Skip to main content

Execute

Runs the guest through the same pipeline as prove but without producing a proof, so you can validate inputs and hint streams and measure execution cost before paying for proof generation. Documents the input, backend, and diagnostic flags plus the execution-statistics output.

Execute the guest program through the same pipeline that cargo-zisk prove uses, but without generating a proof. Use execute to validate that your inputs and hint streams are consistent with the path prove will take, and to measure execution cost end-to-end before paying for proof generation.

cargo-zisk execute [OPTIONS]
execute vs run

execute runs through the full proving pipeline (minus the proof itself), so it catches input and hint mismatches that run would miss. Use run for quick logic checks and cycle profiling; use execute when you are ready to validate that your program is provable.

Inputs

Identify the program to execute and the data fed to it.

FlagShortDefaultDescription
--elf <ELF>-eauto-detectedPath to the program ELF. If omitted, the ELF is auto-detected from the current project.
--inputs <INPUTS>-iemptyInput fed to the guest. Accepts an inline string literal or a path to a binary file.
--hints <HINTS>Precompiles hints URI for the guest. Requires the ASM backend (--asm).
note

If no setup files are found at the resolved location, execute invokes setup automatically before running, so you can go straight from build to execute without an explicit setup step.

Binary and profile selection

When the ELF is auto-detected (no --elf), these flags choose which build to use, just like selecting a Cargo target. All three are mutually exclusive with --elf.

FlagDefaultDescription
--releaseUse the release-profile build.
--debugdefaultUse the debug-profile build (the default).
--bin <BIN>Select the binary when the crate defines more than one.

Execution Backend

By default execute runs the guest through the portable Rust emulator. On Linux x86_64 you can switch to the native Assembly emulator.

FlagShortDefaultDescription
--asm-afalseUse the native Assembly emulator instead of the default Rust emulator (Linux x86_64).
--gpu-gfalseOffload witness generation to a CUDA-capable GPU.

Advanced

FlagShortDefaultDescription
--unlock-mapped-memory-ufalseUnlock the memory map for the ROM file. Only applies with --asm.

Diagnostics

FlagShortDefaultDescription
--verbose-voffIncrease output verbosity. Pass -v for info, -vv for debug-level detail.

Examples

Execute with the auto-detected ELF and an inline string input — the simplest invocation:

cargo-zisk execute --inputs ./inputs/data.bin

Execute with a binary input file:

cargo-zisk execute --inputs ./inputs/data.bin

Execute against a specific ELF, e.g. one built outside the current project:

cargo-zisk execute --elf ./dist/guest.elf --inputs ./inputs/data.bin

Execute a guest that expects precompile hints, supplying the hints file:

cargo-zisk execute --inputs ./inputs/data.bin --hints ./hints.bin

Switch to the native Assembly emulator instead of the default Rust emulator:

cargo-zisk execute --asm --inputs ./inputs/data.bin

Outputs

cargo-zisk execute forwards everything the guest writes to stdout directly to your terminal, the same way run does. After the guest finishes it prints execution statistics (RISC-V steps, cost, and per-stage timing) so you can compare a dry run against the real proving cost without paying for the proof.

INFO: --- PROOF INSTANCES SUMMARY ---
INFO: Zisk | Arith: 1 | Binary: 1 | BinaryExtension: 1 | Dma: 1 |
Dma64AlignedMem: 1 | DmaPrePost: 1 | DmaUnaligned: 1 | InputData: 1 |
Main: 1 | Mem: 1 | MemAlign: 1 | Rom: 1 | RomData: 1 | Sha256f: 1 |
SpecifiedRanges: 1 | VirtualTable0: 1 | VirtualTable1: 1 |
Total global instances: 17
INFO: --------------------------------
--- EXECUTE SUMMARY -----------
Execution completed in 189ms, steps: 15963
Execution summary: Proofman 27ms + Execution 3ms + Count&Plan 0ms + Count&Plan MO 0ms