fix(gpu): treat unreadable memory in ValueWait::holds as not holding #3359
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3359"
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 reeledMarek on 2026-11-26T20:25:39Z.
Summary
ValueWait::holdsdocumented unreadable memory as not holding, but returnedNoneviaread(self.address, self.bytes)?—the same sentinel used for unknown D3D12 comparison functions.Held::pumptreatsNoneas an unknown comparison (incrementingdone.unknownand leavingok = true), so queues waiting on unreadable memory ran prematurely instead of staying held, andHeld::blockedomitted those waits because it filters forSome(false).Some(false)whenread(self.address, self.bytes)returnsNone, reservingNonestrictly for unknown comparison functions.comparisons_test_the_masked_valueand adds regression testunreadable_memory_holds_the_queue_without_counting_as_unknown.Verification
cargo clippy -p victory-gpu --all-targets --target x86_64-pc-windows-msvc --locked -- -D warningshold::testsunit tests directly (rustc --edition 2024 --test)cargo test -p xtask --lockedImported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T20:28:31Z.
Review: APPROVED
LGTM — verified on Windows against
origin/main(63bcca4).Some(false)instead ofNonewhenread(self.address, self.bytes)returnsNoneprevents unreadable wait memory from being treated as an unknown comparison (which previously released the waiting queue segment early).cargo test -p victory-gpu --lib hold:: -- --test-threads=1: 11 passed, 0 failed (includingunreadable_memory_holds_the_queue_without_counting_as_unknown).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).
Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T22:29:11Z.
Windows 11,
63bcca4+ this PR, Radeon RX 7900 XTX:hold::tests::unreadable_memory_holds_the_queue_without_counting_as_unknownby name: 1 passed.cargo test -p victory-gpu --lib: 232 passed / 0 failed / 1 ignored (unpatched63bcca4here: 231).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.Synthetic only. AI-assisted.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T23:39:51Z.
Review: APPROVED
Looks good — clean, targeted fix.
Checked
crates/victory-gpu/src/hold.rs:46-65together with its callers incrates/victory-gpu/src/queue.rs:191-246:!(NEVER..=ALWAYS)) are checked first and still returnNone(counted inPumped::unknownand treated as holding).Some(false)instead ofNone, soHeld::pumpkeeps the queue waiting without inflatingunknown,Held::blocked(hold.rs:213) surfaces the unmet wait consistently, andqueue.rs's 2 ms polling timer + 10 sVALVEsafety valve handle later mapping or stuck waits cleanly.Verification (
2d906514):cargo xtask policyandcargo clippy -p victory-gpu(default and--features diagnostics,--tests -- -D warnings): passed.hold::tests::(11/11): passed on both hardware GPU and WARP (--features diagnostics,VICTORY_D3D12_DEBUG=1).crate::host::read_intocoveringPAGE_NOACCESS,PAGE_GUARD,MEM_DECOMMIT, unmapped0x10000, and an 8-byte cross-page straddle acrossPAGE_READWRITE | PAGE_NOACCESS: all returnedSome(false)withunknown == 0and unblocked cleanly once recommitted and written.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.