Skip to content

Conversation

@crepererum
Copy link
Collaborator

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.

@crepererum crepererum force-pushed the crepererum/evil-payload branch 6 times, most recently from fd9e140 to 50e7b16 Compare November 12, 2025 11:52
Copy link
Collaborator Author

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] = &[
Copy link
Collaborator Author

@crepererum crepererum Nov 12, 2025

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:

  1. a single feature flag can now generate multiple binaries/constants. This makes sense for people with multiple examples
  2. I've streamlined the naming of the Justfile commands 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.

@crepererum crepererum force-pushed the crepererum/evil-payload branch 3 times, most recently from b115a30 to 2d3d8d4 Compare November 12, 2025 12:49
}
}

/// Add environment variable.
Copy link
Collaborator Author

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.

@@ -1,2 +1,3 @@
mod evil
Copy link
Contributor

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 {
Copy link
Contributor

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?

Copy link
Collaborator Author

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

@crepererum crepererum force-pushed the crepererum/evil-payload branch 3 times, most recently from b78d2ad to e4a2ac9 Compare November 13, 2025 11:08
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.
@crepererum crepererum force-pushed the crepererum/evil-payload branch from e4a2ac9 to 9f9544c Compare November 13, 2025 11:27
@crepererum crepererum marked this pull request as ready for review November 13, 2025 13:23
@crepererum crepererum requested a review from Sl1mb0 November 13, 2025 13:23
@crepererum crepererum mentioned this pull request Nov 13, 2025
15 tasks
@crepererum crepererum added this pull request to the merge queue Nov 14, 2025
Merged via the queue into main with commit 968838c Nov 14, 2025
1 check passed
@crepererum crepererum deleted the crepererum/evil-payload branch November 14, 2025 09:17
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.

3 participants