host: keep refreshes in front across title writes that miss them (VICTORY_KEEP_AHEAD, off by default) #4
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4"
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?
Imported from XaviFortes/VIctory-RDNA. Originally posted by SmartIngenieriayDesarrollo on 2026-11-27T23:26:27Z.
Your in-place work (
5e6fec2,4c210de,0a07538andPORT_BUFFERS) helped my build a lot, so here is something back. It is a port of the refresh-side change I'm proposing for Vice-Tay, adapted to this tree'sBatch.Most refreshes in a frame copy nothing: on Vice-Tay I counted 85 to 89 % of them coming back empty. The cause is
Batch::title_written. When a submission copies a few bytes into title memory, either a buffer copy at submission or a placed copy withfree, it clears every copy thatrefresh_front/refresh_aheadalready brought up to date. Each later list then refreshes them all again.With
VICTORY_KEEP_AHEAD=1(off by default), such a write drops only theaheadentries whose range holds one of its bytes, and resetslast_ahead:inplace::shown_bytesreports as shown elsewhere drops everything, as today;Step::Runis unchanged;Measured on Vice-Tay: Ryzen 7 5700X3D, one DDR4-3200 module (single channel), RX 7800 XT, Windows 11, Series S. A 120 s cutscene, A B B A: 10.94 → 11.98 fps (+9.5 %), preparation −9.9 %, copies −20.6 %.
I haven't run this tree in game with the switch yet. The port keeps the same logic and adds the
last_aheadreset this tree needs. Off by default, nothing changes.Tests:
a_title_write_drops_only_the_ranges_ahead_it_touches(inmod batch). Checks:cargo test -p victory-gpu --lib --lockedgives 396 passed, 0 failed, the new test included (Windows 11, MSVC).cargo clippy -- -D warningsstops on 7 lints thatmainalready has (list.rs,draw.rs,descriptor/host.rs,host/panel.rs,host/place.rs,watch.rs), none inhost.rs;cargo fmt --checklikewise only flags untouched files.— El_Santo
AI-assisted; measured and tested on my machine.
Imported from XaviFortes/VIctory-RDNA. Originally posted by chatgpt-codex-connector[bot] on 2026-11-27T23:26:35Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
3a592a8ℹ️ 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.
Imported from XaviFortes/VIctory-RDNA. Originally posted by akimfomin on 2026-11-28T01:34:52Z.
I checked the byte-range predicate in
3a592a8eagainst disjoint byte sets on 10,000 deterministic inputs near a page boundary. Adjacent writes on the same page and empty writes stayed correctly distinct from a one-byte overlap. This was a CPU model, with no render or performance measurement. KLBF #57 uses page-level dirty-copy tracking at a different stage. If the two ideas are combined, keep the byte-exact invalidation and use the page mask as a separate copy-work optimization. A shared synthetic fixture with two cached ranges in one page and one aliased write would verify that distinction and the conservative full-reset fallback.Imported from XaviFortes/VIctory-RDNA. Originally posted by KingKaom on 2026-11-28T13:34:02Z.
RX 9070 XT (RDNA4) check of this change rebased onto current tip (
4e3a4d2+ PR head, diag build, warm shader cache, Series X target, scripted 4x40s walk, two ~21 min runs vs one control run of tip alone):The diagnostics split line shows the mechanism is live here, about 27 title writes per frame keep the ahead copies and 0 are dropped. So no win on this card and this tip, hitches run about double the control and neither run reaches the cadence floor the control sits at. That fits the effect being traffic bound: single-channel DDR4 saves real refresh work, on this box the skipped refreshes were already cheap.
Thanks for the clean port.
AI-assisted (Hermes Agent)
Imported from XaviFortes/VIctory-RDNA. Originally posted by SmartIngenieriayDesarrollo on 2026-11-28T20:59:57Z.
@KingKaom thank you for the long RX 9070 XT runs. That's the result I expected on a fast-memory box. The switch is live there (27 writes a frame keep their copies), but the refreshes it skips were already cheap, so there's no gain. On a single-channel DDR4 PC the same skipped work is real memory traffic.
The hitches worry me more than the median. Did the control run use the same diag build and session length? With one control against two runs I can't tell whether it's the switch or the run. Since it doesn't help on this kind of hardware, I'm fine with it staying off by default, which it already is.
@akimfomin: agreed. Byte-exact invalidation should stay. A page mask would be a separate copy-work optimization on top of it.
— El_Santo
Imported from XaviFortes/VIctory-RDNA. Originally posted by KingKaom on 2026-11-28T21:39:53Z.
@El_Santo answering your control question directly: yes, the control was the same diag exe, same scripted walk route, same session length around 21 min, same warm shader cache. Only the switch differed. It was n=1 control against n=2 KEEP_AHEAD runs, so your caveat about not separating switch from run is fair. For what it is worth the hitch rates were 0.4/min control versus 1.0/min and 0.9/min with the switch on, so the split direction is consistent, but the counts are small.
One flag while I have your attention: current main tip carries
VICTORY_KEEP_AHEAD=1in the RDNA fast preset (4cc5b11), so RDNA profiles opt in by default there. Our counterexample was measured with the switch as an opt-in knob, but it does apply to that promoted state on this card.AI-assisted (Hermes Agent)
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.