compute: accept VCC destination and VCC/EXEC sources in s_brev_b64 and s_bfe_i64/u64 #3409
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3409
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3407"
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?
@Ammmae0x on GitHub · 2026-11-28 22:42 UTC · original
Ammmae0x:compute/salu-bfe64-brev64-vcc-exec→main· +312 −6 · 5 files · 1 commits · merged 2026-11-29 08:43 UTCChange
Accept
VCC(106) as the destination pair andVCC(106) /EXEC(126) as the 64-bitS0source pair ins_brev_b64,s_bfe_u64, ands_bfe_i64in the direct C++ compute path (src/gfx1013_direct_compute.inl, two-line guard change).(i.dst & 1) || (i.dst > 104 && i.dst != 106)—VCCaccepted alongside aligned SGPR pairs;EXEC(126),M0(124), and odd SGPRs still refused with"invalid " + string(n) + " destination".s0_pairis now(s0 <= 104 && !(s0 & 1)) || s0 == 106 || s0 == 126, readinglo/hi(andS1fors_bfe_*) before writingi.dst/i.dst + 1, so in-places_brev_b64 vcc, vccands_bfe_u64 vcc, vcc, s26stay overlap-safe (the handler already reads all inputs first, #3086).s_brev_b64preservesSCC;s_bfe_u64/s_bfe_i64setSCC = (D != 0).tests/native_salu_bfe64_brev64_check.py: the three obsolete refusals (VCCas destination for brev/BFE,EXECasS0fors_bfe_i64) now refuseM0(124) instead; theEXECdestination refusal is intact.tests/native_salu_bfe64_brev64_vcc_exec_check.py+tests/cmake/native_salu_bfe64_brev64_vcc_exec.cmakeregisteringnative_salu_bfe64_brev64_vcc_exec_controlsand_hardware(SKIP_RETURN_CODE 77,TIMEOUT 60): 16 hardware dispatches (12 wave64, 4 wave32) across all three ops fromVCCandEXECsources, including in-placeVCCdestinations, cross-word extraction, zero-width (SCC = 0), sign extension (s_bfe_i64negative vs positive top bit), andSCCpreservation ons_brev_b64; 8 negative controls refusingEXECdestination,M0, odd SGPR, and invalidS1, plus 4 reference mutants incontrols.docs/experiments/native-direct-salu-bfe64-brev64.mddocuments theVCCdestination andVCC/EXECsources.Refs #3226, #2935
Verification
Linux (this host cannot run Windows CTest,
compile_dxil, or DXC):/tmp/bfe_harness.py, not in the repo): decodes every case program withtools/disasm_rdna2.py, cross-checks the references against an independent brute-force oracle, verifies the vmove→store plane mapping, SCC priming, and thes0_pairguard logic:harness OK: 16 cases x wave32/wave64, brev/bfe encodings, SCC priming, store offsets, references and s0_pair guard all match/tmp, never in the worktree): M1 drops0 == 106 || s0 == 126from the C++ guard; M2 plane 1 stores the brev result instead of the bfe_u result; M3eval_bfeignores signedness; M4 brev SCC primed inverted; M5 in-place op runs first instead of last —spot mutations: 5/5 killed/tmp/pe-env/bin/python -B tests/form_coverage_check.py:form coverage checks passed/tmp/pe-env/bin/python -B tests/docs_links_check.py:Checked 160 Markdown files and 682 links/tmp/pe-env/bin/python -B tests/bidi_controls_check.py:Checked 2582 tracked source, script and build/CI files: no bidirectional controlspy_compileon both touched test files: passg++ -std=c++20 -Wall -WextraWindows verification still pending (needs a Windows host with MSVC, DXC, and a GPU adapter):
Evidence and follow-up
Fixtures are synthetic (hand-built scalar programs with literal control words), generated by the test scripts themselves; no game files involved. Assumptions:
operand32/require_numericaccept mask registers106/107/126/127(already proven by the mergeds_bfm_b64VCC destination and thes_bcnt/s_ff/s_flbitVCC source changes); symbolictransfer()clearsdst/dst+1generically for_b64/_u64/_i64suffixes, so no change was needed there. One harness gap found and fixed during the run: the first harness version sliced the wrong split segment when locating the handler (the names_brev_b64appears in two name lists before the handler); the harness now uses the third occurrence.Checklist
AI-assisted.
Windows Verification (
b6431bf5)26100, MSVC 19.50.35727.0, adapterNVIDIA GeForce RTX 4050 Laptop GPU(driver32.0.15.9186,XBOX2WINDOWS_ADAPTER=NVIDIA), D3D12 debug layer off, commitb6431bf59e8c83cbe4ac33ee253acbeef856e90e.cmake --build --preset dev --target compile_dxil native_store_replay-> exit0cmake --build --preset release --target compile_dxil native_store_replay-> exit0ctest --preset dev --no-tests=error -R '^(native_salu_bfe64_brev64_vcc_exec_|native_salu_bfe64_brev64_)' --output-on-failure->4/4passed (0skips)ctest --preset release --no-tests=error -R '^(native_salu_bfe64_brev64_vcc_exec_|native_salu_bfe64_brev64_)' --output-on-failure->4/4passed (0skips).\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py->form coverage checks passed(exit0).\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py->Self-test passed. Checked 160 Markdown files and 682 links.(exit0).\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py->Self-test passed. Checked 2584 tracked source, script and build/CI files: no bidirectional controls.(exit0)@Leyukaka on GitHub · 2026-11-29 04:00 UTC · original · approved these changes
Approve
b6431bf5. Reviewed by reading the diff; nothing built or run here.src/gfx1013_direct_compute.inl:3703: VCC (106) is accepted as the destination pair ofs_brev_b64/s_bfe_u64/s_bfe_i64.:3706: VCC or EXEC (126) is accepted as the 64-bitS0pair, with the high word fromoperand32(i, s0 + 1)at:3720(107/127, accepted at:180-183; register codes pertools/disasm_rdna2.py:38-51).lo/hiare read at:3717-3724and the control at:3732, before the writes at:3728-3729and:3747-3749, so in-placevcc, vccis safe. EXEC as destination,m0and odd registers stay refused. Only the two guards change; the arithmetic and SCC lines are untouched and matchdocs/experiments.md:8930.main(212d4b5f),tests/native_salu_bfe64_brev64_check.py:194,:198and:201assert the three refusals this PR removes; the PR retargets them tom0at the same lines and keeps the EXEC destination case at:195.tests/native_salu_bfe64_brev64_vcc_exec_check.py:229-236) mutate the Python reference, not the C++. By reading, a wrong high word for VCC/EXEC would be caught only by_hardware;_controlschecks compilation, the DXIL ops and the 8 refusals. No case uses VCC as destination with EXEC as source.prpreset filter (CMakePresets.json:51) has nonative_salu_*. The non-PR job runs thedevpreset with-E '_hardware$'(.github/workflows/windows.yml:498), so the_hardwareevidence is the author's run reported in the description (dev and release, 4/4, 0 skips at this head).@@ -3680(lines 3680-3689); this PR's hunk is at@@ -3700. The hunks do not overlap and the two PRs share no other file.ignore_offset_bit5is threaded througheval_bfe/eval_case(:76-98) but never used as a mutant. The addedctest -R '^native_salu_bfe64_brev64_vcc_exec_'line indocs/experiments/native-direct-salu-bfe64-brev64.mdis redundant, because-R '^(native_salu_bfe64_brev64_|...)'already matches the new tests.