Repository navigation
test(runtime): pin a state's entry, do and exit actions as one performance each - #1507
Conversation
…mance each States::StateAction redefines StatePerformance's entry[1], do[1] and exit[1] steps without a multiplicity of its own, so an undeclared do or exit action is the default performance of a [1] composite feature, not an empty value; the library's [0..1] behavior-side features (incomingTransitionTrigger, accepted, viewRendering) hold nothing when unset. 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)".
|
…g part A state's attribute bound over its own occurrence features (`entryAction->size()`) is not re-derived in a held-image copy, so the fixture reads the counts through the exhibit usage from the owning part, which the image carries. Co-Authored-By: jason.han <hanhuijun@gmail.com>
|
b6978b3 moves the fixture's count attributes from the state defs to the exhibiting part ( |
What and why
A state declaring no
doorexitaction still reads one performance undersm.doActionandsm.exitAction(->size()1,->isEmpty()false), beside its declaredentry action enundersm.entryAction. That is the library's reading, and this PR pins it rather than changing it:States.sysmldeclaresStateAction's three actions with no multiplicity of their own —— so each inherits the
[1]of theStatePerformancestep it redefines (StatePerformances.kerml:step entry[1]; step do[1] subsets middle; step exit[1];, identical in the pilot's library XMI). An undeclared one is therefore the default performance the runtime materializes for any[1]composite feature (runtime/shape.goinheritedMultiplicity,runtime/instance.gomaterializeComposite), not an empty value. The[0..1]onStateDefinition::doAction : ActionUsage [0..1]is the metamodel's bound on thedodeclarations a state may own (SysML v2 §8.3.17), not the multiplicity of the performance; the pilot evaluator answeringsm.doActionas an empty sequence reads that declaration, not an instance.The library's genuinely optional behavior-side features already hold nothing when unset, and the fixture pins those beside the state actions:
StatePerformance::incomingTransitionTrigger : MessageTransfer[0..1]andaccepted : Transfer[0..1]readnull(->size()0),View::viewRendering : Rendering[0..1]reads[].No runtime code changes. Readings on
develop(111a59a) and on this branch are the same:sm.entryAction,sm.doAction,sm.exitActionbesideentry action ensm.doAction->size()/->isEmpty()sm.entryAction->size()sm.doAction->size()beside a declareddo action runsm.incomingTransitionTrigger,sm.acceptednull,->size()0v.viewRendering[],->size()0OccurrencesTest::p1.v,new OccurrencesTest::P1().vNo golden, baseline or sweep row moves (
TestLibraryAndPrefixSweepalready recordsst.doAction,es.doActionandS1().doActionasobject:Actions::Action).Not in this PR:
sm.entryActionwith the declareden(sm.entryAction == sm.enisfalseon develop; SysML v2checkActionUsageStateActionRedefinitionmakesenredefineentryAction), which fix(runtime): derive implicit specializations for every performance the run creates #1492 establishes through its state-action role redefinitions — the fixture pins counts and presence only, so it holds on both sides of that change.attribute n : Integer = entryAction->SequenceFunctions::size();, likewiseen->size()) evaluates in the live machine but is not re-derived in a held-image copy (StateDataWithError:no value for feature entryAction; the copy's state data reads{}) — a gap in the held image's restore of state binding cells ondevelop, which is why the fixture reads the counts from the part.Specification basis
KerML 1.0 §9.2.11.1 State Performances Overview ("entry [1] … do [1]: a middle Performance that starts before the others … exit [1]");
Kernel Semantic Library/StatePerformances.kerml;Systems Library/States.sysmlStateAction; SysML v2 §8.3.17StateDefinition::doAction : ActionUsage [0..1](declaration count, not instance multiplicity). New row indocs/project/spec-compliance.mdunder State Machine, after the exit-actions row.How it was verified
state_action_default_performances: a state with a declared entry only (entryAction/doAction/exitActionpresent, counts 1/1/1,doIsEmptyfalse,incomingTransitionTriggerandacceptednullwith counts 0), a state with declareddo/exit(counts 1/1), a view'sviewRendering[]; the counts are read through the exhibit usage from the owning part; flippingm.doCountto 0 fails the case (value = 1, want 0);TestHeldImageRoundTripcarries the casego build ./...,go vet ./...,gofmt -l .empty,make lint,go test ./internal/exec/runtime/...,go test ./cmd/sysml/...,go test ./...with the training, pilot, spec-example and pilot-library-XMI corpora downloaded and theirOPENSYSML_REQUIRE_*set,python3 scripts/changelog.py check,python3 scripts/check-doc-ids.pybytakes a feature chain; a satisfy stating nobyreads its owner as the subject #1466: no conflictsChecklist
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/aa6cec59dbcc4d458aa99224cfb6490f
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/aa6cec59dbcc4d458aa99224cfb6490f?variant=devin
Requested by: @HuiJun