j177: aim capture - log what the model BELIEVED, not what it did
j176 could not attribute the 11.9 deg aim error at 450+ px: the corpus had
no gun id and no bot-side belief, so staleness was an inverse (unidentifiable)
problem and a good gun was indistinguishable from a bad one. Both are cheap to
log and impossible to recover later.
New default-off knob TR_CAPTURE_AIM (presence-only). It appends TWO record
kinds to the EXISTING TR_RECORD_WORLDSTATE file:
aim_scan - one per onScannedBot, written BEFORE the tracker update, so it is
the pre-update belief by construction: tick, raw scanned values
(ex,ey,eh,es,ee), our own state (sx,sy,sh,ss), the gun in force, the
PREVIOUS belief (bx,by,bh,bs,blst), the scan parity age = tick - blst,
and the radar-lock context (rlock, rdir, lbear, boff).
aim_fire - one per real shot: gun, power, the aim angle handed to setFire,
the turret angle and the signed turret error, gunHeat, the predicted
intercept (ax,ay) and implied TOF, and the exact WorldState the predictor
consumed (ex,ey,eh,es,ee,sx,sy) with the tick it came from (lst).
Row builders live in a new pure module src/aim_capture.nim - no bot API, no
env reads - so the offline guard test and the live bot go through the SAME
builders and a field the test proves present is a field the bot writes.
Per-tick world-state rows also gain a `gun` id. offline_range.nim skips
aim_* lines (they carry no `ex`), so the annotations are inert to the replay.
No aim model changed.
Knob registered in env_report.nim (context field, effective-value emit) and
knownEnvNames(); documented in .env.example. Defaults OFF, diagnostic only,
never live-tested.
Verification (no battle, no Java, no server, no GUI):
- default parity: per-gun shots/hits over 20026 ticks of
tr_drussgt_vs_modularbot.jsonl byte-for-byte identical to the golden
generated from the PRE-CHANGE tree (git archive 55e92bc); the golden was
regenerated from that pre-change tree and re-diffed, so it is not
self-referential. Boot [env] block of the pre- and post-change binaries is
identical except pid/cmdline/build line and the new knob's own line.
- test_aim_capture: ALL PASS (every aim_scan/aim_fire key present, plus the
annotation-inertness replay).
- guards: test_tfil_commit_env 159/0, test_env_report 25/0,
test_tfil_ring_weights 24/0, test_vbullet_draw 30/0.
- .env.example round-trip (env_report via the j172 harness): 210 effective
values + 70 [x]/[modules] lines, 0 diffs, 0 dropped keys, 0 warnings.
- clean `git archive HEAD` + nim c -d:release: [SuccessX].
This commit is contained in:
@@ -153,6 +153,7 @@
|
||||
# TR_SURF_LOG one line per wave-surfing decision
|
||||
# TR_FIRE_DIAG per-reading fire-detection tick/raw/correction
|
||||
# TR_RECORD_WORLDSTATE dump every observed world state to JSONL
|
||||
# TR_CAPTURE_AIM aim_scan/aim_fire records (gun id + bot belief)
|
||||
# TR_RADAR_SCANLOG log every radar scan tick
|
||||
# TR_RADAR_FORCE_SPIN force the old full-360 spin radar
|
||||
# TR_TRACKER_PROBE dump the enemy-tracker internals
|
||||
@@ -737,6 +738,24 @@ GUN_STATS_PATH=/tmp/gun_stats.jsonl # where the per-round gun stats are writte
|
||||
GUN_SHOTLOG_PATH=/tmp/shot_log.jsonl # where the per-shot log is written
|
||||
|
||||
# ── measurement helpers (leave off unless you are measuring) ─────────────────
|
||||
# WHAT: aim capture. Adds TWO record kinds to the TR_RECORD_WORLDSTATE file:
|
||||
# aim_scan — one per radar scan: the raw reading, our own state, the gun
|
||||
# that fired, the PREVIOUS tracker belief, and the scan parity
|
||||
# (age = tick - previous lastSeenTick);
|
||||
# aim_fire — one per real shot: gun, power, the aim angle, the turret error,
|
||||
# gun heat, the predicted intercept/TOF, and the exact WorldState the
|
||||
# predictor consumed (with the tick it came from). It also adds the `gun`
|
||||
# id to the per-tick world-state rows.
|
||||
# VALUES: presence-only, like the other keys in this block. Unset = off.
|
||||
# STATUS: default-off, diagnostic only, never live-tested. j176 could not
|
||||
# attribute the 11.9 deg aim error because the corpus had no gun id and no
|
||||
# bot-side belief; this knob makes both a lookup instead of an inverse
|
||||
# problem. No aim model changed with it.
|
||||
# GOTCHA: it only writes when TR_RECORD_WORLDSTATE is on as well, and it makes
|
||||
# the capture file bigger, not different: the extra lines are annotations and
|
||||
# the offline replay skips them.
|
||||
# TRY: TR_RECORD_WORLDSTATE=1 TR_CAPTURE_AIM=1 ./out/ModularBot
|
||||
#TR_CAPTURE_AIM=1 # PRESENCE-only: aim_scan / aim_fire records (needs TR_RECORD_WORLDSTATE)
|
||||
#TR_RECORD_WORLDSTATE=1 # PRESENCE-only: dump every observed world state
|
||||
#TR_RADAR_SCANLOG=1 # PRESENCE-only: log every radar scan tick
|
||||
#TR_TRACKER_PROBE=1 # PRESENCE-only: dump the enemy-tracker's internal state
|
||||
|
||||
Reference in New Issue
Block a user