Skip to content

Compress pane candidate search and progressively expand legal widths - #936

Merged
zzylol merged 13 commits into
feat/joint-execution-demandfrom
feat/pane-search-compression
Oct 25, 2026
Merged

zzylol merged 13 commits into
feat/joint-execution-demandfrom
feat/pane-search-compression

Conversation

@zzylol

@zzylol zzylol commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Merged through #934 into main at 7bbade2. The main commit has the identical Git tree as CI-validated d379c4e. Retains the single CandidateConnections production engine.

Before this PR

Dense pane workloads repeatedly compute and store compatible supplier lists. Complete width generation can consume the planning budget before useful larger models are solved. Equivalent terminal readers duplicate candidate bindings.

After this PR

Memoize exact compatibility, share identical supplier-list storage, and factor contract-equivalent terminal unary readers while preserving independent output bindings. Progressively expose legal widths under one budget and retain the best validated plan. Queries without pane-eligible windows go directly to one complete-domain search. Incomplete domains never claim a global optimum or bound.

Verified effect on the final executable

Three sequential before/after repetitions per workload, alternating order, with the same 30-second budget and input fingerprints. These are development-build measurements of the whole process. All 24 performance runs pass accuracy-contract, coverage, finite-cost, and certificate checks; every selected modeled cost equals its baseline.

Workload Median wall seconds, before → after Median peak RSS MiB, before → after RSS reduction Median peak MILP variables, before → after
mixed 35.96 → 30.68 504.6 → 205.4 59.3% 159,153 → 55,501
long mixed 33.22 → 31.72 411.0 → 201.4 51.0% 159,153 → 55,501
rangeheavy t8/t5 33.69 → 30.07 442.9 → 332.5 24.9% 44,034 → 111,171
rangeheavy 15m/1h 32.73 → 30.10 927.5 → 452.8 51.2% 390,981 → 198,129

These are bounded-search results across different reached domains, not a complete-domain compression proof. One case solves a larger intermediate model while using less memory. Supplier-list storage sharing alone does not remove MILP connection decisions. Three repetitions show observed variability, not statistical significance; execution cost remains a model estimate.

The same final executable passes 30/30 ASAPQuery workloads (270 query requirements) and 9/9 viewer workloads (40 requirements). All 30 ASAPQuery modeled costs equal the archived baseline; all nine viewer costs equal their earlier accepted runs. Final SQL regression validation restores one shared KLL at exactly baseline cost, proving optimality in 58 evaluations.

Final executable source: fe171f6; SHA-256: a3234d62d2a6717e3772aba240959f6a224a4e1e031fe9cba27854079f8622f2. Repeated samples, input hashes and complete plan artifacts are under /mydata/pane-compression-validation/final-effect/. The repository evaluation report documents reproduction and earlier measurements.

Key code interfaces added / modified

  • SupplierCandidates, CompatibilityMemo, terminal-reader factoring, output execution scopes.
  • PaneWidthFrontier and incremental window-expression generation.
  • CandidateConnectionReport: width progress, supplier storage, inventory provenance and preserved diagnostics.
  • tools/benchmark_pane_search.py and the evaluation report.

Major algorithm changes

Intern exact supplier sets; factor only equivalent terminal unary readers; expand nested legal width domains under a shared budget. Preserve independent bindings, full-domain certificate semantics and cross-round plan/cost/accuracy identities. Internal readers and pane merges are not factored. Output-assignment options can still grow quadratically; the fixed-catalog test proves affine producer-connection growth, not a general polynomial search bound.

Validation

  • Final selector 317/317, joint equivalence 14/14, workspace doctests 9/9, Python 102/102, JavaScript 14/14, and PromQL-only 64 passed / 2 existing ignored.
  • Public API-only and PromQL-only compilation checks; strict clippy.
  • Final code CI passed on d379c4e, including workspace, PromQL-only, viewer and external-dependency checks: https://github.com/ProjectASAP/ASAPPlanner/actions/runs/40166798348.
  • Independent review and tiny binding/cost oracles cover factoring. Three regressions found by full testing were fixed: a time-dependent growth assertion, window-free search restarts, and lost early accuracy diagnostics. Original SQL sharing and DDS accuracy-rejection assertions remain unchanged and pass.

No new sketch/window algorithm or general cost-based DP is introduced.

Rollup-heavy follow-up verification

Three sequential before/after repetitions of memo-rollupheavy-t11-service-endpoint-5m, same 30-second budget and final executable:

Median metric Before After Change
Whole-process seconds 34.31 30.18 -12.0%
Peak RSS MiB 1722.5 470.1 -72.7%
Peak MILP variables 866,898 188,946 -78.2%
Modeled cost/second 4.459587090971773e-6 4.459587090971773e-6 unchanged

All six runs accept both queries with enforced accuracy. All selected DAGs share one Scan node but use two separate exact COUNT(DISTINCT) aggregates (service versus service/endpoint); none selects a cross-group rollup. Thus this measures reduced planning overhead on a rollup-heavy workload, not reduced execution cost from rollup. Pending widths remain, so different reached domains and lack of a global optimum certificate still apply. Artifacts: /mydata/pane-compression-validation/rollup-effect/.

@zzylol
zzylol marked this pull request as ready for review October 25, 2026 05:47
@zzylol
zzylol merged commit a69ea1a into feat/joint-execution-demand Oct 25, 2026
4 checks passed
zzylol added a commit that referenced this pull request Oct 25, 2026
* refactor: share execution demand accounting with joint candidate planning

* refactor: evaluate summary materialization for selected readers

* feat: select physical configurations with validated cost refinement

* fix: charge request overhead for literal queries and CPU capacity

* feat: report candidate model, solve, and validation metrics

* feat: expose candidate-connection planning with scoped search reports

* refactor: move shared candidate evaluation out of legacy search

* fix: exclude unavailable query-time raw scans before candidate search

* feat: reuse local pane rules in candidate planning and report generation time

* fix: assign visible IDs to validated joint plans

* fix: preserve ranked-row contracts when lowering fused and top-k candidates

* feat: share concrete pane states and seed joint search with validated contracts

* docs: record capability parity gates and ASAPQuery workload measurements

* feat: share pane states across compatible scan-label projections

* feat: migrate certified query accuracy pruning to candidate search

* feat: add certified ingestion cost bounds to candidate selection

* docs: measure migrated sharing pruning and ingestion bounds

* docs: require scope-based module organization at planner cutover

* fix: retain feasible solver proposals without overstating cost bounds

* docs: identify mixed responsibilities for final module cleanup

* feat: expand shared state capacities and pane horizons in logical memo

* feat: restore shared non-summary query materialization

* feat: reuse conservative per-query pruning before memo expansion

* feat: complete joint candidate sharing and objective selection

* feat: replace legacy planning with bounded candidate-connection search

* fix: reject unexecutable raw window candidates before pane expansion

* fix: preserve physical contracts and feasible workload plans

* perf: refine seed materialization with bounded MILP proposals

* test: enforce raw-source seed legality under both accuracy policies

* fix(planner): bound compilation and validate pane edges linearly

* refactor(planner): remove retired Cartesian workload enumeration

* test(planner): verify explicit rules independently of search archives

* fix(planner): preserve small-cost distinctions in MILP scaling

* test: migrate planner examples to explicit rule fixtures

* fix(cost): reject overflowing physical state configurations

* Make disjoint pane coverage union scale with sorted intervals

* test(planner): validate sharing rewrites and selected pane coverage

* fix(accuracy): gate interpolated DDS quantiles on source domain

* test(planner): make signed DDS and compile rejection fixtures explicit

* test(planner): compare facade plans independently of search timings

* Honor planning deadlines while flattening and exporting physical DAGs

* fix(planner): retain budget reports without a feasible incumbent

* fix(planner): seed composed DDS budgets before query validation

* test: pin valid DDS and pane fixtures independently of plan ranking

* docs: record validated joint planner workload results and limits

* docs(planner): describe the active candidate connection search

* test(planner): make composed summary rejection fixtures deterministic

* fix(viewer): display current candidate-connection search reports

* docs: record complete regression and viewer coverage

* Compress pane candidate search and progressively expand legal widths (#936)

* Expand pane width search progressively within the global budget

* Share compatible supplier storage and index configuration connections

* perf(planner): memoize exact supplier compatibility interfaces

* Skip unchanged pane domains and preserve identities across search rounds

* Preserve independent terminal reader bindings for repeated outputs

* perf(planner): factor equivalent terminal readers with independent bindings

* Name validated plans once by their pane search phase

* Document pane search compression contracts and domain limits

* Preserve the last complete inventory snapshot in timeout reports

* test(planner): benchmark pane search compression and workload quality

* test(planner): separate fixed-catalog growth from bounded search outcomes

* Avoid pane search restarts for window-free workloads and retain diagnostics

* docs(planner): record window-free sharing regression and final validation
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