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

Open
github-bot wants to merge 1 commit from github-bot/gh-1165 into main AGit
Owner

@⁠MalexAson on GitHub · 2026-11-24 19:30 UTC · original
MalexAson:fix/root-args-hw-device-removed → main · +28 −3 · 1 files · 1 commits · open

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

**@⁠MalexAson** on GitHub · 2026-11-24 19:30 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1165) `MalexAson:fix/root-args-hw-device-removed` → `main` · +28 −3 · 1 files · 1 commits · open 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)
Intel's D3D12 driver (Iris Xe, 32.0.101.7092) removes its device on SetGraphicsRoot32BitConstants(0, 0, nullptr, 0)
in a direct list and in a bundle, and on the compute form in a bundle (DXGI_ERROR_DRIVER_INTERNAL_ERROR). The
hardware pass then failed at the next CreateCommandAllocator, whatever GPU the layer ran on. Such a case is now
printed and not compared on hardware, as the run_on_hw = false one is, and the cases after it run on a new device.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:41:01 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 19:32 UTC · original · approved these changes

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.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 19:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1165#pullrequestreview-6045986912) · **approved these changes** 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.
Author
Owner

@⁠madhyn on GitHub · 2026-11-24 19:35 UTC · original

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

**@⁠madhyn** on GitHub · 2026-11-24 19:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1165#issuecomment-7142306552) 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
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:11 UTC · original

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

**@⁠Deedlyy** on GitHub · 2026-11-24 20:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1165#issuecomment-7143165380) **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
Author
Owner

@⁠potatoe0100 on GitHub · 2026-11-25 10:07 UTC · original

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).

**@⁠potatoe0100** on GitHub · 2026-11-25 10:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1165#issuecomment-7159249966) 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).
Author
Owner

@⁠efeekrb on GitHub · 2026-11-25 16:35 UTC · original

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).

**@⁠efeekrb** on GitHub · 2026-11-25 16:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1165#issuecomment-7168214415) 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).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1165/head:github-bot/gh-1165'
git switch 'github-bot/gh-1165'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1165'
git switch 'github-bot/gh-1165'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1165'
git switch 'github-bot/gh-1165'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1165'
git switch 'main'
git merge --squash 'github-bot/gh-1165'
git switch 'main'
git merge --ff-only 'github-bot/gh-1165'
git switch 'main'
git merge 'github-bot/gh-1165'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.