Repository navigation
Conversation
…vs whole (failing) Block detection over rows, the good_lp model as HiGHS columns/rows, and the optimum solved block by block against the whole model on generated MILPs; an ignored check on MPS dumps of paper workloads (n100, mixed-8users, backend n100). The functions are stubs (todo!), so the tests fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
Union-find over the columns each row reads; each block is its own HiGHS problem (gap 0, one thread), up to MOST_BLOCK_SOLVER_THREADS blocks at once, assembled in block order. Loose columns take their cheapest bound; rows without columns are checked against 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
Blocks share no variable and no row, so the optimum is the whole model's; the split is after the model is built, so no sharing is lost. The accuracy re-solve and the LP bound run on the same blocks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
…ery round Keeps the rescanning elimination as a test-only reference and asserts the elimination agrees with it on every memo the crate's tests build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
dead_candidates checks every candidate in the first round and then only the neighbours of the newly dead, with the same rounds and reasons as rescanning; threshold_theta's loop calls it each round, so it gains too. evaluation_period_ms_per_query queues a group at most once (same least fixpoint of gcd merges in any order). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
Contributor
Author
|
Follow-up issue for the objective vs plan_cost gap that this PR's tie-breaking exposed (n100: same objective, plan_cost +3.1%): #1566. No change requested on this PR. |
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.
Summary
data, SQLhttp, SQLflows). HiGHS's root work on the hardest block holds back all the others.Review guide
feat/sil-intent(feat(sil): plan SIL intents: parse/check, lowering, hole guard, planning modes, group latency (L_G) #1553). This draft is stacked on it.crates/stage3-plan-selection/src/milp/model/independent_blocks.rs(independent_blocks,solve_by_blocks,solve_block). Then read the wiring insolve_selection_reporting_lp_boundinmilp/model/mod.rs.solve_selection_reporting_lp_bound;dead_candidates(stage1-pass2-reuse-candidates/src/dead_candidates.rs).evaluation_grids.rsnow puts a group on the queue at most once; there is also acargo fmtcommit.todo!()stubs;On the 11-26 "no DAG split" decision: this is not a split of the workload or the DAG.
Behavior: before → after
asap_planner --workload paper.n100.promql.json --workload paper.n100.sql.json --sql-catalog-table <http> --sql-catalog-table <flows> --run-until stage3 --format text --verbose(S1 arguments). Load average 19–55 on the 56-core local machine.selection MILP:lineThis serves the eval: S1 planning time on paper workloads, where the MILP is 90–96% of planning CPU.
Interfaces
None public. All new items are
pub(super)insidestage3-plan-selection/src/milp/model/.crates/stage3-plan-selection/src/milp/model/independent_blocks.rscrates/stage3-plan-selection/src/milp/model/mod.rs-fn lp_relaxation_objective(mut model: highs::Model) -> Option<f64>;lp_relaxation_objectiveis removed because the LP bound is nowsolve_by_blockswithrelaxation: true.Usage (end to end, as above): the planner CLI reaches
select_plan, thensolve_selection_reporting_lp_bound.Milp::of(&problem, &objective, &constraints): 12954 columns and 17219 rows on n100.independent_blocksfinds 939 blocks in 1 ms. Three have more than one column: 6334, 4934 and 750 columns. The rest are single columns.solve_by_blocks(.., HighsSettings::default(), 4)solves them. The largest blocks start first. Wall time is about the hardest block's time, since the RangeHeavy PromQL block takes about 7.7 s alone.column_ofto the selection, exactly as before. The CLI prints the plan and theselection MILP:line shown above.Algorithm changes
Stage 3: solve independent blocks apart
RowProblemwith the same options, on a scoped thread pool (an atomic work index, largest block first).solve_selectiononly. The cost model 3 cluster solve (cluster/solve.rs) is unchanged; its budget rows would couple the blocks anyway.>=row to<=with negated coefficients. The rows are passed that way, which can change HiGHS's search path, though not the optimum.Pass 2: frontier dead-candidate elimination
dead_candidatesrescanned every candidate in each round.cut_edges_of_dominated_thetascalls it once per round of its own loop.EdgeGraph::neighbours) of candidates that died in the previous round. Each round still judges against the dead set from before that round.#[cfg(test)]assertion compares against the kept rescanning reference on every memo in the crate's tests.evaluation_period_ms_per_querynow puts each group on the queue at most once. The result is the same least fixpoint of gcd merges, whatever the order.Decisions and open questions
cost_per_second: before 6.528505e5, after 6.732607e5, with an identical MILP objective of 6.732615e5.plan_costthan the MILP charges it. That is a gap between the MILP andplan_costthat exists already, not something this PR adds. m8u and b100 report equalcost_per_second.plan_costgap?MOST_BLOCK_SOLVER_THREADS), and also capped byavailable_parallelism. Make it configurable?Verification
cargo test -p asap-stage3-plan-selection --libcargo test -p asap-stage1-pass2-reuse-candidates --libdumped_planner_milps_have_the_whole_models_optimum(release,ASAP_STAGE3_MPS_DIR)-D warnings --all-targetson both crates--run-until stage1_pass2 --format json--run-until stage3 --format json(timings removed)The new tests:
columns_linked_through_rows_are_one_block,a_row_over_every_column_makes_one_block: block detection, including loose columns and rows without columns.a_good_lp_model_becomes_highs_columns_and_rows: the good_lp model becomes the right HiGHS rows, bounds and integrality.solving_block_by_block_finds_the_whole_models_optimum,linked_blocks_are_solved_as_one,the_lp_relaxation_block_by_block_is_the_whole_relaxation: the split solve equals the whole solve.a_loose_column_takes_its_cheapest_bound,an_infeasible_block_makes_the_milp_infeasible,a_row_without_columns_holds_only_when_its_bounds_contain_zero,an_empty_milp_is_solved_with_objective_zero: edge statuses.The first commit holds the tests with
todo!()stubs. It was not built on its own; its tests fail by construction.Planning time, release binaries,
--format text, local 56-core machine, load average 19–64 (other agents' builds):Follow-ups
Deferred:
IntentFull(item 3);plan_costgap shown by the n100 tie.🤖 Generated with Claude Code
https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi