Shaders: the tiled cascade shadow programs translate exactly on 32-lane hosts #1000
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from fxceless/victory-fork. Originally posted by brunofgmag on 2026-11-25T15:36:24Z.
On 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.Imported from fxceless/victory-fork. Originally posted by sambagarandawertanda on 2026-11-25T16:21:37Z.
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.Imported from fxceless/victory-fork. Originally posted by tippythetaidum on 2026-11-25T16:31:27Z.
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.
Imported from fxceless/victory-fork. Originally posted by Danigamer05 on 2026-11-25T19:20:41Z.
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).
Imported from fxceless/victory-fork. Originally posted by HAL9000RELOADED on 2026-11-25T19:29:35Z.
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 (https://github.com/fxceless/victory-fork/pull/129#issuecomment-7172358511).Imported from fxceless/victory-fork. Originally posted by Zayfway on 2026-11-25T19:51:51Z.
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:
Imported from fxceless/victory-fork. Originally posted by Garu667 on 2026-11-26T11:38:13Z.
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.Imported from fxceless/victory-fork. Originally posted by Victorywillbeours222 on 2026-11-26T13:44:03Z.
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.
Imported from fxceless/victory-fork. Originally posted by Swagi-REDACTED on 2026-11-26T14:05:42Z.
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.
Imported from fxceless/victory-fork. Originally posted by Garu667 on 2026-11-26T15:23:43Z.
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.Imported from fxceless/victory-fork. Originally posted by oeirughrepuiohg on 2026-11-27T00:07:31Z.
Test report (Linux/Proton, RTX 4070 Ti): this PR fixes the stair-stepped shoulder/neck rim in the opening prison-cell scene.
Setup: the PR's commit cherry-picked onto a local branch (fork main
ca8829ffplus local changes that are identical in both arms), nothing else changed. Arms interleaved, identical settings: Series S path, 1280x720 internal resolution stretched to 1920x1080, no upscaling or frame generation, RTX 4070 Ti 12 GB, Proton/vkd3d-proton on Linux. Launches that overlapped a host build were excluded. End-of-route frames were scored blind.PR only, against the same base without it:
f133e35e) fails translation without it and translates and binds with it.Supporting context, a different build: the PR combined with a separate local change of ours (a reserved texture budget for one material input, not part of this PR). Smooth rim in 6/6 launches vs 0/6 on the base without either change; wall head shadow 2/6 vs 0/6; timing within noise. This shows the shoulder result holds when stacked with other work, but it is not a clean test of the PR alone; the table above is.
A pale-blue block at the collar remains in all arms and is unrelated to this PR.
Measured and written with AI assistance (Claude Code with Claude Opus 5.5 and Claude Mythos 5.2; Codex with gpt-6.2-sol for the build and the blind scoring).
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.