Current State and Why It Is Unsatisfying
--post-asap without --planner-cost-json runs nothing.
dag_export.rs:1500:
let results = if let Some(document) = planner_cost.as_ref() {
let model = ExportPlannerCostModel { document };
run_post_asap_with_progress(&lowered_queries, progress, &model, Some(&model), ...)
} else {
eprintln!("dag_export: --post-asap requires complete deployment-owned \
physical-plan evidence; exporting the raw plan only");
raw_only_post_asap_results() // three empty Vecs
};
The gate exists because a post-ASAP export asserts a cost-ranked decision, and
dag_export owns no deployment evidence with which to defend one.
However, a user with no deployment yet still wants to see what ASAPPlanner does
with a workload — which replacements it finds, which it commits to, what the
DAG looks like — and that needs the structure to be real, not the numbers.
Proposal
- Behind
--default-cost (mutually exclusive with --planner-cost-json), run
the search and pass &DefaultCostModel to global_selection — the two lines
5dbf4d9 deleted.
- Keep
export_model as None, so every cost is CostSource::Unavailable
with value: None. workload_cost_summary already degrades to an
unavailable summary; the viewer renders Not estimated.
- Absent both flags, behavior is unchanged.
- Update the stderr line and
tools/dag-viewer/README.md, which currently
states that without the document --post-asap exports the raw graph only.
Why This Is Not What 5dbf4d9 Removed
That commit deleted two things:
| Removed |
Restored? |
winner_cost_annotations emitting CostAnnotation::modeled(...) from AnalyticalCostModel |
No |
analytical.map_or(&default_model, ...) choosing which model ranks |
Yes |
DefaultCostModel's number was never an exported cost. The old
winner_cost_annotations had two outcomes: calibrated CostUnits, or
Unavailable — "structural node counts are intentionally never used as a
fallback." The commit's real work was making the evidence document complete and
fail closed. Untouched here. The usual objection — that dag_node_count plus an
"illustrative, not measured" weight table is indistinguishable from a real
cost — does not apply to a number that is never serialized.
Current State and Why It Is Unsatisfying
--post-asapwithout--planner-cost-jsonruns nothing.dag_export.rs:1500:The gate exists because a post-ASAP export asserts a cost-ranked decision, and
dag_exportowns no deployment evidence with which to defend one.However, a user with no deployment yet still wants to see what ASAPPlanner does
with a workload — which replacements it finds, which it commits to, what the
DAG looks like — and that needs the structure to be real, not the numbers.
Proposal
--default-cost(mutually exclusive with--planner-cost-json), runthe search and pass
&DefaultCostModeltoglobal_selection— the two lines5dbf4d9deleted.export_modelasNone, so every cost isCostSource::Unavailablewith
value: None.workload_cost_summaryalready degrades to anunavailable summary; the viewer renders Not estimated.
tools/dag-viewer/README.md, which currentlystates that without the document
--post-asapexports the raw graph only.Why This Is Not What
5dbf4d9RemovedThat commit deleted two things:
winner_cost_annotationsemittingCostAnnotation::modeled(...)fromAnalyticalCostModelanalytical.map_or(&default_model, ...)choosing which model ranksDefaultCostModel's number was never an exported cost. The oldwinner_cost_annotationshad two outcomes: calibratedCostUnits, orUnavailable— "structural node counts are intentionally never used as afallback." The commit's real work was making the evidence document complete and
fail closed. Untouched here. The usual objection — that
dag_node_countplus an"illustrative, not measured" weight table is indistinguishable from a real
cost — does not apply to a number that is never serialized.