Commit Graph

2 Commits

Author SHA1 Message Date
chexit 92c058f606 Sim::step phase timing and the CPU-profile bench driver (#147 step 3.1)
Mod side: Sim::step times plan_step, adapt, step_drones, step_moves,
update_sight, step_sams and record, plus the whole step and its untimed
remainder, through sim::profile. The simulation stays SDK-independent (also
built as airdef-core): the adapter installs the host monotonic clock
(game.monotonic-nanos) in init, native tests use std::time::Instant. The
counters are fixed-size, per-thread, read no randomness and change no
decision; /airdef stats reports them as PROFILE chat lines, reset per world.

Driver: raid_bench gains --scheduler in-frame|server-thread (the two
single-player paths, measured separately), HORIZON_MOD_CPU_PROFILE=1, the
per-tick mod-path spans joined to the frame trace (per-frame totals, >25/33 ms
counts, what the worst CPU frames carry), and the mod phase profile read at
idle and battle end with the battle delta. report.json carries mod_cpu,
mod_cpu_ticks, mod_phases_* and the derived correlation. Tests for the new
helpers.

Engine gitlink: mod-path CPU spans + game.monotonic-nanos (API level 32).

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 12:29:22 +03:00
chexit c08b737296 Reproducible raid/replay render bench and #147 instancing measurements
build / mod (push) Failing after 32s
tools/raid_bench.py (+ tests): the #147 step-0 driver replaces the #126
scratch script. One battle at fixed ticks (waves inside resident terrain —
far waves stall at the unknown-chunk edge and no fight happens), fingerprint
chat lines at control ticks, then the raid's own recording replayed. Both
render paths are benched on the SAME recording in ONE process via the
engine's diagnostic `model-instancing off|on` toggle (cross-process battles
diverge in event timing: 16 vs 32 kills at one control tick), pairs in
alternating order; idle cold/warm, mid-battle window, reload (F3+T), replay
seek, away-camera checks, and static off/on stills for pixel parity
(hd_bench motion-mask methodology). report.json carries gitlinks, device,
mod_models counters, CPU/GPU p50/p95/p99/max, raw frame times, >25/33 ms
frame counts, guest fuel and streaming queues.

Engine gitlink: one mass mod-model group GPU-instanced (retained mesh per
pack generation, current/previous pose/id/light instance stream shared by
main, motion and shadow passes, per-vertex fallback to parity, runtime
diagnostic toggle, stats raw + guest fuel reporting).

Measurements: docs/measurements/issue-147-instancing/ (M5/Metal, 2560x1440;
RTX 3060 pending). docs/REPO-MAP.md and docs/ENGINE.md pin updated.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 11:39:43 +03:00