Repository navigation
Conversation
ps_gather_wrap returned all-zero gathers on an AMD iGPU (Windows driver 24.10.24) exactly where OpSMod's dividend was negative. Gen.gather_addr now takes ((c srem n) + n) srem n, OpSRem only, for both wrap (n) and mirror (2n). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
2 tasks done
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.
SHADER-369 (claimed in #1902).
ps_gather_wrapreturns all-zero gathers on an AMD iGPU (Windows driver 24.10.24) in exactly the cases where the wrap or mirror coordinate givesOpSModa negative dividend. NVIDIA passes the same module.Gen.gather_addrnow computes wrap (n) and mirror (2n) as((c srem n) + n) srem n, withOpSRemonly. The sum is positive becauseOpSRem's sign follows the dividend andn>= 1, so the result is the same floor modulo with no reliance on the driver'sOpSModsign handling.tests/test_translate.py: the two gather address-mode tests countOpSRem(2 per remainder) and assert noOpSMod.docs/design.md: the gather contract row records the rule and why.Tested on Windows 11, NVIDIA RTX 4060 Ti (Ada, subgroup 32), driver 621.24, llvm-mc 21.1.8:
tests/test_translate.py: 498 passed, 2 skipped.python -m unittest discover -s tests/semantic: 1644 OK.run_gpu_tests.py --filter gather:ps_gather_wrap4096/4096 pixels exact,ps_gather_sampler_lodexact.Not tested: the AMD iGPU from the finding. A rerun of
ps_gather_wrapthere is what confirms the fix. This change doesn't touch the border modes in #2025 (SHADER-348).AI-assisted (Claude Code).
🤖 Generated with Claude Code