GPU: an opt-in constant takes the place of a named program that does not run (VICTORY_STAND_IN) #2620
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2620
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2620"
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?
@r4tedx on GitHub · 2026-11-25 16:58 UTC · original
r4tedx:gpu/shadow-stand-in-main→main· +1693 −13 · 6 files · 5 commits · openStacked on #2619 (VICTORY_AMBIENT), which is stacked on #2871 (clears of one view share one dynamic slot). Only the last commit is new here; merge order is #2871, #2619, then this.
A program can be held back (one walking acceleration structures the builder has not built yet), dropped, or left without a host pipeline (it does not translate). Its outputs then keep whatever the memory held, and the passes that read them see garbage: a shadow mask nothing writes can read as "in shadow" everywhere. This adds a run-time switch that clears the views a named program would have written, in place of a dispatch of it that did not run.
Opt-in, off by default. Nothing happens while
VICTORY_STAND_INis unset, and only named programs are touched. No title program names or hashes appear in the code: the user names the program by the shader hash the log already prints.Syntax
VICTORY_STAND_IN=<program>:<view>:<value>, rules separated by;, written exactly as forVICTORY_AMBIENT:<program>: the 16-hex-digit shader hash the log prints for the compute program.<view>: root parameter and table offset in dwords,s1+0or1+0.<value>:r,g,b[,a], optionallyrgb9e5=/r11g11b10=/rgba16f=for an integer view; or0x...,mask,zero.Example (a "lit" R16_FLOAT mask and an all-ones R8_UINT one):
VICTORY_STAND_IN=0123456789abcdef:s1+0:1,1,1;0123456789abcdef:s1+8:mask. An integer view whose format does not say how a colour packs takes a raw word (0x...,mask,zero).What it does
dispatch()andexecute_indirect()become thin wrappers over their old bodies (run_dispatch()/run_indirect()), so every way a dispatch does not run reaches the stand-in. A direct dispatch records in the list state whether it ran, so an early return of any kind (skipped, held back, no host pipeline, tables not made) leaves the flag unset. An indirect dispatch returns false. Indirect draws are left alone.pipeline::compute_hash). The program's views are not known when it does not run, so the rules are not checked against them. The first match logs the view, formats and value (withran = false), as forVICTORY_AMBIENT.VICTORY_AMBIENT, including its one dynamic slot per view per list.Tests
The title was not used in these tests.
stand_ins_take_the_place_of_dispatches_that_do_not_run(WARP): three programs that do not translate, so they get no host pipeline, the same gate a held-back program meets. A named program's direct dispatch clears its two views (R16_FLOAT to 1, R8_UINT to a mask). A named program's indirect dispatch clears its view (0.5). An indirect draw, and a program no rule names, clear nothing, and no dispatch runs. Read back after the list: 1.0, 0xff, 0.5.33df0691(on #2619a83bdc1d, #2871d3f9b11e,mainf3578e38, WARP):cargo clippy -p victory-gpu --all-targets --locked -- -D warningsand the same with--all-features, both clean;VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --features diagnostics --lib --locked: 253 passed, 0 failed, 1 ignored (an existing benchmark).In game
In our play build (RTX 5070, local title data used for the in-game measurement; only log lines and a description of the picture are reported), with #2311 holding back the BVH walks:
Credits
runtime/victory/crates/victory-shader/src/emit/stand_in.rs, GPL-3.0-or-later). That version rewrites the program's stores at translation. Here the program does not run at all.🤖 Generated with Claude Code
@kotekompotek on GitHub · 2026-11-25 17:52 UTC · original
Reviewed: superset of #2619 — adds
VICTORY_STAND_IN, where a program that cannot run (held, dropped, no pipeline) has its views cleared to the stand-in values without any code running. The distinction between the two knobs is well-drawn (ambient = program runs, view overwritten after; stand-in = program doesn't run at all, so views can't be validated). Both correctly opt-in and no-op when unset. CI green.@Marvisak on GitHub · 2026-11-25 22:18 UTC · original · edited 2026-11-26 00:24 UTC
Automated triage for the maintainers.
Needs the maintainer's decision. This PR's own commit is
33df069(VICTORY_STAND_IN), stacked on #2619 and #2871, so it can only be decided after those two. The change isn't purely opt-in in structure.dispatch()andexecute_indirect()incrates/victory-gpu/src/draw.rsbecome wrappers overrun_dispatch()/run_indirect(), with a ran-flag in the list state, for every title, even when the variable is unset. By the in-game measurements in #2619's thread, the four shadow-mask stand-ins alone made no measurable difference, and the right mask value is still open.On your reply: the rebase onto the split-out #2871 is noted. It doesn't change the open points: the scope decision on #2619 applies here too, and the evidence for this part is weaker. CI
checkis passing.Generated by Claude Code
@r4tedx on GitHub · 2026-11-25 23:28 UTC · original
Rebased with #2619, which is now stacked on #2871 (the slot sharing, split out at triage). This PR's own commit is the last one,
33df0691(the same change as af1973b2). The merge order is #2871, #2619, then this.WARP at
33df0691(onmainf3578e38): clippy-D warningsclean with and without--all-features; victory-gpu lib 253 passed, 0 failed, 1 ignored. The description is updated. The title was not used in these tests.AI-assisted
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.