perf: VICTORY_MERGE_SUBMISSIONS sends consecutive title submissions as one host submission #337
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!337
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-337"
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?
@Skyfrye on GitHub · 2026-11-26 06:27 UTC · original
Skyfrye:nep/merge-submissions→main· +1180 −13 · 5 files · 2 commits · draftDraft: a small gain for a large change; for the maintainer to weigh.
Change
VICTORY_MERGE_SUBMISSIONS=1(off by default: unset runs today's code paths): consecutive title submissions in the late/relay path are held and sent to the card as one host submission, so the submitting thread's fixed work per submission (descriptor::sync_heaps,watch::ask_once,shadow::card_dirty,card_before, list close/reset, ExecuteCommandLists + Signal, the relay's bookkeeping) is paid once per group. Each later submission of a group starts with a full barrier, as the boundary between two submissions did. Avictory-mergethread sends a group 500 µs after its first submission.A group is sent at: a fence signal on any queue; a wait for a memory value that held work may write (a held bottom-of-pipe write that meets the wait lets the part behind it join instead); a present, a synchronous submission of ours, a settle, page mappings on a queue; a submission that reads what held or flying shaders write, copies over memory a held one reads, or runs our own code on title memory; 256 lists or 32 submissions held; the 500 µs timer.
=2also carries fence signals behind the group (sent when the fence is queried or waited on): not recommended, see below.A new frame line, "title submissions merged per frame", counts title submissions, host submissions and sends by reason.
Why: in a 30 s Nsight Systems profile of the world (main at
3e258c8), the frame was bound by the title's submitting thread (about 59 submissions a frame), most of its time in that fixed per-submission work.Known risk: a held submission is prepared when it is sent, not when the title gave it, so it can see title memory up to 500 µs newer.
Linked issue: none.
Verification
Windows 11 26300, Rust 1.98.1 (MSVC), on upstream
mainatc4c93bd, fromthird_party/victory:The 3 failures are those of
main:spans_say_the_next_start_and_the_lowest_level_viewed,warp_card_fetch_copies_flagged_pieces_to_their_slots,warp_card_patch_writes_the_masked_bytes_and_no_others. 9 new tests: 7 for the decision of what may be held and what sends a group (they do not build without the change), 2 on the software adapter for the host side. Run with several threads, the test binary ends with an access violation about one run in 4 to 8, and so doesmain(1 of 8).In the world, my copy of the game, the same build both ways (this change plus #308,
VICTORY_INDIRECT_RAW=3), runs of 300 s alternating:=1=2--console series-s, 1280x720)=1With
=1the submitting thread's preparing fell from 48-52 to 40-46 ms a frame at 4K, where the card (about 70 % busy) limits the frame too; with the card at about a third busy (Series S) the frame rate went up by about 3 %. No exception and no device lost with=1(6 runs).Oracle and test data
No game file. The counts come from my own runs of my copy of the game.
Checklist
E_NOTIMPL), never a fake success. (Nothing unimplemented here.)AI assistance: written with Claude Code. Claude Opus 5.5 (a subagent) designed and wrote the change and its tests; Claude Opus 5.5 (coordinating) ran the game A/B and wrote this description.
🤖 Generated 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.