Repository navigation
Conversation
Merging this PR will regress 4 benchmarks
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_window[storage-s-specsolve-highs-values] |
10.5 MB | 11.7 MB | -10.03% |
| ❌ | test_window[storage-s-specsolve-highs-one] |
10.5 MB | 11.7 MB | -10.03% |
| ❌ | test_window[network-s-specsolve-highs-one] |
13.9 MB | 14.8 MB | -6.34% |
| ❌ | test_window[network-s-specsolve-highs-values] |
13.9 MB | 14.8 MB | -6.34% |
| ⚡ | test_window[fleet-s-specsolve-highs-values] |
11.8 MB | 10.4 MB | +13.3% |
| ⚡ | test_window[fleet-s-specsolve-highs-one] |
11.8 MB | 10.4 MB | +13.3% |
| ⚡ | test_emit[fleet-s-specsolve-highs] |
21.1 MB | 19.7 MB | +7.02% |
| ⚡ | test_emit[fleet-s-specsolve-in-memory-highs] |
21.1 MB | 19.7 MB | +7.01% |
| ⚡ | test_window[fleet-s-specsolve-highs-cold] |
21.2 MB | 19.8 MB | +6.98% |
| ⚡ | test_window[fleet-s-specsolve-highs-shape] |
21.1 MB | 19.8 MB | +6.98% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing claude/batched-build (b1cb527) with claude/rows-numbered-at-freeze (77de082)
Footnotes
-
307 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
…bout a quarter faster The labels of every variable, then every variable's bounds, then every constraint's labels, right-hand side and linear terms are each collected in one pass, and attach reads every source table in one. labels.Domain names the coordinates a declaration spans, and labels.frames reads several of them together; labels.frame is its one-domain case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015YXphRT4nkmgh8LgdYMgCj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015YXphRT4nkmgh8LgdYMgCj
808df80 to
31fcc2e
Compare
…nd a constraint with no terms takes the same path as one with terms Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015YXphRT4nkmgh8LgdYMgCj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015YXphRT4nkmgh8LgdYMgCj
|
Note The following content was generated by AI. Replaced by #2022, which carries this branch and #2020's commits in one PR against Generated by Claude Code |
Note
The following content was generated by AI.
Stacked on #2020. The build collects each stage's tables for every declaration in one pass: sources, variable labels, bounds, constraint labels, right-hand sides and linear terms. Port models build in 0.65–0.77× the time of #2020; dispatch in 0.78–0.81×.
What changed, method, measurements, mutation table
Why. Each declaration's tables were collected one query at a time. A polars query has a fixed cost however few rows it holds, so a small model with many declarations paid it dozens of times.
What.
labels.Domainnames the coordinates a declaration spans: its dims, its mask, and the presences its rows must lie in.labels.frames(scope, domains, label)reads several domains together, each numbered from 0.labels.frameis its one-domain case._factoredranks.Assembly._build_variableslabels every variable in one pass and moves each onto its columns by adding to the label Series (_moved). It reads every variable's bounds in a second pass.Assembly._build_constraints:_Sides: its terms, quadratic terms and constants, each signed, and its restrictions._blockon its own rows, whichrun()moves onto the model's as chore(engine): a constraint's rows are numbered when the model is frozen rather than while it is built #2020 does.coverage.constant_sidereturns its plan, andrefuse_uncoveredchecks the read.attaching.attachreads every source table in onecollected_all.Method.
Engine.buildfrom tidied sources, the median of 5–15 builds per process, three alternating process runs per arm, the median of those. 4-vCPU cloud container, started at a 1-minute load below 1.5. Base: #2020's head.dispatch/mran 96–101 ms on #2020 and 105–125 ms here; with one constraint it has nothing to batch, so a small cost there may be real.Mutation table, taken by hand:
tools.mutatecannot express an edited expression. Clean tree, restored withgit checkout --,__pycache__dropped before and after each run._moved(labelled, 'var_label', self.n_cols)→labelled)if gaps:→if False:inrefuse_uncovered)The refusal moved here unchanged from
constant_side. The same mutation onmain's code, at #2020's head, also leaves the suite green (5593 passed). So no test reaches that error today. That is an existing gap and is not addressed here.Coverage moved.
test_the_bounds_are_collected_in_memoryrecordspl.collect_allas well asLazyFrame.collect.bench/profile_build.pyandbench/profile_phases.pyname_build_variablesand_build_constraints.Behaviour. A model with errors in several constraints can report a different one first, because every constraint is compiled and labelled before any is checked. No test asserts that order.
Gates.
pixi run lint,pyrefly checkonsrc/,ruff format --check .,pixi run test: 5593 passed.pixi run test-bench: 411 passed, run with--i-know-another-is-runningafter the suite raised the load, not to take a measurement.Not done.
labels.declared_heightfor each restricted constraint still collect one at a time._factoredand_dense_row, stay. Removing either needs its own measurement.🤖 Generated with Claude Code
https://claude.ai/code/session_015YXphRT4nkmgh8LgdYMgCj