Retry failed GPU scratch chunks with a smaller upload #257
No reviewers
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/Belobug--VIctory-Belobug-AMD!257
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-257"
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?
@loyodea on GitHub · 2026-11-26 13:28 UTC · original
loyodea:victory-loose-window-pressure→main· +216 −33 · 1 files · 2 commits · openRelated to #147. When the scratch pool has no free chunk and allocating a new 512 KiB chunk returns
E_OUTOFMEMORY, retry with a dedicated upload if the request fits a smaller D3D12 allocation. Round the retry size to D3D12 placement alignment for the upload budget and memory accounting. Keep the buffer alive through GPU completion and command-list reset using the existing dedicated-upload path.Validation
victory-gpulibrary suite passed with 115 tests and four ignored. With thediagnosticsfeature, 118 passed and four were ignored. The serial run had 114 passes, four ignored, and the same write-watch failure as clean upstream4f62c2a.crates/victory-shader/src/emit/lower.rs.This change covers one scratch-allocation failure path. The reported in-game hang remains unverified. Codex contributed the implementation and verification.
Review follow-up for requests above the scratch chunk
A 524,289-byte request made one 524,544-byte dedicated upload buffer at offset zero. The test checked that the pooled list stayed empty, that the dedicated buffer was retained through submission until reset, and that D3D12 readback matched every byte. All three scratch tests passed on the RX 9060 XT, including an independent rerun. The GPU library suite passed 116 tests with four ignored. Review thread
@gut0to on GitHub · 2026-11-26 16:21 UTC · original · reviewed
AI-assisted review. I inspected the scratch allocation branches and the new retry tests statically; I did not run tests or a GPU/game build. This review suggests one boundary case for the refactored dedicated path.
@ -2580,3 +2681,1 @@let made = f(&buffer, 0, gpu, data);self.deferred().uploads.push(buffer);return Some(made);return self.dedicated_scratch(len, make, f);@gut0to on GitHub · 2026-11-26 16:21 UTC · original
AI-assisted review; I did not run tests. Could the focused tests also cover a request just over
SCRATCH_CHUNK? This branch now routes large requests throughdedicated_scratch; asserting one exact-size allocation, no pooled chunk, and retention until list reset would protect that existing behavior while testing the helper extraction.@ -2580,3 +2681,1 @@let made = f(&buffer, 0, gpu, data);self.deferred().uploads.push(buffer);return Some(made);return self.dedicated_scratch(len, make, f);@loyodea on GitHub · 2026-11-26 18:53 UTC · original
Agreed. The current tests cover requests below
SCRATCH_CHUNK. A request ofSCRATCH_CHUNK + 1should make one upload-buffer allocation ofSCRATCH_CHUNK + 256after alignment. A regression could also verify offset zero, an untouched pool, and retention until the list resets.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.