d3d12: map a root SRV in a GPU reservation as far as one in committed memory #677
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/677"
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?
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-03T16:43:01Z.
Summary
A root SRV bound inside a GPU reservation could be read past the end of its host buffer.
In ProjectScarlett, mesh draws bind root SRVs inside GPU reservations where the title streams models. A root in committed memory gets up to 4 MiB of reach (
root_view_address). A root in a reservation went throughimported(address, 1)to a shared read-only view buffer that ended at the next 4 MiB boundary. A console shader reads title memory as far past a root as the title placed data, so a root just below a boundary was read past the buffer's end. That returns whatever the driver has at the next address: silently wrong data, or an MMU fault (NVIDIA Xid 13) when nothing is mapped there.Measured on an RTX 5090 with vkd3d-proton's fault reporting: in one run the fault was 0xa000 past a window's end. An unfinished mesh draw's root sat 0x5fb0 before that end, and the address after the window had belonged to a 2 MiB sparse buffer destroyed 71 s earlier.
The change:
heap/view_window.rs), as a root window of committed memory does.gpu_reach, up toROOT_VIEW_REACH) instead of one byte.recorded_bufferbinds a root only into a registered buffer that holds that reach, not one that merely contains the address.Limits:
Claimed on #533. #655 adds a Lanes test for #389's committed-memory root window. This PR's self-test covers the reservation case, and the two only meet in the scenario lists.
Tested
Run the checks relevant to this change.
check --no-gpuand the RTX 5090 passed. On AMD, every failure is a page-mapping call returning E_NOTIMPL: #656's three self-tests, which fail the same way on main106120caon this card, and the new self-test, which stops at the same kind of call before it reads anything (see below)root-reach-reservationbinds a root SRV 256 bytes below a 4 MiB boundary of a reservation with no CPU pages, and reads 256 bytes past the boundary. On the RTX 5090 it fails without the fix (read 0, expected 0x5eed0002) and passes with it. Unit tests coverview_window::reachandwindow.GPU, driver and backend: RTX 5090 (
10de:2b85, NVIDIA 620.70.10) and AMD Ryzen 9 9950X graphics, RDNA 2 (1002:13c0, RADV, Mesa 26.0.8), both through GE-Proton11-15.tuxbox.py check --changed 106120ca, run one card at a time.The
Evidence:linetuxbox.py checkprints last, one per card (it names the commit it tested; run it on this pull request's head):Commands run and their results:
Game run. These ran in ProjectScarlett on the RTX 5090, in 15-minute runs from boot into gameplay. The build was upstream
106120caplus #671, #672 and a local translator change for guarded float divisions (the area #670 now covers), with and without these two commits:It hasn't been run in the game on plain upstream with only this change.
Checks
CI runs the code checks: the Python and Rust unit tests, the translator tests through DXC, a Windows typecheck, clippy, formatting, rustdoc, and Miri on the providers. It has no GPU.
No evidence JSON changes.
🤖 Generated with Claude Code
Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-12-03T17:54:12Z.
RDNA 2 run on the head (
da7a4da4). RX 6700 XT 12 GB (1002:73df), Mesa 26.3.1 RADV, GE-Proton11-15, full check:Page mappings work on this card at
106120ca, so the newroot-reach-reservationself-test ran here and passed. No amdgpu faults or resets in the kernel log during the run.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.