Skip to content

fix(plan-selection): name the pricing reason when the selection MILP is infeasible - #1189

Closed
milindsrivastava1997 wants to merge 2 commits into
mainfrom
fix/milp-surface-pricing-reason
Closed

milindsrivastava1997 wants to merge 2 commits into
mainfrom
fix/milp-surface-pricing-reason

Conversation

@milindsrivastava1997

@milindsrivastava1997 milindsrivastava1997 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Why

main has been red since #1144 because of one test: the DAG viewer's test_a_plan_without_a_rate_fact_names_the_missing_fact. Since the MILP became Stage 3's search, a workload whose source has no rate fact fails with a bare "infeasible", and the user can't tell which fact is missing. The old engine named it.

What / How

Candidates that asap-cost can't price are dropped before the MILP, and their pricing error is kept in CandidateData::usage. When the MILP is infeasible, selection_error now appends each distinct pricing error to the Infeasible rejection's reason.

Before this PR

plan selection: no valid candidate: [Rejection { id: "workload", cause: Infeasible,
  reason: "no plan meets every query's accuracy target, latency bound and the reader
  constraints together (the selection MILP is infeasible)" }]

After this PR

... (the selection MILP is infeasible); candidates left out because they could not be
  priced: pricing source m needs an arrival rate (the arrival's rows_per_second, or the
  source's series_count with sample_interval), and none is declared

Also: unbreak main

main does not compile: #1164 imports crate::AnalyticalCostError in selector.rs, and #1187, merged before it, moved that import into lib.rs's test module. The second commit imports it from asap_cost::analytical instead.

Tests

  • New regression test select::tests::an_unpriceable_workload_names_the_missing_fact: a workload with no source facts names the missing fact. It fails before the fix and passes after.
  • The DAG viewer's test_server.PlanEndpointTests passes locally.

Key code interfaces added / modified: None (the private selection_error now also takes &MilpInputs).

Major algorithm changes: None.

🤖 Generated with Claude Code

milindsrivastava1997 and others added 2 commits November 2, 2026 21:22
…is infeasible

Candidates that cannot be priced (e.g. a source with no arrival rate) are
dropped before the MILP. When that leaves it infeasible, the rejection
said only "infeasible", hiding the missing source fact. The rejection now
appends each distinct pricing error. Fixes the DAG viewer test
test_a_plan_without_a_rate_fact_names_the_missing_fact, red on main
since #1144.

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

#1164 imports crate::AnalyticalCostError, which #1187 moved into lib.rs's
test module; the two merged in that order, so main does not compile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milindsrivastava1997
milindsrivastava1997 force-pushed the fix/milp-surface-pricing-reason branch from 46a3254 to 7aa529f Compare November 3, 2026 02:29
@milindsrivastava1997

Copy link
Copy Markdown
Collaborator Author

Superseded by #1188, which landed the same pricing-reason fix and the selector.rs import fix.

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