-
Notifications
You must be signed in to change notification settings - Fork 337
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
zkVM tests: add feature flag to build multi-test with docker environment #912
Merged
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
The reproducible build implementation used to be a part of the cargo-risczero utility. This change moves the code from cargo-risczero to risc0-build. By doing so, we will be able to integrate the docker builds as a part of the risc0-build mechanism. Eventually, it would be nice for users to be able to build guest code using by setting feature flags for the risc0-build crate. This code movement is the first step in facilitating users to use docker to build their guest code.
The tests being gated by this feature flag measure cycles and segments and are extremely sensitive to changes in the elf binary. We have seen cases where CI machines fail these tests on different architectures depending on the commit. What's interesting is that the test behavior changes even for commits that did not actually change the test. The root of this problem lies in the fact that rust does not support reproducible builds so that each architecture is running slightly mismatched ELF binaries from eachother. This is an attemp to eliminate test failures that happen from reproducible builds. The tests under this new flag must be run on elfs generated by the docker environment. All others can be run by the usual `cargo test` command.
flaub
reviewed
Sep 27, 2023
flaub
reviewed
Sep 27, 2023
flaub
reviewed
Sep 27, 2023
flaub
reviewed
Sep 27, 2023
flaub
reviewed
Sep 27, 2023
Co-authored-by: Frank Laub <flaub@risc0.com>
Benchmark for Linux-cuda fabecb5Click to hide benchmark
Benchmark for Linux-default
Benchmark for macOS-default fabecb5Click to hide benchmark
Benchmark for macOS-metal fabecb5Click to hide benchmark
|
flaub
approved these changes
Sep 27, 2023
Benchmark for Linux-cuda f7725bcClick to hide benchmark
Benchmark for Linux-default
Benchmark for macOS-default
Benchmark for macOS-metal
|
Benchmark for Linux-cuda
Benchmark for Linux-default
Benchmark for macOS-default 9e31afcClick to hide benchmark
Benchmark for macOS-metal 9e31afcClick to hide benchmark
|
Benchmark for Linux-cuda
Benchmark for Linux-default
Benchmark for macOS-default c2a7b26Click to hide benchmark
Benchmark for macOS-metal
|
The cargo metadata crate seems to not play nicely with absolute paths...
Benchmark for Linux-cuda
Benchmark for Linux-default
Benchmark for macOS-default
Benchmark for macOS-metal
|
Benchmark for Linux-cuda 101d599Click to hide benchmark
Benchmark for Linux-default
Benchmark for macOS-default
Benchmark for macOS-metal 101d599Click to hide benchmark
|
Benchmark for Linux-cuda
Benchmark for Linux-default
Benchmark for macOS-default 848e1eeClick to hide benchmark
Benchmark for macOS-metal
|
Benchmark for Linux-cuda acfdd8eClick to hide benchmark
Benchmark for Linux-default
Benchmark for macOS-default acfdd8eClick to hide benchmark
Benchmark for macOS-metal acfdd8eClick to hide benchmark
|
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 PR adds a test-exact-cycles feature for risc0-zkvm. This is used to build test guest binaries like multi-test using the docker environment in the
cargo test
command. The intention here is to run the tests using a reproducible ELF binary to eliminate test failures across different architectures that are caused by entropy in the ELF binaries resulting from rust build tools.I've gated 4 tests using this feature flag. Initially, what I had in mind was to isolate these tests to a different CI test step but I realized that it was cumbersome to isolate the 4 tests as integration tests and prevent other tests from running and I would have to proliferate a bunch of
#[cfg(feature = ...)]
directives. My solution is to create a new feature flag that the CI can use and it will run all tests including the ones that rely on exact cycles counts. If users do not wish to run the tests that require the reproducible binary, they can simply leave out thetest-exact-cycles
feature flag in theircargo test
invocation.Most of the code changes in this PR involves moving code from the
cargo risczero build
command to therisc0-build
crate.