Diagnostics: preserve the world capture draw count #2589
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!2589
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2589"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 16:19 UTC · original
andrewpozdnakov7-jpg:codex2/capture-world-draw-order→main· +16 −3 · 1 files · 1 commits · openVICTORY_CAPTURE_WORLDpicks the first frame that reaches 500 host draws. If two calls toPresentsample the cumulative counter and the older sample is processed later, that sample can lower the stored counter. The next frame then counts some of the same draws again.Keep the greatest draw count seen so far and return zero for an older sample. The same synthetic sequence on
67e8ae1reports 515 draws after the stale sample and crosses the threshold early. The patch reports 395 on that frame and still reports exactly 500 on the next one.All three diagnostics capture tests, strict GPU Clippy, and staged asset policy pass. The change touches the world-capture counter. #2340 covers the counters in the log line.
Coordination claim
If you cherry-pick or rebase this commit, please retain its Git author. If you fold the change into another commit, please add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.AI-assisted. Verification used synthetic draw counts.
@Marvisak on GitHub · 2026-11-25 22:20 UTC · original
Automated triage for the maintainers.
Merge candidate (small, diagnostics only).
capture::presentedcounted draws since the last present withLAST.swap(drawn). If two presents race and the older sample is stored last,LASTmoves backwards and the next frame counts some draws twice, soVICTORY_CAPTURE_WORLDcan pick its first world frame too early.fetch_maxplussaturating_subkeepsLASTmonotonic and gives an older sample zero. The test walks the PR's sequence. The impact is small: it only affects which frame the diagnostics capture counts from. The change is correct by my reading and cannot affect release builds.A nit for the author or maintainer: the
#[test]sits at module level incapture.rsrather than in itstestsmodule.CI:
checkpassing. Merges cleanly into currentmain. A recommendation to look at it, not an approval.Generated by Claude Code
@futurepro62 on GitHub · 2026-11-26 00:57 UTC · original
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
94190ff(on its base67e8ae1).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 773 passed, 0 failed, 9 ignored.stale_draw_samples_do_not_trigger_world_capture_earlyonly builds with thediagnosticsfeature, so the run above doesn't include it; it passes incargo test -p victory-gpu --lib --locked --features diagnostics(same skips).--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
@fuzeofficlal on GitHub · 2026-11-26 16:20 UTC · original · approved these changes
Reviewed
94190ff21061a0daec703af6721991698197d933(merged cleanly onto63bcca43c6a00a758510398fa43096ce7e4f7df0) and verified on Windows 11 x64 with an NVIDIA GeForce RTX 5090, WARP, and D3D12 Debug Layer.Audit
crates/victory-gpu/src/capture.rs:48,:57,:62: replacingLAST.swap(drawn, Relaxed)withdrawn.saturating_sub(last.fetch_max(drawn, Relaxed))keepsLASTmonotonically non-decreasing across concurrent out-of-orderPresentsamples, returning0for stale samples and preventing double-counted draws from triggeringVICTORY_CAPTURE_WORLDearly. Diagnostics-only (captureis gated byfeature = "diagnostics").Verification
63bcca43c6a00a758510398fa43096ce7e4f7df0+cargo run -p xtask -- policy(191 files ok)cargo clippy -p victory-gpu --all-targets -- -D warnings(default &--all-features)victory-gpucapture::(--features diagnostics,VICTORY_D3D12_DEBUG=1): 12/12 passed on RTX 5090; 12/12 passed on WARP (includingstale_draw_samples_do_not_trigger_world_capture_early).max_seen == summed == 20004).@Dukestar69 on GitHub · 2026-11-26 18:32 UTC · original · approved these changes
LGTM — verified on Windows against
origin/main(63bcca4).fetch_max+saturating_subindraws_since_last_presentensures a stale/out-of-order draw count sample cannot rewindLASTand falsely trigger the 500-draw world capture threshold.cargo test -p victory-gpu --lib --features diagnostics capture:: -- --test-threads=1: 12 passed, 0 failed (includingstale_draw_samples_do_not_trigger_world_capture_early).cargo clippy -p victory-gpu --all-targets -- -D warnings(default +--features diagnostics): clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.