Submitting thread: why each part was not joined, per frame and per A/B phase #2008

Closed
github-bot wants to merge 3 commits from github-bot/gh-2008 into main AGit
Owner

@⁠binarycleric on GitHub · 2026-11-29 07:07 UTC · original
up/join-why → main · +257 −27 · 3 files · 3 commits · closed without merging

What it changes

Why

With VICTORY_ASYNC_SUBMIT, our submitting thread joins a queue's next submissions to the one it is preparing
(VICTORY_JOIN_PARTS / VICTORY_JOIN_LISTS) so fewer separate host submissions are made. In the game world about 28
submissions a frame reach it and only about 13 are joined. Nothing said why the other ~15 were not, so there was no way
to tell which rule, if any, is worth loosening.

What

  • Every submission, or group of parts prepared as one, ends with exactly one reason: nothing of its queue behind it
    yet, lists still being translated, a memory value not met, a fence not reached, a present, the parts' cap, the lists'
    cap, title memory written on the CPU for the next part, a CPU read of what the parts before write, or off.
    joinable says which of its two rules refused (Unjoinable); Work::take_along returns the reason with what it
    refused. Nothing is joined or refused differently.
  • The submitting thread's 5-second line gets a second line: submissions prepared separately per frame, and the split.
    The counts add up to the submissions prepared separately.
  • Diagnostics builds: with VICTORY_AB, each phase ends with a line of the submitting thread's own (working ms,
    submissions, prepared separately, joined, title waits at presents, the split), first second left out like the
    phase's frame times, so both sides of a joining switch are compared under the same load in one run.
  • Diagnostics builds: VICTORY_JOIN_WIDE, named in VICTORY_AB, raises the caps to 32 parts / 1024 lists in its phases.
    Nothing changes without VICTORY_AB.

Numbers

Game-world 5-second lines (20+ submissions a frame, about one present) from two release play runs of the same code on
our integration branch, means per frame:

run 1 (89 lines) run 2 (63 lines)
submissions 28.0 28.4
joined to the one before 12.2 13.2
prepared separately 16.2 15.2
nothing of its queue behind it yet 5.26 4.26
a memory value not met 4.81 5.37
a read of what those before write 1.95 2.16
the lists' cap (48) 1.51 1.82
lists still being translated 1.29 0.29
a present 1.00 1.00
title memory written on the CPU 0.39 0.41
a fence not reached 0 0
the parts' cap (8) 0 0

Reading: raising VICTORY_JOIN_PARTS above 8 can't help (its cap never ends a group). The lists' cap ends 1.5-1.8 groups
a frame; VICTORY_JOIN_WIDE is there to measure raising it. The two biggest causes aren't rules: the title had not
submitted the next part yet, and memory-value waits that nothing known meets.

How it was tested

  • GPU and profile: RTX 5070 Ti 16 GB, Ryzen 9 7900X; Series X profile, 1440p native, DLSS off, frame generation off; ray-tracing passes left out (no structure builder)
  • Before: the frame line counted parts prepared alone, but not why they weren't joined
  • After: in play on our integration branch (26–28 fps), per frame: 16.1 parts prepared separately; the next part not joined for 4.8 nothing behind it yet, 0.3 lists still being translated, 4.5 a memory value not met, 1.0 a present, 2.9 the lists' cap, 2.5 a read of what those before write. No behaviour changes
  • cargo test passed for the crates it touches: yes. Rebased onto main e1f2eb60: cargo test --release -p victory-gpu --lib, 589 passed, 0 failed, 44 ignored

Tests

  • submissions_take_those_behind_them_along now also checks the reason that ended each group.
  • parts_taken_along_keep_the_order_and_the_fences_of_parts_done_alone is in the fence-ahead PR, which is stacked on this one.

Not tried in play

  • The VICTORY_AB per-phase line and VICTORY_JOIN_WIDE haven't been through an A/B run yet; one is pending.
  • A joined group that execute_parts splits again for card steps isn't counted as split.
  • "A memory value not met" isn't broken down further.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #1758 (sends joined parts ahead of the first that waits for flights; a behaviour change these counts would help measure). Nothing else adds these counts.
**@⁠binarycleric** on GitHub · 2026-11-29 07:07 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2008) `up/join-why` → `main` · +257 −27 · 3 files · 3 commits · closed without merging ## What it changes #### Why With VICTORY_ASYNC_SUBMIT, our submitting thread joins a queue's next submissions to the one it is preparing (VICTORY_JOIN_PARTS / VICTORY_JOIN_LISTS) so fewer separate host submissions are made. In the game world about 28 submissions a frame reach it and only about 13 are joined. Nothing said why the other ~15 were not, so there was no way to tell which rule, if any, is worth loosening. #### What - Every submission, or group of parts prepared as one, ends with exactly one reason: nothing of its queue behind it yet, lists still being translated, a memory value not met, a fence not reached, a present, the parts' cap, the lists' cap, title memory written on the CPU for the next part, a CPU read of what the parts before write, or off. `joinable` says which of its two rules refused (`Unjoinable`); `Work::take_along` returns the reason with what it refused. **Nothing is joined or refused differently.** - The submitting thread's 5-second line gets a second line: submissions prepared separately per frame, and the split. The counts add up to the submissions prepared separately. - Diagnostics builds: with VICTORY_AB, each phase ends with a line of the submitting thread's own (working ms, submissions, prepared separately, joined, title waits at presents, the split), first second left out like the phase's frame times, so both sides of a joining switch are compared under the same load in one run. - Diagnostics builds: VICTORY_JOIN_WIDE, named in VICTORY_AB, raises the caps to 32 parts / 1024 lists in its phases. Nothing changes without VICTORY_AB. #### Numbers Game-world 5-second lines (20+ submissions a frame, about one present) from two release play runs of the same code on our integration branch, means per frame: | | run 1 (89 lines) | run 2 (63 lines) | |---|---|---| | submissions | 28.0 | 28.4 | | joined to the one before | 12.2 | 13.2 | | prepared separately | 16.2 | 15.2 | | nothing of its queue behind it yet | 5.26 | 4.26 | | a memory value not met | 4.81 | 5.37 | | a read of what those before write | 1.95 | 2.16 | | the lists' cap (48) | 1.51 | 1.82 | | lists still being translated | 1.29 | 0.29 | | a present | 1.00 | 1.00 | | title memory written on the CPU | 0.39 | 0.41 | | a fence not reached | 0 | 0 | | the parts' cap (8) | 0 | 0 | Reading: raising VICTORY_JOIN_PARTS above 8 can't help (its cap never ends a group). The lists' cap ends 1.5-1.8 groups a frame; VICTORY_JOIN_WIDE is there to measure raising it. The two biggest causes aren't rules: the title had not submitted the next part yet, and memory-value waits that nothing known meets. ## How it was tested - GPU and profile: RTX 5070 Ti 16 GB, Ryzen 9 7900X; Series X profile, 1440p native, DLSS off, frame generation off; ray-tracing passes left out (no structure builder) - Before: the frame line counted parts prepared alone, but not why they weren't joined - After: in play on our integration branch (26–28 fps), per frame: 16.1 parts prepared separately; the next part not joined for 4.8 nothing behind it yet, 0.3 lists still being translated, 4.5 a memory value not met, 1.0 a present, 2.9 the lists' cap, 2.5 a read of what those before write. No behaviour changes - `cargo test` passed for the crates it touches: yes. Rebased onto main e1f2eb60: `cargo test --release -p victory-gpu --lib`, 589 passed, 0 failed, 44 ignored #### Tests - `submissions_take_those_behind_them_along` now also checks the reason that ended each group. - `parts_taken_along_keep_the_order_and_the_fences_of_parts_done_alone` is in the fence-ahead PR, which is stacked on this one. #### Not tried in play - The VICTORY_AB per-phase line and VICTORY_JOIN_WIDE haven't been through an A/B run yet; one is pending. - A joined group that `execute_parts` splits again for card steps isn't counted as split. - "A memory value not met" isn't broken down further. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #1758 (sends joined parts ahead of the first that waits for flights; a behaviour change these counts would help measure). Nothing else adds these counts.
Every submission, or group of parts prepared as one, now ends with one
reason: nothing of its queue behind it yet, lists still being translated,
a memory value not met, a fence not reached, a present, the parts' cap
(VICTORY_JOIN_PARTS), the lists' cap (VICTORY_JOIN_LISTS), title memory
written on the CPU for the next part, a CPU read of what the parts before
write, or off. The 5-second line of the submitting thread gets a second
line with the split per frame; the counts add up to the submissions
prepared separately.

`joinable` says which of its two rules refused (`Unjoinable`), and
`Work::take_along` gives the reason back with what it refused. Nothing is
joined or refused differently.
With VICTORY_AB turning switches on and off while the title runs, each
phase now ends with a line of the submitting thread's own: presents, and
per frame the thread's working time, submissions, those prepared
separately, those joined to the one before, the title's waits at presents,
and why parts were not joined. The phase's first second is left out, as
the phase's frame times leave it out. That gives both sides of a joining
switch under the same load in one run.
Named in VICTORY_AB, it raises the parts' cap to 32 (where joining is on)
and the lists' cap to 1024 in the phases it is on, so one run measures
what the caps cost, and what larger joins cost, under the same load. A
release build takes larger caps from VICTORY_JOIN_PARTS and
VICTORY_JOIN_LISTS as before; nothing changes without VICTORY_AB.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 07:10:42 +00:00
github-bot closed this pull request 2026-11-29 07:16:13 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2008
No description provided.