D3D12.X: null ID3D12Heap::GetDesc returns the full 48-byte heap desc #2792
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2802"
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 oni-swr on 2026-11-26T13:51:02Z.
The null backend's
ID3D12Heap::GetDesczeroed only bytes 0-39 of the 48-byteD3D12_HEAP_DESC, soFlags(offset 40) kept whatever the caller's buffer held. The null heap now keeps the desc it was created with andGetDescwrites all 48 bytes.Fixes #2783
What is in it
crates/xcl/src/hle/d3d12x/null.rs:CreateHeap/CreateHeap1keep the desc (new_heap),Heap_GetDesc48writes all 48 bytes in both calling orders, and the now unusedHidden_ZeroDesc40is removed. The other nullGetDescslots (command queue 16 bytes, descriptor heap 16 bytes, resource 56 bytes) already match their structs. Testheap_get_desc_fills_all_48_bytes: sentinel-filled buffers, both orders, and a heap created without a desc reads back zeroed.Tested
cargo test -p xcl --lib -j 4 d3d12x::null: 7 passed, 0 failed, 0 ignored, 1330 filtered out00b0d9c4(clean detached checkout, RX 7800 XT driver 32.0.31035.1003, noXCL_ADAPTERset, debug):cargo build --workspace -j 4, thencargo test --workspace -j 4 --no-fail-fast -- --test-threads=4: 1435 passed, 1 failed, 47 ignored over 37 test binaries (lib: 1309 passed, 1 failed, 27 ignored). 7 SKIPPED messages: sixf16_programs_on_the_gpu/f32_programs_on_the_gpucases the lowering refuses (V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32) andheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).heap_get_desc_fills_all_48_bytespassed.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1("seed 722: res[30] = 0x1, CPU 0x7fffffff", #2115). It fails the same way, same seed, onmainate120925e, so it is not caused by this PR.cargo clippy: nothing new on the changed linesRegression run
Same title, 60 s each, same machine, one after the other (RX 7800 XT). Blocks pasted unedited from
scripts/smoke.ps1.main:
PR:
Not tested
AI use
mainwere made with Claude Code (Claude Sonnet 5.5), which also added them to this description.🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by ettehn on 2026-11-26T14:10:44Z.
Independent Windows A/B of the null device’s
CreateHeap1(slot 54) followed byGetDesc(slot 8), using the same test onb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7and00b0d9c4d58d9412f52367c55f6c3db48e974394. The output descriptor was prefilled with0xA5and had distinct guard bytes on both sides.Flagsat0xA5A5A5A5with either argument order and failed the descriptor round-trip assertion.Flags = 0x80, returned the caller’s output pointer in both argument orders, and preserved both adjacent guards.Windows 11 build 26200, Ryzen 9 8945HX, Rust 1.97.1 MSVC debug.
cargo test --locked --offline -p xcl --lib -j 2 -- hle::d3d12x::null::tests:: --test-threads=1 --nocaptureon the PR plus the probe yielded 8 passed, 0 failed, 0 ignored, no reported skips. The main control ran just the probe and reproduced the expected failure. This check covers the null ABI path. No retail title or full workspace suite was run.OpenAI Codex assisted with the test and verification. The exact model identifier was unavailable in this session.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-26T17:51:08Z.
Linux (Wine) dual-lane run at head
00b0d9c4Suite:
cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --test-threads=2 --skip gpu::.Fresh
mainbaseline measured today at8b957becfor reference: rig 606/2 (reds:gpu_promoted_uav_clear_values_pass_create_committed_resource,xma2_source_voice_decodes_and_manages_lifetime), boxb 605/3 (those two pluswrite_buffer_immediate_on_open_existing_heap_visible_to_cpu). Note main's older third red on the AMD lane (sparse::a_tile_decommitted_and_committed_again_keeps_its_video_memory) is gone at current main — fixed upstream, we can confirm.Results at
00b0d9c4: rig 597/3, boxb 597/3. The newnull::tests::heap_get_desc_fills_all_48_bytesis green on both lanes. On the rig the third red is that stalesparse::one — the head branches from an older main that still carried it; on boxb the red set is identical to current-main baseline (that test is green on Pascal there). No red anywhere is introduced by this PR.Conclusion from two vendors: the null-device
ID3D12Heap::GetDescfull-48-byte fill behaves as the test expects under both Wine stacks. A rebase onto current main would make the rig's third red disappear on contact.Not tested: the real-device
ID3D12Heap::GetDescpath (that is the standingreal::suite's job).AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:00:02Z.
Triage (#1607) – head
00b0d9c#2846 fixed the same bug (bytes 40-47 of
D3D12_HEAP_DESCleft untouched by the null heap'sGetDesc) by zeroing 48 bytes; it is closed. This PR goes further:new_heapkeeps the created desc andHeap_GetDesc48returns it, with a test of both calling orders and the null-desc case. Main still writes only 40 bytes (Hidden_ZeroDesc40).No problems found in the diff (
NullObj::descis 64 bytes, so the 48-byte copy fits).Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.