bench: warm up with play.ps1 before measuring, and flag shader translation during spots #167
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ReTerryDavis--ReVIctory!167
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-166"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@SovietBearz0r on GitHub · 2026-12-05 20:20 UTC · original
SovietBearz0r:bench-warm-lap→main· +749 −75 · 1 files · 2 commits · openA benchmark lap taken right after changing a
VICTORY_*switch (or updating a build) is not comparable: the shader cache key changed, so that lap translates shaders while the title loads — black frames, compile stalls — and the numbers mix translation cost with rendering. We hit this while A/B-testing shader passes. This PR fixes that class of problem and makes benches repeatable, bounded and comparable.Measurement correctness
-Warm: before measuring, runplay.ps1's own documented pre-steps with the same settings —-Shaders(translate every shader) and-Warm(make earlier runs' pipelines). No new translation code paths. Without-Warmnothing changes.-WarmRetry: if a measured lap still translated shaders during the spots, run the pre-steps once and repeat that lap; a clean retry replaces it, otherwise the lap stays excluded.BENCH_SPOT_STARTand the lastBENCH_SPOT_END, warns loudly ("this lap's numbers are not comparable"), and recordstranslations_during_spotsin-Report. Loading-phase translations are reported but not flagged.-Repeats N: N measured laps after the warm-up; aggregated per-spot table with each lap's value plus the median for avg fps, p95/p99, 1%-low, frame/prep ms. Laps with spot translations, device removal, timeout or no log are flagged and excluded from the median (still shown).N=1prints the old table.0clean,2no spots,3translations during spots,4device removed,5timed out. Previously always 0.Bounded runs
-TimeoutMin(default 20, fractional allowed): each lap runs from a temporary child script in a childpwsh;Wait-Processagainst a deadline; on expirytaskkill /T /Fplus agame_scarlett_master/victorysweep, the partial log is parsed, the lap is marked timed out, exit 5.Comparison & provenance
-Compare <base.log> <other.log>: offline delta table (avg fps, p95/p99, 1%-low) with spots matched by name and!marking a spot whose lap translated shaders during the spots / lost the device.-Reportscorecard now records title SHA-256, layer SHA-256, git revision, build, bench config, requested vs actual GPU, OS/CPU/RAM, everyVICTORY_*switch +-Moreoverride,translations_during_spotsandexit_code; with-Repeatsit writes one scorecard per parsed lap.known-pipelines.binwhen-Warmis used (pipeline warm may be a no-op);-MorecarryingVICTORY_SHADER_OPTprints the-GpuOpt255-replacement note.-ParseLog <file>positional spelling works (previously silently parsed the latest log); help documents the-GpuOpttrap and the new flags; bookmark mode ignores-Repeats.Verification
scripts/bench.ps1;cargo test -p xtask: 9 passed;cargo xtask policy: 442 files ok;-ListGpusstill works.play.ps1: child launch/exit propagation,-Repeatsclean (median table, exit 0) and dirty-first (excluded, exit 3), device-removal exclusion (exit 4),-TimeoutMin 0.05watchdog (killed, partial spot parsed, exit 5),-Warm+-Repeats,-WarmRetryclean-replace/retry-still-dirty, preflight warnings.-ParseLogoutput is byte-identical to the previous commit on real logs; no-spot logs still exit 2.-Compareon our real logs (bar-base-1vsbar-on-2) prints, e.g.:spawn_idle avg fps 32.7→33.0 (+0.3),cruise_out 33.0→31.4 (−1.6),cruise_back 30.2→29.9 (−0.3), with p95/p99/1%-low rows.Real validation (RX 9070 XT, diag build, title run)
-Repeats 2on the real title (builtin:cruise,-Gpu 0,-TimeoutMin 8): both laps completed, exit 0, aggregate table printed with per-lap values and medians — e.g.spawn_idle 47.2 / 46.8 → 47.0 avg fps, p95 25.0 / 24.6 → 24.8 ms, p99 35.6 / 32.1 → 33.9 ms, 1%-low 28.1 / 31.2 → 29.6;cruise_out 42.0 / 42.4 → 42.2;cruise_back 40.2 / 41.0 → 40.6.-TimeoutMin 0.4killed the lap as designed — printedWatchdog: lap overran 0.4 min - killing the process tree and the title., thenlap timed out after 0.4 min; … the partial log is parsed (exit code 5), exited 5, nogame_scarlett_master/victoryprocesses left.-Compareon real logs and-ParseLogpaths verified offline (output byte-identical to the previous commit for-ParseLog; delta table shown in the body).Logs of the validation runs are kept outside the repo (
data\ingame-verify\bench-repeat-validation.out.txt,bench-watchdog-validation.out.txt).Still not exercised
-Warm/-WarmRetrywith a real translation pass (they callplay.ps1 -Shaders/-Warm; the wiring is tested with a stub, the translation itself is the existing play mode), and-Reportzips under-Repeatson real laps.A benchmark lap taken right after changing a VICTORY_* switch (or a new build) is not comparable: the shader cache key changed, so that lap translates the shaders while the title loads - black frames and compile stalls - and its numbers mix translation cost with rendering. This adds two things: - -Warm: before the measured lap, run play.ps1's own pre-steps with the very same settings - -Shaders (translate every shader into the cache) and -Warm (make the pipelines earlier runs drew with). No extra code paths; the documented pre-steps are used. Without -Warm nothing changes. - Parse-BenchLog now counts the shaders translated between the first BENCH_SPOT_START and the last BENCH_SPOT_END and prints a prominent warning when any were ("this lap's numbers are not comparable"), with the fix (-Warm or re-run). The scorecard report gains translations_during_spots for -Report. Translation during loading is not flagged: it happens before the spots and does not pollute their numbers. Verified with PowerShell's parser (the repo's scripts-parse test) and on a real bench log: the warning counts only the spot window, while the loading translations are reported separately by the log's own cache lines. No game run was needed for the parsing change; the -Warm path reuses play.ps1's existing documented modes.@SovietBearz0r on GitHub · 2026-12-05 22:09 UTC · original
Real-run validation of the new paths on this machine (RX 9070 XT, diag build,
builtin:cruise):-Repeats 2(exit 0, both laps clean):Watchdog (
-TimeoutMin 0.4, real title):Watchdog: lap overran 0.4 min - killing the process tree and the title., partial log parsed, exit 5, and nogame_scarlett_master/victoryprocesses left afterwards.-Compare/-ParseLogremain verified offline (delta table and byte-identical parse output). Only-Warm/-WarmRetry's real translation pass and-Reportunder-Repeatswere not re-run with the title; their wiring is covered with the stub.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.