Paired wave64 lanes on 32-lane hosts: exact shadow mask, water volumetrics and sky diffusion #208
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/TaynanGT--Vice-Tay!208
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-208"
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?
@Geckomacabre on GitHub · 2026-11-27 09:52 UTC · original
Geckomacabre:pr/paired-wave64-clean→main· +2734 −64 · 12 files · 10 commits · openOn hosts whose waves have 32 lanes (NVIDIA), a console wave64 compute program runs today as two host waves, or as each host wave on its own. For programs whose wave-wide sums, first-lane reads or LDS shared within the console wave cross the two halves, those forms are approximate or need group barriers that cannot follow the console's order everywhere, and the picture shows it. This brings the paired form: one host wave of 32 runs a whole console wave of 64, each thread lowering two console lanes (n and n + 32), so these operations see all 64 lanes exactly.
What it fixes (each checked in game on an RTX 4090, Series S):
CS_ShadowRenderTiled*, 18 programs): whole 16x16 tiles black or lit, i.e. stair-stepped shadows on the ground and square patches on characters;CS_TransmissionVolumetrics_Tiled,_Tiled_LocalLights,_Submerged): dark blocks on open water and a broken view under water. Today these are either left out or forced into the wave-wide form (DEFAULT_WAVE_WIDE_HASHES), which leaves the blocks;CS_GatherDiffusion,CS_ScanMip0..3, withCS_DeferredFallbacksAlpha_SkyProbeandCS_TemporalResolve2_Opaque_FrameStatistics): a halo around dark silhouettes against the sky.These 28 take the paired form by default (
DEFAULT_WAVE_PAIRS_HASHES); together they cost about 0.1 ms of card time a frame (GPU timing run). The user's verdict after the shadow, water and halo programs were paired: the picture is correct.Commits
VICTORY_WAVE_PAIRS=1, or per programVICTORY_WAVE_PAIRS_ONLY); listed programs try it first and fall back to the existing forms when it refuses them.VICTORY_WAVE_PAIRS_FP32says otherwise;TRANSLATOR_VERSION8 (these programs translate differently, so cached translations are made again).docs/this-fork.md).Switches:
VICTORY_WAVE_PAIRS_ONLY=<log hashes>replaces the default list (none: no program);VICTORY_WAVE_PAIRS=1tries the form for every wave64 compute program that needs it;VICTORY_WAVE_PAIRS_FP32=non-ieee-rne-ftzconfirms the float mode for programs not on the default list. All are in the shader cache key.Checks (Windows 11, RTX 4090, toolchain 1.98.1, on this branch):
cargo check -p victory --features diagnostics --tests: clean.cargo test -p victory-shader --lib -- paired wave64: 36 passed, 0 failed.VICTORY_WAVE_PAIRS=1 VICTORY_WAVE_PAIRS_FP32=non-ieee-rne-ftz cargo test -p victory-shader --lib -- --ignored --test-threads=1 nvidia_: 12 passed on the GPU against the CPU model (water LDS min/max and pair exchange, ordered FP32 sum/min/max, lane reads, LDS between halves, divergent loops, the masked LDS add).cargo clippy -p victory-shader -p victory-gpu --tests -- -D warnings: clean.cargo test -p xtask: 11 passed (documented switches).Not included: our
VICTORY_ARGS_WRITERSwater entry. On this tree the default indirect batching (VICTORY_INDIRECT_BATCHunset) already ends a batch at every dispatch, so the water's tile counts are read after they are written.From the Geckomacabre/vx-layer work.
🤖 Generated with Claude Code
@TaynanGT on GitHub · 2026-11-27 09:59 UTC · original
@Geckomacabre
play.ps1setsVICTORY_INDIRECT_BATCH=2in the usual profile. That mode can keep an indirect batch open across a dispatch, while the unset mode in the PR description ends it there. Which mode was used in the Series S water run? I’ll keep that setting fixed while comparing the default paired list withVICTORY_WAVE_PAIRS_ONLY=noneon the same executable, then check the standard launcher path if the modes differ.The two water hashes in the current wave-wide list are the right targets for the paired comparison. I’ll check their selected translation path before comparing the boat shots.
@efsebayern on GitHub · 2026-11-27 10:42 UTC · original · reviewed
I reviewed
4e476c2offline on a 32-lane host model. I found no blocking bug in the paired lowering.Checked and exact:
scc_some/wave_widev_readlane(& 31/& 32; a per-lane index is refused),v_readfirstlane,v_writelane, andv_mbcntviaconsole_laneds_bpermutekept within its halfs_barrierPoints I'd raise, most important first:
DEFAULT_WAVE_PAIRS_HASHESprograms change.TRANSLATOR_VERSION8 also re-translates every cached program, andVICTORY_WAVE_PAIRS*sits in the global cache key rather than in a per-shader key. On our side, the first run after a change like that spends minutes recompiling pipelines. A per-container key that changes only for the programs the policy affects, likewave_wide_cache_override, would avoid that.paired_fp32.rs~253-264). Non-IEEE, round-to-nearest-even and flush-to-zero are assumed for the default 28, and for every program withVICTORY_WAVE_PAIRS_FP32. Onlys_setregis scanned; the program's own initial MODE isn't. If a program starts in another mode, the "exact" sums come out wrong with no warning.mod.rs~655).by_defaultrequiresVICTORY_WAVE_PAIRS_ONLYto be unset. SoVICTORY_WAVE_PAIRS_ONLY=5dc3b25986622949, or an empty value, drops that program's float-mode confirmation, refuses its FP32 sections, and falls back to the old form.lower.rs~569, ~2040, ~2099, andwiden). WithVICTORY_WAVE_WIDE=1, the loop-exit lane regions from fork #993 are active. At ~2040 and ~2099 they aren't gated on wave64 or a 32-lane host.exact_floats(paired_fp32.rs~311) is set but never read...._NOT=<hashes>) would help bisect a program that misbehaves in the paired form.Offline numbers (
VICTORY_HOST_WAVE=32 victory translate --list --validateover the title's shaders). The baseline is main, where 57 compute programs end in an APPROXIMATE form.VICTORY_WAVE_PAIRS_ONLY=noneVICTORY_WAVE_PAIRS=1=1+VICTORY_WAVE_PAIRS_FP32=non-ieee-rne-ftzIn the last run
6871d6e4b3ac9a10(waterCS_TransmissionVolumetrics) translates and validates, but under the assumed float mode from point 2.cargo test -p victory-shader --lib: 330 passed, 0 failed, 18 ignored.For context: we had independently ported the paired form from fxceless #1397 into a local branch. This PR covers more (FP32 replay, LDS atomics without a returned value, 30 vs 23 of the 57), and our port kept
ds_bpermuteacross all 64 lanes, which this PR correctly doesn't. So we're dropping ours in favour of this one.AI-assisted review (Claude Code).
@Smoodie7 on GitHub · 2026-11-27 12:39 UTC · original
A data point from an RTX 4070 Ti SUPER (Series S): in every run on main, two compute programs fail with "no wave32 lowering":
a10179ab7eda0dc3and6871d6e4b3ac9a10. Without RT, the water shows dark rectangular blocks near the bridge, which matches what this PR describes. With this PR merged on current main, both programs translate (0 failures). That run also had-RayTracingon, which broke the water in another way (not drawn at all), so I can't judge the blocks from it yet. Next is this PR alone, without RT, on the same boat route. Details: #212@TaynanGT on GitHub · 2026-11-27 12:47 UTC · original
@Smoodie7 The two successful translations on the 4070 Ti SUPER give us a clear compile result. For the water, the RT-off pass on the same bridge route is the control. Keep the allow-list and upscaler fixed, and compare the same part of the water while the camera moves.
@Garu667 on GitHub · 2026-11-27 12:48 UTC · original
Tested
4e476c2on an RTX 3080 10 GB (32-lane waves, driver cache warm,victory shadersrun once for each list), Series S,-Machine auto(4070 profile), boat mission autosave. One run each, so read the fps as rough.VICTORY_WAVE_PAIRS_ONLY=noneVICTORY_INDIRECT_BATCH=1(instead of play.ps1's2)WAVE64-PAIRS-ONLY translated with paired Wave64x28), and 5dc3b25986622949 / 6f225b641c5b0708 get host pipelines in game.VICTORY_INDIRECT_BATCH=1, so the batch mode does not explain them either. They show mostly on the water off to the side or in the distance, as horizontal strips (the camera angle decides how many you see).6871d6e4b3ac9a10anda10179ab7eda0dc3(CS_TransmissionVolumetrics,_VolumePortalsOnly) are still refused (no wave32 lowering for this wave64 program). Is that on purpose? In a separate port of #1397/#1419 onto this tree, both translate in the paired form withVICTORY_WAVE_PAIRS_FP32=non-ieee-rne-ftzand pass dxil.dll's validator. They were not requested in this scene, though, so I can't say what they change on screen.v_permlane(x)16reads the old vdst for its inactive-lane fallback, and that old vdst was a reduction scratch with no shape. We skipped the fallback in the paired form when there is no guard (every lane runs). Your placeholder handles it another way; just mentioning it in case it helps.Happy to run more on the 3080.
VICTORY_ARGS_WRITERSisn't in this tree, so I can't try it for the rectangles.@TaynanGT on GitHub · 2026-11-27 12:53 UTC · original
@Garu667 All 28 listed programs reaching translation on the 3080 is useful. The same rectangles with the paired list off and with batch mode 1 are a stronger clue for this scene. The two additional shaders weren’t requested on that route, so their validator pass stays separate from the water result. Keep the existing list for the next same-angle comparison.
@Garu667 on GitHub · 2026-11-27 13:02 UTC · original
@Smoodie7 A follow-up from the 3080, on the boat mission (not the bridge route): with this PR merged on current main (
5b2dc68),6871d6e4b3ac9a10anda10179ab7eda0dc3still fail unless they are listed. With them listed (the 28 defaults + those two inVICTORY_WAVE_PAIRS_ONLY,VICTORY_WAVE_PAIRS_FP32=non-ieee-rne-ftz), all 30 translate and validate. In game (run 150), neither of the two is ever dispatched in this scene, and the dark rectangles on the water are unchanged, from the same camera angle as runs 147/148. So here the blocks come from something else; the bridge route may well be a different case. I'll bisect the water pipelines withVICTORY_SKIP_PIPELINESand report back.@TaynanGT on GitHub · 2026-11-27 13:09 UTC · original
@Garu667 The 30-program validation confirms the expanded list works for compilation. On this boat route the two additions weren’t dispatched, and the same rectangles remained. That keeps the bridge case separate. Track the passes that actually ran in the affected shot before associating the blocks with a shader.
@efsebayern on GitHub · 2026-11-27 13:39 UTC · original
I tested this in game with ray tracing off on an RTX 4080 SUPER 16 GB, i7-13700K, 32 GB, Windows 11.
diagwith--features diagnostics,main0982bdewith this PR (4e476c2) and #206 (292adb5) merged locally.-Console series-s -Machine 4070, launcher defaults, plusVICTORY_WAVE_PAIRS=1andVICTORY_WAVE_PAIRS_FP32=non-ieee-rne-ftz. I played by hand on the water.Darker rectangular patches on the water
Stability: no device loss and no crash in either session. That includes
c06aa62112ffba4c, which now takes the paired form; in the wave-wide form it had lost the device on this card before. Saving a game worked.Performance
AI-assisted (Claude Code).
@TaynanGT on GitHub · 2026-11-27 13:43 UTC · original
@efsebayern The 4080 SUPER comparison separates the warming cost from steady state. Once ready, both builds are around 13–15 FPS; the first launch spends about five minutes at 3 FPS with more than 2,000 pipelines being made. The fewer rectangles with #206 plus #208 are a partial image result. Keep the paired test scoped to that route and warmed cache.
@Garu667 on GitHub · 2026-11-27 14:14 UTC · original
Found the program behind the dark rectangles on the boat mission (RTX 3080, #208 merged on
5b2dc68, same side view along the shore in every run):1aa247ed3653b616water_shading:CS_TransmissionVolumetrics_GenerateTiles. Adding it to the paired list removes the rectangles.VICTORY_WAVE_PAIRS_ONLY=all: 843 paired, 308 refused and kept their usual form)water_shading, SSR/denoise water,deferred_tiledwater, underwater mask)water_shadingClassification_Water,GenerateTiles,ClearTiles,Temporal_TiledClassification_Water,GenerateTiles1aa247ed3653b616(GenerateTiles) alone0e366d15868e17bd(Classification_Water) aloneWithout the paired form, this program takes the "without skips" 32-lane retry (
VICTORY_WAVE_WHY: "without early-outs: … a lane mask exchanged where not every lane runs", then "without skips: wave Some(32)"). That form validates but builds wrong tiles. In the paired form it translates and validates (VICTORY_WAVE_PAIRS_FP32=non-ieee-rne-ftz). No crash or card loss in any of runs 147–158.Suggestion: add
1aa247ed3653b616toDEFAULT_WAVE_PAIRS_HASHES. This is likely the same artifact as #270 (aircraft view). efsebayern's "fewer, but not gone" withVICTORY_WAVE_PAIRS=1would fit too: that switch doesn't retry this program, because the "without skips" form already succeeds.@TaynanGT on GitHub · 2026-11-27 14:34 UTC · original
@Garu667 Runs 157 and 158 isolate GenerateTiles. I added
1aa247ed3653b616as the 29th entry in42cdc77and brought #208 up to current main. Translator version 11 gives the updated list a fresh cache. For the next comparison, use the original 28 and the 29 on the same build withVICTORY_WAVE_PAIRS_FP32=non-ieee-rne-ftzin both runs.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.