rdna2spirv: quad_any's docstring says partial quads are exact (DOC-QUAD-ANY-PARTIAL) #2799
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2799
Loading…
Reference in a new issue
No description provided.
Delete branch "docs/quad-any-partial"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: DOC-QUAD-ANY-PARTIAL
What and why
The
quad_anydocstring said an absent invocation in a partial quad gives an undefined value natively. That is stale: the non-fragment branch already answers partial quads exactly by reading each lane's activity withOpGroupNonUniformBallot, andtests/semantic/test_absent_lane_ub.py::test_quad_any_partial_quad_in_vs_and_cscovers partial VS and CS quads (it asserts the module uses ballot, notQuadSwapor an unguarded shuffle). This changes comments only; no translation output changes.After review, three more stale lines in the same docstring/comment and one in a test header: the docstring no longer says the vertex, geometry and mesh shaders shuffle (they ballot); a partial quad is described as fewer than 4 of the quad's lanes running (a partial wave such as 2 active lanes of a 32-lane subgroup, not only a size that is not a multiple of 4); the exactness claim is limited to the non-emulated path; and the
tests/semantic/test_salu_wqm32.pyheader now says the vertex path uses ballot, not a shuffle.Tested
CPU only, no game files or GPU:
python -I tests/semantic/test_absent_lane_ub.py— 18 tests pass.python -I tests/semantic/test_salu_wqm32.py— 10 tests pass.python -m compileall -q tools/rdna2spirv.pyandscripts/check_no_game_data.pyon the changed files.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: wording only, no new rule)Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12, head
3587499f4, main9dffbe721. CPU only.READ IN CODE
quad_anyhas three branches: emulated (exchange buffer),ps(OpGroupNonUniformQuadSwap; fragment quads are always complete), and every other stage, which usesOpGroupNonUniformBallotand takes this lane's 4-bit quad nibble. With ballot, an absent lane is simply 0, so partial quads are exact, as the new text says. The old line ("undefined value natively") described the code before the ballot branch.MEASURED
python -I tests/semantic/test_absent_lane_ub.py: 18 tests OK on main9dffbe721. That file includestest_quad_any_partial_quad_in_vs_and_cs(line 341), the test your description cites.AI-assisted: Claude Code
Verification — VERIFY-2799
Verdict: PASS
3587499f4f01375d114887caaaca9069fff0748b| merge state vs main: clean merge with current main5dd6d444fin a scratch worktree (merge commiteb268b04d), no conflicts. Diff: docstring only intools/rdna2spirv.py(+3/−2), no code change.python -m unittest discover -s tests/semantic -p test_absent_lane_ub.pyGen.quad_any, the non-fragment branch (CS/VS/GS/MS) setsuses_ballotand emitsOpGroupNonUniformBallot, then extracts this lane's 4-bit quad nibble from the ballot word; the in-code comment at that branch states ballot bit l is set iff lane l is running withv != 0, so the result is exact on partial subgroups — which is precisely what the corrected docstring now says, replacing the stale 'undefined value natively' claim. The covering test named in the PR (test_quad_any_partial_quad_in_vs_and_cs) exists intests/semantic/test_absent_lane_ub.pyand passes. No game data.AI-assisted: yes (Muse Wonder, Muse by Meta)
Addressed in d696c8650:
tests/semantic/test_salu_wqm32.py's header now saysOpGroupNonUniformBallotforquad_anyandOpGroupNonUniformQuadSwaponly for the fragment stage.docs/design.md:551already describes the code, so no contract row changes. Checks:python -I tests/semantic/test_absent_lane_ub.py(18 pass),python -I tests/semantic/test_salu_wqm32.py(10 pass),python -m compileall -q tools/rdna2spirv.py, andscripts/check_no_game_data.pyon the changed files. Comment-only, no output change.Verified by MoonEyes (another person than the author) on head
d696c8650merged withmain501b3e6c5: Windows 11, Python 3.14. The diff changes a docstring and comments intools/rdna2spirv.pyand one line of a test's docstring, no code:tests/semantic/test_salu_wqm32.py10 OK on both sides, so there is no red. I readquad_anynext to it: the fragment stage usesQuadSwapand the others ballot, as the new text says.AI-assisted (Claude Code).
Thanks —
tests/semantic/test_salu_wqm32.pyis 10 tests OK here too, and the change is comments and one test docstring only. Nothing further from our side.AI-assisted.
Merging. Head
d696c8650merges cleanly withmain9f27ba2e1and does not force a rebase of #2566. CI green on this head and on main. Comments and a docstring only, no code: the test passes on both sides; I read quad_any against the new text. Merged by MoonEyes.AI-assisted (Claude Code).