startup: accept dead scalar ALU in any slot 57 EXEC-zero block (Part of #2413) #2777
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2785"
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 JB2WIN on 2026-11-26T08:53:41Z.
Change
Part of #2413 (claim, item 2). #2783 is merged. This branch is rebased on main and holds one commit,
4df73191.#2643 accepts scalar ALU with results nothing reads afterwards, but only in the block that
s_cbranch_execzskips into the count exchange. Every other execz block refuses any scalar instruction withslot 57 mesh: s_cbranch_execz skips code with effects outside active lanes.The model skips per lane and the guest skips per wave. A scalar result that no path reads past the join is invisible in both:
This PR applies the rule to every execz block. It uses
dead_block_scalarinmesh_skeleton:mesh_wave_block_scalar(#2783) accepts. It may use SGPR, SCC and VCC operands only; EXEC, M0,src_*, MODE, memory, branches and messages are refused.live_at_join. That includes the SCC that everys_op may write.docs/experiments/startup-mesh57-dead-block-scalar.mdhas the details.Verification
Windows 11 build 26200, NVIDIA GeForce RTX 3080 (driver 621.24), DXC from Windows SDK 10.0.26100, Python 3.13. The checks below ran at
fd9be694on main4bbe52ee. After #2783 merged, the branch was rebased to4df73191on maind1b2be6a, and the skeleton check was re-run there: ok. Only Python changed, so theoffscreen_checkused is from a release build at96a7b4fb.python -B tests/startup_mesh57_skeleton_check.py: ok.s_add_u32 s50, s13, 1in the then arm. Also two former #2643 refusal controls with dead scalars:dead scalar ALU in a different EXEC-zero blockandan EXEC-zero branch that skips a dead scalar write.v_mov_b32 v8, s50after the EXEC restore, which leaves the scalar live at the join.dead_block_scalarterm removed by hand: all three accepted cases fail. Example:lane-masked if/else with a dead scalar write translates: got 'unsupported: slot 57 mesh: s_cbranch_execz skips code with effects outside active lanes'.... draw <dxc> <offscreen_check> warpandhardware: ok on WARP and the RTX 3080. The new if/else case is drawn against the CPU model, and the #2783 wave block cases still pass.startup_mesh57_depth_only_check.py,startup_mesh57_loop_check.py,startup_mesh57_loop_refusal_check.py,startup_mesh57_lane_spill_check.py,binary <llvm-mc>,docs_links_check.py,bidi_controls_check.py,git diff --check.windows.yml(tools/run_checks_parallel.py): 203 ok, 2 skipped.tests/dxc_cache_check.pyfails withWinError 193, the same on unmodified main on this Windows host.dead_block_scalarwith SCC live and fails nowhere earlier.scc_stalerefuses SCC reads first.sccterm stays as a guard. It is not proven by a dedicated test.Evidence and follow-up
The fixture is source-built: hand-assembled words in the existing
masked_vertex_redif/else. A local capture (counts only) used main96a7b4fbplus #2783:s_add_u32in the post-count primitive-export block that is dead past the jump tos_endpgm.v_readfirstlane_b32 outside the group-index read is not covered. That is a first-lane read of a formatted buffer load before the count exchange. I have not claimed it.Checklist
AI-assisted (Claude Code). The commands above were run locally.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T09:03:24Z.
Review: COMMENTED
Review of head
4df73191(author's rebase on top of #2783, no extra push from us).Checked:
dead_block_scalaronly accepts scalar ALU thatmesh_wave_block_scalaralready accepts, and only if no register it writes (including SCC) is live at the join. Samelive_at_joinas the count-entry rule.dead_block_scalarclause makes 3 newtranslateschecks fail.startup-mesh57-dead-block-scalar.md) are consistent. No other open or merged PR covers this slice.Commands run locally:
git diff --check origin/main...HEAD,tests/docs_links_check.py,tests/bidi_controls_check.py: cleantests/startup_mesh57_skeleton_check.py: ok; with the clause removed: 3 FAILWin2025 (build 26100, WARP) at
4df73191,--regex mesh57:startup_mesh57_skeleton_exchange_hardware, no hardware on the VM)PYCHECK tests/startup_mesh57_skeleton_check.py rc=0AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T09:03:29Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
4df73191e5c89187983a01547182a1ae0240044e:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):1.85s(configure0.00s)ctest --preset dev -R 'mesh57' --parallel 2 --no-tests=error --output-on-failure): 18/19 passed (9.26s:startup_mesh57_skeleton_draw_warp3.12s,startup_mesh57_skeleton_draw_hardware3.16s,startup_mesh57_skeleton1.43s,startup_mesh57_skeleton_depth_warp0.52s,startup_mesh57_skeleton_exchange_warp2.40s,startup_mesh57_skeleton_depth_hardware0.54s,startup_mesh57_skeleton_wave_shift_warp0.49s,startup_mesh57_skeleton_wave_shift_hardware0.49s,startup_mesh57_depth_only0.23s,startup_mesh57_loop_refusal0.18s,startup_mesh57_loop0.25s,startup_mesh57_lane_spill0.34s,startup_mesh57_loop_hardware0.76s,startup_mesh57_lane_spill_hardware0.64s,startup_mesh57_skeleton_exchange_hardware0.33s,startup_mesh57_formatted_load_hardware0.78s,startup_mesh57_loop_warp0.80s,startup_mesh57_lane_spill_warp0.69s,startup_mesh57_formatted_load_warp0.64s); skipped (capability, not a pass):startup_mesh57_skeleton_exchange_hardware/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):9.27s(configure0.00s)ctest --preset release -R 'mesh57' --parallel 2 --no-tests=error --output-on-failure): 18/19 passed (8.39s:startup_mesh57_skeleton_draw_warp2.98s,startup_mesh57_skeleton_draw_hardware2.98s,startup_mesh57_skeleton1.47s,startup_mesh57_skeleton_depth_warp0.51s,startup_mesh57_skeleton_exchange_warp2.35s,startup_mesh57_skeleton_wave_shift_warp0.49s,startup_mesh57_skeleton_depth_hardware0.52s,startup_mesh57_skeleton_wave_shift_hardware0.47s,startup_mesh57_depth_only0.25s,startup_mesh57_loop_refusal0.20s,startup_mesh57_loop0.23s,startup_mesh57_lane_spill0.28s,startup_mesh57_loop_hardware0.52s,startup_mesh57_lane_spill_hardware0.46s,startup_mesh57_skeleton_exchange_hardware0.27s,startup_mesh57_formatted_load_hardware0.58s,startup_mesh57_loop_warp0.51s,startup_mesh57_lane_spill_warp0.48s,startup_mesh57_formatted_load_warp0.55s); skipped (capability, not a pass):startup_mesh57_skeleton_exchange_hardwaretests/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_request_offline_check.pyok (0.6s),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.1s),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 (29.5s),tests/startup_gfx2hlsl_compare_dst_check.pyok (0.1s),tests/startup_gfx2hlsl_compute_check.pyok (0.7s),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.1s),tests/startup_gfx2hlsl_f32_nan_check.pyok (4.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.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.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.2s),tests/startup_gfx2hlsl_pack_b32_f16_check.pyok (0.1s),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.8s),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.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.2s),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.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.1s),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.0s),tests/startup_gfx2hlsl_swap_check.pyok (0.3s),tests/startup_gfx2hlsl_vopc_sdwa_check.pyok (5.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.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.2s),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.3s),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.9s),tests/startup_run_sh_check.pyskipped (0.1s),tests/startup_sampler_heap_check.pyok (0.2s),tests/startup_shader_cache_rekey_check.pyok (2.7s),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.4s)sccache: 12/16 hits; wall115.4sAI-assisted; commands listed were executed locally.