Repository navigation
Description
Problem, by example
tools/dag-viewer/workloads/random-mixed-seed-862-long/workload-01.json, planned with the MVP deployment capabilities and --ignore-accuracy-guarantees:
asap_planner --workload tools/dag-viewer/workloads/random-mixed-seed-862-long/workload-01.json \
--deployment-capabilities caps_mvp.json --ignore-accuracy-guarantees \
--run-until stage3 --format json --out plan.json
| commit | --run-until stage2 |
--run-until stage3 |
|---|---|---|
facaec8b2 (#1350) |
0.57 s | 1.42 s |
14308fd2c (#1355) |
0.78 s | 8.46 s |
The workload is the same and Stages 0–2 take about the same time; Stage 3 went from about 0.9 s to about 7.7 s. On current main (b3351bc5b) the same workload spends 13.2 s in the planning stages, 12.4 s of it in the MILP solve.
Across the 34 dag-viewer workloads (viewer34: random-mixed-seed-862, -long, -x5 on MVP caps, plus planner-layering), the planning stages took 42.6 s in total on 2026-11-14 (9ad2c5422) and 304.6 s on b3351bc5b (2026-11-26), at similar candidate and MILP sizes. Each random-mixed workload went from 1.0–1.4 s to 13–14 s; the solve now takes 10–15 s and sometimes branches past the root node.
What should happen: a change to the unit costs should not make Stage 3's solve about 8× slower on an unchanged workload.
What was measured
Release builds of asap_planner at each commit, one workload at a time, on idle identical hosts. Wall time of the command above for four workloads (s):
| commit | long-01 | long-03 | long-09 | seed-862 workload-07 |
|---|---|---|---|---|
9ad2c5422 (11-14 main) |
1.28 | 1.41 | 1.73 | 1.51 |
facaec8b2 (#1350) |
1.48 | 1.12 | 1.65 | 1.16 |
14308fd2c (#1355) |
8.47 | 8.09 | 12.63 | 9.00 |
4cb4110c1 (#1363) |
9.74 | 11.53 | 9.97 | 8.93 |
8e65fca45 (#1365) |
9.64 | 11.49 | 9.88 | 9.11 |
79d99326e (#1368) |
9.86 | 11.57 | 10.03 | 9.03 |
2f3664d1f (#1238) |
9.62 | 11.42 | 9.89 | 8.78 |
ca4be93f0 (#1376) |
9.66 | 11.44 | 9.87 | 9.08 |
1760a69f5 (#1239) |
15.87 | 17.68 | 16.14 | 15.12 |
bc725bda8 (#1374) |
15.91 | 17.79 | 16.22 | 15.50 |
b3351bc5b (#1487) |
20.42 | 19.65 | 23.58 | 23.24 |
- Before
1760a69f5,asap_planner --format jsonpanics after Stage 3 has run (atodo!in the document printer), so those times cover planning only. - From
1760a69f5(refactor: tools and snapshots over the #1207 memo, edges and contexts (#1207 PR 9) #1239) on, the command also builds the full JSON document. At1760a69f5,--run-until stage2alone takes 7.19 s, against 0.73 s atca4be93f0. Onb3351bc5b, 13.2 s of the 18.3 s wall time for long-01 is in the planning stages (per-stage timing), so about 5 s is document building outside planning. That is a separate cost of the tool, not of the planner. The 7× above compares the planning stages only. - The first slow commit is
14308fd2c(fix(cost): charge each operation the executor's measured time, so a sketch plan is no longer predicted cheaper than a faster exact plan #1355). The commit before it,facaec8b2, plans as fast as the 11-14 baseline. Later commits add a smaller drift, from about 9–11 s to about 12–13 s in the planning stages onb3351bc5b. That drift was not bisected.
Suspected cause
#1355 replaced the built-in formulas' one CPU operation per row with the executor's measured time per unit (node::operations_per_unit). The per-unit costs now range from 1 to 35,000 operations: a row kept by a time range 12, a DDSketch fold 210, a KLL merge 7,000, a KLL readout 35,000. Costs change the MILP's objective, and may change which candidates survive cost-based pruning; the MILP's size at the two commits was not compared. The guess is that the wider spread of objective coefficients, and many alternatives whose costs are now close, make HiGHS's root LP and cuts much slower, and sometimes make it branch. This has not been confirmed with the MPS files of the two commits.
Proposal
- Dump the Stage 3 MPS and its row and column counts of
random-mixed-seed-862-long/workload-01atfacaec8b2and at14308fd2c. Compare the presolve, the LP relaxation time, the root-node gap and the node counts under HiGHS with a fixed seed. This confirms or rules out the objective as the cause. - If the objective is the cause, the options are open:
- scale or round the objective (fix(stage3): scale the MILP objective so near-equal plans are told apart #1427, which came later, scales it so near-equal plans are told apart);
- add tighter bounds or cuts for the near-equal alternatives (the search-space pruning rules' greedy bound and cover rows);
- give HiGHS a feasible start from the greedy plan.
Scope and acceptance
- In scope: the Stage 3 solve time on the dag-viewer random-mixed workloads under the measured unit costs.
- Out of scope: the unit costs themselves (fix(cost): charge each operation the executor's measured time, so a sketch plan is no longer predicted cheaper than a faster exact plan #1355's ranking tests stay), and the JSON document's build time in
asap_planner(a separate tool cost; worth its own issue if it matters). - Done when:
random-mixed-seed-862-long/workload-01plans in its planning stages within about 2× of thefacaec8b2time on the same host, with the same selected plan cost; and viewer34's total planning-stage time is back within about 2× of 42.6 s.
Related
- fix(cost): charge each operation the executor's measured time, so a sketch plan is no longer predicted cheaper than a faster exact plan #1355 (first slow commit), fix(stage3): scale the MILP objective so near-equal plans are told apart #1427 (MILP objective scaling), refactor(stage3): select over execution contexts: x_{κ,v}, y_{κ,u,c,i}, h_v and constraint (R) (#1207 PR 7) #1237 / refactor(stage3): constraint (K) per execution and metric; sign-conditioned DDSketch guarantee, classic HLL certificate from the source's distinct bound (#1207 PR 8) #1238 (execution contexts and constraint (K)).
- The search-space pruning stack (fix(pass1): no Count-Min build over weights not proven non-negative #1527–perf(stage3): single-reader regions keep only their cheapest tree (search-space pruning rule 7) #1532) cuts MILP columns and rows, but it does not target this solve slowdown.
Activity
zzylol commentedon Nov 27, 2026
Cause found: HiGHS treats the retention columns as integers, and its root reduced-cost fixing is quadratic in their range
The cause is not the objective's coefficient spread. The selection MILP's$h_v$ (seconds retained) columns are continuous and unbounded, with whole-number row coefficients ($h_v \ge 60,y$ , $300,y$ , $3{,}600,y$ , …). HiGHS's presolve marks them as implied integers. At every root LP resolve, $h_v$ columns.
HighsRedcostFixing::addRootRedcostthen steps through up to 1,024 "lurking bounds" for each such column with a nonzero reduced cost. Each insert walks the whole map, so the work is quadratic in the steps. #1355 kept more executions, so morerandom-mixed-seed-862-long/workload-01: the MILP at the two commits and onmainHiGHS 1.15 on the MILP each commit builds. The planner's settings are gap 0 and one thread; the times are standalone solves of the dumped model on the same idle host.
facaec8b214308fd2c(#1355)maindaaa2a207On
mainthe root node takes 14.9 s for 2,115 LP iterations. The time goes into separation rounds that each run only a few hundred iterations: 0.8 s → 6.1 s for 313 iterations.perfputs 81 % of the solve inaddRootRedcost, 55 % of it instd::_Rb_tree_increment.What was ruled out (same MPS, standalone,
long-01onmain)user_objective_scale=-10(largest coefficient 1e6 → about 1e3)user_objective_scale=-20presolve=offmip_heuristic_effort=0Rescaling the objective and bounding$h_v$ do not help. Only shrinking each column's domain to [0, 1] does. The same rewrite of the dumped models:
long-01long-03seed-862workload-07facaec8b214308fd2cmainOn the 18 paper MILPs (three HiGHS seeds, median), the sum goes from 401.7 s to 201.0 s, with equal optima.
Fix: #1537
#1537 holds$h_v$ as $r_v$ . Release build, same idle host, one workload at a time, HiGHS seeds 0–2, median per workload, planning stages summed:
longest_need_s * share, with share in [0, 1]. The (R) rows stay in seconds, so the solver's tolerances keep their meaning. It does the same for the resident windowsmain→ #1537plan_costseparates the tied plans.mainitself returns the dearer one onpaperwhole_rollupheavywith seed 1.long-01: 2.48 s, againstfacaec8b2's 1.73 s on the same host, which is within 2×.facaec8b2's 48.7 s on the same host (wall time, since that commit panics after Stage 3), so 2.0×. Against the 11-14 figure of 42.6 s it is 2.3×.addRootRedcostno longer appears in the profile oflong-01's solve; no function takes more than 7 %. The rest of the gap to the 11-14 baseline is the larger MILP that the measured unit costs keep (7,570 columns against 10,348 atfacaec8b2, but 590 against 293 after presolve). That was not bisected further.fix(stage3): retention and resident windows as shares of their larges…