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

Merged
roansystemlabs merged 6 commits from upstream-pr/2680 into main 2026-11-26 02:10:20 +00:00
roansystemlabs commented 2026-11-26 01:47:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-26T01:47:07Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6617653986 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2680). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-26T01:47:07Z. --- 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.
upstream-sync closed this pull request 2026-11-26 03:03:10 +00:00
R0Y00 commented 2026-11-26 03:03:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T02:08:38Z.

Review: APPROVED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6067612664 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2680#pullrequestreview-6067612664). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T02:08:38Z. **Review:** APPROVED --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2672
No description provided.