startup: accept the early exit of a kill in the slot 57 pixel stage (Part of #2413) #2816
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2824"
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 mumba17 on 2026-11-26T11:57:18Z.
Change
Part of #2413.
A slot 57 colour pixel stage whose only null export is the early exit of a kill was refused with
slot 57 pixel stage mixes the null export with another export. LLVMSILateBranchLoweringand Mesa ACO place that exit after the program'ss_endpgm:kill_exit_blockintools/startup/gfx2hlsl.pyaccepts the block when it holds the program's one null export, is the last two instructions, follows ans_endpgm, and every branch into it enters with EXEC zero:s_cbranch_execz, ors_cbranch_scc0directly afters_cselect_b32 exec_lo, exec_lo, 0/s_cselect_b64 exec, exec, 0, with no branch landing on thes_cbranch_scc0.s_cselectleaves SCC, so when the branch is taken, the instruction before it has just set EXEC to 0.All other mixed forms keep the existing refusal. The general pixel lowering is unchanged: the null export writes nothing and keeps its
vmdiscard.Verification
Head
546e9b22on410f6004(developed on700522ef). Windows 11 build 26300.9974, RTX 3090 driver 32.0.16.1664, DXC 10.0.26100, Python venv fromrequirements-dev.txt.python -B tests/startup_mesh57_depth_only_check.py: ok. Both forms translate withSV_Target0and the discard. Ten near misses stay refused: fall-through into the null export, a block no branch reaches, entry bys_branch, an exit export withoutvm, another instruction in the block; for the demote form, nos_cselect, ans_cselectthat keeps EXEC, one into another register, an instruction between select and branch, ands_cbranch_scc1.700522effails the acceptance cases with the mixed-export message.startup_mesh57_skeleton_check.py killexit <dxc> offscreen_check {warp,hardware}: both pairs match the CPU rasteriser with the two killed triangles dropped (pixels=1024 mismatches=0) on WARP and RTX 3090. The same mesh with the pixel stage that does not kill differs at exactly the 115 killed pixels. Without the fix the check fails at translation.python -B tests/startup_mesh57_skeleton_check.py,docs_links_check.py,bidi_controls_check.py: ok.ctest --test-dir out/build/release --no-tests=error -j 1 -R "mesh57|mesh_cbv_order|startup_gfx2hlsl" --output-on-failureon the pre-rebase base: 323/324. The one failure,startup_gfx2hlsl_float_transcendental_hardware(v_log_f32one ULP off on RTX 3090), failed identically on unpatched700522efand is fixed on main by #2814.410f6004:ctest ... -j 1 -R "mesh57|mesh_cbv_order|float_transcendental": 26/26, includingstartup_mesh57_skeleton_kill_exit_{warp,hardware}.windows.ymlthroughtools/run_checks_parallel.py -j 10: 223 ok, 2 capability skips (startup_run_sh_check,startup_build_rev_check). 11 scripts need arguments that the workflow passes and my listing did not (for examplemesh_entry_check.py), so they were not run that way.Local evidence (counts only)
In a local capture, 97 slot 57 requests (95 distinct pixel programs, colour stages with 2 to 6 targets) stopped at this check: 89 enter the exit by
s_cbranch_execzonly, 6 also by the demotes_cbranch_scc0. With the change, all 97 move to mesh-stage refusals tracked in #2413 (execz blocks 71, group-index exchange 15, loops 11), so this PR adds no complete translation by itself. No capture data is included.Not covered
Checklist
docs/experiments.md, slot 57 depth-only section).This change was AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T12:05:56Z.
Review: COMMENTED
Review of head
fafa1134(author's merge of main into546e9b22; the PR's own diff is unchanged).Checked:
kill_exit_blockintools/startup/gfx2hlsl.py: accepts only one null export that is the last two instructions, follows ans_endpgm, isdone vm, and is entered only bys_cbranch_execzor the demotes_cselect ... exec, 0+s_cbranch_scc0form. Other mixed forms keep the refusal. Logic is correct.startup_mesh57_skeleton_check.py killexitis a real D3D12 draw compared with the CPU rasteriser with the killed triangles dropped (pixels=1024 mismatches=0), and the same mesh without the kill differs at exactly the killed pixels, so discarded pixels are covered. WARP and hardware tests are registered in CMake next to the sibling depth tests.s_branchaccepted as an entry (1 FAIL);bool(entries)removed (1 FAIL).s_cbranch_scc0" condition (not in targets) is NOT caught by any test. A near miss with a branch into thes_cbranch_scc0would close it.Commands run:
python3 -B tests/startup_mesh57_depth_only_check.py,python3 -B tests/startup_mesh57_skeleton_check.py,python3 tests/docs_links_check.py,python3 tests/bidi_controls_check.py,git diff --check origin/main...HEAD(all ok); Win2025 dev+release onfafa1134(receipt follows). Real-GPU run not available (RunPod stopped).AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T12:05:57Z.
Win2025 WARP receipt for head
fafa1134after the author's merge of main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
fafa113494fcb490581532969b821bb7deb7d2aa:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2):1.26s(configure1.88s)ctest --preset dev -R 'mesh57|mesh_cbv_order' --parallel 6 --no-tests=error --output-on-failure): 22/23 passed (4.09s:mesh_cbv_order_warp1.14s,mesh_cbv_order_hardware1.13s,startup_mesh57_loop_warp0.58s,startup_mesh57_skeleton_depth_hardware0.60s,startup_mesh57_skeleton1.74s,startup_mesh57_loop_hardware0.56s,startup_mesh57_formatted_load_hardware0.62s,startup_mesh57_formatted_load_warp0.62s,startup_mesh57_skeleton_exchange_warp2.73s,startup_mesh57_lane_spill_hardware0.51s,startup_mesh57_skeleton_depth_warp0.59s,startup_mesh57_lane_spill_warp0.53s,startup_mesh57_depth_only0.33s,startup_mesh57_lane_spill0.30s,startup_mesh57_skeleton_wave_shift_hardware0.54s,startup_mesh57_skeleton_draw_warp3.38s,startup_mesh57_skeleton_wave_shift_warp0.54s,startup_mesh57_skeleton_draw_hardware3.43s,startup_mesh57_loop0.25s,startup_mesh57_loop_refusal0.23s,startup_mesh57_skeleton_exchange_hardware0.27s,startup_mesh57_skeleton_kill_exit_hardware0.56s,startup_mesh57_skeleton_kill_exit_warp0.52s); 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):4.10s(configure1.85s)ctest --preset release -R 'mesh57|mesh_cbv_order' --parallel 6 --no-tests=error --output-on-failure): 22/23 passed (3.93s:startup_mesh57_formatted_load_hardware0.60s,mesh_cbv_order_warp1.02s,startup_mesh57_skeleton_depth_hardware0.53s,startup_mesh57_skeleton_depth_warp0.59s,startup_mesh57_skeleton1.67s,startup_mesh57_loop_hardware0.57s,startup_mesh57_formatted_load_warp0.62s,startup_mesh57_loop_warp0.55s,startup_mesh57_lane_spill_warp0.52s,startup_mesh57_skeleton_exchange_warp2.47s,startup_mesh57_lane_spill_hardware0.49s,startup_mesh57_skeleton_wave_shift_hardware0.50s,startup_mesh57_skeleton_wave_shift_warp0.52s,startup_mesh57_lane_spill0.31s,startup_mesh57_loop_refusal0.20s,startup_mesh57_loop0.24s,startup_mesh57_depth_only0.33s,startup_mesh57_skeleton_draw_warp3.19s,startup_mesh57_skeleton_draw_hardware3.20s,startup_mesh57_skeleton_exchange_hardware0.28s,startup_mesh57_skeleton_kill_exit_hardware0.60s,startup_mesh57_skeleton_kill_exit_warp0.53s,mesh_cbv_order_hardware0.81s); skipped (capability, not a pass):startup_mesh57_skeleton_exchange_hardwaretests/startup_mesh57_depth_only_check.pyok (0.2s),tests/startup_mesh57_skeleton_check.pyok (1.0s)sccache: 4/6 hits; wall19.5sNote: the single non-pass in each run is startup_mesh57_skeleton_exchange_hardware, Skipped (exit 77, the VM has no hardware adapter). New tests startup_mesh57_skeleton_kill_exit_warp and _hardware passed in dev and release. Real-GPU run not available (RunPod stopped).
AI-assisted; commands listed were executed locally.