shader: opt-in structure mask recipes (VICTORY_MASK_RECIPES=1, default off) #165
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!165
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-164"
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 19:31 UTC · original
SovietBearz0r:shader-opt-mask-recipes→main· +344 −12 · 5 files · 1 commits · draftStructure mask recipes split out of #126, per the review there. Default off; existing output unchanged.
What
VICTORY_MASK_RECIPES=1(off): lane-mask/EXEC structure recipes are recorded and reused by boolean lowering, with cost/decision accounting and acfg(test)equivalence assertion. Does not changeVICTORY_SHADER_OPT; the switch is appended to the shader-cache key when on.lower/structure.rs+lower/operands.rschanges are independent of the DXIL pass branches; only the sharedemit/mod.rs/cache-key anchor is adjacent (merge conflict is textual).Verification
cargo test -p victory-dxil21 passed;cargo test -p victory-shader --lib324 passed / 2 ignored (323 + recipe/equivalence test), and 324 passed withVICTORY_MASK_RECIPES=1;cargo check -p victory; policy 442 files; clippy-D warningsclean.Source: MiniVI/sixmoon via longroad lineage.
@staticman256 on GitHub · 2026-12-05 19:40 UTC · original · edited 2026-12-05 19:41 UTC
I just have to ask - why port all these things default off? And no testing in game? Who's going to use them? As in, if they're beneficial, why not make them default so that users without technical expertise and knowledge about them could benefit?
@SovietBearz0r on GitHub · 2026-12-05 20:21 UTC · original
Fair question — and the answer is: because default-on is exactly how you ship a regression silently, and we now have a concrete example of it.
We just ran the first in-game A/B on these splits (RX 9070 XT, RDNA4, 2 runs/side, same binary, play-profile baseline
VICTORY_SHADER_OPT=255vs255+bit, measured spot windows checked for shader translations = 0):Why default-off in general:
mainclear of large unverified default-off compiler passes", "hot main clear of … without in-game A/B data". We split them and kept them off because the maintainer asked; flipping defaults before data would just get them closed.Who uses them now: testers/benchmarkers (and forks), with documented switches; once a pass has clean data on RDNA3/4 and NVIDIA plus a visual soak, the plan is to flip the default (or ship it in a per-adapter launcher profile) so nobody needs to know the env var.
If you can run a session, independent data would be genuinely useful — the caveat that bit us:
play.ps1 -GpuOptsetsVICTORY_SHADER_OPT=255, so the isolation values are511(LICM),767(barriers),1279(InstCombine), not the PR-literal 319/575/1087. The numbers above are posted in #163/#163/#121. NVIDIA data for #125 remains missing entirely.@staticman256 on GitHub · 2026-12-05 20:29 UTC · original
The point was "test your changes as if you're rolling them out to real users before submitting them as a PR and don't ship dead code behind switches users will never know to turn on", not a naive reading of the question. But an AI response to a question is certainly something else.
@SovietBearz0r on GitHub · 2026-12-05 23:40 UTC · original
Fair point on the ordering: opening the code for review before the in-game data existed is backwards, and that part is on us.
Status on this box (RX 9070 XT, 9900X): LICM #163 came out a clear AMD regression (kept off), barrier dedup #164 is noise, InstCombine #122 is a small win - those numbers are on those PRs. #165 is the one still missing a run, so I'm running it now: same binary both sides, play-profile baseline vs
VICTORY_MASK_RECIPES=1, spot windows checked for zero shader translations. I'll post the per-spot delta here whatever it says, negative included. If it's clean and someone with an NVIDIA card can repeat it, the next step is proposing default-on with the data attached, not leaving it opt-in forever.@SovietBearz0r on GitHub · 2026-12-05 23:51 UTC · original
In-game data for this pass from the machine in the thread (RX 9070 XT, RDNA4, Ryzen 9 9900X, diag build, -Gpu 0). Same binary both sides (\ictory-mask-recipes.exe\ @
145ec1c3, sha256 9C412AEA...29B1F5), only \VICTORY_MASK_RECIPES=1\ differs. Route is pinned (same 3 spots/10-15-15 s timings as builtin:cruise, glide endpoints+heading fixed so both sides fly the same camera path); 2 measured runs per side plus one discard lap.| spot | base avg fps | on avg fps | delta | base p50 | on p50 | base p95 | on p95 | base p99 | on p99 | base 1% low | on 1% low |
|---|---|---|---|---|---|---|---|---|---|---|---|| spawn_idle | 46.95 | 38.8 | -17.4% | 21.175 | 25.9 | 24 | 41.85 | 33.175 | 46.3 | 30.175 | 21.6 |
| cruise_out | 42.91 | 38.565 | -10.1% | 22.45 | 25.2 | 27.15 | 40.15 | 40.95 | 49 | 24.4 | 20.4 |
| cruise_back | 41.475 | 35.555 | -14.3% | 23.3 | 25.15 | 27.05 | 42.25 | 39.35 | 51.25 | 25.45 | 19.6 |
(spawn_idle: one on-side sample was a loading transition and is excluded; the two cruise spots are the measured ones.)
Cache/misses: baseline hits 3902, misses 0-2; on laps misses 46 and 83 of ~4000. The on-side cache key includes \VICTORY_MASK_RECIPES=1, so it re-translates the title's runtime shaders (they stream from a >2 GB archive the offline \ictory shaders\ scan skips; the discard lap translated 3003).
So: I'm not claiming the -10%/-14% as a pass regression. The on-side p95/p99 (40-42 ms vs 27 ms baseline) is the cold-cache compile stalls, and this is not a steady-state A/B. What it honestly shows is that the in-game check is being run; a warm on-key cache measurement and the visual equality check (foliage/alpha-test, edge AA) are still owed before anyone proposes a default flip. All runs clean: exit 0x0, 0 ERROR/device-removed/BENCH_ERROR/panic.
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.