Skip to content

fix: prevent infinite recursion when expanding a self-initial parallel state#93

Merged
joshua-temple merged 1 commit into
mainfrom
fix/verify-parallel-descend
May 31, 2026
Merged

fix: prevent infinite recursion when expanding a self-initial parallel state#93
joshua-temple merged 1 commit into
mainfrom
fix/verify-parallel-descend

Conversation

@joshua-temple
Copy link
Copy Markdown
Collaborator

configGraph.descend infinite-recursed when expanding a parallel state that also carries a self-referential initial-child marker — the shape produced by SuperState(X).Initial(X), which the food-delivery example uses for its Active superstate. Any invariant check (MutualExclusion/Implies/NeverActive) or bounded simulation over such a machine would hang.

Region initials are now consulted before the compound-initial marker (regions are authoritative for a parallel state), and the compound-initial branch is guarded against self-reference. Behavior is unchanged for every machine that previously terminated: the reordered branches differ only when a node has both region initials and a compound-initial marker, which arises solely for the degenerate self-initial parallel shape that previously looped.

Adds a regression test driving the self-initial parallel shape end to end through MutualExclusion, plus a compound-state case covering the guarded descent.

…l state

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple joshua-temple merged commit 49e171d into main May 31, 2026
10 checks passed
@joshua-temple joshua-temple deleted the fix/verify-parallel-descend branch May 31, 2026 23:59
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.

1 participant