D3D12.X: a direct list at a released compute list's heap vtable address gets the compute list's methods #2588
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#2588
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@SergeAx on GitHub · 2026-11-26 00:31 UTC · original
With the D3D12 Agility SDK 1.620, an open command list's vtable lives in heap memory and is freed with the list.
real::class_for(hle/d3d12x/real.rs) caches an adopted object's extended vtable by the runtime vtable's address, and copies the runtime's methods into it only the first time it sees that address. When a direct list's open vtable lands where a released compute list's was, the direct list gets the compute list's methods: itsClearDepthStencilViewmakesClosefail withE_FAIL.This is why
hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memoryfails now and then in parallel runs (Close().unwrap()atvram.rs:2040→0x80004005, reported in #42).Found on
6d12f58, debugMeasured
--test-threads=4 hle::d3d12x hle::xgameruntime(orhle::kernelxinstead ofhle::xgameruntime) fails that test in 2–5 runs out of 10. It never fails with the tests run one at a time, or with any singled3d12xsubmodule added.ClearDepthStencilViewon any DSV (also a new committed D32S8 target in a new heap) fails itsClose. The other commands of the test close fine, and the device is not removed.class_foron a list of type 2 (compute).ClearDepthStencilView) changes from the compute list's method to the direct list's. XCL's copy keeps the compute list's.Plan
A class made for a vtable outside any module keeps the runtime methods it copied, and
class_fortakes it only while they are still the ones at that address. Vtables in a module's image are looked up as before, at no extra cost. That test becomes the regression test.AI use: found with Claude Code (Claude Opus 5.5), which ran the measurements above and wrote this issue.