Repository navigation
Conversation
|
Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12, head MEASURED
READ IN CODE
ASSUMED
AI-assisted: Claude Code |
|
Verified on Windows, with the control that matters: the tests fail when the change is reverted. Cherry-picked onto
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 - AI-assisted: yes - DeepSeek v4.1 (flash), applied and ran both arms on the machine above. Written with an AI assistant. |
KelboLive
left a comment
There was a problem hiding this comment.
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
-Outinside the runner's checkout is accepted: the guard (:65-67) loops only-CheckoutA/-CheckoutB; add$repo. I passed-Outinside 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.
|
I checked 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. |
|
The two-build cache guard accepts the same Windows directory if one argument ends in a separator. At 413212f 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. |
|
A truncated summary can make game-abba.ps1 exit 0 with an empty comparison.json. On Windows at 413212f 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 |
… (D3D12-GAME-ABBA) The runner takes the order from d3d12_ab_compare.py plan (warm-up runs, discarded runs, then ABBA pairs) and runs each slot through scripts/game-gate.ps1, for one exe with two settings or for two builds (a checkout and a data folder per arm). Each measured run is checked by the new `d3d12_ab_compare.py check`: its gate passed, the pipeline cache was warm before the measured window, its exe is its arm's first one, and its arm's own settings show in the runtime's settings line when there is one. A run that fails gets an ab-excluded.txt, which `abba` now leaves out, and its slot runs again (-Retry, 1). The runner ends with the comparison in <Out>/comparison.txt and comparison.json, and abba.json says what ran and what was left out. -DryRun prints the plan and the gate commands. It needs PowerShell 7 (#Requires).
…on out (review) A summary.json cut short (a gate stopped while writing it), not JSON, or not an object made `check` and `abba` raise. Both now read it through read_summary() and give "unreadable summary" as the reason the run is left out, so the runner retries the slot instead of recording nothing and comparing without it.
…up, checks the comparator and records the arms (review) - A run into an -Out used before first deletes what the earlier one wrote there (runs, abba.json, comparison.*): a run folder of the same name kept its ab-excluded.txt, which left a good run out while abba.json said left_out null, and its data copy. - A warm-up or discarded run whose gate fails stops the runner at once, before the measured runs. - Every call of d3d12_ab_compare.py (plan, check, abba) has its exit code checked before its output is used: a failed comparator writes no comparison. The runner exits 1 when the runs left give no comparison (too few runs, unbalanced pairs), 0 with one. - abba.json records the arms' inputs (more, more_a, more_b, play_args, max_minutes, retry) and each run's commit. - The guard on -Out covers the runner's own checkout in two-build mode, appends [IO.Path]::DirectorySeparatorChar, and -DataA/-DataB (and the checkouts) compare as full paths without an ending separator, so "dir" and "dir\" are one folder. - tests/test_game_abba.py runs the script over a stand-in gate that writes run.json and summary.json: a failed and a cut-short run left out and retried, the outputs, a re-run into the same -Out, a failed warm-up or discarded run, a failing comparator, too few runs left, and the record's fields. - docs/measuring_fps.md: the re-run, the stop on a failed warm-up, the exit codes and abba.json's fields.
2 pairs are 2 runs a side, and `abba` needs 3 runs a side (side and linear trend) or 4 pairs (a verdict from the pairs themselves): such a run could never give a comparison and would only say so, exit 1, after about an hour of gate runs. The runner now refuses -Pairs below 3 before any run, and says why. The header comment and docs/measuring_fps.md say the minimum; the dry-run tests that plan use 3 pairs, and the refusals cover 1 and 2.
…ver be checked, writes LF records as it goes (review) - A re-run deletes runs, abba.json and comparison.* only when -Out's abba.json is this runner's (its schema); an -Out holding any of those without it is refused and kept. Each arm's scripts\game-gate.ps1, -Game, -DataTemplate and the data folders are checked before anything is deleted (two-build mode needs the gate in each checkout). - -Out may not be -Game, -DataTemplate or a data folder, nor be inside one or hold one (full paths without an ending separator, case ignored on Windows). -Retry is 0 or more. - One reading of an arm's settings, d3d12_ab_compare.py's arm_settings(): the way game-gate.ps1 reads -More (split at ";", name and value trimmed). The runner refuses before the first run what the runtime's settings line could never show (not LEONIDA_NAME=value, a value with a space or over 120 characters), through the new `settings` command, and passes the arm's text to `check --more`, which compares with the same reading. - `check` builds on run_value, so a run that counts has one definition (a PASS without a frame rate is left out and run again), and takes AFTER_WORLD_S from tools/game_gate.py. Its docstring no longer says it prints no argument text. - abba.json holds the folders and checkouts as well, and is written at the start and after each run, so an error leaves it. abba.json, comparison.txt, comparison.json and ab-excluded.txt are LF with one final newline. - An empty -More or -PlayArgs is not passed to the gate (PowerShell 7.0 to 7.2 drop an empty argument). - Tests: the stand-in gate notes the parameters it gets and can end a run with another exe, another setting or no frame rate; new cases for each point above, a slot left out on every try keeping its place, and the bytes of the files written. test_d3d12_ab_compare.py removes its temporary folders. - docs/measuring_fps.md: the refusals, the gate each checkout needs, the record and the re-run.
…m, keeps a name's last value, refuses a checkout in -Out (review)
- arm_settings applies the space and length rules only to a value the runtime's settings line shows as it is:
one of ASCII letters, digits and " ._,:+=*-", the `plain` test of d3d12/apps/leonida/src/leonida.rs line 65,
mirrored and quoted in d3d12_ab_compare.py's new SOURCES, which a contract test checks against leonida.rs.
Any other value (a folder with a space, a long path) shows as "<hidden, N chars>", which `check` takes as
shown, so it can be an arm.
- A name given twice in one arm counts with its last value, as the gate keeps it.
- `settings` names an item by its position (and its LEONIDA_ name), never by its text, so no path is said back.
- The runner refuses a checkout inside -Out, where a re-run's clean-up could reach it.
- The files the runner writes are written beside themselves and moved over, so abba.json, rewritten after every
run, is never found cut short; an -Out whose abba.json exists but is not readable as this runner's is refused
as such ("no readable abba.json of this runner").
- docs/measuring_fps.md and the script's header say the same.
413212f to
ac3e217
Compare
|
Rebased on
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). |
…er (review) The Windows runner of the `check` job failed three of these tests; the script was right. - Its TEMP is an 8.3 short path (C:\Users\RUNNER~1\...), and [IO.Path]::GetFullPath, which the script uses for every folder it compares and records, expands short names: the printed gate path and abba.json's folders were the long spelling of what the tests gave. The tests now take the real path of their temporary folders and compare paths after realpath and normcase. - Its console colours PowerShell's error text and wraps it with the escape sequences inside the wrap, which unwrapped() did not join. The tests now run pwsh with NO_COLOR=1, and unwrapped() removes colour sequences before it joins the wrapped lines.
Claimed in the coordination issue as: D3D12-GAME-ABBA (#2570 (comment))
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
planandabbawere written for:scripts/game-abba.ps1takes the order fromd3d12_ab_compare.py plan: warm-up runs of each arm, then discarded runs, then-Pairspairs in ABBA order. It runs each slot throughscripts/game-gate.ps1(d3d12: an in-game gate: one command, one run folder, one summary.json (D3D12-GAME-GATE) #2782).-Data,-MoreA,-MoreB.-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.d3d12_ab_compare.py checkchecks each measured run. A run counts only if all of these hold:-MoreA/-MoreBsettings show in the runtime's settings line (d3d12: a run logs the LEONIDA_ settings it starts with (D3D12-RUN-SETTINGS-LINE) #2775), when the run has one. A value the line hides counts as shown;abbauses:checkis built on it).-MoreA/-MoreBare 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 notLEONIDA_..., 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" mirrorsleonida.rs, pinned by a contract test. Messages name an item by its position, never by its text.summary.jsonincluded) gets anab-excluded.txt, whichabbanow leaves out, and its slot runs again (-Retry, 1). A failed warm-up or discarded run stops the series at once.abbainto<Out>/comparison.txtandcomparison.json. Every comparator call's exit code is checked before its output is used. Exit 0 with a comparison, 1 without one.abba.jsonrecords 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.-Outstarts clean, but only when itsabba.jsonis this runner's. Anything else there is refused and kept. Every folder and each checkout'sscripts\game-gate.ps1is checked before anything is deleted.-DryRunprints the plan and every gate command without starting anything.abbacan never compare);-Outinside a checkout or holding one, or overlapping-Game,-DataTemplateor a data folder;-Retrybelow 0.-More/-PlayArgsare not passed to the gate.#Requires -Version 7.0).docs/measuring_fps.md(section 3) anddocs/game_gate.mddescribe it.Tested
On Windows 11 Pro 10.0.26300, rebased on
main8422def:tests/test_game_abba.py, 23 tests. Besides the dry runs and refusals, a stand-in gate that writesrun.jsonandsummary.jsondrives 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-Outthe 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 onleonida.rs, and an excluded run left out byabba.test_game_gate.py,test_tool_stdout_encoding.py,test_ci_registration.py, the docs tests,scripts/check_no_game_data.pyon the changed files, andgit diff --checkare clean.main8f41d7d code: a null A/B,LEONIDA_FPS_LINE=1against=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 mods: gate_driver takes a run from the menus into the world (D3D12-GATE-DRIVER-MOD) #2784 enabled through-More.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
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)