GPU: handle empty and inverted ranges in watch::writes, writing, and title_memory_remapped #1332
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!1332
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1332/head"
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?
@mgunes1311-lab on GitHub · 2026-11-24 17:30 UTC · original
mgunes1311-lab:gpu-watch-empty-ranges→main· +76 −7 · 1 files · 1 commits · closed without mergingFixes guard corruption and integer underflow on empty, unaligned-empty, and inverted byte/address ranges in
crates/victory-gpu/src/watch.rs:Changes
len == 0inwritingandtitle_memory_remapped: an unaligned empty range previously rounded to a nonempty block range.writingunnecessarily opened and dirtied that block.title_memory_remappedcould remove its protection bookkeeping while the OS mapping remained read-only, so the next write fault was no longer recognized byon_write.falseinopenwhenstart >= endsoBTreeSet::rangecannot panic on inverted bounds.Some((j.asked, Vec::new()))inwriteswhenstart >= end(avoidinglast - firstunderflow orGetWriteWatch(..., size = 0)failure), and uselast.saturating_mul(PAGE)when delegating toguard.empty_and_inverted_ranges_do_not_corrupt_guards_or_underflow.Verification
cargo test -p victory-gpu --target x86_64-pc-windows-msvc --locked watch::(4 passed; 0 failed)cargo clippy --workspace --all-targets --target x86_64-pc-windows-msvc --locked -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --target x86_64-pc-windows-msvc --lockedcargo run -p xtask --target x86_64-pc-windows-msvc --locked -- policy --staged(asset policy: 1 files ok)@Marvisak on GitHub · 2026-11-25 00:37 UTC · original
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.Guards the old watch::writes and open against empty and inverted ranges; both are gone, and in main an empty range at worst marks one page changed.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed