From a5aad9d2137bb5de1ee0115e8f643332f804657b Mon Sep 17 00:00:00 2001 From: Samuel Galanakis Date: Sat, 25 Jul 2026 12:13:52 +0200 Subject: [PATCH] Assert attachment survival independently of item position The turn-input ingress perf measurement asserted the inline attachment was the last materialized item. A claim aggregates many enqueued inputs and only the first carries an attachment, so the attachment sits mid-list and the check could never pass. It has failed every nightly since it was introduced, leaving the runtime performance budgets ungated. Assert that the attachment survives the claim/materialize round trip rather than where it lands. Release-Notes: Internal: Fixed a turn-input ingress performance assertion that checked attachment position instead of survival, which had left nightly runtime performance budgets ungated. --- .../runtime_perf/measurement/queued_work.rs | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/crates/lash-perf/src/runtime_perf/measurement/queued_work.rs b/crates/lash-perf/src/runtime_perf/measurement/queued_work.rs index a8d385ae..86ac2fc0 100644 --- a/crates/lash-perf/src/runtime_perf/measurement/queued_work.rs +++ b/crates/lash-perf/src/runtime_perf/measurement/queued_work.rs @@ -641,12 +641,17 @@ async fn run_once_turn_input_ingress_interrupt( ); } let active_turn_input = active_claim.materialize_for_turn(); - if !matches!( - active_turn_input.items.last(), - Some(lash_core::InputItem::Attachment { - source: lash_core::AttachmentSource::Inline { bytes, .. } - }) if bytes == &vec![1, 2, 3, turn_index as u8] - ) { + // Position-independent on purpose: a claim aggregates many inputs and + // only the first carries the attachment, so the attachment is not the + // last item. Assert survival, not placement. + if !active_turn_input.items.iter().any(|item| { + matches!( + item, + lash_core::InputItem::Attachment { + source: lash_core::AttachmentSource::Inline { bytes, .. } + } if bytes == &vec![1, 2, 3, turn_index as u8] + ) + }) { anyhow::bail!("turn-input ingress active claim lost attachment bytes"); } @@ -727,12 +732,15 @@ async fn run_once_turn_input_ingress_interrupt( phase_profile.insert(phase.0, phase.1); next_claims += 1; let next_turn_input = next_claim.materialize_for_turn(); - if !matches!( - next_turn_input.items.last(), - Some(lash_core::InputItem::Attachment { - source: lash_core::AttachmentSource::Inline { bytes, .. } - }) if bytes == &vec![4, 5, 6, turn_index as u8] - ) { + // Position-independent: see the active-claim assertion above. + if !next_turn_input.items.iter().any(|item| { + matches!( + item, + lash_core::InputItem::Attachment { + source: lash_core::AttachmentSource::Inline { bytes, .. } + } if bytes == &vec![4, 5, 6, turn_index as u8] + ) + }) { anyhow::bail!("turn-input ingress next claim lost attachment bytes"); }