Repository navigation
Conversation
… along A `cases:` region over some of a term's dimensions widens each presence the term carries by the coordinates the region leaves out. Keyed by every dimension, that widening reaches their full product: 1,881,936 rows for each `name`-keyed region of `pypsa-carbon_management_unified`. A variable is now present by the dimensions its `where` reads, and a `missing: absent` parameter by those its rows leave a hole along. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA1kHCvCqjJyD7nXF4E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA1kHCvCqjJyD7nXF4E
… builds faster Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA1kHCvCqjJyD7nXF4E
…s complement A presence a region relaxes held the region's complement written out: the product of the region's dimensions less its few claimed rows, widened to the presence's columns. It now keeps those claimed rows beside it, and a filter admits a row inside the presence or outside a region's claim. An operator that moves coordinates, a shift or a relation, writes the complement out first, since a complement does not survive a map of several coordinates to one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA1kHCvCqjJyD7nXF4E
…ilds faster Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA1kHCvCqjJyD7nXF4E
A named expression two entries read is built once and held in memory, its presences and their claims with it. A condition several `cases:` regions test is read once, and the rows a `where` admits are read once for every constraint that shares it, a constraint's presences narrowing those rows rather than the condition being read again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA1kHCvCqjJyD7nXF4E
…e per build Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA1kHCvCqjJyD7nXF4E
`_reads` is `_read_counts`, `_held` is `_collected`, and `_admitted_rows` is `_where_rows`. The changelog line names the change as its pull request does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA1kHCvCqjJyD7nXF4E
…xpression builds faster The line names the change in the language's words, as its pull request does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA1kHCvCqjJyD7nXF4E
`Presence.materialized` is `Presence.written_out`, as its docstring already says it, and the changelog lines of #2267 and #2268 name their changes in the language's words, as their pull requests do. Merges #2267's branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA1kHCvCqjJyD7nXF4E
…laimed' into claude/funny-thompson-fc33p4-shared # Conflicts: # CHANGELOG.md
The test this branch added to tests/test_queries.py stands in tests/internals/engine/test_queries.py, where main moved the module. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA31LM5B1nAaV1HUXet
…unclaimed Brings main in. The test this branch added to tests/test_queries.py stands in tests/internals/engine/test_queries.py. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA31LM5B1nAaV1HUXet
…on-fc33p4-shared Brings main in. The tests this branch added to tests/test_queries.py stand in tests/internals/engine/test_queries.py. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA31LM5B1nAaV1HUXet
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3n9zRJuf1H4Qr7wpkDsY
…unclaimed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3n9zRJuf1H4Qr7wpkDsY
…on-fc33p4-shared main's narrowed_by, from #2161, narrows a where's admitted rows by the presences as narrowed_rows did, and also keys a constraint with no dimensions; narrowed_rows goes. The rows a where admits are still read once per build through _where_rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3n9zRJuf1H4Qr7wpkDsY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3n9zRJuf1H4Qr7wpkDsY
…unclaimed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3n9zRJuf1H4Qr7wpkDsY
…on-fc33p4-shared Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3n9zRJuf1H4Qr7wpkDsY
…-fc33p4-shared # Conflicts: # CHANGELOG.md # src/specsolve/_engine/queries.py # tests/internals/engine/test_queries.py
# Conflicts: # CHANGELOG.md
… built with Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA3y1UzriCWf2vF5v7X
…-fc33p4-shared # Conflicts: # CHANGELOG.md # src/specsolve/_engine/queries.py # tests/internals/engine/test_queries.py
…s variables share with other reads Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA3y1UzriCWf2vF5v7X
…-fc33p4-shared # Conflicts: # CHANGELOG.md
…named by its variable Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA3y1UzriCWf2vF5v7X
…ts presence is built Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA3y1UzriCWf2vF5v7X
…ches # Conflicts: # src/specsolve/_engine/assembly.py # src/specsolve/_engine/queries.py # tests/internals/engine/test_queries.py
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
📖 2 files modified Preview · build overview · specsolve · built Dec. 6, 2026, 1:04 p.m. UTC |
FBumann
enabled auto-merge (squash)
December 6, 2026 12:37
FBumann
disabled auto-merge
December 6, 2026 12:38
…ows its rows by it once Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018B3nA3y1UzriCWf2vF5v7X
This branch has not been deployed
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.
A build's per-build caches go from eight under unrelated names to five, one per fact. A presence is one with another by the variable, parameter or condition it holds, never by table object, so no cache has to keep an object alive for #2323's dedup to work. Same model, same speed.
What changed, mutation table, A/B, gates
Caches (
queries.py,assembly.py)_claims/_claimed,_variable_keys_held_coordinates/_coordinates(mask, on)_variable_presence[(var, dims)]+_built_presence_variable_presences(var)builds it each readdimskey part never varied; identity no longer needs the object kept_presence_keys_sparse_dims_sparse_alongfound_read_counts+_named/_named_termssharedfield, fromshared_expressions(program), +_held_terms/_shared_terms_collected(terms, kept)_held_in_memory(terms)kept: a variable's presence collected too keeps its identity_where_coordinates/_where_rows_admitted/_admitted_rowsadmitted_named_terms'ssolution is not Nonebranch, dead since no builder sets bothbuildsandsolution_empty_tables, the dimensions' cached properties,collect_engineIdentity (
terms.py)Presence.of:('variable', name)or('parameter', name), set only where the table is that variable's condition or that parameter's rows and nothing else; two presences of one are one whatever table holds them, and the kind keeps a variable and a parameter of one name apartUnclaimed.when: the condition a region claims by; two claims by one condition are one_relaxedkeeps the name where it keeps the table (replace), drops it where it writes a new oneMutation table, by hand on
33e204c9/d6b3f454, full suite with-n auto, restored withgit checkout --,__pycache__dropped both sides, tree clean after each:main…admit_the_same_rows[two tables with the same rows], and a fuzz oracle (a quotient beside a shift)…admit_the_same_rows, two cases…admit_the_same_rows[two conditions' claims in one table]…narrows_by_one_presence[a condition over every dimension]…narrows_by_one_presence[inside a region]1b73ccb0)…narrows_by_one_presence[a parameter with no row at some coordinates]1b73ccb0)…admit_the_same_rows[a variable and a parameter of one name]A/B (
pixi run -e bench python -m bench.ab.compare bb860380 998ac03d --sizes pypsa --rounds 16, basemainbb860380, warmsps.buildwall, a fresh process per side per round, ABBA, 4 cores, load 0.52 before)carbon_management+0.4%, unified -0.8%, both last bits (The osemosys_utopia model differs in its last bit from one build to the next, so its archives refuse undeclared reads #1898)port-pypsa_store-10.8% (13/16), read as chance1b73ccb0); it alone,998ac03dagainst1b73ccb0, same method, load 0.53 before: 44 of 45 no change,carbon_management+0.3%, unified -0.9%; the one slower,port-pypsa_stochastic+3.4% (3/16), read as chancepresences_ofover one build: unified 31 parameter presences asked, 21 kept, so 10 semi joins fewer at row indexing;carbon_management3 asked, 3 kept; not counted insidepropagate_absenceGates
pixi run checkon1b73ccb0: 7013 passed, 995 skipped, 4 xfaileddocs-build,test-bench,--sizes s below aboveNot done
_zero_outside'snarrowed(…, region)over every dimension of the carrier, a different key from_coordinates'sGenerated by Claude Code