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_prev.ndjson.merged ==
n = 8411 groups = 40 k mean = 1.03
== label distribution (rad, same units for both) ==
ring mean -0.00064 sd 0.01341 |p1| 0.03532 |p50| 0.00025 |p90| 0.01636 max|.| 0.05561
1-D aim mean +0.11759 sd 1.16371 |p1| 2.90073 |p50| 0.01136 |p90| 1.80628 max|.| 3.14139
########## LABEL = label (RING lateral aim correction) ##########
== (a) constant baseline, 5-fold by round-group ==
constant per-fold 0.0134 +- 0.0003 pooled RMSE/MAE/medAE 0.0134/0.0106/0.0090
== (B) ridge feature ablation (pooled held-out) ==
feature set | RMSE MAE medAE | per-fold RMSE +- sd | vs const
baseline 6 (belief geometry) | 0.0134 0.0106 0.0090 | 0.0134 +- 0.0003 | -0.0000
+ scan age | 0.0133 0.0104 0.0088 | 0.0133 +- 0.0002 | -0.0001
+ believed intercept geom | 0.0133 0.0104 0.0088 | 0.0133 +- 0.0002 | -0.0002
+ our own state | 0.0133 0.0104 0.0088 | 0.0133 +- 0.0003 | -0.0001
+ context | 0.0133 0.0104 0.0087 | 0.0133 +- 0.0003 | -0.0001
+ scan + intercept | 0.0133 0.0104 0.0087 | 0.0133 +- 0.0002 | -0.0002
ALL 21 | 0.0133 0.0104 0.0088 | 0.0133 +- 0.0003 | -0.0001
-- single-feature ridge (held-out, sorted) --
tgtLatVel RMSE 0.01327 (const 0.01341, gain +1.04%)
predErr RMSE 0.01336 (const 0.01341, gain +0.36%)
losRate RMSE 0.01339 (const 0.01341, gain +0.14%)
tgtSpeed RMSE 0.01340 (const 0.01341, gain +0.13%)
tof RMSE 0.01341 (const 0.01341, gain +0.03%)
closing RMSE 0.01341 (const 0.01341, gain +0.03%)
dist RMSE 0.01341 (const 0.01341, gain +0.03%)
scanAge RMSE 0.01341 (const 0.01341, gain +0.03%)
logScan RMSE 0.01341 (const 0.01341, gain +0.03%)
everScanned RMSE 0.01341 (const 0.01341, gain +0.03%)
gunHeat RMSE 0.01341 (const 0.01341, gain +0.03%)
disp RMSE 0.01341 (const 0.01341, gain +0.03%)
sinRel RMSE 0.01341 (const 0.01341, gain +0.03%)
ownSpeed RMSE 0.01341 (const 0.01341, gain +0.03%)
cosRel RMSE 0.01341 (const 0.01341, gain +0.03%)
power RMSE 0.01341 (const 0.01341, gain +0.03%)
sinPred RMSE 0.01341 (const 0.01341, gain +0.03%)
scanGap RMSE 0.01341 (const 0.01341, gain +0.02%)
cosPred RMSE 0.01341 (const 0.01341, gain -0.00%)
== (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, 10.s
20/20 configs, 21.s
top 6 (ALL 21 features), per-fold RMSE | mean
H= 128 lam= 1.e+00 | 0.0131 0.0130 0.0135 0.0134 0.0128 | mean 0.01317 (-1.8% vs const)
H= 64 lam= 1.e+00 | 0.0131 0.0130 0.0135 0.0134 0.0128 | mean 0.01318 (-1.8% vs const)
H= 128 lam= 1.e-02 | 0.0132 0.0131 0.0136 0.0134 0.0128 | mean 0.01320 (-1.6% vs const)
H= 64 lam= 1.e-02 | 0.0132 0.0131 0.0136 0.0134 0.0128 | mean 0.01320 (-1.6% vs const)
H= 64 lam= 1.e-04 | 0.0132 0.0131 0.0136 0.0134 0.0128 | mean 0.01320 (-1.6% vs const)
H= 64 lam= 1.e-06 | 0.0132 0.0131 0.0136 0.0134 0.0128 | mean 0.01321 (-1.6% vs const)
BEST H=128 lam=1.e+00: pooled RMSE/MAE/medAE 0.01317/0.01033/0.00882 delta-vs-const -0.00024 (better on 5/5)
ELM/const pooled RMSE ratio 0.9819
########## LABEL = label1d (incumbent 1-D aim error) ##########
== (a) constant baseline, 5-fold by round-group ==
constant per-fold 1.1576 +- 0.0352 pooled RMSE/MAE/medAE 1.1638/0.8169/0.4553
== (B) ridge feature ablation (pooled held-out) ==
feature set | RMSE MAE medAE | per-fold RMSE +- sd | vs const
baseline 6 (belief geometry) | 1.1622 0.8133 0.4719 | 1.1560 +- 0.0349 | -0.0016
+ scan age | 1.1601 0.8104 0.4646 | 1.1541 +- 0.0343 | -0.0037
+ believed intercept geom | 1.1561 0.8027 0.4487 | 1.1502 +- 0.0338 | -0.0078
+ our own state | 1.1609 0.8120 0.4677 | 1.1547 +- 0.0351 | -0.0030
+ context | 1.1598 0.8117 0.4698 | 1.1537 +- 0.0346 | -0.0040
+ scan + intercept | 1.1556 0.8041 0.4550 | 1.1496 +- 0.0340 | -0.0082
ALL 21 | 1.1561 0.8067 0.4596 | 1.1500 +- 0.0353 | -0.0077
-- single-feature ridge (held-out, sorted) --
predErr RMSE 1.15086 (const 1.16384, gain +1.12%)
tgtLatVel RMSE 1.15522 (const 1.16384, gain +0.74%)
tof RMSE 1.15616 (const 1.16384, gain +0.66%)
closing RMSE 1.15625 (const 1.16384, gain +0.65%)
power RMSE 1.15698 (const 1.16384, gain +0.59%)
tgtSpeed RMSE 1.15709 (const 1.16384, gain +0.58%)
losRate RMSE 1.15734 (const 1.16384, gain +0.56%)
sinPred RMSE 1.15753 (const 1.16384, gain +0.54%)
gunHeat RMSE 1.15757 (const 1.16384, gain +0.54%)
sinRel RMSE 1.15758 (const 1.16384, gain +0.54%)
disp RMSE 1.15758 (const 1.16384, gain +0.54%)
scanAge RMSE 1.15759 (const 1.16384, gain +0.54%)
everScanned RMSE 1.15759 (const 1.16384, gain +0.54%)
logScan RMSE 1.15759 (const 1.16384, gain +0.54%)
dist RMSE 1.15760 (const 1.16384, gain +0.54%)
scanGap RMSE 1.15760 (const 1.16384, gain +0.54%)
cosRel RMSE 1.15782 (const 1.16384, gain +0.52%)
cosPred RMSE 1.15803 (const 1.16384, gain +0.50%)
ownSpeed RMSE 1.15810 (const 1.16384, gain +0.49%)
== (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, 10.s
20/20 configs, 20.s
top 6 (ALL 21 features), per-fold RMSE | mean
H= 128 lam= 1.e+00 | 1.1647 1.1678 1.1786 1.0850 1.1345 | mean 1.14613 (-1.5% vs const)
H= 64 lam= 1.e+00 | 1.1621 1.1688 1.1798 1.0857 1.1345 | mean 1.14621 (-1.5% vs const)
H= 128 lam= 1.e-02 | 1.1618 1.1706 1.1843 1.0842 1.1309 | mean 1.14637 (-1.5% vs const)
H= 64 lam= 1.e-02 | 1.1632 1.1667 1.1855 1.0863 1.1346 | mean 1.14722 (-1.4% vs const)
H= 64 lam= 1.e-04 | 1.1631 1.1668 1.1861 1.0864 1.1354 | mean 1.14756 (-1.4% vs const)
H= 64 lam= 1.e-06 | 1.1631 1.1668 1.1861 1.0864 1.1354 | mean 1.14756 (-1.4% vs const)
BEST H=128 lam=1.e+00: pooled RMSE/MAE/medAE 1.15207/0.80368/0.46343 delta-vs-const -0.01146 (better on 5/5)
ELM/const pooled RMSE ratio 0.9899