Shaders: ordered paired FP32 reductions for Wave64 on Wave32 hosts #1419
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1419"
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 ByFxbian on 2026-11-27T01:17:04Z.
Summary
Follow-up to #1397, integrated in
b1d777a8.Implements ordered paired FP32 reductions for recognized full
Wave64 reduction trees on Wave32 hosts.
This addresses the floating-point reduction rejection reported
by Filip722 when testing the two water TransmissionVolumetrics
compute shaders:
Changes
NaN payload priority, infinities and denormals.
32-lane half, consistent with the updated RDNA2 lowering.
Targeted testing
Once the guest floating-point mode has been confirmed:
The two hashes should not be forced into the wave-wide workaround.
Fast math must remain disabled for the ordered FP32 path.
Hardware validation
NVIDIA GeForce RTX 3070, Windows.
Limitations
The FP32 path requires a confirmed non-IEEE, round-to-nearest,
flush-to-zero guest mode.
FP64, floating-point prefixes, unsupported instruction sequences,
unknown MODE changes and fast math remain conservatively rejected.
The two original water shaders still require replay and visual
validation.
The goal is to execute both programs correctly and determine
whether the original water appearance can be restored without
reintroducing the black tile artifacts.
No gameplay or visual fix is claimed until verified.
Imported from fxceless/victory-fork. Originally posted by fxceless on 2026-11-27T01:31:39Z.
Tested on an RTX 4070 (Windows) with the recipe above (WAVE_PAIRS_ONLY for both hashes, WAVE_PAIRS_FP32=non-ieee-rne-ftz, GROUP_SYNC=2, SHADER_OPT=127). Both programs are still refused, in two steps:
paired FP32 reduction with fast math or an unknown MODE change: each program has threes_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 2), 0(5dc3: 0x2bfc, 0x3010, 0x3494; 6f22: 0x4b78, 0x4f88, 0x5408). That field is the 64/16-bit rounding only, so it does not change FP32 rounding or denormals. We narrowed the gate locally to refuse only MODE writes touching bits 0-1 / 4-5.a paired FP32 section without a proven full reduction is not supportedat 0x570 (5dc3) and 0x580 (6f22). We are looking at that section's shape now.Imported from fxceless/victory-fork. Originally posted by akimfomin on 2026-11-27T01:35:12Z.
The two-bit write beginning at MODE bit 2 is confined to FP16/FP64 rounding. One guard edge worth keeping while narrowing it: AMD RDNA2 ISA §3.5, Table 4 also defines
DX10_CLAMPat bit 8 andIEEEat bit 9. Those matter when this lowering promises a non-IEEE NaN/min/max result. A rule that rejects only writes overlapping FP32 round/denorm (bits 0–1, 4–5) would also admit writes to bits 8 and 9.A small positive/negative fixture can keep the exact
offset=2,width=2write and the existing bit-exact reduction, then move the write to bit 8 or 9 and require conservative refusal. I checked the bit overlaps independently. This leaves the second failure in your report separate. In the current1338677epath, the same diagnostic covers an unproven live-out shape, an unsupported opcode/modifier and an EXEC write, so reporting which predicate failed first would help people reproduce the remaining shape with a synthetic program. PortBridge can help run that isolated fixture on a second NVIDIA adapter once available. No replay or picture claim here.Imported from fxceless/victory-fork. Originally posted by ByFxbian on 2026-11-27T01:42:58Z.
Just updated the PR based on your feedback.
The MODE guard now permits the reported FP16/FP64 rounding write while retaining conservative rejection of changes affecting FP32 rounding, denormals, DX10_CLAMP and IEEE mode.
The reduction rejection is now split into more specific diagnostics. All new FP32 hardware tests and the existing NVIDIA regression fixtures passed on my RTX 3070.
Both water hashes are ready for another replay test if possible
Imported from fxceless/victory-fork. Originally posted by akimfomin on 2026-11-27T01:46:18Z.
Thanks. I independently tested the updated
8d1162e31491ca8c462356e921b31f39ee99d58don a physical RTX 4070 Ti SUPER, driver 617.14, Windows 11 28000.3501, release. All fourpaired_fp32tests passed. The three GPU fixtures validated DXIL and passed 37 bit-exact comparisons in the paired path with 32 threads; the fourth test confirms refusal when the guest mode is absent. This includes the FP16/FP64 MODE write and the conservative refusal controls for the FP32 and NaN settings.For volunteers, set both the paired switch and the optimization mask explicitly in this test command. A first run with only the guest-mode variable exercised a non-paired or fast-math fallback and should not be compared. The two water-program replays and a visual check are still open. OpenAI Codex assisted with the isolated build and test run.
Imported from fxceless/victory-fork. Originally posted by Dathinel on 2026-11-27T03:15:54Z.
Confirmed on a physical RTX 3050 Laptop, 4 GB (driver 610.62, Windows), testing your unchanged head
8d1162ein the Cargo test profile. All four paired FP32 tests passed, including 37 bit-exact GPU/CPU comparisons and the unconfirmed-mode rejection.I also compared the two permute paths on this card. For byte offsets 0, 4 and 128 and seven EXEC limits each, the paired fixture passed 21/21 comparisons (32 emitted threads) and the exact fixture passed 21/21 (64 emitted threads on Wave32 hardware). DXIL validation, PSO creation and GPU readback succeeded on both paths.
Commands and per-fixture results in our 4 GB hardware log. This covers the synthetic cases; replay and appearance of the two original water shaders remain open. AI-assisted hardware validation.
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.