shader: accept proven uniform forward reduction guards #46
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/brcly--TuxBox!46
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/46/head"
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?
@Valdi320 on GitHub · 2026-11-24 11:11 UTC · original
Valdi320:work/scarlett-uniform-reduction-guards→main· +1229 −8 · 7 files · 3 commits · merged 2026-11-24 13:42 UTCThe public ProjectScarlett log in #39 has 396 distinct refusals from wave_sum's divergent-control-flow guard. This narrow change accepts a forward SCC branch over an entire fixed-width reduction only when its comparison uses immediates or the scalar broadcast from an immediately preceding verified reduction. Other edges overlapping the proof window, alternate entries, intervening writes, early exits and indirect transfers remain rejected. EXEC/VCC and unknown SCC branches still fail closed. Wave-width requirements are unchanged.
Validation on Bazzite:
No retail shader inputs locally; the 396 refusals are not claimed fixed. A retest of the recorded requests would determine whether this specific branch pattern occurs and which remaining patterns need support. No game files or shader binaries included. AI-assisted contribution.
Portable wave64 follow-up: For a verified single 64x1x1 compute group, exact integer reductions can now use synchronized group-shared lane exchanges without a host WaveSize(64) requirement. Unknown collectives, mask escapes, multi-wave groups and unproven branches keep the old native path or rejection. On RTX 4080 with stock Proton, 70 wave64 readbacks (35 scenarios, sums and state) and 32 wave32 readbacks matched all 39,168 words against the CPU oracle. 69 Rust tests passed. The reproducible test and both JSON receipts are included. These are synthetic native ISA controls, not a measured retail compatibility increase.
@trigger337 on GitHub · 2026-11-24 11:37 UTC · original
AI-assisted: yes
Hardware validation on Linux (CachyOS, Linux 6.18, AMD Radeon RX 6900 XT / RADV Navi 21, Vulkan 1.4.333):
tuxbox-xshaderRust unit test suite (cargo test --target x86_64-unknown-linux-gnu --manifest-path tools/shader-compiler/Cargo.toml):hlsl::wave_sum::tests::uniform_literal_guard_must_skip_the_entire_reduction: passhlsl::wave_sum::tests::prior_reduction_result_is_uniform_only_without_intervening_writes: passhlsl::wave_sum::tests::alternate_entry_and_loop_edges_invalidate_uniform_guard: passhlsl::wave_sum::tests::portable_wave64_requires_a_single_group_and_no_other_wave_operations: passhlsl::wave_sum::tests::translates_two_native_reductions_with_a_uniform_scc_guard: passIntegration & Guest Smoke Tests (
python3 -m unittest discover -s tests):The strict proof window logic (ensuring SCC forward branches over reductions reject intervening writes, alternate entries, and loops while correctly accepting proven uniform constants or preceding reductions) builds cleanly and passes all test suites on Linux/RADV.