Preludes recorded on a thread of their own #89
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/readmet3xt-lab--foxhound!89
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-89"
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?
@mgrein on GitHub · 2026-11-30 10:37 UTC · original
mgrein:prelude-away→main· +190 −32 · 1 files · 47 commits · closed without mergingEach of the title's lists that changes a texture's state gets a prelude list at submission (state transitions, twin copies, prelude uploads). In the world of a new retail game that's about 226 preludes a frame. Recording one costs ~16 µs in the driver: allocator reset, list reset, barriers and close. A profile of the submitting thread put this at 8 % (≈3.6 ms a frame), all on the thread the frame waits for.
The fix splits
HostList::preludein two:prelude_workdecides the prelude at submission, in order, exactly as before. The textures' real states still move there.PreludeWork::recorddoes the driver work. WithVICTORY_PRELUDE_AWAYon (the default), that runs on a thread kept for it (victory-prelude) while the submitting thread goes on with the next lists, the refreshes and the card copies.The lists get a placeholder for their prelude. The placeholder is filled right before the lists are sent: by the sending thread under
VICTORY_SUBMIT_SPLIT, or by the submitting thread otherwise. The barriers borrow their resources, so the work holdsArcs of every texture it names until it has been recorded.A submission that contains the same list twice records its preludes in place, as before. That list has one prelude, and it can't be recorded twice at once. A failed recording still ends in
fail, on the waiting thread.VICTORY_PRELUDE_AWAY=0records them where they are decided, as before.VICTORY_PRELUDE_AWAY=abswitches on and off every 20 seconds and logs each switch (prelude-away switch <unix ms> on|off), for an A/B inside one run.Measured
RTX 4070, Ryzen 5 5600X, Series S profile, DLSS quality + frame generation, with
VICTORY_SUBMIT_SPLIT=1,VICTORY_ASK_FIRST=1andVICTORY_OFF_LINE=1. One 10-minute idle run in the world withVICTORY_PRELUDE_AWAY=ab. Neighbouring 20 s windows are paired (they see nearly the same scene):No picture or log problems in the run.
cargo test -p victory-gpu --libpasses.🤖 Generated with Claude Code
@kodifan on GitHub · 2026-11-30 12:57 UTC · original
Context: RTX 5060 Ti 16 GB, Ryzen 7 7700 (32 MB L3), 32 GB DDR5-6000, Windows 11 26200, driver 621.24. foxhound v0.8.2, Series S, DLSS Quality, Frame Generation on, 30 fps target. Measured from the layer's own per-frame lines.
Rendered frame 44.0 ms at 5,990 draws (21 fps), 57.7-60.7 ms at 8,744 draws (16 fps). The submitting thread is the whole frame: 39.3 / 40.4 / 43.0 / 48.2 ms - about 5.5-6.7 us per draw - with the card 84-89 % busy and idle 5.1-9.8 ms a frame behind it.
The lists' steps are the largest single item on that thread:
and in a busier spot:
That is 15-20 ms of a 39-48 ms thread, so if ~226 preludes a frame at ~16 us each is right, moving their recording off the thread should show up plainly here - 3-4 ms, i.e. 7-9 % of the frame on this CPU.
Related and possibly a bigger win: 85-88 % of the slots scanned per frame are "known to copy nothing" (8,363 of 9,482; 6,126 of 7,245). If that scan can be skipped or kept as a compact list between frames, it looks like more than the preludes.
Happy to build and test this branch on the same save and spot and report the same numbers before and after.
@readmet3xt-lab on GitHub · 2026-12-01 01:36 UTC · original
A note on why this shows as closed: GitHub closed every open pull request by itself when main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), and they cannot be reopened. This is not a rejection.
Your change is in the batch being tested for the next release, carried over as one commit with you as its author. Nothing is needed from you now; the result will be posted here.
Pull request closed