Shaders: the tiled cascade shadow programs translate exactly on 32-lane hosts #1002
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/fxceless--victory-fork!1002
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1002"
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?
@brunofgmag on GitHub · 2026-11-25 15:36 UTC · original
brunofgmag:fx-shadow-exact→main· +609 −39 · 2 files · 1 commits · openOn a host with 32-lane waves (an RTX 4080 here),
CS_ShadowRenderTiledCascadesAlphaCBPPPC(f133e35efed2a48a) was refused every frame with "a lane mask exchanged where not every lane runs" at 0x1eb4, so alpha-tested geometry cast no cascade shadows. Three programs of the same family (CS_ShadowRenderTiledCascadesCBPPPC20b78ee12ecdb57d,CS_ShadowRenderTiledCascadesPPPCce79e9eba7ae0348 andCS_ShadowRenderTiledMiscAlphaPPPCfa0bd10a35bfef3c) only translated through the approximate local-waves form. In game that drew the sun's light along characters' silhouettes in steps of about 16 pixels.The ballot they need sits under per-lane regions that the retry forms could not remove. There were three reasons, and this PR fixes each one in
ir.rs:without_early_outsandwithout_skipsnow also take ans_cbranch_execnzover a far-jump trampoline (s_getpc_b64,s_add_u32,s_addc_u32,s_setpc_b64) to an end block. These programs are too long for a short branch to reachs_endpgm. A trampoline that does any work is still kept.without_skips, a scalar phi whose arguments all resolve to one value counts as a copy of that value. The arguments are followed through copies and through other such phis. A phi that merges a real change is still a change.unspillalso pairs two lanes per save and restore site, not only per lane. The pairing is checked with reaching definitions, so a 64-bit exec saved into two VGPR lanes comes back as one mask even when one of those lanes holds another scalar elsewhere.With the three fixes the ballot reaches the existing exact
exchange_halves.Measured with
translate --listandVICTORY_HOST_WAVE=32over 3,093 programs from one session:In game the steps along silhouettes are gone and frame time did not get worse (168 to 195 ms a frame in three runs, against about 200 to 240 before). No run lost the device.
The new tests in
wave64_tests.rsare hand-written GFX10 words. One of them runs on the device and checks a gate where exactly one failing lane is in the upper half, which a per-half answer gets wrong. Thevictory-shadertests pass exceptstub_pipeline_is_created, which fails without dxil.dll on this machine as it does on main. Clippy for the workspace still stops at the four warnings that #982 fixes.@sambagarandawertanda on GitHub · 2026-11-25 16:21 UTC · original
Reproduced the
f133e35efed2a48afailure on an RTX 3080 under Windows with the Series S profile. On ad44e4ae-based build,victory warmfailed to translate it at GFX100x1eb4witha lane mask exchanged where not every lane runs. An earlier gameplay trace also logged this exact shader as requested and unavailable at the first world frame. This is the pre-patch result. The PR still needs a run on this RTX 3080 to check the visual effect.@tippythetaidum on GitHub · 2026-11-25 16:31 UTC · original
Tested in the title on an RTX 5080 16 GB (32-lane waves), driver 621.14, Windows 11, Series X profile: the stepped sunlight along the character's edge is gone.
Build: diagnostics build of
main3973179+ #24 + #927 + #823 + #606 + #956 + this PR + #907. Default settings apart from #956's two switches and a local diagnostic of mine, which touch texture uploads, not shadows.Translation:
f133e35efed2a48anow translates and is bound from the first world frame. On the same base without this PR it wasshader does not translate ... a lane mask exchanged where not every lane runs, every run.20b78ee12ecdb57d,ce79e9eba7ae0348andfa0bd10a35bfef3ctranslate and are bound too. No shader failed to translate in the run.Picture: the opening cell shot, the character from behind against the sunlit window, compared across three runs.
Stability: no errors and no device loss in the 10-minute run.
One run with the PR, one card.
AI-assisted (Claude Code, Claude Opus 5.5). Counts and descriptions only, nothing from the game attached.
@Danigamer05 on GitHub · 2026-11-25 19:20 UTC · original
Confirmed on Turing: RTX 2080 SUPER 8 GB (32-lane waves, driver 621.01), Ryzen 7 3700X, Windows 11, Series S profile.
Tree:
vitutu1/victory-perfffed22d+ #683, #610, #823 and this PR (cherry-picked cleanly), diagnostics build.victory translate --list,VICTORY_HOST_MAX_WAVE=32, the whole package): before,f133e35efed2a48afailed with "a lane mask exchanged where not every lane runs" at 0x1eb4. After: it translates, and 3 more compute programs and 1 pixel program that failed before translate too (2,723 → 2,726 of 2,734 compute, 14,211 → 14,212 of 14,259 vertex/pixel; I compared the counts and failure classes, not each program).f133e35efed2a48aevery frame. After, it is no longer in the dropped list (only02384a60fda6f2d0and2da4beb386509b77remain). Lucia's hair and shirt are lit in every captured frame from the prison-window shot onwards; in the run just before without this PR (same switches) she turned into a dark silhouette once the cell part started. Single runs each, and this kind of darkness varies from run to run, so take it as one data point. Frame time unchanged (3.6-3.9 fps both ways).CS_ShadowRenderTiled*programs instead (VICTORY_SKIP_PIPELINES) made people in the yard pure black silhouettes. So an unwritten shadow-map region reads as full shadow here, which fits the dark characters seen while onlyf133e35efed2a48awas dropped.Numbers and text only. AI-assisted (Claude Code).
@HAL9000RELOADED on GitHub · 2026-11-25 19:29 UTC · original
RX 7900 XTX (RDNA3), Windows 10 + #402, main
d510ee4: all 6 new tests pass. The hardware part ofa_far_early_out_is_left_out_and_the_gate_counts_the_lanes_of_both_halvesran on the card ("ran on the hardware device…") and matched. With the tests alone on main, 3 of 6 fail: the two far early-out/skip ones and the parked pair one. Run table: #129 (#129).@Zayfway on GitHub · 2026-11-25 19:51 UTC · original
Tested on a 32-lane card: on its own on
main, and merged with #994 (which carries #993 and #854). AI-assisted (Claude Code); every number below is from runs on this machine.Machine: RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, 16 GB RAM with a 32 GB pagefile, Windows 11 26300, Series X profile, diag build. Every run loads the same save at the prison window and is measured from world +120 s to +360 s. Switches:
ASYNC_SUBMIT QUEUE2 TEXTURE_NO_WAIT COPY_PLAIN LEVELS_ON_DEMAND INDIRECT_GATHER.main465b94fmain+ this PRf133e35efed2a48anow translates and binds (onmainit was dropped every frame), but the steps are still there: on the wall behind her, and on a doormain+ this PR + #994main, is drawnSo on this card, this PR is needed but not sufficient. The steps go away only together with #854/#993's exact 64-lane forms. In that tree the four programs the driver used to refuse with
E_INVALIDARG(2cc4c197ee29e291,369cbe906ea72764,02384a60fda6f2d0,2da4beb386509b77) build, and the offline census withVICTORY_HOST_WAVE=32emits 26,135 of 26,136 programs. The one left isCS_TraceShadowRays_FullAdaptive, which these scenes do not use. Lanes on opaque masks go from 28,029 (main+ this PR) to 5,459.Merge. The merged tree is at
Zayfway/victory-fork@integ/rtx3060(7538ceb), withmain+ this PR + #994 + #1027. It had three conflicts:draw.rs: both new functions kept.ir.rs: the doc ofunspill.emit/wave64_tests.rs: #994's file with this PR's tests applied on top.One test of #993 needed a new expectation.
a_mask_parked_in_lanes_another_scalar_shares_comes_back_whole_with_shared_slotsexpected the parked pair to come back as two scalars without the shared slots. With this PR'ssite_pairsit comes back as one mask in both cases.cargo test -p victory-shader --lib: 275 passed, 2 ignored.Not tested:
@Garu667 on GitHub · 2026-11-26 11:38 UTC · original
Second NVIDIA data point: RTX 3080 10 GB, merged onto
06702fewith no conflict, boat mission, standing ~3 min, same settings both runs.translate --warm all(32-lane host): 25,635 → 25,639 translated, 254 → 250 that do not.f133e35efed2a48anow translates and its host pipeline is made (was refused every run);20b78ee12ecdb57d,ce79e9eba7ae0348,fa0bd10a35bfef3c,be6ce5d849d51127,922e1d0ee1e19a85all take the exact "without skips, scalars followed" form.926c46bab3b86bd6(water_Submerged) now translates too but the driver refuses it (64-lane), as it refuses the other water volumetrics.@Victorywillbeours222 on GitHub · 2026-11-26 13:44 UTC · original
Tested on an RTX 5080 16 GB (32-lane waves), Ryzen 7 5800X, 32 GB RAM, Windows 11. Diagnostics build of
mainceb9e1f+ #917 + #188 + this PR, Series S profile, 10 minutes hands-off (scripted Enter only). Shader cache warmed withVICTORY_HOST_WAVE=32.f133e35efed2a48a: translates, gets a host pipeline and is bound from the first world frame. In the run before, without this PR, it was refused every frame ("a lane mask exchanged where not every lane runs").That's one machine and one run per side, so take it as a data point.
AI-assisted (Claude Code). Counts and observations only, no game data.
@Swagi-REDACTED on GitHub · 2026-11-26 14:05 UTC · original
Additional RTX 3060 validation for A newer retail game:
0ff6db8156502e89679c9c0a3438e417516fb9b3(current main plus input integration). The runtime logged the samef133e35efed2a48afailure at0x1eb4. Offline validation of the four programs named here produced 3/4 validated, with that same failure.nvwgf2umx.dllandD3D12Core.dll.Commands:
victory translate <private four-program sample directory> --validate --list --jobs 1, then the same command with--pipelines. This is validation and pipeline creation only; no shader dispatch, visual improvement, gameplay completion, or cold-cache timing claim. A combined visual run is in progress. No sample data is attached.Combined workspace:
cargo test --locked --workspace -- --test-threads=4 --nocapture: 632 passed, 0 failed, 13 ignored. Eight explicit adapter/compiler skip messages were reported; those paths are not counted as coverage. Diagnostics application build and asset policy passed. Combining #1112 with current main exceeded the per-file source limit; the sampler-choice routine was moved unchanged into a child module to pass policy.AI use: Codex, GPT-6 (exact serving variant not exposed), performed integration and the local tests above. Original PR authors retained. These measurements are from this machine.
@Garu667 on GitHub · 2026-11-26 15:23 UTC · original
Visual confirmation in the prologue cell (RTX 3080,
58de9bfvs58de9bf+ this PR, same save, standing at the window ~1.5 min each): without the PR the sun's light along the character's shoulder and hair comes out in ~16 px steps; with it the edge is smooth and the shoulder and neck are lit as they should be. 7.7 vs 7.6 fps, no device loss.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.