VYPR
Low severityNVD Advisory· Published Jun 20, 2025· Updated Apr 15, 2026

CVE-2025-52484

CVE-2025-52484

Description

RISC Zero is a general computing platform based on zk-STARKs and the RISC-V microarchitecture. Due to a missing constraint in the rv32im circuit, any 3-register RISC-V instruction (including remu and divu) in risc0-zkvm 2.0.0, 2.0.1, and 2.0.2 are vulnerable to an attack by a malicious prover. The main idea for the attack is to confuse the RISC-V virtual machine into treating the value of the rs1 register as the same as the rs2 register due to a lack of constraints in the rv32im circuit. Rust applications using the risc0-zkvm crate at versions 2.0.0, 2.0.1, and 2.0.2 should upgrade to version 2.1.0. Smart contract applications using the official RISC Zero Verifier Router do not need to take any action: zkVM version 2.1 is active on all official routers, and version 2.0 has been disabled. Smart contract applications not using the verifier router should update their contracts to send verification calls to the 2.1 version of the verifier.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
risc0-zkvmcrates.io
>= 2.0.0, < 2.1.02.1.0
risc0-circuit-rv32imcrates.io
>= 2.0.0, < 2.0.42.0.4

Patches

4
006d86c363b1

ZKVM-1392: Disallow memory I/O to same address in the same memory cycle (#3181)

https://github.com/risc0/risc0Frank LaubMay 23, 2025via ghsa
34 files changed · +153037 178697
  • risc0/build/src/docker.rs+1 1 modified
    @@ -268,7 +268,7 @@ mod test {
             compare_image_id(
                 &guest_list,
                 "hello_commit",
    -            "97323d9305f6de30f4930c03f0e2e5018c7e7bd06ee10a505a93cfe898e1c60f",
    +            "746da1fdbff7e11b281938fcff1f0d3716712c34af385b55229b074e0f1a3d9a",
             );
         }
     }
    
  • risc0/circuit/recursion/build.rs+1 1 modified
    @@ -41,7 +41,7 @@ fn download_zkr() {
     
         const FILENAME: &str = "recursion_zkr.zip";
         const SRC_PATH: &str = "src/recursion_zkr.zip";
    -    const SHA256_HASH: &str = "5f1762201f5c4afb5d92df4a5b8e5bf5c87b67785991592ba79ce4033719b030";
    +    const SHA256_HASH: &str = "b51785b36bff327f8fc7f3983aea343d1daf015a09189dedb5a3e851884db98e";
     
         fn check_sha2(path: &Path) -> bool {
             let data = fs::read(path).unwrap();
    
  • risc0/circuit/recursion/src/control_id.rs+32 32 modified
    @@ -23,22 +23,22 @@ pub const MIN_LIFT_PO2: usize = 14;
     pub const ALLOWED_CONTROL_IDS: &[Digest] = &[
         digest!("0d79bc33b4760b4783cbb96fdc87724c7e0c463eb0ba1b2705d39f43c698bd2d"), // recursion identity.zkr
         digest!("7a8f24092c34ed3eb81b3d0a0b796c588c615d3488ef9e61c21dbd1e4b83ea6e"), // recursion join.zkr
    -    digest!("512b79026fad0712ad93600ea0ea4234d0be686ea9473e4964f10914a0862c77"), // recursion lift_rv32im_v2_14.zkr
    -    digest!("78aabd63d877bc2806371f228fb05d0f9c8c3330bc782f62c7c6d80b4195de74"), // recursion lift_rv32im_v2_15.zkr
    -    digest!("0bef5e34d752b46874fb523c7d01963a37771d25a6af7c26b808fa26b8a0d815"), // recursion lift_rv32im_v2_16.zkr
    -    digest!("ac1a445d5babf304365232571f822725dcf71f3c8d5e7032c1bba04bad19a85e"), // recursion lift_rv32im_v2_17.zkr
    -    digest!("20ae3d31f954e9594cb968463ce0f823b869e3640169a561fc917226f4ca8963"), // recursion lift_rv32im_v2_18.zkr
    -    digest!("6f16e65efedcbf11b20b9e194e123e33aaedcd0abf1e6e5440efa263daeb375a"), // recursion lift_rv32im_v2_19.zkr
    -    digest!("6da21d5bc6a7534bc686b9294717f12994b13c67183c86668c62d01fcc453151"), // recursion lift_rv32im_v2_20.zkr
    -    digest!("60ea420126e9446430dbed5ca8b29017b6d0f31782710a1d8f8bdd3de5854714"), // recursion lift_rv32im_v2_21.zkr
    -    digest!("d5f05524e8bbb123f8fb1b5299413c50462cef399119953f494e57354351e844"), // recursion lift_rv32im_v2_22.zkr
    +    digest!("8af493194e835b276eefc2522cf71761afdb04286bd3490577d55419049eed21"), // recursion lift_rv32im_v2_14.zkr
    +    digest!("ff455665b3743b2e4ec959674cfec4064fa54420ef0f6d38a601e85a841c3a73"), // recursion lift_rv32im_v2_15.zkr
    +    digest!("94a836188680865ff490ae12c140ec1c3a462c67203eda37f3ac6720d680a862"), // recursion lift_rv32im_v2_16.zkr
    +    digest!("b8c3e64be7662b1c9fc04d65dc276b1a5402b66a657fca4486450417b517a96e"), // recursion lift_rv32im_v2_17.zkr
    +    digest!("7768ce5e55c6e0427962342cc0c4cd43b359da5187d65465317c8c065357cd1d"), // recursion lift_rv32im_v2_18.zkr
    +    digest!("cdfd5d3007f57a1836f83c351fbb3d0f7af43050f5f6a06296f9ba25b516eb69"), // recursion lift_rv32im_v2_19.zkr
    +    digest!("14eb825f500342317158942d328a745e9dda2043b5bc27248f726e57effe2d23"), // recursion lift_rv32im_v2_20.zkr
    +    digest!("d3286f768d13864fa7cc921a25ead7536d09d56ad304a9635c3fa60f511eea62"), // recursion lift_rv32im_v2_21.zkr
    +    digest!("5e37cb58440474617b5beb2e1f3e7472d76a5e7572bb4660896d1074dfa7905d"), // recursion lift_rv32im_v2_22.zkr
         digest!("53a7b23d07f99e5d5685e85874f5181e8486aa267a0ae607ffe9ba47c8bdda4a"), // recursion resolve.zkr
         digest!("7771415b778fea1923440e2eb22c4a1e1d7ada2d42cbe03d13402743c0988a31"), // recursion union.zkr
     ];
     
     /// Root of the Merkle tree constructed from [ALLOWED_CONTROL_IDS], using Poseidon2.
     pub const ALLOWED_CONTROL_ROOT: Digest =
    -    digest!("539032186827b06719244873b17b2d4c122e2d02cfb1994fe958b2523b844576");
    +    digest!("884389273e128b32475b334dec75ee619b77cb33d41c332021fe7e44c746ee60");
     
     /// Control ID for the identity recursion programs (ZKR), using Poseidon over the BN254 scalar field.
     pub const BN254_IDENTITY_CONTROL_ID: Digest =
    @@ -100,47 +100,47 @@ pub const POSEIDON2_CONTROL_IDS: [(&str, Digest); 27] = [
         ),
         (
             "lift_rv32im_v2_14.zkr",
    -        digest!("512b79026fad0712ad93600ea0ea4234d0be686ea9473e4964f10914a0862c77"),
    +        digest!("8af493194e835b276eefc2522cf71761afdb04286bd3490577d55419049eed21"),
         ),
         (
             "lift_rv32im_v2_15.zkr",
    -        digest!("78aabd63d877bc2806371f228fb05d0f9c8c3330bc782f62c7c6d80b4195de74"),
    +        digest!("ff455665b3743b2e4ec959674cfec4064fa54420ef0f6d38a601e85a841c3a73"),
         ),
         (
             "lift_rv32im_v2_16.zkr",
    -        digest!("0bef5e34d752b46874fb523c7d01963a37771d25a6af7c26b808fa26b8a0d815"),
    +        digest!("94a836188680865ff490ae12c140ec1c3a462c67203eda37f3ac6720d680a862"),
         ),
         (
             "lift_rv32im_v2_17.zkr",
    -        digest!("ac1a445d5babf304365232571f822725dcf71f3c8d5e7032c1bba04bad19a85e"),
    +        digest!("b8c3e64be7662b1c9fc04d65dc276b1a5402b66a657fca4486450417b517a96e"),
         ),
         (
             "lift_rv32im_v2_18.zkr",
    -        digest!("20ae3d31f954e9594cb968463ce0f823b869e3640169a561fc917226f4ca8963"),
    +        digest!("7768ce5e55c6e0427962342cc0c4cd43b359da5187d65465317c8c065357cd1d"),
         ),
         (
             "lift_rv32im_v2_19.zkr",
    -        digest!("6f16e65efedcbf11b20b9e194e123e33aaedcd0abf1e6e5440efa263daeb375a"),
    +        digest!("cdfd5d3007f57a1836f83c351fbb3d0f7af43050f5f6a06296f9ba25b516eb69"),
         ),
         (
             "lift_rv32im_v2_20.zkr",
    -        digest!("6da21d5bc6a7534bc686b9294717f12994b13c67183c86668c62d01fcc453151"),
    +        digest!("14eb825f500342317158942d328a745e9dda2043b5bc27248f726e57effe2d23"),
         ),
         (
             "lift_rv32im_v2_21.zkr",
    -        digest!("60ea420126e9446430dbed5ca8b29017b6d0f31782710a1d8f8bdd3de5854714"),
    +        digest!("d3286f768d13864fa7cc921a25ead7536d09d56ad304a9635c3fa60f511eea62"),
         ),
         (
             "lift_rv32im_v2_22.zkr",
    -        digest!("d5f05524e8bbb123f8fb1b5299413c50462cef399119953f494e57354351e844"),
    +        digest!("5e37cb58440474617b5beb2e1f3e7472d76a5e7572bb4660896d1074dfa7905d"),
         ),
         (
             "lift_rv32im_v2_23.zkr",
    -        digest!("b4459e2bc38f800ed80c956234d59a4611d0f825eae566478ac4c06a07a61c21"),
    +        digest!("387a9e1a4752e35bbcc27a05c9102713fd6e42728f1bae74bb21d9054a87cc08"),
         ),
         (
             "lift_rv32im_v2_24.zkr",
    -        digest!("4434690c184bd542c823aa1efcf6c15cf8c83d0aafbf4f3e0552d8125eedd12a"),
    +        digest!("60c7632be5c98c38b567522947c03a1048882d2beeba175b63060351486e670d"),
         ),
         (
             "resolve.zkr",
    @@ -212,47 +212,47 @@ pub const SHA256_CONTROL_IDS: [(&str, Digest); 27] = [
         ),
         (
             "lift_rv32im_v2_14.zkr",
    -        digest!("9515af7e33bb75efd90a1f23b12762ca36231881656b4af9fd1685a6ff4ec018"),
    +        digest!("d60c25f02824db9fc7bdcecdc4d431d2d22b65eba7948825948ae1bc92d60946"),
         ),
         (
             "lift_rv32im_v2_15.zkr",
    -        digest!("2b0d1276550887f6b27a423f43a4ce89abef45e056d86c8a59fa8d4593701844"),
    +        digest!("ef84c7599ba1c513dc60370fcf10f0ad97a1849f92e455b7d6dd8359c427a187"),
         ),
         (
             "lift_rv32im_v2_16.zkr",
    -        digest!("92f3c9ee2e5e1a23d90a0e7dd52bf7b9b4f1e272613ac76e5bf6e932fa8de0ec"),
    +        digest!("99139be7bc3b8692f5c38c37529cc84915cce84f8bcd3fa7913abc7984192b2b"),
         ),
         (
             "lift_rv32im_v2_17.zkr",
    -        digest!("4d9c713b2dfa00271b9d4a87ef4244974a85bbb20b493cd103d75b4fcc60d411"),
    +        digest!("bf6c6915e4f31661e11edb487a57c2a56aa44203b9e6886a2a703a44103b2748"),
         ),
         (
             "lift_rv32im_v2_18.zkr",
    -        digest!("7054dde82886b4a8955539872ff4784973a61782ec71348a405564a21ae3f630"),
    +        digest!("21f330b32a66a4352025edf53ac05ecf10cd5ea9db6302c755de421d4cc6589e"),
         ),
         (
             "lift_rv32im_v2_19.zkr",
    -        digest!("c4abec2567fbd603ce616ecd27923f45b601d5f86cc48d1f1fb3091615afb6fd"),
    +        digest!("57049b4e505fa5f706847e9ba3905d93eb0198fe1b69fd19405e3ae3aa266009"),
         ),
         (
             "lift_rv32im_v2_20.zkr",
    -        digest!("1263bd3dcecab89069b91de5c4c99bdc33f853b00b50e1f35e4ffa392badd7a4"),
    +        digest!("9889b3329bd0d2c4694113b4e56790f105efb2b79effd21bfc0c3c3f41bd8066"),
         ),
         (
             "lift_rv32im_v2_21.zkr",
    -        digest!("7380d1f06f8fb3dc3f9c7d278071fbc3bf30073229c6885d1a41c6528e90e4c7"),
    +        digest!("9c976973ab89b8497fc830c1a0305e9f907dbbd40574482e93f6e18458ee2a87"),
         ),
         (
             "lift_rv32im_v2_22.zkr",
    -        digest!("793cbfc8de47a9beeb2221cac0d06470fc87e26771330561369fb518cc3b1b05"),
    +        digest!("a1521c33c8faf68b3db10be0aa3fbde3e100ae8ec924206529db4f1cefe70d5b"),
         ),
         (
             "lift_rv32im_v2_23.zkr",
    -        digest!("7bc461a9ff258b32178124b8c8f78cadac35db313b57f62d51958ec9ec37fb71"),
    +        digest!("45da7396e10423a381e3e42c25a5fb05bb27389e8ca1c73f046de24e790c7727"),
         ),
         (
             "lift_rv32im_v2_24.zkr",
    -        digest!("dc295096d9db9166e06e424445563cc4bec8fdb1a69e3b2fcee1bba75fa85883"),
    +        digest!("8645ae4ab3fa5686dafa447471959834cf4c68d65af8f04cc55300497d31c197"),
         ),
         (
             "resolve.zkr",
    
  • risc0/circuit/recursion/src/recursion_zkr.zip+2 2 modified
    @@ -1,3 +1,3 @@
     version https://git-lfs.github.com/spec/v1
    -oid sha256:5f1762201f5c4afb5d92df4a5b8e5bf5c87b67785991592ba79ce4033719b030
    -size 47454351
    +oid sha256:b51785b36bff327f8fc7f3983aea343d1daf015a09189dedb5a3e851884db98e
    +size 47476190
    
  • risc0/circuit/rv32im/src/execute/r0vm.rs+1 1 modified
    @@ -321,7 +321,7 @@ impl<'a, T: Risc0Context> Risc0Machine<'a, T> {
                         rlen -= WORD_SIZE as u32;
                     } else {
                         // tracing::trace!("store: {:#010x} -> null", 0);
    -                    self.store_memory(SAFE_WRITE_ADDR.waddr(), 0)?;
    +                    self.store_memory(SAFE_WRITE_ADDR.waddr() + j, 0)?;
                     }
                 }
     
    
  • risc0/circuit/rv32im/src/execute/rv32im.rs+16 2 modified
    @@ -421,6 +421,20 @@ impl Emulator {
             Ok(())
         }
     
    +    fn load_rs2<M: EmuContext>(
    +        &self,
    +        ctx: &mut M,
    +        decoded: &DecodedInstruction,
    +        rs1: u32,
    +    ) -> Result<u32> {
    +        if decoded.rs1 == decoded.rs2 {
    +            Ok(rs1)
    +        } else {
    +            ctx.load_register(decoded.rs2 as usize)
    +        }
    +    }
    +
    +    #[inline(always)]
         fn step_compute<M: EmuContext>(
             &mut self,
             ctx: &mut M,
    @@ -431,7 +445,7 @@ impl Emulator {
             let mut new_pc = pc + WORD_SIZE;
             let mut rd = decoded.rd;
             let rs1 = ctx.load_register(decoded.rs1 as usize)?;
    -        let rs2 = ctx.load_register(decoded.rs2 as usize)?;
    +        let rs2 = self.load_rs2(ctx, &decoded, rs1)?;
             let imm_i = decoded.imm_i();
             let mut br_cond = |cond| -> u32 {
                 rd = 0;
    @@ -602,7 +616,7 @@ impl Emulator {
             decoded: &DecodedInstruction,
         ) -> Result<bool> {
             let rs1 = ctx.load_register(decoded.rs1 as usize)?;
    -        let rs2 = ctx.load_register(decoded.rs2 as usize)?;
    +        let rs2 = self.load_rs2(ctx, &decoded, rs1)?;
             let addr = ByteAddr(rs1.wrapping_add(decoded.imm_s()));
             let shift = 8 * (addr.0 & 3);
             if !ctx.check_data_store(addr) {
    
  • risc0/circuit/rv32im/src/prove/witgen/preflight.rs+3 2 modified
    @@ -14,7 +14,7 @@
     
     use std::collections::BTreeSet;
     
    -use anyhow::{anyhow, bail, Result};
    +use anyhow::{anyhow, bail, ensure, Result};
     use derive_more::Debug;
     use num_traits::FromPrimitive as _;
     use risc0_binfmt::{ByteAddr, WordAddr};
    @@ -216,7 +216,8 @@ impl<'a> Preflight<'a> {
                     txn.prev_cycle = self.prev_cycle.get(&addr).unwrap();
                 } else {
                     // Otherwise, compute cycle diff and another diff
    -                let diff = txn.cycle - txn.prev_cycle;
    +                ensure!(txn.cycle != txn.prev_cycle);
    +                let diff = txn.cycle - 1 - txn.prev_cycle;
                     self.trace.cycles[(diff / 2) as usize].diff_count[(diff % 2) as usize] += 1;
                 }
     
    
  • risc0/circuit/rv32im/src/zirgen/info.rs+17 18 modified
    @@ -30,7 +30,7 @@ impl CircuitInfo for CircuitImpl {
     }
     
     #[allow(dead_code)]
    -pub const NUM_POLY_MIX_POWERS: usize = 472;
    +pub const NUM_POLY_MIX_POWERS: usize = 458;
     
     #[allow(dead_code)]
     pub const POLY_MIX_POWERS: &[usize] = &[
    @@ -42,21 +42,20 @@ pub const POLY_MIX_POWERS: &[usize] = &[
         117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
         136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
         155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
    -    174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 187, 188, 190, 197, 198, 199, 200, 201, 202,
    -    203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221,
    -    222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
    -    241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259,
    -    260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
    -    279, 280, 285, 298, 304, 310, 315, 324, 326, 328, 329, 331, 335, 336, 342, 343, 344, 345, 346,
    -    347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365,
    -    366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
    -    385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403,
    -    404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 428, 436, 456,
    -    471, 510, 513, 521, 586, 592, 604, 635, 651, 658, 674, 681, 704, 705, 706, 707, 708, 709, 710,
    -    711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729,
    -    756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774,
    -    775, 790, 808, 950, 1040, 1127, 1214, 1352, 1544, 1825, 2128, 2279, 2428, 3295, 3715, 5722,
    -    6131, 6835, 7551, 7552, 7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564,
    -    7567, 7570, 7573, 7577, 7580, 7583, 7587, 7597, 7607, 7617, 7631, 7648, 7658, 7669, 7689, 7699,
    -    7718, 7720, 7727,
    +    174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 185, 187, 188, 190, 197, 198, 199, 200, 201,
    +    202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
    +    221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
    +    240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258,
    +    259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277,
    +    278, 279, 280, 298, 304, 310, 317, 323, 326, 328, 329, 334, 335, 343, 349, 350, 354, 355, 361,
    +    362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380,
    +    381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399,
    +    400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418,
    +    419, 420, 436, 447, 456, 471, 513, 521, 529, 586, 604, 611, 635, 651, 658, 681, 693, 704, 705,
    +    706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724,
    +    725, 726, 727, 728, 729, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788,
    +    789, 790, 791, 792, 793, 794, 808, 828, 1007, 1040, 1127, 1214, 1428, 1544, 1825, 2223, 2374,
    +    2542, 3409, 3829, 5836, 6245, 6949, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674,
    +    7675, 7676, 7677, 7678, 7681, 7684, 7687, 7691, 7694, 7697, 7701, 7711, 7721, 7731, 7745, 7762,
    +    7772, 7783, 7803, 7813, 7832, 7834, 7841,
     ];
    
  • risc0/circuit/rv32im/src/zirgen/layout.rs.inc+3693 3388 modified
  • risc0/circuit/rv32im/src/zirgen/poly_ext.rs+18967 18760 modified
  • risc0/circuit/rv32im/src/zirgen/types.rs.inc+132 23 modified
    @@ -465,6 +465,23 @@ impl risc0_zkp::layout::Component for DecodeInstLayout {
             Ok(())
         }
     }
    +pub type MemoryArgLayout4LayoutArray = [&'static MemoryArgLayout; 4];
    +pub type CycleArgLayout2LayoutArray = [&'static CycleArgLayout; 2];
    +pub struct _Arguments_ReadSourceRegsSourceRegsLayout {
    +    pub memory_arg: &'static MemoryArgLayout4LayoutArray,
    +    pub cycle_arg: &'static CycleArgLayout2LayoutArray,
    +}
    +impl risc0_zkp::layout::Component for _Arguments_ReadSourceRegsSourceRegsLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "_Arguments_ReadSourceRegsSourceRegsLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("memory_arg", self.memory_arg)?;
    +        v.visit_component("cycle_arg", self.cycle_arg)?;
    +        Ok(())
    +    }
    +}
     pub struct ReadRegLayout {
         pub _super: &'static MemoryReadLayout,
         pub addr: &'static NondetRegLayout,
    @@ -480,10 +497,99 @@ impl risc0_zkp::layout::Component for ReadRegLayout {
             Ok(())
         }
     }
    +pub struct ReadSourceRegsSourceRegsArm0_SuperLayout {
    +    pub rboth: &'static ReadRegLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsSourceRegsArm0_SuperLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsSourceRegsArm0_SuperLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("rboth", self.rboth)?;
    +        Ok(())
    +    }
    +}
    +pub struct ReadSourceRegsSourceRegsArm0Layout {
    +    pub _super: &'static ReadSourceRegsSourceRegsArm0_SuperLayout,
    +    pub _extra0: &'static MemoryArgLayout,
    +    pub _extra1: &'static MemoryArgLayout,
    +    pub _extra2: &'static CycleArgLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsSourceRegsArm0Layout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsSourceRegsArm0Layout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("_super", self._super)?;
    +        v.visit_component("_extra0", self._extra0)?;
    +        v.visit_component("_extra1", self._extra1)?;
    +        v.visit_component("_extra2", self._extra2)?;
    +        Ok(())
    +    }
    +}
    +pub struct ReadSourceRegsSourceRegsArm1_SuperLayout {
    +    pub _0: &'static ReadRegLayout,
    +    pub _1: &'static ReadRegLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsSourceRegsArm1_SuperLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsSourceRegsArm1_SuperLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("_0", self._0)?;
    +        v.visit_component("_1", self._1)?;
    +        Ok(())
    +    }
    +}
    +pub struct ReadSourceRegsSourceRegsLayout {
    +    pub arm0: &'static ReadSourceRegsSourceRegsArm0Layout,
    +    pub arm1: &'static ReadSourceRegsSourceRegsArm1_SuperLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsSourceRegsLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsSourceRegsLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("arm0", self.arm0)?;
    +        v.visit_component("arm1", self.arm1)?;
    +        Ok(())
    +    }
    +}
    +pub struct ReadSourceRegsLayout {
    +    pub is_same_reg: &'static NondetRegLayout,
    +    pub _arguments_read_source_regs_source_regs: &'static _Arguments_ReadSourceRegsSourceRegsLayout,
    +    pub source_regs: &'static ReadSourceRegsSourceRegsLayout,
    +    pub rs1_low: &'static NondetRegLayout,
    +    pub rs1_high: &'static NondetRegLayout,
    +    pub rs2_low: &'static NondetRegLayout,
    +    pub rs2_high: &'static NondetRegLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("is_same_reg", self.is_same_reg)?;
    +        v.visit_component(
    +            "_arguments_read_source_regs_source_regs",
    +            self._arguments_read_source_regs_source_regs,
    +        )?;
    +        v.visit_component("source_regs", self.source_regs)?;
    +        v.visit_component("rs1_low", self.rs1_low)?;
    +        v.visit_component("rs1_high", self.rs1_high)?;
    +        v.visit_component("rs2_low", self.rs2_low)?;
    +        v.visit_component("rs2_high", self.rs2_high)?;
    +        Ok(())
    +    }
    +}
     pub struct MiscInputLayout {
         pub decoded: &'static DecodeInstLayout,
    -    pub rs1: &'static ReadRegLayout,
    -    pub rs2: &'static ReadRegLayout,
    +    pub source_regs: &'static ReadSourceRegsLayout,
     }
     impl risc0_zkp::layout::Component for MiscInputLayout {
         fn ty_name(&self) -> &'static str {
    @@ -492,8 +598,7 @@ impl risc0_zkp::layout::Component for MiscInputLayout {
         #[allow(unused_variables)]
         fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
             v.visit_component("decoded", self.decoded)?;
    -        v.visit_component("rs1", self.rs1)?;
    -        v.visit_component("rs2", self.rs2)?;
    +        v.visit_component("source_regs", self.source_regs)?;
             Ok(())
         }
     }
    @@ -1466,8 +1571,7 @@ impl risc0_zkp::layout::Component for Misc2Layout {
     }
     pub struct MulInputLayout {
         pub decoded: &'static DecodeInstLayout,
    -    pub rs1: &'static ReadRegLayout,
    -    pub rs2: &'static ReadRegLayout,
    +    pub source_regs: &'static ReadSourceRegsLayout,
     }
     impl risc0_zkp::layout::Component for MulInputLayout {
         fn ty_name(&self) -> &'static str {
    @@ -1476,8 +1580,7 @@ impl risc0_zkp::layout::Component for MulInputLayout {
         #[allow(unused_variables)]
         fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
             v.visit_component("decoded", self.decoded)?;
    -        v.visit_component("rs1", self.rs1)?;
    -        v.visit_component("rs2", self.rs2)?;
    +        v.visit_component("source_regs", self.source_regs)?;
             Ok(())
         }
     }
    @@ -1953,8 +2056,7 @@ impl risc0_zkp::layout::Component for Mul0Layout {
     }
     pub struct DivInputLayout {
         pub decoded: &'static DecodeInstLayout,
    -    pub rs1: &'static ReadRegLayout,
    -    pub rs2: &'static ReadRegLayout,
    +    pub source_regs: &'static ReadSourceRegsLayout,
     }
     impl risc0_zkp::layout::Component for DivInputLayout {
         fn ty_name(&self) -> &'static str {
    @@ -1963,8 +2065,7 @@ impl risc0_zkp::layout::Component for DivInputLayout {
         #[allow(unused_variables)]
         fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
             v.visit_component("decoded", self.decoded)?;
    -        v.visit_component("rs1", self.rs1)?;
    -        v.visit_component("rs2", self.rs2)?;
    +        v.visit_component("source_regs", self.source_regs)?;
             Ok(())
         }
     }
    @@ -2677,8 +2778,7 @@ impl risc0_zkp::layout::Component for Mem0Layout {
     }
     pub struct MemStoreInputLayout {
         pub decoded: &'static DecodeInstLayout,
    -    pub rs1: &'static ReadRegLayout,
    -    pub rs2: &'static ReadRegLayout,
    +    pub source_regs: &'static ReadSourceRegsLayout,
         pub addr_u32: &'static NormalizeU32Layout,
         pub addr: &'static AddrDecomposeBitsLayout,
         pub data_0: &'static MemoryReadLayout,
    @@ -2690,8 +2790,7 @@ impl risc0_zkp::layout::Component for MemStoreInputLayout {
         #[allow(unused_variables)]
         fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
             v.visit_component("decoded", self.decoded)?;
    -        v.visit_component("rs1", self.rs1)?;
    -        v.visit_component("rs2", self.rs2)?;
    +        v.visit_component("source_regs", self.source_regs)?;
             v.visit_component("addr_u32", self.addr_u32)?;
             v.visit_component("addr", self.addr)?;
             v.visit_component("data_0", self.data_0)?;
    @@ -8490,6 +8589,16 @@ pub struct InstInputStruct {
     #[derive(Copy, Clone, Debug)]
     pub struct DoCycleTableStruct {}
     #[derive(Copy, Clone, Debug)]
    +pub struct SourceRegsStruct {
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
    +}
    +#[derive(Copy, Clone, Debug)]
    +pub struct ReadSourceRegsStruct {
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
    +}
    +#[derive(Copy, Clone, Debug)]
     pub struct WriteRdStruct {}
     #[derive(Copy, Clone, Debug)]
     pub struct ExpandU32Struct {
    @@ -8520,8 +8629,8 @@ pub struct MultiplyAccumulateStruct {
     pub struct DivInputStruct {
         pub _super: InstInputStruct,
         pub decoded: DecoderStruct,
    -    pub rs1: GetDataStruct,
    -    pub rs2: GetDataStruct,
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
     }
     #[derive(Copy, Clone, Debug)]
     pub struct ComponentStruct {}
    @@ -8547,8 +8656,8 @@ pub struct InstOutputBaseStruct {
     pub struct MiscInputStruct {
         pub _super: InstInputStruct,
         pub decoded: DecoderStruct,
    -    pub rs1: GetDataStruct,
    -    pub rs2: GetDataStruct,
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
     }
     #[derive(Copy, Clone, Debug)]
     pub struct MiscOutputStruct {
    @@ -8560,8 +8669,8 @@ pub struct MiscOutputStruct {
     pub struct MulInputStruct {
         pub _super: InstInputStruct,
         pub decoded: DecoderStruct,
    -    pub rs1: GetDataStruct,
    -    pub rs2: GetDataStruct,
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
     }
     #[derive(Copy, Clone, Debug)]
     pub struct DoMulStruct {
    @@ -8578,7 +8687,7 @@ pub struct MemLoadInputStruct {
     #[derive(Copy, Clone, Debug)]
     pub struct MemStoreInputStruct {
         pub decoded: DecoderStruct,
    -    pub rs2: GetDataStruct,
    +    pub rs2: ValU32Struct,
         pub addr: AddrDecomposeBitsStruct,
         pub data_0: GetDataStruct,
     }
    
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check_0.cu+7546 6517 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check_1.cu+6211 6298 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check_2.cu+6159 6186 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check_3.cu+5993 6647 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check.cuh+29 271 modified
    @@ -2,282 +2,40 @@
     
     #include "supra/fp.h"
     
    +
    +
     #include <cstdint>
     
     namespace risc0::circuit::rv32im_v2::cuda {
     
    -extern __device__ FpExt rv32im_v2_18(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt* arg6,
    -                                     const Fp* arg7,
    -                                     const Fp* arg8,
    -                                     const Fp* arg9,
    -                                     const Fp* arg10);
    -extern __device__ FpExt rv32im_v2_17(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt* arg4,
    -                                     const Fp* arg5,
    -                                     const Fp* arg6,
    -                                     const Fp* arg7,
    -                                     const Fp* arg8);
    -extern __device__ FpExt rv32im_v2_16(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt* arg6,
    -                                     FpExt arg7,
    -                                     const Fp* arg8,
    -                                     const Fp* arg9,
    -                                     const Fp* arg10,
    -                                     const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_15(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt arg6,
    -                                     FpExt arg7,
    -                                     FpExt arg8,
    -                                     FpExt arg9,
    -                                     FpExt arg10,
    -                                     FpExt* arg11,
    -                                     FpExt arg12,
    -                                     const Fp* arg13,
    -                                     const Fp* arg14,
    -                                     const Fp* arg15,
    -                                     const Fp* arg16);
    -extern __device__ FpExt rv32im_v2_14(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt* arg4,
    -                                     FpExt arg5,
    -                                     const Fp* arg6,
    -                                     const Fp* arg7,
    -                                     const Fp* arg8,
    -                                     const Fp* arg9);
    -extern __device__ FpExt rv32im_v2_13(uint32_t idx,
    -                                     uint32_t size,
    -                                     FpExt arg0,
    -                                     Fp* arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt arg6,
    -                                     FpExt* arg7,
    -                                     FpExt arg8,
    -                                     const Fp* arg9,
    -                                     const Fp* arg10,
    -                                     const Fp* arg11,
    -                                     const Fp* arg12);
    -extern __device__ FpExt rv32im_v2_12(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt* arg4,
    -                                     FpExt arg5,
    -                                     const Fp* arg6,
    -                                     const Fp* arg7,
    -                                     const Fp* arg8,
    -                                     const Fp* arg9);
    -extern __device__ FpExt rv32im_v2_11(uint32_t idx,
    -                                     uint32_t size,
    -                                     FpExt* arg0,
    -                                     Fp* arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt arg6,
    -                                     FpExt arg7,
    -                                     FpExt arg8,
    -                                     FpExt arg9,
    -                                     const Fp* arg10,
    -                                     const Fp* arg11,
    -                                     const Fp* arg12);
    -extern __device__ FpExt rv32im_v2_10(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt* arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt arg6,
    -                                     FpExt arg7,
    -                                     FpExt arg8,
    -                                     FpExt arg9,
    -                                     FpExt arg10,
    -                                     FpExt arg11,
    -                                     FpExt arg12,
    -                                     FpExt arg13,
    -                                     FpExt arg14,
    -                                     FpExt arg15,
    -                                     FpExt arg16,
    -                                     FpExt arg17,
    -                                     FpExt arg18,
    -                                     FpExt arg19,
    -                                     FpExt arg20,
    -                                     FpExt arg21,
    -                                     FpExt arg22,
    -                                     FpExt arg23,
    -                                     FpExt arg24,
    -                                     FpExt arg25,
    -                                     FpExt arg26,
    -                                     FpExt arg27,
    -                                     const Fp* arg28,
    -                                     const Fp* arg29,
    -                                     const Fp* arg30);
    -extern __device__ FpExt rv32im_v2_9(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt* arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    const Fp* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_8(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt* arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    const Fp* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_7(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt* arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    const Fp* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_6(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    FpExt* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11,
    -                                    const Fp* arg12);
    -extern __device__ FpExt rv32im_v2_5(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    FpExt* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11,
    -                                    const Fp* arg12);
    -extern __device__ FpExt rv32im_v2_4(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt* arg8,
    -                                    const Fp* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_3(uint32_t idx,
    -                                    uint32_t size,
    -                                    FpExt arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    Fp* arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt* arg6,
    -                                    const Fp* arg7,
    -                                    const Fp* arg8,
    -                                    const Fp* arg9);
    -extern __device__ FpExt rv32im_v2_2(uint32_t idx,
    -                                    uint32_t size,
    -                                    FpExt* arg0,
    -                                    Fp* arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    const Fp* arg5,
    -                                    const Fp* arg6,
    -                                    const Fp* arg7);
    -extern __device__ FpExt rv32im_v2_1(uint32_t idx,
    -                                    uint32_t size,
    -                                    FpExt* arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    const Fp* arg4,
    -                                    const Fp* arg5);
    -extern __device__ FpExt
    -rv32im_v2_0(uint32_t idx, uint32_t size, FpExt* arg0, FpExt arg1, FpExt arg2, const Fp* arg3);
    -extern __device__ FpExt poly_fp(uint32_t idx,
    -                                uint32_t size,
    -                                const Fp* ctrl,
    -                                const Fp* out,
    -                                const Fp* data,
    -                                const Fp* mix,
    -                                const Fp* accum);
    +
    +extern __device__ FpExt rv32im_v2_19(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt* arg6, const Fp* arg7, const Fp* arg8, const Fp* arg9, const Fp* arg10);
    +extern __device__ FpExt rv32im_v2_18(uint32_t idx, uint32_t size, FpExt arg0, FpExt arg1, Fp* arg2, FpExt arg3, FpExt arg4, FpExt* arg5, const Fp* arg6, const Fp* arg7, const Fp* arg8, const Fp* arg9);
    +extern __device__ FpExt rv32im_v2_17(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt* arg6, FpExt arg7, const Fp* arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_16(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt arg9, FpExt arg10, FpExt* arg11, FpExt arg12, const Fp* arg13, const Fp* arg14, const Fp* arg15, const Fp* arg16);
    +extern __device__ FpExt rv32im_v2_15(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt* arg9, FpExt arg10, const Fp* arg11, const Fp* arg12, const Fp* arg13, const Fp* arg14);
    +extern __device__ FpExt rv32im_v2_14(uint32_t idx, uint32_t size, FpExt arg0, FpExt arg1, Fp* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt* arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_13(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt* arg6, FpExt arg7, const Fp* arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_12(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_11(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_10(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt arg9, FpExt arg10, FpExt arg11, FpExt arg12, FpExt arg13, FpExt arg14, FpExt arg15, FpExt* arg16, FpExt arg17, FpExt arg18, FpExt arg19, FpExt arg20, FpExt arg21, FpExt arg22, const Fp* arg23, const Fp* arg24, const Fp* arg25);
    +extern __device__ FpExt rv32im_v2_9(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_8(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_7(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_6(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt* arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_5(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt* arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_4(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt* arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_3(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt* arg6, const Fp* arg7, const Fp* arg8, const Fp* arg9);
    +extern __device__ FpExt rv32im_v2_2(uint32_t idx, uint32_t size, FpExt* arg0, FpExt arg1, FpExt arg2, const Fp* arg3, const Fp* arg4, const Fp* arg5);
    +extern __device__ FpExt rv32im_v2_1(uint32_t idx, uint32_t size, FpExt* arg0, FpExt arg1, FpExt arg2, FpExt arg3, const Fp* arg4, const Fp* arg5);
    +extern __device__ FpExt rv32im_v2_0(uint32_t idx, uint32_t size, FpExt* arg0, FpExt arg1, FpExt arg2, FpExt arg3, const Fp* arg4);
    +extern __device__ FpExt poly_fp(uint32_t idx, uint32_t size, const Fp* ctrl, const Fp* out, const Fp* data, const Fp* mix, const Fp* accum);
     
     constexpr size_t INV_RATE = 4;
    -constexpr size_t kNumPolyMixPows = 472;
    +constexpr size_t kNumPolyMixPows = 458;
     extern __constant__ FpExt poly_mix[kNumPolyMixPows];
     
    -} // namespace risc0::circuit::rv32im_v2::cuda
    +
    +
    +
    +}  // namespace risc0::circuit::rv32im_v2::cuda
    
  • risc0/circuit/rv32im-sys/kernels/cuda/layout.cuh.inc+1118 1083 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/layout.cu.inc+8276 6978 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/steps.cu+30231 59989 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/steps.cuh+210 810 modified
    @@ -17,815 +17,215 @@
     #include "witgen.h"
     
     namespace risc0::circuit::rv32im_v2::cuda {
    -extern __device__ NondetRegStruct back_NondetReg(ExecContext& ctx,
    -                                                 Index distance0,
    -                                                 BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_NondetReg(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetExtRegStruct back_NondetExtReg(ExecContext& ctx,
    -                                                       Index distance0,
    -                                                       BoundLayout<NondetExtRegLayout> layout1);
    -extern __device__ NondetExtRegStruct exec_NondetExtReg(ExecContext& ctx,
    -                                                       ExtVal arg0,
    -                                                       BoundLayout<NondetExtRegLayout> layout1);
    -extern __device__ NondetRegStruct back_Reg(ExecContext& ctx,
    -                                           Index distance0,
    -                                           BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_Reg(ExecContext& ctx,
    -                                           Val arg0,
    -                                           BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetExtRegStruct back_ExtReg(ExecContext& ctx,
    -                                                 Index distance0,
    -                                                 BoundLayout<NondetExtRegLayout> layout1);
    -extern __device__ NondetExtRegStruct exec_ExtReg(ExecContext& ctx,
    -                                                 ExtVal arg0,
    -                                                 BoundLayout<NondetExtRegLayout> layout1);
    -extern __device__ NondetRegStruct back_NondetBitReg(ExecContext& ctx,
    -                                                    Index distance0,
    -                                                    BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_NondetBitReg(ExecContext& ctx,
    -                                                    Val arg0,
    -                                                    BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct back_BitReg(ExecContext& ctx,
    -                                              Index distance0,
    -                                              BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_BitReg(ExecContext& ctx,
    -                                              Val arg0,
    -                                              BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_NondetTwitReg(ExecContext& ctx,
    -                                                     Val arg0,
    -                                                     BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetFakeTwitRegStruct
    -exec_NondetFakeTwitReg(ExecContext& ctx, Val arg0, BoundLayout<NondetFakeTwitRegLayout> layout1);
    -extern __device__ FakeTwitRegStruct exec_FakeTwitReg(ExecContext& ctx,
    -                                                     Val arg0,
    -                                                     BoundLayout<NondetFakeTwitRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_IsZero(ExecContext& ctx,
    -                                              Val arg0,
    -                                              BoundLayout<IsZeroLayout> layout1);
    -extern __device__ ArgU8Struct exec_ArgU8(ExecContext& ctx,
    -                                         Val arg0,
    -                                         Val arg1_0,
    -                                         BoundLayout<ArgU8Layout> layout2);
    -extern __device__ NondetRegStruct exec_NondetU8Reg(ExecContext& ctx,
    -                                                   Val arg0,
    -                                                   BoundLayout<NondetU8RegLayout> layout1);
    -extern __device__ U8RegStruct exec_U8Reg(ExecContext& ctx,
    -                                         Val arg0,
    -                                         BoundLayout<NondetU8RegLayout> layout1);
    -extern __device__ ArgU16Struct exec_ArgU16(ExecContext& ctx,
    -                                           Val arg0,
    -                                           Val arg1_0,
    -                                           BoundLayout<ArgU16Layout> layout2);
    -extern __device__ NondetU16RegStruct exec_NondetU16Reg(ExecContext& ctx,
    -                                                       Val arg0,
    -                                                       BoundLayout<NondetU16RegLayout> layout1);
    -extern __device__ NondetU16RegStruct exec_U16Reg(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<NondetU16RegLayout> layout1);
    -extern __device__ ToBits_5_Struct exec_ToBits_5_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<ToBits_5_Layout> layout1);
    -extern __device__ ValU32Struct exec_DynPo2(ExecContext& ctx,
    -                                           Val arg0,
    -                                           BoundLayout<DynPo2Layout> layout1);
    -extern __device__ NormalizeU32Struct exec_NormalizeU32(ExecContext& ctx,
    -                                                       DenormedValU32Struct arg0,
    -                                                       BoundLayout<NormalizeU32Layout> layout1);
    -extern __device__ AddrDecomposeStruct exec_AddrDecompose(ExecContext& ctx,
    -                                                         ValU32Struct arg0,
    -                                                         Val arg1_0,
    -                                                         BoundLayout<AddrDecomposeLayout> layout2);
    -extern __device__ AddrDecomposeBitsStruct exec_AddrDecomposeBits(
    -    ExecContext& ctx, ValU32Struct arg0, Val arg1_0, BoundLayout<AddrDecomposeBitsLayout> layout2);
    -extern __device__ CmpEqualStruct exec_CmpEqual(ExecContext& ctx,
    -                                               ValU32Struct arg0,
    -                                               ValU32Struct arg1_0,
    -                                               BoundLayout<CmpEqualLayout> layout2);
    -extern __device__ CmpLessThanUnsignedStruct
    -exec_CmpLessThanUnsigned(ExecContext& ctx,
    -                         ValU32Struct arg0,
    -                         ValU32Struct arg1_0,
    -                         BoundLayout<CmpLessThanUnsignedLayout> layout2);
    -extern __device__ NondetRegStruct exec_GetSignU32(ExecContext& ctx,
    -                                                  ValU32Struct arg0,
    -                                                  BoundLayout<GetSignU32Layout> layout1);
    -extern __device__ CmpLessThanStruct exec_CmpLessThan(ExecContext& ctx,
    -                                                     ValU32Struct arg0,
    -                                                     ValU32Struct arg1_0,
    -                                                     BoundLayout<CmpLessThanLayout> layout2);
    -extern __device__ ToBits_16_Struct exec_ToBits_16_(ExecContext& ctx,
    -                                                   Val arg0,
    -                                                   BoundLayout<ToBits_16_Layout> layout1);
    -extern __device__ FromBits_16_Struct exec_BitwiseAndU16(ExecContext& ctx,
    -                                                        Val arg0,
    -                                                        Val arg1_0,
    -                                                        BoundLayout<BitwiseAndU16Layout> layout2);
    -extern __device__ ValU32Struct exec_BitwiseAnd(ExecContext& ctx,
    -                                               ValU32Struct arg0,
    -                                               ValU32Struct arg1_0,
    -                                               BoundLayout<BitwiseAndLayout> layout2);
    -extern __device__ ValU32Struct exec_BitwiseOr(ExecContext& ctx,
    -                                              ValU32Struct arg0,
    -                                              ValU32Struct arg1_0,
    -                                              BoundLayout<BitwiseOrLayout> layout2);
    -extern __device__ ValU32Struct exec_BitwiseXor(ExecContext& ctx,
    -                                               ValU32Struct arg0,
    -                                               ValU32Struct arg1_0,
    -                                               BoundLayout<BitwiseXorLayout> layout2);
    -extern __device__ DecoderStruct exec_Decoder(ExecContext& ctx,
    -                                             ValU32Struct arg0,
    -                                             BoundLayout<DecoderLayout> layout1);
    -extern __device__ MemoryArgStruct exec_MemoryArg(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 Val arg1_0,
    -                                                 Val arg2_0,
    -                                                 ValU32Struct arg3,
    -                                                 BoundLayout<MemoryArgLayout> layout4);
    -extern __device__ CycleArgStruct exec_CycleArg(ExecContext& ctx,
    -                                               Val arg0,
    -                                               Val arg1_0,
    -                                               BoundLayout<CycleArgLayout> layout2);
    -extern __device__ IsCycleStruct exec_IsCycle(ExecContext& ctx,
    -                                             Val arg0,
    -                                             BoundLayout<IsCycleLayout> layout1);
    -extern __device__ MemoryIOStruct exec_MemoryIO(ExecContext& ctx,
    -                                               Val arg0,
    -                                               Val arg1_0,
    -                                               BoundLayout<MemoryIOLayout> layout2);
    -extern __device__ IsForwardStruct exec_IsForward(ExecContext& ctx,
    -                                                 MemoryIOStruct arg0,
    -                                                 BoundLayout<IsForwardLayout> layout1);
    -extern __device__ GetDataStruct exec_MemoryRead(ExecContext& ctx,
    -                                                NondetRegStruct arg0,
    -                                                Val arg1_0,
    -                                                BoundLayout<MemoryReadLayout> layout2);
    -extern __device__ MemoryWriteStruct exec_MemoryWrite(ExecContext& ctx,
    -                                                     NondetRegStruct arg0,
    -                                                     Val arg1_0,
    -                                                     ValU32Struct arg2_0,
    -                                                     BoundLayout<MemoryWriteLayout> layout3);
    -extern __device__ MemoryWriteUnconstrainedStruct
    -exec_MemoryWriteUnconstrained(ExecContext& ctx,
    -                              NondetRegStruct arg0,
    -                              Val arg1_0,
    -                              BoundLayout<MemoryWriteUnconstrainedLayout> layout2);
    -extern __device__ GetDataStruct exec_MemoryPageIn(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  Val arg1_0,
    -                                                  BoundLayout<MemoryPageInLayout> layout2);
    -extern __device__ GetDataStruct exec_MemoryPageOut(ExecContext& ctx,
    -                                                   NondetRegStruct arg0,
    -                                                   Val arg1_0,
    -                                                   BoundLayout<MemoryPageOutLayout> layout2);
    -extern __device__ OneHot_3_Struct exec_OneHot_3_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_3_Layout> layout1);
    -extern __device__ GetDataStruct exec_MemoryGet(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               Val arg1_0,
    -                                               OneHot_3_Struct arg2_0,
    -                                               BoundLayout<MemoryGetLayout> layout3);
    -extern __device__ OneHot_8_Struct exec_OneHot_8_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_8_Layout> layout1);
    -extern __device__ InstInputStruct exec_InstInput(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 Val arg1_0,
    -                                                 ValU32Struct arg2_0,
    -                                                 Val arg3,
    -                                                 Val arg4,
    -                                                 BoundLayout<InstInputLayout> layout5);
    -extern __device__ DoCycleTableStruct exec_DoCycleTable(ExecContext& ctx,
    -                                                       NondetRegStruct arg0,
    -                                                       BoundLayout<DoCycleTableLayout> layout1);
    -extern __device__ DecoderStruct exec_DecodeInst(ExecContext& ctx,
    -                                                NondetRegStruct arg0,
    -                                                InstInputStruct arg1_0,
    -                                                BoundLayout<DecodeInstLayout> layout2);
    -extern __device__ GetDataStruct exec_ReadReg(ExecContext& ctx,
    -                                             NondetRegStruct arg0,
    -                                             InstInputStruct arg1_0,
    -                                             Val arg2_0,
    -                                             BoundLayout<ReadRegLayout> layout3);
    -extern __device__ WriteRdStruct exec_WriteRd(ExecContext& ctx,
    -                                             NondetRegStruct arg0,
    -                                             InstInputStruct arg1_0,
    -                                             DecoderStruct arg2_0,
    -                                             Val arg3,
    -                                             ValU32Struct arg4,
    -                                             BoundLayout<WriteRdLayout> layout5);
    -extern __device__ ExpandU32Struct exec_ExpandU32(ExecContext& ctx,
    -                                                 ValU32Struct arg0,
    -                                                 Val arg1_0,
    -                                                 BoundLayout<ExpandU32Layout> layout2);
    -extern __device__ SplitTotalStruct exec_SplitTotal(ExecContext& ctx,
    -                                                   Val arg0,
    -                                                   BoundLayout<SplitTotalLayout> layout1);
    -extern __device__ MultiplyAccumulateStruct
    -exec_MultiplyAccumulate(ExecContext& ctx,
    -                        ValU32Struct arg0,
    -                        ValU32Struct arg1_0,
    -                        ValU32Struct arg2_0,
    -                        MultiplySettingsStruct arg3,
    -                        BoundLayout<MultiplyAccumulateLayout> layout4);
    -extern __device__ DivInputStruct exec_DivInput(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               InstInputStruct arg1_0,
    -                                               BoundLayout<DivInputLayout> layout2);
    -extern __device__ DivideReturnStruct exec_DoDiv(ExecContext& ctx,
    -                                                ValU32Struct arg0,
    -                                                ValU32Struct arg1_0,
    -                                                Val arg2_0,
    -                                                Val arg3,
    -                                                BoundLayout<DoDivLayout> layout4);
    -extern __device__ ValU32Struct exec_OpSRL(ExecContext& ctx,
    -                                          DivInputStruct arg0,
    -                                          BoundLayout<OpSRLLayout> layout1);
    -extern __device__ NondetRegStruct exec_TopBit(ExecContext& ctx,
    -                                              ValU32Struct arg0,
    -                                              BoundLayout<TopBitLayout> layout1);
    -extern __device__ ValU32Struct exec_OpSRA(ExecContext& ctx,
    -                                          DivInputStruct arg0,
    -                                          BoundLayout<OpSRALayout> layout1);
    -extern __device__ ValU32Struct exec_OpSRLI(ExecContext& ctx,
    -                                           DivInputStruct arg0,
    -                                           BoundLayout<OpSRLILayout> layout1);
    -extern __device__ ValU32Struct exec_OpSRAI(ExecContext& ctx,
    -                                           DivInputStruct arg0,
    -                                           BoundLayout<OpSRAILayout> layout1);
    -extern __device__ ValU32Struct exec_OpDIV(ExecContext& ctx,
    -                                          DivInputStruct arg0,
    -                                          BoundLayout<OpDIVLayout> layout1);
    -extern __device__ ValU32Struct exec_OpDIVU(ExecContext& ctx,
    -                                           DivInputStruct arg0,
    -                                           BoundLayout<OpDIVULayout> layout1);
    -extern __device__ ValU32Struct exec_OpREM(ExecContext& ctx,
    -                                          DivInputStruct arg0,
    -                                          BoundLayout<OpREMLayout> layout1);
    -extern __device__ ValU32Struct exec_OpREMU(ExecContext& ctx,
    -                                           DivInputStruct arg0,
    -                                           BoundLayout<OpREMULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Div0(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Div0Layout> layout2);
    -extern __device__ MiscInputStruct exec_MiscInput(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<MiscInputLayout> layout2);
    -extern __device__ InstOutputBaseStruct exec_FinalizeMisc(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         MiscInputStruct arg1_0,
    -                                                         MiscOutputStruct arg2_0,
    -                                                         BoundLayout<FinalizeMiscLayout> layout3);
    -extern __device__ MiscOutputStruct exec_OpXOR(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpXORLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpOR(ExecContext& ctx,
    -                                             MiscInputStruct arg0,
    -                                             BoundLayout<OpORLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpAND(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpANDLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpSLT(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpSLTLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpSLTU(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpSLTULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Misc0(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  InstInputStruct arg1_0,
    -                                                  BoundLayout<Misc0Layout> layout2);
    -extern __device__ MiscOutputStruct exec_OpXORI(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpXORILayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpORI(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpORILayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpANDI(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpANDILayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpSLTI(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpSLTILayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpSLTIU(ExecContext& ctx,
    -                                                MiscInputStruct arg0,
    -                                                BoundLayout<OpSLTIULayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBEQ(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpBEQLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBNE(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpBNELayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBLT(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpBLTLayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Misc1(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  InstInputStruct arg1_0,
    -                                                  BoundLayout<Misc1Layout> layout2);
    -extern __device__ MiscOutputStruct exec_OpBGE(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpBGELayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBLTU(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpBLTULayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBGEU(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpBGEULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Misc2(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  InstInputStruct arg1_0,
    -                                                  BoundLayout<Misc2Layout> layout2);
    -extern __device__ MulInputStruct exec_MulInput(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               InstInputStruct arg1_0,
    -                                               BoundLayout<MulInputLayout> layout2);
    -extern __device__ DoMulStruct exec_DoMul(ExecContext& ctx,
    -                                         ValU32Struct arg0,
    -                                         ValU32Struct arg1_0,
    -                                         Val arg2_0,
    -                                         Val arg3,
    -                                         BoundLayout<DoMulLayout> layout4);
    -extern __device__ ValU32Struct exec_OpSLL(ExecContext& ctx,
    -                                          MulInputStruct arg0,
    -                                          BoundLayout<OpSLLLayout> layout1);
    -extern __device__ ValU32Struct exec_OpSLLI(ExecContext& ctx,
    -                                           MulInputStruct arg0,
    -                                           BoundLayout<OpSLLILayout> layout1);
    -extern __device__ ValU32Struct exec_OpMUL(ExecContext& ctx,
    -                                          MulInputStruct arg0,
    -                                          BoundLayout<OpMULLayout> layout1);
    -extern __device__ ValU32Struct exec_OpMULH(ExecContext& ctx,
    -                                           MulInputStruct arg0,
    -                                           BoundLayout<OpMULHLayout> layout1);
    -extern __device__ ValU32Struct exec_OpMULHSU(ExecContext& ctx,
    -                                             MulInputStruct arg0,
    -                                             BoundLayout<OpMULHSULayout> layout1);
    -extern __device__ ValU32Struct exec_OpMULHU(ExecContext& ctx,
    -                                            MulInputStruct arg0,
    -                                            BoundLayout<OpMULHULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Mul0(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Mul0Layout> layout2);
    -extern __device__ MemLoadInputStruct exec_MemLoadInput(ExecContext& ctx,
    -                                                       NondetRegStruct arg0,
    -                                                       InstInputStruct arg1_0,
    -                                                       BoundLayout<MemLoadInputLayout> layout2);
    -extern __device__ MemStoreInputStruct exec_MemStoreInput(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         InstInputStruct arg1_0,
    -                                                         BoundLayout<MemStoreInputLayout> layout2);
    -extern __device__ MemStoreFinalizeStruct
    -exec_MemStoreFinalize(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      MemStoreInputStruct arg1_0,
    -                      ValU32Struct arg2_0,
    -                      BoundLayout<MemStoreFinalizeLayout> layout3);
    -extern __device__ SplitWordStruct exec_SplitWord(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<SplitWordLayout> layout1);
    -extern __device__ ValU32Struct exec_OpLB(ExecContext& ctx,
    -                                         MemLoadInputStruct arg0,
    -                                         BoundLayout<OpLBLayout> layout1);
    -extern __device__ ValU32Struct exec_OpLH(ExecContext& ctx,
    -                                         MemLoadInputStruct arg0,
    -                                         BoundLayout<OpLHLayout> layout1);
    -extern __device__ ValU32Struct exec_OpLBU(ExecContext& ctx,
    -                                          MemLoadInputStruct arg0,
    -                                          BoundLayout<OpLBULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Mem0(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Mem0Layout> layout2);
    -extern __device__ ValU32Struct exec_OpSB(ExecContext& ctx,
    -                                         MemStoreInputStruct arg0,
    -                                         BoundLayout<OpSBLayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Mem1(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Mem1Layout> layout2);
    -extern __device__ DigestRegStruct back_DigestReg(ExecContext& ctx,
    -                                                 Index distance0,
    -                                                 BoundLayout<DigestRegLayout> layout1);
    -extern __device__ DigestRegStruct exec_DigestReg(ExecContext& ctx,
    -                                                 ValU32Struct8Array arg0,
    -                                                 BoundLayout<DigestRegLayout> layout1);
    -extern __device__ InstOutputBaseStruct
    -exec_ControlLoadRoot(ExecContext& ctx,
    -                     NondetRegStruct arg0,
    -                     InstInputStruct arg1_0,
    -                     BoundLayout<ControlLoadRootLayout> layout2,
    -                     GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct exec_ControlResume(ExecContext& ctx,
    -                                                          NondetRegStruct arg0,
    -                                                          InstInputStruct arg1_0,
    -                                                          BoundLayout<ControlResumeLayout> layout2,
    -                                                          GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct
    -exec_ControlUserECALL(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      InstInputStruct arg1_0,
    -                      BoundLayout<ControlUserECALLLayout> layout2);
    -extern __device__ InstOutputBaseStruct exec_ControlMRET(ExecContext& ctx,
    -                                                        NondetRegStruct arg0,
    -                                                        InstInputStruct arg1_0,
    -                                                        BoundLayout<ControlMRETLayout> layout2);
    -extern __device__ InstOutputBaseStruct
    -exec_ControlSuspend(ExecContext& ctx,
    -                    NondetRegStruct arg0,
    -                    InstInputStruct arg1_0,
    -                    BoundLayout<ControlSuspendLayout> layout2,
    -                    GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct
    -exec_ControlStoreRoot(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      InstInputStruct arg1_0,
    -                      BoundLayout<ControlStoreRootLayout> layout2,
    -                      GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct exec_ControlTable(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         InstInputStruct arg1_0,
    -                                                         BoundLayout<ControlTableLayout> layout2);
    -extern __device__ InstOutputBaseStruct exec_ControlDone(ExecContext& ctx,
    -                                                        NondetRegStruct arg0,
    -                                                        InstInputStruct arg1_0,
    -                                                        BoundLayout<ControlDoneLayout> layout2,
    -                                                        GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct exec_Control0(ExecContext& ctx,
    -                                                     NondetRegStruct arg0,
    -                                                     InstInputStruct arg1_0,
    -                                                     BoundLayout<Control0Layout> layout2,
    -                                                     GlobalBuf global3);
    -extern __device__ OneHot_6_Struct exec_OneHot_6_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_6_Layout> layout1);
    -extern __device__ ECallOutputStruct exec_MachineECall(ExecContext& ctx,
    -                                                      NondetRegStruct arg0,
    -                                                      InstInputStruct arg1_0,
    -                                                      Val arg2_0,
    -                                                      BoundLayout<MachineECallLayout> layout3);
    -extern __device__ ECallOutputStruct exec_ECallTerminate(ExecContext& ctx,
    -                                                        NondetRegStruct arg0,
    -                                                        InstInputStruct arg1_0,
    -                                                        BoundLayout<ECallTerminateLayout> layout2,
    -                                                        GlobalBuf global3);
    -extern __device__ OneHot_4_Struct exec_OneHot_4_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_4_Layout> layout1);
    -extern __device__ DecomposeLow2Struct exec_DecomposeLow2(ExecContext& ctx,
    -                                                         Val arg0,
    -                                                         BoundLayout<DecomposeLow2Layout> layout1);
    -extern __device__ ECallOutputStruct
    -exec_ECallHostReadSetup(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        InstInputStruct arg1_0,
    -                        BoundLayout<ECallHostReadSetupLayout> layout2);
    -extern __device__ ECallOutputStruct exec_ECallHostWrite(ExecContext& ctx,
    -                                                        NondetRegStruct arg0,
    -                                                        InstInputStruct arg1_0,
    -                                                        BoundLayout<ECallHostWriteLayout> layout2);
    -extern __device__ ECallOutputStruct
    -exec_ECallHostReadBytes(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        InstInputStruct arg1_0,
    -                        Val arg2_0,
    -                        Val arg3,
    -                        Val arg4,
    -                        BoundLayout<ECallHostReadBytesLayout> layout5);
    -extern __device__ ECallOutputStruct
    -exec_ECallHostReadWords(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        InstInputStruct arg1_0,
    -                        Val arg2_0,
    -                        Val arg3,
    -                        BoundLayout<ECallHostReadWordsLayout> layout4);
    -extern __device__ InstOutputBaseStruct exec_ECall0(ExecContext& ctx,
    -                                                   NondetRegStruct arg0,
    -                                                   InstInputStruct arg1_0,
    -                                                   BoundLayout<ECall0Layout> layout2,
    -                                                   GlobalBuf global3);
    -extern __device__ NondetRegStruct exec_SBox(ExecContext& ctx,
    -                                            Val arg0,
    -                                            BoundLayout<SBoxLayout> layout1);
    -extern __device__ MultiplyByMIntStruct exec_DoIntRound(ExecContext& ctx,
    -                                                       Val24Array arg0,
    -                                                       Val arg1_0,
    -                                                       BoundLayout<DoIntRoundLayout> layout2);
    -extern __device__ DoIntRoundsStruct exec_DoIntRounds(ExecContext& ctx,
    -                                                     Val24Array arg0,
    -                                                     BoundLayout<DoIntRoundsLayout> layout1);
    -extern __device__ MultiplyByMExtStruct exec_DoExtRound(ExecContext& ctx,
    -                                                       Val24Array arg0,
    -                                                       Val24Array arg1_0,
    -                                                       BoundLayout<DoExtRoundLayout> layout2);
    -extern __device__ MultiplyByMExtStruct exec_DoExtRoundByIdx(
    -    ExecContext& ctx, Val24Array arg0, Val arg1_0, BoundLayout<DoExtRoundByIdxLayout> layout2);
    -extern __device__ PoseidonStateStruct back_PoseidonState(ExecContext& ctx,
    -                                                         Index distance0,
    -                                                         BoundLayout<PoseidonStateLayout> layout1);
    -extern __device__ PoseidonStateStruct exec_PoseidonState(ExecContext& ctx,
    -                                                         PoseidonOpDefStruct arg0,
    -                                                         Val arg1_0,
    -                                                         Val arg2_0,
    -                                                         Val arg3,
    -                                                         Val arg4,
    -                                                         Val arg5,
    -                                                         Val24Array arg6,
    -                                                         ExtVal arg7,
    -                                                         BoundLayout<PoseidonStateLayout> layout8);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonInvalid(ExecContext& ctx, BoundLayout<PoseidonStateLayout> layout0);
    -extern __device__ ReadAddrStruct exec_ReadAddr(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               Val arg1_0,
    -                                               BoundLayout<ReadAddrLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonEcall(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         Val arg1_0,
    -                                                         BoundLayout<PoseidonEcallLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingEntry(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonEntry(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         ValU32Struct arg1_0,
    -                                                         Val arg2_0,
    -                                                         BoundLayout<PoseidonEntryLayout> layout3);
    -extern __device__ ReadElemStruct exec_ReadElem(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               Val arg1_0,
    -                                               BoundLayout<ReadElemLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonLoadState(ExecContext& ctx,
    -                       NondetRegStruct arg0,
    -                       PoseidonStateStruct arg1_0,
    -                       BoundLayout<PoseidonLoadStateLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonLoadInShort(ExecContext& ctx,
    -                         NondetRegStruct arg0,
    -                         PoseidonStateStruct arg1_0,
    -                         BoundLayout<PoseidonLoadInShortLayout> layout2,
    -                         GlobalBuf global3);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonLoadInLow(ExecContext& ctx,
    -                       NondetRegStruct arg0,
    -                       PoseidonStateStruct arg1_0,
    -                       BoundLayout<PoseidonLoadInLowLayout> layout2,
    -                       GlobalBuf global3);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonLoadInHigh(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        PoseidonStateStruct arg1_0,
    -                        BoundLayout<PoseidonLoadInHighLayout> layout2,
    -                        GlobalBuf global3);
    -extern __device__ PoseidonStateStruct exec_PoseidonLoadIn(ExecContext& ctx,
    -                                                          NondetRegStruct arg0,
    -                                                          PoseidonStateStruct arg1_0,
    -                                                          BoundLayout<PoseidonLoadInLayout> layout2,
    -                                                          GlobalBuf global3);
    -extern __device__ PoseidonStateStruct exec_PoseidonExtRound(
    -    ExecContext& ctx, PoseidonStateStruct arg0, BoundLayout<PoseidonExtRoundLayout> layout1);
    -extern __device__ PoseidonStateStruct exec_PoseidonIntRounds(
    -    ExecContext& ctx, PoseidonStateStruct arg0, BoundLayout<PoseidonIntRoundsLayout> layout1);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonCheckOut(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      PoseidonStateStruct arg1_0,
    -                      BoundLayout<PoseidonCheckOutLayout> layout2);
    -extern __device__ FieldToWordStruct exec_FieldToWord(ExecContext& ctx,
    -                                                     Val arg0,
    -                                                     BoundLayout<FieldToWordLayout> layout1);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonStoreOut(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      PoseidonStateStruct arg1_0,
    -                      BoundLayout<PoseidonStoreOutLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonDoOut(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         PoseidonStateStruct arg1_0,
    -                                                         BoundLayout<PoseidonDoOutLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonStoreState(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        PoseidonStateStruct arg1_0,
    -                        BoundLayout<PoseidonStoreStateLayout> layout2);
    -extern __device__ IsU24Struct exec_IsU24(ExecContext& ctx,
    -                                         Val arg0,
    -                                         BoundLayout<IsU24Layout> layout1);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingLoadNode(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingLoadPage(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonPagingLoadDone(ExecContext& ctx, BoundLayout<PoseidonStateLayout> layout0);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingStoreNode(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingStorePage(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonPagingStoreDone(ExecContext& ctx, BoundLayout<PoseidonStateLayout> layout0);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonPaging(ExecContext& ctx,
    -                    NondetRegStruct arg0,
    -                    Val arg1_0,
    -                    PoseidonStateStruct arg2_0,
    -                    BoundLayout<PoseidonPagingLayout> layout3);
    -extern __device__ InstOutputBaseStruct exec_Poseidon0(ExecContext& ctx,
    -                                                      NondetRegStruct arg0,
    -                                                      InstInputStruct arg1_0,
    -                                                      BoundLayout<Poseidon0Layout> layout2,
    -                                                      GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct exec_Poseidon1(ExecContext& ctx,
    -                                                      NondetRegStruct arg0,
    -                                                      InstInputStruct arg1_0,
    -                                                      BoundLayout<Poseidon1Layout> layout2);
    -extern __device__ CarryExtractStruct exec_CarryExtract(ExecContext& ctx,
    -                                                       Val arg0,
    -                                                       BoundLayout<CarryExtractLayout> layout1);
    -extern __device__ UnpackReg_32__16_Struct exec_UnpackReg_32__16_(
    -    ExecContext& ctx, Val2Array arg0, BoundLayout<UnpackReg_32__16_Layout> layout1);
    -extern __device__ UnpackReg_32__16_Struct
    -exec_CarryAndExpand(ExecContext& ctx, Val2Array arg0, BoundLayout<CarryAndExpandLayout> layout1);
    -extern __device__ ShaStateStruct back_ShaState(ExecContext& ctx,
    -                                               Index distance0,
    -                                               BoundLayout<ShaStateLayout> layout1);
    -extern __device__ ShaStateStruct exec_ShaState(ExecContext& ctx,
    -                                               Val32Array arg0,
    -                                               Val32Array arg1_0,
    -                                               Val32Array arg2_0,
    -                                               Val arg3,
    -                                               Val arg4,
    -                                               Val arg5,
    -                                               Val arg6,
    -                                               Val arg7,
    -                                               Val arg8,
    -                                               Val arg9,
    -                                               BoundLayout<ShaStateLayout> layout10);
    -extern __device__ ShaStateStruct exec_ShaInvalid(ExecContext& ctx,
    -                                                 BoundLayout<ShaStateLayout> layout0);
    -extern __device__ ShaStateStruct exec_ShaEcall(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               BoundLayout<ShaEcallLayout> layout1);
    -extern __device__ ShaStateStruct exec_ShaLoadState(ExecContext& ctx,
    -                                                   NondetRegStruct arg0,
    -                                                   ShaStateStruct arg1_0,
    -                                                   BoundLayout<ShaLoadStateLayout> layout2);
    -extern __device__ ShaStateStruct exec_ShaLoadData(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  ShaStateStruct arg1_0,
    -                                                  ShaStateStruct arg2_0,
    -                                                  ShaStateStruct arg3,
    -                                                  ShaStateStruct arg4,
    -                                                  BoundLayout<ShaLoadDataLayout> layout5);
    -extern __device__ ShaStateStruct exec_ShaMix(ExecContext& ctx,
    -                                             NondetRegStruct arg0,
    -                                             ShaStateStruct arg1_0,
    -                                             ShaStateStruct arg2_0,
    -                                             ShaStateStruct arg3,
    -                                             ShaStateStruct arg4,
    -                                             ShaStateStruct arg5,
    -                                             ShaStateStruct arg6,
    -                                             ShaStateStruct arg7,
    -                                             BoundLayout<ShaMixLayout> layout8);
    -extern __device__ ShaStateStruct exec_ShaStoreState(ExecContext& ctx,
    -                                                    NondetRegStruct arg0,
    -                                                    ShaStateStruct arg1_0,
    -                                                    ShaStateStruct arg2_0,
    -                                                    ShaStateStruct arg3,
    -                                                    BoundLayout<ShaStoreStateLayout> layout4);
    -extern __device__ InstOutputBaseStruct exec_Sha0(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Sha0Layout> layout2);
    -extern __device__ BigIntStateStruct back_BigIntState(ExecContext& ctx,
    -                                                     Index distance0,
    -                                                     BoundLayout<BigIntStateLayout> layout1);
    -extern __device__ BigIntStateStruct exec_BigIntState(ExecContext& ctx,
    -                                                     Val arg0,
    -                                                     Val arg1_0,
    -                                                     Val arg2_0,
    -                                                     Val arg3,
    -                                                     Val arg4,
    -                                                     Val16Array arg5,
    -                                                     Val arg6,
    -                                                     BoundLayout<BigIntStateLayout> layout7);
    -extern __device__ BigIntStateStruct exec_BigIntInvalid(ExecContext& ctx,
    -                                                       BoundLayout<BigIntStateLayout> layout0);
    -extern __device__ BigIntStateStruct exec_BigIntEcall(ExecContext& ctx,
    -                                                     NondetRegStruct arg0,
    -                                                     BoundLayout<BigIntEcallLayout> layout1);
    -extern __device__ SplitU32Struct exec_SplitU32(ExecContext& ctx,
    -                                               ValU32Struct arg0,
    -                                               BoundLayout<SplitU32Layout> layout1);
    -extern __device__ AddrDecomposeBitsStruct exec_BigIntAddr(ExecContext& ctx,
    -                                                          ValU32Struct arg0,
    -                                                          Val arg1_0,
    -                                                          BoundLayout<BigIntAddrLayout> layout2);
    -extern __device__ BigIntReadStruct exec_BigIntRead(ExecContext& ctx,
    -                                                   NondetRegStruct arg0,
    -                                                   ValU32Struct arg1_0,
    -                                                   Val arg2_0,
    -                                                   BoundLayout<BigIntReadLayout> layout3);
    -extern __device__ BigIntWitnessStruct exec_BigIntWitness(ExecContext& ctx,
    -                                                         Val16Array arg0,
    -                                                         BoundLayout<BigIntWitnessLayout> layout1);
    -extern __device__ BigIntWitnessStruct exec_BigIntWrite(ExecContext& ctx,
    -                                                       NondetRegStruct arg0,
    -                                                       ValU32Struct arg1_0,
    -                                                       Val arg2_0,
    -                                                       BoundLayout<BigIntWriteLayout> layout3);
    -extern __device__ BigIntWitnessStruct exec_BigIntCheck(ExecContext& ctx,
    -                                                       BoundLayout<BigIntWitnessLayout> layout0);
    -extern __device__ BigIntStateStruct exec_BigIntStep(ExecContext& ctx,
    -                                                    NondetRegStruct arg0,
    -                                                    BigIntStateStruct arg1_0,
    -                                                    BoundLayout<BigIntStepLayout> layout2);
    -extern __device__ InstOutputBaseStruct exec_BigInt0(ExecContext& ctx,
    -                                                    NondetRegStruct arg0,
    -                                                    InstInputStruct arg1_0,
    -                                                    BoundLayout<BigInt0Layout> layout2);
    -extern __device__ BigIntAccumStateStruct back_BigIntAccumState(
    -    ExecContext& ctx, Index distance0, BoundLayout<BigIntAccumStateLayout> layout1);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntAccumState(ExecContext& ctx,
    -                      ExtVal arg0,
    -                      ExtVal arg1_0,
    -                      ExtVal arg2_0,
    -                      BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ OneHot_7_Struct exec_OneHot_7_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_7_Layout> layout1);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpNop(ExecContext& ctx, BoundLayout<BigIntAccumStateLayout> layout0);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpShift(ExecContext& ctx,
    -                       BigIntTopStateStruct arg0,
    -                       BigIntAccumStateStruct arg1_0,
    -                       ExtVal arg2_0,
    -                       BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpSetTerm(ExecContext& ctx,
    -                         BigIntTopStateStruct arg0,
    -                         BigIntAccumStateStruct arg1_0,
    -                         ExtVal arg2_0,
    -                         BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpAddTotal(ExecContext& ctx,
    -                          BigIntTopStateStruct arg0,
    -                          BigIntAccumStateStruct arg1_0,
    -                          ExtVal arg2_0,
    -                          BoundLayout<BigIntPolyOpAddTotalLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpCarry1(ExecContext& ctx,
    -                        BigIntTopStateStruct arg0,
    -                        BigIntAccumStateStruct arg1_0,
    -                        ExtVal arg2_0,
    -                        BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpCarry2(ExecContext& ctx,
    -                        BigIntTopStateStruct arg0,
    -                        BigIntAccumStateStruct arg1_0,
    -                        ExtVal arg2_0,
    -                        BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpEqz(ExecContext& ctx,
    -                     BigIntTopStateStruct arg0,
    -                     BigIntAccumStateStruct arg1_0,
    -                     ExtVal arg2_0,
    -                     BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStruct exec_BigIntAccum(ExecContext& ctx,
    -                                                     BigIntTopStateStruct arg0,
    -                                                     ExtVal1Array arg1_0,
    -                                                     BoundLayout<BigIntAccumLayout> layout2);
    -extern __device__ OneHot_13_Struct exec_OneHot_13_(ExecContext& ctx,
    -                                                   Val arg0,
    -                                                   BoundLayout<OneHot_13_Layout> layout1);
    -extern __device__ TopStruct exec_Top(ExecContext& ctx,
    -                                     BoundLayout<TopLayout> layout0,
    -                                     GlobalBuf global1);
    -extern __device__ void step_Top(ExecContext& ctx, MutableBuf data0, GlobalBuf global1);
    -extern __device__ AccumStruct exec_Accum(ExecContext& ctx,
    -                                         BigIntTopStateStruct arg0,
    -                                         ExtVal1Array arg1_0,
    -                                         BoundLayout<AccumLayout> layout2);
    -extern __device__ BigIntTopStateStruct exec_TopExtract(ExecContext& ctx,
    -                                                       BoundLayout<TopLayout> arg0,
    -                                                       GlobalBuf global1);
    -extern __device__ AccumStruct execUser_Accum(ExecContext& ctx,
    -                                             BoundLayout<TopLayout> arg0,
    -                                             ExtVal1Array arg1_0,
    -                                             BoundLayout<AccumLayout> layout2,
    -                                             GlobalBuf global3);
    -extern __device__ ComponentStruct exec_TopAccum(ExecContext& ctx,
    -                                                BoundLayout<TopLayout> arg0,
    -                                                BoundLayout<LayoutAccumLayout> layout1,
    -                                                GlobalBuf global2,
    -                                                GlobalBuf mix3);
    -extern __device__ void step_TopAccum(
    -    ExecContext& ctx, MutableBuf accum0, MutableBuf data1, GlobalBuf global2, GlobalBuf mix3);
    +extern __device__ NondetRegStruct back_NondetReg(ExecContext& ctx,Index distance0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_NondetReg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetExtRegStruct back_NondetExtReg(ExecContext& ctx,Index distance0, BoundLayout<NondetExtRegLayout> layout1)  ;
    +extern __device__ NondetExtRegStruct exec_NondetExtReg(ExecContext& ctx,ExtVal arg0, BoundLayout<NondetExtRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct back_Reg(ExecContext& ctx,Index distance0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetExtRegStruct back_ExtReg(ExecContext& ctx,Index distance0, BoundLayout<NondetExtRegLayout> layout1)  ;
    +extern __device__ NondetExtRegStruct exec_ExtReg(ExecContext& ctx,ExtVal arg0, BoundLayout<NondetExtRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct back_NondetBitReg(ExecContext& ctx,Index distance0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_NondetBitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct back_BitReg(ExecContext& ctx,Index distance0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_BitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_NondetTwitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetFakeTwitRegStruct exec_NondetFakeTwitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetFakeTwitRegLayout> layout1)  ;
    +extern __device__ FakeTwitRegStruct exec_FakeTwitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetFakeTwitRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_IsZero(ExecContext& ctx,Val arg0, BoundLayout<IsZeroLayout> layout1)  ;
    +extern __device__ ArgU8Struct exec_ArgU8(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<ArgU8Layout> layout2)  ;
    +extern __device__ NondetRegStruct exec_NondetU8Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetU8RegLayout> layout1)  ;
    +extern __device__ U8RegStruct exec_U8Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetU8RegLayout> layout1)  ;
    +extern __device__ ArgU16Struct exec_ArgU16(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<ArgU16Layout> layout2)  ;
    +extern __device__ NondetU16RegStruct exec_NondetU16Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetU16RegLayout> layout1)  ;
    +extern __device__ NondetU16RegStruct exec_U16Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetU16RegLayout> layout1)  ;
    +extern __device__ ToBits_5_Struct exec_ToBits_5_(ExecContext& ctx,Val arg0, BoundLayout<ToBits_5_Layout> layout1)  ;
    +extern __device__ ValU32Struct exec_DynPo2(ExecContext& ctx,Val arg0, BoundLayout<DynPo2Layout> layout1)  ;
    +extern __device__ NormalizeU32Struct exec_NormalizeU32(ExecContext& ctx,DenormedValU32Struct arg0, BoundLayout<NormalizeU32Layout> layout1)  ;
    +extern __device__ AddrDecomposeStruct exec_AddrDecompose(ExecContext& ctx,ValU32Struct arg0, Val arg1_0, BoundLayout<AddrDecomposeLayout> layout2)  ;
    +extern __device__ AddrDecomposeBitsStruct exec_AddrDecomposeBits(ExecContext& ctx,ValU32Struct arg0, Val arg1_0, BoundLayout<AddrDecomposeBitsLayout> layout2)  ;
    +extern __device__ CmpEqualStruct exec_CmpEqual(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<CmpEqualLayout> layout2)  ;
    +extern __device__ CmpLessThanUnsignedStruct exec_CmpLessThanUnsigned(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<CmpLessThanUnsignedLayout> layout2)  ;
    +extern __device__ NondetRegStruct exec_GetSignU32(ExecContext& ctx,ValU32Struct arg0, BoundLayout<GetSignU32Layout> layout1)  ;
    +extern __device__ CmpLessThanStruct exec_CmpLessThan(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<CmpLessThanLayout> layout2)  ;
    +extern __device__ ToBits_16_Struct exec_ToBits_16_(ExecContext& ctx,Val arg0, BoundLayout<ToBits_16_Layout> layout1)  ;
    +extern __device__ FromBits_16_Struct exec_BitwiseAndU16(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<BitwiseAndU16Layout> layout2)  ;
    +extern __device__ ValU32Struct exec_BitwiseAnd(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<BitwiseAndLayout> layout2)  ;
    +extern __device__ ValU32Struct exec_BitwiseOr(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<BitwiseOrLayout> layout2)  ;
    +extern __device__ ValU32Struct exec_BitwiseXor(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<BitwiseXorLayout> layout2)  ;
    +extern __device__ DecoderStruct exec_Decoder(ExecContext& ctx,ValU32Struct arg0, BoundLayout<DecoderLayout> layout1)  ;
    +extern __device__ MemoryArgStruct exec_MemoryArg(ExecContext& ctx,Val arg0, Val arg1_0, Val arg2_0, ValU32Struct arg3, BoundLayout<MemoryArgLayout> layout4)  ;
    +extern __device__ CycleArgStruct exec_CycleArg(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<CycleArgLayout> layout2)  ;
    +extern __device__ IsCycleStruct exec_IsCycle(ExecContext& ctx,Val arg0, BoundLayout<IsCycleLayout> layout1)  ;
    +extern __device__ MemoryIOStruct exec_MemoryIO(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<MemoryIOLayout> layout2)  ;
    +extern __device__ IsForwardStruct exec_IsForward(ExecContext& ctx,MemoryIOStruct arg0, BoundLayout<IsForwardLayout> layout1)  ;
    +extern __device__ GetDataStruct exec_MemoryRead(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, BoundLayout<MemoryReadLayout> layout2)  ;
    +extern __device__ MemoryWriteStruct exec_MemoryWrite(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, ValU32Struct arg2_0, BoundLayout<MemoryWriteLayout> layout3)  ;
    +extern __device__ MemoryWriteUnconstrainedStruct exec_MemoryWriteUnconstrained(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, BoundLayout<MemoryWriteUnconstrainedLayout> layout2)  ;
    +extern __device__ GetDataStruct exec_MemoryPageIn(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, BoundLayout<MemoryPageInLayout> layout2)  ;
    +extern __device__ GetDataStruct exec_MemoryPageOut(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, BoundLayout<MemoryPageOutLayout> layout2)  ;
    +extern __device__ OneHot_3_Struct exec_OneHot_3_(ExecContext& ctx,Val arg0, BoundLayout<OneHot_3_Layout> layout1)  ;
    +extern __device__ GetDataStruct exec_MemoryGet(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, OneHot_3_Struct arg2_0, BoundLayout<MemoryGetLayout> layout3)  ;
    +extern __device__ OneHot_8_Struct exec_OneHot_8_(ExecContext& ctx,Val arg0, BoundLayout<OneHot_8_Layout> layout1)  ;
    +extern __device__ InstInputStruct exec_InstInput(ExecContext& ctx,Val arg0, Val arg1_0, ValU32Struct arg2_0, Val arg3, Val arg4, BoundLayout<InstInputLayout> layout5)  ;
    +extern __device__ DoCycleTableStruct exec_DoCycleTable(ExecContext& ctx,NondetRegStruct arg0, BoundLayout<DoCycleTableLayout> layout1)  ;
    +extern __device__ DecoderStruct exec_DecodeInst(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, BoundLayout<DecodeInstLayout> layout2)  ;
    +extern __device__ GetDataStruct exec_ReadReg(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, Val arg2_0, BoundLayout<ReadRegLayout> layout3)  ;
    +extern __device__ ReadSourceRegsStruct exec_ReadSourceRegs(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, DecoderStruct arg2_0, BoundLayout<ReadSourceRegsLayout> layout3)  ;
    +extern __device__ WriteRdStruct exec_WriteRd(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, DecoderStruct arg2_0, Val arg3, ValU32Struct arg4, BoundLayout<WriteRdLayout> layout5)  ;
    +extern __device__ ExpandU32Struct exec_ExpandU32(ExecContext& ctx,ValU32Struct arg0, Val arg1_0, BoundLayout<ExpandU32Layout> layout2)  ;
    +extern __device__ SplitTotalStruct exec_SplitTotal(ExecContext& ctx,Val arg0, BoundLayout<SplitTotalLayout> layout1)  ;
    +extern __device__ MultiplyAccumulateStruct exec_MultiplyAccumulate(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, ValU32Struct arg2_0, MultiplySettingsStruct arg3, BoundLayout<MultiplyAccumulateLayout> layout4)  ;
    +extern __device__ DivInputStruct exec_DivInput(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, BoundLayout<DivInputLayout> layout2)  ;
    +extern __device__ DivideReturnStruct exec_DoDiv(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, Val arg2_0, Val arg3, BoundLayout<DoDivLayout> layout4)  ;
    +extern __device__ ValU32Struct exec_OpSRL(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpSRLLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_TopBit(ExecContext& ctx,ValU32Struct arg0, BoundLayout<TopBitLayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpSRA(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpSRALayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpSRLI(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpSRLILayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpSRAI(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpSRAILayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpDIV(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpDIVLayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpDIVU(ExecContext& ctx,DivInputStruct arg0, BoundLa
    ... [truncated]
    
  • risc0/circuit/rv32im-sys/kernels/cuda/types.cuh.inc+51 15 modified
    @@ -135,14 +135,45 @@ struct DecodeInstLayout {
       AddrDecomposeLayout pcAddr;
       MemoryReadLayout loadInst;
     };
    +using MemoryArgLayout4LayoutArray = ::cuda::std::array<MemoryArgLayout,4>;
    +using CycleArgLayout2LayoutArray = ::cuda::std::array<CycleArgLayout,2>;
    +struct _Arguments_ReadSourceRegsSourceRegsLayout {
    +  MemoryArgLayout4LayoutArray memoryArg;
    +  CycleArgLayout2LayoutArray cycleArg;
    +};
     struct ReadRegLayout {
       MemoryReadLayout _super;
       NondetRegLayout addr;
     };
    +struct ReadSourceRegsSourceRegsArm0_SuperLayout {
    +  ReadRegLayout rboth;
    +};
    +struct ReadSourceRegsSourceRegsArm0Layout {
    +  ReadSourceRegsSourceRegsArm0_SuperLayout _super;
    +  MemoryArgLayout _extra0;
    +  MemoryArgLayout _extra1;
    +  CycleArgLayout _extra2;
    +};
    +struct ReadSourceRegsSourceRegsArm1_SuperLayout {
    +  ReadRegLayout _0;
    +  ReadRegLayout _1;
    +};
    +struct ReadSourceRegsSourceRegsLayout {
    +  ReadSourceRegsSourceRegsArm0Layout arm0;
    +  ReadSourceRegsSourceRegsArm1_SuperLayout arm1;
    +};
    +struct ReadSourceRegsLayout {
    +  NondetRegLayout isSameReg;
    +  _Arguments_ReadSourceRegsSourceRegsLayout _arguments_ReadSourceRegsSourceRegs;
    +  ReadSourceRegsSourceRegsLayout sourceRegs;
    +  NondetRegLayout rs1Low;
    +  NondetRegLayout rs1High;
    +  NondetRegLayout rs2Low;
    +  NondetRegLayout rs2High;
    +};
     struct MiscInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout5LayoutArray = ::cuda::std::array<ArgU16Layout,5>;
     struct _Arguments_Misc0MiscOutputLayout {
    @@ -437,8 +468,7 @@ struct Misc2Layout {
     };
     struct MulInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout6LayoutArray = ::cuda::std::array<ArgU16Layout,6>;
     struct ArgU8Layout {
    @@ -593,8 +623,7 @@ struct Mul0Layout {
     };
     struct DivInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout16LayoutArray = ::cuda::std::array<ArgU16Layout,16>;
     struct _Arguments_Div0MulOutputLayout {
    @@ -812,8 +841,7 @@ struct Mem0Layout {
     };
     struct MemStoreInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
       NormalizeU32Layout addrU32;
       AddrDecomposeBitsLayout addr;
       MemoryReadLayout data;
    @@ -3074,6 +3102,14 @@ struct InstInputStruct {
     };
     struct DoCycleTableStruct {
     };
    +struct SourceRegsStruct {
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
    +};
    +struct ReadSourceRegsStruct {
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
    +};
     struct WriteRdStruct {
     };
     struct ExpandU32Struct {
    @@ -3100,8 +3136,8 @@ struct MultiplyAccumulateStruct {
     struct DivInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct ComponentStruct {
     };
    @@ -3123,8 +3159,8 @@ struct InstOutputBaseStruct {
     struct MiscInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct MiscOutputStruct {
       Val doWrite;
    @@ -3134,8 +3170,8 @@ struct MiscOutputStruct {
     struct MulInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct DoMulStruct {
       ValU32Struct low;
    @@ -3149,7 +3185,7 @@ struct MemLoadInputStruct {
     };
     struct MemStoreInputStruct {
       DecoderStruct decoded;
    -  GetDataStruct rs2;
    +  ValU32Struct rs2;
       AddrDecomposeBitsStruct addr;
       GetDataStruct data;
     };
    
  • risc0/circuit/rv32im-sys/kernels/cxx/layout.cpp.inc+8276 6884 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/layout.h.inc+1118 1083 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/rust_poly_fp_0.cpp+13653 11470 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/rust_poly_fp_1.cpp+11050 11123 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/rust_poly_fp_2.cpp+10656 10591 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/rust_poly_fp_3.cpp+11090 12221 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/steps.cpp+8448 8281 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/steps.h+2 1 modified
    @@ -75,6 +75,7 @@ extern InstInputStruct exec_InstInput(ExecContext& ctx,Val arg0, Val arg1_0, Val
     extern DoCycleTableStruct exec_DoCycleTable(ExecContext& ctx,NondetRegStruct arg0, BoundLayout<DoCycleTableLayout> layout1)  ;
     extern DecoderStruct exec_DecodeInst(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, BoundLayout<DecodeInstLayout> layout2)  ;
     extern GetDataStruct exec_ReadReg(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, Val arg2_0, BoundLayout<ReadRegLayout> layout3)  ;
    +extern ReadSourceRegsStruct exec_ReadSourceRegs(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, DecoderStruct arg2_0, BoundLayout<ReadSourceRegsLayout> layout3)  ;
     extern WriteRdStruct exec_WriteRd(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, DecoderStruct arg2_0, Val arg3, ValU32Struct arg4, BoundLayout<WriteRdLayout> layout5)  ;
     extern ExpandU32Struct exec_ExpandU32(ExecContext& ctx,ValU32Struct arg0, Val arg1_0, BoundLayout<ExpandU32Layout> layout2)  ;
     extern SplitTotalStruct exec_SplitTotal(ExecContext& ctx,Val arg0, BoundLayout<SplitTotalLayout> layout1)  ;
    @@ -226,7 +227,7 @@ extern OneHot_13_Struct exec_OneHot_13_(ExecContext& ctx,Val arg0, BoundLayout<O
     extern TopStruct exec_Top(ExecContext& ctx,BoundLayout<TopLayout> layout0, GlobalBuf global1)  ;
     extern void step_Top(ExecContext& ctx,MutableBuf data0, GlobalBuf global1)  ;
     extern AccumStruct exec_Accum(ExecContext& ctx,BigIntTopStateStruct arg0, ExtVal1Array arg1_0, BoundLayout<AccumLayout> layout2)  ;
    -extern BigIntTopStateStruct exec_TopExtract(ExecContext& ctx,BoundLayout<TopLayout> arg0, GlobalBuf global1)  ;
    +extern BigIntTopStateStruct exec_TopExtract(ExecContext& ctx,BoundLayout<TopLayout> layout0, GlobalBuf global1)  ;
     extern AccumStruct execUser_Accum(ExecContext& ctx,BoundLayout<TopLayout> arg0, ExtVal1Array arg1_0, BoundLayout<AccumLayout> layout2, GlobalBuf global3)  ;
     extern ComponentStruct exec_TopAccum(ExecContext& ctx,BoundLayout<TopLayout> arg0, BoundLayout<LayoutAccumLayout> layout1, GlobalBuf global2, GlobalBuf mix3)  ;
     extern void step_TopAccum(ExecContext& ctx,MutableBuf accum0, MutableBuf data1, GlobalBuf global2, GlobalBuf mix3)  ;
    
  • risc0/circuit/rv32im-sys/kernels/cxx/types.h.inc+51 15 modified
    @@ -135,14 +135,45 @@ struct DecodeInstLayout {
       AddrDecomposeLayout pcAddr;
       MemoryReadLayout loadInst;
     };
    +using MemoryArgLayout4LayoutArray = std::array<MemoryArgLayout, 4>;
    +using CycleArgLayout2LayoutArray = std::array<CycleArgLayout, 2>;
    +struct _Arguments_ReadSourceRegsSourceRegsLayout {
    +  MemoryArgLayout4LayoutArray memoryArg;
    +  CycleArgLayout2LayoutArray cycleArg;
    +};
     struct ReadRegLayout {
       MemoryReadLayout _super;
       NondetRegLayout addr;
     };
    +struct ReadSourceRegsSourceRegsArm0_SuperLayout {
    +  ReadRegLayout rboth;
    +};
    +struct ReadSourceRegsSourceRegsArm0Layout {
    +  ReadSourceRegsSourceRegsArm0_SuperLayout _super;
    +  MemoryArgLayout _extra0;
    +  MemoryArgLayout _extra1;
    +  CycleArgLayout _extra2;
    +};
    +struct ReadSourceRegsSourceRegsArm1_SuperLayout {
    +  ReadRegLayout _0;
    +  ReadRegLayout _1;
    +};
    +struct ReadSourceRegsSourceRegsLayout {
    +  ReadSourceRegsSourceRegsArm0Layout arm0;
    +  ReadSourceRegsSourceRegsArm1_SuperLayout arm1;
    +};
    +struct ReadSourceRegsLayout {
    +  NondetRegLayout isSameReg;
    +  _Arguments_ReadSourceRegsSourceRegsLayout _arguments_ReadSourceRegsSourceRegs;
    +  ReadSourceRegsSourceRegsLayout sourceRegs;
    +  NondetRegLayout rs1Low;
    +  NondetRegLayout rs1High;
    +  NondetRegLayout rs2Low;
    +  NondetRegLayout rs2High;
    +};
     struct MiscInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout5LayoutArray = std::array<ArgU16Layout, 5>;
     struct _Arguments_Misc0MiscOutputLayout {
    @@ -437,8 +468,7 @@ struct Misc2Layout {
     };
     struct MulInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout6LayoutArray = std::array<ArgU16Layout, 6>;
     struct ArgU8Layout {
    @@ -593,8 +623,7 @@ struct Mul0Layout {
     };
     struct DivInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout16LayoutArray = std::array<ArgU16Layout, 16>;
     struct _Arguments_Div0MulOutputLayout {
    @@ -812,8 +841,7 @@ struct Mem0Layout {
     };
     struct MemStoreInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
       NormalizeU32Layout addrU32;
       AddrDecomposeBitsLayout addr;
       MemoryReadLayout data;
    @@ -3074,6 +3102,14 @@ struct InstInputStruct {
     };
     struct DoCycleTableStruct {
     };
    +struct SourceRegsStruct {
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
    +};
    +struct ReadSourceRegsStruct {
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
    +};
     struct WriteRdStruct {
     };
     struct ExpandU32Struct {
    @@ -3100,8 +3136,8 @@ struct MultiplyAccumulateStruct {
     struct DivInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct ComponentStruct {
     };
    @@ -3123,8 +3159,8 @@ struct InstOutputBaseStruct {
     struct MiscInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct MiscOutputStruct {
       Val doWrite;
    @@ -3134,8 +3170,8 @@ struct MiscOutputStruct {
     struct MulInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct DoMulStruct {
       ValU32Struct low;
    @@ -3149,7 +3185,7 @@ struct MemLoadInputStruct {
     };
     struct MemStoreInputStruct {
       DecoderStruct decoded;
    -  GetDataStruct rs2;
    +  ValU32Struct rs2;
       AddrDecomposeBitsStruct addr;
       GetDataStruct data;
     };
    
  • risc0/zkvm/src/host/recursion/tests.rs+1 1 modified
    @@ -398,7 +398,7 @@ fn stable_root() {
     
         assert_eq!(
             ALLOWED_CONTROL_ROOT,
    -        digest!("539032186827b06719244873b17b2d4c122e2d02cfb1994fe958b2523b844576")
    +        digest!("884389273e128b32475b334dec75ee619b77cb33d41c332021fe7e44c746ee60")
         );
     }
     
    
  • risc0/zkvm/src/receipt/composite.rs+1 1 modified
    @@ -315,7 +315,7 @@ mod tests {
         fn composite_receipt_verifier_parameters_is_stable() {
             assert_eq!(
                 CompositeReceiptVerifierParameters::default().digest(),
    -            digest!("3daead8f1ec08eb96b60ce6cad42f82eba80f6cf89ba5007ca317e57256b6038")
    +            digest!("50ffbc35d194e6c9f5fc8adb030d077f3bf5393d5e9cedc6f303a9f1eede3a32")
             );
         }
     }
    
  • risc0/zkvm/src/receipt/groth16.rs+1 1 modified
    @@ -195,7 +195,7 @@ mod tests {
         fn groth16_receipt_verifier_parameters_is_stable() {
             assert_eq!(
                 Groth16ReceiptVerifierParameters::default().digest(),
    -            digest!("9f39696cb3ae9d6038d6b7a55c09017f0cf35e226ad7582b82dbabb0dae53385")
    +            digest!("f536085a791bdbc6cb46ab3074f88e9e94eabb192de8daca3caee1f4ed811b08")
             );
         }
     }
    
  • risc0/zkvm/src/receipt/succinct.rs+1 1 modified
    @@ -357,7 +357,7 @@ mod tests {
         fn succinct_receipt_verifier_parameters_is_stable() {
             assert_eq!(
                 SuccinctReceiptVerifierParameters::default().digest(),
    -            digest!("68ecff4bad7b3348ca3ac642e852b8d66b7158307f7d2a001c13887698fe6019")
    +            digest!("bb81f1400f9a2b28b457f9d686c28ec3ffeece08b0b00f1b0d7643a1cc471115")
             );
         }
     
    
1873bbb8a567

ZKVM-1392: Disallow memory I/O to same address in the same memory cycle (#3181)

https://github.com/risc0/risc0Frank LaubMay 23, 2025via ghsa
34 files changed · +153037 178697
  • risc0/build/src/docker.rs+1 1 modified
    @@ -268,7 +268,7 @@ mod test {
             compare_image_id(
                 &guest_list,
                 "hello_commit",
    -            "97323d9305f6de30f4930c03f0e2e5018c7e7bd06ee10a505a93cfe898e1c60f",
    +            "746da1fdbff7e11b281938fcff1f0d3716712c34af385b55229b074e0f1a3d9a",
             );
         }
     }
    
  • risc0/circuit/recursion/build.rs+1 1 modified
    @@ -41,7 +41,7 @@ fn download_zkr() {
     
         const FILENAME: &str = "recursion_zkr.zip";
         const SRC_PATH: &str = "src/recursion_zkr.zip";
    -    const SHA256_HASH: &str = "5f1762201f5c4afb5d92df4a5b8e5bf5c87b67785991592ba79ce4033719b030";
    +    const SHA256_HASH: &str = "b51785b36bff327f8fc7f3983aea343d1daf015a09189dedb5a3e851884db98e";
     
         fn check_sha2(path: &Path) -> bool {
             let data = fs::read(path).unwrap();
    
  • risc0/circuit/recursion/src/control_id.rs+32 32 modified
    @@ -23,22 +23,22 @@ pub const MIN_LIFT_PO2: usize = 14;
     pub const ALLOWED_CONTROL_IDS: &[Digest] = &[
         digest!("0d79bc33b4760b4783cbb96fdc87724c7e0c463eb0ba1b2705d39f43c698bd2d"), // recursion identity.zkr
         digest!("7a8f24092c34ed3eb81b3d0a0b796c588c615d3488ef9e61c21dbd1e4b83ea6e"), // recursion join.zkr
    -    digest!("512b79026fad0712ad93600ea0ea4234d0be686ea9473e4964f10914a0862c77"), // recursion lift_rv32im_v2_14.zkr
    -    digest!("78aabd63d877bc2806371f228fb05d0f9c8c3330bc782f62c7c6d80b4195de74"), // recursion lift_rv32im_v2_15.zkr
    -    digest!("0bef5e34d752b46874fb523c7d01963a37771d25a6af7c26b808fa26b8a0d815"), // recursion lift_rv32im_v2_16.zkr
    -    digest!("ac1a445d5babf304365232571f822725dcf71f3c8d5e7032c1bba04bad19a85e"), // recursion lift_rv32im_v2_17.zkr
    -    digest!("20ae3d31f954e9594cb968463ce0f823b869e3640169a561fc917226f4ca8963"), // recursion lift_rv32im_v2_18.zkr
    -    digest!("6f16e65efedcbf11b20b9e194e123e33aaedcd0abf1e6e5440efa263daeb375a"), // recursion lift_rv32im_v2_19.zkr
    -    digest!("6da21d5bc6a7534bc686b9294717f12994b13c67183c86668c62d01fcc453151"), // recursion lift_rv32im_v2_20.zkr
    -    digest!("60ea420126e9446430dbed5ca8b29017b6d0f31782710a1d8f8bdd3de5854714"), // recursion lift_rv32im_v2_21.zkr
    -    digest!("d5f05524e8bbb123f8fb1b5299413c50462cef399119953f494e57354351e844"), // recursion lift_rv32im_v2_22.zkr
    +    digest!("8af493194e835b276eefc2522cf71761afdb04286bd3490577d55419049eed21"), // recursion lift_rv32im_v2_14.zkr
    +    digest!("ff455665b3743b2e4ec959674cfec4064fa54420ef0f6d38a601e85a841c3a73"), // recursion lift_rv32im_v2_15.zkr
    +    digest!("94a836188680865ff490ae12c140ec1c3a462c67203eda37f3ac6720d680a862"), // recursion lift_rv32im_v2_16.zkr
    +    digest!("b8c3e64be7662b1c9fc04d65dc276b1a5402b66a657fca4486450417b517a96e"), // recursion lift_rv32im_v2_17.zkr
    +    digest!("7768ce5e55c6e0427962342cc0c4cd43b359da5187d65465317c8c065357cd1d"), // recursion lift_rv32im_v2_18.zkr
    +    digest!("cdfd5d3007f57a1836f83c351fbb3d0f7af43050f5f6a06296f9ba25b516eb69"), // recursion lift_rv32im_v2_19.zkr
    +    digest!("14eb825f500342317158942d328a745e9dda2043b5bc27248f726e57effe2d23"), // recursion lift_rv32im_v2_20.zkr
    +    digest!("d3286f768d13864fa7cc921a25ead7536d09d56ad304a9635c3fa60f511eea62"), // recursion lift_rv32im_v2_21.zkr
    +    digest!("5e37cb58440474617b5beb2e1f3e7472d76a5e7572bb4660896d1074dfa7905d"), // recursion lift_rv32im_v2_22.zkr
         digest!("53a7b23d07f99e5d5685e85874f5181e8486aa267a0ae607ffe9ba47c8bdda4a"), // recursion resolve.zkr
         digest!("7771415b778fea1923440e2eb22c4a1e1d7ada2d42cbe03d13402743c0988a31"), // recursion union.zkr
     ];
     
     /// Root of the Merkle tree constructed from [ALLOWED_CONTROL_IDS], using Poseidon2.
     pub const ALLOWED_CONTROL_ROOT: Digest =
    -    digest!("539032186827b06719244873b17b2d4c122e2d02cfb1994fe958b2523b844576");
    +    digest!("884389273e128b32475b334dec75ee619b77cb33d41c332021fe7e44c746ee60");
     
     /// Control ID for the identity recursion programs (ZKR), using Poseidon over the BN254 scalar field.
     pub const BN254_IDENTITY_CONTROL_ID: Digest =
    @@ -100,47 +100,47 @@ pub const POSEIDON2_CONTROL_IDS: [(&str, Digest); 27] = [
         ),
         (
             "lift_rv32im_v2_14.zkr",
    -        digest!("512b79026fad0712ad93600ea0ea4234d0be686ea9473e4964f10914a0862c77"),
    +        digest!("8af493194e835b276eefc2522cf71761afdb04286bd3490577d55419049eed21"),
         ),
         (
             "lift_rv32im_v2_15.zkr",
    -        digest!("78aabd63d877bc2806371f228fb05d0f9c8c3330bc782f62c7c6d80b4195de74"),
    +        digest!("ff455665b3743b2e4ec959674cfec4064fa54420ef0f6d38a601e85a841c3a73"),
         ),
         (
             "lift_rv32im_v2_16.zkr",
    -        digest!("0bef5e34d752b46874fb523c7d01963a37771d25a6af7c26b808fa26b8a0d815"),
    +        digest!("94a836188680865ff490ae12c140ec1c3a462c67203eda37f3ac6720d680a862"),
         ),
         (
             "lift_rv32im_v2_17.zkr",
    -        digest!("ac1a445d5babf304365232571f822725dcf71f3c8d5e7032c1bba04bad19a85e"),
    +        digest!("b8c3e64be7662b1c9fc04d65dc276b1a5402b66a657fca4486450417b517a96e"),
         ),
         (
             "lift_rv32im_v2_18.zkr",
    -        digest!("20ae3d31f954e9594cb968463ce0f823b869e3640169a561fc917226f4ca8963"),
    +        digest!("7768ce5e55c6e0427962342cc0c4cd43b359da5187d65465317c8c065357cd1d"),
         ),
         (
             "lift_rv32im_v2_19.zkr",
    -        digest!("6f16e65efedcbf11b20b9e194e123e33aaedcd0abf1e6e5440efa263daeb375a"),
    +        digest!("cdfd5d3007f57a1836f83c351fbb3d0f7af43050f5f6a06296f9ba25b516eb69"),
         ),
         (
             "lift_rv32im_v2_20.zkr",
    -        digest!("6da21d5bc6a7534bc686b9294717f12994b13c67183c86668c62d01fcc453151"),
    +        digest!("14eb825f500342317158942d328a745e9dda2043b5bc27248f726e57effe2d23"),
         ),
         (
             "lift_rv32im_v2_21.zkr",
    -        digest!("60ea420126e9446430dbed5ca8b29017b6d0f31782710a1d8f8bdd3de5854714"),
    +        digest!("d3286f768d13864fa7cc921a25ead7536d09d56ad304a9635c3fa60f511eea62"),
         ),
         (
             "lift_rv32im_v2_22.zkr",
    -        digest!("d5f05524e8bbb123f8fb1b5299413c50462cef399119953f494e57354351e844"),
    +        digest!("5e37cb58440474617b5beb2e1f3e7472d76a5e7572bb4660896d1074dfa7905d"),
         ),
         (
             "lift_rv32im_v2_23.zkr",
    -        digest!("b4459e2bc38f800ed80c956234d59a4611d0f825eae566478ac4c06a07a61c21"),
    +        digest!("387a9e1a4752e35bbcc27a05c9102713fd6e42728f1bae74bb21d9054a87cc08"),
         ),
         (
             "lift_rv32im_v2_24.zkr",
    -        digest!("4434690c184bd542c823aa1efcf6c15cf8c83d0aafbf4f3e0552d8125eedd12a"),
    +        digest!("60c7632be5c98c38b567522947c03a1048882d2beeba175b63060351486e670d"),
         ),
         (
             "resolve.zkr",
    @@ -212,47 +212,47 @@ pub const SHA256_CONTROL_IDS: [(&str, Digest); 27] = [
         ),
         (
             "lift_rv32im_v2_14.zkr",
    -        digest!("9515af7e33bb75efd90a1f23b12762ca36231881656b4af9fd1685a6ff4ec018"),
    +        digest!("d60c25f02824db9fc7bdcecdc4d431d2d22b65eba7948825948ae1bc92d60946"),
         ),
         (
             "lift_rv32im_v2_15.zkr",
    -        digest!("2b0d1276550887f6b27a423f43a4ce89abef45e056d86c8a59fa8d4593701844"),
    +        digest!("ef84c7599ba1c513dc60370fcf10f0ad97a1849f92e455b7d6dd8359c427a187"),
         ),
         (
             "lift_rv32im_v2_16.zkr",
    -        digest!("92f3c9ee2e5e1a23d90a0e7dd52bf7b9b4f1e272613ac76e5bf6e932fa8de0ec"),
    +        digest!("99139be7bc3b8692f5c38c37529cc84915cce84f8bcd3fa7913abc7984192b2b"),
         ),
         (
             "lift_rv32im_v2_17.zkr",
    -        digest!("4d9c713b2dfa00271b9d4a87ef4244974a85bbb20b493cd103d75b4fcc60d411"),
    +        digest!("bf6c6915e4f31661e11edb487a57c2a56aa44203b9e6886a2a703a44103b2748"),
         ),
         (
             "lift_rv32im_v2_18.zkr",
    -        digest!("7054dde82886b4a8955539872ff4784973a61782ec71348a405564a21ae3f630"),
    +        digest!("21f330b32a66a4352025edf53ac05ecf10cd5ea9db6302c755de421d4cc6589e"),
         ),
         (
             "lift_rv32im_v2_19.zkr",
    -        digest!("c4abec2567fbd603ce616ecd27923f45b601d5f86cc48d1f1fb3091615afb6fd"),
    +        digest!("57049b4e505fa5f706847e9ba3905d93eb0198fe1b69fd19405e3ae3aa266009"),
         ),
         (
             "lift_rv32im_v2_20.zkr",
    -        digest!("1263bd3dcecab89069b91de5c4c99bdc33f853b00b50e1f35e4ffa392badd7a4"),
    +        digest!("9889b3329bd0d2c4694113b4e56790f105efb2b79effd21bfc0c3c3f41bd8066"),
         ),
         (
             "lift_rv32im_v2_21.zkr",
    -        digest!("7380d1f06f8fb3dc3f9c7d278071fbc3bf30073229c6885d1a41c6528e90e4c7"),
    +        digest!("9c976973ab89b8497fc830c1a0305e9f907dbbd40574482e93f6e18458ee2a87"),
         ),
         (
             "lift_rv32im_v2_22.zkr",
    -        digest!("793cbfc8de47a9beeb2221cac0d06470fc87e26771330561369fb518cc3b1b05"),
    +        digest!("a1521c33c8faf68b3db10be0aa3fbde3e100ae8ec924206529db4f1cefe70d5b"),
         ),
         (
             "lift_rv32im_v2_23.zkr",
    -        digest!("7bc461a9ff258b32178124b8c8f78cadac35db313b57f62d51958ec9ec37fb71"),
    +        digest!("45da7396e10423a381e3e42c25a5fb05bb27389e8ca1c73f046de24e790c7727"),
         ),
         (
             "lift_rv32im_v2_24.zkr",
    -        digest!("dc295096d9db9166e06e424445563cc4bec8fdb1a69e3b2fcee1bba75fa85883"),
    +        digest!("8645ae4ab3fa5686dafa447471959834cf4c68d65af8f04cc55300497d31c197"),
         ),
         (
             "resolve.zkr",
    
  • risc0/circuit/recursion/src/recursion_zkr.zip+2 2 modified
    @@ -1,3 +1,3 @@
     version https://git-lfs.github.com/spec/v1
    -oid sha256:5f1762201f5c4afb5d92df4a5b8e5bf5c87b67785991592ba79ce4033719b030
    -size 47454351
    +oid sha256:b51785b36bff327f8fc7f3983aea343d1daf015a09189dedb5a3e851884db98e
    +size 47476190
    
  • risc0/circuit/rv32im/src/execute/r0vm.rs+1 1 modified
    @@ -321,7 +321,7 @@ impl<'a, T: Risc0Context> Risc0Machine<'a, T> {
                         rlen -= WORD_SIZE as u32;
                     } else {
                         // tracing::trace!("store: {:#010x} -> null", 0);
    -                    self.store_memory(SAFE_WRITE_ADDR.waddr(), 0)?;
    +                    self.store_memory(SAFE_WRITE_ADDR.waddr() + j, 0)?;
                     }
                 }
     
    
  • risc0/circuit/rv32im/src/execute/rv32im.rs+16 2 modified
    @@ -421,6 +421,20 @@ impl Emulator {
             Ok(())
         }
     
    +    fn load_rs2<M: EmuContext>(
    +        &self,
    +        ctx: &mut M,
    +        decoded: &DecodedInstruction,
    +        rs1: u32,
    +    ) -> Result<u32> {
    +        if decoded.rs1 == decoded.rs2 {
    +            Ok(rs1)
    +        } else {
    +            ctx.load_register(decoded.rs2 as usize)
    +        }
    +    }
    +
    +    #[inline(always)]
         fn step_compute<M: EmuContext>(
             &mut self,
             ctx: &mut M,
    @@ -431,7 +445,7 @@ impl Emulator {
             let mut new_pc = pc + WORD_SIZE;
             let mut rd = decoded.rd;
             let rs1 = ctx.load_register(decoded.rs1 as usize)?;
    -        let rs2 = ctx.load_register(decoded.rs2 as usize)?;
    +        let rs2 = self.load_rs2(ctx, &decoded, rs1)?;
             let imm_i = decoded.imm_i();
             let mut br_cond = |cond| -> u32 {
                 rd = 0;
    @@ -602,7 +616,7 @@ impl Emulator {
             decoded: &DecodedInstruction,
         ) -> Result<bool> {
             let rs1 = ctx.load_register(decoded.rs1 as usize)?;
    -        let rs2 = ctx.load_register(decoded.rs2 as usize)?;
    +        let rs2 = self.load_rs2(ctx, &decoded, rs1)?;
             let addr = ByteAddr(rs1.wrapping_add(decoded.imm_s()));
             let shift = 8 * (addr.0 & 3);
             if !ctx.check_data_store(addr) {
    
  • risc0/circuit/rv32im/src/prove/witgen/preflight.rs+3 2 modified
    @@ -14,7 +14,7 @@
     
     use std::collections::BTreeSet;
     
    -use anyhow::{anyhow, bail, Result};
    +use anyhow::{anyhow, bail, ensure, Result};
     use derive_more::Debug;
     use num_traits::FromPrimitive as _;
     use risc0_binfmt::{ByteAddr, WordAddr};
    @@ -216,7 +216,8 @@ impl<'a> Preflight<'a> {
                     txn.prev_cycle = self.prev_cycle.get(&addr).unwrap();
                 } else {
                     // Otherwise, compute cycle diff and another diff
    -                let diff = txn.cycle - txn.prev_cycle;
    +                ensure!(txn.cycle != txn.prev_cycle);
    +                let diff = txn.cycle - 1 - txn.prev_cycle;
                     self.trace.cycles[(diff / 2) as usize].diff_count[(diff % 2) as usize] += 1;
                 }
     
    
  • risc0/circuit/rv32im/src/zirgen/info.rs+17 18 modified
    @@ -30,7 +30,7 @@ impl CircuitInfo for CircuitImpl {
     }
     
     #[allow(dead_code)]
    -pub const NUM_POLY_MIX_POWERS: usize = 472;
    +pub const NUM_POLY_MIX_POWERS: usize = 458;
     
     #[allow(dead_code)]
     pub const POLY_MIX_POWERS: &[usize] = &[
    @@ -42,21 +42,20 @@ pub const POLY_MIX_POWERS: &[usize] = &[
         117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
         136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
         155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
    -    174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 187, 188, 190, 197, 198, 199, 200, 201, 202,
    -    203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221,
    -    222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
    -    241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259,
    -    260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
    -    279, 280, 285, 298, 304, 310, 315, 324, 326, 328, 329, 331, 335, 336, 342, 343, 344, 345, 346,
    -    347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365,
    -    366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
    -    385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403,
    -    404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 428, 436, 456,
    -    471, 510, 513, 521, 586, 592, 604, 635, 651, 658, 674, 681, 704, 705, 706, 707, 708, 709, 710,
    -    711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729,
    -    756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774,
    -    775, 790, 808, 950, 1040, 1127, 1214, 1352, 1544, 1825, 2128, 2279, 2428, 3295, 3715, 5722,
    -    6131, 6835, 7551, 7552, 7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564,
    -    7567, 7570, 7573, 7577, 7580, 7583, 7587, 7597, 7607, 7617, 7631, 7648, 7658, 7669, 7689, 7699,
    -    7718, 7720, 7727,
    +    174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 185, 187, 188, 190, 197, 198, 199, 200, 201,
    +    202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
    +    221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
    +    240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258,
    +    259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277,
    +    278, 279, 280, 298, 304, 310, 317, 323, 326, 328, 329, 334, 335, 343, 349, 350, 354, 355, 361,
    +    362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380,
    +    381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399,
    +    400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418,
    +    419, 420, 436, 447, 456, 471, 513, 521, 529, 586, 604, 611, 635, 651, 658, 681, 693, 704, 705,
    +    706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724,
    +    725, 726, 727, 728, 729, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788,
    +    789, 790, 791, 792, 793, 794, 808, 828, 1007, 1040, 1127, 1214, 1428, 1544, 1825, 2223, 2374,
    +    2542, 3409, 3829, 5836, 6245, 6949, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674,
    +    7675, 7676, 7677, 7678, 7681, 7684, 7687, 7691, 7694, 7697, 7701, 7711, 7721, 7731, 7745, 7762,
    +    7772, 7783, 7803, 7813, 7832, 7834, 7841,
     ];
    
  • risc0/circuit/rv32im/src/zirgen/layout.rs.inc+3693 3388 modified
  • risc0/circuit/rv32im/src/zirgen/poly_ext.rs+18967 18760 modified
  • risc0/circuit/rv32im/src/zirgen/types.rs.inc+132 23 modified
    @@ -465,6 +465,23 @@ impl risc0_zkp::layout::Component for DecodeInstLayout {
             Ok(())
         }
     }
    +pub type MemoryArgLayout4LayoutArray = [&'static MemoryArgLayout; 4];
    +pub type CycleArgLayout2LayoutArray = [&'static CycleArgLayout; 2];
    +pub struct _Arguments_ReadSourceRegsSourceRegsLayout {
    +    pub memory_arg: &'static MemoryArgLayout4LayoutArray,
    +    pub cycle_arg: &'static CycleArgLayout2LayoutArray,
    +}
    +impl risc0_zkp::layout::Component for _Arguments_ReadSourceRegsSourceRegsLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "_Arguments_ReadSourceRegsSourceRegsLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("memory_arg", self.memory_arg)?;
    +        v.visit_component("cycle_arg", self.cycle_arg)?;
    +        Ok(())
    +    }
    +}
     pub struct ReadRegLayout {
         pub _super: &'static MemoryReadLayout,
         pub addr: &'static NondetRegLayout,
    @@ -480,10 +497,99 @@ impl risc0_zkp::layout::Component for ReadRegLayout {
             Ok(())
         }
     }
    +pub struct ReadSourceRegsSourceRegsArm0_SuperLayout {
    +    pub rboth: &'static ReadRegLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsSourceRegsArm0_SuperLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsSourceRegsArm0_SuperLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("rboth", self.rboth)?;
    +        Ok(())
    +    }
    +}
    +pub struct ReadSourceRegsSourceRegsArm0Layout {
    +    pub _super: &'static ReadSourceRegsSourceRegsArm0_SuperLayout,
    +    pub _extra0: &'static MemoryArgLayout,
    +    pub _extra1: &'static MemoryArgLayout,
    +    pub _extra2: &'static CycleArgLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsSourceRegsArm0Layout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsSourceRegsArm0Layout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("_super", self._super)?;
    +        v.visit_component("_extra0", self._extra0)?;
    +        v.visit_component("_extra1", self._extra1)?;
    +        v.visit_component("_extra2", self._extra2)?;
    +        Ok(())
    +    }
    +}
    +pub struct ReadSourceRegsSourceRegsArm1_SuperLayout {
    +    pub _0: &'static ReadRegLayout,
    +    pub _1: &'static ReadRegLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsSourceRegsArm1_SuperLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsSourceRegsArm1_SuperLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("_0", self._0)?;
    +        v.visit_component("_1", self._1)?;
    +        Ok(())
    +    }
    +}
    +pub struct ReadSourceRegsSourceRegsLayout {
    +    pub arm0: &'static ReadSourceRegsSourceRegsArm0Layout,
    +    pub arm1: &'static ReadSourceRegsSourceRegsArm1_SuperLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsSourceRegsLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsSourceRegsLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("arm0", self.arm0)?;
    +        v.visit_component("arm1", self.arm1)?;
    +        Ok(())
    +    }
    +}
    +pub struct ReadSourceRegsLayout {
    +    pub is_same_reg: &'static NondetRegLayout,
    +    pub _arguments_read_source_regs_source_regs: &'static _Arguments_ReadSourceRegsSourceRegsLayout,
    +    pub source_regs: &'static ReadSourceRegsSourceRegsLayout,
    +    pub rs1_low: &'static NondetRegLayout,
    +    pub rs1_high: &'static NondetRegLayout,
    +    pub rs2_low: &'static NondetRegLayout,
    +    pub rs2_high: &'static NondetRegLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("is_same_reg", self.is_same_reg)?;
    +        v.visit_component(
    +            "_arguments_read_source_regs_source_regs",
    +            self._arguments_read_source_regs_source_regs,
    +        )?;
    +        v.visit_component("source_regs", self.source_regs)?;
    +        v.visit_component("rs1_low", self.rs1_low)?;
    +        v.visit_component("rs1_high", self.rs1_high)?;
    +        v.visit_component("rs2_low", self.rs2_low)?;
    +        v.visit_component("rs2_high", self.rs2_high)?;
    +        Ok(())
    +    }
    +}
     pub struct MiscInputLayout {
         pub decoded: &'static DecodeInstLayout,
    -    pub rs1: &'static ReadRegLayout,
    -    pub rs2: &'static ReadRegLayout,
    +    pub source_regs: &'static ReadSourceRegsLayout,
     }
     impl risc0_zkp::layout::Component for MiscInputLayout {
         fn ty_name(&self) -> &'static str {
    @@ -492,8 +598,7 @@ impl risc0_zkp::layout::Component for MiscInputLayout {
         #[allow(unused_variables)]
         fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
             v.visit_component("decoded", self.decoded)?;
    -        v.visit_component("rs1", self.rs1)?;
    -        v.visit_component("rs2", self.rs2)?;
    +        v.visit_component("source_regs", self.source_regs)?;
             Ok(())
         }
     }
    @@ -1466,8 +1571,7 @@ impl risc0_zkp::layout::Component for Misc2Layout {
     }
     pub struct MulInputLayout {
         pub decoded: &'static DecodeInstLayout,
    -    pub rs1: &'static ReadRegLayout,
    -    pub rs2: &'static ReadRegLayout,
    +    pub source_regs: &'static ReadSourceRegsLayout,
     }
     impl risc0_zkp::layout::Component for MulInputLayout {
         fn ty_name(&self) -> &'static str {
    @@ -1476,8 +1580,7 @@ impl risc0_zkp::layout::Component for MulInputLayout {
         #[allow(unused_variables)]
         fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
             v.visit_component("decoded", self.decoded)?;
    -        v.visit_component("rs1", self.rs1)?;
    -        v.visit_component("rs2", self.rs2)?;
    +        v.visit_component("source_regs", self.source_regs)?;
             Ok(())
         }
     }
    @@ -1953,8 +2056,7 @@ impl risc0_zkp::layout::Component for Mul0Layout {
     }
     pub struct DivInputLayout {
         pub decoded: &'static DecodeInstLayout,
    -    pub rs1: &'static ReadRegLayout,
    -    pub rs2: &'static ReadRegLayout,
    +    pub source_regs: &'static ReadSourceRegsLayout,
     }
     impl risc0_zkp::layout::Component for DivInputLayout {
         fn ty_name(&self) -> &'static str {
    @@ -1963,8 +2065,7 @@ impl risc0_zkp::layout::Component for DivInputLayout {
         #[allow(unused_variables)]
         fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
             v.visit_component("decoded", self.decoded)?;
    -        v.visit_component("rs1", self.rs1)?;
    -        v.visit_component("rs2", self.rs2)?;
    +        v.visit_component("source_regs", self.source_regs)?;
             Ok(())
         }
     }
    @@ -2677,8 +2778,7 @@ impl risc0_zkp::layout::Component for Mem0Layout {
     }
     pub struct MemStoreInputLayout {
         pub decoded: &'static DecodeInstLayout,
    -    pub rs1: &'static ReadRegLayout,
    -    pub rs2: &'static ReadRegLayout,
    +    pub source_regs: &'static ReadSourceRegsLayout,
         pub addr_u32: &'static NormalizeU32Layout,
         pub addr: &'static AddrDecomposeBitsLayout,
         pub data_0: &'static MemoryReadLayout,
    @@ -2690,8 +2790,7 @@ impl risc0_zkp::layout::Component for MemStoreInputLayout {
         #[allow(unused_variables)]
         fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
             v.visit_component("decoded", self.decoded)?;
    -        v.visit_component("rs1", self.rs1)?;
    -        v.visit_component("rs2", self.rs2)?;
    +        v.visit_component("source_regs", self.source_regs)?;
             v.visit_component("addr_u32", self.addr_u32)?;
             v.visit_component("addr", self.addr)?;
             v.visit_component("data_0", self.data_0)?;
    @@ -8490,6 +8589,16 @@ pub struct InstInputStruct {
     #[derive(Copy, Clone, Debug)]
     pub struct DoCycleTableStruct {}
     #[derive(Copy, Clone, Debug)]
    +pub struct SourceRegsStruct {
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
    +}
    +#[derive(Copy, Clone, Debug)]
    +pub struct ReadSourceRegsStruct {
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
    +}
    +#[derive(Copy, Clone, Debug)]
     pub struct WriteRdStruct {}
     #[derive(Copy, Clone, Debug)]
     pub struct ExpandU32Struct {
    @@ -8520,8 +8629,8 @@ pub struct MultiplyAccumulateStruct {
     pub struct DivInputStruct {
         pub _super: InstInputStruct,
         pub decoded: DecoderStruct,
    -    pub rs1: GetDataStruct,
    -    pub rs2: GetDataStruct,
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
     }
     #[derive(Copy, Clone, Debug)]
     pub struct ComponentStruct {}
    @@ -8547,8 +8656,8 @@ pub struct InstOutputBaseStruct {
     pub struct MiscInputStruct {
         pub _super: InstInputStruct,
         pub decoded: DecoderStruct,
    -    pub rs1: GetDataStruct,
    -    pub rs2: GetDataStruct,
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
     }
     #[derive(Copy, Clone, Debug)]
     pub struct MiscOutputStruct {
    @@ -8560,8 +8669,8 @@ pub struct MiscOutputStruct {
     pub struct MulInputStruct {
         pub _super: InstInputStruct,
         pub decoded: DecoderStruct,
    -    pub rs1: GetDataStruct,
    -    pub rs2: GetDataStruct,
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
     }
     #[derive(Copy, Clone, Debug)]
     pub struct DoMulStruct {
    @@ -8578,7 +8687,7 @@ pub struct MemLoadInputStruct {
     #[derive(Copy, Clone, Debug)]
     pub struct MemStoreInputStruct {
         pub decoded: DecoderStruct,
    -    pub rs2: GetDataStruct,
    +    pub rs2: ValU32Struct,
         pub addr: AddrDecomposeBitsStruct,
         pub data_0: GetDataStruct,
     }
    
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check_0.cu+7546 6517 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check_1.cu+6211 6298 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check_2.cu+6159 6186 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check_3.cu+5993 6647 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check.cuh+29 271 modified
    @@ -2,282 +2,40 @@
     
     #include "supra/fp.h"
     
    +
    +
     #include <cstdint>
     
     namespace risc0::circuit::rv32im_v2::cuda {
     
    -extern __device__ FpExt rv32im_v2_18(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt* arg6,
    -                                     const Fp* arg7,
    -                                     const Fp* arg8,
    -                                     const Fp* arg9,
    -                                     const Fp* arg10);
    -extern __device__ FpExt rv32im_v2_17(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt* arg4,
    -                                     const Fp* arg5,
    -                                     const Fp* arg6,
    -                                     const Fp* arg7,
    -                                     const Fp* arg8);
    -extern __device__ FpExt rv32im_v2_16(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt* arg6,
    -                                     FpExt arg7,
    -                                     const Fp* arg8,
    -                                     const Fp* arg9,
    -                                     const Fp* arg10,
    -                                     const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_15(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt arg6,
    -                                     FpExt arg7,
    -                                     FpExt arg8,
    -                                     FpExt arg9,
    -                                     FpExt arg10,
    -                                     FpExt* arg11,
    -                                     FpExt arg12,
    -                                     const Fp* arg13,
    -                                     const Fp* arg14,
    -                                     const Fp* arg15,
    -                                     const Fp* arg16);
    -extern __device__ FpExt rv32im_v2_14(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt* arg4,
    -                                     FpExt arg5,
    -                                     const Fp* arg6,
    -                                     const Fp* arg7,
    -                                     const Fp* arg8,
    -                                     const Fp* arg9);
    -extern __device__ FpExt rv32im_v2_13(uint32_t idx,
    -                                     uint32_t size,
    -                                     FpExt arg0,
    -                                     Fp* arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt arg6,
    -                                     FpExt* arg7,
    -                                     FpExt arg8,
    -                                     const Fp* arg9,
    -                                     const Fp* arg10,
    -                                     const Fp* arg11,
    -                                     const Fp* arg12);
    -extern __device__ FpExt rv32im_v2_12(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt* arg4,
    -                                     FpExt arg5,
    -                                     const Fp* arg6,
    -                                     const Fp* arg7,
    -                                     const Fp* arg8,
    -                                     const Fp* arg9);
    -extern __device__ FpExt rv32im_v2_11(uint32_t idx,
    -                                     uint32_t size,
    -                                     FpExt* arg0,
    -                                     Fp* arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt arg6,
    -                                     FpExt arg7,
    -                                     FpExt arg8,
    -                                     FpExt arg9,
    -                                     const Fp* arg10,
    -                                     const Fp* arg11,
    -                                     const Fp* arg12);
    -extern __device__ FpExt rv32im_v2_10(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt* arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt arg6,
    -                                     FpExt arg7,
    -                                     FpExt arg8,
    -                                     FpExt arg9,
    -                                     FpExt arg10,
    -                                     FpExt arg11,
    -                                     FpExt arg12,
    -                                     FpExt arg13,
    -                                     FpExt arg14,
    -                                     FpExt arg15,
    -                                     FpExt arg16,
    -                                     FpExt arg17,
    -                                     FpExt arg18,
    -                                     FpExt arg19,
    -                                     FpExt arg20,
    -                                     FpExt arg21,
    -                                     FpExt arg22,
    -                                     FpExt arg23,
    -                                     FpExt arg24,
    -                                     FpExt arg25,
    -                                     FpExt arg26,
    -                                     FpExt arg27,
    -                                     const Fp* arg28,
    -                                     const Fp* arg29,
    -                                     const Fp* arg30);
    -extern __device__ FpExt rv32im_v2_9(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt* arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    const Fp* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_8(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt* arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    const Fp* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_7(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt* arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    const Fp* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_6(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    FpExt* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11,
    -                                    const Fp* arg12);
    -extern __device__ FpExt rv32im_v2_5(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    FpExt* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11,
    -                                    const Fp* arg12);
    -extern __device__ FpExt rv32im_v2_4(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt* arg8,
    -                                    const Fp* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_3(uint32_t idx,
    -                                    uint32_t size,
    -                                    FpExt arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    Fp* arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt* arg6,
    -                                    const Fp* arg7,
    -                                    const Fp* arg8,
    -                                    const Fp* arg9);
    -extern __device__ FpExt rv32im_v2_2(uint32_t idx,
    -                                    uint32_t size,
    -                                    FpExt* arg0,
    -                                    Fp* arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    const Fp* arg5,
    -                                    const Fp* arg6,
    -                                    const Fp* arg7);
    -extern __device__ FpExt rv32im_v2_1(uint32_t idx,
    -                                    uint32_t size,
    -                                    FpExt* arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    const Fp* arg4,
    -                                    const Fp* arg5);
    -extern __device__ FpExt
    -rv32im_v2_0(uint32_t idx, uint32_t size, FpExt* arg0, FpExt arg1, FpExt arg2, const Fp* arg3);
    -extern __device__ FpExt poly_fp(uint32_t idx,
    -                                uint32_t size,
    -                                const Fp* ctrl,
    -                                const Fp* out,
    -                                const Fp* data,
    -                                const Fp* mix,
    -                                const Fp* accum);
    +
    +extern __device__ FpExt rv32im_v2_19(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt* arg6, const Fp* arg7, const Fp* arg8, const Fp* arg9, const Fp* arg10);
    +extern __device__ FpExt rv32im_v2_18(uint32_t idx, uint32_t size, FpExt arg0, FpExt arg1, Fp* arg2, FpExt arg3, FpExt arg4, FpExt* arg5, const Fp* arg6, const Fp* arg7, const Fp* arg8, const Fp* arg9);
    +extern __device__ FpExt rv32im_v2_17(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt* arg6, FpExt arg7, const Fp* arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_16(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt arg9, FpExt arg10, FpExt* arg11, FpExt arg12, const Fp* arg13, const Fp* arg14, const Fp* arg15, const Fp* arg16);
    +extern __device__ FpExt rv32im_v2_15(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt* arg9, FpExt arg10, const Fp* arg11, const Fp* arg12, const Fp* arg13, const Fp* arg14);
    +extern __device__ FpExt rv32im_v2_14(uint32_t idx, uint32_t size, FpExt arg0, FpExt arg1, Fp* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt* arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_13(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt* arg6, FpExt arg7, const Fp* arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_12(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_11(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_10(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt arg9, FpExt arg10, FpExt arg11, FpExt arg12, FpExt arg13, FpExt arg14, FpExt arg15, FpExt* arg16, FpExt arg17, FpExt arg18, FpExt arg19, FpExt arg20, FpExt arg21, FpExt arg22, const Fp* arg23, const Fp* arg24, const Fp* arg25);
    +extern __device__ FpExt rv32im_v2_9(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_8(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_7(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_6(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt* arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_5(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt* arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_4(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt* arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_3(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt* arg6, const Fp* arg7, const Fp* arg8, const Fp* arg9);
    +extern __device__ FpExt rv32im_v2_2(uint32_t idx, uint32_t size, FpExt* arg0, FpExt arg1, FpExt arg2, const Fp* arg3, const Fp* arg4, const Fp* arg5);
    +extern __device__ FpExt rv32im_v2_1(uint32_t idx, uint32_t size, FpExt* arg0, FpExt arg1, FpExt arg2, FpExt arg3, const Fp* arg4, const Fp* arg5);
    +extern __device__ FpExt rv32im_v2_0(uint32_t idx, uint32_t size, FpExt* arg0, FpExt arg1, FpExt arg2, FpExt arg3, const Fp* arg4);
    +extern __device__ FpExt poly_fp(uint32_t idx, uint32_t size, const Fp* ctrl, const Fp* out, const Fp* data, const Fp* mix, const Fp* accum);
     
     constexpr size_t INV_RATE = 4;
    -constexpr size_t kNumPolyMixPows = 472;
    +constexpr size_t kNumPolyMixPows = 458;
     extern __constant__ FpExt poly_mix[kNumPolyMixPows];
     
    -} // namespace risc0::circuit::rv32im_v2::cuda
    +
    +
    +
    +}  // namespace risc0::circuit::rv32im_v2::cuda
    
  • risc0/circuit/rv32im-sys/kernels/cuda/layout.cuh.inc+1118 1083 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/layout.cu.inc+8276 6978 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/steps.cu+30231 59989 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/steps.cuh+210 810 modified
    @@ -17,815 +17,215 @@
     #include "witgen.h"
     
     namespace risc0::circuit::rv32im_v2::cuda {
    -extern __device__ NondetRegStruct back_NondetReg(ExecContext& ctx,
    -                                                 Index distance0,
    -                                                 BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_NondetReg(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetExtRegStruct back_NondetExtReg(ExecContext& ctx,
    -                                                       Index distance0,
    -                                                       BoundLayout<NondetExtRegLayout> layout1);
    -extern __device__ NondetExtRegStruct exec_NondetExtReg(ExecContext& ctx,
    -                                                       ExtVal arg0,
    -                                                       BoundLayout<NondetExtRegLayout> layout1);
    -extern __device__ NondetRegStruct back_Reg(ExecContext& ctx,
    -                                           Index distance0,
    -                                           BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_Reg(ExecContext& ctx,
    -                                           Val arg0,
    -                                           BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetExtRegStruct back_ExtReg(ExecContext& ctx,
    -                                                 Index distance0,
    -                                                 BoundLayout<NondetExtRegLayout> layout1);
    -extern __device__ NondetExtRegStruct exec_ExtReg(ExecContext& ctx,
    -                                                 ExtVal arg0,
    -                                                 BoundLayout<NondetExtRegLayout> layout1);
    -extern __device__ NondetRegStruct back_NondetBitReg(ExecContext& ctx,
    -                                                    Index distance0,
    -                                                    BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_NondetBitReg(ExecContext& ctx,
    -                                                    Val arg0,
    -                                                    BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct back_BitReg(ExecContext& ctx,
    -                                              Index distance0,
    -                                              BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_BitReg(ExecContext& ctx,
    -                                              Val arg0,
    -                                              BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_NondetTwitReg(ExecContext& ctx,
    -                                                     Val arg0,
    -                                                     BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetFakeTwitRegStruct
    -exec_NondetFakeTwitReg(ExecContext& ctx, Val arg0, BoundLayout<NondetFakeTwitRegLayout> layout1);
    -extern __device__ FakeTwitRegStruct exec_FakeTwitReg(ExecContext& ctx,
    -                                                     Val arg0,
    -                                                     BoundLayout<NondetFakeTwitRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_IsZero(ExecContext& ctx,
    -                                              Val arg0,
    -                                              BoundLayout<IsZeroLayout> layout1);
    -extern __device__ ArgU8Struct exec_ArgU8(ExecContext& ctx,
    -                                         Val arg0,
    -                                         Val arg1_0,
    -                                         BoundLayout<ArgU8Layout> layout2);
    -extern __device__ NondetRegStruct exec_NondetU8Reg(ExecContext& ctx,
    -                                                   Val arg0,
    -                                                   BoundLayout<NondetU8RegLayout> layout1);
    -extern __device__ U8RegStruct exec_U8Reg(ExecContext& ctx,
    -                                         Val arg0,
    -                                         BoundLayout<NondetU8RegLayout> layout1);
    -extern __device__ ArgU16Struct exec_ArgU16(ExecContext& ctx,
    -                                           Val arg0,
    -                                           Val arg1_0,
    -                                           BoundLayout<ArgU16Layout> layout2);
    -extern __device__ NondetU16RegStruct exec_NondetU16Reg(ExecContext& ctx,
    -                                                       Val arg0,
    -                                                       BoundLayout<NondetU16RegLayout> layout1);
    -extern __device__ NondetU16RegStruct exec_U16Reg(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<NondetU16RegLayout> layout1);
    -extern __device__ ToBits_5_Struct exec_ToBits_5_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<ToBits_5_Layout> layout1);
    -extern __device__ ValU32Struct exec_DynPo2(ExecContext& ctx,
    -                                           Val arg0,
    -                                           BoundLayout<DynPo2Layout> layout1);
    -extern __device__ NormalizeU32Struct exec_NormalizeU32(ExecContext& ctx,
    -                                                       DenormedValU32Struct arg0,
    -                                                       BoundLayout<NormalizeU32Layout> layout1);
    -extern __device__ AddrDecomposeStruct exec_AddrDecompose(ExecContext& ctx,
    -                                                         ValU32Struct arg0,
    -                                                         Val arg1_0,
    -                                                         BoundLayout<AddrDecomposeLayout> layout2);
    -extern __device__ AddrDecomposeBitsStruct exec_AddrDecomposeBits(
    -    ExecContext& ctx, ValU32Struct arg0, Val arg1_0, BoundLayout<AddrDecomposeBitsLayout> layout2);
    -extern __device__ CmpEqualStruct exec_CmpEqual(ExecContext& ctx,
    -                                               ValU32Struct arg0,
    -                                               ValU32Struct arg1_0,
    -                                               BoundLayout<CmpEqualLayout> layout2);
    -extern __device__ CmpLessThanUnsignedStruct
    -exec_CmpLessThanUnsigned(ExecContext& ctx,
    -                         ValU32Struct arg0,
    -                         ValU32Struct arg1_0,
    -                         BoundLayout<CmpLessThanUnsignedLayout> layout2);
    -extern __device__ NondetRegStruct exec_GetSignU32(ExecContext& ctx,
    -                                                  ValU32Struct arg0,
    -                                                  BoundLayout<GetSignU32Layout> layout1);
    -extern __device__ CmpLessThanStruct exec_CmpLessThan(ExecContext& ctx,
    -                                                     ValU32Struct arg0,
    -                                                     ValU32Struct arg1_0,
    -                                                     BoundLayout<CmpLessThanLayout> layout2);
    -extern __device__ ToBits_16_Struct exec_ToBits_16_(ExecContext& ctx,
    -                                                   Val arg0,
    -                                                   BoundLayout<ToBits_16_Layout> layout1);
    -extern __device__ FromBits_16_Struct exec_BitwiseAndU16(ExecContext& ctx,
    -                                                        Val arg0,
    -                                                        Val arg1_0,
    -                                                        BoundLayout<BitwiseAndU16Layout> layout2);
    -extern __device__ ValU32Struct exec_BitwiseAnd(ExecContext& ctx,
    -                                               ValU32Struct arg0,
    -                                               ValU32Struct arg1_0,
    -                                               BoundLayout<BitwiseAndLayout> layout2);
    -extern __device__ ValU32Struct exec_BitwiseOr(ExecContext& ctx,
    -                                              ValU32Struct arg0,
    -                                              ValU32Struct arg1_0,
    -                                              BoundLayout<BitwiseOrLayout> layout2);
    -extern __device__ ValU32Struct exec_BitwiseXor(ExecContext& ctx,
    -                                               ValU32Struct arg0,
    -                                               ValU32Struct arg1_0,
    -                                               BoundLayout<BitwiseXorLayout> layout2);
    -extern __device__ DecoderStruct exec_Decoder(ExecContext& ctx,
    -                                             ValU32Struct arg0,
    -                                             BoundLayout<DecoderLayout> layout1);
    -extern __device__ MemoryArgStruct exec_MemoryArg(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 Val arg1_0,
    -                                                 Val arg2_0,
    -                                                 ValU32Struct arg3,
    -                                                 BoundLayout<MemoryArgLayout> layout4);
    -extern __device__ CycleArgStruct exec_CycleArg(ExecContext& ctx,
    -                                               Val arg0,
    -                                               Val arg1_0,
    -                                               BoundLayout<CycleArgLayout> layout2);
    -extern __device__ IsCycleStruct exec_IsCycle(ExecContext& ctx,
    -                                             Val arg0,
    -                                             BoundLayout<IsCycleLayout> layout1);
    -extern __device__ MemoryIOStruct exec_MemoryIO(ExecContext& ctx,
    -                                               Val arg0,
    -                                               Val arg1_0,
    -                                               BoundLayout<MemoryIOLayout> layout2);
    -extern __device__ IsForwardStruct exec_IsForward(ExecContext& ctx,
    -                                                 MemoryIOStruct arg0,
    -                                                 BoundLayout<IsForwardLayout> layout1);
    -extern __device__ GetDataStruct exec_MemoryRead(ExecContext& ctx,
    -                                                NondetRegStruct arg0,
    -                                                Val arg1_0,
    -                                                BoundLayout<MemoryReadLayout> layout2);
    -extern __device__ MemoryWriteStruct exec_MemoryWrite(ExecContext& ctx,
    -                                                     NondetRegStruct arg0,
    -                                                     Val arg1_0,
    -                                                     ValU32Struct arg2_0,
    -                                                     BoundLayout<MemoryWriteLayout> layout3);
    -extern __device__ MemoryWriteUnconstrainedStruct
    -exec_MemoryWriteUnconstrained(ExecContext& ctx,
    -                              NondetRegStruct arg0,
    -                              Val arg1_0,
    -                              BoundLayout<MemoryWriteUnconstrainedLayout> layout2);
    -extern __device__ GetDataStruct exec_MemoryPageIn(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  Val arg1_0,
    -                                                  BoundLayout<MemoryPageInLayout> layout2);
    -extern __device__ GetDataStruct exec_MemoryPageOut(ExecContext& ctx,
    -                                                   NondetRegStruct arg0,
    -                                                   Val arg1_0,
    -                                                   BoundLayout<MemoryPageOutLayout> layout2);
    -extern __device__ OneHot_3_Struct exec_OneHot_3_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_3_Layout> layout1);
    -extern __device__ GetDataStruct exec_MemoryGet(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               Val arg1_0,
    -                                               OneHot_3_Struct arg2_0,
    -                                               BoundLayout<MemoryGetLayout> layout3);
    -extern __device__ OneHot_8_Struct exec_OneHot_8_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_8_Layout> layout1);
    -extern __device__ InstInputStruct exec_InstInput(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 Val arg1_0,
    -                                                 ValU32Struct arg2_0,
    -                                                 Val arg3,
    -                                                 Val arg4,
    -                                                 BoundLayout<InstInputLayout> layout5);
    -extern __device__ DoCycleTableStruct exec_DoCycleTable(ExecContext& ctx,
    -                                                       NondetRegStruct arg0,
    -                                                       BoundLayout<DoCycleTableLayout> layout1);
    -extern __device__ DecoderStruct exec_DecodeInst(ExecContext& ctx,
    -                                                NondetRegStruct arg0,
    -                                                InstInputStruct arg1_0,
    -                                                BoundLayout<DecodeInstLayout> layout2);
    -extern __device__ GetDataStruct exec_ReadReg(ExecContext& ctx,
    -                                             NondetRegStruct arg0,
    -                                             InstInputStruct arg1_0,
    -                                             Val arg2_0,
    -                                             BoundLayout<ReadRegLayout> layout3);
    -extern __device__ WriteRdStruct exec_WriteRd(ExecContext& ctx,
    -                                             NondetRegStruct arg0,
    -                                             InstInputStruct arg1_0,
    -                                             DecoderStruct arg2_0,
    -                                             Val arg3,
    -                                             ValU32Struct arg4,
    -                                             BoundLayout<WriteRdLayout> layout5);
    -extern __device__ ExpandU32Struct exec_ExpandU32(ExecContext& ctx,
    -                                                 ValU32Struct arg0,
    -                                                 Val arg1_0,
    -                                                 BoundLayout<ExpandU32Layout> layout2);
    -extern __device__ SplitTotalStruct exec_SplitTotal(ExecContext& ctx,
    -                                                   Val arg0,
    -                                                   BoundLayout<SplitTotalLayout> layout1);
    -extern __device__ MultiplyAccumulateStruct
    -exec_MultiplyAccumulate(ExecContext& ctx,
    -                        ValU32Struct arg0,
    -                        ValU32Struct arg1_0,
    -                        ValU32Struct arg2_0,
    -                        MultiplySettingsStruct arg3,
    -                        BoundLayout<MultiplyAccumulateLayout> layout4);
    -extern __device__ DivInputStruct exec_DivInput(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               InstInputStruct arg1_0,
    -                                               BoundLayout<DivInputLayout> layout2);
    -extern __device__ DivideReturnStruct exec_DoDiv(ExecContext& ctx,
    -                                                ValU32Struct arg0,
    -                                                ValU32Struct arg1_0,
    -                                                Val arg2_0,
    -                                                Val arg3,
    -                                                BoundLayout<DoDivLayout> layout4);
    -extern __device__ ValU32Struct exec_OpSRL(ExecContext& ctx,
    -                                          DivInputStruct arg0,
    -                                          BoundLayout<OpSRLLayout> layout1);
    -extern __device__ NondetRegStruct exec_TopBit(ExecContext& ctx,
    -                                              ValU32Struct arg0,
    -                                              BoundLayout<TopBitLayout> layout1);
    -extern __device__ ValU32Struct exec_OpSRA(ExecContext& ctx,
    -                                          DivInputStruct arg0,
    -                                          BoundLayout<OpSRALayout> layout1);
    -extern __device__ ValU32Struct exec_OpSRLI(ExecContext& ctx,
    -                                           DivInputStruct arg0,
    -                                           BoundLayout<OpSRLILayout> layout1);
    -extern __device__ ValU32Struct exec_OpSRAI(ExecContext& ctx,
    -                                           DivInputStruct arg0,
    -                                           BoundLayout<OpSRAILayout> layout1);
    -extern __device__ ValU32Struct exec_OpDIV(ExecContext& ctx,
    -                                          DivInputStruct arg0,
    -                                          BoundLayout<OpDIVLayout> layout1);
    -extern __device__ ValU32Struct exec_OpDIVU(ExecContext& ctx,
    -                                           DivInputStruct arg0,
    -                                           BoundLayout<OpDIVULayout> layout1);
    -extern __device__ ValU32Struct exec_OpREM(ExecContext& ctx,
    -                                          DivInputStruct arg0,
    -                                          BoundLayout<OpREMLayout> layout1);
    -extern __device__ ValU32Struct exec_OpREMU(ExecContext& ctx,
    -                                           DivInputStruct arg0,
    -                                           BoundLayout<OpREMULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Div0(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Div0Layout> layout2);
    -extern __device__ MiscInputStruct exec_MiscInput(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<MiscInputLayout> layout2);
    -extern __device__ InstOutputBaseStruct exec_FinalizeMisc(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         MiscInputStruct arg1_0,
    -                                                         MiscOutputStruct arg2_0,
    -                                                         BoundLayout<FinalizeMiscLayout> layout3);
    -extern __device__ MiscOutputStruct exec_OpXOR(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpXORLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpOR(ExecContext& ctx,
    -                                             MiscInputStruct arg0,
    -                                             BoundLayout<OpORLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpAND(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpANDLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpSLT(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpSLTLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpSLTU(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpSLTULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Misc0(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  InstInputStruct arg1_0,
    -                                                  BoundLayout<Misc0Layout> layout2);
    -extern __device__ MiscOutputStruct exec_OpXORI(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpXORILayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpORI(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpORILayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpANDI(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpANDILayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpSLTI(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpSLTILayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpSLTIU(ExecContext& ctx,
    -                                                MiscInputStruct arg0,
    -                                                BoundLayout<OpSLTIULayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBEQ(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpBEQLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBNE(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpBNELayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBLT(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpBLTLayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Misc1(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  InstInputStruct arg1_0,
    -                                                  BoundLayout<Misc1Layout> layout2);
    -extern __device__ MiscOutputStruct exec_OpBGE(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpBGELayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBLTU(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpBLTULayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBGEU(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpBGEULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Misc2(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  InstInputStruct arg1_0,
    -                                                  BoundLayout<Misc2Layout> layout2);
    -extern __device__ MulInputStruct exec_MulInput(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               InstInputStruct arg1_0,
    -                                               BoundLayout<MulInputLayout> layout2);
    -extern __device__ DoMulStruct exec_DoMul(ExecContext& ctx,
    -                                         ValU32Struct arg0,
    -                                         ValU32Struct arg1_0,
    -                                         Val arg2_0,
    -                                         Val arg3,
    -                                         BoundLayout<DoMulLayout> layout4);
    -extern __device__ ValU32Struct exec_OpSLL(ExecContext& ctx,
    -                                          MulInputStruct arg0,
    -                                          BoundLayout<OpSLLLayout> layout1);
    -extern __device__ ValU32Struct exec_OpSLLI(ExecContext& ctx,
    -                                           MulInputStruct arg0,
    -                                           BoundLayout<OpSLLILayout> layout1);
    -extern __device__ ValU32Struct exec_OpMUL(ExecContext& ctx,
    -                                          MulInputStruct arg0,
    -                                          BoundLayout<OpMULLayout> layout1);
    -extern __device__ ValU32Struct exec_OpMULH(ExecContext& ctx,
    -                                           MulInputStruct arg0,
    -                                           BoundLayout<OpMULHLayout> layout1);
    -extern __device__ ValU32Struct exec_OpMULHSU(ExecContext& ctx,
    -                                             MulInputStruct arg0,
    -                                             BoundLayout<OpMULHSULayout> layout1);
    -extern __device__ ValU32Struct exec_OpMULHU(ExecContext& ctx,
    -                                            MulInputStruct arg0,
    -                                            BoundLayout<OpMULHULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Mul0(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Mul0Layout> layout2);
    -extern __device__ MemLoadInputStruct exec_MemLoadInput(ExecContext& ctx,
    -                                                       NondetRegStruct arg0,
    -                                                       InstInputStruct arg1_0,
    -                                                       BoundLayout<MemLoadInputLayout> layout2);
    -extern __device__ MemStoreInputStruct exec_MemStoreInput(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         InstInputStruct arg1_0,
    -                                                         BoundLayout<MemStoreInputLayout> layout2);
    -extern __device__ MemStoreFinalizeStruct
    -exec_MemStoreFinalize(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      MemStoreInputStruct arg1_0,
    -                      ValU32Struct arg2_0,
    -                      BoundLayout<MemStoreFinalizeLayout> layout3);
    -extern __device__ SplitWordStruct exec_SplitWord(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<SplitWordLayout> layout1);
    -extern __device__ ValU32Struct exec_OpLB(ExecContext& ctx,
    -                                         MemLoadInputStruct arg0,
    -                                         BoundLayout<OpLBLayout> layout1);
    -extern __device__ ValU32Struct exec_OpLH(ExecContext& ctx,
    -                                         MemLoadInputStruct arg0,
    -                                         BoundLayout<OpLHLayout> layout1);
    -extern __device__ ValU32Struct exec_OpLBU(ExecContext& ctx,
    -                                          MemLoadInputStruct arg0,
    -                                          BoundLayout<OpLBULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Mem0(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Mem0Layout> layout2);
    -extern __device__ ValU32Struct exec_OpSB(ExecContext& ctx,
    -                                         MemStoreInputStruct arg0,
    -                                         BoundLayout<OpSBLayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Mem1(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Mem1Layout> layout2);
    -extern __device__ DigestRegStruct back_DigestReg(ExecContext& ctx,
    -                                                 Index distance0,
    -                                                 BoundLayout<DigestRegLayout> layout1);
    -extern __device__ DigestRegStruct exec_DigestReg(ExecContext& ctx,
    -                                                 ValU32Struct8Array arg0,
    -                                                 BoundLayout<DigestRegLayout> layout1);
    -extern __device__ InstOutputBaseStruct
    -exec_ControlLoadRoot(ExecContext& ctx,
    -                     NondetRegStruct arg0,
    -                     InstInputStruct arg1_0,
    -                     BoundLayout<ControlLoadRootLayout> layout2,
    -                     GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct exec_ControlResume(ExecContext& ctx,
    -                                                          NondetRegStruct arg0,
    -                                                          InstInputStruct arg1_0,
    -                                                          BoundLayout<ControlResumeLayout> layout2,
    -                                                          GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct
    -exec_ControlUserECALL(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      InstInputStruct arg1_0,
    -                      BoundLayout<ControlUserECALLLayout> layout2);
    -extern __device__ InstOutputBaseStruct exec_ControlMRET(ExecContext& ctx,
    -                                                        NondetRegStruct arg0,
    -                                                        InstInputStruct arg1_0,
    -                                                        BoundLayout<ControlMRETLayout> layout2);
    -extern __device__ InstOutputBaseStruct
    -exec_ControlSuspend(ExecContext& ctx,
    -                    NondetRegStruct arg0,
    -                    InstInputStruct arg1_0,
    -                    BoundLayout<ControlSuspendLayout> layout2,
    -                    GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct
    -exec_ControlStoreRoot(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      InstInputStruct arg1_0,
    -                      BoundLayout<ControlStoreRootLayout> layout2,
    -                      GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct exec_ControlTable(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         InstInputStruct arg1_0,
    -                                                         BoundLayout<ControlTableLayout> layout2);
    -extern __device__ InstOutputBaseStruct exec_ControlDone(ExecContext& ctx,
    -                                                        NondetRegStruct arg0,
    -                                                        InstInputStruct arg1_0,
    -                                                        BoundLayout<ControlDoneLayout> layout2,
    -                                                        GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct exec_Control0(ExecContext& ctx,
    -                                                     NondetRegStruct arg0,
    -                                                     InstInputStruct arg1_0,
    -                                                     BoundLayout<Control0Layout> layout2,
    -                                                     GlobalBuf global3);
    -extern __device__ OneHot_6_Struct exec_OneHot_6_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_6_Layout> layout1);
    -extern __device__ ECallOutputStruct exec_MachineECall(ExecContext& ctx,
    -                                                      NondetRegStruct arg0,
    -                                                      InstInputStruct arg1_0,
    -                                                      Val arg2_0,
    -                                                      BoundLayout<MachineECallLayout> layout3);
    -extern __device__ ECallOutputStruct exec_ECallTerminate(ExecContext& ctx,
    -                                                        NondetRegStruct arg0,
    -                                                        InstInputStruct arg1_0,
    -                                                        BoundLayout<ECallTerminateLayout> layout2,
    -                                                        GlobalBuf global3);
    -extern __device__ OneHot_4_Struct exec_OneHot_4_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_4_Layout> layout1);
    -extern __device__ DecomposeLow2Struct exec_DecomposeLow2(ExecContext& ctx,
    -                                                         Val arg0,
    -                                                         BoundLayout<DecomposeLow2Layout> layout1);
    -extern __device__ ECallOutputStruct
    -exec_ECallHostReadSetup(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        InstInputStruct arg1_0,
    -                        BoundLayout<ECallHostReadSetupLayout> layout2);
    -extern __device__ ECallOutputStruct exec_ECallHostWrite(ExecContext& ctx,
    -                                                        NondetRegStruct arg0,
    -                                                        InstInputStruct arg1_0,
    -                                                        BoundLayout<ECallHostWriteLayout> layout2);
    -extern __device__ ECallOutputStruct
    -exec_ECallHostReadBytes(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        InstInputStruct arg1_0,
    -                        Val arg2_0,
    -                        Val arg3,
    -                        Val arg4,
    -                        BoundLayout<ECallHostReadBytesLayout> layout5);
    -extern __device__ ECallOutputStruct
    -exec_ECallHostReadWords(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        InstInputStruct arg1_0,
    -                        Val arg2_0,
    -                        Val arg3,
    -                        BoundLayout<ECallHostReadWordsLayout> layout4);
    -extern __device__ InstOutputBaseStruct exec_ECall0(ExecContext& ctx,
    -                                                   NondetRegStruct arg0,
    -                                                   InstInputStruct arg1_0,
    -                                                   BoundLayout<ECall0Layout> layout2,
    -                                                   GlobalBuf global3);
    -extern __device__ NondetRegStruct exec_SBox(ExecContext& ctx,
    -                                            Val arg0,
    -                                            BoundLayout<SBoxLayout> layout1);
    -extern __device__ MultiplyByMIntStruct exec_DoIntRound(ExecContext& ctx,
    -                                                       Val24Array arg0,
    -                                                       Val arg1_0,
    -                                                       BoundLayout<DoIntRoundLayout> layout2);
    -extern __device__ DoIntRoundsStruct exec_DoIntRounds(ExecContext& ctx,
    -                                                     Val24Array arg0,
    -                                                     BoundLayout<DoIntRoundsLayout> layout1);
    -extern __device__ MultiplyByMExtStruct exec_DoExtRound(ExecContext& ctx,
    -                                                       Val24Array arg0,
    -                                                       Val24Array arg1_0,
    -                                                       BoundLayout<DoExtRoundLayout> layout2);
    -extern __device__ MultiplyByMExtStruct exec_DoExtRoundByIdx(
    -    ExecContext& ctx, Val24Array arg0, Val arg1_0, BoundLayout<DoExtRoundByIdxLayout> layout2);
    -extern __device__ PoseidonStateStruct back_PoseidonState(ExecContext& ctx,
    -                                                         Index distance0,
    -                                                         BoundLayout<PoseidonStateLayout> layout1);
    -extern __device__ PoseidonStateStruct exec_PoseidonState(ExecContext& ctx,
    -                                                         PoseidonOpDefStruct arg0,
    -                                                         Val arg1_0,
    -                                                         Val arg2_0,
    -                                                         Val arg3,
    -                                                         Val arg4,
    -                                                         Val arg5,
    -                                                         Val24Array arg6,
    -                                                         ExtVal arg7,
    -                                                         BoundLayout<PoseidonStateLayout> layout8);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonInvalid(ExecContext& ctx, BoundLayout<PoseidonStateLayout> layout0);
    -extern __device__ ReadAddrStruct exec_ReadAddr(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               Val arg1_0,
    -                                               BoundLayout<ReadAddrLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonEcall(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         Val arg1_0,
    -                                                         BoundLayout<PoseidonEcallLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingEntry(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonEntry(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         ValU32Struct arg1_0,
    -                                                         Val arg2_0,
    -                                                         BoundLayout<PoseidonEntryLayout> layout3);
    -extern __device__ ReadElemStruct exec_ReadElem(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               Val arg1_0,
    -                                               BoundLayout<ReadElemLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonLoadState(ExecContext& ctx,
    -                       NondetRegStruct arg0,
    -                       PoseidonStateStruct arg1_0,
    -                       BoundLayout<PoseidonLoadStateLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonLoadInShort(ExecContext& ctx,
    -                         NondetRegStruct arg0,
    -                         PoseidonStateStruct arg1_0,
    -                         BoundLayout<PoseidonLoadInShortLayout> layout2,
    -                         GlobalBuf global3);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonLoadInLow(ExecContext& ctx,
    -                       NondetRegStruct arg0,
    -                       PoseidonStateStruct arg1_0,
    -                       BoundLayout<PoseidonLoadInLowLayout> layout2,
    -                       GlobalBuf global3);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonLoadInHigh(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        PoseidonStateStruct arg1_0,
    -                        BoundLayout<PoseidonLoadInHighLayout> layout2,
    -                        GlobalBuf global3);
    -extern __device__ PoseidonStateStruct exec_PoseidonLoadIn(ExecContext& ctx,
    -                                                          NondetRegStruct arg0,
    -                                                          PoseidonStateStruct arg1_0,
    -                                                          BoundLayout<PoseidonLoadInLayout> layout2,
    -                                                          GlobalBuf global3);
    -extern __device__ PoseidonStateStruct exec_PoseidonExtRound(
    -    ExecContext& ctx, PoseidonStateStruct arg0, BoundLayout<PoseidonExtRoundLayout> layout1);
    -extern __device__ PoseidonStateStruct exec_PoseidonIntRounds(
    -    ExecContext& ctx, PoseidonStateStruct arg0, BoundLayout<PoseidonIntRoundsLayout> layout1);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonCheckOut(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      PoseidonStateStruct arg1_0,
    -                      BoundLayout<PoseidonCheckOutLayout> layout2);
    -extern __device__ FieldToWordStruct exec_FieldToWord(ExecContext& ctx,
    -                                                     Val arg0,
    -                                                     BoundLayout<FieldToWordLayout> layout1);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonStoreOut(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      PoseidonStateStruct arg1_0,
    -                      BoundLayout<PoseidonStoreOutLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonDoOut(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         PoseidonStateStruct arg1_0,
    -                                                         BoundLayout<PoseidonDoOutLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonStoreState(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        PoseidonStateStruct arg1_0,
    -                        BoundLayout<PoseidonStoreStateLayout> layout2);
    -extern __device__ IsU24Struct exec_IsU24(ExecContext& ctx,
    -                                         Val arg0,
    -                                         BoundLayout<IsU24Layout> layout1);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingLoadNode(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingLoadPage(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonPagingLoadDone(ExecContext& ctx, BoundLayout<PoseidonStateLayout> layout0);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingStoreNode(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingStorePage(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonPagingStoreDone(ExecContext& ctx, BoundLayout<PoseidonStateLayout> layout0);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonPaging(ExecContext& ctx,
    -                    NondetRegStruct arg0,
    -                    Val arg1_0,
    -                    PoseidonStateStruct arg2_0,
    -                    BoundLayout<PoseidonPagingLayout> layout3);
    -extern __device__ InstOutputBaseStruct exec_Poseidon0(ExecContext& ctx,
    -                                                      NondetRegStruct arg0,
    -                                                      InstInputStruct arg1_0,
    -                                                      BoundLayout<Poseidon0Layout> layout2,
    -                                                      GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct exec_Poseidon1(ExecContext& ctx,
    -                                                      NondetRegStruct arg0,
    -                                                      InstInputStruct arg1_0,
    -                                                      BoundLayout<Poseidon1Layout> layout2);
    -extern __device__ CarryExtractStruct exec_CarryExtract(ExecContext& ctx,
    -                                                       Val arg0,
    -                                                       BoundLayout<CarryExtractLayout> layout1);
    -extern __device__ UnpackReg_32__16_Struct exec_UnpackReg_32__16_(
    -    ExecContext& ctx, Val2Array arg0, BoundLayout<UnpackReg_32__16_Layout> layout1);
    -extern __device__ UnpackReg_32__16_Struct
    -exec_CarryAndExpand(ExecContext& ctx, Val2Array arg0, BoundLayout<CarryAndExpandLayout> layout1);
    -extern __device__ ShaStateStruct back_ShaState(ExecContext& ctx,
    -                                               Index distance0,
    -                                               BoundLayout<ShaStateLayout> layout1);
    -extern __device__ ShaStateStruct exec_ShaState(ExecContext& ctx,
    -                                               Val32Array arg0,
    -                                               Val32Array arg1_0,
    -                                               Val32Array arg2_0,
    -                                               Val arg3,
    -                                               Val arg4,
    -                                               Val arg5,
    -                                               Val arg6,
    -                                               Val arg7,
    -                                               Val arg8,
    -                                               Val arg9,
    -                                               BoundLayout<ShaStateLayout> layout10);
    -extern __device__ ShaStateStruct exec_ShaInvalid(ExecContext& ctx,
    -                                                 BoundLayout<ShaStateLayout> layout0);
    -extern __device__ ShaStateStruct exec_ShaEcall(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               BoundLayout<ShaEcallLayout> layout1);
    -extern __device__ ShaStateStruct exec_ShaLoadState(ExecContext& ctx,
    -                                                   NondetRegStruct arg0,
    -                                                   ShaStateStruct arg1_0,
    -                                                   BoundLayout<ShaLoadStateLayout> layout2);
    -extern __device__ ShaStateStruct exec_ShaLoadData(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  ShaStateStruct arg1_0,
    -                                                  ShaStateStruct arg2_0,
    -                                                  ShaStateStruct arg3,
    -                                                  ShaStateStruct arg4,
    -                                                  BoundLayout<ShaLoadDataLayout> layout5);
    -extern __device__ ShaStateStruct exec_ShaMix(ExecContext& ctx,
    -                                             NondetRegStruct arg0,
    -                                             ShaStateStruct arg1_0,
    -                                             ShaStateStruct arg2_0,
    -                                             ShaStateStruct arg3,
    -                                             ShaStateStruct arg4,
    -                                             ShaStateStruct arg5,
    -                                             ShaStateStruct arg6,
    -                                             ShaStateStruct arg7,
    -                                             BoundLayout<ShaMixLayout> layout8);
    -extern __device__ ShaStateStruct exec_ShaStoreState(ExecContext& ctx,
    -                                                    NondetRegStruct arg0,
    -                                                    ShaStateStruct arg1_0,
    -                                                    ShaStateStruct arg2_0,
    -                                                    ShaStateStruct arg3,
    -                                                    BoundLayout<ShaStoreStateLayout> layout4);
    -extern __device__ InstOutputBaseStruct exec_Sha0(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Sha0Layout> layout2);
    -extern __device__ BigIntStateStruct back_BigIntState(ExecContext& ctx,
    -                                                     Index distance0,
    -                                                     BoundLayout<BigIntStateLayout> layout1);
    -extern __device__ BigIntStateStruct exec_BigIntState(ExecContext& ctx,
    -                                                     Val arg0,
    -                                                     Val arg1_0,
    -                                                     Val arg2_0,
    -                                                     Val arg3,
    -                                                     Val arg4,
    -                                                     Val16Array arg5,
    -                                                     Val arg6,
    -                                                     BoundLayout<BigIntStateLayout> layout7);
    -extern __device__ BigIntStateStruct exec_BigIntInvalid(ExecContext& ctx,
    -                                                       BoundLayout<BigIntStateLayout> layout0);
    -extern __device__ BigIntStateStruct exec_BigIntEcall(ExecContext& ctx,
    -                                                     NondetRegStruct arg0,
    -                                                     BoundLayout<BigIntEcallLayout> layout1);
    -extern __device__ SplitU32Struct exec_SplitU32(ExecContext& ctx,
    -                                               ValU32Struct arg0,
    -                                               BoundLayout<SplitU32Layout> layout1);
    -extern __device__ AddrDecomposeBitsStruct exec_BigIntAddr(ExecContext& ctx,
    -                                                          ValU32Struct arg0,
    -                                                          Val arg1_0,
    -                                                          BoundLayout<BigIntAddrLayout> layout2);
    -extern __device__ BigIntReadStruct exec_BigIntRead(ExecContext& ctx,
    -                                                   NondetRegStruct arg0,
    -                                                   ValU32Struct arg1_0,
    -                                                   Val arg2_0,
    -                                                   BoundLayout<BigIntReadLayout> layout3);
    -extern __device__ BigIntWitnessStruct exec_BigIntWitness(ExecContext& ctx,
    -                                                         Val16Array arg0,
    -                                                         BoundLayout<BigIntWitnessLayout> layout1);
    -extern __device__ BigIntWitnessStruct exec_BigIntWrite(ExecContext& ctx,
    -                                                       NondetRegStruct arg0,
    -                                                       ValU32Struct arg1_0,
    -                                                       Val arg2_0,
    -                                                       BoundLayout<BigIntWriteLayout> layout3);
    -extern __device__ BigIntWitnessStruct exec_BigIntCheck(ExecContext& ctx,
    -                                                       BoundLayout<BigIntWitnessLayout> layout0);
    -extern __device__ BigIntStateStruct exec_BigIntStep(ExecContext& ctx,
    -                                                    NondetRegStruct arg0,
    -                                                    BigIntStateStruct arg1_0,
    -                                                    BoundLayout<BigIntStepLayout> layout2);
    -extern __device__ InstOutputBaseStruct exec_BigInt0(ExecContext& ctx,
    -                                                    NondetRegStruct arg0,
    -                                                    InstInputStruct arg1_0,
    -                                                    BoundLayout<BigInt0Layout> layout2);
    -extern __device__ BigIntAccumStateStruct back_BigIntAccumState(
    -    ExecContext& ctx, Index distance0, BoundLayout<BigIntAccumStateLayout> layout1);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntAccumState(ExecContext& ctx,
    -                      ExtVal arg0,
    -                      ExtVal arg1_0,
    -                      ExtVal arg2_0,
    -                      BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ OneHot_7_Struct exec_OneHot_7_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_7_Layout> layout1);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpNop(ExecContext& ctx, BoundLayout<BigIntAccumStateLayout> layout0);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpShift(ExecContext& ctx,
    -                       BigIntTopStateStruct arg0,
    -                       BigIntAccumStateStruct arg1_0,
    -                       ExtVal arg2_0,
    -                       BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpSetTerm(ExecContext& ctx,
    -                         BigIntTopStateStruct arg0,
    -                         BigIntAccumStateStruct arg1_0,
    -                         ExtVal arg2_0,
    -                         BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpAddTotal(ExecContext& ctx,
    -                          BigIntTopStateStruct arg0,
    -                          BigIntAccumStateStruct arg1_0,
    -                          ExtVal arg2_0,
    -                          BoundLayout<BigIntPolyOpAddTotalLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpCarry1(ExecContext& ctx,
    -                        BigIntTopStateStruct arg0,
    -                        BigIntAccumStateStruct arg1_0,
    -                        ExtVal arg2_0,
    -                        BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpCarry2(ExecContext& ctx,
    -                        BigIntTopStateStruct arg0,
    -                        BigIntAccumStateStruct arg1_0,
    -                        ExtVal arg2_0,
    -                        BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpEqz(ExecContext& ctx,
    -                     BigIntTopStateStruct arg0,
    -                     BigIntAccumStateStruct arg1_0,
    -                     ExtVal arg2_0,
    -                     BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStruct exec_BigIntAccum(ExecContext& ctx,
    -                                                     BigIntTopStateStruct arg0,
    -                                                     ExtVal1Array arg1_0,
    -                                                     BoundLayout<BigIntAccumLayout> layout2);
    -extern __device__ OneHot_13_Struct exec_OneHot_13_(ExecContext& ctx,
    -                                                   Val arg0,
    -                                                   BoundLayout<OneHot_13_Layout> layout1);
    -extern __device__ TopStruct exec_Top(ExecContext& ctx,
    -                                     BoundLayout<TopLayout> layout0,
    -                                     GlobalBuf global1);
    -extern __device__ void step_Top(ExecContext& ctx, MutableBuf data0, GlobalBuf global1);
    -extern __device__ AccumStruct exec_Accum(ExecContext& ctx,
    -                                         BigIntTopStateStruct arg0,
    -                                         ExtVal1Array arg1_0,
    -                                         BoundLayout<AccumLayout> layout2);
    -extern __device__ BigIntTopStateStruct exec_TopExtract(ExecContext& ctx,
    -                                                       BoundLayout<TopLayout> arg0,
    -                                                       GlobalBuf global1);
    -extern __device__ AccumStruct execUser_Accum(ExecContext& ctx,
    -                                             BoundLayout<TopLayout> arg0,
    -                                             ExtVal1Array arg1_0,
    -                                             BoundLayout<AccumLayout> layout2,
    -                                             GlobalBuf global3);
    -extern __device__ ComponentStruct exec_TopAccum(ExecContext& ctx,
    -                                                BoundLayout<TopLayout> arg0,
    -                                                BoundLayout<LayoutAccumLayout> layout1,
    -                                                GlobalBuf global2,
    -                                                GlobalBuf mix3);
    -extern __device__ void step_TopAccum(
    -    ExecContext& ctx, MutableBuf accum0, MutableBuf data1, GlobalBuf global2, GlobalBuf mix3);
    +extern __device__ NondetRegStruct back_NondetReg(ExecContext& ctx,Index distance0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_NondetReg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetExtRegStruct back_NondetExtReg(ExecContext& ctx,Index distance0, BoundLayout<NondetExtRegLayout> layout1)  ;
    +extern __device__ NondetExtRegStruct exec_NondetExtReg(ExecContext& ctx,ExtVal arg0, BoundLayout<NondetExtRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct back_Reg(ExecContext& ctx,Index distance0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetExtRegStruct back_ExtReg(ExecContext& ctx,Index distance0, BoundLayout<NondetExtRegLayout> layout1)  ;
    +extern __device__ NondetExtRegStruct exec_ExtReg(ExecContext& ctx,ExtVal arg0, BoundLayout<NondetExtRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct back_NondetBitReg(ExecContext& ctx,Index distance0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_NondetBitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct back_BitReg(ExecContext& ctx,Index distance0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_BitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_NondetTwitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetFakeTwitRegStruct exec_NondetFakeTwitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetFakeTwitRegLayout> layout1)  ;
    +extern __device__ FakeTwitRegStruct exec_FakeTwitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetFakeTwitRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_IsZero(ExecContext& ctx,Val arg0, BoundLayout<IsZeroLayout> layout1)  ;
    +extern __device__ ArgU8Struct exec_ArgU8(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<ArgU8Layout> layout2)  ;
    +extern __device__ NondetRegStruct exec_NondetU8Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetU8RegLayout> layout1)  ;
    +extern __device__ U8RegStruct exec_U8Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetU8RegLayout> layout1)  ;
    +extern __device__ ArgU16Struct exec_ArgU16(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<ArgU16Layout> layout2)  ;
    +extern __device__ NondetU16RegStruct exec_NondetU16Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetU16RegLayout> layout1)  ;
    +extern __device__ NondetU16RegStruct exec_U16Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetU16RegLayout> layout1)  ;
    +extern __device__ ToBits_5_Struct exec_ToBits_5_(ExecContext& ctx,Val arg0, BoundLayout<ToBits_5_Layout> layout1)  ;
    +extern __device__ ValU32Struct exec_DynPo2(ExecContext& ctx,Val arg0, BoundLayout<DynPo2Layout> layout1)  ;
    +extern __device__ NormalizeU32Struct exec_NormalizeU32(ExecContext& ctx,DenormedValU32Struct arg0, BoundLayout<NormalizeU32Layout> layout1)  ;
    +extern __device__ AddrDecomposeStruct exec_AddrDecompose(ExecContext& ctx,ValU32Struct arg0, Val arg1_0, BoundLayout<AddrDecomposeLayout> layout2)  ;
    +extern __device__ AddrDecomposeBitsStruct exec_AddrDecomposeBits(ExecContext& ctx,ValU32Struct arg0, Val arg1_0, BoundLayout<AddrDecomposeBitsLayout> layout2)  ;
    +extern __device__ CmpEqualStruct exec_CmpEqual(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<CmpEqualLayout> layout2)  ;
    +extern __device__ CmpLessThanUnsignedStruct exec_CmpLessThanUnsigned(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<CmpLessThanUnsignedLayout> layout2)  ;
    +extern __device__ NondetRegStruct exec_GetSignU32(ExecContext& ctx,ValU32Struct arg0, BoundLayout<GetSignU32Layout> layout1)  ;
    +extern __device__ CmpLessThanStruct exec_CmpLessThan(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<CmpLessThanLayout> layout2)  ;
    +extern __device__ ToBits_16_Struct exec_ToBits_16_(ExecContext& ctx,Val arg0, BoundLayout<ToBits_16_Layout> layout1)  ;
    +extern __device__ FromBits_16_Struct exec_BitwiseAndU16(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<BitwiseAndU16Layout> layout2)  ;
    +extern __device__ ValU32Struct exec_BitwiseAnd(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<BitwiseAndLayout> layout2)  ;
    +extern __device__ ValU32Struct exec_BitwiseOr(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<BitwiseOrLayout> layout2)  ;
    +extern __device__ ValU32Struct exec_BitwiseXor(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<BitwiseXorLayout> layout2)  ;
    +extern __device__ DecoderStruct exec_Decoder(ExecContext& ctx,ValU32Struct arg0, BoundLayout<DecoderLayout> layout1)  ;
    +extern __device__ MemoryArgStruct exec_MemoryArg(ExecContext& ctx,Val arg0, Val arg1_0, Val arg2_0, ValU32Struct arg3, BoundLayout<MemoryArgLayout> layout4)  ;
    +extern __device__ CycleArgStruct exec_CycleArg(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<CycleArgLayout> layout2)  ;
    +extern __device__ IsCycleStruct exec_IsCycle(ExecContext& ctx,Val arg0, BoundLayout<IsCycleLayout> layout1)  ;
    +extern __device__ MemoryIOStruct exec_MemoryIO(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<MemoryIOLayout> layout2)  ;
    +extern __device__ IsForwardStruct exec_IsForward(ExecContext& ctx,MemoryIOStruct arg0, BoundLayout<IsForwardLayout> layout1)  ;
    +extern __device__ GetDataStruct exec_MemoryRead(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, BoundLayout<MemoryReadLayout> layout2)  ;
    +extern __device__ MemoryWriteStruct exec_MemoryWrite(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, ValU32Struct arg2_0, BoundLayout<MemoryWriteLayout> layout3)  ;
    +extern __device__ MemoryWriteUnconstrainedStruct exec_MemoryWriteUnconstrained(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, BoundLayout<MemoryWriteUnconstrainedLayout> layout2)  ;
    +extern __device__ GetDataStruct exec_MemoryPageIn(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, BoundLayout<MemoryPageInLayout> layout2)  ;
    +extern __device__ GetDataStruct exec_MemoryPageOut(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, BoundLayout<MemoryPageOutLayout> layout2)  ;
    +extern __device__ OneHot_3_Struct exec_OneHot_3_(ExecContext& ctx,Val arg0, BoundLayout<OneHot_3_Layout> layout1)  ;
    +extern __device__ GetDataStruct exec_MemoryGet(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, OneHot_3_Struct arg2_0, BoundLayout<MemoryGetLayout> layout3)  ;
    +extern __device__ OneHot_8_Struct exec_OneHot_8_(ExecContext& ctx,Val arg0, BoundLayout<OneHot_8_Layout> layout1)  ;
    +extern __device__ InstInputStruct exec_InstInput(ExecContext& ctx,Val arg0, Val arg1_0, ValU32Struct arg2_0, Val arg3, Val arg4, BoundLayout<InstInputLayout> layout5)  ;
    +extern __device__ DoCycleTableStruct exec_DoCycleTable(ExecContext& ctx,NondetRegStruct arg0, BoundLayout<DoCycleTableLayout> layout1)  ;
    +extern __device__ DecoderStruct exec_DecodeInst(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, BoundLayout<DecodeInstLayout> layout2)  ;
    +extern __device__ GetDataStruct exec_ReadReg(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, Val arg2_0, BoundLayout<ReadRegLayout> layout3)  ;
    +extern __device__ ReadSourceRegsStruct exec_ReadSourceRegs(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, DecoderStruct arg2_0, BoundLayout<ReadSourceRegsLayout> layout3)  ;
    +extern __device__ WriteRdStruct exec_WriteRd(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, DecoderStruct arg2_0, Val arg3, ValU32Struct arg4, BoundLayout<WriteRdLayout> layout5)  ;
    +extern __device__ ExpandU32Struct exec_ExpandU32(ExecContext& ctx,ValU32Struct arg0, Val arg1_0, BoundLayout<ExpandU32Layout> layout2)  ;
    +extern __device__ SplitTotalStruct exec_SplitTotal(ExecContext& ctx,Val arg0, BoundLayout<SplitTotalLayout> layout1)  ;
    +extern __device__ MultiplyAccumulateStruct exec_MultiplyAccumulate(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, ValU32Struct arg2_0, MultiplySettingsStruct arg3, BoundLayout<MultiplyAccumulateLayout> layout4)  ;
    +extern __device__ DivInputStruct exec_DivInput(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, BoundLayout<DivInputLayout> layout2)  ;
    +extern __device__ DivideReturnStruct exec_DoDiv(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, Val arg2_0, Val arg3, BoundLayout<DoDivLayout> layout4)  ;
    +extern __device__ ValU32Struct exec_OpSRL(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpSRLLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_TopBit(ExecContext& ctx,ValU32Struct arg0, BoundLayout<TopBitLayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpSRA(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpSRALayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpSRLI(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpSRLILayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpSRAI(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpSRAILayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpDIV(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpDIVLayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpDIVU(ExecContext& ctx,DivInputStruct arg0, BoundLa
    ... [truncated]
    
  • risc0/circuit/rv32im-sys/kernels/cuda/types.cuh.inc+51 15 modified
    @@ -135,14 +135,45 @@ struct DecodeInstLayout {
       AddrDecomposeLayout pcAddr;
       MemoryReadLayout loadInst;
     };
    +using MemoryArgLayout4LayoutArray = ::cuda::std::array<MemoryArgLayout,4>;
    +using CycleArgLayout2LayoutArray = ::cuda::std::array<CycleArgLayout,2>;
    +struct _Arguments_ReadSourceRegsSourceRegsLayout {
    +  MemoryArgLayout4LayoutArray memoryArg;
    +  CycleArgLayout2LayoutArray cycleArg;
    +};
     struct ReadRegLayout {
       MemoryReadLayout _super;
       NondetRegLayout addr;
     };
    +struct ReadSourceRegsSourceRegsArm0_SuperLayout {
    +  ReadRegLayout rboth;
    +};
    +struct ReadSourceRegsSourceRegsArm0Layout {
    +  ReadSourceRegsSourceRegsArm0_SuperLayout _super;
    +  MemoryArgLayout _extra0;
    +  MemoryArgLayout _extra1;
    +  CycleArgLayout _extra2;
    +};
    +struct ReadSourceRegsSourceRegsArm1_SuperLayout {
    +  ReadRegLayout _0;
    +  ReadRegLayout _1;
    +};
    +struct ReadSourceRegsSourceRegsLayout {
    +  ReadSourceRegsSourceRegsArm0Layout arm0;
    +  ReadSourceRegsSourceRegsArm1_SuperLayout arm1;
    +};
    +struct ReadSourceRegsLayout {
    +  NondetRegLayout isSameReg;
    +  _Arguments_ReadSourceRegsSourceRegsLayout _arguments_ReadSourceRegsSourceRegs;
    +  ReadSourceRegsSourceRegsLayout sourceRegs;
    +  NondetRegLayout rs1Low;
    +  NondetRegLayout rs1High;
    +  NondetRegLayout rs2Low;
    +  NondetRegLayout rs2High;
    +};
     struct MiscInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout5LayoutArray = ::cuda::std::array<ArgU16Layout,5>;
     struct _Arguments_Misc0MiscOutputLayout {
    @@ -437,8 +468,7 @@ struct Misc2Layout {
     };
     struct MulInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout6LayoutArray = ::cuda::std::array<ArgU16Layout,6>;
     struct ArgU8Layout {
    @@ -593,8 +623,7 @@ struct Mul0Layout {
     };
     struct DivInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout16LayoutArray = ::cuda::std::array<ArgU16Layout,16>;
     struct _Arguments_Div0MulOutputLayout {
    @@ -812,8 +841,7 @@ struct Mem0Layout {
     };
     struct MemStoreInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
       NormalizeU32Layout addrU32;
       AddrDecomposeBitsLayout addr;
       MemoryReadLayout data;
    @@ -3074,6 +3102,14 @@ struct InstInputStruct {
     };
     struct DoCycleTableStruct {
     };
    +struct SourceRegsStruct {
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
    +};
    +struct ReadSourceRegsStruct {
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
    +};
     struct WriteRdStruct {
     };
     struct ExpandU32Struct {
    @@ -3100,8 +3136,8 @@ struct MultiplyAccumulateStruct {
     struct DivInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct ComponentStruct {
     };
    @@ -3123,8 +3159,8 @@ struct InstOutputBaseStruct {
     struct MiscInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct MiscOutputStruct {
       Val doWrite;
    @@ -3134,8 +3170,8 @@ struct MiscOutputStruct {
     struct MulInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct DoMulStruct {
       ValU32Struct low;
    @@ -3149,7 +3185,7 @@ struct MemLoadInputStruct {
     };
     struct MemStoreInputStruct {
       DecoderStruct decoded;
    -  GetDataStruct rs2;
    +  ValU32Struct rs2;
       AddrDecomposeBitsStruct addr;
       GetDataStruct data;
     };
    
  • risc0/circuit/rv32im-sys/kernels/cxx/layout.cpp.inc+8276 6884 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/layout.h.inc+1118 1083 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/rust_poly_fp_0.cpp+13653 11470 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/rust_poly_fp_1.cpp+11050 11123 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/rust_poly_fp_2.cpp+10656 10591 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/rust_poly_fp_3.cpp+11090 12221 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/steps.cpp+8448 8281 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/steps.h+2 1 modified
    @@ -75,6 +75,7 @@ extern InstInputStruct exec_InstInput(ExecContext& ctx,Val arg0, Val arg1_0, Val
     extern DoCycleTableStruct exec_DoCycleTable(ExecContext& ctx,NondetRegStruct arg0, BoundLayout<DoCycleTableLayout> layout1)  ;
     extern DecoderStruct exec_DecodeInst(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, BoundLayout<DecodeInstLayout> layout2)  ;
     extern GetDataStruct exec_ReadReg(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, Val arg2_0, BoundLayout<ReadRegLayout> layout3)  ;
    +extern ReadSourceRegsStruct exec_ReadSourceRegs(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, DecoderStruct arg2_0, BoundLayout<ReadSourceRegsLayout> layout3)  ;
     extern WriteRdStruct exec_WriteRd(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, DecoderStruct arg2_0, Val arg3, ValU32Struct arg4, BoundLayout<WriteRdLayout> layout5)  ;
     extern ExpandU32Struct exec_ExpandU32(ExecContext& ctx,ValU32Struct arg0, Val arg1_0, BoundLayout<ExpandU32Layout> layout2)  ;
     extern SplitTotalStruct exec_SplitTotal(ExecContext& ctx,Val arg0, BoundLayout<SplitTotalLayout> layout1)  ;
    @@ -226,7 +227,7 @@ extern OneHot_13_Struct exec_OneHot_13_(ExecContext& ctx,Val arg0, BoundLayout<O
     extern TopStruct exec_Top(ExecContext& ctx,BoundLayout<TopLayout> layout0, GlobalBuf global1)  ;
     extern void step_Top(ExecContext& ctx,MutableBuf data0, GlobalBuf global1)  ;
     extern AccumStruct exec_Accum(ExecContext& ctx,BigIntTopStateStruct arg0, ExtVal1Array arg1_0, BoundLayout<AccumLayout> layout2)  ;
    -extern BigIntTopStateStruct exec_TopExtract(ExecContext& ctx,BoundLayout<TopLayout> arg0, GlobalBuf global1)  ;
    +extern BigIntTopStateStruct exec_TopExtract(ExecContext& ctx,BoundLayout<TopLayout> layout0, GlobalBuf global1)  ;
     extern AccumStruct execUser_Accum(ExecContext& ctx,BoundLayout<TopLayout> arg0, ExtVal1Array arg1_0, BoundLayout<AccumLayout> layout2, GlobalBuf global3)  ;
     extern ComponentStruct exec_TopAccum(ExecContext& ctx,BoundLayout<TopLayout> arg0, BoundLayout<LayoutAccumLayout> layout1, GlobalBuf global2, GlobalBuf mix3)  ;
     extern void step_TopAccum(ExecContext& ctx,MutableBuf accum0, MutableBuf data1, GlobalBuf global2, GlobalBuf mix3)  ;
    
  • risc0/circuit/rv32im-sys/kernels/cxx/types.h.inc+51 15 modified
    @@ -135,14 +135,45 @@ struct DecodeInstLayout {
       AddrDecomposeLayout pcAddr;
       MemoryReadLayout loadInst;
     };
    +using MemoryArgLayout4LayoutArray = std::array<MemoryArgLayout, 4>;
    +using CycleArgLayout2LayoutArray = std::array<CycleArgLayout, 2>;
    +struct _Arguments_ReadSourceRegsSourceRegsLayout {
    +  MemoryArgLayout4LayoutArray memoryArg;
    +  CycleArgLayout2LayoutArray cycleArg;
    +};
     struct ReadRegLayout {
       MemoryReadLayout _super;
       NondetRegLayout addr;
     };
    +struct ReadSourceRegsSourceRegsArm0_SuperLayout {
    +  ReadRegLayout rboth;
    +};
    +struct ReadSourceRegsSourceRegsArm0Layout {
    +  ReadSourceRegsSourceRegsArm0_SuperLayout _super;
    +  MemoryArgLayout _extra0;
    +  MemoryArgLayout _extra1;
    +  CycleArgLayout _extra2;
    +};
    +struct ReadSourceRegsSourceRegsArm1_SuperLayout {
    +  ReadRegLayout _0;
    +  ReadRegLayout _1;
    +};
    +struct ReadSourceRegsSourceRegsLayout {
    +  ReadSourceRegsSourceRegsArm0Layout arm0;
    +  ReadSourceRegsSourceRegsArm1_SuperLayout arm1;
    +};
    +struct ReadSourceRegsLayout {
    +  NondetRegLayout isSameReg;
    +  _Arguments_ReadSourceRegsSourceRegsLayout _arguments_ReadSourceRegsSourceRegs;
    +  ReadSourceRegsSourceRegsLayout sourceRegs;
    +  NondetRegLayout rs1Low;
    +  NondetRegLayout rs1High;
    +  NondetRegLayout rs2Low;
    +  NondetRegLayout rs2High;
    +};
     struct MiscInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout5LayoutArray = std::array<ArgU16Layout, 5>;
     struct _Arguments_Misc0MiscOutputLayout {
    @@ -437,8 +468,7 @@ struct Misc2Layout {
     };
     struct MulInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout6LayoutArray = std::array<ArgU16Layout, 6>;
     struct ArgU8Layout {
    @@ -593,8 +623,7 @@ struct Mul0Layout {
     };
     struct DivInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout16LayoutArray = std::array<ArgU16Layout, 16>;
     struct _Arguments_Div0MulOutputLayout {
    @@ -812,8 +841,7 @@ struct Mem0Layout {
     };
     struct MemStoreInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
       NormalizeU32Layout addrU32;
       AddrDecomposeBitsLayout addr;
       MemoryReadLayout data;
    @@ -3074,6 +3102,14 @@ struct InstInputStruct {
     };
     struct DoCycleTableStruct {
     };
    +struct SourceRegsStruct {
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
    +};
    +struct ReadSourceRegsStruct {
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
    +};
     struct WriteRdStruct {
     };
     struct ExpandU32Struct {
    @@ -3100,8 +3136,8 @@ struct MultiplyAccumulateStruct {
     struct DivInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct ComponentStruct {
     };
    @@ -3123,8 +3159,8 @@ struct InstOutputBaseStruct {
     struct MiscInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct MiscOutputStruct {
       Val doWrite;
    @@ -3134,8 +3170,8 @@ struct MiscOutputStruct {
     struct MulInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct DoMulStruct {
       ValU32Struct low;
    @@ -3149,7 +3185,7 @@ struct MemLoadInputStruct {
     };
     struct MemStoreInputStruct {
       DecoderStruct decoded;
    -  GetDataStruct rs2;
    +  ValU32Struct rs2;
       AddrDecomposeBitsStruct addr;
       GetDataStruct data;
     };
    
  • risc0/zkvm/src/host/recursion/tests.rs+1 1 modified
    @@ -398,7 +398,7 @@ fn stable_root() {
     
         assert_eq!(
             ALLOWED_CONTROL_ROOT,
    -        digest!("539032186827b06719244873b17b2d4c122e2d02cfb1994fe958b2523b844576")
    +        digest!("884389273e128b32475b334dec75ee619b77cb33d41c332021fe7e44c746ee60")
         );
     }
     
    
  • risc0/zkvm/src/receipt/composite.rs+1 1 modified
    @@ -315,7 +315,7 @@ mod tests {
         fn composite_receipt_verifier_parameters_is_stable() {
             assert_eq!(
                 CompositeReceiptVerifierParameters::default().digest(),
    -            digest!("3daead8f1ec08eb96b60ce6cad42f82eba80f6cf89ba5007ca317e57256b6038")
    +            digest!("50ffbc35d194e6c9f5fc8adb030d077f3bf5393d5e9cedc6f303a9f1eede3a32")
             );
         }
     }
    
  • risc0/zkvm/src/receipt/groth16.rs+1 1 modified
    @@ -195,7 +195,7 @@ mod tests {
         fn groth16_receipt_verifier_parameters_is_stable() {
             assert_eq!(
                 Groth16ReceiptVerifierParameters::default().digest(),
    -            digest!("9f39696cb3ae9d6038d6b7a55c09017f0cf35e226ad7582b82dbabb0dae53385")
    +            digest!("f536085a791bdbc6cb46ab3074f88e9e94eabb192de8daca3caee1f4ed811b08")
             );
         }
     }
    
  • risc0/zkvm/src/receipt/succinct.rs+1 1 modified
    @@ -357,7 +357,7 @@ mod tests {
         fn succinct_receipt_verifier_parameters_is_stable() {
             assert_eq!(
                 SuccinctReceiptVerifierParameters::default().digest(),
    -            digest!("68ecff4bad7b3348ca3ac642e852b8d66b7158307f7d2a001c13887698fe6019")
    +            digest!("bb81f1400f9a2b28b457f9d686c28ec3ffeece08b0b00f1b0d7643a1cc471115")
             );
         }
     
    
67f2d81c638b

ZKVM-1392: Disallow memory I/O to same address in the same memory cycle (#3181)

https://github.com/risc0/risc0Frank LaubMay 23, 2025via ghsa
34 files changed · +153036 178697
  • risc0/build/src/docker.rs+1 1 modified
    @@ -268,7 +268,7 @@ mod test {
             compare_image_id(
                 &guest_list,
                 "hello_commit",
    -            "24ffce65917df933962d0942dcc64bec43f9b33ef4f8305d7fe95d6d0006ce97",
    +            "34bd21c836cd120365f079e6af59fd37e4f3cd19e1cb2fb8d40078713e4b7216",
             );
         }
     }
    
  • risc0/circuit/recursion/build.rs+1 1 modified
    @@ -30,7 +30,7 @@ fn download_zkr() {
     
         const FILENAME: &str = "recursion_zkr.zip";
         const SRC_PATH: &str = "src/recursion_zkr.zip";
    -    const SHA256_HASH: &str = "5f1762201f5c4afb5d92df4a5b8e5bf5c87b67785991592ba79ce4033719b030";
    +    const SHA256_HASH: &str = "b51785b36bff327f8fc7f3983aea343d1daf015a09189dedb5a3e851884db98e";
     
         fn check_sha2(path: &Path) -> bool {
             let data = fs::read(path).unwrap();
    
  • risc0/circuit/recursion/src/control_id.rs+32 32 modified
    @@ -23,22 +23,22 @@ pub const MIN_LIFT_PO2: usize = 14;
     pub const ALLOWED_CONTROL_IDS: &[Digest] = &[
         digest!("0d79bc33b4760b4783cbb96fdc87724c7e0c463eb0ba1b2705d39f43c698bd2d"), // recursion identity.zkr
         digest!("7a8f24092c34ed3eb81b3d0a0b796c588c615d3488ef9e61c21dbd1e4b83ea6e"), // recursion join.zkr
    -    digest!("512b79026fad0712ad93600ea0ea4234d0be686ea9473e4964f10914a0862c77"), // recursion lift_rv32im_v2_14.zkr
    -    digest!("78aabd63d877bc2806371f228fb05d0f9c8c3330bc782f62c7c6d80b4195de74"), // recursion lift_rv32im_v2_15.zkr
    -    digest!("0bef5e34d752b46874fb523c7d01963a37771d25a6af7c26b808fa26b8a0d815"), // recursion lift_rv32im_v2_16.zkr
    -    digest!("ac1a445d5babf304365232571f822725dcf71f3c8d5e7032c1bba04bad19a85e"), // recursion lift_rv32im_v2_17.zkr
    -    digest!("20ae3d31f954e9594cb968463ce0f823b869e3640169a561fc917226f4ca8963"), // recursion lift_rv32im_v2_18.zkr
    -    digest!("6f16e65efedcbf11b20b9e194e123e33aaedcd0abf1e6e5440efa263daeb375a"), // recursion lift_rv32im_v2_19.zkr
    -    digest!("6da21d5bc6a7534bc686b9294717f12994b13c67183c86668c62d01fcc453151"), // recursion lift_rv32im_v2_20.zkr
    -    digest!("60ea420126e9446430dbed5ca8b29017b6d0f31782710a1d8f8bdd3de5854714"), // recursion lift_rv32im_v2_21.zkr
    -    digest!("d5f05524e8bbb123f8fb1b5299413c50462cef399119953f494e57354351e844"), // recursion lift_rv32im_v2_22.zkr
    +    digest!("8af493194e835b276eefc2522cf71761afdb04286bd3490577d55419049eed21"), // recursion lift_rv32im_v2_14.zkr
    +    digest!("ff455665b3743b2e4ec959674cfec4064fa54420ef0f6d38a601e85a841c3a73"), // recursion lift_rv32im_v2_15.zkr
    +    digest!("94a836188680865ff490ae12c140ec1c3a462c67203eda37f3ac6720d680a862"), // recursion lift_rv32im_v2_16.zkr
    +    digest!("b8c3e64be7662b1c9fc04d65dc276b1a5402b66a657fca4486450417b517a96e"), // recursion lift_rv32im_v2_17.zkr
    +    digest!("7768ce5e55c6e0427962342cc0c4cd43b359da5187d65465317c8c065357cd1d"), // recursion lift_rv32im_v2_18.zkr
    +    digest!("cdfd5d3007f57a1836f83c351fbb3d0f7af43050f5f6a06296f9ba25b516eb69"), // recursion lift_rv32im_v2_19.zkr
    +    digest!("14eb825f500342317158942d328a745e9dda2043b5bc27248f726e57effe2d23"), // recursion lift_rv32im_v2_20.zkr
    +    digest!("d3286f768d13864fa7cc921a25ead7536d09d56ad304a9635c3fa60f511eea62"), // recursion lift_rv32im_v2_21.zkr
    +    digest!("5e37cb58440474617b5beb2e1f3e7472d76a5e7572bb4660896d1074dfa7905d"), // recursion lift_rv32im_v2_22.zkr
         digest!("53a7b23d07f99e5d5685e85874f5181e8486aa267a0ae607ffe9ba47c8bdda4a"), // recursion resolve.zkr
         digest!("7771415b778fea1923440e2eb22c4a1e1d7ada2d42cbe03d13402743c0988a31"), // recursion union.zkr
     ];
     
     /// Root of the Merkle tree constructed from [ALLOWED_CONTROL_IDS], using Poseidon2.
     pub const ALLOWED_CONTROL_ROOT: Digest =
    -    digest!("539032186827b06719244873b17b2d4c122e2d02cfb1994fe958b2523b844576");
    +    digest!("884389273e128b32475b334dec75ee619b77cb33d41c332021fe7e44c746ee60");
     
     /// Control ID for the identity recursion programs (ZKR), using Poseidon over the BN254 scalar field.
     pub const BN254_IDENTITY_CONTROL_ID: Digest =
    @@ -100,47 +100,47 @@ pub const POSEIDON2_CONTROL_IDS: [(&str, Digest); 27] = [
         ),
         (
             "lift_rv32im_v2_14.zkr",
    -        digest!("512b79026fad0712ad93600ea0ea4234d0be686ea9473e4964f10914a0862c77"),
    +        digest!("8af493194e835b276eefc2522cf71761afdb04286bd3490577d55419049eed21"),
         ),
         (
             "lift_rv32im_v2_15.zkr",
    -        digest!("78aabd63d877bc2806371f228fb05d0f9c8c3330bc782f62c7c6d80b4195de74"),
    +        digest!("ff455665b3743b2e4ec959674cfec4064fa54420ef0f6d38a601e85a841c3a73"),
         ),
         (
             "lift_rv32im_v2_16.zkr",
    -        digest!("0bef5e34d752b46874fb523c7d01963a37771d25a6af7c26b808fa26b8a0d815"),
    +        digest!("94a836188680865ff490ae12c140ec1c3a462c67203eda37f3ac6720d680a862"),
         ),
         (
             "lift_rv32im_v2_17.zkr",
    -        digest!("ac1a445d5babf304365232571f822725dcf71f3c8d5e7032c1bba04bad19a85e"),
    +        digest!("b8c3e64be7662b1c9fc04d65dc276b1a5402b66a657fca4486450417b517a96e"),
         ),
         (
             "lift_rv32im_v2_18.zkr",
    -        digest!("20ae3d31f954e9594cb968463ce0f823b869e3640169a561fc917226f4ca8963"),
    +        digest!("7768ce5e55c6e0427962342cc0c4cd43b359da5187d65465317c8c065357cd1d"),
         ),
         (
             "lift_rv32im_v2_19.zkr",
    -        digest!("6f16e65efedcbf11b20b9e194e123e33aaedcd0abf1e6e5440efa263daeb375a"),
    +        digest!("cdfd5d3007f57a1836f83c351fbb3d0f7af43050f5f6a06296f9ba25b516eb69"),
         ),
         (
             "lift_rv32im_v2_20.zkr",
    -        digest!("6da21d5bc6a7534bc686b9294717f12994b13c67183c86668c62d01fcc453151"),
    +        digest!("14eb825f500342317158942d328a745e9dda2043b5bc27248f726e57effe2d23"),
         ),
         (
             "lift_rv32im_v2_21.zkr",
    -        digest!("60ea420126e9446430dbed5ca8b29017b6d0f31782710a1d8f8bdd3de5854714"),
    +        digest!("d3286f768d13864fa7cc921a25ead7536d09d56ad304a9635c3fa60f511eea62"),
         ),
         (
             "lift_rv32im_v2_22.zkr",
    -        digest!("d5f05524e8bbb123f8fb1b5299413c50462cef399119953f494e57354351e844"),
    +        digest!("5e37cb58440474617b5beb2e1f3e7472d76a5e7572bb4660896d1074dfa7905d"),
         ),
         (
             "lift_rv32im_v2_23.zkr",
    -        digest!("b4459e2bc38f800ed80c956234d59a4611d0f825eae566478ac4c06a07a61c21"),
    +        digest!("387a9e1a4752e35bbcc27a05c9102713fd6e42728f1bae74bb21d9054a87cc08"),
         ),
         (
             "lift_rv32im_v2_24.zkr",
    -        digest!("4434690c184bd542c823aa1efcf6c15cf8c83d0aafbf4f3e0552d8125eedd12a"),
    +        digest!("60c7632be5c98c38b567522947c03a1048882d2beeba175b63060351486e670d"),
         ),
         (
             "resolve.zkr",
    @@ -212,47 +212,47 @@ pub const SHA256_CONTROL_IDS: [(&str, Digest); 27] = [
         ),
         (
             "lift_rv32im_v2_14.zkr",
    -        digest!("9515af7e33bb75efd90a1f23b12762ca36231881656b4af9fd1685a6ff4ec018"),
    +        digest!("d60c25f02824db9fc7bdcecdc4d431d2d22b65eba7948825948ae1bc92d60946"),
         ),
         (
             "lift_rv32im_v2_15.zkr",
    -        digest!("2b0d1276550887f6b27a423f43a4ce89abef45e056d86c8a59fa8d4593701844"),
    +        digest!("ef84c7599ba1c513dc60370fcf10f0ad97a1849f92e455b7d6dd8359c427a187"),
         ),
         (
             "lift_rv32im_v2_16.zkr",
    -        digest!("92f3c9ee2e5e1a23d90a0e7dd52bf7b9b4f1e272613ac76e5bf6e932fa8de0ec"),
    +        digest!("99139be7bc3b8692f5c38c37529cc84915cce84f8bcd3fa7913abc7984192b2b"),
         ),
         (
             "lift_rv32im_v2_17.zkr",
    -        digest!("4d9c713b2dfa00271b9d4a87ef4244974a85bbb20b493cd103d75b4fcc60d411"),
    +        digest!("bf6c6915e4f31661e11edb487a57c2a56aa44203b9e6886a2a703a44103b2748"),
         ),
         (
             "lift_rv32im_v2_18.zkr",
    -        digest!("7054dde82886b4a8955539872ff4784973a61782ec71348a405564a21ae3f630"),
    +        digest!("21f330b32a66a4352025edf53ac05ecf10cd5ea9db6302c755de421d4cc6589e"),
         ),
         (
             "lift_rv32im_v2_19.zkr",
    -        digest!("c4abec2567fbd603ce616ecd27923f45b601d5f86cc48d1f1fb3091615afb6fd"),
    +        digest!("57049b4e505fa5f706847e9ba3905d93eb0198fe1b69fd19405e3ae3aa266009"),
         ),
         (
             "lift_rv32im_v2_20.zkr",
    -        digest!("1263bd3dcecab89069b91de5c4c99bdc33f853b00b50e1f35e4ffa392badd7a4"),
    +        digest!("9889b3329bd0d2c4694113b4e56790f105efb2b79effd21bfc0c3c3f41bd8066"),
         ),
         (
             "lift_rv32im_v2_21.zkr",
    -        digest!("7380d1f06f8fb3dc3f9c7d278071fbc3bf30073229c6885d1a41c6528e90e4c7"),
    +        digest!("9c976973ab89b8497fc830c1a0305e9f907dbbd40574482e93f6e18458ee2a87"),
         ),
         (
             "lift_rv32im_v2_22.zkr",
    -        digest!("793cbfc8de47a9beeb2221cac0d06470fc87e26771330561369fb518cc3b1b05"),
    +        digest!("a1521c33c8faf68b3db10be0aa3fbde3e100ae8ec924206529db4f1cefe70d5b"),
         ),
         (
             "lift_rv32im_v2_23.zkr",
    -        digest!("7bc461a9ff258b32178124b8c8f78cadac35db313b57f62d51958ec9ec37fb71"),
    +        digest!("45da7396e10423a381e3e42c25a5fb05bb27389e8ca1c73f046de24e790c7727"),
         ),
         (
             "lift_rv32im_v2_24.zkr",
    -        digest!("dc295096d9db9166e06e424445563cc4bec8fdb1a69e3b2fcee1bba75fa85883"),
    +        digest!("8645ae4ab3fa5686dafa447471959834cf4c68d65af8f04cc55300497d31c197"),
         ),
         (
             "resolve.zkr",
    
  • risc0/circuit/recursion/src/recursion_zkr.zip+2 2 modified
    @@ -1,3 +1,3 @@
     version https://git-lfs.github.com/spec/v1
    -oid sha256:5f1762201f5c4afb5d92df4a5b8e5bf5c87b67785991592ba79ce4033719b030
    -size 47454351
    +oid sha256:b51785b36bff327f8fc7f3983aea343d1daf015a09189dedb5a3e851884db98e
    +size 47476190
    
  • risc0/circuit/rv32im/src/execute/r0vm.rs+1 1 modified
    @@ -491,7 +491,7 @@ impl<'a, C: Risc0Context> Risc0Machine<'a, C> {
                         rlen -= WORD_SIZE as u32;
                     } else {
                         // tracing::trace!("store: {:#010x} -> null", 0);
    -                    self.store_memory(SAFE_WRITE_ADDR.waddr(), 0)?;
    +                    self.store_memory(SAFE_WRITE_ADDR.waddr() + j, 0)?;
                     }
                 }
     
    
  • risc0/circuit/rv32im/src/execute/rv32im.rs+15 2 modified
    @@ -311,6 +311,19 @@ impl Emulator {
             Ok(())
         }
     
    +    fn load_rs2<M: EmuContext>(
    +        &self,
    +        ctx: &mut M,
    +        decoded: &DecodedInstruction,
    +        rs1: u32,
    +    ) -> Result<u32> {
    +        if decoded.rs1 == decoded.rs2 {
    +            Ok(rs1)
    +        } else {
    +            ctx.load_register(decoded.rs2 as usize)
    +        }
    +    }
    +
         #[inline(always)]
         fn step_compute<M: EmuContext>(
             &mut self,
    @@ -324,7 +337,7 @@ impl Emulator {
             let mut new_pc = pc + WORD_SIZE;
             let mut rd = decoded.rd;
             let rs1 = ctx.load_register(decoded.rs1 as usize)?;
    -        let rs2 = ctx.load_register(decoded.rs2 as usize)?;
    +        let rs2 = self.load_rs2(ctx, &decoded, rs1)?;
             let imm_i = decoded.imm_i();
             let mut br_cond = |cond| -> u32 {
                 rd = 0;
    @@ -501,7 +514,7 @@ impl Emulator {
             self.trace_instruction(ctx, kind, &decoded)?;
     
             let rs1 = ctx.load_register(decoded.rs1 as usize)?;
    -        let rs2 = ctx.load_register(decoded.rs2 as usize)?;
    +        let rs2 = self.load_rs2(ctx, &decoded, rs1)?;
             let addr = ByteAddr(rs1.wrapping_add(decoded.imm_s()));
             let shift = 8 * (addr.0 & 3);
             if !ctx.check_data_store(addr) {
    
  • risc0/circuit/rv32im/src/prove/witgen/preflight.rs+3 2 modified
    @@ -14,7 +14,7 @@
     
     use std::collections::BTreeSet;
     
    -use anyhow::{anyhow, bail, Result};
    +use anyhow::{anyhow, bail, ensure, Result};
     use derive_more::Debug;
     use num_traits::FromPrimitive as _;
     use risc0_binfmt::{ByteAddr, WordAddr};
    @@ -216,7 +216,8 @@ impl<'a> Preflight<'a> {
                     txn.prev_cycle = self.prev_cycle.get(&addr).unwrap();
                 } else {
                     // Otherwise, compute cycle diff and another diff
    -                let diff = txn.cycle - txn.prev_cycle;
    +                ensure!(txn.cycle != txn.prev_cycle);
    +                let diff = txn.cycle - 1 - txn.prev_cycle;
                     self.trace.cycles[(diff / 2) as usize].diff_count[(diff % 2) as usize] += 1;
                 }
     
    
  • risc0/circuit/rv32im/src/zirgen/info.rs+17 18 modified
    @@ -30,7 +30,7 @@ impl CircuitInfo for CircuitImpl {
     }
     
     #[allow(dead_code)]
    -pub const NUM_POLY_MIX_POWERS: usize = 472;
    +pub const NUM_POLY_MIX_POWERS: usize = 458;
     
     #[allow(dead_code)]
     pub const POLY_MIX_POWERS: &[usize] = &[
    @@ -42,21 +42,20 @@ pub const POLY_MIX_POWERS: &[usize] = &[
         117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
         136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
         155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
    -    174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 187, 188, 190, 197, 198, 199, 200, 201, 202,
    -    203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221,
    -    222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
    -    241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259,
    -    260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
    -    279, 280, 285, 298, 304, 310, 315, 324, 326, 328, 329, 331, 335, 336, 342, 343, 344, 345, 346,
    -    347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365,
    -    366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
    -    385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403,
    -    404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 428, 436, 456,
    -    471, 510, 513, 521, 586, 592, 604, 635, 651, 658, 674, 681, 704, 705, 706, 707, 708, 709, 710,
    -    711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729,
    -    756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774,
    -    775, 790, 808, 950, 1040, 1127, 1214, 1352, 1544, 1825, 2128, 2279, 2428, 3295, 3715, 5722,
    -    6131, 6835, 7551, 7552, 7553, 7554, 7555, 7556, 7557, 7558, 7559, 7560, 7561, 7562, 7563, 7564,
    -    7567, 7570, 7573, 7577, 7580, 7583, 7587, 7597, 7607, 7617, 7631, 7648, 7658, 7669, 7689, 7699,
    -    7718, 7720, 7727,
    +    174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 185, 187, 188, 190, 197, 198, 199, 200, 201,
    +    202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
    +    221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
    +    240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258,
    +    259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277,
    +    278, 279, 280, 298, 304, 310, 317, 323, 326, 328, 329, 334, 335, 343, 349, 350, 354, 355, 361,
    +    362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380,
    +    381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399,
    +    400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418,
    +    419, 420, 436, 447, 456, 471, 513, 521, 529, 586, 604, 611, 635, 651, 658, 681, 693, 704, 705,
    +    706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724,
    +    725, 726, 727, 728, 729, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788,
    +    789, 790, 791, 792, 793, 794, 808, 828, 1007, 1040, 1127, 1214, 1428, 1544, 1825, 2223, 2374,
    +    2542, 3409, 3829, 5836, 6245, 6949, 7665, 7666, 7667, 7668, 7669, 7670, 7671, 7672, 7673, 7674,
    +    7675, 7676, 7677, 7678, 7681, 7684, 7687, 7691, 7694, 7697, 7701, 7711, 7721, 7731, 7745, 7762,
    +    7772, 7783, 7803, 7813, 7832, 7834, 7841,
     ];
    
  • risc0/circuit/rv32im/src/zirgen/layout.rs.inc+3693 3388 modified
  • risc0/circuit/rv32im/src/zirgen/poly_ext.rs+18967 18760 modified
  • risc0/circuit/rv32im/src/zirgen/types.rs.inc+132 23 modified
    @@ -465,6 +465,23 @@ impl risc0_zkp::layout::Component for DecodeInstLayout {
             Ok(())
         }
     }
    +pub type MemoryArgLayout4LayoutArray = [&'static MemoryArgLayout; 4];
    +pub type CycleArgLayout2LayoutArray = [&'static CycleArgLayout; 2];
    +pub struct _Arguments_ReadSourceRegsSourceRegsLayout {
    +    pub memory_arg: &'static MemoryArgLayout4LayoutArray,
    +    pub cycle_arg: &'static CycleArgLayout2LayoutArray,
    +}
    +impl risc0_zkp::layout::Component for _Arguments_ReadSourceRegsSourceRegsLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "_Arguments_ReadSourceRegsSourceRegsLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("memory_arg", self.memory_arg)?;
    +        v.visit_component("cycle_arg", self.cycle_arg)?;
    +        Ok(())
    +    }
    +}
     pub struct ReadRegLayout {
         pub _super: &'static MemoryReadLayout,
         pub addr: &'static NondetRegLayout,
    @@ -480,10 +497,99 @@ impl risc0_zkp::layout::Component for ReadRegLayout {
             Ok(())
         }
     }
    +pub struct ReadSourceRegsSourceRegsArm0_SuperLayout {
    +    pub rboth: &'static ReadRegLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsSourceRegsArm0_SuperLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsSourceRegsArm0_SuperLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("rboth", self.rboth)?;
    +        Ok(())
    +    }
    +}
    +pub struct ReadSourceRegsSourceRegsArm0Layout {
    +    pub _super: &'static ReadSourceRegsSourceRegsArm0_SuperLayout,
    +    pub _extra0: &'static MemoryArgLayout,
    +    pub _extra1: &'static MemoryArgLayout,
    +    pub _extra2: &'static CycleArgLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsSourceRegsArm0Layout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsSourceRegsArm0Layout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("_super", self._super)?;
    +        v.visit_component("_extra0", self._extra0)?;
    +        v.visit_component("_extra1", self._extra1)?;
    +        v.visit_component("_extra2", self._extra2)?;
    +        Ok(())
    +    }
    +}
    +pub struct ReadSourceRegsSourceRegsArm1_SuperLayout {
    +    pub _0: &'static ReadRegLayout,
    +    pub _1: &'static ReadRegLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsSourceRegsArm1_SuperLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsSourceRegsArm1_SuperLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("_0", self._0)?;
    +        v.visit_component("_1", self._1)?;
    +        Ok(())
    +    }
    +}
    +pub struct ReadSourceRegsSourceRegsLayout {
    +    pub arm0: &'static ReadSourceRegsSourceRegsArm0Layout,
    +    pub arm1: &'static ReadSourceRegsSourceRegsArm1_SuperLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsSourceRegsLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsSourceRegsLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("arm0", self.arm0)?;
    +        v.visit_component("arm1", self.arm1)?;
    +        Ok(())
    +    }
    +}
    +pub struct ReadSourceRegsLayout {
    +    pub is_same_reg: &'static NondetRegLayout,
    +    pub _arguments_read_source_regs_source_regs: &'static _Arguments_ReadSourceRegsSourceRegsLayout,
    +    pub source_regs: &'static ReadSourceRegsSourceRegsLayout,
    +    pub rs1_low: &'static NondetRegLayout,
    +    pub rs1_high: &'static NondetRegLayout,
    +    pub rs2_low: &'static NondetRegLayout,
    +    pub rs2_high: &'static NondetRegLayout,
    +}
    +impl risc0_zkp::layout::Component for ReadSourceRegsLayout {
    +    fn ty_name(&self) -> &'static str {
    +        "ReadSourceRegsLayout"
    +    }
    +    #[allow(unused_variables)]
    +    fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
    +        v.visit_component("is_same_reg", self.is_same_reg)?;
    +        v.visit_component(
    +            "_arguments_read_source_regs_source_regs",
    +            self._arguments_read_source_regs_source_regs,
    +        )?;
    +        v.visit_component("source_regs", self.source_regs)?;
    +        v.visit_component("rs1_low", self.rs1_low)?;
    +        v.visit_component("rs1_high", self.rs1_high)?;
    +        v.visit_component("rs2_low", self.rs2_low)?;
    +        v.visit_component("rs2_high", self.rs2_high)?;
    +        Ok(())
    +    }
    +}
     pub struct MiscInputLayout {
         pub decoded: &'static DecodeInstLayout,
    -    pub rs1: &'static ReadRegLayout,
    -    pub rs2: &'static ReadRegLayout,
    +    pub source_regs: &'static ReadSourceRegsLayout,
     }
     impl risc0_zkp::layout::Component for MiscInputLayout {
         fn ty_name(&self) -> &'static str {
    @@ -492,8 +598,7 @@ impl risc0_zkp::layout::Component for MiscInputLayout {
         #[allow(unused_variables)]
         fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
             v.visit_component("decoded", self.decoded)?;
    -        v.visit_component("rs1", self.rs1)?;
    -        v.visit_component("rs2", self.rs2)?;
    +        v.visit_component("source_regs", self.source_regs)?;
             Ok(())
         }
     }
    @@ -1466,8 +1571,7 @@ impl risc0_zkp::layout::Component for Misc2Layout {
     }
     pub struct MulInputLayout {
         pub decoded: &'static DecodeInstLayout,
    -    pub rs1: &'static ReadRegLayout,
    -    pub rs2: &'static ReadRegLayout,
    +    pub source_regs: &'static ReadSourceRegsLayout,
     }
     impl risc0_zkp::layout::Component for MulInputLayout {
         fn ty_name(&self) -> &'static str {
    @@ -1476,8 +1580,7 @@ impl risc0_zkp::layout::Component for MulInputLayout {
         #[allow(unused_variables)]
         fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
             v.visit_component("decoded", self.decoded)?;
    -        v.visit_component("rs1", self.rs1)?;
    -        v.visit_component("rs2", self.rs2)?;
    +        v.visit_component("source_regs", self.source_regs)?;
             Ok(())
         }
     }
    @@ -1953,8 +2056,7 @@ impl risc0_zkp::layout::Component for Mul0Layout {
     }
     pub struct DivInputLayout {
         pub decoded: &'static DecodeInstLayout,
    -    pub rs1: &'static ReadRegLayout,
    -    pub rs2: &'static ReadRegLayout,
    +    pub source_regs: &'static ReadSourceRegsLayout,
     }
     impl risc0_zkp::layout::Component for DivInputLayout {
         fn ty_name(&self) -> &'static str {
    @@ -1963,8 +2065,7 @@ impl risc0_zkp::layout::Component for DivInputLayout {
         #[allow(unused_variables)]
         fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
             v.visit_component("decoded", self.decoded)?;
    -        v.visit_component("rs1", self.rs1)?;
    -        v.visit_component("rs2", self.rs2)?;
    +        v.visit_component("source_regs", self.source_regs)?;
             Ok(())
         }
     }
    @@ -2677,8 +2778,7 @@ impl risc0_zkp::layout::Component for Mem0Layout {
     }
     pub struct MemStoreInputLayout {
         pub decoded: &'static DecodeInstLayout,
    -    pub rs1: &'static ReadRegLayout,
    -    pub rs2: &'static ReadRegLayout,
    +    pub source_regs: &'static ReadSourceRegsLayout,
         pub addr_u32: &'static NormalizeU32Layout,
         pub addr: &'static AddrDecomposeBitsLayout,
         pub data_0: &'static MemoryReadLayout,
    @@ -2690,8 +2790,7 @@ impl risc0_zkp::layout::Component for MemStoreInputLayout {
         #[allow(unused_variables)]
         fn walk<V: risc0_zkp::layout::Visitor>(&self, v: &mut V) -> core::fmt::Result {
             v.visit_component("decoded", self.decoded)?;
    -        v.visit_component("rs1", self.rs1)?;
    -        v.visit_component("rs2", self.rs2)?;
    +        v.visit_component("source_regs", self.source_regs)?;
             v.visit_component("addr_u32", self.addr_u32)?;
             v.visit_component("addr", self.addr)?;
             v.visit_component("data_0", self.data_0)?;
    @@ -8490,6 +8589,16 @@ pub struct InstInputStruct {
     #[derive(Copy, Clone, Debug)]
     pub struct DoCycleTableStruct {}
     #[derive(Copy, Clone, Debug)]
    +pub struct SourceRegsStruct {
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
    +}
    +#[derive(Copy, Clone, Debug)]
    +pub struct ReadSourceRegsStruct {
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
    +}
    +#[derive(Copy, Clone, Debug)]
     pub struct WriteRdStruct {}
     #[derive(Copy, Clone, Debug)]
     pub struct ExpandU32Struct {
    @@ -8520,8 +8629,8 @@ pub struct MultiplyAccumulateStruct {
     pub struct DivInputStruct {
         pub _super: InstInputStruct,
         pub decoded: DecoderStruct,
    -    pub rs1: GetDataStruct,
    -    pub rs2: GetDataStruct,
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
     }
     #[derive(Copy, Clone, Debug)]
     pub struct ComponentStruct {}
    @@ -8547,8 +8656,8 @@ pub struct InstOutputBaseStruct {
     pub struct MiscInputStruct {
         pub _super: InstInputStruct,
         pub decoded: DecoderStruct,
    -    pub rs1: GetDataStruct,
    -    pub rs2: GetDataStruct,
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
     }
     #[derive(Copy, Clone, Debug)]
     pub struct MiscOutputStruct {
    @@ -8560,8 +8669,8 @@ pub struct MiscOutputStruct {
     pub struct MulInputStruct {
         pub _super: InstInputStruct,
         pub decoded: DecoderStruct,
    -    pub rs1: GetDataStruct,
    -    pub rs2: GetDataStruct,
    +    pub rs1: ValU32Struct,
    +    pub rs2: ValU32Struct,
     }
     #[derive(Copy, Clone, Debug)]
     pub struct DoMulStruct {
    @@ -8578,7 +8687,7 @@ pub struct MemLoadInputStruct {
     #[derive(Copy, Clone, Debug)]
     pub struct MemStoreInputStruct {
         pub decoded: DecoderStruct,
    -    pub rs2: GetDataStruct,
    +    pub rs2: ValU32Struct,
         pub addr: AddrDecomposeBitsStruct,
         pub data_0: GetDataStruct,
     }
    
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check_0.cu+7546 6517 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check_1.cu+6211 6298 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check_2.cu+6159 6186 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check_3.cu+5993 6647 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/eval_check.cuh+29 271 modified
    @@ -2,282 +2,40 @@
     
     #include "supra/fp.h"
     
    +
    +
     #include <cstdint>
     
     namespace risc0::circuit::rv32im_v2::cuda {
     
    -extern __device__ FpExt rv32im_v2_18(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt* arg6,
    -                                     const Fp* arg7,
    -                                     const Fp* arg8,
    -                                     const Fp* arg9,
    -                                     const Fp* arg10);
    -extern __device__ FpExt rv32im_v2_17(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt* arg4,
    -                                     const Fp* arg5,
    -                                     const Fp* arg6,
    -                                     const Fp* arg7,
    -                                     const Fp* arg8);
    -extern __device__ FpExt rv32im_v2_16(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt* arg6,
    -                                     FpExt arg7,
    -                                     const Fp* arg8,
    -                                     const Fp* arg9,
    -                                     const Fp* arg10,
    -                                     const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_15(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt arg6,
    -                                     FpExt arg7,
    -                                     FpExt arg8,
    -                                     FpExt arg9,
    -                                     FpExt arg10,
    -                                     FpExt* arg11,
    -                                     FpExt arg12,
    -                                     const Fp* arg13,
    -                                     const Fp* arg14,
    -                                     const Fp* arg15,
    -                                     const Fp* arg16);
    -extern __device__ FpExt rv32im_v2_14(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt* arg4,
    -                                     FpExt arg5,
    -                                     const Fp* arg6,
    -                                     const Fp* arg7,
    -                                     const Fp* arg8,
    -                                     const Fp* arg9);
    -extern __device__ FpExt rv32im_v2_13(uint32_t idx,
    -                                     uint32_t size,
    -                                     FpExt arg0,
    -                                     Fp* arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt arg6,
    -                                     FpExt* arg7,
    -                                     FpExt arg8,
    -                                     const Fp* arg9,
    -                                     const Fp* arg10,
    -                                     const Fp* arg11,
    -                                     const Fp* arg12);
    -extern __device__ FpExt rv32im_v2_12(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt* arg4,
    -                                     FpExt arg5,
    -                                     const Fp* arg6,
    -                                     const Fp* arg7,
    -                                     const Fp* arg8,
    -                                     const Fp* arg9);
    -extern __device__ FpExt rv32im_v2_11(uint32_t idx,
    -                                     uint32_t size,
    -                                     FpExt* arg0,
    -                                     Fp* arg1,
    -                                     FpExt arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt arg6,
    -                                     FpExt arg7,
    -                                     FpExt arg8,
    -                                     FpExt arg9,
    -                                     const Fp* arg10,
    -                                     const Fp* arg11,
    -                                     const Fp* arg12);
    -extern __device__ FpExt rv32im_v2_10(uint32_t idx,
    -                                     uint32_t size,
    -                                     Fp* arg0,
    -                                     FpExt arg1,
    -                                     FpExt* arg2,
    -                                     FpExt arg3,
    -                                     FpExt arg4,
    -                                     FpExt arg5,
    -                                     FpExt arg6,
    -                                     FpExt arg7,
    -                                     FpExt arg8,
    -                                     FpExt arg9,
    -                                     FpExt arg10,
    -                                     FpExt arg11,
    -                                     FpExt arg12,
    -                                     FpExt arg13,
    -                                     FpExt arg14,
    -                                     FpExt arg15,
    -                                     FpExt arg16,
    -                                     FpExt arg17,
    -                                     FpExt arg18,
    -                                     FpExt arg19,
    -                                     FpExt arg20,
    -                                     FpExt arg21,
    -                                     FpExt arg22,
    -                                     FpExt arg23,
    -                                     FpExt arg24,
    -                                     FpExt arg25,
    -                                     FpExt arg26,
    -                                     FpExt arg27,
    -                                     const Fp* arg28,
    -                                     const Fp* arg29,
    -                                     const Fp* arg30);
    -extern __device__ FpExt rv32im_v2_9(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt* arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    const Fp* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_8(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt* arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    const Fp* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_7(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt* arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    const Fp* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_6(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    FpExt* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11,
    -                                    const Fp* arg12);
    -extern __device__ FpExt rv32im_v2_5(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt arg8,
    -                                    FpExt* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11,
    -                                    const Fp* arg12);
    -extern __device__ FpExt rv32im_v2_4(uint32_t idx,
    -                                    uint32_t size,
    -                                    Fp* arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt arg6,
    -                                    FpExt arg7,
    -                                    FpExt* arg8,
    -                                    const Fp* arg9,
    -                                    const Fp* arg10,
    -                                    const Fp* arg11);
    -extern __device__ FpExt rv32im_v2_3(uint32_t idx,
    -                                    uint32_t size,
    -                                    FpExt arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    Fp* arg3,
    -                                    FpExt arg4,
    -                                    FpExt arg5,
    -                                    FpExt* arg6,
    -                                    const Fp* arg7,
    -                                    const Fp* arg8,
    -                                    const Fp* arg9);
    -extern __device__ FpExt rv32im_v2_2(uint32_t idx,
    -                                    uint32_t size,
    -                                    FpExt* arg0,
    -                                    Fp* arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    FpExt arg4,
    -                                    const Fp* arg5,
    -                                    const Fp* arg6,
    -                                    const Fp* arg7);
    -extern __device__ FpExt rv32im_v2_1(uint32_t idx,
    -                                    uint32_t size,
    -                                    FpExt* arg0,
    -                                    FpExt arg1,
    -                                    FpExt arg2,
    -                                    FpExt arg3,
    -                                    const Fp* arg4,
    -                                    const Fp* arg5);
    -extern __device__ FpExt
    -rv32im_v2_0(uint32_t idx, uint32_t size, FpExt* arg0, FpExt arg1, FpExt arg2, const Fp* arg3);
    -extern __device__ FpExt poly_fp(uint32_t idx,
    -                                uint32_t size,
    -                                const Fp* ctrl,
    -                                const Fp* out,
    -                                const Fp* data,
    -                                const Fp* mix,
    -                                const Fp* accum);
    +
    +extern __device__ FpExt rv32im_v2_19(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt* arg6, const Fp* arg7, const Fp* arg8, const Fp* arg9, const Fp* arg10);
    +extern __device__ FpExt rv32im_v2_18(uint32_t idx, uint32_t size, FpExt arg0, FpExt arg1, Fp* arg2, FpExt arg3, FpExt arg4, FpExt* arg5, const Fp* arg6, const Fp* arg7, const Fp* arg8, const Fp* arg9);
    +extern __device__ FpExt rv32im_v2_17(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt* arg6, FpExt arg7, const Fp* arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_16(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt arg9, FpExt arg10, FpExt* arg11, FpExt arg12, const Fp* arg13, const Fp* arg14, const Fp* arg15, const Fp* arg16);
    +extern __device__ FpExt rv32im_v2_15(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt* arg9, FpExt arg10, const Fp* arg11, const Fp* arg12, const Fp* arg13, const Fp* arg14);
    +extern __device__ FpExt rv32im_v2_14(uint32_t idx, uint32_t size, FpExt arg0, FpExt arg1, Fp* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt* arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_13(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt* arg6, FpExt arg7, const Fp* arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_12(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_11(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_10(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt arg9, FpExt arg10, FpExt arg11, FpExt arg12, FpExt arg13, FpExt arg14, FpExt arg15, FpExt* arg16, FpExt arg17, FpExt arg18, FpExt arg19, FpExt arg20, FpExt arg21, FpExt arg22, const Fp* arg23, const Fp* arg24, const Fp* arg25);
    +extern __device__ FpExt rv32im_v2_9(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_8(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_7(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt* arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_6(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt* arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_5(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt arg8, FpExt* arg9, const Fp* arg10, const Fp* arg11, const Fp* arg12);
    +extern __device__ FpExt rv32im_v2_4(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt arg6, FpExt arg7, FpExt* arg8, const Fp* arg9, const Fp* arg10, const Fp* arg11);
    +extern __device__ FpExt rv32im_v2_3(uint32_t idx, uint32_t size, Fp* arg0, FpExt arg1, FpExt arg2, FpExt arg3, FpExt arg4, FpExt arg5, FpExt* arg6, const Fp* arg7, const Fp* arg8, const Fp* arg9);
    +extern __device__ FpExt rv32im_v2_2(uint32_t idx, uint32_t size, FpExt* arg0, FpExt arg1, FpExt arg2, const Fp* arg3, const Fp* arg4, const Fp* arg5);
    +extern __device__ FpExt rv32im_v2_1(uint32_t idx, uint32_t size, FpExt* arg0, FpExt arg1, FpExt arg2, FpExt arg3, const Fp* arg4, const Fp* arg5);
    +extern __device__ FpExt rv32im_v2_0(uint32_t idx, uint32_t size, FpExt* arg0, FpExt arg1, FpExt arg2, FpExt arg3, const Fp* arg4);
    +extern __device__ FpExt poly_fp(uint32_t idx, uint32_t size, const Fp* ctrl, const Fp* out, const Fp* data, const Fp* mix, const Fp* accum);
     
     constexpr size_t INV_RATE = 4;
    -constexpr size_t kNumPolyMixPows = 472;
    +constexpr size_t kNumPolyMixPows = 458;
     extern __constant__ FpExt poly_mix[kNumPolyMixPows];
     
    -} // namespace risc0::circuit::rv32im_v2::cuda
    +
    +
    +
    +}  // namespace risc0::circuit::rv32im_v2::cuda
    
  • risc0/circuit/rv32im-sys/kernels/cuda/layout.cuh.inc+1118 1083 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/layout.cu.inc+8276 6978 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/steps.cu+30231 59989 modified
  • risc0/circuit/rv32im-sys/kernels/cuda/steps.cuh+210 810 modified
    @@ -17,815 +17,215 @@
     #include "witgen.h"
     
     namespace risc0::circuit::rv32im_v2::cuda {
    -extern __device__ NondetRegStruct back_NondetReg(ExecContext& ctx,
    -                                                 Index distance0,
    -                                                 BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_NondetReg(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetExtRegStruct back_NondetExtReg(ExecContext& ctx,
    -                                                       Index distance0,
    -                                                       BoundLayout<NondetExtRegLayout> layout1);
    -extern __device__ NondetExtRegStruct exec_NondetExtReg(ExecContext& ctx,
    -                                                       ExtVal arg0,
    -                                                       BoundLayout<NondetExtRegLayout> layout1);
    -extern __device__ NondetRegStruct back_Reg(ExecContext& ctx,
    -                                           Index distance0,
    -                                           BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_Reg(ExecContext& ctx,
    -                                           Val arg0,
    -                                           BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetExtRegStruct back_ExtReg(ExecContext& ctx,
    -                                                 Index distance0,
    -                                                 BoundLayout<NondetExtRegLayout> layout1);
    -extern __device__ NondetExtRegStruct exec_ExtReg(ExecContext& ctx,
    -                                                 ExtVal arg0,
    -                                                 BoundLayout<NondetExtRegLayout> layout1);
    -extern __device__ NondetRegStruct back_NondetBitReg(ExecContext& ctx,
    -                                                    Index distance0,
    -                                                    BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_NondetBitReg(ExecContext& ctx,
    -                                                    Val arg0,
    -                                                    BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct back_BitReg(ExecContext& ctx,
    -                                              Index distance0,
    -                                              BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_BitReg(ExecContext& ctx,
    -                                              Val arg0,
    -                                              BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_NondetTwitReg(ExecContext& ctx,
    -                                                     Val arg0,
    -                                                     BoundLayout<NondetRegLayout> layout1);
    -extern __device__ NondetFakeTwitRegStruct
    -exec_NondetFakeTwitReg(ExecContext& ctx, Val arg0, BoundLayout<NondetFakeTwitRegLayout> layout1);
    -extern __device__ FakeTwitRegStruct exec_FakeTwitReg(ExecContext& ctx,
    -                                                     Val arg0,
    -                                                     BoundLayout<NondetFakeTwitRegLayout> layout1);
    -extern __device__ NondetRegStruct exec_IsZero(ExecContext& ctx,
    -                                              Val arg0,
    -                                              BoundLayout<IsZeroLayout> layout1);
    -extern __device__ ArgU8Struct exec_ArgU8(ExecContext& ctx,
    -                                         Val arg0,
    -                                         Val arg1_0,
    -                                         BoundLayout<ArgU8Layout> layout2);
    -extern __device__ NondetRegStruct exec_NondetU8Reg(ExecContext& ctx,
    -                                                   Val arg0,
    -                                                   BoundLayout<NondetU8RegLayout> layout1);
    -extern __device__ U8RegStruct exec_U8Reg(ExecContext& ctx,
    -                                         Val arg0,
    -                                         BoundLayout<NondetU8RegLayout> layout1);
    -extern __device__ ArgU16Struct exec_ArgU16(ExecContext& ctx,
    -                                           Val arg0,
    -                                           Val arg1_0,
    -                                           BoundLayout<ArgU16Layout> layout2);
    -extern __device__ NondetU16RegStruct exec_NondetU16Reg(ExecContext& ctx,
    -                                                       Val arg0,
    -                                                       BoundLayout<NondetU16RegLayout> layout1);
    -extern __device__ NondetU16RegStruct exec_U16Reg(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<NondetU16RegLayout> layout1);
    -extern __device__ ToBits_5_Struct exec_ToBits_5_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<ToBits_5_Layout> layout1);
    -extern __device__ ValU32Struct exec_DynPo2(ExecContext& ctx,
    -                                           Val arg0,
    -                                           BoundLayout<DynPo2Layout> layout1);
    -extern __device__ NormalizeU32Struct exec_NormalizeU32(ExecContext& ctx,
    -                                                       DenormedValU32Struct arg0,
    -                                                       BoundLayout<NormalizeU32Layout> layout1);
    -extern __device__ AddrDecomposeStruct exec_AddrDecompose(ExecContext& ctx,
    -                                                         ValU32Struct arg0,
    -                                                         Val arg1_0,
    -                                                         BoundLayout<AddrDecomposeLayout> layout2);
    -extern __device__ AddrDecomposeBitsStruct exec_AddrDecomposeBits(
    -    ExecContext& ctx, ValU32Struct arg0, Val arg1_0, BoundLayout<AddrDecomposeBitsLayout> layout2);
    -extern __device__ CmpEqualStruct exec_CmpEqual(ExecContext& ctx,
    -                                               ValU32Struct arg0,
    -                                               ValU32Struct arg1_0,
    -                                               BoundLayout<CmpEqualLayout> layout2);
    -extern __device__ CmpLessThanUnsignedStruct
    -exec_CmpLessThanUnsigned(ExecContext& ctx,
    -                         ValU32Struct arg0,
    -                         ValU32Struct arg1_0,
    -                         BoundLayout<CmpLessThanUnsignedLayout> layout2);
    -extern __device__ NondetRegStruct exec_GetSignU32(ExecContext& ctx,
    -                                                  ValU32Struct arg0,
    -                                                  BoundLayout<GetSignU32Layout> layout1);
    -extern __device__ CmpLessThanStruct exec_CmpLessThan(ExecContext& ctx,
    -                                                     ValU32Struct arg0,
    -                                                     ValU32Struct arg1_0,
    -                                                     BoundLayout<CmpLessThanLayout> layout2);
    -extern __device__ ToBits_16_Struct exec_ToBits_16_(ExecContext& ctx,
    -                                                   Val arg0,
    -                                                   BoundLayout<ToBits_16_Layout> layout1);
    -extern __device__ FromBits_16_Struct exec_BitwiseAndU16(ExecContext& ctx,
    -                                                        Val arg0,
    -                                                        Val arg1_0,
    -                                                        BoundLayout<BitwiseAndU16Layout> layout2);
    -extern __device__ ValU32Struct exec_BitwiseAnd(ExecContext& ctx,
    -                                               ValU32Struct arg0,
    -                                               ValU32Struct arg1_0,
    -                                               BoundLayout<BitwiseAndLayout> layout2);
    -extern __device__ ValU32Struct exec_BitwiseOr(ExecContext& ctx,
    -                                              ValU32Struct arg0,
    -                                              ValU32Struct arg1_0,
    -                                              BoundLayout<BitwiseOrLayout> layout2);
    -extern __device__ ValU32Struct exec_BitwiseXor(ExecContext& ctx,
    -                                               ValU32Struct arg0,
    -                                               ValU32Struct arg1_0,
    -                                               BoundLayout<BitwiseXorLayout> layout2);
    -extern __device__ DecoderStruct exec_Decoder(ExecContext& ctx,
    -                                             ValU32Struct arg0,
    -                                             BoundLayout<DecoderLayout> layout1);
    -extern __device__ MemoryArgStruct exec_MemoryArg(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 Val arg1_0,
    -                                                 Val arg2_0,
    -                                                 ValU32Struct arg3,
    -                                                 BoundLayout<MemoryArgLayout> layout4);
    -extern __device__ CycleArgStruct exec_CycleArg(ExecContext& ctx,
    -                                               Val arg0,
    -                                               Val arg1_0,
    -                                               BoundLayout<CycleArgLayout> layout2);
    -extern __device__ IsCycleStruct exec_IsCycle(ExecContext& ctx,
    -                                             Val arg0,
    -                                             BoundLayout<IsCycleLayout> layout1);
    -extern __device__ MemoryIOStruct exec_MemoryIO(ExecContext& ctx,
    -                                               Val arg0,
    -                                               Val arg1_0,
    -                                               BoundLayout<MemoryIOLayout> layout2);
    -extern __device__ IsForwardStruct exec_IsForward(ExecContext& ctx,
    -                                                 MemoryIOStruct arg0,
    -                                                 BoundLayout<IsForwardLayout> layout1);
    -extern __device__ GetDataStruct exec_MemoryRead(ExecContext& ctx,
    -                                                NondetRegStruct arg0,
    -                                                Val arg1_0,
    -                                                BoundLayout<MemoryReadLayout> layout2);
    -extern __device__ MemoryWriteStruct exec_MemoryWrite(ExecContext& ctx,
    -                                                     NondetRegStruct arg0,
    -                                                     Val arg1_0,
    -                                                     ValU32Struct arg2_0,
    -                                                     BoundLayout<MemoryWriteLayout> layout3);
    -extern __device__ MemoryWriteUnconstrainedStruct
    -exec_MemoryWriteUnconstrained(ExecContext& ctx,
    -                              NondetRegStruct arg0,
    -                              Val arg1_0,
    -                              BoundLayout<MemoryWriteUnconstrainedLayout> layout2);
    -extern __device__ GetDataStruct exec_MemoryPageIn(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  Val arg1_0,
    -                                                  BoundLayout<MemoryPageInLayout> layout2);
    -extern __device__ GetDataStruct exec_MemoryPageOut(ExecContext& ctx,
    -                                                   NondetRegStruct arg0,
    -                                                   Val arg1_0,
    -                                                   BoundLayout<MemoryPageOutLayout> layout2);
    -extern __device__ OneHot_3_Struct exec_OneHot_3_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_3_Layout> layout1);
    -extern __device__ GetDataStruct exec_MemoryGet(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               Val arg1_0,
    -                                               OneHot_3_Struct arg2_0,
    -                                               BoundLayout<MemoryGetLayout> layout3);
    -extern __device__ OneHot_8_Struct exec_OneHot_8_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_8_Layout> layout1);
    -extern __device__ InstInputStruct exec_InstInput(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 Val arg1_0,
    -                                                 ValU32Struct arg2_0,
    -                                                 Val arg3,
    -                                                 Val arg4,
    -                                                 BoundLayout<InstInputLayout> layout5);
    -extern __device__ DoCycleTableStruct exec_DoCycleTable(ExecContext& ctx,
    -                                                       NondetRegStruct arg0,
    -                                                       BoundLayout<DoCycleTableLayout> layout1);
    -extern __device__ DecoderStruct exec_DecodeInst(ExecContext& ctx,
    -                                                NondetRegStruct arg0,
    -                                                InstInputStruct arg1_0,
    -                                                BoundLayout<DecodeInstLayout> layout2);
    -extern __device__ GetDataStruct exec_ReadReg(ExecContext& ctx,
    -                                             NondetRegStruct arg0,
    -                                             InstInputStruct arg1_0,
    -                                             Val arg2_0,
    -                                             BoundLayout<ReadRegLayout> layout3);
    -extern __device__ WriteRdStruct exec_WriteRd(ExecContext& ctx,
    -                                             NondetRegStruct arg0,
    -                                             InstInputStruct arg1_0,
    -                                             DecoderStruct arg2_0,
    -                                             Val arg3,
    -                                             ValU32Struct arg4,
    -                                             BoundLayout<WriteRdLayout> layout5);
    -extern __device__ ExpandU32Struct exec_ExpandU32(ExecContext& ctx,
    -                                                 ValU32Struct arg0,
    -                                                 Val arg1_0,
    -                                                 BoundLayout<ExpandU32Layout> layout2);
    -extern __device__ SplitTotalStruct exec_SplitTotal(ExecContext& ctx,
    -                                                   Val arg0,
    -                                                   BoundLayout<SplitTotalLayout> layout1);
    -extern __device__ MultiplyAccumulateStruct
    -exec_MultiplyAccumulate(ExecContext& ctx,
    -                        ValU32Struct arg0,
    -                        ValU32Struct arg1_0,
    -                        ValU32Struct arg2_0,
    -                        MultiplySettingsStruct arg3,
    -                        BoundLayout<MultiplyAccumulateLayout> layout4);
    -extern __device__ DivInputStruct exec_DivInput(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               InstInputStruct arg1_0,
    -                                               BoundLayout<DivInputLayout> layout2);
    -extern __device__ DivideReturnStruct exec_DoDiv(ExecContext& ctx,
    -                                                ValU32Struct arg0,
    -                                                ValU32Struct arg1_0,
    -                                                Val arg2_0,
    -                                                Val arg3,
    -                                                BoundLayout<DoDivLayout> layout4);
    -extern __device__ ValU32Struct exec_OpSRL(ExecContext& ctx,
    -                                          DivInputStruct arg0,
    -                                          BoundLayout<OpSRLLayout> layout1);
    -extern __device__ NondetRegStruct exec_TopBit(ExecContext& ctx,
    -                                              ValU32Struct arg0,
    -                                              BoundLayout<TopBitLayout> layout1);
    -extern __device__ ValU32Struct exec_OpSRA(ExecContext& ctx,
    -                                          DivInputStruct arg0,
    -                                          BoundLayout<OpSRALayout> layout1);
    -extern __device__ ValU32Struct exec_OpSRLI(ExecContext& ctx,
    -                                           DivInputStruct arg0,
    -                                           BoundLayout<OpSRLILayout> layout1);
    -extern __device__ ValU32Struct exec_OpSRAI(ExecContext& ctx,
    -                                           DivInputStruct arg0,
    -                                           BoundLayout<OpSRAILayout> layout1);
    -extern __device__ ValU32Struct exec_OpDIV(ExecContext& ctx,
    -                                          DivInputStruct arg0,
    -                                          BoundLayout<OpDIVLayout> layout1);
    -extern __device__ ValU32Struct exec_OpDIVU(ExecContext& ctx,
    -                                           DivInputStruct arg0,
    -                                           BoundLayout<OpDIVULayout> layout1);
    -extern __device__ ValU32Struct exec_OpREM(ExecContext& ctx,
    -                                          DivInputStruct arg0,
    -                                          BoundLayout<OpREMLayout> layout1);
    -extern __device__ ValU32Struct exec_OpREMU(ExecContext& ctx,
    -                                           DivInputStruct arg0,
    -                                           BoundLayout<OpREMULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Div0(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Div0Layout> layout2);
    -extern __device__ MiscInputStruct exec_MiscInput(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<MiscInputLayout> layout2);
    -extern __device__ InstOutputBaseStruct exec_FinalizeMisc(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         MiscInputStruct arg1_0,
    -                                                         MiscOutputStruct arg2_0,
    -                                                         BoundLayout<FinalizeMiscLayout> layout3);
    -extern __device__ MiscOutputStruct exec_OpXOR(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpXORLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpOR(ExecContext& ctx,
    -                                             MiscInputStruct arg0,
    -                                             BoundLayout<OpORLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpAND(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpANDLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpSLT(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpSLTLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpSLTU(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpSLTULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Misc0(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  InstInputStruct arg1_0,
    -                                                  BoundLayout<Misc0Layout> layout2);
    -extern __device__ MiscOutputStruct exec_OpXORI(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpXORILayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpORI(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpORILayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpANDI(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpANDILayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpSLTI(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpSLTILayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpSLTIU(ExecContext& ctx,
    -                                                MiscInputStruct arg0,
    -                                                BoundLayout<OpSLTIULayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBEQ(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpBEQLayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBNE(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpBNELayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBLT(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpBLTLayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Misc1(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  InstInputStruct arg1_0,
    -                                                  BoundLayout<Misc1Layout> layout2);
    -extern __device__ MiscOutputStruct exec_OpBGE(ExecContext& ctx,
    -                                              MiscInputStruct arg0,
    -                                              BoundLayout<OpBGELayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBLTU(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpBLTULayout> layout1);
    -extern __device__ MiscOutputStruct exec_OpBGEU(ExecContext& ctx,
    -                                               MiscInputStruct arg0,
    -                                               BoundLayout<OpBGEULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Misc2(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  InstInputStruct arg1_0,
    -                                                  BoundLayout<Misc2Layout> layout2);
    -extern __device__ MulInputStruct exec_MulInput(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               InstInputStruct arg1_0,
    -                                               BoundLayout<MulInputLayout> layout2);
    -extern __device__ DoMulStruct exec_DoMul(ExecContext& ctx,
    -                                         ValU32Struct arg0,
    -                                         ValU32Struct arg1_0,
    -                                         Val arg2_0,
    -                                         Val arg3,
    -                                         BoundLayout<DoMulLayout> layout4);
    -extern __device__ ValU32Struct exec_OpSLL(ExecContext& ctx,
    -                                          MulInputStruct arg0,
    -                                          BoundLayout<OpSLLLayout> layout1);
    -extern __device__ ValU32Struct exec_OpSLLI(ExecContext& ctx,
    -                                           MulInputStruct arg0,
    -                                           BoundLayout<OpSLLILayout> layout1);
    -extern __device__ ValU32Struct exec_OpMUL(ExecContext& ctx,
    -                                          MulInputStruct arg0,
    -                                          BoundLayout<OpMULLayout> layout1);
    -extern __device__ ValU32Struct exec_OpMULH(ExecContext& ctx,
    -                                           MulInputStruct arg0,
    -                                           BoundLayout<OpMULHLayout> layout1);
    -extern __device__ ValU32Struct exec_OpMULHSU(ExecContext& ctx,
    -                                             MulInputStruct arg0,
    -                                             BoundLayout<OpMULHSULayout> layout1);
    -extern __device__ ValU32Struct exec_OpMULHU(ExecContext& ctx,
    -                                            MulInputStruct arg0,
    -                                            BoundLayout<OpMULHULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Mul0(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Mul0Layout> layout2);
    -extern __device__ MemLoadInputStruct exec_MemLoadInput(ExecContext& ctx,
    -                                                       NondetRegStruct arg0,
    -                                                       InstInputStruct arg1_0,
    -                                                       BoundLayout<MemLoadInputLayout> layout2);
    -extern __device__ MemStoreInputStruct exec_MemStoreInput(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         InstInputStruct arg1_0,
    -                                                         BoundLayout<MemStoreInputLayout> layout2);
    -extern __device__ MemStoreFinalizeStruct
    -exec_MemStoreFinalize(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      MemStoreInputStruct arg1_0,
    -                      ValU32Struct arg2_0,
    -                      BoundLayout<MemStoreFinalizeLayout> layout3);
    -extern __device__ SplitWordStruct exec_SplitWord(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<SplitWordLayout> layout1);
    -extern __device__ ValU32Struct exec_OpLB(ExecContext& ctx,
    -                                         MemLoadInputStruct arg0,
    -                                         BoundLayout<OpLBLayout> layout1);
    -extern __device__ ValU32Struct exec_OpLH(ExecContext& ctx,
    -                                         MemLoadInputStruct arg0,
    -                                         BoundLayout<OpLHLayout> layout1);
    -extern __device__ ValU32Struct exec_OpLBU(ExecContext& ctx,
    -                                          MemLoadInputStruct arg0,
    -                                          BoundLayout<OpLBULayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Mem0(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Mem0Layout> layout2);
    -extern __device__ ValU32Struct exec_OpSB(ExecContext& ctx,
    -                                         MemStoreInputStruct arg0,
    -                                         BoundLayout<OpSBLayout> layout1);
    -extern __device__ InstOutputBaseStruct exec_Mem1(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Mem1Layout> layout2);
    -extern __device__ DigestRegStruct back_DigestReg(ExecContext& ctx,
    -                                                 Index distance0,
    -                                                 BoundLayout<DigestRegLayout> layout1);
    -extern __device__ DigestRegStruct exec_DigestReg(ExecContext& ctx,
    -                                                 ValU32Struct8Array arg0,
    -                                                 BoundLayout<DigestRegLayout> layout1);
    -extern __device__ InstOutputBaseStruct
    -exec_ControlLoadRoot(ExecContext& ctx,
    -                     NondetRegStruct arg0,
    -                     InstInputStruct arg1_0,
    -                     BoundLayout<ControlLoadRootLayout> layout2,
    -                     GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct exec_ControlResume(ExecContext& ctx,
    -                                                          NondetRegStruct arg0,
    -                                                          InstInputStruct arg1_0,
    -                                                          BoundLayout<ControlResumeLayout> layout2,
    -                                                          GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct
    -exec_ControlUserECALL(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      InstInputStruct arg1_0,
    -                      BoundLayout<ControlUserECALLLayout> layout2);
    -extern __device__ InstOutputBaseStruct exec_ControlMRET(ExecContext& ctx,
    -                                                        NondetRegStruct arg0,
    -                                                        InstInputStruct arg1_0,
    -                                                        BoundLayout<ControlMRETLayout> layout2);
    -extern __device__ InstOutputBaseStruct
    -exec_ControlSuspend(ExecContext& ctx,
    -                    NondetRegStruct arg0,
    -                    InstInputStruct arg1_0,
    -                    BoundLayout<ControlSuspendLayout> layout2,
    -                    GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct
    -exec_ControlStoreRoot(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      InstInputStruct arg1_0,
    -                      BoundLayout<ControlStoreRootLayout> layout2,
    -                      GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct exec_ControlTable(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         InstInputStruct arg1_0,
    -                                                         BoundLayout<ControlTableLayout> layout2);
    -extern __device__ InstOutputBaseStruct exec_ControlDone(ExecContext& ctx,
    -                                                        NondetRegStruct arg0,
    -                                                        InstInputStruct arg1_0,
    -                                                        BoundLayout<ControlDoneLayout> layout2,
    -                                                        GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct exec_Control0(ExecContext& ctx,
    -                                                     NondetRegStruct arg0,
    -                                                     InstInputStruct arg1_0,
    -                                                     BoundLayout<Control0Layout> layout2,
    -                                                     GlobalBuf global3);
    -extern __device__ OneHot_6_Struct exec_OneHot_6_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_6_Layout> layout1);
    -extern __device__ ECallOutputStruct exec_MachineECall(ExecContext& ctx,
    -                                                      NondetRegStruct arg0,
    -                                                      InstInputStruct arg1_0,
    -                                                      Val arg2_0,
    -                                                      BoundLayout<MachineECallLayout> layout3);
    -extern __device__ ECallOutputStruct exec_ECallTerminate(ExecContext& ctx,
    -                                                        NondetRegStruct arg0,
    -                                                        InstInputStruct arg1_0,
    -                                                        BoundLayout<ECallTerminateLayout> layout2,
    -                                                        GlobalBuf global3);
    -extern __device__ OneHot_4_Struct exec_OneHot_4_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_4_Layout> layout1);
    -extern __device__ DecomposeLow2Struct exec_DecomposeLow2(ExecContext& ctx,
    -                                                         Val arg0,
    -                                                         BoundLayout<DecomposeLow2Layout> layout1);
    -extern __device__ ECallOutputStruct
    -exec_ECallHostReadSetup(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        InstInputStruct arg1_0,
    -                        BoundLayout<ECallHostReadSetupLayout> layout2);
    -extern __device__ ECallOutputStruct exec_ECallHostWrite(ExecContext& ctx,
    -                                                        NondetRegStruct arg0,
    -                                                        InstInputStruct arg1_0,
    -                                                        BoundLayout<ECallHostWriteLayout> layout2);
    -extern __device__ ECallOutputStruct
    -exec_ECallHostReadBytes(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        InstInputStruct arg1_0,
    -                        Val arg2_0,
    -                        Val arg3,
    -                        Val arg4,
    -                        BoundLayout<ECallHostReadBytesLayout> layout5);
    -extern __device__ ECallOutputStruct
    -exec_ECallHostReadWords(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        InstInputStruct arg1_0,
    -                        Val arg2_0,
    -                        Val arg3,
    -                        BoundLayout<ECallHostReadWordsLayout> layout4);
    -extern __device__ InstOutputBaseStruct exec_ECall0(ExecContext& ctx,
    -                                                   NondetRegStruct arg0,
    -                                                   InstInputStruct arg1_0,
    -                                                   BoundLayout<ECall0Layout> layout2,
    -                                                   GlobalBuf global3);
    -extern __device__ NondetRegStruct exec_SBox(ExecContext& ctx,
    -                                            Val arg0,
    -                                            BoundLayout<SBoxLayout> layout1);
    -extern __device__ MultiplyByMIntStruct exec_DoIntRound(ExecContext& ctx,
    -                                                       Val24Array arg0,
    -                                                       Val arg1_0,
    -                                                       BoundLayout<DoIntRoundLayout> layout2);
    -extern __device__ DoIntRoundsStruct exec_DoIntRounds(ExecContext& ctx,
    -                                                     Val24Array arg0,
    -                                                     BoundLayout<DoIntRoundsLayout> layout1);
    -extern __device__ MultiplyByMExtStruct exec_DoExtRound(ExecContext& ctx,
    -                                                       Val24Array arg0,
    -                                                       Val24Array arg1_0,
    -                                                       BoundLayout<DoExtRoundLayout> layout2);
    -extern __device__ MultiplyByMExtStruct exec_DoExtRoundByIdx(
    -    ExecContext& ctx, Val24Array arg0, Val arg1_0, BoundLayout<DoExtRoundByIdxLayout> layout2);
    -extern __device__ PoseidonStateStruct back_PoseidonState(ExecContext& ctx,
    -                                                         Index distance0,
    -                                                         BoundLayout<PoseidonStateLayout> layout1);
    -extern __device__ PoseidonStateStruct exec_PoseidonState(ExecContext& ctx,
    -                                                         PoseidonOpDefStruct arg0,
    -                                                         Val arg1_0,
    -                                                         Val arg2_0,
    -                                                         Val arg3,
    -                                                         Val arg4,
    -                                                         Val arg5,
    -                                                         Val24Array arg6,
    -                                                         ExtVal arg7,
    -                                                         BoundLayout<PoseidonStateLayout> layout8);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonInvalid(ExecContext& ctx, BoundLayout<PoseidonStateLayout> layout0);
    -extern __device__ ReadAddrStruct exec_ReadAddr(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               Val arg1_0,
    -                                               BoundLayout<ReadAddrLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonEcall(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         Val arg1_0,
    -                                                         BoundLayout<PoseidonEcallLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingEntry(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonEntry(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         ValU32Struct arg1_0,
    -                                                         Val arg2_0,
    -                                                         BoundLayout<PoseidonEntryLayout> layout3);
    -extern __device__ ReadElemStruct exec_ReadElem(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               Val arg1_0,
    -                                               BoundLayout<ReadElemLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonLoadState(ExecContext& ctx,
    -                       NondetRegStruct arg0,
    -                       PoseidonStateStruct arg1_0,
    -                       BoundLayout<PoseidonLoadStateLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonLoadInShort(ExecContext& ctx,
    -                         NondetRegStruct arg0,
    -                         PoseidonStateStruct arg1_0,
    -                         BoundLayout<PoseidonLoadInShortLayout> layout2,
    -                         GlobalBuf global3);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonLoadInLow(ExecContext& ctx,
    -                       NondetRegStruct arg0,
    -                       PoseidonStateStruct arg1_0,
    -                       BoundLayout<PoseidonLoadInLowLayout> layout2,
    -                       GlobalBuf global3);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonLoadInHigh(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        PoseidonStateStruct arg1_0,
    -                        BoundLayout<PoseidonLoadInHighLayout> layout2,
    -                        GlobalBuf global3);
    -extern __device__ PoseidonStateStruct exec_PoseidonLoadIn(ExecContext& ctx,
    -                                                          NondetRegStruct arg0,
    -                                                          PoseidonStateStruct arg1_0,
    -                                                          BoundLayout<PoseidonLoadInLayout> layout2,
    -                                                          GlobalBuf global3);
    -extern __device__ PoseidonStateStruct exec_PoseidonExtRound(
    -    ExecContext& ctx, PoseidonStateStruct arg0, BoundLayout<PoseidonExtRoundLayout> layout1);
    -extern __device__ PoseidonStateStruct exec_PoseidonIntRounds(
    -    ExecContext& ctx, PoseidonStateStruct arg0, BoundLayout<PoseidonIntRoundsLayout> layout1);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonCheckOut(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      PoseidonStateStruct arg1_0,
    -                      BoundLayout<PoseidonCheckOutLayout> layout2);
    -extern __device__ FieldToWordStruct exec_FieldToWord(ExecContext& ctx,
    -                                                     Val arg0,
    -                                                     BoundLayout<FieldToWordLayout> layout1);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonStoreOut(ExecContext& ctx,
    -                      NondetRegStruct arg0,
    -                      PoseidonStateStruct arg1_0,
    -                      BoundLayout<PoseidonStoreOutLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonDoOut(ExecContext& ctx,
    -                                                         NondetRegStruct arg0,
    -                                                         PoseidonStateStruct arg1_0,
    -                                                         BoundLayout<PoseidonDoOutLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonStoreState(ExecContext& ctx,
    -                        NondetRegStruct arg0,
    -                        PoseidonStateStruct arg1_0,
    -                        BoundLayout<PoseidonStoreStateLayout> layout2);
    -extern __device__ IsU24Struct exec_IsU24(ExecContext& ctx,
    -                                         Val arg0,
    -                                         BoundLayout<IsU24Layout> layout1);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingLoadNode(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingLoadPage(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonPagingLoadDone(ExecContext& ctx, BoundLayout<PoseidonStateLayout> layout0);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingStoreNode(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct exec_PoseidonPagingStorePage(
    -    ExecContext& ctx, NondetRegStruct arg0, Val arg1_0, BoundLayout<PoseidonStateLayout> layout2);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonPagingStoreDone(ExecContext& ctx, BoundLayout<PoseidonStateLayout> layout0);
    -extern __device__ PoseidonStateStruct
    -exec_PoseidonPaging(ExecContext& ctx,
    -                    NondetRegStruct arg0,
    -                    Val arg1_0,
    -                    PoseidonStateStruct arg2_0,
    -                    BoundLayout<PoseidonPagingLayout> layout3);
    -extern __device__ InstOutputBaseStruct exec_Poseidon0(ExecContext& ctx,
    -                                                      NondetRegStruct arg0,
    -                                                      InstInputStruct arg1_0,
    -                                                      BoundLayout<Poseidon0Layout> layout2,
    -                                                      GlobalBuf global3);
    -extern __device__ InstOutputBaseStruct exec_Poseidon1(ExecContext& ctx,
    -                                                      NondetRegStruct arg0,
    -                                                      InstInputStruct arg1_0,
    -                                                      BoundLayout<Poseidon1Layout> layout2);
    -extern __device__ CarryExtractStruct exec_CarryExtract(ExecContext& ctx,
    -                                                       Val arg0,
    -                                                       BoundLayout<CarryExtractLayout> layout1);
    -extern __device__ UnpackReg_32__16_Struct exec_UnpackReg_32__16_(
    -    ExecContext& ctx, Val2Array arg0, BoundLayout<UnpackReg_32__16_Layout> layout1);
    -extern __device__ UnpackReg_32__16_Struct
    -exec_CarryAndExpand(ExecContext& ctx, Val2Array arg0, BoundLayout<CarryAndExpandLayout> layout1);
    -extern __device__ ShaStateStruct back_ShaState(ExecContext& ctx,
    -                                               Index distance0,
    -                                               BoundLayout<ShaStateLayout> layout1);
    -extern __device__ ShaStateStruct exec_ShaState(ExecContext& ctx,
    -                                               Val32Array arg0,
    -                                               Val32Array arg1_0,
    -                                               Val32Array arg2_0,
    -                                               Val arg3,
    -                                               Val arg4,
    -                                               Val arg5,
    -                                               Val arg6,
    -                                               Val arg7,
    -                                               Val arg8,
    -                                               Val arg9,
    -                                               BoundLayout<ShaStateLayout> layout10);
    -extern __device__ ShaStateStruct exec_ShaInvalid(ExecContext& ctx,
    -                                                 BoundLayout<ShaStateLayout> layout0);
    -extern __device__ ShaStateStruct exec_ShaEcall(ExecContext& ctx,
    -                                               NondetRegStruct arg0,
    -                                               BoundLayout<ShaEcallLayout> layout1);
    -extern __device__ ShaStateStruct exec_ShaLoadState(ExecContext& ctx,
    -                                                   NondetRegStruct arg0,
    -                                                   ShaStateStruct arg1_0,
    -                                                   BoundLayout<ShaLoadStateLayout> layout2);
    -extern __device__ ShaStateStruct exec_ShaLoadData(ExecContext& ctx,
    -                                                  NondetRegStruct arg0,
    -                                                  ShaStateStruct arg1_0,
    -                                                  ShaStateStruct arg2_0,
    -                                                  ShaStateStruct arg3,
    -                                                  ShaStateStruct arg4,
    -                                                  BoundLayout<ShaLoadDataLayout> layout5);
    -extern __device__ ShaStateStruct exec_ShaMix(ExecContext& ctx,
    -                                             NondetRegStruct arg0,
    -                                             ShaStateStruct arg1_0,
    -                                             ShaStateStruct arg2_0,
    -                                             ShaStateStruct arg3,
    -                                             ShaStateStruct arg4,
    -                                             ShaStateStruct arg5,
    -                                             ShaStateStruct arg6,
    -                                             ShaStateStruct arg7,
    -                                             BoundLayout<ShaMixLayout> layout8);
    -extern __device__ ShaStateStruct exec_ShaStoreState(ExecContext& ctx,
    -                                                    NondetRegStruct arg0,
    -                                                    ShaStateStruct arg1_0,
    -                                                    ShaStateStruct arg2_0,
    -                                                    ShaStateStruct arg3,
    -                                                    BoundLayout<ShaStoreStateLayout> layout4);
    -extern __device__ InstOutputBaseStruct exec_Sha0(ExecContext& ctx,
    -                                                 NondetRegStruct arg0,
    -                                                 InstInputStruct arg1_0,
    -                                                 BoundLayout<Sha0Layout> layout2);
    -extern __device__ BigIntStateStruct back_BigIntState(ExecContext& ctx,
    -                                                     Index distance0,
    -                                                     BoundLayout<BigIntStateLayout> layout1);
    -extern __device__ BigIntStateStruct exec_BigIntState(ExecContext& ctx,
    -                                                     Val arg0,
    -                                                     Val arg1_0,
    -                                                     Val arg2_0,
    -                                                     Val arg3,
    -                                                     Val arg4,
    -                                                     Val16Array arg5,
    -                                                     Val arg6,
    -                                                     BoundLayout<BigIntStateLayout> layout7);
    -extern __device__ BigIntStateStruct exec_BigIntInvalid(ExecContext& ctx,
    -                                                       BoundLayout<BigIntStateLayout> layout0);
    -extern __device__ BigIntStateStruct exec_BigIntEcall(ExecContext& ctx,
    -                                                     NondetRegStruct arg0,
    -                                                     BoundLayout<BigIntEcallLayout> layout1);
    -extern __device__ SplitU32Struct exec_SplitU32(ExecContext& ctx,
    -                                               ValU32Struct arg0,
    -                                               BoundLayout<SplitU32Layout> layout1);
    -extern __device__ AddrDecomposeBitsStruct exec_BigIntAddr(ExecContext& ctx,
    -                                                          ValU32Struct arg0,
    -                                                          Val arg1_0,
    -                                                          BoundLayout<BigIntAddrLayout> layout2);
    -extern __device__ BigIntReadStruct exec_BigIntRead(ExecContext& ctx,
    -                                                   NondetRegStruct arg0,
    -                                                   ValU32Struct arg1_0,
    -                                                   Val arg2_0,
    -                                                   BoundLayout<BigIntReadLayout> layout3);
    -extern __device__ BigIntWitnessStruct exec_BigIntWitness(ExecContext& ctx,
    -                                                         Val16Array arg0,
    -                                                         BoundLayout<BigIntWitnessLayout> layout1);
    -extern __device__ BigIntWitnessStruct exec_BigIntWrite(ExecContext& ctx,
    -                                                       NondetRegStruct arg0,
    -                                                       ValU32Struct arg1_0,
    -                                                       Val arg2_0,
    -                                                       BoundLayout<BigIntWriteLayout> layout3);
    -extern __device__ BigIntWitnessStruct exec_BigIntCheck(ExecContext& ctx,
    -                                                       BoundLayout<BigIntWitnessLayout> layout0);
    -extern __device__ BigIntStateStruct exec_BigIntStep(ExecContext& ctx,
    -                                                    NondetRegStruct arg0,
    -                                                    BigIntStateStruct arg1_0,
    -                                                    BoundLayout<BigIntStepLayout> layout2);
    -extern __device__ InstOutputBaseStruct exec_BigInt0(ExecContext& ctx,
    -                                                    NondetRegStruct arg0,
    -                                                    InstInputStruct arg1_0,
    -                                                    BoundLayout<BigInt0Layout> layout2);
    -extern __device__ BigIntAccumStateStruct back_BigIntAccumState(
    -    ExecContext& ctx, Index distance0, BoundLayout<BigIntAccumStateLayout> layout1);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntAccumState(ExecContext& ctx,
    -                      ExtVal arg0,
    -                      ExtVal arg1_0,
    -                      ExtVal arg2_0,
    -                      BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ OneHot_7_Struct exec_OneHot_7_(ExecContext& ctx,
    -                                                 Val arg0,
    -                                                 BoundLayout<OneHot_7_Layout> layout1);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpNop(ExecContext& ctx, BoundLayout<BigIntAccumStateLayout> layout0);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpShift(ExecContext& ctx,
    -                       BigIntTopStateStruct arg0,
    -                       BigIntAccumStateStruct arg1_0,
    -                       ExtVal arg2_0,
    -                       BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpSetTerm(ExecContext& ctx,
    -                         BigIntTopStateStruct arg0,
    -                         BigIntAccumStateStruct arg1_0,
    -                         ExtVal arg2_0,
    -                         BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpAddTotal(ExecContext& ctx,
    -                          BigIntTopStateStruct arg0,
    -                          BigIntAccumStateStruct arg1_0,
    -                          ExtVal arg2_0,
    -                          BoundLayout<BigIntPolyOpAddTotalLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpCarry1(ExecContext& ctx,
    -                        BigIntTopStateStruct arg0,
    -                        BigIntAccumStateStruct arg1_0,
    -                        ExtVal arg2_0,
    -                        BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpCarry2(ExecContext& ctx,
    -                        BigIntTopStateStruct arg0,
    -                        BigIntAccumStateStruct arg1_0,
    -                        ExtVal arg2_0,
    -                        BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStateStruct
    -exec_BigIntPolyOpEqz(ExecContext& ctx,
    -                     BigIntTopStateStruct arg0,
    -                     BigIntAccumStateStruct arg1_0,
    -                     ExtVal arg2_0,
    -                     BoundLayout<BigIntAccumStateLayout> layout3);
    -extern __device__ BigIntAccumStruct exec_BigIntAccum(ExecContext& ctx,
    -                                                     BigIntTopStateStruct arg0,
    -                                                     ExtVal1Array arg1_0,
    -                                                     BoundLayout<BigIntAccumLayout> layout2);
    -extern __device__ OneHot_13_Struct exec_OneHot_13_(ExecContext& ctx,
    -                                                   Val arg0,
    -                                                   BoundLayout<OneHot_13_Layout> layout1);
    -extern __device__ TopStruct exec_Top(ExecContext& ctx,
    -                                     BoundLayout<TopLayout> layout0,
    -                                     GlobalBuf global1);
    -extern __device__ void step_Top(ExecContext& ctx, MutableBuf data0, GlobalBuf global1);
    -extern __device__ AccumStruct exec_Accum(ExecContext& ctx,
    -                                         BigIntTopStateStruct arg0,
    -                                         ExtVal1Array arg1_0,
    -                                         BoundLayout<AccumLayout> layout2);
    -extern __device__ BigIntTopStateStruct exec_TopExtract(ExecContext& ctx,
    -                                                       BoundLayout<TopLayout> arg0,
    -                                                       GlobalBuf global1);
    -extern __device__ AccumStruct execUser_Accum(ExecContext& ctx,
    -                                             BoundLayout<TopLayout> arg0,
    -                                             ExtVal1Array arg1_0,
    -                                             BoundLayout<AccumLayout> layout2,
    -                                             GlobalBuf global3);
    -extern __device__ ComponentStruct exec_TopAccum(ExecContext& ctx,
    -                                                BoundLayout<TopLayout> arg0,
    -                                                BoundLayout<LayoutAccumLayout> layout1,
    -                                                GlobalBuf global2,
    -                                                GlobalBuf mix3);
    -extern __device__ void step_TopAccum(
    -    ExecContext& ctx, MutableBuf accum0, MutableBuf data1, GlobalBuf global2, GlobalBuf mix3);
    +extern __device__ NondetRegStruct back_NondetReg(ExecContext& ctx,Index distance0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_NondetReg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetExtRegStruct back_NondetExtReg(ExecContext& ctx,Index distance0, BoundLayout<NondetExtRegLayout> layout1)  ;
    +extern __device__ NondetExtRegStruct exec_NondetExtReg(ExecContext& ctx,ExtVal arg0, BoundLayout<NondetExtRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct back_Reg(ExecContext& ctx,Index distance0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetExtRegStruct back_ExtReg(ExecContext& ctx,Index distance0, BoundLayout<NondetExtRegLayout> layout1)  ;
    +extern __device__ NondetExtRegStruct exec_ExtReg(ExecContext& ctx,ExtVal arg0, BoundLayout<NondetExtRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct back_NondetBitReg(ExecContext& ctx,Index distance0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_NondetBitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct back_BitReg(ExecContext& ctx,Index distance0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_BitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_NondetTwitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetRegLayout> layout1)  ;
    +extern __device__ NondetFakeTwitRegStruct exec_NondetFakeTwitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetFakeTwitRegLayout> layout1)  ;
    +extern __device__ FakeTwitRegStruct exec_FakeTwitReg(ExecContext& ctx,Val arg0, BoundLayout<NondetFakeTwitRegLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_IsZero(ExecContext& ctx,Val arg0, BoundLayout<IsZeroLayout> layout1)  ;
    +extern __device__ ArgU8Struct exec_ArgU8(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<ArgU8Layout> layout2)  ;
    +extern __device__ NondetRegStruct exec_NondetU8Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetU8RegLayout> layout1)  ;
    +extern __device__ U8RegStruct exec_U8Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetU8RegLayout> layout1)  ;
    +extern __device__ ArgU16Struct exec_ArgU16(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<ArgU16Layout> layout2)  ;
    +extern __device__ NondetU16RegStruct exec_NondetU16Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetU16RegLayout> layout1)  ;
    +extern __device__ NondetU16RegStruct exec_U16Reg(ExecContext& ctx,Val arg0, BoundLayout<NondetU16RegLayout> layout1)  ;
    +extern __device__ ToBits_5_Struct exec_ToBits_5_(ExecContext& ctx,Val arg0, BoundLayout<ToBits_5_Layout> layout1)  ;
    +extern __device__ ValU32Struct exec_DynPo2(ExecContext& ctx,Val arg0, BoundLayout<DynPo2Layout> layout1)  ;
    +extern __device__ NormalizeU32Struct exec_NormalizeU32(ExecContext& ctx,DenormedValU32Struct arg0, BoundLayout<NormalizeU32Layout> layout1)  ;
    +extern __device__ AddrDecomposeStruct exec_AddrDecompose(ExecContext& ctx,ValU32Struct arg0, Val arg1_0, BoundLayout<AddrDecomposeLayout> layout2)  ;
    +extern __device__ AddrDecomposeBitsStruct exec_AddrDecomposeBits(ExecContext& ctx,ValU32Struct arg0, Val arg1_0, BoundLayout<AddrDecomposeBitsLayout> layout2)  ;
    +extern __device__ CmpEqualStruct exec_CmpEqual(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<CmpEqualLayout> layout2)  ;
    +extern __device__ CmpLessThanUnsignedStruct exec_CmpLessThanUnsigned(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<CmpLessThanUnsignedLayout> layout2)  ;
    +extern __device__ NondetRegStruct exec_GetSignU32(ExecContext& ctx,ValU32Struct arg0, BoundLayout<GetSignU32Layout> layout1)  ;
    +extern __device__ CmpLessThanStruct exec_CmpLessThan(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<CmpLessThanLayout> layout2)  ;
    +extern __device__ ToBits_16_Struct exec_ToBits_16_(ExecContext& ctx,Val arg0, BoundLayout<ToBits_16_Layout> layout1)  ;
    +extern __device__ FromBits_16_Struct exec_BitwiseAndU16(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<BitwiseAndU16Layout> layout2)  ;
    +extern __device__ ValU32Struct exec_BitwiseAnd(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<BitwiseAndLayout> layout2)  ;
    +extern __device__ ValU32Struct exec_BitwiseOr(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<BitwiseOrLayout> layout2)  ;
    +extern __device__ ValU32Struct exec_BitwiseXor(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, BoundLayout<BitwiseXorLayout> layout2)  ;
    +extern __device__ DecoderStruct exec_Decoder(ExecContext& ctx,ValU32Struct arg0, BoundLayout<DecoderLayout> layout1)  ;
    +extern __device__ MemoryArgStruct exec_MemoryArg(ExecContext& ctx,Val arg0, Val arg1_0, Val arg2_0, ValU32Struct arg3, BoundLayout<MemoryArgLayout> layout4)  ;
    +extern __device__ CycleArgStruct exec_CycleArg(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<CycleArgLayout> layout2)  ;
    +extern __device__ IsCycleStruct exec_IsCycle(ExecContext& ctx,Val arg0, BoundLayout<IsCycleLayout> layout1)  ;
    +extern __device__ MemoryIOStruct exec_MemoryIO(ExecContext& ctx,Val arg0, Val arg1_0, BoundLayout<MemoryIOLayout> layout2)  ;
    +extern __device__ IsForwardStruct exec_IsForward(ExecContext& ctx,MemoryIOStruct arg0, BoundLayout<IsForwardLayout> layout1)  ;
    +extern __device__ GetDataStruct exec_MemoryRead(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, BoundLayout<MemoryReadLayout> layout2)  ;
    +extern __device__ MemoryWriteStruct exec_MemoryWrite(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, ValU32Struct arg2_0, BoundLayout<MemoryWriteLayout> layout3)  ;
    +extern __device__ MemoryWriteUnconstrainedStruct exec_MemoryWriteUnconstrained(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, BoundLayout<MemoryWriteUnconstrainedLayout> layout2)  ;
    +extern __device__ GetDataStruct exec_MemoryPageIn(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, BoundLayout<MemoryPageInLayout> layout2)  ;
    +extern __device__ GetDataStruct exec_MemoryPageOut(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, BoundLayout<MemoryPageOutLayout> layout2)  ;
    +extern __device__ OneHot_3_Struct exec_OneHot_3_(ExecContext& ctx,Val arg0, BoundLayout<OneHot_3_Layout> layout1)  ;
    +extern __device__ GetDataStruct exec_MemoryGet(ExecContext& ctx,NondetRegStruct arg0, Val arg1_0, OneHot_3_Struct arg2_0, BoundLayout<MemoryGetLayout> layout3)  ;
    +extern __device__ OneHot_8_Struct exec_OneHot_8_(ExecContext& ctx,Val arg0, BoundLayout<OneHot_8_Layout> layout1)  ;
    +extern __device__ InstInputStruct exec_InstInput(ExecContext& ctx,Val arg0, Val arg1_0, ValU32Struct arg2_0, Val arg3, Val arg4, BoundLayout<InstInputLayout> layout5)  ;
    +extern __device__ DoCycleTableStruct exec_DoCycleTable(ExecContext& ctx,NondetRegStruct arg0, BoundLayout<DoCycleTableLayout> layout1)  ;
    +extern __device__ DecoderStruct exec_DecodeInst(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, BoundLayout<DecodeInstLayout> layout2)  ;
    +extern __device__ GetDataStruct exec_ReadReg(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, Val arg2_0, BoundLayout<ReadRegLayout> layout3)  ;
    +extern __device__ ReadSourceRegsStruct exec_ReadSourceRegs(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, DecoderStruct arg2_0, BoundLayout<ReadSourceRegsLayout> layout3)  ;
    +extern __device__ WriteRdStruct exec_WriteRd(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, DecoderStruct arg2_0, Val arg3, ValU32Struct arg4, BoundLayout<WriteRdLayout> layout5)  ;
    +extern __device__ ExpandU32Struct exec_ExpandU32(ExecContext& ctx,ValU32Struct arg0, Val arg1_0, BoundLayout<ExpandU32Layout> layout2)  ;
    +extern __device__ SplitTotalStruct exec_SplitTotal(ExecContext& ctx,Val arg0, BoundLayout<SplitTotalLayout> layout1)  ;
    +extern __device__ MultiplyAccumulateStruct exec_MultiplyAccumulate(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, ValU32Struct arg2_0, MultiplySettingsStruct arg3, BoundLayout<MultiplyAccumulateLayout> layout4)  ;
    +extern __device__ DivInputStruct exec_DivInput(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, BoundLayout<DivInputLayout> layout2)  ;
    +extern __device__ DivideReturnStruct exec_DoDiv(ExecContext& ctx,ValU32Struct arg0, ValU32Struct arg1_0, Val arg2_0, Val arg3, BoundLayout<DoDivLayout> layout4)  ;
    +extern __device__ ValU32Struct exec_OpSRL(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpSRLLayout> layout1)  ;
    +extern __device__ NondetRegStruct exec_TopBit(ExecContext& ctx,ValU32Struct arg0, BoundLayout<TopBitLayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpSRA(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpSRALayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpSRLI(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpSRLILayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpSRAI(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpSRAILayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpDIV(ExecContext& ctx,DivInputStruct arg0, BoundLayout<OpDIVLayout> layout1)  ;
    +extern __device__ ValU32Struct exec_OpDIVU(ExecContext& ctx,DivInputStruct arg0, BoundLa
    ... [truncated]
    
  • risc0/circuit/rv32im-sys/kernels/cuda/types.cuh.inc+51 15 modified
    @@ -135,14 +135,45 @@ struct DecodeInstLayout {
       AddrDecomposeLayout pcAddr;
       MemoryReadLayout loadInst;
     };
    +using MemoryArgLayout4LayoutArray = ::cuda::std::array<MemoryArgLayout,4>;
    +using CycleArgLayout2LayoutArray = ::cuda::std::array<CycleArgLayout,2>;
    +struct _Arguments_ReadSourceRegsSourceRegsLayout {
    +  MemoryArgLayout4LayoutArray memoryArg;
    +  CycleArgLayout2LayoutArray cycleArg;
    +};
     struct ReadRegLayout {
       MemoryReadLayout _super;
       NondetRegLayout addr;
     };
    +struct ReadSourceRegsSourceRegsArm0_SuperLayout {
    +  ReadRegLayout rboth;
    +};
    +struct ReadSourceRegsSourceRegsArm0Layout {
    +  ReadSourceRegsSourceRegsArm0_SuperLayout _super;
    +  MemoryArgLayout _extra0;
    +  MemoryArgLayout _extra1;
    +  CycleArgLayout _extra2;
    +};
    +struct ReadSourceRegsSourceRegsArm1_SuperLayout {
    +  ReadRegLayout _0;
    +  ReadRegLayout _1;
    +};
    +struct ReadSourceRegsSourceRegsLayout {
    +  ReadSourceRegsSourceRegsArm0Layout arm0;
    +  ReadSourceRegsSourceRegsArm1_SuperLayout arm1;
    +};
    +struct ReadSourceRegsLayout {
    +  NondetRegLayout isSameReg;
    +  _Arguments_ReadSourceRegsSourceRegsLayout _arguments_ReadSourceRegsSourceRegs;
    +  ReadSourceRegsSourceRegsLayout sourceRegs;
    +  NondetRegLayout rs1Low;
    +  NondetRegLayout rs1High;
    +  NondetRegLayout rs2Low;
    +  NondetRegLayout rs2High;
    +};
     struct MiscInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout5LayoutArray = ::cuda::std::array<ArgU16Layout,5>;
     struct _Arguments_Misc0MiscOutputLayout {
    @@ -437,8 +468,7 @@ struct Misc2Layout {
     };
     struct MulInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout6LayoutArray = ::cuda::std::array<ArgU16Layout,6>;
     struct ArgU8Layout {
    @@ -593,8 +623,7 @@ struct Mul0Layout {
     };
     struct DivInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout16LayoutArray = ::cuda::std::array<ArgU16Layout,16>;
     struct _Arguments_Div0MulOutputLayout {
    @@ -812,8 +841,7 @@ struct Mem0Layout {
     };
     struct MemStoreInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
       NormalizeU32Layout addrU32;
       AddrDecomposeBitsLayout addr;
       MemoryReadLayout data;
    @@ -3074,6 +3102,14 @@ struct InstInputStruct {
     };
     struct DoCycleTableStruct {
     };
    +struct SourceRegsStruct {
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
    +};
    +struct ReadSourceRegsStruct {
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
    +};
     struct WriteRdStruct {
     };
     struct ExpandU32Struct {
    @@ -3100,8 +3136,8 @@ struct MultiplyAccumulateStruct {
     struct DivInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct ComponentStruct {
     };
    @@ -3123,8 +3159,8 @@ struct InstOutputBaseStruct {
     struct MiscInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct MiscOutputStruct {
       Val doWrite;
    @@ -3134,8 +3170,8 @@ struct MiscOutputStruct {
     struct MulInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct DoMulStruct {
       ValU32Struct low;
    @@ -3149,7 +3185,7 @@ struct MemLoadInputStruct {
     };
     struct MemStoreInputStruct {
       DecoderStruct decoded;
    -  GetDataStruct rs2;
    +  ValU32Struct rs2;
       AddrDecomposeBitsStruct addr;
       GetDataStruct data;
     };
    
  • risc0/circuit/rv32im-sys/kernels/cxx/layout.cpp.inc+8276 6884 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/layout.h.inc+1118 1083 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/rust_poly_fp_0.cpp+13653 11470 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/rust_poly_fp_1.cpp+11050 11123 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/rust_poly_fp_2.cpp+10656 10591 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/rust_poly_fp_3.cpp+11090 12221 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/steps.cpp+8448 8281 modified
  • risc0/circuit/rv32im-sys/kernels/cxx/steps.h+2 1 modified
    @@ -75,6 +75,7 @@ extern InstInputStruct exec_InstInput(ExecContext& ctx,Val arg0, Val arg1_0, Val
     extern DoCycleTableStruct exec_DoCycleTable(ExecContext& ctx,NondetRegStruct arg0, BoundLayout<DoCycleTableLayout> layout1)  ;
     extern DecoderStruct exec_DecodeInst(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, BoundLayout<DecodeInstLayout> layout2)  ;
     extern GetDataStruct exec_ReadReg(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, Val arg2_0, BoundLayout<ReadRegLayout> layout3)  ;
    +extern ReadSourceRegsStruct exec_ReadSourceRegs(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, DecoderStruct arg2_0, BoundLayout<ReadSourceRegsLayout> layout3)  ;
     extern WriteRdStruct exec_WriteRd(ExecContext& ctx,NondetRegStruct arg0, InstInputStruct arg1_0, DecoderStruct arg2_0, Val arg3, ValU32Struct arg4, BoundLayout<WriteRdLayout> layout5)  ;
     extern ExpandU32Struct exec_ExpandU32(ExecContext& ctx,ValU32Struct arg0, Val arg1_0, BoundLayout<ExpandU32Layout> layout2)  ;
     extern SplitTotalStruct exec_SplitTotal(ExecContext& ctx,Val arg0, BoundLayout<SplitTotalLayout> layout1)  ;
    @@ -226,7 +227,7 @@ extern OneHot_13_Struct exec_OneHot_13_(ExecContext& ctx,Val arg0, BoundLayout<O
     extern TopStruct exec_Top(ExecContext& ctx,BoundLayout<TopLayout> layout0, GlobalBuf global1)  ;
     extern void step_Top(ExecContext& ctx,MutableBuf data0, GlobalBuf global1)  ;
     extern AccumStruct exec_Accum(ExecContext& ctx,BigIntTopStateStruct arg0, ExtVal1Array arg1_0, BoundLayout<AccumLayout> layout2)  ;
    -extern BigIntTopStateStruct exec_TopExtract(ExecContext& ctx,BoundLayout<TopLayout> arg0, GlobalBuf global1)  ;
    +extern BigIntTopStateStruct exec_TopExtract(ExecContext& ctx,BoundLayout<TopLayout> layout0, GlobalBuf global1)  ;
     extern AccumStruct execUser_Accum(ExecContext& ctx,BoundLayout<TopLayout> arg0, ExtVal1Array arg1_0, BoundLayout<AccumLayout> layout2, GlobalBuf global3)  ;
     extern ComponentStruct exec_TopAccum(ExecContext& ctx,BoundLayout<TopLayout> arg0, BoundLayout<LayoutAccumLayout> layout1, GlobalBuf global2, GlobalBuf mix3)  ;
     extern void step_TopAccum(ExecContext& ctx,MutableBuf accum0, MutableBuf data1, GlobalBuf global2, GlobalBuf mix3)  ;
    
  • risc0/circuit/rv32im-sys/kernels/cxx/types.h.inc+51 15 modified
    @@ -135,14 +135,45 @@ struct DecodeInstLayout {
       AddrDecomposeLayout pcAddr;
       MemoryReadLayout loadInst;
     };
    +using MemoryArgLayout4LayoutArray = std::array<MemoryArgLayout, 4>;
    +using CycleArgLayout2LayoutArray = std::array<CycleArgLayout, 2>;
    +struct _Arguments_ReadSourceRegsSourceRegsLayout {
    +  MemoryArgLayout4LayoutArray memoryArg;
    +  CycleArgLayout2LayoutArray cycleArg;
    +};
     struct ReadRegLayout {
       MemoryReadLayout _super;
       NondetRegLayout addr;
     };
    +struct ReadSourceRegsSourceRegsArm0_SuperLayout {
    +  ReadRegLayout rboth;
    +};
    +struct ReadSourceRegsSourceRegsArm0Layout {
    +  ReadSourceRegsSourceRegsArm0_SuperLayout _super;
    +  MemoryArgLayout _extra0;
    +  MemoryArgLayout _extra1;
    +  CycleArgLayout _extra2;
    +};
    +struct ReadSourceRegsSourceRegsArm1_SuperLayout {
    +  ReadRegLayout _0;
    +  ReadRegLayout _1;
    +};
    +struct ReadSourceRegsSourceRegsLayout {
    +  ReadSourceRegsSourceRegsArm0Layout arm0;
    +  ReadSourceRegsSourceRegsArm1_SuperLayout arm1;
    +};
    +struct ReadSourceRegsLayout {
    +  NondetRegLayout isSameReg;
    +  _Arguments_ReadSourceRegsSourceRegsLayout _arguments_ReadSourceRegsSourceRegs;
    +  ReadSourceRegsSourceRegsLayout sourceRegs;
    +  NondetRegLayout rs1Low;
    +  NondetRegLayout rs1High;
    +  NondetRegLayout rs2Low;
    +  NondetRegLayout rs2High;
    +};
     struct MiscInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout5LayoutArray = std::array<ArgU16Layout, 5>;
     struct _Arguments_Misc0MiscOutputLayout {
    @@ -437,8 +468,7 @@ struct Misc2Layout {
     };
     struct MulInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout6LayoutArray = std::array<ArgU16Layout, 6>;
     struct ArgU8Layout {
    @@ -593,8 +623,7 @@ struct Mul0Layout {
     };
     struct DivInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
     };
     using ArgU16Layout16LayoutArray = std::array<ArgU16Layout, 16>;
     struct _Arguments_Div0MulOutputLayout {
    @@ -812,8 +841,7 @@ struct Mem0Layout {
     };
     struct MemStoreInputLayout {
       DecodeInstLayout decoded;
    -  ReadRegLayout rs1;
    -  ReadRegLayout rs2;
    +  ReadSourceRegsLayout sourceRegs;
       NormalizeU32Layout addrU32;
       AddrDecomposeBitsLayout addr;
       MemoryReadLayout data;
    @@ -3074,6 +3102,14 @@ struct InstInputStruct {
     };
     struct DoCycleTableStruct {
     };
    +struct SourceRegsStruct {
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
    +};
    +struct ReadSourceRegsStruct {
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
    +};
     struct WriteRdStruct {
     };
     struct ExpandU32Struct {
    @@ -3100,8 +3136,8 @@ struct MultiplyAccumulateStruct {
     struct DivInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct ComponentStruct {
     };
    @@ -3123,8 +3159,8 @@ struct InstOutputBaseStruct {
     struct MiscInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct MiscOutputStruct {
       Val doWrite;
    @@ -3134,8 +3170,8 @@ struct MiscOutputStruct {
     struct MulInputStruct {
       InstInputStruct _super;
       DecoderStruct decoded;
    -  GetDataStruct rs1;
    -  GetDataStruct rs2;
    +  ValU32Struct rs1;
    +  ValU32Struct rs2;
     };
     struct DoMulStruct {
       ValU32Struct low;
    @@ -3149,7 +3185,7 @@ struct MemLoadInputStruct {
     };
     struct MemStoreInputStruct {
       DecoderStruct decoded;
    -  GetDataStruct rs2;
    +  ValU32Struct rs2;
       AddrDecomposeBitsStruct addr;
       GetDataStruct data;
     };
    
  • risc0/zkvm/src/host/recursion/tests.rs+1 1 modified
    @@ -358,7 +358,7 @@ fn stable_root() {
     
         assert_eq!(
             ALLOWED_CONTROL_ROOT,
    -        digest!("539032186827b06719244873b17b2d4c122e2d02cfb1994fe958b2523b844576")
    +        digest!("884389273e128b32475b334dec75ee619b77cb33d41c332021fe7e44c746ee60")
         );
     }
     
    
  • risc0/zkvm/src/receipt/composite.rs+1 1 modified
    @@ -317,7 +317,7 @@ mod tests {
         fn composite_receipt_verifier_parameters_is_stable() {
             assert_eq!(
                 CompositeReceiptVerifierParameters::default().digest(),
    -            digest!("3daead8f1ec08eb96b60ce6cad42f82eba80f6cf89ba5007ca317e57256b6038")
    +            digest!("50ffbc35d194e6c9f5fc8adb030d077f3bf5393d5e9cedc6f303a9f1eede3a32")
             );
         }
     }
    
  • risc0/zkvm/src/receipt/groth16.rs+1 1 modified
    @@ -195,7 +195,7 @@ mod tests {
         fn groth16_receipt_verifier_parameters_is_stable() {
             assert_eq!(
                 Groth16ReceiptVerifierParameters::default().digest(),
    -            digest!("9f39696cb3ae9d6038d6b7a55c09017f0cf35e226ad7582b82dbabb0dae53385")
    +            digest!("f536085a791bdbc6cb46ab3074f88e9e94eabb192de8daca3caee1f4ed811b08")
             );
         }
     }
    
  • risc0/zkvm/src/receipt/succinct.rs+1 1 modified
    @@ -357,7 +357,7 @@ mod tests {
         fn succinct_receipt_verifier_parameters_is_stable() {
             assert_eq!(
                 SuccinctReceiptVerifierParameters::default().digest(),
    -            digest!("68ecff4bad7b3348ca3ac642e852b8d66b7158307f7d2a001c13887698fe6019")
    +            digest!("bb81f1400f9a2b28b457f9d686c28ec3ffeece08b0b00f1b0d7643a1cc471115")
             );
         }
     
    
e0e2918302c9

Disallow memory IO to same address on same cycle (#238)

https://github.com/risc0/zirgenJeremy BruestleMay 23, 2025via ghsa
11 files changed · +76 27
  • zirgen/circuit/predicates/golden_hashes.txt+11 11 modified
    @@ -9,17 +9,17 @@ e59210262aee637041e8c730166a3456114d1b85c7df5a39360277f47d61b765 lift_18.zkr
     c11ffc92596048e184159d166fe290fda21708bc15c8c9370b28a6981d284524 lift_22.zkr
     83c58b67eac8e9d1b6244fae10952c4fd81d035bed8043734c3d0bea6aac38fa lift_23.zkr
     f7ecb4abb3c3cb2a4ff82947f0c7e3c21726fd8650d56b7d007a64a20474a427 lift_24.zkr
    -fc4c531b3be6b4d35a1db9a6b3bf645d203e57ec634c1c4e5cbf44a8c385cf82 lift_rv32im_v2_14.zkr
    -aa2f456a644b8a4e8c14a2c3fb0582a527ee67625220b8950ad4562d9f6c2e61 lift_rv32im_v2_15.zkr
    -6202ded9c092ff3ff230ae3c986a8e7e91078b9c2dc2effab50f40ac5f38987a lift_rv32im_v2_16.zkr
    -78d4db6dbeaa98f53fd9e4030011e8ec5f1591ff29e202b9ed101931d47bc5e3 lift_rv32im_v2_17.zkr
    -bef45ae9c0094aad0b2b7c49003615cd8e57e8f7e3814393423e1a9732948ea0 lift_rv32im_v2_18.zkr
    -15f021c20df38c1a010c27d57db7f5e18eeac3a0d7a0af4527557621a7f1b8b4 lift_rv32im_v2_19.zkr
    -cb111c1f17158dd48e187dff5b1f06bf15caa231322a04227ec63f980c9e8463 lift_rv32im_v2_20.zkr
    -c57f1df1ac10934154e2f83414b7f1a59d9858b2f5c1afd92d132e5d59dc02e2 lift_rv32im_v2_21.zkr
    -38ab10b8d37b9dcd012a9c7b7bc06d2f3f894fdf1509722cb0f7a590a51d1ff8 lift_rv32im_v2_22.zkr
    -f665d5457988c9beb839fafc2ab0e2fbe7e19ebe798cf0ff85aaca5f77dd2f99 lift_rv32im_v2_23.zkr
    -c7b01e16291ccee480b6524c20624f11a6760b04c69cc6d954d4bca06cee4eab lift_rv32im_v2_24.zkr
    +ed28fdcc4b41600f321f7d472cb70471084628852b2fa9cb0789ad0ca0cf68ec lift_rv32im_v2_14.zkr
    +70978875f4416d2752cde41bf757e29f13dc1db9dc0277201701d264d2ce22b7 lift_rv32im_v2_15.zkr
    +2206f354ed5f3e446859aa6c39d6f022e52ec775f9b21559e59946596a9ef529 lift_rv32im_v2_16.zkr
    +436bfefed26e352737ae057088ed5e610c184007fd7d9e4ca4f8edb852577f3c lift_rv32im_v2_17.zkr
    +e2ec96d5fd60d1a6f68b777b86b65e360db093e50c636f2c05ccd698917da6f1 lift_rv32im_v2_18.zkr
    +7798bdb97e6de6c775ed445286e374572ce5f825ccacf39f48861490aaab7240 lift_rv32im_v2_19.zkr
    +acdbac0bc6f99e24fee7b9cafdeaa60cfa0d4668e46d022a665a8a408317703c lift_rv32im_v2_20.zkr
    +803157d8ee7a4f1452c38ebef45864e9791a7cd63df043cee51463d414967020 lift_rv32im_v2_21.zkr
    +ce6a2b69072b39e2c10d19ed8ebf8927b3e7c7060030bca2fa6c5656040189f0 lift_rv32im_v2_22.zkr
    +0c00ea1fe83c313a38aa52c26cf367fe0d403481191f5cb6af387d4db481009e lift_rv32im_v2_23.zkr
    +414a20dd12843d26e43502e79237354231fbf56cb70d2b31b9e9881705346f38 lift_rv32im_v2_24.zkr
     f99657cf182e53df3810e0c88b6e2aa10a17af9c086b93dbb941bf4ea17ebde7 test_recursion_circuit.zkr
     730afd6be910247584675f02e0a578951118c141e37cfd0605afa3e112ef2361 join.zkr
     52aad1184cef4330b3c3cf5ca06b965f4c6cb38a159815b95c8d07d54fcceaef resolve.zkr
    
  • zirgen/circuit/rv32im/shared/rv32im.h+14 4 modified
    @@ -267,6 +267,16 @@ template <typename Context> class RV32Emulator {
       FastDecodeTable decodeTable;
       Context& context;
     
    +  uint32_t loadRS2(const DecodedInst& decoded, uint32_t rs1) {
    +    uint32_t rs2;
    +    if (decoded.rs1 == decoded.rs2) {
    +      rs2 = rs1;
    +    } else {
    +      rs2 = context.loadReg(decoded.rs2);
    +    }
    +    return rs2;
    +  }
    +
     public:
       RV32Emulator(Context& context) : context(context) {}
     
    @@ -332,7 +342,7 @@ template <typename Context> class RV32Emulator {
         uint32_t rd = decoded.rd;
         uint32_t out = 0;
         uint32_t rs1 = context.loadReg(decoded.rs1);
    -    uint32_t rs2 = context.loadReg(decoded.rs2);
    +    uint32_t rs2 = loadRS2(decoded, rs1);
         uint32_t immI = decoded.immI();
         auto br_cond = [&](bool cond) {
           rd = 0;
    @@ -424,7 +434,7 @@ template <typename Context> class RV32Emulator {
       }
       bool stepMul(InstType type, const DecodedInst& decoded) {
         uint32_t rs1 = context.loadReg(decoded.rs1);
    -    uint32_t rs2 = context.loadReg(decoded.rs2);
    +    uint32_t rs2 = loadRS2(decoded, rs1);
         uint32_t immI = decoded.immI();
         uint32_t out = 0;
         switch (type) {
    @@ -455,7 +465,7 @@ template <typename Context> class RV32Emulator {
       }
       bool stepDiv(InstType type, const DecodedInst& decoded) {
         uint32_t rs1 = context.loadReg(decoded.rs1);
    -    uint32_t rs2 = context.loadReg(decoded.rs2);
    +    uint32_t rs2 = loadRS2(decoded, rs1);
         uint32_t immI = decoded.immI();
         uint32_t out = 0;
         switch (type) {
    @@ -552,7 +562,7 @@ template <typename Context> class RV32Emulator {
     
       bool stepStore(InstType type, const DecodedInst& decoded) {
         uint32_t rs1 = context.loadReg(decoded.rs1);
    -    uint32_t rs2 = context.loadReg(decoded.rs2);
    +    uint32_t rs2 = loadRS2(decoded, rs1);
         uint32_t addr = rs1 + decoded.immS();
         uint32_t shift = 8 * (addr & 3);
         if (!context.checkDataStore(addr)) {
    
  • zirgen/circuit/rv32im/v2/dsl/inst_div.zir+3 2 modified
    @@ -8,8 +8,9 @@ component DivInput(cycle: Reg, inst_input: InstInput) {
       inst_input.state = StateDecode();
       public ii := inst_input;
       public decoded := DecodeInst(cycle, ii);
    -  public rs1 := ReadReg(cycle, ii, decoded.rs1);
    -  public rs2 := ReadReg(cycle, ii, decoded.rs2);
    +  source_regs := ReadSourceRegs(cycle, ii, decoded);
    +  public rs1 := source_regs.rs1;
    +  public rs2 := source_regs.rs2;
       ii
     }
     
    
  • zirgen/circuit/rv32im/v2/dsl/inst_ecall.zir+1 1 modified
    @@ -179,7 +179,7 @@ component ECallHostReadWords(cycle: Reg, input: InstInput, ptrWord: Val, len: Va
       ];
       count := reduce doWord init 0 with Add;
       for i : 0..4 {
    -    addr := Reg(doWord[i] * (ptrWord + i) + (1 - doWord[i]) * SafeWriteWord());
    +    addr := Reg(doWord[i] * (ptrWord + i) + (1 - doWord[i]) * (SafeWriteWord() + i));
         MemoryWriteUnconstrained(cycle, addr);
       };
       newLenHighZero := IsZero(lenDecomp.high - count);
    
  • zirgen/circuit/rv32im/v2/dsl/inst_mem.zir+3 2 modified
    @@ -18,8 +18,9 @@ component MemStoreInput(cycle: Reg, inst_input: InstInput) {
       inst_input.state = StateDecode();
       public ii := inst_input;
       public decoded := DecodeInst(cycle, ii);
    -  public rs1 := ReadReg(cycle, ii, decoded.rs1);
    -  public rs2 := ReadReg(cycle, ii, decoded.rs2);
    +  source_regs := ReadSourceRegs(cycle, ii, decoded);
    +  public rs1 := source_regs.rs1;
    +  public rs2 := source_regs.rs2;
       addr_u32 := NormalizeU32(AddU32(rs1, decoded.immS));
       public addr := AddrDecomposeBits(addr_u32, ii.mode);
       public data := MemoryRead(cycle, addr.addr);
    
  • zirgen/circuit/rv32im/v2/dsl/inst_misc.zir+3 2 modified
    @@ -7,8 +7,9 @@ component MiscInput(cycle: Reg, inst_input: InstInput) {
       inst_input.state = StateDecode();
       public ii := inst_input;
       public decoded := DecodeInst(cycle, ii);
    -  public rs1 := ReadReg(cycle, ii, decoded.rs1);
    -  public rs2 := ReadReg(cycle, ii, decoded.rs2);
    +  source_regs := ReadSourceRegs(cycle, ii, decoded);
    +  public rs1 := source_regs.rs1;
    +  public rs2 := source_regs.rs2;
       ii
     }
     
    
  • zirgen/circuit/rv32im/v2/dsl/inst_mul.zir+3 2 modified
    @@ -8,8 +8,9 @@ component MulInput(cycle: Reg, inst_input: InstInput) {
       inst_input.state = StateDecode();
       public ii := inst_input;
       public decoded := DecodeInst(cycle, ii);
    -  public rs1 := ReadReg(cycle, ii, decoded.rs1);
    -  public rs2 := ReadReg(cycle, ii, decoded.rs2);
    +  source_regs := ReadSourceRegs(cycle, ii, decoded);
    +  public rs1 := source_regs.rs1;
    +  public rs2 := source_regs.rs2;
       ii
     }
     
    
  • zirgen/circuit/rv32im/v2/dsl/inst.zir+29 0 modified
    @@ -38,6 +38,35 @@ component ReadReg(cycle: Reg, input: InstInput, reg: Val) {
       MemoryRead(cycle, addr)
     }
     
    +component SourceRegs(rs1: ValU32, rs2: ValU32) {
    +  public rs1 := rs1;
    +  public rs2 := rs2;
    +}
    +
    +component ReadSourceRegs(cycle: Reg, ii: InstInput, decoded: DecodeInst) {
    +  is_same_reg := NondetReg(Isz(decoded.rs1 - decoded.rs2));
    +  // Verify is_same_reg is boolean
    +  is_same_reg * (1 - is_same_reg) = 0;
    +  source_regs := if (is_same_reg) {
    +    // If is_same_reg, verify we really are the same reg, and read once
    +    decoded.rs1 = decoded.rs2;
    +    rboth := ReadReg(cycle, ii, decoded.rs1);
    +    SourceRegs(rboth, rboth)
    +  } else {
    +    // Otherwise read twice, if we are the same reg, this will fail
    +    // because one of the reads will happen on the same cycle
    +    SourceRegs(
    +      ReadReg(cycle, ii, decoded.rs1),
    +      ReadReg(cycle, ii, decoded.rs2))
    +  };
    +  rs1Low := Reg(source_regs.rs1.low);
    +  rs1High:= Reg(source_regs.rs1.high);
    +  rs2Low := Reg(source_regs.rs2.low);
    +  rs2High := Reg(source_regs.rs2.high);
    +  public rs1 := ValU32(rs1Low, rs1High);
    +  public rs2 := ValU32(rs2Low, rs2High);
    +}
    +
     component WriteRd(cycle: Reg, input: InstInput, decoded: Decoder, do_write: Val, write_data: ValU32) {
       isRd0 := IsZero(decoded.rd);
       do_write := (1 - isRd0) * do_write;
    
  • zirgen/circuit/rv32im/v2/dsl/mem.zir+1 1 modified
    @@ -81,7 +81,7 @@ component IsRead(io: MemoryIO) {
     }
     
     component IsForward(io: MemoryIO) {
    -  IsCycle(io.newTxn.cycle - io.oldTxn.cycle);
    +  IsCycle(io.newTxn.cycle - 1 - io.oldTxn.cycle);
     }
     
     // A normal memory read, the most constrained case
    
  • zirgen/circuit/rv32im/v2/emu/preflight.cpp+7 1 modified
    @@ -357,7 +357,13 @@ PreflightTrace preflightSegment(const Segment& in, size_t segmentSize) {
           txn.prevCycle = preflightContext.prevCycle[txn.word];
         } else {
           // Otherwise, compute cycle diff and another diff
    -      uint32_t diff = txn.cycle - txn.prevCycle;
    +      if (txn.cycle == txn.prevCycle) {
    +        std::cerr << "ACCESS ON SAME CYCLE\n";
    +        std::cerr << "tnx.cycle = " << txn.cycle << "\n";
    +        std::cerr << "addr = " << txn.word << "\n";
    +        throw std::runtime_error("DIE");
    +      }
    +      uint32_t diff = txn.cycle - 1 - txn.prevCycle;
           ret.cycles[diff / 2].diffCount[diff % 2]++;
         }
     
    
  • zirgen/circuit/rv32im/v2/emu/r0vm.h+1 1 modified
    @@ -201,7 +201,7 @@ template <typename Context> struct R0Context {
               i += 4;
               rlen -= 4;
             } else {
    -          storeMem(SAFE_WRITE_WORD, 0);
    +          storeMem(SAFE_WRITE_WORD + j, 0);
             }
           }
           if (rlen == 0) {
    

Vulnerability mechanics

Synthesis attempt was rejected by the grounding validator. Re-run pending.

References

9

News mentions

0

No linked articles in our index yet.