tests: honor hardware adapter selection in native Compute replay #3155
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3155"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-27T18:59:44Z.
Change
Refs #3052 and its adapter-selection report.
native_store_replaycreated the default D3D12 device even when the caller requested a specific adapter viaXBOX2WINDOWS_ADAPTER. With the old runner,XBOX2WINDOWS_ADAPTER='no adapter has this name'still ran both packed-U8 cases and matched all 2,064 words in each case.Use the shared hardware selector for explicit filters and retain the default-device path when the variable is unset. An unmatched or overlong filter exits with code 2 before a shader runs. Report name, vendor/device IDs, driver version where available, and the LUID of the actual D3D12 device on stderr. Binding rows remain on stdout.
Verification
Tested
1330c2530d16d5527606b3cb9bf93b85d36b0396based on88cddb0919fd4044ff45211c0919c3aefda73c35. Windows 1126300.10075, Visual Studio 2026 18.12.1, Windows SDK 10.0.26100.0, RTX 4070 driver32.0.16.2124, and WARP for the sampled Pixel regression. Native compute replay used its normal configuration without the debug layer.Evidence and follow-up
The tests use source-built shaders and synthetic adapter filters. The experiment note gives the output contract and reproduction. Selection between multiple physical GPUs was not available on this test machine.
I used Codex to prepare the change and ran verification locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T20:36:19Z.
Review: COMMENTED
Review of
d78b3871f2(updated with main). Comment only.native_store_replaynow goes through the sharedcreate_deviceselector whenXBOX2WINDOWS_ADAPTERis set, returns 2 with a diagnostic when no adapter matches (instead of silently using the default device), keeps the old default-device path and its exit 77 when the variable is unset, and prints the adapter it actually used.xmem_test_device.honly gains adiagnosticsstream parameter that defaults tostdout, so its existing callers print the same as before. The newnative_store_replay_adapter_controlstest checks both refusals (unmatched and over-long filter) and that nothing is written, and it runs without a GPU.tests/native_store_replay.cppis also changed on thecpp-migrationbranch; this merges cleanly there, and the native sweep on that merge is in the comment below.Windows results are in the comment below.
Commands:
git diff origin/main...pull/3155/head(read),git merge-tree --write-tree origin/cpp-migration pull/3155/head, plus the Windows commands listed in the comment.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T20:36:20Z.
Windows Server 2025 verification of
d78b3871f23b862ee3bb79616131d917253d583e(D3D12 WARP, MSVC 14.44.35207):cmake --build --preset dev --target compile_dxil native_store_replayplus the 15 device-check targets that includetests/xmem_test_device.h;ctest --preset dev -R <native sweep>|^(linear_buffer_backing|startup_committed|startup_null_views|startup_plane_size|startup_small_texture_4k|startup_title_heap|startup_view_heap|unified_buffer_paths|vm_copy_queue|vm_translation|xmem_|cpu_placed_dxr): 100% tests passed out of 283 (221 passed, 62 hardware or capability skips), includingnative_store_replay_adapter_controls--preset release: 100% tests passed out of 283 (221 passed, 62 skipped)cpp-migration(a0f67731), dev and release: 100% tests passed out of 134 in both presets<native sweep>= everynative_*test exceptnative_startup_request_cache_hardware, which fails on WARP-only hosts with or without this PR.AI-assisted; commands listed were executed locally.