GPU: skip prewarming after the predecessor fence completes #232
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!232
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-232"
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 07:37 UTC · original
loyodea:victory-submit-fence-overhead→main· +148 −18 · 1 files · 2 commits · openRelated to #163. When the previous GPU submission's fence has already completed, skip the early refresh pass and retire the completed submission using the observed fence value. Normal preparation still runs. When the preceding submission is busy, the early refresh remains available and the event wait is followed by a fence query.
An already-complete predecessor uses one fence query instead of two. If work remains after the early refresh, the quick check adds one fence query. This change has no measured gameplay frame-rate result.
Tested
cargo test --locked -p victory-gpu -j 4 --lib -- --test-threads=1 --nocapturereported 113 passed, one failed, and four ignored. Clean upstream4f62c2areported 112 passed, one failed, and four ignored. Both failed the same assertion inwatch::tests::written_pages_are_reported_to_every_asker.The run used original synthetic fixtures. Codex helped implement, review, and test the patch.
@gut0to on GitHub · 2026-11-26 16:20 UTC · original · reviewed
AI-assisted review. I inspected the prewarm/drain branches and the new focused test statically; I did not run tests or the game. This review suggests a case for the remaining-wait path.
@ -1223,4 +1275,4 @@if let Err(e) = self.fence.SetEventOnCompletion(target, self.event) {tracing::warn!(error = %e, "host async drain failed");} else {WaitForSingleObject(self.event, INFINITE);@gut0to on GitHub · 2026-11-26 16:20 UTC · original
AI-assisted review; I did not run tests. Could the regression include a case where
prewarmruns but does not signaltarget, then another thread signals it afterSetEventOnCompletion? The current test callback always completes the fence, so it verifies reaping after prewarm but never exercises the event wait and post-wait fence query that this change also modifies.@ -1223,4 +1275,4 @@if let Err(e) = self.fence.SetEventOnCompletion(target, self.event) {tracing::warn!(error = %e, "host async drain failed");} else {WaitForSingleObject(self.event, INFINITE);@loyodea on GitHub · 2026-11-26 18:53 UTC · original
Agreed. The current test completes the fence inside
prewarm, so it exercises the second fence sample and skips the event wait. A separate thread signaled only afterSetEventOnCompletionsucceeds would cover that branch without relying on timing. A bounded wait can then verify that the submission retires and its deferred write is applied.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.