test: respect LEONIDA_HOST_ADAPTER and layer LUID in d3d12_texture_tiles (RT-TEXTURE-TILES-HOST-ADAPTER) #1941

Merged
abnalstlll-byte merged 1 commit from upstream-pr/1941 into main 2026-11-25 19:20:31 +00:00
abnalstlll-byte commented 2026-11-25 16:19:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-25T16:19:56Z.


Item ID: RT-TEXTURE-TILES-HOST-ADAPTER (claimed in Issue #1608: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7167704003)

Addresses Finding #623 by @efeekrb (Issue #1608):
runtime/test/d3d12_texture_tiles_test.cpp:251 previously used an unguided native_device() adapter enumeration loop that completely ignored LEONIDA_HOST_ADAPTER and the layer's Vulkan device LUID. On dual-GPU systems (such as laptops with integrated Intel UHD and discrete NVIDIA RTX), the native D3D12 reference device defaulted to the iGPU and failed on Intel CopyTiles offset rounding quirks even when LEONIDA_HOST_ADAPTER was explicitly pointed to the NVIDIA GPU.

Changes

  1. Added <cctype> and <string> includes in runtime/test/d3d12_texture_tiles_test.cpp.
  2. Implemented tiled_device(IDXGIFactory4&, LUID, bool) and native_device(LUID layer_luid) matching the verified pattern in runtime/test/d3d12_buffer_tiles_test.cpp.
  3. Read LEONIDA_HOST_ADAPTER (case-insensitive substring match or "warp"). When unset, default to the adapter matching the layer Vulkan device LUID (vulkan->GetAdapterLuid()).
  4. If the selected adapter lacks Tier 2 tiled resources, cleanly skip the native reference comparison instead of falling back to the wrong hardware.
  5. In main(), ensure that when LEONIDA_HOST_ADAPTER is unset and the layer's adapter supports Tier 2 tiled resources, the native reference device runs on the exact same adapter.

Verification

  • Clean-room: zero retail binaries, game assets, or carved shaders.
  • Verified standalone syntax conformance under g++ -std=c++20 -fsyntax-only.
  • Verified python -I scripts/check_no_game_data.py runtime/test/d3d12_texture_tiles_test.cpp.
  • Verified python -I tests/test_text_write_line_endings.py.

AI-assisted (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5494963089 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1941). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-25T16:19:56Z. --- Item ID: `RT-TEXTURE-TILES-HOST-ADAPTER` (claimed in Issue #1608: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7167704003) Addresses Finding #623 by @efeekrb (Issue #1608): `runtime/test/d3d12_texture_tiles_test.cpp:251` previously used an unguided `native_device()` adapter enumeration loop that completely ignored `LEONIDA_HOST_ADAPTER` and the layer's Vulkan device LUID. On dual-GPU systems (such as laptops with integrated Intel UHD and discrete NVIDIA RTX), the native D3D12 reference device defaulted to the iGPU and failed on Intel CopyTiles offset rounding quirks even when `LEONIDA_HOST_ADAPTER` was explicitly pointed to the NVIDIA GPU. ### Changes 1. Added `<cctype>` and `<string>` includes in `runtime/test/d3d12_texture_tiles_test.cpp`. 2. Implemented `tiled_device(IDXGIFactory4&, LUID, bool)` and `native_device(LUID layer_luid)` matching the verified pattern in `runtime/test/d3d12_buffer_tiles_test.cpp`. 3. Read `LEONIDA_HOST_ADAPTER` (case-insensitive substring match or `"warp"`). When unset, default to the adapter matching the layer Vulkan device LUID (`vulkan->GetAdapterLuid()`). 4. If the selected adapter lacks Tier 2 tiled resources, cleanly skip the native reference comparison instead of falling back to the wrong hardware. 5. In `main()`, ensure that when `LEONIDA_HOST_ADAPTER` is unset and the layer's adapter supports Tier 2 tiled resources, the native reference device runs on the exact same adapter. ### Verification - Clean-room: zero retail binaries, game assets, or carved shaders. - Verified standalone syntax conformance under `g++ -std=c++20 -fsyntax-only`. - Verified `python -I scripts/check_no_game_data.py runtime/test/d3d12_texture_tiles_test.cpp`. - Verified `python -I tests/test_text_write_line_endings.py`. AI-assisted (Claude Code)
aslan2142 commented 2026-11-25 19:20:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-25T19:20:34Z.


Merged, thanks! It mirrors d3d12_buffer_tiles_test.cpp. Under Wine, d3d12_texture_tiles passes on a RADV iGPU and skips on llvmpipe, the same as on main; no test went from pass to fail.

  • Checked on main 6a2e9ea93 + ae74f89d1: it merges cleanly; the semantic suite passes (491 files, 6,312 tests, 0 files failed); the 15 docs and writer tests pass; check_no_game_data.py is clean on the 1 changed files.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7172162719 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1941#issuecomment-7172162719). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-25T19:20:34Z. --- Merged, thanks! It mirrors `d3d12_buffer_tiles_test.cpp`. Under Wine, `d3d12_texture_tiles` passes on a RADV iGPU and skips on llvmpipe, the same as on `main`; no test went from pass to fail. - **Checked on `main` `6a2e9ea93` + `ae74f89d1`:** it merges cleanly; the semantic suite passes (491 files, 6,312 tests, 0 files failed); the 15 docs and writer tests pass; `check_no_game_data.py` is clean on the 1 changed files. AI-assisted (Claude Code, Claude Opus 5.5).
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
ProjectLeonida/mandy!1941
No description provided.