Skip to content

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

Closed
Calvix2k wants to merge 1 commit into
Marvisak:mainfrom
Calvix2k:codex/gpu-unreadable-wait
Closed

Calvix2k wants to merge 1 commit into
Marvisak:mainfrom
Calvix2k:codex/gpu-unreadable-wait

Conversation

@Calvix2k

Copy link
Copy Markdown
Contributor

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.

…ak#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.

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.

@necrobytes necrobytes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@Calvix2k

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GPU: a list waiting on memory that cannot be read yet runs at once and is counted as an unknown comparison

2 participants