Repository navigation
Conversation
…zen rather than while it is built Each constraint builds its labelled block, its rows and its shares on rows of its own from 0, and drops its rows with no terms there. run() moves every block onto the model's rows once, so no build step carries a start or a running row count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015YXphRT4nkmgh8LgdYMgCj
…an offset, by adding to its row column Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015YXphRT4nkmgh8LgdYMgCj
Merging this PR will not alter performance
Comparing Footnotes
|
Collaborator
Author
|
Note The following content was generated by AI. Closed and folded into #2019. On its own this change does not remove code. Generated by Claude Code |
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.
Note
The following content was generated by AI.
Each constraint builds on rows of its own from 0 and drops its rows with no terms there.
Assembly.runmoves every block onto the model's rows once. No build step carries astartor a running row count. No change in what is built, and no measurable change in build time.What changed, mutation table, method
Why. Discussion of #2019 showed where its complexity came from. A constraint's rows were numbered when it was labelled, and a block could then drop rows with no terms, so every later block's numbers were provisional. #2019 made that visible as a shift step. This PR is the base #2019 is rebuilt on.
What.
_build_constraintreturns its labelled block,rows, matrix share and quadratic share, all on its own rows.labels.frame(..., 'row', 0, ...),_dense_row(dims)and_drop_termless_rowsno longer take a start.run()computes each block's offset, setsself.constraints[name]with the block's frame moved lazily, and stacksrows, the matrix and the quadratic matrix through_on_model_rows._on_model_rowsmoves only a block whose offset is not zero, by adding to itsrowSeries, so a model with one constraint pays nothing. A first version moved every entry through one polars query and cost 10.5 ms per build ondispatch/m.Assembly.n_rowsis gone; the row count is computed at freeze. Variables keep their numbering up front, because constraint terms need their final column numbers and a variable never loses a column after labelling.Mutation table, taken by hand:
tools.mutatecannot express an edited expression. Clean tree, restored withgit checkout --,__pycache__dropped before and after each run.frame.with_columns(pl.col('row') + offset)→frame)_on_model_rowsremoved)Method.
Engine.buildfrom tidied sources, the median of 5–15 builds per process, four alternating process runs per arm. 4-vCPU cloud container. Base:main'ssrc/atb646d61.Every cell is inside its runs' spread.
Gates.
pixi run lint,pyrefly checkonsrc/,ruff format --check .,pixi run test: 5593 passed.Not done. Variables are still numbered while they are built. The batching itself is #2019, rebased onto this branch.
🤖 Generated with Claude Code
https://claude.ai/code/session_015YXphRT4nkmgh8LgdYMgCj
Generated by Claude Code