tests: measure desktop culling and front-face winding with opposite triangles #2252

Merged
RavenCurseBurg merged 3 commits from upstream-pr/2260 into main 2026-11-25 08:52:36 +00:00
RavenCurseBurg commented 2026-11-25 08:34:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T08:34:04Z.


Add the independent desktop reference requested in #1999, item B. One draw submits two opposite-winding triangles into an 8×4 float target. SV_IsFrontFace selects green or red, and the known clear value marks uncovered or culled pixels. The Python reference compares all 32 pixels for each combination of none/front/back culling and CW/CCW winding. Four wrong-state draws must differ at exactly 6, 6, 12 and 12 pixels. This uses explicit desktop PSO fields and makes no assumptions about guest registers.

Reproduce with cmake --build --preset dev --target offscreen_check and ctest --preset dev --no-tests=error -V -R '^raster_winding_(warp|hardware)$'. The fixture prints the adapter, driver and debug-layer status, and rejects any warning or error when the layer is enabled.

Adapter and driver Debug layer Result
Microsoft Basic Render Driver, 10.0.26100.33648 (hosted WARP) Enabled Six exact images, four exact mismatch counts, zero debug warnings and errors
NVIDIA GeForce RTX 4060, 32.0.15.9579 Unavailable on this machine with both the system and Agility runtimes Six exact images and all four mismatch counts
Microsoft Basic Render Driver, 10.0.26100.9711 (local WARP) Unavailable Six exact images and all four mismatch counts

The hosted runner also exposes the Microsoft Basic Render Driver through hardware enumeration. The hardware case returns CTest skip for that adapter. A physical-adapter run with Graphics Tools enabled is still needed for the remaining review item. The command above prints all the evidence in one run. Initial debug-layer validation · Final source build

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6600447997 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2260). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T08:34:04Z. --- Add the independent desktop reference requested in [#1999, item B](https://github.com/R0Y00/Xbox2Windows/issues/1999#issuecomment-7156838351). One draw submits two opposite-winding triangles into an 8×4 float target. `SV_IsFrontFace` selects green or red, and the known clear value marks uncovered or culled pixels. The Python reference compares all 32 pixels for each combination of none/front/back culling and CW/CCW winding. Four wrong-state draws must differ at exactly 6, 6, 12 and 12 pixels. This uses explicit desktop PSO fields and makes no assumptions about guest registers. Reproduce with `cmake --build --preset dev --target offscreen_check` and `ctest --preset dev --no-tests=error -V -R '^raster_winding_(warp|hardware)$'`. The fixture prints the adapter, driver and debug-layer status, and rejects any warning or error when the layer is enabled. | Adapter and driver | Debug layer | Result | | --- | --- | --- | | Microsoft Basic Render Driver, 10.0.26100.33648 (hosted WARP) | Enabled | Six exact images, four exact mismatch counts, zero debug warnings and errors | | NVIDIA GeForce RTX 4060, 32.0.15.9579 | Unavailable on this machine with both the system and Agility runtimes | Six exact images and all four mismatch counts | | Microsoft Basic Render Driver, 10.0.26100.9711 (local WARP) | Unavailable | Six exact images and all four mismatch counts | The hosted runner also exposes the Microsoft Basic Render Driver through hardware enumeration. The hardware case returns CTest skip for that adapter. A physical-adapter run with Graphics Tools enabled is still needed for the remaining review item. The command above prints all the evidence in one run. [Initial debug-layer validation](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45576462902) · [Final source build](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45577260224)
upstream-sync closed this pull request 2026-11-25 09:04:06 +00:00
tedin7 commented 2026-11-25 09:04:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T08:38:42Z.

Review: COMMENTED


Review of head dea8b47d1aca9bc5ea790fbc464ae201d15115e8. P1: 0. P2: 0.

Review:

  • The fixture uses explicit desktop PSO fields (cull mode, front winding) with two mirrored triangles, so it makes no assumption about guest registers or ISA. Clean-room.
  • Expected images are written independently as coverage strings in the Python reference. They are not computed by the code under test.
  • The extra draw parameters in check_startup_flat_param default to the previous behavior (no cull, clockwise, 3 vertices), so existing callers are unchanged. The new CLI arguments are validated, with self-test cases.
  • The hosted-runner case where "hardware" returns the Basic Render Driver is handled as a CTest skip (77).
  • No other open PR covers this fixture.

Commands executed locally:

  • python3 tests/docs_links_check.py: passed, 18 files, 428 links.
  • python3 tests/bidi_controls_check.py: passed, no bidirectional controls.
  • git diff --check origin/main...HEAD: clean.
  • Mutation: Linux has no D3D12, so I ran verify() from tests/raster_winding_reference.py against a stand-in renderer. The stand-in is an independent shoelace and edge-function model I wrote locally. Correct tables: all 6 state images match, and the 4 wrong-state draws differ by 6, 6, 12 and 12 pixels. Mutating EXPECTED[("front","cw")] from ".B" to "FB" makes the test FAIL ("6 of 32 pixels differ").
  • Win2025 (D3D12 WARP), x2w_pipe.py win2025 2260 --scope direct --targets offscreen_check --regex '^(raster_winding|startup_flat_param)_':
    • Debug: 4/5 passed (raster_winding_warp and the three startup_flat_param_* tests). raster_winding_hardware skipped because the VM has WARP only.
    • Release /O2: the same result.
  • GitHub CI Build and test on Windows: SUCCESS.

Note: a run on a physical adapter with Graphics Tools is still outstanding, as the author states. This does not block the WARP gate.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6054262924 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2260#pullrequestreview-6054262924). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T08:38:42Z. **Review:** COMMENTED --- Review of head `dea8b47d1aca9bc5ea790fbc464ae201d15115e8`. P1: 0. P2: 0. Review: - The fixture uses explicit desktop PSO fields (cull mode, front winding) with two mirrored triangles, so it makes no assumption about guest registers or ISA. Clean-room. - Expected images are written independently as coverage strings in the Python reference. They are not computed by the code under test. - The extra draw parameters in `check_startup_flat_param` default to the previous behavior (no cull, clockwise, 3 vertices), so existing callers are unchanged. The new CLI arguments are validated, with self-test cases. - The hosted-runner case where "hardware" returns the Basic Render Driver is handled as a CTest skip (77). - No other open PR covers this fixture. Commands executed locally: - `python3 tests/docs_links_check.py`: passed, 18 files, 428 links. - `python3 tests/bidi_controls_check.py`: passed, no bidirectional controls. - `git diff --check origin/main...HEAD`: clean. - Mutation: Linux has no D3D12, so I ran `verify()` from `tests/raster_winding_reference.py` against a stand-in renderer. The stand-in is an independent shoelace and edge-function model I wrote locally. Correct tables: all 6 state images match, and the 4 wrong-state draws differ by 6, 6, 12 and 12 pixels. Mutating `EXPECTED[("front","cw")]` from ".B" to "FB" makes the test FAIL ("6 of 32 pixels differ"). - Win2025 (D3D12 WARP), `x2w_pipe.py win2025 2260 --scope direct --targets offscreen_check --regex '^(raster_winding|startup_flat_param)_'`: - Debug: 4/5 passed (`raster_winding_warp` and the three `startup_flat_param_*` tests). `raster_winding_hardware` skipped because the VM has WARP only. - Release /O2: the same result. - GitHub CI `Build and test on Windows`: SUCCESS. Note: a run on a physical adapter with Graphics Tools is still outstanding, as the author states. This does not block the WARP gate. AI-assisted; commands listed were executed locally.
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!2252
No description provided.