compute: accept VCC as destination in s_bfm_b64 #3359
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!3359
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3357"
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 13:38 UTC · original
Ammmae0x:compute/s-bfm-b64-vcc→main· +166 −4 · 5 files · 2 commits · merged 2026-11-28 19:07 UTCChange
Refs #3226, #2935
Accept
VCC(i.dst == 106) as the destination ofs_bfm_b64in the direct C++ compute path (src/gfx1013_direct_compute.inl). The destination guard now admits aligned SGPR pairs (<= 104),VCC(106) andEXEC(126), mirrorings_cselect_b64/s_not_b64(#3264). Bothvcc_loandvcc_hiare written through the existingwrite()path andSCCis untouched, so it is preserved. Odd destinations,M0(124) and invalid sources are still refused withinvalid s_bfm_b64 destination/invalid s_bfm_b64 source.This removes the highest-impact unclaimed refusal in the refreshed census in #3226 (
invalid s_bfm_b64 destination: 9 wave64 shaders / 27,004 dispatches).New coverage in
tests/native_s_bfm_b64_vcc_check.py(registered asnative_s_bfm_b64_vcc_controls/native_s_bfm_b64_vcc_hardware,SKIP_RETURN_CODE 77,TIMEOUT 60): wave64 and wave32s_bfm_b64 vcc, width, offsetfor width 0, low half (16, 0), high half (32, 32), a 32-bit straddle (20, 24) and width 64 (masked via& 63to an empty mask), reading backvcc_lo/vcc_hi, using VCC inv_cndmask_b32, and checking SCC is unchanged before and after. Negative controls refuseM0(124), odd SGPR 23, and invalid sources (VCC/M0as width/offset operands) with no.cs.csooutput.tests/native_wave64_exec_salu_check.pydrops the now-obsoletes_bfm_b64 vccrefusal and instead refusesM0and odd SGPR 23 as destinations; all existingEXECandBCNT1_B64checks are unchanged.docs/experiments/native-salu64-ops.mddocuments the new destination.Out of scope: the
gfx2hlsltext translator (tests/startup_gfx2hlsl_bfm_b64_check.py) and the pixel path still refuses_bfm_b64 vcc; those are separate translators and are unchanged here.AI-assisted.
Verification
Commit under test:
f81feb164814807c38fb793189f66572f16dcea2(repair of2e460b2666add2d7d17018392fcdac1f40de8daa) (branchcompute/s-bfm-b64-vcc, forkAmmmae0x/Xbox2Windows).Linux (this VM, Python 3.12.3,
/tmp/pe-envvenv withiced-x86==1.21.0,pefile==2024.8.26):/tmp/pe-env/bin/python -B tests/form_coverage_check.py— exit 0 (form coverage checks passed)/tmp/pe-env/bin/python -B tests/docs_links_check.py— exit 0 (Checked 155 Markdown files and 677 links.)/tmp/pe-env/bin/python -B tests/bidi_controls_check.py— exit 0 (Checked 2547 tracked source, script and build/CI files: no bidirectional controls.)/tmp/pe-env/bin/python -B -m py_compile tests/native_s_bfm_b64_vcc_check.py tests/native_wave64_exec_salu_check.py tests/native_s_not_b64_exec_check.py tests/native_salu64_check.py— exit 0/tmp/bfm_vcc_harness.py, decodes the emitteds_bfm_b64word, theset_sccword and the store→plane mapping, and independently recomputes every expected word):harness OK: 5 cases x wave32/wave64, BFM dst=VCC, SCC decode, store offsets, reference words all matchdiffagainst a backup andgit status):vcc_loword to 8 bits — KILLED (harness exit 1)s_bfm_b64destination fromVCCtoEXEC— KILLEDset_sccpolarity — KILLEDvcc_hiinto thevcc_loplane — KILLEDg++ -std=c++20 -fsyntax-onlyand is byte-identical in form to the provens_cselect_b64guard. A fullcompile_dxilbuild was NOT possible on Linux:g++ -fsyntax-only src/gfx1013_compute_native.cppstops atd3d12.h: No such file or directory(Windows SDK absent).Not run — needs Windows (see the
WIN-VERIFYtag below):cmake --build --preset dev --target compile_dxil native_store_replayandctest --preset dev --no-tests=error -R '^(native_s_bfm_b64_vcc_|native_wave64_exec_salu|native_salu64)' -V, including thenative_s_bfm_b64_vcc_hardwarereplay on a real adapter. An exit-77 skip is not a pass; report the adapter separately.Repair in
f81feb164814807c38fb793189f66572f16dcea2(Windows verification of2e460b26failed innative_s_bfm_b64_vcc_controls: all 10 cases failed withunbound numeric SGPR s9at+0x3c):vmove(1, 9)encodedv_mov_b32 v1, s9, not VGPRv9— plane 0 is now stored directly with*store(9, 0)(thes_not_b64template's idiom), and only the SGPR sources (VCC,VCC + 1,SCC_OUT) go throughvmove. The deadsop1(MOV_B64, EXEC, NEG_ONE)restore before readback was also removed:EXECis never narrowed inprogram()(unlike thes_not_b64template), so in wave64 it was already all ones and in wave32 it only widenedEXEC_HIfrom the seeded 1. MSVC build (compile_dxil,native_store_replay) andnative_salu64_controlsalready passed on Windows; onlynative_s_bfm_b64_vcc_controls(and the hardware test) need re-running. Linux re-verification of the repair: offline harnessharness OK: 5 cases x wave32/wave64(strengthened to reject anyvmove(1, 9)and to check the store→plane mapping including direct VGPR stores; it fails on the pre-repair code), 3/3 spot-mutations killed,form_coverage_check.py,docs_links_check.py(155 files, 677 links) andbidi_controls_check.py(2549 files) all exit 0.Evidence and follow-up
Fixtures are synthetic hand-encoded instruction words (no game files); the reference mask is computed independently as
((1 << (width & 63)) - 1) << (offset & 63). Assumptions: in the direct compute model VCC is a 64-bit pair in both wave sizes, as already established bynative_salu64_check.py(which reads back aVCCdestination viav_mov_b32) andnative_s_not_b64_exec_check.py.Follow-up for Windows verification: run the
ctestfilter above; ifnative_lds_request-style hardware is unavailable, report the skip separately. The_validate_writable_dirwritability follow-up on #3138 is unrelated and stays a follow-up.Checklist
Windows Verification (
f81feb16)26100, MSVC 19.50.35727.0, adapterNVIDIA GeForce RTX 4050 Laptop GPU(driver32.0.15.9186,XBOX2WINDOWS_ADAPTER=NVIDIA), D3D12 debug layer off, commitf81feb164814807c38fb793189f66572f16dcea2.cmake --build --preset dev --target compile_dxil native_store_replay-> exit0cmake --build --preset release --target compile_dxil native_store_replay-> exit0.\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 155 Markdown files and 677 links.(exit0).\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py->Self-test passed. Checked 2549 tracked source, script and build/CI files: no bidirectional controls.(exit0)Verbatim
ctest --preset dev --no-tests=error -R '^(native_s_bfm_b64_vcc_|native_wave64_exec_salu|native_salu64)' -V(5/5 passed, 0 skips)``text
UpdateCTestConfiguration from :/DartConfiguration.tcl
Test project /out/build/dev
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 2701
Start 2701: native_s_bfm_b64_vcc_controls
2701: Test command: \out\pe-env\Scripts\python.exe "-B" "/tests/native_s_bfm_b64_vcc_check.py" "controls" "/out/build/dev/compile_dxil.exe" "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
2701: Working Directory: /out/build/dev
2701: Test timeout computed to be: 60
2701: Wave32 and wave64 compile controls and invalid operand refusals passed
1/5 Test #2701: native_s_bfm_b64_vcc_controls ...... Passed 0.82 sec
test 2702
Start 2702: native_s_bfm_b64_vcc_hardware
2702: Test command: \out\pe-env\Scripts\python.exe "-B" "/tests/native_s_bfm_b64_vcc_check.py" "hardware" "/out/build/dev/native_store_replay.exe" "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
2702: Working Directory: /out/build/dev
2702: Test timeout computed to be: 60
2702: adapter=NVIDIA GeForce RTX 4050 Laptop GPU vendor=10de device=28e1
2702: wave32 bfm vcc 0,0 SCC=1: both groups and guards matched
2702: wave32 bfm vcc 16,0 SCC=0: both groups and guards matched
2702: wave32 bfm vcc 32,32 SCC=1: both groups and guards matched
2702: wave32 bfm vcc 20,24 SCC=0: both groups and guards matched
2702: wave32 bfm vcc 64,0 SCC=1: both groups and guards matched
2702: wave64 bfm vcc 0,0 SCC=1: both groups and guards matched
2702: wave64 bfm vcc 16,0 SCC=0: both groups and guards matched
2702: wave64 bfm vcc 32,32 SCC=1: both groups and guards matched
2702: wave64 bfm vcc 20,24 SCC=0: both groups and guards matched
2702: wave64 bfm vcc 64,0 SCC=1: both groups and guards matched
2/5 Test #2702: native_s_bfm_b64_vcc_hardware ...... Passed 3.08 sec
test 2713
Start 2713: native_salu64_controls
2713: Test command: \out\pe-env\Scripts\python.exe "-B" "/tests/native_salu64_check.py" "controls" "/out/build/dev/compile_dxil.exe" "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
2713: Working Directory: /out/build/dev
2713: Test timeout computed to be: 60
2713: invalid s_cselect_b64 destination
2713: invalid s_not_b64 source
3/5 Test #2713: native_salu64_controls ............. Passed 0.21 sec
test 2714
Start 2714: native_salu64_hardware
2714: Test command: \out\pe-env\Scripts\python.exe "-B" "/tests/native_salu64_check.py" "hardware" "/out/build/dev/native_store_replay.exe" "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
2714: Working Directory: /out/build/dev
2714: Test timeout computed to be: 60
2714: bfm 0,0: result words, SCC and guards matched
2714: bfm 1,0: result words, SCC and guards matched
2714: bfm 31,1: result words, SCC and guards matched
2714: bfm 32,32: result words, SCC and guards matched
2714: bfm 33,0: result words, SCC and guards matched
2714: bfm 63,1: result words, SCC and guards matched
2714: bfm 64,0: result words, SCC and guards matched
2714: cselect pair,-1 SCC=0: result words, SCC and guards matched
2714: cselect literal,pair SCC=0: result words, SCC and guards matched
2714: cselect pair,-1 SCC=1: result words, SCC and guards matched
2714: cselect literal,pair SCC=1: result words, SCC and guards matched
2714: not (2309737967, 19088743): result words, SCC and guards matched
2714: not (0, 0): result words, SCC and guards matched
2714: not (4294967295, 4294967295): result words, SCC and guards matched
2714: not (4294967295, 0): result words, SCC and guards matched
4/5 Test #2714: native_salu64_hardware ............. Passed 5.08 sec
test 2761
Start 2761: native_wave64_exec_salu_hardware
2761: Test command: \out\pe-env\Scripts\python.exe "-B" "/tests/native_wave64_exec_salu_check.py" "/out/build/dev/compile_dxil.exe" "/out/build/dev/native_store_replay.exe" "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
2761: Working Directory: /out/build/dev
2761: Test timeout computed to be: 60
2761: wave64, 64 threads, count: both groups and guards matched
2761: wave64, 64 threads, lower: both groups and guards matched
2761: wave64, 64 threads, upper: both groups and guards matched
2761: wave64, 128 threads, count: both groups and guards matched
2761: wave64, 128 threads, lower: both groups and guards matched
2761: wave64, 128 threads, upper: both groups and guards matched
2761: wave32, 32 threads, count: both groups and guards matched
5/5 Test #2761: native_wave64_exec_salu_hardware ... Passed 2.62 sec
The following tests passed:
native_s_bfm_b64_vcc_controls
native_s_bfm_b64_vcc_hardware
native_salu64_controls
native_salu64_hardware
native_wave64_exec_salu_hardware
100% tests passed, 0 tests failed out of 5
Total Test time (real) = 11.93 sec
``
Verbatim
ctest --preset release --no-tests=error -R '^(native_s_bfm_b64_vcc_|native_wave64_exec_salu|native_salu64)' -V(5/5 passed, 0 skips)``text
UpdateCTestConfiguration from :/DartConfiguration.tcl
Test project /out/build/release
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 2701
Start 2701: native_s_bfm_b64_vcc_controls
2701: Test command: \out\pe-env\Scripts\python.exe "-B" "/tests/native_s_bfm_b64_vcc_check.py" "controls" "/out/build/release/compile_dxil.exe" "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
2701: Working Directory: /out/build/release
2701: Test timeout computed to be: 60
2701: Wave32 and wave64 compile controls and invalid operand refusals passed
1/5 Test #2701: native_s_bfm_b64_vcc_controls ...... Passed 0.77 sec
test 2702
Start 2702: native_s_bfm_b64_vcc_hardware
2702: Test command: \out\pe-env\Scripts\python.exe "-B" "/tests/native_s_bfm_b64_vcc_check.py" "hardware" "/out/build/release/native_store_replay.exe" "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
2702: Working Directory: /out/build/release
2702: Test timeout computed to be: 60
2702: wave32 bfm vcc 0,0 SCC=1: both groups and guards matched
2702: wave32 bfm vcc 16,0 SCC=0: both groups and guards matched
2702: wave32 bfm vcc 32,32 SCC=1: both groups and guards matched
2702: wave32 bfm vcc 20,24 SCC=0: both groups and guards matched
2702: wave32 bfm vcc 64,0 SCC=1: both groups and guards matched
2702: wave64 bfm vcc 0,0 SCC=1: both groups and guards matched
2702: wave64 bfm vcc 16,0 SCC=0: both groups and guards matched
2702: wave64 bfm vcc 32,32 SCC=1: both groups and guards matched
2702: wave64 bfm vcc 20,24 SCC=0: both groups and guards matched
2702: wave64 bfm vcc 64,0 SCC=1: both groups and guards matched
2/5 Test #2702: native_s_bfm_b64_vcc_hardware ...... Passed 2.99 sec
test 2713
Start 2713: native_salu64_controls
2713: Test command: \out\pe-env\Scripts\python.exe "-B" "/tests/native_salu64_check.py" "controls" "/out/build/release/compile_dxil.exe" "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
2713: Working Directory: /out/build/release
2713: Test timeout computed to be: 60
2713: invalid s_cselect_b64 destination
2713: invalid s_not_b64 source
3/5 Test #2713: native_salu64_controls ............. Passed 0.20 sec
test 2714
Start 2714: native_salu64_hardware
2714: Test command: \out\pe-env\Scripts\python.exe "-B" "/tests/native_salu64_check.py" "hardware" "/out/build/release/native_store_replay.exe" "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
2714: Working Directory: /out/build/release
2714: Test timeout computed to be: 60
2714: bfm 0,0: result words, SCC and guards matched
2714: bfm 1,0: result words, SCC and guards matched
2714: bfm 31,1: result words, SCC and guards matched
2714: bfm 32,32: result words, SCC and guards matched
2714: bfm 33,0: result words, SCC and guards matched
2714: bfm 63,1: result words, SCC and guards matched
2714: bfm 64,0: result words, SCC and guards matched
2714: cselect pair,-1 SCC=0: result words, SCC and guards matched
2714: cselect literal,pair SCC=0: result words, SCC and guards matched
2714: cselect pair,-1 SCC=1: result words, SCC and guards matched
2714: cselect literal,pair SCC=1: result words, SCC and guards matched
2714: not (2309737967, 19088743): result words, SCC and guards matched
2714: not (0, 0): result words, SCC and guards matched
2714: not (4294967295, 4294967295): result words, SCC and guards matched
2714: not (4294967295, 0): result words, SCC and guards matched
4/5 Test #2714: native_salu64_hardware ............. Passed 4.67 sec
test 2761
Start 2761: native_wave64_exec_salu_hardware
2761: Test command: \out\pe-env\Scripts\python.exe "-B" "/tests/native_wave64_exec_salu_check.py" "/out/build/release/compile_dxil.exe" "/out/build/release/native_store_replay.exe" "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
2761: Working Directory: /out/build/release
2761: Test timeout computed to be: 60
2761: wave64, 64 threads, count: both groups and guards matched
2761: wave64, 64 threads, lower: both groups and guards matched
2761: wave64, 64 threads, upper: both groups and guards matched
2761: wave64, 128 threads, count: both groups and guards matched
2761: wave64, 128 threads, lower: both groups and guards matched
2761: wave64, 128 threads, upper: both groups and guards matched
2761: wave32, 32 threads, count: both groups and guards matched
5/5 Test #2761: native_wave64_exec_salu_hardware ... Passed 2.70 sec
The following tests passed:
native_s_bfm_b64_vcc_controls
native_s_bfm_b64_vcc_hardware
native_salu64_controls
native_salu64_hardware
native_wave64_exec_salu_hardware
100% tests passed, 0 tests failed out of 5
Total Test time (real) = 11.44 sec
``
@Leyukaka on GitHub · 2026-11-28 19:07 UTC · original · approved these changes
GPU review of
f81feb16.mainf2972840with this PR and 17 other open PRs merged locally:native_s_bfm_b64_vcc_controls,native_s_bfm_b64_vcc_hardwareandnative_wave64_exec_salu_hardwarepass. Dropping&& i.dst != 106makes the twonative_s_bfm_b64_vcctests fail.Not covered: the narrow wave64 model (a 64-lane wave of at most 32 threads).
Approve.