Require complete BA states for modal components 馃 - #3260
Merged
Merged
Conversation
Exercise missing initial and complete states on modal component types and implementations, including inherited memory modes. Require the exact BA diagnostics so unrelated AADL errors cannot satisfy the regression. Preserve valid device dispatch, nonmodal memory behavior, modal subprogram behavior, and complete states that do not represent modes. Before the fix, the two negative tests fail because only thread, device, and virtual processor categories are checked; the positive controls pass.
Apply the D.3 initial/complete-state requirement to non-subprogram classifiers with modes, including inherited modes, as well as the existing dispatchable categories. Keep the subprogram exception and optional mapping between complete states and modes. Add characterization records for issue #2279 and mark complete states in the existing mode-specific condition and subclause fixtures so their original diagnostics stay isolated. Document the distinction from the historical device-dispatch lookup failure, which is not reproducible on current master. Validation: the new regression and 15 related condition/mode tests pass. The clean offline root reactor passes all 143 projects and 1,700 tests with no failures, errors, or skips.
Run the state legality checks even when the annex has no states. This reports missing initial and complete states for dispatchable or modal components and missing initial and final states for subprograms. Add regression coverage for empty and variables-only annexes, inherited modes, and a nonmodal memory control. Record the fixture goldens and document the additional check. The new regression fails before the change and passes afterward. The clean offline root reactor passes 143 projects and 1,701 tests, including all 218 BA tests, with no failures, errors, or skips.
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.
Fixes #2279.
The BA validator required initial and complete states only for threads, devices, and virtual processors. A memory component with modes could therefore omit either required state without a diagnostic. AS5506/3 Rev. A D.3 also covers components that suspend awaiting a mode transition.
Extend the existing check to non-subprogram classifiers with modes, including modes inherited from a type or extended classifier. Run required-state checks even when the states section is omitted, so empty and variables-only annexes also report missing initial/complete states or, for subprograms, initial/final states. Keep mode refinement optional: memory states do not have to match mode names unless the existing all-or-none complete-state/mode rule applies. Three existing mode-specific fixtures now declare complete states so they continue to isolate their original condition and subclause-selection checks; their diagnostic expectations are unchanged.
Issue2279Testcovers 12 modal component categories in both types and implementations, missing initial/complete states with inherited memory modes, and valid external transitions between mode-representing states. Positive controls cover device dispatch, nonmodal memory, modal subprograms, and complete states with names unrelated to modes. Before the fix, the two negative tests failed on missing diagnostics and the positive test passed; all four issue regressions pass after the fix. The omitted-states regression separately demonstrated that empty and variables-only annexes produced no required-state diagnostics before removing the driver guard. The issue's corrected device example already validates on current master; the historical intermittent Dispatch_Protocol lookup failure was not reproduced and is not claimed as a new repair.Validation used JDK 21 and offline Tycho with Maven
-T5:Issue3186Testtests passed. Focused builds selected:org.osate.ba,:org.osate.xtext.aadl2.ba,:org.osate.ba.tests,:org.osate.ba.featurewith-Dtycho.localArtifacts=default, the common flags below, andclean verify/verify. Test selectors were-Dtest=Issue2279Test,BehaviorAnnexCharacterizationTest,BehaviorAnnexValidatedDiagnosticsTest(9 passed) and-Dtest=Issue3186Test,BehaviorAnnexCharacterizationTest,BehaviorAnnexValidatedDiagnosticsTest(20 passed), using-Dosate.ba.tests.regenerate=trueto create/review the required golden updates.git diff --checkpassed.Dependencies: based directly on master, with no unmerged PR dependencies. Existing modal models missing an initial or complete state will now receive the intended validation error; nonmodal categories retain their previous behavior.