GPU/indirect: gate diagnostic budget atomics and readbacks behind diagnostics feature #793
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!793
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-793"
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?
@im-a-cat on GitHub · 2026-11-25 07:53 UTC · original
im-a-cat:perf/indirect-release-no-diag-atomics→main· +124 −23 · 2 files · 1 commits · openWhy
On current
main(9376fd6), the indirect argument clamp compute shader (indirect::SOURCE) unconditionally executes 4 extra global atomic operations (budget.InterlockedMax/budget.InterlockedAddat byte offsets 4, 8, 12, and 16) on every indirect compute and mesh record to collect frame diagnostics, andHostList::budget()/frame_line()always read, clear, and logMESH_GROUPSandCOMPUTE_GROUPSeven in non-diagnostics (release) builds — while the rest ofindirect.rs(IndirectBounded,barrier_test) is already gated on#[cfg(feature = "diagnostics")].Because world frames run ~6,700 indirect calls per frame, removing these diagnostic-only atomics and per-list volatile readbacks from non-diagnostics builds reduces unnecessary global atomic contention and mapped-buffer work without altering clamping, budgeting, or
diagnostics-profile telemetry.What
crates/victory-gpu/src/indirect.rs:clamp_source(diagnostics: bool)andmake_for_with(device, diagnostics)passing#define VICTORY_DIAGNOSTICS 0/1toD3DCompile.budget.InterlockedMax/InterlockedAddwrites at offsets4, 8, 12, 16under#if VICTORY_DIAGNOSTICS.cfg!(feature = "diagnostics")inmake_for(), keepsWarpHarness::new()testing the diagnostics path (true) for existing mesh telemetry assertions, and adds a new WARP testwarp_release_clamp_skips_diagnostic_atomics_and_keeps_boundscoveringdiagnostics = false(verifying both compute> 65535clamping and meshbudget[0]tracking whilebudget[1..=4]stay zero).crates/victory-gpu/src/host.rs:MESH_GROUPS,COMPUTE_GROUPS, reading/clearingwords.add(1..=4)inHostList::budget()(still zeroingwords.write_volatile(0)for the real budget counter), and the two diagnostic log lines under#[cfg(feature = "diagnostics")].Verification
cargo xtask policy:asset policy: 171 files okcargo clippy -p victory-gpu --lib --testsand--features diagnostics: clean inindirect.rsandhost.rscargo test -p victory-gpu --lib --features diagnostics --lockedandcargo test --workspace --locked: 0 failures across all crates (victory-gpupasses with both default and--features diagnostics, includingwarp_release_clamp_skips_diagnostic_atomics_and_keeps_boundson WARP).@timorjay on GitHub · 2026-11-25 09:44 UTC · original
Release-build comparison on an RTX 5090 D v2 (24 GB), NVIDIA 617.42, Ryzen 7 9800X3D, Windows Sandbox on Windows 11 Pro build 26300.
I built the exact PR head
c4d5ca5aand base9376fd60with the same toolchain, without the diagnostics feature. All three runs used the Series X profile and default switches. The patched run came between the two base runs.Each launch restored a separate copy of the same local checkpoint and started with its own empty VIctory cache. The Windows graphics driver cache was shared across the runs. I left the camera at the prison window for 90 seconds, beginning 20 seconds after the movement tutorial became visible, then backed up and turned to inspect Lucia in the window light. The reported FPS is the median of 1000 / the game window's ms per frame, sampled about once every 1.2 seconds.
The expected counter lines disappeared from the release build. The P10–P90 FPS interval overlaps those of both base runs. With one patched run I can't separate a small speed change from ordinary run-to-run variation. The same movement and camera inputs worked on all three, with no device-removal message before I stopped each observation.
Measured on my hardware with Codex assistance.
@MamaLeVrai on GitHub · 2026-11-25 10:20 UTC · original
Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head
c4d5ca5intomain9376fd6in a throwaway tree (no conflict).cargo clippy --workspace --all-targets --locked -- -D warningsfails with exactly the errorsmainitself has on this machine (placed_filler_twinsnever used,depth_writtennever read, invictory-gpu); with--all-featuresit fails with the same number of errors asmain(4). This PR adds none and removes none.cargo test --workspace --locked: 541 passed, 0 failed, 10 ignored, two runs (mainalone: 540 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data.AI-assisted (Claude Code); no game data.
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.