D3D12.X: debug layer messages reach the log without ID3D12InfoQueue1 #1008
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!1008
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1008"
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?
@madaraXor on GitHub · 2026-11-24 10:20 UTC · original
madaraXor:d3d12-debug-messages-without-infoqueue1→main· +99 −6 · 2 files · 1 commits · draftWith
XCL_D3D12_DEBUG=1, the debug layer's messages reachedxcl.logonly through anID3D12InfoQueue1message callback. Windows 10 has noID3D12InfoQueue1: the cast fails withE_NOINTERFACE(measured on 19045 with the Agility SDK 1.620.2), the failure was ignored, and the log got no message at all. The debug layer was on but silent there, andtest_title_draws_with_a_root_signature_under_the_debug_layerpassed without seeing a single message.Without
ID3D12InfoQueue1, XCL now keeps the device'sID3D12InfoQueue, logs its stored messages with the same caps (8 per id, 3 000 in all) and clears it, at every submission and present (stop_if_device_removed). The messages that led to a device removal are logged before the removal. WithID3D12InfoQueue1nothing changes.What is in it
crates/xcl/src/hle/d3d12x/real.rs: the fallback toID3D12InfoQueue(poll_debug_messages, called first instop_if_device_removed). The callback and the poll sharelog_debug_message.crates/xcl/tests/debug_layer_log.rs(its own process): adds an application message to the debug layer's queue and expects it in the log afterstop_if_device_removed. Skipped without the debug layer.Tested
stable-x86_64-pc-windows-msvc; DXC 1.8.2502.11; tests in debug, runs in release.cargo test --workspace --no-fail-fast -- --test-threads=4on8dde8ff: 713 passed, 4 failed, 41 ignored, noSKIPPED. The same 4 fail onmain09940bb(712 passed, 4 failed, 41 ignored):xmem_virtual_query_marks_cpu_readable_memory(misaligned output buffer, #650 / #656) andplaced_title_textures_share_vram_and_preserve_pixelswith the two tests on its poisoned lock (#718, #447).cargo test -p xcl --test debug_layer_log: fails onmain(the message is not in the log), passes here.test_title_draws_with_a_root_signature_under_the_debug_layer: passes on both. Onmainthe test title's log has 0 debug layer messages, here 22 (none about a missing root signature).XCL_D3D12_DEBUG=1andXCL_NETWORK=0: 53 debug layer messages in 30 s here (20 errors, ids 538, 1047, 824, 723, 1422); none in a 35 s run onmain.Regression run
main:This PR:
The smoke runs do not turn the debug layer on: without it the new code is a lock on an empty slot.
Not tested
ID3D12InfoQueue1(Windows 11): the callback path is unchanged, but the new test was not run there (it should pass through the callback).AI use
🤖 Generated with Claude Code
@DavidM1911 on GitHub · 2026-11-24 11:22 UTC · original
Independent verification, merged onto current
main384f7f7locally (clean merge).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti + Radeon iGPU; Rust stable MSVC, debug.
cargo test -p xcl --test debug_layer_log: 1 passed —debug_layer_messages_reach_the_log(the new integration test).AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@jmal423 on GitHub · 2026-11-24 11:31 UTC · original · edited 2026-11-24 11:36 UTC
Windows 11 callback timing and per-ID cap on head
8dde8ff, RX 9070 XT (32.0.32029.2010), Windows Graphics Tools installed. I extended the integration test locally: required ID3D12InfoQueue1 on the real device, added the same application error 12 times, flushed the XCL log before the first stop_if_device_removed call, then called it twice and flushed again. Matching log lines: 8 before either call, 8 after both. This verifies immediate callback delivery and the 8-per-ID cap on this setup. The cap could also suppress duplicates, so the final count alone cannot establish whether polling was internally attempted. The Windows 10 fallback and concurrent writers were outside this test. AI use: Codex wrote and ran the scratch test and prepared this report.Follow-up below the per-ID cap: I injected three identical application errors in fresh processes using the same scratch binary. Matching log lines before polling / after one poll / after a second poll: native callback 3/3/3; forced fallback 0/3/3. The only runtime instrumentation was a short-circuit around callback registration; the device, queue and polling implementation were real. This verifies deferred delivery and no duplicate on a second empty poll in this single-writer Windows 11 test. It does not simulate concurrent insertion or Windows 10 interface discovery.
Concurrent-writer measurement on the forced polling path (same Windows 11 setup): seven distinct text markers sharing one application message ID, below the cap of eight. Each AddApplicationMessage succeeded. In 12 fresh processes where the poller waited for the writer to finish, the log retained 84/84 markers. In 12 fresh processes where the poller called stop_if_device_removed in a tight loop alongside the writer, followed by a final poll after join, it retained 35/84 (per trial: 1,1,1,1,1,7,5,4,1,7,5,1). This measures the snapshot/clear limitation already disclosed in the PR under synthetic contention; it is not an estimate of retail message loss. No game files or device removal involved.
Reproducer patch for
8dde8ff(test instrumentation only)Save the diff as queue.patch and run the following in PowerShell from the repository root. Change the adapter selector for other hardware. Run each mode in fresh processes several times because the concurrent case can pass. Count a run only if it prints observed=N/7. Without a real GPU backend or debug queue this integration test can return early and Cargo can still report success. The sequential control should print observed=7/7.
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.