Repository navigation
feat(migrate): faithful states, events and opaque behaviors in the v1 transformation census - #1037
Open
devin-ai-integration[bot] wants to merge 23 commits into
Open
devin-ai-integration[bot] wants to merge 23 commits into
devin-ai-integration[bot] wants to merge 23 commits into
Conversation
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…tes-events Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/sysml-v1-transformation-census-baseline.json # docs/project/sysml-v1-transformation-census.md # tests/corpus/testdata/pssm_migration_expected.txt # tests/migrate/migrate_test.go # tests/migrate/testdata/xmi/figures.golden.report.txt # tests/migrate/testdata/xmi/figures.mdzip.golden.report.txt
…ting Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
This reverts commit 33ccd9c.
…m completing" This reverts commit 0f39297.
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)".
|
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…g its owner Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
… bodies Co-Authored-By: jason.han <hanhuijun@gmail.com>
…tes-events Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/pssm-referee-baseline.json # docs/project/spec-compliance.md # docs/project/sysml-v1-transformation-census-baseline.json # docs/project/sysml-v1-transformation-census.md # internal/exec/runtime/state_executor.go # internal/exec/runtime/state_region_entry.go # internal/ir/lower/fork_plan.go # internal/translate/migrate/migrate.go # internal/translate/migrate/names.go # tests/migrate/testdata/xmi/parking_usecases.golden.report.txt
…tes-events Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/sysml-v1-transformation-census.md
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…y changes Co-Authored-By: jason.han <hanhuijun@gmail.com>
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
This closes the census group for states, events and opaque behaviours in the SysML v1 → v2 transformation census. Each row is now either faithful to OMG's
SysMLv1Tov2mapping (or a valid v2 equivalent of it) or deliberate, with the measured reason recorded.Migrator
OpaqueAction,OpaqueBehaviororFunctionBehaviorbody becomesrep language "<lang>" /* body */, which is OMG's TextualRepresentation, pairing bodies and languages by index. A translated body keeps its executable statements and now also keeps its source text. An untranslated body gets the representation instead of the old "body not migrated" comment. A body with no language stays a comment. A representation keeps the raw body, leading indentation included. Bodyless elements become plain usages or definitions and are reported as mapped.action <name> terminate;, with incoming transitions targeting that action. Before this change they were written as a transition todone, which only ended the enclosing region.parallelwrapper:state S parallel { …S's actions, deferrals, metadata… state <region> { entry; then A; … } }. Orthogonal regions are unchanged. The single region of a state machine is still flattened (see Candidate errata).accept after <duration>/accept at <instant>notation is the textual form of OMG's TimeTrigger structure, so those rows are recorded as faithful.Lowering and runtime
parallelOwnedMemberaccepts@Meta { … }(prefix metadata) in a parallel state's body, as it already acceptedmetadata …;. Wrapped states with deferrals need this.lower/fork_plan_test.go, plus the PSSM referee classifier and docs.=values in action, calc, block and state bodies hold at all times #842 and fix(runtime): write-granular change triggers, unordered composite entry, entry-action transition effects #833 also touchinternal/ir/lower/state_graph.goand state execution. This PR changesparallelOwnedMemberandrecordRegionInitialsthere, plus region entry and completion in the runtime.Census
Totals (faithful / approximate / not implemented / deliberate), measured on develop at
bc3333c11: 500 / 50 / 42 / 191 → 529 / 17 / 42 / 195.OpaqueAction_Mapping,OpaqueBehavior_Mapping,OpaqueBehaviorMembership_Mapping,OpaqueBehaviorSpecification_MappingTimeTrigger*rowsCommonPseudostate_Mapping,PseudoState_MappingRegion_MappingTimeEvent_Mapping,ChangeEvent_Mapping,ChangeEventReturnParameter_Mapping,ChangeEventReturnParameterMembership_MappingCandidate errata
OpaqueBehaviorSpecification_Mappingpairsbodywithlanguageby index, so a body with no language is dropped. The migrator keeps it as a comment.StateUsage, which drops the kind: a choice becomes a waiting state, and a fork fires one transition. The migrator writes choice, junction and history as#StateMachines::<kind> state, fork and join as nodes, and terminate asaction … terminate.Specification basis
SysMLv1Tov2.xmi, 2025-02-01): Region, Pseudostate, OpaqueAction, OpaqueBehavior and TimeTrigger mapping classes.docs/project/spec-compliance.mdhas rewritten rows for region default entry and completion, and for fork-omitted regions.How it was verified
go build ./...,go vet ./...,gofmt -l .(empty),OPENSYSML_REQUIRE_PSSM_SUITE=1 go test ./...,make lint,make docs-check,scripts/check-doc-ids.py,scripts/changelog.py check, census-check -require-xmiplusgo test -C tools ./census/transformation, andTestPSSMSuiteMigration.tests/migratefor opaque representations, terminate and the wrapper (entry, nested transition, exit, connection points, state actions, deferrals, orthogonal regions, no-entry regions).state_parallel_region_without_entry_completes(the Entering 004 shape),state_parallel_region_without_entry_inactive,state_fork_only_region_entered_by_default,state_nested_fork_starts_outer_region_inactive,state_history_restores_inactive_parallel_region,state_transition_cross_region_inactive_wrapper,state_parallel_deferred_event,state_history_first_entry_inactive_region,state_parallel_stand_in_do_action_defers_completion, and the single-region wrapper fixture.TestRuntimeRobustnessInactiveRegionandTestRuntimeRobustnessParallelWrapperLeavesInnerRegionInactive.PSSM
bc3333c11at 56 pass / 6 fail / 34 not-expressible / 7 differs-by-design. Entering 004 passes.bc3333c11TMT 2024x (
-migrate sysml -layout, then-validate,-compare-results -seed 1,analysis_report.pyand HTML rendering). Develop atbc3333c11can't migrate TMT on its own: sincedf6dc8876(from #1033), a dependency or comment on a nested requirement usage is written with a feature chain, so the notation doesn't parse. #1051 fixes that. Both sides below include #1051: developbc3333c11+ #1051 → this branch + #1051.-strict: develop → branchThe only verdict movement in either mode is 29 elements from approximated to mapped: 14
FunctionBehaviorand 15OpaqueBehavior, whose bodies are now textual representations. No element becomes unmapped.Checklist
make testandmake lintpass locallychanges/unreleased/census-states-events.changed.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/7e80a1d5715b4e8b9bf7039b09d8d589
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/7e80a1d5715b4e8b9bf7039b09d8d589?variant=devin
Requested by: @HuiJun