The asking thread runs at the highest priority #93
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!93
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-93"
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 11:17 UTC · original
mgrein:ask-priority→main· +49 −0 · 1 files · 47 commits · closed without mergingWith
VICTORY_ASK_FIRST=1the submitting thread hands each submission's write-watch asking to a kept thread (victory-ask), then waits for it after planning. In the world of a new retail game I added temporary counters around that hand-off. They showed that the job sat in the queue ~150 µs before the thread ran it: 2.5–3.0 ms a frame over ~18 askings, next to ~5.2 ms of the asking itself. With our helpers and the title's threads on every core, the woken thread didn't get one right away. The submitting thread waited 5.9 ms a frame in total.This sets that thread to the highest priority (
THREAD_PRIORITY_HIGHEST) at its first asking. Its work is short (~0.3 ms an asking) and the frame's critical thread is blocked on it, so it shouldn't starve anything.VICTORY_ASK_PRIORITY=<n>(-2 to 2) picks another priority.VICTORY_ASK_PRIORITY=abswitches between the highest and the old priority every 20 seconds and logs each switch (ask-priority switch <unix ms> on|off), for an A/B inside one run.victory-askthread is touched. A submitting thread that makes the asking itself (no thread available) keeps its priority.Measured
RTX 4070, Ryzen 5 5600X, Series S profile, DLSS quality + frame generation,
VICTORY_SUBMIT_SPLIT=1,VICTORY_ASK_FIRST=1,VICTORY_OFF_LINE=1,VICTORY_HELPER_PRIORITY=1. One 10-minute idle run in the world withVICTORY_ASK_PRIORITY=ab. Neighbouring 20 s windows are paired:Frame median about 1.3 ms less (21 of 25 pairs), submitting thread about 1.5 ms less (20 of 25 pairs).
cargo test -p victory-gpu --libpasses. In 6 runs one test failed once, which looks like an existing intermittent test; this change doesn't touch anything tests exercise beyond the asking thread's priority.🤖 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 in the samples - about 5.5-6.7 us per draw. The card is 84-89 % busy and idle 5.1-9.8 ms a frame behind that thread, drawing 46-58 W.
The asking shows up in our breakdown exactly where this PR measures it: 5.3-5.7 ms per frame "asking the write watch", with only 1.0-1.2 of the asks finding something to ask:
That is on a 7700 with 32 MB L3, i.e. less cache than the 5600X in the PR's numbers, so the hand-off waiting may be worse here rather than better. 2-3 ms off the submitting thread would be 5-7 % of a frame here, which matters at 44 ms.
One negative result that may save someone time: we A/B'd Memory Integrity (HVCI) on this machine - the submitting thread cost 6.7 us per draw with it on and 5.5 us with it off, inside scene-to-scene scatter. So the cost is not kernel hardening on the ask path; it is the queueing this PR addresses. We reverted HVCI.
Happy to build and test this branch on the same save and spot and report the same numbers before and after.
@missionarteemis-cloud on GitHub · 2026-11-30 18:35 UTC · original
A data point from an 8-thread CPU (no SMT), where I expected this to matter most: no measurable effect here.
Machine: i7-9700K (8 cores / 8 threads), RTX 4070 12 GB, 32 GB DDR4-3000, Windows 10 22H2 (Agility SDK runtime beside victory.exe), driver 621.40. Series S profile, DLSS Quality, DLSS-FG on, the launcher's v0.8.2 switch set (process above normal, VICTORY_HELPER_PRIORITY=1). A v0.8.2 timeline shows the CPU oversubscribed: the threads' running time adds up to ~1.2x what 8 threads can give, and ~10 ms a frame of "woken, not running yet" sits on the present's chain.
Method: v0.8.2 diagnostics build with this PR and #116 cherry-picked. Your
abmode and #116's flip on the same wall-clock 20 s windows, so I bound both toVICTORY_ABbits instead. Inask_thread_priority(),crate::ab::pick("VICTORY_ASK_PRIORITY")picks 2 when on and the helper priority when off. Phases of 15 s cycle through all four combinations, standing still after loading a save, and each round is compared against its own both-off phase. Rounds where draws a frame moved by more than 2 % are left out.Frame time vs both off, per round (3 steady rounds, ~7,650 draws a frame):
So on this machine the asking thread's priority does not show in the frame time. My guess is that what waits here is mostly the title's own threads (~24 ms a frame on the chain) rather than our helpers. I can run a timeline with it on and off if that would help.
@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