Capture: avoid overflow in world-relative frame matching #3482
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!3482
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3482"
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?
@playcations on GitHub · 2026-11-27 07:31 UTC · original
playcations:fix/capture-world-offset-overflow→main· +32 −1 · 1 files · 1 commits · openA large accepted
VICTORY_CAPTURE_WORLDoffset can overflowanchor + offsetafter the world anchor is established: checked builds panic, while wrapping builds can match a frame before that anchor. Match the checked frame difference against the offsets so all representable targets, includingu64::MAX, keep their meaning.The change is limited to
capture.rs. Its pure tests avoid environment mutation and the process-globalOnceLocks; absolute frame selection and power-of-two captures retain their existing behavior.Validation:
-D warnings, the asset policy, andgit diff --checkpassed. Separate Sol source review found no material issue.Reproduce the three new CPU tests on Windows with
cargo test --locked -p victory-gpu --lib --features diagnostics -- capture::tests::world_frames_ --test-threads=1. Thediagnosticsfeature is required to compile the capture module.Claim: #1633. The broad fork in #2643 also changes this selector; its wrapping-subtraction variant retains the before-anchor case covered here. This patch preserves current main's capture contract.
AI-assisted with Codex GPT-6.1 Sol. Synthetic CPU tests only; no game data.
@andrewpozdnakov7-jpg on GitHub · 2026-11-27 08:48 UTC · original
Native Windows verification on
1a756dc. All 8 capture tests passed, including the 3 new world-offset cases.I also ran the frame selector from each revision in fresh Windows processes with synthetic draw counts. Both builds of the PR (overflow checks on and off) kept the absolute frame and power-of-two captures, anchored the first frame with 500 draws, and selected offsets 0 and 5 from that anchor. With
u64::MAXfirst in the offset list, main either panicked or selected the frame immediately before the anchor. The PR rejected that frame in both builds and still selectedu64::MAXwhen the target was representable.The selector fixture also covered unset world offsets and trace selection with PNG output disabled. It exercised frame selection on the CPU. AI-assisted with Codex.
@cloph-dsp on GitHub · 2026-11-27 09:05 UTC · original
Independent CPU-only verification of PR #3482 (
world-frame wrap).CARGO_TARGET_DIR(D:\Victory-Contrib\target-3482-verify),CARGO_BUILD_JOBS=2.1a756dcc9e9e40186d365376f4710b15f19efa6d, merge base63bcca43c6a00a758510398fa43096ce7e4f7df0.captureis gated#[cfg(all(windows, feature = "diagnostics"))];--features diagnosticsis required (the first run without it matched 0 tests).cargo test --locked -p victory-gpu --lib --features diagnostics -- capture::tests::world_frames_before_anchor_do_not_wrap --exact --test-threads=1 --quiet->1 passed; 0 failed; 249 filtered out.git grep -Ffor the new test name on63bcca4returned no hits (test absent on base).git diff --check 63bcca4 HEADexit 0 (clean).fetch_updatedeprecation warnings.@futurepro62 on GitHub · 2026-11-27 18:37 UTC · original
NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head
1a756dc(on its base63bcca4).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: 866 passed, 0 failed, 10 ignored.world_frames_match_zero_and_later_offsets_beside_maximum,world_frames_before_anchor_do_not_wrap,world_frames_keep_the_largest_representable_targetonly build with thediagnosticsfeature, so the run above doesn't include them; they pass incargo test -p victory-core -p victory-gpu -p victory-hle -p victory-loader -p victory-shader -p victory --lib --locked --features victory-core/diagnostics,victory-gpu/diagnostics,victory-hle/diagnostics,victory-loader/diagnostics,victory-shader/diagnostics,victory/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
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.