Repository navigation
Property engine: typed edges, graph export (DOT/JSON) and a named cycle (#213, #188) - #223
Merged
Merged
Conversation
This was referenced Oct 28, 2026
…the edge order to_dot escapes backslash, quote and newline in every name it interpolates. to_json dumps with the replace error handler, so an odd name no longer throws type_error.316. The property_graph comment says what the edge order is: the sorted global edges, then the sorted local ones. Tests add the self-loop cycle message, a second finalize(), and the stateful and routed node flags.
Member
Author
|
Review findings, addressed in 9eaa781:
Not changed, noted for the record: PR body updated (edge-order wording, tests, gate). Gate: GCC 14 -O1, build 0 warnings, 1466/1466 tests pass. |
Member
Author
This was referenced Oct 30, 2026
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.
Closes #213, closes #188. First step of #221.
What
compute_execution_order()records each edge's kind when it is added; a duplicate keeps the first kind seen. The kinds aredependency,input(a material without declarations: every output),declared read,drives,material_ref,callback order,written_byandlocal. Local edges are recorded separately and take no part in the sort, so the execution order is unchanged.material_context::graph(). Returns aproperty_graph: nodes in execution order with flags (history, constant, stateful, routed, own callback), and the edges: the sorted global ones, then the sorted local ones. Stateful outputs come from the newmaterial_interface::stateful_outputs().to_dot(ctx)/to_json(ctx)incore/graph_description.h, next todescribe_graph(). DOT draws one cluster per material: local edges dashed, constants shaded, history doubled, stateful outputs orange. Every edge is labelled with its kind.Circular dependency in property graph: a::value -[declared read]-> b::value -[declared read]-> a::value.Nodes that are merely downstream of the cycle are not listed. When the cycle contains a callback-order edge, the message names its sources (
runs_after()or a read of the material's own output), soConstantProperties.ACycleOfRunsAfterIsRejectedstill finds "runs_after".update_property()computes the upstream set of a target once perfinalize()(upstream_of()). Property engine: iteration groups, the fixed point moves into update() #214, Property engine: partial derivatives per callback, chain rule by forward accumulation #217 and Property engine: residual systems set up at run time (unknowns and equations from any nodes, Newton/Picard, implicit function theorem) #218 need the same sets.Cost
Only at
finalize(): one map of edge kinds while building, one vector of edges kept per context.update()is untouched.update_property()stops rebuilding its upstream set on every call.Tests
test_graph_export, written first (red: nograph(),to_dot,to_json):localand does not change the execution order;runs_afteron itself) is named in the cycle message; a secondfinalize()leaves the graph andupdate_property()intact; the stateful and routed flags.Gate
GCC 14, reports on,
-DNUMSIM_PREFER_SIBLINGS=OFF: -O1 build 0 warnings, 1466/1466 tests pass.