-
Notifications
You must be signed in to change notification settings - Fork 1
feat: infrastructure for "evil" test payloads #162
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
Conversation
fd9e140 to
50e7b16
Compare
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.
The actual content of this file is now auto-generated, making it less cumbersome to keep in-sync.
| /// | ||
| /// This must be in-sync with the feature list in `Cargo.toml` and the imports in `src/lib.rs`. | ||
| /// This must be in-sync with the feature list in `Cargo.toml`. | ||
| const FEATURES: &[Feature] = &[ |
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.
There are two changes in here:
- a single feature flag can now generate multiple binaries/constants. This makes sense for people with multiple examples
- I've streamlined the naming of the
Justfilecommands so you now longer need to specify them here. One just needs to say if it's a lib or an example and we now auto-generate the Just command and also automatically know where the resulting output lands. It just makes this entire listing easier to mess up and avoids needless repetition.
b115a30 to
2d3d8d4
Compare
| } | ||
| } | ||
|
|
||
| /// Add environment variable. |
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.
passing env vars to the guests is kinda nice to implement the multi-plexing that our different evil payloads need (if we don't wanna build a large set of different WASM binaries, which IMHO has it's own issues), and is likely nice for other guests too.
2d3d8d4 to
29e29da
Compare
| @@ -1,2 +1,3 @@ | |||
| mod evil | |||
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.
muahahahaha
| } | ||
|
|
||
| /// <https://en.wikipedia.org/wiki/Ackermann_function>. | ||
| fn ackermann(m: u128, n: u128) -> u128 { |
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.
The Ackermann function is used here because it's not primitive recursive and thus it cannot be optimized away into a for loop; because the function is recursive and it won't be optimized away, a stack overflow can occur if n or m is large enough.
Do I understand correctly?
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.
correct, I'll extend the docstring to state that
b78d2ad to
e4a2ac9
Compare
Add the overall infrastructure so we can implement a large zoo of evil test payloads. Adds a few payloads already to demonstrate the architecture. This somewhat streamlines/re-designs the `guests/bundle` build script. For #16.
e4a2ac9 to
9f9544c
Compare
Add the overall infrastructure so we can implement a large zoo of evil test payloads. Adds a few payloads already to demonstrate the architecture.
This somewhat streamlines/re-designs the
guests/bundlebuild script.For #16.