Repository navigation
Shaders: preserve first active lane reads across divergent switches - #2192
Draft
gloger2003 wants to merge 1 commit into
Draft
gloger2003 wants to merge 1 commit into
gloger2003 wants to merge 1 commit into
Conversation
Broadcast the first active lane i32 value with a masked wave reduction. On the RX 7800 XT the original opcode returns a case-local value in fuzz seed 722. Pin that case in a standalone test. Assisted-by: OpenAI Codex (GPT-6.2 Sol, high reasoning effort, Fast mode)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1833. Follow-up to #1679. On a Radeon RX 7800 XT, the direct DXIL read of the first active lane can return a value from a later divergent switch case. That case should see the value captured before the switch.
What is in it
Tested
cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputwith XCL_DXIL_CACHE pointing to a writable directory reported 1154 passed, 1 failed, 46 ignored. Runtime skips: 7 (gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu, gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu, heap_window_out_of_memory_falls_back_to_the_switch_form). Seed 783 also produced mismatches on clean main. The HLSL mesh cache-only test passed separately on both revisions with a writable cache, after both had failed using the default directory in this environment.Regression run
Minecraft Preview, 90 seconds per build, 1x MSAA and
XCL_DIRECT_DXIL=all, with separate fresh caches. An earlier 30-second pair reached only 42 frames on main and ended before the candidate entered the title, so the comparison uses a longer matched run.Not tested
Other GPU drivers, retail world entry, and performance of workloads that use this operation more frequently.
AI use
OpenAI Codex (GPT-6.2 Sol, high reasoning effort, Fast mode) investigated the mismatch, compared implementations, wrote the patch and regression test, ran validation, and drafted this description.