fix(runtime): write-granular change triggers, unordered composite entry, entry-action transition effects - #833
devin-ai-integration[bot] wants to merge 13 commits into
Conversation
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…s out of the entry action Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ge triggers, adjudicate PSSM movements Co-Authored-By: jason.han <hanhuijun@gmail.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…ition out of an entry action Co-Authored-By: jason.han <hanhuijun@gmail.com>
…f an entry action Co-Authored-By: jason.han <hanhuijun@gmail.com>
…p choices open and alternatives disjunctive Co-Authored-By: jason.han <hanhuijun@gmail.com>
…Available Co-Authored-By: jason.han <hanhuijun@gmail.com>
…semantics Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # internal/check/passes/behavior/state_transition.go
…ransition is taken Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ating Co-Authored-By: jason.han <hanhuijun@gmail.com>
…eference to earlier behavior Co-Authored-By: jason.han <hanhuijun@gmail.com>
…semantics Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/behavior-semantic-oracle.md # internal/exec/runtime/snapshot.go
|
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 |
What and why
Three state-machine execution changes, each derived from the vendored Kernel Semantic and Systems libraries, plus adjudication of the PSSM referee failures.
when <expr>condition that became true and false again inside one step was missed.dostep and its substates' entry work are unordered, so both are scheduler choice points under-schedule explore. Before, there was one fixed order.entry action boot; transition boot do { … } then s;runs its effect after the entry action and beforesis entered. It may target a junction or choice in the same body. In a region of a parallel state, that effect is a unit of the region's entry front, as is a compound-transition segment's effect inside the region it enters. This closes five PSSM failures; the other six are adjudicated as suite defects or design differences.Specification basis
Change triggers.
Triggers.kermlTriggerWhenbuilds aChangeSignal, "a signal to be sent when the Boolean result of its changeCondition Expression changes from false to true" (Observation.kerml).ObserveChangewaits while the condition is false, then sends the signal. A condition's result can change only when a feature it reads is written. A write is seen only once it completes:FeatureWritePerformanceassigns its values "at time its performance ends", andFeatureMonitorPerformanceneeds a before time slice and an after snapshot that differ (FeatureReferencingPerformances.kerml). KerML has no clock, so the granularity the library supports is the completed write.So, after each completed outermost feature write, the runtime re-evaluates the conditions whose recorded read set the write touched. Each false-to-true rise queues one change signal, which the next dispatch consumes. A value that one assignment writes and replaces before it completes is never observed:
Probe and preview evaluation are excluded. Observed, pending and read-set state is carried by snapshots, held images and check-state keys. Executors whose graph has no change trigger return early.
spec-compliance.md: the ChangeEvent row moves to ✅ Faithful and its known limitation is removed.Composite entry.
StatePerformances.kerml:entry then middle,middle then exit, anddois amiddlestep. The substates' entry work is also within the state's middle, and the libraries do not order it against the composite's owndo. That is now a choice point rather than a fixed order (state_anonymous_action_body: both interleavings, with goldens). The known limitation is removed.Entry-action transitions. §7.18.3
EntryTransitionMember(the shorthandentry; then s;) is aGuardedTargetSuccession, so it still carries a guard at most. A transition whose source is a named entry action is aTransitionUsagewith an action source, performed as aNonStateTransitionPerformance(TransitionPerformances.kerml;Actions.sysmlDecisionTransitionAction):transitionLinkSource then effectandeffect then transitionLink.laterOccurrenceput the effect after the entry action and before the target's entry, within the entry.middlesteps, and nothing orders one region's transition performance against another's. So each effect precedes its own target's entry, and the regions interleave in every way.The pinned pilot accepts the shape, and still rejects a trigger on it ("A transition with an accepter must have a state as its source",
validateTransitionUsageTriggerActions). The full derivation is inbehavior-semantic-oracle.md§ "Effects on the way into the regions of a parallel state: each precedes its own target's entry, the regions interleave". Thespec-compliance.mdguarded-entry-transition row is updated, and a new row covers route effects inside a parallel state's regions.What now executes
accept when cfires on every admitted rise, including a rise followed by a fall within one run-to-completion step.doand its substates' entries interleave, and explore reaches each order.state_entry_transition_effect_junction_static,state_entry_transition_effect_opens_choice,state_entry_route_dead_alternative,state_entry_transition_junction_reads_outer_effect,state_entry_transition_junction_no_way_fails).What is still refused, and why
validateTransitionUsageTriggerActions).entry; then s;.GuardedTargetSuccessionhas no effect. The diagnostic suggests the named entry-action spelling.EntryTransitionTargetError.PSSM referee: 53/11/34/5 → 56/6/34/7
Three tests moved
fail→passand twofail→differs-by-design; no other bucket, reason or reached set moved. Each movement is adjudicated inpssm-referee.md§ "Movements since the previous baseline":entryaction (§7.18.3EntryTransitionMember;NonStateTransitionPerformance:succession transitionLinkSource then self), so its junction is read when that entry transition is taken, after the incoming effect and the composite's entry; with no guard true the run fails with a typed no-way-through error naming the junction.routeAvailablechecks only the incoming transition's own route.T1.3(effect)(the junction segment inside region 1) andT2.1(effect)are each units of their region's entry front afterS1(entry). All three admitted orders are reached.The six that remain
fail, each with evidence on file:omg-issues.mdomg-issues.mdomg-issues.mdpssm-referee.md,omg-issues.mdpssm-referee.mdThe baseline was regenerated only after these adjudications.
-check -jobs 8reproduces it, and the-jsonreports for-jobs 1and-jobs 8are byte-identical.How it was verified
go build ./...,go vet ./...: clean.gofmt -l .: empty.go test ./...andgo test -C tools ./...: pass.go test -race ./internal/exec/runtime/ ./internal/ir/lower/... ./internal/check/passes/behavior/...: pass.make docs-check: pass (0 broken links; IDs and figures OK).python3 scripts/changelog.py check: pass.download-training-examples.sh,download-pilot-corpora.sh,download-pilot-library-xmi.shanddownload-pssm-suite.sh.OPENSYSML_REQUIRE_TRAINING_CORPUS=1 OPENSYSML_REQUIRE_PILOT_CORPORA=1 OPENSYSML_REQUIRE_PILOT_LIBRARY_XMI=1 OPENSYSML_REQUIRE_PSSM_SUITE=1 go test -count=1 ./tests/corpus/... ./tests/identity/...: pass.training_examples_expected.txtis untouched, and the pilot-differential digest did not drift.-check: 1,293 agree / 33 disagree, identical todevelop. A triggered transition out of an entry action keeps the accepter-source diagnostic at the trigger (TransitionUsage_invalid.sysml.xt:54).state_change_trigger_transient_rise,state_change_trigger_atomic_write,state_anonymous_action_body(both orders), andstate_entry_transition_{effect,effect_regions,junction,choice,guarded_effect_not_taken,explicit_inner,history_restore,junction_no_way_disables}.state_junction_inside_orthogonal_regionnow has three outcomes.TestChangeTriggerKeepsOutsideWriteRiseUntilPoll(a rise and fall between polls fires) andTestChangeTriggerIgnoresRiseInsideOneWrite(inside one outermost write it does not; verified load-bearing by removing the bracket).TestRuntimeRobustnessChangeTriggerWritesandTestRuntimeRobustnessEntryTransitionEffect.-check. Its suite download failed with HTTP 429 from Maven Central. No fUML-relevant code changed.Checklist
make testandmake lintpass locallychanges/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/394b8e09b1374a4bb4d92ad8d1f5b7e1
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/394b8e09b1374a4bb4d92ad8d1f5b7e1?variant=devin
Requested by: @HuiJun