shader: cover six mesh-entry lowerings that no draw observed #697

Merged
Leyukaka merged 1 commit from upstream-pr/703 into main 2026-11-22 21:39:05 +00:00
Leyukaka commented 2026-11-22 21:19:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-22T21:19:36Z.


Change

This closes six coverage gaps in tools/mesh_entry_aot.py. Each was a one-line mutation that passed every WARP test on main. Only tests/mesh_entry_check.py and tests/mesh_indexed_check.py change; the translator does not.

New case Mutation it covers
the entry draw shades by SV_IsFrontFace (green only when back-facing) primitive winding reversed
an entry triangle at Z = -0.25 that must be clipped (DepthClipEnable is set) Z clamped to [0, W]
an indexed draw with W = 2 and its coverage mask W forced to 1
primitive word 0x200600 (index 512) must be rejected packed index fields masked to 9 bits
exp pos0 ... without done must be rejected unfinished position export accepted
an indexed vertex fetch at byte 0 (the vertex header) must be rejected fetch range starting at 0 instead of 4

The harness keeps CullMode = NONE, so winding is only visible through SV_IsFrontFace. The existing full-coverage check of the entry draw is kept with the new pixel shader. No pixel centre of the W = 2 triangle lies on an edge.

Not covered: a container count limit of 128 instead of 256. It only shows in the LLVM binary mode, which this machine does not run.

Verification

On e20a8df (branch on a3cf689), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, WARP:

ctest --preset dev --no-tests=error -j 4

All 297 tests pass.

Each mutation was applied to tools/mesh_entry_aot.py one at a time, and all WARP tests were run. On main, all of them passed for each mutation. A control that read every attribute component from lane 0 was caught by mesh_attribute_draw_warp, mesh_textured_draw_warp and compute_mesh_texture_warp, so the run does detect a broken translator. On this branch, each of the six mutations fails mesh_entry_draw_warp or mesh_indexed_draw_warp.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed. (No capability changed.)
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6547930698 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/703). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-22T21:19:36Z. --- ## Change This closes six coverage gaps in `tools/mesh_entry_aot.py`. Each was a one-line mutation that passed every WARP test on `main`. Only `tests/mesh_entry_check.py` and `tests/mesh_indexed_check.py` change; the translator does not. | New case | Mutation it covers | |---|---| | the entry draw shades by `SV_IsFrontFace` (green only when back-facing) | primitive winding reversed | | an entry triangle at Z = -0.25 that must be clipped (`DepthClipEnable` is set) | Z clamped to [0, W] | | an indexed draw with W = 2 and its coverage mask | W forced to 1 | | primitive word `0x200600` (index 512) must be rejected | packed index fields masked to 9 bits | | `exp pos0 ... ` without `done` must be rejected | unfinished position export accepted | | an indexed vertex fetch at byte 0 (the vertex header) must be rejected | fetch range starting at 0 instead of 4 | The harness keeps `CullMode = NONE`, so winding is only visible through `SV_IsFrontFace`. The existing full-coverage check of the entry draw is kept with the new pixel shader. No pixel centre of the W = 2 triangle lies on an edge. Not covered: a container count limit of 128 instead of 256. It only shows in the LLVM binary mode, which this machine does not run. ## Verification On `e20a8df` (branch on `a3cf689`), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, WARP: ```text ctest --preset dev --no-tests=error -j 4 ``` All 297 tests pass. Each mutation was applied to `tools/mesh_entry_aot.py` one at a time, and all WARP tests were run. On `main`, all of them passed for each mutation. A control that read every attribute component from lane 0 was caught by `mesh_attribute_draw_warp`, `mesh_textured_draw_warp` and `compute_mesh_texture_warp`, so the run does detect a broken translator. On this branch, each of the six mutations fails `mesh_entry_draw_warp` or `mesh_indexed_draw_warp`. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [ ] I updated README/docs when a capability or build requirement changed. (No capability changed.) - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
upstream-sync closed this pull request 2026-11-24 06:44:24 +00:00
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!697
No description provided.