Repository navigation
feat(analysis): write the graphs export from the lowered graphs by id - #2264
Merged
Merged
Conversation
modelform numbers an action vertex by lower.FlowNode, a state vertex by program.VertexRef and a region by RegionID, and reads the 7a accessors and the expression tables; what a record does not yet say (a declaration's site and extent, a trigger's shape, what a node performs) lower answers by id from the tree it still holds. The export's bytes and refusals are unchanged. exec/analysis, exec/analysis/modelform and exec/sweep may no longer import syntax/ast. 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)".
|
3 of 6 tasks
5 of 6 tasks
3 of 6 tasks
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
Part of the "consumers off the tree" step of the execution-IR migration (
docs/internals/execution-ir-design.md): the analysis packages stop reading the syntax tree behind the lowered graphs, so that the later step can delete the tree-typed fields without touching them.Stacked on #2257 (#2249, #2252 and #2253 have merged). Merge order: #2257 → this; it is retargeted to
developwhen #2257 lands.internal/exec/analysis/modelform: the graphs export numbers an action vertex bylower.FlowNode, a state vertex byprogram.VertexRefand a region byprogram.RegionID, and reads the graphs through their id-addressed accessors and expression tables. It no longer importsinternal/syntax/ast.internal/ir/lower: what a record does not yet say is answered by id from the treelowerstill holds, ingraph_sites.go: a declaration'sSite(kind label, name, span) andExtent, aTrigger's shape,StatementAt,PerformedBy,FootprintOf/ControlIDs; plusValued,ExprEntry.Extent,StateGraph.PseudoIDs,CompositeIDsandStateScope. These are additive; no tree field is removed.tests/hygiene:internal/exec/analysis,internal/exec/analysis/modelformandinternal/exec/sweepmay no longer importinternal/syntax/ast. The first and the last already did not, and read no tree-typed field of a lowered graph, so they change in no other way.Behaviour is unchanged: the export's bytes and its refusals are the same.
Two things the move made visible, both kept as they were and now pinned by tests:
if n > 0 { action inner : Work; }) is a node of the block's flow, not of the enclosing graph. The export still lists it among the graph's vertices, by its kind, name, span and what it performs, and nothing else.graphs: elements of one graph cannot be ordered: a vertex is reached only while it is writtenwhen a node's footprint converges on a node outside the graph's own, as a body block stating its own fork and join does (conformance modelaction_body_flow_fork_join). Whether that refusal should become an export is left for a separate change.Not in this change:
internal/exec/analysis/recordkeeps itssyntax/astimport. It reads symbol declarations, not lowered graphs.How it was verified
GraphsOf+MarshalGraphsfor every action and state declaration of every model underinternal/exec/runtime/testdata/conformance,internal/exec/smt/testdata,examples/(downloaded corpora included) and the analysis test data, 11,508 behaviors, comparing the SHA-256 of the bytes or the error text between the base head and this one: no difference.graphs_block_test.go(the block node and the refusal above; both also pass on the base head) andinternal/ir/lower/graph_sites_test.go(the new accessors).go build ./...,go vet ./...,gofmt -l .(empty),make lint,go test ./...with the training, pilot and specification-example corpora required (140 packages ok),go test -C tools ./...,go test ./tests/hygiene,make docs-counts,make spec-compliance-check,make changelog-check,make wasm-check.pilot-xpect -check: 432 files, 1299 agree, 30 disagree.tests/wasm.go run -C tools ./cmd/pilot-diff -checkfails identically on develop 0abb3aa; re-recorded by chore(baselines): re-record the pilot differential for the KerML declaration keyword error #2323.pilot-apijson-diff -checkandderived-census -check -require-exporterpass; nothing is re-recorded here.REPLEvalExpr6.751 ms → 6.860 ms (, p=0.529););GRPCEvaluate13.93 µs → 13.93 µs (ConnectEvaluateHTTP124.4 µs → 118.5 µs (−4.78%, p=0.043); bytes and allocations per op unchanged.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.md(nothing user-visible changes)make docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build) (none moved)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/f0e5153d16b3428e96fddec893eb225e
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/f0e5153d16b3428e96fddec893eb225e?variant=devin
Requested by: @HuiJun
🟢 Devin Review found nothing to fix · View findings