Expand SCXML parallel conformance - #37
Merged
Merged
Conversation
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.
Summary
+ 1assignment, and standalone strict integer equality guards.more-parallel/test10andtest10b, retaining byte-identical Apache-2.0 fixtures under the repository's existing provenance boundary.more-parallelcases.Why
more-parallel/test10andtest10bwere intentionally disabled because the importer did not initialize SCXML data, convert<assign>, or evaluate their integer guards. Once that data flow was present, the fixtures exposed a second issue: the transition-domain calculation treated an atomic self-transition as cycling the containing parallel state, which executed parent and sibling exit/entry behavior and produced the wrong counter sequence.The change implements only the syntax and transition behavior evidenced by these two fixtures. It does not add a JavaScript evaluator or claim broader SCXML datamodel support.
User and developer impact
Machine.transition(...)path.InvalidConfigErrorinstead of being ignored or evaluated.Machine(config, ...)boundary.Implementation
Fail-closed SCXML expression subset
datamodel="ecmascript"block containing simple identifiers initialized from non-negative integer literals.<assign location="x" expr="x + 1"/>only when the expression increments that same declared location by exactly one.x === 2; the existing Boolean-only parser remains unchanged.raiseandassignexecutable content in document order.Atomic self-transition boundary
Fixture provenance
test10.scxml,test10.json,test10b.scxml, andtest10b.jsonfrom SCXML Test Framework commitb46a10a1c3a3b1ca5c5cb4bb44ddb5c785611f41.tests/fixtures/scxml/PROVENANCE.mdownership boundary.Scope
Non-scope
Evidence and validation
Local validation on commit
730f1396baf7ab3ac9082f82fb137e20d2475ddf:428 passed.57 passed— 56 configured cases plus the fixture inventory/provenance guard.poetry check --lock: passed.xstate 0.7.0.Risks and mitigations
algorithm.pyis correctness-critical, and the atomic self-transition rule affects native machines as well as imported SCXML. A dedicated native parallel regression test plus the complete primary and SCXML suites cover the entry/exit boundary.AGENTS.mdare updated together with the enabled-case counts.Diff-size justification
The PR changes 15 files with 530 additions and 58 deletions. Of those additions, 194 lines are unmodified upstream fixture bytes. The remaining size is concentrated in the fail-closed parser boundary, focused acceptance/rejection tests, one native transition regression, and documentation required to state the new support limits accurately. The runtime change remains localized to
src/xstate/scxml.pyand a 16-line transition-domain adjustment insrc/xstate/algorithm.py.Rollback
Revert commit
730f1396baf7ab3ac9082f82fb137e20d2475ddf. That removes the parser and transition-domain changes, disables the two cases, removes the four vendored fixture files, and restores the prior documented 54-case boundary. No data migration, dependency rollback, or external cleanup is required.Review focus
InvalidConfigErrormessages.Unresolved decisions
None required for this PR. Additional assignment forms, data types, nested locations, and broader executable content remain explicitly deferred to separately evidenced work.
Merge order and release boundary
This is a standalone PR against
masterwith no prerequisite or follow-up merge ordering. It is intentionally draft for review and validation only; merging does not publish PyPI artifacts or deploy any runtime.