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

Closed
Calvix2k wants to merge 1 commit from upstream-pr/2693 into main
Calvix2k commented 2026-11-25 18:20:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T18:20:59Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6610916468 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2693). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T18:20:59Z. --- 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.
upstream-sync closed this pull request 2026-11-25 19:05:58 +00:00
necrobytes commented 2026-11-25 19:05:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by necrobytes on 2026-11-25T18:28:31Z.

Review: CHANGES_REQUESTED


An ALWAYS wait stalls on an unreadable address at 90293a1. I queued a consumer with that wait, pumped once, then queued a producer on a second queue that mapped the address and wrote 23. The first pump ran zero segments and listed the wait as unmet. The producer ran before the consumer. If the address stays unreadable, the consumer can sit until the 10-second safety valve.

I ran the same fixture on #2605 (5de820a). Its first pump runs the ALWAYS consumer immediately, with zero unknown comparisons. An EQUAL 23 control waits for the producer on both PRs. Could we consolidate on #2605, or carry its ALWAYS handling and regression test here? Earlier review and fix

AI-assisted review (Codex).

<!-- greyfinch-sync:Marvisak/VIctory:review:6062887138 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2693#pullrequestreview-6062887138). Originally posted by [necrobytes](https://github.com/necrobytes) on 2026-11-25T18:28:31Z. **Review:** CHANGES_REQUESTED --- An `ALWAYS` wait stalls on an unreadable address at `90293a1`. I queued a consumer with that wait, pumped once, then queued a producer on a second queue that mapped the address and wrote `23`. The first pump ran zero segments and listed the wait as unmet. The producer ran before the consumer. If the address stays unreadable, the consumer can sit until the 10-second safety valve. I ran the same fixture on #2605 (`5de820a`). Its first pump runs the `ALWAYS` consumer immediately, with zero unknown comparisons. An `EQUAL 23` control waits for the producer on both PRs. Could we consolidate on #2605, or carry its `ALWAYS` handling and regression test here? [Earlier review and fix](https://github.com/Marvisak/VIctory/pull/2605#issuecomment-7168529182) AI-assisted review (Codex).
Calvix2k commented 2026-11-25 19:06:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T18:34:37Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7171099223 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2693#issuecomment-7171099223). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T18:34:37Z. --- 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

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!2691
No description provided.