Skip to content

Commit cf3fc26

Browse files
zzylolclaude
andcommitted
refactor(ir): rename summary_update to summary_input_data
It reads the producing SummaryAgg's update expression and reduction; it does not update the summary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 8caceed commit cf3fc26

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

‎crates/types/src/ir/asap.rs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,12 @@ impl ASAPOp {
489489
}
490490
// Equal schemas do not prove the states summarize the same
491491
// expression with the same grouping; the producers do.
492-
let update = first.summary_update();
493-
if update.is_none() || children.iter().any(|c| c.summary_update() != update) {
492+
let input_data = first.summary_input_data();
493+
if input_data.is_none()
494+
|| children
495+
.iter()
496+
.any(|c| c.summary_input_data() != input_data)
497+
{
494498
return Err(SchemaDerivationError::InvalidScalarSignature(
495499
"summary merge inputs must share update expression and reduction".into(),
496500
));

‎crates/types/src/ir/node.rs‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,20 @@ impl OperatorNode {
161161
Ok(self)
162162
}
163163

164-
/// What a summary state was built from: the update expression (`input`)
165-
/// and grouping (`reduction`) of the `SummaryAgg` that produced it. For a
164+
/// What a summary state summarizes from each row: the update expression
165+
/// fed into the state (`input`, e.g. the `latency` column) and the
166+
/// grouping (`reduction`, e.g. by `job`) of the `SummaryAgg` that produced
167+
/// it. Which rows were included is `coverage`, not this. For a
166168
/// `SummaryMerge` these are its first input's, which merge validation
167-
/// requires every input to share. `None` for any other node. Merging
168-
/// compares it so that all inputs summarize the same expression with the
169-
/// same grouping.
170-
pub fn summary_update(&self) -> Option<(&SummaryUpdate, &Reduction)> {
169+
/// requires every input to share. `None` for any other node. Equal schemas
170+
/// cannot tell a KLL over `latency` from one over `size`; merging compares
171+
/// this instead.
172+
pub fn summary_input_data(&self) -> Option<(&SummaryUpdate, &Reduction)> {
171173
match self.asap()? {
172174
ASAPOp::SummaryAgg {
173175
input, reduction, ..
174176
} => Some((input, reduction)),
175-
ASAPOp::SummaryMerge { children } => children.first()?.summary_update(),
177+
ASAPOp::SummaryMerge { children } => children.first()?.summary_input_data(),
176178
_ => None,
177179
}
178180
}

0 commit comments

Comments
 (0)