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.
This commit is contained in:
2026-09-21 22:41:06 +02:00
parent 18f778056b
commit c091bf3c34
11 changed files with 283 additions and 8 deletions
+20 -2
View File
@@ -14,12 +14,30 @@ Integration test framework for Tank Royale bots. Spins up a TR server JAR on a r
| Variable | Purpose | Default |
|---|---|---|
| `TR_SERVER_JAR` | Path to the TR server JAR | hardcoded dev path in `server_manager.nim` |
| `TR_BATTLE_RUNNER` | Path to the TR runner JAR | hardcoded dev path in `runner_process.nim` |
| `TR_SERVER_JAR` | Path to the TR server JAR | `DefaultServerJar` in `server_manager.nim` (current: server 1.3.1) |
| `TR_BATTLE_RUNNER` | Path to the TR runner JAR | hardcoded dev path in `runner_process.nim` (1.0.2) |
| `TR_BATTLE_RUNNER_DIR` | Directory containing compiled `TestBattleRunner.class` | `tools/battle_runner/` |
Set at minimum `TR_SERVER_JAR` and `TR_BATTLE_RUNNER` to point at your local JAR builds.
### Switching server versions
The framework defaults to the current server (`DefaultServerJar`, 1.3.1). The
previous 0.35.5 build is kept at `LegacyServerJar` for reproducing older
baselines. Either can be selected from the environment without editing code:
```sh
# current (default)
nim c -r tests/test_gauntlet_5bots.nim
# legacy 0.35.5, for old-baseline reproduction
export TR_SERVER_JAR=/home/davide/Projects/tank-royale/server/build/libs/robocode-tankroyale-server-0.35.5-all.jar
nim c -r tests/test_gauntlet_5bots.nim
```
Test drivers must not overwrite `TR_SERVER_JAR` when the caller already set it;
`test_gauntlet_5bots.nim` now only fills in the default when the variable is unset.
### One-time Java compilation
```sh
@@ -4,7 +4,12 @@
import std/[osproc, net, os, strutils, times, streams, exitprocs]
const
DefaultJar = "/home/davide/Projects/tank-royale/server/build/libs/robocode-tankroyale-server-0.35.5-all.jar"
DefaultServerJar* = "/home/davide/Downloads/robocode-tankroyale/robocode-tankroyale-server.jar"
## Current server (Implementation-Version 1.3.1).
LegacyServerJar* = "/home/davide/Projects/tank-royale/server/build/libs/robocode-tankroyale-server-0.35.5-all.jar"
## Previous server (0.35.5). Every pre-1.3.1 measurement was taken on it;
## kept so old baselines can be reproduced. Select it with
## `TR_SERVER_JAR=$LegacyServerJar`, no code edit needed.
ReadySignal = "Starting server on port"
StartupTimeout = 15.0 # seconds
@@ -22,7 +27,7 @@ proc findFreePort(): int =
proc ensureServer*() =
if serverProc != nil: return
let jar = getEnv("TR_SERVER_JAR", DefaultJar)
let jar = getEnv("TR_SERVER_JAR", DefaultServerJar)
if not fileExists(jar):
raise newException(IOError, "TR server JAR not found: " & jar &
"\nSet TR_SERVER_JAR env var to override.")