GPU: wake the copy-batch caller once when its last job finishes #1172
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!1172
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1172"
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?
@UwUCammie on GitHub · 2026-11-25 22:41 UTC · original
UwUCammie:perf/parallel-copy-job-completion→main· +64 −19 · 1 files · 1 commits · openA batch of parallel refreshes took the same completion mutex once for every job. Each already-boxed job was also boxed a second time to carry its completion count. The submitting thread could keep draining other batches after its own had finished.
Queue the job with its group, count completions atomically, and have the last job wake the caller. The caller still helps execute queued work while waiting for its own batch.
On a Ryzen 7 9700X I timed the two pool implementations in a native Linux release harness. Each caller submitted 64 batches. These are medians of eight alternating pairs.
All 31 shadow tests passed on the Windows x64 build under Wine 11.22, including the new test with three overlapping callers. The times above measure the worker pool. The first-room frame-rate comparison is still pending.
Runnable benchmark and commands
I also timed the first room on the RX 7900 XT, with the same 16 KiB readback setting and scratch-reuse patch on both builds. The parent build accepted 588 presents in 73.89 s (7.96 FPS, 4,881 draws/frame). With this change it accepted 693 in 74.37 s (9.32 FPS, 4,919 draws/frame). Each value is one run on a shared desktop. The paired synthetic measurements above isolate the worker code more closely.
@Proudnoob4 on GitHub · 2026-11-25 23:17 UTC · original · edited 2026-11-25 23:26 UTC
AI-assisted (Claude Opus 5.5 in OpenCode), measured on my own machine. This replaces two overlapping AI-written reports I posted here earlier; on re-auditing the logs, some of their numbers were single samples or misattributed, and one said there were no visual artifacts, which was wrong.
Setup: RTX 4080 16 GB, Windows 10 22H2, Series X build, diagnostics release, prison-cell scene (~4,800 draws/frame). Three single 360 s runs, so this is a bundle comparison, not an isolated A/B:
Marvisak/VIctory#2825native f16#1168+#1147+#1164(VICTORY_CARD_PIECE_KB=16) +#1171+#1172+ a local commit (skip cleancard_dirtycopies; chunk wide compare dispatches to ≤ 65,535 groups)all other lists), 2nd-half mediancardmeter, 256-frame mean, steadycardmeterunchanged). Which of C's additions gave the 8 ms is not isolated.For this PR: ran in C with
VICTORY_QUEUE2=1 VICTORY_RELAY=2, no hang in 360 s. The relay thread's wait for card-copy piece fetches stayed at 4.4–4.5 ms in A, B and C, even with 3× the pieces in C. That fits this PR but does not isolate it. An earlier note here said unit tests passed; I have no record of running them, so please disregard that.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.