D3D12.X: a placed view's padding does not make a second texture #2764
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!2764
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2764"
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?
@GreemSC on GitHub · 2026-11-26 10:59 UTC · original
GreemSC:amd-dev-placed-key-padding→amd-dev· +20 −0 · 1 files · 1 commits · closed without mergingformat_alias::prepare_placed_srv_descandprepare_placed_uav_desckeyplaced_srvs/placed_uavsby (address, the 0x38-byte console resource description) and clear only0x34..of it. Bytes0x04..0x08are the padding betweenDimensionandAlignment; the retail title leaves stack bytes there, so the same view at the same address made a second PC texture, with its own views, whenever that padding differed. Both now clear it too.This is the
amd-devside of #2743;main'sresource_athas the same key and is fixed by #2762 (joeypercia). Spotting the padding came from the VIctory project's notes (GPL-3.0, read only; no code taken).What is in it
crates/xcl/src/hle/d3d12x/format_alias.rs: clear0x04..0x08in both prepares; testplaced_descs_ignore_the_padding_after_dimension(fails without the change: the key keeps the padding bytes).Tested
placed_descs_ignore_the_padding_after_dimensionandplaced_uav_and_srv_descs_are_sanitized: pass; the new test fails with the two lines taken out.xcllib suite under Wine,--test-threads=4, skippingpso_async::used_testsandlist_x::tests::a_dispatch_with_a_pipeline_still_building(they abort the binary onamd-dev, #2632): the binary still stops at the same test on this head and onamd-devb5c0275, after 1,046 ok / 84 failed here and 1,047 ok / 81 failed there. The failures are the same tests on both, plus 3 GPU tests on this run (gpu_qsad_and_mqsad,gpu_split_wave64_cross_half_operations,gpu_split_wave64_lane_local_masks) that pass run alone; the new test passes.amd-devb5c0275+ the Wine stack this machine needs (#1732 with #867/#871/#877, #684, #1860, a readback-list guard from #846) + a local counter of the table, warm caches, 200 s, one run each:placed_srvsentries at 150 sFewer objects; no memory difference measurable in a 200 s run (each entry is a few KB of host memory here).
Regression run
scripts/smoke.ps1, 60 s,XCL_NETWORK=0, A every 4 s from 20 s. No device removal or crash on either side; 99 % of the base's frames. The base is08db802(onmainand inamd-dev's history), notamd-dev's head. (Under Wine,amd-devwithout the Wine stack stops at ~2.5 s, so a pair from my machine would cover nothing.)Not tested
amd-dev's head, more than one run a side, the open world.AI use
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@Anon64 on GitHub · 2026-11-26 12:05 UTC · original
Regression run of
2469517on a newer retail title: no device removal, no crash, frames and commit within the limits.Setup: RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of this PR's base
08db802and of its exact head,scripts/smoke.ps1 -Game <title>for 60 s withXCL_NETWORK=0and A pressed every 4 s from 20 s.base:
this PR:
99 % of the base's frames, 83 % of its peak commit. One run each; the last-6-s rates and the commit vary between runs on this title, so they say nothing about this change by themselves.
Not tested: the suite on this head; whether the title creates placed views with padding in its first 60 s; AMD.
AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.
@oni-swr on GitHub · 2026-11-26 12:46 UTC · original
Independent amd-win test report for head
24695174(baseamd-dev= merge-baseb5c0275f), on real hardware.Hardware / env: AMD Radeon RX 7800 XT, driver 32.0.31035.1003; Ryzen 7 5700X3D; Windows 11 Pro 10.0.26200; rustc 1.100.0; debug build.
CARGO_TARGET_DIR=D:\xcl-2764-amdwin-target,-j 4on every cargo command. Synthetic tests only.Targeted (head)
cargo test -p xcl --lib -j 4 placed_: 5 passed, 0 failed, 0 ignored... placed_descs_ignore_the_padding: 1 passed (format_alias::tests::placed_descs_ignore_the_padding_after_dimension)... placed_title_textures_share_vram_and_preserve_pixels: 1 passed, ran on the GPU (no SKIPPED)x[0x04..0x08].fill(0)lines removed): the new test fails (leftkeeps216,126,63,1in bytes 4..8,righthas zeros). So the test does catch the bug. Working tree restored afterwards.Full
cargo test -p xcl --lib -j 4, head: the run aborted, no finaltest resultline. The test process died with0xc0000005 STATUS_ACCESS_VIOLATIONafter 1016 of 1572 results: 982 ok, 8 FAILED, 23 ignored, 4 SKIPPED (the f16 tests). The same command on base (b5c0275f) also aborts, with0xc0000409 STATUS_STACK_BUFFER_OVERRUN, after 1563 results: 1515 ok, 12 FAILED, 27 ignored, 4 SKIPPED. The crash is on base too, so it is not from this PR. The two runs cut off at different points, so their counts are not comparable.Failures on head, each rerun alone with
-- --exact, then on basegpu::dxil::kernel::dispatch_chain_native_wave64_builds_wholegpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barriergpu::recomp::lower_dxil::tests::f32_programs_on_the_gpugpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(#2115)hle::d3d12x::list_x::tests::bitset_runs_emit_exact_contiguous_page_rangeshle::d3d12x::list_x::tests::a_put_off_dispatch_runs_at_the_submit_when_its_build_outlasts_the_wait_budgethle::d3d12x::bind::tests::two_pass_binds_set_the_shared_view_heaphle::d3d12x::present::frame_dump_tests::compositor_releases_root_sig_and_rejects_invalid_planesAll six alone-failures also fail alone on base, so none come from this PR. The last two fail only inside the full run, on head and on base. That is cross-test interference on this adapter (or fallout from the crash), not a result of the PR.
Review: one file, +20 lines. The padding at
0x04..0x08of the 0x38-byte resource desc (betweenDimensionandAlignment) is zeroed in bothprepare_placed_srv_descandprepare_placed_uav_desc, and the callers (placed_uav_resource/placed_srv_resource) build their cache key as(va, prepared), so the fix sits where the key is made. The offsets are right: Dimension u32 @0, Alignment u64 @8, Flags @0x30. I found no defects. Coverage gap: the unit test only checks the prepared descriptor bytes. No test drivesplaced_srv_resource/placed_uav_resourcetwice with different padding and checks that only one texture is made. The GPU test above has no garbage in the padding. I did not run a retail title (synthetic tests only), so there is noxcl-smokeregression run. The PR touchescrates/xcl/src, so that block is still needed for the merge.Not tested: NVIDIA, wave32-only GPUs, any retail title, a full-suite run that completes (the lib run aborts on this adapter, on base too).
AI use: Claude Code (Claude Sonnet 5.5), coordinated by Claude Code (Claude Opus 5.5).
@SlopTart on GitHub · 2026-11-26 17:54 UTC · original
Linux (Wine) dual-lane run at head
24695174- PR itself is clean, but currentamd-devHEAD carries a lane-fatal failure this PR does not cause.Suite:
cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --test-threads=2 --skip gpu::.The PR's own change:
format_alias::tests::placed_descs_ignore_the_padding_after_dimensionran green on both lanes at this head.The branch-level finding (not caused by this PR): full-suite runs die before completion on BOTH lanes, at BOTH this PR head and bare
amd-dev(c32c91a3). The killer is always the same test:hle::d3d12x::list_x::tests::a_dispatch_with_a_pipeline_still_building_waits_at_the_submitSolo repro on each machine (
--exact), identical panic on both:What we see leading up to it: the stand-in pipeline for shader
0x7e57d001never completes its background build on either Wine lane. The dispatch-to-submit wait escalates in doubling retries (log shows #1, #2, #4, #8, #16), then the test's own budget assertion fires at ~10s. In full-suite context the process then dies hard instead of finishing the run: exit 5 on the rig, and on boxb an unhandled execute page fault with WineDbg attach (base run aborted with the PoisonError-style exit 9). Deterministic so far: 2/2 suite deaths + 1/1 solo on each machine.Cross-branch contrast: the identically-named test exists and passes on
main(8b957bec, measured today: rig 606/2, boxb 605/3) and onnvidia-dev(af2cecc4today: rig 869/6, boxb 865/10). So this looks specific to whateveramd-devcurrently does differently with that stand-in build under Wine, not to this PR and not to one vendor or one Wine stack.Not tested: whether the same death occurs on native Windows
amd-dev, we cannot run that.AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
@GreemSC on GitHub · 2026-11-26 18:43 UTC · original
@SlopTart thanks for the two-lane run. Same here: on
amd-devc32c91a3the lib run under Wine stops at the same place with and without #2842's changes, so it is the branch, not either PR (I'll namelist_x::tests::a_dispatch_with_a_pipeline_still_building_waits_at_the_submiton #2842 too). The change of this PR is already inamd-devasc093211e(cherry-picked by @raylitebull), so I'm closing this one.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@SlopTart on GitHub · 2026-11-26 21:09 UTC · original
Follow-up: amd-dev rewound to
b5c0275f- the Wine stand-in-build deadlock survives the rewind.Context for anyone tracking this branch:
amd-devis now force-moved back tob5c0275f, which is an ancestor ofc32c91a3- the rb_queue rework (and everything#2842stacks on) is off the branch. We re-ran both Wine lanes on the new tip today, same rigs and suite as our earlier rows (cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --test-threads=2 --skip gpu::; rig = Ryzen 9 9900X / RX 7900 XT / wine-11.0 Proton, boxb = i5-10600K / GTX 1070 / wine-10.0 + xvfb).AMD Wine lane (rig): still dies. Suite stops at 253 tests -
hle::d3d12x::list_x::tests::a_dispatch_with_a_pipeline_still_building_waits_at_the_submitFAILED and the process dies. Solo repro identical signature at all three shas we have now:So this is not an artifact of the dropped rework - the never-completing stand-in build for console shader
0x7e57d001predatesb5c0275fin the amd-dev lineage.NVIDIA Wine lane (boxb): the suite completes but the branch is deeply red. wine-10 survives the failing test, and the full run gives 770 passed / 22 failed / 4 ignored (797 run). The 22 include clusters nowhere near our usual vendor noise: 4 in
list_x(the killer test,a_put_off_dispatch_runs_at_the_submit_when_its_build_outlasts_the_wait_budget,bitset_runs_emit_exact_contiguous_page_ranges,write_buffer_immediate_on_open_existing_heap_visible_to_cpu), 6 inkernelx(4 alias, 1 sections, 1 physical-home), 3 insparse(incl.flush_parked_does_not_free_or_reuse_tiles_while_unmap_is_in_flight), and one-offs inambientsm5 compile,bindtwo-pass indirect, presentcompositor_releases_root_sig_and_rejects_invalid_planes,giant_driver_compiles_have_their_own_lane,class_for_rebuilds_when_heap_vtable_reused,title_bytes_are_used_in_place,serialize_root_signature, plus the two standing boxb reds (gpu_promoted_uav_clear_values,xma2_source_voice). Different branch, so this is the branch state, not a delta against our nvidia-dev numbers.Net for anyone rebasing onto this tip: the Wine lane cannot currently finish the suite on an AMD stack, and completes with 22 red on a NVIDIA one.
AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
@SlopTart on GitHub · 2026-11-27 08:25 UTC · original
Deadlock follow-up: still alive at today's amd-dev tip
bf7c82ee(3/3 on our NVIDIA+Wine lane; rig probe below).Solo run of
hle::d3d12x::list_x::tests::a_dispatch_with_a_pipeline_still_building_waits_at_the_submitat the new tip:dispatch 17 waited for the build (9.9253832s / 9.9218474s / 9.9210597s). Panic line moved with the rework: nowlist_x.rs:8508:17(was8277:17before the queue rework) - same test, same ~9.92 s signature, unchanged behavior across all four tips we've tracked (c32c91a3,344ce7b5,b5c0275f, nowbf7c82ee).dispatch 17 waited for the build (9.9727644s). Suite behavior at recent tips has been: dies partway (exit 5 / stops after 253 tests), consistent with the same stand-in build never completing.a_dispatch_with_a_pipeline_still_building_waits_at_the_submit ... FAILED), and the run then died withwine: Unhandled page fault on execute accessshortly after - the amd-dev suite no longer completes on the NVIDIA+Wine lane either (it finished 770/22 at the older tipb5c0275f).So whatever is happening in the shader-stand-in build path, it has survived the rb_queue rework and every subsequent amd-dev change we can see from two vendor stacks. The stand-in in our repro is
0x7e57d001.Machine details both lanes: rig = Ryzen 9 9900X, 96 GB DDR5, RX 7900 XT 20 GB (Mesa 26.2.5 RADV), Arch, kernel 7.2.15, wine-11.0 (Proton build), rustc 1.94; boxb = i5-10600K, 16 GB DDR4, GTX 1070 8 GB (550.163.01), Debian 13, wine-10.0, xvfb. Target
x86_64-pc-windows-gnurun under Wine,VKD3D_CONFIG=ignore_shared_fence.AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
Pull request closed