tests: honor the hardware adapter filter in startup stream fixtures #2416

Merged
RavenCurseBurg merged 2 commits from upstream-pr/2424 into main 2026-11-25 17:11:34 +00:00
RavenCurseBurg commented 2026-11-25 16:20:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T16:20:48Z.


Fixes #2416.

Five startup-stream test drivers now share hardware adapter selection. A case-insensitive substring in XBOX2WINDOWS_ADAPTER selects a non-software D3D12 feature-level 12 device, preserving DXGI's high-performance order. An unmatched or overlong explicit name produces a diagnostic and exit 4. WARP still runs when a hardware filter is present.

I reproduced the false pass with the previous rasterizer binary: both an Intel selector and a nonexistent selector ran on the RTX 4060. The new CTest checks the native exit code and diagnostic for both an absent name and a 128-character name.

I ran the five complete draw/readback fixtures on Windows 11 in each of four configurations. All 20 passed. In each configuration I checked 22 adapter descriptions printed by the native drivers:

Hardware selector Backend Observed device
uHd gRaPhIcS 770 hardware Intel UHD Graphics 770, 32.0.101.5973
gEfOrCe rTx hardware NVIDIA GeForce RTX 4060, 32.0.15.9579
unset hardware NVIDIA GeForce RTX 4060, 32.0.15.9579
nonexistent WARP Microsoft Basic Render Driver, 10.0.26100.9711

The negative selection test and all five WARP fixtures also passed on Windows Server 2025 with a nonexistent hardware filter. Source and fixtures use synthetic shaders only.

AI-assisted with Codex + GPT-6.2 Astra (xhigh).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6608756945 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2424). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T16:20:48Z. --- Fixes #2416. Five startup-stream test drivers now share hardware adapter selection. A case-insensitive substring in `XBOX2WINDOWS_ADAPTER` selects a non-software D3D12 feature-level 12 device, preserving DXGI's high-performance order. An unmatched or overlong explicit name produces a diagnostic and exit 4. WARP still runs when a hardware filter is present. I reproduced the false pass with the previous rasterizer binary: both an Intel selector and a nonexistent selector ran on the RTX 4060. The new CTest checks the native exit code and diagnostic for both an absent name and a 128-character name. I ran the five complete draw/readback fixtures on Windows 11 in each of four configurations. All 20 passed. In each configuration I checked 22 adapter descriptions printed by the native drivers: | Hardware selector | Backend | Observed device | | --- | --- | --- | | `uHd gRaPhIcS 770` | hardware | Intel UHD Graphics 770, 32.0.101.5973 | | `gEfOrCe rTx` | hardware | NVIDIA GeForce RTX 4060, 32.0.15.9579 | | unset | hardware | NVIDIA GeForce RTX 4060, 32.0.15.9579 | | nonexistent | WARP | Microsoft Basic Render Driver, 10.0.26100.9711 | The negative selection test and all five WARP fixtures also passed on [Windows Server 2025](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45652416659) with a nonexistent hardware filter. Source and fixtures use synthetic shaders only. AI-assisted with Codex + GPT-6.2 Astra (xhigh).
tedin7 commented 2026-11-25 17:01:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:43:46Z.

Review: COMMENTED


Review of head d169b99b.

Checked against origin/main:

  • The five startup-stream drivers now share one pick_stream_adapter() in tests/startup_stream_setup.cpp. The old copies were identical, so this is a clean dedupe.
  • Behavior: unset filter keeps the old order (high-performance, first D3D12 FL12 non-software device). A set filter matches a case-insensitive substring. A 128+ character filter and an unmatched filter both exit 4 with a diagnostic. WARP ignores the filter.
  • New CTest startup_stream_adapter_filter checks exit code 4 and the exact stderr text for both the overlong and the unmatched case. It returns 77 (skip) when there is no hardware adapter. It guards the false pass described in #2416.
  • Scope is small and additive: tests, one CMake entry, one docs paragraph. Nothing in launcher, hooks or .github.
  • Sibling check: no other open or merged PR covers this adapter filter in the startup-stream drivers (#2325 only touched compute readbacks).
  • Note, not a blocker: with a filter set on a machine that has no hardware adapter, the hardware fixtures exit 4 instead of skipping. This matches the new docs ("an unmatched hardware selector fails the test").

Commands run: merge_check.py 2424, gh pr diff 2424, gh pr list --state all --search ..., gh pr checks 2424.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6061407138 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2424#pullrequestreview-6061407138). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:43:46Z. **Review:** COMMENTED --- Review of head d169b99b. Checked against origin/main: - The five startup-stream drivers now share one `pick_stream_adapter()` in `tests/startup_stream_setup.cpp`. The old copies were identical, so this is a clean dedupe. - Behavior: unset filter keeps the old order (high-performance, first D3D12 FL12 non-software device). A set filter matches a case-insensitive substring. A 128+ character filter and an unmatched filter both exit 4 with a diagnostic. WARP ignores the filter. - New CTest `startup_stream_adapter_filter` checks exit code 4 and the exact stderr text for both the overlong and the unmatched case. It returns 77 (skip) when there is no hardware adapter. It guards the false pass described in #2416. - Scope is small and additive: tests, one CMake entry, one docs paragraph. Nothing in launcher, hooks or .github. - Sibling check: no other open or merged PR covers this adapter filter in the startup-stream drivers (#2325 only touched compute readbacks). - Note, not a blocker: with a filter set on a machine that has no hardware adapter, the hardware fixtures exit 4 instead of skipping. This matches the new docs ("an unmatched hardware selector fails the test"). Commands run: `merge_check.py 2424`, `gh pr diff 2424`, `gh pr list --state all --search ...`, `gh pr checks 2424`. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 17:01:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:48:53Z.


Win2025 WARP receipt for head 8a9265ed after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 8a9265edba3f2ab92871cf749443f2a70db6ce00:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target cpu_placed_provider startup_draw_depth_target startup_slot57_depth startup_stream_consumer startup_stream_depth startup_stream_rasterizer startup_stream_setup_obj -- -j 2): 12.36s (configure 0.00s)
    • Test (ctest --preset dev -R 'startup_(stream|draw_depth|slot57).*(warp|adapter_filter)' --parallel 4 --no-tests=error --output-on-failure): 13/14 passed (6.07s: startup_slot57_blend_draw_warp 2.26s, startup_slot57_depth_warp 2.45s, startup_stream_fetch_warp 1.05s, startup_stream_draw_warp 3.57s, startup_draw_depth_target_warp 1.32s, startup_stream_depth_warp 4.34s, startup_stream_request_warp 1.20s, startup_draw_depth_target_drop_control_warp 1.13s, startup_stream_viewport_warp 1.03s, startup_stream_adapter_filter 0.19s, startup_stream_interface_warp 0.81s, startup_stream_rasterizer_ignore_warp 0.82s, startup_stream_rasterizer_warp 0.83s, startup_draw_depth_target_debug_warp 0.87s); skipped (capability, not a pass): startup_draw_depth_target_debug_warp
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target cpu_placed_provider startup_draw_depth_target startup_slot57_depth startup_stream_consumer startup_stream_depth startup_stream_rasterizer startup_stream_setup_obj -- -j 2): 6.09s (configure 0.00s)
    • Test (ctest --preset release -R 'startup_(stream|draw_depth|slot57).*(warp|adapter_filter)' --parallel 4 --no-tests=error --output-on-failure): 13/14 passed (4.86s: startup_stream_request_warp 1.03s, startup_slot57_depth_warp 1.82s, startup_draw_depth_target_drop_control_warp 1.02s, startup_stream_draw_warp 2.76s, startup_draw_depth_target_warp 1.19s, startup_stream_depth_warp 3.37s, startup_slot57_blend_draw_warp 1.44s, startup_stream_fetch_warp 0.92s, startup_stream_viewport_warp 0.78s, startup_stream_adapter_filter 0.16s, startup_stream_interface_warp 0.65s, startup_stream_rasterizer_warp 0.78s, startup_stream_rasterizer_ignore_warp 0.68s, startup_draw_depth_target_debug_warp 0.76s); skipped (capability, not a pass): startup_draw_depth_target_debug_warp
  • sccache: 13/26 hits; wall 30.1s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7168572482 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2424#issuecomment-7168572482). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:48:53Z. --- Win2025 WARP receipt for head 8a9265ed after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `8a9265edba3f2ab92871cf749443f2a70db6ce00`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target cpu_placed_provider startup_draw_depth_target startup_slot57_depth startup_stream_consumer startup_stream_depth startup_stream_rasterizer startup_stream_setup_obj -- -j 2`): `12.36s` (configure `0.00s`) - Test (`ctest --preset dev -R 'startup_(stream|draw_depth|slot57).*(warp|adapter_filter)' --parallel 4 --no-tests=error --output-on-failure`): **13/14 passed** (`6.07s`: `startup_slot57_blend_draw_warp` `2.26s`, `startup_slot57_depth_warp` `2.45s`, `startup_stream_fetch_warp` `1.05s`, `startup_stream_draw_warp` `3.57s`, `startup_draw_depth_target_warp` `1.32s`, `startup_stream_depth_warp` `4.34s`, `startup_stream_request_warp` `1.20s`, `startup_draw_depth_target_drop_control_warp` `1.13s`, `startup_stream_viewport_warp` `1.03s`, `startup_stream_adapter_filter` `0.19s`, `startup_stream_interface_warp` `0.81s`, `startup_stream_rasterizer_ignore_warp` `0.82s`, `startup_stream_rasterizer_warp` `0.83s`, `startup_draw_depth_target_debug_warp` `0.87s`); skipped (capability, not a pass): `startup_draw_depth_target_debug_warp` - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target cpu_placed_provider startup_draw_depth_target startup_slot57_depth startup_stream_consumer startup_stream_depth startup_stream_rasterizer startup_stream_setup_obj -- -j 2`): `6.09s` (configure `0.00s`) - Test (`ctest --preset release -R 'startup_(stream|draw_depth|slot57).*(warp|adapter_filter)' --parallel 4 --no-tests=error --output-on-failure`): **13/14 passed** (`4.86s`: `startup_stream_request_warp` `1.03s`, `startup_slot57_depth_warp` `1.82s`, `startup_draw_depth_target_drop_control_warp` `1.02s`, `startup_stream_draw_warp` `2.76s`, `startup_draw_depth_target_warp` `1.19s`, `startup_stream_depth_warp` `3.37s`, `startup_slot57_blend_draw_warp` `1.44s`, `startup_stream_fetch_warp` `0.92s`, `startup_stream_viewport_warp` `0.78s`, `startup_stream_adapter_filter` `0.16s`, `startup_stream_interface_warp` `0.65s`, `startup_stream_rasterizer_warp` `0.78s`, `startup_stream_rasterizer_ignore_warp` `0.68s`, `startup_draw_depth_target_debug_warp` `0.76s`); skipped (capability, not a pass): `startup_draw_depth_target_debug_warp` - `sccache`: 13/26 hits; wall `30.1s` AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 18:01:04 +00:00
MasterDomino commented 2026-11-25 18:01:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T17:10:41Z.

Review: COMMENTED


Review of head 8a9265ed (base b442b57f), built and run at that exact revision. This complements @tedin7's review of d169b99b and his WARP receipt with a physical AMD adapter and a negative control.

Verdict: no findings. The behaviour matches the description and #2416, and the new test catches the original false pass.

Environment

  • Windows 11 build 26300, --preset dev (Debug), MSVC 14.44.
  • AMD Radeon RX 9070 XT (1002:7550, driver 32.0.32029.2010) and WARP 10.0.26100.9818.
  • This machine has a single hardware adapter, so it can't exercise the choice between two GPUs. The dual-GPU table in the description covers that.

Commands executed

cmake --build --preset dev --target cpu_placed_provider startup_draw_depth_target startup_slot57_depth startup_stream_consumer startup_stream_depth startup_stream_rasterizer startup_stream_setup_obj
ctest --preset dev --no-tests=error -R 'startup_(stream|draw_depth|slot57).*(hardware|warp|adapter_filter)' -V

I ran the second command once per XBOX2WINDOWS_ADAPTER setting:

XBOX2WINDOWS_ADAPTER Result Hardware-test adapter
unset 26/26 passed AMD Radeon RX 9070 XT
rAdEoN rX 9070 26/26 passed AMD Radeon RX 9070 XT
no-such-adapter-768 15 passed, 11 failed as intended: every *_hardware test, each with No D3D12 hardware adapter matches XBOX2WINDOWS_ADAPTER=no-such-adapter-768. WARP tests and startup_stream_adapter_filter passed. none; WARP ran

There were no capability skips.

Negative control

I restored the six drivers and the startup_stream_setup files to the base b442b57f, kept the PR's CTest and check script, and rebuilt. Then, with XBOX2WINDOWS_ADAPTER=no-such-adapter-768:

  • startup_stream_adapter_filter failed: expected 'XBOX2WINDOWS_ADAPTER is longer than 127 characters', got exit 0, and the driver ran on the RX 9070 XT.
  • startup_stream_rasterizer_hardware passed on the RX 9070 XT despite the nonexistent selector. That is the false pass #2416 reports.

After restoring the PR sources and rebuilding, startup_stream_adapter_filter passes again.

Merge checks

  • Head 8a9265ed is the one tested. The PR is mergeable (clean) and has no review threads.
  • Required CI passed at this head: "Build and test on Windows" and both Linux jobs.
  • The /O2 and coverage jobs are skipped by explicit workflow conditions: if: github.event_name != 'pull_request', and main pushes only, respectively.
  • The scope is test drivers, one CTest registration and one docs paragraph.

These are source-built synthetic fixtures only; no executable run is involved.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6061815238 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2424#pullrequestreview-6061815238). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T17:10:41Z. **Review:** COMMENTED --- Review of head `8a9265ed` (base `b442b57f`), built and run at that exact revision. This complements @tedin7's review of `d169b99b` and his WARP receipt with a physical AMD adapter and a negative control. **Verdict: no findings. The behaviour matches the description and #2416, and the new test catches the original false pass.** ### Environment - Windows 11 build 26300, `--preset dev` (Debug), MSVC 14.44. - **AMD Radeon RX 9070 XT** (1002:7550, driver 32.0.32029.2010) and WARP 10.0.26100.9818. - This machine has a single hardware adapter, so it can't exercise the choice between two GPUs. The dual-GPU table in the description covers that. ### Commands executed ```powershell cmake --build --preset dev --target cpu_placed_provider startup_draw_depth_target startup_slot57_depth startup_stream_consumer startup_stream_depth startup_stream_rasterizer startup_stream_setup_obj ctest --preset dev --no-tests=error -R 'startup_(stream|draw_depth|slot57).*(hardware|warp|adapter_filter)' -V ``` I ran the second command once per `XBOX2WINDOWS_ADAPTER` setting: | `XBOX2WINDOWS_ADAPTER` | Result | Hardware-test adapter | |---|---|---| | unset | **26/26 passed** | AMD Radeon RX 9070 XT | | `rAdEoN rX 9070` | **26/26 passed** | AMD Radeon RX 9070 XT | | `no-such-adapter-768` | 15 passed, **11 failed as intended**: every `*_hardware` test, each with `No D3D12 hardware adapter matches XBOX2WINDOWS_ADAPTER=no-such-adapter-768`. WARP tests and `startup_stream_adapter_filter` passed. | none; WARP ran | There were no capability skips. ### Negative control I restored the six drivers and the `startup_stream_setup` files to the base `b442b57f`, kept the PR's CTest and check script, and rebuilt. Then, with `XBOX2WINDOWS_ADAPTER=no-such-adapter-768`: - **`startup_stream_adapter_filter` failed:** `expected 'XBOX2WINDOWS_ADAPTER is longer than 127 characters', got exit 0`, and the driver ran on the RX 9070 XT. - **`startup_stream_rasterizer_hardware` passed on the RX 9070 XT** despite the nonexistent selector. That is the false pass #2416 reports. After restoring the PR sources and rebuilding, `startup_stream_adapter_filter` passes again. ### Merge checks - Head `8a9265ed` is the one tested. The PR is mergeable (`clean`) and has no review threads. - Required CI passed at this head: "Build and test on Windows" and both Linux jobs. - The `/O2` and coverage jobs are skipped by explicit workflow conditions: `if: github.event_name != 'pull_request'`, and main pushes only, respectively. - The scope is test drivers, one CTest registration and one docs paragraph. These are source-built synthetic fixtures only; no executable run is involved. AI-assisted; commands listed were executed locally.
MasterDomino commented 2026-11-25 18:01:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T17:11:29Z.

Review: APPROVED


Approving 8a9265ed: verified on an RX 9070 XT and WARP, with a negative control. See my review above. AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6061826771 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2424#pullrequestreview-6061826771). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T17:11:29Z. **Review:** APPROVED --- Approving `8a9265ed`: verified on an RX 9070 XT and WARP, with a negative control. See my review above. AI-assisted.
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!2416
No description provided.