Renderer port 1 ordering: a run of in-place indirect executions with only state between them clamped in one pass (VICTORY_PORT_CONSTANTS_ORDER_BATCH=1, off by default) #438
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!438
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-438"
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?
@HAL9000RELOADED on GitHub · 2026-11-27 07:17 UTC · original
HAL9000RELOADED:contrib/order-batch→main· +379 −16 · 2 files · 1 commits · openWith
VICTORY_PORT_CONSTANTS_ORDER(on by default since7ab13ed), every indirect execution whose arguments sit in port 1's in-place memory is clamped by a pass of its own, between two waits for all earlier work. In the heavy 4K scenes here that is about 2,060 passes a frame, and the ordering costs about 15 ms: in runab-order-4k(VICTORY_AB=20,VICTORY_PORT_CONSTANTS_ORDER, the 15 phases a side with at least 1,500 draws) the median of phase medians was 40.8 ms with it off and 56.0 ms with it on.VICTORY_PORT_CONSTANTS_ORDER_BATCH=1(off by default) clamps a run of them in one pass. A run is in-place executions of one record without a count, with nothing but state recorded between them (pipelines, root arguments, heaps, targets, viewports). The first opens a batch right before it, after a wait for every earlier write, and the next ones read it. Anything else ends the run: a draw or dispatch that is not one of it, a copy, a clear, a resolve, a barrier or pipeline sync, a value write or wait, another host list. A member that may write buffers (a dispatch, shaders that store, a light probe pass) ends it after itself.So between the pass and each member the card runs only earlier members, which write no buffer, and each member reads the bytes its own clamp would have read. That is the difference from
VICTORY_PORT_CONSTANTS_ORDER_ALONE=0, whose batch was kept across direct draws, other executions, barriers and clears (run pop-15). What it still relies on:Translated::storesbeing right (it is true when the code is not known), and our own work recorded with a member writing no title buffer.=<n>caps the executions a pass. In diagnostics buildsVICTORY_AB=<s>,VICTORY_PORT_CONSTANTS_ORDER_BATCHswitches it while the title runs, and the port 1 frame line now gives the passes and the executions a pass. Inlist.rsthe copy, clear, resolve, value write and wait methods end the run.Run
ab-batch-4k: RX 7900 XTX (driver 32.0.32015.7029), i7-13700KF, Windows 10 Pro 22H2, Series X at 4K, renderer ports 1, 2, 5, 6, 7 (VICTORY_PORT_CONSTANTS,_DESCRIPTORS,_CBV,_GUARD,_JOURNAL),VICTORY_INDIRECT_BATCH=2,VICTORY_INDIRECT_WINDOW=1,VICTORY_AB=20,VICTORY_PORT_CONSTANTS_ORDER_BATCH, 59 phases of 20 s. The 10 phases a side with at least 1,500 draws:ORDER_BATCH=1Trees and palms did not drop out on either side. Both sides ran one binary:
126acb3with this commit and our local input, overlay and light stand-in commits. This branch is the same patch alone on014d52d.I left it off by default. That is one run on one card, the batched side counted slightly more flicker events, and the change relies on
storesbeing right in every scene. A run on your side in the pop-14..17 places would settle the default.cargo test -p victory-gpu --libon the same machine: seven new tests indraw::in_place_run_tests. One of them records every sequence of six operations of five kinds, at four batch sizes, and checks that no execution reads a record clamped before a write recorded ahead of it. With the Agility runtime staged (014d52d+ #165 + the two test-export commits from my comment there): 401 passed, 0 failed, 35 ignored, against 394 / 0 / 35 without this commit. Without the runtime, this branch and main014d52dboth fail onlydepth_bounds_pipeline_loads_and_filters_draws(400 and 393 others pass).Refs #43
AI-assisted (Claude Code): measured and tested on my machine, code and text drafted with Claude.
@ThomasHFWright on GitHub · 2026-11-27 09:53 UTC · original
We tested a port of
c110868on an RTX 5090 under Proton. Both arms used the same executable and warm cache seed for the Series S 1080p cell replay with RT on and ambient fallback off. Over elapsed seconds 240–295, batching cut median clamp passes from about 1,440 to 133 per frame. Median Present interval rose from 113.3 to 192.8 ms (8.83 to 5.19 FPS), with zero budget refusals in both arms.In a separate 3,200-draw GPU fixture with 12 executions per batch, the legacy and ordered paths took 2.06 and 2.41 ms respectively, with matching vertex counts and budget checks. The size of the replay regression is still unexplained. If anyone repeats the test on NVIDIA, counts for clamp passes, executed indirect work, and copyback alongside Present intervals would help narrow it down. LinVxtory replay and fixture results
@HAL9000RELOADED on GitHub · 2026-11-27 11:35 UTC · original
Not NVIDIA, but the same counters from my run: RX 7900 XTX, Windows 10 Pro, native D3D12 (no Proton), Series X at 4K, RT off, ambient stand-in 0.8, renderer ports 1, 2, 5, 6, 7. The binary was
8db4c15, which carries the same patch asc110868(equalgit patch-id). One process withVICTORY_AB=20,VICTORY_PORT_CONSTANTS_ORDER_BATCH, 20 s phases; below are the 10 phases a side with at least 1,500 draws, elapsed 41-441 s. It is not a replay, so draws differ by phase. Present rows come from the A/B phase lines; the others are medians of the 5 s frame lines and ~1 s port 1 lines inside those phases.Only phases with at least 3,000 draws: 65.45 ms (6 phases) alone, 48.5 ms (7) batched. So here batching reduces both the passes and the full waits around our dispatches, and the frame gets shorter.
Differences from your run that I can list but have not tested: NVIDIA under Proton vs AMD native D3D12, RT on (BVH builder) vs off, ambient fallback off vs 0.8, Series S 1080p replay vs Series X 4K free run, and ~113 ms vs ~57 ms frames before the switch.
AI-assisted (Claude Code): measured on my machine, text drafted with Claude.
@HAL9000RELOADED on GitHub · 2026-11-27 14:46 UTC · original
One more set from the same RX 7900 XTX / Windows 10 machine, this time on main
014d52d+ #165 at 4K output with render scale 0.5 (ports 1, 2, 5, 6, 7,PORT_BUFFERS=1,INPLACE=2), one 10-minute run per arm on the same save, the boat scripted through the mission. 5-second lines with 3,000-4,999 draws:ORDERon (main)ORDERon +ORDER_BATCH=1For scale,
ORDER=0on two nearby trees in the same setup (main + #337 + #339, and VIctory-RDNA e3bfddf + #165) gave 37.1 and 36.2 ms, so here the per-execution clamp costs about 30 ms a frame and batching gets most of it back. These are separate runs, not an in-run A/B, and there was no screen recording, so flicker was not counted this time.AI-assisted (Claude Code): measured on my machine, text drafted with Claude.
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.