Keep refreshes in front across title writes that miss them (VICTORY_KEEP_AHEAD) #388
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/TaynanGT--Vice-Tay!388
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-388"
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?
@SmartIngenieriayDesarrollo on GitHub · 2026-11-27 23:26 UTC · original
SmartIngenieriayDesarrollo:keep-refreshes-ahead→main· +162 −3 · 1 files · 1 commits · openMost refreshes in a frame copy nothing. I counted 85 to 89 % of 9,000–11,000 refreshes per frame coming back empty, about 38 ms of the submitting thread. Almost all of that waste starts with one small write.
When a submission copies a few bytes into title memory, either a buffer copy done at submission or a placed copy at its place in the lists,
Batch::title_writtenthrows away every copy thatrefresh_front/refresh_aheadhad already brought up to date. Every later list then adds, flushes and checks those copies again, even though the write touched none of them.With
VICTORY_KEEP_AHEAD=1(off by default), such a write drops only the copies whose refreshed range contains one of its bytes:inplace::shown_bytes) still drops everything, as today;Step::Runwork, which may write anywhere, is unchanged;Measured on a Ryzen 7 5700X3D with one DDR4-3200 module (single channel) and an RX 7800 XT, Series S, Vice-Tay
791648bplus a frame CSV patch: a 120 s cutscene, runs A B B A, 10.94 → 11.98 fps (+9.5 %).I kept it on through the rest of my tuning, but I haven't repeated an alternating A/B on current
main(0148258).On a PC like mine every flush is memory bandwidth taken from the frame. On a high-end PC it is still submitting-thread time handed back.
Two tests cover it:
a_title_write_drops_only_the_ranges_ahead_it_touches(the batch bookkeeping) anda_title_write_refreshes_again_only_the_copies_it_touches. The second runs a real copy over the end of one range and checks that every host copy still matches title memory, with the switch on and off. Checks:cargo clippy -p victory-gpu --all-targets --locked -- -D warningsis clean andcargo test -p victory-gpu --lib --lockedgives 529 passed, 0 failed, the two new tests included (Windows 11, MSVC, the repo toolchain).cargo fmt --checkonly flags files this PR does not touch.— El_Santo
AI-assisted (Claude Code and Codex): measured on my machine, text drafted with Claude.
🤖 Generated with Claude Code
@chatgpt-codex-connector[bot] on GitHub · 2026-11-27 23:26 UTC · original · edited 2026-11-27 23:29 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
0334d59ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@akimfomin on GitHub · 2026-11-28 00:04 UTC · original
I ran PortBridge’s tree check between #388
0334d59and #379ecc003e. The pair combines without a Git conflict. There is one useful combined control: exercise #379’s mapped alias with KEEP_AHEAD both off and on. Pre-refresh a buffer through view B, write through view A, then verify the refreshed bytes through B and both texture heaps’ notices. #388 already falls back to a full refresh for any mapped portion of the write; the combined check would preserve that guard if the PRs land together. The tree check and source review are from PortBridge, with no new GPU run.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.