Skip to content

refactor: rename every remaining pane name to the tumbling-window wording (#1163, part 2) - #1176

Merged
zzylol merged 4 commits into
mainfrom
refactor/1163-tumbling-window-rename-part2
Nov 2, 2026
Merged

zzylol merged 4 commits into
mainfrom
refactor/1163-tumbling-window-rename-part2

Conversation

@zzylol

@zzylol zzylol commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Part 2 of 2 for #1163; closes #1163. Part 1 (#1167) renamed the serialized names.

Why

#1163 decided that "pane", our own word, becomes "tumbling window", the standard stream-processing term, everywhere. After part 1, the operator and its fields carry the new names, but helper types, functions, files, test names, comments and docs still say "pane". This PR finishes the rename so the code reads one way, before #1160 adds the raw-data counterparts (RawDataTumblingWindowChain, RawDataMerge).

What

Every remaining "pane" name moves to the tumbling-window wording, with no behavior change:

Kind Before After
types PaneWidthDomain, PaneCandidate, PaneLayout, PaneCoverageError, PaneChainExpansion(Error), ExpandedPaneChain, SharedPaneChain, PaneWidthFrontier TumblingWindowWidthDomain, TumblingWindowCandidate, TumblingWindowLayout, TumblingWindowCoverageError, TumblingWindowChainExpansion(Error), ExpandedTumblingWindowChain, SharedTumblingWindowChain, TumblingWindowWidthFrontier
functions expand_pane_chains(_in_workload(_before)), kept_pane_chains, pane_candidates, panes_of, validate_pane_coverage, test_support::pane expand_tumbling_window_chains(…), kept_tumbling_window_chains, tumbling_window_candidates, tumbling_windows_of, validate_tumbling_window_coverage, test_support::tumbling_window
fields PlanningRoundReport.pane_width_domain, PlanningReport.pane_widths_pending, ingestion_pane_chains, pane_candidates, panes tumbling_window_width_domain, tumbling_window_widths_pending, ingestion_tumbling_window_chains, tumbling_window_candidates, tumbling_windows
modules and files asap_types::ir::operator::pane_chain; tests pane_chain.rs, kll_pane_execution.rs, tumbling_pane_merge.rs, stored_pane_memory_limit.rs; tools/benchmark_pane_search.py; docs/develop_docs/pane-search-compression-evaluation.md tumbling_window_chain; tumbling_window_chain.rs, kll_tumbling_window_execution.rs, tumbling_window_merge.rs, stored_tumbling_window_memory_limit.rs; tools/benchmark_tumbling_window_search.py; docs/develop_docs/tumbling-window-search-compression-evaluation.md
text "pane(s)", "pane chain", "tumbling pane" in comments, docs, test names, labels and messages "tumbling window(s)", "tumbling-window chain", "tumbling window"

Identifiers always say tumbling_window, never a bare window, which would collide with a query's own window. A few names became clearer instead: pane_window_ms → splittable_window_ms, has_pane_window → has_splittable_window, and test constants PANES / PANE_MS / PER_PANE → TUMBLING_WINDOW_COUNT / TUMBLING_WINDOW_WIDTH_MS / ROWS_PER_TUMBLING_WINDOW.

Kept on purpose:

  • The deployed wire contract. The code calls these the deployed wire contract, so only the Rust names change; tests check the wire strings.
    • TumblingWindowLayout reads and writes pane_width_ms / pane_origin_ms. Part 1 had switched the first to tumbling_window_width_ms; this PR goes back to the contract name and keeps the new one as an alias.
    • WindowEdgeCoverage::TumblingWindowAligned is "pane_aligned".
    • TumblingWindowCoverageError is ZeroPaneWidth, UnknownPaneOrigin and pane_phase_ms.
    • WindowEdgeCompatibility is "RequiresAlignedPanePhaseOrExactBoundaryResidual".
  • Recorded artifacts: paths, plan ids and archived results in development docs, the viewer's recorded example labels, and part 1's compatibility code.

How

A script renames tokens per language (Rust, JS, Python, Markdown and HTML):

  • identifier rules for code, including JS template-literal expressions, regex literals and Python f-string fields;
  • English rules for comments, docs and strings that contain spaces.

The result is reviewed by hand:

  • doubled words fixed ("tumbling-tumbling", "a tumbling window's window");
  • hyphenation of compound modifiers;
  • sentences that had contrasted panes with tumbling windows rewritten;
  • the viewer's labels kept readable.

Checked-in JSON is data, so the script did not rewrite it. Two exceptions:

  • the 17 snapshot files whose display and cost labels the code now writes differently;
  • one viewer example's three old report keys.

Key code interfaces added / modified

The renames in the table above; no signature or behavior changes. In tools/dag-viewer/stages.js, upgradeTumblingWindowNames now also renames pane_width_domain and pane_widths_pending in documents written before #1163.

The viewer's internal data fields are now camelCase (tumblingWindowOf, tumblingWindowIndex, tumblingWindows; node kind and CSS class tumblingWindow).

Usage

Planning is unchanged; names and text are what change:

cargo run -p asap-devtools --bin stage_pipeline -- --example planner-layering-1 --out run.json

The document's planning report reads "tumbling_window_width_domain" and "tumbling_window_widths_pending". Plan labels read Kll ×5 tumbling windows, and cost details read build … in 6 tumbling windows of 10000 ms …. A document written before #1163 still opens in the viewer with the same plan.

Major algorithm changes

None.

Snapshot changes

The 17 corpus and sketch-plan snapshots that contain chains change only in their labels: ×N panes → ×N tumbling windows, N × 1m panes → N × 1m tumbling windows, and in N panes of → in N tumbling windows of. No plan, cost or status changes.

The third commit fixes a problem part 1 left in 22 snapshots:

  • What broke: part 1 renamed pane_retention_ms → tumbling_window_retention_ms in place, but snapshots store keys sorted, so the renamed key belongs after proven_optimal. The nightly corpus-snapshots job on main would fail.
  • Fix: the 22 snapshots are regenerated with UPDATE_SNAPSHOTS=1. They equal the checked-in ones as JSON (22 of 22); only the key order changes.

Before this PR

The tumbling-window chain was SummaryTumblingWindowChain, but its helpers, files and docs said "pane".

After this PR

The code, tests, docs and viewer say "tumbling window" throughout. The only remaining "pane" names are the deployed wire strings above, part 1's compatibility aliases and upgrade, and recorded artifacts.

Other notes

Verification

  • cargo fmt --all -- --check and cargo check --workspace --all-targets: clean, except asap-frontend-metricsql's test target, which is broken on main (see above).
  • cargo test --workspace --no-fail-fast, without asap-frontend-metricsql: all pass, including the wire-contract tests (window_edge_names_preserve_wire_values, window_edge_compatibility_names_preserve_wire_values).
  • Viewer Node tests (stages, memo, enumeration): 44 pass, including a new check that expanded tumbling-window nodes carry the CSS class the viewer styles.
  • Viewer Python tests (python3 -m unittest test_viewer test_server): 117 pass.
  • Release corpus_snapshots with --include-ignored (the nightly job, not part of PR CI): the first run failed only on the key order described above. A rerun on the rebased head is in progress.
  • Rebased onto main at c83aa19. One conflict: main added #[ignore] to a test this PR renames.
  • An independent review found a CSS-class regression in the viewer, a historical doc and archived paths/ids rewritten by the script, 17 stale snapshots and wording problems. All are fixed in the second commit.

🤖 Generated with Claude Code

@zzylol zzylol added dag-viewer DAG export and visualization tooling ir Pre-ASAP or post-ASAP intermediate representation refactor labels Nov 2, 2026
@zzylol
zzylol force-pushed the refactor/1163-tumbling-window-rename-part2 branch from 545d4d6 to 1441384 Compare November 2, 2026 21:48
zzylol and others added 4 commits November 2, 2026 22:29
…ding (#1163, part 2)

Helper types, functions, modules, files, test names, comments and docs: Pane*
becomes TumblingWindow*, pane_* becomes tumbling_window_*, and the word
"pane" becomes "tumbling window" (e.g. PaneWidthDomain ->
TumblingWindowWidthDomain, pane_chain.rs -> tumbling_window_chain.rs,
expand_pane_chains -> expand_tumbling_window_chains). The planning report's
pane_width_domain and pane_widths_pending become tumbling_window_* too, and
the DAG viewer upgrades them in older documents.

The deployed wire contract keeps its names: TumblingWindowLayout still reads
and writes pane_width_ms and pane_origin_ms, WindowEdgeCoverage pane_aligned,
TumblingWindowCoverageError ZeroPaneWidth / UnknownPaneOrigin / pane_phase_ms,
and WindowEdgeCompatibility RequiresAlignedPanePhaseOrExactBoundaryResidual.
No behavior change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- viewer: expanded tumbling-window nodes keep one CSS class (tumblingWindow)
  that app.js styles, with a test; JS data fields are camelCase;
- historical docs, artifact paths and plan ids keep their recorded names;
- code names inside comments and labels keep identifier form;
- wording: doubled words, hyphenated compound modifiers, contrasted terms;
- snapshot labels updated to the new display and cost text;
- test constants name what they hold (TUMBLING_WINDOW_COUNT, ...);
- the coverage errors' wire names are tested; cargo fmt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on_ms rename

Part 1 renamed pane_retention_ms in the snapshot JSON in place; the snapshots
store keys sorted, so the renamed key now sorts after proven_optimal. The
regenerated snapshots equal the checked-in ones as JSON (22 of 22).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reruns the part 2 rename over the files main changed (#1174, #1178, #1180,
#1182) and reapplies the review's wording fixes there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzylol
zzylol force-pushed the refactor/1163-tumbling-window-rename-part2 branch from 1441384 to 0c1c8a7 Compare November 2, 2026 22:34
@zzylol
zzylol merged commit b8bb198 into main Nov 2, 2026
3 checks passed
zzylol added a commit that referenced this pull request Nov 2, 2026
…art 2) in the group MILP

#1176 renamed the remaining pane helpers (pane_candidates, kept_pane_chains,
panes_of, retained_panes, the pane test helper, ...); rename their uses in
the group MILP's code and tests.
zzylol added a commit that referenced this pull request Nov 2, 2026
… Stage 3's default search (#1095) (#1144)

* feat(plan-selection): group selection MILP over execution contexts behind ASAP_STAGE3_SEARCH=milp (#1095)

Step 1 of #1095's solving strategy: one MILP with a warm start. The
owner-model pieces from tag stage3-owner-milp-redesign are restored and
the owner/instance model is replaced by execution contexts: each query
evaluation, the ingestion pipeline I (NotMaterialized ingestion-time
candidates) and each shareable (materialized) candidate's own inputs.

- groups.rs (was owners.rs): RunKind, ResultSlot (group roots split by
  self-read depth; private nodes their own slot), execution contexts and
  their options; dominance, per-candidate usage and accuracy weights kept.
  Scan windows are costed at every union of the window kinds read within
  one context, as plan_cost prices them.
- milp/model.rs: p[ctx, c], x[m], a[q, m], rows 1-9, slot links for
  inputs over several result slots, order ranks within and across
  contexts, latency in scaled units.
- milp/cost_terms.rs: run terms (plain, producer-dependent, exact scan
  window sets), schedule-group rates, held memory, raw retention and
  pane retention levels.
- milp/warm_start.rs: each query's cheapest plan, then greedy sharing,
  costed exactly by the completion.
- milp/decode.rs: one node per (context, computed candidate) and per
  selected shareable candidate.
- asap-cost: a NotMaterialized ingestion-time node runs once per second
  for every consumer; a NotMaterialized node a materialized node computes
  is held until that node's slowest reader finishes.

The old engine stays the default.

* fix(plan-selection): a shareable candidate reads a scan at its own window; window-independent scans keep their usage per window (#1095)

* fix(plan-selection): adopt main's Stage 1 exports and cost_inputs name after rebasing onto the Stages 0–2 milestone (#1095)

* feat(plan-selection): selection MILP solved per independent part, LP gap diagnosis, tighter big-M bounds (#1095 §5 3a, §6.1) (#1155)

Each connected component of the selection MILP is solved alone and joined before the single decode, realization and plan_cost check. An lp-diagnosis feature (devtools only) attributes the LP gap by row and variable family. Two big-M bounds are tightened. No selected plan or cost changes.

* perf(plan-selection): keep accuracy builds across pair checks and queries (#1095 §8) (#1156)

Measured that candidates of one operator node never share an input context on the measured workloads (no same-timing pairs), so the §8 shared-input-context step has nothing to share. The 44 s build of rangeheavy-t8-t5 largest round was 96% accuracy checks; a candidate built outputs are now kept across pair checks and queries (except outputs built across a cycle of links), and duplicate exact stand-ins are skipped. Weights, excluded pairs, plans and costs unchanged; that round builds in 7.6 s.

* feat(plan-selection): one ingestion context per refresh window in the selection MILP (#1095) (#1157)

Brings feat/1095-stage3 (#1151 refresh groups and cost rule) into the prototype and drops its once-per-second ingestion hook. The MILP has one ingestion context I_r per refresh window (unbounded views alone), so a shared stateless ingestion node is charged once per refresh window, as asap-cost charges it. workload-01 costs 1.6% more: its old plan under-charged a scan read by chains of three refresh windows. Part of #1095.

* fix(plan-selection): use the tumbling-window names (#1163) in the group MILP after rebasing onto main

The group MILP commits were written before #1163 renamed PaneChain to
SummaryTumblingWindowChain and pane_width_ms / pane_count / newest_panes /
pane_retention_ms to their tumbling-window names; rename their uses, and
rustfmt the lines the rebase resolved.

* feat(plan-selection): the group MILP is Stage 3's default search (#1095 C6)

select_plan runs the group MILP unless ASAP_STAGE3_SEARCH=old. Inputs the
MILP does not price yet (cost models 2 and 3, or a measured operation cost
table without a frozen calibration factor) are an UnsupportedCostModel
error; there is no fallback to the old engine.

* fix(plan-selection): use the remaining tumbling-window names (#1163 part 2) in the group MILP

#1176 renamed the remaining pane helpers (pane_candidates, kept_pane_chains,
panes_of, retained_panes, the pane test helper, ...); rename their uses in
the group MILP's code and tests.
@zzylol
zzylol deleted the refactor/1163-tumbling-window-rename-part2 branch November 3, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dag-viewer DAG export and visualization tooling ir Pre-ASAP or post-ASAP intermediate representation refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename PaneChain to SummaryTumblingWindowChain, and every pane name to the tumbling-window wording

1 participant