ChimeraBot_garage: M7.5 — virtual-gun tournament, Dodger-v2, discriminating bench

This commit is contained in:
2026-10-07 09:16:54 +02:00
parent 4c98333a3c
commit 5b48ac980c
12 changed files with 865 additions and 150 deletions
+68 -38
View File
@@ -1,11 +1,17 @@
## G8 LIVE BENCH — twin gun vs ELM gun vs inert, suite + G7 no-regression.
## LIVE, Java required. Three binaries from the SAME tree:
## * inert — `-d:chimeraInert` (all CHIMERA command paths off == M1 copy)
## * elm — `-d:chimeraNoTwinGun` (probes+fusion+influence, ELM gun as now)
## * twin — default (ELM gun REPLACED by the M7 twin gun)
## G8.5 LIVE BENCH — virtual-gun tournament vs twin vs ELM vs inert.
## LIVE, Java required. FOUR binaries from the SAME tree:
## * inert — `-d:chimeraInert` (all CHIMERA command paths off == M1 copy)
## * elm — `-d:chimeraNoTwinGun` (probes+fusion+influence, ELM gun as now)
## * twin — `-d:chimeraNoVguns` (M7 influence-gated twin/ELM path)
## * vgun — default (M7.5 virtual-gun tournament: TWIN/ELM/HEAD-ON)
## 5 rounds per arm per opponent vs the 8 primary sample bots + the garage-local
## Dodger archetype. Reports win rate + score margin; the G7 no-regression read
## is twin >= inert (win rate) on every opponent, stated plainly when it fails.
## Dodger-v2 archetype. Reports win rate + score margin; the G7 no-regression read
## is vgun >= inert (win rate) on every opponent, stated plainly when it fails.
##
## The **discrimination test** is the Dodger-v2 row: M7 found the three arms
## ~equal there (~2660 each), i.e. the opponent was too weak to separate them.
## M7.5 reports the four Dodger margins and states plainly whether they now
## differ.
##
## Run: `nim c -r --hints:off -d:release tests/bench_g8_live.nim`
@@ -29,7 +35,8 @@ type
const Arms = [
Arm(tag: "inert", name: "ChimeraInert", defines: @["-d:chimeraInert"]),
Arm(tag: "elm", name: "ChimeraElm", defines: @["-d:chimeraNoTwinGun"]),
Arm(tag: "twin", name: "ChimeraTwin", defines: @[]),
Arm(tag: "twin", name: "ChimeraTwin", defines: @["-d:chimeraNoVguns"]),
Arm(tag: "vgun", name: "ChimeraVgun", defines: @[]),
]
proc parseOutcome(log, ourName: string): Outcome =
@@ -85,10 +92,10 @@ proc margin(o: Outcome): float64 = o.ourScore - o.oppScore
proc main() =
guardSkip()
echo "[G8-live] staging 3 arms..."
echo "[G8.5-live] staging 4 arms..."
var bots = initTable[string, string]()
for a in Arms:
bots[a.tag] = stageBot("g8_" & a.tag, a.defines, a.name)
bots[a.tag] = stageBot("g85_" & a.tag, a.defines, a.name)
let opps = sorted(toSeq(Expected.keys)) & @["Dodger"]
var suite = initTable[string, Table[string, Outcome]]() # arm -> opp -> out
@@ -107,60 +114,83 @@ proc main() =
" margin=", formatFloat(margin(o), ffDecimal, 1)
suite[arm.tag] = t
echo "\n=== G8 live suite (", Rounds, " rounds/arm/opponent) ==="
echo "Opponent elmW% elmM twinW% twinM inertW% inertM"
echo "\n=== G8.5 live suite (", Rounds, " rounds/arm/opponent) ==="
echo "Opponent elmW% elmM twinW% twinM vgunW% vgunM inertW% inertM"
var noRegress = true
var regress: seq[string]
var lines: seq[string]
lines.add "# G8 live bench (M7 twin gun)\n"
lines.add "Three arms from the SAME tree: inert (`-d:chimeraInert`), elm " &
"(`-d:chimeraNoTwinGun`), twin (default). " & $Rounds &
" rounds per arm per opponent. Generated by `tests/bench_g8_live.nim`.\n"
lines.add "| opponent | elm W% | elm margin | twin W% | twin margin | inert W% | inert margin |"
lines.add "|---|---:|---:|---:|---:|---:|---:|"
lines.add "# G8.5 live bench (M7.5 virtual-gun tournament)\n"
lines.add "Four arms from the SAME tree: inert (`-d:chimeraInert`), elm " &
"(`-d:chimeraNoTwinGun`), twin (`-d:chimeraNoVguns`), vgun (default). " &
$Rounds & " rounds per arm per opponent. Generated by " &
"`tests/bench_g8_live.nim`.\n"
lines.add "| opponent | elm W% | elm margin | twin W% | twin margin | vgun W% | vgun margin | inert W% | inert margin |"
lines.add "|---|---:|---:|---:|---:|---:|---:|---:|---:|"
for opp in opps:
let e = suite["elm"].getOrDefault(opp)
let t = suite["twin"].getOrDefault(opp)
let v = suite["vgun"].getOrDefault(opp)
let i = suite["inert"].getOrDefault(opp)
if t.rounds > 0 and i.rounds > 0 and t.wins < i.wins:
if v.rounds > 0 and i.rounds > 0 and v.wins < i.wins:
noRegress = false; regress.add opp
echo " ", alignLeft(opp, 10),
align(formatFloat(winRate(e), ffDecimal, 0), 7),
align(formatFloat(margin(e), ffDecimal, 1), 7),
align(formatFloat(winRate(t), ffDecimal, 0), 7),
align(formatFloat(margin(t), ffDecimal, 1), 6),
align(formatFloat(winRate(v), ffDecimal, 0), 7),
align(formatFloat(margin(v), ffDecimal, 1), 6),
align(formatFloat(winRate(i), ffDecimal, 0), 8),
align(formatFloat(margin(i), ffDecimal, 1), 7)
lines.add "| " & opp & " | " & formatFloat(winRate(e), ffDecimal, 1) & " | " &
formatFloat(margin(e), ffDecimal, 1) & " | " &
formatFloat(winRate(t), ffDecimal, 1) & " | " &
formatFloat(margin(t), ffDecimal, 1) & " | " &
formatFloat(winRate(v), ffDecimal, 1) & " | " &
formatFloat(margin(v), ffDecimal, 1) & " | " &
formatFloat(winRate(i), ffDecimal, 1) & " | " &
formatFloat(margin(i), ffDecimal, 1) & " |"
# suite totals
var te, tt, ti: Outcome
var totals = initTable[string, Outcome]()
for opp in opps:
for (dst, arm) in [(addr te, "elm"), (addr tt, "twin"), (addr ti, "inert")]:
let o = suite[arm].getOrDefault(opp)
dst.rounds += o.rounds; dst.wins += o.wins
dst.ourScore += o.ourScore; dst.oppScore += o.oppScore
echo "\nTotals: elm ", formatFloat(winRate(te), ffDecimal, 1),
"% (m ", formatFloat(margin(te), ffDecimal, 1), ") twin ",
formatFloat(winRate(tt), ffDecimal, 1), "% (m ",
formatFloat(margin(tt), ffDecimal, 1), ") inert ",
formatFloat(winRate(ti), ffDecimal, 1), "% (m ",
formatFloat(margin(ti), ffDecimal, 1), ")"
lines.add "\n**Totals:** elm " & formatFloat(winRate(te), ffDecimal, 1) &
"% (margin " & formatFloat(margin(te), ffDecimal, 1) & "), twin " &
formatFloat(winRate(tt), ffDecimal, 1) & "% (margin " &
formatFloat(margin(tt), ffDecimal, 1) & "), inert " &
formatFloat(winRate(ti), ffDecimal, 1) & "% (margin " &
formatFloat(margin(ti), ffDecimal, 1) & ")."
lines.add "\n**G7 no-regression (twin >= inert win-rate on every opponent): " &
for arm in Arms:
let o = suite[arm.tag].getOrDefault(opp)
totals.mgetOrPut(arm.tag, Outcome()).rounds += o.rounds
totals[arm.tag].wins += o.wins
totals[arm.tag].ourScore += o.ourScore
totals[arm.tag].oppScore += o.oppScore
var totLine = "Totals: "
for arm in Arms:
let t = totals[arm.tag]
totLine.add arm.tag & " " & formatFloat(winRate(t), ffDecimal, 1) &
"% (m " & formatFloat(margin(t), ffDecimal, 1) & ") "
echo "\n", totLine
lines.add "\n**" & totLine & "**"
# Discrimination read on the Dodger-v2 row.
var dm = ""
var dmin = Inf
var dmax = -Inf
for arm in Arms:
let o = suite[arm.tag].getOrDefault("Dodger")
dm.add arm.tag & " " & formatFloat(margin(o), ffDecimal, 1) & " "
dmin = min(dmin, margin(o))
dmax = max(dmax, margin(o))
let spread = dmax - dmin
echo "Dodger-v2 margins: ", dm, " spread=", formatFloat(spread, ffDecimal, 1)
lines.add "\n**Discrimination test (Dodger-v2 row).** Margins: " & dm &
"spread " & formatFloat(spread, ffDecimal, 1) & ". " &
(if spread >= 500.0:
"The arms DIFFER materially against the upgraded Dodger."
else:
"The arms remain ~equal against the upgraded Dodger — stated plainly as a finding.")
lines.add "\n**G7 no-regression (vgun >= inert win-rate on every opponent): " &
(if noRegress: "PASS" else: "**FAIL** on " & regress.join(", ")) & ".**"
let art = currentSourcePath().parentDir.parentDir / "benchmarks" / "m7_g8_live.md"
let art = currentSourcePath().parentDir.parentDir / "benchmarks" / "m7_5_g8_live.md"
createDir(art.parentDir)
writeFile(art, lines.join("\n") & "\n")
echo "\nArtifact: ", art