D3D12.X: DRED's VA 0 output follows the device state it comes with #3119
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3119"
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 ivall/xcl. Originally posted by Raul-Paiva on 2026-11-28T11:39:50Z.
On a device removal,
log_device_removedlogged DRED's page-fault output as a fault unconditionally. When the output is VA 0 with no allocation named, the log saidDRED 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. WithXCL_DRED=pagefaultthe breadcrumbs are never switched on, yet the log saidno breadcrumbs (no list was in flight).Log changes (wording only, no behaviour change):
DRED page-fault output: VA 0x0, no allocations named (no page fault: the device state is another removal);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.
UNKNOWNand is logged asDRED device state: 0 (unknown); nothing infers from it whether the GPU's work faulted.GetPageFaultAllocationOutputlogs its HRESULT when XCL switched the page-fault output on:DRED page-fault output not available (<hr>). WithoutXCL_DRED:DRED: no page-fault output (not switched on; XCL_DRED=1 or XCL_DRED=pagefault does).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_missinganddred_breadcrumbs_missing(the lines for an output DRED did not give, switched on or not), pure helpers; their testsdred_output_at_va_0_with_no_allocations_follows_the_device_stateandmissing_dred_output_says_whether_it_was_switched_onindred_tests; the log lines inlog_device_removed.crates/xcl/src/gpu/agility.rs:dred_switched_on, whatenable_dred_onceswitched on (nothing, the page faults, or the breadcrumbs too); its testdred_outputs_are_on_only_when_the_settings_took.Tested
main5b0d5fa3(same commands, same machine). The head pushed here is this change, with the review fixes of 12-01, rebased ontomainb2b1f109without conflicts;main's newer commits also changereal.rs, which the rebase merged. The full-suite counts below were measured before those fixes and that rebase.efb87906(with the review fixes, onmainb2b1f109), 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 onmaintoo (exit 0x80004005 aftersparse upload preparation still failed after bounded retries), so the lib was also run alone, serially (--test-threads=1), with--skipfor the 20 tests that end the binary onmain(6list_x, 12sparse, 1texture_upload, 1uma_driver; each passes alone).main5b0d5fa3):main: the same.main: 2604 passed, 13 failed, 29 ignored.dred_output_at_va_0_with_no_allocations_is_ambiguous(now..._follows_the_device_state), passes. The 13 failures ofmainfail here too (12title_textures, 1vram::d32s8_targets_take_their_own_size_of_video_memory).alloc_pool::tests::a_reset_that_puts_the_allocator_aside_keeps_what_the_gpu_still_readsandvram::tests::superseded_texture_waits_for_every_title_queue, pass alone 3/3 on this head and onmain, 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.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, withXCL_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 ofmainbefore.main:This PR:
Not tested
AI use
🤖 Generated with Claude Code
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.0isUNKNOWN; it does not establish that GPU work caused no fault. The PR description anddred_recorded_faultcomment currently make that inference. Microsoft enum reference.GetPageFaultAllocationOutputcall is currently silent. Its HRESULT should be logged: Microsoft documentsDXGI_ERROR_UNSUPPORTEDwhen page-fault reporting was not enabled, andDXGI_ERROR_NOT_CURRENTLY_AVAILABLEwhen the device is not removed. Missing output is not a negative fault finding. Microsoft method reference.0plus 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.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
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-28T14:47:58Z.
Tested
Independently reran the pinned standalone CPU test for
284d1401f2061c16f1f5e93f0b9a3bbd4064eac4on 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 copiesDRED,dred_request, anddred_breadcrumbs_onbyte for byte from the tested commit.Ran
predicate.exe --exact <state>_<input> --nocapture --test-threads=1in 12 separate processes. The state filters wereuninitialized,initialized_none,initialized_err, andinitialized_ok. The input filtersunset,pagefault, andoneset the child’sXCL_DREDto absent,pagefault, and1, 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_onereturnedtrue.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.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
mainand its head is now07dd7879.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.DRED page-fault output not available (<HRESULT>)instead of nothing.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.no breadcrumbs (empty output); the disabled case (XCL_DRED=pagefault) still says they are not switched on.The full suite was run against
mainon 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).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:32:49Z.
Triage (#1607) – head
1c89197No open or merged PR makes the same change. No problems found in the diff.
dred_unplaced_page_faultis only used for VA 0 with both allocation lists empty,dred_breadcrumbs_onfollowsenable_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.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T11:10:35Z.
merge-check
base:
493dbd3dd0head:
1c89197dc4merge: 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) WithoutXCL_DREDpage-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_onand 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.
Imported from ivall/xcl. Originally posted by Raul-Paiva on 2026-12-01T13:58:39Z.
Thanks for the review. Head is now
efb87906(rebased ontomainb2b1f109), with fixes for all three points, squashed into the one commit:dred_unplaced_page_faulttakes the state read just above it:GetPageFaultAllocationOutputlogs its HRESULT only when XCL switched the page-fault output on (agility::dred_switched_on). WithoutXCL_DRED, the log says it is not switched on and how to switch it on, as the breadcrumbs line already did.dred_output_at_va_0_with_no_allocations_follows_the_device_statecovers states 0, 3, 6, 7 and none;missing_dred_output_says_whether_it_was_switched_oncovers the page-fault and breadcrumb lines: not switched on, an error, and empty output;dred_outputs_are_on_only_when_the_settings_tookcoversdred_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.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-01T18:41:20Z.
merge-check
base:
6bfb5c5153head:
efb879063fmerge: 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_removednow passes the DRED device state todred_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.dred_switched_onreadsenable_dred_once's result andXCL_DRED.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.Some(s) if false && ...) failsdred_output_at_va_0_with_no_allocations_follows_the_device_state. Good.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)
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T20:52:27Z.
Follow-up review (head
efb87906, since1c89197, diff read, not a merge-check):dred_unplaced_page_faultnow takes the statelog_device_removedreads (real.rs~12543-12553): state 7 still logsDRED 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).XCL_DRED: fixed. The HRESULT is logged only whenagility::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).dred_output_at_va_0_with_no_allocations_follows_the_device_statecovers states 7, 3, 6, 0 and none plus a non-zero VA and named allocations;missing_dred_output_says_whether_it_was_switched_onanddred_outputs_are_on_only_when_the_settings_tookcover the wording anddred_on.New: none. Open #2131 rewrites the same
GetPageFaultAllocationOutputblock, 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, matchingenable_dred_once.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by stijn-boer on 2026-12-02T18:26:33Z.
merge-check
base:
c53e969602head:
efb879063fverdict: 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
efb8790Clean merge onto
mainatc53e969(merge commit13e3be6586907fe3052215d086e006dbc5cb4eeb).git diff --checkwas clean.Setup
d3d12SDKLayers.dll, DXC 1.9.2609.5Tested
cargo build --workspacepassed.cargo test --workspace --no-fail-fast -- --test-threads=4 --show-outputexited 101 on both builds. The baseline table row is from a prior run of the same commit, machine, SDK, and command.SKIPPEDnoticesmainCounts are partial because two test processes aborted on each build.
main— none observed in comparable results.--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.uploads_start_from_each_subresources_statepassed.Shared failures and process aborts
fuzz_validate_and_gpu_1,fuzz_validate_and_gpu_3, andtwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobsreported failures on both builds.gpu_compute_e2etest processes exited with0xc0000409on both builds.Retail smoke
Ran
scripts/smoke.ps1 -Game <local folder> -Seconds 60 -Xcl <debug binary>withXCL_UMA_DRIVER=mixedfor title hash2c508222.main0xc00004090xc0000409XCL_DRED=10xc0000409XCL_DRED=pagefault0xc0000409Neither 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.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":
0xc0000409aborts of the library andgpu_compute_e2etest processes, and of the retail smoke, happen onmaintoo. 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.XCL_DREDon breaks nothing. Your DRED-mode smokes ended in the same abort asmainbefore 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.