gfx2hlsl: accept mask-preserving lane-mask writes in an execz block #2715
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2723"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:48:05Z.
Part of #1723
What this unblocks: compute shaders whose compiler-made i1 phi (a lane mask with a per-lane old value,
s_andn2+ exec-masked compare +s_or) is defined in ans_cbranch_execzblock and read per lane after the join now translate instead of being refused withdefinition of <M>, live where the block joins.What changed
phi_mask_ok(extends the i1-phi rule from #2505) now accepts, for a 32-bit lane mask M (vcc_lo or one sN) written inside an execz block:s_andn2_b32 M, M, exec_lo, ands_or_b32 M, M, Twhere T was written in the block bys_and_b32 T, X, exec_loor av_cmp;v_cmp(notv_cmpx) into M only when M was zeroed before the branch;s_orn2_b32 M, X, exec_loonly when M was set to all ones (s_mov_b32 M, -1) before the branch.Why it is exact: the model skips a lane when its exec bit is clear, and the exec proof (#2509) keeps that bit clear through the block. The wave runs the block when any lane is active. So the model equals the wave iff the block leaves a skipped lane's mask bit unchanged. Preserving writes always do; compare/exec-copy writes only after zeroing;
s_orn2only after all ones. Zeroing and all-ones writes are never mixed, any other write of M (including an offsets_movkinto M) stays refused, and whole-mask reads after the join stay refused. The exhaustive 4-lane check is in the test file.No overlap with #2557: it covers absorbed reads and an andn2-only narrowed mask; this PR covers the blend and the compare/orn2 set-up forms and does not touch those two rules.
Tests
tests/startup_gfx2hlsl_compute_check.py: acceptance of the blend, andn2-only, vcc blend, zeroed compare and all-ones orn2; refusals for each missing set-up, an unmasked term, M not the first source, mixed classes, and whole-mask reads; exhaustive 4-lane checkcheck_execz_mask_exact.p-dropped-andn2,p-dropped-or,p-block-entered,q-block-entered,q-not-all-ones(registered in CMake for warp and hardware).Verification
Linux (this is Stage-1, no Windows run):
python3 -I tests/startup_gfx2hlsl_compute_check.py-> pass (new checks fail on origin/main withs_andn2_b32 inside a block s_cbranch_execz skips per lane: definition of s20, live where the block joins)python3 -B tests/startup_gfx2hlsl_compute_check.py binary llvm-mc-19->fixture words match llvm-mcs_cbranch_execzis emitted): blend andtruenow translate, the others unchangedWin2025 (dev + release, head
27ad219ce, merged with current main):x2w_pipe.py win2025 2723 --py-checks tests/startup_gfx2hlsl_compute_check.py --targets offscreen_check --regex startup_gfx2hlsl_compute: 45/45 passed, including dispatch cases P and Q on warp and hardware and the five new controls (p-dropped-andn2, p-dropped-or, p-block-entered, q-block-entered, q-not-all-ones), each rejected at its first bad word.Build and run:
cmake --build --preset dev --target offscreen_checkthenctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_compute' -V.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:42:19Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
27ad219ce0ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:57:46Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:57:48Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:36:59Z.
@MasterDomino Ready for review on head
27ad219ce.Independent gate review:
mainwas merged into the branch first (CMake control list conflict resolved, both sides kept, no rebase, no force). Then I tried to breakphi_mask_ok: a zeroed or all-ones mask overwritten before the branch, an unmasked term, exec widened inside the block before thes_andn2,s_orn2with swapped sources,s_xorinto the mask, a 64-bits_andn2, ans_orinto a different register read after the join, and whole-mask numeric reads of the mask or its term after the join (s_lshr,s_bcnt1,v_cvt,v_mov,s_and,s_add). All stay refused; only the blend, andn2-only, vcc blend, zeroed compare and all-ones orn2 forms translate. A break-it sweep of 166 shapes translates the same asorigin/main.Verification:
python3 -B tests/startup_gfx2hlsl_compute_check.pyand... binary llvm-mc-19pass.x2w_pipe.py win2025 2723 --py-checks tests/startup_gfx2hlsl_compute_check.py --targets offscreen_check --regex startup_gfx2hlsl_compute: 45/45 passed, including the partial-wave dispatch cases P and Q (warp, hardware) and their wrong-value controls.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:37:00Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
27ad219ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:42:19Z.
Code review location:
tools/startup/gfx2hlsl.py; line 2878In a Linux translation repro, changing case Q's block instruction to
s_orn2_b32 s23, s7, exec_lonow succeeds where the parent refused it, but group 1/lane 1 gets mask bit 0 from the source instruction (s7 = 1,exec_lo = 7) and bit 1 from the emitted(s7 | ~exec) & 1, incorrectly inverting output word 9. The newkeeppath has the same encoding problem if case P initializes M withs_mov_b32 s23, 16: skipped lane 4 retains source bit 1 but reads bit 0 in HLSL. Require inputs whose bit 0 already represents the current lane, or project whole-word inputs before admitting these shapes; skipped-lane preservation alone does not establish correct translation.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T04:42:19Z.
Code review location:
tools/startup/gfx2hlsl.py; line 2573This broadens the public compute-translation capability, but
docs/experiments.md:15352-15366still requires M to be zeroed before the branch and explicitly lists missing/nonzero initialization and writes not sourced from exec as refusal conditions. That contradicts the newly accepted preserving, compare, and all-ones forms, leaving the capability reference describing the old behavior. Update the corresponding compute-stage section with the new accepted shapes and their restrictions.AGENTS.md reference: AGENTS.md:L315-L316
Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:57:46Z.
Code review location:
tools/startup/gfx2hlsl.py; line 2878Confirmed and fixed in
94c692b4(merged with main as9ab28289).The one-lane model reads a lane mask's bit 0, while the wave holds the lane's bit at bit
lane. So a mask built from data (a group id,s_mov_b32 M, 16) was translated wrongly. Now every mask a block write uses must hold lane bits: av_cmp, ans_andwith exec and a lane mask, a copy of exec, or 0 / -1. Specifically:s_orn2 M, X, exec_lo: X must be a lane mask (yours_orn2_b32 s23, s7, exec_locase is refused);s_andn2/s_orblend: T must be an exec-masked lane mask, and M's last write before the branch must itself hold lane bits (sos_mov_b32 s23, 16is refused);s_and M, X, exec_lo(zeroing class): the same rule for X. This also closes the older group-id form, and I changed the existing test that expected it to be accepted.Tests added in
tests/startup_gfx2hlsl_compute_check.py(check_controls): refusals for s7 as X or T,s_mov_b32 s20, 16as M, and M unknown; the accepted shapes now use compare-derived masks. Disabling the new M rule makes thes_mov_b32 s20, 16control fail.Commands run locally (Linux):
python3 -B tests/startup_gfx2hlsl_compute_check.py,startup_gfx2hlsl_mask_overwrite_check.py,startup_gfx2hlsl_mask_data_check.py,startup_gfx2hlsl_refusals_check.py,startup_compute_translate_check.py: all pass;git diff --checkclean.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:57:48Z.
Code review location:
tools/startup/gfx2hlsl.py; line 2573Fixed in
94c692b4/9ab28289:docs/experiments.md(compute-stage execz section) now lists the preserving, compare and all-ones forms, the lane-bit requirement for every mask they use, the zeroing / all-ones set-up each one needs, and the cases that stay refused. The refusal list no longer says "a write of M that is not from exec".python3 -B tests/docs_links_check.pypasses.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:11:46Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:11:51Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:27:22Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
9ab2828926e6760fc8b99545c3b21efe74214dff:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj -- -j 2):0.73s(configure0.00s)ctest --preset dev -R 'startup_gfx2hlsl_compute_(controls|warp)' --parallel 6 --no-tests=error --output-on-failure): 2/2 passed (2.27s:startup_gfx2hlsl_compute_controls0.51s,startup_gfx2hlsl_compute_warp2.15s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj -- -j 2):2.28s(configure1.79s)ctest --preset release -R 'startup_gfx2hlsl_compute_(controls|warp)' --parallel 6 --no-tests=error --output-on-failure): 2/2 passed (2.13s:startup_gfx2hlsl_compute_controls0.46s,startup_gfx2hlsl_compute_warp2.02s)tests/mesh_heap_sampler_check.pyok (0.6s),tests/startup_buffer_address_check.pyok (0.4s),tests/startup_buffer_format_word3_table_check.pyok (0.1s),tests/startup_compute_image_store_check.pyok (0.5s),tests/startup_compute_image_store_d16_check.pyok (0.5s),tests/startup_compute_request_offline_check.pyok (0.5s),tests/startup_compute_store_format_xyzw_check.pyok (0.2s),tests/startup_compute_translate_check.pyok (0.2s),tests/startup_flat_param_check.pyok (0.1s),tests/startup_gfx2hlsl_add_sub_co_check.pyok (0.1s),tests/startup_gfx2hlsl_add_sub_co_ci_check.pyok (0.1s),tests/startup_gfx2hlsl_bfm_b64_check.pyok (1.1s),tests/startup_gfx2hlsl_bit_alu_check.pyok (0.6s),tests/startup_gfx2hlsl_capture_check.pyok (0.9s),tests/startup_gfx2hlsl_cmp16_check.pyok (0.2s),tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.pyok (27.5s),tests/startup_gfx2hlsl_compare_dst_check.pyok (0.1s),tests/startup_gfx2hlsl_compute_check.pyok (0.4s),tests/startup_gfx2hlsl_cselect_mask_check.pyok (0.1s),tests/startup_gfx2hlsl_cvt_alu_check.pyok (0.2s),tests/startup_gfx2hlsl_cvt_off_f32_i4_check.pyok (0.2s),tests/startup_gfx2hlsl_cvt_pk_int16_check.pyok (0.2s),tests/startup_gfx2hlsl_f32_lg_check.pyok (1.1s),tests/startup_gfx2hlsl_f32_nan_check.pyok (4.3s),tests/startup_gfx2hlsl_fma_mix_check.pyok (0.1s),tests/startup_gfx2hlsl_getpc_refusal_check.pyok (0.1s),tests/startup_gfx2hlsl_handler_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_heap_record_check.pyok (0.2s),tests/startup_gfx2hlsl_image_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_image_get_lod_check.pyok (0.2s),tests/startup_gfx2hlsl_int_med3_check.pyok (0.1s),tests/startup_gfx2hlsl_interp_p2_hi_check.pyok (0.2s),tests/startup_gfx2hlsl_join_symbols_check.pyok (0.2s),tests/startup_gfx2hlsl_loop_constants_check.pyok (0.1s),tests/startup_gfx2hlsl_mask_data_check.pyok (0.1s),tests/startup_gfx2hlsl_mask_overwrite_check.pyok (0.1s),tests/startup_gfx2hlsl_operand_count_check.pyok (0.3s),tests/startup_gfx2hlsl_pack_absdiff_check.pyok (2.1s),tests/startup_gfx2hlsl_pack_b32_f16_check.pyok (0.1s),tests/startup_gfx2hlsl_readfirstlane_recompute_check.pyok (0.1s),tests/startup_gfx2hlsl_readfirstlane_uniform_check.pyok (0.1s),tests/startup_gfx2hlsl_refusals_check.pyok (0.5s),tests/startup_gfx2hlsl_root_check.pyok (0.7s),tests/startup_gfx2hlsl_s_abs_check.pyok (0.1s),tests/startup_gfx2hlsl_s_bitset_check.pyok (0.1s),tests/startup_gfx2hlsl_s_ff0_check.pyok (0.1s),tests/startup_gfx2hlsl_s_ff1_check.pyok (0.1s),tests/startup_gfx2hlsl_s_flbit_check.pyok (0.1s),tests/startup_gfx2hlsl_s_quadmask_check.pyok (0.1s),tests/startup_gfx2hlsl_sad_check.pyok (0.3s),tests/startup_gfx2hlsl_sad_hi_msad_check.pyok (0.3s),tests/startup_gfx2hlsl_saveexec_same_reg_check.pyok (0.1s),tests/startup_gfx2hlsl_scalar_arity_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_brev_fold_check.pyok (0.1s),tests/startup_gfx2hlsl_scalar_m0_check.pyok (0.1s),tests/startup_gfx2hlsl_scalar_null_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_table_arity_check.pyok (0.3s),tests/startup_gfx2hlsl_sdwa_cndmask_check.pyok (0.2s),tests/startup_gfx2hlsl_sdwa_cvt_check.pyok (0.2s),tests/startup_gfx2hlsl_sgpr_spill_check.pyok (0.1s),tests/startup_gfx2hlsl_shift64_check.pyok (0.2s),tests/startup_gfx2hlsl_sload_const_offset_check.pyok (0.1s),tests/startup_gfx2hlsl_smem_offset_check.pyok (0.1s),tests/startup_gfx2hlsl_sop2_complement_check.pyok (4.7s),tests/startup_gfx2hlsl_sopk_accum_check.pyok (0.9s),tests/startup_gfx2hlsl_sopk_signext_check.pyok (0.1s),tests/startup_gfx2hlsl_spill_branches_check.pyok (0.8s),tests/startup_gfx2hlsl_swap_check.pyok (0.3s),tests/startup_gfx2hlsl_vopc_sdwa_check.pyok (3.6s),tests/startup_gfx2hlsl_waitcnt_depctr_check.pyok (0.1s),tests/startup_gfx2hlsl_watch_check.pyok (2.4s),tests/startup_image_2d_array_check.pyok (0.1s),tests/startup_image_3d_check.pyok (0.1s),tests/startup_image_gather_lz_check.pyok (0.5s),tests/startup_image_load_d16_check.pyok (0.8s),tests/startup_image_sample_a16_check.pyok (0.2s),tests/startup_image_sample_b_check.pyok (0.2s),tests/startup_image_sample_c_check.pyok (0.2s),tests/startup_image_sample_l_check.pyok (0.2s),tests/startup_image_sample_lod_check.pyok (0.5s),tests/startup_inline_sampler_check.pyok (0.1s),tests/startup_mesh57_depth_only_check.pyok (0.2s),tests/startup_mesh57_lane_spill_check.pyok (0.2s),tests/startup_mesh57_loop_check.pyok (0.2s),tests/startup_mesh57_loop_refusal_check.pyok (0.1s),tests/startup_mesh57_skeleton_check.pyok (0.9s),tests/startup_run_ps1_check.pyok (8.3s),tests/startup_run_sh_check.pyskipped (0.1s),tests/startup_sampler_heap_check.pyok (0.1s),tests/startup_shader_cache_rekey_check.pyok (2.1s),tests/startup_smem_address_check.pyok (0.1s),tests/startup_stream_fetch_check.pyok (0.2s),tests/startup_stream_interface_check.pyok (0.2s),tests/startup_translator_check.pyok (0.3s)sccache: 2/2 hits; wall88.5sFull-suite Win2025 run (dev + release, default pool) on the same head passed earlier: no failure other than a one-off
startup_run_ps1_checkfailure under load on the first attempt, which passed on rerun (unrelated to this change).AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:27:23Z.
@MasterDomino #2723 is ready for review and merge. Head
9ab28289: both bot threads fixed and resolved (lane-bit inputs required for the new execz mask writes, docs updated). CI green, Win2025 WARP dev + release PASS on this exact head (receipt above, includingstartup_gfx2hlsl_compute_warp).AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:11:46Z.
Code review location:
tools/startup/gfx2hlsl.py; line 2878Fix is in
94c692b4, head9ab28289(merged with main). CI on9ab28289is green: Linux Python checks, gfx1013 fixture translate, Windows build and test. Local commands:python3 -B tests/startup_gfx2hlsl_compute_check.py,startup_gfx2hlsl_mask_overwrite_check.py,startup_gfx2hlsl_mask_data_check.py,startup_gfx2hlsl_refusals_check.py,startup_compute_translate_check.py,tests/docs_links_check.py,git diff --check. Resolving; the Win2025 receipt follows on this head.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:11:50Z.
Code review location:
tools/startup/gfx2hlsl.py; line 2573Fix is in
94c692b4, head9ab28289(merged with main). CI on9ab28289is green: Linux Python checks, gfx1013 fixture translate, Windows build and test. Local commands:python3 -B tests/startup_gfx2hlsl_compute_check.py,startup_gfx2hlsl_mask_overwrite_check.py,startup_gfx2hlsl_mask_data_check.py,startup_gfx2hlsl_refusals_check.py,startup_compute_translate_check.py,tests/docs_links_check.py,git diff --check. Resolving; the Win2025 receipt follows on this head.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T06:19:48Z.
Review: CHANGES_REQUESTED
Reviewed
9ab28289.The accepted forms look exact:
s_andn2 M, M, exec_lo, ands_or M, M, Twith T exec-masked in the block, leave a skipped lane's bit unchanged.execcopy, or ans_andwith a lane mask needs M zeroed first.s_orn2 M, X, exec_loneeds M set to all ones.execwrite in the block.Two requests before merge:
maintranslated:s_mov_b32 M, 0, thens_and_b32 M, s7, exec_lowith s7 a group id, whose cached HLSL reads the wrong bit. The existing compute test that accepted it is flipped here.mainis now atx2w-startup-shader-19cs(since #2708), so please move to20cs, so that stale cache entries are re-keyed:compute_keyingfx2hlsl.py;compute_revisionind3d12_draw.inl;tests/startup_compute_request_offline_check.py.startup_gfx2hlsl_compute_check.pyand the WARP dispatch: one that letszeroandoneswrites mix, and one that acceptss_andn2_b32 M, M, Xfor any X. The existing mixed-class control uses s7, so it's refused for the lane-bit reason instead. Please add:v_cmp_gt_u32 vcc_lo, 3, v0; s_mov_b32 s20, exec_lo; s_orn2_b32 s20, vcc_lo, exec_lo, afters_mov_b32 s20, 0and again after-1;s_andn2_b32 s20, s20, vcc_lorefusal.Smaller points:
lane_bit_keystreats anys_and_b32 M, X, exec_lobefore the branch as lane bits, without the lane-mask check that the block's writes now get. The generic lowering ofs_and_b32 s20, s7, exec_lohas the same gap onmain, so that can be its own issue.phi_mask_ok(or any().s_orn2outside the lane mask above" among exec writes, but the new form writes M, notexec. They also mention onlys_mov_b32 M, 0/-1, while the code acceptss_movk_i32too.Runs: Windows 11 build 26300; AMD Radeon RX 9070 XT (driver 32.0.32029.2010); WARP 10.0.26100.9818.
ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_compute'45/45, with cases P/Q and the five new controls on WARP and hardware.ctest -R 'startup_gfx2hlsl|startup_compute_translate|startup_compute_request_offline'277/278. The only failure isstartup_gfx2hlsl_fma_mix_dispatch_hardware, as onmainon this GPU (#2746).main: the controls and the dispatch pass (320 words, 0 mismatches on WARP and hardware), and each new dispatch control is rejected.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T06:32:35Z.
Review: APPROVED
The original head accepted s_and_b32 s20, s7, exec_lo before a preserving execz block, even though the ordinary group ID is not a projected lane mask. The new control reproduces this on the old code and refuses it now. A proven VCC source still translates. Host mask/descriptor controls and the full WARP and RTX compute dispatch suites pass.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T06:34:14Z.
@R0Y00, thanks.
1f0c65d3closes thelane_bit_keysgap I noted (ans_and_b32 M, s7, exec_lobefore the block) and adds the control for it.My change request at
9ab28289is still open on two points:maintranslated with the wrong bit:s_mov_b32 M, 0, thens_and_b32 M, s7, exec_lo, with s7 a group id, inside a preserving execz block. The existing compute test that accepted it is flipped here. A shader cached under the current compute key keeps that wrong HLSL. This head still keys18cs, andmainis at19cs. Do you want the bump pastmain(20cs), or is the stale entry acceptable to you? If it's fine without, I'll dismiss my request.zeroandoneswrites allowed to mix: needs a case with a compare-derived X, for examplev_cmp_gt_u32 vcc_lo, 3, v0; s_mov_b32 s20, exec_lo; s_orn2_b32 s20, vcc_lo, exec_lo, afters_mov_b32 s20, 0and again after-1;s_andn2_b32 M, M, Xaccepted for any X: needs one refusal such ass_andn2_b32 s20, s20, vcc_lo.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T07:18:12Z.
Review: APPROVED
Approving
129fc835. Both points from my change request are addressed.Cache revision: both keys move to
x2w-startup-shader-21/21cs. Against1f0c65d3, the only other translator change is the line-continuation fix.startup_shader_cache_rekey_check.pyandstartup_shader_cache_key_check.pypass.Controls: both mutants that survived before are now caught by
startup_gfx2hlsl_compute_check.py:zeroandoneswrites mix (if stale or (...)→if stale:) fails on the new compare-derived mixed case;s_andn2_b32 M, M, Xfor any X fails on the newvcc_lorefusals.The new
s_andn2_b32 s20, s20, vcc_loword,146a148a, matches llvm-mc 15 (binarymode: "fixture words match llvm-mc").The head merges cleanly onto current
main, and CI is green at the head.Commands, on Windows 11 build 26300:
python -B tests/startup_gfx2hlsl_compute_check.py(plusbinary <llvm-mc 15>),startup_shader_cache_rekey_check.py,startup_shader_cache_key_check.py,startup_compute_request_offline_check.pyandstartup_gfx2hlsl_mask_overwrite_check.py: all exit 0.Note for #2768, which also takes
21/21cs: once this lands, it needs22/22cs.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:18:34Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
129fc835bc599507d52e650093934c3cab537070:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check startup_indirect_draw_indexed startup_resource_retire_title startup_stream_consumer -- -j 2):1.67s(configure0.00s)ctest --preset dev -R '^startup_gfx2hlsl_compute|startup_compute_request_offline' --parallel 3 --no-tests=error --output-on-failure): 48/48 passed (7.35s:startup_gfx2hlsl_compute_mbcnt_warp0.71s,startup_gfx2hlsl_compute_mbcnt_hardware0.71s,startup_gfx2hlsl_compute_controls0.69s,startup_gfx2hlsl_compute_dropped-store_warp0.29s,startup_gfx2hlsl_compute_c-unpredicated_warp0.30s,startup_gfx2hlsl_compute_warp2.99s,startup_gfx2hlsl_compute_hardware3.02s,startup_gfx2hlsl_compute_swapped-axes_warp0.30s,startup_gfx2hlsl_compute_b-offset_warp0.28s,startup_gfx2hlsl_compute_b-offset_hardware0.28s,startup_gfx2hlsl_compute_c-unpredicated_hardware0.28s,startup_gfx2hlsl_compute_dropped-store_hardware0.29s,startup_gfx2hlsl_compute_swapped-axes_hardware0.30s,startup_gfx2hlsl_compute_m-else-unswitched_hardware0.28s,startup_gfx2hlsl_compute_n-dropped-broadcast_hardware0.28s,startup_compute_request_offline0.63s,startup_gfx2hlsl_compute_m-else-unswitched_warp0.30s,startup_gfx2hlsl_compute_n-dropped-broadcast_warp0.31s,startup_gfx2hlsl_compute_f-peer_warp0.31s,startup_gfx2hlsl_compute_f-broadcast_hardware0.29s,startup_gfx2hlsl_compute_o-mask-kept_warp0.29s,startup_gfx2hlsl_compute_f-broadcast_warp0.29s,startup_gfx2hlsl_compute_h-inner-unpredicated_hardware0.30s,startup_gfx2hlsl_compute_k-block-entered_warp0.31s,startup_gfx2hlsl_compute_n-unmasked_warp0.32s,startup_gfx2hlsl_compute_f-peer_hardware0.29s,startup_gfx2hlsl_compute_k-block-entered_hardware0.30s,startup_gfx2hlsl_compute_h-inner-unpredicated_warp0.28s,startup_gfx2hlsl_compute_g-swapped-offsets_hardware0.27s,startup_gfx2hlsl_compute_n-unmasked_hardware0.29s,startup_gfx2hlsl_compute_j-scalar-dropped_hardware0.27s,startup_gfx2hlsl_compute_g-overlap_warp0.30s,startup_gfx2hlsl_compute_g-swapped-offsets_warp0.28s,startup_gfx2hlsl_compute_g-overlap_hardware0.30s,startup_gfx2hlsl_compute_j-scalar-dropped_warp0.30s,startup_gfx2hlsl_compute_o-mask-kept_hardware0.29s,startup_gfx2hlsl_compute_f-second-fill_warp0.30s,startup_gfx2hlsl_compute_p-dropped-andn2_warp0.33s,startup_gfx2hlsl_compute_p-dropped-or_warp0.32s,startup_gfx2hlsl_compute_p-block-entered_warp0.33s,startup_gfx2hlsl_compute_q-block-entered_warp0.30s,startup_gfx2hlsl_compute_q-not-all-ones_warp0.30s,startup_gfx2hlsl_compute_f-second-fill_hardware0.31s,startup_gfx2hlsl_compute_p-dropped-andn2_hardware0.32s,startup_gfx2hlsl_compute_p-dropped-or_hardware0.32s,startup_gfx2hlsl_compute_p-block-entered_hardware0.32s,startup_gfx2hlsl_compute_q-block-entered_hardware0.28s,startup_gfx2hlsl_compute_q-not-all-ones_hardware0.28s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check startup_indirect_draw_indexed startup_resource_retire_title startup_stream_consumer -- -j 2):7.36s(configure0.00s)ctest --preset release -R '^startup_gfx2hlsl_compute|startup_compute_request_offline' --parallel 3 --no-tests=error --output-on-failure): 48/48 passed (7.87s:startup_gfx2hlsl_compute_mbcnt_warp0.65s,startup_gfx2hlsl_compute_b-offset_warp0.33s,startup_gfx2hlsl_compute_c-unpredicated_warp0.32s,startup_gfx2hlsl_compute_controls0.79s,startup_gfx2hlsl_compute_dropped-store_warp0.29s,startup_gfx2hlsl_compute_dropped-store_hardware0.33s,startup_gfx2hlsl_compute_warp3.01s,startup_gfx2hlsl_compute_swapped-axes_hardware0.30s,startup_gfx2hlsl_compute_hardware3.05s,startup_gfx2hlsl_compute_swapped-axes_warp0.29s,startup_gfx2hlsl_compute_b-offset_hardware0.37s,startup_gfx2hlsl_compute_c-unpredicated_hardware0.35s,startup_gfx2hlsl_compute_m-else-unswitched_warp0.32s,startup_gfx2hlsl_compute_n-dropped-broadcast_warp0.28s,startup_compute_request_offline0.73s,startup_gfx2hlsl_compute_mbcnt_hardware0.73s,startup_gfx2hlsl_compute_m-else-unswitched_hardware0.44s,startup_gfx2hlsl_compute_n-dropped-broadcast_hardware0.48s,startup_gfx2hlsl_compute_g-swapped-offsets_hardware0.41s,startup_gfx2hlsl_compute_f-broadcast_warp0.33s,startup_gfx2hlsl_compute_f-peer_warp0.32s,startup_gfx2hlsl_compute_h-inner-unpredicated_warp0.37s,startup_gfx2hlsl_compute_j-scalar-dropped_warp0.36s,startup_gfx2hlsl_compute_k-block-entered_warp0.39s,startup_gfx2hlsl_compute_k-block-entered_hardware0.38s,startup_gfx2hlsl_compute_g-overlap_warp0.36s,startup_gfx2hlsl_compute_g-swapped-offsets_warp0.31s,startup_gfx2hlsl_compute_j-scalar-dropped_hardware0.33s,startup_gfx2hlsl_compute_f-peer_hardware0.30s,startup_gfx2hlsl_compute_h-inner-unpredicated_hardware0.30s,startup_gfx2hlsl_compute_f-broadcast_hardware0.31s,startup_gfx2hlsl_compute_g-overlap_hardware0.29s,startup_gfx2hlsl_compute_f-second-fill_warp0.30s,startup_gfx2hlsl_compute_n-unmasked_warp0.29s,startup_gfx2hlsl_compute_o-mask-kept_warp0.29s,startup_gfx2hlsl_compute_p-dropped-andn2_warp0.31s,startup_gfx2hlsl_compute_p-dropped-or_warp0.32s,startup_gfx2hlsl_compute_p-block-entered_warp0.30s,startup_gfx2hlsl_compute_q-block-entered_warp0.32s,startup_gfx2hlsl_compute_q-not-all-ones_warp0.32s,startup_gfx2hlsl_compute_f-second-fill_hardware0.29s,startup_gfx2hlsl_compute_o-mask-kept_hardware0.27s,startup_gfx2hlsl_compute_n-unmasked_hardware0.31s,startup_gfx2hlsl_compute_p-dropped-andn2_hardware0.30s,startup_gfx2hlsl_compute_p-dropped-or_hardware0.34s,startup_gfx2hlsl_compute_p-block-entered_hardware0.32s,startup_gfx2hlsl_compute_q-block-entered_hardware0.30s,startup_gfx2hlsl_compute_q-not-all-ones_hardware0.27s)tests/mesh_heap_sampler_check.pyok (0.7s),tests/startup_buffer_address_check.pyok (0.5s),tests/startup_buffer_format_word3_table_check.pyok (0.1s),tests/startup_compute_global_load_check.pyok (0.2s),tests/startup_compute_image_store_check.pyok (0.6s),tests/startup_compute_image_store_d16_check.pyok (0.5s),tests/startup_compute_request_offline_check.pyok (0.5s),tests/startup_compute_store_format_xyzw_check.pyok (0.2s),tests/startup_compute_translate_check.pyok (0.2s),tests/startup_flat_param_check.pyok (0.2s),tests/startup_gfx2hlsl_add_sub_co_check.pyok (0.1s),tests/startup_gfx2hlsl_add_sub_co_ci_check.pyok (0.2s),tests/startup_gfx2hlsl_bfm_b64_check.pyok (1.2s),tests/startup_gfx2hlsl_bit_alu_check.pyok (0.7s),tests/startup_gfx2hlsl_capture_check.pyok (1.2s),tests/startup_gfx2hlsl_cmp16_check.pyok (0.3s),tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.pyok (33.6s),tests/startup_gfx2hlsl_compare_dst_check.pyok (0.1s),tests/startup_gfx2hlsl_compute_check.pyok (0.6s),tests/startup_gfx2hlsl_const_copy_join_check.pyok (0.1s),tests/startup_gfx2hlsl_cselect_mask_check.pyok (0.1s),tests/startup_gfx2hlsl_cvt_alu_check.pyok (0.2s),tests/startup_gfx2hlsl_cvt_off_f32_i4_check.pyok (0.2s),tests/startup_gfx2hlsl_cvt_pk_int16_check.pyok (0.3s),tests/startup_gfx2hlsl_f32_lg_check.pyok (1.3s),tests/startup_gfx2hlsl_f32_nan_check.pyok (4.9s),tests/startup_gfx2hlsl_fma_mix_check.pyok (0.2s),tests/startup_gfx2hlsl_getpc_refusal_check.pyok (0.2s),tests/startup_gfx2hlsl_handler_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_heap_record_check.pyok (0.2s),tests/startup_gfx2hlsl_heap_word_check.pyok (0.2s),tests/startup_gfx2hlsl_image_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_image_get_lod_check.pyok (0.2s),tests/startup_gfx2hlsl_int_med3_check.pyok (0.1s),tests/startup_gfx2hlsl_interp_p2_hi_check.pyok (0.2s),tests/startup_gfx2hlsl_join_symbols_check.pyok (0.3s),tests/startup_gfx2hlsl_loop_constants_check.pyok (0.1s),tests/startup_gfx2hlsl_mask_data_check.pyok (0.1s),tests/startup_gfx2hlsl_mask_overwrite_check.pyok (0.1s),tests/startup_gfx2hlsl_operand_count_check.pyok (0.4s),tests/startup_gfx2hlsl_pack_absdiff_check.pyok (2.5s),tests/startup_gfx2hlsl_pack_b32_f16_check.pyok (0.2s),tests/startup_gfx2hlsl_readfirstlane_load_recompute_check.pyok (0.1s),tests/startup_gfx2hlsl_readfirstlane_recompute_check.pyok (0.1s),tests/startup_gfx2hlsl_readfirstlane_uniform_check.pyok (0.1s),tests/startup_gfx2hlsl_refusals_check.pyok (0.6s),tests/startup_gfx2hlsl_root_check.pyok (0.9s),tests/startup_gfx2hlsl_s_abs_check.pyok (0.1s),tests/startup_gfx2hlsl_s_bitset_check.pyok (0.1s),tests/startup_gfx2hlsl_s_ff0_check.pyok (0.1s),tests/startup_gfx2hlsl_s_ff1_check.pyok (0.1s),tests/startup_gfx2hlsl_s_flbit_check.pyok (0.1s),tests/startup_gfx2hlsl_s_quadmask_b64_check.pyok (0.1s),tests/startup_gfx2hlsl_s_quadmask_check.pyok (0.1s),tests/startup_gfx2hlsl_sad_check.pyok (0.4s),tests/startup_gfx2hlsl_sad_hi_msad_check.pyok (0.3s),tests/startup_gfx2hlsl_saveexec_same_reg_check.pyok (0.1s),tests/startup_gfx2hlsl_scalar_arity_check.pyok (0.3s),tests/startup_gfx2hlsl_scalar_brev_fold_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_m0_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_null_check.pyok (0.2s),tests/startup_gfx2hlsl_scalar_table_arity_check.pyok (0.4s),tests/startup_gfx2hlsl_sdwa_cndmask_check.pyok (0.2s),tests/startup_gfx2hlsl_sdwa_cvt_check.pyok (0.3s),tests/startup_gfx2hlsl_sgpr_spill_check.pyok (0.2s),tests/startup_gfx2hlsl_shift64_check.pyok (0.2s),tests/startup_gfx2hlsl_sload_const_offset_check.pyok (0.1s),tests/startup_gfx2hlsl_smem_offset_check.pyok (0.1s),tests/startup_gfx2hlsl_sop2_complement_check.pyok (5.8s),tests/startup_gfx2hlsl_sopk_accum_check.pyok (1.1s),tests/startup_gfx2hlsl_sopk_signext_check.pyok (0.1s),tests/startup_gfx2hlsl_spill_branches_check.pyok (1.1s),tests/startup_gfx2hlsl_swap_check.pyok (0.3s),tests/startup_gfx2hlsl_vopc_sdwa_check.pyok (4.5s),tests/startup_gfx2hlsl_waitcnt_depctr_check.pyok (0.1s),tests/startup_gfx2hlsl_watch_check.pyok (2.7s),tests/startup_image_2d_array_check.pyok (0.2s),tests/startup_image_3d_check.pyok (0.2s),tests/startup_image_gather_lz_check.pyok (0.6s),tests/startup_image_load_d16_check.pyok (1.0s),tests/startup_image_sample_a16_check.pyok (0.2s),tests/startup_image_sample_b_check.pyok (0.2s),tests/startup_image_sample_c_check.pyok (0.3s),tests/startup_image_sample_l_check.pyok (0.2s),tests/startup_image_sample_lod_check.pyok (0.6s),tests/startup_inline_sampler_check.pyok (0.2s),tests/startup_mesh57_depth_only_check.pyok (0.2s),tests/startup_mesh57_lane_spill_check.pyok (0.2s),tests/startup_mesh57_loop_check.pyok (0.2s),tests/startup_mesh57_loop_refusal_check.pyok (0.2s),tests/startup_mesh57_skeleton_check.pyok (1.2s),tests/startup_run_ps1_check.pyok (10.8s),tests/startup_run_sh_check.pyskipped (0.1s),tests/startup_sampler_heap_check.pyok (0.2s),tests/startup_shader_cache_rekey_check.pyok (2.8s),tests/startup_smem_address_check.pyok (0.2s),tests/startup_stream_fetch_check.pyok (0.2s),tests/startup_stream_interface_check.pyok (0.2s),tests/startup_translator_check.pyok (0.5s)sccache: 20/20 hits; wall119.5s129fc835(the PR tests, warp-named ones run on that GPU there, not on WARP)Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T07:18:35Z.
@MasterDomino both requests and the smaller points are done at head
129fc835b(merged with currentmain, on top of the lane-bit commit1f0c65d37).x2w-startup-shader-21csincompute_key(gfx2hlsl.py),compute_revision(d3d12_draw.inl) andtests/startup_compute_request_offline_check.py(known-answer key0x90041d02ef75b4e9).mainis already at20/20cs(#2006), andstartup_shader_cache_rekey_check.pyrequires the pixel and compute revisions to move together, so the pixel revision is21too, with its known-answer keys and literals in the other tests that spell it, and the note indocs/startup-runtime.md.startup_gfx2hlsl_compute_check.py:v_cmp_gt_u32 vcc_lo, 3, v0; s_mov_b32 s20, exec_lo; s_orn2_b32 s20, vcc_lo, exec_lo) afters_mov_b32 s20, 0and again after-1: refused;s_andn2_b32 s20, s20, vcc_loafter0, with no setting, and after-1: refused.I ran both of your mutants locally: allowing
zero+onesto mix, and acceptings_andn2_b32 M, M, Xfor any X. Each now fails the check withaccepted, expected a refusal naming 'definition of s20, live where the block joins'.phi_mask_okis split. The docs now says_orn2into exec (the new form writes M), and mentions_movk_i32 M, 0. Thelane_bit_keysgap stays out of this PR, as you suggested.Commands run:
python3 -B tests/startup_gfx2hlsl_compute_check.py,startup_compute_request_offline_check.py,startup_shader_cache_rekey_check.py,startup_shader_cache_key_check.py,startup_gfx2hlsl_fract_check.pyand the other tests that spell the revision -> pass129fc835b:ctest -R '^startup_gfx2hlsl_compute|startup_compute_request_offline'48/48 on both, plus the full py-check list; receipt in the comment belowAI-assisted; commands listed were executed locally.