GPU: a copy footprint whose sizes overflow spans no bytes #2302
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2304"
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 Marvisak/VIctory. Originally posted by denkencar-sketch on 2026-11-25T10:05:48Z.
Summary
PlacedFootprint::bytesmultiplied the title's pitch, height and depth unchecked: a panic in checked builds, a small wrapped size in release. A footprint whose sizes overflow now spans no bytes.Testing
Test
footprints_that_overflow_span_no_bytesfails onmainand passes with this change.cargo test --workspace --lockedpasses apart from known flakes:modules::dstorage::tests::a_page_list_filled_after_its_request_startsfails now and then onmaintoo, and so does a parallel-run flake invictory-gpu's lib tests (watch::anddescriptor::host::tests, 2 of 40 runs on pristinemain).Not tried: a run in the game.
AI-assisted.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T10:19:20Z.
Review: COMMENTED
PlacedFootprint::bytes uses checked_mul — overflowing title numbers span no bytes instead of wrapping. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T10:21:58Z.
Review: APPROVED
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:checked_mul/checked_addinPlacedFootprint::bytescleanly turns overflowing title footprints intoNoneinstead of wrapping/panicking.cargo test -p victory-gpu resource::tests: 11/11 passed on RTX 5090, 11/11 passed on WARP (includingfootprints_that_overflow_span_no_bytes).cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:21:36Z.
Automated triage for the maintainers.
Proposed close.
PlacedFootprint::bytesincrates/victory-gpu/src/resource.rscan only overflow inrow_pitch * (lines - 1), which needs a footprint describing a buffer larger than 2^64 bytes; no real copy footprint does. Its only caller, the footprint branch of the copy path inlist.rs(around line 534), already passes the result throughbuffer_range, so a wrapped value is rejected there anyway. The test covers only made-upu32::MAXsizes. A real footprint that overflows here would change the verdict. (Side note: the test module now has a test function betweenuse super::PlacedFootprint;anduse super::*;, and the first import is redundant.)This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by denkencar-sketch on 2026-11-25T23:12:07Z.
Closing per triage: overflowing \PlacedFootprint::bytes\ requires a >2^64-byte footprint and the caller already rejects wrapped values via \uffer_range.
Pull request closed