Repository navigation
feat(runtime): key action executor state by node id - #2144
Open
devin-ai-integration[bot] wants to merge 4 commits into
Open
devin-ai-integration[bot] wants to merge 4 commits into
devin-ai-integration[bot] wants to merge 4 commits into
Conversation
The action executor's frames, tokens, breakpoints, traversals, future footprints and their snapshot and held-image copies hold the graph-local program.NodeID step 1 assigns, as runtime.NodeRef, in place of ast.Node; consumers read the declaration back through the graph's provenance. 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)".
|
BreakpointAt unfolds a deferred subflow (a typed body nested in its own type) as the performance running it does, so a node of that flow is one a breakpoint can name; Subflow.Graph stays nil for such a flow. 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)
- Recursive subflow breakpoints cannot be set — nestedRef now resolves a nested action's flow through Subflow.Unfold(), which returns the cached unfolded graph the executor's performance runs for a deferred (recursively typed) body; TestBreakpointAtUnfoldsADeferredFlow pins a breakpoint on a node of such a flow pausing the run and reporting the same ids.
…r-action-exec-ids
6 tasks done
…r-action-exec-ids
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.
What and why
Step 2 of the execution-owned IR migration (
docs/internals/execution-ir-design.md, "Migration as a stack of pull requests", row 2): the action executor's own records stop holdingast.Nodeand hold the graph-localprogram.NodeIDstep 1 assigns. The graph (lower.ActionGraph) keeps its AST fields; the executor reads a node back throughProvenance.Node(id)where a consumer still needs it. No layering change, no behaviour change.runtime.NodeRef{Graph *lower.ActionGraph; ID program.NodeID}is the id-keyed reference the executor records hold;NodeRef.Node()reads the declaration back through the graph's provenance,runtime.NodesOfdoes so for a path.actionFrame.{subactions, repeatedPerfs, pending, held, staged, nested, unreceived, nodes},Token.Location,Token.Within(),NodeBreakpoint.{Within, Node},Traversal.Within,breakpointVisit.node,ActionExecutor.performedAt,futureKey.node, and the snapshot (snapshot.go) and held-image (held_image_behavior.go) copies of the frame tables.ActionExecutor.BreakpointAt(within []ast.Node, node ast.Node) (NodeBreakpoint, bool)resolves a breakpoint named by declarations (as the LSP debug session and tests name them) to ids, level by level: a node of the action's own flow or of a block flow its statement nodes state, then under each nested action node the nodes of the flow it owns or of the block flows of its body.Token.Node()is the declaration a token stands at; the token of a state-space run stands at the action itself, which is no node of the flow, and keeps answering with the action's declaration.Where the design met the code:
NodeIDcannot key a frame's tables: a performance's subactions mix nodes of its own flow, of the block flows its statement nodes state (each lowered as its own graph with its own dense ids) and of an adopted callee's flow. The reference therefore carries the graph beside the id; until step 9 computesGraphID, the graph pointer stands for it, as the design's decision 4 ("every wire type carries GraphID") anticipates.actionFrame.node,nestedDelivery.path,unreceivedStream.source,stagedStream.flowandTraversal.Edgekeep their AST form: they are lowering's own shapes (PinBinding.Path,ObjectFlow,ActionEdge), which steps 4 and 8 convert, and the frame's node is whatScopes,Bindingsand the body machinery look up by.actionFrametype is shared with the state-behavior and calc-case hosts, so three one-line hunks land instate_statements.goandcalc_statements.go(thenodestable built by reference, thesubactionsmap type, thepauseAtsignature); nothing else of those executors moves.check_body.gospelled a paused breakpoint with%qover the wholebreakpointStoprecord, whichgo vetrejects once the record holds a graph pointer; it now spells the breakpoint's name. The spelling is a canonical-state key within one exploration, not a golden.No wire or snapshot format changes: snapshots and held images are in-memory copies, and the LSP, gRPC and REPL surfaces convert at the boundary (
BreakpointAt,NodesOf,Token.Node()), so their observable behaviour is unchanged. No conformance expectation, golden trace, ratchet or baseline moved.Stacked on #2137 (
feat/ir-program-ids), which must merge first; this PR is then retargeted todevelop.How it was verified
go build ./...,go vet ./...,gofmt -l .(empty),make lintgo test ./...with the training and pilot corpora fetched (go test -count=1 ./tests/corpus -run 'TestTrainingExamples|TestPilotCorpora'),go test ./tests/hygiene,go test -C tools ./...TestRuntimeRobustness*andTestRuntimeRobustnessReplay, the LSP debug tests,TestGRPCConformanceTestBreakpointAtResolvesNodesInTheirFlows(a breakpoint's ids resolve in the flows the path leads through, a path not leading to the node resolves to nothing, and the paused breakpoint and token report the same ids);TestCanonicalStateTellsUnreceivedStreamsApartnow lowers a real flow so its keys are ids.Checklist
make testandmake lintpass locallyLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/458b2ce75f4a4fcaa05a7ae049de7644
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/458b2ce75f4a4fcaa05a7ae049de7644?variant=devin
Requested by: @HuiJun
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work