## Cross-check probe for `measure_gk_residual.py`: it prints the PRODUCTION aim ## base of `guns/gun_knowledge.nim` -- the exact angle `KnowledgeGun.predict` ## turns into its prediction point -- for every ## ex ey eh es sx sy power ## line on stdin, one float per line on stdout. The measurement script replays ## the aim offline and asserts that its replay equals THIS, so the offline ## numbers cannot silently drift away from the shipped code again. ## ## Build: nim c --path:common_libs common_libs/tests/gk_aim_probe.nim ## (the script builds it itself and skips the cross-check with a loud warning ## if the binary is missing). import std/[os, strutils] import guns/gun_knowledge for line in stdin.lines: let f = line.splitWhitespace() if f.len < 7: continue let feat = GkFeatures( enemyX: parseFloat(f[0]), enemyY: parseFloat(f[1]), enemyHeading: parseFloat(f[2]), enemySpeed: parseFloat(f[3]), selfX: parseFloat(f[4]), selfY: parseFloat(f[5]), power: parseFloat(f[6]), hasTarget: true) echo forecastBase(feat, 0.0)