D3D12.X: release the interface returned by QueryInterface #1156
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!1156
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1156"
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?
@gloger2003 on GitHub · 2026-11-24 12:37 UTC · original
gloger2003:fix/d3d12-release-queried-interface→main· +45 −1 · 2 files · 1 commits · openD3D12 interface discovery now releases the reference through the interface returned by QueryInterface. In the DRED and debug-layer configuration, that pointer can belong to a different wrapper.
What is in it
Tested
Regression run
Minecraft Preview 1.18.3064.0, normal D3D12 mode with identical 1x game profiles.
main:
PR:
Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 12:48 UTC · original
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.
cargo test -p xcl --lib d3d12x::real: 19 passed, 0 failed — the QueryInterface release fix doesn't disturb the existing real-backend tests.QueryInterfacewhen the caller's contract doesn't need it — matches the README note; refcount tests ingameinput::tests::query_interface_validates_iids_and_refcountsalso pass.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@JoaoPauluu on GitHub · 2026-11-24 14:21 UTC · original
A regression run under Wine on Linux, on a retail title.
Tested
x86_64-pc-windows-gnu.256b3f2as it is (merge base47efa2e) andmain47efa2e, no uncommitted changes. Retail title 1.0.2.1,scripts/linux/smoke.sh(#257) for 60 s, no input. Twelve runs in a row,mainfirst and last, other PRs in between.Regression run
main (first run):
this PR:
The last
mainrun: 1425 frames,exit: 0x0, no device removal, no crash. Under Wine,peak commitreads 0 MB, so these blocks do not check memory.Not tested
AI use
@wondercrash on GitHub · 2026-11-25 05:54 UTC · original
Tested on
main6020a33+ this PR (256b3f2cherry-picked; same tree as the merge). With the D3D12 debug layer and DRED both on,maincrashes at the firstCreateCommandList, and this PR fixes it. Your unit test fails onmainand passes here. The suite shows no regression.Setup: RTX 5090 32 GB, NVIDIA 621.14 (32.0.16.2114), Ryzen 7 9800X3D, Windows 11 23H2 (10.0.22631.6199), inbox
D3D12Core.dllandd3d12SDKLayers.dll10.0.22621.5415 (no Agility SDK), DXC 1.8.2502.11 from Windows SDK 10.0.26100, Rust 1.96.0 MSVC, debug.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on6020a33+ this PR: 1149 passed, 6 failed, 46 ignored (not counting the scratch GPU check below, which ran in the same suite and passed).gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3fail withCreateComputePipelineState: ... (0x8007000E)(seeds 70, 545, 1019, 1507). The same four fail the same way on plain6020a33, so they do not come from this PR.frame::tests::origin_events_issue_tokens_and_flips_have_statistics("4 origins at 60 Hz took 249 ms") andkernelx::tests::fine_timer_makes_short_sleeps_short("Sleep(1) took 83 ms") are timing tests. Another heavy GPU/CPU job was running on the machine during the suite. Rerun in a filtered run of only these six tests, both pass on this PR and on6020a33.no wave64(gpu::recomp::lower,lower_dxil,recomp::tests), 3lower_dxilper-lane f16 forms refused (V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32, #1426), andheap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows.class_probe_tests::class_probe_releases_the_queried_interface(your unit test, added alone to6020a33): fails onmainatreal.rs:6578and passes with the fix.XCL_D3D12_DEBUG=1+XCL_DRED=1, D3D12.X real backend, thenCreateCommandAllocator,CreateCommandList,Close,ResetandCloseagain.6020a33: the test process ends with0xc0000005 STATUS_ACCESS_VIOLATIONright after XCL wraps the command allocator, duringCreateCommandList.ID3D12Resource2withPC vtable D3D12Core.dll+0x14c238(DRED's breadcrumb buffer, made through XCL'sCreatePlacedResourcehook and released through the debug layer's object) before the command list.On the
out == objbranch: we had made the same change on our side, but without that branch. Yours is better: inreadoptthe object already carries XCL's extended table, and its slot 2 is XCL'sReleaseoverride (cl_releaseand the like), not the native one.If you want the GPU check in the PR, here it is (
crates/xcl/tests/debug_layer_dred.rs). It skips without a GPU or without the debug layer (Graphics Tools):Not tested
6020a33+ this PR, with or without the debug layer.readoptpath (DMA lists) under the debug layer.AI use: omp with Claude Opus 5.5 ran the tests above on the machine named, wrote the GPU check and this report; no code changes to this PR.
@jessenic on GitHub · 2026-11-25 09:05 UTC · original
Test report: this PR fixes the start-up crash with
XCL_DRED=1andXCL_D3D12_DEBUG=1together on an RTX 5070 Ti too. Under a debugger, the crash without it is the path this PR changes.Setup: RTX 5070 Ti 16 GB (driver 610.88), Ryzen 7 9700X, Windows 11 Pro 26300, rustc 1.97.0, release. A retail title, on a local integration branch based on
main8f5fca5. This PR's256b3f2was cherry-picked on top cleanly.0xc0000005inD3D12Core.dll+0x6047b(a read at 0x0), at the title's firstCreateCommandListX. cdb (-o, D3D12 symbols from the Microsoft symbol server) gives this stack, outermost call at the bottom: With DRED on, D3D12Core makes each list's breadcrumb buffer through the hookedCreatePlacedResource.class_forthen probes the new object and callsReleasethrough the original object's vtable on the interface QueryInterface returned, as the PR description says. The same build withoutXCL_D3D12_DEBUGstarted normally.cargo test -p xcl --lib -- class_probe sparseon this tree: 23 passed, 0 failed, 1 ignored, includingclass_probe_releases_the_queried_interface.Not tested:
mainalone; AMD; the full suite on this tree; not ascripts/smoke.ps1regression run.AI use: Claude Code (Claude Opus 5.5) ran the runs and cdb on the machine above and wrote this report.
@Swagi-REDACTED on GitHub · 2026-11-25 11:15 UTC · original · edited 2026-11-25 11:31 UTC
NVIDIA startup validation of this fix, encountered while diagnosing A newer retail game.
Hardware: Ryzen 7 9800X3D, RTX 3060 12 GB (621.14), approximately 16 GB RAM, Windows 11 Home 26200; Rust 1.95.0 MSVC, DXC/DXIL 1.9.2602.17.
Before: local integration
cd3719f313a38e25fd45cf593145683a2922599a(#2057 reference plus #2046 and #541). WithXCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_DRED=1 XCL_D3D12_DEBUG=1 XCL_PSO_TRACE=1 XCL_COHERENT_MB=4095 XCL_NETWORK=0,xcl run <owned-title-folder>ended during startup with0xc0000005, a null read in D3D12Core. Symbolicating the matching XCL/PDB locatedreal::class_forandreal::dev_create_placed_resourceon the stack.After: cherry-picked only
256b3f2929e58a466b51ae8ca4fa6dcffabdbe14as local head46ce479. The same configuration passes that startup point, adopts both native and debug-layer resource interfaces, visibly reaches profile selection, and advances into loading. It subsequently ended during world setup with a GPU hang (0x887a0006) and the title's error breakpoint. The startup access violation did not recur. Resource-state/command-list validation errors and a separate mesh-pipeline rejection remain; this does not establish world rendering or prologue completion.Validation on the integrated tree:
cargo test --locked -p xcl --lib class_probe_releases_the_queried_interface -- --test-threads=1: 1 passed, 0 failed, 0 ignored; no explicit skips.cargo test --locked --workspace -- --test-threads=4, direct/heap/shadow off: 1,202 passed, 0 failed, 46 ignored, 21 result blocks; 25 explicit skip events (20 native-wave64, 3 unsupported per-lane f16, 1 heap-window-disabled case, 1 PSO measurement requiring Developer Mode).cargo test --locked -p xcl --lib gpu_ -- --test-threads=4, direct/heap/shadow on: 143 passed, 0 failed, 1 ignored; two native-wave64 skip events.cargo build --locked --release --workspace: passed, 46.34 s.This is not a clean main/PR-head smoke pair. Both sides also contained the same optional local input harness and a wrapping-arithmetic correction in the reference branch's texture-upload test-data generator. No assertions were weakened. No game data, dumps or screenshots are attached.
AI use: Codex, GPT-6 (exact serving variant not exposed), investigated the failure, integrated the existing patch, ran these commands and wrote this report. The interface fix remains its original author's work.
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.