D3D12.X: DRED's VA 0 output follows the device state it comes with #3119

Open
Raul-Paiva wants to merge 1 commit from upstream-pr/3119 into main
Raul-Paiva commented 2026-11-28 11:39:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Raul-Paiva on 2026-11-28T11:39:50Z.


On a device removal, log_device_removed logged DRED's page-fault output as a fault unconditionally. When the output is VA 0 with no allocation named, the log said DRED page fault at GPU VA 0x0; allocations there: []; recently freed: [], which reads as a real fault at VA 0; logs of this shape were discussed as VA 0 faults in #2920 and #3052. DRED gives that output when it recorded no fault, but the allocation lists can be empty for a real fault too. The DRED device state read just before tells the two apart, so the log now follows it. With XCL_DRED=pagefault the breadcrumbs are never switched on, yet the log said no breadcrumbs (no list was in flight).

Log changes (wording only, no behaviour change):

  • VA 0 with no existing and no recently freed allocation:
    • device state 7 (PAGEFAULT): a page fault happened, logged as a fault at VA 0x0 as before (the null-address faults of #2920);
    • another known state (3 hung, 6 fault): DRED page-fault output: VA 0x0, no allocations named (no page fault: the device state is another removal);
    • state 0 (UNKNOWN) or no state: DRED page-fault output: VA 0x0, no allocations named (no fault recorded, or a fault DRED could not place).
      Any other address, or a fault that names an allocation, is logged as before.
  • Device state 0 is UNKNOWN and is logged as DRED device state: 0 (unknown); nothing infers from it whether the GPU's work faulted.
  • A failed GetPageFaultAllocationOutput logs its HRESULT when XCL switched the page-fault output on: DRED page-fault output not available (<hr>). Without XCL_DRED: DRED: no page-fault output (not switched on; XCL_DRED=1 or XCL_DRED=pagefault does).
  • Breadcrumbs not switched on: DRED: no breadcrumbs (not switched on; XCL_DRED=1 does). Switched on and no node returned: DRED: no breadcrumbs (empty output).

Review points from Prime1997 (state 0 unknown, the query's error, VA 0 kept ambiguous, "empty output") and Foniass (the device state decides VA 0, the output not switched on, tests of the wording) are in the single commit.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: dred_unplaced_page_fault (the line for VA 0 with no allocation named, by device state), dred_page_fault_missing and dred_breadcrumbs_missing (the lines for an output DRED did not give, switched on or not), pure helpers; their tests dred_output_at_va_0_with_no_allocations_follows_the_device_state and missing_dred_output_says_whether_it_was_switched_on in dred_tests; the log lines in log_device_removed.
  • crates/xcl/src/gpu/agility.rs: dred_switched_on, what enable_dred_once switched on (nothing, the page faults, or the breadcrumbs too); its test dred_outputs_are_on_only_when_the_settings_took.

Tested

  • Hardware: RTX 3070 Laptop GPU 8 GB, driver 621.40, i7-11800H, 32 GB, Windows 10 19045, rustc 1.100.0, release build.
  • Base for the comparison: main 5b0d5fa3 (same commands, same machine). The head pushed here is this change, with the review fixes of 12-01, rebased onto main b2b1f109 without conflicts; main's newer commits also change real.rs, which the rebase merged. The full-suite counts below were measured before those fixes and that rebase.
  • At this head efb87906 (with the review fixes, on main b2b1f109), the lib tests of the modules this PR touches (gpu::agility, hle::d3d12x::real), release, serial, with the 20 skips: 185 passed, 0 failed, 0 ignored, the three new tests among them.
  • cargo test --release --workspace --no-fail-fast -- --test-threads=4: the lib test binary ends early on main too (exit 0x80004005 after sparse upload preparation still failed after bounded retries), so the lib was also run alone, serially (--test-threads=1), with --skip for the 20 tests that end the binary on main (6 list_x, 12 sparse, 1 texture_upload, 1 uma_driver; each passes alone).
  • This PR tested at 436dff78 (on main 5b0d5fa3):
    • integration tests (all binaries but the lib): 139 passed, 0 failed, 20 ignored; main: the same.
    • lib, serial with the 20 skips: 2603 passed, 15 failed, 29 ignored; main: 2604 passed, 13 failed, 29 ignored.
    • The test of the first version, dred_output_at_va_0_with_no_allocations_is_ambiguous (now ..._follows_the_device_state), passes. The 13 failures of main fail here too (12 title_textures, 1 vram::d32s8_targets_take_their_own_size_of_video_memory).
    • The 2 failures only in this run, alloc_pool::tests::a_reset_that_puts_the_allocator_aside_keeps_what_the_gpu_still_reads and vram::tests::superseded_texture_waits_for_every_title_queue, pass alone 3/3 on this head and on main, and their whole modules pass serially 2/2 here; they wait on GPU fences and fail only late in the long run. They do not reach the code this PR changes.
  • SKIPPED on this adapter (same on main): the wave64 forms (no wave64), three f16/f32 per-lane forms refused by the recompiler, and the heap-window tests (no heap windows).

Regression run
scripts/smoke.ps1 -Seconds 120 -Title 'retail title A', release builds of clean trees, one after the other on the machine in Tested, with XCL_DEVICE_TYPE=lockhart XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_WATCH_HOT=0 XCL_DRED=1 XCL_GPU_WAIT_TIMEOUT_MS=60000. The title is left on its own, with no input; the shader cache was warmed by two runs of main before.

main:

xcl-smoke v1
commit: b2b1f109d27e746a62ec95b04dd1f9924452e682
gpu: NVIDIA GeForce RTX 3070 Laptop GPU
title: retail title A
seconds: 120
exit: 0x0
frames shown: 3358 (PresentX 3358)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 15865 MB

This PR:

xcl-smoke v1
commit: efb879063f590a6c8725486bda8264d45a09c577
gpu: NVIDIA GeForce RTX 3070 Laptop GPU
title: retail title A
seconds: 120
exit: 0x0
frames shown: 3366 (PresentX 3366)
presents per 2 s (last 3): 61 60 61
device removals: 0
crashes: 0
peak commit: 16918 MB

Not tested

  • A device removal with the new wording: no removal happened in these runs.
  • A removal with the breadcrumbs on.
  • AMD and Intel GPUs.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change, the test and this description, and ran the tests; I read the diff.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5539737597 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3119). Originally posted by [Raul-Paiva](https://github.com/Raul-Paiva) on 2026-11-28T11:39:50Z. --- On a device removal, `log_device_removed` logged DRED's page-fault output as a fault unconditionally. When the output is VA 0 with no allocation named, the log said `DRED page fault at GPU VA 0x0; allocations there: []; recently freed: []`, which reads as a real fault at VA 0; logs of this shape were discussed as VA 0 faults in #2920 and #3052. DRED gives that output when it recorded no fault, but the allocation lists can be empty for a real fault too. The DRED device state read just before tells the two apart, so the log now follows it. With `XCL_DRED=pagefault` the breadcrumbs are never switched on, yet the log said `no breadcrumbs (no list was in flight)`. Log changes (wording only, no behaviour change): - VA 0 with no existing and no recently freed allocation: - device state 7 (PAGEFAULT): a page fault happened, logged as a fault at VA 0x0 as before (the null-address faults of #2920); - another known state (3 hung, 6 fault): `DRED page-fault output: VA 0x0, no allocations named (no page fault: the device state is another removal)`; - state 0 (UNKNOWN) or no state: `DRED page-fault output: VA 0x0, no allocations named (no fault recorded, or a fault DRED could not place)`. Any other address, or a fault that names an allocation, is logged as before. - Device state 0 is `UNKNOWN` and is logged as `DRED device state: 0 (unknown)`; nothing infers from it whether the GPU's work faulted. - A failed `GetPageFaultAllocationOutput` logs its HRESULT when XCL switched the page-fault output on: `DRED page-fault output not available (<hr>)`. Without `XCL_DRED`: `DRED: no page-fault output (not switched on; XCL_DRED=1 or XCL_DRED=pagefault does)`. - Breadcrumbs not switched on: `DRED: no breadcrumbs (not switched on; XCL_DRED=1 does)`. Switched on and no node returned: `DRED: no breadcrumbs (empty output)`. Review points from Prime1997 (state 0 unknown, the query's error, VA 0 kept ambiguous, "empty output") and Foniass (the device state decides VA 0, the output not switched on, tests of the wording) are in the single commit. **What is in it** - `crates/xcl/src/hle/d3d12x/real.rs`: `dred_unplaced_page_fault` (the line for VA 0 with no allocation named, by device state), `dred_page_fault_missing` and `dred_breadcrumbs_missing` (the lines for an output DRED did not give, switched on or not), pure helpers; their tests `dred_output_at_va_0_with_no_allocations_follows_the_device_state` and `missing_dred_output_says_whether_it_was_switched_on` in `dred_tests`; the log lines in `log_device_removed`. - `crates/xcl/src/gpu/agility.rs`: `dred_switched_on`, what `enable_dred_once` switched on (nothing, the page faults, or the breadcrumbs too); its test `dred_outputs_are_on_only_when_the_settings_took`. **Tested** - Hardware: RTX 3070 Laptop GPU 8 GB, driver 621.40, i7-11800H, 32 GB, Windows 10 19045, rustc 1.100.0, release build. - Base for the comparison: `main` 5b0d5fa3 (same commands, same machine). The head pushed here is this change, with the review fixes of 12-01, rebased onto `main` b2b1f109 without conflicts; `main`'s newer commits also change `real.rs`, which the rebase merged. The full-suite counts below were measured before those fixes and that rebase. - At this head efb87906 (with the review fixes, on `main` b2b1f109), the lib tests of the modules this PR touches (`gpu::agility`, `hle::d3d12x::real`), release, serial, with the 20 skips: 185 passed, 0 failed, 0 ignored, the three new tests among them. - `cargo test --release --workspace --no-fail-fast -- --test-threads=4`: the lib test binary ends early on `main` too (exit 0x80004005 after `sparse upload preparation still failed after bounded retries`), so the lib was also run alone, serially (`--test-threads=1`), with `--skip` for the 20 tests that end the binary on `main` (6 `list_x`, 12 `sparse`, 1 `texture_upload`, 1 `uma_driver`; each passes alone). - This PR tested at 436dff78 (on `main` 5b0d5fa3): - integration tests (all binaries but the lib): 139 passed, 0 failed, 20 ignored; `main`: the same. - lib, serial with the 20 skips: 2603 passed, 15 failed, 29 ignored; `main`: 2604 passed, 13 failed, 29 ignored. - The test of the first version, `dred_output_at_va_0_with_no_allocations_is_ambiguous` (now `..._follows_the_device_state`), passes. The 13 failures of `main` fail here too (12 `title_textures`, 1 `vram::d32s8_targets_take_their_own_size_of_video_memory`). - The 2 failures only in this run, `alloc_pool::tests::a_reset_that_puts_the_allocator_aside_keeps_what_the_gpu_still_reads` and `vram::tests::superseded_texture_waits_for_every_title_queue`, pass alone 3/3 on this head and on `main`, and their whole modules pass serially 2/2 here; they wait on GPU fences and fail only late in the long run. They do not reach the code this PR changes. - SKIPPED on this adapter (same on `main`): the wave64 forms (no wave64), three f16/f32 per-lane forms refused by the recompiler, and the heap-window tests (no heap windows). **Regression run** `scripts/smoke.ps1 -Seconds 120 -Title 'retail title A'`, release builds of clean trees, one after the other on the machine in **Tested**, with `XCL_DEVICE_TYPE=lockhart XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_WATCH_HOT=0 XCL_DRED=1 XCL_GPU_WAIT_TIMEOUT_MS=60000`. The title is left on its own, with no input; the shader cache was warmed by two runs of `main` before. `main`: ``` xcl-smoke v1 commit: b2b1f109d27e746a62ec95b04dd1f9924452e682 gpu: NVIDIA GeForce RTX 3070 Laptop GPU title: retail title A seconds: 120 exit: 0x0 frames shown: 3358 (PresentX 3358) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 15865 MB ``` This PR: ``` xcl-smoke v1 commit: efb879063f590a6c8725486bda8264d45a09c577 gpu: NVIDIA GeForce RTX 3070 Laptop GPU title: retail title A seconds: 120 exit: 0x0 frames shown: 3366 (PresentX 3366) presents per 2 s (last 3): 61 60 61 device removals: 0 crashes: 0 peak commit: 16918 MB ``` **Not tested** - A device removal with the new wording: no removal happened in these runs. - A removal with the breadcrumbs on. - AMD and Intel GPUs. **AI use** - Claude Code (Claude Opus 5.5) wrote the change, the test and this description, and ran the tests; I read the diff. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Prime1997 commented 2026-11-28 11:53:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T11:53:54Z.


Source review of 284d1401f2061c16f1f5e93f0b9a3bbd4064eac4: this partially overlaps our local diagnostics correction, so I’m bringing the remaining points here rather than opening another diagnostics PR.

  • DRED state 0 is UNKNOWN; it does not establish that GPU work caused no fault. The PR description and dred_recorded_fault comment currently make that inference. Microsoft enum reference.
  • A failed GetPageFaultAllocationOutput call is currently silent. Its HRESULT should be logged: Microsoft documents DXGI_ERROR_UNSUPPORTED when page-fault reporting was not enabled, and DXGI_ERROR_NOT_CURRENTLY_AVAILABLE when the device is not removed. Missing output is not a negative fault finding. Microsoft method reference.
  • VA 0 plus empty allocation lists is ambiguous. The lists describe matching active/recent allocations and may be empty; the documented contract does not require a real VA-zero fault to identify an allocation. Please preserve that uncertainty in the new helper/test and wording, especially when device state is unknown. Microsoft output structure.
  • Distinguishing explicitly disabled breadcrumbs is useful. The enabled-but-empty branch should say “empty output,” rather than infer that no list was in flight.

Our small reporting correction labels UNKNOWN, logs page-fault query errors and removes the empty-breadcrumb inference. It does not implement your VA-zero or disabled-breadcrumb changes. No new diagnostic settings are enabled. This is source review only; no tests or native reproduction were run for these points.

AI use: OpenAI Codex (GPT-6) inspected the exact diff and Microsoft references and prepared this follow-up.

Optional contributor/test coordination: https://discord.gg/gK3y7WRRY

<!-- greyfinch-sync:ivall/xcl:comment:7238854989 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3119#issuecomment-7238854989). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-28T11:53:54Z. --- Source review of `284d1401f2061c16f1f5e93f0b9a3bbd4064eac4`: this partially overlaps our local diagnostics correction, so I’m bringing the remaining points here rather than opening another diagnostics PR. - DRED state `0` is `UNKNOWN`; it does not establish that GPU work caused no fault. The PR description and `dred_recorded_fault` comment currently make that inference. [Microsoft enum reference](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_dred_device_state). - A failed `GetPageFaultAllocationOutput` call is currently silent. Its HRESULT should be logged: Microsoft documents `DXGI_ERROR_UNSUPPORTED` when page-fault reporting was not enabled, and `DXGI_ERROR_NOT_CURRENTLY_AVAILABLE` when the device is not removed. Missing output is not a negative fault finding. [Microsoft method reference](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12deviceremovedextendeddata-getpagefaultallocationoutput). - VA `0` plus empty allocation lists is ambiguous. The lists describe matching active/recent allocations and may be empty; the documented contract does not require a real VA-zero fault to identify an allocation. Please preserve that uncertainty in the new helper/test and wording, especially when device state is unknown. [Microsoft output structure](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_dred_page_fault_output). - Distinguishing explicitly disabled breadcrumbs is useful. The enabled-but-empty branch should say “empty output,” rather than infer that no list was in flight. Our [small reporting correction](https://github.com/Prime1997/xcl/commit/05ed3f2980d8348a055d24f5fd5f82722d576409) labels UNKNOWN, logs page-fault query errors and removes the empty-breadcrumb inference. It does not implement your VA-zero or disabled-breadcrumb changes. No new diagnostic settings are enabled. This is source review only; no tests or native reproduction were run for these points. AI use: OpenAI Codex (GPT-6) inspected the exact diff and Microsoft references and prepared this follow-up. Optional contributor/test coordination: https://discord.gg/gK3y7WRRY
JJAutoCompare commented 2026-11-28 14:47:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-28T14:47:58Z.


Tested

Independently reran the pinned standalone CPU test for 284d1401f2061c16f1f5e93f0b9a3bbd4064eac4 on Windows 11 x64 build 26200.9974 with a Ryzen 7 3800X. The executable was built with Rust 1.100.1 (x86_64 MSVC). I verified that the harness copies DRED, dred_request, and dred_breadcrumbs_on byte for byte from the tested commit.

Ran predicate.exe --exact <state>_<input> --nocapture --test-threads=1 in 12 separate processes. The state filters were uninitialized, initialized_none, initialized_err, and initialized_ok. The input filters unset, pagefault, and one set the child’s XCL_DRED to absent, pagefault, and 1, respectively.

All 12 processes exited 0 (12 passed, 0 failed, 0 ignored, 0 skipped). Each case asserted the raw environment value, synthetic OnceLock state, and predicate result. Only initialized_ok_one returned true.

Not tested

Runtime DRED initialization, GPU or D3D12 operation, device removal, page-fault or breadcrumb output, title smoke, and the workspace suite.

AI use

T3 Code through Codex (gpt-6.2-sol, high) prepared the standalone harness, verified the source and executable pins, independently reran the cases, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7240939204 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3119#issuecomment-7240939204). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-28T14:47:58Z. --- **Tested** Independently reran the pinned standalone CPU test for `284d1401f2061c16f1f5e93f0b9a3bbd4064eac4` on Windows 11 x64 build 26200.9974 with a Ryzen 7 3800X. The executable was built with Rust 1.100.1 (x86_64 MSVC). I verified that the harness copies `DRED`, `dred_request`, and `dred_breadcrumbs_on` byte for byte from the tested commit. Ran `predicate.exe --exact <state>_<input> --nocapture --test-threads=1` in 12 separate processes. The state filters were `uninitialized`, `initialized_none`, `initialized_err`, and `initialized_ok`. The input filters `unset`, `pagefault`, and `one` set the child’s `XCL_DRED` to absent, `pagefault`, and `1`, respectively. All 12 processes exited 0 (12 passed, 0 failed, 0 ignored, 0 skipped). Each case asserted the raw environment value, synthetic OnceLock state, and predicate result. Only `initialized_ok_one` returned `true`. **Not tested** Runtime DRED initialization, GPU or D3D12 operation, device removal, page-fault or breadcrumb output, title smoke, and the workspace suite. **AI use** T3 Code through Codex (`gpt-6.2-sol`, high) prepared the standalone harness, verified the source and executable pins, independently reran the cases, and drafted this report.
Raul-Paiva commented 2026-11-30 00:14:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Raul-Paiva on 2026-11-30T00:14:24Z.


Thanks for the review. All four points are in, folded into the single commit; the PR is rebased onto main and its head is now 07dd7879.

  1. State 0 is UNKNOWN: adopted. It is logged as DRED device state: 0 (unknown), and the comment, commit message and description no longer say that 0 means the GPU's work did not fault.
  2. GetPageFaultAllocationOutput error: adopted. A failed call now logs DRED page-fault output not available (<HRESULT>) instead of nothing.
  3. VA 0 with empty lists is ambiguous: adopted. The helper is now dred_unplaced_page_fault, which returns the line for that case: VA 0x0, no allocations named (no fault recorded, or a fault DRED could not place). Its test (dred_output_at_va_0_with_no_allocations_is_ambiguous) checks that the line keeps both readings and that a non-zero VA or any named allocation is still logged as a fault.
  4. Enabled but empty breadcrumbs: adopted. That branch now says no breadcrumbs (empty output); the disabled case (XCL_DRED=pagefault) still says they are not switched on.

The full suite was run against main on an RTX 3070 Laptop; the counts are in the description (no new failure). The smoke runs are still to come.

Written with Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7265090233 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3119#issuecomment-7265090233). Originally posted by [Raul-Paiva](https://github.com/Raul-Paiva) on 2026-11-30T00:14:24Z. --- Thanks for the review. All four points are in, folded into the single commit; the PR is rebased onto `main` and its head is now `07dd7879`. 1. **State 0 is UNKNOWN**: adopted. It is logged as `DRED device state: 0 (unknown)`, and the comment, commit message and description no longer say that 0 means the GPU's work did not fault. 2. **GetPageFaultAllocationOutput error**: adopted. A failed call now logs `DRED page-fault output not available (<HRESULT>)` instead of nothing. 3. **VA 0 with empty lists is ambiguous**: adopted. The helper is now `dred_unplaced_page_fault`, which returns the line for that case: `VA 0x0, no allocations named (no fault recorded, or a fault DRED could not place)`. Its test (`dred_output_at_va_0_with_no_allocations_is_ambiguous`) checks that the line keeps both readings and that a non-zero VA or any named allocation is still logged as a fault. 4. **Enabled but empty breadcrumbs**: adopted. That branch now says `no breadcrumbs (empty output)`; the disabled case (`XCL_DRED=pagefault`) still says they are not switched on. The full suite was run against `main` on an RTX 3070 Laptop; the counts are in the description (no new failure). The smoke runs are still to come. Written with Claude Code (Claude Opus 5.5).
Foniass commented 2026-12-01 09:32:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:32:49Z.


Triage (#1607) – head 1c89197

No open or merged PR makes the same change. No problems found in the diff. dred_unplaced_page_fault is only used for VA 0 with both allocation lists empty, dred_breadcrumbs_on follows enable_dred_once / dred_request, and the test covers the helper.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7306857573 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3119#issuecomment-7306857573). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:32:49Z. --- **Triage (#1607)** – head 1c89197 No open or merged PR makes the same change. No problems found in the diff. `dred_unplaced_page_fault` is only used for VA 0 with both allocation lists empty, `dred_breadcrumbs_on` follows `enable_dred_once` / `dred_request`, and the test covers the helper. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Foniass commented 2026-12-01 11:10:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T11:10:35Z.


merge-check
base: 493dbd3dd0
head: 1c89197dc4
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2901 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (+41/-8). Findings: (1) It ignores the DRED device state read just above (real.rs ~12458). State 7 (PAGEFAULT) means a page fault happened. #2920's rows b-d are exactly that: state 7, VA 0x0, no allocations, during Dispatch / DispatchMesh / ExecuteIndirect, real null-address faults. This PR would log them as "no fault recorded, or a fault DRED could not place" (dred_unplaced_page_fault ~12432). The no-fault removals in #2920 (RTX 4080) and #3052 are the state-0 ones. PageFaultFlags (DRED 1.3) defines only NONE, so it can't separate the two. Passing the state in, keeping the fault line for state 7, and using the ambiguous line only when the state is unknown would keep both cases right. (2) Without XCL_DRED page-fault reporting is off, so every removal may now log "page-fault output not available" (unverified). (3) The one test covers the pure helper and builds in the state-blind behaviour; dred_breadcrumbs_on and the breadcrumb wording are untested. Fine: state 0 is labelled unknown, the query's HRESULT is logged, and "breadcrumbs not switched on" is now told apart from "empty output". This code runs only after a device removal, so no smoke run.
performance: no smoke run (the default path doesn't reach this change); not measured. Runs only after a device removal.
verdict: not yet: it ignores the DRED device state it reads just above, so real null-address page faults (state 7, VA 0, as in #2920) would be logged as "no fault recorded"; keep the fault line for state 7 and use the ambiguous line only when the state is unknown
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7309274744 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3119#issuecomment-7309274744). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T11:10:35Z. --- merge-check base: 493dbd3dd0cd50b4c3e8d28f73ab9b504fcd8158 head: 1c89197dc4514b511500a545c67646d62276e10f merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2901 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: read the whole diff (+41/-8). Findings: (1) **It ignores the DRED device state read just above** (`real.rs` ~12458). State 7 (PAGEFAULT) means a page fault happened. #2920's rows b-d are exactly that: state 7, VA 0x0, no allocations, during Dispatch / DispatchMesh / ExecuteIndirect, real null-address faults. This PR would log them as "no fault recorded, or a fault DRED could not place" (`dred_unplaced_page_fault` ~12432). The no-fault removals in #2920 (RTX 4080) and #3052 are the state-0 ones. `PageFaultFlags` (DRED 1.3) defines only NONE, so it can't separate the two. Passing the state in, keeping the fault line for state 7, and using the ambiguous line only when the state is unknown would keep both cases right. (2) Without `XCL_DRED` page-fault reporting is off, so every removal may now log "page-fault output not available" (unverified). (3) The one test covers the pure helper and builds in the state-blind behaviour; `dred_breadcrumbs_on` and the breadcrumb wording are untested. Fine: state 0 is labelled unknown, the query's HRESULT is logged, and "breadcrumbs not switched on" is now told apart from "empty output". This code runs only after a device removal, so no smoke run. performance: no smoke run (the default path doesn't reach this change); not measured. Runs only after a device removal. verdict: not yet: it ignores the DRED device state it reads just above, so real null-address page faults (state 7, VA 0, as in #2920) would be logged as "no fault recorded"; keep the fault line for state 7 and use the ambiguous line only when the state is unknown hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
Raul-Paiva commented 2026-12-01 13:58:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Raul-Paiva on 2026-12-01T13:58:39Z.


Thanks for the review. Head is now efb87906 (rebased onto main b2b1f109), with fixes for all three points, squashed into the one commit:

  1. The device state now decides VA 0. dred_unplaced_page_fault takes the state read just above it:
    • State 7 (PAGEFAULT) with VA 0 and no allocations is logged as a fault at VA 0x0 again, so the null-address faults of #2920 rows b-d keep the fault line.
    • Another known state (3 hung, 6 fault) logs "no page fault: the device state is another removal".
    • Only state 0 (UNKNOWN), or no state, gets the ambiguous line.
  2. Output not switched on. A failed GetPageFaultAllocationOutput logs its HRESULT only when XCL switched the page-fault output on (agility::dred_switched_on). Without XCL_DRED, the log says it is not switched on and how to switch it on, as the breadcrumbs line already did.
  3. Tests. The wording is now in pure helpers with tests:
    • dred_output_at_va_0_with_no_allocations_follows_the_device_state covers states 0, 3, 6, 7 and none;
    • missing_dred_output_says_whether_it_was_switched_on covers the page-fault and breadcrumb lines: not switched on, an error, and empty output;
    • dred_outputs_are_on_only_when_the_settings_took covers dred_switched_on.

Tested on an RTX 3070 Laptop (driver 621.40): the modules this PR touches (gpu::agility, hle::d3d12x::real), release, serially, gave 185 passed, 0 failed.

The new lines have not been seen in a real removal yet: no removal happened in my runs.

Claude Code (Claude Opus 5.5) helped with the fixes and this reply; I checked each point.

<!-- greyfinch-sync:ivall/xcl:comment:7313492815 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3119#issuecomment-7313492815). Originally posted by [Raul-Paiva](https://github.com/Raul-Paiva) on 2026-12-01T13:58:39Z. --- Thanks for the review. Head is now efb87906 (rebased onto `main` b2b1f109), with fixes for all three points, squashed into the one commit: 1. **The device state now decides VA 0.** `dred_unplaced_page_fault` takes the state read just above it: - State 7 (PAGEFAULT) with VA 0 and no allocations is logged as a fault at VA 0x0 again, so the null-address faults of #2920 rows b-d keep the fault line. - Another known state (3 hung, 6 fault) logs "no page fault: the device state is another removal". - Only state 0 (UNKNOWN), or no state, gets the ambiguous line. 2. **Output not switched on.** A failed `GetPageFaultAllocationOutput` logs its HRESULT only when XCL switched the page-fault output on (`agility::dred_switched_on`). Without `XCL_DRED`, the log says it is not switched on and how to switch it on, as the breadcrumbs line already did. 3. **Tests.** The wording is now in pure helpers with tests: - `dred_output_at_va_0_with_no_allocations_follows_the_device_state` covers states 0, 3, 6, 7 and none; - `missing_dred_output_says_whether_it_was_switched_on` covers the page-fault and breadcrumb lines: not switched on, an error, and empty output; - `dred_outputs_are_on_only_when_the_settings_took` covers `dred_switched_on`. Tested on an RTX 3070 Laptop (driver 621.40): the modules this PR touches (`gpu::agility`, `hle::d3d12x::real`), release, serially, gave 185 passed, 0 failed. The new lines have not been seen in a real removal yet: no removal happened in my runs. Claude Code (Claude Opus 5.5) helped with the fixes and this reply; I checked each point.
fromthemoonx commented 2026-12-01 18:41:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-01T18:41:20Z.


merge-check
base: 6bfb5c5153
head: efb879063f
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2907 passed, 0 failed, 51 ignored (base: 2904 passed, 0 failed, 51 ignored); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same set as base; failing: none
review: read the whole diff (3 files, +125 -13). No correctness problem found; log wording only.

  • log_device_removed now passes the DRED device state to dred_unplaced_page_fault. VA 0 with no allocations named is still logged as a fault at VA 0 for state 7 (page fault), and gets its own line for 3 / 6 and for 0 / no state.
  • A missing page-fault output or missing breadcrumbs now say whether DRED was switched on. dred_switched_on reads enable_dred_once's result and XCL_DRED.
  • The three new tests (dred_output_at_va_0_with_no_allocations_follows_the_device_state, missing_dred_output_says_whether_it_was_switched_on, dred_outputs_are_on_only_when_the_settings_took): 3 of 3 runs passed.
  • Mutation: the state 3 / 6 branch off (Some(s) if false && ...) fails dred_output_at_va_0_with_no_allocations_follows_the_device_state. Good.
  • Not run here: a real device removal with XCL_DRED=1 / =pagefault. The new lines were checked through the helpers only.
    performance: none: removal path only.
    verdict: safe to merge
    hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
<!-- greyfinch-sync:ivall/xcl:comment:7321347862 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3119#issuecomment-7321347862). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-01T18:41:20Z. --- merge-check base: 6bfb5c5153ccc23517daf30aa1071ddb0fadb53c head: efb879063f590a6c8725486bda8264d45a09c577 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2907 passed, 0 failed, 51 ignored (base: 2904 passed, 0 failed, 51 ignored); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same set as base; failing: none review: read the whole diff (3 files, +125 -13). No correctness problem found; log wording only. - `log_device_removed` now passes the DRED device state to `dred_unplaced_page_fault`. VA 0 with no allocations named is still logged as a fault at VA 0 for state 7 (page fault), and gets its own line for 3 / 6 and for 0 / no state. - A missing page-fault output or missing breadcrumbs now say whether DRED was switched on. `dred_switched_on` reads `enable_dred_once`'s result and `XCL_DRED`. - The three new tests (`dred_output_at_va_0_with_no_allocations_follows_the_device_state`, `missing_dred_output_says_whether_it_was_switched_on`, `dred_outputs_are_on_only_when_the_settings_took`): 3 of 3 runs passed. - Mutation: the state 3 / 6 branch off (`Some(s) if false && ...`) fails `dred_output_at_va_0_with_no_allocations_follows_the_device_state`. Good. - Not run here: a real device removal with `XCL_DRED=1` / `=pagefault`. The new lines were checked through the helpers only. performance: none: removal path only. verdict: safe to merge hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
Foniass commented 2026-12-01 20:52:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T20:52:27Z.


Follow-up review (head efb87906, since 1c89197, diff read, not a merge-check):

  • The DRED device state is ignored at VA 0: fixed. dred_unplaced_page_fault now takes the state log_device_removed reads (real.rs ~12543-12553): state 7 still logs DRED page fault at GPU VA 0x0 (~12494), states 3 and 6 say "no page fault", and the ambiguous line is only for state 0 or no state (~12497-12499).
  • "Page-fault output not available" on every removal without XCL_DRED: fixed. The HRESULT is logged only when agility::dred_switched_on() says XCL turned the output on; otherwise the line says it is not switched on (real.rs ~12503-12510, ~12557-12560; agility.rs ~405-415).
  • The test checked only the helper and only the state-blind behaviour: fixed. dred_output_at_va_0_with_no_allocations_follows_the_device_state covers states 7, 3, 6, 0 and none plus a non-zero VA and named allocations; missing_dred_output_says_whether_it_was_switched_on and dred_outputs_are_on_only_when_the_settings_took cover the wording and dred_on.

New: none. Open #2131 rewrites the same GetPageFaultAllocationOutput block, so whichever merges second needs a rebase.

Fine: only log lines change, only after a device removal; breadcrumbs are on only with XCL_DRED=1, matching enable_dred_once.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7325403328 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3119#issuecomment-7325403328). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T20:52:27Z. --- Follow-up review (head efb87906, since 1c89197, diff read, not a merge-check): - **The DRED device state is ignored at VA 0:** fixed. `dred_unplaced_page_fault` now takes the state `log_device_removed` reads (`real.rs` ~12543-12553): state 7 still logs `DRED page fault at GPU VA 0x0` (~12494), states 3 and 6 say "no page fault", and the ambiguous line is only for state 0 or no state (~12497-12499). - **"Page-fault output not available" on every removal without `XCL_DRED`:** fixed. The HRESULT is logged only when `agility::dred_switched_on()` says XCL turned the output on; otherwise the line says it is not switched on (`real.rs` ~12503-12510, ~12557-12560; `agility.rs` ~405-415). - **The test checked only the helper and only the state-blind behaviour:** fixed. `dred_output_at_va_0_with_no_allocations_follows_the_device_state` covers states 7, 3, 6, 0 and none plus a non-zero VA and named allocations; `missing_dred_output_says_whether_it_was_switched_on` and `dred_outputs_are_on_only_when_the_settings_took` cover the wording and `dred_on`. New: none. Open #2131 rewrites the same `GetPageFaultAllocationOutput` block, so whichever merges second needs a rebase. Fine: only log lines change, only after a device removal; breadcrumbs are on only with `XCL_DRED=1`, matching `enable_dred_once`. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
stijn-boer commented 2026-12-02 18:26:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by stijn-boer on 2026-12-02T18:26:33Z.


merge-check
base: c53e969602
head: efb879063f
verdict: not yet: the focused DRED tests passed and the workspace and retail smoke runs ended early on both builds. A device removal was not captured.

Windows / AMD RDNA4 (native D3D12) — DRED diagnostics checks on efb8790

Clean merge onto main at c53e969 (merge commit 13e3be6586907fe3052215d086e006dbc5cb4eeb). git diff --check was clean.

Setup

  • AMD Radeon RX 9060 XT (driver 32.0.32029.2010), Ryzen 7 5700X, Windows 10 21H2 build 19044.6332
  • Rust 1.100.0, debug builds, Agility SDK 1.620.2 with matching d3d12SDKLayers.dll, DXC 1.9.2609.5

Tested

cargo build --workspace passed. cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output exited 101 on both builds. The baseline table row is from a prior run of the same commit, machine, SDK, and command.

Build Passed Failed Ignored SKIPPED notices
main 338 3 23 0
Merged PR 341 3 23 0

Counts are partial because two test processes aborted on each build.

  • Tests that failed on the PR and passed on main — none observed in comparable results.
  • Focused tests — 5 passed, 0 failed, 0 ignored, 0 skip notices with --test-threads=1 --show-output --nocapture. These covered the three new tests for enablement, VA 0 classification, and missing output messages, plus the two existing DRED tests.
  • Debug-layer coverage — both debug-layer E2E tests, including DRED, and uploads_start_from_each_subresources_state passed.
Shared failures and process aborts
  • fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_3, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs reported failures on both builds.
  • The library and gpu_compute_e2e test processes exited with 0xc0000409 on both builds.

Retail smoke

Ran scripts/smoke.ps1 -Game <local folder> -Seconds 60 -Xcl <debug binary> with XCL_UMA_DRIVER=mixed for title hash 2c508222.

Build Exit Frames logged Device removals logged Peak commit
main 0xc0000409 None 0 1320 MB
Merged PR, defaults 0xc0000409 None 0 4911 MB
Merged PR, XCL_DRED=1 0xc0000409 None 0 1330 MB
Merged PR, XCL_DRED=pagefault 0xc0000409 None 0 1329 MB

Neither DRED-mode retail run reached a device-removal report.

Diff review

The unit tests distinguish outputs that were disabled from outputs that were requested but unavailable. They also cover the ambiguous zero-VA case and the case where DRED explicitly reports a page fault.

Not tested

Remaining workspace tests after the aborts, retail performance, and log output from an actual device removal in either DRED mode.

AI use

Codex (GPT-6) merged and built the PR, ran the tests, compared the results with main, reviewed the diff, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7354590087 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3119#issuecomment-7354590087). Originally posted by [stijn-boer](https://github.com/stijn-boer) on 2026-12-02T18:26:33Z. --- merge-check base: c53e96960265a82477a9c98677afb0402e98d486 head: efb879063f590a6c8725486bda8264d45a09c577 verdict: not yet: the focused DRED tests passed and the workspace and retail smoke runs ended early on both builds. A device removal was not captured. **Windows / AMD RDNA4 (native D3D12) — DRED diagnostics checks on `efb8790`** Clean merge onto `main` at `c53e969` (merge commit `13e3be6586907fe3052215d086e006dbc5cb4eeb`). `git diff --check` was clean. **Setup** - AMD Radeon RX 9060 XT (driver 32.0.32029.2010), Ryzen 7 5700X, Windows 10 21H2 build 19044.6332 - Rust 1.100.0, debug builds, Agility SDK 1.620.2 with matching `d3d12SDKLayers.dll`, DXC 1.9.2609.5 **Tested** `cargo build --workspace` passed. `cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output` exited 101 on both builds. The baseline table row is from a prior run of the same commit, machine, SDK, and command. | Build | Passed | Failed | Ignored | `SKIPPED` notices | |---|---:|---:|---:|---:| | `main` | 338 | 3 | 23 | 0 | | Merged PR | 341 | 3 | 23 | 0 | Counts are partial because two test processes aborted on each build. - **Tests that failed on the PR and passed on `main`** — none observed in comparable results. - **Focused tests** — 5 passed, 0 failed, 0 ignored, 0 skip notices with `--test-threads=1 --show-output --nocapture`. These covered the three new tests for enablement, VA 0 classification, and missing output messages, plus the two existing DRED tests. - **Debug-layer coverage** — both debug-layer E2E tests, including DRED, and `uploads_start_from_each_subresources_state` passed. <details><summary>Shared failures and process aborts</summary> - `fuzz_validate_and_gpu_1`, `fuzz_validate_and_gpu_3`, and `two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` reported failures on both builds. - The library and `gpu_compute_e2e` test processes exited with `0xc0000409` on both builds. </details> **Retail smoke** Ran `scripts/smoke.ps1 -Game <local folder> -Seconds 60 -Xcl <debug binary>` with `XCL_UMA_DRIVER=mixed` for title hash `2c508222`. | Build | Exit | Frames logged | Device removals logged | Peak commit | |---|---|---|---:|---:| | `main` | `0xc0000409` | None | 0 | 1320 MB | | Merged PR, defaults | `0xc0000409` | None | 0 | 4911 MB | | Merged PR, `XCL_DRED=1` | `0xc0000409` | None | 0 | 1330 MB | | Merged PR, `XCL_DRED=pagefault` | `0xc0000409` | None | 0 | 1329 MB | Neither DRED-mode retail run reached a device-removal report. **Diff review** The unit tests distinguish outputs that were disabled from outputs that were requested but unavailable. They also cover the ambiguous zero-VA case and the case where DRED explicitly reports a page fault. **Not tested** Remaining workspace tests after the aborts, retail performance, and log output from an actual device removal in either DRED mode. **AI use** Codex (GPT-6) merged and built the PR, ran the tests, compared the results with `main`, reviewed the diff, and drafted this report.
Raul-Paiva commented 2026-12-03 08:07:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Raul-Paiva on 2026-12-03T08:07:46Z.


Thanks for running it on RDNA4. Two notes on the "not yet":

  • The aborts: the 0xc0000409 aborts of the library and gpu_compute_e2e test processes, and of the retail smoke, happen on main too. The three failures are shared as well. So the run shows no difference this PR makes. Your focused run, 5 passed, covers the three new tests and the two DRED tests already there.
  • Where the change runs: it only runs when the device is removed, as the DRED output is read then. A run with no removal does not reach it, so a smoke can only check that turning XCL_DRED on breaks nothing. Your DRED-mode smokes ended in the same abort as main before that point.

What is still untested, on any GPU, is the log from a real removal with XCL_DRED=1 / pagefault, which Not tested already says. If a title removes the device on your card once the abort is gone, that log would be the useful check.

The reply was posted by Claude Code (Claude Opus 5.5) on my behalf, and I reviewed it before it went out.

<!-- greyfinch-sync:ivall/xcl:comment:7371858927 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3119#issuecomment-7371858927). Originally posted by [Raul-Paiva](https://github.com/Raul-Paiva) on 2026-12-03T08:07:46Z. --- Thanks for running it on RDNA4. Two notes on the "not yet": - **The aborts:** the `0xc0000409` aborts of the library and `gpu_compute_e2e` test processes, and of the retail smoke, happen on `main` too. The three failures are shared as well. So the run shows no difference this PR makes. Your focused run, 5 passed, covers the three new tests and the two DRED tests already there. - **Where the change runs:** it only runs when the device is removed, as the DRED output is read then. A run with no removal does not reach it, so a smoke can only check that turning `XCL_DRED` on breaks nothing. Your DRED-mode smokes ended in the same abort as `main` before that point. What is still untested, on any GPU, is the log from a real removal with `XCL_DRED=1` / `pagefault`, which **Not tested** already says. If a title removes the device on your card once the abort is gone, that log would be the useful check. The reply was posted by Claude Code (Claude Opus 5.5) on my behalf, and I reviewed it before it went out.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3119:upstream-pr/3119'
git switch 'upstream-pr/3119'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3119'
git switch 'upstream-pr/3119'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3119'
git switch 'upstream-pr/3119'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3119'
git switch 'main'
git merge --squash 'upstream-pr/3119'
git switch 'main'
git merge --ff-only 'upstream-pr/3119'
git switch 'main'
git merge 'upstream-pr/3119'
git push origin 'main'
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
xcl-dev/xcl!3119
No description provided.