Repository navigation
Conversation
In R0Y00#2823 (commit 7256cec), uncompleted reuse of the shared upload ring was removed to prevent GPU in-flight memory corruption. However, because chunks were never recycled once GPU submissions finished, total reservations permanently froze upon reaching the 256 MiB cap, refusing every subsequent upload and leading to black screens and hundreds of thousands of null buffer bindings in long startup runs. Track queue submission fence values on upload chunks that receive unsubmitted writes. When active chunks and free tails cannot satisfy a reservation, inspect completed fence values and reset completed, idle chunks, guaranteeing storage still in flight on the GPU is never reused before completion. Add the gate-ring-reuse fixture to verify that upload reservations succeed once earlier GPU submissions complete, while gate and gate-ring continue to enforce in-flight safety and exhaustion limits. Fixes R0Y00#2837 Refs R0Y00#2823
Address review feedback on R0Y00#2847 (tedin7): 1. Tie chunk reuse to the command lists that actually reserve from them. Track recorded chunks per command list in recorded_upload_chunks. Chunks maintain an unsubmitted_lists count and are bound to queue submit fence values only when the lists using them are executed. When a recording is discarded on Reset or failed Close, its reservations are dropped. 2. In upload_reservation_check.cpp, test unsubmitted lists, pending and completed fence values, and multi-queue submissions. 3. In gate-ring-reuse, add a negative control draw while the queue is held behind the gate fence. Verify it is refused and preserves payload 0 on the left half, and verify mutation of the fence check fails the fixture.
…removal - Pass command list through upload_from_title to ring_copy to maintain chunk associations. - Add generation counter to UploadRingChunk and FrameCopy to invalidate stale cache hits after chunk reset. - Keep chunk recordings held across queue_execute submissions so closed lists can be safely resubmitted. - Treat UINT64_MAX fence completion query in is_upload_chunk_idle as device removal. - Extend upload_reservation_check with generation, closed list hold and device removal test coverage.
… before reset - Mark chunks untracked when queue fence signaling or creation fails so they are never recycled. - Only reset idle chunks in reserve_upload_ring when chunk.capacity >= rounded to protect cached frame copies. - Add unit tests in upload_reservation_check for generation validation and untracked chunks.
…cache validation lock - Call discard_upload_ring in release() when a list wrapper refcount hits zero to prevent transient lists from permanently pinning chunks. - Combine generation check and note_upload_ring_use into atomic validate_and_note_upload_ring_use under exclusive lock in frame_copy.
KelboLive
left a comment
There was a problem hiding this comment.
What works
- Good coverage: the C++ test exercises 7 console command list slots
(33 root sig, 25 PSO, 37/39 root constants, 45 UAV, 14 Dispatch)
plus 5 negative controls (0 threads, no PSO, out-of-range constants,
out-of-range offset). Both warp and hardware adapters are tested. - Upload ring generation tracking is clean:
UploadRingChunkgets
generationandsubmitsfields,is_upload_chunk_idle()walks the
submit list checking fence completion, anddiscard_upload_ring()
handles list release. frame_copy()now callsvalidate_and_note_upload_ring_use()which
ensures cached frame copies aren't reused after the ring has been
submitted to the GPU. Good safety guard.
Issues
note_submits()now takes 3 parameters (queue, wrappers, native
lists). The existing call sites need updating -- verify all callers
pass the native list arg (or empty vector).UploadReservationgaining agenerationfield means the caller
must pass it toframe_copy(). The diff showsframe_copy()
defaults tolist=nullptr, but thegenerationmust be threaded
through correctly for the upload ring tracking to work.- The
discard_mesh_lease_recording()call in the release path
is no longer inlined -- it now takes the list directly. Ensure the
call site passesstatic_cast<ID3D12CommandList*>(...)correctly.
Recommendations
- Verify all call sites of
note_submits()pass the third parameter. - The test (369 lines) is long but well-structured; consider whether
any negative controls could be factored into reusable helpers. discard_upload_ring()should also resetrecordingsif it hasn't
already (to catch cases where the chunk is still recording).
Overall
Solid test add with useful upload ring generation tracking.
The C++ test covers the critical path well. Approvable.
R0Y00
left a comment
There was a problem hiding this comment.
At 0a627028, neither tests/startup_compute_dispatch.cpp nor tests/cmake/startup_compute_dispatch.cmake from the description is in the PR diff. The current diff changes the upload ring, queue submission and address-console fixtures, which overlap #2949. The PR also conflicts with current main. Please put the intended standalone compute-dispatch fixture and registration on a branch from current main so those changes can be reviewed on their own.
|
This PR now conflicts with
Could you merge AI-assisted; commands listed were executed locally. ( |
Changes
Adds standalone C++ test for compute dispatch on a console command list:
Tests register with warp and hardware adapters (hardware skipped when no D3D12-capable GPU available).
Files
tests/startup_compute_dispatch.cpp— 369 line test fixturetests/cmake/startup_compute_dispatch.cmake— test registrationCleanup
nulWindows artifactpr2862_review.mdfrom root todocs/pr2849_review.md(merged, review obsolete)