Conversation
A query that alone consumes its states may retain some and rebuild the others from raw series at query time, as #803 executes: raw inputs at t_q, each stored native batch at its newest complete window within the lag bound. Placement enumerates per query (at most 8 units) the assignments that retain at least one native branch (an ungrouped Sum or sketch over retained readouts, with its sources) and rebuild every other state. Each unit is priced with #804's model as it would run: retained as complete windows sliding at the evaluation interval, or rebuilt folding only its own selector's samples. The cheapest mix replaces the group decision only when priced and strictly cheaper; otherwise the group decision stands. The compiled plan types the mixed root with the series identity, installs each stored branch with a precompute program building its batch, and emits one physical program over raw Scans and ReadMaterialization inputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preserve group placement for unsupported or shared branch layouts, scale complete-window maintenance by overlap, and verify the selected stored window in the process oracle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #804.
Why
A query may be cheaper when one summary is retained and another is rebuilt from raw series. Group-only placement could not select that assignment, although the runtime supports bounded-lag mixed inputs.
What
Enumerate up to eight disjoint stored branches for queries whose states are not shared with other queries. Price complete-window retention, including overlapping source updates, against rebuilding each selector. Install the cheapest admissible mix only when it beats the group decision. Unsupported branch shapes, shared states, and native root candidates preserve the group decision.
Before this PR
sum(rate(a[1m])) + sum(rate(b[10m]))rebuilt both states in the priced fixture.After this PR
The query rebuilds
aat query time and reads the retainedbbranch's latest complete window within the lag bound. The response reports the observed lag; stale inputs take the existing exact fallback. Free-store and inadmissible fixtures retain their group placement.Validation
🤖 Generated with Claude Code