scripts: game-abba.ps1 runs an in-game ABBA comparison over gate runs (D3D12-GAME-ABBA) #2804

Merged
TheGeogeo merged 7 commits from upstream-pr/2804 into main 2026-12-02 11:45:10 +00:00
TheGeogeo commented 2026-12-01 00:27:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-12-01T00:27:55Z.


Claimed in the coordination issue as: D3D12-GAME-ABBA (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7293606762)

What and why

An A/B between separate runs needs a balanced order, warm caches, the same exe throughout, and every run checked before it counts. Testers still do this by hand, one gate run at a time. This adds the runner that #2783's plan and abba were written for:

  • scripts/game-abba.ps1 takes the order from d3d12_ab_compare.py plan: warm-up runs of each arm, then discarded runs, then -Pairs pairs in ABBA order. It runs each slot through scripts/game-gate.ps1 (#2782).
    • One exe with two settings: -Data, -MoreA, -MoreB.
    • Two builds: -CheckoutA, -DataA, -CheckoutB, -DataB. Each arm runs its own checkout's gate and exe, with a data folder of its own, because the caches differ.
  • The new d3d12_ab_compare.py check checks each measured run. A run counts only if all of these hold:
    • its gate passed;
    • the pipeline cache was warm before the measured window (60 s into the world);
    • its exe is the one its arm started with;
    • its arm's own -MoreA/-MoreB settings show in the runtime's settings line (#2775), when the run has one. A value the line hides counts as shown;
    • it has a frame rate (the same definition abba uses: check is built on it).
  • -MoreA/-MoreB are read once, the gate's way (d3d12_ab_compare.py settings, check --more): names and values trimmed, the last value of a name kept. Items the settings line could never show (no =, a name that is not LEONIDA_..., an empty value, a space or more than 120 characters in a value the line shows as it is) are refused before the first run. The rule for "shows as it is" mirrors leonida.rs, pinned by a contract test. Messages name an item by its position, never by its text.
  • A run that fails a check (an unreadable summary.json included) gets an ab-excluded.txt, which abba now leaves out, and its slot runs again (-Retry, 1). A failed warm-up or discarded run stops the series at once.
  • It ends with abba into <Out>/comparison.txt and comparison.json. Every comparator call's exit code is checked before its output is used. Exit 0 with a comparison, 1 without one.
  • abba.json records the arms' inputs (-MoreA, -MoreB, -More, -PlayArgs, the folders), what ran, which exe and commit, and what was left out and why. It is written at the start and after each run, beside itself then moved over, so an error leaves a record. The files the runner writes are LF.
  • A re-run into the same -Out starts clean, but only when its abba.json is this runner's. Anything else there is refused and kept. Every folder and each checkout's scripts\game-gate.ps1 is checked before anything is deleted.
  • -DryRun prints the plan and every gate command without starting anything.
  • It refuses:
    • two builds sharing one data folder (paths compared in full, without an ending separator, case ignored);
    • one exe with no setting that differs;
    • fewer than 3 pairs (2 pairs are 2 runs a side, which abba can never compare);
    • an -Out inside a checkout or holding one, or overlapping -Game, -DataTemplate or a data folder;
    • -Retry below 0.
  • Empty -More/-PlayArgs are not passed to the gate.
  • It needs PowerShell 7 (#Requires -Version 7.0).
  • docs/measuring_fps.md (section 3) and docs/game_gate.md describe it.

Tested

On Windows 11 Pro 10.0.26300, rebased on main 8422def75:

  • tests/test_game_abba.py, 23 tests. Besides the dry runs and refusals, a stand-in gate that writes run.json and summary.json drives the whole path (gate, check, retry, outputs): a failed run left out and run again in the A B B A order, a cut summary, a failed comparator, a failed warm-up, too few runs left, runs measuring another exe or other settings, a re-run into the same -Out, an -Out the runner did not write, the record's fields and bytes.
  • tests/test_d3d12_ab_compare.py, 26 tests: check (each reason to leave a run out, an unreadable summary, a run without a frame rate), the settings reader (hidden values, last value of a name, items named by position), the contract on leonida.rs, and an excluded run left out by abba.
  • Each fix asked for in the reviews has a test that fails without it.
  • test_game_gate.py, test_tool_stdout_encoding.py, test_ci_registration.py, the docs tests, scripts/check_no_game_data.py on the changed files, and git diff --check are clean.
  • In game, RTX 3080 10 GB, driver 32.0.16.2140, Series S profile, the diagnostics build of main 8f41d7d01 code: a null A/B, LEONIDA_FPS_LINE=1 against =0 (the top-left frame-rate line). One exe with two settings, 4 pairs, 120 s in the world per run, with the driver mod from #2784 enabled through -More.
    • 11 runs. All 8 measured runs passed their gate, none was left out, and none was retried.
    • Verdict "no clear difference": effect -0.08 ms (-0.2 %), standard error 0.53, 95 % [-1.78, +1.63] ms, 3 of 4 pairs agree.
    • The world median frame time of the measured runs was 41.05 / 40.50 / 39.45 / 37.92 / 38.49 / 37.79 / 37.89 / 38.48 ms in ABBA order. The first pair was still a little slower, which the balanced pairs absorb.
    • An earlier attempt of the same A/B had all its runs stopped early by an outside guard. It showed the other path: every run was marked and left out, each slot ran again once, and the verdict was "not enough runs".

GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.2140, Windows 11 Pro 10.0.26300

AI-assisted: yes. Claude Code (Claude Fable 5.2 and Claude Opus 5.5); a separate Claude Opus 5.5 agent reviewed the diff before this push.

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5576367218 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-12-01T00:27:55Z. --- Claimed in the coordination issue as: D3D12-GAME-ABBA (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7293606762) ### What and why An A/B between separate runs needs a balanced order, warm caches, the same exe throughout, and every run checked before it counts. Testers still do this by hand, one gate run at a time. This adds the runner that #2783's `plan` and `abba` were written for: - `scripts/game-abba.ps1` takes the order from `d3d12_ab_compare.py plan`: warm-up runs of each arm, then discarded runs, then `-Pairs` pairs in ABBA order. It runs each slot through `scripts/game-gate.ps1` (#2782). - **One exe with two settings:** `-Data`, `-MoreA`, `-MoreB`. - **Two builds:** `-CheckoutA`, `-DataA`, `-CheckoutB`, `-DataB`. Each arm runs its own checkout's gate and exe, with a data folder of its own, because the caches differ. - The new `d3d12_ab_compare.py check` checks each measured run. A run counts only if all of these hold: - its gate passed; - the pipeline cache was warm before the measured window (60 s into the world); - its exe is the one its arm started with; - its arm's own `-MoreA`/`-MoreB` settings show in the runtime's settings line (#2775), when the run has one. A value the line hides counts as shown; - it has a frame rate (the same definition `abba` uses: `check` is built on it). - `-MoreA`/`-MoreB` are read once, the gate's way (`d3d12_ab_compare.py settings`, `check --more`): names and values trimmed, the last value of a name kept. Items the settings line could never show (no `=`, a name that is not `LEONIDA_...`, an empty value, a space or more than 120 characters in a value the line shows as it is) are refused before the first run. The rule for "shows as it is" mirrors `leonida.rs`, pinned by a contract test. Messages name an item by its position, never by its text. - A run that fails a check (an unreadable `summary.json` included) gets an `ab-excluded.txt`, which `abba` now leaves out, and its slot runs again (`-Retry`, 1). A failed warm-up or discarded run stops the series at once. - It ends with `abba` into `<Out>/comparison.txt` and `comparison.json`. Every comparator call's exit code is checked before its output is used. Exit 0 with a comparison, 1 without one. - `abba.json` records the arms' inputs (`-MoreA`, `-MoreB`, `-More`, `-PlayArgs`, the folders), what ran, which exe and commit, and what was left out and why. It is written at the start and after each run, beside itself then moved over, so an error leaves a record. The files the runner writes are LF. - A re-run into the same `-Out` starts clean, but only when its `abba.json` is this runner's. Anything else there is refused and kept. Every folder and each checkout's `scripts\game-gate.ps1` is checked before anything is deleted. - `-DryRun` prints the plan and every gate command without starting anything. - It refuses: - two builds sharing one data folder (paths compared in full, without an ending separator, case ignored); - one exe with no setting that differs; - fewer than 3 pairs (2 pairs are 2 runs a side, which `abba` can never compare); - an `-Out` inside a checkout or holding one, or overlapping `-Game`, `-DataTemplate` or a data folder; - `-Retry` below 0. - Empty `-More`/`-PlayArgs` are not passed to the gate. - It needs PowerShell 7 (`#Requires -Version 7.0`). - `docs/measuring_fps.md` (section 3) and `docs/game_gate.md` describe it. ### Tested On Windows 11 Pro 10.0.26300, rebased on `main` 8422def75: - `tests/test_game_abba.py`, 23 tests. Besides the dry runs and refusals, a stand-in gate that writes `run.json` and `summary.json` drives the whole path (gate, check, retry, outputs): a failed run left out and run again in the A B B A order, a cut summary, a failed comparator, a failed warm-up, too few runs left, runs measuring another exe or other settings, a re-run into the same `-Out`, an `-Out` the runner did not write, the record's fields and bytes. - `tests/test_d3d12_ab_compare.py`, 26 tests: `check` (each reason to leave a run out, an unreadable summary, a run without a frame rate), the settings reader (hidden values, last value of a name, items named by position), the contract on `leonida.rs`, and an excluded run left out by `abba`. - Each fix asked for in the reviews has a test that fails without it. - `test_game_gate.py`, `test_tool_stdout_encoding.py`, `test_ci_registration.py`, the docs tests, `scripts/check_no_game_data.py` on the changed files, and `git diff --check` are clean. - In game, RTX 3080 10 GB, driver 32.0.16.2140, Series S profile, the diagnostics build of `main` 8f41d7d01 code: a null A/B, `LEONIDA_FPS_LINE=1` against `=0` (the top-left frame-rate line). One exe with two settings, 4 pairs, 120 s in the world per run, with the driver mod from #2784 enabled through `-More`. - 11 runs. All 8 measured runs passed their gate, none was left out, and none was retried. - Verdict "no clear difference": effect -0.08 ms (-0.2 %), standard error 0.53, 95 % [-1.78, +1.63] ms, 3 of 4 pairs agree. - The world median frame time of the measured runs was 41.05 / 40.50 / 39.45 / 37.92 / 38.49 / 37.79 / 37.89 / 38.48 ms in ABBA order. The first pair was still a little slower, which the balanced pairs absorb. - An earlier attempt of the same A/B had all its runs stopped early by an outside guard. It showed the other path: every run was marked and left out, each slot ran again once, and the verdict was "not enough runs". GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.2140, Windows 11 Pro 10.0.26300 AI-assisted: yes. Claude Code (Claude Fable 5.2 and Claude Opus 5.5); a separate Claude Opus 5.5 agent reviewed the diff before this push. ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change)
OreoFR commented 2026-12-01 00:30:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-01T00:30:08Z.


Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12, head 413212ff9, main b7a1be296. CPU only, no pwsh and no game on this machine.

MEASURED

  • Red (main + only this PR's tests): 6 failed, 14 passed, 4 skipped.
    • In test_d3d12_ab_compare.py, the four new Runs tests fail: check doesn't exist on main.
    • In test_game_abba.py, test_it_needs_powershell_7 and test_no_variable_takes_a_parameters_name_in_another_case fail: the script doesn't exist on main.
  • Green (main + this PR, merge-tree): 20 passed, 4 skipped (test_d3d12_ab_compare.py 18 passed; test_game_abba.py 2 passed, 4 skipped).
  • The 4 skips are test_game_abba.py:50, :65, :81, :97, all "needs Windows and pwsh". So the parts of game-abba.ps1 that run are not exercised here. Only the static checks ran (the #Requires -Version 7.0 line and the variable/parameter case clash).

READ IN CODE

  • scripts/game-abba.ps1 starts with #Requires -Version 7.0, consistent with #2805 doing the same for game-gate.ps1.
  • tools/d3d12_ab_compare.py gains check_run() and a check subcommand (run, --exe, --setting repeatable), which the script calls for each measured run.

ASSUMED

  • The ABBA run itself (order, retries, exclusions, abba.json) needs a Windows run, or at least -DryRun under pwsh 7. Not reproduced here.

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7296406629 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#issuecomment-7296406629). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-01T00:30:08Z. --- Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12, head `413212ff9`, main `b7a1be296`. CPU only, no pwsh and no game on this machine. **MEASURED** - Red (main + only this PR's tests): 6 failed, 14 passed, 4 skipped. - In `test_d3d12_ab_compare.py`, the four new `Runs` tests fail: `check` doesn't exist on main. - In `test_game_abba.py`, `test_it_needs_powershell_7` and `test_no_variable_takes_a_parameters_name_in_another_case` fail: the script doesn't exist on main. - Green (main + this PR, merge-tree): 20 passed, 4 skipped (`test_d3d12_ab_compare.py` 18 passed; `test_game_abba.py` 2 passed, 4 skipped). - The 4 skips are `test_game_abba.py:50, :65, :81, :97`, all "needs Windows and pwsh". So the parts of `game-abba.ps1` that run are not exercised here. Only the static checks ran (the `#Requires -Version 7.0` line and the variable/parameter case clash). **READ IN CODE** - `scripts/game-abba.ps1` starts with `#Requires -Version 7.0`, consistent with #2805 doing the same for `game-gate.ps1`. - `tools/d3d12_ab_compare.py` gains `check_run()` and a `check` subcommand (`run`, `--exe`, `--setting` repeatable), which the script calls for each measured run. **ASSUMED** - The ABBA run itself (order, retries, exclusions, `abba.json`) needs a Windows run, or at least `-DryRun` under pwsh 7. Not reproduced here. AI-assisted: Claude Code
fiestorra commented 2026-12-01 01:18:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T01:18:00Z.


Verified on Windows, with the control that matters: the tests fail when the change is reverted.

Cherry-picked onto main d920d850d in a clean worktree, Python 3.13.14:

python -m pytest tests/test_game_abba.py + tests/test_d3d12_ab_compare.py -q with this pull request: 6 + 18 passed with scripts/game-abba.ps1 y tools/d3d12_ab_compare.py from main: 6 failed (script borrado) y 4 failed (tool de main)

So the new tests are tied to the change and not to each other's fixtures. No part of this needed a GPU, a display or game data, which is what the gate tests are built for.

What I could not test: the script against a real run folder - game-abba.ps1 drives one, and this machine has the game but not the gate harness the other contributors used, so the shape is proven and the run is not.

AI-assisted: yes - DeepSeek v4.1 (flash), applied and ran both arms on the machine above.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7297341927 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#issuecomment-7297341927). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-01T01:18:00Z. --- **Verified on Windows, with the control that matters: the tests fail when the change is reverted.** **Cherry-picked onto `main` `d920d850d` in a clean worktree, Python 3.13.14:** ` python -m pytest tests/test_game_abba.py + tests/test_d3d12_ab_compare.py -q with this pull request: 6 + 18 passed with scripts/game-abba.ps1 y tools/d3d12_ab_compare.py from main: 6 failed (script borrado) y 4 failed (tool de main) ` **So the new tests are tied to the change and not to each other's fixtures.** **No part of this needed a GPU, a display or game data, which is what the gate tests are built for.** **What I could not test:** **the script against a real run folder** - `game-abba.ps1` drives one, **and this machine has the game but not the gate harness the other contributors used**, so the shape is proven and the run is not. **AI-assisted:** yes - DeepSeek v4.1 (flash), applied and ran both arms on the machine above. Written with an AI assistant.
KelboLive commented 2026-12-01 05:49:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T05:49:33Z.

Review: COMMENTED


Verified with pwsh here: 6/6 test_game_abba.py, 18/18 test_d3d12_ab_compare.py, 21/21 test_game_gate.py. The dry runs and a stub-gate end-to-end run confirm the shape — warm-up A, warm-up B, the discarded run(s), then A,B,B,A — a failed measured run is left out and retried, and comparison.txt/json + abba.json are written. plan (tools/d3d12_ab_compare.py:268-275) alternates A,B / B,A and abba requires an even A-first count (:170-172), so a synthetic 1 ms/run drift yields effect 0.00 under ABBA, and an ABAB order is rejected as unbalanced (the linear-trend fallback also gives 0).

One real failure-path bug: a re-run into the same -Out keeps a stale ab-excluded.txt. Labels are deterministic, the gate reuses the folder (New-Item -ItemType Directory -Force), and scripts/game-abba.ps1:112 only writes the exclusion. In the stub run, the first invocation's 06-measured-B failed and was excluded; the second invocation's 06-measured-B passed, but comparison.txt still said left out (excluded: gate FAIL) while abba.json said left_out: null — the record and the comparison disagree and a good run is silently dropped. Remove $dir (or at least its exclusion file) before each attempt, or require a fresh -Out. The previous run's data copy is left behind the same way.

Two smaller ones:

  • In two-build mode -Out inside the runner's checkout is accepted: the guard (:65-67) loops only -CheckoutA/-CheckoutB; add $repo. I passed -Out inside the runner's tree and the dry run was happy.
  • A failed warm-up or discarded run is neither checked nor retried, so a broken environment runs every measured slot (about an hour) before failing with "not enough runs". Fail fast on a warm-up gate failure.

Coverage: all six tests are dry runs or refusals — deleting the ab-excluded.txt write keeps them green, so the gate/check/retry/output path is untested. A stub game-gate.ps1 writing run.json/summary.json (the shape tests/test_game_gate.py's Fake already uses) would cover it and the stale-file case. Also abba.json records schema/builds/pairs/runs but not -MoreA/-MoreB/-PlayArgs, so the arms' inputs live only in the run folders.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6125833356 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#pullrequestreview-6125833356). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T05:49:33Z. **Review:** COMMENTED --- Verified with pwsh here: 6/6 `test_game_abba.py`, 18/18 `test_d3d12_ab_compare.py`, 21/21 `test_game_gate.py`. The dry runs and a stub-gate end-to-end run confirm the shape — warm-up A, warm-up B, the discarded run(s), then **A,B,B,A** — a failed measured run is left out and retried, and `comparison.txt/json` + `abba.json` are written. `plan` (`tools/d3d12_ab_compare.py:268-275`) alternates A,B / B,A and `abba` requires an even A-first count (`:170-172`), so a synthetic 1 ms/run drift yields effect **0.00** under ABBA, and an ABAB order is rejected as unbalanced (the linear-trend fallback also gives 0). One real failure-path bug: **a re-run into the same `-Out` keeps a stale `ab-excluded.txt`.** Labels are deterministic, the gate reuses the folder (`New-Item -ItemType Directory -Force`), and `scripts/game-abba.ps1:112` only writes the exclusion. In the stub run, the first invocation's `06-measured-B` failed and was excluded; the second invocation's `06-measured-B` passed, but `comparison.txt` still said `left out (excluded: gate FAIL)` while `abba.json` said `left_out: null` — the record and the comparison disagree and a good run is silently dropped. Remove `$dir` (or at least its exclusion file) before each attempt, or require a fresh `-Out`. The previous run's `data` copy is left behind the same way. Two smaller ones: - In two-build mode `-Out` inside the **runner's** checkout is accepted: the guard (`:65-67`) loops only `-CheckoutA`/`-CheckoutB`; add `$repo`. I passed `-Out` inside the runner's tree and the dry run was happy. - A failed warm-up or discarded run is neither checked nor retried, so a broken environment runs every measured slot (about an hour) before failing with "not enough runs". Fail fast on a warm-up gate failure. Coverage: all six tests are dry runs or refusals — deleting the `ab-excluded.txt` write keeps them green, so the gate/check/retry/output path is untested. A stub `game-gate.ps1` writing `run.json`/`summary.json` (the shape `tests/test_game_gate.py`'s `Fake` already uses) would cover it and the stale-file case. Also `abba.json` records schema/builds/pairs/runs but not `-MoreA`/`-MoreB`/`-PlayArgs`, so the arms' inputs live only in the run folders.
merzleckeier commented 2026-12-01 12:00:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T12:00:16Z.


I checked 413212ff9 on bf30e2585. All 18 comparison tests passed. I also forced the ABBA dry-run tests to execute on Linux with PowerShell 7.4.21. Five of six passed. The checkout-containment case failed because the check appends a Windows path separator on Linux. Using [IO.Path]::DirectorySeparatorChar for both paths passes all six with the same fixtures, without launching a game.

This is a portability note for Linux dry runs. The native Windows verification in the other comments covers the supported launch path.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7310492923 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#issuecomment-7310492923). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-01T12:00:16Z. --- I checked `413212ff9` on `bf30e2585`. All 18 comparison tests passed. I also forced the ABBA dry-run tests to execute on Linux with PowerShell 7.4.21. Five of six passed. The checkout-containment case failed because the check appends a Windows path separator on Linux. Using `[IO.Path]::DirectorySeparatorChar` for both paths passes all six with the same fixtures, without launching a game. This is a portability note for Linux dry runs. The native Windows verification in the other comments covers the supported launch path. AI-assisted with OpenAI Codex.
andrew-ai commented 2026-12-02 00:39:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by andrew-ai on 2026-12-02T00:39:48Z.


The two-build cache guard accepts the same Windows directory if one argument ends in a separator. At 413212ff9 I ran game-abba.ps1 with two distinct checkout directories, -Pairs 2 and -DryRun. Passing the same existing folder to -DataA and -DataB exited 1 before planning. Appending a backslash to just -DataB exited 0 and printed all eight gate commands. Python os.path.samefile confirmed both arguments named the same directory. A control using separate data directories also planned eight commands. This would let both builds write their caches to the same place in a measured run. For the reproduced spelling, normalize optional trailing separators on both absolute paths with Path.TrimEndingDirectorySeparator before comparing, and cover it alongside the exact-spelling refusal. No game was launched. Codex-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7330817084 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#issuecomment-7330817084). Originally posted by [andrew-ai](https://github.com/andrew-ai) on 2026-12-02T00:39:48Z. --- The two-build cache guard accepts the same Windows directory if one argument ends in a separator. At 413212ff9 I ran game-abba.ps1 with two distinct checkout directories, -Pairs 2 and -DryRun. Passing the same existing folder to -DataA and -DataB exited 1 before planning. Appending a backslash to just -DataB exited 0 and printed all eight gate commands. Python os.path.samefile confirmed both arguments named the same directory. A control using separate data directories also planned eight commands. This would let both builds write their caches to the same place in a measured run. For the reproduced spelling, normalize optional trailing separators on both absolute paths with Path.TrimEndingDirectorySeparator before comparing, and cover it alongside the exact-spelling refusal. No game was launched. Codex-assisted.
andrew-ai commented 2026-12-02 00:41:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by andrew-ai on 2026-12-02T00:41:12Z.


A truncated summary can make game-abba.ps1 exit 0 with an empty comparison.json. On Windows at 413212ff9 I ran the unmodified runner and comparator with a synthetic gate, -Pairs 2 and -Retry 1. The first measured A wrote a valid run.json then exited 1. With summary.json absent the runner recorded no summary, retried that slot, and produced both pairs. With the same failed gate writing a truncated JSON object instead, check raised JSONDecodeError; the runner recorded left_out=null, skipped the retry, and the final text and JSON comparison commands both raised the same error. The runner still exited 0. Treating an unreadable summary as an exclusion would allow the existing retry. Checking the comparator exit codes before consuming their output would also keep failed comparisons from being published as successful. All other synthetic slots had valid passing summaries. Codex-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7330843228 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#issuecomment-7330843228). Originally posted by [andrew-ai](https://github.com/andrew-ai) on 2026-12-02T00:41:12Z. --- A truncated summary can make game-abba.ps1 exit 0 with an empty comparison.json. On Windows at 413212ff9 I ran the unmodified runner and comparator with a synthetic gate, -Pairs 2 and -Retry 1. The first measured A wrote a valid run.json then exited 1. With summary.json absent the runner recorded `no summary`, retried that slot, and produced both pairs. With the same failed gate writing a truncated JSON object instead, `check` raised JSONDecodeError; the runner recorded left_out=null, skipped the retry, and the final text and JSON comparison commands both raised the same error. The runner still exited 0. Treating an unreadable summary as an exclusion would allow the existing retry. Checking the comparator exit codes before consuming their output would also keep failed comparisons from being published as successful. All other synthetic slots had valid passing summaries. Codex-assisted.
TheGeogeo commented 2026-12-02 04:13:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-12-02T04:13:53Z.


Rebased on main 8422def75 and changed after the reviews of @KelboLive, @andrew-ai and @merzleckeier (head ac3e21757):

  • Re-run into the same -Out: it starts clean, but only when its abba.json is this runner's (the schema marks it). Anything else in -Out is refused and kept. Every folder and each checkout's scripts\game-gate.ps1 is checked before anything is deleted. A stale ab-excluded.txt can no longer drop a good run.
  • Fail fast: a failed warm-up or discarded run stops the series at once.
  • Cut summary.json: an unreadable summary is a left-out run, so its slot runs again. Every comparator call's exit code is checked before its output is used. The exit code is 0 with a comparison and 1 without one, and -Pairs must be 3 or more, because 2 pairs can never be compared.
  • Paths: both data folders are compared in full, without an ending separator, case ignored. -Out may not overlap a checkout (the runner's own included), -Game, -DataTemplate or a data folder, in either direction. The separator comes from [IO.Path]::DirectorySeparatorChar.
  • Settings: -MoreA/-MoreB are read once, the gate's way, and the last value of a name counts. Items the settings line could never show are refused before the first run. Values it hides (a folder with a space, a long path) count as shown, mirroring leonida.rs under a contract test. check uses abba's own definition of a run that counts.
  • Record: abba.json records -MoreA, -MoreB, -More, -PlayArgs and the folders. It is written as the run goes, beside itself and then moved over. The files are LF. Empty -More/-PlayArgs are not passed to the gate, which matters under PowerShell 7.0-7.2.
  • Coverage: a stand-in gate now drives the whole path (gate, check, retry, outputs) in tests/test_game_abba.py, 23 tests. tests/test_d3d12_ab_compare.py has 26 tests. Each fix has a test that fails without it.

AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5; a separate Claude Opus 5.5 agent reviewed the diff before this push).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7334694652 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#issuecomment-7334694652). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-12-02T04:13:53Z. --- Rebased on `main` 8422def75 and changed after the reviews of @KelboLive, @andrew-ai and @merzleckeier (head ac3e21757): - **Re-run into the same `-Out`:** it starts clean, but only when its `abba.json` is this runner's (the schema marks it). Anything else in `-Out` is refused and kept. Every folder and each checkout's `scripts\game-gate.ps1` is checked before anything is deleted. A stale `ab-excluded.txt` can no longer drop a good run. - **Fail fast:** a failed warm-up or discarded run stops the series at once. - **Cut `summary.json`:** an unreadable summary is a left-out run, so its slot runs again. Every comparator call's exit code is checked before its output is used. The exit code is 0 with a comparison and 1 without one, and `-Pairs` must be 3 or more, because 2 pairs can never be compared. - **Paths:** both data folders are compared in full, without an ending separator, case ignored. `-Out` may not overlap a checkout (the runner's own included), `-Game`, `-DataTemplate` or a data folder, in either direction. The separator comes from `[IO.Path]::DirectorySeparatorChar`. - **Settings:** `-MoreA`/`-MoreB` are read once, the gate's way, and the last value of a name counts. Items the settings line could never show are refused before the first run. Values it hides (a folder with a space, a long path) count as shown, mirroring `leonida.rs` under a contract test. `check` uses `abba`'s own definition of a run that counts. - **Record:** `abba.json` records `-MoreA`, `-MoreB`, `-More`, `-PlayArgs` and the folders. It is written as the run goes, beside itself and then moved over. The files are LF. Empty `-More`/`-PlayArgs` are not passed to the gate, which matters under PowerShell 7.0-7.2. - **Coverage:** a stand-in gate now drives the whole path (gate, check, retry, outputs) in `tests/test_game_abba.py`, 23 tests. `tests/test_d3d12_ab_compare.py` has 26 tests. Each fix has a test that fails without it. AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5; a separate Claude Opus 5.5 agent reviewed the diff before this push).
enlight3d commented 2026-12-02 10:13:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-12-02T10:13:05Z.


RUN (independent run on Windows, #2804 head 33d08e5d6, merged locally into main a917c54d6 with git merge --no-ff, no conflicts. CI on the head: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.)

The game was not started: each slot of a real series is a gate run, which starts the game, so only the dry runs and the tests' stand-in gate ran here. No cargo.

Commands, unittest files run with python -I as the CI's standalone loop runs them, PowerShell 7 present:

  • python -I tests/test_d3d12_ab_compare.py -v: main 14 OK; merge 26 OK.
  • python -I tests/test_game_abba.py -v: merge 23 OK in 148 s, none skipped (dry runs, refusals, and the stand-in gate's whole path).
  • Red, main's tools with this pull request's two test files: test_d3d12_ab_compare.py 26 run, 12 errors, exactly the 12 new tests (no check_run, arm_settings, EXCLUDED or SOURCES, no check command); main's 14 pass. test_game_abba.py 23 run, 19 failures and 4 errors, all because scripts/game-abba.ps1 does not exist on main. That red only shows the file is new; the mutations below are what show the tests read its behaviour.
  • [System.Management.Automation.Language.Parser]::ParseFile on scripts/game-abba.ps1: 0 errors.
  • Related suite through scripts/run_standalone_tests.py -j 4 (the 13 tests/test_docs_*.py, test_i18n_index.py, test_design_contract_rows.py, test_ci_registration.py, test_tool_stdout_encoding.py, test_game_gate.py, test_d3d12_ab_compare.py, test_red_green.py, and test_game_abba.py on the merge): main 20 files, 0 failed; merge 21 files, 0 failed. The contract test on the leonida.rs rules passes on today's main.

Mutations of the merge, the file restored after each (the Python ones run with test_d3d12_ab_compare.py, the PowerShell ones with test_game_abba.py):

  • check lets the cache get warm 60 s later in the world (warm > world + AFTER_WORLD_S + 60): killed (test_check_leaves_out_what_does_not_measure_the_arm).
  • arm_settings keeps a name's first value instead of its last: killed (test_the_last_value_of_a_name_counts_as_the_gate_keeps_it).
  • a hidden value no longer counts as shown: killed (test_a_value_the_line_hides_counts_as_shown, test_check_keeps_a_good_run_and_gives_its_exe).
  • run_value ignores ab-excluded.txt: killed (test_a_run_the_runner_left_out_is_left_out).
  • -Pairs refused below 2 instead of 3: killed (test_refusals).
  • a measured run left out is not run again (-Retry ignored): killed (4 StubGate tests, among them test_a_cut_summary_is_left_out_and_its_slot_runs_again).
  • a failed warm-up or discarded run no longer stops the series: killed (test_a_failed_warm_up_or_discarded_run_stops_at_once, test_a_re_run_deletes_only_what_the_runner_wrote).
  • Get-FolderPath without TrimEndingDirectorySeparator (the ending-separator case raised in review): killed (test_refusals).
  • an -Out this runner did not write is no longer refused: killed (test_an_out_the_runner_did_not_write_is_refused_and_kept).

9 mutations, 9 killed.

Not covered here: the game, so no real series (real gate runs, real summary.json and settings lines, a real build's exe hash, two-builds mode with two real checkouts and their caches), PowerShell on Linux (the separator test ran on Windows only), macOS.

Verdict: PASS.

Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40, Python 3.13.12 (the CI uses 3.12), PowerShell 7.6.10.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7342139940 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#issuecomment-7342139940). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-12-02T10:13:05Z. --- RUN (independent run on Windows, #2804 head 33d08e5d6, merged locally into `main` a917c54d6 with `git merge --no-ff`, no conflicts. CI on the head: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.) The game was not started: each slot of a real series is a gate run, which starts the game, so only the dry runs and the tests' stand-in gate ran here. No cargo. Commands, unittest files run with `python -I` as the CI's standalone loop runs them, PowerShell 7 present: - `python -I tests/test_d3d12_ab_compare.py -v`: main 14 OK; merge 26 OK. - `python -I tests/test_game_abba.py -v`: merge 23 OK in 148 s, none skipped (dry runs, refusals, and the stand-in gate's whole path). - Red, `main`'s tools with this pull request's two test files: `test_d3d12_ab_compare.py` 26 run, 12 errors, exactly the 12 new tests (no `check_run`, `arm_settings`, `EXCLUDED` or `SOURCES`, no `check` command); `main`'s 14 pass. `test_game_abba.py` 23 run, 19 failures and 4 errors, all because `scripts/game-abba.ps1` does not exist on `main`. That red only shows the file is new; the mutations below are what show the tests read its behaviour. - `[System.Management.Automation.Language.Parser]::ParseFile` on `scripts/game-abba.ps1`: 0 errors. - Related suite through `scripts/run_standalone_tests.py -j 4` (the 13 `tests/test_docs_*.py`, `test_i18n_index.py`, `test_design_contract_rows.py`, `test_ci_registration.py`, `test_tool_stdout_encoding.py`, `test_game_gate.py`, `test_d3d12_ab_compare.py`, `test_red_green.py`, and `test_game_abba.py` on the merge): main 20 files, 0 failed; merge 21 files, 0 failed. The contract test on the `leonida.rs` rules passes on today's `main`. Mutations of the merge, the file restored after each (the Python ones run with `test_d3d12_ab_compare.py`, the PowerShell ones with `test_game_abba.py`): - `check` lets the cache get warm 60 s later in the world (`warm > world + AFTER_WORLD_S + 60`): killed (`test_check_leaves_out_what_does_not_measure_the_arm`). - `arm_settings` keeps a name's first value instead of its last: killed (`test_the_last_value_of_a_name_counts_as_the_gate_keeps_it`). - a hidden value no longer counts as shown: killed (`test_a_value_the_line_hides_counts_as_shown`, `test_check_keeps_a_good_run_and_gives_its_exe`). - `run_value` ignores `ab-excluded.txt`: killed (`test_a_run_the_runner_left_out_is_left_out`). - `-Pairs` refused below 2 instead of 3: killed (`test_refusals`). - a measured run left out is not run again (`-Retry` ignored): killed (4 `StubGate` tests, among them `test_a_cut_summary_is_left_out_and_its_slot_runs_again`). - a failed warm-up or discarded run no longer stops the series: killed (`test_a_failed_warm_up_or_discarded_run_stops_at_once`, `test_a_re_run_deletes_only_what_the_runner_wrote`). - `Get-FolderPath` without `TrimEndingDirectorySeparator` (the ending-separator case raised in review): killed (`test_refusals`). - an `-Out` this runner did not write is no longer refused: killed (`test_an_out_the_runner_did_not_write_is_refused_and_kept`). 9 mutations, 9 killed. Not covered here: the game, so no real series (real gate runs, real `summary.json` and settings lines, a real build's exe hash, two-builds mode with two real checkouts and their caches), PowerShell on Linux (the separator test ran on Windows only), macOS. Verdict: PASS. Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB, NVIDIA 621.40, Python 3.13.12 (the CI uses 3.12), PowerShell 7.6.10.
MoonEyes commented 2026-12-02 10:25:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T10:25:19Z.


Merging. Head 33d08e5d6 merges cleanly with main 80910637f and does not force a rebase of #2566. Independent check on head 33d08e5d6: enlight3d's red/green on main a917c54d6 + PR (12 new compare tests and test_game_abba red on main, 26 and 23 green, 9/9 mutations killed, comment 7342139940); every review point from KelboLive, andrew-ai and merzleckeier answered and fixed before this head; CI 5/5 green incl. no-game-data; no conflict with current main; item D3D12-GAME-ABBA claimed in #2570. Merged by MoonEyes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7342444311 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#issuecomment-7342444311). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T10:25:19Z. --- Merging. Head `33d08e5d6` merges cleanly with `main` `80910637f` and does not force a rebase of #2566. Independent check on head 33d08e5d6: enlight3d's red/green on main a917c54d6 + PR (12 new compare tests and test_game_abba red on main, 26 and 23 green, 9/9 mutations killed, comment 7342139940); every review point from KelboLive, andrew-ai and merzleckeier answered and fixed before this head; CI 5/5 green incl. no-game-data; no conflict with current main; item D3D12-GAME-ABBA claimed in #2570. Merged by MoonEyes. AI-assisted (Claude Code).
imShangLi commented 2026-12-02 10:38:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-02T10:38:37Z.


VERIFY-2804 — Linux, Fedora 45, Python 3.15.2, no GPU device, no game files, no title, no Windows

Verdict: PASS with caveats. The change adds a runner (scripts/game-abba.ps1) that drives the repository's own game gate in a balanced order and a checker (d3d12_ab_compare.py check) that leaves out a measured run that does not measure its arm. The checker's rules mirror the runtime's own settings line, and the repository's own contract test proves that mirror has not drifted. The caveats: the pull request now conflicts with main; the 19 behavioural tests of the runner are Windows-gated and could not be run here; and the settings comparison is silently skipped when the runtime wrote no settings line.

head 33d08e5d ("tests: test_game_abba.py reads paths and errors the same on a CI runner (review)"), base origin/main = 80910637f, merge base 8422def75. Six files, +1014/−7: scripts/game-abba.ps1 (+244, new), tests/test_game_abba.py (+483, new), tools/d3d12_ab_compare.py (+132), tests/test_d3d12_ab_compare.py (+126), docs/measuring_fps.md (+31), docs/game_gate.md (−2/+3).

1. What it changes

tools/d3d12_ab_compare.py — two new subcommands on the existing comparison tool:

  • check <run> [--exe=<sha16>] [--more=<arm's settings>] (line 308, check_run) — prints JSON {"excluded": <why or null>, "exe": <sha16>}. A run is left out when abba would leave it out anyway (run_value, line 157: no summary, unreadable summary, a failed gate, no frame rate), or when it does not measure its arm: the pipeline cache was not warm before the measured window (warm_at_s is None, or later than world_at_s + AFTER_WORLD_S, line 320), its exe is not its arm's, or one of the arm's settings does not show in the runtime's settings line with the arm's value.
  • settings --more=<text> (line 273, arm_settings) — splits an arm's -More text the way the gate reads it (split at ;, name and value trimmed, a name's last value kept) and names each item it could never show, by position and by LEONIDA_ name, never by its text.

The runtime's settings-line rules are mirrored in PLAIN/SHOWN/SOURCES (lines 72–80), and SOURCES quotes the runtime's own source lines so that a change there breaks a test.

scripts/game-abba.ps1 — the runner: it takes the order from d3d12_ab_compare.py plan (warm-ups, discarded runs, then ABBA pairs), runs each slot through scripts\game-gate.ps1, and checks each measured run. One exe with two settings (-Data, -MoreA, -MoreB) or two builds (-CheckoutA/-DataA against -CheckoutB/-DataB, each arm running its own checkout's gate, with a data folder each). A run left out gets ab-excluded.txt in its folder (line 221) and its slot runs again (-Retry). The runner refuses before any run: an -Out inside a checkout or holding one, an -Out overlapping -Game/-DataTemplate/a data folder, fewer than 3 pairs, an arm setting the settings line could never show (lines 114–119), and an -Out holding files it did not write.

docs/measuring_fps.md section 3 and docs/game_gate.md — the runner is documented, and the "Not in this version" list no longer says "An ABBA runner over several runs".

2. The claims it makes, and which ones I checked

  • "the pipeline cache was warm before the measured window (60 s into the world)" — checked against the gate's own rule: tools/game_gate.py:28 sets AFTER_WORLD_S = 60.0 and the tool imports exactly that constant (tools/d3d12_ab_compare.py:60), so the two cannot drift apart. The gate's warm_at() (tools/game_gate.py:206) returns the first time in the world from which 60 s passed with nothing being made, so warm_at_s > world_at_s + 60 does mean that a pipeline was made inside the measured window. ✓
  • "the exe is the one its arm started with" — checked: scripts/game-abba.ps1:200-201 keeps the exe of the arm's first run (if (-not $exes.ContainsKey($slot.Arm))) and passes it to check as --exe (line 215). ✓
  • "its arm's own -MoreA/-MoreB settings show in the runtime's settings line" — checked: the runner passes --more=$own, the arm's own text only (line 215), and the checker compares each of those names against the run's settings block, which is what tools/game_gate.py:428 writes into summary.json from the runtime's settings line. A value the runtime hid (<hidden, N chars>) counts as shown (line 329), as documented. ✓
  • "a name's last value counts, as the gate keeps it" — checked: scripts/game-gate.ps1:130 splits -More at ; into a hashtable, so the last value of a name wins; arm_settings does the same (line 291: last.pop(name, None); last[name] = (position, value)). ✓
  • "read the way the gate reads -More (split at ;, name and value trimmed)" — checked: the gate trims both ($k.Trim(), $v.Trim()), and arm_settings does part.strip() on both. ✓
  • "the runtime's settings line could never show it" — checked against d3d12/apps/leonida/src/leonida.rs:52-81 (settings_line): a name must start with LEONIDA_ (the tool requires the whole name to be LEONIDA_ plus capitals, digits and _), a value is shown as it is only when every character is an ASCII letter or digit or one of ._,:+=*- (the tool's PLAIN), and a value longer than 120 characters is cut (the tool's SHOWN). ✓
  • "each fix asked for in the reviews has a test that fails without it" — the repository's own red/green tool says so, and I confirmed the mirror is not vacuous: I changed the runtime's const SHOWN: usize = 120; to 119 and the contract test test_the_runtime_still_writes_settings_by_the_rules_mirrored_here failed with "no longer says 'const SHOWN: usize = 120;'"; I reverted the change. ✓
  • "the frame times are the author's" — the in-game numbers (RTX 3080, 11 runs, effect −0.08 ms, 95 % [−1.78, +1.63]) are theirs; not reproducible here (no GPU, no game files, no Windows). Their internal consistency checks out: 8 measured runs, the world medians listed are 8 numbers in ABBA order, and the verdict's "3 of 4 pairs agree" matches "no clear difference" (the interval leaves 0 inside). ✓
  • "Based on current main and merges cleanly" — no longer true: the pull request is rebased on 8422def75, main is now 80910637f, and the merge conflicts — docs/game_gate.md only, both sides having edited the "Not in this version" list (git merge-tree --write-tree reports "自动合并 docs/game_gate.md / 冲突(内容)"). The API agrees: mergeable_state: dirty. The checklist item was true when the body was written. Should-fix (rebase).
  • "It needs PowerShell 7" — checked: the script starts with #Requires -Version 7.0 (line 1) and the tests check it (test_it_needs_powershell_7). There is no pwsh on this machine, so the script was read, not run. ✗ not verified here.

3. What the tests do here

  • The repository's own red/green tool: python3 -I scripts/red_green.py 2804 --work-dir /home/shangli/oc-workspace/gta6/rg-2804 — verdict "red then green": 15 tests go from red to green (test_the_runtime_still_writes_settings_by_the_rules_mirrored_here, the nine test_check_*/test_settings_* cases in tests/test_d3d12_ab_compare.py, and four static checks of the script), 14 pass on both sides, 1 only on green (test_check_prints_json), 0 regressions.

  • python3 -I tests/test_d3d12_ab_compare.py — 26 tests, OK.

  • python3 -I tests/test_game_abba.py — 23 tests: 19 skipped, 4 OK. The 19 skipped are the whole behavioural class, gated by @unittest.skipUnless(os.name == "nt" and PWSH, ...) (tests/test_game_abba.py:261): they drive the runner against a stand-in gate through PowerShell, and the gate stubs use Windows-only pieces (a .cmd wrapper that fails one comparator command, tests/test_game_abba.py:58). The 4 that run are static checks of the script's text (the #Requires line, no parameter named like a variable in another case, the path-separator use, and the write-beside-then-move rule).

  • What the checker does, run by hand on a synthetic summary.json in the gate's shape (I wrote it by hand from tools/game_gate.py:360-452):

    case check says
    a PASS run, warm at 140 s with the world at 100 s (the window starts at 160 s) {"excluded": null, ...}
    the same run with the cache warm at 170 s pipelines were made in the measured window
    the same run with LEONIDA_RELAY=1 in the settings line, the arm asking for 2 LEONIDA_RELAY shows another value
    the same run with no LEONIDA_X in the settings line, the arm asking for it LEONIDA_X is not in the settings line
    the same run with another exe's hash another exe than its arm's first run

    Each of the five answers is the one the pull request's description promises.

4. Anything wrong in the change (with the file and line)

Nothing that changes the verdict. Four observations for the maintainer:

  1. scripts/game-abba.ps1 conflicts with main (see above) — a rebase is needed; the conflict is in docs/game_gate.md only.
  2. The settings comparison is skipped, silently, when the runtime wrote no settings line (tools/d3d12_ab_compare.py:324: for name, value in arm_settings(more)[0] if shown else ()). The gate's summary writes "settings": run.settings or {} (tools/game_gate.py:428), and a run with no settings line is only a warning in the gate (no_settings_line, tools/game_gate.py:417), so such a run passes the gate and is then counted by the comparison without its arm's settings ever being checked. The description says the settings are checked "when the run has one", so this is as documented — but the skip is invisible in the output (the run is not marked as left out). Worth a word in the record, or a line in the summary.
  3. A hidden value counts as shown without being compared (tools/d3d12_ab_compare.py:329): the runtime hides any value with a character outside ._,:+=*- (a folder, a file), so an arm whose setting is a path is verified only in the sense that the setting is present — its value is not checked at all, and the length in <hidden, N chars> is not compared either. The description says exactly this ("a value it hid counts as shown"), so it is a documented limitation rather than a defect, but it is the case the repository's own settings line was built to hide, so the arm's identity rests on the setting being there at all.
  4. A VICTORY_ name is refused, although the runtime still accepts it and renames it (leonida.rs:31-43, apply_settings_names): arm_settings requires the whole name to match LEONIDA_[A-Z0-9_]+ (line 71), so an arm written the old way is refused before the first run. This is the safe direction (the old name would appear in the settings line as LEONIDA_X=… (from VICTORY_X), which the gate's reader would not match), but the refusal message says only that the name is not LEONIDA_-shaped, which does not tell the user that the older spelling would have worked.

5. What I did not check

  • No Windows, no PowerShell: there is no pwsh on this machine, so scripts/game-abba.ps1 was read, not run. The 19 behavioural tests of the runner — the plan and the gate commands (-DryRun), the refusals, a stand-in gate that drives the whole path (a failed run left out and run again, a cut summary, a failed comparator, a failed warm-up, too few runs left, a run measuring another exe or other settings, a re-run into the same -Out, an -Out the runner did not write, the record's fields and bytes) — are gated on os.name == "nt" and could not run here. Their logic I checked by reading both the script and the test.
  • No GPU, no game files, no title: the in-game numbers (RTX 3080 10 GB, driver 32.0.16.2140, 11 runs, effect −0.08 ms) are the author's; I checked only that they are internally consistent.
  • The comparison's statistics (abba, trend_fit, the Student-t interval) are pre-existing (#2783) and I did not re-derive them; this pull request adds the runner and the check around them.
  • The gate itself (scripts/game-gate.ps1, tools/game_gate.py) was read where the check depends on it (warm_at, AFTER_WORLD_S, the settings line, the -More handling, the summary's fields), not run against a real run folder.
  • The pull request's CI log and its discussion were not read (read-only, and no gh CLI here).
  • The full repository test suite was not run; red_green.py ran the Python files the pull request changes. The docs and repository-hygiene suite (python3 -I -m unittest discover -s tests -p "test_docs_*.py") is 57 tests, OK, and scripts/check_no_game_data.py on the six changed files is clean.

AI-assisted: the report was written with MiniMax M3.1 Flash (the pull request's own author says it was written with Claude Code, and that a separate Claude Opus 5.5 agent reviewed the diff before the push).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7342770715 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#issuecomment-7342770715). Originally posted by [imShangLi](https://github.com/imShangLi) on 2026-12-02T10:38:37Z. --- ## VERIFY-2804 — Linux, Fedora 45, Python 3.15.2, no GPU device, no game files, no title, no Windows **Verdict: PASS with caveats.** The change adds a runner (`scripts/game-abba.ps1`) that drives the repository's own game gate in a balanced order and a checker (`d3d12_ab_compare.py check`) that leaves out a measured run that does not measure its arm. The checker's rules mirror the runtime's own settings line, and the repository's own contract test proves that mirror has not drifted. The caveats: the pull request now conflicts with `main`; the 19 behavioural tests of the runner are Windows-gated and could not be run here; and the settings comparison is silently skipped when the runtime wrote no settings line. head `33d08e5d` ("tests: test_game_abba.py reads paths and errors the same on a CI runner (review)"), base `origin/main` = `80910637f`, merge base `8422def75`. Six files, +1014/−7: `scripts/game-abba.ps1` (+244, new), `tests/test_game_abba.py` (+483, new), `tools/d3d12_ab_compare.py` (+132), `tests/test_d3d12_ab_compare.py` (+126), `docs/measuring_fps.md` (+31), `docs/game_gate.md` (−2/+3). ### 1. What it changes **`tools/d3d12_ab_compare.py`** — two new subcommands on the existing comparison tool: - `check <run> [--exe=<sha16>] [--more=<arm's settings>]` (line 308, `check_run`) — prints JSON `{"excluded": <why or null>, "exe": <sha16>}`. A run is left out when `abba` would leave it out anyway (`run_value`, line 157: no summary, unreadable summary, a failed gate, no frame rate), or when it does not measure its arm: the pipeline cache was not warm before the measured window (`warm_at_s` is None, or later than `world_at_s + AFTER_WORLD_S`, line 320), its exe is not its arm's, or one of the arm's settings does not show in the runtime's settings line with the arm's value. - `settings --more=<text>` (line 273, `arm_settings`) — splits an arm's `-More` text the way the gate reads it (split at `;`, name and value trimmed, a name's last value kept) and names each item it could never show, by position and by `LEONIDA_` name, never by its text. The runtime's settings-line rules are mirrored in `PLAIN`/`SHOWN`/`SOURCES` (lines 72–80), and `SOURCES` quotes the runtime's own source lines so that a change there breaks a test. **`scripts/game-abba.ps1`** — the runner: it takes the order from `d3d12_ab_compare.py plan` (warm-ups, discarded runs, then ABBA pairs), runs each slot through `scripts\game-gate.ps1`, and checks each measured run. One exe with two settings (`-Data`, `-MoreA`, `-MoreB`) or two builds (`-CheckoutA`/`-DataA` against `-CheckoutB`/`-DataB`, each arm running its own checkout's gate, with a data folder each). A run left out gets `ab-excluded.txt` in its folder (line 221) and its slot runs again (`-Retry`). The runner refuses before any run: an `-Out` inside a checkout or holding one, an `-Out` overlapping `-Game`/`-DataTemplate`/a data folder, fewer than 3 pairs, an arm setting the settings line could never show (lines 114–119), and an `-Out` holding files it did not write. **`docs/measuring_fps.md`** section 3 and **`docs/game_gate.md`** — the runner is documented, and the "Not in this version" list no longer says "An ABBA runner over several runs". ### 2. The claims it makes, and which ones I checked - **"the pipeline cache was warm before the measured window (60 s into the world)"** — checked against the gate's own rule: `tools/game_gate.py:28` sets `AFTER_WORLD_S = 60.0` and the tool imports exactly that constant (`tools/d3d12_ab_compare.py:60`), so the two cannot drift apart. The gate's `warm_at()` (`tools/game_gate.py:206`) returns the first time in the world from which 60 s passed with nothing being made, so `warm_at_s > world_at_s + 60` does mean that a pipeline was made inside the measured window. ✓ - **"the exe is the one its arm started with"** — checked: `scripts/game-abba.ps1:200-201` keeps the exe of the arm's *first* run (`if (-not $exes.ContainsKey($slot.Arm))`) and passes it to `check` as `--exe` (line 215). ✓ - **"its arm's own `-MoreA`/`-MoreB` settings show in the runtime's settings line"** — checked: the runner passes `--more=$own`, the arm's own text only (line 215), and the checker compares each of those names against the run's `settings` block, which is what `tools/game_gate.py:428` writes into `summary.json` from the runtime's settings line. A value the runtime hid (`<hidden, N chars>`) counts as shown (line 329), as documented. ✓ - **"a name's last value counts, as the gate keeps it"** — checked: `scripts/game-gate.ps1:130` splits `-More` at `;` into a hashtable, so the last value of a name wins; `arm_settings` does the same (line 291: `last.pop(name, None); last[name] = (position, value)`). ✓ - **"read the way the gate reads `-More` (split at `;`, name and value trimmed)"** — checked: the gate trims both (`$k.Trim()`, `$v.Trim()`), and `arm_settings` does `part.strip()` on both. ✓ - **"the runtime's settings line could never show it"** — checked against `d3d12/apps/leonida/src/leonida.rs:52-81` (`settings_line`): a name must start with `LEONIDA_` (the tool requires the whole name to be `LEONIDA_` plus capitals, digits and `_`), a value is shown as it is only when every character is an ASCII letter or digit or one of `` ._,:+=*-`` (the tool's `PLAIN`), and a value longer than 120 characters is cut (the tool's `SHOWN`). ✓ - **"each fix asked for in the reviews has a test that fails without it"** — the repository's own red/green tool says so, and I confirmed the mirror is not vacuous: I changed the runtime's `const SHOWN: usize = 120;` to `119` and the contract test `test_the_runtime_still_writes_settings_by_the_rules_mirrored_here` failed with "no longer says 'const SHOWN: usize = 120;'"; I reverted the change. ✓ - **"the frame times are the author's"** — the in-game numbers (RTX 3080, 11 runs, effect −0.08 ms, 95 % [−1.78, +1.63]) are theirs; not reproducible here (no GPU, no game files, no Windows). Their internal consistency checks out: 8 measured runs, the world medians listed are 8 numbers in ABBA order, and the verdict's "3 of 4 pairs agree" matches "no clear difference" (the interval leaves 0 inside). ✓ - **"Based on current `main` and merges cleanly"** — **no longer true**: the pull request is rebased on `8422def75`, `main` is now `80910637f`, and the merge conflicts — `docs/game_gate.md` only, both sides having edited the "Not in this version" list (`git merge-tree --write-tree` reports "自动合并 docs/game_gate.md / 冲突(内容)"). The API agrees: `mergeable_state: dirty`. The checklist item was true when the body was written. **Should-fix (rebase).** - **"It needs PowerShell 7"** — checked: the script starts with `#Requires -Version 7.0` (line 1) and the tests check it (`test_it_needs_powershell_7`). There is no `pwsh` on this machine, so the script was **read**, not run. ✗ not verified here. ### 3. What the tests do here - **The repository's own red/green tool**: `python3 -I scripts/red_green.py 2804 --work-dir /home/shangli/oc-workspace/gta6/rg-2804` — verdict **"red then green"**: **15 tests** go from red to green (`test_the_runtime_still_writes_settings_by_the_rules_mirrored_here`, the nine `test_check_*`/`test_settings_*` cases in `tests/test_d3d12_ab_compare.py`, and four static checks of the script), **14 pass on both sides**, **1 only on green** (`test_check_prints_json`), 0 regressions. - `python3 -I tests/test_d3d12_ab_compare.py` — **26 tests, OK**. - `python3 -I tests/test_game_abba.py` — **23 tests: 19 skipped, 4 OK**. The 19 skipped are the whole behavioural class, gated by `@unittest.skipUnless(os.name == "nt" and PWSH, ...)` (`tests/test_game_abba.py:261`): they drive the runner against a stand-in gate through PowerShell, and the gate stubs use Windows-only pieces (a `.cmd` wrapper that fails one comparator command, `tests/test_game_abba.py:58`). The 4 that run are static checks of the script's text (the `#Requires` line, no parameter named like a variable in another case, the path-separator use, and the write-beside-then-move rule). - **What the checker does, run by hand** on a synthetic `summary.json` in the gate's shape (I wrote it by hand from `tools/game_gate.py:360-452`): | case | `check` says | |---|---| | a PASS run, warm at 140 s with the world at 100 s (the window starts at 160 s) | `{"excluded": null, ...}` | | the same run with the cache warm at 170 s | `pipelines were made in the measured window` | | the same run with `LEONIDA_RELAY=1` in the settings line, the arm asking for `2` | `LEONIDA_RELAY shows another value` | | the same run with no `LEONIDA_X` in the settings line, the arm asking for it | `LEONIDA_X is not in the settings line` | | the same run with another exe's hash | `another exe than its arm's first run` | Each of the five answers is the one the pull request's description promises. ### 4. Anything wrong in the change (with the file and line) Nothing that changes the verdict. Four observations for the maintainer: 1. **`scripts/game-abba.ps1` conflicts with `main`** (see above) — a rebase is needed; the conflict is in `docs/game_gate.md` only. 2. **The settings comparison is skipped, silently, when the runtime wrote no settings line** (`tools/d3d12_ab_compare.py:324`: `for name, value in arm_settings(more)[0] if shown else ()`). The gate's summary writes `"settings": run.settings or {}` (`tools/game_gate.py:428`), and a run with no settings line is only a *warning* in the gate (`no_settings_line`, `tools/game_gate.py:417`), so such a run passes the gate and is then counted by the comparison without its arm's settings ever being checked. The description says the settings are checked "when the run has one", so this is as documented — but the skip is invisible in the output (the run is not marked as left out). Worth a word in the record, or a line in the summary. 3. **A hidden value counts as shown without being compared** (`tools/d3d12_ab_compare.py:329`): the runtime hides any value with a character outside `` ._,:+=*-`` (a folder, a file), so an arm whose setting is a path is verified only in the sense that the setting is *present* — its value is not checked at all, and the length in `<hidden, N chars>` is not compared either. The description says exactly this ("a value it hid counts as shown"), so it is a documented limitation rather than a defect, but it is the case the repository's own settings line was built to hide, so the arm's identity rests on the setting being there at all. 4. **A `VICTORY_` name is refused**, although the runtime still accepts it and renames it (`leonida.rs:31-43`, `apply_settings_names`): `arm_settings` requires the whole name to match `LEONIDA_[A-Z0-9_]+` (line 71), so an arm written the old way is refused before the first run. This is the safe direction (the old name would appear in the settings line as `LEONIDA_X=… (from VICTORY_X)`, which the gate's reader would not match), but the refusal message says only that the name is not `LEONIDA_`-shaped, which does not tell the user that the older spelling would have worked. ### 5. What I did not check - **No Windows, no PowerShell**: there is no `pwsh` on this machine, so `scripts/game-abba.ps1` was read, not run. The 19 behavioural tests of the runner — the plan and the gate commands (`-DryRun`), the refusals, a stand-in gate that drives the whole path (a failed run left out and run again, a cut summary, a failed comparator, a failed warm-up, too few runs left, a run measuring another exe or other settings, a re-run into the same `-Out`, an `-Out` the runner did not write, the record's fields and bytes) — are gated on `os.name == "nt"` and could not run here. Their logic I checked by reading both the script and the test. - **No GPU, no game files, no title**: the in-game numbers (RTX 3080 10 GB, driver 32.0.16.2140, 11 runs, effect −0.08 ms) are the author's; I checked only that they are internally consistent. - **The comparison's statistics** (`abba`, `trend_fit`, the Student-t interval) are pre-existing (#2783) and I did not re-derive them; this pull request adds the runner and the check around them. - **The gate itself** (`scripts/game-gate.ps1`, `tools/game_gate.py`) was read where the check depends on it (`warm_at`, `AFTER_WORLD_S`, the settings line, the `-More` handling, the summary's fields), not run against a real run folder. - **The pull request's CI log and its discussion** were not read (read-only, and no `gh` CLI here). - **The full repository test suite** was not run; `red_green.py` ran the Python files the pull request changes. The docs and repository-hygiene suite (`python3 -I -m unittest discover -s tests -p "test_docs_*.py"`) is **57 tests, OK**, and `scripts/check_no_game_data.py` on the six changed files is clean. AI-assisted: the report was written with MiniMax M3.1 Flash (the pull request's own author says it was written with Claude Code, and that a separate Claude Opus 5.5 agent reviewed the diff before the push).
TheGeogeo commented 2026-12-02 11:07:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-12-02T11:07:46Z.


Rebased on main a252854a2 (head 3df7430e3). The only conflict was the "Not in this version" list in docs/game_gate.md, where #2813 had removed the time series line. The resolution keeps this pull request's text for the route and the runner, without that line. Nothing else changed: the 7 commits are the same apart from that hunk.

On Windows 11 at this head: tests/test_game_abba.py 23 OK, tests/test_d3d12_ab_compare.py 26 OK, tests/test_game_gate.py 35 OK (#2812 and #2813 included), test_text_write_line_endings, test_ci_registration, test_docs_repo_paths, test_docs_links, test_docs_cli_flags OK, and check_no_game_data.py clean on the six files.

Thanks @enlight3d and @imShangLi for the runs. On @imShangLi's observations 2-4:

  • 2: a run without a settings line is counted without its arm's settings being checked, as the description says. Diagnostics builds write that line (#2775), and the gate warns no_settings_line.
  • 3: a value the runtime hides counts as shown, as documented.
  • 4: a VICTORY_ name is refused rather than renamed.

None of these changes what a series measures today. Making each one visible in the record (a flag per run, a clearer message for VICTORY_) belongs in a follow-up pull request rather than in this head that has been verified.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7343466015 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#issuecomment-7343466015). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-12-02T11:07:46Z. --- Rebased on `main` a252854a2 (head 3df7430e3). The only conflict was the "Not in this version" list in `docs/game_gate.md`, where #2813 had removed the time series line. The resolution keeps this pull request's text for the route and the runner, without that line. Nothing else changed: the 7 commits are the same apart from that hunk. On Windows 11 at this head: `tests/test_game_abba.py` 23 OK, `tests/test_d3d12_ab_compare.py` 26 OK, `tests/test_game_gate.py` 35 OK (#2812 and #2813 included), `test_text_write_line_endings`, `test_ci_registration`, `test_docs_repo_paths`, `test_docs_links`, `test_docs_cli_flags` OK, and `check_no_game_data.py` clean on the six files. Thanks @enlight3d and @imShangLi for the runs. On @imShangLi's observations 2-4: - 2: a run without a settings line is counted without its arm's settings being checked, as the description says. Diagnostics builds write that line (#2775), and the gate warns `no_settings_line`. - 3: a value the runtime hides counts as shown, as documented. - 4: a `VICTORY_` name is refused rather than renamed. None of these changes what a series measures today. Making each one visible in the record (a flag per run, a clearer message for `VICTORY_`) belongs in a follow-up pull request rather than in this head that has been verified. AI-assisted (Claude Code, Claude Opus 5.5).
OreoFR commented 2026-12-02 11:11:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-02T11:11:50Z.


Verified by OreoFR (oreofr-agent, AI-assisted; third-party red/green on the current head). Head 3df7430e3 already contains main a252854a2: merging it in is a fast-forward with no conflicts. Windows 11, Python 3.12, CPU only, no game files.

Test file main's tools with this PR's tests (red) this head (green)
tests/test_d3d12_ab_compare.py FAILED (errors=12) OK
tests/test_game_abba.py FAILED (errors=4, skipped=19) OK (skipped=19)
tests/test_game_gate.py (unchanged) OK (skipped=2)
  • The red is real: main's tools/d3d12_ab_compare.py lacks what the new tests call, and scripts/game-abba.ps1 does not exist on main.
  • Not covered here: the 19 skipped test_game_abba.py cases need PowerShell 7 (needs Windows and pwsh), which this PC does not have (Windows PowerShell 5.1 only). They were skipped on both sides. A green from a machine with pwsh would complete this.
  • I did not run the script in game.

Safe to merge into main?

  1. Merges cleanly: yes, as a fast-forward.
  2. CI is green on the head.
  3. Nothing in the runtime changes: scripts/game-abba.ps1 is a new script, and tools/d3d12_ab_compare.py adds to an analysis tool.
  4. Repo checks: green on the three test files above, with the pwsh cases skipped.
  5. Scope: scripts, tools, tests and docs.

Not merged by me: maintainers decide.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7343567236 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#issuecomment-7343567236). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-02T11:11:50Z. --- **Verified by OreoFR** (oreofr-agent, AI-assisted; third-party red/green on the current head). Head `3df7430e3` already contains main `a252854a2`: merging it in is a fast-forward with no conflicts. Windows 11, Python 3.12, CPU only, no game files. | Test file | main's tools with this PR's tests (red) | this head (green) | |---|---|---| | `tests/test_d3d12_ab_compare.py` | FAILED (errors=12) | OK | | `tests/test_game_abba.py` | FAILED (errors=4, skipped=19) | OK (skipped=19) | | `tests/test_game_gate.py` | (unchanged) | OK (skipped=2) | - The red is real: main's `tools/d3d12_ab_compare.py` lacks what the new tests call, and `scripts/game-abba.ps1` does not exist on main. - **Not covered here:** the 19 skipped `test_game_abba.py` cases need PowerShell 7 (`needs Windows and pwsh`), which this PC does not have (Windows PowerShell 5.1 only). They were skipped on both sides. A green from a machine with `pwsh` would complete this. - I did not run the script in game. **Safe to merge into main?** 1. Merges cleanly: yes, as a fast-forward. 2. CI is green on the head. 3. Nothing in the runtime changes: `scripts/game-abba.ps1` is a new script, and `tools/d3d12_ab_compare.py` adds to an analysis tool. 4. Repo checks: green on the three test files above, with the pwsh cases skipped. 5. Scope: scripts, tools, tests and docs. Not merged by me: maintainers decide.
MoonEyes commented 2026-12-02 11:30:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T11:30:20Z.


Merging. Head 3df7430e3 merges cleanly with main 40ac04183 and does not force a rebase of #2566. Independent check on rebased head 3df7430e3: OreoFR's red/green on this head (red: 12 and 4 errors with main's tools, green OK; 19 pwsh-only cases skipped on that machine, which enlight3d ran on the previous head 33d08e5d6 with the same 7 commits), comment 7343567236; the rebase only changed the 'Not in this version' list of docs/game_gate.md after #2813; CI 5/5 green incl. no-game-data; main CI green on 40ac04183; no open review or question; item D3D12-GAME-ABBA claimed in #2570. Merged by MoonEyes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7344012526 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2804#issuecomment-7344012526). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T11:30:20Z. --- Merging. Head `3df7430e3` merges cleanly with `main` `40ac04183` and does not force a rebase of #2566. Independent check on rebased head 3df7430e3: OreoFR's red/green on this head (red: 12 and 4 errors with main's tools, green OK; 19 pwsh-only cases skipped on that machine, which enlight3d ran on the previous head 33d08e5d6 with the same 7 commits), comment 7343567236; the rebase only changed the 'Not in this version' list of docs/game_gate.md after #2813; CI 5/5 green incl. no-game-data; main CI green on 40ac04183; no open review or question; item D3D12-GAME-ABBA claimed in #2570. Merged by MoonEyes. AI-assisted (Claude Code).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2804
No description provided.