Shaders: run LDS flag regions on 32-lane GPUs #4
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!4
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4"
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?
@gomeaw on GitHub · 2026-11-25 22:59 UTC · original
gomeaw:fix/wave32-lds-flags→main· +398 −2 · 3 files · 3 commits · merged 2026-11-26 08:17 UTCSummary
Some console wave64 compute shaders retain
WaveSize(64)on 32-lane hosts because a divergent region both reads and writes group-shared memory. NVIDIA rejects those pipelines. This adapts fxceless/victory-fork#592 by FrancescoGelosoEterea to this fork, with the original author and commit recorded.The lowering allows this specific form only when the LDS accesses use constant addresses, stores write the same constant, and a missed read cannot affect any result that leaves the region. The group barriers stay on the converged edges. A region that writes another value keeps its original lowering.
VICTORY_LDS_FLAGS=0disables the new form.Verification
On Windows x64, the original lowering produced
Some(64)for the synthetic flag shader. The port producedSome(32)and still kept the two-value case at 64. The shader suite reported 281 passed, 4 ignored, and the asset policy passed. Windows comparisonThe added test uses 14 dispatches and distinct output words for all 64 console lanes. It checks both sides of the scalar skip and active-lane counts on either side of 32. The hosted runner skipped the hardware dispatches. The original PR reports the reflection-tiling pipeline builds on an RTX 5070 Ti, and an independent contributor ran synthetic dispatches on an RTX 3050 Laptop GPU using that original PR.
On a physical RTX 5070 (12 GB, driver 621.24, Windows build 26300), an independent tester ran the added test both alone and with the wave64 suite. All 14 dispatches matched for all 64 output words in both runs. The companion tests selected wave32 for the single-value flag and wave64 for the two-value case. Hardware results
A separate NVIDIA test on upstream
0a43566reproduced0x80070057for compute shader2cc4c197ee29e291during the opening prologue. Gameplay baselineOn a Radeon RX 6950 XT, an independent Windows run passed 278 shader tests on the base and 281 on this PR. That device skipped the 32-lane hardware dispatches. AMD regression check
On an RTX 3060 Ti 8 GB, an independent diagnostics run with
VICTORY_TEXTURE_MAX=512passed the same 14 hardware dispatches, reached a 3D cutscene past the frame-1798 transition where the tester previously saw upstream exit, and shut down cleanly. A matched run of shader2cc4c197ee29e291through the opening prologue is still pending. RTX 3060 Ti gameplay reportVICTORY_LDS_FLAGSnow participates in the shader and pipeline cache keys. Three Windowswarm --limit 0runs verified that switching it on changes the pipeline fingerprint and switching it off restores the original fingerprint. Cache validationTo confirm this port on a 32-lane GPU, run
cargo test --locked -p victory-shader --lib both_host_waves_observe_the_lds_flag_after_the_join -- --nocaptureand check for the line reporting all 14 hardware dispatches. Further gameplay and performance comparisons are open.AI-assisted with Codex. The tests use synthetic shaders.
@Hussein5645 on GitHub · 2026-11-25 23:17 UTC · original
I reproduced 0x80070057 for compute shader 2cc4c197ee29e291 on NVIDIA while running AvatarManz main at
0a43566through the opening prologue. This matches the shader targeted by fxceless/victory-fork#592. This is the baseline result. PR #4 is still to be tested on my machine.@Adika713 on GitHub · 2026-11-25 23:31 UTC · original
Verified PR #4 at head
25025d2on this host: AMD Radeon RX 6950 XT (RDNA2), Ryzen 5 3600, 32 GB RAM, Windows 11, rustc/cargo 1.98.1.Commands and results:
0a43566: 278 passed, 0 failed, 4 ignored; exit 025025d2: 281 passed, 0 failed, 4 ignored; exit 0The three added tests cover the wave-32 lowering decision and the negative two-value LDS case. I also ran the named dispatch test alone; it passes but prints
not a 32-lane host, skipping flag dispatches. This RX 6950 XT reportsWaveLaneCountMax != 32, and a temporary local WARP-forced probe also skipped, so I cannot claim the 14 hardware dispatches were executed here. That probe was reverted and the worktree is clean.No game files were used and no in-game FPS was measured. From this host's CPU-only results, no changes requested.
AI-assisted: OpenCode, model Big Pickle. No game data.
@sawetco on GitHub · 2026-11-25 23:18 UTC · original · edited 2026-11-25 23:39 UTC
Tested
25025d2on a physical GeForce RTX 5070 (12 GB), driver 621.24, Windows build 26300. I ran the requestedboth_host_waves_observe_the_lds_flag_after_the_jointest twice, once on its own and once with the other wave64 tests, using thediagprofile. Both runs reached the hardware assertion and printed:All 64 output words matched for each of the seven active-lane counts with both scalar-skip values. The two companion tests also selected wave32 for the single-value flag and wave64 for the two-value case. This confirms the synthetic LDS case on this NVIDIA card.
Follow-up on the compute shader reported above. I also tested
2cc4c197ee29e291from a local copy on the same RTX 5070. On main (0a43566),translate --validate --pipelines --listwith host wave limit 32 validated the DXIL, but D3D12 rejected the compute pipeline with “The parameter is incorrect.” On this PR head, I ran the same container through the translator and the physical D3D12 device in separate processes, without a shader cache. WithVICTORY_LDS_FLAGS=0the pipeline was rejected. WithVICTORY_LDS_FLAGS=1it was created successfully. This verifies pipeline creation for the specific shader in the RTX prologue report. The per-lane dispatch check above uses the synthetic fixture.@spook40 on GitHub · 2026-11-25 23:42 UTC · original
Adding an in-game 32-lane NVIDIA run on RTX 3060 Ti (8 GB) (
pr-4branch,diagprofile with--features diagnostics,VICTORY_TEXTURE_MAX=512):both_host_waves_observe_the_lds_flag_after_the_joinpassed (all 14 flag dispatches passed on a 32-lane hardware adapter).mainpreviously exited with-1073741819(0xC0000005), and shut down cleanly (title suspended; ending the title, host pipeline library saved230833866bytes).@Marcosmarb on GitHub · 2026-11-25 23:53 UTC · original
Tested this port on a 32-lane GPU, as asked in the description.
Machine: Windows 11 Home (26200), AMD Ryzen 7 6800HS, 16 GB RAM, NVIDIA GeForce RTX 3050 Laptop GPU 4 GB (driver 32.0.16.2101). It is DXGI adapter 0 and the default device here; D3D12 reports waves of 32–32 lanes, SM 6.8, mesh shader tier 1. Rust 1.98.1 (MSVC), debug test profile.
Branch:
25025d2(this PR).Whole shader suite on this branch:
281 passed; 0 failed; 4 ignored.For comparison,
mainat0a43566on the same machine: whole workspace916 passed, 0 failed, 45 ignored; shader suite278 passed, 0 failed, 4 ignored.Not tested: anything in-game (synthetic tests only, no title files), and
VICTORY_LDS_FLAGS=0.Tested with the help of Claude Code.
@MoonYueya on GitHub · 2026-11-26 05:28 UTC · original
Tested on an RTX 3080 10 GB, driver 32.0.16.1742, Ryzen 7 7700, 31.1 GB RAM, Windows 11 26300, merged into MoonYueya/VIctory-Kira
a3de053on top ofe2a28ectogether with the other open NVIDIA PRs (#47 #48 #24 #23 #78 #42 #66 #18 #10 #4 #58 #17).cargo test --workspace --locked --no-fail-fast -- --test-threads=1: 934 passed, 0 failed, 45 ignored after this PR was merged (never below the count before it; the branch started at 923).VICTORY_LDS_FLAGSis on by default; the flag-region tests pass here. It conflicted only in appended test modules (both kept).What this does not show: the PR was not run in the game on its own, so this is unit tests plus a combined run, not an in-game verification of this PR by itself; nothing here is about picture quality.
AI-assisted.
@avatarmanz on GitHub · 2026-11-26 07:56 UTC · original
Merged into main in the next push (tests pass); thanks.