Conversation
zzylol
force-pushed
the
stack/528-11-deployment-inputs
branch
from
October 3, 2026 04:08
ff53a21 to
ff11d5c
Compare
This was referenced Oct 3, 2026
zzylol
marked this pull request as draft
October 3, 2026 19:28
Contributor
Author
|
Parked as draft: PR priorities changed (see #528). Order is now (A) finish #511 operator sharing, (B) the #572 crate/module reorganization, (C) #509 end-to-end stages. This PR sits on the old 🤖 Generated with Claude Code |
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.
Problem: runtime capabilities are passed with the planning clock, not with the other deployment inputs
#509 §Goal and §Stages say the planner takes three groups of inputs, and that the deployment supplies one of them:
#509 leaves the structure as a TODO ("TODO: define this data structure, #525"). #509 §3 Plan selection then rejects "every candidate that … needs a capability the deployment lacks".
Before this PR, the cost and accuracy models were in
PlanningModels, but the runtime lifecycle capabilities were inLifecycleInput, next to the planning clock and horizon:now_msandhorizondescribe this planning call. The capabilities describe what the deployment's runtime can do. They are a deployment input like the cost and accuracy models, so they belong with them.Also missing: no test drove restricted capabilities through the public planner (
e2e_plan) and checked that the lifecycle alternatives the runtime cannot run are not selectable.Scope. This PR covers the "execution capabilities" part of #509's deployment inputs, for runtime lifecycle capabilities only (step 1 of #525's proposal). It does not touch
SummaryMaintenanceCapabilities(what a summary algorithm can do), the value-operation capability hooks onCostModel, or #511 operator capabilities.Proposed method
capabilities: SummaryMaintenanceLifecycleCapabilitiesfromLifecycleInputtoPlanningModels.PlanningModelsis now the one bundle of deployment inputs: cost model, accuracy model, accuracy evidence and runtime capabilities. No new struct.PlanningModels::newandPlanningModels::builtinsetcapabilitiestoSummaryMaintenanceLifecycleCapabilities::ALL.Defaultfor the capabilities type is alreadyALL, so callers that used::default()keep the same behavior.PlanningModels::with_capabilities, matchingwith_cost,with_accuracyandwith_evidence.LifecycleInput::newnow takes onlynow_ms.LifecycleInputkeeps the planning clock and the optional horizon.MajorPassreadsmodels.capabilitiesinstead oflifecycle.capabilitiesat its three call sites: global selection (global_selection_with_summary_maintenance_lifecycles) and the two final-assembly calls (plan_assembled_dag).Where it lives: the input to the optimization pass and the public planner facade. The capability check itself is unchanged. It still runs in the lifecycle stage (physical materialization choice and selection), which marks an alternative the runtime cannot run as
UnsupportedByRuntime.Key code interfaces
crates/asap-aware-mapping/src/pass/mod.rsThe capabilities type is unchanged (
crates/asap-aware-mapping/src/summary_maintenance_lifecycle.rs):Usage:
Fields
PlanningModelscost&dyn CostModelbuiltin()usesDefaultCostModelaccuracy&dyn AccuracyModelbuiltin()usesDefaultAccuracyModelevidence&dyn AccuracyEvidenceProviderbuiltin()usesNoAccuracyEvidencecapabilitiesSummaryMaintenanceLifecycleCapabilitieswith_capabilities; defaults toALLinnewandbuiltinnew(cost, accuracy, evidence)ALLbuiltin()ALLwith_capabilities(capabilities)capabilities, returnsSelfLifecycleInputnow_msu64rejects_disagreeing_planning_clocks).horizonOption<Horizon>Nonekeeps horizon-dependent alternatives unselectable. Set withwith_horizon.new(now_ms)horizon = NoneSummaryMaintenanceLifecycleCapabilities(unchanged; listed because it is now aPlanningModelsfield)truesupports_ephemeralSummaryMaintenanceLifecycle::Ephemeralsupports_preparedPrepared { activate_at, retire_at }supports_sharedShared { retention }supports_continuously_maintainedContinuouslyMaintainedALLtrue; alsoDefaultA
falseflag makes the matching alternative carrySummaryMaintenanceLifecycleRejection::UnsupportedByRuntime. Atrueflag does not make an alternative selectable by itself: it can still be rejected for missing workload evidence or unknown cost.Examples
Restricted runtime, through the public planner. Test
deployment_inputs_control_lifecycle_capabilitiesincrates/planner/tests/e2e_plan.rs:SELECT COUNT(DISTINCT l_orderkey) FROM lineitem,PlanningModels::builtin().with_capabilities(…)with onlysupports_ephemeral = true, andLifecycleInput::new(NOW_MS).e2e_planruns the frontend andMajorPass.MajorPasspassesmodels.capabilitiesto lifecycle selection and final assembly.Prepared,SharedorContinuouslyMaintainedcarries a rejection.PlanningModelsEphemeralPreparedSharedContinuouslyMaintainedALL(default fromnew/builtin)"May be selected" still depends on workload facts and cost evidence.
Caller migration. All existing callers change the same way:
Updated callers:
crates/planner/tests/e2e_plan.rs,crates/planner/tests/summary_sharing.rs,crates/integration-tests/tests/operator_design_examples.rs.crates/planner/src/lib.rsonly updates theUserInput.lifecycledoc comment.Out of scope
SummaryMaintenanceCapabilitiesfrom physical kernels, and merging the three value-operation capability hooks onCostModel.PlanningModels(for example toDeploymentInputs). Deployment inputs: one bundle for cost model, accuracy model and capabilities — after #511 #525 recommends keeping the name for now.LifecycleInput::new. Per Deployment inputs: one bundle for cost model, accuracy model and capabilities — after #511 #525, ASAPQuery-backend pins an older planner revision and is not updated here.Stack and validation
Legacy physical stack: … ← #551 ← #552 ← #553 ← #554 ← #555 ← #556 … · Base: #552 (
stack/528-10-univmon) · Next: #554 · Tracker: #528Closes #525.
Validation:
CARGO_TARGET_DIR=/mydata/cargo-target-412 cargo test --locked -p asap-plannerCARGO_TARGET_DIR=/mydata/cargo-target-412 cargo test --locked -p asap-integration-tests --test operator_design_examplescargo fmt --all -- --check🤖 Generated with Claude Code