Repository navigation
startup: translate slot 57 mesh requests with a depth-only pixel stage - #2606
Conversation
The null target carries no channel; its only effect is the vm discard emitted before it. Same change as the open R0Y00#2026, so a rebase onto it drops this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e (Part of R0Y00#2413) A pixel stage whose only export is the null target was refused with 'slot 57 mesh with a depth-only pixel stage is not covered'. It now translates with the pair: the pixel stage has no SV_Target, keeps the vm discard of an alpha test, and the manifest has an empty targets line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tedin7
left a comment
There was a problem hiding this comment.
Review of head 94fed37 against origin/main (comment only).
Code: the diff is small and consistent with the description.
tools/startup/gfx2hlsl.pyStage.export: thenulltarget returns after the existingvmdiscard, so an alpha-test kill is kept and no render-target write is emitted.translate_mesh57: the null-only refusal is removed; the role check for a null export mixed with another non-colour export is unchanged.- Sibling checks: the two assertions that expected the old refusal were updated to the new outcome and nothing else changed in them.
Linux commands run on the exact head:
python3 -B tests/startup_mesh57_depth_only_check.py-> okpython3 -B tests/startup_mesh57_skeleton_check.py-> okpython3 -B tests/startup_gfx2hlsl_watch_check.py-> passedpython3 -B tests/startup_translator_check.py-> 0 failedpython3 tests/docs_links_check.py-> ok;python3 tests/bidi_controls_check.py-> ok;git diff --check origin/main...HEAD-> clean- Mutation 1: restore
tools/startup/gfx2hlsl.pyfrom origin/main -> the new depth-only check exits 1. - Mutation 2: disable the
nullearly return inStage.export-> the new depth-only check exits 1.
Findings: no code defect found. The new test guards the behavior (discard kept, no SV_Target, empty targets line, mixed null+position still refused).
Not covered by this review:
- No Windows run was done by this review (no Win2025 receipt for this head).
- The PR is framed as startup progress (29 locally requested pairs, first-refusal counts). That observation cannot be reproduced from the repository and was not verified here; the DXC compile result is the author's own.
- Because of that framing, the merge decision stays with MasterDomino or @R0Y00, who can check the startup claim on the game. This review does not merge it.
.github/workflows/windows.ymlhas a one-line change registering the new test; it should be exercised by this PR's own CI run.
AI-assisted; commands listed were executed locally.
|
Thanks for #2606. As agreed in #2413, I'm building the source-built depth-only draw on top of it, and I checked the translator half first. Everything below was run on your head What works
Questions To reproduce, save this as import os, sys, tempfile
sys.path.insert(0, 'tests')
import startup_mesh57_skeleton_check as S
if sys.argv[1:] != ['dxc']:
os.environ['X2W_FXC'] = '' # sources and manifest only
PRE = ['c8020002', '7c2200f0'] # v_interp_mov_f32 v0, p0, attr0.x; v_cmpx_lt_f32 0.5, v0
NULL, END = ['f8001890', '00000000'], ['bf810000'] # exp null off, off, off, off done vm; s_endpgm
for label, words in (
('mrt0 before null', PRE + ['f800000f', '00000000'] + NULL + END),
('null done, then mrt0 done', ['f8000890', '00000000', 'f800080f', '00000000'] + END),
('mrtz before null', ['f8000081', '00000000'] + NULL + END),
('param0 before null', PRE + ['f800020f', '00000000'] + NULL + END),
('pos0 before null', PRE + ['f80000cf', '00000000'] + NULL + END),
('null with channel x', ['f8001891', '00000000'] + END)):
with tempfile.TemporaryDirectory() as tmp:
key, result = S.request(tmp, S.MESH, words)
print('%-26s %-60s %s' % (label, result, sorted(n.split('.', 1)[1] for n in os.listdir(tmp) if not n.startswith('req_'))))
Not covered: source-built programs only, no captured requests, nothing loaded at runtime (R1 does not exist yet). AI-assisted. |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
R0Y00
left a comment
There was a problem hiding this comment.
Keep T5 scoped to a slot-57 pixel stage whose only export target is null. The existing general pixel behavior from #2026 can keep its mixed-export forms. I reran the proposed controls on the rebased 1f41b562: the pure depth-only check passes, but each of mrt0 + null, mrtz + null and param0 + null returns ok in manifest-only mode. Please enforce the narrower shape in translate_mesh57 before HLSL publication. Include the inverse export order and confirm mixed forms leave no manifest. For the null-only case, keep the VM discard and the real pixel stage with zero color targets. The D32 sentinel comparison and discard-removal mutant described above are the right independent evidence.
… of R0Y00#2413) The slot 57 depth-only profile is a pixel stage whose only export target is null. A null export before or after an mrt0, mrtz or param0 export passed the role check and was published; it is now refused in translate_mesh57 before any source or manifest is written. The general pixel path keeps its mixed forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks. Pushed Reproduction. At Narrower shape. Inverse order, no manifest. Null-only. Unchanged and still asserted: the D32 sentinel and discard-removal mutant. I left this out of the PR on purpose: @roansystemlabs is building the source-built depth-only draw on top of this branch, as agreed in #2413, and I do not want to duplicate it. For reference, a local draw of the alpha-test pair into a D32 target cleared to 1.0 (zero render targets, depth test LESS) matched its reference on WARP and on one hardware adapter, and the same draw with the Commands at Not verified:
🤖 Generated with Claude Code |
|
I retested |
|
Thanks. Here is the D32 draw fixture on your exact head
Translator mutants at the same head, each reverted:
Not covered: source-built programs only, no captured request, nothing loaded at runtime (R1). The AI-assisted. |
R0Y00
left a comment
There was a problem hiding this comment.
I reran the offline depth-only, mesh-skeleton and watcher controls at your exact head plus the test-only #2680 commit. WARP and RTX 4060 Laptop each matched all 1,024 D32 pixels and kept color cleared with zero debug warnings. Both adapters detected 181 depth mismatches against a no-write reference and 134 when the discard was removed. The six mixed export forms still refuse before publication. This resolves the T5 scope review. The fixture can follow as its own PR.
Part of #2413 (item T5, the null-export half; #2520 covered the no-pixel-stage half).
What changed
A slot 57 request whose pixel stage exports only to the null target (
exp null off, off, off, off done vm) passed the role check since #2421 but was then refused withslot 57 mesh with a depth-only pixel stage is not covered. That refusal is removed, so the pair goes through the existing pair path:Stage.exportwrites nothing for thenulltarget. Thevmflag still emits the existingif (!(exec & 1)) discard;when EXEC was narrowed, so an alpha test keeps its kill. This is the same two-line hunk as the open shader: lower export target null in gfx2hlsl (Part of #1723) #2026 (first commit of this branch, byte-identical, so it drops out if shader: lower export target null in gfx2hlsl (Part of #1723) #2026 merges first).classify_decodedis not changed here.translate_mesh57no longer raises for a null-only pixel stage. The role check is unchanged: a null export mixed with any other non-colour export is still refused.hlsl_psalready emitsvoid main(PSIn i)with noSV_Targetwhen the stage has no colour export, andmanifest()already writes an emptytargetsline. The manifest keeps that line instead ofps none, because the pixel stage still decides coverage (discard) and must be bound.Why it is not handled like the no-pixel case (#2520): all 29 measured depth-only pixel stages read a texture and write EXEC before the null export, and 2 of them also store to an image. Dropping the stage would lose the kill (depth written for pixels that are discarded) and the stores.
Tests
Windows 11, Python 3.13, at this branch's head:
tests/startup_mesh57_depth_only_check.py(new, pure Python, registered in CMakeLists.txt, AGENTS.md and the platform-independent workflow job) pairs the accepted mesh fixture with hand-built pixel words:v_interp_mov_f32,v_cmp_gt_f32 vcc, 0.5, v0,s_andn2_b64 exec, exec, vcc,exp null done vm,s_endpgm. It checks the decode, that the pair translates, that the pixel HLSL has noSV_Targetand keeps the discard, and that the manifest ends in an emptytargetsline and has nops none. Controls: the same stage without the EXEC narrowing has no discard; a null export followed by a position export is still refused with the incompatible-export message. With the translator change reverted the check exits 1.Two existing assertions that expected the old refusal were updated to the new outcome: the skeleton check's depth-only case now expects
ok, and the watch check's synthetic null-export pair now reaches the mesh shape check, with the same refusal as its synthetic colour pair.Local observation (not reproducible from the repository)
29 locally requested slot 57 pairs stopped first at the depth-only refusal.
All 29 now stop in the mesh stage, at refusals that already exist; none translates. Shapes of the 29 pixel stages: 31 to 437 instructions; each reads a texture (
image_sampleorimage_load) and writes EXEC before its null export; 24 have the single null export as the instruction befores_endpgm; 2 contain an image store. The common form interpolates two attributes, samples one texture channel (dmask:0x8), compares and narrows EXEC.DXC (Windows SDK 10.0.26100) compiled the new fixture pair as
ms_6_5andps_6_0locally. Nothing was drawn.Measured versus hypothesis
s_load with a register offset through the resource heap, 1sampler from a descriptor, 1image_store modifier a16. These are expected to be the next pixel-side refusals once the mesh stages pass, but the request path never reached them.targetsline is what a future slot 57 runtime loader needs to create a pipeline with zero render targets and a depth view. No runtime code reads slot 57 results yet.Not verified
.ms57/.ps57results (issue item R1), so these draws are not submitted. Zero-RTV plus depth translated draws are the subject of the open startup: allow MRT, depth, and depth-only targets in translated ExecuteIndirect #2417.🤖 Generated with Claude Code