D3D12.X: XCL_DRED=1 names the pipeline bound where the GPU faulted #1592
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1592
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1592/head"
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?
@marquezinii on GitHub · 2026-11-24 18:02 UTC · original
marquezinii:dred-pipeline-labels→main· +274 −6 · 7 files · 1 commits · merged 2026-11-25 13:19 UTCThe device removals reported when the newer retail title loads its world (the mesh shader page faults on #541: an Aftermath dump on an RTX 3070 Ti, DRED on an RX 7900 XT) don't say which translated pipeline faulted.
XCL_DRED=1logs how far each list got, but not what was bound there, and nobody could tell which console shader to look at. With this, the DRED lines name the pipeline by its console shaders' hashes, the samefnv64hashes the translation log uses.How it works, and why not in the simplest way: on this machine DRED kept no marker text (breadcrumb contexts came back empty), and gave the list's debug name but a null
pCommandList. So eachSetPipelineStateXCL records for the title is followed by aSetMarker, XCL keeps the pipeline's label per list in order, and on a removal it counts the marker operations in DRED's history up to where the list stopped. The title's own markers are counted without a label (aSetMarkerhook). Marked lists are namedxcl list 0x…so a node can be matched without its pointer. DRED's count can also lag behind the GPU here: with a fault in the second of two dispatches, it left the first one not done. So the labels bound after that point are printed too. Nothing changes withoutXCL_DRED=1except theSetMarkerhook forwarding the call.What is in it
crates/xcl/src/hle/d3d12x/dred.rs(new): labels per pipeline, markers per list (its last 4 recordings, a DRED node matched to the one with as many markers),bound_at/bound_afterfrom a DRED history,node_list; unit tests for the counting (the title's markers skipped, ops after the stop point), the recording match and the name parsing.crates/xcl/src/hle/d3d12x/real.rs: labels where translated compute, graphics, mesh and VS+GS pipelines are made; a marker incl_set_pipeline_state,ClearStateand afterResetwith an initial state; aSetMarkerhook; labels and marks dropped with a released pipeline or list; the pipeline inlog_device_removed's DRED lines.crates/xcl/src/hle/d3d12x/device_x.rs,list_x.rs: a list created with an initial pipeline, and the next segment of a Wait64 mid-list split, start a recording with it marked.crates/xcl/src/hle/d3d12x/console_list.rs: a replay starts a recording of the PC list (itsSetPipelineStateis the adopted list's, so it is marked there).README.md: whatXCL_DRED=1now logs.What a line looks like (from the check below, shortened):
DRED: list … 2 of 7 operations done, around: …; pipeline bound there: cs e42ba8a014b743b9; bound after it: cs 26e1b0c2aadbe056.Tested
cargo test --workspace -- --test-threads=4onc6067a6(rebased ontomain1d027e5): 963 passed, 0 failed, 43 ignored. The same withXCL_DRED=1set: 963 passed, 0 failed, 43 ignored. SKIPPED: the wave64 cases oflower/lower_dxilandgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64), the f16 and conversion formslower_dxilrefuses in wave32,heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache). On681e0ab, before the rebase: 780 passed, 0 failed, 41 ignored both ways.SetMarker, then a second pipeline dispatched with a root UAV at an unmapped address. The device was removed (0x887A0006). From DRED's historybound_atgave the first pipeline's label andbound_afterthe faulting one's, with the title's marker skipped. DRED reportedPageFaultVA0 for that fault (the address was 0x700000000), so on NVIDIA a DRED page fault "at VA 0" doesn't by itself mean a null address.Regression run
Needs a new pair for this head
c6067a6. It is681e0abrebased ontomain1d027e5, because the PR no longer merged: the only conflict was theXCL_DREDlines inREADME.md, and the code is unchanged. The pair below was run on681e0ab. Run by @LocranKing on an NVIDIA GeForce RTX 3060 Ti, 60 s each,XCL_NETWORK=0, release, copied from their comment as posted:main:
PR:
Not tested
XCL_DRED=1on this head: I did not run one; the smoke pair above is a regression run of the title, not a fault capture. crosettiremi's run on an RX 7900 XT during world loading (a device hang, on an earlier head with local changes) got labels on 18 of 20 unfinished lists, see the comments. Whether it names the mesh pipeline behind the faults on #541 is not shown yet.pCommandListor breadcrumb contexts there; the name and the marker count are used either way); Wine / vkd3d-proton.AI use
@eizispark on GitHub · 2026-11-24 18:11 UTC · original
Hardware test report — commit
5883e44Verified
5883e441fe421bd5da96d3c3676ffaca2a0ed42d(clean merge withmain9e3831e1f570d3646e53ab753b19ec07eb8f1485): pass.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo test --workspace --no-fail-fast -- --test-threads=4:779 passed, 0 failed, 41 ignored(1 skipped:heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows), including all three newhle::d3d12x::dred::tests(node_list_takes_the_pointer_or_the_name_xcl_gave,markers_before_counts_only_markers_ahead_of_the_failing_op,bound_at_skips_the_titles_markers),hle::d3d12x::real::dred_tests::a_late_partially_executed_list_is_reported_before_unstarted_lists, and the native-wave64 tests (gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware,console_wave64_compute_through_the_pso_hook_dispatch_and_read_back)Regression run
main(9e3831e1f570d3646e53ab753b19ec07eb8f1485):PR (
5883e441fe421bd5da96d3c3676ffaca2a0ed42d):Not tested
XCL_DRED=1GPU page-fault / device-removal run, NVIDIA/Intel GPUs, Wine/vkd3d-proton,XCL_SAMPLE_*AI use
@IvyNotFound on GitHub · 2026-11-24 18:14 UTC · original
A data point for using this on the retail title, and a related PR.
On an RTX 5080 (driver 621.24, Windows),
XCL_DRED=1changed what the driver accepts from its pipeline cache. With DRED's auto-breadcrumbs and page-fault reports forced on, none of the cached driver blobs were taken. The title's first big compute pipeline (1.99 MB of DXIL) was built again in 153 s, and the run never got past the title's start (2 frames in 160 s;mainpresents ~1 300 in that time). That run was on an earliermainwith a local marker patch. It was one run, and I have not checked which DRED setting causes it. If the same holds on other NVIDIA cards, a world-load run with this PR on needs a warm-up run withXCL_DRED=1first, or a long wait at the start.#1323 names what is in flight without DRED, for stalls rather than device removals.
XCL_GPU_CULPRIT=1wraps each recorded dispatch inWriteBufferImmediatemarkers. When the GPU-wait watchdog fires, it logs the console CS hashes (fnv64, as here) of the dispatches that started and did not finish. The two could share the per-pipeline hash bookkeeping if both land.AI use: Claude Code (Claude Opus 5.5) wrote this note from runs on my machine.
@MatyEjsr on GitHub · 2026-11-24 18:25 UTC · original
Verified PR #1592 at commit
5883e441fe421bd5da96d3c3676ffaca2a0ed42don NVIDIA RTX 3090 (Ampere) with both default settings andXCL_DRED=1, plus a code review of the DRED tracking hooks.Tested
dxcompiler 1.9.2602.17/dxil 1.9.2602.17cargo build --workspace -j 8: succeeded in 5.72s (0 errors, 2 pre-existingfetch_updatedeprecation warnings)cargo test --workspace -j 8 -- --test-threads=4(default env): 779 reported passed (774 executed + 5 SKIPPED), 0 failed, 41 ignored (xcl lib 15.03s)XCL_DRED=1 cargo test -p xcl --lib dred: 4 passed, 0 failed, 0 ignored (0.00s)XCL_DRED=1 cargo test --workspace -j 8 -- --test-threads=4: 779 reported passed (774 executed + 5 SKIPPED), 0 failed, 41 ignored (xcl lib 15.10s)--test-threads=8: both default andXCL_DRED=1runs hit a concurrency failure ingpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem(assertion left == right failed: submit 1 lane 0 mismatch; 729 passed, 1 failed, 21 ignored inxcl --lib), while standalone (0.39s) and--test-threads=4runs passed cleanly.--test-threads=4runs, not counted as coverage):gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64)gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64)test_title_draws_with_a_root_signature_under_the_debug_layer(no d3d12SDKLayers.dll)heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)uploads_start_from_each_subresources_state(no D3D12 debug layer,0x887A002D)Review notes (confirmed in source)
console_list.rs:857-858:st.pccomes fromreal::dev_create_command_list(real.rs:2413), which adoptsKind::CommandList(including theSetPipelineStatehookcl_set_pipeline_state). Callinglist.SetPipelineState(pc)on line 857 already invokesdred::mark_pipeline, so the second explicit call todred::mark_pipelineon line 858 records two back-to-backSetMarkerops and twoMARKSentries per replayed dispatch (causingbound_afterto repeat each pipeline label twice).cl_resetmarks a non-nullinitial_state, butdevice_x::create_list(device_x.rs:98-103, when a list is created with a non-null initial PSO and records before its firstReset),cl_clear_state(real.rs:5131-5137,ClearState(pso)), and mid-list split segments (list_x.rs:2484-2505) do not calldred::reset/dred::mark_pipeline.forget_pso(real.rs:1722) clears every other address-keyed PSO map to avoid stale metadata on address reuse, andcl_release(real.rs:5169) clearslist_x/bind; pruningdred::LABELSinforget_psoanddred::MARKSincl_releasewould prevent stale labels or stale marks if an address is reused.Not tested
scripts/smoke.ps1)AI use
5883e441, ran the build and workspace test suites (default andXCL_DRED=1), audited the DRED hook paths, and wrote this report.@crosettiremi on GitHub · 2026-11-24 18:31 UTC · original
Tested the pipeline labels on an RX 7900 XT with DRED enabled during retail world loading. At 189.36 s the driver reported DXGI_ERROR_DEVICE_HUNG. Of 20 reported unfinished lists, one had made progress (14/112 operations), and 18 had pipeline labels. The partially completed list reported CS hash 4401d482ef24797c, which the title shader index identifies as meshlet_culling:CS_BatchCullInitArgs. The first outstanding operation was ClearDepthStencilView. A compute PSO being bound at that point does not establish that its dispatch caused the hang. DRED reported GPU VA 0 and no allocation names. The same run recorded an actual 33-list ExecuteCommandLists call about ten seconds earlier. Local diagnostic changes also prioritized partially completed DRED nodes in the output. This confirms the labels are usable on this AMD path.
@marquezinii on GitHub · 2026-11-24 18:33 UTC · original
Thanks for the reviews. All of these are in the new head (squashed into the one commit):
SetPipelineStatealready marks. The explicit call inconsole_list.rsis gone, and there is one marker per replayed dispatch now.ClearState(pso)marks what it binds. A list created with an initial pipeline starts a recording and marks it (device_x::create_list). The next segment of a Wait64 mid-list split does the same (list_x), since it is reset or made withoutcl_reset.forget_psodrops the pipeline's label, and the list's last release drops its recordings.XCL_DRED=1sounds like the way to do a world-load run. And yes, if #1323 lands, the per-pipeline hash bookkeeping could be shared.Tested (new head, same machine as in the description: RTX 5070, driver 621.40, Windows 11 Pro 26300, Rust 1.99.1, debug)
cargo test --workspace -- --test-threads=4: 780 passed, 0 failed, 41 ignored (681e0ab)XCL_DRED=1: 780 passed, 0 failed, 41 ignored; SKIPPED in both: the two no-wave64 tests andheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)AI use: Claude Code (Claude Opus 5.5) made the changes, ran the tests and drafted this reply.
@marquezinii on GitHub · 2026-11-24 18:41 UTC · original
@crosettiremi thanks, that's the first run of this with the title, and the case it was made for: a list stopped part way with a labelled compute pipeline. As you say, the CS bound there doesn't prove its dispatch hung the GPU. It narrows down which shader to look at first, which is what the line is for. I've added a pointer to your run under Not tested in the description, so it's clear that run was yours, on AMD, and not on this head.
AI use: Claude Code (Claude Opus 5.5) drafted this reply.
@LocranKing on GitHub · 2026-11-24 20:03 UTC · original
Independent GPU workspace tests and a paired 60 s retail
xcl-smoke v1regression run on NVIDIA RTX 3060 Ti (681e0abeb8627439b3035c5bd5e7e492420efdc7vs its basemain9e3831e1f570d3646e53ab753b19ec07eb8f1485).Setup
8024 MiB VRAM, wave32), driver32.0.16.210131.8 GBRAM26200rustc 1.100.0, DXC1.9.2602.17,--releaseWorkspace tests (
cargo test --workspace --release --no-fail-fast -- --test-threads=4)0: 780 passed, 0 failed, 41 ignored across 20 result blocks (SKIPPED: 2no wave64, 2no D3D12 debug layer,heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows).Regression run (
scripts/smoke.ps1, 60 s,XCL_NETWORK=0, title folder name redacted)main:1571 / 1566frames (100.3%),15224 / 14715 MBpeak commit (103.5%),0device removals,0crashes.Base (
main9e3831e):PR head (
681e0ab):Not tested: triggering an actual GPU fault with
XCL_DRED=1on a retail title, debug build, AMD / wave64 hardware.AI use: Antigravity (
Gemini 4 Neon) built and ran the test suite and smoke pair on this hardware and drafted this report from the captured outputs; reviewed before posting. No game files attached.@DavidM1911 on GitHub · 2026-11-24 20:12 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@marquezinii on GitHub · 2026-11-24 20:54 UTC · original
@LocranKing thank you, that's the smoke pair this PR was missing. I've copied both blocks into Regression run as you posted them, credited to you.
9e3831eis onmainand the PR block names the current head681e0ab.AI use: Claude Code (Claude Opus 5.5) drafted this reply.
@marquezinii on GitHub · 2026-11-24 22:00 UTC · original
Rebased onto
main1d027e5, because the PR no longer merged. The only conflict was theXCL_DREDparagraph inREADME.md, next to the new DirectStorage lines; the code is unchanged. The new head isc6067a6. Here,cargo test --workspace -- --test-threads=4gives 963 passed, 0 failed, 43 ignored, and the same withXCL_DRED=1.That leaves @LocranKing's smoke pair on the old head
681e0ab, so the description check needs a new one forc6067a6. @LocranKing, or anyone with a title: ascripts/smoke.ps1pair onmainandc6067a6would put it back where it was. I'll copy it in as before.AI use: Claude Code (Claude Opus 5.5) did the rebase, ran the tests and drafted this comment.
@ivall on GitHub · 2026-11-25 13:20 UTC · original
Merged as
379725a, thanks. It merged cleanly withmain1a0bbe3.cargo test --workspace --no-fail-fast -- --test-threads=4on the merged tree (with one other commit, the newer list layout's DispatchMesh slot): 1252 passed, 2 failed (fuzz_validate_and_gpu_1/_3, #2115, as onmain), 46 ignored. The four tests ofdred.rsare among the passed.XCL_DRED=1the only change on the path is theSetMarkerhook.AI use: Claude Code (Claude Opus 5.5) read it, ran the tests and wrote this on the maintainer's behalf.
@ -0,0 +104,4 @@pub fn forget_list(list: *mut c_void) {if on() {if let Some(m) = MARKS.lock().unwrap().as_mut() {m.remove(&(list as usize));@gut0to on GitHub · 2026-11-24 18:06 UTC · original
Could labels be retained per recording generation until the corresponding submission completes? D3D12 allows
Resetwhile a command list is still executing. If the old submission faults after this removes its labels and the same pointer has new labels, DRED looks up the old node by that pointer and can report the pipeline from the newer recording. Please retain the old labels until in-flight submissions can no longer reference them. AI-assisted review: I checked the Reset contract and traced the pointer-based DRED lookup.@ -0,0 +104,4 @@pub fn forget_list(list: *mut c_void) {if on() {if let Some(m) = MARKS.lock().unwrap().as_mut() {m.remove(&(list as usize));@marquezinii on GitHub · 2026-11-24 18:33 UTC · original
Done in 681e0ab: a Reset starts a new recording instead of dropping the old one; a list keeps its last 4, and a DRED node is matched to the newest recording with as many markers as its history. When the old and new recordings have the same marker count it still picks the newer one, so it is a heuristic. The unit test
a_fault_in_an_earlier_recording_finds_that_recordingcovers both cases. (Claude Code with Claude Opus 5.5 made the change.)@DavidM1911 on GitHub · 2026-11-26 05:48 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
@gut0to on GitHub · 2026-11-24 18:06 UTC · original · reviewed
AI-assisted review (GPT-6): I verified command-list reset semantics against the D3D12 API contract and traced the label lookup by list pointer.