Repository navigation
feat(lower): name the nodes and vertices of the lowered graphs by id - #2253
Merged
Merged
Conversation
Step 7a of the execution-owned IR. Beside each node, state and vertex a lowered record names by declaration it now names the id the step-1 identity tables assigned: SourceID/TargetID on ActionEdge and ObjectFlow, NodeID/OtherNodeID on PinBinding, SourceRef/TargetRef/OwnerID on Transition, TargetID/ViaID on EntryTransition, OwnerID on StateBehavior, with id-indexed accessors over the graph tables. No consumer changes; step 8 removes the tree side. The sysml-core size budget rises to 7,500,000 bytes: the build is 7,451,380 bytes gzipped, 5,087 over the base's 7,446,293. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
PerformedPinBindings builds its bindings outside the graph's own binding slices, so they left lowering with zero NodeID and OtherNodeID. The ids are now set where each binding is built, from the performed graph's identity table. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
There was a problem hiding this comment.
Devin Review found 1 finding. Devin automatically fixed it.
Fixed by Devin (1)
- Missing identities on performed-action bindings — PerformedPinBindings now sets NodeID/OtherNodeID where each binding is built, from the performed graph's identity table; TestPerformedPinBindingIDs covers it.
This was referenced Nov 15, 2026
…into feat/ir-graph-ids Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # tests/wasm/core_test.go
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Merged
3 tasks done
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.
What and why
Step 7a of the execution-owned IR (
docs/internals/execution-ir-design.md, "Migration as a stack of pull requests"). Step 7 moves the consumers outside the runtime off the syntax tree, but the lowered graphs named their nodes, states and vertices by declaration only, so a consumer could reach an id only by first reading the tree-typed field that step 8 deletes. This pull request gives the graphs the id-addressed side; it changes no consumer.Merge order: #2249 → #2252 → this. The base is
feat/ir-expr-semantic-residues(#2252) and moves todevelopas those land.Added, in
internal/ir/lower:ActionEdge.SourceID/TargetID,ObjectFlow.SourceID/TargetID,PinBinding.NodeID/OtherNodeID(program.NodeID).Transition.SourceRef/TargetRef(program.VertexRef) andTransition.OwnerID;EntryTransition.TargetID/ViaID;StateBehavior.OwnerID.graph_ids.go: id-indexed access to the tables. For a flow:EdgesOf,IncomingOf,FlowsOf,BodyOf,FeaturesOf,AcceptOf,SubflowOf,StatementRun,BlockNodesOf,InitialID,ConcurrentIDs,StartIDs,FinalIDs,EnclosingNodeID. For a machine:StateIDs,StateIDOf,MachineID,VertexOf,InitialID,ParentOf,StateRegion,RegionsOf,TopRegionIDs,RegionOwnerOf,RegionInitialOf,RegionStateOf,HiddenRegion,Hidden,ParallelState,BehaviorsOf,AttributesOf,BehaviorFeatures,TransitionsOf,EntryTransitionsOf,RegionEntryTransitions,PseudostateOwnerOf,PseudostateRegionOf,TerminateOwnerOf.Every id is the one the step-1 identity tables assigned (
ActionGraph.ID,StateGraph.ID/RegionID/PseudoID/TransID); there is no second numbering. The fields are stamped at the end ofassignIDs(and, for the bindings a performer writes through the feature it performs, wherePerformedPinBindingsbuilds them), and the accessors read the existing tables throughProvenance.On the id fields beside the tree fields. This is the additive pattern step 1 and 6b-3 used. It is not a parallel structure in the sense of
AGENTS.md§4: the tree-typed side is scheduled for deletion in step 8 (row 8 of the design's table), and nothing copies IR back into a tree field.The design document records the re-measured scope of step 7 and its split (7a–7f).
How it was verified
TestLoweredGraphIDs(internal/exec/runtime/graph_ids_test.go) lowers every action and state machine of the execution-conformance models, nested and block flows included, and checks that each tree-typed node, state, region, pseudostate and vertex a record or table names has a non-zero id counterpart that round-trips to the same element, and that each accessor answers what the tree-keyed table answers. With the stamping disabled it fails on every edge, transition, entry transition and behavior.TestPerformedPinBindingIDschecks the same for performed pin bindings.go build ./...,go vet ./...,gofmt -l .(empty),make lint,go test ./...with the training, pilot and specification-example corpora required,go test ./tests/hygiene,go test -C tools ./...,make docs-counts,make spec-compliance-check,make wasm-check,make changelog-check.agree 229 · kind-only 1 · order-only 0 · disagree 38 · differs-by-design 5 · pilot-unevaluated 167 · pilot-silent 24 · pilot-error 7 · ours-error 10 · ours-undetermined 17 · both-error 16 · nondeterministic 0, equal to the committed record.pilot-xpect -checkpasses.REPLEvalExprGRPCEvaluateConnectEvaluateHTTPAllocations per operation are identical (123 / 144 / 224); bytes per operation show no significant difference.
What moved. One ratchet:
coreGzipBudgetintests/wasm/core_test.gorises from 7,450,000 to 7,500,000 bytes. The base buildssysml-core.wasmat 7,446,293 bytes gzipped, 3,707 under the old budget; this change adds 5,237 (7,451,530). No conformance expectation, golden trace, view golden, corpus baseline, wire format or snapshot format moves.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.md— none: no user-visible change, as for the earlier steps of this migrationmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelog🟢 Devin Review found nothing to fix · View findings · Follow Devin's work