D3D12.X: XG CopyInto/FromSubresource take the newer library's added argument #1435
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!1435
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1435"
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?
@lukastaro on GitHub · 2026-11-24 15:54 UTC · original
lukastaro:xg-copy-subresource-newer-form→main· +73 −3 · 1 files · 1 commits · openA retail game crashed during its world loading, every run: an access violation in a
memcpywriting to title memory that was never reserved, mapped or committed. The writer was XCL'sXGTextureAddressComputer::CopyFromSubresource(vtable #9), which the game calls as(linear dst, plane, subresource, 0, tiled src, row pitch, slice pitch): its XG library has a 32-bit argument before the source pointer, which the library the oracle test uses does not have. Read the 6-argument way, the source was the 0 dword with the stack slot's old upper half, and the row pitch the low half of the real source pointer, so the second row went gigabytes past the destination.The game calls both forms, so they are told apart per call: a value of 16 bits or less in the fourth slot with address space in use at the fifth is the newer form (address space, not readable memory: a title's pages are committed on first use). A nonzero added argument is logged once and ignored; its meaning is not known (the game passes 0).
What is in it
copy_argsand the two copy methods taking either form (hle/xg.rs).hle/xg.rs).Tested
cargo build --workspace, thencargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware– no wave64 on this GPU).Regression run
main:
PR:
An offline shader precompile ran on the same machine during the main run (and less of it during the PR's), so the frame and commit numbers differ more than the change does; the 60 s stay in the game's menus, before the copy this changes.
Not tested
xg_oracle.AI use
🤖 Generated with Claude Code
@futurepro62 on GitHub · 2026-11-24 16:53 UTC · original · edited 2026-11-24 17:09 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
14c8a2d(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.subresource_copies_take_both_argument_forms.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 18:52 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@iggyvilla on GitHub · 2026-11-25 08:03 UTC · original
Test report on
14c8a2d(merged with #2120 onmain cbc296aasb5c481f;cargo build --release -p xcl), 2 world-load walks on RX 6650 XT 8 GB (RDNA2)/ Adrenalin 32.0.21045.29003 / 32 GB RAM (
PRELOAD=0,XCL_PSO_WAIT_MS=2000,-FromSave, commit stop at 37.8 GB).Tested: same tree and runs as the #2120 report on this machine
(
b5c481f, walksauto-20261125-154354andauto-20261125-155228).What was measured: the PR's per-form logging fires once per copy form in
both walks —
in the 6-argument format 2.5 s / 2.7 s andin the newer 7-argument format 125.5 s / 126.9 s (during world load). No0x80000003and no
+0x4dcbc9din either log: the packet-stream assert did not fire here.Not tested: a run that reaches the account-prompt assert itself (these runs
come from a save); suite run on this tree; other GPUs.
AI use: Measured by an omp agent running DeepSeek v4.1 Flash; text drafted
by Muse Spark 1.3; checked and posted by Claude Code (Claude Opus 5.5) on my
behalf; I did not run the tests or write the text.
@xpatfussy69x on GitHub · 2026-11-25 11:57 UTC · original
Test report for head
14c8a2das pushed (not merged onto currentmain) – NVIDIA, wave32.Tested
.\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 752 passed, 0 failed, 41 ignoredsubresource_copies_take_both_argument_formsran and passedXCL_SAMPLE_*data set (game-data tests not run, so not with the title's realxglibrary)Not tested
mainAI use
@ClosetPie107 on GitHub · 2026-11-25 12:28 UTC · original
Linux / AMD RDNA4 (RADV) test report for head
14c8a2dmerged locally ontomain1a0bbe3(clean merge).Environment
experimental-11.0-20261112), vkd3d-proton v3.1 (#257+dxil-spirv53aac418), DXVKv3.1.1-209, DXC1.9.2609.5,x86_64-pc-windows-gnucross-compileTested (debug test binary under Wine,
--test-threads=1 --nocapture)hle::xg::tests: 4 passed, 0 failed, 0 ignored, 0 skipped (0.00 s), includingsubresource_copies_take_both_argument_forms.Not tested: full workspace suite, retail title run, native Windows.
AI use: T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran the tests on this machine, and drafted this report.
@Placebola on GitHub · 2026-11-25 17:07 UTC · original
Test report on
14c8a2dmerged ontomain06c9f55(clean merge, release build): it removes thememcpyaccess violation during the retail title's world load on this machine.Tested
xcl runon the retail title,XCL_NETWORK=0,XCL_RUN_SECONDS=200, A pressed every 4 s from 20 s, warm DXIL cache.main06c9f55alone: 2 runs out of 2 end with0xc0000005inVCRUNTIME140!memcpy(write past the destination, at 130 s and 138 s), called fromxcl::hle::xg::copy_from. One of my own manual runs onmainended the same way.main06c9f55+ this PR: 3 runs out of 3 reach 200 s with no crash and no device removal (2191 – 2466 frames shown). Each run logs both forms:called in the 6-argument format about 3 s, thencalled in the newer 7-argument format 133 – 161 s, which is whenmainalone crashes.This title calls both forms in the same run. #684 fixes the same crash, and an older tree of mine with it (
main9633138+ #684) got past this point too. But #684 readsCopyFromSubresourcein the 7-argument form only and leavesCopyIntoSubresourceas it is. This PR tells the two forms apart on every call, for both methods, so it covers more of what this title does.Not tested
cargo test,scripts/smoke.ps1; AMD; #684 on06c9f55.AI use
@DLampos on GitHub · 2026-11-25 19:06 UTC · original
Independent confirmation on Linux. This is not a run of this PR's commit: I hit the same crash on a retail title (build 1.0.2.1) and made the same change locally, on
mainatc160d86. In that change,copy_fromtakes the extrau32between the subresource and the source pointer. I did not build this PR's branch.Tested
x86_64-pc-windows-gnu(release), running under Proton Experimental's Wine 11 with DXVK's dxgi and vkd3d-proton. vkd3d-proton was built from Proton's commit 2576c0b4 with two local patches for XCL's vtable swap.VKD3D_CONFIG=no_upload_hvvto get past an unrelated vkd3d-proton abort.memcpycalled fromxcl::hle::xg::copy_from. The writes went to 0x8_070c_c5f0 – 0x8_4fe0_74a0, outside anything mapped.+0x979f31), dword 0 is at[rsp+0x20], the source at[rsp+0x28]and the pitches at[rsp+0x30]/[rsp+0x38]. Read as six arguments, the row pitch became the low half of the source pointer.no_upload_hvv.Not tested
AI use
@anes66 on GitHub · 2026-11-25 20:01 UTC · original · edited 2026-11-25 20:31 UTC
Native Windows reproduction on unmodified
main2898511, followed by CPU checks of this PR.A manual loading-screen run on Windows 10 22H2 / RTX 3060 12 GB ended at 612.097 s with a write AV in
VCRUNTIME140.dll+0x1cc83, destination0x808a1c840. The stack scan includes:Using the matching release PDB offline, Windows SDK
dbhresolvesxcl.exe+0x9d180toxcl::hle::xg::copy_from+0x2d0,hle/xg.rs:713, the row-copy call. This matches the first failure in #662. The run logged no0x8007000E, device-removal or GPU-wait-timeout message; that does not establish a general absence of memory pressure.Unmodified head
14c8a2dpasses all fourhle::xg::testshere. I added CPU coverage for pitched mips, array slices, depth/stencil planes, BC formats, volumes and reserved source addresses in #2483: six tests pass both on your head and when carried ontomaine0d93c8. The additional tests are authored underanes66; their dependency retains your original commit author.Not tested: a title run with this PR on this machine, GPU tests or the full workspace suite. A separate build is being prepared for a manual before/after check; there is no claim yet that it removes our crash.
Manual A/B follow-up, 25 November
The separate release build is now tested manually:
main2898511+ your exact runtime change (14c8a2d, cherry-picked ascb9041c) + the test-only commit, headaec6fa1. Same machine, title and launcher settings as the baseline. Existing caches and saves were retained, so this is not a cold-cache comparison.xg::copy_fromat 612.097 s.crash: null.This one run gets past the previous
copy_fromAV and remains alive until manual closure. It does not establish a general fix for the remaining loading/rendering stall. No title binaries, dumps or complete local logs are uploaded.@madaraXor on GitHub · 2026-11-25 21:55 UTC · original
Test report on the retail title: this fixes #646's
VCRUNTIME140memcpy crash here, and shows what the old reading does first. Tested commit:14c8a2d(this PR's head).Setup: RX 6700 XT (RDNA2), Windows 10 22H2, release build. Not plain
main:main 65fc114+ #1803, #2229, #2384 (with a local fix of its deadlock), #1790, #2385, #1795, #2246, then this PR merged on top (no conflict).XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_GPU_VIEW_BUFFERS=1, same input script in every run.Without this PR (two runs):
VCRUNTIME140.dll+0x1dcf3, write,rbx=0x40000 rdi=0x800, title frames+0x979f5b,+0x4fb0c2f,+0x50bb3f0. The return address on the stack isxg::copy_from+0x168, the instruction after itscall memcpy(disassembled with the build's PDB).0x45999000, the same value asr12in run 1's crash), and the "slice pitch" is the real row pitch. Rows 1 and 2 had already been written ~1.1 GB and ~2.2 GB past the destination, into memory the title owns, before row 3 reached an uncommitted page. Presents stopped 4 s later.With this PR: the log has
called in the 6-argument format 23 s andcalled in the newer 7-argument format 453 s, as the PR says. There is no XG write outside the destination and no crash to the end of the run, which then waits on driver compiles, a separate matter. The PR'ssubresource_copies_take_both_argument_formstest was not run separately here.The 464 s run was at 21.5 GB commit and 10 GB local VRAM, so on this machine #646's crash was not the commit wall.
Claude Code (Claude Opus 5.5): wrote this from the runs above (logs, cdb). Counts, times and RVAs only.
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.