Take the changed card copies from a queue, not from a walk of all of them #251
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/251"
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 TaynanGT/Vice-Tay. Originally posted by CristianCiubancan on 2026-11-27T12:20:06Z.
One commit on
mainat6141601. A draft because it touches the lines #238 and #199 move (see Overlap).What
card_dirtytook a reference to every copy in the card's memory at every submission to find the few whose CPU side had changed. #192 made the look at each copy lock-free (has_dirty), but the walk still upgrades and drops aWeakfor each of them.What puts a range into a copy's
dirty(card_changed_runs) now also puts the copy on a list, once (aqueuedflag besidehas_dirty), andcard_dirtygoes through that list.has_dirty,sentandhas_sentare set and cleared exactly where they were, in the same order; the take is the same closure for both ways.VICTORY_CARD_DIRTY_QUEUE=0walks as before.VICTORY_AB=<s>,VICTORY_CARD_DIRTY_QUEUEdoes each in turn in one run; the walk clears the queue and each copy'squeuedas it goes, so switching loses no change (tested).CARDEDwhen it has doubled since they last were, since no walk does it at every submission any more.Measured
RTX 5070 Ti 16 GB, Ryzen 7 9850X3D, 32 GB, Windows 11. Diagnostics build of this branch, Series S,
-Machine 4070 -Windowed,VICTORY_PIPELINE_WORKERS=8. The same self-driven route as in #247, one run each way, aVICTORY_PROFILEwindow of 60 s at 10 ms in the world. Share of the submitting thread's samples:VICTORY_CARD_DIRTY_QUEUE=0shadow::card_dirtyVec::retain's closure)That thread works about 50 ms a frame there, so about 1.3 ms a frame. On the earlier base (
3da964a, before #192) the same comparison gave 2.88 % against 0.84 % and 0.64 %.Frame times do not show a change this small: an alternation in one hand-played session on the earlier base (20 s phases, 17 world phases, a fit against draws) leaned 1.6 ms to the queue's side with a scatter of 4.8 ms between phases, and the two runs here differ by more than that the other way (medians 18.9 and 17.8 fps, the second with a slow stretch of the kind #247 describes). The profile is the evidence; I do not claim a frame-rate gain from it.
Overlap
CARDED.lock()...push(Arc::downgrade(&shadow))lines, which this replaces withlist_carded(&shadow). It merges cleanly with neither as they are. I am glad to rebase on whichever lands first, or to wait for both.host.rs, so not #247.Limits
Checks
Three new tests (
card_dirty_tests): the queue gives what the walk gives, in the same order; a copy changed again is taken again; the two ways in turn lose nothing. All three fail with the push to the queue taken out.cargo test -p victory-gpu --locked --all-features -- --test-threads=1passes (537). Clippy with and without--all-featuresis clean, andcargo xtask policypasses.🤖 Generated with Claude Code
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T12:26:30Z.
@CristianCiubancan The profile moved
card_dirtyfrom 3.45% to 0.93% of the submitting thread, which isolates the benefit of replacing the walk. #238 is in main now. The next branch should preserve its publish-time bookkeeping whenlist_cardedreplaces the registration calls. The order and switch-over tests are the right checks for that rebase.Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:14:55Z.
mainhas moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the currentmainand open a new PR; I'll review it there.Pull request closed