Conversation
This was referenced Oct 4, 2026
Replace the two ignored Pattern B cost tests, which asserted B1 <= B2 for any workload, with invariants the cost model actually implies: - at 1M series, rebuilding the panes (B2) breaks the 200 ms latency bound; - when the deployment keeps raw data, B2 is cheaper whenever it is valid; - panes larger than the raw samples they cover (15 s sampling, 1-min panes) lose even when the deployment does not keep raw data; - panes smaller than their raw samples (1 s sampling, 10-min panes over 1 h) win when raw data is not kept, and the planner selects B1. run_stages_with plans with given deployment inputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
force-pushed
the
stack/509-y2-deployment-doc
branch
from
October 5, 2026 06:21
73ded2f to
c0f007f
Compare
zzylol
force-pushed
the
stack/509-q49-example4-invariants
branch
from
October 5, 2026 06:21
d28b006 to
a23ab1a
Compare
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.
Stack: Wave 3 chain: #605 → #607 → #608 → #609 → #610 → this PR
Rebased on main d4869a7 (DF 54).
Problem
Example 4's spec says B1 (tumbling KLL panes built at ingestion time) is never costlier than B2 (rebuild every pane from raw samples at each evaluation). The built-in model contradicts that for Pattern B, so both tests were
#[ignore]d:Q49 (a): write the tests as invariants that follow from the model, and add a workload where B1 actually wins.
What the model implies
B1 keeps one KLL per series per pane for as long as the window lasts. B2 keeps no state, but it reads the window's raw samples at every evaluation. It pays to retain those samples only when the deployment doesn't keep raw data (#609). So B1 wins only when its panes are smaller than the raw samples they cover, and keeping those samples would otherwise be charged to the plan. When raw data is kept, B1 wins only if B2 breaks the latency limit.
stage3_b_rebuilding_a_million_series_breaks_the_latency_boundstage3_b_kept_raw_data_makes_rebuilding_cheaperstage3_b_panes_larger_than_their_raw_data_losestage3_b_panes_smaller_than_their_raw_data_winThe tests check which option is cheaper, not the numbers. The numbers above are from the illustrative v2 calibration.
Changes
planner_layering_example4.rs: removes the two ignored testsstage3_b_rebuilding_every_window_costs_mostandstage3_b_prefers_ingestion_time_tumbling_windows, and adds the four tests above, apattern_b_variantworkload builder, andrun_with_raw_data.planner_layering_common: addsrun_stages_with, which plans with the given deployment inputs.run_stagescalls it with the executor's inputs.Test plan
cargo fmt --checkandcargo clippy -p asap-integration-tests --all-targets -D warningsare clean.cargo test -p asap-integration-tests: 209 passed, 0 failed.🤖 Generated with Claude Code