perf: a fill behind a copy at its place takes the copy's upload bytes (VICTORY_FILL_AFTER_COPY, off by default) #481
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!481
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-481"
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?
@Anzymanz on GitHub · 2026-11-27 02:20 UTC · original
Anzymanz:perf/fill-after-copy→main· +364 −9 · 6 files · 2 commits · openWhat it fixes. On our build the submitting thread waited 48-67 ms a frame for flights before one kind of fill (two whole runs). We tested this switch together with two others our build also has,
VICTORY_PLACED_ORDER=1andVICTORY_LATE_WAIT_LISTS=512. With all three on:Frame time, from interleaved whole runs of the same scene: 154 ms with all three off (mean of 7 runs, range 137-181) against 145.5 ms with all three on (mean of 4 runs, range 133-157). The ranges overlap, so the frame figure is weak; the wait figures are the result. The three were never measured apart. On our build, this switch alone still left fills ahead of the copy refused.
Hardware: RX 9070 XT, Ryzen 9 5950X, Mesa 26.3.1 RADV, GE-Proton11-14 with the view-tree wineserver, Series X profile at 4K, ray tracing on.
What it needs beside it on AnyXboxX
main(read from the code, not measured):VICTORY_LATE_WAIT=0(device lost on RADV, fork issue #184), so it does nothing in that profile. Unset, late waits are on when the relay is.VICTORY_PLACED_ORDER(off by default). Without it, a card step that touches the copy's bytes is refused wherever the copy stands, so the fills ahead of the copy still wait.VICTORY_LATE_WAIT_LISTS(256 by default). On our build, the 256-list cap cost 25 ms a frame once the fill waits were gone, until it was raised to 512.Why. The title keeps a ring of constants in memory that flights are declared to write: a UAV view of its whole graphics heap, used by a few compute passes a frame. Once a frame, a copy at its place (
host/place.rs) writes into that ring out of the list's upload memory, and a fill later in the same list reads those bytes as constants. The fill reads title memory on the CPU at submission (Step::Fill), so it waits until every flight declared to write there has landed. On the card it is refused while the list holds a copy at its place.Change. With
VICTORY_FILL_AFTER_COPY=1, such a fill reads the bytes from the copy's upload memory instead. All of these conditions must hold:Run) stands between them.Placed::preparefills that upload memory on the CPU at the copy's step whether or not the copy can land yet, so the fill gets the same bytes the card has at the destination when the list reads them. The newStep::ForwardedFilldoes not read title memory, so it holds nothing back (blocked_by) and the card-step planner skips it. A copy out of a host copy is refused: the card copies what shaders wrote there, not what the CPU took. The frame-rate line counts forwarded fills per frame when the switch is on.The decision is a pure function over the list's steps (
host/place/forward.rs), unit-tested without a GPU. avatarmanz landed the same idea independently on their main (84917c34, renderer port RT part 1:HostList::forward_fill,port_rt::forwarded); credit to them.Tests (Windows target through cargo-xwin, run under Wine):
watch(holes_are_known_until_the_runtime_tells,no_mapping_is_lost_between_askers,what_is_left_alone_is_no_known_hole); they fail the same way on unmodifiedmainunder Wine (checked: 45 passed, the same 3 failed);cargo xtask policypasses, andcargo clippy(Windows target) passes, with one warning in the untouchedoverlay.rs.Not run: Windows itself, NVIDIA, and any game run on this branch.
Written with Claude Code (port by an OpenAI Codex agent, reviewed by Claude).
@chatgpt-codex-connector[bot] on GitHub · 2026-11-27 02:21 UTC · original · edited 2026-11-27 02:27 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
6580d42ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-27 02:27 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
6580d4285fℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@ -0,0 +86,4 @@}let fill = src..src.checked_add(len)?;let mut later = Vec::new();for step in steps {@chatgpt-codex-connector[bot] on GitHub · 2026-11-27 02:27 UTC · original
With
VICTORY_FILL_AFTER_COPY=1, everydefer_upload_fillinvokes this walk. On a command list with many fills and writes but noRunbarrier or earlierPlacedcopy covering a fill source, the loop visits the entire prefix and accumulates its writes before returningNone; repeating that for M fills over N steps is O(MN) and repeatedly grows a temporary vector on the recording path even though every fill falls back. This can erase the opt-in optimization on nonmatching lists; index or short-circuit eligible placements instead of rescanning the history for each fill.Useful? React with 👍 / 👎.
@ -0,0 +86,4 @@}let fill = src..src.checked_add(len)?;let mut later = Vec::new();for step in steps {@Anzymanz on GitHub · 2026-11-27 02:38 UTC · original
Fair point, fixed in
fe33308without changing what gets forwarded.The list now keeps its copies at their place out of upload memory since its last
Run(index, destination, bytes). Only such a copy that holds the whole fill can give it its bytes. Soforwardfirst picks the earliest of those that holds the fill, and walks back only to it. A fill with none costs a look at that short list, usually empty or one entry, and no walk at all.Before that copy there is only a
Run(which ends the walk with nothing) or steps that can't give the fill its bytes. So the result is the same as walking every step. Two new tests cover this:All 11 forwarding tests pass under Wine (Windows target), and clippy is clean apart from the existing warning in
overlay.rs.Written with Claude Code.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.