rdna2spirv: apply src0 float modifiers after bound_ctrl zero selection (SHADER-DPP-NEG-BOUND-CTRL) #1778
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1778
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1778/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?
@abnalstlll-byte on GitHub · 2026-11-25 11:56 UTC · original
abnalstlll-byte:feat/shader-dpp-neg-bound-ctrl→main· +93 −2 · 3 files · 3 commits · merged 2026-11-25 19:19 UTCClaimed in the coordination issue as: SHADER-DPP-NEG-BOUND-CTRL (claim)
What and why
Implements the hardware measurement by @mcpeacebir-lang on AMD RDNA3 (RX 7800 XT,
HW-DPP-NEG-INVALID-LANE, addressing @OreoFR's finding in Issue #1608):Previously,
Gen.dpp_insn(tools/rdna2spirv.py:7353) evaluatedsrc_val = self.src_u(src)before the shuffle and bound check under the assumption that "neg/abs are lane-uniform, so before or after the shuffle is the same". Then at line 7523,src0 = OpSelect %uint %src_ok %shuffled %zeroselected%zero(0x00000000/+0.0f) for invalid lanes (bound_ctrl:1or DPP8fi:0), which wiped out the float negation on invalid lanes and caused them to read+0.0finstead of-0.0f.This fixes the ordering:
negandabsfromraw_srcbefore evaluatingsrc_val = self.src_u(raw_src)so the raw register bits are shuffled across lanes.src0 = OpSelect %uint %src_ok %shuffled %zero.src0 = self.modify(src0, src)after the zero selection, applyingFAbs/OpFNegateto the selected result. An invalid lane reading0.0fwithnegbecomes-0.0f(0x80000000), withabsbecomes+0.0f(0x00000000), and with-|src0|becomes-0.0f.docs/design.md.tests/semantic/test_dpp_bound_ctrl_modifiers.pyverifying wave execution and SPIR-V instruction structure.Tested
python -m unittest tests/semantic/test_dpp_bound_ctrl_modifiers.py: 2/2 tests pass (0.03s).python -m unittest discover -s tests/semantic -p "*dpp*.py": 19/19 tests pass.python -I tests/test_text_write_line_endings.py: 3/3 pass (clean line endings).python -I scripts/check_no_game_data.py: clean (0 violations, no game data).AI-assisted (Claude Code)
@GeorgiyDemo on GitHub · 2026-11-25 12:13 UTC · original
Tested
fb3552fddon Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), againstmain0d80bc5df(translator-only PR; binaries from the build at66d4f5aa3):tests/semantic/test_dpp_bound_ctrl_modifiers.py: OK at this head; copied ontomainit fails 2 — theneg-after-bound_ctrlresult is the new expectation.--filter cs_dppon MoltenVK 1.4.2: 9/10 PASS, 1 skipped (cs_dpp_w64: no 64-wide compute subgroup on this device); this includescs_dpp_bound,cs_dpp_mask,cs_dpp_ops,cs_dpp_fi.AI-assisted; synthetic fixtures only, no game data.
@ShotTechOp on GitHub · 2026-11-25 12:25 UTC · original · approved these changes
Independent Windows 11 / Python 3.12.10 review of
fb3552fdapplied ontoorigin/main(0d80bc5d) — CPU-only, synthetic inputs, no game files.Checks run
origin/main(0d80bc5d): clean.python -m unittest discover -s tests/semantic -p test_dpp_bound_ctrl_modifiers.py -v: 2/2 OK.tools/rdna2spirv.pytoorigin/mainwith the PR's test): 2/2 failures (out_raw[0]is0instead of0x80000000, andOpBitcast %floatdoes not followOpSelect).python -m compileall -q tools/rdna2spirv.py tests/semantic/test_dpp_bound_ctrl_modifiers.py: exit 0.python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/semantic/test_dpp_bound_ctrl_modifiers.py docs/design.md: exit 0.git diff --check origin/main: clean.Code audit
neg/absbeforeself.src_u(raw_src)and applyingself.modify(src0, src)immediately afterOpSelect %uint {src_ok} {shuffled} {zero}cleanly moves modifier application afterbound_ctrl:1zero selection while leaving valid-lane values unchanged.self.modifyapplies 32-bit floatFAbs/OpFNegate(matchingsrc_u's prior behaviour); if DPP is ever used on f16 or raw sign-bit-move ops (src_u_sign_mods), forwarding the modifiers onto thessaoperand for_insnto apply per op could be a clean follow-up.LGTM. AI-assisted (Antigravity).
@potatoe0100 on GitHub · 2026-11-25 13:50 UTC · original
Tested
fb3552fddmerged ontomain98c2f7777(clean), native Windows 11 Pro 26H2 (build 26300), NVIDIA GeForce RTX 4060, driver 621.14, VS 2022 (MSVC 19.44) RelWithDebInfo + Ninja, llvm-mc 21.1.8.run_gpu_tests.py: 209/263 passed, 53 skipped, identical tomain(no fixture covers an invalid DPP lane withneg, so this shows no regression rather than the fix).ctest -j 6: all pass apart fromxs_proxy_mock, which failed while another build was running on this PC. This PR changes only Python, so that test binary is the same asmain's, and thexmemtests fail the same way onmainunder that load.AI-assisted (Claude)
@abnalstlll-byte on GitHub · 2026-11-25 16:03 UTC · original
Thanks for the review! Fixed: escaped the pipes in \|src0|\ in \docs/design.md\ so \ est_docs_design_rows.py\ passes cleanly (5/5 tests OK), and updated the measurement note to specify 'measured on RDNA3 (gfx1101)'.
@abnalstlll-byte on GitHub · 2026-11-25 16:03 UTC · original
Thanks for the review! Fixed: escaped the pipes in \|src0|\ in \docs/design.md\ so \ est_docs_design_rows.py\ passes cleanly (5/5 tests OK), and updated the measurement note to specify 'measured on RDNA3 (gfx1101)'.
@aslan2142 on GitHub · 2026-11-25 16:28 UTC · original
Thanks, @abnalstlll-byte. The fix and its test look right: the test fails on
mainand passes here. One thing before merge:fb3552fdd, and the DPP row indocs/design.mdstill has|src0|.test_docs_design_rows.pystill fails. Could you push the commit?Also please note "RDNA2 not measured" next to the RDNA3 (gfx1101) note, and name the model in the AI note.
AI-assisted (Claude Code, Claude Opus 5.5).
@abnalstlll-byte on GitHub · 2026-11-25 17:44 UTC · original
Pushed commit \
31e8ba5fb:AI-assisted (Claude Code, Claude Opus 5.5).
@QemmHD on GitHub · 2026-11-25 18:41 UTC · original
Heads-up from a test run on an RTX 4070 SUPER: the code part looks fine, but merged onto current main this PR fails
tests/test_docs_design_rows: adocs/design.mdtable row has more cells than the table header. Fixing that row should let it pass the consistency set.AI-assisted (Claude Code, Claude Opus 5.5).
@aslan2142 on GitHub · 2026-11-25 19:19 UTC · original
Merged, thanks! The fix, the test and the contract row are verified at
31e8ba5fb: the new test fails onmain(2 failures) and passes here, DPP tests are 19/19, and thedocs/design.mdrow now escapes|src0|and says "RDNA2 not measured".maine380a69a6+31e8ba5fb: the semantic suite passes (491 files, 6,312 tests, 0 files failed); the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 3 changed files.AI-assisted (Claude Code, Claude Opus 5.5).