Skip to content
hikari
RenderingEditorAIToolchainDocumentation
Download

© 2026 Flying Rat Studio.
All rights reserved.

Explore the engineDocumentationContributorsDownloadLicenseBack to top
Documentation / Overview
Browse docs
Overview
Tutorials17
OverviewPlay, Edit, and scenesFirst UI documentFirst game projectFirst entityComponent properties and the inspectorFirst mesh and materialFirst physics body and triggerFirst character controllerFirst session servicesFirst UIFirst input actionFirst messagesFirst runtime spawnFirst motionFirst skeletal animationAssets in Play (soft refs and hot reload)Dynamic editor recompile
Guides25
OverviewWorking in the editorDevelopment guideGameplay APIActor and component lifecycleThreads, jobs, events, and routinesGameplay AI tasksGame AI: perception and movement playgroundBrain assetsBrain execution for swarm populationsLocalizationGame cursorsChoosing component storageBuild and packagingProject filePluginsHikari Plugin APIData-driven content, JSON, and pathsScripting with KawaShader authoringChoosing and scaling shadowsTime of dayUser interfaceUI layoutUI widgetsMigration from Unity / Unreal
Systems32
OverviewArchitectureApplication lifecycleFrontends and driversPlatforms and supportSession services and cross-scene stateScenes and gameplayActor communication (hi.actors)Game-facing refsSave / replication wire versionCoordinate space and camera conventionsRenderingRenderer architecture mapFrame governorPipeline compilationSkeletal animationGPU particlesVisual ZonesVolumetric mediaInputAudioPhysicsMotion KitTemporal KitUI documentsAssets and ShinraPrefabsAsset residencyAsset formats (Shinra pipeline)Document schemasUI and editorEditor asset hot reloadEditor Project Selector
Language reference3
OverviewAkari GPU ABIAkari language referenceKawa language reference
Engine overview
Start exploring
  • No matching sections. Try fewer words or another topic.
NavigateEnter Openesc Close
Overview
Tutorials17
OverviewPlay, Edit, and scenesFirst UI documentFirst game projectFirst entityComponent properties and the inspectorFirst mesh and materialFirst physics body and triggerFirst character controllerFirst session servicesFirst UIFirst input actionFirst messagesFirst runtime spawnFirst motionFirst skeletal animationAssets in Play (soft refs and hot reload)Dynamic editor recompile
Guides25
OverviewWorking in the editorDevelopment guideGameplay APIActor and component lifecycleThreads, jobs, events, and routinesGameplay AI tasksGame AI: perception and movement playgroundBrain assetsBrain execution for swarm populationsLocalizationGame cursorsChoosing component storageBuild and packagingProject filePluginsHikari Plugin APIData-driven content, JSON, and pathsScripting with KawaShader authoringChoosing and scaling shadowsTime of dayUser interfaceUI layoutUI widgetsMigration from Unity / Unreal
Systems32
OverviewArchitectureApplication lifecycleFrontends and driversPlatforms and supportSession services and cross-scene stateScenes and gameplayActor communication (hi.actors)Game-facing refsSave / replication wire versionCoordinate space and camera conventionsRenderingRenderer architecture mapFrame governorPipeline compilationSkeletal animationGPU particlesVisual ZonesVolumetric mediaInputAudioPhysicsMotion KitTemporal KitUI documentsAssets and ShinraPrefabsAsset residencyAsset formats (Shinra pipeline)Document schemasUI and editorEditor asset hot reloadEditor Project Selector
Language reference3
OverviewAkari GPU ABIAkari language referenceKawa language reference
Engine overview
Overview3 min read

Shared AI perception benchmark

On this page
On this pageReproduceService CPU costSimulated sensing latency and coverageScope and limits Back to top

Measured 2026-09-07 on Apple M5 Max, macOS 26.6.2, Zig 0.16.0, ReleaseFast.

Reproduce

From src/hikari:

sh
zig build ai-perception-bench -Dgame-src=../../../hikari-games/example/src -Doptimize=fast --summary all

The table reports the median of three consecutive runs for mean and p95 CPU time. Each run uses 600 frames of simulated 60 Hz time per population/budget pair. There is no real-time pacing or discarded warm-up interval. Compilation is outside the timed region. The executable emits one JSON line per case. Run-to-run variation is expected; these measurements are not a performance gate.

Service CPU cost

ObserversBudget (steps/rays)Mean µsp95 µs
10128/322.002.08
101024/10242.002.13
100128/3213.1913.83
1001024/102420.0823.33
1,000128/32102.31120.00
1,0001024/1024209.63225.96

Simulated sensing latency and coverage

These values were identical across the three runs. First detection is the latest first positive observation among all observers. Service gap is the largest interval between consecutive observer publications, measured by the callback. It is distinct from the time needed to revisit every target.

ObserversBudgetWorst first detection, msMax service gap, msOldest cached check, msMin publications/observerTotal queries
10Normal16.6716.67116.676006,000
10High16.6716.67116.676006,000
100Normal66.6766.67400.0019219,200
100High16.6716.67116.6760060,000
1,000Normal533.33533.334,150.001919,200
1,000High16.6716.67116.67600600,000

At 1,000 observers, Normal spends about 0.10 ms per service tick here, but first detection can take 0.53 seconds and individual cached checks reach 4.15 seconds old. High spends about 0.21 ms and services each observer every simulated frame. A 10 Hz nominal cycle is therefore a requested cadence, not a guarantee under a smaller budget. Guards stop treating unchecked observations as visible after 0.25 seconds; remembered positions expire separately.

Scope and limits

  • Eight targets move on deterministic sine paths. Observer positions and orientations are fixed, with 40 m range and an 80° half-angle. These settings deliberately differ from the interactive scene to keep the benchmark cohort in sensing range.
  • The timed call includes copied snapshot synchronization, sorting, spatial indexing, memory maintenance, candidate selection, analytic occlusion, and publication into benchmark counters. Target motion preparation and timing aggregation are outside the interval.
  • Occlusion is a single analytic XZ box. It does not exercise Tenkai queries, actor-field gathering, World event dispatch, navigation, character motors, physics simulation, or rendering. These numbers do not establish a full 1,000-actor game frame budget.
  • Service(1024, 64, 8) occupies 933,480 bytes, including both observer buffers and fixed scratch storage. It allocates once before the benchmark; service ticks do not allocate.
  • Every frame checks both work caps. Every observer must receive a publication and a positive detection before the run ends. Separate unit tests verify candidate continuation, removal/generation/epoch handling, pause, capacity validation, and bounded memory.
  • Use the in-game AI Perception panel for real query counts, deferred work, and adapter CPU time. Added load observers are stationary sensors; the two authored guards retain movement.

See the game AI guide for controls and lifecycle semantics.

PreviousRoutine scheduler benchmarkNext Swarm Brain benchmark

Documentation follows the current engine checkout.

Snapshot 86f12d68Source docs/reports/ai-perception-benchmark.md
On this pageReproduceService CPU costSimulated sensing latency and coverageScope and limits Back to top