Skip to content

(Opt-in, +1 fps in light scenes) Prepare the next submission while the last one is sent (VICTORY_SUBMIT_SPLIT, VICTORY_OFF_LINE) - #1066

Closed
yeedgrthfgv wants to merge 7 commits into
trustno1-coder:mainfrom
yeedgrthfgv:pr/submit-split
Closed

yeedgrthfgv wants to merge 7 commits into
trustno1-coder:mainfrom
yeedgrthfgv:pr/submit-split

Conversation

@yeedgrthfgv

Copy link
Copy Markdown
Contributor

On CPU-bound PCs one thread sets the frame: the submitting thread (victory-submit, queue::behind lane, Host::send_late). On a Ryzen 5 9600X + RTX 5080 it is busy for nearly all of a 41 ms frame (a sampling profile puts 90 % of its time in send_late), and making other threads faster (#834, #801, VICTORY_WIDE_THREADS, VICTORY_ASK_EARLY, measured here) did not change the frame rate. Issues #699, #833, #855 and #985 show the same on other PCs.

This PR ports two switches from Biskwit/VIctory-reloaded that take work off that thread. Both are off by default. With them unset every submission takes the old path: nothing is published, the new sender thread is never started, wait_sent returns on an atomic before it takes any lock, and the card steps' slots are written by the same code as before.

VICTORY_SUBMIT_SPLIT=1 (from Biskwit/VIctory-reloaded d5bd9d8)

Two threads in a row. The lane's thread prepares a submission as before, takes what goes up to the copies in the card's memory (card_take, numbered under QUEUE_ORDER), puts the placed copies' bytes into their references, then publishes it under the submission lock: its fence value, and its flight, bottom-of-pipe writes and declared ranges in the line. A new thread, victory-send, then records the sends to card copies and the compare (card_record), waits for the heaps' records, makes the slots that waited for textures, calls ExecuteCommandLists and signals the fence. The lane's thread prepares the next submission meanwhile.

Order and safety (as in Biskwit's commit, checked against this tree):

  • Only the sender sends published submissions, in publishing order. Every other submission (waited for, the present's copy, ours) first waits under the submission lock until everything published was sent (wait_sent), so it gets a higher fence value. The timeline's calibration submission (diagnostics) waits too.
  • A published submission is in the line, so everything that asks what flights write sees it, and waits for it to land where it would have.
  • The sender never takes the submission lock and never waits for the lane's thread, so a holder of that lock can wait for a published flight to land.
  • A failed send or signal, a lost device or a panic on the sender is fail, as on the one thread before. Nothing published is dropped.
  • Needs the relay's second stage, the relay's fetches on the copy queue and send::own (VICTORY_RELAY=2, VICTORY_RELAY_COPY=1, as play-foxhound.ps1 sets them). Without them the switch does nothing.

Changes against Biskwit's commit: off by default (asked_for!), the conflicts resolved against this tree (streamline tags, two-queues plan, texback ranges, Batch reuse, heap_marks timing, span_lists and timeline::sent signatures, AFTER_SEND), the calibration submission waits for published ones, and his late texture read-back test is left out (this tree does not have it).

Biskwit's numbers (i9-12900K + RTX 4090, Series S, in-run A/B): see the commit message.

VICTORY_OFF_LINE=1, with VICTORY_SUBMIT_SPLIT=1 (from Biskwit/VIctory-reloaded 821867c)

The descriptor slots that steps done on the card fill (about 11,000 a frame there, 1.9 ms on the lane) are kept with the published submission and written by the sender, after that submission's heaps' records and before its lists go to the queue. Synchronous submissions still write theirs on the lane, after wait_sent. Only the slots half of that commit is here: its other half (closing host lists at recycle) is already covered in this tree by HostList::leave_open, and its slot-order counter (VICTORY_SLOT_ORDER_COUNT) was a one-off measurement.

Credit and licence

Both changes are Biskwit's (https://github.com/Biskwit/VIctory-reloaded, GPL-3.0-or-later, same licence text as this repo); the commits keep him as author. I found them through Keel62155/VIctoryUnified, which carries them off by default. My part is the port to this tree and the opt-in defaults. I did not find an open or closed PR here with the same change (searched SUBMIT_SPLIT, OFF_LINE, victory-send, split submission, Biskwit, reloaded).

Checks

  • cargo build --release --locked -p victory: ok.
  • cargo test --release --locked -p victory-gpu --lib: 453 passed, 0 failed, 36 ignored.
  • cargo clippy -p victory-gpu -p victory-hle --all-targets, with and without diagnostics: no finding in the changed files (the ones left are in shadow.rs, descriptor.rs and gameinput.rs, as on main).
  • No unit test of the split itself: it needs the relay and a device, which the crate's tests run without.

In the game

Measured with a build of this branch plus one more commit of Biskwit's (thread placement, VICTORY_PLACE_APART / VICTORY_PLACE_LANE, left out of this PR: it overlaps #419 and #475 and changes nothing on a CPU with one kind of core, as here). Ryzen 5 9600X (6 cores) + RTX 5080, Windows 11, Series X 4K output, DLSS Performance, frame generation 2x, THIN=1, JOIN_PARTS=8, ASYNC_SUBMIT=1, RELAY=2, RELAY_COPY=1 (play-foxhound.ps1), opening prison scene, about 4,800 draws a frame, warm cache. One release exe of this branch for every run, only the switches changing, alternating runs of 240 s; frame lines from 30 to 150 s after the world starts, and the settled part from 90 to 150 s.

run fps 30-150 s fps 90-150 s (median) preparing ms (90-150 s) sender worked ms a frame
off 1 25.0 26.5 (26.6) 25.6
split 1 26.1 27.7 (27.7) 23.0 3.5
split + off line 1 25.9 27.5 (27.5) 23.0 4.8
off 2 24.5 26.4 (26.4) 25.6
split 2 25.0 25.8 (26.9) 26.6 3.3
split + off line 2 25.5 27.0 (26.8) 24.2 4.7

Means: off 24.8 / 26.5, split 25.6 / 26.8, split + off line 25.7 / 27.3 (30-150 s / 90-150 s). So about +1 fps (3 to 4 %) on this PC, with the preparing time 1.5 to 2.5 ms shorter. The sender takes 3.3 to 3.5 ms a frame off the lane, 4.7 to 4.8 ms with OFF_LINE (about 15.4 submissions a frame). The two off runs agree within 0.1 fps in the settled part, so the gain is above the spread here, but it is small and two rounds are not many.

"split 2" had three short stalls in its settled part (one 5 s line at 13.9 fps with 54 ms preparing, two at 20 to 21.5 fps); the off runs had none in that part, the other three split runs had none either. I can not tell yet whether that is the split or the scene streaming; worth watching.

Stability: no device removal, no panic and no new warning in the four runs with the split on (16 minutes); the warnings counted in each log were the same kinds as with it off. Nobody watched the screen during these runs, so I can not say anything about the picture yet.

🤖 Generated with Claude Code

Biskwit and others added 2 commits November 28, 2026 13:08
Cause: the thread that prepares and sends submissions is the wall of a
Series S frame. Timeline split-tl-1 covered 10 settled frames of 47.4 ms.
That thread worked 44.9 ms of each: about 40 on the CPU and 8 in waits
(3.1 for the wide helpers, 1.9 on the guards mutex, 1.1 for the heaps'
records). Some 7 ms of it came after the submission was prepared, and
nothing of the next submission's preparing needs it:
- recording and sending the list that brings copies in the card's
  memory up to date, and the compare list;
- the wait for the heaps' records, and the slots that wait for textures;
- ExecuteCommandLists.
The title's present thread waited 15.5 ms a frame for it.

Change: two threads in a row. The line's thread prepares; victory-send
sends. N+1 is prepared while N is sent. On by default; with
VICTORY_SUBMIT_SPLIT=0 one thread does both, as before. With VICTORY_AB
it is switched on and off while the title runs. It needs the relay's
second stage, fetches on the copy queue and send::own (play.ps1's
defaults).
- The line's thread prepares as before. Then it takes what goes up to
  copies in the card's memory (card_take: card_dirty, the first hashes'
  buffers and send::take, numbered under QUEUE_ORDER). It also puts the
  placed copies' bytes into their references.
- It then publishes the submission under the submission lock: its fence
  value, and its flight (with no compare plan yet), bottom-of-pipe writes
  and declared ranges in the line. The rest goes to the sender's queue.
- The sender records and sends what was taken (card_record) and gives
  the flight its compare plan before the lists go to the queue. Then it
  waits for the heaps' records, makes the slots that waited for
  textures, sends the lists and signals the fence value.
- Every other submission (waited for, the present's copy, ours) first
  waits under the submission lock until everything published has been
  sent (wait_sent).
- The line's thread no longer resets landed lists after each send.
  late_helper already does that after every landing.

Invariants for a published submission N, i.e. one prepared and not yet
sent:
- Before N is published, all of its CPU work is done:
  - title memory its steps wrote;
  - its declared and picked shader writes, with their snapshots;
  - its bytes for copies in the card's memory, taken. The next
    submission's refreshes of those CPU sides do not reach N, which
    send::own already relies on;
  - its placed copies' references.
- What N+1's preparing may assume about N before N is sent: N is in the
  air.
  - Everything that asks what flights write sees N: the line's declared
    ranges, the copies done on the card, bottom-of-pipe writes for value
    waits, writes_pending. So N+1 waits for N to land wherever it would
    have waited for a sent N, or lets the card do the read behind it.
  - Such a wait ends. The relay lands N once the card reaches N's
    fence, which it cannot do before N is sent, and the sender needs
    nothing the waiting thread holds.
- What N has not done yet: nothing of it is on the queue, its compare plan
  does not exist (only the landing reads it, after the card has run N),
  and the slots waiting for its textures are not made.
- Order on the queue: only the sender sends published submissions, in
  publishing order. Everything else that goes to the queue waits for
  wait_sent under the submission lock and gets a higher fence value. The
  relay's fetches go to the copy queue and take their order from their
  plans' numbers, never from the drawing queue.
- Locks: the sender never takes the submission lock and never waits for
  the line's thread. It waits only for landings of flights it has sent
  (the compare area's reset) and for the heaps' records thread. A holder
  of the submission lock may therefore wait for published flights to
  land: a title thread at a blocking fence wait, a waited-for
  submission, or the line's thread.
- If N's send fails or is dropped: it is never dropped. The sender is the
  only consumer of its queue and does every item. A failed
  ExecuteCommandLists or Signal, a lost card or a panic on the sender
  fails the host (crate::host::fail), as on the single thread before.

Measured on 7cae3c5 (before the card windows in BAR and FSR4 LAND_NOT)
(Series S, prologue cell, i9-12900K + RTX 4090, play.ps1's 4090
settings). All comparisons are in-run arms: VICTORY_AB=15 switches the
split every 15 s, and these are the medians of the settled phases'
median frame times. A null A/B with identical arms (split-pl-1) differed
by ~1 ms. Launches of the same exe differed by up to 5 ms today, so no
conclusion here rests on comparing launches.

| exe, launches | phases off / on | frame, off -> on | that thread worked | title waited at presents | card idle |
|---|---|---|---|---|---|
| split-a1 (ab-1, ab-2) | 6 / 7 | 54.5 (52.8-56.7) -> 51.8 (49.9-53.2) | 52.5 -> 49.8 | 20.7 -> 16.4 | 24.3 -> 21.6 |
| split-a2 (warm-a2, ab2-1) | 5 / 7 | 52.2 (51.4-55.5) -> 50.0 (48.6-53.4) | 50.8 -> 47.9 | 19.3 -> 15.4 | 19.1 -> 15.4 |
| all four launches (frame lines) | | 53.1 -> 50.5 | 51.9 -> 48.9 | 19.9 -> 16.0 | 22.4 -> 18.9 |

a2 is a1 plus the landed lists left to late_helper; that changed nothing
measurable. The sender worked 8.1 ms a frame. Of the ~7 ms it took over,
the line's thread lost only ~3. Its remaining parts grew because more
flights are in the air while the card gets busier: title bytes under
flights' writes 6.0 -> 7.1, planning steps done on the card +1.3, and
card_dirty 3.0 -> 5.1 in timeline split-on-tl. The present thread still
waits ~16 ms a frame for the line's thread, which is still the wall.
The process's CPU rose 474 -> 484 ms a frame.

Checks:
- cargo clippy --workspace --all-targets --locked -- -D warnings, with and
  without --all-features;
- cargo test --workspace --locked: all pass. victory-loader's
  console_insn::a_clzero_loop_becomes_plain_stores failed in one run and
  passed on the rerun; this commit does not touch that crate;
- cargo xtask policy.
No new unit test: the switch is read once per process, and the crate's own
tests run without the relay, which the split needs. The line's ordering
tests (queue/behind.rs) are unchanged and pass.

Gate (ssfps-gate.ps1, exe on 74d2497 with this; VICTORY_WINDOWS_BAR_MB
and LAND_NOT on as vt-go sets them; frames 1300-3600, ms a frame):
| launch | frame | submitting thread | title waited at presents | card busy |
|---|---|---|---|---|
| cold (fresh cache) | 46.0 | 41.9 | 19.0 | 19.9 |
| warm1 | 43.8 | 40.7 | 15.4 | 18.6 |
| warm2 | 43.3 | 40.0 | 14.4 | 22.7 |
| warm3 | 44.4 | 41.1 | 15.6 | 20.7 |
| 15-min session | 43.5 | 40.9 | 15.5 | 18.8 |
- The session's minute medians are 40.5-43.7 ms with no drift; private
  memory stays flat at 24.6-25.7 GB.
- No device loss. Head intact.
- Banding is clean (25-47 colours/1000 px on the wall).
- The left-wall silhouette appeared in warm1 only: 1 of the gate's 5
  launches, and 1 of all 13 launches of this work (split on, off or
  switching), the known ~10% rate.
These frame times are not a before/after: other agents' launches were
waiting in the run queue meanwhile. The effect is the in-run table above.

(cherry picked from commit d5bd9d82cf3a470597a541bae60285f486073d00 of
https://github.com/Biskwit/VIctory-reloaded, GPL-3.0-or-later)

Ported to trustno1-coder/VIctory-NVIDIA by yeedgrthfgv:
- Off by default here: on only with VICTORY_SUBMIT_SPLIT=1 (read once
  through asked_for!, so VICTORY_AB can still switch it in diagnostics
  builds), and still only with VICTORY_RELAY=2, VICTORY_RELAY_COPY=1 and
  send::own. With it unset nothing is published, wait_sent returns on an
  atomic before taking any lock, and every submission takes the old path.
- Conflicts resolved against this tree: the streamline upscale/hudless tags
  stay where they were (after wait_sent); the two-queues plan counts a
  submission whose card bytes were taken for the sender as carded; the
  published path uses texback::Back::range for its texture read-backs,
  gives its Batch back for reuse, and the sender keeps the heap_marks
  timing, span_lists(fence) and timeline::sent's compute flag; the
  AFTER_SEND count stays.
- The timeline's calibration submission (host/stamps.rs, diagnostics)
  also waits for published submissions first, so its fence value cannot
  pass a published one.
- Dropped the cherry-picked late texture read-back test, which this tree
  does not have.
Also carried, off by default, in Keel62155/VIctoryUnified.

Co-authored-by: yeedgrthfgv <220001521+yeedgrthfgv@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-in)

Cause: the line's thread, the wall of a frame, was busy 37 of 39 ms
(timeline split-now-tl-3, reloaded 240b6c5b). Two parts of that need
nothing the next submission's preparing waits for:
- the descriptor slots that steps done on the card fill: 1.9 ms on the
  line, about 11,000 slots a frame, 7 ms on all threads;
- closing 127 new host lists a frame, each empty, when they are taken for
  a title's list: 1.1 ms.
The sender was idle 30 ms a frame.

Change (VICTORY_OFF_LINE, on by default with VICTORY_SUBMIT_SPLIT;
=0: as before; VICTORY_AB can switch it while the title runs):
- The slots of a published submission's card steps are kept (Slots) and
  written by the sender. It writes them after that submission's heaps'
  records and before its lists go to the queue, on the records' threads,
  which it has just waited for.
  - On the line's own pool (split-o1), they made its title bytes under
    flights' writes 1.4 ms longer: -0.8 ms in all (split-now-off-1..3).
  - Synchronous submissions write theirs on the line, as before.
- A host list is closed when it is reset after running (recycle, mostly on
  victory-late-wait), and kept idle as closed.
  - detach takes it closed; one taken open is closed there as before.
  - The cuts, which record into a fresh list, reset a closed one again.
- Invariants are written at off_line():
  - Nothing of the preparing reads host heap slots.
  - Slots are written in publishing order. A synchronous submission
    writes its own only after wait_sent.
  - The title rewrites such a slot only after the submission's fence.

Why "after the records" matches the console: a card step that fills a
slot stands for the title's GPU write into its descriptor heap, done when
the submission runs. The records the title copied for it were written by
its CPU before it submitted. So on the console the fill always lands after
them. Before, the line wrote the slot ahead of the records' round, so a
record of that slot made before the submission could have overwritten
the fill. Now the sender writes it after the round.

Counted (VICTORY_SLOT_ORDER_COUNT=1, diagnostics only, split-now-cnt-1,
exe split-o3), per frame:
- 4,100-5,200 slots written by the sender;
- 0.00 whose title record changed between the steps and the writing,
  0.00 by a draw's table;
- 0.0 whose record changed at any time in the run;
- for control, 12,800-15,200 title records changed in all slots.
In this cell no slot a card step fills is ever written by the title's
CPU, so the order change alters nothing here. It matters only for a
title that does both.

Measured (Series S, prologue cell, i9-12900K + RTX 4090; exe split-o2 =
this on 92c848ab, VICTORY_PLACE_CORE=0, which matches reloaded's
placement). In-run A/B over 3 launches, split-now-off2-1..3. Each
launch's first settled phase is left out; settled means over 150 frames,
more than 3,000 draws, and p90 under 1.25x the median. Launch 1 also had
the count on. Medians, ms a frame:

| | off | on |
|---|---|---|
| frame | 39.7 (39.0-39.9, 8 phases) | 38.0 (37.2-39.3, 7 phases) |
| launch 1 / 2 / 3 | 39.9 / 39.6 / 39.2 | 39.2 / 37.9 / 37.55 |
| title waited at presents | 14.5 | 11.8 |
| card idle | 17.8 | 17.0 |
| line: steps given to the card | 4.5 | 3.0 |
| line: title bytes under flights' writes | 6.8 | 7.7 |
| sender worked | 9.7 | 14.4 |

Without launch 1's count: 39.4 vs 37.8. Identical in-run arms differ by
about 1 ms.

Picture, per arm (guards_cellab, phase_pics, phase_diff; 3 launches):

| | off | on |
|---|---|---|
| left wall | 45.4 / 45.3 / 45.2 | 45.9 / 45.4 / 45.2 |
| strip/wall | 1.01 | 1.01-1.02 |
| purple box RGB, launch 2 | 25.1 17.4 17.6 | 25.2 17.4 17.6 |
| banding, flat pairs % | 7.2 / 7.5 / 7.3 | 7.7 / 7.6 / 7.4 |
| colours per 1000 px | 37 / 30 / 30 | 30 / 36 / 31 |
| consecutive frames' difference | 6.23 within an arm (27 pairs) | 6.02 across arms (12 pairs) |

No flicker and no wrong texture on the contact sheets of every frame
from 1500 on, labelled by arm. The silhouette flags at 1500-1600 are the
cutscene and title card before the cell. No device lost, panic, or list
that failed to close or reset.

Checks: clippy --workspace --all-targets --locked, with and without
--all-features, -D warnings: clean; cargo test --workspace --locked: all
pass; cargo xtask policy: ok. Run on 73ec8de5 and again after the rebase
onto 2e905468.

Gate: split-gate3 (split-g4.exe, built on 73ec8de5; the rebase onto
2e905468 was mechanical).
- Cold and three warm launches: 39.8, 39.7, 40.0 and 38.0 ms a frame
  (windows' ranges 37.3-109.9).
- 11-minute session: 37.8-39.2 ms a minute from minute 2, and 24.2-25.0 GB
  private, flat.
- No device lost or panic. 259-270 draws dropped a frame, the ray-tracing
  builder's, as on the base.
- Silhouette, by sil's recount of cell frames: warm2 is SIL (19 of 20
  frames); cold, warm1, warm3 and long are clean.
  - That is the known whole-run left-wall state. guards-gated-warm2 and
    card-gateA-warm3 had it without this change; 10 of today's 167
    launches without sil's fix had it.
  - None of the six A/B launches of this change, either arm, had it.

(cherry picked from commit 821867c401905955f6c5c13a0ced30c65432add3,
"perf(host): the card steps' slots and list closes off the line", of
https://github.com/Biskwit/VIctory-reloaded, GPL-3.0-or-later; only its
card-step slots half)

Ported to trustno1-coder/VIctory-NVIDIA by yeedgrthfgv:
- Off by default here: on only with VICTORY_OFF_LINE=1 together with
  VICTORY_SUBMIT_SPLIT=1 (asked_for!, VICTORY_AB can still switch it in
  diagnostics builds). With it unset card_steps writes the slots on the
  line's thread with the same code as before (kept verbatim in the else
  branch, no Slots built).
- Left out: the host list closes moved to recycle (list.rs). This tree
  already leaves new host lists open for the title's next reset
  (HostList::leave_open, a7b8667), which removed that cost another way.
- Left out: the VICTORY_SLOT_ORDER_COUNT diagnostics (descriptor.rs,
  descriptor/host.rs), a one-off measurement that hooked every slot made.
Also carried, off by default, in Keel62155/VIctoryUnified.

Co-authored-by: yeedgrthfgv <220001521+yeedgrthfgv@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cxy0072019-sketch

Copy link
Copy Markdown

Validated locally on an i5-14600KF and RTX 5070 Ti 16 GB, driver 621.24, Windows 11. I cherry-picked both commits from 2d72aeb onto my local #1069 / #932 / #1018 compatibility test branch. Series S, 1080p output, DLSS and frame generation off.

I held the camera at the same nighttime parking checkpoint and used VICTORY_AB=10,VICTORY_SUBMIT_SPLIT with VICTORY_OFF_LINE=1, relay 2 and relay copy on. The sender startup and activity appeared in the log, and the phase diagnostics discard their first second. I excluded the early settling interval and retained nine adjacent pairs with zero pending pipelines and roughly 3,200 draws per frame.

Both options Frames Mean period Rendered FPS
Off 1,447 56.18 ms 17.80
On 1,533 52.93 ms 18.89

Every retained pair improved by 2.3–4.1 ms. Comparing each enabled phase to the mean of the disabled phases either side gave a 3.1 ms reduction. Side-by-side frames showed the same character, truck, pavement, foliage and lights. This test covers this static camera and leaves the moving route and other scenes open.

@yeedgrthfgv

Copy link
Copy Markdown
Contributor Author

Thanks for testing it. Good to see the same direction on a different CPU: about 3 ms a frame here on the 14600KF, and about 2.5 ms of preparing on the 9600X. The side by side frames also answer the picture question I left open. A moving route is still worth a run if someone has one.

@yeedgrthfgv yeedgrthfgv changed the title Opt-in: prepare the next submission while the last one is sent (VICTORY_SUBMIT_SPLIT, VICTORY_OFF_LINE) (FPS INCREASE) Opt-in: prepare the next submission while the last one is sent (VICTORY_SUBMIT_SPLIT, VICTORY_OFF_LINE) Nov 28, 2026
@POMXARK

POMXARK commented Nov 28, 2026

Copy link
Copy Markdown

Tested this PR in a 20-minute 1440p DLSS Quality + MFG 4x A/B run on Ryzen 7 5700X (8C/16T) + RTX 5080 (16 GB) + 32 GB RAM with VICTORY_SUBMIT_SPLIT=1 and VICTORY_OFF_LINE=1 (on top of VICTORY_WAIT_RESIDENT=0, VICTORY_RELAY=2, VICTORY_CARD_STEPS=2, VICTORY_THIN=1, VICTORY_JOIN_COPIES=1, VICTORY_JOIN_PARTS=8, VICTORY_LAND_SKIP=1).

Unit tests & Stability

  • cargo test -p victory-gpu host::: 123/123 PASS (2.90 s).
  • 20-minute continuous 3D workload: 0 errors, 0 DeviceRemoved/DEVICE_HUNG, 0 guest exceptions, 0 bake stalls, visually clean output throughout.
  • victory-send ran cleanly (16.0 sent/frame, worked = 9.6 ms p50 / 12.8 ms p90, land_wait = 0.0 ms, others_waited = 0.2 ms).

Draw-Count-Matched 3D Comparison (Baseline vs PR #1066)

Metric Baseline PR #1066 (SUBMIT_SPLIT=1, OFF_LINE=1) Delta
1k–4k draws/frame FPS (p50 / mean) 17.50 / 17.32 15.85 / 16.07 -9.4% / -7.2%
4k–7k draws/frame FPS (p50 / mean) 13.40 / 13.75 12.90 / 13.29 -3.7% / -3.3%
7k–10k draws/frame FPS (p50 / mean) 11.05 / 11.06 10.60 / 11.72 -4.1% / +6.0%
>=10k draws/frame FPS (p50 / mean) 8.00 / 8.34 6.20 / 6.20 -22.5% / -25.7%
ALL 3D FPS (p50 / mean) 13.9 / 13.91 13.9 / 13.52 0.0% / -2.8%
1s frame_times (med / p95 / p99) 65.4 / 85.9 / 97.7 ms 65.7 / 88.8 / 103.7 ms +0.3 / +2.9 / +6.0 ms
Frames >100 ms / >=250 ms / >=500 ms 1,354 / 0 / 0 1,672 / 2 / 1 (max 788.3 ms) +23.5% >100 ms
Peak Commit / loose_mb 30,550 MB / 4,228 MB 31,312 MB / 5,336 MB +762 MB / +1,108 MB

Submitting Thread Breakdown (p50, n>1000 3D seconds)

While after (0.70 -> 0.20 ms), plan (4.20 -> 3.30 ms), and under (4.40 -> 3.80 ms) dropped as expected, total submitting-thread wall time rose from 62.0 ms -> 72.8 ms (p90: 92.6 -> 108.6 ms) on this 8C/16T CPU:

  • refreshes: 22.60 -> 25.15 ms (steps: 31.10 -> 34.75 ms)
  • card copies: 8.40 -> 10.00 ms
  • heaps_end: 0.60 -> 2.60 ms
  • write_watch: 5.95 -> 7.10 ms (p90: 10.1 -> 16.0 ms)
  • wait_flights: 0.10 -> 1.10 ms (p90: 3.0 -> 7.5 ms)
  • send: 1.80 -> 2.40 ms
  • Present-side GPU wait also rose (0.0 -> 1.4–8.5 ms across buckets) and card_busy dipped 58% -> 55%.

Takeaway: Functionally solid and stable across 20 minutes, but on an 8C/16T CPU where send is already small (1.8 ms) and wait_flights is ~0.1 ms (VICTORY_WAIT_RESIDENT=0), adding the extra victory-send thread + VICTORY_OFF_LINE=1 increases CPU contention and heaps_end/wait_flights waits enough to regress frame time and pacing. Keeping it opt-in makes sense so high-core-count / higher-send-overhead setups can still enable it.

@yeedgrthfgv

Copy link
Copy Markdown
Contributor Author

Thanks, this is the kind of run I could not do here: 20 minutes moving through dense scenes. The extra stalls fit what I saw: one of my two split runs had three short stalls in the settled part (one 5 s line at 13.9 fps) that the off runs did not have, which I put in the description as unclear. With your numbers it looks like the split itself, at least in heavy scenes, and the cost grows with the draw count (your >=10k bucket).

So the gain seems to hold in lighter, static scenes (cxy0072019-sketch's checkpoint, my prison scene) and turn into a loss with more draws and movement on 8 cores. I agree it should stay opt-in. I will run a moving route here too and look at heaps_end and wait_flights with it on, since those two grew the most in your breakdown.

@yeedgrthfgv yeedgrthfgv changed the title (FPS INCREASE) Opt-in: prepare the next submission while the last one is sent (VICTORY_SUBMIT_SPLIT, VICTORY_OFF_LINE) (Opt-in, +1 fps in light scenes) Prepare the next submission while the last one is sent (VICTORY_SUBMIT_SPLIT, VICTORY_OFF_LINE) Nov 28, 2026
@tippythetaidum

Copy link
Copy Markdown

Test report from an RTX 5080 + Ryzen 7 9800X3D (8 cores, one CCD), 32 GB, Windows 11 26200. Both commits are cherry-picked onto 63b902f with #1014, #1133, #1134 and #393. Series X, DLSS Quality 2560x1440, frame generation off, relay 2 and relay copy on (play-foxhound.ps1), warm cache. The scene is indoors (Jason's house), with the same save restored before every run. Runs were alternated off / on / off / on, 150 s each.

SUBMIT_SPLIT + OFF_LINE off on
lane thread "worked" per frame (queue::behind line) 33.3 to 35.5 ms 27.7 to 31.4 ms
sender thread (victory-send) — 3.8 ms a frame, 0.0 waiting for landings
title's threads waiting at presents 10.8 to 16.8 ms 10.2 to 14.7 ms
fps (median frame) 20.9, 21.7 20.8, 19.8

The work leaves the lane thread as described (about -4 to -6 ms a frame). No errors were logged and no visual difference was seen. Here the frame rate didn't follow. The title still waits about as long at its presents, and the card's clock line puts the card at about 50 % busy, idle about 12 ms behind the submitting thread and about 10 ms while the title had not submitted. The scenes differed between runs (5,000 to 6,600 draws), so a difference of 1 fps either way is within the noise.

I also tried VICTORY_SUBMIT_FRAMES=2 with both switches on. The present waits went to 0.0 ms, but the lane thread's work went up to 41 to 44 ms a frame (settles for "lists in the air", 4 to 14 ms), and the median frame stayed at 46 ms. So two frames in the line don't help there.

@wildheathen

Copy link
Copy Markdown
Contributor

Reviewed and built this on top of 63b902f (RTX 5080, Windows), together with #697, #127 and foxhound's CARD_STEPS_JOIN. No deadlock found reading it; the order before ExecuteCommandLists is kept per submission. Three things, from reading the code:

  1. Split without a copy queue. split_send() only checks VICTORY_RELAY_COPY. If the copy queue is not made (the "no copy queue" warning in make_relay_fetch), the fetch goes on the direct queue and counts flights that are published but not yet sent as already queued (line().target, QUEUE_ORDER). Suggest: no split unless the fetch really has its copy queue.
  2. relay_wait in send_published compares with SENT_FENCE, which only send_published moves. Flights sent under the lock without publishing (execute_own at a present, or submissions before the split is switched on) are skipped, their CardPlan stays taken and the compares fall back to whole fetches for a submission or two. f.fence < h.fence covers every earlier flight, since all of them have been sent by then. Costs speed only, no wrong bytes.
  3. Counters (diagnostics only). The sender adds its parts into the line's SPLIT, so "preparing per frame, the submitting thread" mixes both threads; and relay_wait on the sender toggles the global WORKING and the late stats meant for the lock holder. Biskwit fixed the first in 48f9982; bc43515 also saves the line waiting on CARD_WORK.

Numbers, same scene as @tippythetaidum (Jason's house, RTX 5080, Series X 1440p, frame generation off), but switched inside one run so the scene is the same for both arms: VICTORY_AB=10,VICTORY_SUBMIT_SPLIT,VICTORY_ASK_FIRST, 8 minutes, phases kept from minute 3 on at 7,000–7,600 draws a frame (these runs include the fixes above, OFF_LINE not set).

SUBMIT_SPLIT phases median frame, mean of phases range of phases
off 7 36.6 ms 35.2–40.3
on 6 36.6 ms 36.0–36.9

So no difference at the frame here, which matches tippythetaidum's runs: the card stays about 50–60 % busy and idle 12–15 ms a frame behind the submitting thread, and in this scene the preparing that stays on that thread (refreshes alone about 10.5 ms a frame) is what the frame waits for, not the sending. On the loading screen before it (a steady ~5,800 draws a frame) the split was about 1.5 ms a frame faster (37.9 vs 36.3, 5 phases each), in line with the static scenes above.

yeedgrthfgv and others added 5 commits November 28, 2026 17:29
Review of trustno1-coder#1066 (wildheathen), point 1.

Cause: split_send() asked only for VICTORY_RELAY_COPY=1, not whether the
copy queue was made. If the card gives none ("no copy queue" in
make_relay_fetch), the relay's fetches go to the drawing queue, and a
fetch there takes every flight in the line as given to the queue already
(line().target, QUEUE_ORDER). A published submission is in the line
before the sender has sent it, so such a fetch could count it as ahead
of itself while its lists went to the queue behind the fetch.

Change: the copy queue and its list are made once by the host
(Host::relay_copying, a OnceLock), and split_send() is true only if they
are there. With the switch on they are made when the first submission
asks, before anything is published, so the answer never changes while
submissions are published. The thread that lands flights takes the same
queue and list for its fetch.

Unset: split_send() stops at the switch as before and never asks for the
queue; the thread that lands flights makes it at its first fetch, the
same objects at the same moment, with the same warning if it cannot.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Review of trustno1-coder#1066 (wildheathen), point 2.

Cause: when the compare's result area is half taken, send_published
waits for the flights sent so far to land, so that no plan is out and
the results start from the beginning. It knew "sent so far" from
SENT_FENCE, which only send_published moved. A flight sent under the
submission lock without being published (execute_own at a present, a
submission from before the split was switched on) has a higher fence
value than the last published one and was left out. Its plan stayed
out, the area did not start again (card_done: only with none out), and
the next plans' ranges went uncompared, fetched whole, until that flight
landed by itself. Speed only, no wrong bytes.

Change: it waits for every flight with a lower fence value than its own
(f.fence < h.fence), as the review proposed. Checked against the code:
each of those is on the queue by then, so the wait ends.
- Fence values are given under the submission lock, rising.
- Published ones are sent by this thread alone, in the order they were
  published, which is the order of their values.
- One not published is sent inside submit, under the lock, after
  wait_sent, and joins the line only after that; the lock is let go
  before a later one can be published.
Flights published behind this one (higher values) have no plan yet and
are not waited for, as before. SENT_FENCE has no reader left and goes.

Unset: nothing is published and send_published never runs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Cause: the "preparing per frame, the submitting thread" line sums SPLIT,
one static, and the thread that sends published submissions
(send_published, VICTORY_SUBMIT_SPLIT, on by default) added three of its
own parts to it:
- "for copies in the card's memory": the lane's card_take and the
  sender's card_record together;
- "at the end ... waiting for the heaps' records": the sender's wait
  (drop of the submission's records round, make_waiting, the slots the
  card steps fill) and the lane's, which is about 0.04 ms a frame since
  the lane publishes before it; the 9.7-10.8 ms a frame there with
  masked words were the sender's;
- "sending the lists": the sender's ExecuteCommandLists.
Timeline land-rec-tl1 (main 64a9f28d): the sender waits 5.1-6.1 ms a
frame for the heaps' records and is idle 20.5-23.7; the lane's waits
ended by heap-sync, the records' threads or the sender are 0.3-0.7 ms a
frame. The wait is not the lane's, and not the wall.

Change: the sender counts into SEND_SPLIT, printed on a line of its own
("the sending thread's part of the preparing per frame"), worded so
that none of the tools' patterns for the lane's fields match it. The
lane's line keeps its fields, now the lane's alone. Diagnostics builds
only; nothing else changes.

Not mixed: the frame line's "preparing" (SUBMISSION_US[0], added by the
lane when it publishes) and queue::behind's "that thread worked" (the
lane's jobs) were the lane's alone, so the README's "preparing" column
is too; the sender's own work is on its line ("it worked ... ms").

Checks: cargo clippy --workspace --all-targets --locked -- -D warnings,
with and without --all-features; cargo test --workspace --locked; cargo
xtask policy.

(cherry picked from commit 48f9982d823afcd4d2a3c4973ae163c25c7365f3,
Biskwit/VIctory-reloaded, GPL-3.0-or-later)

Review of trustno1-coder#1066 (wildheathen), point 3, first half. Fitted to this tree:
here SPLIT and the "preparing per frame, the submitting thread" line are
in every build (submit_split_line), not in diagnostics builds only, so
SEND_SPLIT and the sender's line are in every build too and the line is
printed from submit_split_line. VICTORY_SUBMIT_SPLIT is opt-in here, not
on by default as the message above says of the tree it came from. Unset:
nothing is published, SEND_SPLIT stays zero and its line is not printed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Cause: card_take locked CARD_WORK only to see whether the work of copies
in the card's memory exists. The thread that sends holds that lock while
it records a submission's sends and compare (card_record), and the
submitting thread stood behind it: 0.36 ms a frame (profile
land-rec-prof1, main 64a9f28d: 119 samples at that line).

Change: it asks Host::card_ready, a OnceLock read once the work has
been made. Equivalent: CARD_WORK is set once, by card_ready, and never
emptied; a copy goes to the card's memory only if card_ready said yes,
so card_take is never reached with no work to find.

Measured (in-run A/B as VICTORY_TAKE_UNLOCKED, land-rec1-ab1 and -ab2,
21 phases each, ms a frame, off -> on): frame 36.4 -> 36.5 and 36.1 ->
35.8 (blocks); the lane's copies in the card's memory 3.2 -> 2.9 and
3.2 -> 3.0. Inside the noise on the frame: a lock taken only to see
whether something exists, left out.

Checks: cargo clippy --workspace --all-targets --locked -- -D warnings,
with and without --all-features; cargo test --workspace --locked; cargo
xtask policy (with the next commits, before the gate).

(cherry picked from commit bc4351506d074abc19bde0fed4058af79640cffb,
Biskwit/VIctory-reloaded, GPL-3.0-or-later)

Review of trustno1-coder#1066 (wildheathen), point 3: named there as also saving the
line's wait on CARD_WORK. Applied without conflict. card_take is also on
the path of a run without VICTORY_SUBMIT_SPLIT (card_before), so the
equivalence above was checked in this tree: card_take gets past its
"nothing to do" return only with a copy in the card's memory (declared
ranges are filtered by carded(), card_dirty and the picked views hold
carded copies only), a copy gets a card side only after card_ready()
said yes, and CARD_WORK is set there once and never emptied. So the
answer is the same in every state that is reached; only the lock is not
taken. The numbers above are Biskwit's, not measured here.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…unts

Review of trustno1-coder#1066 (wildheathen), point 3, second half. Biskwit's tree has
no change for this one yet, so it is new here.

Cause: send_published waited with relay_wait, which is written for the
thread that holds the submission lock. On the sender, which does not
hold it, each wait:
- switched the global WORKING off and back to what it had read, while
  the lock holder was working or standing on its own thread, so the
  card's clock ("idle behind the submitting thread") could count the
  wrong stretch;
- added its time to the lock holder's wait for the card (stood,
  SUBMISSION_US[1], LATE_STATS[12], LATE_WAITED) and counted a settle
  for "lists in the air" (LATE_STATS);
- in diagnostics builds took what the lock holder had last named as the
  memory it waits for (blamed), so that wait lost its name.
Counts and log lines only; no order or bytes depend on them.

Change: the sender waits with sender_wait: the same wait on the same
condition, with the timeline's span, and none of those counts. Its time
is still on the sender's own line (SEND_STATS[2], "of them waiting for
landings").

Unset: nothing is published, send_published never runs, relay_wait is
untouched.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
kadiratesdev added a commit to kadiratesdev/VIctory-NVIDIA that referenced this pull request Nov 28, 2026
@yeedgrthfgv

Copy link
Copy Markdown
Contributor Author

Thanks for the careful read, @wildheathen. All three points were right. Fixes are on the branch as new commits on top of 2d72aeb:

  1. Split without a copy queue (bda893c). The copy queue and its list are now made once by the host, and split_send() is only true if they are really there. With the switch on they are made before the first submission is published, so the answer cannot change later. If the card gives no copy queue, the old warning is logged and nothing is ever published.

  2. relay_wait and SENT_FENCE (5b24308). Changed to f.fence < h.fence as you suggested, and SENT_FENCE is gone. I checked the reasoning in the code first: fence values are given under the submission lock in rising order, the sender sends published ones in that order, and a submission that is not published is put on the queue inside submit, under the lock, before a later one can be published. So every flight with a lower value has been sent and the wait ends.

  3. Counters.
    a. a622068 is Biskwit's 48f9982 (cherry picked, Biskwit kept as author): the sender counts into SEND_SPLIT and gets a line of its own. One difference from his tree: here SPLIT and the "preparing per frame, the submitting thread" line are in every build, so the new line is in every build too.
    b. 540ee25 is Biskwit's bc43515 (cherry picked, applied clean): card_take asks card_ready instead of locking CARD_WORK. card_take is also on the path with the switch unset, so I checked that the answer is the same there: it only gets that far with a copy in the card's memory, and a copy only gets there after card_ready said yes. The 0.36 ms number is his, I did not measure it here.
    c. 1b611e5 is new, since Biskwit's tree still has this one: the sender now waits with a small wait of its own (sender_wait) that does not touch WORKING, the late stats, the frame line's card wait or blamed. Its waiting time is still shown on the sender's line.

Not done: no new measurements yet for these commits, and nothing else from Biskwit's later history was pulled in (the sender presenting, the kept card step plans). With both switches unset nothing is published, so the old path is unchanged apart from card_take not taking the CARD_WORK lock (b).

Checked: release build, diagnostics build, victory-gpu lib tests (453 passed), cargo xtask policy, and clippy shows only the findings main already has (shadow.rs, descriptor.rs).

One more data point, from a local test build that stacks this branch with #1014, #875, #1133, #1123, #1093 and #18 on top of 9ce3cf9 (Ryzen 5 9600X, RTX 5080, Series X 4K output, DLSS Performance, prison scene, window off screen and the world clock held at 12:00 with #1009 and #1155, one run each, 90 to 150 s after the world starts): 25.1 fps with every new switch off, 25.0 with #1014 + #875 + #18's pipelines from pieces, 25.5 with those plus SUBMIT_SPLIT + OFF_LINE. No crash or device loss in any run, and the review fixes above were in all of them. The read waits went from about 2.0 to 1.6 ms a frame, but on this 6 core CPU the frame is still set by the submitting thread's own preparing (about 30 ms), so the split stays a small gain here.

@trustno1-coder

Copy link
Copy Markdown
Owner

Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.

@bigboss22869

Copy link
Copy Markdown

A data point on another PC: RTX 5070 Ti 16 GB, Ryzen 7 7800X3D, 64 GB, Windows 11. Ported both commits onto trustno1 main of 2026-11-28 (one conflict in card_steps.rs with a local diagnostic). Series X profile, 1440p output, DLSS Performance (1280x720 scene), no frame generation. Same save at a pier, camera still, 4 minutes each, one release build, only the switches changing:

Run Median frame p90 of the 5 s means Sender worked
off 48.0 ms 51.0 ms –
VICTORY_SUBMIT_SPLIT=1 46.6 ms 48.0 ms 5.9 ms a frame
SUBMIT_SPLIT=1 + VICTORY_OFF_LINE=1 46.5 ms 47.7 ms 10.7 ms a frame

No new warnings, no device loss, and nothing new seen in a play session afterwards. Single runs here vary by about ±2 ms between series, so read this as "a small gain, not a loss". It is on by default in our fork (https://github.com/bigboss22869/VIctory-RTX5070Ti, branch rtx5070ti).

Two more things measured the same day, in case they help others on CPU-bound setups:

AI-assisted (Claude Code); runs and observations by me; no game data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants