compute: classify remaining scalar ops in direct SCC liveness #3611
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!3611
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3609"
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-30 13:36 UTC · original
Ammmae0x:compute/direct-scc-liveness→main· +982 −3 · 6 files · 2 commits · merged 2026-11-30 15:51 UTCRefs #3226, #2935
Issue #3226's census still lists the "numeric SCC from a symbolic descriptor field" refusal (2 shaders / 203,617 dispatches in
8ecd30fe) after #3229 and #3303.Change
uses_scc_after()(src/gfx1013_direct_compute.inl) treated every SOPK op excepts_movk_i32as uncertain and missed SCC writers and readers, so programs that kill or preserve SCC through those ops were refused as if SCC were still live at a symbolic descriptor field:s_bfe_i32,s_addk_i32, all twelves_cmpk_*(they write SCC from the extracted value, the signed overflow, or the comparison result, without reading incoming SCC).s_mulk_i32, the four counter waits (s_waitcnt_vscnt/vmcnt/expcnt/lgkmcnt),s_setreg_b32,s_setreg_imm32_b32(newpreserves_sopklist; the Sopk uncertain clause now excludes overwriters and preservers).s_addc_u32,s_subb_u32(they consume SCC throughread(128)).Unimplemented scalar ops stay uncertain. SOPP ops are not listed: the uncertain test never matches them, so lowered ones fall through and preserve SCC.
s_setreg_b32is classified as a preserver althoughconsume_half_mode()never accepts it in compute, so any program containing it still refuses at lowering.s_wqm_b32/s_wqm_b64stay inmask_sccalthougharithmetic()does not lower them.WIN-VERIFY fix (
f4d347b1)Windows dev verification of
c60704bfcompiled the C++ cleanly and caught three fixture bugs intests/native_scc_liveness_check.py(the translator change itself is untouched):prologue(), beforegroup_base(), whoses_lshl_b32overwrites SCC, so all 15 SCC refusals returnedrc=0instead of refusing. The field now comes after the group base and the SGPR initializations (newbase_words()helper), so the field's SCC is the one the tested instruction sees.s24ands27were read unbound in several controls programs (pass-mode,pass-nop,pass-branch-over-reader,refuse-cbranch-scc1,refuse-diamond-one-overwrite). The base now initializes them (movk(24, 1)+movk(27, 0);movk(24, 6)for the one-arm-overwrite diamond), and the stride-bound positive control uses the same base.hardware_program()storeds25numerically, but the stride field value is symbolic. Slot 15 now re-extracts the field and proves the mode writes (s_round_mode 0,s_denorm_mode 0xf,s_setreg_imm32_b32) preserve its SCC intos_cselect_b32.The no-arg audit now also pins the base initializations and the pass/refusal split itself: between the field and the first SCC reader, every pass program has an overwriter (except the branch-over-reader, which passes by skipping the reader) and every SCC refusal program has none (except the diamond that refuses on its preserving arm, and the three mode refusals, which refuse on the mode op).
Verification (Linux)
No-arg audit, run from the repository root:
Full Linux check suite (the
python-linuxjob shape):Plus
tests/form_coverage_check.py,tests/docs_links_check.py(187 files, 738 links),tests/bidi_controls_check.py(2728 files),py_compile,git diff --check— all clean;git merge-tree --write-tree origin/main HEADexits 0.controlsandhardwaremodes (native_scc_liveness_controls,native_scc_liveness_hardware) needcompile_dxilandnative_store_replayon Windows and are not covered by the Linux run above.Windows Verification (
f4d347b1)AI-assisted.
@R0Y00 on GitHub · 2026-11-30 15:51 UTC · original · approved these changes
Independent Release retest of
f4d347b1: builtcompile_dxilandnative_store_replay;ctest --preset release --no-tests=error --output-on-failure -j 1 -R '^(native_scc_liveness_.*|native_direct_container)$'passed 3/3 with zero skips, including the RTX hardware replay. The liveness scan still prioritizes real consumers and only stops on unconditional writes. The fixture keeps carry/borrow reads, the one-arm branch negative and mode-preservation checks.