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

Manually merged
github merged 3 commits from gh-pr/2260/head into gh-pr/2260/base 2026-11-27 00:10:39 +00:00
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-25 08:34 UTC · original
RavenCurseBurg:tests/desktop-raster-winding → main · +140 −5 · 6 files · 3 commits · merged 2026-11-25 08:52 UTC

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

**@⁠RavenCurseBurg** on GitHub · 2026-11-25 08:34 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2260) `RavenCurseBurg:tests/desktop-raster-winding` → `main` · +140 −5 · 6 files · 3 commits · merged 2026-11-25 08:52 UTC Add the independent desktop reference requested in [#1999, item B](https://git.gtahub.st/github/R0Y00--Xbox2Windows/issues/1999). 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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:10:38 +00:00
github manually merged commit d179eedccc into gh-pr/2260/base 2026-11-27 00:10:39 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 08:38 UTC · original · reviewed

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.

**@⁠tedin7** on GitHub · 2026-11-25 08:38 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2260#pullrequestreview-6054262924) · **reviewed** 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.