compute: accept VCC as source in 64-bit scalar bit-count and bit-scan #3458
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!3458
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3456"
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?
@Leyukaka on GitHub · 2026-11-29 13:32 UTC · original
Leyukaka:takeover-3402-salu-bitscan64-vcc→main· +268 −8 · 7 files · 3 commits · merged 2026-11-29 13:41 UTCTakeover of #3404 by @Ammmae0x.
Change
414874b6(@Ammmae0x, unchanged): thes0_pairguard insrc/gfx1013_direct_compute.inlacceptss0 == 106(VCC) as the 64-bit source ofs_bcnt0_i32_b64,s_bcnt1_i32_b64,s_ff0_i32_b64,s_ff1_i32_b64,s_flbit_i32_b64ands_flbit_i32_i64. It addsnative_salu_bitscan64_vcc_controls/native_salu_bitscan64_vcc_hardware, switches two existing VCC refusals toM0, and updatesdocs/experiments/native-direct-salu-bitscan64.md.863e9549: merge ofmainc04e0dd6, no conflict.ee117c4f(tests only, 2 files):tests/native_scalar_mask64_check.py: removes the commentVCC stays refused as a 64-bit count sourceand the twocount_program()cases (64 and 32 threads) that expectedinvalid s_bcnt1_i32_b64 source.count_program()defaults tosrc=106; the guard change stops refusing that source, so the two cases no longer hold (not run on414874b6alone; this is from reading the guard).count_program(src=107)stays.tests/native_salu_bitscan64_vcc_check.py: adds a refusal casesop1(FF1_64, 24, VCC + 1)expectinginvalid s_ff1_i32_b64 source, so the new controls also refusevcc_hi(107) as a source. The printed count goes from 6 to 7 invalid forms.git diff --stat c04e0dd6 ee117c4f: 7 files, +268 -8.git merge-tree --write-tree --name-only origin/main ee117c4fagainstmain17b662a2exits 0.Verification
Head
ee117c4f, Windows, network off,devpreset configured with-DX2W_WITH_OPUS=OFF, full build (exit 0), a hardware adapter.ctest --preset dev --no-tests=error -R '^(native_salu_bitscan64|native_wave64_exec_salu|native_scalar_mask64_)'-> exit 0Not covered
_controlsand_hardwaretests.native_salu_bitscan64_vcc_hardwaretook 57.59 s here against its 60 sTIMEOUT.releasepreset not run on this head.cmp_lt16/cmp_eq0cases expectvcc_hi == 0without setting it.gfx2hlsltext translator and the pixel path are untouched.Refs #3404, #3226, #2935
@JohnConnorNPC on GitHub · 2026-11-29 13:40 UTC · original
Review of head
ee117c4f. Its merge-base isc04e0dd6.git merge-tree --write-tree origin/main ee117c4fagainstmain4b0586d4exits 0. No commit onmainsincec04e0dd6touchessrc/gfx1013_direct_compute.inl. I only read the change. Nothing was built here; the native tests need Windows and DXC.BLOCKED: this was CI still running. The run started at 13:32Z. At 13:38Z,
Build and test on Windows,Run platform-independent Python checks on LinuxandAssemble and translate gfx1013 fixtureshad all passed, and the PR showedMERGEABLE CLEAN.Checked:
|| s0 == 106 ||).operand32(i, 106)andoperand32(i, 107)liftsgpr_limitto 108 for VCC. This is the same pair read thatpair_highand the other 64-bit SALU guards onmainalready accept (s0 == 106in thes_*_b64mask lowerings). In wave32,initializewritess107 = 0, which is why thecmp_lt16/cmp_eq0wave32 cases expecthi = 0. The lowering after the guard is unchanged. It usesunaryBits31/32/33 = Countbits/FirstbitLo/FirstbitHi.count_program()cases that expectedinvalid s_bcnt1_i32_b64 sourcefor VCC are removed.count_program(src=107)stays. On the merged tree,git grep -n 'invalid s_(bcnt[01]_i32_b64|ff[01]_i32_b64|flbit_i32_[bi]64) source'finds only non-VCC sources (M0, odd SGPR,exec_hi,vcc_hi, float).controlsfails onmain: its first compile usesS0 = VCCand assertsreturncode == 0.SHOULD
native_salu_bitscan64_vcc_hardwaretook 57.59 s in the posted run, againstTIMEOUT 60intests/cmake/native_salu_bitscan64_vcc.cmake. It starts onenative_store_replayper case, 102 in all (2 wave sizes × 51 cases). A slower adapter or a debug-layer run would hit the timeout, and ctest reports that as a failure, not a skip. A follow-up could raise the timeout, for example to 180 astests/cmake/native_image_atomic_binops.cmakedoes, or batch the cases into fewer dispatches.NIT
docs/experiments/native-direct-salu-bitscan64.mdsays the controls check "6 invalid destination/source refusals (vcc/exec/m0dst, …)". Therefusedtuple intests/native_salu_bitscan64_check.pyhas noM0destination case. The two destination cases are VCC and EXEC, andM0is used only as a source.Nothing blocks. Merging at
ee117c4f.AI-assisted.