Fuse refresh sifting when write watch is kept #3762
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3762"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by SmallDevBigNothing on 2026-11-30T06:11:35Z.
What it changes
When write-watch data is already kept for a submission and the parallel refresh is available,
flush_allchecks for unchanged spans as it refreshes the batch. This saves a separate worker dispatch and filter pass. The separate sift still runs when it can narrow the upcoming write-watch query or when the parallel refresh is unavailable. This change affects the path withVICTORY_FLUSH_SIFT=1.How it was tested
Windows 11 build 26100, Core Ultra 5 225F, RTX 3060 12 GiB. The release benchmark uses synthetic write-watched buffers and the existing submission and refresh code. Each process warms up for eight submissions and times 64 more. Four paired process runs per variant, with alternating order, 4,096 spans and eight large flushes. One in eight spans changes each submission and the benchmark checks the copied bytes.
With sifting disabled, the three-worker wide case measured 0.96 ms on both revisions. The small-flush controls were within 0.05 ms of baseline. These are CPU submission timings. Gameplay FPS still needs a paired run.
cargo test --release --locked -p victory-gpu --lib write_watched_submission_throughput -- --ignored --nocapture. SetVICTORY_LIGHT_REFRESH=1,VICTORY_WIDE_REFRESH=1,VICTORY_NEW_BATCH=0,VICTORY_FLUSH_SIFT=1and select the worker count withVICTORY_WIDE_THREADS.Checked for overlap
Implementation and testing assisted by Codex.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Smoodie7 on 2026-11-30T06:21:42Z.
Thanks for the benchmark, it is a useful one to have. One thing I noticed while reading
flush_all: as far as I can tell, this only changes anything for people who setVICTORY_FLUSH_SIFT=1.flush_sift()isswitch::on("VICTORY_FLUSH_SIFT"), so it is off unless the variable is set, and no launcher (play.ps1,play-foxhound.ps1,victory play) sets it.siftedis false, so whenself.refreshes.len() > FEWand!batch,check_noopis already true in thewide_each_scopedpath. The no-op checks already run inside the parallel update. That is the fused path this PR adds, and it is what everyone gets by default today.FLUSH_SIFT=1with 3 workers is 0.98 ms, against 0.96 ms with sifting off on both revisions.So with a kept asking and the wide refresh,
FLUSH_SIFT=1now behaves likeFLUSH_SIFT=0. That is fine, but it is not a speed-up over the default.Two ways this could go further:
write_watched_submission_throughput). It is the valuable part: it gives the refresh path a repeatable CPU number. If you drop thesiftedchange, it measures exactly what the default does.!keptcase, where it narrows the ranges forask_ahead. A run of the benchmark without a kept asking, sift on and off, would show whetherFLUSH_SIFTis worth keeping at all, or whether the switch andsift_refreshescan go.A paired gameplay run with the default settings (sift off) would also show how much of the submitting thread's time is in refreshes. On my RTX 4070 Ti SUPER and Ryzen 7 7700, the
lists' stepsline shows 15–23 ms per frame in refreshes in the heavy scenes from #3512 and #3761. That is where a gain would show up in fps.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by SmallDevBigNothing on 2026-11-30T18:02:10Z.
@Smoodie7 Thanks for pointing out the flush-local case. On a Core Ultra 5 225F, with no kept watch and three workers, enabling separate sifting raised the median from 1.07 to 1.47 ms for the wide all-watched fixture and from 0.61 to 0.78 ms for the wide mixed fixture. In the mixed case, candidate ranges handed to write watch fell from 4,096 to 960 even as total CPU time rose. Kept-watch timings were within run-to-run variation. #4271 has the asset-free reproducer. No defaults changed.