Queue-ordered page remap can redirect earlier GPU copy-back to the replacement backing #1131
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork#1131
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@NotADonky43 on GitHub · 2026-11-25 21:04 UTC · original
Reproduction (no game files)
On native Windows D3D12, allocate two different physical backings and initially map a destination VA to the first one. Keep an independent alias of the original physical backing so it can be inspected after the remap.
0x71and the replacement with0x23. Make a synthetic GPU texture copy whose readback writes0x65to the destination. Hold that copy on a logical queue behind an unsignalled fence.CopyPageMappingsBatchXon the same queue to replace the destination backing. Before opening the fence, read the current destination byte.0x710x230x650x710x230x65The test used a 256×192 RGBA8 texture on an RTX 5070 Ti. The wrong-page result was reproduced with the pre-ordering queue path after applying a separate Windows placeholder-boundary fix needed by the multi-page fixture. The current public queue handler still treats mapping as an immediate operation.
Candidate direction
Represent a page remap as work on its logical queue. Finish already-submitted work and its deferred writes before changing the destination's backing, and don't prepare newer commands on that queue against the old addresses. A local candidate retested on
085ee7cpreserved both backing patterns and returned the expected bytes to the later GPU read with synchronous, deferred, and joined submission. The test also overwrites the caller's mapping descriptors after enqueueing to check that deferred work owns them.This is a correctness finding, not an FPS claim or a diagnosis of a specific in-game artifact. A fix must also order presentation behind a pending remap and retain the queue through joined submission completion. Waiting for the shared host queue can cost time; the candidate is not ready to merge as-is.
@NotADonky43 on GitHub · 2026-11-25 21:21 UTC · original
Follow-up: the source-only candidate now fixes the two issues identified in the first review.
The tests separate queue/presentation ordering from real GPU writes. The queue test uses an observer at the host-present boundary (not a desktop or game display check). The native D3D12 fixture releases both client queues and its copy fence with work still pending, then verifies the old backing, replacement backing, and later GPU read. This is a correctness patch, not a game visual, stability, or FPS claim. Remaps can still wait on the shared host submission lane, and existing partial-map error handling is unchanged.
Applying the source patches
Start from
085ee7c4c3d1dfaed41d683fa9f465a6f9dac8c3orc36971b213770e48f513f0d6e3ced3f1f65a32b2. Apply the standalone Windows placeholder-boundary patch from #824 first, then the runtime/queue diff below, then the fixture diff in the next comment. Both diffs are against that prerequisite; no game files or assets are needed.Verification: On
c36971bthe 8 queue tests, 14 XMem tests, and real D3D12 readback on the RTX 5070 Ti passed. The GPU fixture passed with synchronous and deferred execution and with joined submissions, both with and without relay copy-back. GPU-based validation was on. The optimized build succeeded. The same patch had 588 workspace tests pass on085ee7c, with the independently failing baseline WARP budget test excluded. No game launch or visual claim.Part 1 of 2 — runtime and queue regressions
@NotADonky43 on GitHub · 2026-11-25 21:22 UTC · original
Source patches for this issue, part 2 of 2: the synthetic D3D12 fixture and its test dependencies. Apply after the placeholder prerequisite and the runtime/queue patch.
On Windows with a real D3D12 adapter, set
VICTORY_D3D12_DEBUG=1andVICTORY_D3D12_GBV=1, then run:The fixture does not load a game or save images.
Part 2 of 2 — synthetic GPU fixture