fix(runtime): end a loop body's own performance of the node a terminate names - #844
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
This branch now conflicts with
To resolve: merge current Planned merge order for the execution PRs: #844 → #850 → #838 → (#851 → #853 → #857) → #830 → #833 → #842 → #837 → #834 → #816. Re-run the full gate ( |
|
Hold on pushes: please don't push to this branch, including |
…te names Co-Authored-By: jason.han <hanhuijun@gmail.com>
842d838 to
be267cf
Compare
What and why
A loop body reached by several tokens runs one performance of the body per token.
terminate slow;inside it reached the pausedslowperformances of the other loop performances too, because a statement node's body performed its nodes directly in the enclosing frame:ActionExecutor.ongoing(parent, node)filters by parent and node only, so every loop performance'sslowshared one parent. The same model written withsuccession(a stated flow) already scoped it to its own and failed withperformance already ended.Root-cause fix: a token's step of a statement node (
loop,if, assignment,send,terminatewritten as a statement) is now a transparent performance owning what its body performs.Feature reads and writes still go to the enclosing performance (the body's lexical frames are unchanged), and diagnostics name the same performances as before.
Fixtures. The two fixtures that relied on the cross-loop reach are redesigned so each still ends a paused performance in its own scope:
action_terminate_names_node_of_paused_bodies: each loop body'sslownaps while a watch inside it, due first, runsterminate slow;.action_terminate_names_node_performing_action: the same, withslowperformingNap.New
action_terminate_names_node_of_its_own_loop_performancepins the cross-loop case: the third loop performance'sslowends itself while the first two nap on and complete (napped = 2).Specification basis
Actions::TerminateActionperformsterminateOccurrence : destroyonterminatedOccurrence.OccurrenceFunctions::destroyconnectsocc.endShotto the destroy performance withHappensDuring, so the occurrence must end during the terminate. An occurrence whoseendShotalready happened cannot satisfy that, so terminating an ended performance stays the typedErrPerformanceEnded, not a no-op. A loop body'sterminate slowdesignates theslowof the body performance it runs in; each body performance owns its own.The terminate row in
docs/project/spec-compliance.mdis narrowed to the performances the statement runs within, and cites the new fixtures and robustness cases. It stays ✅ Faithful.How it was verified
robustness_terminate_nested_test.go(TestRuntimeRobustnessTerminateNestedFlowTarget):slowalready ended while the others are paused →ErrPerformanceEnded;ErrTerminateTarget.go build ./...,go vet ./...andgofmt -l .are clean.go test ./...passes with the corpora downloaded, excepttests/identity TestPilotLibraryXMI: that XMI isn't downloaded locally while its require variable is set.make docs-checkandpython3 scripts/changelog.py checkpass.Checklist
make testandmake lintpass locally (go test ./...; race run left to CI)changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake 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 changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/5344039f62464badb7a0a648e6384b08
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/5344039f62464badb7a0a648e6384b08?variant=devin
Requested by: @HuiJun