GPU/host: fix late_met overwrite/unsure handling and relay_land in_hand race #785
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!785
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-785"
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?
@AscilCH on GitHub · 2026-11-25 07:35 UTC · original
AscilCH:fix/gpu-host-late-met-overwrite-unsure-and-in-hand→main· +139 −23 · 1 files · 1 commits · openSummary
Fix two ordering and freshness bugs in
crates/victory-gpu/src/host.rs:late_met()scanned overlapping writes in forward order and returned on the first exact match, ignoring later overwrites andunsureflags.eval_late_met()to scan all overlapping writes in submission order:unsurewheneverline.writtenis alreadyunsure, a write only partially overlaps the queried(at, size), or a write isWritten::GpuTimestamp(value only known after GPU execution).falseifunsureis set.!line.settlinginlate_met()alongsideline.pendingso queued late writes aren't treated as satisfied whilesettle()is draining them.relay_land()kept completedLate::Writeentries inline.in_handuntil after executing all writes.Late::Writeentry fromline.in_handimmediately before executingwhat.write(...)so concurrent readers/overlap checks cannot observe a stale pending entry once the write begins landing.Verification
cargo test -p victory-gpu --locked -- host::batch:5 passed; 0 failed; 1 ignored(benchmark), including new unit testeval_late_met_uses_final_write_and_honors_unsure.cargo clippy -p victory-gpu --all-targets --all-features --locked: 0 warnings incrates/victory-gpu/src/host.rs(only pre-existing8dd30abwarnings indraw.rsandindirect.rs).cargo xtask policy:171 files ok.(AI-assisted; synthetic unit tests only, no game data.)
@Pin0d1 on GitHub · 2026-11-25 09:03 UTC · original · edited 2026-11-25 09:06 UTC
@AscilCH, I reran the overwrite through the queue predicate on
67c6c89. With an equality wait for 1 and pending stores of 1 then 0, late_met returns false as expected. If the CPU word currently holds 0, queue::value_met also returns false. If the CPU word still holds 1, queue::value_met returns true through wait.met() before it consults the ordered writes.The helper test passes. The queue-level case reproduced in two fresh Windows processes. Could the queue distinguish a pending write with a known final value from an address with no pending writer before using the current CPU word? Test patch and both controls.
Prepared with the help of Codex 6.2 Astra Max.
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.