Compile actual finite multi-source maintenance plans - #668
Merged
Merged
Conversation
zzylol
marked this pull request as ready for review
September 11, 2026 19:13
This was referenced Sep 11, 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.
The actual selected query
quantile(0.9, sum_over_time(m[1m]) + sum_over_time(n[1m]))requires two installed source states and an explicit maintained arithmetic input. The compiler previously recognized only one direct finalized source.Collect every exact source frontier beneath supported MaintenanceTime arithmetic, install sources before the derived state, and construct DerivedInputIdentity from the actual DAG and all source bindings. Shared installation checks require raw sources, matching full nonoverlapping windows, explicit finalization, and arithmetic with Left/Right roles and no vector matching. Query binding uses the derived identity instead of requiring a single metric name.
Before: the actual two-source plan could not be installed and queried as maintained state. After: the real process compiles, installs, ingests both sources, closes finite input, and reads the selected derived DDSketch. Same-generation restart preserves its result; missing source and multiple source populations fail closed. The process also checks old derived state is unavailable after a generation change while new raw input is accepted.
Validation: 749 CP tests pass;
cargo check -p control_plane --all-targetspasses; real two-source process test passes in 3.74s using sketchlib c0de315754f9a6c77dd7a25aca0b2b62f0aec276. The actual selected family and parameters are retained; no forced winner or performance claim. Independent CP/shared source review passed. Final DP binary replay passes 1171/1171 with --test-threads=4 (15.42s), after correcting five empty-fixture provenance assertions. The initial unrestricted parallel run on four pinned CPUs timed out in one durable flush test; the unchanged test and final full replay pass with bounded concurrency.Scope: finite, full aligned nonoverlapping windows, one physical population per source with matching labels, supported scalar arithmetic. Continuous/sliding execution and arbitrary grouping are not enabled by this change. This PR depends on the timed binary and finite cohort runtime stack.