GPU: marks in the last dword of the written-pages bitmap are not discarded #2267
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2269"
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-25T09:28:51Z.
Summary
The written-pages bitmap's last dword took the marks of offsets past it by clearing the whole dword, which dropped the writes to the 31 pages before its last bit. Only the last bit is cleared now.
Testing
Test
marks_in_the_last_dword_are_read_but_the_sink_bit_is_notfails with the old clearing (= 0) and passes with this change.cargo test --workspace --lockedpasses apart from the 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-25T09:35:38Z.
Review: COMMENTED
Refactors copy_back_marks bitmap draining into drain_marks (clears bit 31 of the last word, returns marked offsets) with the same last-word fix as #2267 plus coverage. 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. Cleaner than #2267 and supersedes it; check the merge order.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T12:42:20Z.
Automated triage for the maintainers.
Merge candidate. Rebased cleanly.
copy_back_marksincrates/victory-gpu/src/shadow.rsused to zero the whole last dword of the written-pages bitmap, but only its top bit is the sink (lower.rscaps the mark index atVIEW_WRITE_BITS - 1), while the mark allocator hands out bits up toVIEW_WRITE_BITS - 2. So the 31 bits before the sink can belong to copies, and their writes were dropped. The newdrain_marksclears only the sink bit, andmarks_in_the_last_dword_are_read_but_the_sink_bit_is_notchecks exactly that. It only matters once the mark space is almost full, but the fix is right and small.CI: passing (
check).Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T15:54:36Z.
Review: APPROVED
Reviewed
356929dd893386ee753bb0ff9c9e36ab3e3ccb37(merged cleanly onto63bcca43c6a00a758510398fa43096ce7e4f7df0) and verified on Windows 11 with an NVIDIA GeForce RTX 5090, WARP, and D3D12 Debug Layer.Audit
crates/victory-gpu/src/shadow.rs:894,:896,:930:Marks::takeallocates bit runs strictly belowVIEW_WRITE_BITS(1 << 22), reserving only bitVIEW_WRITE_BITS - 1(bit 31 of the final dword) as the out-of-range sink. Replacingbits[words - 1] = 0with*last &= !(1 << 31)indrain_markspreserves all 31 valid copy bits (0..=30) in the final dword while still clearing the sink bit even whenend == 0.Verification
63bcca43c6a00a758510398fa43096ce7e4f7df0+cargo run -p xtask -- policy(191 files ok)cargo clippy -p victory-gpu --all-targets -- -D warnings(default &--all-features)victory-gpushadow::withVICTORY_D3D12_DEBUG=1: 11/11 passed on RTX 5090; 11/11 passed (--features diagnostics) on WARP (includingmarks_in_the_last_dword_are_read_but_the_sink_bit_is_not).drain_markscovering empty slices,end == 0(sink cleared), single-word bitmaps,end == 32/end == 33, and fullVIEW_WRITE_BITS - 1with all 32 bits set in the final dword.Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T22:11:29Z.
Review: APPROVED
LGTM — verified on RTX 5090 (Windows / D3D12) against
origin/main(63bcca4).cargo test -p victory-gpu --lib shadow:: -- --test-threads=1: all passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.