-
Couldn't load subscription status.
- Fork 44
Guide for running KEVM tests with custom backends
This page is written with the assumption that you want to profile the proofs you are running. If you only want to run the proofs with a custom version of the backend, follow steps 1, 2, 3, and 4, then make your target normally. Step 8 may help fix PATH-related errors.
- Clone the KEVM semantics repo but don't follow the build instructions there.
-
cdinto your clone of KEVM and do the following:
rm -r deps .build # if you've build KEVM in this folder before
make deps SKIP_HASKELL=true
make build -j4Additionally, make sure your custom backend's executables are on your PATH. If your build of the backend is older than 04dd2a2 (Build with -eventlog by default, Jun 15 2021), you will also have to re-build it with the GHC option -eventlog.
- (Optional) Open the primary Makefile in a text editor. Change the variables
TEST_CONCRETE_BACKENDandTEST_SYMBOLIC_BACKENDto have the valuehaskelllike so:
# Tests
# -----
TEST_CONCRETE_BACKEND := haskell
TEST_SYMBOLIC_BACKEND := haskell
- Just to be sure, remove the executables
kore-exec kore-format kore-parser kore-prof kore-replfrom your standard frontend distribution so that the ones from your custom backend will be run instead. - Put
path/to/evm-semantics/.build/usr/binon yourPATH. If you need to edit thekevmscript, you'll have to also rebuild KEVM, as that process copies./kevmto.build/usr/bin/kevm. - Identify the KEVM
maketarget that you want to run. Runmake target TEST_SYMBOLIC_BACKEND=haskell --dry-run. - Copy the
kevmcommand that make outputs. Run this command and add--profile. You can also add--profile-timeout <timeout-spec>and--kore-prof-args "..."to control timeouts andkore-prof. This will output an eventlog and akore-prof'd.jsonfile in the same directory as the proof's spec. - If you see any error at any point about not being able to find one of the executables above, your backend executables aren't on your
PATH. Runexport PATH=$PATH:path/to/kore/.build/kore/binreplacingpath/to/koreby the path to your custom clone of the repo. Remember that this will add the right executables toPATHfor this terminal session only.
If you want to run a whole suite, you can modify the Makefile's kevm invocations to add the --profile option.
Be aware that the --haskell-backend-command option will mess with the profiling options passed to the backend by kevm. If you need to pass options to the backend, you'll probably be better off not using kevm's --profile option(s). To do this:
- Run
env GHCRTS='-l' make target. This will output an eventlog in the current working directory (I think, so if you do this, please confirm and then update this page). - Use
kore-profon that eventlog as needed. - You may want to set that target to only one single test at a time (followed by a manual save of the eventlog/prof produced) rather than an entire test-suite as that might give back eventlogs/profiles that are mashed together.