Shaders: paired Wave64 form for the wave64 compute programs no wave32 form takes (6b82bc7d22016cb5, 6871d6e4b3ac9a10), opt-in with VICTORY_WAVE_PAIRS=1 #348
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/348"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by grosterr on 2026-11-27T21:15:36Z.
On a 32-lane host the translator refuses some wave64 compute programs ("no wave32 lowering for this wave64 program") and their dispatches are dropped. #101 takes four of them wave-wide and names one that is left:
6b82bc7d22016cb5(vfx_triangleClip:CS_CollectTriangles_Meshlets, groups of 1,024, LDS past the host's 32 KiB in the meeting forms). The water program6871d6e4b3ac9a10(water_shading:CS_TransmissionVolumetrics) is refused for another reason: a floating-point wave reduction with no exact wave32 tree.This brings the paired form from fxceless/victory-fork: one host thread runs two console lanes (lane and lane+32), so a console wave of 64 is one host wave of 32 and its cross-lane operations stay inside the thread. It is off by default and taken only with
VICTORY_WAVE_PAIRS=1, as a last form after the existing ones.Commits (authorship kept):
f134f48(ByFxbian) — the paired lowering, fxceless/victory-fork#1397 (b27e0b1), which builds on PiloteCode's #854. Merged by hand into this tree'slower.rs/mod.rs(lane_regions_of,wave_basewith a step of 64 for the pair,console_thread); the dispatch-spread hook that tree had is left out (this tree has none).a1c0f9d— ordered paired FP32 reductions, from fxceless#1419 (cb4f23b, ByFxbian), taken in part: its move oflds_meetings/ signature packing into files of their own is left out, and its fast-math guard (this tree has no fast-math pass).36b16ba(ByFxbian) — fxceless#14198d1162e, as is.e9c13e6(fxceless) — water programs in paired form, their wave64 sums replayed exactly (e3307c7);exact_floats/Cast::FpExtkept, the fast-math part not applied.ad29fe0— what the two programs still needed here: LDS reached throughLower::dsin the paired form; a memory-onlybarrier(8)for groups over 64 threads and LDS slot 0 reused when the group's LDS already fills 32 KiB;paired_withreusing the caller's io/res and a last-resortpaired_fallback(exact RNE/FTZ FP32 replay); thev_add_f64simulation inwave.rs(+0.0 identity,s_mov_b64) and the dead inactive-lanevdstread ofv_permlane[x]16_b32inside the FP32 replay; #854's two paired tests; andVICTORY_WAVE_PAIRS/VICTORY_WAVE_PAIRS_FP32in the shader cache key.Measured (RTX 3060 12 GB, driver 621.40,
shaders.rpfof 1.0.2.1):VICTORY_WAVE_PAIRS=1: both programs translate with a 32-lane wave, pass DXIL validation andCreateComputePipelineState(6b82bc7d22016cb5→c2978aea83f25a9c, "paired Wave64";6871d6e4b3ac9a10→7bd41fa916dfb216, "paired Wave64" withVICTORY_WAVE_PAIRS_FP32=non-ieee-rne-ftz, the same DXIL through the fallback without it). Over the whole archive "no wave32 lowering for this wave64 program" goes from 22 to 0 (25,667 → 25,689 translated).d12eb1b, the base of that comparison).translate --warmwithVICTORY_WAVE_PAIRS=1finds both in the cache made by the same translator (0 do not translate).cargo test -p victory-shader299 passed, 0 failed;cargo test -p victory-gpu --lib -- --test-threads=1422 passed, 2 failed:indirect::tests::host_list_budget_starts_empty_at_each_submissionandwarp_batch_charges_every_execution, which fail onmainas well (#67 fixes them).Complements #101. Without #101 this form also takes its four programs (they are among the 22 above); with #101 merged they take its wave-wide form first, since the paired form is only tried after the others, and
6b82bc7d22016cb5and6871d6e4b3ac9a10are left to this one. Both are merged together in our test build.🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ZanderOS1 on 2026-11-27T22:12:51Z.
Works on my build and now all 22 wave64 shaders now translate cleanly.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by grosterr on 2026-11-28T07:33:58Z.
Updated onto main
63b902f(merge commit3c87ac4); the conflicts were with main's LDS bounds and loop changes inlower.rs/mod.rs:VICTORY_LDS_BOUNDS) and loop atomics stay on the unpaired LDS paths; the paired form keeps its own bounded LDS paths.halvesandtwinare checked together.emit/emit_onceretry (withoutVICTORY_LOOPS_WAVE) wraps the paired tries; both cache-key lists are kept.Checked on this branch:
cargo test -p victory-shader304 passed, 0 failed (twice; one earlier run stopped once without a failing test named, not reproduced);cargo test -p victory-gpu --lib -- --test-threads=1453 passed, 0 failed.Played on RTX 3060 12 GB with the same merge on top of main plus 19 other open PRs of this repository,
VICTORY_WAVE_PAIRS=1, Series S, DLSS Quality: a warm cache of 25,782 shaders (203 do not translate, as before) and no wave64 program refused. Three runs (prologue cutscene, then the boat), no device loss.Open question, being checked: with main's water light on (the default since
64d4931), dark rectangles show on the water around objects and the mission marker; they go away withVICTORY_WATER_LIGHT=0. WhetherVICTORY_WAVE_PAIRS=1plays a part (the water light's programs are wave64 with LDS) is the next run here; I will add the result.Thanks to ZanderOS1 for testing it on their build.
🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by grosterr on 2026-11-28T07:46:50Z.
Result of the open question above: the dark rectangles on the water are not from this form. They are there with
VICTORY_WAVE_PAIRS=0too and go away withVICTORY_WATER_LIGHT=0(details in #739).🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by johnthemistaker on 2026-11-28T08:06:28Z.
Additional Wave32 data point for
6871d6e4b3ac9a10on an RTX 5060 Ti (8 GB, host wave lanes 32..32).Local change. In
crates/victory-shader/src/emit/mod.rs(emit_once), I added this container to the existing digest allowlist for compute groups of exactly 64 threads. WithVICTORY_WAVE_WIDEunset, it can reach the existingwiden()fallback, which widens control flow so the two host waves can meet at group barriers. The explicit override still takes precedence. This is the wave-wide path. The paired path in this PR uses two console lanes per host lane and explicitly replays the FP32 reduction order.Single-container controls. I used
translate --list --validate --pipelines --jobs 1withVICTORY_HOST_MAX_WAVE=32and the same translation settings across the earlier local checkpoints:b5cb122with the defaultVICTORY_WAVE_WIDEsetting refused the shader withno wave32 lowering for this wave64 program.a5f464ewith the allowlist entry andVICTORY_WAVE_WIDEunset emitted Wave32 DXIL, passed DXIL validation, and created a D3D12 compute PSO. The logged DXIL digest6fcb55bcaf70cb2ematched the explicitVICTORY_WAVE_WIDE=1control.VICTORY_WAVE_WIDE=0on the candidate reproduced the refusal.Current-base check. I ported the allowlist entry as local commit
1e65394on63b902f(v2026.11.28.01). Thef0b9876release build contains that port. Its offline run loggedwave Some(32), widened 17 branches, emitted DXIL6d256ff3bd7dc5bb, passed validation, and created the compute PSO. The 15 widened branches in the earlier checkpoint describe that checkpoint's output.In-game observation. In
f0b9876with Series S, DLSS Balanced, and frame generation off, the log recorded first bind at frame 29800, then translation and host pipeline creation:This establishes that the single-hash wave-wide path can emit DXIL and create the host PSO on this card. Dispatch output, numerical equivalence to the paired FP32 reduction, and a matched visual comparison remain unverified.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by grosterr on 2026-11-28T12:26:28Z.
Pushed
5df24f4: withVICTORY_WAVE_PAIRS=1the paired form no longer takes over programs that main's lowering already translates.Before,
=1tried it first for every wave64 compute program with LDS, even one that had translated, and in the retry chain ahead of the exact forms with group barriers ("without skips", wave-wide branches). The water light's_Tiledand_Tiled_LocalLightsthen lost main's lowering (VICTORY_LOOPS_WAVE,VICTORY_LDS_FIRST_INIT), and on an RTX 3060 the open water came out dark (table in #739). Now:Checked on this branch:
cargo test -p victory-shader: 304 passed, 0 failed.translatewithVICTORY_HOST_WAVE=32: 2,758 of 2,763 compute programs emitted, with and without the switch, the same as before the change.VICTORY_WAVE_WHYshows the two water programs taking the wave-wide form (wave 32), as they do without the switch.On our build the open water is blue with the switch unset, and the paired form still picks up the wave64 programs that do not translate otherwise (203 shaders do not translate, as with
=1). So I run it unset now.🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by futurepro62 on 2026-11-28T23:08:12Z.
Tested this PR on an RTX 5070 Ti (16 GB, host wave lanes 32..32), Windows 11 26300, Series X profile,
shaders.rpfof 1.0.2.1. It works, but with one problem, and there's a small fix below.Problem: two programs that already translate change output. The default-on fallback (
VICTORY_WAVE_PAIRSunset) runs at the end ofemit_once.emitcallsemit_oncetwice: first withloops_wave, then again withLOOPS_OFF. So the fallback takes a program on the first try that the second try would have translated with main's wave-wide form. Two programs change this way:926c46bab3b86bd6water_shading:CS_TransmissionVolumetricsSubmerged. This is the underwater program the comment onemitnames for #539/#570.02384a60fda6f2d0vfx_triangleClip:CS_DefragHeap_ComputeRelocations.With
VICTORY_WAVE_WHY=1, the head of this PR showspaired Wave64 (fallback): wave Some(32)for both. WithVICTORY_WAVE_PAIRS=0they takewave-wide branches: wave Some(32), as on the base.Fix: move the fallback out of
emit_onceand intoemit, after both tries have failed (paired_last_resort). Same conditions as before (wave32_compute, notWAVE_PAIRS_HERE,VICTORY_WAVE_PAIRSnot0). The commit is below, on top of this PR's head (5df24f4):diff
Offline check. Whole archive,
VICTORY_HOST_WAVE=32 VICTORY_VIEW_LIMIT=1000000 victory translate shaders.rpf --validate --list, empty cache:The 22 that now translate include
6b82bc7d22016cb5,a10179ab7eda0dc3,6871d6e4b3ac9a10,9fe711566bec0d0aand3b02415f67c6b0d8.In game. One session of about 22 minutes on PR + fix, after a fresh
victory warm: noshader does not translatelines. The session before, on the base, had two (6b82bc7d22016cb5anda10179ab7eda0dc3). No device removal. Frame rate in line with the session before (game frames about 18 vs about 20 fps, different mission). The black props that remain are a different cause: the view heap cap, #638.Not checked: a side-by-side picture of the water and meshlet programs, and
cargo test.🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Yoshi-233 on 2026-11-29T05:33:50Z.
I tested the last-resort paired lowering at
5df24f4fon an RTX 4070 Ti SUPER with 32-lane host waves. I limited the comparison to the two raster shadow-classification compute shaderseae3498e6553afa8andb8f3f7979d6bbc50, withVICTORY_WAVE_PAIRS_FP32=0.Both fail to translate on my previous .28.01-based player build and with pairing disabled. With pairing allowed for these two, the Microsoft DXIL validator passes both and D3D12 creates both compute pipelines in the game. Three control shaders (diffuse resolve, material lighting, and the particle draw) produced byte-identical DXIL across all three runs.
In a saved daylight interior I alternated recording and skipping both classification passes every 12 seconds in one process. Across four enabled and five skipped intervals with geometrically matched camera views, enabling them brightened the ceiling and cabinetry, while the sampled sunlit patch on the floor darkened. The rear window looked warmer. Small square boundaries on the floor remained in both modes. Median render frame times were 69.85 ms enabled and 69.30 ms skipped at 2560×1440 input, 3840×2160 output and 2× frame generation.
This confirms a visible lighting change from these two programs on Ada. Determining the intended exposure still requires native footage with matching camera, time and lighting.
Independently toggling the two shaders in a second, fixed dining-room view separated their effects. I kept eae3498e6553afa8 and b8f3f7979d6bbc50 on separate switches and captured two matched, pre-upscaling HDR inputs for each of the four combinations. At 550-pixel registration width the 90th-percentile geometry displacement stayed below 0.6 pixels across all eight images.
In the same 688×96 patch of floor, running eae3… produced 87–88 aligned 16-pixel edges above half a stop, with either setting of b8f3…. Skipping eae3… produced zero such edges in each of four samples. A neighbouring wall brightened from a median 33–34/255 to 67–77/255 when eae3… ran. This switch also changes the overall room lighting, so the lower edge count alone is insufficient to pick the correct shadow result. The original player can show floor grid artifacts with both shaders unavailable. The test isolates a change in this view, without identifying the unique cause of every grid artifact.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by grosterr on 2026-11-29T13:03:25Z.
Closing this one: current
mainhas made it unnecessary.On the release
829188e(v2026.11.29.01), both programs this PR was for translate on an RTX 3060 12 GB (32-lane host waves) withoutVICTORY_WAVE_PAIRS. From the play log, Series S, DLSS Quality, FSR 3 FG 2x:There is no "no wave32 lowering" refusal for either. On
e1f2eb6(28.11) both were still refused. My guess is the exact fold of wave64 onto 32-lane hosts (VICTORY_WAVE_FOLDED, on by default, #1504) did it, but I haven't bisected that.Thanks to futurepro62 for finding the
emit_oncefallback problem and providing the fix, and to Yoshi-233 for the detailed lighting comparison of the two shadow-classification programs. #2001 carries this work forward as an opt-in last resort, and already runs it after both ofemit's tries, as futurepro62 suggested.Posted by Claude Code on behalf of the machine's owner.
Pull request closed