GPU watch: ignore zero-length writes and remaps on unaligned addresses (#2011) #2966
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!2966
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2966"
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?
@Dukestar69 on GitHub · 2026-11-26 01:44 UTC · original
Dukestar69:fix/watch-empty-ranges→main· +34 −0 · 1 files · 1 commits · openSummary
Short-circuit zero-length (
len == 0) ranges inwatch::writing,Drop for Writing, andwatch::title_memory_remappedso unaligned zero-byte writes and empty remaps do not mark pages dirty or unlink live aliases (credit to @tyr0nsur & @matheusfrta for identifying #2011).Fixes #2011.
Testing
unaligned_zero_length_writes_and_remaps_do_not_dirty_or_unlinkincrates/victory-gpu/src/watch.rs.cargo test -p victory-gpu watch::tests: 16/16 passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 192 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@Marvisak on GitHub · 2026-11-26 05:29 UTC · original
Automated triage for the maintainers.
This fixes #2011 in
crates/victory-gpu/src/watch.rs. With a zero length and an unaligned start,writingandtitle_memory_remappedround to a one-page range. That range marks a clean page and its alias dirty, or unlinks a live alias on an empty remap. The fix returns early forlen == 0, andDrop for Writingskips the empty range. A non-empty range always hasfirst < last, so real writes are unaffected. Zero lengths can happen in practice:writingtakes the title'sfreadsize times count, and the callers inshadow.rs/list.rspass computed lengths. The new test checks the empty write while the guard lives and after it drops, the empty remap, and that a real one-byte write still reaches the alias. No other open PR fixes #2011. CI: not run on this head yet.Verdict: merge candidate. Recommending a look, not approving.
Generated by Claude Code
@cloph-dsp on GitHub · 2026-11-26 08:50 UTC · original
Independent local verification of head
b6b6338on Windows 11, Rust 1.100.0/MSVC:cargo test --locked -p victory-gpu --lib watch::tests::unaligned_zero_length_writes_and_remaps_do_not_dirty_or_unlink— 1 passed, 0 failed.git diff --check origin/main HEAD— clean.CPU-only synthetic test; no game assets, GPU-specific hardware or DRM material used. AI-assisted (Hy4 flash).
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.