XG: fix CopyFromSubresource 7-argument ABI and guard destination span #684
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!684
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-684"
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?
@JGonzalezRodriguez on GitHub · 2026-11-24 03:28 UTC · original
JGonzalezRodriguez:fix/xg-copy-from-subresource-abi→main· +149 −8 · 2 files · 1 commits · openFix
XGTextureAddressComputer::CopyFromSubresource(vtable slot #9) taking 7 arguments instead of 6, and validate the destination span before writing rows.CopyFromSubresourcereceives an extrau32parameter beforesrc(dst, plane, sub, arg4, src, row_pitch, slice_pitch). With the previous 6-argument signature,srcwas read asrow_pitch, causingcopy_nonoverlappingto stride rows by the low 32 bits of the source pointer and trigger access violations (#477, first crash in #662).Supersedes #539 (the other parts of #539 have either landed on
mainin #435 / #451 / #486 / #574 / #602 / #634 / #636, are covered by focused open PRs, or need a separate single-purpose PR).Fixes #477
Part of #662
What is in it
crates/xcl/src/hle/xg.rs:copy_from(vtable slot #9) and the module doc comment to the 7-argument signature(dst, plane, sub, arg4, src, row_pitch, slice_pitch).row_pitch, 3Dslice_pitch, and destination span readability (gpu::shader::readable) before copying, logging a bounded warning and returningE_INVALIDARGon invalid spans.copy_into_and_copy_from_round_trip,copy_from_3d_round_trip, andcopy_from_rejects_invalid_dst_span.crates/xcl/tests/xg_oracle.rs:CopyFromSubresourcecall insubresource_copies_match_the_console_libraryto the 7-argument signature.Tested
rustc 1.98.1, debug,x86_64-pc-windows-msvcviaclang-cl+lld-link+xwin):cargo check --workspace --target x86_64-pc-windows-msvc --tests: passed (0 errors, 0 warnings).wine-11.0) on AMD Ryzen 9 7950X3D + NVIDIA GeForce RTX 4090 (driver610.57.04), debug:xcl --lib hle::xg::tests: 6 passed, 0 failed, 0 ignored (rgba8_64kb_s_layout,d16s8_is_planar_depth_and_stencil,console_floats_are_32_bits,copy_into_and_copy_from_round_trip,copy_from_3d_round_trip,copy_from_rejects_invalid_dst_span).xg_oracle: 6 passed, 0 failed, 12 ignored (oracle tests return early withoutXCL_SAMPLE_XG).xgcommits from #539 were also independently tested against a retail title by @ddm-j in https://github.com/ivall/xcl/pull/539#issuecomment-7120523111 (confirmed validrow_pitch/slice_pitchand no access violation).Regression run
scripts/smoke.ps1runs (opened as draft until native Windowsscripts/test.ps1andmain+ PRxcl-smokeblocks are attached).Not tested
scripts/test.ps1(full workspace suite) andscripts/smoke.ps1regression runs (author builds on Linux/Wine).tests/xg_oracle.rswithXCL_SAMPLE_XGset against the consolexg_xs.dll.AI use
origin/main, refined the 2D/3D destination span check, wrote unit tests, ran cross-compile + Proton Wine checks, and drafted the PR description; reviewed by author).@jvyden on GitHub · 2026-11-24 03:37 UTC · original
This branch seems to fix #477 on Linux!
@eizispark on GitHub · 2026-11-24 03:43 UTC · original
Hardware check of
e56dbc3f4313e6950730ba4129c14b530b3e7e40(verified clean merge withmain91f9a5e): pass.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo test --workspace -- --test-threads=4:695 passed, 0 failed, 41 ignored(GPU tests skipped on this adapter:none)cargo test -p xcl --lib hle::xg::tests:6 passed, 0 failed;cargo test -p xcl --test xg_oracle:6 passed, 0 failed, 12 ignored(XCL_SAMPLE_*unset)Regression run
main(dd2ae9a):PR (
e56dbc3):Not tested
xg_oraclewithXCL_SAMPLE_XGset; gameplay past the menusAI use
scripts/smoke.ps1harness on this machine and formatted this report.@imnicho on GitHub · 2026-11-24 03:46 UTC · original
A retail run that reaches the call, on native Windows – the reports above cover the suite and the 60 s regression pair, which stay on the title's first screens.
Tested
XCL_NETWORK=0, a pad script (XCL_PRESS_AT), 240 s asked for, one run each:main63cdc25(this PR's base less its README commit)e56dbc3memcpywriting past the end of the unified memory's windows, with the same title frames on the stack as in #6620xc0000005CopyIntoSubresourcefits its six arguments in all 50 calls logged (24 of them on six-slice textures).cargo build --workspace && cargo test --workspace -- --test-threads=4one56dbc3(debug): 695 passed, 0 failed, 41 ignored (SKIPPED: the two wave64 tests);scripts/smoke.ps160 s, two rounds in turn:main91f9a5e1316 and 1381 frames,e56dbc31413 and 1373, exit 0 and no crash in all four.Not tested: AMD and Intel GPUs;
tests/xg_oracle.rsagainst the console's library (none on this PC); what the extra argument selects when it is not 0.One thing you may want: I had the same fix with a test of the title's own first call – BC7 512×512 with its full mip chain through both methods, level by level, nothing written between or after the rows; on
mainthat test process ends withSTATUS_ACCESS_VIOLATION, as the title does. It is atimnicho/xcl, branchxg-copy-from-args(00b384c), if you want to take it; I did not open a PR for it since yours covers the fix.AI use: Claude Code with Claude Fable 5.2 ran the builds, tests and runs and wrote this report; every number is from a run on the machine named. No game files are attached.
@MonkeyPython on GitHub · 2026-11-24 03:43 UTC · original · edited 2026-11-24 03:52 UTC
@odd/tasks/draft-pr684-comment.md
@itsd-effex on GitHub · 2026-11-24 03:53 UTC · original
Linux (Wine) run that reaches the call, with details for the one-line Linux report above.
Tested
e56dbc3with #273 (ce8839b, BC1) merged on top, merge53fcb50, no conflicts. Without BC1 this title doesn't reach the call on this machine: it stays on refused BC1 loads.GetState, the same as onmain).XCL_NETWORK=0: no AV incopy_from.maindd2ae9a+ #273, without this PR, faults there at ~184 s (ucrtbase.dll+0x171d9,rax=0x45999000= the source pointer read as the row pitch). With it, the run went on past that point.What came after
CommandList10::#101stub was first called at 159 s. At 200 s the title's GPU watchdog fired (GPU Loc Sig7333478din its Breakpad log), followed by its null write atgame+0x23cf683. That's the #505 stop. Its crash reporter then tried to upload tosubmit.backtrace.io, andXCL_NETWORK=0refused it (WinHttpConnect fails).Not tested: Windows. The workspace suite: XCL doesn't build or run tests on Linux, so only the cross-built binaries ran. This PR without #273 on a run that reaches the call.
AI use: Claude Code (Claude Opus 5.5) built the branches, read the logs and the kernel journal, and drafted this comment. The runs are mine, on the hardware above.
@theaustinayers on GitHub · 2026-11-24 03:57 UTC · original
Test report on native Windows for
e56dbc3(this PR's head), since the description has no Windows run yet. Written with Claude Code (Claude Fable 5.2) from runs on my machine; the blocks below are the unedited output ofscripts/smoke.ps1.Tested
cargo build --workspace, thencargo test --workspace -- --test-threads=4: 695 passed, 0 failed, 41 ignored.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.cargo test -p xcl --lib hle::xg:copy_into_and_copy_from_round_trip,copy_from_3d_round_trip,copy_from_rejects_invalid_dst_spanand the three olderxgtests pass.cargo test -p xcl --test xg_oracle: 6 passed, 12 ignored (subresource_copies_match_the_console_libraryamong the passed).Regression run (a retail title, 60 s, no input)
main (
91f9a5e, this PR's merge base):this PR (
e56dbc3):Not tested
CopyFromSubresourceat all in those 60 s: the run stays at its first menu, and the new warning for an invalid span was not logged. So this is a regression check, not a confirmation of the 7-argument layout on a retail title.@mastrr9 on GitHub · 2026-11-24 04:10 UTC · original
Code audit + NVIDIA RTX 5080 test run on
e56dbc3f4313e6950730ba4129c14b530b3e7e40:Review
CopyFromSubresourcesignature andchecked_mul/checked_addspan overflow guards cleanly fix the stride crash in #662 / #477.xg.rs:731:gpu::shader::readable(dst as usize, span)only rejectsPAGE_NOACCESS | PAGE_GUARD, so aPAGE_READONLYdestination would still pass and fault on write (andsrcis not checked forreadable(src + at, t.size())beforeslice::from_raw_parts). Checking writability fordstand readability forsrcwould make the guard complete.Tested
rustc 1.100.0(MSVC), debug build.cargo build --workspace && cargo test --workspace -- --test-threads=4: 695 passed, 0 failed, 41 ignored.copy_into_and_copy_from_round_trip,copy_from_3d_round_trip,copy_from_rejects_invalid_dst_span: all passed.SKIPPEDGPU/D3D12 tests:gpu_geometry_wave32_prefix_count_over_a_mask/gpu_wave32_program_in_wave64_hardware(no wave64), plus 2 D3D12 debug-layer tests (no d3d12SDKLayers.dll).Not tested
scripts/smoke.ps1run (test suite only).AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.
@Royalflamejlh on GitHub · 2026-11-24 06:10 UTC · original
Linux + NVIDIA run that reaches the call:
maine50836bfaulted incopy_fromat 85.9 s, ande50836bmerged with this PR's heade56dbc3(no conflicts) did not fault and logged the newinvalid spanwarning 0 times.Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (X11), vkd3d-proton 3.1 with the relaxed-vtable patch from #175 and a local dxil-spirv patch,
VKD3D_CONFIG=ignore_shared_fence. RTX 4060 Ti 16 GB (driver 615.71.09, 32-lane waves), Ryzen 9 9950X3D, 64 GB RAM. Release, cross-compiled tox86_64-pc-windows-gnu(rustc 1.98.0), DXC 1.9.2609.5,XCL_NETWORK=0. The title of #662, first boot (no save), one A press at 44.8 s throughXCL_PRESS_AT, 130 s asked for, 1 run each.maine50836be50836b+e56dbc3copy_fromCopyFromSubresource invalid spanwarnings0xc0000005inmsvcrt.dll+0xa4f9game+0x23cf683The fault on
main:xcl.exe+0x11fcd8is insidexcl::hle::xg::copy_from(nmon this build). These are the title frames of #662.With the PR, the title presented for about 14 s more and then stopped, and its watchdog ended it 29 s later.
Wait64BitValueX timed out after 2000 mswas logged 15 times from 101.3 s to the end of that run. That is the stall of #662, not this PR's.Not tested: the
cargo testsuite and the three newxgtests; native Windows; AMD and Intel; a second run of either tree;mainaftere50836b(nowbeaa245, which does not touch the two files of this PR).AI use: Claude Code (Claude Fable 5.2) read the diff, ran both builds of the title on my machine with
XCL_PRESS_AT, compared the logs and drafted this report.mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@jvyden on GitHub · 2026-11-24 10:11 UTC · original
@ivall, this is missing the regression run in the main body but this has other people running them. It's critical to get Linux working - I've been using this patch for a few hours now and it's stable. This is a good merge, so I figured I'd ping incase it dropped under your radar
@sander110419 on GitHub · 2026-11-24 10:22 UTC · original
Test report on Linux (Wine), the newer retail game in the README table:
x86_64-pc-windows-gnu; DXC 1.9.2609.5mainof today plus several open PRs (among them the vtable part of #867, without which the title does not start under vkd3d-proton)Without this PR, Series X mode, 105 s into world loading:
unhandled exception 0xc0000005 in msvcrt.dll+0xa4c9 (write at address 0x7fef77990)inxg::copy_from(xg.rs:713,xcl.exe+0x3f7405). The write address isdst+ 0x395ce990, which is the low 32 bits of the tiled source pointer (0x7395ce990): the pointer is read as the row pitch, as this PR describes. The title's two call sites of slot #9 (game+0x979e96andgame+0x979f57) both pass(dst, 0, sub, 0 as a 32-bit store, tiled src, row pitch, slice pitch).With this PR (
3ae0841) merged on that base: Series X ran to 163 s, Series S runs to 142 s and 113 s. None crashed incopy_from; they ended in GPU device loss and the+0x23cf683stop from #505.A side note in case someone extends this to slot #8:
CopyIntoSubresourcedid not change in this title. It calls #8 about 10 s in with a heap pointer (0x48d7390) in the 5th argument, the old place. When I tried the 7-argument form for #8 too, it crashed 20 s in, reading through the argument that was then taken for the source. So the change to #9 only, as here, matches what the title does.Not tested: Windows, AMD,
cargo testof this PR on its own base.AI use: Hermes agent with Claude Opus 5.5 (
claude-opus-5-5) ran the builds and the game, and wrote this report; I checked it.@frozht on GitHub · 2026-11-24 10:23 UTC · original
Test report: this fixes a crash on retail GTA6 under Wine.
e56dbc3, on main077ce40plus open PRs, RX 7900 XT RADV (Mesa 26.2.6), Wine 11.22 Staging, release build.hle::xg::copy_from(xg.rs:713), writing a 0x800-byte row to 0x83a0f6110, which is neither committed nor lazy (callergame+0x979f5b).CopyFromSubresource invalid spanwarnings over a 1131 s run. The game gets to the fade into its intro cutscene (1096 s).hle::xgtests under Wine: 79 passed, 0 failed (6 of themhle::xg::tests, includingcopy_from_rejects_invalid_dst_span).xg_oracle: 6 passed, 12 ignored. Those 6 do nothing withoutXCL_SAMPLE_XG.xg_oracleagainst the console DLL.@NicolaiVdS on GitHub · 2026-11-24 11:04 UTC · original
Linux (Wine) report on NVIDIA, with runs that reach the call.
Tested
xcl.execross-built in release forx86_64-pc-windows-gnu(MinGW), rustc 1.99.0.main09940bb+ #867 atdfe1aaa+ a small local change on top of #867 (XCL's own fences go through itsunwrap_fence) + #684'se56dbc3and #794'sbee31d5cherry-picked. Not this PR's head on its own.cargo test --release --target x86_64-pc-windows-gnu -p xcl --lib -- hle::xg::tests hle::user::tests, run under that Wine: 10 passed, 0 failed, 0 ignored.copy_fromat 105 s and 132 s,ucrtbase.dll+0x171d9, a write at0x803b29640/0x84c248e80,rax=0x45999000(the low half of the source pointer, used as the row pitch). The title calls slot 9 fromgame+0x979e96andgame+0x979f57withr8d = 0,r9dfrom the caller's object ([rdi+0x18]), aDWORD 0at[rsp+0x20], the source at[rsp+0x28]and the two pitches at[rsp+0x30]/[rsp+0x38]. A scan of the exe for calls through slot 8 or 9 with that argument shape finds only these two, both with the extra argument 0.XCL_NETWORK=0,XCL_PRESS_A_AT=25,40,55): theCommandList10::#101stub at 82 s, then no access violation incopy_fromand no "invalid span" warning. 10 s later GE-Proton's own vkd3d-proton crashed ind3d12core.dll(one frame repeating on the stack; it looks like #611). With #775's vkd3d-proton instead, the run went on to the #505 watchdog at 115 s (GPU Loc Sig7333478d).Not tested: Windows; the whole workspace suite (only the two modules above, under Wine);
xg_oraclewithXCL_SAMPLE_XG;scripts/smoke.ps1; this PR without #794 and #867.AI use: Claude Code (Claude Opus 5.5) read the logs and the title's call site, built the branches, ran the tests and the scripted runs, and wrote this report. The runs are on my machine, on the hardware above.
@madaraXor on GitHub · 2026-11-24 11:16 UTC · original
Tested on RDNA2: this removes the
copy_fromAV at the end of the retail title's loadingSetup: AMD Radeon RX 6700 XT 12 GB (driver 32.0.21045.29003), Ryzen 5 5600X, 16 GB RAM, Windows 10 Pro 22H2 (19045.6466) with the Agility SDK 1.620.2, Rust 1.90.0 MSVC, release, DXC 1.8.2502.11. Retail 1.0.2.1,
XCL_NETWORK=0,XCL_ACTIVITY=1, menus passed withXCL_PRESS_AT, warm caches, a save past the first-run setup.main6efdabc, run 10xc0000005 in VCRUNTIME140.dll+0x1dcf3 (write at address 0x808314860)at 537.9 smain6efdabc+ #488 (to rule out #467)0x8086fae80); no lazy commit failure in the crash linemain6efdabc+ this PR's diff (e56dbc3)+0x23cf683)xcl::hle::xg::copy_from+0x168,xg.rs:712: the case this PR fixes. The faulting address is inside the title's 24 GB reservation (0x7ffff0000,0x600000000bytes).bind::set_pipeline_state→pso_async::resolve_for_bind→resolve_wait(noXCL_PSO_WAIT_MS), and two unnamed threads are insideamdxc64.dll. The last compute PSO logged took 18 512 ms in the driver (299992 B DXIL). Presents stopped at ~593 s, the watchdog fired at 622 s. That is the pipeline-wait stop from #505, not something in this PR.Not tested: the full suite with this PR; NVIDIA; #976 / #992.
AI use: Claude Code, Claude Opus 5.5 ran the builds and runs on my PC, symbolized the stacks and wrote this comment. Counts, offsets and timings only.
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@tiagonleal on GitHub · 2026-11-24 13:25 UTC · original · edited 2026-11-24 14:34 UTC
Windows / NVIDIA retail test of
e56dbc3f43merged ontomain47efa2e(clean merge, merged tree535a139).Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4(debug) on the merged tree: 744 passed, 0 failed, 41 ignored. SKIPPED:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64).XCL_NETWORK=0 XCL_PSO_WAIT_MS=50 XCL_PRESS_AT=30:A, into world loading. All four runs below with warm DXIL and driver-blob caches (only 1–5 compute builds over 5 s per run):main+0x23cf683write at 0x0, 146.7 smain+0x23cf683, 177.0 sD3D12 device removed: 0x887a0006, 135.9 s+0x23cf683, 239.5 sEarlier the same day, on
mainwith the same settings, one of three runs ended at 108.7 s inVCRUNTIME140.dll+0x1c45a(0xc0000005, read at0x825210000); it did not happen in these runs, so I cannot say whether this PR is what removes it (the log has noCopyFromSubresourceline in any run).Edit: two later runs with this PR (same tree, same settings) had presents end at 120 and 116 s, ending in
+0x23cf683at 172.7 s and inD3D12 device removed: 0x887a0006at 163.6 s. Runs of one build vary a lot here, so the 210 s run above is not a reliable gain; theVCRUNTIME140fault did not appear in any of the four runs with this PR.Not tested: more runs (two per build is a small sample; the
mainruns had an Idle-priority shader precompile running alongside); AMD / Intel; Windows 10.Run and written with Claude Code (Claude Opus 5.5).
@vitor127wt on GitHub · 2026-11-24 22:58 UTC · original
The #684 diff
91f9a5e9f031..e56dbc3f4313prevented thexg::copy_fromaccess violation in a matched 150 s retail A/B on #1798 head55e7beb6de9fplus the same #899 wait instrumentation. The control hit0xc0000005at 122.140 s, symbolized toxg.rs:713. With #684 the timer ended the title at 150.000 s, exit 0, with 1,701 PresentX calls and zero crashes. The activity interval ending at 118.129 s and each later interval recorded zero presents. Both Linux scopes had zero OOM kills.RTX 5070 Ti (driver 620.73.04), Ryzen 7 9700X, 32 GB DDR5, CachyOS 7.3.5-2-cachyos, Proton Experimental
experimental-11.0-20261112-x86_64, vkd3d-protonec20719452e9, DXC 1.9.2609.5. The exact build and run commands, commits and wait counts are in the full A/B report on #1798.AI use — OpenAI Codex (GPT-6, exact variant unavailable) ran the tests, symbolized the failure, and drafted this report.
@relativespace2K on GitHub · 2026-11-24 03:53 UTC · original · edited 2026-11-25 04:10 UTC
Tested -
e56dbc3onmain3da2abb, retail GTA6 1.0.2.1Tool: OpenCode with DeepSeek V4.1 Flash 1017
dxcompiler.dll(xcl-dxc-2thread, deeprecursion in the DXC stack) - it did not reproduce at 240 s, so it looks like a DXC
stack overflow on a large shader under memory pressure, not the XG ABI path.
CopyFromSubresource-related failures observed.Tested - native Windows, AMD RDNA2
e56dbc3f4313e6950730ba4129c14b530b3e7e40(based on91f9a5e;mainhas since advanced tof4ce27c).Windows 11 IoT Enterprise LTSC 26100 (native D3D12, no Wine/Proton);
Rust 1.100.0
stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug; noXCL_SAMPLE_*.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4:692 passed, 3 failed, 41 ignored, 0 SKIPPED.
main91f9a5e(689 passed, 3 failed, 41 ignored) and untouched by this PR: the packed-mip
3D 64x64x64 4 mips: subresource 2 mismatch(#470) and the twoPoisonErrorfollow-ons (#673). This PR adds the three new XG tests and no new failure.
cargo test -p xcl --lib hle::xg::tests: 6 passed, 0 failed, 0 ignoredcopy_into_and_copy_from_round_trip,copy_from_3d_round_tripandcopy_from_rejects_invalid_dst_spanpass, and the invalid-span guard logs theexpected refusals (
row_pitch=0x40000000, and a 4-deep 3D span).cargo test -p xcl --test xg_oracle: 6 passed, 0 failed, 12 ignored.Not tested: the #477 crash through a retail title (
XCL_SAMPLE_XGunset),release build, NVIDIA / Intel.
AI use: OpenCode with DeepSeek V4.1 Flash 1017 ran the tests and drafted this report.
@JJAutoCompare on GitHub · 2026-11-25 06:24 UTC · original
Empirical test report (
e56dbc3f)Hardware / environment
e56dbc3f4313e6950730ba4129c14b530b3e7e40(PR #684), verified after detached checkout.10.0.26200.9974, AMD Ryzen 7 3800X 8-Core Processor.1.100.0 (0ef1bc386 2026-11-09), hostx86_64-pc-windows-msvc, Cargo1.100.0. DXC1.9.2609.5 (01b62ad47).Invoke-ArcTest.ps1.Commands and results
cargo test --workspace --no-runexited0and compiled all workspace test binaries, includingxg_oracle. This was a build-only command.cargo test -p xcl --lib hle::xg::tests::copy_ran withXCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1. Exit0, 3 passed, 0 failed, 0 ignored, 0 skipped, 673 filtered out. The skip count comes from case-sensitive^SKIPPEDlines in the captured output.Observed behavior
CopyFromSubresource.E_INVALIDARGfor an undersized row pitch, an oversized destination span, null source and destination pointers, and an undersized 3D slice pitch.Not tested
subresource_copies_match_the_console_library.AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr684-focused.log and published.
@ozimchuk on GitHub · 2026-11-25 09:41 UTC · original · edited 2026-11-25 10:03 UTC
Test report: this PR gets the retail title past its world load on Linux, where
maincrashes incopy_fromevery time.Tested – NVIDIA (32-lane waves), Linux, Wine + vkd3d-proton (
VKD3D_CONFIG=ignore_shared_fence), release build forx86_64-pc-windows-gnu, the newer retail title of #662, 300 s runs, A pressed every 8 s:main568e7db: two runs crash at the world load (80.7 s, 88.6 s) with0xc0000005inxg::copy_from(hle/xg.rs:713), a write to an unmapped page (0x80a293410,0x80a10b260) – the first crash of #662.568e7db+ this PR (e56dbc3, merges cleanly): the world loads at 77.7 s and the title runs on past it; no fault incopy_from. It stops 54 s later on a different, known crash in the title's own code (0x80000003), which this PR does not touch.mainc4d37be+ several open PRs) got past the world load in all 18 of its 300 s runs today, with no fault incopy_from; 17 ran the full 300 s, one ended later when the GPU driver ran out of system memory. (Corrected: this said "with no crash".)Not tested: Windows, AMD; the destination-span guard on its own (no run hit it).
AI-assisted. Claude Code, Claude Opus 5.5.
@DavidM1911 on GitHub · 2026-11-25 12:06 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@7yww8j5hyb-web on GitHub · 2026-11-25 20:46 UTC · original
Confirmed on a second retail title, GTA (Xbox Series, gta5.exe), native Windows, RTX 3050 8 GB, 32 GB RAM, xcl main
0829441.Without the extra argument, CopyFromSubresource reads the source pointer as the row pitch (0x458a9000). The copy is refused (destination span 0x227fbd7800 is not committed), and the game then crashes: read of 0xffffffffffffffff at gta5.exe+0x5228010.
With slot 9 as (dst, plane, sub, flags, src, row_pitch, slice_pitch), row pitch is 0x800 or 0x100, the copy succeeds, and that crash is gone. The title gets into shader compilation.
@itsSio on GitHub · 2026-11-26 04:22 UTC · original
Independent dual-PC NVIDIA full-workspace test report on clean head
e56dbc3f4313e6950730ba4129c14b530b3e7e40.Tested
32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200,rustc 1.97.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5, debug build (XCL_ADAPTER=NVIDIA)cargo build --workspace: exit 0cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 695 passed, 0 failed, 41 ignored (xg::tests::copy_into_and_copy_from_round_trip,copy_from_3d_round_trip,copy_from_rejects_invalid_dst_span, andxg_oracle6 passed / 12 ignored all pass)SKIPPED: 2 (wave64-only GPU tests)32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200,rustc 1.99.1(stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC1.8.2502.11, debug build (XCL_ADAPTER=NVIDIA)cargo build --workspace: exit 0cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 695 passed, 0 failed, 41 ignored (allxgcopy_fromtests andxg_oraclepass)SKIPPED: 4 (same 2 wave64 tests plus 2 requiringd3d12SDKLayers.dll)Not tested
scripts/smoke.ps1runs--release)AI use
Ran via Samaritan:
@throny on GitHub · 2026-11-26 06:10 UTC · original
Two contributors checked independently and found that #1435 solves the same problem (for #662) in a different way: #1607, group D124. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@ClosetPie107 on GitHub · 2026-11-26 06:06 UTC · original · edited 2026-11-26 06:17 UTC
Tested on AMD RDNA4 / Linux (Proton Experimental), merged cleanly onto
main(b49be183) alongside #871 (8f08d7cd), confirming @St5sz2Jk's report on #871:Hardware & environment
experimental-11.0-20261112),vkd3d-protonmasterec207194(3.2.0) +dxil-spirvb540c8a2+ relaxed-vtable patch (-Db_ndebug=true), DXVKv3.1.1-209, DXC1.9.2609.5, Rustx86_64-pc-windows-gnuTargeted unit tests (head
e56dbc3fmerged ontomainb49be183+ #8718f08d7cd, debug,--test-threads=1):xcl.exe hle::xg::tests -- --test-threads=1: 6 passed, 0 failed, 0 ignored (0 skipped).Retail title verification (1.0.2.1, pressing
Apast menus, 300 s, release)Flags:
XCL_DIRECT_DXIL=1,XCL_TEXTURE_LEVEL_PAGES=1,XCL_PSO_WAIT_MS=50,XCL_SPLIT_MIDLIST_WAIT=0,XCL_COHERENT_MB=1024,VKD3D_CONFIG=ignore_shared_fence,XCL_PSO_PRELOAD=0,XCL_NETWORK=0.0xc0000005crash at76.600 sreading0x400016000inxcl::hle::xg::copy_from (xg.rs:712)→tiling::Chain::detile_level (tiling.rs:464).e56dbc3f): sailed right past76.6 sand completed the full 300 s (exit=0, 0 crashes, 0xg:warnings, 0 device removals) both onmain + #871 + #684and onmain + #871 + #684 + #1993(16,384translated draws,22,268dispatches,1,620PresentXframes).Not tested
tests/xg_oracle.rswithXCL_SAMPLE_XG, or full workspace test suite.AI use
main, ran the Proton unit tests and retail runs on this machine, and drafted this report.@bmjask on GitHub · 2026-11-25 21:15 UTC · original · reviewed
P1: copy_from validates dst with gpu::shader::readable, which accepts committed PAGE_READONLY pages, then raw copy_nonoverlapping writes and can AV. Validate writability or use a fault-safe process write; validate src before raw slice/detile too. P2: readable rejects spans >256 MiB, but valid XG 16,384x16,384 4-Bpp subresources reach 1 GiB, so valid calls become E_INVALIDARG. Use a destination-specific region validator without this cap/iterate regions. Add read-only dst, invalid src, and >256 MiB valid-span tests.
xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590View 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.