Skip to content

Require complete BA states for modal components 馃 - #3260

Merged
lwrage merged 3 commits into
masterfrom
2279_check_modal_complete_states
Sep 19, 2026
Merged

lwrage merged 3 commits into
masterfrom
2279_check_modal_complete_states

Conversation

@lwrage

@lwrage lwrage commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

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.

Issue2279Test covers 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:

  • Before the fixes: the category regressions failed on missing diagnostics; the added omitted-states regression also failed because no required-state diagnostics were reported. All failures were isolated from unrelated AADL errors.
  • After the fix: all 4 regression tests and all 15 Issue3186Test tests passed. Focused builds selected :org.osate.ba,:org.osate.xtext.aadl2.ba,:org.osate.ba.tests,:org.osate.ba.feature with -Dtycho.localArtifacts=default, the common flags below, and clean verify/verify. Test selectors were -Dtest=Issue2279Test,BehaviorAnnexCharacterizationTest,BehaviorAnnexValidatedDiagnosticsTest (9 passed) and -Dtest=Issue3186Test,BehaviorAnnexCharacterizationTest,BehaviorAnnexValidatedDiagnosticsTest (20 passed), using -Dosate.ba.tests.regenerate=true to create/review the required golden updates.
  • Final clean root reactor: 143 projects, 1,701 tests across 15 test bundles; zero failures, errors, or skips, including all 218 BA tests and the golden comparisons with regeneration disabled. Counts were checked against fresh Surefire reports and the build log. git diff --check passed.
mvn -o -T5 -s releng/osate.releng/settings.xml -Plocal \
  -Dtycho.localArtifacts=ignore -Dpr.build=true -Dsign=false \
  -Dspotbugs=false -Dcodecoverage=false -Djavadoc=false \
  -DfailIfNoTests=false clean install

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.

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.
@lwrage
lwrage merged commit 342a10c into master Sep 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent error messages for behavior_specification on non-thread types

2 participants