startup: upload ring refuses every reservation after 256 MiB in total since #2823 #2837
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#2837
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?
@Not-Saii on GitHub · 2026-11-26 12:47 UTC · original
### Commit or build
7256cecf(dev and release presets). Last good build for the startup run:25eb746e.Reproduction
Source-built: a new mode of the existing gate fixture,
gate-ring-reuse(diff below). It runs thegate-ringsequence (18 x 16 MiB by-address texture uploads from the shared ring while the queue waits on a gate fence), opens the gate, waits until every submit has completed, then draws one more payload (18) over the right half from the ring.Control: the same tests with
src/startup_stubs/d3d12_xs_device.cpprestored to7256cecf^.Test change (tests only, applies to
7256cecf)Expected behavior
Once every earlier submit has completed, a new ring reservation succeeds: the left half holds payload 0 (
03ff5aff) and the right half payload 18 (355d48ff). Storage still in flight is never reused.Observed behavior
gategate-ringgate-ring-reuseleft (in flight)gate-ring-reuseright (after completion)7256cecf00000000null view: 32,768 wrong pixels7256cecf^stand-in136f4aff(payload 16): 32,768 wrong pixelsSame result on WARP and hardware. On
7256cecf, once 256 MiB has been reserved in total,reserve_upload_ringrefuses every new reservation for the rest of the process, even after the GPU has finished with all of it. The first diagnostic isx2w-draw upload ring reservation refused: no unused capacity. The old wraparound code reused space without checking completion, which is what #2823 fixed; the new test fails on that code too, so it rejects both behaviors.Effect on a local startup run (release build,
run.ps1 -Render -Translate -FakeUser -GpuMirror, 180 s, no input script), finalx2w-render totals:7256cecf7256cecfwith #2823 revertedThe first refusal is logged before the first non-zero null-binding count; the presented picture stays black.
Proposed fix: record a fence value with each reservation (or per chunk) and reset a chunk's
usedonce that fence has completed, keeping #2823's rule that storage is never reused before completion.gate-ring-reuseshould then pass on both halves whilegateandgate-ringkeep passing.Environment
Windows 11 build 26300.9974, VS 2022 (MSVC 19.44.35230), Windows SDK 10.0.26100, NVIDIA GeForce RTX 4090 driver 610.88 (32.0.16.1088); WARP and hardware backends; D3D12 debug layer not enabled.
Checklist
Refs #2823
@SimSalabimse on GitHub · 2026-11-26 12:52 UTC · original
Confirming on a second machine. A dev-preset build of
7256cecfwithrun.ps1 -Render -Translate -FakeUser -GpuMirrorlogsx2w-draw upload ring reservation refused: no unused capacity8 times. The first refusal comes about 80–90 s in, and the presented picture stays black from there. Over the 717 s run,x2w-render totalsreports 0 textures uploaded, 668,514 null buffer bindings and 300,468 translated draws not drawn. The same run on25eb746ethe night before had no refusals and uploaded 1,364 textures.Environment: Windows 11 25H2 (26200), MSVC 19.42, NVIDIA GeForce RTX 4070 Ti driver 621.35 (32.0.16.2135), hardware backend.
Happy to test a fix branch here. If nobody is taking the fence-tagged reuse, I can open a PR against the
gate-ring-reusetest above.AI-Assisted