GPU/indirect: gate diagnostic budget atomics and readbacks behind diagnostics feature #793
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from fxceless/victory-fork. Originally posted by im-a-cat on 2026-11-25T07:53:07Z.
Why
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).upstream-sync referenced this pull request2026-11-25 09:08:36 +00:00
Imported from fxceless/victory-fork. Originally posted by timorjay on 2026-11-25T09:44:40Z.
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.
Imported from fxceless/victory-fork. Originally posted by MamaLeVrai on 2026-11-25T10:20:27Z.
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
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.