encoder_fold: the race test waits for the check's failure to be noted, not for its call

a_check_that_fails_a_submission_before_its_group_is_split_keeps_it_failed
let the commit's encodings again go once the check closure signalled from
inside its call. The scheduler notes the failure (State::fail_submission,
which marks the encoders unrunnable) only after the closure returns, so the
encodings again could build their units and splice the blit's in between:
the full lavapipe runtime suite at the render fold's tip (m3-max-29520)
counted 4 encoded again against 3. The blit still ran nothing there (the
failure, noted after the splice, cleared its part), so this is the test's
race, not the product's.

The test now holds the turn until the command buffer's failure is noted
(failure_noted, a test-only reading of State::failure, set under the state
lock after the encoders are marked), then lets the encodings again go.

Verified (msi lavapipe): encoder_fold 22/22; clippy 0 (--cfg m2v_cpu_icd and plain); control
m3-max-29567 (unrunnable marks removed) fails the test (4 vs 3).
This commit is contained in:
Anees Iqbal committed 2026-11-14 08:56:54 -08:00
1 parent 1a44a6d198
commit ca5042567b
2 files changed
+20 -13

No files matched your search

@@ -893,4 +893,10 @@ impl CommandBuffer {
pub(crate) fn hold_reencoding(&self) -> std::sync::MutexGuard<'_, ()> {
lock(&self.0.reencoding)
}
/// Whether a failure of it is noted (`State::failure`): a check's, once
/// `State::fail_submission` marked the encoders it failed. A test's.
pub(crate) fn failure_noted(&self) -> bool {
lock(&self.0.state).failure.is_some()
}
}