shader: cover four mesh-entry lowerings that no draw observed #626

Merged
Leyukaka merged 1 commit from upstream-pr/632 into main 2026-11-22 17:23:54 +00:00
Leyukaka commented 2026-11-22 16:46:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-22T16:46:48Z.


Change

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

The check gains offset_draw(), a second draw of the existing mesh program. It folds four extra values into the exported depth:

  • a constant read from byte 0x104 (row 16), with a different decoy at byte 0x4;
  • a scalar geometry load at 0x404 (word 257, 0.0625);
  • a vector buffer_load_dword at 0x408 (word 258, 0.125);
  • an s_cmp_lt_u32 3, 3 whose true arm would add 1.25.

Geometry words 1 and 2 hold different decoys (0.875 and 1.125). The expected depth, 0.6875, is exact in binary32; each mutation pushes every vertex past the far plane. The existing draw and its wrong-primitive-index control are unchanged.

Verification

On 88eb7a1 (branch on 84c1506), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, WARP and NVIDIA GeForce RTX 5080:

ctest --preset dev --no-tests=error -R '^mesh_entry_draw_(warp|hardware)$'
ctest --preset dev --no-tests=error -j 4

Both pass (282 of 282 for the full suite).

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 reordered the packed primitive indices was caught by six mesh WARP tests, so the run does detect a broken translator. On this branch, each mutation fails mesh_entry_draw_warp:

Mutation Caught through
uniform row index wraps at 16 constant at row 16
scalar geometry offset wraps at 256 words word 257
vector geometry address wraps at 256 words word 258
s_cmp_lt_u32 lowered as <= equal operands

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:6545008001 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/632). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-22T16:46:48Z. --- ## Change This closes four coverage gaps in `tools/mesh_entry_aot.py`. Each was a one-line mutation of the translator that passed every WARP test on `main`. Only `tests/mesh_entry_check.py` changes; the translator does not. The check gains `offset_draw()`, a second draw of the existing mesh program. It folds four extra values into the exported depth: - a constant read from byte `0x104` (row 16), with a different decoy at byte `0x4`; - a scalar geometry load at `0x404` (word 257, 0.0625); - a vector `buffer_load_dword` at `0x408` (word 258, 0.125); - an `s_cmp_lt_u32 3, 3` whose true arm would add 1.25. Geometry words 1 and 2 hold different decoys (0.875 and 1.125). The expected depth, 0.6875, is exact in binary32; each mutation pushes every vertex past the far plane. The existing draw and its wrong-primitive-index control are unchanged. ## Verification On `88eb7a1` (branch on `84c1506`), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, WARP and NVIDIA GeForce RTX 5080: ```text ctest --preset dev --no-tests=error -R '^mesh_entry_draw_(warp|hardware)$' ctest --preset dev --no-tests=error -j 4 ``` Both pass (282 of 282 for the full suite). 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 reordered the packed primitive indices was caught by six mesh WARP tests, so the run does detect a broken translator. On this branch, each mutation fails `mesh_entry_draw_warp`: | Mutation | Caught through | |---|---| | uniform row index wraps at 16 | constant at row 16 | | scalar geometry offset wraps at 256 words | word 257 | | vector geometry address wraps at 256 words | word 258 | | `s_cmp_lt_u32` lowered as `<=` | equal operands | ## 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:04 +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!626
No description provided.