Sweeps: the pressed interval as a switch (VICTORY_SWEEP_PRESSED_MS), and a submission with nothing in the air sweeps only when the sweep is due #4227
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4227
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4226"
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?
@Denkiyaa on GitHub · 2026-11-30 17:35 UTC · original
Denkiyaa:pr/sweep-when-due→main· +804 −825 · 32 files · 12 commits · closed without mergingFixes #
What it changes
Two changes in
crates/victory-gpu/src/host.rs, one commit each, about the long frames the sweep makes on a card whose texture budget is always full.1.
VICTORY_SWEEP_PRESSED_MS=<n>, the interval of the sweep while the card counts as pressed (default 1500: nothing changes unless it is set). While the card is pressed,Host::sweep_every_msgives 1.5 s, and the sweep behind flights settles every flight first. On the card measured here the budget is full the whole time in the world, so that is every 1.5 s, and the sweep's frame took 107-110 ms instead of ~42: about 40 ms of settle plus a ~23 ms texture pass. The constant becomes a switch read once; the "sweeps behind flights" line names the interval in use. The default is not changed in this PR: 8000 is what was measured here (below), on one PC.2. A submission that finds nothing in the air sweeps only when the sweep is due. With the present sent ahead (
late_free_present), nothing is in the air at a submission only when the title was slow to give it, which is the frame after a sudden camera turn.Host::submitransweep()there every time, on the submitting thread and ahead of the frame's submissions. While the card is full the texture pass asks for an idle reclaim every 250 ms (draw::request_idle_reclaim), so that sweep ranresource::let_go_idlefor 39-75 ms under the texture table's lock, on exactly the frames that were already late. The long-frame line of #3703 does not show it: its SWEEP timer covers only the once-a-second part. Now such a submission sweeps only when the sweep is due by its interval (VICTORY_SWEEP_PRESSED_MS/VICTORY_SWEEP_EVERY_MS), as behind flights. Without the present sent ahead it sweeps as before.VICTORY_SWEEP_AT_REST=1sweeps at every such moment, as before (read withasked_for!).What it costs: idle textures are let go less often (see the counters below). On this card that did not show as more textures waiting or held back, but this card is the only one measured.
How it was tested
VICTORY_SWEEP_PRESSED_MS=8000against the default, 3 runs each by turns, frame generation off):VICTORY_SWEEP_PRESS_BY_ROOM=0helped with frame generation off (2.0 / 15.7) but did nothing with it on. #3858 (the sweep in bounded steps) had the fewest long frames (1.0 / 7.7), but on this full card let about half as many idle copies go: textures held back for room 6.4x, the card over its budget.cargo testpassed for the crates it touches: no, not run.victory-gpu's tests need Windows, and this was prepared on Linux. What was run:cargo xwin clippy -p victory-gpu --all-targets --locked --target x86_64-pc-windows-msvc -- -D warningson this branch (cut from main84bd61e2): it builds; the only two findings are main's own and in lines this PR does not touch (method ranged is never usedinshadow.rs:7197,manual implementation of .is_multiple_of()inhost.rs:5099), and with those two lints allowed it passes with no other warning.cargo xtask policy --stagedpassed for both commits.Checked for overlap
VICTORY_ASYNC_SWEEP=0, while change 1 still decides how often the settle runs withVICTORY_SWEEP_AHEAD=0), #3502 and #3578 (makelet_go_idleitself cheaper: complementary), #3951 (releases trimmed spares off the submitting thread: complementary), #3475 (changes how often sweeps run behind flights: conflicts insweep_every_ms), #3703 (the long-frame line whose SWEEP timer does not cover change 2's sweep). No open PR makes the pressed interval a switch or skips the sweep at rest.Written with Claude Code (Claude Opus 5.5): the measurements were run by me on my PC; the code and this text were prepared with it.
🤖 Generated with Claude Code
@IRennie74 on GitHub · 2026-11-30 18:23 UTC · original · edited 2026-11-30 18:44 UTC
A data point for change 2 from another rig: Ryzen 5 5600X, RTX 3060 12 GB, 32 GB, Windows 11, Series S at 960x540 with DLSS Performance, diagnostics build. Our build is based on
41adb551, so it predates main'sVICTORY_SLOT_EVICT_ASIDE.Walking through the cell, defaults gave 13-14 fps and about 63 pauses a minute (present gaps over 150 ms). The once-a-second
sweep()inline inHost::submit:On our build about 85 % of that sweep was slot eviction, which already runs aside on current main (
VICTORY_SLOT_EVICT_ASIDE). What stays inline on main is the 1 Hz part and the idle-reclaimresource::let_go_idlethat this PR gates. So our numbers support not sweeping at every moment with nothing in the air when the present is sent ahead.One thing to keep an eye on with change 2: each
sweep()call also carries outresource::slot_evict_ready(). With the present sent ahead and the card not pressed,sweep_every_msis 15 s, so evictions chosen aside are carried out at most every 15 s instead of at every such moment. While pressed it is 1.5 s (orVICTORY_SWEEP_PRESSED_MS), which is where eviction matters, so this may be fine. A sentence at theduecheck would make it explicit.@trustno1-coder on GitHub · 2026-12-01 18:45 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed