feat(planner): price reuse of compatible window pane producers - #403
Merged
Conversation
3 tasks
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.
Why
Compatible temporal readouts can share a pane producer, but the backend needs a Planner-owned comparison of shared and independent producer costs.
What
Add
pane_sharing::select_shared_panes, which selects beneficial groups from executor-certified compatible pane implementations and supplied horizon costs.How
Group by the executor's complete compatibility key. Charge the longest-retained producer once and retain every consumer's read cost. Reject invalid or overflowing quotes and retain independent implementations when sharing has no benefit.
Before this PR
The optimizer has no costed physical-pane reuse decision for readouts with different lookback windows.
After this PR
A backend can bind
sum_over_time(a[1m]) / sum_over_time(a[10m])to one compatible pane producer while preserving both readout windows. Different sources or incompatible state contracts remain separate.Evidence
The unit fixture prices independent producers at 12 + 17 = 29; shared production costs 15 + 2 + 2 = 19 and retains the 600-second lookback. A distinct source is excluded.
Screenshots and performance measurements: not applicable; these are modeled costs, not measured speedups.
Verification
cargo +1.98.0 test -p asap-aware-mapping --lib pane_sharing --offline: 2 passed.git diff --checkpass.Architectural decisions
Planner owns the cost comparison; the executor supplies physical compatibility and cost evidence. Logical readout windows are not rewritten. This avoids a second optimizer in the backend compiler.
Limitations and follow-up
This reuses compatible selected panes; it does not enumerate all pane widths or jointly reconsider independently selected FullWindow layouts. Equal keys must certify equal unit costs, pane shape and source/state contracts.
Human review — do not complete with an agent