Conversation
Placement needs the window implementation compilation would install for a retained state. Extract the per-state query narrowing from the install loop and the cheapest-window rule from the complete-candidate estimate so both paths use one definition. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Placement priced retention from window / evaluation interval, priced a shared state with its first consumer's unit costs as one install, and priced Ephemeral as a state rebuild per read that ignored the raw samples the query-time program actually reads. - Retention charges the panes the window implementation compilation would install keeps (retained_state_count of the chosen layout). - Consumers share one priced install only when compilation groups them (same layout, cadence and phase); each install uses its own consumers' demand and unit costs. - Ephemeral adds, per evaluation, the fold of every raw sample the program's Scans cover at the per-update cost. - States linked through a query move to query time together, decided on the group's summed costs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
changed the base branch from
fix/topk-by-heap-groups
to
feat/bounded-lag-mixed-inputs
September 30, 2026 13:04
zzylol
force-pushed
the
feat/placement-pricing
branch
from
September 30, 2026 13:04
603b10f to
ea98dc0
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.
Stacked on #803.
Why
#794 prices each summary state's lifecycle, but three inputs were proxies. Pane counts came from the evaluation interval, not from the window layout that gets installed. A shared state used its first consumer's unit costs and was priced as one install. Ephemeral was priced as one state rebuild per read, which ignored the raw samples the query-time program actually reads.
What
retained_state_countof the window implementation that compilation would install for the state. It reuses the install loop's per-state window narrowing (state_query) and the cost model's window choice (cheapest_window_implementation), both extracted in a no-behaviour-change refactor commit.maintenance_per_update).retained_states.Before this PR
Fixture
quantile_over_time(0.99, m[1m]), evaluated every 10 s over a 300 s horizon (installs 10 s panes, 7 retained):After this PR
num_aggregates_to_retain.Behaviour differences
time_native_candidate) still estimates panes, because its windows are prepared after its timing is chosen.Validation
cargo fmt --all -- --check,cargo clippy --workspace --all-targets --locked -- -D warnings: clean.cargo test --workspace --locked --libandcargo test -p control_plane --locked --tests: pass.cargo test -p data_plane --locked --test asapquery_compatibility_process_e2e -- --test-threads=1: 28/28 pass.control_plane/tests/lifecycle_placement.rs:retention_prices_the_installed_window_panes,ephemeral_cost_is_the_raw_program_over_its_scanned_samplesandshared_state_combines_every_consumers_demand_and_costsfailed on the feat: place summary state by backend-priced lifecycle choice #794 code and pass now.store_price_flips_placement_at_the_break_even_pricepins the new threshold.out_of_phase_consumers_are_priced_as_separate_installswas added after review.🤖 Generated with Claude Code