d3d12_root_args_validation: a hardware driver that removes its device does not fail the test (TEST-ROOT-ARGS-HW-DEVICE-REMOVED) #1165

Closed
MalexAson wants to merge 1 commit from upstream-pr/1165 into main
MalexAson commented 2026-11-24 19:30:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MalexAson on 2026-11-24T19:30:01Z.


Claimed in the coordination issue as: TEST-ROOT-ARGS-HW-DEVICE-REMOVED

What and why

d3d12_root_args_validation runs its table on the layer, on WARP and on the first hardware D3D12 adapter. Where that adapter is an Intel Iris Xe (Intel 32.0.101.7092) the hardware pass fails, with the layer on any GPU:

line 194: SUCCEEDED(env.device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_BUNDLE, IID_PPV_ARGS(&balloc.p)))
line 500: run_case(env, table[j], true, hw_hr[j])

The cause is two cases earlier. On direct: SetGraphicsRoot32BitConstants(0, 0, nullptr, 0) the Intel driver's Close() returns DXGI_ERROR_DEVICE_REMOVED (0x887a0005) and the device's removed reason becomes DXGI_ERROR_DRIVER_INTERNAL_ERROR (0x887a0020). The next case is the compute form, which is run_on_hw = false already (the NVIDIA driver crashes on it), and the one after it cannot create an allocator on the removed device. The same driver also removes its device on the two bundle forms.

This is the situation run_on_hw = false was written for, a hardware UMD failing on a call WARP and the layer accept, but which cases do it depends on the driver. So the hardware pass now checks GetDeviceRemovedReason() after each case. A case that removed the device is printed, counted as not run on hardware (the table shows skip(umd), as for run_on_hw = false), and the remaining cases run on a new device, created after every reference to the removed one is released. A case that fails with its device still alive fails the test as before.

Tested

Windows 11 24H2 (26100.6584), MSVC 19.50 + Ninja RelWithDebInfo, main 6293c1c4f. The first hardware adapter is the Iris Xe (8086:a7a0).

layer (LEONIDA_VK_DEVICE) main this branch
Intel Iris Xe fails at line 194 pass: 29 parity cases, 25 compared on hardware, 4 skip(umd), 0 failures, 0 validation errors
RTX 4060 Laptop GPU (NVIDIA 616.92) fails at line 194 pass, the same counts

With the change the test prints, for the Intel host:

direct: SetGraphicsRoot32BitConstants(0, 0, nullptr, 0): the hardware driver removed its device (0x887a0020); not compared on hardware
bundle: SetGraphicsRoot32BitConstants(0, 0, nullptr, 0): the hardware driver removed its device (0x887a0020); not compared on hardware
bundle: SetComputeRoot32BitConstants(0, 0, nullptr, 0): the hardware driver removed its device (0x887a0020); not compared on hardware

Not tested: a machine whose first hardware adapter keeps its device through every case. That path is the old one, REQUIRE(ran) after each case.

tests/test_ctest_registration.py and tests/test_text_write_line_endings.py: OK. scripts/check_no_game_data.py on the changed file: clean.

GPUs tested: Intel Iris Xe (8086:a7a0), Intel 32.0.101.7092, and NVIDIA GeForce RTX 4060 Laptop GPU, NVIDIA 616.92, Windows 11

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (no translator rule)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5478910894 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1165). Originally posted by [MalexAson](https://github.com/MalexAson) on 2026-11-24T19:30:01Z. --- Claimed in the coordination issue as: TEST-ROOT-ARGS-HW-DEVICE-REMOVED ### What and why `d3d12_root_args_validation` runs its table on the layer, on WARP and on the first hardware D3D12 adapter. Where that adapter is an Intel Iris Xe (Intel 32.0.101.7092) the hardware pass fails, with the layer on any GPU: line 194: SUCCEEDED(env.device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_BUNDLE, IID_PPV_ARGS(&balloc.p))) line 500: run_case(env, table[j], true, hw_hr[j]) The cause is two cases earlier. On `direct: SetGraphicsRoot32BitConstants(0, 0, nullptr, 0)` the Intel driver's `Close()` returns `DXGI_ERROR_DEVICE_REMOVED` (0x887a0005) and the device's removed reason becomes `DXGI_ERROR_DRIVER_INTERNAL_ERROR` (0x887a0020). The next case is the compute form, which is `run_on_hw = false` already (the NVIDIA driver crashes on it), and the one after it cannot create an allocator on the removed device. The same driver also removes its device on the two bundle forms. This is the situation `run_on_hw = false` was written for, a hardware UMD failing on a call WARP and the layer accept, but which cases do it depends on the driver. So the hardware pass now checks `GetDeviceRemovedReason()` after each case. A case that removed the device is printed, counted as not run on hardware (the table shows `skip(umd)`, as for `run_on_hw = false`), and the remaining cases run on a new device, created after every reference to the removed one is released. A case that fails with its device still alive fails the test as before. ### Tested Windows 11 24H2 (26100.6584), MSVC 19.50 + Ninja RelWithDebInfo, `main` 6293c1c4f. The first hardware adapter is the Iris Xe (8086:a7a0). | layer (`LEONIDA_VK_DEVICE`) | `main` | this branch | |---|---|---| | Intel Iris Xe | fails at line 194 | pass: 29 parity cases, 25 compared on hardware, 4 `skip(umd)`, 0 failures, 0 validation errors | | RTX 4060 Laptop GPU (NVIDIA 616.92) | fails at line 194 | pass, the same counts | With the change the test prints, for the Intel host: direct: SetGraphicsRoot32BitConstants(0, 0, nullptr, 0): the hardware driver removed its device (0x887a0020); not compared on hardware bundle: SetGraphicsRoot32BitConstants(0, 0, nullptr, 0): the hardware driver removed its device (0x887a0020); not compared on hardware bundle: SetComputeRoot32BitConstants(0, 0, nullptr, 0): the hardware driver removed its device (0x887a0020); not compared on hardware Not tested: a machine whose first hardware adapter keeps its device through every case. That path is the old one, `REQUIRE(ran)` after each case. `tests/test_ctest_registration.py` and `tests/test_text_write_line_endings.py`: OK. `scripts/check_no_game_data.py` on the changed file: clean. GPUs tested: Intel Iris Xe (8086:a7a0), Intel 32.0.101.7092, and NVIDIA GeForce RTX 4060 Laptop GPU, NVIDIA 616.92, Windows 11 AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (no translator rule) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
abnalstlll-byte commented 2026-11-24 19:32:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T19:32:39Z.

Review: APPROVED


Reviewed and verified. Handles hardware UMD device removals (DXGI_ERROR_DEVICE_REMOVED) gracefully in runtime/test/d3d12_root_args_validation.cpp by recording problematic edge cases as skip(umd) and recreating the test device for subsequent cases rather than failing the entire test suite on host drivers like Intel Iris Xe. 100% clean-room.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045986912 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1165#pullrequestreview-6045986912). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T19:32:39Z. **Review:** APPROVED --- Reviewed and verified. Handles hardware UMD device removals (`DXGI_ERROR_DEVICE_REMOVED`) gracefully in `runtime/test/d3d12_root_args_validation.cpp` by recording problematic edge cases as `skip(umd)` and recreating the test device for subsequent cases rather than failing the entire test suite on host drivers like Intel Iris Xe. 100% clean-room.
madhyn commented 2026-11-24 19:35:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by madhyn on 2026-11-24T19:35:05Z.


Tested 48319c707 on Arch Linux + Wine 11.22 + NVIDIA RTX 3060 Ti (595.58.03 / Vulkan):

  • ctest --test-dir runtime/build/win -R "^d3d12_root_args_validation$" --output-on-failure: Passed (5.48 s)

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7142306552 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1165#issuecomment-7142306552). Originally posted by [madhyn](https://github.com/madhyn) on 2026-11-24T19:35:05Z. --- Tested `48319c707` on Arch Linux + Wine 11.22 + NVIDIA RTX 3060 Ti (595.58.03 / Vulkan): - `ctest --test-dir runtime/build/win -R "^d3d12_root_args_validation$" --output-on-failure`: **Passed** (5.48 s) AI-assisted: yes
Deedlyy commented 2026-11-24 20:11:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:11:21Z.


Recommendation: [MERGE]

Reasoning: d3d12_root_args_validation no longer fails when a hardware reference driver (seen on Intel Iris Xe) removes its device on an invalid case; the hardware comparison is skipped from that point. Test-only change. Verified on Wine by madhyn. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 2/10

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143165380 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1165#issuecomment-7143165380). Originally posted by [Deedlyy](https://github.com/Deedlyy) on 2026-11-24T20:11:21Z. --- **Recommendation:** [MERGE] **Reasoning:** `d3d12_root_args_validation` no longer fails when a hardware reference driver (seen on Intel Iris Xe) removes its device on an invalid case; the hardware comparison is skipped from that point. Test-only change. Verified on Wine by madhyn. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 2/10
potatoe0100 commented 2026-11-25 10:07:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by potatoe0100 on 2026-11-25T10:07:08Z.


Tested 48319c707 merged onto main 57ba40bd6 (clean), native Windows 11 Pro 26H2 (build 26300), NVIDIA GeForce RTX 4060, driver 621.14, VS 2022 RelWithDebInfo + Ninja.

  • d3d12_root_args_validation: passes on main and with this PR, also with LEONIDA_VK_VALIDATION=1: "29 parity cases (WARP=live, HW=NVIDIA GeForce RTX 4060), layer-only checks ok, 0 validation errors, 0 failures". The NVIDIA driver removes no device here, so only the existing skip(umd) compute case is skipped; the new path is not exercised on this GPU but changes nothing either.

AI-assisted testing (non-developer tester).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7159249966 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1165#issuecomment-7159249966). Originally posted by [potatoe0100](https://github.com/potatoe0100) on 2026-11-25T10:07:08Z. --- Tested `48319c707` merged onto `main` `57ba40bd6` (clean), native Windows 11 Pro 26H2 (build 26300), NVIDIA GeForce RTX 4060, driver 621.14, VS 2022 RelWithDebInfo + Ninja. - `d3d12_root_args_validation`: passes on `main` and with this PR, also with `LEONIDA_VK_VALIDATION=1`: "29 parity cases (WARP=live, HW=NVIDIA GeForce RTX 4060), layer-only checks ok, 0 validation errors, 0 failures". The NVIDIA driver removes no device here, so only the existing `skip(umd)` compute case is skipped; the new path is not exercised on this GPU but changes nothing either. AI-assisted testing (non-developer tester).
efeekrb commented 2026-11-25 16:35:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by efeekrb on 2026-11-25T16:35:07Z.


Tested on a two-GPU Windows laptop: the layer on an NVIDIA GeForce RTX 4060 Laptop GPU (NVIDIA 610.78), Windows 11 build 26300, with an Intel UHD Graphics iGPU (Windows driver 31.0.101.4255) also present, which is where the test's hardware pass lands. main at 24a29f8, RelWithDebInfo, LEONIDA_VK_DEVICE=4060. This PR's one-file diff applied cleanly, and only d3d12_root_args_validation_test was rebuilt.

  • main: d3d12_root_args_validation fails 3 of 3 runs, at line 194 (CreateCommandAllocator for a bundle), reached from line 500.
  • With this PR: passes 3 of 3 (exit 0). The output shows the cases the hardware pass now sets aside: direct: SetGraphicsRoot32BitConstants(0, 0, nullptr, 0): the hardware driver removed its device (0x887a0020); not compared on hardware, and the same for the bundle graphics and bundle compute forms. The remaining closed: cases compare equal on layer, WARP and the Intel UHD.

So the removed-device pattern from the Iris Xe in the description also happens on an Intel UHD Graphics, with the layer on an NVIDIA GPU. No game files; counts and pass/fail lines only. AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7168214415 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1165#issuecomment-7168214415). Originally posted by [efeekrb](https://github.com/efeekrb) on 2026-11-25T16:35:07Z. --- Tested on a two-GPU Windows laptop: the layer on an NVIDIA GeForce RTX 4060 Laptop GPU (NVIDIA 610.78), Windows 11 build 26300, with an Intel UHD Graphics iGPU (Windows driver 31.0.101.4255) also present, which is where the test's hardware pass lands. `main` at `24a29f8`, RelWithDebInfo, `LEONIDA_VK_DEVICE=4060`. This PR's one-file diff applied cleanly, and only `d3d12_root_args_validation_test` was rebuilt. - `main`: `d3d12_root_args_validation` fails 3 of 3 runs, at line 194 (`CreateCommandAllocator` for a bundle), reached from line 500. - With this PR: passes 3 of 3 (exit 0). The output shows the cases the hardware pass now sets aside: `direct: SetGraphicsRoot32BitConstants(0, 0, nullptr, 0): the hardware driver removed its device (0x887a0020); not compared on hardware`, and the same for the bundle graphics and bundle compute forms. The remaining `closed:` cases compare equal on layer, WARP and the Intel UHD. So the removed-device pattern from the Iris Xe in the description also happens on an Intel UHD Graphics, with the layer on an NVIDIA GPU. No game files; counts and pass/fail lines only. AI-assisted (Claude Code).
OreoFR commented 2026-11-28 21:47:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:47:03Z.


Verified by OreoFR

  • Base: main c1ecf04ed + PR head 48319c707; green run in a merge package of 12 PRs, no new ctest failure vs main
  • Test: ctest -R ^d3d12_root_args_validation$
  • Red on main: OK
  • Green with the PR: OK
  • Verdict: NO RED (test-only PR; the NVIDIA driver does not remove the device here, the Intel driver case is not exercised)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246269078 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1165#issuecomment-7246269078). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:47:03Z. --- **Verified by OreoFR** - Base: main `c1ecf04ed` + PR head `48319c707`; green run in a merge package of 12 PRs, no new ctest failure vs main - Test: `ctest -R ^d3d12_root_args_validation$` - Red on main: OK - Green with the PR: OK - Verdict: NO RED (test-only PR; the NVIDIA driver does not remove the device here, the Intel driver case is not exercised) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-29 01:25:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:25:53Z.


Windows 11 + MSVC 19.44 + RTX 3090 Verification — PASS (48319c7072)

Verified 48319c7072 (TEST-ROOT-ARGS-HW-DEVICE-REMOVED) merged onto origin/main (5825b02ff8 / 53b77df14f, 0 conflicts) on native Windows 11 (10.0.26200.9974) with MSVC 19.44.35228, NVIDIA GeForce RTX 3090, WARP, and VK_LAYER_KHRONOS_validation 1.4.363.1.

Checks Run

  • Native d3d12_root_args_validation_test.exe on NVIDIA GeForce RTX 3090 + WARP + Leonida Vulkan D3D12 shim:
    • Compiled cleanly (/std:c++20 /O2 /MD /EHsc /W4 /permissive- /utf-8, 0 warnings in d3d12_root_args_validation_test.cpp) and passed (rc=0, 0 VUID- / validation errors).
  • Red -> Green live ID3D12Device5::RemoveDevice() mid-table recovery test on Windows 11 D3D12 (RTX 3090):
    • Injected ID3D12Device5::RemoveDevice() on case index 3 of the hardware D3D12 loop (GetDeviceRemovedReason() == 0x887a0005 DXGI_ERROR_DEVICE_REMOVED):
      • Red (origin/main): aborted immediately (rc=1 at REQUIRE(ran)).
      • Green (#1165 + origin/main): logged "closed: SetComputeRoot32BitConstant: the hardware driver removed its device (0x887a0005); not compared on hardware", released all COM references held by env and hw_dev so D3D12CreateDevice created a fresh non-removed ID3D12Device (GetDeviceRemovedReason() == S_OK), and completed all remaining hardware/WARP/shim parity checks (rc=0, 0 VUID- errors).

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248777544 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1165#issuecomment-7248777544). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T01:25:53Z. --- ## Windows 11 + MSVC `19.44` + RTX 3090 Verification — PASS (`48319c7072`) Verified `48319c7072` (`TEST-ROOT-ARGS-HW-DEVICE-REMOVED`) merged onto `origin/main` (`5825b02ff8` / `53b77df14f`, `0` conflicts) on native Windows 11 (`10.0.26200.9974`) with MSVC `19.44.35228`, **NVIDIA GeForce RTX 3090**, WARP, and `VK_LAYER_KHRONOS_validation` `1.4.363.1`. ### Checks Run - **Native `d3d12_root_args_validation_test.exe` on NVIDIA GeForce RTX 3090 + WARP + Leonida Vulkan D3D12 shim**: - Compiled cleanly (`/std:c++20 /O2 /MD /EHsc /W4 /permissive- /utf-8`, `0` warnings in `d3d12_root_args_validation_test.cpp`) and passed (`rc=0`, `0` `VUID-` / validation errors). - **Red -> Green live `ID3D12Device5::RemoveDevice()` mid-table recovery test on Windows 11 D3D12 (`RTX 3090`)**: - Injected `ID3D12Device5::RemoveDevice()` on case index `3` of the hardware D3D12 loop (`GetDeviceRemovedReason() == 0x887a0005` `DXGI_ERROR_DEVICE_REMOVED`): - **Red (`origin/main`)**: aborted immediately (`rc=1` at `REQUIRE(ran)`). - **Green (`#1165 + origin/main`)**: logged `"closed: SetComputeRoot32BitConstant: the hardware driver removed its device (0x887a0005); not compared on hardware"`, released all COM references held by `env` and `hw_dev` so `D3D12CreateDevice` created a fresh non-removed `ID3D12Device` (`GetDeviceRemovedReason() == S_OK`), and completed all remaining hardware/WARP/shim parity checks (`rc=0`, `0` `VUID-` errors). AI-assisted.
aslan2142 commented 2026-12-01 16:33:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:33:36Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7317807229 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1165#issuecomment-7317807229). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:33:36Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

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!1165
No description provided.