Files
SirStone 16c71c527a tools/elm_bench: ring label experiment — the ring label is NOT learnable
Gate question: can a ring-based label (a 2-D offset from the belief centre to
where a ray ring touches the enemy) be predicted from our own belief state?
extract_ring.py + bench_ring.nim answer it by MERGING the ring label into
samples_realistic.ndjson, so the ring label and the incumbent 1-D aim-error
label are scored on the SAME rows, the SAME features and the SAME round-group
folds. 8119 of 8676 DrussGT shot rows get a ring label.

Verdict: worse, not richer.

  * The spike's headline is an artifact. The belief is already accurate to
    under 3 px, so a belief-anchored ring touches the enemy on its FIRST ray
    step: ringK = 1.0000 for all 172723 extracted events. The "100% at power
    <= 1.5, 0.2% at power 3.0" pattern is just whether 1 * bulletSpeed fits
    inside the +-18 px belief-error ball. The literal ring label is the 1-tick
    belief extrapolation error, clipped to BotRadius.
  * Same-tick it scores better than the 1-D label (ELM/const 0.2628 vs 0.3629)
    but a single feature, beliefTgtLatVel, already gets -71.8 of the -73.7
    points: the model is re-deriving beliefTgtLatVel * age / beliefDist, i.e.
    its own inputs.
  * Under --prev it collapses to ratio 0.9819 (-1.8%). It depends MORE on the
    same-tick assumption than the 1-D label (-63.7% -> -1.0%), not less.
  * Repaired (--kintercept: k = round(believed range / bullet speed), mean k 42,
    no clipping, 60 px spread) the label is well posed and completely
    unpredictable: best feature +0.5%, best ELM -0.4%, best |corr| 0.09.

So: the belief-extrapolation error at intercept time is not a function of what
we believed, it is the opponent's unmodelled acceleration. Do not ship a ring
label. common_libs/guns/waveelm.nim is the right shape for the same idea and
is a different thing: it fires the ring from the SHOOTER, so the ring measures
an interception radius and bearing and the ELM learns a bias correction to it.
2026-10-05 22:59:41 +02:00

109 lines
6.4 KiB
Plaintext

== dataset: ring_ki.ndjson.merged ==
n = 8020 groups = 40 k mean = 42.22
== label distribution (rad, same units for both) ==
ring mean -0.00209 sd 0.14282 |p1| 0.37041 |p50| 0.00070 |p90| 0.17191 max|.| 0.63946
1-D aim mean +0.11160 sd 1.16585 |p1| 2.90010 |p50| 0.00658 |p90| 1.80194 max|.| 3.14139
########## LABEL = label (RING lateral aim correction) ##########
== (a) constant baseline, 5-fold by round-group ==
constant per-fold 0.1423 +- 0.0061 pooled RMSE/MAE/medAE 0.1429/0.1111/0.0876
== (B) ridge feature ablation (pooled held-out) ==
feature set | RMSE MAE medAE | per-fold RMSE +- sd | vs const
baseline 6 (belief geometry) | 0.1423 0.1107 0.0873 | 0.1416 +- 0.0065 | -0.0006
+ scan age | 0.1423 0.1107 0.0874 | 0.1416 +- 0.0065 | -0.0006
+ believed intercept geom | 0.1424 0.1108 0.0882 | 0.1417 +- 0.0066 | -0.0004
+ our own state | 0.1424 0.1107 0.0874 | 0.1417 +- 0.0065 | -0.0005
+ context | 0.1424 0.1107 0.0872 | 0.1417 +- 0.0066 | -0.0005
+ scan + intercept | 0.1425 0.1108 0.0879 | 0.1418 +- 0.0065 | -0.0004
ALL 21 | 0.1426 0.1109 0.0879 | 0.1419 +- 0.0065 | -0.0002
-- single-feature ridge (held-out, sorted) --
cosRel RMSE 0.14215 (const 0.14287, gain +0.50%)
dist RMSE 0.14228 (const 0.14287, gain +0.41%)
losRate RMSE 0.14229 (const 0.14287, gain +0.41%)
scanAge RMSE 0.14230 (const 0.14287, gain +0.40%)
logScan RMSE 0.14230 (const 0.14287, gain +0.40%)
everScanned RMSE 0.14230 (const 0.14287, gain +0.40%)
scanGap RMSE 0.14230 (const 0.14287, gain +0.40%)
disp RMSE 0.14230 (const 0.14287, gain +0.40%)
gunHeat RMSE 0.14230 (const 0.14287, gain +0.40%)
sinPred RMSE 0.14230 (const 0.14287, gain +0.40%)
tgtLatVel RMSE 0.14231 (const 0.14287, gain +0.39%)
tgtSpeed RMSE 0.14231 (const 0.14287, gain +0.39%)
cosPred RMSE 0.14231 (const 0.14287, gain +0.39%)
closing RMSE 0.14231 (const 0.14287, gain +0.39%)
sinRel RMSE 0.14231 (const 0.14287, gain +0.39%)
predErr RMSE 0.14232 (const 0.14287, gain +0.38%)
power RMSE 0.14233 (const 0.14287, gain +0.38%)
ownSpeed RMSE 0.14238 (const 0.14287, gain +0.34%)
tof RMSE 0.14240 (const 0.14287, gain +0.33%)
== (C) ELM sweep H{16,32,64,128} x lambda{1e-6..1e2}, decay=1.0 (20 cfg x 5 folds) ==
5/20 configs, 2.s
10/20 configs, 5.s
15/20 configs, 9.s
20/20 configs, 19.s
top 6 (ALL 21 features), per-fold RMSE | mean
H= 128 lam= 1.e+00 | 0.1437 0.1421 0.1499 0.1426 0.1295 | mean 0.14158 (-0.9% vs const)
H= 128 lam= 1.e+02 | 0.1435 0.1425 0.1503 0.1422 0.1302 | mean 0.14176 (-0.8% vs const)
H= 64 lam= 1.e+00 | 0.1436 0.1427 0.1501 0.1423 0.1301 | mean 0.14178 (-0.8% vs const)
H= 32 lam= 1.e+00 | 0.1438 0.1429 0.1504 0.1421 0.1299 | mean 0.14180 (-0.7% vs const)
H= 32 lam= 1.e-02 | 0.1442 0.1429 0.1504 0.1420 0.1303 | mean 0.14194 (-0.6% vs const)
H= 32 lam= 1.e-04 | 0.1442 0.1429 0.1504 0.1420 0.1303 | mean 0.14195 (-0.6% vs const)
BEST H=128 lam=1.e+00: pooled RMSE/MAE/medAE 0.14224/0.11042/0.08885 delta-vs-const -0.00072 (better on 4/5)
ELM/const pooled RMSE ratio 0.9956
########## LABEL = label1d (incumbent 1-D aim error) ##########
== (a) constant baseline, 5-fold by round-group ==
constant per-fold 1.1589 +- 0.0386 pooled RMSE/MAE/medAE 1.1661/0.8208/0.4633
== (B) ridge feature ablation (pooled held-out) ==
feature set | RMSE MAE medAE | per-fold RMSE +- sd | vs const
baseline 6 (belief geometry) | 1.1651 0.8186 0.4783 | 1.1578 +- 0.0390 | -0.0009
+ scan age | 0.9460 0.6389 0.3752 | 0.9443 +- 0.0246 | -0.2201
+ believed intercept geom | 0.4415 0.1713 0.1094 | 0.4394 +- 0.0463 | -0.7245
+ our own state | 0.9464 0.6394 0.3738 | 0.9448 +- 0.0242 | -0.2197
+ context | 0.9460 0.6390 0.3735 | 0.9444 +- 0.0258 | -0.2201
+ scan + intercept | 0.4415 0.1713 0.1098 | 0.4394 +- 0.0463 | -0.7245
ALL 21 | 0.4419 0.1721 0.1107 | 0.4399 +- 0.0463 | -0.7242
-- single-feature ridge (held-out, sorted) --
predErr RMSE 0.44207 (const 1.16605, gain +62.09%)
tgtLatVel RMSE 0.94572 (const 1.16605, gain +18.90%)
closing RMSE 1.15006 (const 1.16605, gain +1.37%)
tof RMSE 1.15790 (const 1.16605, gain +0.70%)
power RMSE 1.15838 (const 1.16605, gain +0.66%)
tgtSpeed RMSE 1.15871 (const 1.16605, gain +0.63%)
gunHeat RMSE 1.15887 (const 1.16605, gain +0.62%)
disp RMSE 1.15888 (const 1.16605, gain +0.62%)
scanAge RMSE 1.15889 (const 1.16605, gain +0.61%)
logScan RMSE 1.15889 (const 1.16605, gain +0.61%)
everScanned RMSE 1.15889 (const 1.16605, gain +0.61%)
scanGap RMSE 1.15889 (const 1.16605, gain +0.61%)
dist RMSE 1.15889 (const 1.16605, gain +0.61%)
sinRel RMSE 1.15892 (const 1.16605, gain +0.61%)
cosRel RMSE 1.15933 (const 1.16605, gain +0.58%)
sinPred RMSE 1.15934 (const 1.16605, gain +0.58%)
ownSpeed RMSE 1.15943 (const 1.16605, gain +0.57%)
cosPred RMSE 1.17038 (const 1.16605, gain -0.37%)
losRate RMSE 1.41676 (const 1.16605, gain -21.50%)
== (C) ELM sweep H{16,32,64,128} x lambda{1e-6..1e2}, decay=1.0 (20 cfg x 5 folds) ==
5/20 configs, 2.s
10/20 configs, 5.s
15/20 configs, 9.s
20/20 configs, 19.s
top 6 (ALL 21 features), per-fold RMSE | mean
H= 128 lam= 1.e-02 | 0.3682 0.4847 0.4027 0.4101 0.4441 | mean 0.42195 (-63.8% vs const)
H= 128 lam= 1.e-04 | 0.3696 0.4854 0.4050 0.4099 0.4454 | mean 0.42308 (-63.7% vs const)
H= 128 lam= 1.e-06 | 0.3696 0.4854 0.4051 0.4100 0.4454 | mean 0.42310 (-63.7% vs const)
H= 128 lam= 1.e+00 | 0.3694 0.5002 0.4082 0.4235 0.4455 | mean 0.42936 (-63.2% vs const)
H= 64 lam= 1.e-02 | 0.3775 0.5071 0.4259 0.4227 0.4473 | mean 0.43611 (-62.6% vs const)
H= 64 lam= 1.e-04 | 0.3782 0.5068 0.4261 0.4224 0.4473 | mean 0.43617 (-62.6% vs const)
BEST H=128 lam=1.e-02: pooled RMSE/MAE/medAE 0.42349/0.18269/0.11082 delta-vs-const -0.73693 (better on 5/5)
ELM/const pooled RMSE ratio 0.3632