GPU diagnostics: count clean buffer refreshes once per command list #2669
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2669
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2669"
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?
@SinisterRob on GitHub · 2026-11-25 17:47 UTC · original
gpu/gre-refresh-readback→main· +29 −16 · 2 files · 1 commits · closed without mergingOn main, the diagnostics frame summary prints skipped refresh requests and their byte count, but both counters stay at zero even when the tracked buffer is clean. This makes it hard to tell how much work the existing clean-buffer check avoids.
Count the clean subset of explicit buffer refresh requests and accumulate all four request totals once per command list. Heap and page-table scans keep their own dirty-bit filters. Copies that pass those filters go straight into the batch. The reported skipped bytes measure the requested range, and the log format stays the same.
GPU verification. Tested with a local synthetic harness on an RX 7900 GRE, RADV, Wine 11.22 and vkd3d-proton, using the Windows GNU LLVM target and the optimized diagnostics profile. A closed command list refreshes one tracked 64 KiB buffer and copies its first word to a separate GPU buffer for CPU readback. Resubmitting unchanged, writing a new word, then resubmitting unchanged again yields:
The same check fails on
13f91caat the first unchanged submission: readback is correct, both skip counters are zero. The existing batch refresh test also passes.Diagnostics overhead. In a separate stress case, one closed list issues 8,192 distinct four-byte refresh requests into one clean buffer plus a GPU copy whose result is checked after each submission. Four runs per build, in counterbalanced order, each with 10 warmups and 60 timed submissions. Per-run median wall time in microseconds:
Game frame time is unmeasured. Synthetic inputs only. AI-assisted.
@kotekompotek on GitHub · 2026-11-25 17:55 UTC · original
Reviewed: counting clean-vs-dirty refreshes and routing only dirty ones to
add_dirtymakes the stats mean 'work done' — and skipping clean adds also avoids pointless batch growth. Diagnostics-only paths. CI green.@oni-swr on GitHub · 2026-11-25 18:13 UTC · original
Independent verification of head
1b240444de62b5b133cae208eb92598f3c0ac1a9onorigin/main13f91caee25f2fdf2c062be5f7a27f058e51cbca(merges cleanly, fast-forward).Environment: Windows 11 Pro 10.0.26100, WARP (d3d10warp 10.0.26100.9818) only, rustc/cargo 1.98.1 (per rust-toolchain.toml), DXC 1.8.2502.11 / dxil.dll 1.8.2502.11 (Windows SDK 10.0.26100.0 x64).
VICTORY_WARP=1andVICTORY_D3D12_WARP=1set for every run;victory-gputests were only run with--features diagnostics(without it the crate opens the default adapter). Limits: no physical GPU, no game files, no title-driven runs; this says nothing about behaviour on real hardware.... -p victory-gpu --features diagnostics host::batch->host::batch::a_copy_is_refreshed_once_per_submission_by_the_pages_written1 passed (updated toadd_dirty).origin/mainbaseline (cargo test -j 4 --locked -p victory-gpu --features diagnostics): 197 passed, 1 failed (memory::tests::a_submission_that_missed_leaves_the_copies_at_once,memory.rs:886), 1 ignored. That test passed in all four PR runs, so it looks flaky; I did not investigate it, and none of these PRs touchmemory.rs.Refreshes/Skippedcounters, which only exist underdiagnosticsand are only printed in the stats line. The existing batch test passes before and after, so it covers the unchanged flush behaviour, not this change.Batch::add'sshadow.clean()check moved to theStep::Refreshcaller, andHeap/Memorycallers already filter onwatch::clean_bit(bindless.rs:319,memory.rs:428), so no unfiltered path reachesadd_dirty. One small difference: those two paths no longer double-checkshadow.clean(), so a shadow whose cached bit is stale-dirty gets a (harmless) no-opupdateinstead of being skipped. No bugs found.AI disclosure: independent verification by Claude Code / Claude Sonnet 5.5, run for a user; no game files, dumps or hashes involved.
@fuzeofficlal on GitHub · 2026-11-25 19:03 UTC · original
Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of
1b240444(on13f91ca):Verification (
rustc 1.98.1MSVC)cargo clippy --locked -p victory-gpu --all-targets -- -D warningsand--features diagnostics: 0 warnings.cargo test --locked -p victory-gpu --features diagnostics --lib host::batch: 1 passed, 0 failed.VICTORY_D3D12_WARP=1):cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1: 198 passed, 0 failed, 1 ignored.Review Notes
HostList::run_deferredadd zero locks, zero heap allocations, and zero cross-reset state; under non-diagnosticsbuilds all counting compiles away completely and liftingshadow.clean()ahead ofbatch.add_dirtyavoids an extra check on already-filteredStep::Heap/Step::Memorycalls. Clean and ready to merge.@Marvisak on GitHub · 2026-11-25 22:24 UTC · original
Automated triage for the maintainers.
Merge candidate (small; diagnostics counters). On
mainnothing ever adds toC::Skipped/C::SkippedBytes(crates/victory-gpu/src/copystat.rsonly prints them), so the frame summary always shows zero skipped refreshes.HostList::run_deferred(crates/victory-gpu/src/host.rs) now checksshadow.clean()at theStep::Refreshcaller, counts requests and skips locally, and adds them once per list.Batch::addbecomesadd_dirtywithout its own clean check. TheHeapandMemorypaths already filter onwatch::clean_bit(bindless::refresh,memory::prepare), so nothing that was copied before is skipped now; at worst a hull with a stale dirty bit gets a no-op update. It merges cleanly; CIcheck: passing.Non-blocking: a small diagnostics test that checks the counter deltas would pin the new accounting.
Generated by Claude Code
Pull request closed