Submitting thread: pass a fence wait whose signal stands behind sent flights (VICTORY_FENCE_AHEAD, off) #2009
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!2009
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2009"
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?
@binarycleric on GitHub · 2026-11-29 07:07 UTC · original
up/fence-ahead→main· +419 −35 · 3 files · 5 commits · closed without mergingStacked on #2008: please merge that one first. Until then this PR also shows its three commits.
What it changes
Why
With the relay, a queue's fence signal goes behind its flights in the air and is set only when they land, after the
card has run them and their results are copied back. Until then another queue's wait for that fence holds its next part:
it can't go, and it can't be joined to the part before it.
What
With VICTORY_FENCE_AHEAD=1, the wait is met (at the head of its queue, or when taken along) by a signal of that fence,
to that value or higher, that stands in the line of flights (
host::late_signalled). It is off by default; nothingchanges without the switch. Why this is equivalent:
the wait runs on the card after the work the signal is behind, which is what the wait asks of the card. It is the
argument already made for a memory value a flight writes (
late_met_known).(
late_blocked, the card steps, the title bytes under their writes).unchanged.
value or another fence still stands.
The submitting thread's line, and its VICTORY_AB phase line, count the waits passed this way.
How it was tested
VICTORY_FENCE_AHEAD=1such a part is taken along. It's off by default, so nothing changes until it's turned on. Not yet measured in play: in #2008's counts, joining never stopped at "a fence not reached" in the release runs we have, so the gain in this game is unprovencargo testpassed for the crates it touches: yes. Rebased onto maine1f2eb60:cargo test --release -p victory-gpu --lib, 592 passed, 0 failed, 44 ignoredTests
a_fence_signalled_behind_flights_sent_is_passed_and_no_other: such a wait goes, and is taken along, without thefence set; a wait for a higher value or for another fence still stands; the title's fence values don't move until set.
a_wait_is_met_behind_flights_only_by_its_fences_signal(host): a signal in the flights' line meets only its ownfence's waits, at its value or below.
parts_taken_along_keep_the_order_and_the_fences_of_parts_done_alone: the same work across two queues that waitfor each other's fences, with a drain and a present between, done part by part and with parts taken along. Each queue's
order is the same, a part behind a cross-queue wait comes after the part the signal is behind, nothing is joined
across the present, and the drain ends with everything before it done and its fences set.
Numbers
None yet. The A/B play run (VICTORY_FENCE_AHEAD on/off under the same load) hasn't come in, so there's no
measured gain. In the release runs we have (#2008's table), joining never stopped at "a fence not reached", so this can
only matter for fence waits at the head of a queue; its counter says how many are passed. This stays off by default
until a run shows a gain.
Not covered
flight, as
value_passedgives memory values.submitting thread would have to keep that.
Checked for overlap
A queue's wait for a fence stood until the fence was set. With the relay, a queue's signal goes behind its flights in the air and is set only when they land, after the card has run them and their results are copied back. Meanwhile the waiting queue's next part could not go, and could not be joined to the part before it either ("a fence not reached"). With the switch, the wait is met, at the head of its queue or when taken along, by a signal of that fence to that value or more that stands in the line of flights. Why that is equivalent: - Every host submission goes to the one direct queue (two_queues is a plan only) in the order it is sent, and the card runs them in that order. - A signal is put in that line only once everything its queue was given before it has been sent. So the part behind the wait runs on the card after the work the signal is behind, which is what the wait asks of the card. This is the argument already made for a memory value a flight writes (late_met_known). - What preparing that part reads on the CPU of what those flights write is kept as for any part sent behind flights: late_blocked, the steps done on the card, the title bytes under their writes. - The title still sees the fence reach the value when the flights land, never earlier, so its own CPU waits and reads are unchanged. - A signal taken out of the line to be landed is not seen, so the wait stands until the fence is set, as before. A wait for a higher value, or another fence, still stands. Not covered: the two-queue plan (VICTORY_ASYNC_QUEUE=plan) does not order such a pass; it would need a wait for the other queue's flight, as value_passed gives memory values. And the argument depends on submissions reaching the card in the order they are sent, which a sender thread must keep. The submitting thread's line counts the waits passed so. Tests: such a wait goes and is taken along without the fence set, while a higher value or another fence still stands. A signal in the flights' line meets only its own fence's waits, at its value or below.Pull request closed