tests: draw a slot 57 depth-only pair into D32 and compare depth with the CPU (Part of #2413) #2680

Manually merged
github merged 6 commits from gh-pr/2680/head into gh-pr/2680/base 2026-11-27 01:14:21 +00:00
Owner

@⁠roansystemlabs on GitHub · 2026-11-26 01:47 UTC · original
roansystemlabs:startup/2413-d32-depth-draw → main · +184 −3 · 3 files · 6 commits · merged 2026-11-26 02:10 UTC

Part of #2413

Depends on #2606 and should be merged after it. Until then this branch also carries its commits; the change here is the last commit only (120eef54), on top of the #2606 head 8bd527a8. It changes no translator code. It adds the source-built depth-only draw that #2606 leaves out, in the shape the maintainer asked for in #2413:

  • depth initialised to a sentinel;
  • covered and discarded pixels told apart;
  • a failing control when the discard is removed;
  • checks for the mismatched-pair and mixed colour/null refusals.

What changes

  • tests/startup_mesh57_skeleton_check.py:
    • a gfx1013 depth-only pixel stage paired with the accepted mesh from tests/startup_mesh57_skeleton.s:
      v_interp_mov_f32 v0, p0, attr0.x
      v_cmpx_lt_f32_e32 0.5, v0
      exp null off, off, off, off done vm
      s_endpgm
      
      (words c8020002 7c2200f0 f8001890 00000000 bf810000, as printed by clang 15 -cc1as -target-cpu gfx1013 -show-encoding);
    • a depth mode that draws the pair twice with offscreen_check --mesh-depth-pair into a D32 target cleared to the sentinel 1.0, depth test LESS. Colour must stay cleared and depth must match the CPU rasteriser. The four triangles cover four cases: the second draw behind the first, the second in front, a first draw discarded, and both discarded;
    • offline controls:
      • the #2606 manifest form (an empty targets line, no ps line); pending_keys must keep the pair pending until both .ms57.cso and .ps57.cso are complete;
      • the drawn stage with exp mrt0 before its null export must stop at slot 57 pixel stage mixes the null export with another export, leaving only <key>.fail. The other mixed forms are covered by startup_mesh57_depth_only_check.py and are not repeated here;
      • a pixel stage reading an attribute the mesh does not export;
      • a colour stage stored under a depth-only key, and the reverse (slot 57 mesh request key mismatch, nothing else published);
      • every mesh shape the paired path already refuses, now with the depth-only pixel stage.
  • CMakeLists.txt: startup_mesh57_skeleton_depth_{warp,hardware} (timeout 60, skip code 77).
  • docs/experiments.md: the #2606 paragraph now describes the draw.

Results

At 8bd527a8 + this commit, Windows 11, Release, MSVC 14.44, DXC 10.0.26100.0:

ctest --preset release --no-tests=error -j 1 -R '^startup_mesh57_skeleton' -V
  • 9/9 passed. startup_mesh57_depth_only, startup_gfx2hlsl_watch and startup_gfx2hlsl_export_null{,_draw_warp,_draw_hardware} pass too.
  • startup_mesh57_skeleton_depth_hardware: NVIDIA GeForce RTX 3070 (10de:2484, driver 32.0.16.2101).
  • startup_mesh57_skeleton_depth_warp: Microsoft Basic Render Driver (1414:008c, 10.0.26100.9818).

Both ran with the debug layer enabled, debug_errors=0 debug_warnings=0, and nothing was skipped. Of 259 covered pixels, 181 keep a written depth and 78 keep the sentinel only because of the discard. Against the CPU reference: depth_mismatches=0, colour mismatches=0. Negative controls in the same run, on both adapters:

  • a reference without the depth writes: depth_mismatches=181, exit 1;
  • the same mesh with a null export that does not discard: depth_mismatches=134, exit 1.

Translator mutants at the same head, each reverted:

  • Discard removed (vm ignored for the null export in Stage.export): the baseline draw fails with 134 depth mismatches on both adapters, and the offline check and startup_mesh57_depth_only fail.
  • An unconditional discard for the null export (no depth written): the baseline fails with 181 on both, and the same two checks fail.

Not covered

  • No runtime path loads .ms57 / .ps57 results yet (R1).
  • No captured request was used; everything is source-built.
  • The binary mode (llvm-mc -show-encoding) was not run here.

AI-assisted.

**@⁠roansystemlabs** on GitHub · 2026-11-26 01:47 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2680) `roansystemlabs:startup/2413-d32-depth-draw` → `main` · +184 −3 · 3 files · 6 commits · merged 2026-11-26 02:10 UTC Part of #2413 Depends on #2606 and should be merged after it. Until then this branch also carries its commits; the change here is the last commit only (`120eef54`), on top of the #2606 head `8bd527a8`. It changes no translator code. It adds the source-built depth-only draw that #2606 leaves out, in the shape the maintainer asked for in #2413: - depth initialised to a sentinel; - covered and discarded pixels told apart; - a failing control when the discard is removed; - checks for the mismatched-pair and mixed colour/null refusals. ## What changes - `tests/startup_mesh57_skeleton_check.py`: - a gfx1013 depth-only pixel stage paired with the accepted mesh from `tests/startup_mesh57_skeleton.s`: ``` v_interp_mov_f32 v0, p0, attr0.x v_cmpx_lt_f32_e32 0.5, v0 exp null off, off, off, off done vm s_endpgm ``` (words `c8020002 7c2200f0 f8001890 00000000 bf810000`, as printed by clang 15 `-cc1as -target-cpu gfx1013 -show-encoding`); - a `depth` mode that draws the pair twice with `offscreen_check --mesh-depth-pair` into a D32 target cleared to the sentinel 1.0, depth test LESS. Colour must stay cleared and depth must match the CPU rasteriser. The four triangles cover four cases: the second draw behind the first, the second in front, a first draw discarded, and both discarded; - offline controls: - the #2606 manifest form (an empty `targets` line, no `ps` line); `pending_keys` must keep the pair pending until both `.ms57.cso` and `.ps57.cso` are complete; - the drawn stage with `exp mrt0` before its null export must stop at `slot 57 pixel stage mixes the null export with another export`, leaving only `<key>.fail`. The other mixed forms are covered by `startup_mesh57_depth_only_check.py` and are not repeated here; - a pixel stage reading an attribute the mesh does not export; - a colour stage stored under a depth-only key, and the reverse (`slot 57 mesh request key mismatch`, nothing else published); - every mesh shape the paired path already refuses, now with the depth-only pixel stage. - `CMakeLists.txt`: `startup_mesh57_skeleton_depth_{warp,hardware}` (timeout 60, skip code 77). - `docs/experiments.md`: the #2606 paragraph now describes the draw. ## Results At `8bd527a8` + this commit, Windows 11, Release, MSVC 14.44, DXC 10.0.26100.0: ``` ctest --preset release --no-tests=error -j 1 -R '^startup_mesh57_skeleton' -V ``` - 9/9 passed. `startup_mesh57_depth_only`, `startup_gfx2hlsl_watch` and `startup_gfx2hlsl_export_null{,_draw_warp,_draw_hardware}` pass too. - `startup_mesh57_skeleton_depth_hardware`: NVIDIA GeForce RTX 3070 (10de:2484, driver 32.0.16.2101). - `startup_mesh57_skeleton_depth_warp`: Microsoft Basic Render Driver (1414:008c, 10.0.26100.9818). Both ran with the debug layer enabled, `debug_errors=0 debug_warnings=0`, and nothing was skipped. Of 259 covered pixels, 181 keep a written depth and 78 keep the sentinel only because of the discard. Against the CPU reference: `depth_mismatches=0`, colour `mismatches=0`. Negative controls in the same run, on both adapters: - a reference without the depth writes: `depth_mismatches=181`, exit 1; - the same mesh with a null export that does not discard: `depth_mismatches=134`, exit 1. Translator mutants at the same head, each reverted: - Discard removed (`vm` ignored for the null export in `Stage.export`): the baseline draw fails with 134 depth mismatches on both adapters, and the offline check and `startup_mesh57_depth_only` fail. - An unconditional discard for the null export (no depth written): the baseline fails with 181 on both, and the same two checks fail. ## Not covered - No runtime path loads `.ms57` / `.ps57` results yet (R1). - No captured request was used; everything is source-built. - The `binary` mode (`llvm-mc -show-encoding`) was not run here. AI-assisted.
The null target carries no channel; its only effect is the vm discard
emitted before it. Same change as the open #2026, so a rebase onto it
drops this commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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 <[email protected]>
A source-built gfx1013 pixel stage narrows EXEC with v_cmpx and exports
only to the null target. The pair is drawn twice into a D32 target cleared
to the sentinel 1.0 (depth test LESS) on WARP and hardware; colour must
stay cleared and depth must match the CPU rasteriser, so covered and
discarded pixels are told apart. A reference without the depth writes and
the same mesh without the discard must each fail. Offline controls refuse
the drawn stage with a colour export before its null export (the slot 57
mixed-export refusal) and a mismatched pair in both directions, and check
that pending_keys needs both bytecodes.

Part of #2413
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:14:17 +00:00
github manually merged commit c294289fcc into gh-pr/2680/base 2026-11-27 01:14:21 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-26 02:08 UTC · original · approved these changes

I integrated main after #2606 landed. The delta now contains only the D32 fixture, its test registration and documentation. WARP and RTX matched all 1,024 depth pixels with zero debug errors or warnings. Removing depth writes yields 181 mismatches, and removing the discard yields 134. The pre-existing mesh draw and the host depth, skeleton and watcher controls also passed after integration.

**@⁠R0Y00** on GitHub · 2026-11-26 02:08 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2680#pullrequestreview-6067612664) · **approved these changes** I integrated main after #2606 landed. The delta now contains only the D32 fixture, its test registration and documentation. WARP and RTX matched all 1,024 depth pixels with zero debug errors or warnings. Removing depth writes yields 181 mismatches, and removing the discard yields 134. The pre-existing mesh draw and the host depth, skeleton and watcher controls also passed after integration.
This discussion has been locked. Commenting is limited to contributors.
No description provided.