GPU: cheaper indirect draws: no barrier per draw, one budget charge per group, budget in card memory #220
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!220
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-220"
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?
@venglov on GitHub · 2026-11-24 22:41 UTC · original
venglov:gpu/indirect-scratch-stays-readable→main· +1494 −99 · 4 files · 9 commits · openRefs #107, #10.
Problem
#107 measured about 3,200 one-record indirect draws a frame at roughly 12 µs each, about 40 of 63 ms of GPU time on an RTX 5080.
VICTORY_INDIRECT_WINDOW=1, which clamps a run of records in one pass, didn't move it. Two reasons, both in our own clamp path:indirect::done, which moves the clamped-arguments buffer back toCOMMON; the next clamp then moved it fromCOMMON. A barrier into or out ofCOMMONmay be a full wait for the driver.shared_buffer, custom heapL0), so on a card of its own each atomic crosses PCIe. On an RTX 5070 Ti, windows of 32 took 46–50 ms for 3,200 draws, where draws clamped one at a time took 19 ms (benchmark below).Change
cc11ccc).HostListremembers that a clamp left its scratch buffer inINDIRECT_ARGUMENT. Executions read it with no barrier of their own, the next clamp moves it straight back toUNORDERED_ACCESS, and it returns toCOMMONonce, when the list closes or a bigger buffer replaces it.indirect::doneis gone.f873394, off by default). WithVICTORY_INDIRECT_WINDOW_CHECK=1, every draw served from a window first clamps its record again (own buffer, own budget) and a compare on the card checks it against the window's copy. Counts are logged aswindow check, plus a warning naming the first record that differed.3db5a0e,23daba3). Record costs go to group-shared memory, and one thread charges the group's sum with a single compare-and-swap (retried only if another group got there first). It simulates the same saturation record by record, in lane order, and each thread reads whether its record fit. The mesh diagnostics are summed in the group and added once. What a record costs and when it runs empty are unchanged; which records of a group fit is now lane order instead of whoever won the race.d5c15cb). Even one record clamped alone makes two atomics in a row on the budget word (a read, then a compare-and-swap), and in CPU-mapped memory both cross PCIe, on the default path too. The word is now a device-local buffer of the list. The list zeroes it before its first clamp (WriteBufferImmediate, as a copy) instead of the CPU zeroing it at submission. When the list closes, the clamp's notes on mesh records are copied to the mapped words, where the next submission reads them for the frame line as before.VICTORY_INDIRECT_CARD_BUDGET=0keeps the old place, for in-game A/B runs.Barrier calls per indirect execution:
Why it is safe
INDIRECT_ARGUMENT, which orders its writes after all earlier executions' argument reads.copy_buffer_region→defer_copy), so nothing recorded between two window draws writes the scratch buffer.Measured
In-game, RTX 3070 8 GB (by @VibeClauding,
d5c15cb, card-bound cell scene,VICTORY_RELAY=2, frame lines from minutes 3–5, one run each; report):VICTORY_INDIRECT_WINDOWThe picture was intact in the dumped frames, with no device removal. Afterwards the frame is bound by preparing and copy-back, not the card.
In-game, RTX 5080 (by @Peppacodes,
32c6229/7e239bf, first room,VICTORY_RELAY=2 VICTORY_LATE_WAIT=3, medians of 20 frame lines; report): with windows on, 157–177 ms a frame against 202 ms formainwith windows off and 218 ms formainwith windows on. The card wait fell from 84 to 22–30 ms. With windows off at7e239bf: 211 ms against 202 ms, within this machine's run-to-run spread (up to 9 %), with the card wait down from 84 to 64 ms. No errors or device loss in six runs.Other in-game runs:
32c6229, windows off, one run each): 232.2 ms against 209.1 ms onmain, so slower. One cause found since: every clamp group touched the budget, including groups past a count buffer's count. Fixed in7e239bf; a rerun has been asked for.a4a745e, CPU-bound at about 550 ms a frame): same frame time, about 23 % more draws a frame, no hangs.Benchmark
indirect::bench(ignored by default, no title files needed): 3,200 one-record indirect draws of our own, records 32 bytes apart, one at a time and in windows of 32. It runs them asmainrecords them and as this branch does, plus windows with the new barriers butmain's clamp, and both modes with the budget in card memory. GPU time comes from timestamps around the list.d5c15cb, @VibeClauding)a4a745e, @Flyander)mainmainmain's clampOn an RTX 5080 (by @Peppacodes): one at a time 14.1 ms on
main, 14.0–14.2 with this, 10.7–10.9 with the budget in card memory; windows of 32 32.6 ms onmain, 0.63 ms with this, 0.52 ms with the budget in card memory.Synthetic single-record mesh draws on an RTX 5070 (by @ryotdev,
32c6229): 19.68 ms → 17.61 ms (−10.5 %) with the new clamp; the barriers alone were neutral.What this shows:
VICTORY_INDIRECT_WINDOW=1.VICTORY_INDIRECT_WINDOW_CHECK=1(f873394) checks every window draw against a fresh clamp of its record on the card and logs any that differ, to settle whether windows can be trusted in a scene. Turning it on by default should wait for #204 (window bounds) and a check that window draws match fresh clamps; the 16-window breakage on #107 likely came from several windows sharing one scratch region, which a single window cannot do (comment).Tests
HostListandHost::execute, recorded twice across a reset.VICTORY_D3D12_DEBUG=1, diagnostics), the host-list tests check that nothing was reported after closing each list. A control that records a wrong barrier into aHostListis caught by the same check (run).windows-latestpasses forf873394: clippy in both configurations, andcargo test --workspace(victory-gpu115 passed, 2 ignored; merged ontomainc96b4f2, 117 passed with only that main's owndepth_boundstest failing on the software adapter, as it does without this PR). Under the debug layer all 12indirect::tests pass with nothing reported (run).AI-assisted (Claude Code). Tests and benchmark ran on GitHub's Windows runners; hardware and in-game numbers are from the testers credited above.
🤖 Generated with Claude Code
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 22:42 UTC · original · edited 2026-11-24 22:45 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
cc11cccℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@venglov on GitHub · 2026-11-24 23:10 UTC · original
Thanks for the RTX 5070 Ti run. It showed something the software adapter couldn't: on the card, windows of 32 took 46–50 ms where draws clamped one at a time took 19 ms, even though windows record far fewer clamp passes and barriers.
The only work that grows with a window is in the clamp. Each record charged the list's budget with an atomic read and a compare-and-swap loop on one word, all 64 threads racing for it. That's a round per record and about n²/2 atomics per window. The word is a
shared_buffer(custom heap,MEMORY_POOL_L0), so on a card of its own every one of those atomics crosses PCIe; on WARP they're CPU atomics, which is why it didn't show here. That would also explain why windows didn't pay off in-game in #107.New commits:
3db5a0e: the clamp charges the budget once per thread group. Record costs go to group-shared memory, one thread does a single compare-and-swap for the group, simulating the same saturation record by record in lane order, and each thread reads whether its record fit. The rules are unchanged. Which records of a group fit is now lane order instead of whoever won the race. New WARP test:warp_a_group_charges_its_records_in_lane_order.23daba3:main's clamp to compare against, so one run separates the two changes.On the software adapter (run, three repetitions):
mainmainmain's clampAs expected, the per-group charge doesn't matter there. The card is where it should. If you can run the updated benchmark on the same 5070 Ti, its fourth and fifth lines will show how much of the windows' cost was the budget atomics:
Full CI on
23daba3passes (victory-gpu113 passed). Under the D3D12 debug layer, allindirect::tests pass with nothing reported, and a control that records a wrong barrier into aHostListis caught by the same check (run).@AKA0GHOST on GitHub · 2026-11-24 23:38 UTC · original
Tested in game on Windows 11 D3D12, RTX 5070 (driver 621.14): fork main + #175 + this PR at
a4a745e(before your latest push), diag build,VICTORY_RELAY=2, 10-minute run. Thanks for this.World frames only (samples over 1,000 draws), one run each:
The frame time stayed the same while each frame carried about 23% more draws, so more indirect work gets through per frame. Here the CPU side (~420 ms preparing) still sets the pace, so the barrier savings don't show up as fps yet. No hangs or device removals in the full run, and the
indirecttests pass here (one failure on a first run that I couldn't reproduce or identify; all 9 passed on rerun).AI-assisted (Claude Code); no game files attached.
@ryotdev on GitHub · 2026-11-24 23:41 UTC · original
I tested
32c62299on a desktop RTX 5070 with Windows D3D12 driver 610.88. I added a mesh variant of your triangle benchmark to separate the barrier change from the new clamp on the single-record path. Test source based on this PREach arm issued 3,827 single-record indirect mesh dispatches, one group per dispatch, with a 12-byte signature and 32 bytes between source records. The budget remained in CPU-visible memory and lookahead was off. The warm-up for each arm checked 3,827 mesh invocations, 3,827 emitted primitives, nonzero pixel invocations and the expected budget charge. Nine timed rounds rotated the arm order. Times below are GPU timestamps around the complete synthetic command list.
The full change saved 2.067 ms per list (10.5%) on this workload and was faster in all nine paired rounds. The barrier-only median moved by 0.033 ms. This gives the clamp change a measurable result on the RTX 5070 with one requested record per call. Game frame time still needs a separate comparison.
For a local correctness check, the original and new HLSL produced the same indirect arguments and budget counters for 14 single-record WARP cases, including oversized mesh counts, zero work and exact/insufficient remaining budget. The benchmark’s original clamp compiled byte-for-byte identically to the original production shader.
To reproduce, check out the linked commit on a Windows machine with native mesh-shader and mesh pipeline-statistics support. Set
VICTORY_PC_DXCto your PCdxc.exeand run the following command.AI-assisted. All benchmark shaders and inputs are synthetic.
@venglov on GitHub · 2026-11-24 23:46 UTC · original
One more change, for the default path:
d5c15cbmoves the budget word into the card's memory.Even a record clamped alone makes two atomics in a row on that word (read, then compare-and-swap). In mapped memory, both cross PCIe on every clamped draw, which may be a good part of the ~6 µs a draw in the one-at-a-time line on the 5070 Ti. The list now zeroes a device-local copy before its first clamp (
WriteBufferImmediate) and copies the mesh notes back to the mapped words when it closes, so the frame-line stats are unchanged.VICTORY_INDIRECT_CARD_BUDGET=0restores the old place for an in-game A/B.The benchmark gained two lines with the budget in card memory: "one at a time, card" and "windows of 32, card". If someone reruns it on a card, the lines comparing "this" with "card" show what that saves. On the software adapter it's neutral, as it should be there (run).
CI on
d5c15cbpasses (victory-gpu114 passed, including a test that the budget starts empty at each submission), and under the debug layer all 12indirect::tests pass with nothing reported (run).@ryotdev on GitHub · 2026-11-24 23:51 UTC · original
Follow-up to the synthetic mesh benchmark. I also compared two plain release builds on the same RTX 5070, one with the four-file delta from
32c62299. Both restored the same checkpoint and native cache seed, with identical launch input, lookahead off and 90 seconds after the first world report.The last 30 seconds had median reported frame times of 209.1 ms on the control and 232.2 ms with #220 (4.78 and 4.31 FPS). For a closer workload comparison, I paired reports from 30–90 seconds after world entry with at least 3,500 draws/frame, zero pipelines building, timestamps within 10 seconds, and draw counts within 3%. Only three pairs qualified. The candidate was 9.3, 13.0 and 18.3 ms slower in those pairs. Median draws/frame were 4,967 and 5,019, with 347 and 345 dropped.
One run per build. The runs reached the world threshold at different times. We saw the synthetic single-record GPU improvement, but this checkpoint did not show a frame-rate improvement. AI-assisted.
@venglov on GitHub · 2026-11-24 23:57 UTC · original
Thank you, both runs are useful, and the in-game one matters more.
Synthetic. The single-record result (19.68 → 17.61 ms, barriers alone neutral) fits the budget being the cost: even one record makes an atomic read and a compare-and-swap on a word in CPU-mapped memory.
In-game, slower. One run per build is thin, but all three matched pairs going the same way is enough to take seriously. The single-record benchmark can't show one regression I found in
32c6229:main's shader, threads past the count returned before touching the budget.7e239bfmakes a group without records make no atomic.Your build also didn't have
d5c15cb, which moves the budget into the card's memory (VICTORY_INDIRECT_CARD_BUDGET=0turns it off).If you have time for one more pair on the same checkpoint,
7e239bfagainstmain, ideally two runs each, would show whether it's a gain, neutral or still a loss. A third run of7e239bfwithVICTORY_INDIRECT_CARD_BUDGET=0would separate the card-memory part. If frames are still slower, I'll cut the PR down to whatever measures as a gain in-game.@VibeClauding on GitHub · 2026-11-25 00:13 UTC · original
RTX 3070 8 GB (Ampere, driver 610.88), Ryzen 7 5700X3D, Windows 11 26200. Tested
d5c15cb(before7e239bf): the benchmark, and one in-game A/B where the card is the limit. With windows on, both show a large gain on this card.Benchmark (
cargo test --release -p victory-gpu --lib indirect::bench -- --ignored --nocapture --test-threads=1):On this card, the barriers matter little (-8.7%). The per-group charge is what turns windows from slower than one at a time (10.5 µs) into 0.31 µs a draw. The card budget takes another 10-14% off.
In game. The base is fork
main4e17478plus my branch (VibeClauding/victory-fork@nvidia-8gb-fixes: #203 #186 #188 and a few shader fixes, nothing inindirect.rs).VICTORY_RELAY=2 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024, DRED off.VICTORY_INDIRECT_WINDOWd5c15cbVICTORY_GPU_TIMINGon the base had put 84 of 110 ms a frame in 4,732 indirect commands (about 18 µs each).I'll run
7e239bfagainstmainnext, two runs each, plus one withVICTORY_INDIRECT_CARD_BUDGET=0, and post the numbers here.AI-assisted (Claude Code); runs on my machine with my own copy, counts and timings only.
@venglov on GitHub · 2026-11-25 00:22 UTC · original
Thank you, this is the in-game result the PR needed. 201–206 → 130–145 ms a frame, with the card's share going from about 110 ms to 28–46 ms, also says where the windows' cost was: the per-group charge, not the barriers. I've put your tables in the description.
Two notes for your next runs:
7e239bfis the commit to compare againstmain. It stops clamp groups past a count buffer's count from touching the budget, which @ryotdev's slower windows-off run on an RTX 5070 may have been hitting. A run of it withVICTORY_INDIRECT_WINDOWunset would show whether the default path is now neutral or better on your card.VICTORY_INDIRECT_CARD_BUDGET=0separates the card-memory part, as you planned.@Peppacodes on GitHub · 2026-11-25 00:39 UTC · original
The benchmark and an in-game A/B on an RTX 5080 (driver 621.24, Ryzen 7 5700X3D, Windows 11 26200), at
32c6229and again at7e239bf.Benchmark
cargo test --locked -p victory-gpu --release --lib indirect::bench -- --ignored --nocapture. Four runs, each the median of 9 frames: three at32c6229, one at7e239bf. They agree within 1 %.mainmainmain's clampAs on the 3070, the budget atomics were almost all of the windows' cost on this card. The barriers take 9.5 % off, and the per-group charge takes off another 97.9 %.
In game
Setup:
4e17478, plus #28's watchdog hook and 64 MB pipeline-worker stacks. "This" adds the PR's commits up to the one named.VICTORY_RELAY=2 VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024 VICTORY_DISPLAY_MODE=1920x1080, Series X profile.VICTORY_INDIRECT_WINDOWmain7e239bfmain32c622932c62297e239bfmain's clamp they make the frame 8 % slower, as in #107. With this PR they make it 12–22 % faster thanmainwith windows off (5.6–6.4 fps against 4.9). The submitting thread's wait for the card drops from 84 to 22–30 ms.7e239bf: the card wait drops from 84 to 64 ms. The frame was 4 % slower, but repeat runs of one build vary by up to 9 % here, so that's noise, not a regression either way.Run 50 drew the first room's walls on both sides, which no run without this PR did here. Runs 52 and 54 didn't. The walls vary from run to run, so I'm not claiming anything for #168.
AI-assisted (Claude Code). Benchmark and runs on my own machine; nothing from the title attached.
@venglov on GitHub · 2026-11-25 02:13 UTC · original
Thanks @Peppacodes. The RTX 5080 numbers settle the windows' cost: 32.6 ms → 0.63 ms for 3,200 draws in the benchmark, and 12–22 % shorter frames in game with
VICTORY_INDIRECT_WINDOW=1. With windows off, the card's share fell from 84 to 64 ms while the frame stayed within this machine's run-to-run spread, since preparing is the limit there.So the gain is in windows, and the open question is whether windows can be trusted by default (#107: keeping 16 windows per list broke drawing, and one RTX 4090 run with windows on
mainshowed corrupted blocks).f873394adds a check for that, off by default:VICTORY_INDIRECT_WINDOW=1 VICTORY_INDIRECT_WINDOW_CHECK=1, every draw served from a window first clamps its record again, by the window's rules, into a buffer of its own with a budget of its own, and a one-thread compare checks it against the window's copy on the card.window check(every 10,000 checks). A warning names the first record of a run that differed, as the window had it and as it is now.indirect::tests pass with nothing reported.If anyone with windows on can run a few minutes of gameplay with the check and post the last
window checkline (and any warning), that tells us whether windows read anything stale in this title.Also: #220 merges cleanly onto the new
main(c96b4f2). Two things onmainitself will show up in every PR's CI:cargo clippy --workspace --all-targets -- -D warnings(without--all-features) fails with "functionplaced_filler_twinsis never used" (resource.rs, called only from diagnostics code). A#[cfg(feature = "diagnostics")]on it fixes that.pipeline::host::tests::depth_bounds_pipeline_loads_and_filters_drawsfails: "depth 0.5 outside [0.6, 1.0] must be rejected", left 255. Perhaps the adapter doesn't apply the test, so it may want a skip there.With those two aside, #220 merged onto
c96b4f2passes everything: 117 passed againstmain's 112, the same single failure on both (#220 merged,mainalone; both with the one-linecfgadded so the tests run).@Pin0d1 on GitHub · 2026-11-25 04:12 UTC · original
I compared a single GPU clamp on
f873394(the window-checker commit) against an independent CPU budget reference. The input has 130 draw records and room for 497 more vertices. The reference visits live records in order and leaves the remainder available if a record is too large. With a GPU count of 63, the first difference is record 50. The GPU returned[0, 0, 50, 250]where the reference kept[5, 1, 50, 250]. Both runs on each of WARP and the RTX 2060 SUPER gave the same first difference.This is a check of the emulator's admission policy. A fresh clamp can agree with a windowed clamp and still differ from that reference. The
pr220replay case applies the test to this exact PR head. I also included an ordered-admission candidate on top of #204 and #239 for comparison. GPU test and transcripts · Candidate and prerequisitesPrepared with the help of Codex 6.2 Astra Max.
@AimLogin on GitHub · 2026-11-25 04:32 UTC · original
I tested this PR independently using a synthetic buffer-refresh benchmark and also integrated it locally with #220.
Hardware:
Synthetic benchmark with 64 buffer copies and approximately 67 MB of data:
The combined build with #220 compiled successfully and passed all 516 tests.
One remaining concern is contention within the memory-management and write-watch paths under concurrent workloads. Our synthetic benchmark does not fully reproduce those conditions.
Nevertheless, the measured reduction in CPU-side refresh time is encouraging. No isolated end-to-end FPS improvement has been established yet.
@Peppacodes on GitHub · 2026-11-25 04:59 UTC · original
Window check on an RTX 5080 (driver 621.24, Ryzen 7 5700X3D, Windows 11), as asked above.
diagbuild with diagnostics: fork main310c6eb+ this PR atf873394+ #462, plus #28's watchdog hook and 64 MB pipeline-worker stacks.VICTORY_INDIRECT_WINDOW=1 VICTORY_INDIRECT_WINDOW_CHECK=1, main's defaults, Series X profile, 1080p. One run, standing in the first room for 5 minutes after entering the world. No errors.Last line:
The only warning came 23 s after entering the world:
So all 88 differences were among the first 90 checks, and there were none in the roughly 760,000 checks after that.
AI-assisted (Claude Code).
@Pin0d1 on GitHub · 2026-11-25 05:41 UTC · original
In the RTX 5080 trace,
checked=90, differed=88describes the previous execution of one host command list. The periodicchecked=760028, differed=88line is cumulative. The warning accounts for all 88 reported mismatches, but their position within the full run is still unknown. Counter reportingI also reproduced a guest copy the checker misses on both
f873394and the merge with main at8107935. I recorded six three-vertex draws and used the deferred copy path to set the third draw's vertex count to zero. After the fence the guest word was zero, yet the GPU's pipeline statistics showed 18 vertices (15 expected). All four window checks compared equal. Applying #663 to each revision gave 15 vertices and two matching checks. A hit checks the same GPU Shadow that supplied the window, so both reads can agree on stale data. Window hit and argument refreshThe unchanged-input control produced 18 vertices on all four builds. The existing direct-GPU-write control detected its one changed record in two checks. I repeated both tests twice per build on WARP and an RTX 2060 SUPER. The writer responsible for the 88 differences on the 5080 is still unknown. Test patch, commands and all 32 process transcripts
Prepared with the help of Codex 6.2 Astra Max.
@Peppacodes on GitHub · 2026-11-25 05:54 UTC · original
Thanks, @Pin0d1. Right, 90/88 is one list's execution, and the periodic line is cumulative. From the same RTX 5080 log:
checked=10042 differed=88.checked=760028.So all 88 came from that one list execution, within the first ~10,000 checks, and nothing differed after it. I can rerun with #663 on top to see whether that execution is the copy case you found.
AI-assisted (Claude Code).
@venglov on GitHub · 2026-11-25 06:02 UTC · original
Merged
main(310c6eb) into the branch (8107935), so it merges again. The only conflict was both of us adding a benchmark at the end ofindirect.rs; both are kept (mod bench;andbare_cost). Earlier commit hashes, such as7e239bfandf873394, are unchanged for anyone mid-A/B.CI on the merged tree, with throwaway fixes for
main's own lint failures so the tests run (run): 122 passed, 3 ignored. The only failure isdepth_bounds_pipeline_loads_and_filters_draws, which fails the same way onmainalone on GitHub's software adapter.main's CI currently stops before the tests, at three lints:draw.rs2339,sort_unstable_by(clippy wantssort_unstable_by_key(|r| std::cmp::Reverse(r.1)));bare_cost'sdepth_writtenfield is never read;placed_filler_twinsis unused withoutdiagnostics.@Pin0d1 on GitHub · 2026-11-25 06:02 UTC · original · edited 2026-11-25 06:05 UTC
@Peppacodes, thanks for checking the earlier log lines. That puts all 88 differences within the first 10,042 reported checks.
Yes, could you repeat the same five-minute scene on the same build and settings, with only #663 (
845fc43) added? The first and lastchecked/differedlines, plus thewindowandfreshvalues from any warning, would let us compare the runs. The totalcheckedcount matters because #663 can rebuild a window that would otherwise have produced a checker hit.If the warning disappears and you have time for one more run, it would help to see whether it comes back on the original build.
Prepared with the help of Codex 6.2 Astra Max.
@CuteBooty on GitHub · 2026-11-25 08:04 UTC · original
A second RTX 3070 (slower CPU), Series S: faster in light scenes, slower in heavy ones
One run with the switch against one without, same exe and settings otherwise, both about 24 minutes from the first
room through the robbery and the chase. Our tree carries an older head of this PR, not
81079358. Settled medians ofthe log's frame lines, by draws per frame:
where the same scene was 240 ms without.
not worked out why.
One run each, and the heavy scenes differ a little between runs, so the direction is firmer than the sizes. It
agrees with VibeClauding's cell-view result on the same card; the heavy-scene loss is new as far as I can see.
Setup: RTX 3070 8 GB (driver 621.24, 32-lane waves), Ryzen 5 3600, 32 GB, Windows 11, Series S mode (PR #188), 1920x1080,
VICTORY_TEXTURE_DROP_MIPS=1, relay at its default (stage 2), card buffers 1 / 1024 MB, a diagnostics build of a tree with a number of open PRs picked.@kennymaakay on GitHub · 2026-11-25 09:03 UTC · original
Turing data point: RTX 2080 SUPER 8 GB (i9-9900, Windows 11, PCIe 3.0), PR head
8107935, both synthetic benchmarks, no title files.cargo test -p victory-gpu --release --lib indirect::bench -- --ignored --nocapture, 3,200 one-record draws, medians of 9 frames:mainmainmain's clampSo this card tracks the 3070 closely: windows -96.9 % against
main's windows, budget in card memory -11.8 % one at a time.bare_command_cost(10,000 one-triangle draws, 2560x1440), the part that differs from the 5070 Ti numbers in #696:On Turing almost all of the per-draw cost is the compute pass between two draws itself (4.18 µs); the two UAV waits add about 0.1 µs. On the 5070 Ti in #696 it was the other way round (0.47 µs without the waits, 4.22 with them). So on this generation removing barriers alone (
VICTORY_BARRIER_TEST=indirect) should not help; what helps is not having a clamp between draws at all, which is what windows do here.Rough synthetic bound for this card: about 5,100 clamped executions a frame × ~6 µs ≈ 30 ms a frame of clamp alone, before any loss of overlap with the real draws. For reference, in game this machine runs at about 190 ms a frame of card work, card-bound (with the
c96b4f2texture passes off, see #594). I haven't run this PR in game yet; that A/B is next.(Measured and written with Claude Code, Claude Opus 5.5.)
@kennymaakay on GitHub · 2026-11-25 10:44 UTC · original
In-game A/B on the same RTX 2080 SUPER 8 GB (i9-9900, Windows 11), following the benchmarks above. PR head
8107935merged onto our local tree (forkmain3bff182+ local changes, no other PRs), one binary, onlyVICTORY_INDIRECT_WINDOWdiffers. Series X profile, relay stage 2, card copies 1 MiB–1280 MB,VICTORY_HEAP_RECHECK=0 VICTORY_EARLY_TEXTURES_MS=0 VICTORY_BAKE_TEXTURES_MS=0(#594). Same moment of the opening in-engine scene, standing still, the last minute of each run (12–16 frame lines each):VICTORY_INDIRECT_WINDOW=1Not covered: one run each; I did not compare the picture closely between the two runs and have not run
VICTORY_INDIRECT_WINDOW_CHECK=1yet; and only this ~4,900-draw scene, so nothing on the heavier 5,000–9,000-draw scenes where @CuteBooty saw it slower. I'll add a check run and a heavy scene when I can.(Measured and written with Claude Code, Claude Opus 5.5.)
@npanu420 on GitHub · 2026-11-25 10:50 UTC · original
Results on an RTX 3070 8 GB + i9-9900X, Windows 11, Series S profile. This is a port of this PR's budget part onto a
9376fd6-based stack (ExoCalibra's #770 head28b74a9+ #802 #804 #346 #522 #783 #827 #798 #823 + #824).#780 (
VICTORY_INDIRECT_KEEP=1) already covers the scratch-barrier half, so the port takes only the grouped charge with the budget in card memory. It sits behindVICTORY_INDIRECT_GROUP_BUDGET=1and is off by default. With it off, the clamp compiles to the same DXBC as before. It also carriesVICTORY_INDIRECT_WINDOW_CHECKand the bench module. Commit:github.com/npanu420/victory-fork@04eb3e1(branchport-220-on-9376fd6).The same warm build, three runs back to back. Each is the median over world frames 60-160, with
VICTORY_INDIRECT_KEEP=1:GROUP_BUDGET=0GROUP_BUDGET=1GROUP_BUDGET=1 INDIRECT_WINDOW=1These are single runs with small windows (9-11 status lines), so the medians are noisy, but the GPU drop with windows is large. There were no device losses on this card. WARP tests: 14 passed with all switch combinations, including a lane-order test across the 32-lane boundary.
(AI-assisted: ported with Codex, reviewed and measured with Claude Code. No game data.)
@iGoldenNinja on GitHub · 2026-11-25 12:53 UTC · original
RTX 5080 16 GB, 617.14, Windows 11 Pro 25H2 build 26200.9974, Ryzen 9 5900X, 32 GB RAM. I used a diagnostics switch to toggle draw windows on and off within an
a253706-based build,74becd8, after reaching controllable Series X prison. The driver watcher was active andVICTORY_COPY_PLAINwas off.Over three 30-second display segments at 2542 × 1396, off/on/off gave 2.985 / 3.446 / 3.813 displayed FPS and 393.94 / 629.10 / 358.66 ms P99. In the overlapping 4,800–5,300 draws-per-frame band, median host-reported GPU time was 179.45 ms across six initial off samples and 78.40 ms across five on samples. The final off segment drew fewer objects, and the captured viewpoints differed. A performance overlay was also visible in the enabled capture. The GPU time decrease is a useful lead. The test does not establish an FPS gain at matched workload.
No driver error or device removal was logged and the run ended deliberately. Test method and frame timing. Testing and reporting assisted by OpenAI Codex.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 22:45 UTC · original
On
crates/victory-gpu/src/indirect.rsline 1415 (outdated):With
diagnosticsandVICTORY_D3D12_DEBUG=1, this assertion runs afterhost.execute, butHost::submitalready callsself.log_messages()athost.rs:4144, discarding its result and clearing the info queue. Nonfatal resource-state errors from recording or submission are therefore consumed before this assertion can inspect them, allowing the test to pass despite the barrier errors it is intended to reject. The new assertion inhost_list_reuses_and_grows_scratch_across_submissionshas the same problem. Preserve and assert the submission's diagnostic result, or inspect the messages before that drain.Useful? React with 👍 / 👎.
@venglov on GitHub · 2026-11-24 23:07 UTC · original
On
crates/victory-gpu/src/indirect.rsline 1415 (outdated):Right:
Host::submitdrains the queue into the log, so those asserts couldn't see errors raised while recording. Fixed in23daba3: both host-list tests now read the messages afterlist.close()and beforehost.execute. Barrier before-state errors are reported at record time, so they're caught there. A control test on the CI-only debug-layer branch records a wrong barrier into aHostListthe same way and checks that the read sees it.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.