Return the expanded lattice with and without the computed parameters#80
Merged
Conversation
parse_and_expand_PALS now hands back five trees rather than four. The lattice the bookkeeper finishes is `full_expanded`: every dependent parameter computed and present — ReferenceP, FloorP and s_position on each element, the derived members of every parameter family it uses, the non-zero defaults of the groups it carries, and a branch_end Placeholder capping each branch. `expanded` is that same tree pruned back to the author's inputs. A parameter is kept when it was present before the bookkeeper first ran, or when a post-`expand_lattice` `set` wrote it; everything else the bookkeeper produced is dropped, along with any group left empty and the branch_end elements. It is full_expanded with nodes removed rather than an earlier snapshot, so a parameter in both trees holds the same value in both, with every `set` and ABSOLUTE controller applied. The trees that took the old `expanded` name now take `full_expanded`: node_link, build_correspondence_map and get_lattice_parameter_value all name it. `expanded` takes no part in the correspondence — it is a pruned copy, not a step in the derivation chain, so its nodes are found by path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
parse_and_expand_PALSnow returns five trees rather than four.full_expanded— the lattice the bookkeeper finishes: every dependent parameter computed and present. Each element carries itsReferenceP,FloorPands_position, the derived members of every parameter family it uses (Kn1LalongsideKn1,voltagealongsidegradient, …) and the non-zero defaults of the groups it carries; each branch is capped with abranch_endPlaceholder holding its final reference and floor.expanded— that same tree pruned back to the author's inputs. A parameter is kept when it was present beforerun_element_bookkeeperfirst ran, or when a post-expand_latticesetwrote it. Everything else the bookkeeper produced is dropped, along with any group left empty and thebranch_endelements.expandedisfull_expandedwith nodes removed rather than an earlier snapshot, so a parameter present in both holds the same value in both, with everysetand ABSOLUTE controller applied. Use it to see the inputs rather than their consequences, or to write a lattice back out without the derived values.API
The tree that took the old
expandedname now takesfull_expanded:node_link.full_expanded,build_correspondence_map(original, combined, full_expanded, leftover)andget_lattice_parameter_value(full_expanded, leftover, …).expandedtakes no part in the correspondence — it is a pruned copy, not a step in the derivation chain, so its nodes are located by path.struct latticesgainedfull_expandedbetweenexpandedandleftover, so callers binding it by layout need updating. PALSJulia follows in a companion PR.Tests
New
tests/test_expanded_minus_dependent.cpp(9 cases) pins the boundary between the two trees: an authoredReferencePthe bookkeeper completes, one authored member of a multipole family with the rest derived, an authored RFP gradient plus materialized defaults, and an element holding nothing but itskind. The existing suites follow the rename.Full suite: 1291 assertions in 236 test cases, all passing.
🤖 Generated with Claude Code