Skip to content

feat(planner): price reuse of compatible window pane producers - #403

Merged
zzylol merged 1 commit into
mainfrom
fix/shared-window-panes
Sep 12, 2026
Merged

feat(planner): price reuse of compatible window pane producers#403
zzylol merged 1 commit into
mainfrom
fix/shared-window-panes

Conversation

@zzylol

@zzylol zzylol commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

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

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

  • The MVP boundary is correct.
  • New conceptual layers or public interfaces are necessary.
  • The before/after description matches the intended product behavior.
  • Human reviewer:
  • Decision and rationale:

@zzylol
zzylol merged commit 80ffb06 into main Sep 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant