Proposal #2 (active-dodge commit lock), milder half only: while a tracked
bullet is within LockRadiusTiles (15 x 36px), suppress the tile-crossing
replan so the committed dodge direction survives the crossing. The 15-tick
dwell and the danger safety valve still apply.
A hard freeze until the bullet passed (no dwell expiry) was measured and
reverted: the bot parked on the committed tile and absorbed the shot
(damage taken/round 26.8 -> 53.9 over 12 opponents x 20 rounds).
Measured on 12 opponents x 40 rounds (RawRecord, verified CONTIGUOUS):
damage taken/round 30.8 -> 25.5, damage dealt/round 73.2 -> 72.1,
rounds won 358/480 -> 360/480.
Raising CommitTicks 15 -> 25 (proposal #3) measured harmful and was reverted.
Proposal #1 (speculative bullet on 'could fire') not implemented: TFIL already
spawns a tracked bullet from the same-tick energy drop, and speculation would
be a ~70% false-positive flood.
Cap dead-reckoning lead at MaxDeadReckonTicks (freeze at the last scan past
it) and return (0,0) from targetVelocity when the two scans it averages span
more than MaxVelGap ticks. computeGun now uses gunAimErrorDeg.
predictAim folded the learned correction into the bearing and derived x/y
once instead of recomputing them per branch. New gunAimErrorDeg carries the
degree unit in its name so the FireSlopDeg comparison cannot fall back to the
old degrees-vs-radians mix-up; test_online.nim adds a regression block for it.
Replace the aim-error-ELM section with the movement-prediction gun: the
true-impact label and its centred distribution, the 32-D features, held-out
training (ELM -27.8% RMSE vs plain intercept, output mean -0.36 deg), the
|correction|>0.10 gate (61.4% open), and 20-round RawRecord results showing
damage/round up against DrussGT, CassiusClay, Komarious and Phoenix.
Rewrite elm_features.nim as a 32-D enemy-motion vector (7 scan-to-scan
displacement legs, speed stats, heading/turn/curvature, plus the single-frame
geometry). Add a WinCap=8 scan buffer to radar.nim and feed it through
buildBelief. elm_gun.nim now uses the physical bullet speed for the feature
(was the power*10 corpus artifact) and applies the trained correction only when
|correction| > GATE_TAU; below it the gun keeps the exact geometric aim. Retrain
and export weights (H=256, gate_tau=0.1).
Add extract_predict.py, which builds the movement-prediction corpus: for each
sampled tick with the shooter fixed to DevControlBot (power 2), the label is
wrap(trueImpactBearing - geometricInterceptBearing), solved against the
observer's true trajectory. Unlike the old opponent-aim-error label this is
centred near zero (mean -0.33 deg, sd 18.3 deg).
Add train_predict.nim: round-group 5-fold evaluation, baselines (plain
intercept / constant), small H x lambda sweep, prediction-mean centring check,
and a |correction|>tau gate calibrated on held-out folds, then export.
Delete the old train_elm_gun.nim (it wrote the live weights from the old label)
and mark extract_realistic.py deprecated.
The salvage dir (rescued from /tmp on 2026-08-04) is fully superseded by the
canonical legacy_bots/ tree: all 28 jars are byte-identical duplicates, the
tr_wrappers still hardcode dead /tmp paths, and portaudit/ was one-off analysis
of a /tmp tree that no longer exists. The shim, vendor/, booter and legacy_bots/
are untouched.
DrussGT now lives at legacy_bots/DrussGT/{DrussGT.jar,DrussGT.sh,DrussGT.json}
like the other legacy bots. Its jar is committed and recorded in
MANIFEST.sha256 (sha256 5dfc0595...). tr_bots/DrussGT is kept as a
compatibility symlink to ../legacy_bots/DrussGT for in-flight jobs.
The vendored copy under tools/robocode_shim/vendor/drussgt/ is untouched.
Wrapper dirs (Name.sh + Name.json) referencing the prebuilt binaries in
Downloads/robocode-tankroyale/sample-bots-nim-linux-1.0.7 read-only, plus
MyFirstTeam (team config). All 13 single bots smoke-tested with RawRecord
2 rounds and verified CONTIGUOUS via query.py --verify. See SAMPLE_BOTS.md.
The three geometric adversaries (Target, Walls, SpinBot) were force-added in
9f37db7 and are not needed: they were a one-off non-regression gate for the
old opponent-bias gun. Delete them and their README section. Keep the
score_battles.py damage/round + aim-error additions and the DrussGT bot.
Measure the ELM gun against the plain geometric gun on the three classic
geometric-movement bots (Target, Walls, SpinBot), 20 rounds each, RawRecord
observer ground truth. Verdict: ELM passes only Target (105.5 vs 104.5
dmg/round, within noise); fails Walls (13.5 vs 76.0) and SpinBot (11.0 vs
43.0). score_battles.py extended with damage/round, round wins and the
aim-error-at-fire distribution (vs the true geometric intercept).
Also confirms the corpus and live feature builder both use bulletSpeed =
power*10, so there is no train/inference feature mismatch.
The gun turn math is written for setAdjustGunForBodyTurn(true) (absolute bearing
-> normalizeRelativeAngle(bearing - getGunDirection())), but the flag was never
set: the gun inherited the body's turn. Set the three adjust flags.
Two firing bugs found while measuring the geometric baseline against a stationary
SittingDuck:
- computeGun called the BLOCKING fire(), which calls go() itself, and the run
loop called go() again => every shot double-stepped the server. Use setFire.
- the fire slop compared a degrees error against degToRad(FireSlopDeg) = 0.052
deg. Compare in degrees; 1 deg (3 deg fired mid-slew, up to 3 deg off).
Baseline vs stationary: 110/112 hits, aim error sd 0.04 deg.
Firing wired in behind a compile-time A/B switch (-d:baselineGun): both guns go
through the same predictAim() call and differ only by the learned correction, so
the measured difference is attributable. radar.nim now keeps the two most recent
scans (velocity, scan age, own displacement).
Measured over 20 recorded rounds each vs DrussGT, CassiusClay, Komarious and
Phoenix: the ELM gun LOSES to the geometric baseline on three of four opponents
(Phoenix 51.0% vs 99.5% hit rate). README has the table, the diagnosis and the
two in-game-only bugs measuring exposed (degrees/radians, and features whose
in-game range lies outside the corpus).
train_elm_gun.nim trains H=128, lambda=1e-2, decay=1.0 over every opponent in
tools/elm_bench/gen and writes modules/ELM/elm_gun_weights.txt (trainRmse 0.431
vs a constant baseline 0.933). Pooled is the point: the gun meets opponents it
was not fitted on.
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.
Full 60-config grid per activation on the same features, folds and seed, so
the three runs are directly comparable (act_sweep.log):
tanh (default) 0.4218 mean per-fold RMSE (constant 1.1406)
relu 0.4338 (+2.8%)
step 0.7476 (+77.3%)
The activation only matters where there is nonlinear structure to expose: on
base 6 and on scan-age alone all three agree to 0.0002 and are all worthless.
tanh stays the default because it is never worse, and because every other
number in this README was produced with it.
Also records why there is no RBF/gaussian option: g(b*||x - a||) reads the
distance to a centre in input space, so it needs centre + width parameters,
its own init and its own Thm 2.2 validation - a different node architecture,
not a different nonlinearity. It would buy nothing here anyway: the signal is
one linear term in beliefPredErr.
tools/raw_recorder/RawRecord.java + shadow/GameRecorder.java the observer
that writes the .battle.gz corpora in data/ (gitignored, regenerable)
tools/raw_recorder/query.py, sample_outline.md query helpers
and the shape of a capture
tr_bots/_salvage/ the port audit:
portaudit/{methods,static}.py, shim/, and the tr_wrappers/*.json + *.sh
for 29 rescued legacy bots, with legacy_bots/MANIFEST.sha256
guns/elm.nim online sequential ELM (ridge/RLS), fixed random
hidden layer, one pass, no backprop
guns/waveelm.nim the WaveElm gun: a simulated omnidirectional expanding
ring of probes fired from the SHOOTER, where the ELM
learns a BIAS CORRECTION to the ring's reconstructed
position (predicting the position outright was measured
and refuted: it collapses on abrupt/burst movement)
guns/gun_knowledge.nim GUNK: a learned additive angular residual on top of
the self-consistent lead forecast. Only answers "which
absolute gun direction", nothing else
guns/docs/ the open-access OS-ELM / ELM reference set plus
fetch_papers.sh, which re-downloads it idempotently
Plus the matching test and measurement harnesses (test_waveelm*, test_elm,
test_gun_knowledge, test_knowledge_registration, gk_aim_probe,
measure_gk_{residual,virtual}.py) and the docs README with the citations.
Feasibility spike for a ring-based training label. N rays are fired
simultaneously from the shooter's BELIEF centre at bullet speed; the label is
a 2-D positional error from the belief centre to the contact point on the enemy
circle (BotRadius 18 px). Belief is reconstructed with strict --prev
semantics (a bot cannot act on a scan delivered at the end of tick T until
T+1), so the spike already measures the label under the harder assumption.
Also fixes a latent crash in ring_contact: the `last`-sample fallback was
computed and then overwritten by an unconditional p[0], p[1], so any enemy
track with a gap raised TypeError instead of falling back.
Result is NOT what it first looks like -- see the ring-label section of
tools/elm_bench/README.md. The contact search degenerates to k = 1 (the belief
is already within BotRadius of the enemy), and the reported 100% hit rate at
power <= 1.5 versus 0.2% at power 3.0 is an artifact of bullet speed versus
the size of the belief error, not of ray geometry.
Extractors, benchmarks and analysis for "can we predict an opponent's aim
error from our own belief state?". All labels come from BulletFiredEvents;
all features come only from the shooter's own state and its ScannedBotEvent
history (the target's true state is used for the label and never for a
feature, verified by a ground-truth-poisoning re-extraction).
extract.py / extract_realistic.py label + oracle features / realistic ones
gen_analysis.py, analyse_realistic.py, audit_independent.py
bench.nim, bench_realistic.nim, cross_opponent.nim, online.nim
gen/*.ndjson the per-opponent sample tables
README.md the write-up, ~1200 lines
Headline: DrussGT applies about 13% of the correct lead, and that 13% is
computable from one feature (beliefPredErr) as label ~ 0.8663*predErr +
0.0418. ELM ALL-21 pools to RMSE 0.4220 against a constant 1.1463 (-63%).
The network is not the finding; the single linear term is. Cross-opponent,
--prev leakage audit and an independent re-derivation are in the README.
The top-level samples_realistic*.ndjson are byte-identical to gen/DrussGT* and
are gitignored; gen/ is the authoritative copy.