GPU: marks in the last dword of the written-pages bitmap are not discarded #2269
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!2269
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@denkencar-sketch on GitHub · 2026-11-25 09:28 UTC · original
denkencar-sketch:fix/shadow-001→main· +33 −11 · 1 files · 1 commits · openSummary
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.
@Marvisak on GitHub · 2026-11-25 12:42 UTC · original · edited 2026-11-26 01:25 UTC
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
@catminou4 on GitHub · 2026-11-25 09:35 UTC · original · reviewed
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.
@fuzeofficlal on GitHub · 2026-11-26 15:54 UTC · original · approved these changes
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.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.