gpu: add fence-timed targeted readback fixture #3951
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3951
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3949"
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?
@lambirou on GitHub · 2026-12-03 16:48 UTC · original
lambirou:codex/memory-targeted-readback→main· +269 −0 · 3 files · 1 commits · merged 2026-12-03 17:20 UTCProblem
The runtime has no demonstrated path for making a GPU-written range visible through
the title's original CPU address when the backing cannot alias those pages. A
readback added before a CPU-dependent case is measured would copy work for every
GPU-written buffer and leave the synchronization point unproven.
Change
Add a source-built D3D12 fixture for one 4 KiB range in a 256 KiB buffer. The GPU
writes the range through a copy, the fixture copies only that range to a READBACK
resource, waits for the queue fence, and compares the mapped bytes. A second full
buffer readback checks the other 252 KiB against their sentinel pattern. The
wrong-offsetcase reads 512 bytes later and must fail the comparison.This is a transfer primitive and fence-boundary prototype. It does not wire a
writeback into title memory. Runtime integration remains conditional on a measured
CPU read that depends on a GPU-written range whose backing cannot alias title pages.
Refs #1914, #3678 and #3765.
Validation
Windows 11, MSVC 19.44.35228,
devpreset, debug layer off:WARP and the physical adapter: 4/4 passed, 0 skipped. The positive case transferred
4,096 bytes and preserved all neighbour bytes. Both wrong-offset controls rejected
the copied range.
Limits
@R0Y00 on GitHub · 2026-12-03 17:18 UTC · original · approved these changes
Independently built startup_targeted_readback with MSVC Debug and ran ctest --test-dir out/build/review --no-tests=error -j 1 -V -R '^startup_targeted_readback_' on Windows 11 build 26300. All four cases passed, no skips, on WARP and RTX 4060 Laptop. Both adapters matched the 4,096-byte destination after the fence and preserved the surrounding bytes. Both wrong-offset controls rejected the copy. The fixture uses ordinary D3D12 buffers and tests the submission boundary without depending on the runtime wrapper. Required Windows CI passed.