-
Notifications
You must be signed in to change notification settings - Fork 40
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
[WIP] [reconfigurator] introduce a simulator, make CLI use it #6856
Closed
Conversation
This file contains 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
Created using spr 1.3.6-beta.1
sunshowers
commented
Oct 14, 2024
sunshowers
commented
Oct 14, 2024
sunshowers
commented
Oct 14, 2024
sunshowers
commented
Oct 14, 2024
sunshowers
commented
Oct 14, 2024
|
||
use crate::errors::{DuplicateError, MissingError, NonEmptySystemError}; | ||
|
||
/// A versioned, simulated reconfigurator system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More documentation.
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Superseded by #7022. |
sunshowers
deleted the
sunshowers/spr/wip-reconfigurator-introduce-a-simulator-make-cli-use-it
branch
November 9, 2024 01:33
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.
For non-deterministic testing, it's useful to have a higher-level notion of a
succession of system states, which can be inspected, rewound, and other
branches explored as desired. Introduce this via a new
Simulator
struct.The individual states are roughly identical to the existing
ReconfiguratorSim
in the CLI, and are a pretty standard tree structure. Fornow I've chosen not to use a Merkle tree, just a UUID-based tree, but if
there's a good use case for it we may choose to make it a Merkle tree in the
future.
I've added a few basic features like storing the log of changes (though it's
not complete... I think I'll want to make
SystemDescription
follow the samestructure with read-only and mutable versions.)
As a proof of concept, this PR also rebuilds the current reconfigurator-cli
script on top of the simulator. I've not made any functional changes to the
CLI, but hope to add features like looking at the tree of states and undoing
them, and with non-deterministic testing to be able to load up the tree of
states.
The simulator uses a bunch of structural sharing via
Arc
. I was wonderingwhether I could use the
im
crate, but it doesn't seem to have anIndexMap
equivalent, but it doesn't seem to have an
IndexMap
equivalent that I couldtell. The
Arc
s should make cloning cheap enough that I don't think it's anissue in any case. (There's a comment in the PR about why I haven't used an
object-store-like style instead -- it's just easier to use
Arc
for now.)There's a bunch of work to be done before this can be landed, but I wanted to
put it up for folks to have an early look.
TODO fill this out in more detail.