shader: lower s_nor_b32 and s_nand_b32 on lane mask in gfx2hlsl (Part of #1723) #2030
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!2030
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2030/head"
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?
@tedin7 on GitHub · 2026-11-24 23:27 UTC · original
tedin7:x2w-r20-s-nor-nand→main· +223 −21 · 7 files · 8 commits · closed without mergingPart of #1723
What this unblocks: Run 20 census #9 (64/61 pairs).
Source: AMD RDNA 2 instruction set architecture guide, the SOP2 instructions
s_nor_b32ands_nand_b32(bitwise on the 32-bit scalar operands) and the EXEC / wave32 description (a write toexec_loin wave64 leaves the high half unchanged).gfx2hlslrefuseds_nor_b32ands_nand_b32whenever an operand or the destination was a lane mask. They now lower on a mask when every source is a lane mask: bit i of~(a op b)depends only on bit i of each source, so the lane's own bit is exact. The destination may be an SGPR (any stage) orexec_lo(only for compute with at most 32 threads per group, the one wave32 proof available; pixel, vertex, mesh and larger compute groups keep refusing it, because a write toexec_loleaves lanes 32..63 of a wave64 wave unchanged).s_xnor_b32, avcc_loor high-half destination, mixed mask and word sources, ands_pack_hh_b32_b16on a lane mask stay refused.SCC is not emitted for these forms: translate() refuses a program that can read it.
Changes:
tools/startup/gfx2hlsl.py: lane-complement lowering ofs_nor_b32/s_nand_b32on masks, with the wave32 gate for theexec_lodestination.tests/startup_gfx2hlsl_s_nor_nand_check.py(new, registered inCMakeLists.txt, with_dispatch_warp/_dispatch_hardwareD3D12 UAV readback variants): per-bit CPU reference, GPU readback, andstage_checks()for the stage gate.tests/startup_gfx2hlsl_sop2_complement_check.py: refusal checks narrowed to the forms that stay refused; the shared probe is a 32-thread compute stage.docs/experiments.md: the accepted forms and the stage rule.Verification (head
ef54c20a638f7d0ff72dc3747c6a82158273207a):python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py,..._sop2_complement_check.py,..._waitcnt_depctr_check.pyok. Without the stage gate,s_nor_nand_checkfails on the wave64 cases.startup_gfx2hlsl_sop2_complement,startup_gfx2hlsl_s_nor_nand,startup_gfx2hlsl_s_nor_nand_dispatch_warp,startup_gfx2hlsl_s_nor_nand_dispatch_hardware). Thewarp-named test ran on the GPU there, not on WARP.AI-assisted; commands listed were executed locally.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:27 UTC · original · edited 2026-11-24 23:33 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
117d2fdℹ️ 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.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:33 UTC · original
For a newly accepted mask form containing a scalar word whose bits are not all identical, the shared lowering uses bit 0 for every HLSL invocation. For example,
s_nor_b32 vcc_lo, 1, 0now emits a zerovcc, whereas the ISA result is0xfffffffe; consequently, the supportedv_cndmask_b32selects the wrong arm in lanes 1–31.s_nand_b32 vcc_lo, 1, -1has the same issue. Keep these raw-word forms refused until their operands are projected to the actual lane, and cover a nonzero lane rather than testing only supplied 0/1 bits.Useful? React with 👍 / 👎.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:33 UTC · original
For a pixel shader containing
s_nor_b32 vcc_hi, 0, 0or anexec_hidestination, removing this guard reachesreg_range(dname)[1]inscalar()withNone, raising an uncaughtTypeError; both NAND variants behave identically. The previous revision raisesUnsupported, whichtranslate_to()catches to produce a.failrecord. The new exception instead terminates the pending-cache loop and prevents later requests from being translated. Keep rejecting the unmodelled high halves separately when enabling the low-half forms.Useful? React with 👍 / 👎.
@ -3578,1 +3578,4 @@"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_sop2_complement_check.py")# s_nand_b32 and s_nor_b32 of lane masks into exec_lo or an SGPR: CPU lines and D3D12 UAV readback (#1723).add_test(NAME startup_gfx2hlsl_s_nor_nand COMMAND "${INTAKE_PYTHON}" -B"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_nor_nand_check.py")@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:33 UTC · original
The newly accepted mask operations change a public translator capability, but this commit updates neither
README.mdnordocs/experiments.md. RootAGENTS.mdrequires one of those documentation updates for public capability changes. Record the supported operand scope, the per-lane SCC limitation, the reproduction command, and the CPU-only validation scope so contributors can reproduce the result and distinguish accepted lowering from verified GPU behavior.AGENTS.md reference: AGENTS.md:L209-L210
Useful? React with 👍 / 👎.
@tedin7 on GitHub · 2026-11-25 00:50 UTC · original
Fixed in e73b1f01: nand/nor now refuse any form that mixes a lane mask with a raw scalar word (inline constant or plain SGPR); the test covers vcc_lo,1,0 and vcc_lo,1,-1. Ran: python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py (PASS). AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-25 00:50 UTC · original
Fixed in e73b1f01: exec_hi/vcc_hi operands and destinations raise Unsupported again (no TypeError); covered by the refused forms in the test. Ran: python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.py and startup_gfx2hlsl_sop2_complement_check.py (PASS). AI-assisted; commands listed were executed locally.
@ -3578,1 +3578,4 @@"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_sop2_complement_check.py")# s_nand_b32 and s_nor_b32 of lane masks into exec_lo or an SGPR: CPU lines and D3D12 UAV readback (#1723).add_test(NAME startup_gfx2hlsl_s_nor_nand COMMAND "${INTAKE_PYTHON}" -B"${CMAKE_CURRENT_SOURCE_DIR}/tests/startup_gfx2hlsl_s_nor_nand_check.py")@tedin7 on GitHub · 2026-11-25 00:50 UTC · original
Fixed in e73b1f01: docs/experiments.md now records the operand scope, the per-lane SCC limit, the refused forms, the repro command and CPU-only scope. AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-25 13:51 UTC · original
Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is.
We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here.
AI-assisted; commands listed were executed locally.
@Leyukaka on GitHub · 2026-11-25 22:45 UTC · original
The
exec_lodestination of this PR is the first refusal for 23 requests in a local start-up capture (s_nor_b32 exec_lo, <mask>, <mask>, counts only), at mainfc97ade. #2459 took the SGPR-destination forms and left avcc_loorexec_lodestination refused.You wrote that you will reopen this once the Windows queue is clear. Since #2459 merged in between, the branch now overlaps it. If you would rather not rebase, I can port the
exec_lopart onto current main, with you credited as co-author and the remaining SCC case guarded the way #2459 does. I will leave it until tomorrow, or hand it back as soon as you pick it up.AI-assisted.
@Leyukaka on GitHub · 2026-11-25 22:49 UTC · original
Changing my timeline above: I am taking the
exec_lopart over now, since there has been no activity on this PR since 13:51. I will port it onto current main with you as co-author, and hand it back if you resume.AI-assisted.
@Leyukaka on GitHub · 2026-11-25 23:46 UTC · original
I see you reopened this at 23:00 UTC, so I am handing the
exec_lopart back as promised and will not open a competing PR. If it saves you a rebase over #2459: my port of that part ontofc97adeis commit482bade0on branchsnor-exec-loin my fork. It accepts only NAND and NOR intoexec_lowith all-mask sources, leaves SCC unmodelled like the SGPR forms, and keeps XNOR,vcc_lo,exec_hiand pairs refused. Yourexec_locases and the source-bit table are in its test. Use any of it or none.AI-assisted.
@tedin7 on GitHub · 2026-11-26 00:36 UTC · original
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
392a40de0685e69fc27c2d78950d95ff9984aa35:--preset dev):cmake --build --preset dev --target offscreen_check d3d12_xs_device_obj -- -j 2):86.67s(configure0.00s)ctest --preset dev -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)' --parallel 4 --no-tests=error --output-on-failure): 4/4 passed (11.26s:startup_gfx2hlsl_s_nor_nand0.28s,startup_gfx2hlsl_s_nor_nand_dispatch_hardware0.68s,startup_gfx2hlsl_s_nor_nand_dispatch_warp0.72s,startup_gfx2hlsl_sop2_complement11.06s)/O2(--preset release):cmake --build --preset release --target offscreen_check d3d12_xs_device_obj -- -j 2):69.16s(configure0.00s)ctest --preset release -R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)' --parallel 4 --no-tests=error --output-on-failure): 4/4 passed (5.74s:startup_gfx2hlsl_s_nor_nand0.20s,startup_gfx2hlsl_s_nor_nand_dispatch_warp0.54s,startup_gfx2hlsl_s_nor_nand_dispatch_hardware0.53s,startup_gfx2hlsl_sop2_complement5.62s)tests/mesh_heap_sampler_check.pyok (0.9s),tests/startup_buffer_address_check.pyok (0.6s),tests/startup_buffer_format_word3_table_check.pyok (0.1s),tests/startup_compute_request_offline_check.pyok (0.7s),tests/startup_compute_store_format_xyzw_check.pyok (0.3s),tests/startup_compute_translate_check.pyok (0.3s),tests/startup_flat_param_check.pyok (0.2s),tests/startup_gfx2hlsl_add_sub_co_check.pyok (0.2s),tests/startup_gfx2hlsl_add_sub_co_ci_check.pyok (0.2s),tests/startup_gfx2hlsl_bit_alu_check.pyok (1.0s),tests/startup_gfx2hlsl_capture_check.pyok (1.4s),tests/startup_gfx2hlsl_cmp16_check.pyok (0.4s),tests/startup_gfx2hlsl_compare_dst_check.pyok (0.1s),tests/startup_gfx2hlsl_compute_check.pyok (0.6s),tests/startup_gfx2hlsl_cselect_mask_check.pyok (0.1s),tests/startup_gfx2hlsl_cvt_alu_check.pyok (0.3s),tests/startup_gfx2hlsl_cvt_off_f32_i4_check.pyok (0.3s),tests/startup_gfx2hlsl_cvt_pk_int16_check.pyok (0.4s),tests/startup_gfx2hlsl_f32_lg_check.pyok (1.9s),tests/startup_gfx2hlsl_f32_nan_check.pyok (8.2s),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_image_arity_check.pyok (0.1s),tests/startup_gfx2hlsl_image_get_lod_check.pyok (0.2s),tests/startup_gfx2hlsl_int_med3_check.pyok (0.2s),tests/startup_gfx2hlsl_interp_p2_hi_check.pyok (0.3s),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.5s),tests/startup_gfx2hlsl_pack_absdiff_check.pyok (4.3s),tests/startup_gfx2hlsl_pack_b32_f16_check.pyok (0.2s),tests/startup_gfx2hlsl_readfirstlane_recompute_check.pyok (0.2s),tests/startup_gfx2hlsl_readfirstlane_uniform_check.pyok (0.2s),tests/startup_gfx2hlsl_refusals_check.pyok (0.9s),tests/startup_gfx2hlsl_root_check.pyok (1.2s),tests/startup_gfx2hlsl_s_nor_nand_check.pyok (0.2s),tests/startup_gfx2hlsl_sad_check.pyok (0.5s),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_table_arity_check.pyok (0.4s),tests/startup_gfx2hlsl_sdwa_cvt_check.pyok (0.4s),tests/startup_gfx2hlsl_sgpr_spill_check.pyok (0.2s),tests/startup_gfx2hlsl_shift64_check.pyok (0.3s),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 (9.3s),tests/startup_gfx2hlsl_sopk_accum_check.pyok (1.5s),tests/startup_gfx2hlsl_sopk_signext_check.pyok (0.3s),tests/startup_gfx2hlsl_swap_check.pyok (0.6s),tests/startup_gfx2hlsl_vopc_sdwa_check.pyok (7.3s),tests/startup_gfx2hlsl_waitcnt_depctr_check.pyok (0.2s),tests/startup_gfx2hlsl_watch_check.pyok (3.1s),tests/startup_image_2d_array_check.pyok (0.3s),tests/startup_image_3d_check.pyok (0.3s),tests/startup_image_gather_lz_check.pyok (0.9s),tests/startup_image_load_d16_check.pyok (1.7s),tests/startup_image_sample_a16_check.pyok (0.4s),tests/startup_image_sample_b_check.pyok (0.3s),tests/startup_image_sample_c_check.pyok (0.3s),tests/startup_image_sample_l_check.pyok (0.3s),tests/startup_image_sample_lod_check.pyok (0.9s),tests/startup_inline_sampler_check.pyok (0.2s),tests/startup_mesh57_loop_refusal_check.pyok (0.3s),tests/startup_mesh57_skeleton_check.pyok (0.7s),tests/startup_run_ps1_check.pyok (19.0s),tests/startup_run_sh_check.pyskipped (0.1s),tests/startup_sampler_heap_check.pyok (0.2s),tests/startup_shader_cache_rekey_check.pyok (3.5s),tests/startup_smem_address_check.pyok (0.2s),tests/startup_stream_fetch_check.pyok (0.3s),tests/startup_stream_interface_check.pyok (0.3s),tests/startup_translator_check.pyok (0.7s)sccache: 10/119 hits; wall252.5sAI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-26 00:36 UTC · original
@MasterDomino ready for review/merge: head
392a40de, CI green, Win2025 WARP dev+release receipt on this exact head posted above.@Leyukaka thank you for the
exec_loport. #2459 took the SGPR-destination forms, so I merged main (merge commit, no force-push), kept main's lowering and brought over only yourexec_lodestination from482bade0, with you as co-author. SCC is not modelled, as in the SGPR forms, andvcc_lo,exec_hi, pairs and XNOR intoexec_lostay refused. I replaced the old per-lane test withstartup_gfx2hlsl_s_nor_nandplus_dispatch_warpand_dispatch_hardware: a D3D12 UAV readback of NOR and NAND intoexec_loand an SGPR over every pair of source bits, against an integer reference. Yourexec_locases instartup_gfx2hlsl_sop2_complementstay.Verification (Win2025, head
392a40de):ctest --preset devand--preset releasewith-R '^startup_gfx2hlsl_(s_nor_nand|sop2_complement)': 4/4 passed each. Linux:python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.pyandtests/startup_gfx2hlsl_sop2_complement_check.pypass.AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-26 03:30 UTC · original
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
9d9dbe9147256a3d1223e7cfb61803c985c31c9a:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):6.52s(configure2.53s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):1.80s(configure3.94s)tests/mesh_heap_sampler_check.pyok (1.1s),tests/startup_buffer_address_check.pyok (0.8s),tests/startup_buffer_format_word3_table_check.pyok (0.1s),tests/startup_compute_request_offline_check.pyok (0.9s),tests/startup_compute_store_format_xyzw_check.pyok (0.5s),tests/startup_compute_translate_check.pyok (0.4s),tests/startup_flat_param_check.pyok (0.3s),tests/startup_gfx2hlsl_add_sub_co_check.pyok (0.2s),tests/startup_gfx2hlsl_add_sub_co_ci_check.pyok (0.3s),tests/startup_gfx2hlsl_bit_alu_check.pyok (1.3s),tests/startup_gfx2hlsl_capture_check.pyok (1.9s),tests/startup_gfx2hlsl_cmp16_check.pyok (0.5s),tests/startup_gfx2hlsl_cmp_class_f16_sdwa_check.pyok (48.4s),tests/startup_gfx2hlsl_compare_dst_check.pyok (0.1s),tests/startup_gfx2hlsl_compute_check.pyok (0.5s),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.3s),tests/startup_gfx2hlsl_cvt_pk_int16_check.pyok (0.3s),tests/startup_gfx2hlsl_f32_lg_check.pyok (1.6s),tests/startup_gfx2hlsl_f32_nan_check.pyok (6.4s),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.2s),tests/startup_gfx2hlsl_heap_record_check.pyok (0.3s),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.3s),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 (3.0s),tests/startup_gfx2hlsl_pack_b32_f16_check.pyok (0.2s),tests/startup_gfx2hlsl_readfirstlane_recompute_check.pyok (0.1s),tests/startup_gfx2hlsl_readfirstlane_uniform_check.pyok (0.2s),tests/startup_gfx2hlsl_refusals_check.pyok (0.8s),tests/startup_gfx2hlsl_root_check.pyok (1.0s),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_nor_nand_check.pyok (0.2s),tests/startup_gfx2hlsl_s_quadmask_check.pyok (0.1s),tests/startup_gfx2hlsl_sad_check.pyok (0.4s),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.5s),tests/startup_gfx2hlsl_sdwa_cndmask_check.pyok (0.3s),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 (7.1s),tests/startup_gfx2hlsl_sopk_accum_check.pyok (1.2s),tests/startup_gfx2hlsl_sopk_signext_check.pyok (0.2s),tests/startup_gfx2hlsl_spill_branches_check.pyok (1.2s),tests/startup_gfx2hlsl_swap_check.pyok (0.4s),tests/startup_gfx2hlsl_vopc_sdwa_check.pyok (6.1s),tests/startup_gfx2hlsl_waitcnt_depctr_check.pyok (0.1s),tests/startup_gfx2hlsl_watch_check.pyok (2.9s),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.8s),tests/startup_image_load_d16_check.pyok (1.4s),tests/startup_image_sample_a16_check.pyok (0.3s),tests/startup_image_sample_b_check.pyok (0.3s),tests/startup_image_sample_c_check.pyok (0.3s),tests/startup_image_sample_l_check.pyok (0.3s),tests/startup_image_sample_lod_check.pyok (0.9s),tests/startup_inline_sampler_check.pyok (0.2s),tests/startup_mesh57_depth_only_check.pyok (0.3s),tests/startup_mesh57_lane_spill_check.pyok (0.3s),tests/startup_mesh57_loop_check.pyok (0.3s),tests/startup_mesh57_loop_refusal_check.pyok (0.2s),tests/startup_mesh57_skeleton_check.pyok (1.9s),tests/startup_run_ps1_check.pyok (16.6s),tests/startup_run_sh_check.pyskipped (0.1s),tests/startup_sampler_heap_check.pyok (0.2s),tests/startup_shader_cache_rekey_check.pyok (3.2s),tests/startup_smem_address_check.pyok (0.2s),tests/startup_stream_fetch_check.pyok (0.3s),tests/startup_stream_interface_check.pyok (0.3s),tests/startup_translator_check.pyok (0.6s)sccache: 1314/1415 hits; wall151.1s@tedin7 on GitHub · 2026-11-26 03:30 UTC · original
@MasterDomino: #2030 is ready for review/merge.
What changed: merged current main into the branch (one conflict in
tools/startup/gfx2hlsl.py, kept both the address-carry handling from main and the lane-mask complement SCC refusal from this PR). New head9d9dbe91.Verification:
python3 tests/startup_gfx2hlsl_s_nor_nand_check.pyokpython3 tests/startup_gfx2hlsl_sop2_complement_check.pyPASS9d9dbe91: Linux checks, gfx1013 fixtures and Windows build all pass9d9dbe9147256a3d1223e7cfb61803c985c31c9a(receipt in the comment above)AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-26 07:58 UTC · original
@MasterDomino @R0Y00 thanks, both points are addressed at
ef54c20a638f7d0ff72dc3747c6a82158273207a.exec_lodestination in a wave64 stage.s_nor_b32/s_nand_b32intoexec_lois now accepted only for compute with at most 32 threads per group, the same proof the b32 waterfall close uses (gfx2hlsl.py, next tomask_source). The slot 57 mesh stage, vertex stages and compute groups above 32 threads refuse it with... on a lane mask. I did not include pixel: the translator has no wave size proof there (require_spill_lanes_apartsays "the wave size is unknown" forps/vs), so I kept it refused rather than assume wave32. If you want pixel accepted, tell me what proves it and I will add that proof.startup_gfx2hlsl_s_nor_nand_check.pygainsstage_checks(): both opcodes intoexec_lofor ps, vs, ms, cs of 64 and 8x8 threads (refused) and cs of 32 and 8x4 threads (accepted), plus thes3destination staying accepted in a mesh stage. Without the gate this check fails (the wave64 cases are accepted); with it, it passes. The sharedProbeinstartup_gfx2hlsl_sop2_complement_check.pyis now a 32-thread compute stage, so the existing accepted-form cases keep their meaning.main. Mergedorigin/main, keptmain'smark_heap_indexcall and thesalu_align4write, dropped the movedlane_complementblock.vcc_loand SCC reads are refused, and the stage rule above.docs/experiments.mdstates the wave32 requirement.s_and_b32/s_or_b32/s_mov_b32intoexec_lo. Left for a separate issue, as you suggested.Linux, from the worktree at this head:
python3 -B tests/startup_gfx2hlsl_s_nor_nand_check.pyok;python3 -B tests/startup_gfx2hlsl_sop2_complement_check.pyok;python3 -B tests/startup_gfx2hlsl_waitcnt_depctr_check.pyok; everytests/startup_gfx2hlsl_*_check.pypasses except the two draw checks that need DXC arguments (export_null_draw,mul24_align_draw).The Win2025 receipt (named tests) follows in an edit to this comment.
AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-26 07:59 UTC · original
Win2025 receipt at
ef54c20a638f7d0ff72dc3747c6a82158273207a(Windows Server 2025 build 26100, MSVC 14.44.35207, D3D12 WARP), tests run by name:ctest --preset dev -R '^(startup_gfx2hlsl_s_nor_nand|startup_gfx2hlsl_sop2_complement)' --no-tests=error: 4/4 passed:startup_gfx2hlsl_s_nor_nand,startup_gfx2hlsl_s_nor_nand_dispatch_warp,startup_gfx2hlsl_s_nor_nand_dispatch_hardware,startup_gfx2hlsl_sop2_complement.ctest --preset releasewith the same regex: 4/4 passed, same four tests.@MasterDomino @R0Y00 ready for another look.
AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-26 08:59 UTC · original
@R0Y00 the change request of 2026-11-26 05:50Z (on
9d9dbe91:s_nor_b32/s_nand_b32intoexec_loaccepted in the mesh stage, which is wave64) has been addressed at headef54c20a:exec_loas the destination is now accepted only for compute with at most 32 threads per group, the one wave32 proof available. Pixel, vertex, mesh (slot 57) and larger compute groups refuse it, so lanes 32..63 of a wave64 wave are never changed (9b326a3f,f8022065,ef54c20a).startup_gfx2hlsl_s_nor_nandfails on the wave64 cases; the SCC-read refusals are unchanged.ef54c20a: dev 4/4 and release 4/4 passed, tests run by name (receipt in this thread).Please re-review this head, or dismiss the old change request if you agree it is resolved.
AI-assisted; commands listed were executed locally.
@MasterDomino on GitHub · 2026-11-26 10:09 UTC · original
@tedin7,
ef54c20anow conflicts withmain(700522ef) intools/startup/gfx2hlsl.py, after #2736 and the other recent translator merges. Could you mergemainagain? I'll re-check the new head (thes_nor_nand/sop2_complementchecks and the wave32-gate mutant). This PR needs no cache bump, so no revision line should move.The merge also still needs @R0Y00 to re-review or dismiss his change request at
9d9dbe91.AI-assisted.
@tedin7 on GitHub · 2026-11-26 10:12 UTC · original
Withdrawn: shader translation is moving to the native C++ frontend (see #870), so we are not continuing this change to the Python translator. The branch stays available if any part is useful later. Thank you to everyone who reviewed and tested it.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:33 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
117d2fd03bℹ️ 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".
@R0Y00 on GitHub · 2026-11-26 05:50 UTC · original · requested changes
The four-bit-pair fixtures passed on WARP and RTX, but the new EXEC_LO form is accepted by the mesh-stage lowering too. The slot 57 profile is known wave64. A probe with kind=ms and two marked mask sources emits exec = (~(s1 | s2)) & 1 for s_nor_b32 exec_lo, s1, s2 and likewise for NAND, so upper lanes are changed even though the instruction only writes EXEC_LO. Please require a proven wave32 mask for the new EXEC_LO forms, or explicitly preserve lanes 32–63 in wave64. Add a case with an active upper lane and an inactive low lane result so the current lowering fails. The existing SCC-read refusals should remain.
@MasterDomino on GitHub · 2026-11-26 06:19 UTC · original · requested changes
Reviewed
9d9dbe91. I agree with @R0Y00's open change request.The
exec_lodestination is accepted for every stage kind. A unit probe withkind='ms'(slot 57 mesh is wave64) and two marked mask sources emitsexec = (~(s1 | s2)) & 1;fors_nor_b32 exec_lo, s1, s2, and NAND does the same. That write also changes lanes 32–63 of a wave64 wave.exec_lodestination only for a proven wave32 stage: pixel, or compute with at most 32 threads per group, as the b32 waterfall close already requires (gfx2hlsl.py:~2606).s_and_b32/s_or_b32/s_mov_b32writes intoexec_loshow the same behaviour in that probe. That can be a separate issue.The branch also conflicts with
mainsince #2580, intools/startup/gfx2hlsl.py, wheremain'smark_heap_indexcall followsset_s. Keeping that call and dropping the movedlane_complementblock should resolve it. Please also refresh the PR description: it still says avcc_lodestination is accepted and that SCC uses the per-lane projection, and the code now refuses both.Otherwise the lane semantics look right:
execwrite, so a reactivated lane computes the hardware bit.No cache revision bump is needed: 60 of 72 probe programs translate identically on
mainand on this head, and the 12 that differ were refused onmain.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_(s_nor_nand|sop2_complement)'4/4, including dispatch on WARP and hardware.ctest -R startup_gfx2hlsl252/253. The failure,startup_gfx2hlsl_fma_mix_dispatch_hardware, also fails onmainon this GPU (#2746).startup_gfx2hlsl_sop2_complement: XNOR intoexec_lo, avcc_lodestination intoexec_lo, mixed sources intoexec_lo, SCC emitted, andscc_effectdropped. The news_nor_nandcheck itself catches none of them; it covers only accepted forms and the readback.AI-assisted; commands listed were executed locally.
@MasterDomino on GitHub · 2026-11-26 08:03 UTC · original · approved these changes
Approving
ef54c20a. My change request at9d9dbe91is addressed.exec_lodestination. NOR/NAND intoexec_lois now accepted only for compute groups of at most 32 threads (wave32_stage), where lanes 32..63 hold no thread. Pixel, vertex, mesh and larger compute groups refuse it.wave32_stage = True or ...),startup_gfx2hlsl_s_nor_nand_check.pyfails on the newstage_checks(): the ps, cs (64, 1, 1) and cs (8, 8, 1) cases are no longer refused.main, and CI is green at the head.No cache revision bump is needed:
mainrefuses theseexec_loforms, and this head only adds translations for compute groups of at most 32 threads.Commands, on Windows 11 build 26300, at
ef54c20a:python -B tests/startup_gfx2hlsl_{s_nor_nand,sop2_complement,compute,mask_overwrite}_check.py, all exit 0.@R0Y00, the head now enforces the wave32 requirement from your change request. If you agree, please clear it and I'll merge (or merge it yourself).
AI-assisted; commands listed were executed locally.
Pull request closed