GPU: a wait on memory that cannot be read yet holds its queue (#2604) #2693

Closed
github-bot wants to merge 1 commit from gh-pr/2693/head into gh-pr/2693/base
Owner

@⁠Calvix2k on GitHub · 2026-11-25 18:20 UTC · original
Calvix2k:codex/gpu-unreadable-wait → main · +50 −4 · 1 files · 1 commits · closed without merging

Fixes #2604.

ValueWait::holds returned None both for a comparison we do not know (counted by the caller, taken as holding) and for memory that cannot be read, which the doc comment says is taken as not holding. Held::pump therefore counted an unreadable value's wait as an unknown comparison and ran the segment at once, before the work that would write the value, and Held::blocked left it out of the unmet waits.

Unreadable memory now returns Some(false): the segment waits until the value reads (the 2 ms timer tests held work, and the 10 s safety valve still releases a wait nothing satisfies). None is left for a comparison we do not know, so the frame's unknown count says what it claims to and no longer includes waits that are merely early.

The test queues a wait on unmapped memory: nothing runs, no unknown is counted, and blocked lists it as not holding; once the memory maps, the segment runs. On the old code it runs at once and counts one unknown.

Tests: cargo test -p victory-gpu --lib --locked hold:: (11 passed), cargo clippy -p victory-gpu --all-targets clean.

**@⁠Calvix2k** on GitHub · 2026-11-25 18:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/2693) `Calvix2k:codex/gpu-unreadable-wait` → `main` · +50 −4 · 1 files · 1 commits · closed without merging Fixes #2604. `ValueWait::holds` returned `None` both for a comparison we do not know (counted by the caller, taken as holding) and for memory that cannot be read, which the doc comment says is taken as not holding. `Held::pump` therefore counted an unreadable value's wait as an unknown comparison and ran the segment at once, before the work that would write the value, and `Held::blocked` left it out of the unmet waits. Unreadable memory now returns `Some(false)`: the segment waits until the value reads (the 2 ms timer tests held work, and the 10 s safety valve still releases a wait nothing satisfies). `None` is left for a comparison we do not know, so the frame's unknown count says what it claims to and no longer includes waits that are merely early. The test queues a wait on unmapped memory: nothing runs, no unknown is counted, and `blocked` lists it as not holding; once the memory maps, the segment runs. On the old code it runs at once and counts one unknown. Tests: `cargo test -p victory-gpu --lib --locked hold::` (11 passed), `cargo clippy -p victory-gpu --all-targets` clean.
`ValueWait::holds` returned `None` both for a comparison we do not know
(counted by the caller, taken as holding) and for memory that cannot be
read, which the doc comment says is taken as not holding. `Held::pump`
therefore counted an unreadable value's wait as an unknown comparison and
ran the segment at once, before the work that would write the value, and
`Held::blocked` left it out of the unmet waits.

Unreadable memory now returns `Some(false)`: the segment waits until the
value reads (the 2 ms timer tests held work, and the 10 s safety valve
still releases a wait nothing satisfies). `None` is left for a comparison
we do not know, so the frame's unknown count says what it claims to.

The test queues a wait on unmapped memory: nothing runs and no unknown is
counted, `blocked` lists it; once the memory maps, the segment runs. On
the old code it runs at once and counts one unknown.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:12:12 +00:00
github-bot closed this pull request 2026-11-26 05:12:12 +00:00
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 18:34 UTC · original

Consolidating on #2605: it is earlier, green, and already has the ALWAYS case the review found missing here (an ALWAYS comparison does not depend on the value, so an unreadable address must not stall it). Its body also carries the same unreadable-holds-queue change and the regression coverage, so there is nothing here to keep. Closing in its favour.

**@⁠Calvix2k** on GitHub · 2026-11-25 18:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/2693#issuecomment-7171099223) Consolidating on #2605: it is earlier, green, and already has the `ALWAYS` case the review found missing here (an `ALWAYS` comparison does not depend on the value, so an unreadable address must not stall it). Its body also carries the same unreadable-holds-queue change and the regression coverage, so there is nothing here to keep. Closing in its favour.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2693
No description provided.