Repository navigation
startup: accept the early exit of a kill in the slot 57 pixel stage (Part of #2413) - #2824
Conversation
…Part of R0Y00#2413) A slot 57 colour pixel stage whose only null export is the early exit LLVM SILateBranchLowering and Mesa ACO place after the program's s_endpgm was refused as a mixed null export. kill_exit_block accepts that block when it is `exp null off, off, off, off done vm` then the final s_endpgm, and every branch into it enters with EXEC zero: s_cbranch_execz, or s_cbranch_scc0 directly after s_cselect exec, exec, 0 (the demote form). All other mixed forms stay refused with the existing message. Checks: startup_mesh57_depth_only_check.py (both forms plus ten near misses) and startup_mesh57_skeleton_kill_exit_{warp,hardware}, which draw both pairs against a CPU rasteriser without the killed triangles; the pair without the kill must differ at the 115 killed pixels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tedin7
left a comment
There was a problem hiding this comment.
Review of head fafa113 (author's merge of main into 546e9b2; 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.- No overlap: #2606/#2520/#2421 cover the null-export-only stage; #2783/#2785 touch EXEC-zero blocks in other stages and do not touch this exit.
- Test guards the behavior:
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. - Mutations run (each made the check fail):
s_branchaccepted as an entry (1 FAIL);bool(entries)removed (1 FAIL). - Small gap, not a blocker: removing the "no branch lands on the
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 on fafa113 (receipt follows). Real-GPU run not available (RunPod stopped).
AI-assisted; commands listed were executed locally.
|
Win2025 WARP receipt for head fafa113 after the author's merge of main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
Note: 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. |
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 546e9b2 on 410f600 (developed on 700522e). Windows 11 build 26300.9974, RTX 3090 driver 32.0.16.1664, DXC 10.0.26100, Python venv from
requirements-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.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 unpatched 700522e and is fixed on main by tests: accept 4 ulps for v_log_f32 in the transcendental fixture #2814.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