-
Notifications
You must be signed in to change notification settings - Fork 10
Add full structural information to runtime interface #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
This is a nice self-consistent waypoint, but it's a WIP. I'm about to do some refactoring and add more structural info (in particular, declared names) into the interface. The code generator has not been updated yet, so the integration tests will fail with this version.
This change adds a hierarchy of structs that provides tons of static (naming, structural) information about all instances of a given state machine at runtime. Unfortunately, while the interface and supporting methods compile, the tests don't because I can't actually instantiate this interface, in turn because didn't realize how limited Rust constants are... so I need to rethink my approach here. Committing this WIP since it's another decent waypoint. :-/
Finally settled on an interface that I can manually implement. The CI tests will fail (actually, they won't even compile) since the Rust backend isn't updated to actually generate implementations of this interface, but the `frame_runtime` tests (with manual implementations) all pass.
`MachineInfo#events()` should now contains all events (i.e. including enter/exit events) generable by the system, while the new method `MachineInfo#interface()` contains only the events declared in the `-interface-` block.
This is a mostly complete extension of the code generator to implement the new and significantly expanded runtime interface. All that's left is transitions, which are the trickiest bit, but I've got a plan. Compilation of generated code for tests will fail in the current state, and the tests will still need to be updated once code generation is finished.
This commit implements the new transition interface for standard transitions and change states. The only piece left is state-stack transitions. I've disabled the state-stack tests for now and updated the remaining tests (and added one more), so CI should finally pass again!
This updates the codegen for state-stack transitions to work with the new runtime interface. This is the last piece of the puzzle for the new interface. This restores the stack-stack tests and everything passes (phew!). Still have to do some dedicated testing of the new interface.
Only thing left to test is the runtime interface for state-stack transitions.
This revealed a bug in the general state stack implementation, so one of the tests is ignored. I'm about to fix that right now though.
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.
This extends the runtime interface to support querying essentially everything about a state machine compiled with
runtime_support
enabled. While the old interface (which is still present as a subset of the new one) essentially gave a snapshot of the currently running machine (current state and variable values), the new interface provides access to all of the structural information of the machine itself.Here are the new capabilities: