GPU feed: our send-up list goes first in its submission's own ExecuteCommandLists call (VICTORY_FEED_ONE_CALL=1, off by default) #1134

Closed
exotiquee wants to merge 1 commit from upstream-pr/1137 into main
exotiquee commented 2026-11-25 21:23:08 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by exotiquee on 2026-11-25T21:23:08Z.


Branch: pr/feed-one-call (1 commit on main 085ee7c)

What it does

Today Host::card_before closes the send-up and hash list (the changed bytes of host copies in the card's memory, sent up and hashed again) and sends it in an ExecuteCommandLists call of its own, ahead of the submission's call.

With the switch it closes the list but does not send it. The list comes back as a SendUp, and submit puts it at the front of the submission's own lists. In timing runs (VICTORY_GPU_TIMING) it goes in the first group, and firsts shifts by one.

The card runs the same commands in the same order:

  • Nothing else reaches the direct queue between the old place and the new one. The copy queue's hold stays ahead of both, and settles and card_results_low come before card_before.
  • With the relay, the queue's order (QUEUE_ORDER) stays held until the call, so a fetch numbered after the send still runs behind it.
  • The send's number for fetches on the copy queue (Second::sent_up) is signalled behind the call: later than before, never earlier.

Off, nothing changes. numbered is factored out of card_before so that both paths signal the same way.

What it saves: one ExecuteCommandLists call and one boundary between calls per submission, 15-17 a frame in the title.

Not in this PR: the feed meter (VICTORY_FEED_METER, our stage F0) that this change was developed and counted with.

  • Its port to main conflicts in 38 places: it decodes barrier origins for our hoisted clamps, runs and gathers.
  • With the meter on by default in one build, the visible window showed only white while the log showed frames rendering. Turning the meter off brought the picture back.
  • We then made the meter an opt-in bitmask (1 counts, +2 timestamps, +4 barrier-group decode), off by default. We never found the cause of the white window, and it did not reproduce offline.

So the meter stays out until it is ported and that is understood.

Switch

VICTORY_FEED_ONE_CALL=1. Off by default.

Tests

  • warp_three_copies_go_up_in_one_list_and_their_writes_come_back, new here:
    • three host copies in the card's memory, title bytes sent up and shader writes declared in every round;
    • run with the switch off and then on, through a per-thread override;
    • checks that the shaders read the title bytes sent up in the same submission, the writes come back, the bytes are the same both ways, and with the switch every round's send-up list went in the submission's call.
    • It runs on the software adapter only (VICTORY_D3D12_WARP=1, diagnostics), where the debug layer checks the barriers. Result there: passed. The queue2 tests on WARP with the switch set in the environment also passed: 10 passed, one skipped for its relay/queue settings.
  • cargo +1.98.1 test --locked -j 4 -p victory-gpu: 184 passed. With --features diagnostics: 201 passed.
  • No new compiler or clippy warnings against main.

What we measured (RTX 5080, Ryzen 7 9800X3D)

  • Bench: a boundary between ExecuteCommandLists calls cost ~15 µs, against 0.09 µs for a boundary between lists inside one call.
  • In the title there is no isolated measurement. These runs were not scene-matched, and later we found that ±2 fps between runs can come from where the player stands:
    • Hidden runs: without this switch and without the clamp switch tested with it, ~11 fps (5.5-14.8, with dips, card 62%). With this switch and the heap and descriptor-slot switches on (but not the clamp switch), ~13.7 fps; this switch was not isolated.
    • A visible run with this switch, the clamp switch (VICTORY_CLAMP_AT_WRITE) and several heap/descriptor switches came out about +2 fps over the same build with all of them off: 13.3-15.3 fps (~14.3) against ~12.2.
  • Crash bisect. A crash showed up in hidden runs with this switch and the clamp switch both on. With this switch alone there was no crash. The crash was the clamp switch: a ~20 s stall in a loading frame.

Risks

  • The send's number for copy-queue fetches is signalled later than before (behind the submission's call). That only makes a fetch count fewer sends as done, never more.
  • If submit returned between card_before and its ExecuteCommandLists with the switch on, the send-up list would be dropped unsent. Today every path from card_before reaches a call: the late path and the group loop both take the SendUp.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:5499404885 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1137). Originally posted by [exotiquee](https://github.com/exotiquee) on 2026-11-25T21:23:08Z. --- Branch: `pr/feed-one-call` (1 commit on `main` 085ee7c) ## What it does Today `Host::card_before` closes the send-up and hash list (the changed bytes of host copies in the card's memory, sent up and hashed again) and sends it in an `ExecuteCommandLists` call of its own, ahead of the submission's call. With the switch it closes the list but does not send it. The list comes back as a `SendUp`, and `submit` puts it at the front of the submission's own lists. In timing runs (`VICTORY_GPU_TIMING`) it goes in the first group, and `firsts` shifts by one. The card runs the same commands in the same order: - Nothing else reaches the direct queue between the old place and the new one. The copy queue's hold stays ahead of both, and settles and `card_results_low` come before `card_before`. - With the relay, the queue's order (`QUEUE_ORDER`) stays held until the call, so a fetch numbered after the send still runs behind it. - The send's number for fetches on the copy queue (`Second::sent_up`) is signalled behind the call: later than before, never earlier. Off, nothing changes. `numbered` is factored out of `card_before` so that both paths signal the same way. What it saves: one `ExecuteCommandLists` call and one boundary between calls per submission, 15-17 a frame in the title. **Not in this PR:** the feed meter (`VICTORY_FEED_METER`, our stage F0) that this change was developed and counted with. - Its port to `main` conflicts in 38 places: it decodes barrier origins for our hoisted clamps, runs and gathers. - With the meter on by default in one build, the visible window showed only white while the log showed frames rendering. Turning the meter off brought the picture back. - We then made the meter an opt-in bitmask (1 counts, +2 timestamps, +4 barrier-group decode), off by default. We never found the cause of the white window, and it did not reproduce offline. So the meter stays out until it is ported and that is understood. ## Switch `VICTORY_FEED_ONE_CALL=1`. **Off by default.** ## Tests - `warp_three_copies_go_up_in_one_list_and_their_writes_come_back`, new here: - three host copies in the card's memory, title bytes sent up and shader writes declared in every round; - run with the switch off and then on, through a per-thread override; - checks that the shaders read the title bytes sent up in the same submission, the writes come back, the bytes are the same both ways, and with the switch every round's send-up list went in the submission's call. - It runs on the software adapter only (`VICTORY_D3D12_WARP=1`, diagnostics), where the debug layer checks the barriers. Result there: passed. The queue2 tests on WARP with the switch set in the environment also passed: 10 passed, one skipped for its relay/queue settings. - `cargo +1.98.1 test --locked -j 4 -p victory-gpu`: 184 passed. With `--features diagnostics`: 201 passed. - No new compiler or clippy warnings against `main`. ## What we measured (RTX 5080, Ryzen 7 9800X3D) - **Bench:** a boundary between `ExecuteCommandLists` calls cost ~15 µs, against 0.09 µs for a boundary between lists inside one call. - **In the title** there is no isolated measurement. These runs were not scene-matched, and later we found that ±2 fps between runs can come from where the player stands: - Hidden runs: without this switch and without the clamp switch tested with it, ~11 fps (5.5-14.8, with dips, card 62%). With this switch and the heap and descriptor-slot switches on (but not the clamp switch), ~13.7 fps; this switch was not isolated. - A visible run with this switch, the clamp switch (`VICTORY_CLAMP_AT_WRITE`) and several heap/descriptor switches came out about +2 fps over the same build with all of them off: 13.3-15.3 fps (~14.3) against ~12.2. - **Crash bisect.** A crash showed up in hidden runs with this switch and the clamp switch both on. With this switch alone there was no crash. The crash was the clamp switch: a ~20 s stall in a loading frame. ## Risks - The send's number for copy-queue fetches is signalled later than before (behind the submission's call). That only makes a fetch count fewer sends as done, never more. - If `submit` returned between `card_before` and its `ExecuteCommandLists` with the switch on, the send-up list would be dropped unsent. Today every path from `card_before` reaches a call: the late path and the group loop both take the `SendUp`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
BitWuehler commented 2026-11-25 23:09:59 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by BitWuehler on 2026-11-25T23:03:03Z.


Tested on Linux (GE-Proton + vkd3d-proton, RTX 5080) together with #1078, #1086, #1136, #1138, #1146, and #154:

  • heap buffers: dropped from 200.4 ms median (848 ms max) down to 17–35 ms
  • remapping: ... waiting for readers: 0.0 ms
  • copying back: median improved from 161.6 ms to 130.6 ms (CARD_FETCH_INFLIGHT=1 fetch wait 3.7 ms -> 0.6–1.4 ms)
  • With VICTORY_PIPELINE_WAIT_MS=50, world intervals reached med=252.1 ms (4.0 fps) and max=8.6 fps (116.8 ms/frame) (usual frame: 87–92 ms).

Note: Log analysis and write-up were AI-assisted based on local runtime measurements.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7177088526 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1137#issuecomment-7177088526). Originally posted by [BitWuehler](https://github.com/BitWuehler) on 2026-11-25T23:03:03Z. --- Tested on Linux (GE-Proton + vkd3d-proton, RTX 5080) together with #1078, #1086, #1136, #1138, #1146, and #154: - `heap buffers`: dropped from `200.4 ms` median (`848 ms` max) down to `17–35 ms` - `remapping: ... waiting for readers`: `0.0 ms` - `copying back`: median improved from `161.6 ms` to `130.6 ms` (`CARD_FETCH_INFLIGHT=1` fetch wait `3.7 ms -> 0.6–1.4 ms`) - With `VICTORY_PIPELINE_WAIT_MS=50`, world intervals reached `med=252.1 ms (4.0 fps)` and `max=8.6 fps (116.8 ms/frame)` (`usual frame: 87–92 ms`). *Note: Log analysis and write-up were AI-assisted based on local runtime measurements.*

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!1134
No description provided.