host: the sweep runs behind flights instead of draining the card every 1.5 s (VICTORY_SWEEP_SETTLE) #354
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/lobomfz--VIctory-xmem!354
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-354"
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?
@OliWoly on GitHub · 2026-12-03 19:26 UTC · original
OliWoly:pr/sweep-behind-flights→main· +42 −2 · 2 files · 2 commits · closed without mergingProblem
With submissions sent ahead (
late && flying()), the once-a-second sweep (idle shadow windows, staging buffers, host copies, the pools' blocks) waited for a moment with nothing in the air. Since the present is sent ahead too, nothing brought one, so every 1.5 ssettle(WHY_SYNC)drained the card for it.With FSR 4 frame generation at ~30 real fps that was a frame of ~42 ms GPU wait every 1.5 s: 69 of 499 frames over 50 ms in 277 s in the world, including a chain of 35 of them exactly 1.5 s apart while standing still.
Separately, the "long frame" lines stopped at 5,000, which a busy 30 fps session reaches about 20 minutes in.
Changes
retire, which waits for every submission begun or in the line to finish;VICTORY_SWEEP_SETTLE=1keeps the old drain, for comparison.VICTORY_LONG_FRAMESsets how many long-frame lines are written (default 50,000, was 5,000).docs/SETTINGS.mdlists both.Results
Same settings, ~28 min in the world against the first ~18 min of the run before:
About 3 hours of play with the change before the latest rebase, with no device loss.
All numbers come from one machine:
VICTORY_FIDELITYFX_FRAMEGEN_DIRECT=1),VICTORY_UI_PLANE=3840x2160,VICTORY_LATE_FENCE=1, RT onPlay differs between runs (route, scene density), so the comparison is indicative. The 1.5 s pattern is the clear part: it was in every run before and in none after.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Bg4XQaVExsGA3ocyAed39H
@Kal0s-design on GitHub · 2026-12-03 19:47 UTC · original
Tested
b6d12dfnatively on Windows 11 (MSVC, toolchain 1.98.1), with the D3D12 host tests on one NVIDIA desktop card. I didn't run a game, so this is code reading plus the unit suite.I went through what the sweep frees and it holds up as far as I can see. Shadow windows and host copies are only taken when the table has the last
Arcand the D3D object has a single reference, and then they go throughretire. Texture and staging pool blocks also go throughretire. Staging buffers are dropped directly but only atstrong_count == 1under the table lock, andunstagefromtake_idleonly drops the table'sArc. A list holds the shadow window and the stagingArcfrom the moment it records the step (Step::Refresh/Step::Texture), so a list that is still open is covered by the count checks even thoughretiredoesn't know about it. For lists already submitted, the job being prepared is still counted inqueued()while the sweep runs, sinceQUEUEDis decremented afterexecute_late/execute_partsreturn, and flights in the air are already inSTARTED. I also checked locally that something retired survivesburyup to tag +BURY_LAG- 1 and goes at tag +BURY_LAG(throwaway test, not pushed).The "host submission not waited for" path in the sync submit hasn't changed and it settles before it submits, so I don't think this adds to it.
VICTORY_POOL_MOVE=1(move_out) only changes CPU tables and retires the old copies, and the slot remap happens at a later texture pass either way, so the old drain didn't protect it anyway.One thing is new.
flying()is also true while the relay is landing, so before this the sweep never ran at the same time as a landing, and now it can. I compared the locks the sweep takes with what landing andburydrop and didn't find an ordering problem, but I haven't proven it, and nothing in the unit suite goes throughexecute_late.Two comments are out of date now, the one above the
behindcheck insubmit("nothing runs now") and the one beforeretireinshadow::let_go_idle.Both new switches are read once through
OnceLock. 50,000 long-frame lines is just a bigger log, nothing else grows.Test suite (
cargo test -p victory-gpu --lib -- --test-threads=4 --skip descriptor::tests::views_die_with_their_resource)VICTORY_SWEEP_SETTLE=1, same00aa4d3, 338 passed, 5 failed, 23 ignoredThe 4 failures are the same tests on both (two
indirect::tests::host_list_*and twopipeline::hostlibrary tests). The fifth one on main iswatch::tests::the_rest_of_the_one_asking_has_a_number_of_its_own, which failed once on main and passed on the PR head, and it's known to be flaky. Clippy on-p victory-gpu --all-targetsgives the same warnings as main.AI-assisted: yes
@joaowtrdev on GitHub · 2026-12-03 22:08 UTC · original
Tested this together with #364 against plain
main(6064c04), so the numbers below are for both PRs at once (b6d12df+d9346bbmerged on6064c04).Ryzen 7 5700X3D, RX 9070 XT, CachyOS, system Wine 11.22. 4K output, FSR 4 Performance, RT on,
VICTORY_UI_PLANE=3840x2160,VICTORY_CARD_PULL=0,VICTORY_PAGES_SEEN=1,VICTORY_PARTS_ONE_CALL=1, lsfg-vk 2x. One run each, back to back, from the same save: ~3 min standing, then ~6 min driving my usual route through the city.Driving part:
mainmain+ #354 + #364long frame≥ 75 ms, per minlong frame≥ 100 ms, per minStanding: 27.1 vs 28.0 fps.
So the average is unchanged and the long frames drop by about a third, in line with what you measured. On
mainhere the 1.5 s chains were short (at most 2 in a row), so most of the gain seems to come from each sweep costing less rather than the chains going away. It is one run each and the route is never quite the same, but the difference is well above what I usually see between runs.I'm staying on this build for now and will report if anything goes wrong. I also get the
SQC (data)device loss in #271, where the last thing before the fault is a sweep, so I'll say there whether it shows up again on this build.@fsrajner on GitHub · 2026-12-03 22:17 UTC · original
Tested this together with #364 (and #351/#352) on top of main, with the default (no drain). In this scene we see no measurable change: no fewer long frames, and the worst windows are unchanged. We run without frame generation at about 22 fps, so the 1.5 s drain may matter less here than in your FG case.
Setup: RX 9070 XT 16 GB, Ryzen 7 7800X3D, CachyOS, RADV from this repo's
setup.sh(Mesa 26.3.1 + patches). Series X, 3840x2160 output, FSR 4 Quality (4.1.2), RT at defaults, headless gamescope. Same save (the intro), the game stops 120 s after the first press; metric over the 5 sstats: framewindows after loading. 2 runs per variant, main =6064c04.UNIFORM_GUEST_LOADS=1+CLUSTER_GUEST_LOADS=1UNIFORM_GUEST_LOADS=1+CLUSTER_GUEST_LOADS=1Run-to-run spread here is about ±1 ms/frame, and the worst window moves between 56 and 72 ms, so all of these are within noise.
@Benflex1 on GitHub · 2026-12-04 10:30 UTC · original
A data point combining this with #342 (
VICTORY_HW_RT=1). This is a single occurrence, so treat it as a lead, not proof.Setup
a70bd85plus4c5a736from this PR, on an RX 7900 XTX with RADV.VICTORY_CLUSTER_GUEST_LOADS=1andVICTORY_UNIFORM_GUEST_LOADS=1.VICTORY_SWEEP_SETTLE=1vs the default.What happened
0x887A0005).vkd3d_queuethread:Faulty UTCL2 client ID: SQC (data),PERMISSION_FAULTS: 0x3.Limitations
VICTORY_HW_RT=1) and the guest-load switches. It does not show a problem with this PR on main, or without HW RT.VICTORY_D3D12_DEBUGand there was no GPU crash dump.Interpretation (speculative)
That fits a resource being released by the sweep while a still-in-flight list reads it, perhaps via RT structures that outlive the lists the sweep checks. I have not isolated it further. I'm happy to run a diagnostics build with
VICTORY_D3D12_DEBUG=1on the same replay if that helps.@Luxuride on GitHub · 2026-12-04 12:10 UTC · original · edited 2026-12-05 11:22 UTC
Right diagnosis, real numbers, and it was shipped twice:
maincarries the change and the follow-up carries the part that was not ported. Whether anything is left here is the maintainer's call, not mine.What I checked:
git merge-base --is-ancestor pr/354 pr/355returns true, and your two commits (b6d12df,4c5a736) are byte-identical to the first two commits of that branch. There is nothing here that the follow-up does not have, so the maintainer should read the follow-up once and not this.crates/victory-gpu/src/host.rs:4512: theelse if !sweep_settles()branch is a copy of the!behindbranch — same two statements. Harmless, but it reads as if the two cases differ when they do not. The follow-up collapses it into one comment, which is the better shape.VICTORY_SWEEP_SETTLEandVICTORY_LONG_FRAMESare indocs/SETTINGS.md:151-152but not inrun.conf.default, where this project keeps the same switch list. Same gap in the follow-up.VICTORY_LONG_FRAMEScap change (5,000 → 50,000 lines) is unrelated to the sweep fix and makes a five-minute diagnostic log up to 10× longer. It belongs in its own commit at the very least.50 commits behind, conflicts in
docs/SETTINGS.mdonly.@OliWoly on GitHub · 2026-12-04 12:44 UTC · original
Closing in favour of #355, which contains these two commits unchanged (now rebased on
main) and carries this PR's numbers and the test results posted here. Thanks to everyone who tested.Pull request closed