tests: select the hardware adapter for indirect Dispatch readbacks #2644

Merged
RavenCurseBurg merged 1 commit from upstream-pr/2652 into main 2026-11-26 00:37:00 +00:00
RavenCurseBurg commented 2026-11-26 00:34:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-26T00:34:05Z.


Change

On a dual-GPU machine, setting XBOX2WINDOWS_ADAPTER=Intel still ran the indirect Dispatch fixture on the first D3D12 device, my RTX 4060. This made it easy to report the same card twice when gathering the GPU-written count requested in #2626.

The hardware fixture now matches a case-insensitive substring of the DXGI description using the stream tests' existing rule. Without a filter it enumerates devices in its original order. WARP uses its explicit software adapter. A selector longer than 127 characters or one that matches no eligible hardware exits 4 with a diagnostic. The indirect fixture and stream rasterizer exercise these failures through the same Python check. The count readback documented under startup_indirect_count_hardware can now be repeated per adapter.

Verification

Windows 11 build 26100.9711, fixture sources at 04b454c8. I built both changed C++ entry points locally with Zig 0.13.0 (C++17, x86_64-windows-gnu, -O2) and linked the existing Windows runtime DLL built at 2e029857. The D3D12 debug layer was unavailable. All three modes of startup_indirect_dispatch <backend> [constants|count] passed on each backend. All outputs below are fenced GPU readbacks.

Selected device Driver GPU count 2 GPU count 9, maximum 3 GPU count 0
NVIDIA GeForce RTX 4060, gEfOrCe 32.0.15.9579 0x31415935 0x31415a64 0x31415926
Intel UHD Graphics 770, uHd GrApHiCs 770 32.0.101.5973 0x31415935 0x31415a64 0x31415926
WARP, 128-character hardware selector set 10.0.26100.9711 0x31415935 0x31415a64 0x31415926

The default hardware run selected the RTX. With the old executable, the new failure check caught the first overlong selector returning 0. Both candidate executables reject overlong and unmatched selectors with exit 4. A 127-character unmatched name reaches the no-match diagnostic. I read the WARP count results in a terminal because its redirected stdout was empty on this local build.

python -B tests/hardware_adapter_filter_check.py $indirect hardware count
python -B tests/startup_stream_rasterizer_check.py $rasterizer hardware filter
python -B tests/startup_stream_rasterizer_check.py $rasterizer hardware
python -B tests/startup_stream_rasterizer_check.py $rasterizer warp

The rasterizer's eight cull/winding images matched on both physical adapters and WARP. Fractional bias and both mixed rasterizer orders stayed clear.

Evidence and follow-up

The shaders and expected values come from the project's existing synthetic fixtures. The reported RX 5700 XT result still needs a second RDNA 1 comparison. Standalone mixed-record and split-call measurements

Refs #2626.

AI-assisted contribution using Codex (GPT-6.2 Astra, xhigh).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6616743294 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2652). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-26T00:34:05Z. --- ## Change On a dual-GPU machine, setting `XBOX2WINDOWS_ADAPTER=Intel` still ran the indirect Dispatch fixture on the first D3D12 device, my RTX 4060. This made it easy to report the same card twice when gathering the GPU-written count requested in #2626. The hardware fixture now matches a case-insensitive substring of the DXGI description using the stream tests' existing rule. Without a filter it enumerates devices in its original order. WARP uses its explicit software adapter. A selector longer than 127 characters or one that matches no eligible hardware exits 4 with a diagnostic. The indirect fixture and stream rasterizer exercise these failures through the same Python check. The count readback documented under `startup_indirect_count_hardware` can now be repeated per adapter. ## Verification Windows 11 build 26100.9711, fixture sources at `04b454c8`. I built both changed C++ entry points locally with Zig 0.13.0 (C++17, x86_64-windows-gnu, -O2) and linked the existing Windows runtime DLL built at `2e029857`. The D3D12 debug layer was unavailable. All three modes of `startup_indirect_dispatch <backend> [constants|count]` passed on each backend. All outputs below are fenced GPU readbacks. | Selected device | Driver | GPU count 2 | GPU count 9, maximum 3 | GPU count 0 | | --- | --- | --- | --- | --- | | NVIDIA GeForce RTX 4060, `gEfOrCe` | 32.0.15.9579 | 0x31415935 | 0x31415a64 | 0x31415926 | | Intel UHD Graphics 770, `uHd GrApHiCs 770` | 32.0.101.5973 | 0x31415935 | 0x31415a64 | 0x31415926 | | WARP, 128-character hardware selector set | 10.0.26100.9711 | 0x31415935 | 0x31415a64 | 0x31415926 | The default hardware run selected the RTX. With the old executable, the new failure check caught the first overlong selector returning 0. Both candidate executables reject overlong and unmatched selectors with exit 4. A 127-character unmatched name reaches the no-match diagnostic. I read the WARP count results in a terminal because its redirected stdout was empty on this local build. ```powershell python -B tests/hardware_adapter_filter_check.py $indirect hardware count python -B tests/startup_stream_rasterizer_check.py $rasterizer hardware filter python -B tests/startup_stream_rasterizer_check.py $rasterizer hardware python -B tests/startup_stream_rasterizer_check.py $rasterizer warp ``` The rasterizer's eight cull/winding images matched on both physical adapters and WARP. Fractional bias and both mixed rasterizer orders stayed clear. ## Evidence and follow-up The shaders and expected values come from the project's existing synthetic fixtures. The reported RX 5700 XT result still needs a second RDNA 1 comparison. [Standalone mixed-record and split-call measurements](https://github.com/R0Y00/Xbox2Windows/issues/2626#issuecomment-7178514351) Refs #2626. AI-assisted contribution using Codex (GPT-6.2 Astra, xhigh).
upstream-sync closed this pull request 2026-11-26 01:02:06 +00:00
tedin7 commented 2026-11-26 01:02:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:36:52Z.

Review: COMMENTED


Review of head 04b454c8 (test-only change: fixtures and CTest, no runtime code).

What I checked

  • The indirect Dispatch fixture now filters hardware adapters by XBOX2WINDOWS_ADAPTER through the new shared AdapterNameFilter, with the same rule the stream setup used (case-insensitive substring, 127-char limit, exit 4 with a diagnostic, exit 77 only when no filter is set and no hardware exists). Default enumeration order and the WARP path are unchanged.
  • startup_stream_setup.cpp and startup_stream_rasterizer_check.py were moved onto the shared helper with identical behavior (no duplicated logic left behind).
  • The new CTest startup_indirect_dispatch_adapter_filter reuses the same Python check as startup_stream_adapter_filter, so both fixtures guard the same two failures (overlong and unmatched selector). It needs no hardware, so it runs on WARP-only machines.
  • No other open or merged PR covers this slice.

Commands run

  • python3 tests/docs_links_check.py: ok
  • python3 tests/bidi_controls_check.py: ok
  • git diff --check origin/main...HEAD: clean
  • Win2025 (dev and release): the four related tests passed, see the receipt comment below.

Not verified

  • The GPU-count table for the two real adapters in the PR body comes from the author's own machine; I could not reproduce it (Win2025 has WARP only).

No blocking findings.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6066968461 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2652#pullrequestreview-6066968461). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:36:52Z. **Review:** COMMENTED --- Review of head 04b454c8 (test-only change: fixtures and CTest, no runtime code). What I checked - The indirect Dispatch fixture now filters hardware adapters by `XBOX2WINDOWS_ADAPTER` through the new shared `AdapterNameFilter`, with the same rule the stream setup used (case-insensitive substring, 127-char limit, exit 4 with a diagnostic, exit 77 only when no filter is set and no hardware exists). Default enumeration order and the WARP path are unchanged. - `startup_stream_setup.cpp` and `startup_stream_rasterizer_check.py` were moved onto the shared helper with identical behavior (no duplicated logic left behind). - The new CTest `startup_indirect_dispatch_adapter_filter` reuses the same Python check as `startup_stream_adapter_filter`, so both fixtures guard the same two failures (overlong and unmatched selector). It needs no hardware, so it runs on WARP-only machines. - No other open or merged PR covers this slice. Commands run - `python3 tests/docs_links_check.py`: ok - `python3 tests/bidi_controls_check.py`: ok - `git diff --check origin/main...HEAD`: clean - Win2025 (dev and release): the four related tests passed, see the receipt comment below. Not verified - The GPU-count table for the two real adapters in the PR body comes from the author's own machine; I could not reproduce it (Win2025 has WARP only). No blocking findings. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 01:02:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:36:53Z.


Win2025 WARP receipt for head 04b454c8.

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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target cpu_placed_provider startup_draw_depth_target startup_indirect_dispatch startup_slot57_depth startup_stream_consumer startup_stream_depth startup_stream_rasterizer startup_stream_setup_obj -- -j 2): 6.26s (configure 2.86s)
    • Test (ctest --preset dev -R 'adapter_filter|startup_indirect_count_warp|startup_stream_draw_warp' --parallel 2 --no-tests=error --output-on-failure): 4/4 passed (3.57s: startup_stream_adapter_filter 0.22s, startup_indirect_count_warp 0.15s, startup_indirect_dispatch_adapter_filter 0.19s, startup_stream_draw_warp 3.37s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target cpu_placed_provider startup_draw_depth_target startup_indirect_dispatch startup_slot57_depth startup_stream_consumer startup_stream_depth startup_stream_rasterizer startup_stream_setup_obj -- -j 2): 10.24s (configure 3.40s)
    • Test (ctest --preset release -R 'adapter_filter|startup_indirect_count_warp|startup_stream_draw_warp' --parallel 2 --no-tests=error --output-on-failure): 4/4 passed (3.55s: startup_indirect_count_warp 0.17s, startup_stream_adapter_filter 0.24s, startup_indirect_dispatch_adapter_filter 0.16s, startup_stream_draw_warp 3.33s)
  • sccache: 16/30 hits; wall 33.6s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7178938261 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2652#issuecomment-7178938261). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:36:53Z. --- Win2025 WARP receipt for head 04b454c8. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `04b454c804ff0296197af4adf06b23a7b11fdab0`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target cpu_placed_provider startup_draw_depth_target startup_indirect_dispatch startup_slot57_depth startup_stream_consumer startup_stream_depth startup_stream_rasterizer startup_stream_setup_obj -- -j 2`): `6.26s` (configure `2.86s`) - Test (`ctest --preset dev -R 'adapter_filter|startup_indirect_count_warp|startup_stream_draw_warp' --parallel 2 --no-tests=error --output-on-failure`): **4/4 passed** (`3.57s`: `startup_stream_adapter_filter` `0.22s`, `startup_indirect_count_warp` `0.15s`, `startup_indirect_dispatch_adapter_filter` `0.19s`, `startup_stream_draw_warp` `3.37s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target cpu_placed_provider startup_draw_depth_target startup_indirect_dispatch startup_slot57_depth startup_stream_consumer startup_stream_depth startup_stream_rasterizer startup_stream_setup_obj -- -j 2`): `10.24s` (configure `3.40s`) - Test (`ctest --preset release -R 'adapter_filter|startup_indirect_count_warp|startup_stream_draw_warp' --parallel 2 --no-tests=error --output-on-failure`): **4/4 passed** (`3.55s`: `startup_indirect_count_warp` `0.17s`, `startup_stream_adapter_filter` `0.24s`, `startup_indirect_dispatch_adapter_filter` `0.16s`, `startup_stream_draw_warp` `3.33s`) - `sccache`: 16/30 hits; wall `33.6s` 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!2644
No description provided.