perf: coalesce contiguous GPU readback commands #1230
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/fxceless--victory-fork!1230
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1230"
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?
@spk-c on GitHub · 2026-11-26 00:59 UTC · original
spk-c:submit/readback-coalesce→main· +96 −6 · 1 files · 2 commits · openSummary
Opt-in with
VICTORY_READBACK_COALESCE=1(off by default). Merge only exactly adjacent source and destination ranges for the same resource; preserve piece bookkeeping, bytes and fences. Three synthetic tests passed, including 1,024 adjacent 64 KiB pieces reduced to one copy command. No end-to-end FPS improvement claimed.Validation
All CI steps passed for this isolated change against the corrected test baseline in the fork: https://github.com/spk-c/victory-fork/actions/runs/45731806189.
This submission is a single commit rebased onto upstream
a183ea2; exact-revision upstream CI is pending. Upstream's pre-existing CI failures are addressed separately in #1228. Draft pending baseline and upstream review. AI-assisted.Independent validation
UncommonDLL's report on exact head
0f7ba9cand its parent, RTX 5070 Ti / Windows 11: 7,296 main submissions passed byte/guard/fence/bookkeeping checks. The 64 MiB direct-queue adjacent-copy case reduced 1,024 commands to one, with paired median CPU recording savings of 0.184 ms vs parent and 0.18205 ms vs head disabled; GPU copy time remained near 2.346 ms. Synthetic harness, not full title-memory merge or gameplay. Clippy failures matching parent were also reported. See the original report for scope and details.Refresh against upstream
52ac4ecNew head
3074fdf1eea4e93f729ca5def7a72bc433ae018b; all three focused synthetic readback tests passed (exact adjacency, byte equality and resource boundaries, adjacent-piece command reduction). External GPU evidence remains scoped to the original tested revisions. Clean isolated workspace Cargo Check and strict all-feature Clippy passed. Original commits are preserved. PR-only diff check passed. Full upstream CI approval and source-size policy fix #1357 remain pending.@UncommonDLL on GitHub · 2026-11-26 17:55 UTC · original
Hardware validation on direct parent
a183ea275e48e047eeb18790b09cac19d6e4b8c2and PR head0f7ba9c06b7a3e2d22934e269a7475a4a63517bd. Native Windows 11 build 26200, Ryzen 7 7800X3D, 64 GiB RAM, RTX 5070 Ti, NVIDIA driver 621.24.For the tested 64 MiB batch on the direct queue with range-index keys, the parent and head with coalescing disabled each recorded 1,024 copy commands for 1,024 adjacent 64 KiB pieces. With coalescing enabled, head recorded one command for the same 67,108,864 bytes. Across 24 interleaved rounds, the paired median CPU recording saving per batch was 0.184 ms versus parent and 0.18205 ms versus head disabled. The CPU timer surrounded the recording loop alone. Both GPU timestamp commands and per-copy tracing were disabled for that CPU measurement.
GPU copy time stayed near 2.346 ms in all three modes. With coalescing enabled, the paired median GPU time was 0.464 µs lower than on the parent and 0.400 µs lower than on the head with coalescing disabled.
Across the correctness fixtures, all 7,296 main submissions, including 6,912 timed submissions, passed byte-for-byte output, guard-region, fence-completion and original-piece bookkeeping checks. Coverage included direct and dedicated copy queues, with both shadow-identity and range-index keys. Source gaps, destination gaps and alternating physical resources stayed separate. The harness exercised the four pinned recording loops and upstream landing predicate with synthetic buffers. Gameplay adjacency rates, frame time and the full title-memory merge were outside its scope.
All three new readback tests passed. The other local validation results on the tested head were:
map_entry,unnecessary_sort_by,collapsible_if,manual_is_multiple_ofand the unread fielddepth_written. The default-feature run also reported the unused functionplaced_filler_twins.cargo test --workspace --lockedpolicy::tests::repository_passes_policy. Two tracked files exceeded the historical 524,288-byte limit on both revisions:diagnostics/timing-run-2026-11-25.txtanddiagnostics/timing-run-295s-2026-11-25.txt. Excludingvictory-gpuproduced the same sole failure, with 404 passed and 7 ignored.victory-gpusuiteindirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fieldsfailed the assertion that the first two real draws fit the budget.watch::tests::written_pages_are_reported_to_every_askerfailedbefore.is_empty(). Both failures reproduced in the parent serial suite. In fresh processes, the WARP budget test failed on both revisions and the write-watch test passed on both.The evidence packet includes harness sources, reproduction commands, raw samples and paired distributions. The C++ trial source
measure.cpphas SHA-256b3df01839ce46a01eebbf4446a7037451f6ef418541574483ac62c4cd62fed66.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.