Fix bitmap mark clearing in copy_back_marks #2265
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2267"
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 Kholoso on 2026-11-25T09:24:16Z.
## Problem
In
copy_back_marks, the last bitmap word is currently cleared entirely:However, the last bit is reserved as an overflow sentinel, while the preceding 31 bits may still contain valid marks.
Clearing the entire word could discard valid GPU write marks, preventing the corresponding memory from being copied back.
## Proposed fix
Clear only the overflow sentinel bit while preserving the remaining bits:
## Testing
Not tested yet. This change is based on code inspection and should be validated with a test covering valid marks in the last bitmap word.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T09:35:37Z.
Review: COMMENTED
One-line fix: copy_back_marks no longer zeroes the whole last bitmap word, only bit 31 (marks past the bitmap land there, no copy owns it). 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. Correct minimal fix — but #2269 refactors the same code into drain_marks with the same correction plus tests; whichever lands second should reconcile (likely #2269 supersedes this).
Imported from Marvisak/VIctory. Originally posted by welisonzika14-jpg on 2026-11-25T12:00:07Z.
First run on NVIDIA hardware here, as far as I can see (the reviews above are static or WARP). RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC, no game files. Head
9ad90famerged ontomain940d32f,cargo test -p victory-gpu -p victory-shader --lib --no-fail-fast.The PR adds no test, so this only shows it breaks nothing here. The rest is the same as
mainon this card: the 5 known NVIDIA failures from #1744 (2 view heap cap tests invictory-gpu, 3 invictory-shader), nothing new.One run, unit tests only, title not run.
Written with AI help (Claude/Kiro); the numbers are from runs on my machine.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T12:42:26Z.
Automated triage for the maintainers.
Proposed close: duplicate of #2269. Both PRs make the same fix in
copy_back_marks(crates/victory-gpu/src/shadow.rs): clear only the sink bit 31 of the bitmap's last dword, not the whole dword. The fix is right. #2269 also factors the drain intodrain_marksand adds a test for the last-dword case (marks_in_the_last_dword_are_read_but_the_sink_bit_is_not). Both merge cleanly. #2269 is marked as a merge candidate.This PR will be closed in 48 hours unless you push a change or a maintainer removes the
triage: proposed closelabel. Thanks for finding it.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Kholoso on 2026-11-25T13:16:31Z.
Thanks for the review! I agree that #2269 supersedes this PR. Closing this one to avoid duplicate work.
Glad the fix was useful!
Pull request closed