Files
SirRoboGarage/common_libs/tests/measure_physics.nim
T
SirStone c091bf3c34 harness: upgrade to server 1.3.1, keep 0.35.5 selectable, re-baseline
All prior measurements ran on server 0.35.5. The default is now the current
1.3.1 jar, with the legacy jar kept and switchable via TR_SERVER_JAR (no code
edit). test_gauntlet_5bots.nim no longer clobbers a caller's TR_SERVER_JAR -
it used to putEnv() unconditionally, so an override was silently ignored.

RE-BASELINE (controlled RulesProbe battle, stationary bot, powers 0.1/0.5/1/2/3):

  dimension                    1.3.1              0.35.5            verdict
  bullet damage per hit        0.4/2/4/10/16       identical         SAME
  bullet speed (20-3p)         within noise        within noise      SAME
  post-fire gun heat (1+p/5)   identical           identical         SAME
  cooling                      0.1/tick            0.1/tick          SAME
  bulletDamage SCORE           exactly 100/round   104..113/round    DIFFERENT
  bulletKillBonus (20%)        20/round            20..23/round      DIFFERENT

LOUD FINDING - a SCORING rule changed, physics did not: 0.35.5 credits
OVERKILL to bulletDamage (the killing bullet's full damage even past 0 energy);
1.3.1 caps it at the energy actually removed. Every 0.35.5 score is therefore
inflated ~5-6%, and bulletKillBonus inherits the inflation. Gauntlet totals
shift accordingly (SittingDuck 1936 -> 1800, WaveSurfer 1886 -> 1669).

Consequence: score-based numbers recorded on 0.35.5 are NOT comparable to 1.3.1.
Our gun A/Bs used real HIT RATE, not score, so those conclusions stand.

Runner 1.0.2 (unchanged, no newer one on the box) is measured compatible with
the 1.3.1 server. Note TrBattleCapture uses the runner's EMBEDDED server, which
is 1.0.2 - so the capture path still runs an older engine than the gauntlet.

Also re-ran acceptance_offline_vs_online on the new default: 12/12.
2026-09-21 22:41:06 +02:00

33 lines
1.3 KiB
Nim

## Empirical physics re-baseline driver: run the RulesProbe bot against a
## stationary SittingDuck on whichever server TR_SERVER_JAR selects, and dump
## the raw event log to PROBE_LOG.
##
## PROBE_LOG=/tmp/probe_131.jsonl TR_SERVER_JAR=<jar> \
## nim c -r --path:common_libs common_libs/tests/measure_physics.nim
##
## Compare the two logs with common_libs/tests/analyze_probe_log.nim.
import std/[os, strformat, strutils]
import test_framework/test_framework
const
repoRoot = currentSourcePath().parentDir.parentDir.parentDir
probeDir = currentSourcePath().parentDir / "probe_bots" / "RulesProbe"
duckDir = repoRoot / "common_libs" / "test_framework" / "adversaries" / "SittingDuck"
let outPath = getEnv("PROBE_LOG", "/tmp/probe_log.jsonl")
let rounds = parseInt(getEnv("PROBE_ROUNDS", "6"))
let powers = getEnv("PROBE_POWERS", "0.1,0.5,1,2,3")
if fileExists(outPath): removeFile(outPath)
putEnv("PROBE_LOG", outPath)
putEnv("PROBE_POWERS", powers)
echo "server jar : ", getEnv("TR_SERVER_JAR", "(default)")
echo "probe log : ", outPath
echo "rounds : ", rounds
let r = runBattle(@[probeDir, duckDir], rounds = rounds, timeout = 300000, maxSpeed = true)
for b in r.results:
echo fmt" {b.name}: totalScore={b.totalScore} rank={b.rank} survival={b.survivalCount}"
echo "rounds played: ", r.rounds.len