Closed
Description
Goal
#509 "3. Plan selection" rejects candidates that miss an accuracy target, exceed a latency bound or need a missing capability, and every rejected candidate carries a reason. Two gaps remain on main @107ab28d.
Blocked on
Implementation of #511 (unified operator graph). Do not start before #511 is implemented.
1. Latency bounds are never enforced
LatencyRequirement(types/src/workload.rs:76, carried asQueryRequirements.response_latency) is read only by workload validation.- No cost model estimates latency.
CostModelhas abstractCost/CostRate. Empirical and ERP evidence measure CPU time, not wall-clock latency. - Proposed:
- Add a defaulted hook
CostModel::read_latency_ms(summary, lifecycle) -> Option<f64> { None }. - Carry the minimum bound over a summary's bound entries in
SummaryMaintenanceWorkloadFacts. - In
alternatives_for, reject an alternative that exceeds the bound with a newSummaryMaintenanceLifecycleRejection::ExceedsLatencyBound. - With no estimate, keep the alternative and add "latency bound unchecked: no estimate" to its
assumptions. - About 40 lines.
- Add a defaulted hook
- Tests:
- The bound rejects ephemeral while continuous is selected.
- With no estimate, the alternative is kept and marked unchecked.
- When every summary alternative violates the bound, raw recompute is chosen.
2. Candidates that lose selection keep no reason
RejectedCandidate(replacement.rs:579,error: AccuracyError) records only stage 1-2 accuracy pruning.TargetSubDAGSelectionkeeps onlychosen, andMajorPassdrops both the search and the selection.- Lifecycle alternatives already record
{total_cost, rejection, assumptions}inPlanOutput. - Proposed:
- Keep pruning and selection separate; don't reuse
RejectedCandidate. - Add the per-candidate costs considered (
Vec<(candidate, Option<Cost>)>) toTargetSubDAGSelection, filled where the choice is made. About 25 lines. - Surface them in
PlanOutputin a follow-up.
- Keep pruning and selection separate; don't reuse
Open questions (recommendations)
- Check latency per lifecycle or per logical candidate? Per lifecycle.
- With no estimate, keep the candidate or fail closed? Keep it and mark it unchecked.
- Latency hook for raw recompute? Defer until a deployment can supply one.
- With One workload-level PhysicalASAPDAG and PlanOutput deduplication — after #511 #521 (one workload DAG), should loss reasons be recorded per whole-workload candidate?
Metadata
Metadata
Assignees
Labels
No labels
Activity
zzylol commentedon Oct 15, 2026
Status: covered by the upcoming latency-check work. Not closing yet.
On main:
crates/asap-aware-mapping/src/stage3_plan_selection.rs) says "Latency bounds and deployment capabilities are not checked yet." That work adds the check.select_plan, feat(planner): physical ASAP-aware optimization and plan selection for candidate logical ASAP DAGs #576). Each candidate that misses an accuracy target gets aRejection { valid: false, reason }. Each valid candidate that loses gets aRejection { valid: true, reason }("costlier: … vs …", or a tie lost on enumeration order). Per-candidate costs are inSelection.costs, andPlanOutput.selectioncarries them. TheMajorPass/TargetSubDAGSelectionpath this issue describes was retired in feat(planner): run the planning stages as the planner pipeline; retire MajorPass #674.zzylol commentedon Oct 18, 2026
Done on main (58999df):
QueryRequirements.max_latency_mswithRejectionCause::LatencyBoundExceeded(feat(planner)!: Stage 2 materialization, the latency check and simplified query requirements (Example 4) #717, refactor!: rename AccuracyTarget.error, Rejection.valid, accuracy CLI flags, execution_timed_dag and accuracy_target #740).Rejection.cause(feat(planner)!: Stage 3 resource usage and cost models 1-3 (usage over time, provisioned capacity, own cluster) #723, refactor!: rename AccuracyTarget.error, Rejection.valid, accuracy CLI flags, execution_timed_dag and accuracy_target #740), covering failed checks (accuracy target missed, raw data not retained, over cluster capacity, latency) and losing on cost (costlier, slower, more memory, dominated on the Pareto front).Closing as completed.