Repository navigation
Conversation
…rgument A retail game crashed during its world loading, every run: an access violation in a memcpy writing to title memory that was never reserved, mapped or committed. The writer was XCL's XGTextureAddressComputer::CopyFromSubresource (vtable xcl-dev#9), called by the game as (linear dst, plane, subresource, 0, tiled src, row pitch, slice pitch): its library has a 32-bit argument before the source pointer, which the library the oracle test uses (XDefiant's) does not. 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: title pages are committed on first use). A nonzero added argument is logged once and ignored; its meaning is not known. New test: both forms tile the same bytes and read them back, with garbage in the upper half of the added argument's slot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
|
|
Nothing has happened on this PR for 3 days, so it is marked |
|
The first commit ( AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Stacked on #1435; only the top commit,
767f439, belongs to this PR. The dependency keeps its original author.The existing ABI regression covers a single RGBA8 surface. These two CPU tests extend it to pitched mip levels, array slices, separate depth/stencil planes, BC1/BC3 blocks and 3D textures. They also cover a source whose address space is reserved but not committed, and stale upper stack-slot bits around the added 32-bit argument.
What is in it
crates/xcl/src/hle/xg.rs, tests only: 10 descriptors and 512 copy calls through the six- and seven-argument vtable forms. Expected bytes are placed per element; reads use that reference rather than the preceding copy's output. Whole-buffer comparisons check row/slice padding, other subresources and trailing sentinels too.PAGE_NOACCESSsource without reading it, three added-argument values, three stale upper halves, and unused trailing-slot values in the older form.Tested
14c8a2d:cargo test --locked -p xcl --lib hle::xg::tests -j2 -- --nocapture --test-threads=1: 4 passed, 0 failed, 0 ignored, 0 skipped.8b4d42c): the same command: 6 passed, 0 failed, 0 ignored, 0 skipped.maine0d93c8(this branch,767f439): the same command: 6 passed, 0 failed, 0 ignored, 0 skipped.main2898511+ D3D12.X: XG CopyInto/FromSubresource take the newer library's added argument #1435, headaec6fa1) also pass in release: 6 passed, 0 failed, 0 ignored, 0 skipped; 512 copy calls.Not tested
Merge prerequisites