Commit Graph

19 Commits

Author SHA1 Message Date
chexit d8d9913770 Issue #126 point 4: same-tick A/B parity and timing record
build / mod (push) Failing after 29s
The temporary in-session shader switch (harness build, reverted) renders the
same frozen tick with both effects.wgsl versions: old-vs-new differs by at
most 1-2/255, no pixel over 5/255, and no more than two frames of the same
shader differ. Frame time is below the in-game noise floor on M5 (32
screen-filling late-life fireballs: +0.37 ms median, sigma 3.6). Includes
the hd_bench polygon_noon run and test counts.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 13:51:13 +03:00
chexit 1a82742744 CPU timeline profile of the battle frame (#147 step 3.1, #126 D/E)
build / mod (push) Failing after 28s
Measure-first profile naming the culprit with data; no worker implemented
(step 3.2 is out of scope). docs/measurements/issue-147-cpu-profile/: README +
report-server.json (default server-thread path) + report-inframe.json
(--in-frame control), M5/Metal 2560x1440 HD, same-recording battle with
overlapping raids + explosions + dense smoke, each run serialized under the
shared flock /tmp/airdef-bench.lock (earlier concurrent runs discarded).

Instrumentation: host per-tick tick_mods spans (ground/world/snapshot/wasm/
models/output/total, HORIZON_MOD_CPU_PROFILE=1, attributed by tick+frame),
mod Sim::step phase timing via an adapter-injected monotonic clock
(game.monotonic-nanos, API level 32; airdef-core stays SDK-free), raid_bench
--scheduler + per-frame span/frame correlation + mod phase delta.

Findings: on the default path the battle frame is GPU-bound (GPU avg 73.7ms ~
frame p95 88ms; 127/128 frames >33ms); the mod path is ~2.5ms/tick, per-frame
p99 7.7ms, 0 frames >25ms, host world answers <0.1ms, model prep ~0.05ms; the
872ms CPU spike is a render/GPU hitch (mod 2.15ms). In-frame is CPU-bound
(CPU p99 175ms); the mod path reaches >25ms in 27 frames, and step_drones
dominates Sim::step (52%, max 47ms/tick), A* only 15%. The schedulers' mod
peaks do not coincide; only the render-dominated catch-up spike is common.

Recommendation: a pure A* route worker and a world-snapshot worker are NOT
justified (A* leads only the tiny default-path mod; world answers never lead).
Default-path peaks are GPU -> steps 1-2 (GPU/geometry) apply, a CPU worker
would not help. If targeting in-frame CPU, the unit is the whole Sim::step
(Wasmtime on its own thread), not a route worker — still not implemented.

Harness fix (engine gitlink 48eff0fcb): control-socket chat/chat-log now reach
the client mod on the server-thread path (chat-box parity), enabling the
required default-path battle measurement; sim rules untouched.

Tests: airdef-core 326 passed/0 failed/8 ignored; airdef-mod 113+1+2+5 passed
incl. same_seed_same_result and combat_trace_is_deterministic;
tools/test_raid_bench.py 11 passed; horizon-mods suite + wasm ABI test ok.

Engine: d073783f5 (spans + clock) + 48eff0fcb (chat harness) on
agent/126-cpu-profile. Parent: 92c058f60 (profiler + driver) + this commit.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 13:35:32 +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
chexit b796a439df Restore the saturated intercept count by uncueing the embedded radar (#145)
build / mod (push) Failing after 31s
The heavy WASM scenario (wasm_flat_budget, 64 integrated complexes vs two
`airdef wave oreshnik 40 2600`) lost intercepts at the tick-2102 checkpoint:
522 (main) -> 302 (#133) -> 243 (#134). Decomposed by A/B on one fixture, one
host (2bcce64), one SDK, each slice built from its own commit:

- 522 -> 302 (#133): Track.vel became an estimate from noisy measured places
  (it was the target's true velocity); the forecast, the aim lead and the
  interceptor's launch Fix all read it. Forcing the class estimate to Unknown
  leaves the count unchanged (native 296 ~= 294), so class/roles is not the
  cause. The pre-#133 522 used the target's true velocity, which the #133
  contract "class and speed only from measurements" forbids; this portion is
  the intentional cost of honest measurement-only tracks and is kept.

- 302 -> 243 (#134): the network cue was extended from the separate engagement
  radar to every fire-quality radar, including each weapon's embedded radar.
  Cueing every relayed contact each tick flooded the embedded fire control with
  one-tick plots whose noisy velocity degraded guidance. Restricting the cue
  back to separate radars recovers the whole drop: 243 -> 325.

- own_fire_within / FIRE_QUALITY / channels are NOT causes here: relaxing the
  own-fire gate or the channel limit each changed nothing (243 -> 243). Embedded
  radars always measure Fire plots of quality >= 64 and have no channel limit.

- #140 does not affect this loadout, by fact: the fixture deploys no separate
  radar, so every profile is embedded with channels = 0; the channel-age bug
  binds only where a profile has channels, and the channels-off A/B was flat.

Fix: the cue looks only through a separate fire-quality radar
(sam.kind == SamKind::Radar); the embedded radar keeps its beam/revisit/lock
acquisition as before #134. All radar profiles, channel limits, own-fire
authority and the measurement-only class/speed contract are preserved; no
target truth is injected.

Measured after the fix (WASM, fuel budget 300M/tick): checkpoint 325 intercepts
/ 2011 hits, fuel max 118M; final (tick 3302, two late Smart raids) 385 / 2472,
fuel max 176M; zero fuel failures. The first late raid reports the #135 recon
flight ("Разведка противника: впереди налёта высланы разведчики"); the second
is silent (recon budget spent) — the fixture now expects exactly that instead
of the stale empty chat that stopped the scenario.

Tests:
- airdef-mod/tests/saturation.rs: deterministic native replica of the checkpoint
  (same sim, host block tracer) asserting the restored count and a regression
  threshold, plus the #140 loadout fact (no separate radar, channels = 0).
- Sim::launch_audit (why.rs): on-demand tolerance diagnostic counting why each
  (system, drone) pair holds fire — no track / stale / no authority / role /
  doctrine / reach / claimed / not ready / not aimed / terrain / ready.
- sensor_tests: a network plot cues a separate fire radar but not the embedded one.
- wasm_flat_budget baselines re-measured with provenance comments; the asserted
  fixture SHA in tools/airdef.py updated.

Verification: `python3 tools/airdef.py test-budgets` passes both stages and the
two late raids (283 steps, fuel failures = 0). airdef-core 292 + 8, mod lib 104,
mod scenarios 5, saturation 2 — all green. A/B record:
docs/measurements/issue-145-intercept-regression.json.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>

Integration note (shipped engine 8e711f969): the tick-2102 checkpoint baseline is
unchanged and passes on the shipped engine (325 intercepts / 2011 hits). The final
stats baseline was re-measured on the shipped engine with #146 integrated (one
knowledge snapshot per Smart order changes the two late raids): 414 / 2463, world
8885 sections / 420671 rays / 3442845 cells. The asserted fixture SHA in
tools/airdef.py was updated to match. python3 tools/airdef.py test-budgets passes
all 283 steps with zero fuel failures (tick max 184608537 / 300000000).
2026-11-21 10:32:11 +03:00
chexit 5f00a2a16b Read replay events by their time ranges, not the whole journal (#150)
The replay's sounds, the raid map's counts and the struck objects now read
the recording's event and scene journals by time instead of every pass over
the whole journal: partition points over the journals (with a stable time
index built at close only when a journal is out of order), the map's kill
and hit prefix indices, each object's first hit, and marker/time-line paths
that stop at the map's shape cap. Blasts, smoke, debris and the fire replay
read bounded windows back from the moment.

The sets, order and names stay exactly as they were: tests compare every
reader against the full journal filter, including tied times, out-of-order
journals and arbitrary forward and back seeks. The replay_bench example
measures a 10-minute raid with nearly full journals (playback, reverse seek,
pause, MP4); its result is docs/measurements/issue-150-replay-ranges.json.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-21 09:52:20 +03:00
chexit 1e2d5dd0c0 Record #126 first stage: retained mod-model meshes, measured
build / mod (push) Failing after 55s
Engine a861c1ed2 (kimi-work-124), based on ed751714e: mod-model faces resolved once per pack generation, frames only transform and light them; motion #124 from the same faces; counters and span; reload/unload invalidate the cache. HD-RENDERER status + section, and docs/measurements/issue-126-first-stage with the A/B method and numbers (M5/Metal, Polygon raid: entity_geometry CPU 5.71 -> 1.57 ms avg, prepare 23.5 -> 7.05 ms; static scene pixel-identical; reload/unload smoke). Not GPU instancing; 5600X/3060 acceptance pending. Issue #126 stays open.

Co-Authored-By: Kimi Code <noreply@moonshot.ai>
2026-11-20 21:46:46 +03:00
chexit e7934a1ebb Give the enemy a structured intent and a durable route queue (#127)
build / mod (push) Failing after 22s
release / windows (push) Failing after 2s
Stage 2 of #127. A smart drone now carries why it is aimed where it is
(Intent: plan, sead, react, replace) apart from the aim bookkeeping
(unit, since, switches, confidence). Assignments are throttled per
adaptive tick and per contact, a fresh disclosure replaces an aim only
after a hold, within a switch cap and when the change is worth a new
route, and a killed aim is replaced as a separate, lower-priority
decision. The queue is bounded and taken by priority (plan > sead >
react > replace); unknown land is no longer free in a replanned route.

The autosave now carries the air state: the drones in flight, the launch
queue, every pending job with its id, aim, unit, version, priority,
intent and relief version, the contacts the jobs were chosen from and
the relief snapshots they plan over. The format is a versioned `air 1`
section; older saves read as before, scenarios do not carry the sky,
stale, ghost and duplicate jobs are cancelled on load, and the section is
bounded (512 drones, 512 route points, 4096 contacts, 8 reliefs, 900 KB).
A periodic save waits while a raid is only being planned.

enemy_picture() now explains targets and pending jobs (aims, aimed_by,
pending_jobs, reason, work_per_tick) in English, and intel_bench records
the queue and intent evidence next to completion, losses and failures.
2026-11-06 18:36:20 +03:00
chexit 8fc10c07a1 Give the enemy a last-observation picture and observed-capability pricing (#127) 2026-11-06 18:00:08 +03:00
chexit 0b645d77e9 Normalize #129 measurements and pair the cold-launch capture
build / mod (push) Failing after 22s
Write both measurement CSVs with LF instead of CRLF so the range no longer
fails `git diff --check` on trailing whitespace; the parsed data is unchanged.

Add a matched before/after capture: one copied world, scenario and seed, the
same client/director and the same export command. The baseline hmod is built
from dc36d67 and the final one from the #129 code. Both launch shots start at
frame 94; the first centre illumination is frame 101 (0.233 s) before and
frame 121 (0.900 s) after, against the 0.25/1.00 s cold rules. Raw probe,
hashes and the measurement method are in issue-129-pair.json. The two MP4s
in docs are CRF26 storage copies; the CRF16 originals stay in the scratch
homes.

These are replay exports, not live footage. The capturing agent still has no
image input, so composition is left for human review; the frames before the
launch are not pixel-identical because these are two live sessions.

Co-Authored-By: Kimi Code <noreply@kimi.com>
2026-11-06 13:35:35 +03:00
chexit 56093b3a55 Record the #129 balance and the cold-launch capture
The stage contract and profiles are in 4b013fb. This commit adds the
measured balance (the #120 grid on identical seeds and the 12-seed raid),
the replay/export video with four stills, and updates the user and handoff
documentation. The visual files are provided for human review; the agent
that captured them has no image input and checked only the encoded
parameters, shot boundaries and the first large plume.

Co-Authored-By: Kimi Code <noreply@kimi.com>
2026-11-06 13:35:35 +03:00
chexit d45629ae29 Fix the UI-event fuel trap on a second large raid order
build / mod (push) Failing after 22s
The Windows log for #122 showed the mod stopping in the UI event
(fuel budget 1e9, remaining 0) with known_units <- order_raid <-
launch_wave <- ui_select: order_raid recomputed the planner snapshot
known_units() for every drone, and the snapshot itself rescanned the
whole force and the dedup list per intel entry. A second big Smart
order cost drones x intel-log x force-size inside one event.

Reproduced in actual WASM with measured per-callback fuel through the
exact ui_select(BTN_LAUNCH) handler (diagnostic guest, trigger.patch):
before, a 111-drone second order at revealed=13172/known=144 exhausted
exactly 1e9 and stopped the mod (an 11-drone order at the same state:
247805865); after, the same scenario passes with max command fuel
32946177/1e9, failures=0, and /stats at tick 2602 byte-identical.
A stacked single-point layout dies to one warhead (known=0, cheap
order), so the scenario deploys spread clusters with a moved player.

Fix: one known_units snapshot per order_raid passed to radar_strikes
and choose_target; known_units is a single O(log + force) set pass;
price_grid_on reuses its snapshot. Emitter/network targeting and
carrier choice semantics are unchanged (native equivalence test
against the former predicate; WASM checkpoint counters equal).
Limits unchanged; HD/recording untouched; wave size unrestricted.

Committed regressions: native snapshot-equivalence and
second-smart-order tests; the heavy WASM fixture now orders two Smart
raids through the wave screen's launch function (airdef preset +
airdef raid) with EW and a combat intel log, four accepted orders
asserted; the light contract covers preset and the empty-wave refusal.

Core release 195 + 8 scenarios; adapter 65 + 1 boundary + 5 scenarios;
light WASM 30 steps; heavy WASM 283 steps (tick max 182413686/300M,
command max 6939810/1e9, failures 0). Windows GUI acceptance remains
external and is not claimed.

Co-Authored-By: Kimi Code (Moonshot AI) <noreply@moonshot.cn>
2026-11-06 10:29:36 +03:00
chexit 46d2274c8d Measure the #120 balance grid across batteries, ranges and target classes
Wider same-seed sampling of the finite-burn/coast change: baseline 2689d93
(pre-#120) against the current tree, 6 variants x 8 seeds of a 46-drone raid
(batt10/20/50, near200, far1500, hills20). Harness-only: Result carries the
tally's fuse/expired/orphaned/energy_lost counts and a new ignored
sim::balance::issue_120_grid test; no simulation parameters changed.

Findings: kills are equal or up and leaks equal or down in every variant;
fuse misses drop (far1500 70 -> 38 over 8 seeds); hills terrain losses fall
(scrubbed 6 -> 2). MotorEnergyLost never fires in the 48 scenarios and
expired stays <= 1: coast ends before drag reaches the 25% guidance
threshold. Leaks stay concentrated in the ballistic/fast classes
(Iskander/Kinzhal/Kh22/Zircon). No confirmed defect, so no tuning.

Full airdef-core suite: 193 + 8 passed, 0 failed (baseline side 169 + 4).

Co-Authored-By: Kimi Code <noreply@moonshot.cn>
2026-11-04 21:03:01 +03:00
chexit 632061d2ad docs: archive clean API29 WASM fuel acceptance
build / mod (push) Failing after 20s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 16:23:22 +03:00
chexit 56339b076e docs: hand off catalog, model, API29 and acoustics continuation
build / mod (push) Failing after 20s
Co-Authored-By: Codex <noreply@openai.com>
2026-11-04 16:21:29 +03:00
chexit d410e2c92d docs: archive the reproduced fuel failure and bounded cache fix
build / mod (push) Failing after 18s
Preserve the diagnostic trigger, scenario, before/after logs and scope of equivalent counters. Update ground strike guidance, Windows acceptance status and profiler semantics.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 11:39:23 +03:00
chexit 10f24b5df8 docs: record verified overlap stress and unresolved Windows report
build / mod (push) Failing after 19s
Keep the corrected historical coverage claim, archive the real flat-world WASM run, explain trap diagnostics and the small HD trail density change.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:54:57 +03:00
chexit 8f5603847e test: pin real render-query fixtures and correct raid coverage claims
build / mod (push) Failing after 18s
Archive the original budget report as insufficient proof of overlapping raids. Pin callback/fuel diagnostics and an opt-in flat render world that services actual guest queries.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:36:45 +03:00
chexit 19c53fda4c docs: record API27 readiness and reverse logistics verification
build / mod (push) Failing after 19s
Document capability milestones, budget limits versus measurements, real-game no-audio observations, reverse pickup reservation and the Windows stale-URL fix.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 10:22:53 +03:00
chexit e70d7a667b docs: describe implemented realism mechanics and verified handoff
build / mod (push) Failing after 18s
Record actual save field positions, motor phases, finite typed delivery, last-known radar contacts and blast-cover policy. Include per-seed baseline measurements and distinguish native/WASM checks from pending GUI acceptance.

Co-authored-by: Codex <codex@openai.com>
2026-11-03 00:07:31 +03:00