diff --git a/.gitignore b/.gitignore index 79c70512..563e7a4e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ **/.lake # Rust -/target +**/target # Nix result* diff --git a/Cargo.lock b/Cargo.lock index 78ec1f00..3bc4ec84 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,6 +46,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "aiur" +version = "0.1.0" +dependencies = [ + "indexmap", + "multi-stark", + "rayon", + "rustc-hash", +] + [[package]] name = "allocator-api2" version = "0.2.21" @@ -163,6 +173,14 @@ version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" +[[package]] +name = "bignat" +version = "0.1.0" +source = "git+https://github.com/argumentcomputer/lean-ffi.git?branch=bignat#fb36aa18beb946a372cbc355a27aedfff334554a" +dependencies = [ + "num-bigint", +] + [[package]] name = "bincode" version = "2.0.1" @@ -299,17 +317,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" -[[package]] -name = "chacha20" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" -dependencies = [ - "cfg-if", - "cpufeatures 0.3.0", - "rand_core 0.10.1", -] - [[package]] name = "chrono" version = "0.4.44" @@ -811,7 +818,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1719,10 +1726,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] -name = "ix_rs" +name = "ix-common" +version = "0.1.0" +dependencies = [ + "bignat", + "blake3", + "indexmap", + "quickcheck", + "quickcheck_macros", + "rustc-hash", +] + +[[package]] +name = "ix-compile" version = "0.1.0" dependencies = [ "anyhow", + "bignat", + "blake3", + "dashmap", + "indexmap", + "itertools 0.14.0", + "ix-common", + "ix-kernel", + "ixon", + "num-bigint", + "rayon", + "rustc-hash", + "sha2 0.10.9", +] + +[[package]] +name = "ix-ffi" +version = "0.1.0" +dependencies = [ + "aiur", + "anyhow", + "bignat", "bincode", "blake3", "bytes", @@ -1732,14 +1772,15 @@ dependencies = [ "iroh", "iroh-base", "itertools 0.14.0", + "ix-common", + "ix-compile", + "ix-kernel", + "ixon", "lean-ffi", "mimalloc", "multi-stark", "n0-error", "num-bigint", - "quickcheck", - "quickcheck_macros", - "rand 0.10.1", "rayon", "rustc-hash", "serde", @@ -1750,6 +1791,43 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "ix-kernel" +version = "0.1.0" +dependencies = [ + "bignat", + "blake3", + "dashmap", + "indexmap", + "itertools 0.14.0", + "ix-common", + "ixon", + "log", + "num-bigint", + "quickcheck", + "quickcheck_macros", + "rayon", + "rustc-hash", +] + +[[package]] +name = "ixon" +version = "0.1.0" +dependencies = [ + "bignat", + "blake3", + "dashmap", + "indexmap", + "ix-common", + "num-bigint", + "quickcheck", + "quickcheck_macros", + "rayon", + "rustc-hash", + "sha2 0.10.9", + "tiny-keccak", +] + [[package]] name = "js-sys" version = "0.3.97" @@ -1771,8 +1849,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lean-ffi" version = "0.1.0" -source = "git+https://github.com/argumentcomputer/lean-ffi?rev=cc98ebf67bf453ac3827cb767f78b13ea674dd6a#cc98ebf67bf453ac3827cb767f78b13ea674dd6a" +source = "git+https://github.com/argumentcomputer/lean-ffi.git?branch=bignat#fb36aa18beb946a372cbc355a27aedfff334554a" dependencies = [ + "bignat", "bindgen", "cc", "num-bigint", @@ -2207,7 +2286,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -2980,7 +3059,6 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" dependencies = [ - "chacha20", "getrandom 0.4.2", "rand_core 0.10.1", ] @@ -3211,7 +3289,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b55fb86dfd3a2f5f76ea78310a88f96c4ea21a3031f8d212443d56123fd0521" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -3390,7 +3468,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3efdfe00..c0db864b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,55 +1,59 @@ -[package] -name = "ix_rs" +[workspace] +members = [ + "crates/aiur", + "crates/common", + "crates/compile", + "crates/ffi", + "crates/ixon", + "crates/kernel", +] +# `zisk/` and `sp1/` are their own Cargo workspaces (guest + host) built via +# the respective zkVM toolchains; excluded so host workspace ops don't pick +# them up. +exclude = ["zisk", "sp1"] +resolver = "2" + +[profile.dev] +panic = "abort" + +[profile.release] +panic = "abort" + +[workspace.package] version = "0.1.0" edition = "2024" +license = "MIT OR Apache-2.0" + +[workspace.dependencies] +# Internal crates +aiur = { path = "crates/aiur" } +ix-common = { path = "crates/common" } +ix-compile = { path = "crates/compile" } +ixon = { path = "crates/ixon" } +ix-kernel = { path = "crates/kernel" } -[lib] -crate-type = ["staticlib"] +# lean-ffi tree (lean-ffi crate + factored-out bignat sub-crate) +bignat = { git = "https://github.com/argumentcomputer/lean-ffi.git", branch = "bignat" } +lean-ffi = { git = "https://github.com/argumentcomputer/lean-ffi.git", branch = "bignat" } -[dependencies] +# External shared deps anyhow = "1" blake3 = "1.8.4" +dashmap = "6.1.0" +indexmap = "2" itertools = "0.14.0" -indexmap = { version = "2", features = ["rayon"] } -lean-ffi = { git = "https://github.com/argumentcomputer/lean-ffi", rev = "cc98ebf67bf453ac3827cb767f78b13ea674dd6a" } +log = "0.4" mimalloc = { version = "0.1", default-features = false } multi-stark = { git = "https://github.com/argumentcomputer/multi-stark.git", rev = "a8a15ea6aa2890f9f60f32a6e0e5e66afc1535ff" } num-bigint = "0.4.6" +quickcheck = "1.0.3" +quickcheck_macros = "1.0.0" rayon = "1" rustc-hash = "2" -tiny-keccak = { version = "2", features = ["keccak"] } -dashmap = { version = "6.1.0", features = ["rayon"] } sha2 = "0.10" -# Iroh dependencies -bytes = { version = "1.10.1", optional = true } -tokio = { version = "1.44.1", optional = true } -iroh = { version = "0.97", optional = true } -iroh-base = { version = "0.97", optional = true } -n0-error = { version = "0.1", optional = true } -getrandom = { version = "0.3", optional = true } -tracing = { version = "0.1", optional = true } -tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true } -bincode = { version = "2.0.1", optional = true } -serde = { version = "1.0.219", features = ["derive"], optional = true } - -[dev-dependencies] -quickcheck = "1.0.3" -rand = "0.10.1" -quickcheck_macros = "1.0.0" - -[features] -default = [] -parallel = ["multi-stark/parallel"] -test-ffi = [] -net = ["bytes", "tokio", "iroh", "iroh-base", "n0-error", "getrandom", "tracing", "tracing-subscriber", "bincode", "serde" ] - -[profile.dev] -panic = "abort" - -[profile.release] -panic = "abort" +tiny-keccak = { version = "2", features = ["keccak"] } -[lints.rust] +[workspace.lints.rust] invalid_reference_casting = "warn" nonstandard_style = "warn" rust_2018_idioms = { level = "warn", priority = -1 } @@ -58,7 +62,7 @@ unreachable_pub = "warn" unused_lifetimes = "warn" unused_qualifications = "warn" -[lints.clippy] +[workspace.lints.clippy] all = { level = "warn", priority = -1 } cast_lossless = "warn" cast_possible_truncation = "warn" diff --git a/Ix/Cli/CompileCmd.lean b/Ix/Cli/CompileCmd.lean index fb1c0afe..1b9057eb 100644 --- a/Ix/Cli/CompileCmd.lean +++ b/Ix/Cli/CompileCmd.lean @@ -20,17 +20,29 @@ def runCompileCmd (p : Cli.Parsed) : IO UInt32 := do let pathStr := path.as! String let outPath : String := (p.flag? "out").map (·.as! String) |>.getD (defaultOutPathFor pathStr) + let rootName? : Option Lean.Name := + (p.flag? "root").map (·.as! String |>.toName) buildFile pathStr let leanEnv ← getFileEnv pathStr println! "Running Ix compiler on {pathStr}" - let totalConsts := leanEnv.constants.toList.length - println! "Total constants: {totalConsts}" + let constList ← match rootName? with + | none => pure leanEnv.constants.toList + | some root => + if !leanEnv.constants.contains root then + IO.eprintln s!"error: root constant `{root}` not found in environment" + IO.Process.exit 1 + pure (Lean.collectDependencies root leanEnv.constants) + let totalConsts := constList.length + if let some root := rootName? then + println! "Slicing to transitive closure of `{root}`: {totalConsts} constants" + else + println! "Total constants: {totalConsts}" let start ← IO.monoMsNow - let bytes ← Ix.CompileM.rsCompileEnvBytes leanEnv + let bytes ← Ix.CompileM.rsCompileEnvBytesFFI constList let elapsed := (← IO.monoMsNow) - start println! "Compiled {fmtBytes bytes.size} env in {elapsed.formatMs}" @@ -56,6 +68,7 @@ def compileCmd : Cli.Cmd := `[Cli| FLAGS: path : String; "Path to file to compile" out : String; "Output path for serialized Ixon.Env bytes; defaults to the lowercased input file stem with `.ixe` (e.g. CompileMathlib.lean -> compilemathlib.ixe)" + root : String; "If set, emit only the transitive Const-closure of this constant (e.g. `Nat.add_comm`) instead of the entire environment" ] end diff --git a/Ix/Meta.lean b/Ix/Meta.lean index 41cfa980..4430c52e 100644 --- a/Ix/Meta.lean +++ b/Ix/Meta.lean @@ -88,17 +88,41 @@ def fetchMathlibCache (cwd : Option FilePath) : IO Unit := do if exitCode != 0 then throw $ IO.userError "lake exe cache get failed" +/-- Walk up from `start` looking for `lake-manifest.json`. -/ +partial def findLakeRoot (start : FilePath) : IO (Option FilePath) := do + if ← (start / "lake-manifest.json").pathExists then + return some start + match start.parent with + | none => return none + | some p => if p == start then return none else findLakeRoot p + +/-- Walk up from `cur` collecting directory names until reaching `root`, +yielding the path components between them (in top-down order). -/ +partial def collectRelParts (root cur : FilePath) (acc : List String) : Option (List String) := + if cur == root then some acc + else match cur.fileName, cur.parent with + | some name, some par => + if par == cur then none else collectRelParts root par (name :: acc) + | _, _ => none + /-- Build the Lean module at the given file path using Lake. Also fetches Mathlib cache if the project depends on it. -/ def buildFile (path : FilePath) : IO Unit := do let path ← IO.FS.realPath path - let some moduleName := path.fileStem + let some stem := path.fileStem | throw $ IO.userError s!"cannot determine module name from {path}" - fetchMathlibCache path.parent + let some parent := path.parent + | throw $ IO.userError s!"cannot determine parent of {path}" + let some root ← findLakeRoot parent + | throw $ IO.userError s!"no lake-manifest.json found at or above {parent}" + let some relParts := collectRelParts root parent [] + | throw $ IO.userError s!"{path} is not under {root}" + let moduleName := ".".intercalate (relParts ++ [stem]) + fetchMathlibCache root let child ← IO.Process.spawn { cmd := "lake" args := #["build", moduleName] - cwd := path.parent + cwd := root stdout := .inherit stderr := .inherit } diff --git a/README.md b/README.md index 0f7af7e6..f66190c4 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,120 @@ Compiler performance benchmarks are tracked at https://bencher.dev/console/proje **Rust tests:** `cargo test` or `cargo nextest run` +### Proving under SP1 + +The Ix kernel typechecker has an SP1 guest at `sp1/guest/` driven by a host at +`sp1/host/`. The workflow is two steps: first compile a Lean program to a `.ixe` +serialized `Ixon.Env`, then feed that file to the SP1 host to either execute or +prove the typecheck. + +**Nix users only:** enter the SP1 dev shell first to pick up `cargo-prove` and +the succinct Rust toolchain: + +``` +nix develop .#sp1 +``` + +Non-Nix users: install the SP1 toolchain manually per the +[SP1 docs](https://docs.succinct.xyz/docs/sp1/getting-started/install). + +1. **Compile a `.ixe` from a Lean file.** Pass `--path` to the Lean source, + `--root` to slice the environment to the transitive closure of one constant, + and `--out` for the output path. For example, to compile + `Nat.add_comm` from the benchmark file: + + ``` + lake exe ix compile --path Benchmarks/CheckNatAddComm.lean \ + --root Nat.add_comm \ + --out nataddcomm.ixe + ``` + + Omitting `--root` emits the entire environment; omitting `--out` defaults to + the lowercased input stem plus `.ixe` (e.g. `checknataddcomm.ixe`). + +2. **Execute or prove under SP1.** From `sp1/host/`, run the host with `--ixe` + pointing at the file produced above: + + ``` + cd sp1/host + # Execute the kernel typecheck in the SP1 VM (no proof), prints failures + cycles + RUST_LOG=info cargo run --release -- --execute --ixe ../../nataddcomm.ixe + # Generate and verify a compressed SP1 proof of the same typecheck + RUST_LOG=info cargo run --release -- --ixe ../../nataddcomm.ixe + ``` + + With no `--ixe`, the host runs against an empty `Ixon.Env`. To enable GPU + proving, set `SP1_PROVER=cuda` (see the SP1 docs for CUDA setup). + +### Proving under Zisk + +The Ix kernel typechecker also has a Zisk guest at `zisk/guest/` driven by a +host at `zisk/host/`. The workflow mirrors the SP1 one — first compile a Lean +program to a `.ixe`, then feed it to the Zisk host to either execute or prove +the typecheck. + +**Nix users only:** enter the Zisk dev shell first to pick up `cargo-zisk`, +`ziskemu`, and the RISC-V toolchain needed to build the guest: + +``` +nix develop .#zisk +``` + +Non-Nix users: install Zisk manually per the +[Zisk install docs](https://0xpolygonhermez.github.io/zisk/getting_started/installation.html). + +1. **Compile a `.ixe` from a Lean file.** Same as for SP1: + + ``` + lake exe ix compile --path Benchmarks/CheckNatAddComm.lean \ + --root Nat.add_comm \ + --out nataddcomm.ixe + ``` + +2. **Execute or prove under Zisk.** From `zisk/`, run the host with `--ixe`: + + ``` + cd zisk + # Execute the kernel typecheck in the Zisk VM (no proof), prints cycles + RUST_LOG=info cargo run --release -- --execute --ixe ../nataddcomm.ixe + # Run the constraint checker without generating a proof + RUST_LOG=info cargo run --release -- --verify-constraints --ixe ../nataddcomm.ixe + # Generate and verify a VadcopFinal proof of the same typecheck + RUST_LOG=info cargo run --release -- --ixe ../nataddcomm.ixe + ``` + + With no `--ixe`, the host runs against an empty `Ixon.Env`. The host's + `build.rs` invokes `zisk_sdk::build_program("../guest")`, so `cargo run` + transparently rebuilds the guest ELF whenever its sources change. + + **Memlock limit.** Zisk's assembly emulator `mmap`s ROM with `MAP_LOCKED` + and needs a memlock limit well above typical distro defaults (often 8 MB). + Symptom: `mmap(rom) errno=11=Resource temporarily unavailable` followed by + `Shmem creation … failed with exit status: 255` during + `STARTING_ASM_MICROSERVICES`. Raise it for the current shell (needs sudo + to lift the hard cap): + + ``` + sudo prlimit --memlock=unlimited:unlimited --pid $$ + ulimit -l # confirm: prints 'unlimited' + ``` + + For a persistent fix, raise `memlock` system-wide via your distro's PAM + limits and re-login. + + **Heap cap.** The Zisk zkVM has a hard 512 MB RAM cap + ([`RAM_SIZE`](https://github.com/0xPolygonHermez/zisk/blob/v0.17.0/core/src/mem.rs#L111)), + of which ~510 MB is usable heap, and isn't configurable without + rebuilding the proving setup. Envs whose deserialized in-memory + representation exceeds that won't fit (full `TutorialDefs.lean` pulls in + Lean stdlib + Batteries + LSpec, around 1 GB resident). For bigger envs, + prefer the SP1 backend (default 24 GB runtime cap + [`DEFAULT_MEMORY_LIMIT`](https://github.com/succinctlabs/sp1/blob/v6.2.0/crates/core/executor/src/opts.rs#L25), + configurable via `MEMORY_LIMIT` env var up to a ~1 TB JIT ceiling + [`MAX_JIT_LOG_ADDR`](https://github.com/succinctlabs/sp1/blob/v6.2.0/crates/primitives/src/consts.rs#L11)), + or shrink the env via `--root ` to take the transitive closure of + a single constant. + ### Nix #### Prerequisites diff --git a/Tests/MinimalDefs.lean b/Tests/MinimalDefs.lean new file mode 100644 index 00000000..a83067cc --- /dev/null +++ b/Tests/MinimalDefs.lean @@ -0,0 +1,5 @@ +def myConst : Nat := 42 + +def myId (x : Nat) : Nat := x + +theorem myReflEq (n : Nat) : n = n := rfl diff --git a/crates/aiur/Cargo.toml b/crates/aiur/Cargo.toml new file mode 100644 index 00000000..fc0b688c --- /dev/null +++ b/crates/aiur/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "aiur" +version.workspace = true +edition.workspace = true +license.workspace = true + +[dependencies] +indexmap = { workspace = true } +multi-stark = { workspace = true } +rayon = { workspace = true } +rustc-hash = { workspace = true } + +[features] +default = [] +parallel = ["multi-stark/parallel"] + +[lints] +workspace = true diff --git a/src/aiur/bytecode.rs b/crates/aiur/src/bytecode.rs similarity index 78% rename from src/aiur/bytecode.rs rename to crates/aiur/src/bytecode.rs index 31d7a88e..d25fcb59 100644 --- a/src/aiur/bytecode.rs +++ b/crates/aiur/src/bytecode.rs @@ -3,23 +3,23 @@ use crate::FxIndexMap; use super::G; pub struct Toplevel { - pub(crate) functions: Vec, - pub(crate) memory_sizes: Vec, + pub functions: Vec, + pub memory_sizes: Vec, } pub struct Function { - pub(crate) body: Block, - pub(crate) layout: FunctionLayout, - pub(crate) entry: bool, - pub(crate) constrained: bool, + pub body: Block, + pub layout: FunctionLayout, + pub entry: bool, + pub constrained: bool, } #[derive(Clone, Copy)] pub struct FunctionLayout { - pub(crate) input_size: usize, - pub(crate) selectors: usize, - pub(crate) auxiliaries: usize, - pub(crate) lookups: usize, + pub input_size: usize, + pub selectors: usize, + pub auxiliaries: usize, + pub lookups: usize, } impl FunctionLayout { @@ -29,8 +29,8 @@ impl FunctionLayout { } pub struct Block { - pub(crate) ops: Vec, - pub(crate) ctrl: Ctrl, + pub ops: Vec, + pub ctrl: Ctrl, } pub enum Op { diff --git a/src/aiur/constraints.rs b/crates/aiur/src/constraints.rs similarity index 97% rename from src/aiur/constraints.rs rename to crates/aiur/src/constraints.rs index 777eb099..2e3bf2ef 100644 --- a/src/aiur/constraints.rs +++ b/crates/aiur/src/constraints.rs @@ -7,21 +7,18 @@ use multi_stark::{ use std::{array, ops::Range}; use crate::{ - FxIndexMap, - aiur::{ - G, - bytecode::{Block, Ctrl, Function, FunctionLayout, Op, Toplevel, ValIdx}, - function_channel, - gadgets::{ - AiurGadget, - bytes1::{Bytes1, Bytes1Op}, - bytes2::{Bytes2, Bytes2Op}, - }, - memory_channel, u8_add_channel, u8_and_channel, - u8_bit_decomposition_channel, u8_less_than_channel, u8_or_channel, - u8_range_check_channel, u8_shift_left_channel, u8_shift_right_channel, - u8_sub_channel, u8_xor_channel, + FxIndexMap, G, + bytecode::{Block, Ctrl, Function, FunctionLayout, Op, Toplevel, ValIdx}, + function_channel, + gadgets::{ + AiurGadget, + bytes1::{Bytes1, Bytes1Op}, + bytes2::{Bytes2, Bytes2Op}, }, + memory_channel, u8_add_channel, u8_and_channel, u8_bit_decomposition_channel, + u8_less_than_channel, u8_or_channel, u8_range_check_channel, + u8_shift_left_channel, u8_shift_right_channel, u8_sub_channel, + u8_xor_channel, }; type Expr = SymbolicExpression; diff --git a/src/aiur/execute.rs b/crates/aiur/src/execute.rs similarity index 97% rename from src/aiur/execute.rs rename to crates/aiur/src/execute.rs index 9fec900b..7ed10030 100644 --- a/src/aiur/execute.rs +++ b/crates/aiur/src/execute.rs @@ -3,28 +3,25 @@ use rustc_hash::FxHashMap; use std::collections::hash_map::Entry; use crate::{ - FxIndexMap, - aiur::{ - G, - bytecode::{Block, Ctrl, FunIdx, Function, Op, Toplevel}, - gadgets::{ - AiurGadget, - bytes1::{Bytes1, Bytes1Op, Bytes1Queries}, - bytes2::{Bytes2, Bytes2Op, Bytes2Queries}, - }, + FxIndexMap, G, + bytecode::{Block, Ctrl, FunIdx, Function, Op, Toplevel}, + gadgets::{ + AiurGadget, + bytes1::{Bytes1, Bytes1Op, Bytes1Queries}, + bytes2::{Bytes2, Bytes2Op, Bytes2Queries}, }, }; pub struct QueryResult { pub(crate) output: Vec, - pub(crate) multiplicity: G, + pub multiplicity: G, } pub type QueryMap = FxIndexMap, QueryResult>; pub struct QueryRecord { - pub(crate) function_queries: Vec, - pub(crate) memory_queries: FxIndexMap, + pub function_queries: Vec, + pub memory_queries: FxIndexMap, pub(crate) bytes1_queries: Bytes1Queries, pub(crate) bytes2_queries: Bytes2Queries, } @@ -44,14 +41,14 @@ impl QueryRecord { } } -pub(crate) struct IOKeyInfo { - pub(crate) idx: usize, - pub(crate) len: usize, +pub struct IOKeyInfo { + pub idx: usize, + pub len: usize, } pub struct IOBuffer { - pub(crate) data: Vec, - pub(crate) map: FxHashMap, IOKeyInfo>, + pub data: Vec, + pub map: FxHashMap, IOKeyInfo>, } impl IOBuffer { diff --git a/src/aiur/gadgets.rs b/crates/aiur/src/gadgets.rs similarity index 97% rename from src/aiur/gadgets.rs rename to crates/aiur/src/gadgets.rs index 2a3ca95f..a71c2b9d 100644 --- a/src/aiur/gadgets.rs +++ b/crates/aiur/src/gadgets.rs @@ -6,7 +6,7 @@ use multi_stark::{ p3_matrix::dense::RowMajorMatrix, }; -use crate::aiur::{G, execute::QueryRecord}; +use crate::{G, execute::QueryRecord}; /// A trait representing a generic Aiur gadget. /// diff --git a/src/aiur/gadgets/blake3.rs b/crates/aiur/src/gadgets/blake3.rs similarity index 99% rename from src/aiur/gadgets/blake3.rs rename to crates/aiur/src/gadgets/blake3.rs index 434f43b5..9fd508f9 100644 --- a/src/aiur/gadgets/blake3.rs +++ b/crates/aiur/src/gadgets/blake3.rs @@ -14,7 +14,7 @@ use multi_stark::{ p3_matrix::dense::RowMajorMatrix, }; -use crate::aiur::{ +use crate::{ G, execute::QueryRecord, gadgets::{ diff --git a/src/aiur/gadgets/bytes1.rs b/crates/aiur/src/gadgets/bytes1.rs similarity index 99% rename from src/aiur/gadgets/bytes1.rs rename to crates/aiur/src/gadgets/bytes1.rs index 1cc6525b..cc83c5c9 100644 --- a/src/aiur/gadgets/bytes1.rs +++ b/crates/aiur/src/gadgets/bytes1.rs @@ -6,7 +6,7 @@ use multi_stark::{ p3_matrix::dense::RowMajorMatrix, }; -use crate::aiur::{ +use crate::{ G, execute::QueryRecord, gadgets::AiurGadget, u8_bit_decomposition_channel, u8_shift_left_channel, u8_shift_right_channel, }; diff --git a/src/aiur/gadgets/bytes2.rs b/crates/aiur/src/gadgets/bytes2.rs similarity index 99% rename from src/aiur/gadgets/bytes2.rs rename to crates/aiur/src/gadgets/bytes2.rs index c3d382c8..31d2a718 100644 --- a/src/aiur/gadgets/bytes2.rs +++ b/crates/aiur/src/gadgets/bytes2.rs @@ -6,7 +6,7 @@ use multi_stark::{ p3_matrix::dense::RowMajorMatrix, }; -use crate::aiur::{ +use crate::{ G, execute::QueryRecord, gadgets::AiurGadget, u8_add_channel, u8_and_channel, u8_less_than_channel, u8_or_channel, u8_range_check_channel, u8_sub_channel, u8_xor_channel, diff --git a/src/aiur.rs b/crates/aiur/src/lib.rs similarity index 89% rename from src/aiur.rs rename to crates/aiur/src/lib.rs index c4794b85..0002d787 100644 --- a/src/aiur.rs +++ b/crates/aiur/src/lib.rs @@ -6,9 +6,12 @@ pub mod memory; pub mod synthesis; pub mod trace; +use indexmap::IndexMap; use multi_stark::p3_field::PrimeCharacteristicRing; +use rustc_hash::FxBuildHasher; pub type G = multi_stark::p3_goldilocks::Goldilocks; +pub type FxIndexMap = IndexMap; #[inline] pub const fn function_channel() -> G { diff --git a/src/aiur/memory.rs b/crates/aiur/src/memory.rs similarity index 98% rename from src/aiur/memory.rs rename to crates/aiur/src/memory.rs index fa676394..d6e74ff3 100644 --- a/src/aiur/memory.rs +++ b/crates/aiur/src/memory.rs @@ -13,7 +13,7 @@ use rayon::{ slice::ParallelSliceMut, }; -use crate::aiur::{G, execute::QueryRecord, memory_channel}; +use crate::{G, execute::QueryRecord, memory_channel}; pub struct Memory { width: usize, diff --git a/src/aiur/synthesis.rs b/crates/aiur/src/synthesis.rs similarity index 99% rename from src/aiur/synthesis.rs rename to crates/aiur/src/synthesis.rs index f5fbaf0a..60cbbea4 100644 --- a/src/aiur/synthesis.rs +++ b/crates/aiur/src/synthesis.rs @@ -12,7 +12,7 @@ use rayon::iter::{ IntoParallelIterator, IntoParallelRefIterator, ParallelIterator, }; -use crate::aiur::{ +use crate::{ G, bytecode::{FunIdx, Toplevel}, constraints::Constraints, diff --git a/src/aiur/trace.rs b/crates/aiur/src/trace.rs similarity index 97% rename from src/aiur/trace.rs rename to crates/aiur/src/trace.rs index 5cc6f9f6..99654ca8 100644 --- a/src/aiur/trace.rs +++ b/crates/aiur/src/trace.rs @@ -11,19 +11,16 @@ use rayon::{ }; use crate::{ - FxIndexMap, - aiur::{ - G, - bytecode::{Block, Ctrl, Function, Op, Toplevel}, - execute::{IOBuffer, IOKeyInfo, QueryRecord}, - function_channel, - gadgets::{bytes1::Bytes1, bytes2::Bytes2}, - memory::Memory, - u8_add_channel, u8_and_channel, u8_bit_decomposition_channel, - u8_less_than_channel, u8_or_channel, u8_range_check_channel, - u8_shift_left_channel, u8_shift_right_channel, u8_sub_channel, - u8_xor_channel, - }, + FxIndexMap, G, + bytecode::{Block, Ctrl, Function, Op, Toplevel}, + execute::{IOBuffer, IOKeyInfo, QueryRecord}, + function_channel, + gadgets::{bytes1::Bytes1, bytes2::Bytes2}, + memory::Memory, + u8_add_channel, u8_and_channel, u8_bit_decomposition_channel, + u8_less_than_channel, u8_or_channel, u8_range_check_channel, + u8_shift_left_channel, u8_shift_right_channel, u8_sub_channel, + u8_xor_channel, }; struct ColumnIndex { diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml new file mode 100644 index 00000000..6ff7109c --- /dev/null +++ b/crates/common/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "ix-common" +version.workspace = true +edition.workspace = true +license.workspace = true + +[dependencies] +bignat = { workspace = true } +blake3 = { workspace = true } +indexmap = { workspace = true } +quickcheck = { workspace = true, optional = true } +rustc-hash = { workspace = true } + +[dev-dependencies] +quickcheck = { workspace = true } +quickcheck_macros = { workspace = true } + +[features] +quickcheck = ["dep:quickcheck"] + +[lints] +workspace = true diff --git a/src/ix/address.rs b/crates/common/src/address.rs similarity index 91% rename from src/ix/address.rs rename to crates/common/src/address.rs index df90d061..d5cba0b4 100644 --- a/src/ix/address.rs +++ b/crates/common/src/address.rs @@ -43,8 +43,8 @@ impl Address { /// name that can't collide with any Lean-originated name (e.g. for /// scratch `KEnv` entries that should not participate in the /// `name_to_addr` / `aux_name_to_addr` namespace). - pub fn to_unique_name(&self) -> crate::ix::env::Name { - use crate::ix::env::Name; + pub fn to_unique_name(&self) -> crate::env::Name { + use crate::env::Name; Name::str( Name::str(Name::str(Name::anon(), "Ix".to_string()), "_#".to_string()), self.hex(), @@ -53,8 +53,8 @@ impl Address { /// Inverse of `to_unique_name`. Returns `Some(Address)` iff `name` has /// shape `Ix._#.` with valid 64-char hex; otherwise `None`. - pub fn from_unique_name(name: &crate::ix::env::Name) -> Option { - use crate::ix::env::NameData; + pub fn from_unique_name(name: &crate::env::Name) -> Option { + use crate::env::NameData; let (parent, hex) = match name.as_data() { NameData::Str(parent, s, _) => (parent.clone(), s.clone()), _ => return None, @@ -79,11 +79,8 @@ impl Address { /// Used by `compile/mutual.rs` to register each mutual block under a /// Muts-tagged meta so kernel ingress can discover and process it via /// `ingress_muts_block`. - pub fn muts_name( - &self, - first_member: &crate::ix::env::Name, - ) -> crate::ix::env::Name { - use crate::ix::env::{Name, NameData}; + pub fn muts_name(&self, first_member: &crate::env::Name) -> crate::env::Name { + use crate::env::{Name, NameData}; let base = Name::str(Name::str(Name::anon(), "Ix".to_string()), self.hex()); // Append each component of `first_member` to the base, preserving // numeric vs string parts. @@ -127,8 +124,8 @@ impl StdHash for Address { } } -#[cfg(test)] -pub mod tests { +#[cfg(any(test, feature = "quickcheck"))] +pub mod arbitrary { use super::*; use quickcheck::{Arbitrary, Gen}; diff --git a/src/ix/env.rs b/crates/common/src/env.rs similarity index 97% rename from src/ix/env.rs rename to crates/common/src/env.rs index ca700056..b2d6675a 100644 --- a/src/ix/env.rs +++ b/crates/common/src/env.rs @@ -14,7 +14,7 @@ use std::{ sync::Arc, }; -use lean_ffi::nat::Nat; +use bignat::Nat; use rustc_hash::FxHashMap; // -- Name tags ---------------------------------------------------------------- @@ -1464,3 +1464,51 @@ impl ConstantInfo { /// The Lean kernel environment: a map from names to their constant declarations. pub type Env = FxHashMap; + +#[cfg(any(test, feature = "quickcheck"))] +pub mod arbitrary { + use super::*; + use quickcheck::{Arbitrary, Gen}; + + impl Arbitrary for DefinitionSafety { + fn arbitrary(g: &mut Gen) -> Self { + match u8::arbitrary(g) % 3 { + 0 => DefinitionSafety::Unsafe, + 1 => DefinitionSafety::Safe, + _ => DefinitionSafety::Partial, + } + } + } + + impl Arbitrary for QuotKind { + fn arbitrary(g: &mut Gen) -> Self { + match u8::arbitrary(g) % 4 { + 0 => QuotKind::Type, + 1 => QuotKind::Ctor, + 2 => QuotKind::Lift, + _ => QuotKind::Ind, + } + } + } + + impl Arbitrary for BinderInfo { + fn arbitrary(g: &mut Gen) -> Self { + match u8::arbitrary(g) % 4 { + 0 => Self::Default, + 1 => Self::Implicit, + 2 => Self::StrictImplicit, + _ => Self::InstImplicit, + } + } + } + + impl Arbitrary for ReducibilityHints { + fn arbitrary(g: &mut Gen) -> Self { + match u8::arbitrary(g) % 3 { + 0 => Self::Opaque, + 1 => Self::Abbrev, + _ => Self::Regular(u32::arbitrary(g)), + } + } + } +} diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs new file mode 100644 index 00000000..e51d043c --- /dev/null +++ b/crates/common/src/lib.rs @@ -0,0 +1,21 @@ +//! Foundational types shared across the Ix project. +//! +//! Contains: +//! - `address`: 32-byte content-address newtype. +//! - `env`: the Lean kernel type representation (`Name`, `Level`, `Expr`, +//! `ConstantInfo`, `Env`, …) and the tag-byte constants used throughout. +//! - `mutual`: mutual-block helpers used by both compile and kernel. +//! - `strong_ordering`: small comparison helper. +//! +//! Plus the `FxIndexMap` / `FxIndexSet` aliases that the rest of the project +//! uses. + +use indexmap::{IndexMap, IndexSet}; +use rustc_hash::FxBuildHasher; + +pub mod address; +pub mod env; +pub mod strong_ordering; + +pub type FxIndexMap = IndexMap; +pub type FxIndexSet = IndexSet; diff --git a/src/ix/strong_ordering.rs b/crates/common/src/strong_ordering.rs similarity index 100% rename from src/ix/strong_ordering.rs rename to crates/common/src/strong_ordering.rs diff --git a/crates/compile/Cargo.toml b/crates/compile/Cargo.toml new file mode 100644 index 00000000..3fff593a --- /dev/null +++ b/crates/compile/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "ix-compile" +version.workspace = true +edition.workspace = true +license.workspace = true + +[dependencies] +anyhow = { workspace = true } +bignat = { workspace = true } +blake3 = { workspace = true } +dashmap = { workspace = true, features = ["rayon"] } +indexmap = { workspace = true, features = ["rayon"] } +itertools = { workspace = true } +ix-common = { workspace = true } +ixon = { workspace = true } +ix-kernel = { workspace = true } +num-bigint = { workspace = true } +rayon = { workspace = true } +rustc-hash = { workspace = true } +sha2 = { workspace = true } + +[lints] +workspace = true diff --git a/src/ix/compile.rs b/crates/compile/src/compile.rs similarity index 97% rename from src/ix/compile.rs rename to crates/compile/src/compile.rs index 2bebb759..3aa4f435 100644 --- a/src/ix/compile.rs +++ b/crates/compile/src/compile.rs @@ -13,35 +13,37 @@ use std::{ sync::{Arc, atomic::Ordering as AtomicOrdering}, }; -use lean_ffi::nat::Nat; - -use crate::{ - ix::address::Address, - ix::env::{ - AxiomVal, BinderInfo, ConstantInfo as LeanConstantInfo, ConstructorVal, - DataValue as LeanDataValue, Env as LeanEnv, Expr as LeanExpr, ExprData, - InductiveVal, Level, LevelData, Literal, Name, NameData, QuotVal, - RecursorRule as LeanRecursorRule, SourceInfo as LeanSourceInfo, - Substring as LeanSubstring, Syntax as LeanSyntax, SyntaxPreresolved, +use bignat::Nat; + +use ix_common::address::Address; +use ix_common::env::{ + AxiomVal, BinderInfo, ConstantInfo as LeanConstantInfo, ConstructorVal, + DataValue as LeanDataValue, Env as LeanEnv, Expr as LeanExpr, ExprData, + InductiveVal, Level, LevelData, Literal, Name, NameData, QuotVal, + RecursorRule as LeanRecursorRule, SourceInfo as LeanSourceInfo, + Substring as LeanSubstring, Syntax as LeanSyntax, SyntaxPreresolved, +}; +use ix_common::strong_ordering::SOrd; + +use ixon::{ + CompileError, Tag0, + constant::{ + Axiom, Constant, ConstantInfo, Constructor, ConstructorProj, Definition, + DefinitionProj, Inductive, InductiveProj, MutConst as IxonMutConst, + Quotient, Recursor, RecursorProj, RecursorRule, }, - ix::graph::NameSet, - ix::ixon::{ - CompileError, Tag0, - constant::{ - Axiom, Constant, ConstantInfo, Constructor, ConstructorProj, Definition, - DefinitionProj, Inductive, InductiveProj, MutConst as IxonMutConst, - Quotient, Recursor, RecursorProj, RecursorRule, - }, - env::{Env as IxonEnv, Named}, - expr::Expr, - metadata::{ - ConstantMeta, ConstantMetaInfo, DataValue, ExprMeta, ExprMetaData, KVMap, - }, - sharing::{self, analyze_block, build_sharing_vec, decide_sharing}, - univ::Univ, + env::{Env as IxonEnv, Named}, + expr::Expr, + metadata::{ + ConstantMeta, ConstantMetaInfo, DataValue, ExprMeta, ExprMetaData, KVMap, }, - ix::mutual::{Def, Ind, MutConst, MutCtx, Rec, ctx_to_all}, - ix::strong_ordering::SOrd, + sharing::{self, analyze_block, build_sharing_vec, decide_sharing}, + univ::Univ, +}; + +use crate::{ + graph::NameSet, + mutual::{Def, Ind, MutConst, MutCtx, Rec, ctx_to_all}, }; /// Whether to track hash-consed sizes during compilation. @@ -86,7 +88,7 @@ pub struct KernelCtx { /// etc.) with aux-substituted types at `resolve_lean_name_addr`-derived /// addresses that may shift as alpha-collapse reassigns addresses over /// the course of compilation. - pub kenv: crate::ix::kernel::env::KEnv, + pub kenv: ix_kernel::env::KEnv, } impl Default for KernelCtx { @@ -97,7 +99,7 @@ impl Default for KernelCtx { impl KernelCtx { pub fn new() -> Self { - KernelCtx { kenv: crate::ix::kernel::env::KEnv::new() } + KernelCtx { kenv: ix_kernel::env::KEnv::new() } } } @@ -441,7 +443,7 @@ fn compile_univ_indices( fn univ_sort_key(univ: &Arc) -> Vec { let mut buf = Vec::new(); - crate::ix::ixon::univ::put_univ(univ, &mut buf); + ixon::univ::put_univ(univ, &mut buf); buf } @@ -539,7 +541,7 @@ fn collect_expr_tables( Ok(()) } -pub(crate) fn preseed_expr_tables( +pub fn preseed_expr_tables( exprs: &[(&LeanExpr, &[Name])], mut_ctx: &MutCtx, cache: &mut BlockCache, @@ -581,7 +583,7 @@ pub(crate) fn preseed_expr_tables( Ok(()) } -pub(crate) fn collect_mut_const_exprs<'a>( +pub fn collect_mut_const_exprs<'a>( cnst: &'a MutConst, exprs: &mut Vec<(&'a LeanExpr, &'a [Name])>, ) { @@ -620,7 +622,7 @@ pub fn compile_expr( cache: &mut BlockCache, stt: &CompileState, ) -> Result, CompileError> { - use crate::ix::ixon::metadata::CallSiteEntry; + use ixon::metadata::CallSiteEntry; // Stack-based iterative compilation to avoid stack overflow enum Frame { @@ -773,7 +775,7 @@ pub fn compile_expr( let compiling_is_aux_regen = cache .compiling .as_ref() - .is_some_and(crate::ix::decompile::is_aux_gen_suffix); + .is_some_and(crate::decompile::is_aux_gen_suffix); if !compiling_is_aux_regen { if let Some(plan) = stt.call_site_plans.get(name) && !plan.is_identity() @@ -1460,11 +1462,11 @@ fn compile_data_value(dv: &LeanDataValue, stt: &CompileState) -> DataValue { // Serialize Int and store as blob let mut bytes = Vec::new(); match i { - crate::ix::env::Int::OfNat(n) => { + ix_common::env::Int::OfNat(n) => { bytes.push(0); bytes.extend_from_slice(&n.to_le_bytes()); }, - crate::ix::env::Int::NegSucc(n) => { + ix_common::env::Int::NegSucc(n) => { bytes.push(1); bytes.extend_from_slice(&n.to_le_bytes()); }, @@ -1670,16 +1672,16 @@ fn apply_sharing(exprs: Vec>) -> (Vec>, Vec>) { } /// Result of applying sharing to a singleton constant. -pub(crate) struct SingletonSharingResult { +pub struct SingletonSharingResult { /// The compiled Constant - pub(crate) constant: Constant, + pub constant: Constant, /// Hash-consed size of expressions - pub(crate) hash_consed_size: usize, + pub hash_consed_size: usize, } /// Apply sharing to a Definition and return a Constant with stats. #[allow(clippy::needless_pass_by_value)] -pub(crate) fn apply_sharing_to_definition_with_stats( +pub fn apply_sharing_to_definition_with_stats( def: Definition, refs: Vec
, univs: Vec>, @@ -1703,7 +1705,7 @@ pub(crate) fn apply_sharing_to_definition_with_stats( /// Apply sharing to an Axiom and return a Constant with stats. #[allow(clippy::needless_pass_by_value)] -pub(crate) fn apply_sharing_to_axiom_with_stats( +pub fn apply_sharing_to_axiom_with_stats( ax: Axiom, refs: Vec
, univs: Vec>, @@ -1721,7 +1723,7 @@ pub(crate) fn apply_sharing_to_axiom_with_stats( /// Apply sharing to a Quotient and return a Constant with stats. #[allow(clippy::needless_pass_by_value)] -pub(crate) fn apply_sharing_to_quotient_with_stats( +pub fn apply_sharing_to_quotient_with_stats( quot: Quotient, refs: Vec
, univs: Vec>, @@ -1742,7 +1744,7 @@ pub(crate) fn apply_sharing_to_quotient_with_stats( } /// Apply sharing to a Recursor and return a Constant with stats. -pub(crate) fn apply_sharing_to_recursor_with_stats( +pub fn apply_sharing_to_recursor_with_stats( rec: Recursor, refs: Vec
, univs: Vec>, @@ -1779,15 +1781,15 @@ pub(crate) fn apply_sharing_to_recursor_with_stats( } /// Result of applying sharing to a mutual block. -pub(crate) struct MutualBlockSharingResult { +pub struct MutualBlockSharingResult { /// The compiled Constant - pub(crate) constant: Constant, + pub constant: Constant, /// Hash-consed size of all expressions in the block - pub(crate) hash_consed_size: usize, + pub hash_consed_size: usize, } /// Apply sharing to a mutual block and return a Constant with stats. -pub(crate) fn apply_sharing_to_mutual_block( +pub fn apply_sharing_to_mutual_block( mut_consts: Vec, refs: Vec
, univs: Vec>, @@ -1959,7 +1961,7 @@ enum MutConstKind { /// Compile a Definition. /// Arena persists across type + value within a constant. -pub(crate) fn compile_definition( +pub fn compile_definition( def: &Def, mut_ctx: &MutCtx, cache: &mut BlockCache, @@ -2030,7 +2032,7 @@ fn compile_recursor_rule( /// Compile a Recursor. /// Arena grows across type and all rule RHS expressions. -pub(crate) fn compile_recursor( +pub fn compile_recursor( rec: &Rec, mut_ctx: &MutCtx, cache: &mut BlockCache, @@ -2157,7 +2159,7 @@ fn compile_constructor( /// The inductive type gets its own arena. Each constructor gets its own arena /// via compile_constructor. No CtorMeta duplication — ConstantMeta::Indc only /// stores constructor name addresses. -pub(crate) fn compile_inductive( +pub fn compile_inductive( ind: &Ind, mut_ctx: &MutCtx, cache: &mut BlockCache, @@ -2314,20 +2316,20 @@ fn compile_quotient( // =========================================================================== /// Result of compiling a mutual block. -pub(crate) struct CompiledMutualBlock { +pub struct CompiledMutualBlock { /// The compiled Constant - pub(crate) constant: Constant, + pub constant: Constant, /// Content-addressed hash - pub(crate) addr: Address, + pub addr: Address, /// Hash-consed size (theoretical minimum with perfect DAG sharing) - pub(crate) hash_consed_size: usize, + pub hash_consed_size: usize, /// Serialized size (actual bytes) - pub(crate) serialized_size: usize, + pub serialized_size: usize, } /// Compile a mutual block with block-level sharing. /// Returns the Constant, its content-addressed hash, and size statistics. -pub(crate) fn compile_mutual_block( +pub fn compile_mutual_block( mut_consts: Vec, refs: Vec
, univs: Vec>, @@ -3844,18 +3846,18 @@ fn compile_mutual( .map(|r| r.clone()) } -pub(crate) mod aux_gen; +pub mod aux_gen; mod env; -pub(crate) mod mutual; -pub(crate) mod nat_conv; -pub(crate) mod surgery; +pub mod mutual; +pub mod nat_conv; +pub mod surgery; pub use env::{compile_env, compile_env_with_options}; #[cfg(test)] mod tests { use super::*; - use crate::ix::env::{BinderInfo, Expr as LeanExpr, Level}; - use crate::ix::ixon::metadata::CallSiteEntry; + use ix_common::env::{BinderInfo, Expr as LeanExpr, Level}; + use ixon::metadata::CallSiteEntry; #[test] fn test_compile_univ_zero() { @@ -4268,7 +4270,7 @@ mod tests { #[test] fn test_compile_axiom() { - use crate::ix::env::{AxiomVal, ConstantVal}; + use ix_common::env::{AxiomVal, ConstantVal}; // Create a simple axiom: axiom myAxiom : Type let name = Name::str(Name::anon(), "myAxiom".to_string()); @@ -4302,7 +4304,7 @@ mod tests { #[test] fn test_compile_simple_def() { - use crate::ix::env::{ + use ix_common::env::{ ConstantVal, DefinitionSafety, DefinitionVal, ReducibilityHints, }; @@ -4356,11 +4358,11 @@ mod tests { #[test] fn test_compile_self_referential_def() { - use crate::ix::env::{ + use ix_common::env::{ ConstantInfo as LeanConstantInfo, ConstantVal, DefinitionSafety, DefinitionVal, Env as LeanEnv, ReducibilityHints, }; - use crate::ix::ixon::constant::ConstantInfo; + use ixon::constant::ConstantInfo; // Create a self-referential definition (like a recursive function placeholder) // def myDef : Type := myDef (this is silly but tests the mutual handling) @@ -4416,7 +4418,7 @@ mod tests { #[test] fn test_compile_env_single_axiom() { - use crate::ix::env::{AxiomVal, ConstantVal}; + use ix_common::env::{AxiomVal, ConstantVal}; // Create a minimal environment with just one axiom let name = Name::str(Name::anon(), "myAxiom".to_string()); @@ -4438,7 +4440,7 @@ mod tests { #[test] fn test_compile_env_two_independent_axioms() { - use crate::ix::env::{AxiomVal, ConstantVal}; + use ix_common::env::{AxiomVal, ConstantVal}; let name1 = Name::str(Name::anon(), "axiom1".to_string()); let name2 = Name::str(Name::anon(), "axiom2".to_string()); @@ -4482,7 +4484,7 @@ mod tests { #[test] fn test_compile_env_def_referencing_axiom() { - use crate::ix::env::{ + use ix_common::env::{ AxiomVal, ConstantVal, DefinitionSafety, DefinitionVal, ReducibilityHints, }; @@ -4532,7 +4534,7 @@ mod tests { /// to the single representative in the Muts array. #[test] fn test_compile_mutual_alpha_equivalent_defs() { - use crate::ix::env::{ + use ix_common::env::{ ConstantVal, DefinitionSafety, DefinitionVal, ReducibilityHints, }; @@ -4612,7 +4614,7 @@ mod tests { /// with projections indexing correctly into the array. #[test] fn test_compile_mutual_alpha_equiv_with_different_third() { - use crate::ix::env::{ + use ix_common::env::{ ConstantVal, DefinitionSafety, DefinitionVal, ReducibilityHints, }; @@ -4721,8 +4723,8 @@ mod tests { #[test] fn test_mutual_block_roundtrip() { - use crate::ix::env::DefinitionSafety; - use crate::ix::ixon::constant::{DefKind, Definition}; + use ix_common::env::DefinitionSafety; + use ixon::constant::{DefKind, Definition}; // Create a mutual block and verify it roundtrips through serialization let sort0 = Expr::sort(0); @@ -4792,7 +4794,7 @@ mod tests { #[test] fn test_definition_with_sharing() { - use crate::ix::ixon::constant::{DefKind, Definition}; + use ixon::constant::{DefKind, Definition}; // Create a definition where typ and value share structure let sort0 = Expr::sort(0); @@ -4813,7 +4815,7 @@ mod tests { // Create constant with sharing at Constant level let def = Definition { kind: DefKind::Definition, - safety: crate::ix::env::DefinitionSafety::Safe, + safety: ix_common::env::DefinitionSafety::Safe, lvls: 0, typ: rewritten[0].clone(), value: rewritten[1].clone(), @@ -4836,7 +4838,7 @@ mod tests { #[test] fn test_axiom_with_sharing() { - use crate::ix::ixon::constant::Axiom; + use ixon::constant::Axiom; // Axiom with repeated subterms in its type let sort0 = Expr::sort(0); @@ -4871,7 +4873,7 @@ mod tests { #[test] fn test_recursor_with_sharing() { - use crate::ix::ixon::constant::{Recursor, RecursorRule}; + use ixon::constant::{Recursor, RecursorRule}; // Recursor with shared subterms across typ and rules let sort0 = Expr::sort(0); @@ -4937,7 +4939,7 @@ mod tests { #[test] fn test_inductive_with_sharing() { - use crate::ix::ixon::constant::{Constructor, Inductive}; + use ixon::constant::{Constructor, Inductive}; // Inductive with shared subterms across type and constructors let sort0 = Expr::sort(0); @@ -5047,8 +5049,8 @@ mod tests { #[test] fn test_roundtrip_axiom() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{AxiomVal, ConstantVal}; + use crate::decompile::decompile_env; + use ix_common::env::{AxiomVal, ConstantVal}; // Create an axiom: axiom myAxiom : Type let name = Name::str(Name::anon(), "myAxiom".to_string()); @@ -5081,8 +5083,8 @@ mod tests { #[test] fn test_roundtrip_axiom_with_level_params() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{AxiomVal, ConstantVal, Env as LeanEnv}; + use crate::decompile::decompile_env; + use ix_common::env::{AxiomVal, ConstantVal, Env as LeanEnv}; // Create an axiom with universe params: axiom myAxiom.{u, v} : Sort (max u v) let name = Name::str(Name::anon(), "myAxiom".to_string()); @@ -5124,8 +5126,8 @@ mod tests { #[test] fn test_roundtrip_definition() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{ + use crate::decompile::decompile_env; + use ix_common::env::{ ConstantVal, DefinitionSafety, DefinitionVal, ReducibilityHints, }; @@ -5136,13 +5138,13 @@ mod tests { Name::str(Name::anon(), "x".to_string()), type1.clone(), type1.clone(), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); let value = LeanExpr::lam( Name::str(Name::anon(), "x".to_string()), type1, LeanExpr::bvar(Nat::from(0u64)), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); let def = DefinitionVal { cnst: ConstantVal { name: name.clone(), level_params: vec![], typ }, @@ -5177,8 +5179,8 @@ mod tests { #[test] fn test_roundtrip_def_referencing_axiom() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{ + use crate::decompile::decompile_env; + use ix_common::env::{ AxiomVal, ConstantVal, DefinitionSafety, DefinitionVal, Env as LeanEnv, ReducibilityHints, }; @@ -5234,8 +5236,8 @@ mod tests { #[test] fn test_roundtrip_quotient() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{ConstantVal, Env as LeanEnv, QuotKind, QuotVal}; + use crate::decompile::decompile_env; + use ix_common::env::{ConstantVal, Env as LeanEnv, QuotKind, QuotVal}; // Create quotient constants let quot_name = Name::str(Name::anon(), "Quot".to_string()); @@ -5254,9 +5256,9 @@ mod tests { Name::anon(), LeanExpr::bvar(Nat::from(1u64)), prop.clone(), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); let typ = LeanExpr::all( alpha, @@ -5265,9 +5267,9 @@ mod tests { Name::anon(), rel_type, sort_u.clone(), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); let quot = QuotVal { @@ -5304,8 +5306,8 @@ mod tests { #[test] fn test_roundtrip_theorem() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{ConstantVal, Env as LeanEnv, TheoremVal}; + use crate::decompile::decompile_env; + use ix_common::env::{ConstantVal, Env as LeanEnv, TheoremVal}; // Create a theorem: theorem trivial : True := True.intro let name = Name::str(Name::anon(), "trivial".to_string()); @@ -5345,8 +5347,8 @@ mod tests { #[test] fn test_roundtrip_opaque() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{ConstantVal, Env as LeanEnv, OpaqueVal}; + use crate::decompile::decompile_env; + use ix_common::env::{ConstantVal, Env as LeanEnv, OpaqueVal}; // Create an opaque: opaque secret : Nat := 42 let name = Name::str(Name::anon(), "secret".to_string()); @@ -5387,8 +5389,8 @@ mod tests { #[test] fn test_roundtrip_multiple_constants() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{ + use crate::decompile::decompile_env; + use ix_common::env::{ AxiomVal, ConstantVal, DefinitionSafety, DefinitionVal, Env as LeanEnv, ReducibilityHints, TheoremVal, }; @@ -5462,8 +5464,8 @@ mod tests { #[test] fn test_roundtrip_inductive_simple() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{ + use crate::decompile::decompile_env; + use ix_common::env::{ ConstantVal, ConstructorVal, Env as LeanEnv, InductiveVal, }; @@ -5545,8 +5547,8 @@ mod tests { #[test] fn test_roundtrip_inductive_with_multiple_ctors() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{ + use crate::decompile::decompile_env; + use ix_common::env::{ ConstantVal, ConstructorVal, Env as LeanEnv, InductiveVal, }; @@ -5629,8 +5631,8 @@ mod tests { #[test] fn test_roundtrip_mutual_definitions() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{ + use crate::decompile::decompile_env; + use ix_common::env::{ ConstantVal, DefinitionSafety, DefinitionVal, Env as LeanEnv, ReducibilityHints, }; @@ -5646,7 +5648,7 @@ mod tests { Name::anon(), type0.clone(), type0.clone(), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); // f := fun x => g x @@ -5657,7 +5659,7 @@ mod tests { LeanExpr::cnst(g_name.clone(), vec![]), LeanExpr::bvar(Nat::from(0u64)), ), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); // g := fun x => f x @@ -5668,7 +5670,7 @@ mod tests { LeanExpr::cnst(f_name.clone(), vec![]), LeanExpr::bvar(Nat::from(0u64)), ), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); // Mutual block: both reference each other @@ -5735,8 +5737,8 @@ mod tests { #[test] fn test_roundtrip_mutual_inductives() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{ + use crate::decompile::decompile_env; + use ix_common::env::{ ConstantVal, ConstructorVal, Env as LeanEnv, InductiveVal, }; @@ -5806,7 +5808,7 @@ mod tests { Name::anon(), odd_type.clone(), even_type.clone(), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); let even_succ_ctor = ConstructorVal { @@ -5827,7 +5829,7 @@ mod tests { Name::anon(), even_type.clone(), odd_type.clone(), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); let odd_succ_ctor = ConstructorVal { @@ -5893,8 +5895,8 @@ mod tests { #[test] fn test_roundtrip_inductive_with_recursor() { - use crate::ix::decompile::decompile_env; - use crate::ix::env::{ConstantVal, InductiveVal, RecursorVal}; + use crate::decompile::decompile_env; + use ix_common::env::{ConstantVal, InductiveVal, RecursorVal}; // Create Empty type with recursor (no constructors) // inductive Empty : Type @@ -5927,7 +5929,7 @@ mod tests { Name::anon(), empty_type.clone(), LeanExpr::sort(Level::param(u.clone())), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); let rec_type = LeanExpr::all( Name::str(Name::anon(), "motive".to_string()), @@ -5939,9 +5941,9 @@ mod tests { LeanExpr::bvar(Nat::from(1u64)), LeanExpr::bvar(Nat::from(0u64)), ), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ), - crate::ix::env::BinderInfo::Implicit, + ix_common::env::BinderInfo::Implicit, ); let recursor = RecursorVal { diff --git a/src/ix/compile/aux_gen.rs b/crates/compile/src/compile/aux_gen.rs similarity index 96% rename from src/ix/compile/aux_gen.rs rename to crates/compile/src/compile/aux_gen.rs index 080a57e8..f9e06e5a 100644 --- a/src/ix/compile/aux_gen.rs +++ b/crates/compile/src/compile/aux_gen.rs @@ -74,28 +74,28 @@ //! - `.sparseCasesOn`, `.sparseCasesOnEq` //! - `.casesOnSameCtor`, `.casesOnSameCtorHet` -pub(crate) mod below; -pub(crate) mod brecon; -pub(crate) mod cases_on; -pub(crate) mod expr_utils; -pub(crate) mod nested; -pub(crate) mod rec_on; -pub(crate) mod recursor; +pub mod below; +pub mod brecon; +pub mod cases_on; +pub mod expr_utils; +pub mod nested; +pub mod rec_on; +pub mod recursor; use std::sync::Arc; use rustc_hash::FxHashMap; -use crate::ix::compile::CompileState; -use crate::ix::env::{ +use crate::compile::CompileState; +use ix_common::env::{ ConstantVal, Env as LeanEnv, Expr as LeanExpr, Name, RecursorRule, RecursorVal, }; -use crate::ix::ixon::CompileError; +use ixon::CompileError; /// A regenerated constant ready for compilation. #[derive(Clone)] -pub(crate) enum PatchedConstant { +pub enum PatchedConstant { /// A regenerated `.rec` recursor. Rec(RecursorVal), /// A regenerated `.recOn` definition (arg-reordered `.rec` wrapper). @@ -118,7 +118,7 @@ pub(crate) enum PatchedConstant { /// flips to `Unsafe` whenever the type or value mentions any unsafe constant — /// and every auxiliary references its parent inductive. #[derive(Clone)] -pub(crate) struct AuxDef { +pub struct AuxDef { pub name: Name, pub level_params: Vec, pub typ: LeanExpr, @@ -134,7 +134,7 @@ pub(crate) struct AuxDef { /// (to canonicalize Lean-source-order originals before structural /// comparison). #[derive(Clone, Default)] -pub(crate) struct AuxPatchesOutput { +pub struct AuxPatchesOutput { /// The regenerated canonical-layout constants, keyed by their /// Lean-visible source-indexed name (e.g. `A.rec`, `A.below_2`). pub patches: FxHashMap, @@ -185,12 +185,12 @@ pub(crate) struct AuxPatchesOutput { /// `InductiveVal.all` of any block member). It determines the canonical /// `.rec_N` naming and the source-aux walk used to compute the /// hash-sort permutation. -pub(crate) fn generate_aux_patches( +pub fn generate_aux_patches( sorted_classes: &[Vec], original_all: &[Name], lean_env: &Arc, stt: &CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + kctx: &mut crate::compile::KernelCtx, ) -> Result { let mut patches: FxHashMap = FxHashMap::default(); let mut aliases: FxHashMap = FxHashMap::default(); @@ -257,8 +257,8 @@ pub(crate) fn generate_aux_patches( let metadata_has_nested = original_all.iter().any(|name| { matches!( lean_env.get(name), - Some(crate::ix::env::ConstantInfo::InductInfo(v)) - if crate::ix::compile::nat_conv::nat_to_usize(&v.num_nested) > 0 + Some(ix_common::env::ConstantInfo::InductInfo(v)) + if crate::compile::nat_conv::nat_to_usize(&v.num_nested) > 0 ) }); let (canonical_recs, is_prop) = if metadata_has_nested @@ -529,7 +529,7 @@ pub(crate) fn generate_aux_patches( for (rec_name, rec_val) in canonical_recs.iter().take(n_classes) { // Build casesOn name: rec_name is "I.rec", casesOn name is "I.casesOn" let ind_name = match rec_name.as_data() { - crate::ix::env::NameData::Str(parent, _, _) => parent.clone(), + ix_common::env::NameData::Str(parent, _, _) => parent.clone(), _ => continue, }; let cases_on_name = Name::str(ind_name, "casesOn".to_string()); @@ -549,7 +549,7 @@ pub(crate) fn generate_aux_patches( // types (unlike below_N/brecOn_N which ARE generated via BRecOn.lean). for (rec_name, rec_val) in canonical_recs.iter().take(n_classes) { let ind_name = match rec_name.as_data() { - crate::ix::env::NameData::Str(parent, _, _) => parent.clone(), + ix_common::env::NameData::Str(parent, _, _) => parent.clone(), _ => continue, }; let rec_on_name = Name::str(ind_name, "recOn".to_string()); @@ -650,7 +650,7 @@ pub(crate) fn generate_aux_patches( .and_then(|c| c.first()) .map(|n| n.pretty()) .unwrap_or_default(); - if *crate::ix::compile::IX_TIMING + if *crate::compile::IX_TIMING && _below_elapsed.as_secs_f32() + _brecon_elapsed.as_secs_f32() > 0.3 { eprintln!( @@ -669,7 +669,7 @@ pub(crate) fn generate_aux_patches( .and_then(|c| c.first()) .map(|n| n.pretty()) .unwrap_or_default(); - if *crate::ix::compile::IX_TIMING && _p1_elapsed.as_secs_f32() > 0.5 { + if *crate::compile::IX_TIMING && _p1_elapsed.as_secs_f32() > 0.5 { eprintln!( "[gen_patches] {:?} recGen={:.2}s patches={}", _gen_label, @@ -721,13 +721,13 @@ pub(crate) fn generate_aux_patches( ) { let rep_ctors = match lean_env.get(rep) { - Some(crate::ix::env::ConstantInfo::InductInfo(v)) => { + Some(ix_common::env::ConstantInfo::InductInfo(v)) => { v.ctors.clone() }, _ => vec![], }; let alias_ctors = match lean_env.get(alias) { - Some(crate::ix::env::ConstantInfo::InductInfo(v)) => { + Some(ix_common::env::ConstantInfo::InductInfo(v)) => { v.ctors.clone() }, _ => vec![], @@ -896,7 +896,7 @@ pub(crate) fn generate_aux_patches( /// This distinguishes `.below` auxiliaries from coincidental name collisions /// like structure field accessors (e.g., `NewDecl.below : NewDecl → LocalDecl`). fn is_below_shaped(typ: &LeanExpr) -> bool { - use crate::ix::env::ExprData; + use ix_common::env::ExprData; let mut cur = typ; loop { match cur.as_data() { @@ -914,16 +914,16 @@ fn is_below_shaped(typ: &LeanExpr) -> bool { /// and may differ from the originals in `lean_env`. The canonical TC /// (`stt.canon_tc`) uses `canon_kenv` exclusively, so it sees the /// correct types for PProd(motive, I.below ...) inference. -pub(crate) fn populate_canon_kenv_with_below( +pub fn populate_canon_kenv_with_below( below_consts: &[below::BelowConstant], sorted_classes: &[Vec], - lean_env: &crate::ix::env::Env, + lean_env: &ix_common::env::Env, stt: &CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + kctx: &mut crate::compile::KernelCtx, ) { - use crate::ix::kernel::constant::KConst; - use crate::ix::kernel::id::KId; - use crate::ix::kernel::ingress::{ + use ix_kernel::constant::KConst; + use ix_kernel::id::KId; + use ix_kernel::ingress::{ lean_expr_to_zexpr_with_kenv, resolve_lean_name_addr, }; @@ -965,9 +965,9 @@ pub(crate) fn populate_canon_kenv_with_below( KConst::Defn { name: d.name.clone(), level_params: d.level_params.clone(), - kind: crate::ix::ixon::constant::DefKind::Definition, - safety: crate::ix::env::DefinitionSafety::Safe, - hints: crate::ix::env::ReducibilityHints::Abbrev, + kind: ixon::constant::DefKind::Definition, + safety: ix_common::env::DefinitionSafety::Safe, + hints: ix_common::env::ReducibilityHints::Abbrev, lvls: d.level_params.len() as u64, ty: ty_z, val: val_z, diff --git a/src/ix/compile/aux_gen/below.rs b/crates/compile/src/compile/aux_gen/below.rs similarity index 98% rename from src/ix/compile/aux_gen/below.rs rename to crates/compile/src/compile/aux_gen/below.rs index a483e83f..407dc5e7 100644 --- a/src/ix/compile/aux_gen/below.rs +++ b/crates/compile/src/compile/aux_gen/below.rs @@ -8,12 +8,12 @@ //! //! Follows `refs/lean4/src/Lean/Meta/Constructions/BRecOn.lean:59-108`. -use crate::ix::compile::nat_conv::{nat_to_usize, try_nat_to_usize}; -use crate::ix::env::{ +use crate::compile::nat_conv::{nat_to_usize, try_nat_to_usize}; +use ix_common::env::{ BinderInfo, ConstantInfo, ConstructorVal, Env as LeanEnv, Expr as LeanExpr, ExprData, InductiveVal, Level, LevelData, Name, RecursorVal, }; -use crate::ix::ixon::CompileError; +use ixon::CompileError; use super::expr_utils::{ LocalDecl, decompose_apps, find_motive_fvar, forall_telescope, fresh_fvar, @@ -38,7 +38,7 @@ pub(super) fn aux_rec_suffix_idx(aux_rec_name: &Name) -> Option { /// A generated `.below` constant — either a definition (Type-level) /// or an inductive (Prop-level). #[derive(Clone)] -pub(crate) enum BelowConstant { +pub enum BelowConstant { /// Type-level `.below`: a reducible definition using `.rec` + PProd. Def(BelowDef), /// Prop-level `.below`: an inductive type with constructors. @@ -53,7 +53,7 @@ pub(crate) enum BelowConstant { /// type or value references an unsafe constant — for unsafe inductives this /// always triggers because `.below` mentions the parent inductive's `.rec`. #[derive(Clone)] -pub(crate) struct BelowDef { +pub struct BelowDef { pub name: Name, pub level_params: Vec, pub typ: LeanExpr, @@ -63,7 +63,7 @@ pub(crate) struct BelowDef { /// A generated `.below` inductive (Prop-level case). #[derive(Clone)] -pub(crate) struct BelowIndc { +pub struct BelowIndc { pub name: Name, pub level_params: Vec, pub n_params: usize, @@ -87,7 +87,7 @@ pub(crate) struct BelowIndc { /// A constructor for a Prop-level `.below` inductive. #[derive(Clone)] -pub(crate) struct BelowCtor { +pub struct BelowCtor { pub name: Name, pub typ: LeanExpr, pub n_params: usize, @@ -107,13 +107,13 @@ pub(crate) struct BelowCtor { /// Note: `is_prop` is distinct from `is_large`. A Prop inductive with single /// constructors and all-Prop fields gets large elimination (`drec`), but Lean /// still generates `.below` as an inductive via `IndPredBelow`. -pub(crate) fn generate_below_constants( +pub fn generate_below_constants( sorted_classes: &[Vec], canonical_recs: &[(Name, RecursorVal)], lean_env: &LeanEnv, is_prop: bool, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) -> Result, CompileError> { let n_classes = sorted_classes.len(); if n_classes == 0 || canonical_recs.is_empty() { @@ -262,7 +262,7 @@ pub(crate) fn generate_below_constants( /// Build a single `.below` definition for a Type-level inductive. /// /// The `.below` definition's value is: -/// ``` +/// ```text /// λ {params} {motives} (indices) (major), /// I.rec.{succ(rlvl), lvls...} params /// (λ (indices) (major), Sort rlvl) -- for each motive @@ -276,8 +276,8 @@ fn build_below_def( lean_env: &LeanEnv, n_classes: usize, canonical_recs: &[(Name, RecursorVal)], - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) -> Result { let n_params = try_nat_to_usize(&rec_val.num_params)?; let n_motives = try_nat_to_usize(&rec_val.num_motives)?; @@ -475,8 +475,8 @@ fn build_below_value( rlvl: &Level, _n_classes: usize, _canonical_recs: &[(Name, RecursorVal)], - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) -> Result { let n_params = try_nat_to_usize(&rec_val.num_params)?; let n_motives = try_nat_to_usize(&rec_val.num_motives)?; @@ -1687,10 +1687,10 @@ fn mk_imax_aux(l1: &Level, l2: &Level) -> Level { /// Uses raw `Level::succ` / `Level::max` to faithfully preserve the kernel's /// level structure — no distribution of Succ over Max, no subsumption. pub(super) fn kuniv_to_level( - u: &crate::ix::kernel::level::KUniv, + u: &ix_kernel::level::KUniv, param_names: &[Name], ) -> Level { - use crate::ix::kernel::level::UnivData; + use ix_kernel::level::UnivData; match u.data() { UnivData::Zero(_) => Level::zero(), UnivData::Succ(inner, _) => Level::succ(kuniv_to_level(inner, param_names)), @@ -1774,7 +1774,7 @@ pub(super) fn mk_punit_unit(lvl: &Level) -> LeanExpr { /// Used when extracting motive domains from the recursor type for Prop-level /// `.below` inductives. The recursor may have large elimination (extra `u` /// param), but `.below` motives always target Prop. -pub(crate) fn replace_result_sort_with_prop(expr: &LeanExpr) -> LeanExpr { +pub fn replace_result_sort_with_prop(expr: &LeanExpr) -> LeanExpr { match expr.as_data() { ExprData::ForallE(name, dom, body, bi, _) => LeanExpr::all( name.clone(), diff --git a/src/ix/compile/aux_gen/brecon.rs b/crates/compile/src/compile/aux_gen/brecon.rs similarity index 98% rename from src/ix/compile/aux_gen/brecon.rs rename to crates/compile/src/compile/aux_gen/brecon.rs index dff154d8..fdcd0582 100644 --- a/src/ix/compile/aux_gen/brecon.rs +++ b/crates/compile/src/compile/aux_gen/brecon.rs @@ -8,13 +8,13 @@ //! `.brecOn.go` uses PProd-wrapped motives; `.brecOn` projects first component. //! Reference: `refs/lean4/src/Lean/Meta/Constructions/BRecOn.lean:191-308` -use crate::ix::compile::nat_conv::try_nat_to_usize; -use crate::ix::env::{ +use crate::compile::nat_conv::try_nat_to_usize; +use bignat::Nat; +use ix_common::env::{ BinderInfo, ConstantInfo, Env as LeanEnv, Expr as LeanExpr, ExprData, InductiveVal, Level, LevelData, Name, RecursorVal, }; -use crate::ix::ixon::CompileError; -use lean_ffi::nat::Nat; +use ixon::CompileError; use super::below::{ BelowConstant, mk_level_succ, mk_pprod, mk_pprod_mk, mk_punit_unit, @@ -44,7 +44,7 @@ use rustc_hash::FxHashMap; /// `.brecOn.eq`. `.go` and `.brecOn` are always `Defn`; `.eq` is `Thm` /// (safe) or unsafe `Defn` with `hints := .opaque`. #[derive(Clone)] -pub(crate) struct BRecOnDef { +pub struct BRecOnDef { pub name: Name, pub level_params: Vec, pub typ: LeanExpr, @@ -59,14 +59,14 @@ pub(crate) struct BRecOnDef { /// from Phase 1 and the `.below` constants from Phase 2. /// `is_prop` determines whether to generate Prop-level (single theorem) or /// Type-level (`.brecOn.go` + `.brecOn`) forms. -pub(crate) fn generate_brecon_constants( +pub fn generate_brecon_constants( sorted_classes: &[Vec], canonical_recs: &[(Name, RecursorVal)], below_consts: &[BelowConstant], lean_env: &LeanEnv, is_prop: bool, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) -> Result, CompileError> { let n_classes = sorted_classes.len(); if n_classes == 0 || canonical_recs.is_empty() || below_consts.is_empty() { @@ -623,8 +623,8 @@ fn build_type_brecon_fvar( below_names: &[Name], lean_env: &LeanEnv, n_classes: usize, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) -> Result, CompileError> { // canon_kenv is populated by `populate_canon_kenv_with_below` in // aux_gen.rs between Phase 2 and Phase 3. It contains PUnit, PProd, @@ -1076,16 +1076,15 @@ fn build_type_brecon_fvar( }, ]; - if let Some((eq_typ, eq_val)) = eq_result { - results.push(BRecOnDef { - name: eq_name, - level_params: rec_level_params.clone(), - typ: eq_typ, - value: eq_val, - is_unsafe, - is_prop: false, - }); - } + let (eq_typ, eq_val) = eq_result; + results.push(BRecOnDef { + name: eq_name, + level_params: rec_level_params.clone(), + typ: eq_typ, + value: eq_val, + is_unsafe, + is_prop: false, + }); Ok(results) } @@ -1441,18 +1440,14 @@ fn build_type_brecon_eq_fvar( // `Eq` and `HEq` binders in `motive_wrapped` and // `build_minor_via_cases_sim`'s remaining list. rec_level_params: &[Name], - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, -) -> Option<(LeanExpr, LeanExpr)> { - // .brecOn.eq requires Eq and Eq.refl as constants. In the full pipeline, - // aux_gen is only called when the original Lean environment has these - // constants, so this always succeeds. But in minimal test environments - // (e.g., unit tests with synthetic inductives), Eq may not exist. - // Return None in that case — matching the old BVar code's behavior. - // - // TODO: Accept a lean_env parameter and check lean_env.get("Eq").is_some() - // for a more principled guard. For now, we always generate .eq since the - // real pipeline guarantees Eq exists. + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, +) -> (LeanExpr, LeanExpr) { + // .brecOn.eq requires Eq and Eq.refl as constants. The real pipeline only + // calls aux_gen when the original Lean environment has these, so this + // always succeeds. If a future minimal-test caller needs to opt out (e.g. + // a synthetic inductive without Eq), reintroduce an `Option` return or + // gate via a `lean_env.get("Eq").is_some()` check. let _ = n_minors; let _n_motives = motive_fvars.len(); @@ -1577,7 +1572,7 @@ fn build_type_brecon_eq_fvar( kctx, ); if let Some(eq_value) = eq_value_opt { - return Some((eq_type, eq_value)); + return (eq_type, eq_value); } // Fall through to the simple path if the indexed construction // couldn't be completed (e.g., missing ctor info). @@ -1717,7 +1712,7 @@ fn build_type_brecon_eq_fvar( let eq_value = mk_lambda(eq_val, all_decls); - Some((eq_type, eq_value)) + (eq_type, eq_value) } // ========================================================================= @@ -1785,8 +1780,8 @@ fn build_indexed_eq_value( // `Eq` and `HEq` binders (matching Lean's `mkEqAndProof` in // `refs/lean4/src/Lean/Meta/Tactic/Cases.lean:30-37`). rec_level_params: &[Name], - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) -> Option { let n_indices = index_decls.len(); let outer_major = &major_fvars[0]; diff --git a/src/ix/compile/aux_gen/cases_on.rs b/crates/compile/src/compile/aux_gen/cases_on.rs similarity index 98% rename from src/ix/compile/aux_gen/cases_on.rs rename to crates/compile/src/compile/aux_gen/cases_on.rs index 4d2ec2e7..b14a4163 100644 --- a/src/ix/compile/aux_gen/cases_on.rs +++ b/crates/compile/src/compile/aux_gen/cases_on.rs @@ -10,8 +10,8 @@ //! //! Follows `refs/lean4/src/library/constructions/cases_on.cpp`. -use crate::ix::compile::aux_gen::AuxDef; -use crate::ix::env::{ +use crate::compile::aux_gen::AuxDef; +use ix_common::env::{ BinderInfo, ConstantInfo, Env as LeanEnv, Expr as LeanExpr, ExprData, Level, Name, RecursorVal, }; @@ -53,7 +53,7 @@ fn mk_pi_unit(e: &LeanExpr, unit: &LeanExpr) -> LeanExpr { /// Uses FVar-based construction: opens the rec type into FVars, builds /// casesOn type and value using FVar references, then abstracts with /// mk_forall/mk_lambda. -pub(crate) fn generate_cases_on( +pub fn generate_cases_on( name: &Name, rec_val: &RecursorVal, lean_env: &LeanEnv, @@ -65,7 +65,7 @@ pub(crate) fn generate_cases_on( // Extract target inductive name from "A.casesOn" → "A" let target_ind = match name.as_data() { - crate::ix::env::NameData::Str(parent, s, _) if s == "casesOn" => { + ix_common::env::NameData::Str(parent, s, _) if s == "casesOn" => { parent.clone() }, _ => return None, @@ -370,8 +370,8 @@ fn get_minor_name( #[cfg(test)] mod tests { use super::*; - use crate::ix::env::{BinderInfo, ConstantVal, InductiveVal, Literal}; - use lean_ffi::nat::Nat; + use bignat::Nat; + use ix_common::env::{BinderInfo, ConstantVal, InductiveVal, Literal}; fn mk_name_for(s: &str) -> Name { let mut n = Name::anon(); diff --git a/src/ix/compile/aux_gen/expr_utils.rs b/crates/compile/src/compile/aux_gen/expr_utils.rs similarity index 96% rename from src/ix/compile/aux_gen/expr_utils.rs rename to crates/compile/src/compile/aux_gen/expr_utils.rs index 986dc6f0..92105974 100644 --- a/src/ix/compile/aux_gen/expr_utils.rs +++ b/crates/compile/src/compile/aux_gen/expr_utils.rs @@ -9,14 +9,14 @@ use rustc_hash::{FxHashMap, FxHashSet}; -use crate::ix::address::Address; -use crate::ix::compile::nat_conv::{nat_to_u64, nat_to_usize}; -use crate::ix::env::{ +use crate::compile::nat_conv::{nat_to_u64, nat_to_usize}; +use bignat::Nat; +use ix_common::address::Address; +use ix_common::env::{ BinderInfo, Expr as LeanExpr, ExprData, Level, LevelData, Name, }; -use crate::ix::kernel::ingress::{lean_level_to_kuniv, resolve_lean_name_addr}; -use crate::ix::kernel::mode::Meta; -use lean_ffi::nat::Nat; +use ix_kernel::ingress::{lean_level_to_kuniv, resolve_lean_name_addr}; +use ix_kernel::mode::Meta; // ========================================================================= // FVar infrastructure @@ -28,7 +28,7 @@ use lean_ffi::nat::Nat; /// FVar space. The `fvar_name` is a unique identifier; `binder_name` is /// the cosmetic name that appears in the final forall/lambda chain. #[derive(Clone)] -pub(crate) struct LocalDecl { +pub struct LocalDecl { pub fvar_name: Name, pub binder_name: Name, pub domain: LeanExpr, @@ -36,7 +36,7 @@ pub(crate) struct LocalDecl { } /// Create a fresh FVar with a unique name derived from `prefix` and `idx`. -pub(crate) fn fresh_fvar(prefix: &str, idx: usize) -> (Name, LeanExpr) { +pub fn fresh_fvar(prefix: &str, idx: usize) -> (Name, LeanExpr) { let name = Name::str(Name::anon(), format!("_{}_{}", prefix, idx)); let fvar = LeanExpr::fvar(name.clone()); (name, fvar) @@ -119,13 +119,13 @@ pub(super) struct IndRecInfo { /// loop body and terminates peeling, potentially yielding a shorter /// `indices` vec than Lean's stored `num_indices`. pub(super) fn decompose_inductive_type( - ind: &crate::ix::env::InductiveVal, + ind: &ix_common::env::InductiveVal, ind_univs: &[Level], param_fvars: &[LocalDecl], - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, -) -> Result { - use crate::ix::ixon::CompileError; + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, +) -> Result { + use ixon::CompileError; let n_params = param_fvars.len(); let ty = subst_levels(&ind.cnst.typ, &ind.cnst.level_params, ind_univs); @@ -274,7 +274,7 @@ pub(super) fn decompose_inductive_type( /// position MUST verify `decls.len() == n` before indexing — otherwise /// a surprising input shape becomes a panic. Prefer /// [`forall_telescope_exact`] when a precise arity is required. -pub(crate) fn forall_telescope( +pub fn forall_telescope( expr: &LeanExpr, n: usize, prefix: &str, @@ -322,10 +322,7 @@ pub(super) fn forall_telescope_exact( start_idx: usize, context: &str, what: &str, -) -> Result< - (Vec, Vec, LeanExpr), - crate::ix::ixon::CompileError, -> { +) -> Result<(Vec, Vec, LeanExpr), ixon::CompileError> { let (fvars, decls, body) = forall_telescope(expr, n, prefix, start_idx); if decls.len() != n { // Include enough context to pinpoint the shape problem: every peeled @@ -337,7 +334,7 @@ pub(super) fn forall_telescope_exact( format!("{}:{}", d.binder_name.pretty(), describe_expr_head(&d.domain)) }) .collect(); - return Err(crate::ix::ixon::CompileError::UnsupportedExpr { + return Err(ixon::CompileError::UnsupportedExpr { desc: format!( "{context}: expected {n} leading foralls ({what}), got {actual}. \ Peeled binders (name:domain_kind): [{binders}]. \ @@ -447,7 +444,7 @@ pub(super) fn mk_forall(body: LeanExpr, binders: &[LocalDecl]) -> LeanExpr { /// Build a lambda chain by batch-abstracting all FVars in a single pass. /// /// Same semantics as `mk_forall` but produces `λ (x : T), body`. -pub(crate) fn mk_lambda(body: LeanExpr, binders: &[LocalDecl]) -> LeanExpr { +pub fn mk_lambda(body: LeanExpr, binders: &[LocalDecl]) -> LeanExpr { mk_binder_chain(body, binders, BinderKind::Lambda) } @@ -601,10 +598,7 @@ pub(super) fn batch_abstract( /// /// `instantiate1` is used when peeling forall binders during recursor /// construction (matching Lean C++ and lean4lean). -pub(crate) fn instantiate1( - body: &LeanExpr, - replacement: &LeanExpr, -) -> LeanExpr { +pub fn instantiate1(body: &LeanExpr, replacement: &LeanExpr) -> LeanExpr { instantiate1_at(body, replacement, 0) } @@ -862,7 +856,7 @@ pub(super) fn shift_vars( // ========================================================================= /// Substitute universe parameters in expressions. -pub(crate) fn subst_levels( +pub fn subst_levels( expr: &LeanExpr, params: &[Name], univs: &[Level], @@ -1259,7 +1253,7 @@ impl<'a> RestoreState<'a> { } /// Open lambda binders into FVars (matching forall_telescope but for lambdas). -pub(crate) fn lambda_telescope( +pub fn lambda_telescope( expr: &LeanExpr, n: usize, prefix: &str, @@ -1490,7 +1484,7 @@ pub(super) fn mk_const(name: &Name, univs: &[Level]) -> LeanExpr { /// /// Called by the kernel's `mk_local_decl` during inductive processing /// to ensure parameter/field types are clean before entering the local context. -pub(crate) fn consume_type_annotations(e: &LeanExpr) -> LeanExpr { +pub fn consume_type_annotations(e: &LeanExpr) -> LeanExpr { let (head, args) = decompose_apps(e); if let ExprData::Const(name, _, _) = head.as_data() { let n = name.pretty(); @@ -1507,7 +1501,7 @@ pub(crate) fn consume_type_annotations(e: &LeanExpr) -> LeanExpr { } /// Decompose an application spine: `f a1 a2 ... an` -> `(f, [a1, ..., an])`. -pub(crate) fn decompose_apps(expr: &LeanExpr) -> (LeanExpr, Vec) { +pub fn decompose_apps(expr: &LeanExpr) -> (LeanExpr, Vec) { let mut args = Vec::new(); let mut cur = expr.clone(); while let ExprData::App(f, a, _) = cur.as_data() { @@ -1724,14 +1718,14 @@ pub(super) fn find_motive_fvar( /// ``` /// Ensure PUnit and PProd are in the given kenv for kernel type inference. /// Accepts `kctx` so callers can choose which KernelCtx to populate. -pub(crate) fn ensure_prelude_in_kenv_of( - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, +pub fn ensure_prelude_in_kenv_of( + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) { - use crate::ix::kernel::constant::KConst; - use crate::ix::kernel::expr::KExpr; - use crate::ix::kernel::id::KId; - use crate::ix::kernel::level::KUniv; + use ix_kernel::constant::KConst; + use ix_kernel::expr::KExpr; + use ix_kernel::id::KId; + use ix_kernel::level::KUniv; let n2a = Some(&stt.name_to_addr); let aux_n2a = Some(&stt.aux_name_to_addr); @@ -1950,17 +1944,15 @@ pub(crate) fn ensure_prelude_in_kenv_of( /// requires the parent). fn ensure_in_kenv_of_inner_env( name: &Name, - lean_env: &crate::ix::env::Env, - stt: &crate::ix::compile::CompileState, - kenv: &mut crate::ix::kernel::env::KEnv, + lean_env: &ix_common::env::Env, + stt: &crate::compile::CompileState, + kenv: &mut ix_kernel::env::KEnv, replace_axio_stub: bool, ) { - use crate::ix::env::{ConstantInfo as LCI, DefinitionSafety}; - use crate::ix::kernel::constant::KConst; - use crate::ix::kernel::id::KId; - use crate::ix::kernel::ingress::{ - lean_expr_to_zexpr_cached, param_names_hash, - }; + use ix_common::env::{ConstantInfo as LCI, DefinitionSafety}; + use ix_kernel::constant::KConst; + use ix_kernel::id::KId; + use ix_kernel::ingress::{lean_expr_to_zexpr_cached, param_names_hash}; let n2a = Some(&stt.name_to_addr); let aux_n2a = Some(&stt.aux_name_to_addr); @@ -1982,10 +1974,10 @@ fn ensure_in_kenv_of_inner_env( // Helper: convert a LeanExpr to KExpr with the given level param names, // using the KEnv's persistent ingress cache. Callers are top-level, so // we start with an empty binder-name stack. - let to_z = |expr: &crate::ix::env::Expr, + let to_z = |expr: &ix_common::env::Expr, lp: &[Name], - kenv: &mut crate::ix::kernel::env::KEnv| - -> crate::ix::kernel::expr::KExpr { + kenv: &mut ix_kernel::env::KEnv| + -> ix_kernel::expr::KExpr { let pn_h = param_names_hash(lp); let mut binder_names: Vec = Vec::new(); lean_expr_to_zexpr_cached( @@ -2059,7 +2051,7 @@ fn ensure_in_kenv_of_inner_env( KConst::Defn { name: name.clone(), level_params: lp.clone(), - kind: crate::ix::ixon::constant::DefKind::Definition, + kind: ixon::constant::DefKind::Definition, safety: d.safety, hints: d.hints, lvls: lp.len() as u64, @@ -2079,9 +2071,9 @@ fn ensure_in_kenv_of_inner_env( KConst::Defn { name: name.clone(), level_params: lp.clone(), - kind: crate::ix::ixon::constant::DefKind::Theorem, + kind: ixon::constant::DefKind::Theorem, safety: DefinitionSafety::Safe, - hints: crate::ix::env::ReducibilityHints::Opaque, + hints: ix_common::env::ReducibilityHints::Opaque, lvls: lp.len() as u64, ty, val, @@ -2099,9 +2091,9 @@ fn ensure_in_kenv_of_inner_env( KConst::Defn { name: name.clone(), level_params: lp.clone(), - kind: crate::ix::ixon::constant::DefKind::Opaque, + kind: ixon::constant::DefKind::Opaque, safety: DefinitionSafety::Safe, - hints: crate::ix::env::ReducibilityHints::Opaque, + hints: ix_common::env::ReducibilityHints::Opaque, lvls: lp.len() as u64, ty, val, @@ -2157,9 +2149,9 @@ fn ensure_in_kenv_of_inner_env( fn ensure_in_kenv_of_inner( name: &Name, - lean_env: &crate::ix::env::Env, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + lean_env: &ix_common::env::Env, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, replace_axio_stub: bool, ) { ensure_in_kenv_of_inner_env( @@ -2171,11 +2163,11 @@ fn ensure_in_kenv_of_inner( ); } -pub(crate) fn ensure_in_kenv_of( +pub fn ensure_in_kenv_of( name: &Name, - lean_env: &crate::ix::env::Env, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + lean_env: &ix_common::env::Env, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) { ensure_in_kenv_of_inner(name, lean_env, stt, kctx, false); } @@ -2183,30 +2175,30 @@ pub(crate) fn ensure_in_kenv_of( /// Like [`ensure_in_kenv_of`], but upgrades an existing type-only `Axio` /// stub into the real constant. This is required before WHNF paths that must /// unfold reducible definitions or inspect inductive/ctor metadata. -pub(crate) fn ensure_full_in_kenv_of( +pub fn ensure_full_in_kenv_of( name: &Name, - lean_env: &crate::ix::env::Env, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + lean_env: &ix_common::env::Env, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) { ensure_in_kenv_of_inner(name, lean_env, stt, kctx, true); } fn ensure_full_in_tc_env( name: &Name, - lean_env: &crate::ix::env::Env, - stt: &crate::ix::compile::CompileState, - kenv: &mut crate::ix::kernel::env::KEnv, + lean_env: &ix_common::env::Env, + stt: &crate::compile::CompileState, + kenv: &mut ix_kernel::env::KEnv, ) { ensure_in_kenv_of_inner_env(name, lean_env, stt, kenv, true); } /// Convenience wrapper: ingress into the **original** kenv (`stt.kctx`). -pub(crate) fn ensure_in_kenv( +pub fn ensure_in_kenv( name: &Name, - lean_env: &crate::ix::env::Env, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + lean_env: &ix_common::env::Env, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) { ensure_in_kenv_of(name, lean_env, stt, kctx); } @@ -2224,8 +2216,8 @@ pub(super) struct TcScope<'a> { fvar_levels: FxHashMap, base_depth: usize, param_names: &'a [Name], - stt: &'a crate::ix::compile::CompileState, - tc: crate::ix::kernel::tc::TypeChecker<'a, Meta>, + stt: &'a crate::compile::CompileState, + tc: ix_kernel::tc::TypeChecker<'a, Meta>, /// How many extra locals are currently pushed above base_depth. extra_locals: usize, } @@ -2235,8 +2227,8 @@ impl<'a> TcScope<'a> { pub(super) fn new( outer_fvar_ctx: &[LocalDecl], param_names: &'a [Name], - stt: &'a crate::ix::compile::CompileState, - kctx: &'a mut crate::ix::compile::KernelCtx, + stt: &'a crate::compile::CompileState, + kctx: &'a mut crate::compile::KernelCtx, ) -> Self { let fvar_levels: FxHashMap = outer_fvar_ctx .iter() @@ -2244,7 +2236,7 @@ impl<'a> TcScope<'a> { .map(|(i, decl)| (decl.fvar_name.clone(), i)) .collect(); - let mut tc = crate::ix::kernel::tc::TypeChecker::new(&mut kctx.kenv); + let mut tc = ix_kernel::tc::TypeChecker::new(&mut kctx.kenv); tc.infer_only = true; // Push outer FVar types once. @@ -2347,9 +2339,9 @@ impl<'a> TcScope<'a> { fn get_level_error( &self, ty: &LeanExpr, - kexpr: &crate::ix::kernel::expr::KExpr, - e: &crate::ix::kernel::error::TcError, - ) -> crate::ix::ixon::CompileError { + kexpr: &ix_kernel::expr::KExpr, + e: &ix_kernel::error::TcError, + ) -> ixon::CompileError { eprintln!("[TcScope::get_level] FAILED"); eprintln!(" lean_expr: {}", ty.pretty()); eprintln!(" kexpr: {kexpr}"); @@ -2361,10 +2353,10 @@ impl<'a> TcScope<'a> { self.extra_locals ); // Dump kenv entries for constants referenced in the expression. - let mut stack: Vec<&crate::ix::kernel::expr::KExpr> = vec![kexpr]; + let mut stack: Vec<&ix_kernel::expr::KExpr> = vec![kexpr]; let mut seen_ids = std::collections::HashSet::new(); while let Some(expr) = stack.pop() { - use crate::ix::kernel::expr::ExprData as ZED; + use ix_kernel::expr::ExprData as ZED; match expr.data() { ZED::Const(id, us, _) => { if seen_ids.insert(id.clone()) { @@ -2391,7 +2383,7 @@ impl<'a> TcScope<'a> { _ => {}, } } - crate::ix::ixon::CompileError::UnsupportedExpr { + ixon::CompileError::UnsupportedExpr { desc: format!( "TcScope::get_level({}): tc.infer failed: {e}", ty.pretty() @@ -2412,7 +2404,7 @@ impl<'a> TcScope<'a> { pub(super) fn get_level( &mut self, ty: &LeanExpr, - ) -> Result { + ) -> Result { // Fast path: read Sort level from stored type (matching Lean's // inferAppType which peels foralls without substituting term args). // Sort levels use level params, not BVars, so the level is correct @@ -2432,14 +2424,14 @@ impl<'a> TcScope<'a> { let inferred = loop { match self.tc.infer(&kexpr) { Ok(inferred) => break inferred, - Err(crate::ix::kernel::error::TcError::UnknownConst(addr)) + Err(ix_kernel::error::TcError::UnknownConst(addr)) if faulted_addrs.insert(addr.clone()) && self.fault_in_addr(&addr) => {}, Err(e) => return Err(self.get_level_error(ty, &kexpr, &e)), } }; let ku = self.tc.ensure_sort(&inferred).map_err(|e| { - crate::ix::ixon::CompileError::UnsupportedExpr { + ixon::CompileError::UnsupportedExpr { desc: format!("TcScope::get_level: ensure_sort failed: {e}"), } })?; @@ -2463,7 +2455,7 @@ impl<'a> TcScope<'a> { /// Check if a Level is guaranteed non-zero. Matches Lean's `is_not_zero`: /// true for Succ(_), Param, Max(a,b) where either is not-zero. fn is_not_zero_level(l: &Level) -> bool { - use crate::ix::env::LevelData; + use ix_common::env::LevelData; match l.as_data() { LevelData::Succ(_, _) => true, LevelData::Max(a, b, _) => { @@ -2484,8 +2476,8 @@ impl<'a> TcScope<'a> { /// application, not enough foralls, result isn't Sort, or the constant /// isn't found in the kernel env). fn try_infer_app_sort_level(&self, ty: &LeanExpr) -> Option { - use crate::ix::env::ExprData; - use crate::ix::kernel::expr::ExprData as ZED; + use ix_common::env::ExprData; + use ix_kernel::expr::ExprData as ZED; // Decompose into head constant + args. let (head, args) = decompose_apps(ty); @@ -2498,7 +2490,7 @@ impl<'a> TcScope<'a> { let n2a = Some(&self.stt.name_to_addr); let aux_n2a = Some(&self.stt.aux_name_to_addr); let addr = resolve_lean_name_addr(name, n2a, aux_n2a); - let kid = crate::ix::kernel::id::KId::new(addr, name.clone()); + let kid = ix_kernel::id::KId::new(addr, name.clone()); let kconst = self.tc.env.get(&kid)?; let kty = kconst.ty(); @@ -2535,10 +2527,10 @@ impl<'a> TcScope<'a> { /// the concrete levels from a Const's level args. fn kuniv_to_level_with_const_levels( &self, - u: &crate::ix::kernel::level::KUniv, + u: &ix_kernel::level::KUniv, const_levels: &[Level], ) -> Level { - use crate::ix::kernel::level::UnivData; + use ix_kernel::level::UnivData; match u.data() { UnivData::Zero(_) => Level::zero(), UnivData::Succ(inner, _) => { @@ -2681,13 +2673,13 @@ impl<'a> TcScope<'a> { /// `Mdata` layers carried by the kernel expression are re-wrapped around /// the result in original order — matching `egress_expr`. pub(super) fn kexpr_to_lean( - expr: &crate::ix::kernel::expr::KExpr, + expr: &ix_kernel::expr::KExpr, outer_depth: usize, fvar_levels: &FxHashMap, local_depth: usize, param_names: &[Name], ) -> LeanExpr { - use crate::ix::kernel::expr::ExprData as KED; + use ix_kernel::expr::ExprData as KED; // Reverse `fvar_levels` lazily via linear search — the FVar context is // small in practice (a handful of param/motive/minor/index binders), @@ -2772,11 +2764,11 @@ pub(super) fn kexpr_to_lean( kexpr_to_lean(val, outer_depth, fvar_levels, local_depth, param_names), ), KED::Nat(n, _, _) => { - use crate::ix::env::Literal; + use ix_common::env::Literal; LeanExpr::lit(Literal::NatVal(n.clone())) }, KED::Str(s, _, _) => { - use crate::ix::env::Literal; + use ix_common::env::Literal; LeanExpr::lit(Literal::StrVal(s.clone())) }, }; @@ -2805,8 +2797,8 @@ fn collect_lean_source_name_hints( fvar_levels: &FxHashMap, depth: usize, param_names: &[Name], - stt: &crate::ix::compile::CompileState, - out: &mut FxHashMap, + stt: &crate::compile::CompileState, + out: &mut FxHashMap, ) { if source_name_hint_candidate(source) && !expr_has_bvar(source) { let key = @@ -2909,8 +2901,8 @@ fn restore_lean_source_name_hints( fvar_levels: &FxHashMap, depth: usize, param_names: &[Name], - stt: &crate::ix::compile::CompileState, - hints: &FxHashMap, + stt: &crate::compile::CompileState, + hints: &FxHashMap, ) -> LeanExpr { if source_name_hint_candidate(generated) && !expr_has_bvar(generated) { let key = to_kexpr_static(generated, fvar_levels, depth, param_names, stt) @@ -3061,7 +3053,7 @@ fn expr_has_bvar(expr: &LeanExpr) -> bool { fn restore_source_names_same_content( generated: &LeanExpr, source: &LeanExpr, - stt: &crate::ix::compile::CompileState, + stt: &crate::compile::CompileState, ) -> LeanExpr { let source = strip_mdata_ref(source); @@ -3077,7 +3069,7 @@ fn restore_source_names_same_content( fn restore_source_names_same_content_inner( generated: &LeanExpr, source: &LeanExpr, - stt: &crate::ix::compile::CompileState, + stt: &crate::compile::CompileState, ) -> LeanExpr { match (generated.as_data(), source.as_data()) { ( @@ -3146,7 +3138,7 @@ fn strip_mdata_ref(mut expr: &LeanExpr) -> &LeanExpr { fn same_resolved_name_addr( a: &Name, b: &Name, - stt: &crate::ix::compile::CompileState, + stt: &crate::compile::CompileState, ) -> bool { if a == b { return true; @@ -3167,13 +3159,13 @@ fn to_kexpr_static( fvar_levels: &FxHashMap, ctx_depth: usize, param_names: &[Name], - stt: &crate::ix::compile::CompileState, -) -> crate::ix::kernel::expr::KExpr { + stt: &crate::compile::CompileState, +) -> ix_kernel::expr::KExpr { let n2a = Some(&stt.name_to_addr); let aux_n2a = Some(&stt.aux_name_to_addr); - use crate::ix::kernel::expr::KExpr; - use crate::ix::kernel::id::KId; - use crate::ix::kernel::level::KUniv; + use ix_kernel::expr::KExpr; + use ix_kernel::id::KId; + use ix_kernel::level::KUniv; match expr.as_data() { ExprData::Fvar(fname, _) => { @@ -3225,7 +3217,7 @@ fn to_kexpr_static( KExpr::prj(zid, nat_to_u64(idx), ke) }, ExprData::Lit(lit, _) => { - use crate::ix::env::Literal; + use ix_common::env::Literal; match lit { Literal::NatVal(n) => { let addr = Address::hash(&nat_to_u64(n).to_le_bytes()); @@ -3277,7 +3269,7 @@ fn collect_lean_const_refs(expr: &LeanExpr, out: &mut FxHashSet) { #[cfg(test)] mod tests { use super::*; - use crate::ix::env::BinderInfo; + use ix_common::env::BinderInfo; fn mk_name_for(s: &str) -> Name { let mut n = Name::anon(); @@ -3654,7 +3646,7 @@ mod tests { fn consume_type_annotations_strips_known_wrappers() { // `outParam α` reduces to `α`. We use a stub inductive name that the // function recognizes. - use crate::ix::env::BinderInfo; + use ix_common::env::BinderInfo; let inner = sort0(); let wrapped = LeanExpr::app( LeanExpr::cnst(mk_name_for("outParam"), vec![]), diff --git a/src/ix/compile/aux_gen/nested.rs b/crates/compile/src/compile/aux_gen/nested.rs similarity index 98% rename from src/ix/compile/aux_gen/nested.rs rename to crates/compile/src/compile/aux_gen/nested.rs index 726f70a1..5a57d2c2 100644 --- a/src/ix/compile/aux_gen/nested.rs +++ b/crates/compile/src/compile/aux_gen/nested.rs @@ -14,26 +14,26 @@ //! - Spec_params are built in FVar space during detection, then abstracted back //! to BVars for the returned `CompileFlatMember`. +use bignat::Nat; use blake3::Hash; -use lean_ffi::nat::Nat; use rustc_hash::{FxHashMap, FxHashSet}; use super::expr_utils::{ LocalDecl, batch_abstract, decompose_apps, forall_telescope, instantiate_pi_params, instantiate1, mk_forall, subst_levels, }; -use crate::ix::compile::nat_conv::{nat_to_u64, nat_to_usize}; -use crate::ix::env::{ +use crate::compile::nat_conv::{nat_to_u64, nat_to_usize}; +use ix_common::env::{ ConstantInfo, Env as LeanEnv, Expr as LeanExpr, ExprData, Level, Name, }; -use crate::ix::ixon::CompileError; +use ixon::CompileError; /// A member of the flat block (original inductive or nested auxiliary). /// /// Spec_params use BVars relative to the block's parameter context: /// `BVar(0)` = innermost (last) param, `BVar(n_params-1)` = outermost (first). #[derive(Clone)] -pub(crate) struct CompileFlatMember { +pub struct CompileFlatMember { pub name: Name, pub spec_params: Vec, pub occurrence_level_args: Vec, @@ -51,7 +51,7 @@ pub(crate) struct CompileFlatMember { /// Matches the C++ kernel's `elim_nested_inductive_result`: auxiliary types /// like `_nested.Array_1` replace `Array (Part α β)` so that the recursor /// generator can treat all members uniformly. -pub(crate) struct ExpandedBlock { +pub struct ExpandedBlock { /// All types in the expanded block: originals first, then auxiliaries. pub types: Vec, /// `aux_name → nested_expr`: the original nested application with block @@ -82,7 +82,7 @@ pub(crate) struct ExpandedBlock { /// All members share the same `level_params` and `n_params` — auxiliaries /// have the block's parameters, not the external inductive's own parameters. #[derive(Clone)] -pub(crate) struct ExpandedMember { +pub struct ExpandedMember { /// Inductive name: original name for originals, `_nested.ExtInd_N` for /// auxiliaries (scoped under `all[0]`). pub name: Name, @@ -101,7 +101,7 @@ pub(crate) struct ExpandedMember { /// A constructor in the expanded block. #[derive(Clone)] -pub(crate) struct ExpandedCtor { +pub struct ExpandedCtor { /// Constructor name: for auxiliaries, prefixed with aux name. pub name: Name, /// Constructor type with nested refs replaced by aux const applications. @@ -424,7 +424,7 @@ impl<'a> ExpandCtx<'a> { /// /// Matches the C++ kernel's `elim_nested_inductive_fn::operator()()` at /// `refs/lean4/src/kernel/inductive.cpp:1045-1077`. -pub(crate) fn expand_nested_block( +pub fn expand_nested_block( ordered_originals: &[Name], lean_env: &LeanEnv, alias_to_rep: &FxHashMap, @@ -612,9 +612,9 @@ pub(crate) fn expand_nested_block( /// appear in user-visible env: `RestoreCtx` converts them back to /// `ExtInd spec_params` expressions during recursor emission. So renaming /// them by canonical index is purely an internal-labeling change. -pub(crate) fn sort_aux_by_partition_refinement( +pub fn sort_aux_by_partition_refinement( expanded: &mut ExpandedBlock, - stt: &crate::ix::compile::CompileState, + stt: &crate::compile::CompileState, ) -> Result, CompileError> { let n_originals = expanded.n_originals; let n_total = expanded.types.len(); @@ -629,9 +629,9 @@ pub(crate) fn sort_aux_by_partition_refinement( // fixed positional MutRef, so alpha-equivalent originals collapse to the same // aux signature. If any referenced original is unresolved, compare_expr now // errors instead of falling back to namespace-sensitive name hashes. - use crate::ix::compile::{BlockCache, sort_consts}; - use crate::ix::env::{ConstantVal, ConstructorVal, InductiveVal}; - use crate::ix::mutual::{Ind, MutConst}; + use crate::compile::{BlockCache, sort_consts}; + use crate::mutual::{Ind, MutConst}; + use ix_common::env::{ConstantVal, ConstructorVal, InductiveVal}; let level_params = expanded.level_params.clone(); @@ -780,7 +780,7 @@ pub(crate) fn sort_aux_by_partition_refinement( let nested_prefix = { let first_aux_name = &expanded.types[n_originals].name; match first_aux_name.as_data() { - crate::ix::env::NameData::Str(prefix, _, _) => prefix.clone(), + ix_common::env::NameData::Str(prefix, _, _) => prefix.clone(), _ => { return Err(CompileError::InvalidMutualBlock { reason: format!( @@ -806,7 +806,7 @@ pub(crate) fn sort_aux_by_partition_refinement( // Extract the "" identifier from old suffix. let ext_name = match old_name.as_data() { - crate::ix::env::NameData::Str(_, suffix, _) => { + ix_common::env::NameData::Str(_, suffix, _) => { // Old suffix is "_" — strip the trailing "_". let s: &str = suffix.as_ref(); // Find the last underscore — everything before is "". @@ -940,7 +940,7 @@ pub(crate) fn sort_aux_by_partition_refinement( /// /// `original_all` is the source-order Lean `InductiveVal.all` list — /// not alpha-collapsed representatives, and not canonical-aux-sorted. -pub(crate) fn source_aux_order( +pub fn source_aux_order( original_all: &[Name], lean_env: &LeanEnv, ) -> Result)>, CompileError> { @@ -954,7 +954,7 @@ pub(crate) fn source_aux_order( /// Like [`source_aux_order`], but also reports the source mutual-block member /// whose constructor walk first discovered each auxiliary. -pub(crate) fn source_aux_order_with_owner( +pub fn source_aux_order_with_owner( original_all: &[Name], lean_env: &LeanEnv, ) -> Result)>, CompileError> { @@ -990,7 +990,7 @@ fn source_aux_order_from_expanded( /// source auxes whose spec_params reference inductives that belong to /// a different SCC block — those auxes are handled by that block's /// compilation, not ours. -pub(crate) const PERM_OUT_OF_SCC: usize = usize::MAX; +pub const PERM_OUT_OF_SCC: usize = usize::MAX; /// Compute the permutation mapping Lean-source aux-walk positions to /// canonical aux positions. Returns `perm: Vec` @@ -1024,11 +1024,11 @@ pub(crate) const PERM_OUT_OF_SCC: usize = usize::MAX; /// Returns an error if some canonical aux has no matching source. This /// shouldn't happen because canonical members are always a subset (via /// dedup) of what a full source walk would find. -pub(crate) fn compute_aux_perm( +pub fn compute_aux_perm( expanded: &ExpandedBlock, original_all: &[Name], lean_env: &LeanEnv, - stt: &crate::ix::compile::CompileState, + stt: &crate::compile::CompileState, orig_to_canon_names: &std::collections::HashMap, ) -> Result, CompileError> { let n_originals = expanded.n_originals; @@ -1208,12 +1208,12 @@ pub(crate) fn compute_aux_perm( fn aux_spec_eq( canon: &LeanExpr, src: &LeanExpr, - stt: &crate::ix::compile::CompileState, + stt: &crate::compile::CompileState, source_to_canon_fvar: &FxHashMap, cache: &mut FxHashMap<(Hash, Hash), bool>, ) -> bool { - let canon = crate::ix::congruence::strip_mdata(canon); - let src = crate::ix::congruence::strip_mdata(src); + let canon = crate::congruence::strip_mdata(canon); + let src = crate::congruence::strip_mdata(src); let key = (*canon.get_hash(), *src.get_hash()); if let Some(cached) = cache.get(&key) { @@ -1226,7 +1226,7 @@ fn aux_spec_eq( source_to_canon_fvar.get(b).map_or(a == b, |expected| a == expected) }, (ExprData::Sort(a, _), ExprData::Sort(b, _)) => { - crate::ix::congruence::level_alpha_eq(a, b).is_ok() + crate::congruence::level_alpha_eq(a, b).is_ok() }, ( ExprData::Const(a_name, a_lvls, _), @@ -1236,7 +1236,7 @@ fn aux_spec_eq( || a_lvls .iter() .zip(b_lvls.iter()) - .any(|(a, b)| crate::ix::congruence::level_alpha_eq(a, b).is_err()) + .any(|(a, b)| crate::congruence::level_alpha_eq(a, b).is_err()) { return false; } @@ -1669,7 +1669,7 @@ struct FvarFlatMember { /// caught by checking for non-param FVars in the detected spec_params. /// /// Ported from the kernel's `build_flat_block` (`src/ix/kernel/inductive.rs:364-475`). -pub(crate) fn build_compile_flat_block( +pub fn build_compile_flat_block( ordered_originals: &[Name], lean_env: &LeanEnv, ) -> Result, CompileError> { @@ -1680,7 +1680,7 @@ pub(crate) fn build_compile_flat_block( /// environment first for all lookups. Used by the expand/restore path /// to scan expanded constructor types (where nested refs are already /// replaced with auxiliary const applications). -pub(crate) fn build_compile_flat_block_with_overlay( +pub fn build_compile_flat_block_with_overlay( ordered_originals: &[Name], lean_env: &LeanEnv, overlay: Option<&LeanEnv>, @@ -1905,7 +1905,7 @@ fn abstract_spec_params_to_bvars( /// This function computes the pointwise max of `occurrence_level_args` across /// all auxiliaries with the same `name`, then updates all of them. fn maximize_occurrence_levels(flat: &mut [FvarFlatMember], n_originals: usize) { - use crate::ix::env::LevelData; + use ix_common::env::LevelData; use rustc_hash::FxHashMap; // Group auxiliary members by external inductive name. @@ -2080,10 +2080,10 @@ fn try_detect_nested_fvar( #[cfg(test)] mod tests { use super::*; - use crate::ix::env::{ + use bignat::Nat; + use ix_common::env::{ AxiomVal, ConstantVal, InductiveVal, Level as LL, Name, }; - use lean_ffi::nat::Nat; fn mk_name_for(s: &str) -> Name { let mut n = Name::anon(); @@ -2134,7 +2134,7 @@ mod tests { mk_name_for("x"), sort0(), LeanExpr::cnst(mk_name_for("Target"), vec![]), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); assert!(expr_mentions_any_name(&e, &names_of([mk_name_for("Target")]))); } @@ -2219,7 +2219,7 @@ mod tests { mk_name_for("x"), sort0(), LeanExpr::bvar(Nat::from(0u64)), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); assert!(!has_invalid_spec_ref(&e, &[])); } @@ -2231,7 +2231,7 @@ mod tests { mk_name_for("x"), sort0(), LeanExpr::fvar(unknown), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ); assert!(has_invalid_spec_ref(&e, &[])); } @@ -2285,7 +2285,7 @@ mod tests { mk_name_for("_"), LeanExpr::cnst(nat_name.clone(), vec![]), LeanExpr::cnst(nat_name.clone(), vec![]), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, ), }, is_unsafe: false, diff --git a/src/ix/compile/aux_gen/rec_on.rs b/crates/compile/src/compile/aux_gen/rec_on.rs similarity index 97% rename from src/ix/compile/aux_gen/rec_on.rs rename to crates/compile/src/compile/aux_gen/rec_on.rs index eec09eaa..2bc934a9 100644 --- a/src/ix/compile/aux_gen/rec_on.rs +++ b/crates/compile/src/compile/aux_gen/rec_on.rs @@ -7,8 +7,8 @@ //! the FVar/declaration arrays, then close back with mk_forall/mk_lambda. //! Follows `refs/lean4/src/Lean/Meta/Constructions/RecOn.lean`. -use crate::ix::compile::aux_gen::AuxDef; -use crate::ix::env::{Level, Name, RecursorVal}; +use crate::compile::aux_gen::AuxDef; +use ix_common::env::{Level, Name, RecursorVal}; use super::expr_utils::{ forall_telescope, mk_app_n, mk_const, mk_forall, mk_lambda, @@ -17,10 +17,7 @@ use super::expr_utils::{ /// Generate a `.recOn` definition from a canonical `.rec`. /// /// Returns `None` if the recursor type cannot be decomposed. -pub(crate) fn generate_rec_on( - name: &Name, - rec_val: &RecursorVal, -) -> Option { +pub fn generate_rec_on(name: &Name, rec_val: &RecursorVal) -> Option { let n_params = rec_val.num_params.to_u64()? as usize; let n_motives = rec_val.num_motives.to_u64()? as usize; let n_minors = rec_val.num_minors.to_u64()? as usize; @@ -79,8 +76,8 @@ pub(crate) fn generate_rec_on( #[cfg(test)] mod tests { use super::*; - use crate::ix::env::{BinderInfo, ConstantVal, Expr as LeanExpr, ExprData}; - use lean_ffi::nat::Nat; + use bignat::Nat; + use ix_common::env::{BinderInfo, ConstantVal, Expr as LeanExpr, ExprData}; fn mk_name(s: &str) -> Name { Name::str(Name::anon(), s.to_string()) diff --git a/src/ix/compile/aux_gen/recursor.rs b/crates/compile/src/compile/aux_gen/recursor.rs similarity index 96% rename from src/ix/compile/aux_gen/recursor.rs rename to crates/compile/src/compile/aux_gen/recursor.rs index c5c51539..6c8924b6 100644 --- a/src/ix/compile/aux_gen/recursor.rs +++ b/crates/compile/src/compile/aux_gen/recursor.rs @@ -11,16 +11,14 @@ //! Key difference from C++: we use FVar-based intermediate computation //! (see `expr_utils.rs`) then abstract back into de Bruijn binder chains. -use crate::ix::compile::nat_conv::{ - nat_to_u64, nat_to_usize, try_nat_to_usize, -}; -use crate::ix::env::{ +use crate::compile::nat_conv::{nat_to_u64, nat_to_usize, try_nat_to_usize}; +use bignat::Nat; +use ix_common::env::{ BinderInfo, ConstantInfo, ConstantVal, ConstructorVal, Env as LeanEnv, Expr as LeanExpr, ExprData, InductiveVal, Level, Name, NameData, RecursorRule, RecursorVal, }; -use crate::ix::ixon::CompileError; -use lean_ffi::nat::Nat; +use ixon::CompileError; use super::expr_utils::{ LocalDecl, decompose_apps, fresh_fvar, instantiate_spec_with_fvars, @@ -45,7 +43,7 @@ use super::expr_utils::{ /// /// The caller is responsible for applying `RestoreCtx::restore` to the /// output to replace auxiliary const references with original nested apps. -pub(crate) fn generate_recursors_from_expanded( +pub fn generate_recursors_from_expanded( sorted_classes: &[Vec], expanded: &super::nested::ExpandedBlock, // `source_of_canonical[canonical_i]` = Lean source-walk index `source_j` @@ -57,8 +55,8 @@ pub(crate) fn generate_recursors_from_expanded( // no nested-aux hash-sort permutation. source_of_canonical: Option<&[usize]>, lean_env: &LeanEnv, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) -> Result<(Vec<(Name, RecursorVal)>, bool), CompileError> { if expanded.types.is_empty() { return Ok((vec![], false)); @@ -292,11 +290,11 @@ struct FlatInfo { /// directly and pass the appropriate `KernelCtx` — this wrapper is kept /// only so unit tests don't have to plumb one through. #[cfg(test)] -pub(crate) fn generate_canonical_recursors( +pub fn generate_canonical_recursors( sorted_classes: &[Vec], lean_env: &LeanEnv, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) -> Result<(Vec<(Name, RecursorVal)>, bool), CompileError> { generate_canonical_recursors_with_overlay( sorted_classes, @@ -342,7 +340,7 @@ pub(crate) fn generate_canonical_recursors( fn reorder_flat_by_layout( flat: Vec, n_classes: usize, - layout: &crate::ix::ixon::env::AuxLayout, + layout: &ixon::env::AuxLayout, ) -> Result< Vec, (Vec, String), @@ -434,13 +432,13 @@ fn reorder_flat_by_layout( Ok(primary) } -pub(crate) fn generate_canonical_recursors_with_overlay( +pub fn generate_canonical_recursors_with_overlay( sorted_classes: &[Vec], lean_env: &LeanEnv, overlay: Option<&LeanEnv>, pre_flat: Option>, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) -> Result<(Vec<(Name, RecursorVal)>, bool), CompileError> { generate_canonical_recursors_with_layout( sorted_classes, @@ -455,20 +453,20 @@ pub(crate) fn generate_canonical_recursors_with_overlay( } /// Like [`generate_canonical_recursors_with_overlay`] but accepts an -/// optional [`crate::ix::ixon::env::AuxLayout`] that reorders the aux +/// optional [`ixon::env::AuxLayout`] that reorders the aux /// section of the flat block per its `perm` before recursor generation. /// /// This is the hook decompile uses to pin its canonical layout to /// compile's first-run result. With `aux_layout = None`, falls back to /// the discovery order produced by `build_compile_flat_block_with_overlay`. -pub(crate) fn generate_canonical_recursors_with_layout( +pub fn generate_canonical_recursors_with_layout( sorted_classes: &[Vec], lean_env: &LeanEnv, overlay: Option<&LeanEnv>, pre_flat: Option>, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, - aux_layout: Option<&crate::ix::ixon::env::AuxLayout>, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, + aux_layout: Option<&ixon::env::AuxLayout>, // Optional Lean-source index per canonical aux position, used for // emitting `all0.rec_{source_j + 1}` names directly. If provided // alongside `aux_layout`, both must agree (this parameter takes @@ -950,8 +948,8 @@ fn build_rec_type( rec_level_params: &[Name], lean_env: &LeanEnv, overlay: Option<&LeanEnv>, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, nested_rewrite: Option<&mut NestedRewriteCtx>, ) -> LeanExpr { let env_get = |name: &Name| -> Option { @@ -1350,8 +1348,8 @@ fn build_minor_type( motive_fvars: &[LeanExpr], ind_univs: &[Level], rec_level_params: &[Name], - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, // Shared scratch for nested-aux level rewrites across every ctor in // the block. `None` when the block doesn't need any rewriting. nested_rewrite: Option<&mut NestedRewriteCtx>, @@ -1631,8 +1629,8 @@ fn build_rec_rules( // Lean-source-indexed aux naming (see caller doc). `None` falls back // to `canonical_i + 1`. source_of_canonical: Option<&[usize]>, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, nested_rewrite: Option<&mut NestedRewriteCtx>, ) -> Result, CompileError> { let _ = n_classes; // Kept for signature parity with `build_rec_type`. @@ -2002,7 +2000,7 @@ fn build_rule_ih_fvar( /// Lean's `appendAfter`: append a suffix string to a Name. /// /// Matches `Init/Meta/Defs.lean:317-320`: -/// ``` +/// ```text /// def appendAfter (n : Name) (suffix : String) : Name := /// n.modifyBase fun /// | str p s => Name.mkStr p (s ++ suffix) @@ -2096,7 +2094,7 @@ fn find_rec_target( param_fvars: &[LeanExpr], n_params: usize, scope: &mut super::expr_utils::TcScope<'_>, - _stt: &crate::ix::compile::CompileState, + _stt: &crate::compile::CompileState, ) -> Option { // Phase 1: syntactic peel + match. let mut ty = dom.clone(); @@ -2330,15 +2328,15 @@ fn compute_is_large_and_k( n_classes: usize, n_params: usize, lean_env: &LeanEnv, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) -> Result<(bool, bool, bool), CompileError> { - use crate::ix::kernel::constant::KConst; - use crate::ix::kernel::id::KId; - use crate::ix::kernel::ingress::{ + use ix_kernel::constant::KConst; + use ix_kernel::id::KId; + use ix_kernel::ingress::{ lean_expr_to_zexpr_with_kenv, resolve_lean_name_addr, }; - use crate::ix::kernel::mode::Meta; + use ix_kernel::mode::Meta; let n2a = Some(&stt.name_to_addr); let aux_n2a = Some(&stt.aux_name_to_addr); @@ -2351,7 +2349,7 @@ fn compute_is_large_and_k( u64, u64, Vec>, - crate::ix::kernel::expr::KExpr, + ix_kernel::expr::KExpr, bool, )> = Vec::new(); @@ -2459,7 +2457,7 @@ fn compute_is_large_and_k( let first_n_indices = ind_infos[0].2; // Use the TC for the appropriate context. - let mut tc = crate::ix::kernel::tc::TypeChecker::new(&mut kctx.kenv); + let mut tc = ix_kernel::tc::TypeChecker::new(&mut kctx.kenv); // Compute the WHNF-reduced result sort level via the kernel. This peels // params+indices with whnf at each step — crucial for inductives whose @@ -2533,7 +2531,7 @@ fn compute_is_large_and_k( && is_prop; let _cilk_elapsed = _cilk_start.elapsed(); - if *crate::ix::compile::IX_TIMING && _cilk_elapsed.as_secs_f32() > 0.1 { + if *crate::compile::IX_TIMING && _cilk_elapsed.as_secs_f32() > 0.1 { eprintln!( "[compute_is_large_and_k] {:?} total={:.3}s ingress={:.3}s n_classes={} kenv_size={}", classes[0].ind.cnst.name.pretty(), @@ -2553,8 +2551,8 @@ fn compute_is_large_and_k( fn ingress_target_type_deps( target_ty: &LeanExpr, lean_env: &LeanEnv, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) { let mut seen = rustc_hash::FxHashSet::default(); let mut queue = Vec::new(); @@ -2578,8 +2576,8 @@ fn ingress_field_deps( class: &FlatInfo, _lvl_params: &[Name], lean_env: &LeanEnv, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) { let mut seen = rustc_hash::FxHashSet::default(); let mut queue: Vec = Vec::new(); @@ -2603,8 +2601,8 @@ fn ingress_aux_gen_dep( name: &Name, ci: &ConstantInfo, lean_env: &LeanEnv, - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, queue: &mut Vec, ) { match ci { @@ -2653,15 +2651,15 @@ fn ingress_type_stub( name: &Name, typ: &LeanExpr, level_params: &[Name], - stt: &crate::ix::compile::CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + stt: &crate::compile::CompileState, + kctx: &mut crate::compile::KernelCtx, ) { - use crate::ix::kernel::constant::KConst; - use crate::ix::kernel::id::KId; - use crate::ix::kernel::ingress::{ + use ix_kernel::constant::KConst; + use ix_kernel::id::KId; + use ix_kernel::ingress::{ lean_expr_to_zexpr_with_kenv, resolve_lean_name_addr, }; - use crate::ix::kernel::mode::Meta; + use ix_kernel::mode::Meta; let n2a = Some(&stt.name_to_addr); let aux_n2a = Some(&stt.aux_name_to_addr); @@ -2733,9 +2731,9 @@ fn collect_const_refs(expr: &LeanExpr, out: &mut Vec) { /// referenced by that same comment for the historical record. #[allow(dead_code)] fn peek_result_sort( - ty: &crate::ix::kernel::expr::KExpr, -) -> Option> { - use crate::ix::kernel::expr::ExprData as ZED; + ty: &ix_kernel::expr::KExpr, +) -> Option> { + use ix_kernel::expr::ExprData as ZED; let mut cur = ty.clone(); loop { match cur.data() { @@ -2749,7 +2747,7 @@ fn peek_result_sort( #[cfg(test)] mod tests { use super::*; - use crate::ix::compile::aux_gen::below::{ + use crate::compile::aux_gen::below::{ BelowConstant, generate_below_constants, }; @@ -2877,7 +2875,7 @@ mod tests { } fn insert_aux_stub_def(env: &mut LeanEnv, ind: &Name, suffix: &str) -> Name { - use crate::ix::env::{DefinitionSafety, DefinitionVal, ReducibilityHints}; + use ix_common::env::{DefinitionSafety, DefinitionVal, ReducibilityHints}; let def_name = Name::str(ind.clone(), suffix.into()); env.insert( @@ -3477,8 +3475,8 @@ mod tests { env.insert(ctor_name, ConstantInfo::CtorInfo(ctor)); let classes = vec![vec![ind_name]]; - let tmp_stt = crate::ix::compile::CompileState::default(); - let mut kctx = crate::ix::compile::KernelCtx::new(); + let tmp_stt = crate::compile::CompileState::default(); + let mut kctx = crate::compile::KernelCtx::new(); let (result, _is_prop) = generate_canonical_recursors(&classes, &env, &tmp_stt, &mut kctx) .unwrap(); @@ -3503,8 +3501,8 @@ mod tests { #[test] fn test_aux_gen_alpha_collapse() { let (env, a, b) = build_alpha_collapse_env(); - let stt = crate::ix::compile::CompileState::default(); - let mut kctx = crate::ix::compile::KernelCtx::new(); + let stt = crate::compile::CompileState::default(); + let mut kctx = crate::compile::KernelCtx::new(); // After sort_consts collapse, A≅B → 1 class. let classes = vec![vec![a.clone(), b.clone()]]; @@ -3563,12 +3561,12 @@ mod tests { #[test] fn test_alpha_collapse_sort_consts_groups_inductives() { - use crate::ix::compile::{BlockCache, mk_indc, sort_consts}; - use crate::ix::env::ConstantInfo as LeanCI; - use crate::ix::mutual::MutConst; + use crate::compile::{BlockCache, mk_indc, sort_consts}; + use crate::mutual::MutConst; + use ix_common::env::ConstantInfo as LeanCI; let (env, a, b) = build_alpha_collapse_env(); - let stt = crate::ix::compile::CompileState::default(); + let stt = crate::compile::CompileState::default(); let mut cache = BlockCache::default(); let mut cs = Vec::new(); @@ -3594,7 +3592,7 @@ mod tests { #[test] fn test_alpha_collapse_compile_env_addresses_inductives_and_ctors() { - use crate::ix::compile::env::compile_env; + use crate::compile::env::compile_env; let (env, a, b) = build_alpha_collapse_env(); let lean_env = std::sync::Arc::new(env); @@ -3617,7 +3615,7 @@ mod tests { #[test] fn test_alpha_collapse_aux_gen_aliases_primary_aux_to_rep() { - use crate::ix::compile::aux_gen::{self, PatchedConstant}; + use crate::compile::aux_gen::{self, PatchedConstant}; let (mut env, a, b) = build_alpha_collapse_env(); let all = vec![a.clone(), b.clone()]; @@ -3633,8 +3631,8 @@ mod tests { let a_brecon = insert_aux_stub_def(&mut env, &a, "brecOn"); let b_brecon = insert_aux_stub_def(&mut env, &b, "brecOn"); - let stt = crate::ix::compile::CompileState::default(); - let mut kctx = crate::ix::compile::KernelCtx::new(); + let stt = crate::compile::CompileState::default(); + let mut kctx = crate::compile::KernelCtx::new(); let out = aux_gen::generate_aux_patches( &[vec![a.clone(), b.clone()]], &all, @@ -3675,8 +3673,8 @@ mod tests { #[test] fn test_aux_gen_alpha_collapse_3() { let (env, a, b, c) = build_alpha_collapse_3_env(); - let stt = crate::ix::compile::CompileState::default(); - let mut kctx = crate::ix::compile::KernelCtx::new(); + let stt = crate::compile::CompileState::default(); + let mut kctx = crate::compile::KernelCtx::new(); // All 3 collapse into 1 class. let classes = vec![vec![a.clone(), b.clone(), c.clone()]]; @@ -3710,8 +3708,8 @@ mod tests { #[test] fn test_aux_gen_over_merge_alpha_collapse() { let (env, a, b, c) = build_over_merge_alpha_collapse_env(); - let stt = crate::ix::compile::CompileState::default(); - let mut kctx = crate::ix::compile::KernelCtx::new(); + let stt = crate::compile::CompileState::default(); + let mut kctx = crate::compile::KernelCtx::new(); // A≅B collapse into 1 class, C is a separate class → 2 classes. let classes = vec![vec![a.clone(), b.clone()], vec![c.clone()]]; @@ -3767,8 +3765,8 @@ mod tests { #[test] fn test_aux_gen_over_merge() { let (env, a, b, c) = build_over_merge_env(); - let stt = crate::ix::compile::CompileState::default(); - let mut kctx = crate::ix::compile::KernelCtx::new(); + let stt = crate::compile::CompileState::default(); + let mut kctx = crate::compile::KernelCtx::new(); // No alpha-collapse: A≠B (B has 2 fields), A≠C, B≠C → 3 classes. let classes = vec![vec![a.clone()], vec![b.clone()], vec![c.clone()]]; @@ -3810,8 +3808,8 @@ mod tests { #[test] fn test_aux_gen_below_indc_prop() { let (env, a, b) = build_alpha_collapse_env(); - let stt = crate::ix::compile::CompileState::default(); - let mut kctx = crate::ix::compile::KernelCtx::new(); + let stt = crate::compile::CompileState::default(); + let mut kctx = crate::compile::KernelCtx::new(); let classes = vec![vec![a.clone(), b.clone()]]; let (recs, is_prop) = @@ -3846,8 +3844,8 @@ mod tests { #[test] fn test_aux_gen_below_def_type() { let (env, t) = build_type_nat_env(); - let stt = crate::ix::compile::CompileState::default(); - let mut kctx = crate::ix::compile::KernelCtx::new(); + let stt = crate::compile::CompileState::default(); + let mut kctx = crate::compile::KernelCtx::new(); let classes = vec![vec![t.clone()]]; let (recs, is_prop) = @@ -3888,8 +3886,8 @@ mod tests { #[test] fn test_aux_gen_is_prop_vs_is_large() { let (env, p) = build_prop_drec_env(); - let stt = crate::ix::compile::CompileState::default(); - let mut kctx = crate::ix::compile::KernelCtx::new(); + let stt = crate::compile::CompileState::default(); + let mut kctx = crate::compile::KernelCtx::new(); let classes = vec![vec![p.clone()]]; let (recs, is_prop) = @@ -3933,7 +3931,7 @@ mod tests { #[ignore] #[test] fn test_aux_gen_compile_roundtrip() { - use crate::ix::compile::env::compile_env; + use crate::compile::env::compile_env; use std::sync::Arc; let (mut env, a, b) = build_alpha_collapse_env(); @@ -3986,18 +3984,18 @@ mod tests { /// Type-level brecOn: Nat-like T generates .brecOn.go + .brecOn (no .eq without Eq in env). #[test] fn test_brecon_type_level() { - use crate::ix::compile::aux_gen::below::generate_below_constants; - use crate::ix::compile::aux_gen::brecon::generate_brecon_constants; + use crate::compile::aux_gen::below::generate_below_constants; + use crate::compile::aux_gen::brecon::generate_brecon_constants; let (env, t) = build_type_nat_env(); - let stt = crate::ix::compile::CompileState::default(); - let mut kctx = crate::ix::compile::KernelCtx::new(); + let stt = crate::compile::CompileState::default(); + let mut kctx = crate::compile::KernelCtx::new(); // Ingress prelude (PUnit, PProd) and the inductive into the kenv // so TcScope can resolve them during brecOn sort-level inference. - crate::ix::compile::aux_gen::expr_utils::ensure_prelude_in_kenv_of( + crate::compile::aux_gen::expr_utils::ensure_prelude_in_kenv_of( &stt, &mut kctx, ); - crate::ix::compile::aux_gen::expr_utils::ensure_in_kenv_of( + crate::compile::aux_gen::expr_utils::ensure_in_kenv_of( &t, &env, &stt, &mut kctx, ); @@ -4012,7 +4010,7 @@ mod tests { assert_eq!(below.len(), 1); // Populate kenv with .below types for brecOn generation. - crate::ix::compile::aux_gen::populate_canon_kenv_with_below( + crate::compile::aux_gen::populate_canon_kenv_with_below( &below, &classes, &std::sync::Arc::new(env.clone()), @@ -4046,12 +4044,12 @@ mod tests { /// Prop-level brecOn: alpha-collapse A/B generates single .brecOn per class. #[test] fn test_brecon_prop_alpha_collapse() { - use crate::ix::compile::aux_gen::below::generate_below_constants; - use crate::ix::compile::aux_gen::brecon::generate_brecon_constants; + use crate::compile::aux_gen::below::generate_below_constants; + use crate::compile::aux_gen::brecon::generate_brecon_constants; let (env, a, b) = build_alpha_collapse_env(); - let stt = crate::ix::compile::CompileState::default(); - let mut kctx = crate::ix::compile::KernelCtx::new(); + let stt = crate::compile::CompileState::default(); + let mut kctx = crate::compile::KernelCtx::new(); let classes = vec![vec![a.clone(), b.clone()]]; let (recs, is_prop) = @@ -4081,8 +4079,8 @@ mod tests { /// Non-recursive inductives should NOT generate brecOn. #[test] fn test_brecon_skipped_for_non_recursive() { - use crate::ix::compile::aux_gen::below::generate_below_constants; - use crate::ix::compile::aux_gen::brecon::generate_brecon_constants; + use crate::compile::aux_gen::below::generate_below_constants; + use crate::compile::aux_gen::brecon::generate_brecon_constants; // Build a simple non-recursive inductive: Unit | unit : Unit let unit = n("Unit"); @@ -4122,8 +4120,8 @@ mod tests { }), ); - let stt = crate::ix::compile::CompileState::default(); - let mut kctx = crate::ix::compile::KernelCtx::new(); + let stt = crate::compile::CompileState::default(); + let mut kctx = crate::compile::KernelCtx::new(); let classes = vec![vec![unit]]; let (recs, is_prop) = generate_canonical_recursors(&classes, &env, &stt, &mut kctx).unwrap(); @@ -4150,7 +4148,7 @@ mod tests { /// with real Lean environments that include .below and .brecOn constants. #[test] fn test_brecon_type_compile_roundtrip() { - use crate::ix::compile::env::compile_env; + use crate::compile::env::compile_env; use std::sync::Arc; let (mut env, t) = build_type_nat_env(); diff --git a/src/ix/compile/env.rs b/crates/compile/src/compile/env.rs similarity index 98% rename from src/ix/compile/env.rs rename to crates/compile/src/compile/env.rs index 7f0731b8..0b36bc23 100644 --- a/src/ix/compile/env.rs +++ b/crates/compile/src/compile/env.rs @@ -14,15 +14,15 @@ use dashmap::DashMap; use rayon::prelude::*; use rustc_hash::FxHashSet; -use crate::ix::address::Address; -use crate::ix::compile::{ +use crate::compile::{ BlockCache, CompileOptions, CompileState, compile_const, compile_const_no_aux, }; -use crate::ix::condense::compute_sccs; -use crate::ix::env::{Env as LeanEnv, Name}; -use crate::ix::graph::{NameSet, build_ref_graph}; -use crate::ix::ground::ground_consts; -use crate::ix::ixon::CompileError; +use crate::condense::compute_sccs; +use crate::graph::{NameSet, build_ref_graph}; +use crate::ground::ground_consts; +use ix_common::address::Address; +use ix_common::env::{Env as LeanEnv, Name}; +use ixon::CompileError; // =========================================================================== // Progress + diagnostic logging @@ -150,8 +150,7 @@ pub fn compile_env_with_options( // Filter ungrounded names from the ref graph before SCC computation so // condensed blocks only contain constants we can actually compile. - let grounded_out_refs: crate::ix::graph::RefMap = if ungrounded_map.is_empty() - { + let grounded_out_refs: crate::graph::RefMap = if ungrounded_map.is_empty() { graph.out_refs } else { graph @@ -455,7 +454,7 @@ pub fn compile_env_with_options( // Spawn worker threads for _ in 0..num_threads { s.spawn(move || { - let mut worker_kctx = crate::ix::compile::KernelCtx::new(); + let mut worker_kctx = crate::compile::KernelCtx::new(); loop { // Try to get work from the ready queue let work = { @@ -742,7 +741,7 @@ pub fn compile_env_with_options( // Check for slow blocks let elapsed = block_start.elapsed(); - if *crate::ix::compile::IX_TIMING && elapsed.as_secs_f32() > 1.0 { + if *crate::compile::IX_TIMING && elapsed.as_secs_f32() > 1.0 { let cc_time = _cc_start.elapsed().as_secs_f32(); eprintln!( "Slow block {:?} ({} consts): {:.2}s path={} cc={:.2}s", @@ -956,7 +955,7 @@ fn aux_gen_seed_names() -> Vec { /// references; we resolve each referenced name back to its own SCC-rep via /// `condensed.low_links`. fn precompile_aux_gen_prereqs( - condensed: &crate::ix::condense::CondensedBlocks, + condensed: &crate::condense::CondensedBlocks, lean_env: &Arc, stt: &CompileState, ) -> Result<(), CompileError> { @@ -1011,7 +1010,7 @@ fn precompile_aux_gen_prereqs( // Compile each SCC in dep-first order, moving compiled names to // `aux_name_to_addr` so later SCCs can resolve their Const refs. - let mut prereq_kctx = crate::ix::compile::KernelCtx::new(); + let mut prereq_kctx = crate::compile::KernelCtx::new(); for rep in order { if stt.aux_name_to_addr.contains_key(&rep) { continue; // Already compiled (e.g., via a prior prereq run). diff --git a/src/ix/compile/mutual.rs b/crates/compile/src/compile/mutual.rs similarity index 97% rename from src/ix/compile/mutual.rs rename to crates/compile/src/compile/mutual.rs index 11f83bef..2471a6af 100644 --- a/src/ix/compile/mutual.rs +++ b/crates/compile/src/compile/mutual.rs @@ -15,23 +15,24 @@ use std::sync::Arc; use rustc_hash::FxHashMap; -use lean_ffi::nat::Nat; - -use crate::ix::address::Address; -use crate::ix::compile::aux_gen::below::BelowIndc; -use crate::ix::compile::aux_gen::brecon::BRecOnDef; -use crate::ix::compile::aux_gen::recursor; -use crate::ix::compile::aux_gen::{self, PatchedConstant}; -use crate::ix::compile::{ +use bignat::Nat; + +use crate::compile::aux_gen::below::BelowIndc; +use crate::compile::aux_gen::brecon::BRecOnDef; +use crate::compile::aux_gen::recursor; +use crate::compile::aux_gen::{self, PatchedConstant}; +use crate::compile::{ BlockCache, CompileState, collect_mut_const_exprs, compile_definition, compile_inductive, compile_mutual_block, compile_name, compile_recursor, preseed_expr_tables, sort_consts, }; -use crate::ix::env::{ +use crate::mutual::{Def, Ind, MutConst}; +use ix_common::address::Address; +use ix_common::env::{ ConstantInfo as LeanConstantInfo, ConstantVal, ConstructorVal, DefinitionSafety, Env as LeanEnv, Name, ReducibilityHints, }; -use crate::ix::ixon::{ +use ixon::{ CompileError, constant::{ Constant, ConstantInfo, ConstructorProj, DefKind, DefinitionProj, @@ -41,7 +42,6 @@ use crate::ix::ixon::{ metadata::{ConstantMeta, ConstantMetaInfo}, univ::Univ, }; -use crate::ix::mutual::{Def, Ind, MutConst}; // =========================================================================== // compile_aux_block @@ -57,11 +57,11 @@ use crate::ix::mutual::{Def, Ind, MutConst}; /// `stt.name_to_addr`) so they don't interfere with the scheduler's /// dependency tracking. The scheduler's promotion path in `env.rs` moves /// them to `name_to_addr` when the block is processed. -pub(crate) fn compile_aux_block( +pub fn compile_aux_block( aux_consts: &[MutConst], lean_env: &Arc, stt: &CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + kctx: &mut crate::compile::KernelCtx, ) -> Result<(), CompileError> { compile_aux_block_with_rename(aux_consts, lean_env, stt, kctx, None, None) } @@ -95,16 +95,16 @@ pub(crate) fn compile_aux_block( /// Without this reorder, `sort_consts` on recursors picks an independent /// canonical permutation that diverges from the inductive block's layout. /// See `docs/ix_canonicity.md` §6.2 and the rationale in -/// `kernel::inductive::populate_recursor_rules_from_block`. +/// `ix_kernel::inductive::populate_recursor_rules_from_block`. /// /// The class ordering produced by `sort_consts` is preserved as a /// stable tiebreak: classes that map to `u64::MAX` (no key entry) keep /// their `sort_consts` relative position at the tail. -pub(crate) fn compile_aux_block_with_rename( +pub fn compile_aux_block_with_rename( aux_consts: &[MutConst], lean_env: &Arc, stt: &CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + kctx: &mut crate::compile::KernelCtx, name_rename: Option<&FxHashMap>, class_order_key: Option<&dyn Fn(&MutConst) -> u64>, ) -> Result<(), CompileError> { @@ -470,13 +470,13 @@ fn content_address(constant: &Constant) -> Address { /// /// Only runs for inductive blocks. Non-inductive mutual blocks return /// immediately. -pub(crate) fn generate_and_compile_aux_recursors( +pub fn generate_and_compile_aux_recursors( cs: &[MutConst], class_names: &[Vec], lean_env: &Arc, stt: &CompileState, - kctx: &mut crate::ix::compile::KernelCtx, -) -> Result, CompileError> { + kctx: &mut crate::compile::KernelCtx, +) -> Result, CompileError> { // Guard: aux_gen canonical generation only runs for blocks containing // inductives. Non-inductive blocks (plain defs, recursor-only SCCs, // etc.) have no canonical auxiliaries to generate. @@ -565,7 +565,7 @@ pub(crate) fn generate_and_compile_aux_recursors( // `original_all` (= `source_all` above) is hoisted to the enclosing // scope so the aux-name rename map construction below can reuse it. let original_all: Vec = source_all; - let mut aux_layout: Option = None; + let mut aux_layout: Option = None; if !original_all.is_empty() && let Some(perm) = aux_out.perm.clone() && !perm.is_empty() @@ -601,7 +601,7 @@ pub(crate) fn generate_and_compile_aux_recursors( }); } aux_layout = - Some(crate::ix::compile::surgery::AuxLayout { perm, source_ctor_counts }); + Some(crate::compile::surgery::AuxLayout { perm, source_ctor_counts }); } // NOTE: Historically, a canonical→source rename map was built here @@ -851,7 +851,7 @@ pub(crate) fn generate_and_compile_aux_recursors( // blocks). See the aux_gen.rs module docs for the full rationale. let total = aux_total_start.elapsed(); - if *crate::ix::compile::IX_TIMING && total.as_secs_f32() > 0.5 { + if *crate::compile::IX_TIMING && total.as_secs_f32() > 0.5 { eprintln!( "[aux_gen] {:?} total={:.2}s gen={:.2}s rec={:.2}s cases={:.2}s recOn={:.2}s below={:.2}s belowRec={:.2}s brecon={:.2}s patches={}", block_label, @@ -901,7 +901,7 @@ fn below_indc_to_mut_const( .collect(); MutConst::Indc(Ind { - ind: crate::ix::env::InductiveVal { + ind: ix_common::env::InductiveVal { cnst: ConstantVal { name: bi.name.clone(), level_params: bi.level_params.clone(), @@ -1016,7 +1016,7 @@ fn compile_below_recursors( below_indcs: &[MutConst], lean_env: &Arc, stt: &CompileState, - kctx: &mut crate::ix::compile::KernelCtx, + kctx: &mut crate::compile::KernelCtx, ) -> Result<(), CompileError> { // Build a small overlay with just the .below inductives + ctors. // These don't exist in the original lean_env, but generate_canonical_recursors diff --git a/src/ix/compile/nat_conv.rs b/crates/compile/src/compile/nat_conv.rs similarity index 82% rename from src/ix/compile/nat_conv.rs rename to crates/compile/src/compile/nat_conv.rs index b1a2be22..a96ec090 100644 --- a/src/ix/compile/nat_conv.rs +++ b/crates/compile/src/compile/nat_conv.rs @@ -5,14 +5,14 @@ //! `num_nested`) are always small values. These utilities make the conversion //! explicit rather than silently producing 0 on overflow. -use lean_ffi::nat::Nat; +use bignat::Nat; -use crate::ix::ixon::CompileError; +use ixon::CompileError; /// Convert a Lean `Nat` to `usize`, returning `CompileError` on overflow. /// /// Use in functions that return `Result<_, CompileError>`. -pub(crate) fn try_nat_to_usize(n: &Nat) -> Result { +pub fn try_nat_to_usize(n: &Nat) -> Result { n.to_u64().map(|v| v as usize).ok_or_else(|| CompileError::UnsupportedExpr { desc: "Nat field exceeds u64".into(), }) @@ -23,11 +23,11 @@ pub(crate) fn try_nat_to_usize(n: &Nat) -> Result { /// Use in pure functions where returning `Result` would cascade through /// callers. Overflow is impossible for valid Lean metadata — these fields /// represent type constructor arities which are always < 2^64. -pub(crate) fn nat_to_usize(n: &Nat) -> usize { +pub fn nat_to_usize(n: &Nat) -> usize { n.to_u64().expect("Nat field exceeds u64") as usize } /// Convert a Lean `Nat` to `u64`, panicking on overflow. -pub(crate) fn nat_to_u64(n: &Nat) -> u64 { +pub fn nat_to_u64(n: &Nat) -> u64 { n.to_u64().expect("Nat field exceeds u64") } diff --git a/src/ix/compile/surgery.rs b/crates/compile/src/compile/surgery.rs similarity index 98% rename from src/ix/compile/surgery.rs rename to crates/compile/src/compile/surgery.rs index fb204f14..94a5029d 100644 --- a/src/ix/compile/surgery.rs +++ b/crates/compile/src/compile/surgery.rs @@ -23,12 +23,12 @@ use std::sync::Arc; use rustc_hash::FxHashMap; -use crate::ix::env::{ +use ix_common::env::{ ConstantInfo as LeanConstantInfo, ConstructorVal, Env as LeanEnv, Expr as LeanExpr, ExprData, Level, Name, NameData, RecursorVal, }; -use crate::ix::ixon::error::CompileError; -use crate::ix::ixon::expr::Expr as IxonExpr; +use ixon::error::CompileError; +use ixon::expr::Expr as IxonExpr; use super::{ aux_gen::expr_utils::{ @@ -151,7 +151,7 @@ impl BRecOnCallSitePlan { } } -pub(crate) fn rec_name_to_brecon_name(name: &Name) -> Option { +pub fn rec_name_to_brecon_name(name: &Name) -> Option { match name.as_data() { NameData::Str(parent, s, _) if s == "rec" => { Some(Name::str(parent.clone(), "brecOn".to_string())) @@ -163,7 +163,7 @@ pub(crate) fn rec_name_to_brecon_name(name: &Name) -> Option { } } -pub(crate) fn rec_name_to_below_name(name: &Name) -> Option { +pub fn rec_name_to_below_name(name: &Name) -> Option { match name.as_data() { NameData::Str(parent, s, _) if s == "rec" => { Some(Name::str(parent.clone(), "below".to_string())) @@ -182,7 +182,7 @@ pub(crate) fn rec_name_to_below_name(name: &Name) -> Option { /// Collect a Lean App telescope: peel App nodes to get `(head, [a1, ..., aN])`. /// /// Arguments are returned in application order (leftmost first). -pub(crate) fn collect_lean_telescope<'a>( +pub fn collect_lean_telescope<'a>( e: &'a LeanExpr, ) -> (&'a LeanExpr, Vec<&'a LeanExpr>) { let mut args: Vec<&'a LeanExpr> = Vec::new(); @@ -199,7 +199,7 @@ pub(crate) fn collect_lean_telescope<'a>( /// /// Arguments are returned in application order (leftmost first). #[allow(dead_code)] -pub(crate) fn collect_ixon_telescope( +pub fn collect_ixon_telescope( e: &Arc, ) -> (Arc, Vec>) { let mut args: Vec> = Vec::new(); @@ -237,14 +237,14 @@ pub(crate) fn collect_ixon_telescope( /// its own plan). We skip generating a plan for a phantom `X.rec` /// itself, since that belongs to the block owning `X`. /// -/// The [`AuxLayout`] type is re-exported from `crate::ix::ixon::env` so it +/// The [`AuxLayout`] type is re-exported from `ixon::env` so it /// can live in the Ixon env side-table and survive serialization — see the -/// doc on [`crate::ix::ixon::env::AuxLayout`] for the canonical definition. -pub(crate) use crate::ix::ixon::env::AuxLayout; +/// doc on [`ixon::env::AuxLayout`] for the canonical definition. +pub use ixon::env::AuxLayout; const PERM_OUT_OF_SCC: usize = usize::MAX; -pub(crate) fn compute_call_site_plans( +pub fn compute_call_site_plans( sorted_classes: &[Vec], original_all: &[Name], lean_env: &LeanEnv, @@ -706,7 +706,7 @@ pub(crate) fn compute_call_site_plans( /// recursor call then goes through the normal call-site surgery for its own /// SCC. #[allow(clippy::too_many_arguments)] -pub(crate) fn adapt_split_minor( +pub fn adapt_split_minor( rec_name: &Name, rec_levels: &[Level], plan: &CallSitePlan, @@ -1115,8 +1115,8 @@ fn dump_plan_state( #[cfg(test)] mod tests { use super::*; - use crate::ix::env::{ConstantVal, ConstructorVal, InductiveVal}; - use lean_ffi::nat::Nat; + use bignat::Nat; + use ix_common::env::{ConstantVal, ConstructorVal, InductiveVal}; fn n(s: &str) -> Name { Name::str(Name::anon(), s.to_string()) @@ -1208,8 +1208,8 @@ mod tests { fn build_test_env( names: &[&str], ctor_counts: &[usize], - ) -> crate::ix::env::Env { - let mut env = crate::ix::env::Env::default(); + ) -> ix_common::env::Env { + let mut env = ix_common::env::Env::default(); let all: Vec = names.iter().map(|s| n(s)).collect(); for (i, &name_str) in names.iter().enumerate() { @@ -1398,7 +1398,7 @@ mod tests { ctor_counts: &[usize], aux_motives: usize, aux_minors: usize, - ) -> crate::ix::env::Env { + ) -> ix_common::env::Env { let mut env = build_test_env(names, ctor_counts); // Overwrite each inductive's recursor with inflated motive/minor counts. let total_motives = (names.len() + aux_motives) as u64; diff --git a/src/ix/condense.rs b/crates/compile/src/condense.rs similarity index 98% rename from src/ix/condense.rs rename to crates/compile/src/condense.rs index ab0a6b27..f293aaa0 100644 --- a/src/ix/condense.rs +++ b/crates/compile/src/condense.rs @@ -5,11 +5,10 @@ use rustc_hash::FxHashMap; -use crate::{ - FxIndexSet, - ix::env::Name, - ix::graph::{NameSet, RefMap}, -}; +use ix_common::FxIndexSet; +use ix_common::env::Name; + +use crate::graph::{NameSet, RefMap}; /// The condensation of a reference graph into strongly connected components. pub struct CondensedBlocks { diff --git a/src/ix/congruence.rs b/crates/compile/src/congruence.rs similarity index 98% rename from src/ix/congruence.rs rename to crates/compile/src/congruence.rs index 4f075020..c74c2ee3 100644 --- a/src/ix/congruence.rs +++ b/crates/compile/src/congruence.rs @@ -14,8 +14,8 @@ pub mod perm; -use crate::ix::env::{ConstantInfo, Expr, ExprData, Level, LevelData, Literal}; -use lean_ffi::nat::Nat; +use bignat::Nat; +use ix_common::env::{ConstantInfo, Expr, ExprData, Level, LevelData, Literal}; /// Check that two Lean levels are equal modulo the same simplifications /// `Level::max_smart` / `Level::imax_smart` perform. @@ -334,7 +334,7 @@ pub fn const_alpha_eq( // ========================================================================= /// Strip Mdata wrappers from an expression. -pub(crate) fn strip_mdata(e: &Expr) -> &Expr { +pub fn strip_mdata(e: &Expr) -> &Expr { let mut cur = e; while let ExprData::Mdata(_, inner, _) = cur.as_data() { cur = inner; @@ -342,11 +342,7 @@ pub(crate) fn strip_mdata(e: &Expr) -> &Expr { cur } -pub(crate) fn check_nat_eq( - a: &Nat, - b: &Nat, - field: &str, -) -> Result<(), String> { +pub fn check_nat_eq(a: &Nat, b: &Nat, field: &str) -> Result<(), String> { let av = a.to_u64().unwrap_or(u64::MAX); let bv = b.to_u64().unwrap_or(u64::MAX); if av != bv { @@ -411,7 +407,7 @@ mod tests { //! `Level::imax_smart` (see `src/ix/env.rs:340-404`), so they double //! as a contract test for those constructors. use super::*; - use crate::ix::env::Name; + use ix_common::env::Name; fn p(s: &str) -> Level { Level::param(Name::str(Name::anon(), s.to_string())) } diff --git a/src/ix/congruence/perm.rs b/crates/compile/src/congruence/perm.rs similarity index 99% rename from src/ix/congruence/perm.rs rename to crates/compile/src/congruence/perm.rs index 3def435b..f179c39e 100644 --- a/src/ix/congruence/perm.rs +++ b/crates/compile/src/congruence/perm.rs @@ -65,19 +65,16 @@ //! - `InductInfo`, `CtorInfo`, `AxiomInfo`, `QuotInfo` — pass-through //! (no permutation needed). -use lean_ffi::nat::Nat; +use bignat::Nat; use rustc_hash::FxHashMap; -use crate::ix::compile::aux_gen::expr_utils::{ - forall_telescope, lambda_telescope, -}; -use crate::ix::{ - address::Address, - env::{ - ConstantInfo, ConstantVal, Expr, ExprData, Name, RecursorRule, RecursorVal, - }, +use ix_common::address::Address; +use ix_common::env::{ + ConstantInfo, ConstantVal, Expr, ExprData, Name, RecursorRule, RecursorVal, }; +use crate::compile::aux_gen::expr_utils::{forall_telescope, lambda_telescope}; + use super::{check_nat_eq, expr_alpha_eq, level_alpha_eq, strip_mdata}; /// Sentinel for `aux_perm` entries that don't correspond to any canonical @@ -352,7 +349,7 @@ impl PermCtx { /// counterparts. Built once per binder telescope, passed by shared /// reference into the alpha-eq walk. #[derive(Default, Clone)] -pub(crate) struct Corr { +pub struct Corr { fvar_map: FxHashMap, fvar_alts: FxHashMap>, punit_motive_gen: Vec, @@ -538,7 +535,7 @@ fn classify_defn_shape(name: &Name) -> DefnShape { /// Collect up to `n` trailing `Str` segments of `name`, from leaf /// outward. `Num` segments or `Anonymous` terminate collection early. fn collect_name_tail_strs(name: &Name, n: usize) -> Vec { - use crate::ix::env::NameData; + use ix_common::env::NameData; let mut out: Vec = Vec::with_capacity(n); let mut cur = name.clone(); for _ in 0..n { @@ -1273,8 +1270,8 @@ fn n_canonical_minors_of(ctx: &PermCtx) -> usize { fn add_motive_alts( corr: &mut Corr, ctx: &PermCtx, - orig_decls: &[crate::ix::compile::aux_gen::expr_utils::LocalDecl], - gen_decls: &[crate::ix::compile::aux_gen::expr_utils::LocalDecl], + orig_decls: &[crate::compile::aux_gen::expr_utils::LocalDecl], + gen_decls: &[crate::compile::aux_gen::expr_utils::LocalDecl], ) { let n_params = ctx.n_params; let n_source_motives = ctx.n_source_motives(); @@ -1353,7 +1350,7 @@ fn is_motive_app(e: &Expr, motives: &[Name]) -> bool { /// - `LetE` / `Proj` / `Mdata`: recurse; `Mdata` is stripped before /// matching so it's essentially a no-op. /// - `Sort`, `Lit`: compare literally. -pub(crate) fn expr_alpha_eq_ctx( +pub fn expr_alpha_eq_ctx( g: &Expr, orig: &Expr, ctx: &PermCtx, @@ -1800,9 +1797,8 @@ fn peel_all_lambdas( expr: &Expr, prefix: &str, min_count: usize, -) -> (Vec, Vec, Expr) -{ - use crate::ix::compile::aux_gen::expr_utils::LocalDecl; +) -> (Vec, Vec, Expr) { + use crate::compile::aux_gen::expr_utils::LocalDecl; let (mut fvars, mut decls, mut body): (Vec, Vec, Expr) = if min_count == 0 { diff --git a/src/ix/decompile.rs b/crates/compile/src/decompile.rs similarity index 98% rename from src/ix/decompile.rs rename to crates/compile/src/decompile.rs index 8b1ccf61..65199a33 100644 --- a/src/ix/decompile.rs +++ b/crates/compile/src/decompile.rs @@ -9,35 +9,37 @@ #![allow(clippy::map_err_ignore)] #![allow(clippy::match_same_arms)] -use lean_ffi::nat::Nat; +use bignat::Nat; + +use ix_common::address::Address; +use ix_common::env::{ + AxiomVal, BinderInfo, ConstantInfo as LeanConstantInfo, ConstantVal, + ConstructorVal, DataValue as LeanDataValue, DefinitionSafety, DefinitionVal, + Env as LeanEnv, Expr as LeanExpr, InductiveVal, Int, Level, Literal, Name, + OpaqueVal, QuotVal, RecursorRule as LeanRecursorRule, RecursorVal, + ReducibilityHints, SourceInfo, Substring, Syntax, SyntaxPreresolved, + TheoremVal, +}; -use crate::{ - ix::address::Address, - ix::compile::CompileState, - ix::env::{ - AxiomVal, BinderInfo, ConstantInfo as LeanConstantInfo, ConstantVal, - ConstructorVal, DataValue as LeanDataValue, DefinitionSafety, - DefinitionVal, Env as LeanEnv, Expr as LeanExpr, InductiveVal, Int, Level, - Literal, Name, OpaqueVal, QuotVal, RecursorRule as LeanRecursorRule, - RecursorVal, ReducibilityHints, SourceInfo, Substring, Syntax, - SyntaxPreresolved, TheoremVal, +use ixon::{ + DecompileError, Tag0, + constant::{ + Axiom, Constant, ConstantInfo, Constructor, DefKind, Definition, + DefinitionProj, Inductive, InductiveProj, MutConst, Quotient, Recursor, + RecursorProj, }, - ix::ixon::{ - DecompileError, Tag0, - constant::{ - Axiom, Constant, ConstantInfo, Constructor, DefKind, Definition, - DefinitionProj, Inductive, InductiveProj, MutConst, Quotient, Recursor, - RecursorProj, - }, - env::Named, - expr::Expr, - metadata::{ - CallSiteEntry, ConstantMeta, ConstantMetaInfo, DataValue, ExprMeta, - ExprMetaData, KVMap, - }, - univ::Univ, + env::Named, + expr::Expr, + metadata::{ + CallSiteEntry, ConstantMeta, ConstantMetaInfo, DataValue, ExprMeta, + ExprMetaData, KVMap, }, - ix::mutual::{Def, Ind, MutConst as LeanMutConst, MutCtx, all_to_ctx}, + univ::Univ, +}; + +use crate::{ + compile::CompileState, + mutual::{Def, Ind, MutConst as LeanMutConst, MutCtx, all_to_ctx}, }; use dashmap::DashMap; use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; @@ -1934,14 +1936,14 @@ enum AuxKind { /// we're going to regenerate anyway should never have its call-sites /// surgered, since the regenerated body is emitted in canonical order /// by construction. -pub(crate) fn is_aux_gen_suffix(name: &Name) -> bool { +pub fn is_aux_gen_suffix(name: &Name) -> bool { classify_aux_gen(name).is_some() } /// Classify an aux_gen constant by suffix, returning (kind, root_inductive). /// The root inductive is the base inductive the auxiliary is derived from. fn classify_aux_gen(name: &Name) -> Option<(AuxKind, Name)> { - use crate::ix::env::NameData; + use ix_common::env::NameData; let s1 = name.last_str()?; let p1 = match name.as_data() { NameData::Str(parent, _, _) => parent.clone(), @@ -2036,7 +2038,7 @@ fn def_safety(is_unsafe: bool) -> DefinitionSafety { /// `mkDefinitionValInferringUnsafe`, which always flips to `Unsafe` when the /// parent inductive is unsafe (the value references the parent's `.rec`). fn below_def_to_lean( - def: &crate::ix::compile::aux_gen::below::BelowDef, + def: &crate::compile::aux_gen::below::BelowDef, ) -> LeanConstantInfo { LeanConstantInfo::DefnInfo(DefinitionVal { cnst: ConstantVal { @@ -2057,7 +2059,7 @@ fn below_def_to_lean( /// branch of `IndPredBelow`). The constructor `is_unsafe` matches the /// enclosing inductive — the kernel rejects mixed safety within an inductive. fn below_indc_to_lean( - indc: &crate::ix::compile::aux_gen::below::BelowIndc, + indc: &crate::compile::aux_gen::below::BelowIndc, all_below_names: &[Name], ) -> (InductiveVal, Vec) { let ctor_names: Vec = @@ -2117,7 +2119,7 @@ fn below_indc_to_lean( /// (`Lean/Environment.lean:2797`), which replaces a theorem with an unsafe /// definition whenever `env.hasUnsafe` fires on the type or value. fn brecon_def_to_lean( - def: &crate::ix::compile::aux_gen::brecon::BRecOnDef, + def: &crate::compile::aux_gen::brecon::BRecOnDef, ) -> LeanConstantInfo { let cnst = ConstantVal { name: def.name.clone(), @@ -2429,11 +2431,11 @@ fn roundtrip_block( stt: &CompileState, dstt: &DecompileState, ) -> Result, DecompileError> { - use crate::ix::compile::{ + use crate::compile::{ BlockCache as CompileBlockCache, compile_definition, compile_inductive, compile_mutual_block, compile_recursor, sort_consts, }; - use crate::ix::mutual::ctx_to_all; + use crate::mutual::ctx_to_all; let mut results: FxHashMap = FxHashMap::default(); if consts.is_empty() { @@ -2528,7 +2530,7 @@ fn roundtrip_block( // Singleton: compile as bare constant (no Muts wrapper). let result = match &ixon_mutuals[0] { MutConst::Defn(def) => { - crate::ix::compile::apply_sharing_to_definition_with_stats( + crate::compile::apply_sharing_to_definition_with_stats( def.clone(), block_refs, block_univs, @@ -2536,7 +2538,7 @@ fn roundtrip_block( ) }, MutConst::Recr(rec) => { - crate::ix::compile::apply_sharing_to_recursor_with_stats( + crate::compile::apply_sharing_to_recursor_with_stats( rec.clone(), block_refs, block_univs, @@ -3209,7 +3211,7 @@ fn decompile_named_const( /// Idempotent: if `stt.aux_perms` already has an entry for the name, we /// leave it alone (compile-in-progress stt wins over rehydrated copy). fn rehydrate_aux_perms_from_env(stt: &CompileState) { - use crate::ix::ixon::metadata::ConstantMetaInfo; + use ixon::metadata::ConstantMetaInfo; let mut n_muts = 0usize; let mut n_muts_with_layout = 0usize; @@ -3321,7 +3323,7 @@ fn block_mut_consts_from_env( #[derive(Clone)] struct StoredPlanBlock { class_names: Vec>, - aux_layout: Option, + aux_layout: Option, flat_names: Vec, } @@ -3417,7 +3419,7 @@ fn fallback_plan_blocks_from_sort( env: &LeanEnv, stt: &CompileState, ) -> Result, DecompileError> { - use crate::ix::compile::{BlockCache as CompileBlockCache, sort_consts}; + use crate::compile::{BlockCache as CompileBlockCache, sort_consts}; let cs = block_mut_consts_from_env(all_names, env)?; if cs.is_empty() { @@ -3449,7 +3451,7 @@ fn install_decompile_call_site_plans( env: &LeanEnv, stt: &CompileState, ) -> Result<(), DecompileError> { - use crate::ix::compile::{aux_gen, surgery}; + use crate::compile::{aux_gen, surgery}; if all_names.is_empty() { return Ok(()); @@ -3529,11 +3531,11 @@ fn decompile_block_aux_gen( all_names: &[Name], aux_members: &[(AuxKind, Name)], env: &mut LeanEnv, - kctx: &mut crate::ix::compile::KernelCtx, + kctx: &mut crate::compile::KernelCtx, stt: &CompileState, dstt: &DecompileState, ) -> Vec<(Name, DecompileError)> { - use crate::ix::compile::aux_gen::{ + use crate::compile::aux_gen::{ below::{BelowConstant, generate_below_constants}, brecon::generate_brecon_constants, cases_on::generate_cases_on, @@ -3568,7 +3570,7 @@ fn decompile_block_aux_gen( // Ingress transitive dependencies from constructor field types. { - use crate::ix::graph::get_constant_info_references; + use crate::graph::get_constant_info_references; for ind_name in all_names { if let Some(ci) = env.get(ind_name) { for ref_name in get_constant_info_references(ci) { @@ -3614,7 +3616,7 @@ fn decompile_block_aux_gen( // // See `docs/ix_canonicity.md` §9.3 / §17.2 for the canonicity // commitment this upholds. - let aux_layout_for_block: Option = None; + let aux_layout_for_block: Option = None; let (canonical_recs, is_prop) = if needs_rec || needs_rec_on @@ -3623,7 +3625,7 @@ fn decompile_block_aux_gen( || needs_below_rec || needs_brecon { - match crate::ix::compile::aux_gen::recursor::generate_canonical_recursors_with_layout( + match crate::compile::aux_gen::recursor::generate_canonical_recursors_with_layout( &classes, env, None, None, stt, kctx, aux_layout_for_block.as_ref(), None, // source_of_canonical derived from aux_layout inside _with_layout @@ -3724,7 +3726,7 @@ fn decompile_block_aux_gen( for co_name in &cases_on_members { let ind_name = match co_name.as_data() { - crate::ix::env::NameData::Str(parent, _, _) => parent.clone(), + ix_common::env::NameData::Str(parent, _, _) => parent.clone(), _ => continue, }; let rec_name = Name::str(ind_name.clone(), "rec".to_string()); @@ -3795,7 +3797,7 @@ fn decompile_block_aux_gen( // Phase 1c: Generate .recOn definitions (arg-reordered .rec wrapper). if needs_rec_on { - use crate::ix::compile::aux_gen::rec_on::generate_rec_on; + use crate::compile::aux_gen::rec_on::generate_rec_on; let rec_on_members: Vec<&Name> = aux_members .iter() @@ -3805,7 +3807,7 @@ fn decompile_block_aux_gen( for ro_name in &rec_on_members { let ind_name = match ro_name.as_data() { - crate::ix::env::NameData::Str(parent, _, _) => parent.clone(), + ix_common::env::NameData::Str(parent, _, _) => parent.clone(), _ => continue, }; let rec_name = Name::str(ind_name, "rec".to_string()); @@ -4260,8 +4262,7 @@ fn decompile_block_aux_gen( if let Some(orig) = orig_env { for (name, generated_ci) in &generated_consts { if let Some(orig_ci) = orig.get(name) - && let Err(e) = - crate::ix::congruence::const_alpha_eq(generated_ci, orig_ci) + && let Err(e) = crate::congruence::const_alpha_eq(generated_ci, orig_ci) { aux_gen_errors.push(( name.clone(), @@ -4289,10 +4290,10 @@ fn decompile_block_aux_gen( pub fn decompile_env( stt: &CompileState, ) -> Result { - use crate::ix::compile::KernelCtx; - use crate::ix::compile::aux_gen::expr_utils; - use crate::ix::condense::compute_sccs; - use crate::ix::graph::{NameSet, RefMap, get_constant_info_references}; + use crate::compile::KernelCtx; + use crate::compile::aux_gen::expr_utils; + use crate::condense::compute_sccs; + use crate::graph::{NameSet, RefMap, get_constant_info_references}; let dstt = DecompileState::default(); @@ -4687,8 +4688,8 @@ pub fn check_decompile( #[cfg(test)] mod tests { use super::*; - use crate::ix::compile::compile_name; - use crate::ix::env::Level; + use crate::compile::compile_name; + use ix_common::env::Level; /// Register a Name in `stt.env.names` so `decompile_name` can resolve it. /// Mirrors `compile_name` (content-address the name, insert into names map). @@ -4701,7 +4702,7 @@ mod tests { fn lean_telescope(e: &LeanExpr) -> (LeanExpr, Vec) { let mut args = Vec::new(); let mut cur = e.clone(); - while let crate::ix::env::ExprData::App(f, a, _) = cur.as_data() { + while let ix_common::env::ExprData::App(f, a, _) = cur.as_data() { args.push(a.clone()); cur = f.clone(); } @@ -4712,7 +4713,7 @@ mod tests { /// Pull the bvar index out of a Lean expr, or None if it isn't a bvar. fn bvar_idx(e: &LeanExpr) -> Option { match e.as_data() { - crate::ix::env::ExprData::Bvar(n, _) => n.to_u64(), + ix_common::env::ExprData::Bvar(n, _) => n.to_u64(), _ => None, } } @@ -4800,7 +4801,7 @@ mod tests { // The reconstructed spine should be in *source* order: Var 10, 11, 12. let (head_lean, args) = lean_telescope(&decompiled); match head_lean.as_data() { - crate::ix::env::ExprData::Const(name, _, _) => { + ix_common::env::ExprData::Const(name, _, _) => { assert_eq!(*name, head_name, "head const name mismatch"); }, other => panic!("expected Const head, got {other:?}"), @@ -4899,7 +4900,7 @@ mod tests { // Expected source-order spine: App(App(head, motive_ref), major). let (head_lean, args) = lean_telescope(&decompiled); match head_lean.as_data() { - crate::ix::env::ExprData::Const(name, _, _) => { + ix_common::env::ExprData::Const(name, _, _) => { assert_eq!(*name, head_name); }, other => panic!("expected head Const, got {other:?}"), @@ -4912,7 +4913,7 @@ mod tests { // args[0] is the collapsed motive — must be Const(target), NOT the // decoy lambda from sharing[0]. match args[0].as_data() { - crate::ix::env::ExprData::Const(name, _, _) => { + ix_common::env::ExprData::Const(name, _, _) => { assert_eq!( *name, target_name, "args[0] is the Collapsed motive and must resolve via \ @@ -4948,9 +4949,9 @@ mod tests { // ------------------------------------------------------------------------- #[test] fn test_projection_decompile_loads_meta_extensions() { - use crate::ix::address::Address; - use crate::ix::env::DefinitionSafety; - use crate::ix::ixon::constant::{ + use ix_common::address::Address; + use ix_common::env::DefinitionSafety; + use ixon::constant::{ DefKind, Definition, DefinitionProj, MutConst as IxMutConst, }; @@ -5068,7 +5069,7 @@ mod tests { LeanConstantInfo::DefnInfo(dv) => { let (head_lean, args) = lean_telescope(&dv.value); match head_lean.as_data() { - crate::ix::env::ExprData::Const(name, _, _) => { + ix_common::env::ExprData::Const(name, _, _) => { assert_eq!( *name, head_name, "CallSite head should decode as `head`" @@ -5078,7 +5079,7 @@ mod tests { } assert_eq!(args.len(), 2, "CallSite had 2 entries -> 2 app args"); match args[0].as_data() { - crate::ix::env::ExprData::Const(name, _, _) => { + ix_common::env::ExprData::Const(name, _, _) => { assert_eq!( *name, target_name, "Collapsed arg must resolve via loaded meta_sharing[0]" diff --git a/src/ix/graph.rs b/crates/compile/src/graph.rs similarity index 98% rename from src/ix/graph.rs rename to crates/compile/src/graph.rs index f90c7a95..e10bd777 100644 --- a/src/ix/graph.rs +++ b/crates/compile/src/graph.rs @@ -9,7 +9,7 @@ use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use rustc_hash::{FxHashMap, FxHashSet}; use std::collections::hash_map::Entry; -use crate::ix::env::{ConstantInfo, Env, Expr, ExprData, Name}; +use ix_common::env::{ConstantInfo, Env, Expr, ExprData, Name}; /// A set of [`Name`]s, used to represent the neighbors of a node in the reference graph. pub type NameSet = FxHashSet; @@ -97,9 +97,7 @@ pub fn build_ref_graph(env: &Env) -> RefGraph { RefGraph { out_refs, in_refs } } -pub(crate) fn get_constant_info_references( - constant_info: &ConstantInfo, -) -> NameSet { +pub fn get_constant_info_references(constant_info: &ConstantInfo) -> NameSet { let cache = &mut FxHashMap::default(); match constant_info { ConstantInfo::AxiomInfo(val) => get_expr_references(&val.cnst.typ, cache), @@ -179,8 +177,8 @@ fn get_expr_references<'a>( #[cfg(test)] mod tests { use super::*; - use crate::ix::env::*; - use lean_ffi::nat::Nat; + use bignat::Nat; + use ix_common::env::*; fn n(s: &str) -> Name { Name::str(Name::anon(), s.to_string()) diff --git a/src/ix/ground.rs b/crates/compile/src/ground.rs similarity index 98% rename from src/ix/ground.rs rename to crates/compile/src/ground.rs index ffe7325a..c854a311 100644 --- a/src/ix/ground.rs +++ b/crates/compile/src/ground.rs @@ -9,15 +9,14 @@ use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use rustc_hash::{FxHashMap, FxHashSet}; use std::collections::hash_map::Entry; -use lean_ffi::nat::Nat; +use bignat::Nat; -use crate::{ - ix::env::{ - ConstantInfo, Env, Expr, ExprData, InductiveVal, Level, LevelData, Name, - }, - ix::graph::RefMap, +use ix_common::env::{ + ConstantInfo, Env, Expr, ExprData, InductiveVal, Level, LevelData, Name, }; +use crate::graph::RefMap; + /// Reason a constant failed groundedness checking. /// /// `Indc` carries `InductiveVal + Option` (~360 bytes) — the @@ -235,8 +234,8 @@ fn ground_level( #[cfg(test)] mod tests { use super::*; - use crate::ix::env::*; - use crate::ix::graph::build_ref_graph; + use crate::graph::build_ref_graph; + use ix_common::env::*; fn n(s: &str) -> Name { Name::str(Name::anon(), s.to_string()) diff --git a/src/ix/kernel/egress.rs b/crates/compile/src/kernel_egress.rs similarity index 98% rename from src/ix/kernel/egress.rs rename to crates/compile/src/kernel_egress.rs index 10435cfe..743f97db 100644 --- a/src/ix/kernel/egress.rs +++ b/crates/compile/src/kernel_egress.rs @@ -7,20 +7,20 @@ use rayon::iter::{ }; use rustc_hash::FxHashMap; -use crate::ix::env::{ +use bignat::Nat; +use ix_common::env::{ self, AxiomVal, ConstantInfo as LeanCI, ConstantVal, ConstructorVal, DefinitionVal, InductiveVal, Name, OpaqueVal, QuotVal, RecursorRule as LeanRecRule, RecursorVal, TheoremVal, }; -use crate::ix::ixon::constant::DefKind; -use lean_ffi::nat::Nat; +use ixon::constant::DefKind; -use super::constant::KConst; -use super::env::KEnv; -use super::expr::{ExprData, KExpr, MData}; -use super::id::KId; -use super::level::{KUniv, UnivData}; -use super::mode::Meta; +use ix_kernel::constant::KConst; +use ix_kernel::env::KEnv; +use ix_kernel::expr::{ExprData, KExpr, MData}; +use ix_kernel::id::KId; +use ix_kernel::level::{KUniv, UnivData}; +use ix_kernel::mode::Meta; /// Convert a zero kernel universe to a Lean level. fn egress_level(u: &KUniv, level_params: &[Name]) -> env::Level { @@ -53,7 +53,7 @@ fn egress_levels( } /// Expression egress cache, keyed by content hash. -type Cache = FxHashMap; +type Cache = FxHashMap; /// Convert a zero kernel expression to a Lean expression. fn egress_expr( @@ -343,23 +343,23 @@ use std::sync::Arc; use indexmap::IndexSet; -use crate::ix::address::Address; -use crate::ix::compile::{ +use crate::compile::{ apply_sharing_to_axiom_with_stats, apply_sharing_to_definition_with_stats, apply_sharing_to_mutual_block, apply_sharing_to_quotient_with_stats, apply_sharing_to_recursor_with_stats, }; -use crate::ix::ixon::constant::{ +use ix_common::address::Address; +use ixon::constant::{ Axiom as IxonAxiom, Constant as IxonConstant, ConstantInfo as IxonCI, Constructor as IxonConstructor, ConstructorProj, Definition as IxonDefinition, DefinitionProj, Inductive as IxonInductive, InductiveProj, MutConst as IxonMutConst, Quotient as IxonQuotient, Recursor as IxonRecursor, RecursorProj, RecursorRule as IxonRecursorRule, }; -use crate::ix::ixon::env::{Env as IxonEnv, Named}; -use crate::ix::ixon::expr::Expr as IxonExpr; -use crate::ix::ixon::metadata::ConstantMetaInfo; -use crate::ix::ixon::univ::Univ as IxonUniv; +use ixon::env::{Env as IxonEnv, Named}; +use ixon::expr::Expr as IxonExpr; +use ixon::metadata::ConstantMetaInfo; +use ixon::univ::Univ as IxonUniv; /// Per-constant (or per-block) working context accumulated while converting /// kernel expressions back to Ixon. Mirrors `BlockCache.refs` / `univs` on @@ -1256,14 +1256,17 @@ pub fn ixon_egress( #[cfg(test)] mod tests { use super::*; - use crate::ix::address::Address; - use crate::ix::env::{ + use ix_common::address::Address; + use ix_common::env::{ BinderInfo, DefinitionSafety, ExprData as LeanExprData, Literal, QuotKind, ReducibilityHints, }; - use crate::ix::kernel::constant::RecRule; - use crate::ix::kernel::expr::KExpr; - use crate::ix::kernel::id::KId; + use ix_kernel::constant::{KConst, RecRule}; + use ix_kernel::env::KEnv; + use ix_kernel::expr::KExpr; + use ix_kernel::id::KId; + use ix_kernel::level::KUniv; + use ix_kernel::mode::Meta; fn mk_name(s: &str) -> Name { let mut n = Name::anon(); diff --git a/crates/compile/src/lib.rs b/crates/compile/src/lib.rs new file mode 100644 index 00000000..da38ab96 --- /dev/null +++ b/crates/compile/src/lib.rs @@ -0,0 +1,11 @@ +//! Lean ↔ Ixon compilation pipeline plus kernel ↔ Lean egress. + +pub mod compile; +pub mod condense; +pub mod congruence; +pub mod decompile; +pub mod graph; +pub mod ground; +pub mod kernel_egress; +pub mod mutual; +pub mod store; diff --git a/src/ix/mutual.rs b/crates/compile/src/mutual.rs similarity index 97% rename from src/ix/mutual.rs rename to crates/compile/src/mutual.rs index b3bf8122..b7486a75 100644 --- a/src/ix/mutual.rs +++ b/crates/compile/src/mutual.rs @@ -5,16 +5,15 @@ //! [`ctx_to_all`] / [`all_to_ctx`] functions convert between ordered name //! vectors and index maps. -use lean_ffi::nat::Nat; - -use crate::{ - ix::env::{ - ConstructorVal, DefinitionSafety, DefinitionVal, Expr, InductiveVal, Name, - OpaqueVal, RecursorVal, ReducibilityHints, TheoremVal, - }, - ix::ixon::constant::DefKind, +use bignat::Nat; + +use ix_common::env::{ + ConstructorVal, DefinitionSafety, DefinitionVal, Expr, InductiveVal, Name, + OpaqueVal, RecursorVal, ReducibilityHints, TheoremVal, }; +use ixon::constant::DefKind; + use rustc_hash::FxHashMap; /// A definition-like constant (definition, theorem, or opaque) unified into a @@ -195,7 +194,7 @@ impl MutConst { #[cfg(test)] mod tests { use super::*; - use crate::ix::env::{ConstantVal, Level}; + use ix_common::env::{ConstantVal, Level}; fn n(s: &str) -> Name { Name::str(Name::anon(), s.to_string()) diff --git a/src/ix/store.rs b/crates/compile/src/store.rs similarity index 98% rename from src/ix/store.rs rename to crates/compile/src/store.rs index fe45f508..33dcaf79 100644 --- a/src/ix/store.rs +++ b/crates/compile/src/store.rs @@ -4,7 +4,7 @@ //! are derived from the first 6 hex characters of the Blake3 hash. This provides //! deterministic addressing: identical content always maps to the same path. -use crate::ix::address::Address; +use ix_common::address::Address; use std::env; use std::fs; use std::io; diff --git a/crates/ffi/Cargo.toml b/crates/ffi/Cargo.toml new file mode 100644 index 00000000..bc078147 --- /dev/null +++ b/crates/ffi/Cargo.toml @@ -0,0 +1,50 @@ +[package] +name = "ix-ffi" +version.workspace = true +edition.workspace = true +license.workspace = true + +[lib] +crate-type = ["lib", "staticlib"] + +[dependencies] +aiur = { workspace = true } +anyhow = { workspace = true } +bignat = { workspace = true } +blake3 = { workspace = true } +dashmap = { workspace = true, features = ["rayon"] } +indexmap = { workspace = true, features = ["rayon"] } +itertools = { workspace = true } +ix-common = { workspace = true } +ix-compile = { workspace = true } +ixon = { workspace = true } +ix-kernel = { workspace = true } +lean-ffi = { workspace = true } +multi-stark = { workspace = true } +mimalloc = { workspace = true } +num-bigint = { workspace = true } +rayon = { workspace = true } +rustc-hash = { workspace = true } +sha2 = { workspace = true } +tiny-keccak = { workspace = true } + +# Iroh dependencies +bytes = { version = "1.10.1", optional = true } +tokio = { version = "1.44.1", optional = true } +iroh = { version = "0.97", optional = true } +iroh-base = { version = "0.97", optional = true } +n0-error = { version = "0.1", optional = true } +getrandom = { version = "0.3", optional = true } +tracing = { version = "0.1", optional = true } +tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = true } +bincode = { version = "2.0.1", optional = true } +serde = { version = "1.0.219", features = ["derive"], optional = true } + +[features] +default = [] +parallel = ["aiur/parallel"] +test-ffi = [] +net = ["bytes", "tokio", "iroh", "iroh-base", "n0-error", "getrandom", "tracing", "tracing-subscriber", "bincode", "serde"] + +[lints] +workspace = true diff --git a/src/ffi/_iroh.rs b/crates/ffi/src/_iroh.rs similarity index 100% rename from src/ffi/_iroh.rs rename to crates/ffi/src/_iroh.rs diff --git a/src/ffi/aiur.rs b/crates/ffi/src/aiur.rs similarity index 95% rename from src/ffi/aiur.rs rename to crates/ffi/src/aiur.rs index aa565fd2..01ad45ac 100644 --- a/src/ffi/aiur.rs +++ b/crates/ffi/src/aiur.rs @@ -3,7 +3,7 @@ use multi_stark::p3_field::integers::QuotientMap; pub mod protocol; pub mod toplevel; -use crate::aiur::G; +use aiur::G; use lean_ffi::object::LeanRef; #[inline] diff --git a/src/ffi/aiur/protocol.rs b/crates/ffi/src/aiur/protocol.rs similarity index 98% rename from src/ffi/aiur/protocol.rs rename to crates/ffi/src/aiur/protocol.rs index c6a1f9fe..39dd35bb 100644 --- a/src/ffi/aiur/protocol.rs +++ b/crates/ffi/src/aiur/protocol.rs @@ -12,18 +12,16 @@ use lean_ffi::object::{ }; use crate::{ - aiur::{ - G, - execute::{IOBuffer, IOKeyInfo}, - synthesis::AiurSystem, - }, - ffi::aiur::{ - lean_unbox_g, lean_unbox_nat_as_usize, toplevel::decode_toplevel, - }, + aiur::{lean_unbox_g, lean_unbox_nat_as_usize, toplevel::decode_toplevel}, lean::{ LeanAiurCommitmentParameters, LeanAiurFriParameters, LeanAiurToplevel, }, }; +use aiur::{ + G, + execute::{IOBuffer, IOKeyInfo}, + synthesis::AiurSystem, +}; // ============================================================================= // External class registration diff --git a/src/ffi/aiur/toplevel.rs b/crates/ffi/src/aiur/toplevel.rs similarity index 97% rename from src/ffi/aiur/toplevel.rs rename to crates/ffi/src/aiur/toplevel.rs index 02b8a4e8..b93f3f6f 100644 --- a/src/ffi/aiur/toplevel.rs +++ b/crates/ffi/src/aiur/toplevel.rs @@ -4,16 +4,13 @@ use lean_ffi::object::{LeanBorrowed, LeanCtor, LeanRef}; use crate::lean::LeanAiurFunction; -use crate::{ - FxIndexMap, - aiur::{ - G, - bytecode::{Block, Ctrl, Function, FunctionLayout, Op, Toplevel, ValIdx}, - }, - lean::LeanAiurToplevel, +use crate::lean::LeanAiurToplevel; +use aiur::{ + FxIndexMap, G, + bytecode::{Block, Ctrl, Function, FunctionLayout, Op, Toplevel, ValIdx}, }; -use crate::ffi::aiur::{lean_unbox_g, lean_unbox_nat_as_usize}; +use crate::aiur::{lean_unbox_g, lean_unbox_nat_as_usize}; fn decode_vec_val_idx(obj: LeanBorrowed<'_>) -> Vec { obj.as_array().map(|x| lean_unbox_nat_as_usize(&x)) diff --git a/src/ffi/builder.rs b/crates/ffi/src/builder.rs similarity index 100% rename from src/ffi/builder.rs rename to crates/ffi/src/builder.rs diff --git a/src/ffi/byte_array.rs b/crates/ffi/src/byte_array.rs similarity index 100% rename from src/ffi/byte_array.rs rename to crates/ffi/src/byte_array.rs diff --git a/src/ffi/compile.rs b/crates/ffi/src/compile.rs similarity index 97% rename from src/ffi/compile.rs rename to crates/ffi/src/compile.rs index 84156240..4aa59f6f 100644 --- a/src/ffi/compile.rs +++ b/crates/ffi/src/compile.rs @@ -9,44 +9,44 @@ use std::sync::Arc; -use crate::ix::address::Address; -use crate::ix::compile::{ - CompileOptions, CompileState, compile_env_with_options, -}; -use crate::ix::condense::compute_sccs; -use crate::ix::decompile::decompile_env; -use crate::ix::env::Name; -use crate::ix::graph::build_ref_graph; -use crate::ix::ixon::constant::Constant as IxonConstant; -#[cfg(feature = "test-ffi")] -use crate::ix::ixon::constant::ConstantInfo; -#[cfg(feature = "test-ffi")] -use crate::ix::ixon::expr::Expr as IxonExpr; -use crate::ix::ixon::{Comm, ConstantMeta}; use crate::lean::{ LeanIxBlock, LeanIxCompileError, LeanIxCompilePhases, LeanIxCondensedBlocks, LeanIxConstantInfo, LeanIxDecompileError, LeanIxName, LeanIxRawEnvironment, LeanIxSerializeError, LeanIxonRawBlob, LeanIxonRawComm, LeanIxonRawConst, LeanIxonRawEnv, LeanIxonRawNameEntry, LeanIxonRawNamed, }; -use lean_ffi::nat::Nat; +use ix_common::address::Address; +use ix_common::env::Name; +use ix_compile::compile::{ + CompileOptions, CompileState, compile_env_with_options, +}; +use ix_compile::condense::compute_sccs; +use ix_compile::decompile::decompile_env; +use ix_compile::graph::build_ref_graph; +use ixon::constant::Constant as IxonConstant; +#[cfg(feature = "test-ffi")] +use ixon::constant::ConstantInfo; +#[cfg(feature = "test-ffi")] +use ixon::expr::Expr as IxonExpr; +use ixon::{Comm, ConstantMeta}; +use lean_ffi::nat::{Nat, NatExt}; use lean_ffi::object::LeanIOResult; use lean_ffi::object::{ LeanArray, LeanBorrowed, LeanByteArray, LeanExcept, LeanList, LeanOwned, LeanProd, LeanRef, LeanString, }; -use crate::ffi::builder::LeanBuildCache; -use crate::ffi::ixon::env::decoded_to_ixon_env; -use crate::ffi::lean_env::decode_env; +use crate::builder::LeanBuildCache; use crate::lean::LeanIxAddress; +use crate::lean_env::decode_env; +use crate::lean_ixon::env::decoded_to_ixon_env; #[cfg(feature = "test-ffi")] -use crate::ffi::lean_env::{GlobalCache, decode_name}; +use crate::lean::{LeanIxBlockCompareDetail, LeanIxBlockCompareResult}; #[cfg(feature = "test-ffi")] -use crate::ix::ixon::serialize::put_expr; +use crate::lean_env::{GlobalCache, decode_name}; #[cfg(feature = "test-ffi")] -use crate::lean::{LeanIxBlockCompareDetail, LeanIxBlockCompareResult}; +use ixon::serialize::put_expr; #[cfg(feature = "test-ffi")] use std::collections::HashMap; @@ -996,17 +996,17 @@ extern "C" fn rs_get_pre_sharing_exprs( let mut exprs = Vec::new(); for mc in muts { match mc { - crate::ix::ixon::constant::MutConst::Defn(def) => { + ixon::constant::MutConst::Defn(def) => { exprs.push(def.typ.clone()); exprs.push(def.value.clone()); }, - crate::ix::ixon::constant::MutConst::Indc(ind) => { + ixon::constant::MutConst::Indc(ind) => { exprs.push(ind.typ.clone()); for ctor in &ind.ctors { exprs.push(ctor.typ.clone()); } }, - crate::ix::ixon::constant::MutConst::Recr(rec) => { + ixon::constant::MutConst::Recr(rec) => { exprs.push(rec.typ.clone()); for rule in &rec.rules { exprs.push(rule.rhs.clone()); @@ -1085,13 +1085,9 @@ extern "C" fn rs_get_pre_sharing_exprs_len( let mut count = 0; for mc in muts { match mc { - crate::ix::ixon::constant::MutConst::Defn(_) => count += 2, - crate::ix::ixon::constant::MutConst::Indc(ind) => { - count += 1 + ind.ctors.len() - }, - crate::ix::ixon::constant::MutConst::Recr(rec) => { - count += 1 + rec.rules.len() - }, + ixon::constant::MutConst::Defn(_) => count += 2, + ixon::constant::MutConst::Indc(ind) => count += 1 + ind.ctors.len(), + ixon::constant::MutConst::Recr(rec) => count += 1 + rec.rules.len(), } } count @@ -1149,7 +1145,7 @@ extern "C" fn rs_get_compiled_const_count( // Error type FFI builders // ============================================================================= -use crate::ix::ixon::error::{CompileError, DecompileError, SerializeError}; +use ixon::error::{CompileError, DecompileError, SerializeError}; impl LeanIxSerializeError { /// Build a Lean Ixon.SerializeError from a Rust SerializeError. diff --git a/src/ffi/graph.rs b/crates/ffi/src/graph.rs similarity index 94% rename from src/ffi/graph.rs rename to crates/ffi/src/graph.rs index acfcacff..5dfdd9e8 100644 --- a/src/ffi/graph.rs +++ b/crates/ffi/src/graph.rs @@ -2,21 +2,21 @@ use std::sync::Arc; -use crate::ix::condense::compute_sccs; -use crate::ix::graph::build_ref_graph; use crate::lean::LeanIxCondensedBlocks; +use ix_compile::condense::compute_sccs; +use ix_compile::graph::build_ref_graph; use lean_ffi::object::{ LeanArray, LeanBorrowed, LeanIOResult, LeanList, LeanOwned, LeanProd, }; -use crate::ffi::builder::LeanBuildCache; -use crate::ffi::lean_env::decode_env; +use crate::builder::LeanBuildCache; use crate::lean::LeanIxName; +use crate::lean_env::decode_env; /// Build an Array (Ix.Name × Array Ix.Name) from a RefMap. pub fn build_ref_graph_array( cache: &mut LeanBuildCache, - refs: &crate::ix::graph::RefMap, + refs: &ix_compile::graph::RefMap, ) -> LeanArray { let arr = LeanArray::alloc(refs.len()); for (i, (name, ref_set)) in refs.iter().enumerate() { @@ -38,7 +38,7 @@ impl LeanIxCondensedBlocks { /// Build a RustCondensedBlocks structure. pub fn build( cache: &mut LeanBuildCache, - condensed: &crate::ix::condense::CondensedBlocks, + condensed: &ix_compile::condense::CondensedBlocks, ) -> Self { // Build lowLinks: Array (Ix.Name × Ix.Name) let low_links_arr = LeanArray::alloc(condensed.low_links.len()); diff --git a/src/iroh.rs b/crates/ffi/src/iroh.rs similarity index 100% rename from src/iroh.rs rename to crates/ffi/src/iroh.rs diff --git a/src/iroh/client.rs b/crates/ffi/src/iroh/client.rs similarity index 100% rename from src/iroh/client.rs rename to crates/ffi/src/iroh/client.rs diff --git a/src/iroh/server.rs b/crates/ffi/src/iroh/server.rs similarity index 100% rename from src/iroh/server.rs rename to crates/ffi/src/iroh/server.rs diff --git a/src/ffi/ix.rs b/crates/ffi/src/ix.rs similarity index 100% rename from src/ffi/ix.rs rename to crates/ffi/src/ix.rs diff --git a/src/ffi/ix/address.rs b/crates/ffi/src/ix/address.rs similarity index 98% rename from src/ffi/ix/address.rs rename to crates/ffi/src/ix/address.rs index f389f8d1..34512e45 100644 --- a/src/ffi/ix/address.rs +++ b/crates/ffi/src/ix/address.rs @@ -2,8 +2,8 @@ //! //! Address = { hash : ByteArray } - ByteArray wrapper for blake3 Hash -use crate::ix::address::Address; use crate::lean::LeanIxAddress; +use ix_common::address::Address; use lean_ffi::object::{LeanArray, LeanBorrowed, LeanByteArray, LeanOwned}; impl LeanIxAddress { diff --git a/src/ffi/ix/constant.rs b/crates/ffi/src/ix/constant.rs similarity index 99% rename from src/ffi/ix/constant.rs rename to crates/ffi/src/ix/constant.rs index ebc01d8c..a72c5ee2 100644 --- a/src/ffi/ix/constant.rs +++ b/crates/ffi/src/ix/constant.rs @@ -10,23 +10,23 @@ //! - Tag 6: ctorInfo (v : ConstructorVal) //! - Tag 7: recInfo (v : RecursorVal) -use crate::ix::env::{ - AxiomVal, ConstantInfo, ConstantVal, ConstructorVal, DefinitionSafety, - DefinitionVal, InductiveVal, Name, OpaqueVal, QuotKind, QuotVal, - RecursorRule, RecursorVal, ReducibilityHints, TheoremVal, -}; use crate::lean::{ LeanIxAxiomVal, LeanIxConstantInfo, LeanIxConstantVal, LeanIxConstructorVal, LeanIxDefinitionVal, LeanIxExpr, LeanIxInductiveVal, LeanIxName, LeanIxOpaqueVal, LeanIxQuotVal, LeanIxRecursorRule, LeanIxRecursorVal, LeanIxReducibilityHints, LeanIxTheoremVal, }; -use lean_ffi::nat::Nat; +use ix_common::env::{ + AxiomVal, ConstantInfo, ConstantVal, ConstructorVal, DefinitionSafety, + DefinitionVal, InductiveVal, Name, OpaqueVal, QuotKind, QuotVal, + RecursorRule, RecursorVal, ReducibilityHints, TheoremVal, +}; +use lean_ffi::nat::{Nat, NatExt}; #[cfg(feature = "test-ffi")] use lean_ffi::object::LeanBorrowed; use lean_ffi::object::{LeanArray, LeanOwned, LeanRef}; -use crate::ffi::builder::LeanBuildCache; +use crate::builder::LeanBuildCache; // ============================================================================= // ConstantVal diff --git a/src/ffi/ix/data.rs b/crates/ffi/src/ix/data.rs similarity index 99% rename from src/ffi/ix/data.rs rename to crates/ffi/src/ix/data.rs index 7fbb6228..486800da 100644 --- a/src/ffi/ix/data.rs +++ b/crates/ffi/src/ix/data.rs @@ -1,18 +1,18 @@ //! Ix.DataValue, Ix.Syntax, Ix.SourceInfo build/decode/roundtrip FFI. -use crate::ix::env::{ - DataValue, Int, Name, SourceInfo, Substring, Syntax, SyntaxPreresolved, -}; use crate::lean::{ LeanIxDataValue, LeanIxInt, LeanIxName, LeanIxSourceInfo, LeanIxSubstring, LeanIxSyntax, LeanIxSyntaxPreresolved, }; -use lean_ffi::nat::Nat; +use ix_common::env::{ + DataValue, Int, Name, SourceInfo, Substring, Syntax, SyntaxPreresolved, +}; +use lean_ffi::nat::{Nat, NatExt}; #[cfg(feature = "test-ffi")] use lean_ffi::object::LeanBorrowed; use lean_ffi::object::{LeanArray, LeanOwned, LeanProd, LeanRef, LeanString}; -use crate::ffi::builder::LeanBuildCache; +use crate::builder::LeanBuildCache; impl LeanIxInt { /// Build a Ix.Int (ofNat or negSucc). diff --git a/src/ffi/ix/env.rs b/crates/ffi/src/ix/env.rs similarity index 97% rename from src/ffi/ix/env.rs rename to crates/ffi/src/ix/env.rs index c4179fe2..3800bc61 100644 --- a/src/ffi/ix/env.rs +++ b/crates/ffi/src/ix/env.rs @@ -2,15 +2,15 @@ use rustc_hash::FxHashMap; -use crate::ix::env::{ConstantInfo, Name}; use crate::lean::{ LeanIxConstantInfo, LeanIxEnvironment, LeanIxName, LeanIxRawEnvironment, }; +use ix_common::env::{ConstantInfo, Name}; use lean_ffi::object::{ LeanArray, LeanBorrowed, LeanCtor, LeanOwned, LeanProd, LeanRef, }; -use crate::ffi::builder::LeanBuildCache; +use crate::builder::LeanBuildCache; // ============================================================================= // HashMap Building @@ -140,7 +140,7 @@ impl LeanIxRawEnvironment { /// so we return just the array, not a structure containing it. pub fn build( cache: &mut LeanBuildCache, - consts: &crate::ix::env::Env, + consts: &ix_common::env::Env, ) -> Self { // Build consts array: Array (Name × ConstantInfo) let consts_arr = LeanArray::alloc(consts.len()); @@ -242,7 +242,7 @@ pub extern "C" fn rs_roundtrip_ix_environment( env_ptr: LeanIxEnvironment>, ) -> LeanIxRawEnvironment { let decoded = env_ptr.decode(); - let env: crate::ix::env::Env = decoded.into_iter().collect(); + let env: ix_common::env::Env = decoded.into_iter().collect(); let mut cache = LeanBuildCache::with_capacity(env.len()); LeanIxRawEnvironment::build(&mut cache, &env) } diff --git a/src/ffi/ix/expr.rs b/crates/ffi/src/ix/expr.rs similarity index 99% rename from src/ffi/ix/expr.rs rename to crates/ffi/src/ix/expr.rs index ced0bb75..e57faa03 100644 --- a/src/ffi/ix/expr.rs +++ b/crates/ffi/src/ix/expr.rs @@ -14,16 +14,16 @@ //! - Tag 10: mdata (data : Array (Name × DataValue)) (expr : Expr) (hash : Address) //! - Tag 11: proj (typeName : Name) (idx : Nat) (struct : Expr) (hash : Address) -use crate::ffi::builder::LeanBuildCache; -use crate::ix::env::{ - BinderInfo, DataValue, Expr, ExprData, Level, Literal, Name, -}; +use crate::builder::LeanBuildCache; use crate::lean::LeanIxAddress; use crate::lean::{ LeanIxBinderInfo, LeanIxDataValue, LeanIxExpr, LeanIxLevel, LeanIxLiteral, LeanIxName, }; -use lean_ffi::nat::Nat; +use ix_common::env::{ + BinderInfo, DataValue, Expr, ExprData, Level, Literal, Name, +}; +use lean_ffi::nat::{Nat, NatExt}; #[cfg(feature = "test-ffi")] use lean_ffi::object::LeanBorrowed; use lean_ffi::object::{LeanOwned, LeanRef, LeanString}; diff --git a/src/ffi/ix/level.rs b/crates/ffi/src/ix/level.rs similarity index 98% rename from src/ffi/ix/level.rs rename to crates/ffi/src/ix/level.rs index 5039c386..fead881f 100644 --- a/src/ffi/ix/level.rs +++ b/crates/ffi/src/ix/level.rs @@ -8,11 +8,11 @@ //! - Tag 4: param (n : Name) (hash : Address) //! - Tag 5: mvar (n : Name) (hash : Address) -use crate::ix::env::{Level, LevelData}; use crate::lean::{LeanIxLevel, LeanIxName}; +use ix_common::env::{Level, LevelData}; use lean_ffi::object::{LeanArray, LeanBorrowed, LeanOwned, LeanRef}; -use crate::ffi::builder::LeanBuildCache; +use crate::builder::LeanBuildCache; use crate::lean::LeanIxAddress; impl LeanIxLevel { diff --git a/src/ffi/ix/name.rs b/crates/ffi/src/ix/name.rs similarity index 96% rename from src/ffi/ix/name.rs rename to crates/ffi/src/ix/name.rs index 62e72ec0..8cda4f0c 100644 --- a/src/ffi/ix/name.rs +++ b/crates/ffi/src/ix/name.rs @@ -5,14 +5,14 @@ //! - Tag 1: str (parent : Name) (s : String) (hash : Address) //! - Tag 2: num (parent : Name) (i : Nat) (hash : Address) -use crate::ix::env::{Name, NameData}; use crate::lean::LeanIxName; -use lean_ffi::nat::Nat; +use ix_common::env::{Name, NameData}; +use lean_ffi::nat::{Nat, NatExt}; use lean_ffi::object::{ LeanArray, LeanBorrowed, LeanOwned, LeanRef, LeanString, }; -use crate::ffi::builder::LeanBuildCache; +use crate::builder::LeanBuildCache; use crate::lean::LeanIxAddress; impl LeanIxName { diff --git a/src/ffi/keccak.rs b/crates/ffi/src/keccak.rs similarity index 100% rename from src/ffi/keccak.rs rename to crates/ffi/src/keccak.rs diff --git a/src/ffi/kernel.rs b/crates/ffi/src/kernel.rs similarity index 98% rename from src/ffi/kernel.rs rename to crates/ffi/src/kernel.rs index f62a429a..131c2657 100644 --- a/src/ffi/kernel.rs +++ b/crates/ffi/src/kernel.rs @@ -37,7 +37,7 @@ use std::thread; use std::time::{Duration, Instant}; use lean_ffi::include::lean_object; -use lean_ffi::nat::Nat; +use lean_ffi::nat::{Nat, NatExt}; use rustc_hash::FxHashMap; use lean_ffi::object::{ @@ -48,34 +48,34 @@ use lean_ffi::object::{ use crate::lean::LeanIxCheckError; #[cfg(feature = "test-ffi")] -use crate::ffi::lean_env::{GlobalCache, decode_name}; -use crate::ffi::lean_env::{decode_env, decode_name_array}; -use crate::ix::address::Address; -use crate::ix::compile::{ +use crate::lean_env::{GlobalCache, decode_name}; +use crate::lean_env::{decode_env, decode_name_array}; +use ix_common::address::Address; +use ix_common::env::{Name, NameData}; +use ix_compile::compile::{ CompileOptions, CompileState, compile_env_with_options, }; #[cfg(feature = "test-ffi")] -use crate::ix::decompile::decompile_env; -use crate::ix::env::{Name, NameData}; -use crate::ix::ixon::constant::ConstantInfo as IxonCI; +use ix_compile::decompile::decompile_env; #[cfg(feature = "test-ffi")] -use crate::ix::ixon::constant::MutConst as IxonMutConst; -use crate::ix::ixon::env::Env as IxonEnv; -#[cfg(feature = "test-ffi")] -use crate::ix::ixon::expr::Expr as IxonExpr; -use crate::ix::ixon::metadata::ConstantMetaInfo; -#[cfg(feature = "test-ffi")] -use crate::ix::kernel::egress::{ixon_egress, lean_egress}; -use crate::ix::kernel::env::KEnv; -use crate::ix::kernel::error::TcError; -use crate::ix::kernel::ingress::{ +use ix_compile::kernel_egress::{ixon_egress, lean_egress}; +use ix_kernel::env::KEnv; +use ix_kernel::error::TcError; +use ix_kernel::ingress::{ IxonIngressLookups, build_ixon_ingress_lookups, ingress_const_shallow_into_kenv_with_lookups, ixon_ingress_owned, }; #[cfg(feature = "test-ffi")] -use crate::ix::kernel::ingress::{ixon_ingress, lean_ingress}; -use crate::ix::kernel::mode::Meta; -use crate::ix::kernel::tc::TypeChecker; +use ix_kernel::ingress::{ixon_ingress, lean_ingress}; +use ix_kernel::mode::Meta; +use ix_kernel::tc::TypeChecker; +use ixon::constant::ConstantInfo as IxonCI; +#[cfg(feature = "test-ffi")] +use ixon::constant::MutConst as IxonMutConst; +use ixon::env::Env as IxonEnv; +#[cfg(feature = "test-ffi")] +use ixon::expr::Expr as IxonExpr; +use ixon::metadata::ConstantMetaInfo; unsafe extern "C" { fn lean_name_mk_string( @@ -417,7 +417,7 @@ pub extern "C" fn rs_kernel_check_malformed_rec_rule_ixon( t2.elapsed() ); - let kid = crate::ix::kernel::id::KId::new(rec_addr, rec_name); + let kid = ix_kernel::id::KId::new(rec_addr, rec_name); let result = { let mut tc = TypeChecker::new(&mut kenv); match tc.check_const(&kid) { @@ -520,7 +520,7 @@ fn poison_second_rec_rule_returns_first_minor( #[cfg(feature = "test-ffi")] fn poison_recursor_rule_payload( - rec: &mut crate::ix::ixon::constant::Recursor, + rec: &mut ixon::constant::Recursor, ) -> Result<(), String> { if rec.rules.len() < 2 { return Err(format!( @@ -2299,7 +2299,7 @@ pub extern "C" fn rs_kernel_roundtrip( // Build a plain Lean `Env` from decompile's DashMap for the standard // compare_envs / find_diff flow. let t5 = Instant::now(); - let mut decompiled_env = crate::ix::env::Env::default(); + let mut decompiled_env = ix_common::env::Env::default(); for entry in dstt.env.iter() { decompiled_env.insert(entry.key().clone(), entry.value().clone()); } @@ -2335,10 +2335,10 @@ pub extern "C" fn rs_kernel_roundtrip( /// manageable. #[cfg(feature = "test-ffi")] fn compare_envs( - original: &crate::ix::env::Env, - egressed: &crate::ix::env::Env, + original: &ix_common::env::Env, + egressed: &ix_common::env::Env, ) -> (Vec, usize, usize) { - use crate::ix::env::ConstantInfo as LCI; + use ix_common::env::ConstantInfo as LCI; let total = original.len(); let mut errors: Vec = Vec::new(); @@ -2408,11 +2408,11 @@ fn compare_envs( /// Returns a path-annotated description of where the mismatch is. #[cfg(feature = "test-ffi")] fn find_diff( - a: &crate::ix::env::Expr, - b: &crate::ix::env::Expr, + a: &ix_common::env::Expr, + b: &ix_common::env::Expr, path: &str, ) -> String { - use crate::ix::env::ExprData; + use ix_common::env::ExprData; if a.get_hash() == b.get_hash() { return format!("{path}: hashes match (ok)"); @@ -2508,7 +2508,7 @@ fn find_diff( let mut val_diffs = Vec::new(); for (i, ((n1, v1), (_, v2))) in kvs1.iter().zip(kvs2.iter()).enumerate() { - use crate::ix::env::hash_data_value; + use ix_common::env::hash_data_value; let mut h1 = blake3::Hasher::new(); let mut h2 = blake3::Hasher::new(); hash_data_value(v1, &mut h1); diff --git a/src/lean.rs b/crates/ffi/src/lean.rs similarity index 100% rename from src/lean.rs rename to crates/ffi/src/lean.rs diff --git a/src/ffi/lean_env.rs b/crates/ffi/src/lean_env.rs similarity index 95% rename from src/ffi/lean_env.rs rename to crates/ffi/src/lean_env.rs index 21795ffe..38de643f 100644 --- a/src/ffi/lean_env.rs +++ b/crates/ffi/src/lean_env.rs @@ -2,7 +2,7 @@ //! //! Provides functions to walk Lean object pointers and decode them into //! the Rust `Name`, `Level`, `Expr`, and `ConstantInfo` types defined in -//! `crate::ix::env`. Used by the compilation pipeline to read the Lean +//! `ix_common::env`. Used by the compilation pipeline to read the Lean //! environment before transforming it to Ixon format. //! //! Uses a two-level cache (`GlobalCache` + `LocalCache`) to avoid redundant @@ -17,11 +17,11 @@ use rayon::prelude::*; use rustc_hash::FxHashMap; -use crate::ix::compile::{CompileOptions, compile_env_with_options}; -use crate::ix::decompile::{check_decompile, decompile_env}; +use ix_compile::compile::{CompileOptions, compile_env_with_options}; +use ix_compile::decompile::{check_decompile, decompile_env}; use std::sync::Arc; -use lean_ffi::nat::Nat; +use lean_ffi::nat::{Nat, NatExt}; use lean_ffi::object::{ LeanArray, LeanBorrowed, LeanList, LeanRef, LeanShared, }; @@ -35,7 +35,7 @@ use crate::lean::{ LeanIxSyntaxPreresolved, LeanIxTheoremVal, }; -use crate::ix::env::{ +use ix_common::env::{ AxiomVal, BinderInfo, ConstantInfo, ConstantVal, ConstructorVal, DataValue, DefinitionSafety, DefinitionVal, Env, Expr, InductiveVal, Int, Level, Literal, Name, OpaqueVal, QuotKind, QuotVal, RecursorRule, RecursorVal, @@ -55,7 +55,7 @@ const PARALLEL_THRESHOLD: usize = 100; /// generated recursor is intentionally canonical rather than source-identical. fn primary_addresses_collapse( all: &[Name], - stt: &crate::ix::compile::CompileState, + stt: &ix_compile::compile::CompileState, ) -> bool { let mut seen = rustc_hash::FxHashSet::default(); for name in all { @@ -72,12 +72,12 @@ fn primary_addresses_collapse( fn build_aux_perm_ctx( all: &[Name], env: &Env, - stt: &crate::ix::compile::CompileState, + stt: &ix_compile::compile::CompileState, perm: &[usize], -) -> Option { - use crate::ix::compile::aux_gen; - use crate::ix::congruence::perm::{PermCtx, RecHeadInfo, RecHeadKind}; - use crate::ix::env::{ConstantInfo as LeanCI, ExprData}; +) -> Option { + use ix_common::env::{ConstantInfo as LeanCI, ExprData}; + use ix_compile::compile::aux_gen; + use ix_compile::congruence::perm::{PermCtx, RecHeadInfo, RecHeadKind}; let first = all.first()?; let n_params = match env.get(first) { @@ -162,7 +162,7 @@ fn build_aux_perm_ctx( ); } - let mut const_addr: FxHashMap = + let mut const_addr: FxHashMap = FxHashMap::default(); let mut add_addr = |name: &Name| { if let Some(addr) = stt.resolve_addr(name) { @@ -194,8 +194,8 @@ fn build_aux_perm_ctx( fn collect_const_addrs( e: &Expr, - stt: &crate::ix::compile::CompileState, - out: &mut FxHashMap, + stt: &ix_compile::compile::CompileState, + out: &mut FxHashMap, ) { match e.as_data() { ExprData::Const(n, _, _) => { @@ -261,13 +261,13 @@ fn build_aux_perm_ctx( fn build_collapse_const_map( all: &[Name], env: &Env, - stt: &crate::ix::compile::CompileState, + stt: &ix_compile::compile::CompileState, ) -> FxHashMap { - use crate::ix::env::ConstantInfo as LeanCI; + use ix_common::env::ConstantInfo as LeanCI; let mut map: FxHashMap = FxHashMap::default(); // Group primary members by canonical address; the first member with a // given address is the representative. - let mut rep_by_addr: FxHashMap = + let mut rep_by_addr: FxHashMap = FxHashMap::default(); for member in all { let Some(addr) = stt.resolve_addr(member) else { @@ -323,21 +323,21 @@ fn build_collapse_const_map( #[derive(Clone)] struct AuxCompareEntry { generated: ConstantInfo, - ctx: Option, + ctx: Option, } fn aux_patch_to_lean_ci( - patch: &crate::ix::compile::aux_gen::PatchedConstant, -) -> Option { - use crate::ix::env::{ + patch: &ix_compile::compile::aux_gen::PatchedConstant, +) -> ConstantInfo { + use ix_common::env::{ ConstantInfo as LeanCI, ConstantVal as LeanCV, DefinitionVal, InductiveVal, }; - Some(match patch { - crate::ix::compile::aux_gen::PatchedConstant::Rec(r) => { + match patch { + ix_compile::compile::aux_gen::PatchedConstant::Rec(r) => { LeanCI::RecInfo(r.clone()) }, - crate::ix::compile::aux_gen::PatchedConstant::CasesOn(d) - | crate::ix::compile::aux_gen::PatchedConstant::RecOn(d) => { + ix_compile::compile::aux_gen::PatchedConstant::CasesOn(d) + | ix_compile::compile::aux_gen::PatchedConstant::RecOn(d) => { LeanCI::DefnInfo(DefinitionVal { cnst: LeanCV { name: d.name.clone(), @@ -350,7 +350,7 @@ fn aux_patch_to_lean_ci( all: vec![], }) }, - crate::ix::compile::aux_gen::PatchedConstant::BelowDef(d) => { + ix_compile::compile::aux_gen::PatchedConstant::BelowDef(d) => { LeanCI::DefnInfo(DefinitionVal { cnst: LeanCV { name: d.name.clone(), @@ -363,7 +363,7 @@ fn aux_patch_to_lean_ci( all: vec![], }) }, - crate::ix::compile::aux_gen::PatchedConstant::BRecOn(d) => { + ix_compile::compile::aux_gen::PatchedConstant::BRecOn(d) => { LeanCI::DefnInfo(DefinitionVal { cnst: LeanCV { name: d.name.clone(), @@ -376,7 +376,7 @@ fn aux_patch_to_lean_ci( all: vec![], }) }, - crate::ix::compile::aux_gen::PatchedConstant::BelowIndc(bi) => { + ix_compile::compile::aux_gen::PatchedConstant::BelowIndc(bi) => { LeanCI::InductInfo(InductiveVal { cnst: LeanCV { name: bi.name.clone(), @@ -393,7 +393,7 @@ fn aux_patch_to_lean_ci( is_reflexive: bi.is_reflexive, }) }, - }) + } } fn aux_congruence_result( @@ -402,8 +402,8 @@ fn aux_congruence_result( original: &ConstantInfo, entry: Option<&AuxCompareEntry>, ) -> Result<(), String> { - use crate::ix::congruence::const_alpha_eq; - use crate::ix::congruence::perm::const_alpha_eq_with_perm; + use ix_compile::congruence::const_alpha_eq; + use ix_compile::congruence::perm::const_alpha_eq_with_perm; if let Ok(()) = const_alpha_eq(decompiled, original) { return Ok(()); } @@ -478,11 +478,11 @@ fn aux_congruence_result( fn build_aux_compare_contexts( env: &Arc, - stt: &crate::ix::compile::CompileState, + stt: &ix_compile::compile::CompileState, ) -> FxHashMap { - use crate::ix::compile::KernelCtx; - use crate::ix::compile::aux_gen::{self, expr_utils}; - use crate::ix::env::ConstantInfo as LeanCI; + use ix_common::env::ConstantInfo as LeanCI; + use ix_compile::compile::KernelCtx; + use ix_compile::compile::aux_gen::{self, expr_utils}; use rustc_hash::FxHashSet; let mut by_name = FxHashMap::default(); @@ -523,12 +523,11 @@ fn build_aux_compare_contexts( None }; for (patch_name, patch) in aux_out.patches.iter() { - if let Some(generated) = aux_patch_to_lean_ci(patch) { - by_name.insert( - patch_name.clone(), - AuxCompareEntry { generated, ctx: ctx.clone() }, - ); - } + let generated = aux_patch_to_lean_ci(patch); + by_name.insert( + patch_name.clone(), + AuxCompareEntry { generated, ctx: ctx.clone() }, + ); } } by_name @@ -1117,11 +1116,11 @@ extern "C" fn rs_tmp_decode_const_map( obj: LeanList>, ) -> usize { // Enable hash-consed size tracking for debugging - crate::ix::compile::TRACK_HASH_CONSED_SIZE + ix_compile::compile::TRACK_HASH_CONSED_SIZE .store(true, std::sync::atomic::Ordering::Relaxed); // Enable verbose sharing analysis for debugging pathological blocks - crate::ix::compile::ANALYZE_SHARING + ix_compile::compile::ANALYZE_SHARING .store(false, std::sync::atomic::Ordering::Relaxed); let env = decode_env(obj); @@ -1150,12 +1149,12 @@ extern "C" fn rs_tmp_decode_const_map( // Phase 1b: Aux_gen congruence (full env) eprintln!("[rust-compile] Phase 1b: Checking aux_gen congruence..."); { - use crate::ix::compile::aux_gen::{self, PatchedConstant, expr_utils}; - use crate::ix::congruence::const_alpha_eq; - use crate::ix::env::{ + use ix_common::env::{ ConstantInfo as LeanCI, ConstantVal as LeanCV, DefinitionSafety, DefinitionVal, InductiveVal, ReducibilityHints, }; + use ix_compile::compile::aux_gen::{self, PatchedConstant, expr_utils}; + use ix_compile::congruence::const_alpha_eq; use rustc_hash::{FxHashMap, FxHashSet}; // Build per-block PermCtx for the permutation-aware comparator. @@ -1165,11 +1164,11 @@ extern "C" fn rs_tmp_decode_const_map( fn build_perm_ctx_1b( all: &[Name], env: &Env, - stt: &crate::ix::compile::CompileState, + stt: &ix_compile::compile::CompileState, perm: &[usize], - ) -> Option { - use crate::ix::congruence::perm::{PermCtx, RecHeadInfo, RecHeadKind}; - use crate::ix::env::{ConstantInfo as LeanCI, ExprData}; + ) -> Option { + use ix_common::env::{ConstantInfo as LeanCI, ExprData}; + use ix_compile::congruence::perm::{PermCtx, RecHeadInfo, RecHeadKind}; let first = all.first()?; let n_params = match env.get(first) { @@ -1257,7 +1256,7 @@ extern "C" fn rs_tmp_decode_const_map( ); } - let mut const_addr: FxHashMap = + let mut const_addr: FxHashMap = FxHashMap::default(); let mut add_addr = |name: &Name| { if let Some(addr) = stt.resolve_addr(name) { @@ -1290,8 +1289,8 @@ extern "C" fn rs_tmp_decode_const_map( } fn collect_const_addrs( e: &Expr, - stt: &crate::ix::compile::CompileState, - out: &mut FxHashMap, + stt: &ix_compile::compile::CompileState, + out: &mut FxHashMap, ) { match e.as_data() { ExprData::Const(n, _, _) => { @@ -1377,7 +1376,7 @@ extern "C" fn rs_tmp_decode_const_map( continue; } - let mut local_kctx = crate::ix::compile::KernelCtx::new(); + let mut local_kctx = ix_compile::compile::KernelCtx::new(); expr_utils::ensure_prelude_in_kenv_of(&stt, &mut local_kctx); let orig_aux_out = match aux_gen::generate_aux_patches( &original_classes, @@ -1405,7 +1404,7 @@ extern "C" fn rs_tmp_decode_const_map( // `rs_compile_validate_aux`) for the full builder; the // `#[cfg(feature = "test-ffi")]` Phase 1b path here uses a // local copy with the same logic. - let perm_ctx_1b: Option = + let perm_ctx_1b: Option = if let Some(perm) = &orig_aux_out.perm && !perm.is_empty() { @@ -1475,7 +1474,7 @@ extern "C" fn rs_tmp_decode_const_map( }; let orig_ci: &LeanCI = orig_ci_ref; let eq_result = match &perm_ctx_1b { - Some(ctx) => crate::ix::congruence::perm::const_alpha_eq_with_perm( + Some(ctx) => ix_compile::congruence::perm::const_alpha_eq_with_perm( &gen_ci, orig_ci, ctx, ), None => const_alpha_eq(&gen_ci, orig_ci), @@ -1598,9 +1597,9 @@ extern "C" fn rs_tmp_decode_const_map( eprintln!("[rust-compile] Phase 6: Deserializing and re-decompiling..."); let t4 = std::time::Instant::now(); let mut buf: &[u8] = &serialized; - match crate::ix::ixon::env::Env::get(&mut buf) { + match ixon::env::Env::get(&mut buf) { Ok(fresh_env) => { - let fresh_stt = crate::ix::compile::CompileState { + let fresh_stt = ix_compile::compile::CompileState { env: fresh_env, ..Default::default() }; @@ -1690,7 +1689,7 @@ impl PhaseResult { extern "C" fn rs_compile_validate_aux( obj: LeanList>, ) -> usize { - use crate::ix::congruence::const_alpha_eq; + use ix_compile::congruence::const_alpha_eq; use rustc_hash::FxHashSet; let t_total = std::time::Instant::now(); @@ -1796,10 +1795,10 @@ extern "C" fn rs_compile_validate_aux( let mut p2 = PhaseResult::new("2. Aux_gen congruence"); println!("{VALIDATE_PREFIX} phase 2: checking aux_gen congruence..."); { - use crate::ix::compile::aux_gen::{self, PatchedConstant, expr_utils}; - use crate::ix::compile::{KernelCtx, mk_indc}; - use crate::ix::env::ConstantInfo as LeanCI; - use crate::ix::mutual::MutConst; + use ix_common::env::ConstantInfo as LeanCI; + use ix_compile::compile::aux_gen::{self, PatchedConstant, expr_utils}; + use ix_compile::compile::{KernelCtx, mk_indc}; + use ix_compile::mutual::MutConst; // Ephemeral kernel context for original-structure congruence testing. // Shared across all blocks (accumulates inductives incrementally). @@ -1867,7 +1866,7 @@ extern "C" fn rs_compile_validate_aux( // introducing races (even though individual DashMap inserts are safe, // a reader may observe a partially-ingressed kctx and fail). { - use crate::ix::graph::get_constant_info_references; + use ix_compile::graph::get_constant_info_references; // Step A (serial): enumerate the transitive-closure of names to // ingress. BFS walking the env hashmap is cheap — the per-node cost // is a lookup and a ref-walk, dwarfed by Step B's actual ingress. @@ -1913,18 +1912,18 @@ extern "C" fn rs_compile_validate_aux( // Build a `PermCtx` for the block: the congruence comparator uses // it to walk gen vs orig in lockstep with permutation awareness. - // See `crate::ix::congruence::perm` for details. + // See `ix_compile::congruence::perm` for details. // // `n_primary = all.len()` because Phase 2 uses singleton classes // (one class per original, no alpha-collapse at the primary level). fn build_perm_ctx( all: &[Name], env: &Env, - stt: &crate::ix::compile::CompileState, + stt: &ix_compile::compile::CompileState, perm: &[usize], - ) -> Option { - use crate::ix::congruence::perm::{PermCtx, RecHeadInfo}; - use crate::ix::env::ConstantInfo as LeanCI; + ) -> Option { + use ix_common::env::ConstantInfo as LeanCI; + use ix_compile::congruence::perm::{PermCtx, RecHeadInfo}; use rustc_hash::FxHashMap; let first = all.first()?; @@ -1968,7 +1967,7 @@ extern "C" fn rs_compile_validate_aux( // - Aux `.below_N` (kind = Below) — `{first}.below_{N}` // - Primary `.brecOn`/.go/.eq (kind = BRecOn) // - Aux `.brecOn_N`/.go/.eq (kind = BRecOn) - use crate::ix::congruence::perm::RecHeadKind; + use ix_compile::congruence::perm::RecHeadKind; let n_motives = n_primary + source_aux_ctor_counts.len(); let n_minors: usize = primary_ctor_counts.iter().sum::() + source_aux_ctor_counts.iter().sum::(); @@ -2049,7 +2048,7 @@ extern "C" fn rs_compile_validate_aux( // operate on collapsed blocks pick up the rewrites automatically. // (Built below at the PermCtx construction site so `env`/`stt` // borrows don't conflict with the const_addr-collecting closure.) - let mut const_addr: FxHashMap = + let mut const_addr: FxHashMap = FxHashMap::default(); let mut add_addr = |name: &Name| { if let Some(addr) = stt.resolve_addr(name) { @@ -2084,10 +2083,10 @@ extern "C" fn rs_compile_validate_aux( } fn collect_const_addrs( e: &Expr, - stt: &crate::ix::compile::CompileState, - out: &mut FxHashMap, + stt: &ix_compile::compile::CompileState, + out: &mut FxHashMap, ) { - use crate::ix::env::ExprData; + use ix_common::env::ExprData; match e.as_data() { ExprData::Const(n, _, _) => { if let Some(addr) = stt.resolve_addr(n) { @@ -2145,12 +2144,12 @@ extern "C" fn rs_compile_validate_aux( } // Helper to wrap a patch as a Lean `ConstantInfo` for alpha-eq. - fn patch_to_lean_ci(patch: &PatchedConstant) -> Option { - use crate::ix::env::{ + fn patch_to_lean_ci(patch: &PatchedConstant) -> ConstantInfo { + use ix_common::env::{ ConstantInfo as LeanCI, ConstantVal as LeanCV, DefinitionSafety, DefinitionVal, InductiveVal, ReducibilityHints, }; - Some(match patch { + match patch { PatchedConstant::Rec(r) => LeanCI::RecInfo(r.clone()), PatchedConstant::CasesOn(d) | PatchedConstant::RecOn(d) => { LeanCI::DefnInfo(DefinitionVal { @@ -2202,7 +2201,7 @@ extern "C" fn rs_compile_validate_aux( is_unsafe: false, is_reflexive: bi.is_reflexive, }), - }) + } } // Diagnostic dump printed per-thread on alpha-eq failure. Writes go @@ -2215,7 +2214,7 @@ extern "C" fn rs_compile_validate_aux( orig_ci: &ConstantInfo, err: &str, ) { - use crate::ix::env::{Expr, ExprData as ED}; + use ix_common::env::{Expr, ExprData as ED}; fn extract_sort(e: &Expr, depth: usize) -> String { match e.as_data() { @@ -2268,7 +2267,7 @@ extern "C" fn rs_compile_validate_aux( // Build a PermCtx for this block once. When the block has no // nested auxes (`perm == None` or empty), we pass `None` and // fall through to plain `const_alpha_eq`. - let perm_ctx: Option = + let perm_ctx: Option = if let Some(p) = &orig_aux_out.perm && !p.is_empty() { @@ -2282,16 +2281,18 @@ extern "C" fn rs_compile_validate_aux( let mut result = BlockResult::default(); let mut dumped = 0usize; for (patch_name, patch) in orig_patches.iter() { - let Some(gen_ci) = patch_to_lean_ci(patch) else { continue }; + let gen_ci = patch_to_lean_ci(patch); let Some(orig_ci_ref) = env.get(patch_name) else { continue; // Synthetic name — no Lean original. }; let orig_ci: &LeanCI = orig_ci_ref; let eq_result = match &perm_ctx { - Some(ctx) => crate::ix::congruence::perm::const_alpha_eq_with_perm( - &gen_ci, orig_ci, ctx, - ), + Some(ctx) => { + ix_compile::congruence::perm::const_alpha_eq_with_perm( + &gen_ci, orig_ci, ctx, + ) + }, None => const_alpha_eq(&gen_ci, orig_ci), }; @@ -2333,7 +2334,7 @@ extern "C" fn rs_compile_validate_aux( // Precompute canonical addresses: any orig_addr that matches another Named // entry's canonical addr is in consts legitimately (not an ephemeral leak). // The gather itself parallelizes cleanly over the DashMap. - let canonical_addrs: FxHashSet = + let canonical_addrs: FxHashSet = stt.env.named.par_iter().map(|e| e.value().addr.clone()).collect(); // Parallel scan over named DashMap. Each check is read-only against @@ -2463,17 +2464,17 @@ extern "C" fn rs_compile_validate_aux( } fn describe_addr( - stt: &crate::ix::compile::CompileState, - addr: &crate::ix::address::Address, + stt: &ix_compile::compile::CompileState, + addr: &ix_common::address::Address, ) -> String { match stt.env.get_const(addr).map(|c| c.info) { - Some(crate::ix::ixon::constant::ConstantInfo::RPrj(p)) => { + Some(ixon::constant::ConstantInfo::RPrj(p)) => { format!("RPrj(idx={}, block={:.12})", p.idx, p.block.hex()) }, - Some(crate::ix::ixon::constant::ConstantInfo::IPrj(p)) => { + Some(ixon::constant::ConstantInfo::IPrj(p)) => { format!("IPrj(idx={}, block={:.12})", p.idx, p.block.hex()) }, - Some(crate::ix::ixon::constant::ConstantInfo::CPrj(p)) => { + Some(ixon::constant::ConstantInfo::CPrj(p)) => { format!( "CPrj(idx={}, cidx={}, block={:.12})", p.idx, @@ -2487,14 +2488,14 @@ extern "C" fn rs_compile_validate_aux( } fn describe_rprj_block( - stt: &crate::ix::compile::CompileState, - addr: &crate::ix::address::Address, + stt: &ix_compile::compile::CompileState, + addr: &ix_common::address::Address, ) -> Option { fn expand_shares_expr( - expr: &Arc, - sharing: &[Arc], - ) -> Arc { - use crate::ix::ixon::expr::Expr; + expr: &Arc, + sharing: &[Arc], + ) -> Arc { + use ixon::expr::Expr; match expr.as_ref() { Expr::Share(idx) => sharing.get(*idx as usize).map_or_else( || expr.clone(), @@ -2528,10 +2529,10 @@ extern "C" fn rs_compile_validate_aux( } fn expand_shares_member( - member: &crate::ix::ixon::constant::MutConst, - sharing: &[Arc], - ) -> crate::ix::ixon::constant::MutConst { - use crate::ix::ixon::constant::{MutConst, RecursorRule}; + member: &ixon::constant::MutConst, + sharing: &[Arc], + ) -> ixon::constant::MutConst { + use ixon::constant::{MutConst, RecursorRule}; match member { MutConst::Defn(def) => { let mut def = def.clone(); @@ -2563,18 +2564,18 @@ extern "C" fn rs_compile_validate_aux( } } - fn expr_hash_prefix(expr: &Arc) -> String { + fn expr_hash_prefix(expr: &Arc) -> String { let mut buf = Vec::new(); - crate::ix::ixon::serialize::put_expr(expr, &mut buf); - let h = crate::ix::address::Address::hash(&buf); + ixon::serialize::put_expr(expr, &mut buf); + let h = ix_common::address::Address::hash(&buf); format!("{}:{}", buf.len(), &h.hex()[..12]) } fn member_parts_summary( - member: &crate::ix::ixon::constant::MutConst, - sharing: &[Arc], + member: &ixon::constant::MutConst, + sharing: &[Arc], ) -> String { - use crate::ix::ixon::constant::MutConst; + use ixon::constant::MutConst; let expanded = expand_shares_member(member, sharing); match expanded { MutConst::Defn(def) => { @@ -2598,12 +2599,12 @@ extern "C" fn rs_compile_validate_aux( } let proj = match stt.env.get_const(addr).map(|c| c.info) { - Some(crate::ix::ixon::constant::ConstantInfo::RPrj(p)) => p, + Some(ixon::constant::ConstantInfo::RPrj(p)) => p, _ => return None, }; let block = stt.env.get_const(&proj.block)?; let member_count_for_names = match &block.info { - crate::ix::ixon::constant::ConstantInfo::Muts(ms) => ms.len(), + ixon::constant::ConstantInfo::Muts(ms) => ms.len(), _ => 0, }; let proj_names: Vec = (0..member_count_for_names) @@ -2615,17 +2616,17 @@ extern "C" fn rs_compile_validate_aux( .chain(stt.name_to_addr.iter()) .filter_map(|entry| { match stt.env.get_const(entry.value()).map(|c| c.info) { - Some(crate::ix::ixon::constant::ConstantInfo::RPrj(p)) + Some(ixon::constant::ConstantInfo::RPrj(p)) if p.block == proj.block && p.idx == idx => { Some(entry.key().pretty()) }, - Some(crate::ix::ixon::constant::ConstantInfo::IPrj(p)) + Some(ixon::constant::ConstantInfo::IPrj(p)) if p.block == proj.block && p.idx == idx => { Some(entry.key().pretty()) }, - Some(crate::ix::ixon::constant::ConstantInfo::DPrj(p)) + Some(ixon::constant::ConstantInfo::DPrj(p)) if p.block == proj.block && p.idx == idx => { Some(entry.key().pretty()) @@ -2659,22 +2660,22 @@ extern "C" fn rs_compile_validate_aux( }) .collect(); let (members, per_member_hashes) = match &block.info { - crate::ix::ixon::constant::ConstantInfo::Muts(ms) => { + ixon::constant::ConstantInfo::Muts(ms) => { let per: Vec = ms .iter() .map(|m| { // Compute a per-member byte hash for quick diffing. let mut buf = Vec::new(); m.put(&mut buf); - let h = crate::ix::address::Address::hash(&buf); + let h = ix_common::address::Address::hash(&buf); let expanded = expand_shares_member(m, &block.sharing); let mut expanded_buf = Vec::new(); expanded.put(&mut expanded_buf); - let expanded_h = crate::ix::address::Address::hash(&expanded_buf); + let expanded_h = ix_common::address::Address::hash(&expanded_buf); let tag = match m { - crate::ix::ixon::constant::MutConst::Defn(_) => "Defn", - crate::ix::ixon::constant::MutConst::Indc(_) => "Indc", - crate::ix::ixon::constant::MutConst::Recr(_) => "Recr", + ixon::constant::MutConst::Defn(_) => "Defn", + ixon::constant::MutConst::Indc(_) => "Indc", + ixon::constant::MutConst::Recr(_) => "Recr", }; let parts = member_parts_summary(m, &block.sharing); format!( @@ -3563,7 +3564,7 @@ extern "C" fn rs_compile_validate_aux( // ends before we drop it. let fresh_env = { let mut buf: &[u8] = &serialized; - match crate::ix::ixon::env::Env::get(&mut buf) { + match ixon::env::Env::get(&mut buf) { Ok(fe) => Some(fe), Err(e) => { p7.record_fail(format!("deserialize FAILED: {e}")); @@ -3576,7 +3577,7 @@ extern "C" fn rs_compile_validate_aux( match fresh_env { Some(fresh_env) => { - let fresh_stt = crate::ix::compile::CompileState { + let fresh_stt = ix_compile::compile::CompileState { env: fresh_env, ..Default::default() }; @@ -3672,7 +3673,7 @@ extern "C" fn rs_compile_validate_aux( (None, None) => true, _ => false, }; - let aux_eq_result = if crate::ix::decompile::is_aux_gen_suffix(name) + let aux_eq_result = if ix_compile::decompile::is_aux_gen_suffix(name) && !(type_ok && val_ok) { Some(aux_congruence_result( @@ -3738,8 +3739,8 @@ extern "C" fn rs_compile_validate_aux( // ══════════════════════════════════════════════════════════════════════ let mut p8 = PhaseResult::new("8. Nested detection"); { - use crate::ix::compile::aux_gen::nested::build_compile_flat_block; - use crate::ix::env::ConstantInfo; + use ix_common::env::ConstantInfo; + use ix_compile::compile::aux_gen::nested::build_compile_flat_block; /// Build a dotted Lean name from a dot-separated string. /// Numeric components (e.g. the `0` in `_private.Foo.0.Bar`) are @@ -3880,8 +3881,8 @@ impl ConstSizeBreakdown { #[cfg(feature = "test-ffi")] /// Analyze the serialized size of a constant and its transitive dependencies. -fn analyze_const_size(stt: &crate::ix::compile::CompileState, name_str: &str) { - use crate::ix::address::Address; +fn analyze_const_size(stt: &ix_compile::compile::CompileState, name_str: &str) { + use ix_common::address::Address; use std::collections::{HashSet, VecDeque}; // Build a global name index for metadata serialization @@ -4035,10 +4036,10 @@ fn analyze_const_size(stt: &crate::ix::compile::CompileState, name_str: &str) { /// Build a name index for metadata serialization. #[cfg(feature = "test-ffi")] fn build_name_index( - stt: &crate::ix::compile::CompileState, -) -> crate::ix::ixon::metadata::NameIndex { - use crate::ix::address::Address; - use crate::ix::ixon::metadata::NameIndex; + stt: &ix_compile::compile::CompileState, +) -> ixon::metadata::NameIndex { + use ix_common::address::Address; + use ixon::metadata::NameIndex; let mut idx = NameIndex::new(); let mut counter: u64 = 0; @@ -4059,10 +4060,10 @@ fn build_name_index( /// Compute size breakdown for a constant (alpha-invariant vs metadata). #[cfg(feature = "test-ffi")] fn compute_const_size_breakdown( - constant: &crate::ix::ixon::constant::Constant, + constant: &ixon::constant::Constant, name: &Name, - stt: &crate::ix::compile::CompileState, - name_index: &crate::ix::ixon::metadata::NameIndex, + stt: &ix_compile::compile::CompileState, + name_index: &ixon::metadata::NameIndex, ) -> ConstSizeBreakdown { // Alpha-invariant size let alpha_size = serialized_const_size(constant); @@ -4080,8 +4081,8 @@ fn compute_const_size_breakdown( /// Compute the serialized size of constant metadata. #[cfg(feature = "test-ffi")] fn serialized_meta_size( - meta: &crate::ix::ixon::metadata::ConstantMeta, - name_index: &crate::ix::ixon::metadata::NameIndex, + meta: &ixon::metadata::ConstantMeta, + name_index: &ixon::metadata::NameIndex, ) -> usize { let mut buf = Vec::new(); meta @@ -4110,9 +4111,7 @@ pub fn parse_name(s: &str) -> Name { /// Compute the serialized size of a constant. #[cfg(feature = "test-ffi")] -fn serialized_const_size( - constant: &crate::ix::ixon::constant::Constant, -) -> usize { +fn serialized_const_size(constant: &ixon::constant::Constant) -> usize { let mut buf = Vec::new(); constant.put(&mut buf); buf.len() @@ -4120,11 +4119,11 @@ fn serialized_const_size( /// Analyze block size statistics: hash-consing vs serialization. #[cfg(feature = "test-ffi")] -fn analyze_block_size_stats(stt: &crate::ix::compile::CompileState) { - use crate::ix::compile::BlockSizeStats; +fn analyze_block_size_stats(stt: &ix_compile::compile::CompileState) { + use ix_compile::compile::BlockSizeStats; // Check if hash-consed size tracking was enabled - let tracking_enabled = crate::ix::compile::TRACK_HASH_CONSED_SIZE + let tracking_enabled = ix_compile::compile::TRACK_HASH_CONSED_SIZE .load(std::sync::atomic::Ordering::Relaxed); if !tracking_enabled { println!("\n=== Block Size Analysis ==="); diff --git a/src/ffi/iroh.rs b/crates/ffi/src/lean_iroh.rs similarity index 100% rename from src/ffi/iroh.rs rename to crates/ffi/src/lean_iroh.rs diff --git a/src/ffi/ixon.rs b/crates/ffi/src/lean_ixon.rs similarity index 100% rename from src/ffi/ixon.rs rename to crates/ffi/src/lean_ixon.rs diff --git a/src/ffi/ixon/compare.rs b/crates/ffi/src/lean_ixon/compare.rs similarity index 96% rename from src/ffi/ixon/compare.rs rename to crates/ffi/src/lean_ixon/compare.rs index aa82724b..6890d89d 100644 --- a/src/ffi/ixon/compare.rs +++ b/crates/ffi/src/lean_ixon/compare.rs @@ -2,14 +2,16 @@ use std::collections::HashMap; -use crate::ix::compile::{BlockCache, CompileState, compile_env, compile_expr}; -use crate::ix::env::Name; -use crate::ix::ixon::serialize::put_expr; -use crate::ix::mutual::MutCtx; use crate::lean::{LeanIxBlockCompareDetail, LeanIxBlockCompareResult}; +use ix_common::env::Name; +use ix_compile::compile::{ + BlockCache, CompileState, compile_env, compile_expr, +}; +use ix_compile::mutual::MutCtx; +use ixon::serialize::put_expr; use lean_ffi::object::{LeanBorrowed, LeanByteArray, LeanList, LeanOwned}; -use crate::ffi::lean_env::{ +use crate::lean_env::{ Cache as LeanCache, GlobalCache, decode_expr, decode_name, }; @@ -195,7 +197,7 @@ pub unsafe extern "C" fn rs_free_compiled_env(ptr: *mut RustBlockEnv) { pub extern "C" fn rs_build_compiled_env( env_consts_ptr: LeanList>, ) -> *mut RustBlockEnv { - use crate::ffi::lean_env::decode_env; + use crate::lean_env::decode_env; // Decode Lean environment let rust_env = decode_env(env_consts_ptr); diff --git a/src/ffi/ixon/constant.rs b/crates/ffi/src/lean_ixon/constant.rs similarity index 97% rename from src/ffi/ixon/constant.rs rename to crates/ffi/src/lean_ixon/constant.rs index eabde98b..d5fe112f 100644 --- a/src/ffi/ixon/constant.rs +++ b/crates/ffi/src/lean_ixon/constant.rs @@ -6,14 +6,6 @@ use std::sync::Arc; -use crate::ix::ixon::constant::{ - Axiom as IxonAxiom, Constant as IxonConstant, - ConstantInfo as IxonConstantInfo, Constructor as IxonConstructor, - ConstructorProj, DefKind, Definition as IxonDefinition, DefinitionProj, - Inductive as IxonInductive, InductiveProj, MutConst, - Quotient as IxonQuotient, Recursor as IxonRecursor, RecursorProj, - RecursorRule as IxonRecursorRule, -}; use crate::lean::{ LeanIxAddress, LeanIxonAxiom, LeanIxonConstant, LeanIxonConstantInfo, LeanIxonConstructor, LeanIxonConstructorProj, LeanIxonDefinition, @@ -21,6 +13,14 @@ use crate::lean::{ LeanIxonInductiveProj, LeanIxonMutConst, LeanIxonQuotient, LeanIxonRecursor, LeanIxonRecursorProj, LeanIxonRecursorRule, LeanIxonUniv, }; +use ixon::constant::{ + Axiom as IxonAxiom, Constant as IxonConstant, + ConstantInfo as IxonConstantInfo, Constructor as IxonConstructor, + ConstructorProj, DefKind, Definition as IxonDefinition, DefinitionProj, + Inductive as IxonInductive, InductiveProj, MutConst, + Quotient as IxonQuotient, Recursor as IxonRecursor, RecursorProj, + RecursorRule as IxonRecursorRule, +}; #[cfg(feature = "test-ffi")] use lean_ffi::object::LeanBorrowed; use lean_ffi::object::{LeanArray, LeanOwned, LeanRef}; @@ -47,9 +47,9 @@ impl LeanIxonDefinition { }; ctor.set_num_8(0, kind_val); let safety_val: u8 = match def.safety { - crate::ix::env::DefinitionSafety::Unsafe => 0, - crate::ix::env::DefinitionSafety::Safe => 1, - crate::ix::env::DefinitionSafety::Partial => 2, + ix_common::env::DefinitionSafety::Unsafe => 0, + ix_common::env::DefinitionSafety::Safe => 1, + ix_common::env::DefinitionSafety::Partial => 2, }; ctor.set_num_8(1, safety_val); ctor @@ -75,9 +75,9 @@ impl LeanIxonDefinition { }; let safety_val = self.get_num_8(1); let safety = match safety_val { - 0 => crate::ix::env::DefinitionSafety::Unsafe, - 1 => crate::ix::env::DefinitionSafety::Safe, - 2 => crate::ix::env::DefinitionSafety::Partial, + 0 => ix_common::env::DefinitionSafety::Unsafe, + 1 => ix_common::env::DefinitionSafety::Safe, + 2 => ix_common::env::DefinitionSafety::Partial, _ => panic!("Invalid DefinitionSafety: {}", safety_val), }; IxonDefinition { kind, safety, lvls, typ, value } @@ -210,10 +210,10 @@ impl LeanIxonQuotient { ctor.set_obj(0, typ_obj); ctor.set_num_64(0, quot.lvls); let kind_val: u8 = match quot.kind { - crate::ix::env::QuotKind::Type => 0, - crate::ix::env::QuotKind::Ctor => 1, - crate::ix::env::QuotKind::Lift => 2, - crate::ix::env::QuotKind::Ind => 3, + ix_common::env::QuotKind::Type => 0, + ix_common::env::QuotKind::Ctor => 1, + ix_common::env::QuotKind::Lift => 2, + ix_common::env::QuotKind::Ind => 3, }; ctor.set_num_8(0, kind_val); ctor @@ -229,10 +229,10 @@ impl LeanIxonQuotient { let lvls = self.get_num_64(0); let kind_val = self.get_num_8(0); let kind = match kind_val { - 0 => crate::ix::env::QuotKind::Type, - 1 => crate::ix::env::QuotKind::Ctor, - 2 => crate::ix::env::QuotKind::Lift, - 3 => crate::ix::env::QuotKind::Ind, + 0 => ix_common::env::QuotKind::Type, + 1 => ix_common::env::QuotKind::Ctor, + 2 => ix_common::env::QuotKind::Lift, + 3 => ix_common::env::QuotKind::Ind, _ => panic!("Invalid QuotKind: {}", kind_val), }; IxonQuotient { kind, lvls, typ } diff --git a/src/ffi/ixon/enums.rs b/crates/ffi/src/lean_ixon/enums.rs similarity index 97% rename from src/ffi/ixon/enums.rs rename to crates/ffi/src/lean_ixon/enums.rs index 0afa0593..54fa7a4f 100644 --- a/src/ffi/ixon/enums.rs +++ b/crates/ffi/src/lean_ixon/enums.rs @@ -1,10 +1,10 @@ //! Ixon enum types: DefKind, DefinitionSafety, QuotKind build/decode/roundtrip FFI. -use crate::ix::env::{DefinitionSafety, QuotKind}; -use crate::ix::ixon::constant::DefKind; use crate::lean::{ LeanIxonDefKind, LeanIxonDefinitionSafety, LeanIxonQuotKind, }; +use ix_common::env::{DefinitionSafety, QuotKind}; +use ixon::constant::DefKind; #[cfg(feature = "test-ffi")] use lean_ffi::object::LeanBorrowed; use lean_ffi::object::{LeanOwned, LeanRef}; diff --git a/src/ffi/ixon/env.rs b/crates/ffi/src/lean_ixon/env.rs similarity index 97% rename from src/ffi/ixon/env.rs rename to crates/ffi/src/lean_ixon/env.rs index bcafec12..29bdeadc 100644 --- a/src/ffi/ixon/env.rs +++ b/crates/ffi/src/lean_ixon/env.rs @@ -3,22 +3,22 @@ //! Provides full decode/build cycle for RawEnv and its component types: //! RawConst, RawNamed, RawBlob, RawComm. -use crate::ix::address::Address; -use crate::ix::env::Name; -use crate::ix::ixon::comm::Comm; -use crate::ix::ixon::constant::Constant as IxonConstant; -use crate::ix::ixon::env::{Env as IxonEnv, Named as IxonNamed}; -use crate::ix::ixon::metadata::ConstantMeta; use crate::lean::{ LeanIxName, LeanIxonComm, LeanIxonConstant, LeanIxonConstantMeta, LeanIxonRawBlob, LeanIxonRawComm, LeanIxonRawConst, LeanIxonRawEnv, LeanIxonRawNameEntry, LeanIxonRawNamed, }; +use ix_common::address::Address; +use ix_common::env::Name; +use ixon::comm::Comm; +use ixon::constant::Constant as IxonConstant; +use ixon::env::{Env as IxonEnv, Named as IxonNamed}; +use ixon::metadata::ConstantMeta; use lean_ffi::object::{ LeanArray, LeanBorrowed, LeanByteArray, LeanExcept, LeanOwned, LeanRef, }; -use crate::ffi::builder::LeanBuildCache; +use crate::builder::LeanBuildCache; use crate::lean::LeanIxAddress; // ============================================================================= diff --git a/src/ffi/ixon/expr.rs b/crates/ffi/src/lean_ixon/expr.rs similarity index 99% rename from src/ffi/ixon/expr.rs rename to crates/ffi/src/lean_ixon/expr.rs index 4fb71091..cea24163 100644 --- a/src/ffi/ixon/expr.rs +++ b/crates/ffi/src/lean_ixon/expr.rs @@ -2,8 +2,8 @@ use std::sync::Arc; -use crate::ix::ixon::expr::Expr as IxonExpr; use crate::lean::LeanIxonExpr; +use ixon::expr::Expr as IxonExpr; use lean_ffi::object::{LeanArray, LeanBorrowed, LeanOwned, LeanRef}; /// Decode Array UInt64 from Lean. diff --git a/src/ffi/ixon/meta.rs b/crates/ffi/src/lean_ixon/meta.rs similarity index 99% rename from src/ffi/ixon/meta.rs rename to crates/ffi/src/lean_ixon/meta.rs index 3962f65d..13db8ec0 100644 --- a/src/ffi/ixon/meta.rs +++ b/crates/ffi/src/lean_ixon/meta.rs @@ -2,19 +2,19 @@ //! //! Includes: DataValue, KVMap, ExprMetaData, ExprMetaArena, ConstantMeta, Named, Comm -use crate::ix::address::Address; -use crate::ix::env::BinderInfo; -use crate::ix::ixon::Comm; -use crate::ix::ixon::env::Named; -use crate::ix::ixon::metadata::{ - ConstantMeta, ConstantMetaInfo, DataValue as IxonDataValue, ExprMeta, - ExprMetaData, KVMap, -}; use crate::lean::{ LeanIxReducibilityHints, LeanIxonComm, LeanIxonConstantMeta, LeanIxonDataValue, LeanIxonExprMetaArena, LeanIxonExprMetaData, LeanIxonNamed, }; +use ix_common::address::Address; +use ix_common::env::BinderInfo; +use ixon::Comm; +use ixon::env::Named; +use ixon::metadata::{ + ConstantMeta, ConstantMetaInfo, DataValue as IxonDataValue, ExprMeta, + ExprMetaData, KVMap, +}; use lean_ffi::object::{ LeanArray, LeanBorrowed, LeanOption, LeanOwned, LeanProd, LeanRef, }; diff --git a/src/ffi/ixon/serialize.rs b/crates/ffi/src/lean_ixon/serialize.rs similarity index 97% rename from src/ffi/ixon/serialize.rs rename to crates/ffi/src/lean_ixon/serialize.rs index 94e0facb..dbd2de17 100644 --- a/src/ffi/ixon/serialize.rs +++ b/crates/ffi/src/lean_ixon/serialize.rs @@ -5,13 +5,13 @@ use std::sync::Arc; -use crate::ix::address::Address; -use crate::ix::ixon::serialize::put_expr; -use crate::ix::ixon::sharing::hash_expr; -use crate::ix::ixon::univ::put_univ; use crate::lean::{ LeanIxAddress, LeanIxonConstant, LeanIxonExpr, LeanIxonRawEnv, LeanIxonUniv, }; +use ix_common::address::Address; +use ixon::serialize::put_expr; +use ixon::sharing::hash_expr; +use ixon::univ::put_univ; use lean_ffi::object::{LeanBorrowed, LeanByteArray, LeanOwned}; /// Check if Lean's computed hash matches Rust's computed hash. @@ -77,7 +77,7 @@ pub extern "C" fn rs_eq_env_serialization( raw_env_obj: LeanIxonRawEnv>, bytes_obj: LeanByteArray>, ) -> bool { - use crate::ix::ixon::env::Env; + use ixon::env::Env; let debug = std::env::var("IX_DEBUG_SERDE").is_ok(); let decoded = raw_env_obj.decode(); @@ -244,7 +244,7 @@ pub extern "C" fn rs_eq_env_serialization( extern "C" fn rs_env_serde_roundtrip( lean_bytes_obj: LeanByteArray, ) -> bool { - use crate::ix::ixon::env::Env; + use ixon::env::Env; // Get bytes from Lean ByteArray let lean_bytes = lean_bytes_obj.as_bytes().to_vec(); @@ -292,7 +292,7 @@ extern "C" fn rs_env_serde_roundtrip( extern "C" fn rs_env_serde_check( lean_bytes_obj: LeanByteArray, ) -> bool { - use crate::ix::ixon::env::Env; + use ixon::env::Env; // Get bytes from Lean ByteArray let lean_bytes = lean_bytes_obj.as_bytes().to_vec(); diff --git a/src/ffi/ixon/sharing.rs b/crates/ffi/src/lean_ixon/sharing.rs similarity index 95% rename from src/ffi/ixon/sharing.rs rename to crates/ffi/src/lean_ixon/sharing.rs index 85065081..9811fb63 100644 --- a/src/ffi/ixon/sharing.rs +++ b/crates/ffi/src/lean_ixon/sharing.rs @@ -2,12 +2,10 @@ use std::sync::Arc; -use crate::ix::ixon::expr::Expr as IxonExpr; -use crate::ix::ixon::serialize::put_expr; -use crate::ix::ixon::sharing::{ - analyze_block, build_sharing_vec, decide_sharing, -}; use crate::lean::LeanIxonExpr; +use ixon::expr::Expr as IxonExpr; +use ixon::serialize::put_expr; +use ixon::sharing::{analyze_block, build_sharing_vec, decide_sharing}; use lean_ffi::object::{LeanArray, LeanBorrowed, LeanByteArray, LeanOwned}; /// FFI: Debug sharing analysis - print usage counts for subterms with usage >= 2. @@ -23,7 +21,7 @@ pub extern "C" fn rs_debug_sharing_analysis( let (info_map, _ptr_to_hash, topo_order) = analyze_block(&exprs, false); let effective_sizes = - crate::ix::ixon::sharing::compute_effective_sizes(&info_map, &topo_order); + ixon::sharing::compute_effective_sizes(&info_map, &topo_order); println!("[Rust] Found {} unique subterms", info_map.len()); diff --git a/src/ffi/ixon/univ.rs b/crates/ffi/src/lean_ixon/univ.rs similarity index 98% rename from src/ffi/ixon/univ.rs rename to crates/ffi/src/lean_ixon/univ.rs index c85dde83..57b8eab1 100644 --- a/src/ffi/ixon/univ.rs +++ b/crates/ffi/src/lean_ixon/univ.rs @@ -2,8 +2,8 @@ use std::sync::Arc; -use crate::ix::ixon::univ::Univ; use crate::lean::LeanIxonUniv; +use ixon::univ::Univ; use lean_ffi::object::{LeanArray, LeanBorrowed, LeanOwned, LeanRef}; impl LeanIxonUniv { diff --git a/crates/ffi/src/lib.rs b/crates/ffi/src/lib.rs new file mode 100644 index 00000000..b952522d --- /dev/null +++ b/crates/ffi/src/lib.rs @@ -0,0 +1,59 @@ +// `_iroh` provides dummy fallbacks when the `net` feature is disabled or on +// `aarch64-darwin` (where iroh doesn't work). Lean and C don't support feature +// flags, so we always expose iroh symbols — they just panic with an error +// message when called without `net`. +#[cfg(any( + not(feature = "net"), + all(target_os = "macos", target_arch = "aarch64") +))] +pub mod _iroh; +pub mod aiur; +pub mod byte_array; +#[cfg(all( + feature = "net", + not(all(target_os = "macos", target_arch = "aarch64")) +))] +pub mod iroh; +pub mod keccak; +pub mod lean_env; +#[cfg(all( + feature = "net", + not(all(target_os = "macos", target_arch = "aarch64")) +))] +pub mod lean_iroh; +pub mod unsigned; + +pub mod builder; +pub mod compile; +pub mod graph; +pub mod ix; +pub mod kernel; +pub mod lean_ixon; +pub mod primitives; +#[cfg(feature = "test-ffi")] +pub mod refcount; + +pub mod lean; +mod sha256; + +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + +#[cfg(feature = "test-ffi")] +use lean_ffi::object::{ + LeanArray, LeanBorrowed, LeanByteArray, LeanOwned, LeanRef, +}; + +#[cfg(feature = "test-ffi")] +#[unsafe(no_mangle)] +extern "C" fn rs_boxed_u32s_are_equivalent_to_bytes( + u32s: LeanArray, + bytes: LeanByteArray>, +) -> bool { + let u32s_flat: Vec = u32s + .map(|elem| elem.unbox_u32()) + .into_iter() + .flat_map(u32::to_le_bytes) + .collect(); + u32s_flat == bytes.as_bytes() +} diff --git a/src/ffi/primitives.rs b/crates/ffi/src/primitives.rs similarity index 99% rename from src/ffi/primitives.rs rename to crates/ffi/src/primitives.rs index c73e1448..1617d35b 100644 --- a/src/ffi/primitives.rs +++ b/crates/ffi/src/primitives.rs @@ -3,7 +3,7 @@ //! Roundtrip FFI functions for AssocList, DHashMap.Raw, and HashMap //! (ix-specific types not covered by the lean-ffi test suite). -use lean_ffi::nat::Nat; +use lean_ffi::nat::{Nat, NatExt}; #[cfg(feature = "test-ffi")] use lean_ffi::object::{LeanArray, LeanCtor, LeanOwned}; use lean_ffi::object::{LeanBorrowed, LeanRef}; diff --git a/src/ffi/refcount.rs b/crates/ffi/src/refcount.rs similarity index 99% rename from src/ffi/refcount.rs rename to crates/ffi/src/refcount.rs index f5edd77c..2e066001 100644 --- a/src/ffi/refcount.rs +++ b/crates/ffi/src/refcount.rs @@ -16,12 +16,12 @@ use std::thread; use lean_ffi::LeanShared; -use lean_ffi::nat::Nat; +use lean_ffi::nat::{Nat, NatExt}; use lean_ffi::object::{ LeanArray, LeanBorrowed, LeanList, LeanOwned, LeanRef, LeanString, }; -use crate::ffi::builder::LeanBuildCache; +use crate::builder::LeanBuildCache; use crate::lean::{LeanIxExpr, LeanIxLevel, LeanIxName}; // ============================================================================= @@ -364,7 +364,7 @@ pub extern "C" fn rs_mt_parallel_roundtrip_names( arr: LeanArray>, n_threads: usize, ) -> LeanArray { - use crate::ix::env::Name; + use ix_common::env::Name; let shared = LeanShared::new(arr.inner().to_owned_ref()); let len = arr.len(); diff --git a/src/sha256.rs b/crates/ffi/src/sha256.rs similarity index 100% rename from src/sha256.rs rename to crates/ffi/src/sha256.rs diff --git a/src/ffi/unsigned.rs b/crates/ffi/src/unsigned.rs similarity index 100% rename from src/ffi/unsigned.rs rename to crates/ffi/src/unsigned.rs diff --git a/crates/ixon/Cargo.toml b/crates/ixon/Cargo.toml new file mode 100644 index 00000000..c6db7cbf --- /dev/null +++ b/crates/ixon/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "ixon" +version.workspace = true +edition.workspace = true +license.workspace = true + +[dependencies] +bignat = { workspace = true } +blake3 = { workspace = true } +dashmap = { workspace = true } +indexmap = { workspace = true } +ix-common = { workspace = true } +num-bigint = { workspace = true } +rustc-hash = { workspace = true } +sha2 = { workspace = true } +tiny-keccak = { workspace = true } + +[target.'cfg(not(target_arch = "riscv64"))'.dependencies] +dashmap = { workspace = true, features = ["rayon"] } +rayon = { workspace = true } + +[dev-dependencies] +ix-common = { workspace = true, features = ["quickcheck"] } +quickcheck = { workspace = true } +quickcheck_macros = { workspace = true } + +[lints] +workspace = true diff --git a/src/ix/ixon/comm.rs b/crates/ixon/src/comm.rs similarity index 98% rename from src/ix/ixon/comm.rs rename to crates/ixon/src/comm.rs index 408a9c74..866a276a 100644 --- a/src/ix/ixon/comm.rs +++ b/crates/ixon/src/comm.rs @@ -3,7 +3,7 @@ #![allow(clippy::map_err_ignore)] #![allow(clippy::needless_pass_by_value)] -use crate::ix::address::Address; +use ix_common::address::Address; use super::tag::Tag4; @@ -81,6 +81,7 @@ impl Comm { mod tests { use super::*; use quickcheck::Arbitrary; + use quickcheck_macros::quickcheck; impl Arbitrary for Comm { fn arbitrary(g: &mut quickcheck::Gen) -> Self { diff --git a/src/ix/ixon/constant.rs b/crates/ixon/src/constant.rs similarity index 93% rename from src/ix/ixon/constant.rs rename to crates/ixon/src/constant.rs index a7979dde..456f61af 100644 --- a/src/ix/ixon/constant.rs +++ b/crates/ixon/src/constant.rs @@ -10,8 +10,8 @@ use std::sync::Arc; -use crate::ix::address::Address; -use crate::ix::env::{DefinitionSafety, QuotKind}; +use ix_common::address::Address; +use ix_common::env::{DefinitionSafety, QuotKind}; use super::expr::Expr; use super::univ::Univ; @@ -254,10 +254,11 @@ impl Constant { #[cfg(test)] pub mod tests { use super::*; - use crate::ix::env::{DefinitionSafety, QuotKind}; - use crate::ix::ixon::expr::tests::arbitrary_expr; - use crate::ix::ixon::tests::gen_range; + use crate::expr::tests::arbitrary_expr; + use crate::tests::gen_range; + use ix_common::env::{DefinitionSafety, QuotKind}; use quickcheck::{Arbitrary, Gen}; + use quickcheck_macros::quickcheck; impl Arbitrary for DefKind { fn arbitrary(g: &mut Gen) -> Self { @@ -269,27 +270,6 @@ pub mod tests { } } - impl Arbitrary for DefinitionSafety { - fn arbitrary(g: &mut Gen) -> Self { - match u8::arbitrary(g) % 3 { - 0 => DefinitionSafety::Unsafe, - 1 => DefinitionSafety::Safe, - _ => DefinitionSafety::Partial, - } - } - } - - impl Arbitrary for QuotKind { - fn arbitrary(g: &mut Gen) -> Self { - match u8::arbitrary(g) % 4 { - 0 => QuotKind::Type, - 1 => QuotKind::Ctor, - 2 => QuotKind::Lift, - _ => QuotKind::Ind, - } - } - } - pub fn gen_sharing(g: &mut Gen) -> Vec> { (0..gen_range(g, 0..4)).map(|_| arbitrary_expr(g)).collect() } @@ -299,7 +279,7 @@ pub mod tests { } pub fn gen_univs(g: &mut Gen) -> Vec> { - use crate::ix::ixon::univ::tests::arbitrary_univ; + use crate::univ::tests::arbitrary_univ; (0..gen_range(g, 0..4)).map(|_| arbitrary_univ(g)).collect() } diff --git a/src/ix/ixon/env.rs b/crates/ixon/src/env.rs similarity index 83% rename from src/ix/ixon/env.rs rename to crates/ixon/src/env.rs index 7c43f2e8..91e2914f 100644 --- a/src/ix/ixon/env.rs +++ b/crates/ixon/src/env.rs @@ -1,12 +1,11 @@ //! Environment for storing Ixon data. -use dashmap::DashMap; - -use crate::ix::address::Address; -use crate::ix::env::Name; +use ix_common::address::Address; +use ix_common::env::Name; use super::comm::Comm; use super::constant::Constant; +use super::map::IxonMap; use super::metadata::ConstantMeta; /// A named constant with metadata. @@ -39,7 +38,7 @@ impl Named { /// correctly permute source-order aux motives/minors into canonical /// positions. Both arrays have one entry per source-walk-discovered aux. /// -/// This lives in `ixon::env` (not `compile::surgery`, where it originated) +/// This lives in `ixon::env` (not `ix_compile::surgery`, where it originated) /// so it can be persisted into the serialized Ixon environment as a /// side-table on [`Env::aux_layouts`]. The surgery layer re-exports it. /// @@ -68,29 +67,35 @@ pub struct AuxLayout { #[derive(Debug, Default)] pub struct Env { /// Alpha-invariant constants: Address -> Constant - pub consts: DashMap, + pub consts: IxonMap, /// Named references: Name -> (constant address, metadata, ctx) - pub named: DashMap, + pub named: IxonMap, /// Raw data blobs: Address -> bytes - pub blobs: DashMap>, + pub blobs: IxonMap>, /// Hash-consed Lean.Name components: Address -> Name - pub names: DashMap, + pub names: IxonMap, /// Cryptographic commitments: commitment Address -> Comm - pub comms: DashMap, + pub comms: IxonMap, } impl Env { pub fn new() -> Self { Env { - consts: DashMap::new(), - named: DashMap::new(), - blobs: DashMap::new(), - names: DashMap::new(), - comms: DashMap::new(), + consts: IxonMap::new(), + named: IxonMap::new(), + blobs: IxonMap::new(), + names: IxonMap::new(), + comms: IxonMap::new(), } } /// Store a blob and return its content address. + /// + /// Host-only because `IxonMap` is `DashMap` here (interior-mutable `&self` + /// inserts). On `riscv64` `IxonMap` is `FxHashMap`, which requires `&mut`; + /// the guest builds `Env` via `Env::get` deserialization and doesn't need + /// the store helpers. + #[cfg(not(target_arch = "riscv64"))] pub fn store_blob(&self, bytes: Vec) -> Address { let addr = Address::hash(&bytes); self.blobs.insert(addr.clone(), bytes); @@ -102,8 +107,8 @@ impl Env { self.blobs.get(addr).map(|r| r.clone()) } - /// Store a constant and return its content address. - /// Note: The actual hashing/serialization is done elsewhere. + /// Store a constant. Host-only — see `store_blob`. + #[cfg(not(target_arch = "riscv64"))] pub fn store_const(&self, addr: Address, constant: Constant) { self.consts.insert(addr, constant); } @@ -113,7 +118,8 @@ impl Env { self.consts.get(addr).map(|r| r.clone()) } - /// Register a named constant. + /// Register a named constant. Host-only — see `store_blob`. + #[cfg(not(target_arch = "riscv64"))] pub fn register_name(&self, name: Name, named: Named) { self.named.insert(name, named); } @@ -123,7 +129,8 @@ impl Env { self.named.get(name).map(|r| r.clone()) } - /// Store a hash-consed name component. + /// Store a hash-consed name component. Host-only — see `store_blob`. + #[cfg(not(target_arch = "riscv64"))] pub fn store_name(&self, addr: Address, name: Name) { self.names.insert(addr, name); } @@ -133,7 +140,8 @@ impl Env { self.names.get(addr).map(|r| r.clone()) } - /// Store a commitment. + /// Store a commitment. Host-only — see `store_blob`. + #[cfg(not(target_arch = "riscv64"))] pub fn store_comm(&self, addr: Address, comm: Comm) { self.comms.insert(addr, comm); } @@ -170,28 +178,31 @@ impl Env { } impl Clone for Env { + // `mut` is only needed on `riscv64` where `IxonMap` wraps `FxHashMap` and + // `insert` takes `&mut self`; on host `DashMap::insert` takes `&self`. + #[cfg_attr(not(target_arch = "riscv64"), allow(unused_mut))] fn clone(&self) -> Self { - let consts = DashMap::new(); + let mut consts = IxonMap::new(); for entry in self.consts.iter() { consts.insert(entry.key().clone(), entry.value().clone()); } - let named = DashMap::new(); + let mut named = IxonMap::new(); for entry in self.named.iter() { named.insert(entry.key().clone(), entry.value().clone()); } - let blobs = DashMap::new(); + let mut blobs = IxonMap::new(); for entry in self.blobs.iter() { blobs.insert(entry.key().clone(), entry.value().clone()); } - let names = DashMap::new(); + let mut names = IxonMap::new(); for entry in self.names.iter() { names.insert(entry.key().clone(), entry.value().clone()); } - let comms = DashMap::new(); + let mut comms = IxonMap::new(); for entry in self.comms.iter() { comms.insert(entry.key().clone(), entry.value().clone()); } @@ -203,9 +214,9 @@ impl Clone for Env { #[cfg(test)] mod tests { use super::*; - use crate::ix::env::Name; - use crate::ix::ixon::constant::{Axiom, Constant, ConstantInfo}; - use crate::ix::ixon::expr::Expr; + use crate::constant::{Axiom, Constant, ConstantInfo}; + use crate::expr::Expr; + use ix_common::env::Name; use std::sync::Arc; fn n(s: &str) -> Name { diff --git a/src/ix/ixon/error.rs b/crates/ixon/src/error.rs similarity index 99% rename from src/ix/ixon/error.rs rename to crates/ixon/src/error.rs index 26f22334..0e2c8462 100644 --- a/src/ix/ixon/error.rs +++ b/crates/ixon/src/error.rs @@ -1,6 +1,6 @@ //! Custom error types for Ixon serialization and compilation. -use crate::ix::address::Address; +use ix_common::address::Address; /// Errors during serialization/deserialization. #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/src/ix/ixon/expr.rs b/crates/ixon/src/expr.rs similarity index 98% rename from src/ix/ixon/expr.rs rename to crates/ixon/src/expr.rs index 5a6f6267..815ed69c 100644 --- a/src/ix/ixon/expr.rs +++ b/crates/ixon/src/expr.rs @@ -145,10 +145,11 @@ impl Expr { #[cfg(test)] pub mod tests { use super::*; - use crate::ix::ixon::constant::Constant; - use crate::ix::ixon::serialize::{get_expr, put_expr}; - use crate::ix::ixon::tests::gen_range; + use crate::constant::Constant; + use crate::serialize::{get_expr, put_expr}; + use crate::tests::gen_range; use quickcheck::{Arbitrary, Gen}; + use quickcheck_macros::quickcheck; use std::ptr; #[derive(Clone, Copy)] @@ -169,7 +170,7 @@ pub mod tests { /// Generate an arbitrary Expr using pointer-tree technique (no stack overflow) pub fn arbitrary_expr(g: &mut Gen) -> Arc { - use crate::ix::ixon::tests::next_case; + use crate::tests::next_case; let mut root = Expr::Var(0); let mut stack = vec![&mut root as *mut Expr]; diff --git a/src/ix/ixon.rs b/crates/ixon/src/lib.rs similarity index 98% rename from src/ix/ixon.rs rename to crates/ixon/src/lib.rs index cda202a8..ae2e9479 100644 --- a/src/ix/ixon.rs +++ b/crates/ixon/src/lib.rs @@ -11,6 +11,7 @@ pub mod constant; pub mod env; pub mod error; pub mod expr; +pub mod map; pub mod metadata; pub mod proof; pub mod serialize; @@ -82,7 +83,7 @@ pub mod tests { #[cfg(test)] mod doc_examples { use super::*; - use crate::ix::address::Address; + use ix_common::address::Address; // ========================================================================= // Tag4 examples (docs section "Tag4 (4-bit flag)") @@ -365,8 +366,8 @@ mod doc_examples { fn definition_packed_kind_safety() { // DefKind::Definition = 0, DefinitionSafety::Safe = 1 // Packed: (0 << 2) | 1 = 0x01 - use crate::ix::env::DefinitionSafety; use constant::{DefKind, Definition}; + use ix_common::env::DefinitionSafety; let def = Definition { kind: DefKind::Definition, @@ -384,8 +385,8 @@ mod doc_examples { fn definition_opaque_unsafe() { // DefKind::Opaque = 1, DefinitionSafety::Unsafe = 0 // Packed: (1 << 2) | 0 = 0x04 - use crate::ix::env::DefinitionSafety; use constant::{DefKind, Definition}; + use ix_common::env::DefinitionSafety; let def = Definition { kind: DefKind::Opaque, @@ -403,8 +404,8 @@ mod doc_examples { fn definition_theorem_partial() { // DefKind::Theorem = 2, DefinitionSafety::Partial = 2 // Packed: (2 << 2) | 2 = 0x0A - use crate::ix::env::DefinitionSafety; use constant::{DefKind, Definition}; + use ix_common::env::DefinitionSafety; let def = Definition { kind: DefKind::Theorem, @@ -425,8 +426,8 @@ mod doc_examples { #[test] fn constant_defn_tag() { // Constant with Defn -> Tag4 { flag: 0xD, size: 0 } -> 0xD0 - use crate::ix::env::DefinitionSafety; use constant::{Constant, ConstantInfo, DefKind, Definition}; + use ix_common::env::DefinitionSafety; let constant = Constant::new(ConstantInfo::Defn(Definition { kind: DefKind::Definition, @@ -443,8 +444,8 @@ mod doc_examples { #[test] fn constant_muts_tag() { // Muts with 3 entries -> Tag4 { flag: 0xC, size: 3 } -> 0xC3 - use crate::ix::env::DefinitionSafety; use constant::{Constant, ConstantInfo, DefKind, Definition, MutConst}; + use ix_common::env::DefinitionSafety; let def = Definition { kind: DefKind::Definition, diff --git a/crates/ixon/src/map.rs b/crates/ixon/src/map.rs new file mode 100644 index 00000000..748ebafb --- /dev/null +++ b/crates/ixon/src/map.rs @@ -0,0 +1,101 @@ +//! Map type used by `Env`. +//! +//! On host, this is `dashmap::DashMap` — concurrent reads/writes for the +//! parallel ingress path. On `riscv64`, `DashMap` pulls in `parking_lot_core`, +//! whose `HashTable::new` calls `Instant::now()` (unsupported in the Zisk +//! guest's stdlib). Instead, alias to a thin single-threaded wrapper around +//! `rustc_hash::FxHashMap` that mirrors the subset of DashMap's API used here. + +#[cfg(not(target_arch = "riscv64"))] +pub use dashmap::DashMap as IxonMap; + +#[cfg(target_arch = "riscv64")] +pub use riscv_impl::IxonMap; + +#[cfg(target_arch = "riscv64")] +mod riscv_impl { + use std::collections::hash_map; + use std::hash::Hash; + use std::ops::Deref; + + use rustc_hash::FxHashMap; + + #[derive(Debug)] + pub struct IxonMap(FxHashMap); + + impl Default for IxonMap { + fn default() -> Self { + Self(FxHashMap::default()) + } + } + + impl IxonMap { + pub fn new() -> Self { + Self::default() + } + + pub fn len(&self) -> usize { + self.0.len() + } + + pub fn is_empty(&self) -> bool { + self.0.is_empty() + } + + pub fn contains_key(&self, k: &K) -> bool { + self.0.contains_key(k) + } + + pub fn insert(&mut self, k: K, v: V) -> Option { + self.0.insert(k, v) + } + + pub fn clear(&mut self) { + self.0.clear(); + } + + pub fn get(&self, k: &K) -> Option> { + self.0.get_key_value(k).map(|(k, v)| MapRef { k, v }) + } + + pub fn get_mut(&mut self, k: &K) -> Option<&mut V> { + self.0.get_mut(k) + } + + pub fn iter(&self) -> Iter<'_, K, V> { + Iter(self.0.iter()) + } + } + + /// Read guard exposing DashMap's `key()` / `value()` shape. + pub struct MapRef<'a, K, V> { + k: &'a K, + v: &'a V, + } + + impl<'a, K, V> MapRef<'a, K, V> { + pub fn key(&self) -> &K { + self.k + } + + pub fn value(&self) -> &V { + self.v + } + } + + impl<'a, K, V> Deref for MapRef<'a, K, V> { + type Target = V; + fn deref(&self) -> &V { + self.v + } + } + + pub struct Iter<'a, K, V>(hash_map::Iter<'a, K, V>); + + impl<'a, K, V> Iterator for Iter<'a, K, V> { + type Item = MapRef<'a, K, V>; + fn next(&mut self) -> Option { + self.0.next().map(|(k, v)| MapRef { k, v }) + } + } +} diff --git a/src/ix/ixon/metadata.rs b/crates/ixon/src/metadata.rs similarity index 96% rename from src/ix/ixon/metadata.rs rename to crates/ixon/src/metadata.rs index e6f48db1..c8f16d2c 100644 --- a/src/ix/ixon/metadata.rs +++ b/crates/ixon/src/metadata.rs @@ -12,8 +12,8 @@ use std::collections::HashMap; use std::sync::Arc; -use crate::ix::address::Address; -use crate::ix::env::{self, BinderInfo, Name, ReducibilityHints}; +use ix_common::address::Address; +use ix_common::env::{self, BinderInfo, Name, ReducibilityHints}; use super::env::AuxLayout; use super::expr::Expr; @@ -330,7 +330,7 @@ pub fn resolve_kvmap( }, DataValue::OfNat(a) => { let bytes = ixon_env.get_blob(a)?; - env::DataValue::OfNat(lean_ffi::nat::Nat::from_le_bytes(&bytes)) + env::DataValue::OfNat(bignat::Nat::from_le_bytes(&bytes)) }, DataValue::OfInt(a) => { let bytes = ixon_env.get_blob(a)?; @@ -389,8 +389,8 @@ fn deser_addr(buf: &mut &[u8]) -> Option
{ fn deser_int(bytes: &[u8]) -> Option { let (&tag, rest) = bytes.split_first()?; match tag { - 0 => Some(env::Int::OfNat(lean_ffi::nat::Nat::from_le_bytes(rest))), - 1 => Some(env::Int::NegSucc(lean_ffi::nat::Nat::from_le_bytes(rest))), + 0 => Some(env::Int::OfNat(bignat::Nat::from_le_bytes(rest))), + 1 => Some(env::Int::NegSucc(bignat::Nat::from_le_bytes(rest))), _ => None, } } @@ -401,8 +401,8 @@ fn deser_substring( ) -> Option { let str_addr = deser_addr(buf)?; let s = String::from_utf8(ixon_env.get_blob(&str_addr)?).ok()?; - let start_pos = lean_ffi::nat::Nat::from(deser_tag0(buf)?); - let stop_pos = lean_ffi::nat::Nat::from(deser_tag0(buf)?); + let start_pos = bignat::Nat::from(deser_tag0(buf)?); + let stop_pos = bignat::Nat::from(deser_tag0(buf)?); Some(env::Substring { str: s, start_pos, stop_pos }) } @@ -413,9 +413,9 @@ fn deser_source_info( match deser_u8(buf)? { 0 => { let leading = deser_substring(buf, ixon_env)?; - let leading_pos = lean_ffi::nat::Nat::from(deser_tag0(buf)?); + let leading_pos = bignat::Nat::from(deser_tag0(buf)?); let trailing = deser_substring(buf, ixon_env)?; - let trailing_pos = lean_ffi::nat::Nat::from(deser_tag0(buf)?); + let trailing_pos = bignat::Nat::from(deser_tag0(buf)?); Some(env::SourceInfo::Original( leading, leading_pos, @@ -424,8 +424,8 @@ fn deser_source_info( )) }, 1 => { - let start = lean_ffi::nat::Nat::from(deser_tag0(buf)?); - let end = lean_ffi::nat::Nat::from(deser_tag0(buf)?); + let start = bignat::Nat::from(deser_tag0(buf)?); + let end = bignat::Nat::from(deser_tag0(buf)?); let canonical = deser_u8(buf)? != 0; Some(env::SourceInfo::Synthetic(start, end, canonical)) }, @@ -560,8 +560,15 @@ pub(super) fn get_vec_len(buf: &mut &[u8]) -> Result { // BinderInfo and ReducibilityHints serialization // =========================================================================== -impl BinderInfo { - pub fn put(&self, buf: &mut Vec) { +/// Extension trait for serializing/deserializing small env-side enums whose +/// types live in `ix-types` (so we can't define inherent impls here). +pub trait IxonByteSerde: Sized { + fn put_ser(&self, buf: &mut Vec); + fn get_ser(buf: &mut &[u8]) -> Result; +} + +impl IxonByteSerde for BinderInfo { + fn put_ser(&self, buf: &mut Vec) { match self { Self::Default => put_u8(0, buf), Self::Implicit => put_u8(1, buf), @@ -570,7 +577,7 @@ impl BinderInfo { } } - pub fn get_ser(buf: &mut &[u8]) -> Result { + fn get_ser(buf: &mut &[u8]) -> Result { match get_u8(buf)? { 0 => Ok(Self::Default), 1 => Ok(Self::Implicit), @@ -581,8 +588,8 @@ impl BinderInfo { } } -impl ReducibilityHints { - pub fn put(&self, buf: &mut Vec) { +impl IxonByteSerde for ReducibilityHints { + fn put_ser(&self, buf: &mut Vec) { match self { Self::Opaque => put_u8(0, buf), Self::Abbrev => put_u8(1, buf), @@ -593,7 +600,7 @@ impl ReducibilityHints { } } - pub fn get_ser(buf: &mut &[u8]) -> Result { + fn get_ser(buf: &mut &[u8]) -> Result { match get_u8(buf)? { 0 => Ok(Self::Opaque), 1 => Ok(Self::Abbrev), @@ -1004,7 +1011,7 @@ impl ConstantMetaInfo { put_u8(0, buf); put_idx(name, idx, buf)?; put_idx_vec(lvls, idx, buf)?; - hints.put(buf); + hints.put_ser(buf); put_idx_vec(all, idx, buf)?; put_idx_vec(ctx, idx, buf)?; arena.put_indexed(idx, buf)?; @@ -1182,28 +1189,6 @@ impl ConstantMetaInfo { #[cfg(test)] mod tests { use super::*; - use quickcheck::{Arbitrary, Gen}; - - impl Arbitrary for BinderInfo { - fn arbitrary(g: &mut Gen) -> Self { - match u8::arbitrary(g) % 4 { - 0 => Self::Default, - 1 => Self::Implicit, - 2 => Self::StrictImplicit, - _ => Self::InstImplicit, - } - } - } - - impl Arbitrary for ReducibilityHints { - fn arbitrary(g: &mut Gen) -> Self { - match u8::arbitrary(g) % 3 { - 0 => Self::Opaque, - 1 => Self::Abbrev, - _ => Self::Regular(u32::arbitrary(g)), - } - } - } #[test] fn test_binder_info_roundtrip() { @@ -1214,7 +1199,7 @@ mod tests { BinderInfo::InstImplicit, ] { let mut buf = Vec::new(); - bi.put(&mut buf); + bi.put_ser(&mut buf); assert_eq!(BinderInfo::get_ser(&mut buf.as_slice()).unwrap(), bi); } } @@ -1227,7 +1212,7 @@ mod tests { ReducibilityHints::Regular(42), ] { let mut buf = Vec::new(); - h.put(&mut buf); + h.put_ser(&mut buf); assert_eq!(ReducibilityHints::get_ser(&mut buf.as_slice()).unwrap(), h); } } diff --git a/src/ix/ixon/proof.rs b/crates/ixon/src/proof.rs similarity index 99% rename from src/ix/ixon/proof.rs rename to crates/ixon/src/proof.rs index 00b4d0c8..969ee64f 100644 --- a/src/ix/ixon/proof.rs +++ b/crates/ixon/src/proof.rs @@ -8,8 +8,8 @@ //! order. This enables revealing specific fields of a committed constant without //! exposing the full structure. -use crate::ix::address::Address; -use crate::ix::env::{DefinitionSafety, QuotKind}; +use ix_common::address::Address; +use ix_common::env::{DefinitionSafety, QuotKind}; use super::constant::DefKind; use super::tag::{Tag0, Tag4}; @@ -1078,6 +1078,7 @@ impl Proof { mod tests { use super::*; use quickcheck::{Arbitrary, Gen}; + use quickcheck_macros::quickcheck; // ========== Arbitrary impls ========== diff --git a/src/ix/ixon/serialize.rs b/crates/ixon/src/serialize.rs similarity index 96% rename from src/ix/ixon/serialize.rs rename to crates/ixon/src/serialize.rs index 12690d6f..7f540393 100644 --- a/src/ix/ixon/serialize.rs +++ b/crates/ixon/src/serialize.rs @@ -9,8 +9,8 @@ use std::sync::Arc; -use crate::ix::address::Address; -use crate::ix::env::{DefinitionSafety, QuotKind}; +use ix_common::address::Address; +use ix_common::env::{DefinitionSafety, QuotKind}; use super::constant::{ Axiom, Constant, ConstantInfo, Constructor, ConstructorProj, DefKind, @@ -18,6 +18,7 @@ use super::constant::{ Recursor, RecursorProj, RecursorRule, }; use super::expr::Expr; +use super::metadata::IxonByteSerde; use super::tag::{Tag0, Tag4}; use super::univ::{Univ, get_univ, put_univ}; @@ -425,28 +426,26 @@ impl DefKind { } } -impl DefinitionSafety { - fn to_u8(self) -> u8 { - match self { - Self::Unsafe => 0, - Self::Safe => 1, - Self::Partial => 2, - } +fn definition_safety_to_u8(s: DefinitionSafety) -> u8 { + match s { + DefinitionSafety::Unsafe => 0, + DefinitionSafety::Safe => 1, + DefinitionSafety::Partial => 2, } +} - fn from_u8(x: u8) -> Result { - match x { - 0 => Ok(Self::Unsafe), - 1 => Ok(Self::Safe), - 2 => Ok(Self::Partial), - x => Err(format!("DefinitionSafety::from_u8: invalid {x}")), - } +fn definition_safety_from_u8(x: u8) -> Result { + match x { + 0 => Ok(DefinitionSafety::Unsafe), + 1 => Ok(DefinitionSafety::Safe), + 2 => Ok(DefinitionSafety::Partial), + x => Err(format!("DefinitionSafety::from_u8: invalid {x}")), } } /// Pack DefKind (2 bits) and DefinitionSafety (2 bits) into a single byte. fn pack_def_kind_safety(kind: DefKind, safety: DefinitionSafety) -> u8 { - (kind.to_u8() << 2) | safety.to_u8() + (kind.to_u8() << 2) | definition_safety_to_u8(safety) } /// Unpack DefKind and DefinitionSafety from a single byte. @@ -454,12 +453,12 @@ fn unpack_def_kind_safety( b: u8, ) -> Result<(DefKind, DefinitionSafety), String> { let kind = DefKind::from_u8(b >> 2)?; - let safety = DefinitionSafety::from_u8(b & 0x3)?; + let safety = definition_safety_from_u8(b & 0x3)?; Ok((kind, safety)) } -impl QuotKind { - pub fn put_ser(&self, buf: &mut Vec) { +impl IxonByteSerde for QuotKind { + fn put_ser(&self, buf: &mut Vec) { match self { Self::Type => put_u8(0, buf), Self::Ctor => put_u8(1, buf), @@ -468,7 +467,7 @@ impl QuotKind { } } - pub fn get_ser(buf: &mut &[u8]) -> Result { + fn get_ser(buf: &mut &[u8]) -> Result { match get_u8(buf)? { 0 => Ok(Self::Type), 1 => Ok(Self::Ctor), @@ -870,8 +869,8 @@ impl Constant { // Name serialization // ============================================================================ -use crate::ix::env::{Name, NameData}; -use lean_ffi::nat::Nat; +use bignat::Nat; +use ix_common::env::{Name, NameData}; use rustc_hash::FxHashMap; /// Serialize a Name to bytes (full recursive serialization, for standalone use). @@ -1108,6 +1107,7 @@ impl Env { /// insertion orders), and DashMap iteration order is shard-dependent. /// Sorting the keys is the minimum work to guarantee that. pub fn put(&self, buf: &mut Vec) -> Result<(), String> { + #[cfg(not(target_arch = "riscv64"))] use rayon::slice::ParallelSliceMut; // Chatty per-section logging gated on IX_QUIET=1 (disables) so we can @@ -1127,7 +1127,10 @@ impl Env { } let mut blob_addrs: Vec
= self.blobs.iter().map(|e| e.key().clone()).collect(); + #[cfg(not(target_arch = "riscv64"))] blob_addrs.par_sort_unstable(); + #[cfg(target_arch = "riscv64")] + blob_addrs.sort_unstable(); put_u64(blob_addrs.len() as u64, buf); for addr in &blob_addrs { if let Some(entry) = self.blobs.get(addr) { @@ -1154,7 +1157,10 @@ impl Env { } let mut const_addrs: Vec
= self.consts.iter().map(|e| e.key().clone()).collect(); + #[cfg(not(target_arch = "riscv64"))] const_addrs.par_sort_unstable(); + #[cfg(target_arch = "riscv64")] + const_addrs.sort_unstable(); if !quiet { eprintln!( "[Env::put] section 2/5 consts: collected+sorted in {:.1}s, \ @@ -1237,9 +1243,14 @@ impl Env { // Sort by the cached name hash bytes (same key used by every existing // Section 4 ordering guarantee). `par_sort_unstable_by` uses rayon to // parallelize the compare across all cores. + #[cfg(not(target_arch = "riscv64"))] named_keys.par_sort_unstable_by(|a, b| { a.get_hash().as_bytes().cmp(b.get_hash().as_bytes()) }); + #[cfg(target_arch = "riscv64")] + named_keys.sort_unstable_by(|a, b| { + a.get_hash().as_bytes().cmp(b.get_hash().as_bytes()) + }); if !quiet { eprintln!( "[Env::put] section 4/5 named: collected+sorted in {:.1}s, \ @@ -1274,7 +1285,10 @@ impl Env { } let mut comm_addrs: Vec
= self.comms.iter().map(|e| e.key().clone()).collect(); + #[cfg(not(target_arch = "riscv64"))] comm_addrs.par_sort_unstable(); + #[cfg(target_arch = "riscv64")] + comm_addrs.sort_unstable(); put_u64(comm_addrs.len() as u64, buf); for addr in &comm_addrs { if let Some(entry) = self.comms.get(addr) { @@ -1315,7 +1329,8 @@ impl Env { )); } - let env = Env::new(); + #[cfg_attr(not(target_arch = "riscv64"), allow(unused_mut))] + let mut env = Env::new(); // Section 1: Blobs let num_blobs = get_u64(buf)?; @@ -1474,8 +1489,9 @@ impl Env { /// Mathlib because 4.7M shard-lock acquisitions dominate vs the one-time /// ~150 MB tuple-clone allocation. fn topological_sort_names( - names: &dashmap::DashMap, + names: &crate::map::IxonMap, ) -> Vec<(Address, Name)> { + #[cfg(not(target_arch = "riscv64"))] use rayon::slice::ParallelSliceMut; use rustc_hash::FxHashSet; @@ -1514,7 +1530,10 @@ fn topological_sort_names( // during DFS). Parallel sort uses rayon over address bytes. let mut sorted_entries: Vec<(Address, Name)> = names.iter().map(|e| (e.key().clone(), e.value().clone())).collect(); + #[cfg(not(target_arch = "riscv64"))] sorted_entries.par_sort_unstable_by(|a, b| a.0.cmp(&b.0)); + #[cfg(target_arch = "riscv64")] + sorted_entries.sort_unstable_by(|a, b| a.0.cmp(&b.0)); for (_, name) in &sorted_entries { visit(name, &mut visited, &mut result); } @@ -1525,9 +1544,10 @@ fn topological_sort_names( #[cfg(test)] mod tests { use super::*; - use crate::ix::ixon::constant::tests::gen_constant; - use crate::ix::ixon::tests::gen_range; + use crate::constant::tests::gen_constant; + use crate::tests::gen_range; use quickcheck::{Arbitrary, Gen}; + use quickcheck_macros::quickcheck; #[quickcheck] fn prop_pack_bools_roundtrip(x: Vec) -> bool { diff --git a/src/ix/ixon/sharing.rs b/crates/ixon/src/sharing.rs similarity index 99% rename from src/ix/ixon/sharing.rs rename to crates/ixon/src/sharing.rs index 610d07c2..ccf87dd2 100644 --- a/src/ix/ixon/sharing.rs +++ b/crates/ixon/src/sharing.rs @@ -1060,7 +1060,7 @@ mod tests { #[test] fn test_roundtrip_with_sharing() { - use crate::ix::ixon::serialize::{get_expr, put_expr}; + use crate::serialize::{get_expr, put_expr}; // Create a simple expression with potential sharing let var0 = Expr::var(0); diff --git a/src/ix/ixon/tag.rs b/crates/ixon/src/tag.rs similarity index 99% rename from src/ix/ixon/tag.rs rename to crates/ixon/src/tag.rs index 240d9688..35465aaa 100644 --- a/src/ix/ixon/tag.rs +++ b/crates/ixon/src/tag.rs @@ -225,6 +225,7 @@ impl Tag0 { mod tests { use super::*; use quickcheck::{Arbitrary, Gen}; + use quickcheck_macros::quickcheck; // ============================================================================ // Arbitrary implementations diff --git a/src/ix/ixon/univ.rs b/crates/ixon/src/univ.rs similarity index 98% rename from src/ix/ixon/univ.rs rename to crates/ixon/src/univ.rs index ce3e9db8..41282332 100644 --- a/src/ix/ixon/univ.rs +++ b/crates/ixon/src/univ.rs @@ -162,8 +162,9 @@ pub fn get_univ(buf: &mut &[u8]) -> Result, String> { #[cfg(test)] pub mod tests { use super::*; - use crate::ix::ixon::tests::{gen_range, next_case}; + use crate::tests::{gen_range, next_case}; use quickcheck::{Arbitrary, Gen}; + use quickcheck_macros::quickcheck; use std::ptr; #[derive(Clone, Copy)] diff --git a/crates/kernel/Cargo.toml b/crates/kernel/Cargo.toml new file mode 100644 index 00000000..edaef73d --- /dev/null +++ b/crates/kernel/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "ix-kernel" +version.workspace = true +edition.workspace = true +license.workspace = true + +[dependencies] +bignat = { workspace = true } +blake3 = { workspace = true } +dashmap = { workspace = true } +indexmap = { workspace = true } +ix-common = { workspace = true } +ixon = { workspace = true } +itertools = { workspace = true } +log = { workspace = true } +num-bigint = { workspace = true } +rustc-hash = { workspace = true } + +[target.'cfg(not(target_arch = "riscv64"))'.dependencies] +dashmap = { workspace = true, features = ["rayon"] } +rayon = { workspace = true } + +[dev-dependencies] +quickcheck = { workspace = true } +quickcheck_macros = { workspace = true } + +[lints] +workspace = true diff --git a/src/ix/kernel/canonical_check.rs b/crates/kernel/src/canonical_check.rs similarity index 99% rename from src/ix/kernel/canonical_check.rs rename to crates/kernel/src/canonical_check.rs index 68429f99..9c028fec 100644 --- a/src/ix/kernel/canonical_check.rs +++ b/crates/kernel/src/canonical_check.rs @@ -38,7 +38,7 @@ use std::cmp::Ordering; use rustc_hash::FxHashMap; -use crate::ix::address::Address; +use ix_common::address::Address; use super::constant::{KConst, RecRule}; use super::error::TcError; @@ -47,7 +47,7 @@ use super::id::KId; use super::level::{KUniv, UnivData}; use super::mode::KernelMode; -pub use crate::ix::strong_ordering::SOrd; +pub use ix_common::strong_ordering::SOrd; // =========================================================================== // KMutCtx — block-local address → class-index map @@ -415,11 +415,11 @@ fn compare_krecr( /// alpha-collapse on the canonical IXON form, which doesn't include /// hints (and treats safety as a separate sidecar in practice). fn compare_kdefn( - x_kind: crate::ix::ixon::constant::DefKind, + x_kind: ixon::constant::DefKind, x_lvls: u64, x_ty: &KExpr, x_val: &KExpr, - y_kind: crate::ix::ixon::constant::DefKind, + y_kind: ixon::constant::DefKind, y_lvls: u64, y_ty: &KExpr, y_val: &KExpr, @@ -826,10 +826,10 @@ pub fn validate_canonical_block_single_pass( #[cfg(test)] mod tests { use super::*; - use crate::ix::address::Address; - use crate::ix::env::{BinderInfo, Name}; - use crate::ix::env::{DefinitionSafety, ReducibilityHints}; - use crate::ix::ixon::constant::DefKind; + use ix_common::address::Address; + use ix_common::env::{BinderInfo, Name}; + use ix_common::env::{DefinitionSafety, ReducibilityHints}; + use ixon::constant::DefKind; use super::super::expr::KExpr; use super::super::level::KUniv; diff --git a/src/ix/kernel/check.rs b/crates/kernel/src/check.rs similarity index 97% rename from src/ix/kernel/check.rs rename to crates/kernel/src/check.rs index 4d3dad1c..9b497447 100644 --- a/src/ix/kernel/check.rs +++ b/crates/kernel/src/check.rs @@ -5,9 +5,9 @@ use std::time::{Duration, Instant}; use rustc_hash::FxHashSet; -use crate::ix::address::Address; -use crate::ix::env::{DefinitionSafety, QuotKind}; -use crate::ix::ixon::constant::DefKind; +use ix_common::address::Address; +use ix_common::env::{DefinitionSafety, QuotKind}; +use ixon::constant::DefKind; use super::constant::KConst; use super::env::Addr; @@ -26,14 +26,20 @@ use super::tc::TypeChecker; /// `IX_DECL_DIFF=1` we dump `val_ty` / `ty` and their whnf forms to /// pinpoint which sub-expression is stuck \u2014 sister tool to /// `IX_APP_DIFF` in `infer.rs`. +#[cfg(not(target_arch = "riscv64"))] static IX_DECL_DIFF: LazyLock = LazyLock::new(|| std::env::var("IX_DECL_DIFF").is_ok()); +#[cfg(target_arch = "riscv64")] +static IX_DECL_DIFF: LazyLock = LazyLock::new(|| false); /// Per-phase timing for `Defn` checks. Set `IX_PHASE_TIMING=1` to see where a /// slow constant spends its time. Noisy — gate on a single constant via focus /// mode so only one line is printed. +#[cfg(not(target_arch = "riscv64"))] static IX_PHASE_TIMING: LazyLock = LazyLock::new(|| std::env::var("IX_PHASE_TIMING").is_ok()); +#[cfg(target_arch = "riscv64")] +static IX_PHASE_TIMING: LazyLock = LazyLock::new(|| false); #[derive(Clone, Copy, Debug, Default)] struct ValidationTiming { @@ -67,7 +73,7 @@ impl TypeChecker<'_, M> { /// Type-check a single constant. Clears per-constant caches first. pub fn check_const(&mut self, id: &KId) -> Result<(), TcError> where - M::MField>: CheckDupLevelParams, + M::MField>: CheckDupLevelParams, { let c = self.get_const(id)?; if let Some(block) = self.coordinated_block_for(&c)? { @@ -84,7 +90,7 @@ impl TypeChecker<'_, M> { fn check_const_member_fresh(&mut self, id: &KId) -> Result<(), TcError> where - M::MField>: CheckDupLevelParams, + M::MField>: CheckDupLevelParams, { self.reset(); @@ -98,7 +104,7 @@ impl TypeChecker<'_, M> { c: &KConst, ) -> Result<(), TcError> where - M::MField>: CheckDupLevelParams, + M::MField>: CheckDupLevelParams, { let phase_timing = *IX_PHASE_TIMING; let overall = if phase_timing { Some(Instant::now()) } else { None }; @@ -334,7 +340,7 @@ impl TypeChecker<'_, M> { requested: &KId, ) -> Result<(), TcError> where - M::MField>: CheckDupLevelParams, + M::MField>: CheckDupLevelParams, { let phase_timing = *IX_PHASE_TIMING; let overall = if phase_timing { Some(Instant::now()) } else { None }; @@ -866,9 +872,9 @@ mod tests { use super::super::level::KUniv; use super::super::mode::Anon; use super::super::tc::TypeChecker; - use crate::ix::address::Address; - use crate::ix::env::{DefinitionSafety, ReducibilityHints}; - use crate::ix::ixon::constant::DefKind; + use ix_common::address::Address; + use ix_common::env::{DefinitionSafety, ReducibilityHints}; + use ixon::constant::DefKind; type AE = KExpr; type AU = KUniv; @@ -1087,13 +1093,13 @@ mod tests { #[test] fn check_duplicate_level_params_rejected() { - use crate::ix::kernel::mode::Meta; + use crate::mode::Meta; type ME = KExpr; type MU = KUniv; let mut env = KEnv::::new(); let dup_name = - crate::ix::env::Name::str(crate::ix::env::Name::anon(), "u".into()); + ix_common::env::Name::str(ix_common::env::Name::anon(), "u".into()); let id = KId::new(mk_addr("T"), dup_name.clone()); env.insert( id.clone(), diff --git a/src/ix/kernel/congruence.rs b/crates/kernel/src/congruence.rs similarity index 97% rename from src/ix/kernel/congruence.rs rename to crates/kernel/src/congruence.rs index 2ba3ff44..906ae1b2 100644 --- a/src/ix/kernel/congruence.rs +++ b/crates/kernel/src/congruence.rs @@ -3,8 +3,8 @@ //! Validates that Ixon ingress in Anon mode produces structurally correct //! constants by comparing the Lean `ConstantInfo` against the loaded `KConst`. -use crate::ix::address::Address; -use crate::ix::env::{self as lean, ConstantInfo as LeanCI, Literal, Name}; +use ix_common::address::Address; +use ix_common::env::{self as lean, ConstantInfo as LeanCI, Literal, Name}; use super::constant::KConst; use super::expr::{ExprData, KExpr}; @@ -17,7 +17,7 @@ pub struct NameResolver { } impl NameResolver { - pub fn from_ixon_env(ixon_env: &crate::ix::ixon::env::Env) -> Self { + pub fn from_ixon_env(ixon_env: &ixon::env::Env) -> Self { let mut map = rustc_hash::FxHashMap::default(); for entry in ixon_env.named.iter() { map.insert(entry.key().clone(), entry.value().addr.clone()); @@ -364,22 +364,22 @@ fn zero_const_tag(c: &KConst) -> &'static str { #[cfg(test)] mod tests { use super::*; - use crate::ix::address::Address; - use crate::ix::env::{ + use crate::constant::KConst; + use crate::id::KId; + use crate::mode::Anon; + use ix_common::address::Address; + use ix_common::env::{ self, AxiomVal, BinderInfo, ConstantVal, ConstructorVal, DefinitionSafety, DefinitionVal, InductiveVal, Level as LL, Name, OpaqueVal, QuotKind, QuotVal, RecursorRule as LeanRule, RecursorVal, ReducibilityHints, TheoremVal, }; - use crate::ix::ixon::env::{Env as IxonEnv, Named}; - use crate::ix::kernel::constant::KConst; - use crate::ix::kernel::id::KId; - use crate::ix::kernel::mode::Anon; + use ixon::env::{Env as IxonEnv, Named}; /// `Nat` from a u64 via the public `From` impl. /// (The `Nat` type itself is a private re-export in `env.rs`.) - fn n(x: u64) -> lean_ffi::nat::Nat { - lean_ffi::nat::Nat::from(x) + fn n(x: u64) -> bignat::Nat { + bignat::Nat::from(x) } // ---- test helpers ---- @@ -725,7 +725,7 @@ mod tests { let kc = KConst::::Defn { name: (), level_params: (), - kind: crate::ix::ixon::constant::DefKind::Definition, + kind: ixon::constant::DefKind::Definition, safety: DefinitionSafety::Safe, hints: ReducibilityHints::Opaque, lvls: 0, @@ -768,7 +768,7 @@ mod tests { let kc = KConst::::Defn { name: (), level_params: (), - kind: crate::ix::ixon::constant::DefKind::Definition, + kind: ixon::constant::DefKind::Definition, safety: DefinitionSafety::Safe, hints: ReducibilityHints::Opaque, lvls: 0, @@ -969,7 +969,7 @@ mod tests { let k = KConst::::Defn { name: (), level_params: (), - kind: crate::ix::ixon::constant::DefKind::Theorem, + kind: ixon::constant::DefKind::Theorem, safety: DefinitionSafety::Safe, hints: ReducibilityHints::Opaque, lvls: 0, diff --git a/src/ix/kernel/constant.rs b/crates/kernel/src/constant.rs similarity index 95% rename from src/ix/kernel/constant.rs rename to crates/kernel/src/constant.rs index 09bde5f0..16a3592b 100644 --- a/src/ix/kernel/constant.rs +++ b/crates/kernel/src/constant.rs @@ -3,8 +3,8 @@ //! Each variant carries structural fields plus metadata fields //! (`name`, `level_params`, `lean_all`) for roundtrip fidelity in Meta mode. -use crate::ix::env::{DefinitionSafety, Name, QuotKind, ReducibilityHints}; -use crate::ix::ixon::constant::DefKind; +use ix_common::env::{DefinitionSafety, Name, QuotKind, ReducibilityHints}; +use ixon::constant::DefKind; use super::expr::KExpr; use super::id::KId; @@ -153,9 +153,9 @@ mod tests { use super::super::level::KUniv; use super::super::mode::Anon; use super::*; - use crate::ix::address::Address; - use crate::ix::env::{DefinitionSafety, QuotKind, ReducibilityHints}; - use crate::ix::ixon::constant::DefKind; + use ix_common::address::Address; + use ix_common::env::{DefinitionSafety, QuotKind, ReducibilityHints}; + use ixon::constant::DefKind; fn sort0() -> KExpr { KExpr::sort(KUniv::zero()) diff --git a/src/ix/kernel/def_eq.rs b/crates/kernel/src/def_eq.rs similarity index 98% rename from src/ix/kernel/def_eq.rs rename to crates/kernel/src/def_eq.rs index a9323339..b7ba8e6c 100644 --- a/src/ix/kernel/def_eq.rs +++ b/crates/kernel/src/def_eq.rs @@ -9,7 +9,7 @@ use std::sync::LazyLock; -use crate::ix::ixon::constant::DefKind; +use ixon::constant::DefKind; use super::constant::KConst; use super::env::Addr; @@ -120,8 +120,8 @@ impl TypeChecker<'_, M> { // per method call. Any true result moves the originals into `add_equiv` // before returning. let eq_ctx = self.def_eq_ctx_key(a, b); - let a_key: crate::ix::kernel::equiv::EqKey = (a.hash_key(), eq_ctx); - let b_key: crate::ix::kernel::equiv::EqKey = (b.hash_key(), eq_ctx); + let a_key: crate::equiv::EqKey = (a.hash_key(), eq_ctx); + let b_key: crate::equiv::EqKey = (b.hash_key(), eq_ctx); if self.equiv_manager.is_equiv(&a_key, &b_key) { return Ok(true); @@ -807,7 +807,7 @@ impl TypeChecker<'_, M> { Ok(ty) => ty, Err(_) => return Ok(false), }; - if !self.is_prop_type(&a_ty)? { + if !self.is_prop_type(&a_ty) { return Ok(false); } let b_ty = match self.with_infer_only(|tc| tc.infer(b)) { @@ -826,14 +826,11 @@ impl TypeChecker<'_, M> { /// the inner chain are propagated as `Ok(false)` (treating ill-typed /// metadata as non-prop), matching the previous behaviour of /// `try_proof_irrel`. - pub(crate) fn is_prop_type( - &mut self, - ty: &KExpr, - ) -> Result> { + pub(crate) fn is_prop_type(&mut self, ty: &KExpr) -> bool { let cache_key = (ty.hash_key(), self.ctx_addr_for_lbr(ty.lbr())); if let Some(&cached) = self.env.is_prop_cache.get(&cache_key) { self.env.perf.record_is_prop_hit(); - return Ok(cached); + return cached; } self.env.perf.record_is_prop_miss(); self.record_hot_miss("is-prop", ty); @@ -852,7 +849,7 @@ impl TypeChecker<'_, M> { Err(_) => false, }; self.env.is_prop_cache.insert(cache_key, result); - Ok(result) + result } /// Unit-like type: non-recursive, 0 indices, 1 ctor with 0 fields. @@ -933,8 +930,8 @@ impl TypeChecker<'_, M> { if v.0 == num_bigint::BigUint::ZERO { return None; } - let pred = lean_ffi::nat::Nat(&v.0 - num_bigint::BigUint::from(1u64)); - let pred_addr = crate::ix::address::Address::hash(&pred.to_le_bytes()); + let pred = bignat::Nat(&v.0 - num_bigint::BigUint::from(1u64)); + let pred_addr = ix_common::address::Address::hash(&pred.to_le_bytes()); Some(self.env.intern.intern_expr(KExpr::nat(pred, pred_addr))) }, ExprData::App(f, arg, _) => match f.data() { @@ -1047,8 +1044,8 @@ impl TypeChecker<'_, M> { // Build list right-to-left: foldr let mut list = nil; for c in s.chars().rev() { - let nat_val = lean_ffi::nat::Nat::from(c as u64); - let nat_addr = crate::ix::address::Address::hash(&nat_val.to_le_bytes()); + let nat_val = bignat::Nat::from(c as u64); + let nat_addr = ix_common::address::Address::hash(&nat_val.to_le_bytes()); let nat_lit = self.intern(KExpr::nat(nat_val, nat_addr)); let char_val = self.intern(KExpr::app(char_of_nat.clone(), nat_lit)); let partial = self.intern(KExpr::app(cons.clone(), char_val)); @@ -1093,7 +1090,7 @@ impl TypeChecker<'_, M> { // Wrap s as λ(ty). s #0 let s_lifted = lift(&mut self.env.intern, s, 1, 0); let v0 = - self.intern(KExpr::var(0, M::meta_field(crate::ix::env::Name::anon()))); + self.intern(KExpr::var(0, M::meta_field(ix_common::env::Name::anon()))); let body = self.intern(KExpr::app(s_lifted, v0)); let s_lam = self.intern(KExpr::lam(name, bi, ty, body)); self.is_def_eq(t, &s_lam) @@ -1307,7 +1304,7 @@ impl TypeChecker<'_, M> { /// Check if a constant has Regular reducibility hints (not Abbrev or Opaque). /// Used to guard the same-head-spine optimization (lean4lean: dt.hints.isRegular). fn is_regular(&mut self, id: &KId) -> Result> { - use crate::ix::env::ReducibilityHints; + use ix_common::env::ReducibilityHints; Ok(matches!( self.try_get_const(id)?, Some(KConst::Defn { hints: ReducibilityHints::Regular(_), .. }) @@ -1329,7 +1326,7 @@ impl TypeChecker<'_, M> { /// - `Regular(h)` → `(1, h)` (ordered by height within the class) /// - `Abbrev` → `(2, 0)` (strictly greater than every `Regular(h)`) fn def_rank_id(&mut self, id: &KId) -> Result<(u8, u32), TcError> { - use crate::ix::env::ReducibilityHints; + use ix_common::env::ReducibilityHints; Ok(match self.try_get_const(id)? { Some(KConst::Defn { kind, hints, .. }) => match kind { DefKind::Opaque | DefKind::Theorem => (0, 0), @@ -1744,9 +1741,9 @@ mod tests { use super::super::level::KUniv; use super::super::mode::{Anon, Meta}; use super::super::tc::TypeChecker; - use crate::ix::address::Address; - use crate::ix::env::{DataValue, DefinitionSafety, Name, ReducibilityHints}; - use crate::ix::ixon::constant::DefKind; + use ix_common::address::Address; + use ix_common::env::{DataValue, DefinitionSafety, Name, ReducibilityHints}; + use ixon::constant::DefKind; type AE = KExpr; type ME = KExpr; diff --git a/src/ix/kernel/env.rs b/crates/kernel/src/env.rs similarity index 99% rename from src/ix/kernel/env.rs rename to crates/kernel/src/env.rs index 0383ab3f..2517c66d 100644 --- a/src/ix/kernel/env.rs +++ b/crates/kernel/src/env.rs @@ -11,7 +11,7 @@ use std::collections::BTreeSet; use rustc_hash::{FxHashMap, FxHashSet}; use std::cell::OnceCell; -use crate::ix::address::Address; +use ix_common::address::Address; use super::constant::{KConst, RecRule}; use super::error::TcError; @@ -587,7 +587,7 @@ mod tests { use super::super::mode::Anon; use super::super::primitive::PrimAddrs; use super::*; - use crate::ix::address::Address; + use ix_common::address::Address; fn mk_addr(s: &str) -> Address { Address::hash(s.as_bytes()) diff --git a/src/ix/kernel/equiv.rs b/crates/kernel/src/equiv.rs similarity index 100% rename from src/ix/kernel/equiv.rs rename to crates/kernel/src/equiv.rs diff --git a/src/ix/kernel/error.rs b/crates/kernel/src/error.rs similarity index 99% rename from src/ix/kernel/error.rs rename to crates/kernel/src/error.rs index 0d253436..44ad4852 100644 --- a/src/ix/kernel/error.rs +++ b/crates/kernel/src/error.rs @@ -2,7 +2,7 @@ use std::cmp::Ordering; -use crate::ix::address::Address; +use ix_common::address::Address; use super::expr::KExpr; use super::mode::KernelMode; diff --git a/src/ix/kernel/expr.rs b/crates/kernel/src/expr.rs similarity index 98% rename from src/ix/kernel/expr.rs rename to crates/kernel/src/expr.rs index 009bcf82..fe5ce40c 100644 --- a/src/ix/kernel/expr.rs +++ b/crates/kernel/src/expr.rs @@ -6,12 +6,12 @@ use std::fmt; use std::sync::Arc; -use crate::ix::address::Address; -use crate::ix::env::{ +use bignat::Nat; +use ix_common::address::Address; +use ix_common::env::{ BinderInfo, DataValue, EALL, EAPP, EFVAR, ELAM, ELET, ENAT, EPRJ, EREF, ESORT, ESTR, EVAR, Name, }; -use lean_ffi::nat::Nat; use super::env::Addr; use super::id::KId; @@ -48,7 +48,7 @@ pub struct ExprInfo { } /// Per-`TypeChecker` unique identifier for a free variable. Generated by -/// [`crate::ix::kernel::lctx::NameGenerator`] and embedded into the blake3 +/// [`crate::lctx::NameGenerator`] and embedded into the blake3 /// content hash of [`ExprData::FVar`] nodes, so that two distinct fvars hash /// distinctly. This is the soundness lever that lets cache keys be the /// expression hash alone (no separate local-context key) — see the kernel @@ -69,7 +69,7 @@ pub enum ExprData { /// Free variable: opaque identity from the active local context. /// `FVarId` participates in the content hash; the user-facing `Name` is /// preserved (in Meta mode) for diagnostics. The looked-up type lives in - /// the active [`crate::ix::kernel::lctx::LocalContext`], not on the node. + /// the active [`crate::lctx::LocalContext`], not on the node. FVar(FVarId, M::MField, ExprInfo), Sort(KUniv, ExprInfo), Const(KId, Box<[KUniv]>, ExprInfo), @@ -802,8 +802,8 @@ fn collect_spine(e: &KExpr) -> (KExpr, Vec>) { mod tests { use super::super::mode::{Anon, Meta}; use super::*; - use crate::ix::address::Address; - use crate::ix::env::BinderInfo; + use ix_common::address::Address; + use ix_common::env::BinderInfo; type ME = KExpr; type AE = KExpr; diff --git a/src/ix/kernel/id.rs b/crates/kernel/src/id.rs similarity index 98% rename from src/ix/kernel/id.rs rename to crates/kernel/src/id.rs index 621efdf3..36316984 100644 --- a/src/ix/kernel/id.rs +++ b/crates/kernel/src/id.rs @@ -1,8 +1,8 @@ use std::fmt; use std::hash::{Hash, Hasher}; -use crate::ix::address::Address; -use crate::ix::env::Name; +use ix_common::address::Address; +use ix_common::env::Name; use super::mode::{KernelMode, MetaDisplay, MetaHash}; diff --git a/src/ix/kernel/inductive.rs b/crates/kernel/src/inductive.rs similarity index 99% rename from src/ix/kernel/inductive.rs rename to crates/kernel/src/inductive.rs index b1ee08f9..4091c0e7 100644 --- a/src/ix/kernel/inductive.rs +++ b/crates/kernel/src/inductive.rs @@ -6,7 +6,7 @@ use std::sync::LazyLock; -use crate::ix::address::Address; +use ix_common::address::Address; use super::constant::KConst; use super::env::{GeneratedRecursor, RecursorAuxOrder}; @@ -493,7 +493,7 @@ impl TypeChecker<'_, M> { n_rec_params: u64, univ_offset: u64, ) -> Result>, TcError> { - let anon = || M::meta_field(crate::ix::env::Name::anon()); + let anon = || M::meta_field(ix_common::env::Name::anon()); let all_block_addrs: Vec
= block_inds.iter().map(|id| id.addr.clone()).collect(); @@ -916,7 +916,7 @@ impl TypeChecker<'_, M> { continue; } - let anon = || M::meta_field(crate::ix::env::Name::anon()); + let anon = || M::meta_field(ix_common::env::Name::anon()); let mut result = self.env.intern.intern_expr(KExpr::cnst( aux_ids[idx].clone(), block_us.to_vec().into_boxed_slice(), @@ -951,8 +951,8 @@ impl TypeChecker<'_, M> { n_block_params: u64, ) -> Result< Vec<( - M::MField, - M::MField, + M::MField, + M::MField, KExpr, )>, TcError, @@ -991,8 +991,8 @@ impl TypeChecker<'_, M> { &mut self, body: KExpr, binders: &[( - M::MField, - M::MField, + M::MField, + M::MField, KExpr, )], ) -> KExpr { @@ -1042,13 +1042,11 @@ impl TypeChecker<'_, M> { aux: &[FlatBlockMember], n_block_params: u64, block_us: &[KUniv], - all0_name: Option<&crate::ix::env::Name>, + all0_name: Option<&ix_common::env::Name>, block_first_id: Option<&KId>, ) -> Result, TcError> { - use crate::ix::env::Name; - use crate::ix::kernel::canonical_check::{ - KMutCtx, sort_kconsts_with_seed_key, - }; + use crate::canonical_check::{KMutCtx, sort_kconsts_with_seed_key}; + use ix_common::env::Name; use rustc_hash::FxHashMap; // Build synthetic Indc + Ctor views for each aux. @@ -1068,7 +1066,7 @@ impl TypeChecker<'_, M> { // the block's first inductive is unavailable, the wrap is empty (a no-op). let block_param_binders: Vec<( M::MField, - M::MField, + M::MField, KExpr, )> = match block_first_id { Some(id) if n_block_params > 0 => { @@ -2025,7 +2023,7 @@ peers={} flat={} rec_ids={} failed_gi={failed_gi}", } for (i, u) in us.iter().enumerate() { let expected = - KUniv::param(i as u64, M::meta_field(crate::ix::env::Name::anon())); + KUniv::param(i as u64, M::meta_field(ix_common::env::Name::anon())); if !univ_eq(u, &expected) { self.lctx.truncate(saved); return Err(TcError::Other(format!( @@ -2255,7 +2253,7 @@ peers={} flat={} rec_ids={} failed_gi={failed_gi}", let is_large = self.is_large_eliminator(&result_level, &ind_infos)?; let univ_offset: u64 = if is_large { 1 } else { 0 }; let elim_level = if is_large { - KUniv::param(0, M::meta_field(crate::ix::env::Name::anon())) + KUniv::param(0, M::meta_field(ix_common::env::Name::anon())) } else { KUniv::zero() }; @@ -2479,8 +2477,8 @@ peers={} flat={} rec_ids={} failed_gi={failed_gi}", elim_level: &KUniv, _univ_offset: u64, ) -> Result, TcError> { - let anon = || M::meta_field(crate::ix::env::Name::anon()); - let bi_default = || M::meta_field(crate::ix::env::BinderInfo::Default); + let anon = || M::meta_field(ix_common::env::Name::anon()); + let bi_default = || M::meta_field(ix_common::env::BinderInfo::Default); // Get inductive type and instantiate with occurrence universe args // (concrete for auxiliaries, same as ind_us for originals). @@ -2613,8 +2611,8 @@ peers={} flat={} rec_ids={} failed_gi={failed_gi}", }, }; let (ctor_ty_raw, _ctor_lvls) = ctor; - let anon = || M::meta_field(crate::ix::env::Name::anon()); - let bi_default = || M::meta_field(crate::ix::env::BinderInfo::Default); + let anon = || M::meta_field(ix_common::env::Name::anon()); + let bi_default = || M::meta_field(ix_common::env::BinderInfo::Default); let saved = self.lctx.len(); // Instantiate ctor type with occurrence universe args (concrete for output). @@ -2826,8 +2824,8 @@ peers={} flat={} rec_ids={} failed_gi={failed_gi}", field_domains: &[KExpr], block_addrs: &[Address], ) -> Result, TcError> { - let anon = || M::meta_field(crate::ix::env::Name::anon()); - let bi_default = || M::meta_field(crate::ix::env::BinderInfo::Default); + let anon = || M::meta_field(ix_common::env::Name::anon()); + let bi_default = || M::meta_field(ix_common::env::BinderInfo::Default); // Lift the field domain from its original depth (minor_saved + field_idx) // to the current depth (minor_saved + n_fields + k). @@ -3040,8 +3038,8 @@ peers={} flat={} rec_ids={} failed_gi={failed_gi}", let n_indices = u64_to_usize::(ind_infos[di].2)?; let block_addrs: Vec
= block_inds.iter().map(|id| id.addr.clone()).collect(); - let anon = || M::meta_field(crate::ix::env::Name::anon()); - let bi_default = || M::meta_field(crate::ix::env::BinderInfo::Default); + let anon = || M::meta_field(ix_common::env::Name::anon()); + let bi_default = || M::meta_field(ix_common::env::BinderInfo::Default); // Collect all binder domains in order: params, motives, minors, indices, major let mut domains: Vec> = Vec::new(); @@ -3209,7 +3207,7 @@ peers={} flat={} rec_ids={} failed_gi={failed_gi}", fn mk_ind_univs(&mut self, ind_lvls: u64, offset: u64) -> Box<[KUniv]> { (0..ind_lvls) .map(|i| { - KUniv::param(i + offset, M::meta_field(crate::ix::env::Name::anon())) + KUniv::param(i + offset, M::meta_field(ix_common::env::Name::anon())) }) .collect::>() .into_iter() @@ -3581,8 +3579,8 @@ re-run with `IX_RECURSOR_DUMP={}` for the full breakdown.", is_large: bool, _univ_offset: u64, ) -> Result, TcError> { - let anon = || M::meta_field(crate::ix::env::Name::anon()); - let bi_default = || M::meta_field(crate::ix::env::BinderInfo::Default); + let anon = || M::meta_field(ix_common::env::Name::anon()); + let bi_default = || M::meta_field(ix_common::env::BinderInfo::Default); let ctor_ty_raw = match self.get_const(ctor_id)? { KConst::Ctor { ty, .. } => ty.clone(), @@ -3849,8 +3847,8 @@ re-run with `IX_RECURSOR_DUMP={}` for the full breakdown.", is_large: bool, dom: &KExpr, ) -> Result, TcError> { - let anon = || M::meta_field(crate::ix::env::Name::anon()); - let bi_default = || M::meta_field(crate::ix::env::BinderInfo::Default); + let anon = || M::meta_field(ix_common::env::Name::anon()); + let bi_default = || M::meta_field(ix_common::env::BinderInfo::Default); let target_n_params = u64_to_usize::(flat[target_bi].own_params)?; @@ -3869,7 +3867,7 @@ re-run with `IX_RECURSOR_DUMP={}` for the full breakdown.", }, }; let rec_lvls: Box<[KUniv]> = (0..peer_rec_lvls) - .map(|i| KUniv::param(i, M::meta_field(crate::ix::env::Name::anon()))) + .map(|i| KUniv::param(i, M::meta_field(ix_common::env::Name::anon()))) .collect(); // Peel foralls from the domain to detect wrapping. @@ -4500,7 +4498,7 @@ mod tests { use super::super::level::KUniv; use super::super::mode::Anon; use super::super::tc::TypeChecker; - use crate::ix::address::Address; + use ix_common::address::Address; type AE = KExpr; type AU = KUniv; diff --git a/src/ix/kernel/infer.rs b/crates/kernel/src/infer.rs similarity index 98% rename from src/ix/kernel/infer.rs rename to crates/kernel/src/infer.rs index 95f0232b..5705cc81 100644 --- a/src/ix/kernel/infer.rs +++ b/crates/kernel/src/infer.rs @@ -229,8 +229,8 @@ impl TypeChecker<'_, M> { abstract_fvars(&mut self.env.intern, &body_ty, &[fv_id]); self.lctx.truncate(saved); self.intern(KExpr::all( - M::meta_field(crate::ix::env::Name::anon()), - M::meta_field(crate::ix::env::BinderInfo::Default), + M::meta_field(ix_common::env::Name::anon()), + M::meta_field(ix_common::env::BinderInfo::Default), ty.clone(), abstracted, )) @@ -316,8 +316,8 @@ impl TypeChecker<'_, M> { self.infer_proj(&struct_id, *field, val, &val_ty)? }, - ExprData::Nat(..) => self.infer_nat_type()?, - ExprData::Str(..) => self.infer_str_type()?, + ExprData::Nat(..) => self.infer_nat_type(), + ExprData::Str(..) => self.infer_str_type(), }; if !infer_only { @@ -477,12 +477,12 @@ impl TypeChecker<'_, M> { } } - fn infer_nat_type(&mut self) -> Result, TcError> { - Ok(self.intern(KExpr::cnst(self.prims.nat.clone(), Box::new([])))) + fn infer_nat_type(&mut self) -> KExpr { + self.intern(KExpr::cnst(self.prims.nat.clone(), Box::new([]))) } - fn infer_str_type(&mut self) -> Result, TcError> { - Ok(self.intern(KExpr::cnst(self.prims.string.clone(), Box::new([])))) + fn infer_str_type(&mut self) -> KExpr { + self.intern(KExpr::cnst(self.prims.string.clone(), Box::new([]))) } fn inductive_app_is_prop( @@ -614,10 +614,10 @@ mod tests { use super::super::level::KUniv; use super::super::mode::Anon; use super::super::tc::TypeChecker; - use crate::ix::address::Address; - use crate::ix::env::{DefinitionSafety, ReducibilityHints}; - use crate::ix::ixon::constant::DefKind; - use lean_ffi::nat::Nat; + use bignat::Nat; + use ix_common::address::Address; + use ix_common::env::{DefinitionSafety, ReducibilityHints}; + use ixon::constant::DefKind; type AE = KExpr; type AU = KUniv; diff --git a/src/ix/kernel/ingress.rs b/crates/kernel/src/ingress.rs similarity index 93% rename from src/ix/kernel/ingress.rs rename to crates/kernel/src/ingress.rs index 21970f6d..b05d7f14 100644 --- a/src/ix/kernel/ingress.rs +++ b/crates/kernel/src/ingress.rs @@ -6,10 +6,12 @@ //! to avoid stack overflow on deeply nested expressions. use std::cell::Cell; +#[cfg(not(target_arch = "riscv64"))] use std::hash::{BuildHasher, Hash}; use std::sync::Arc; use std::time::{Duration, Instant}; +#[cfg(not(target_arch = "riscv64"))] use rayon::iter::{ IntoParallelIterator, IntoParallelRefIterator, ParallelIterator, }; @@ -17,22 +19,27 @@ use rustc_hash::{FxHashMap, FxHashSet}; use dashmap::DashMap; -use crate::ix::address::Address; -use crate::ix::env::{ - BinderInfo, ConstantInfo as LeanCI, DefinitionSafety, Env as LeanEnv, Name, - ReducibilityHints, +use crate::env::Addr; +use bignat::Nat; +use ix_common::address::Address; +#[cfg(not(target_arch = "riscv64"))] +use ix_common::env::ConstantInfo as LeanCI; +#[cfg(not(target_arch = "riscv64"))] +use ix_common::env::DefinitionSafety; +#[cfg(not(target_arch = "riscv64"))] +use ix_common::env::Env as LeanEnv; +use ix_common::env::{BinderInfo, Name, ReducibilityHints}; +#[cfg(not(target_arch = "riscv64"))] +use ixon::constant::DefKind; +use ixon::constant::{ + Constant, ConstantInfo as IxonCI, MutConst as IxonMutConst, }; -use crate::ix::ixon::constant::{ - Constant, ConstantInfo as IxonCI, DefKind, MutConst as IxonMutConst, -}; -use crate::ix::ixon::env::Env as IxonEnv; -use crate::ix::ixon::expr::Expr as IxonExpr; -use crate::ix::ixon::metadata::{ +use ixon::env::Env as IxonEnv; +use ixon::expr::Expr as IxonExpr; +use ixon::metadata::{ ConstantMeta, ConstantMetaInfo, ExprMeta, ExprMetaData, resolve_kvmap, }; -use crate::ix::ixon::univ::Univ as IxonUniv; -use crate::ix::kernel::env::Addr; -use lean_ffi::nat::Nat; +use ixon::univ::Univ as IxonUniv; use super::constant::{KConst, RecRule}; use super::env::{InternTable, KEnv}; @@ -1356,7 +1363,7 @@ fn ingress_expr( #[allow(clippy::too_many_arguments)] fn ingress_defn( - def: &crate::ix::ixon::constant::Definition, + def: &ixon::constant::Definition, self_id: KId, meta: &ConstantMeta, ixon_env: &IxonEnv, @@ -1461,7 +1468,7 @@ fn ingress_defn( #[allow(clippy::too_many_arguments)] fn ingress_recursor( - rec: &crate::ix::ixon::constant::Recursor, + rec: &ixon::constant::Recursor, self_id: KId, meta: &ConstantMeta, ixon_env: &IxonEnv, @@ -1737,7 +1744,7 @@ fn ingress_standalone( #[allow(clippy::too_many_arguments)] fn ingress_muts_inductive( - ind: &crate::ix::ixon::constant::Inductive, + ind: &ixon::constant::Inductive, self_id: &KId, meta: &ConstantMeta, ixon_env: &IxonEnv, @@ -2041,9 +2048,11 @@ fn ingress_muts_block( let resolve_ctor = |cid: &KId| -> Option> { results_ref.iter().find(|(rid, _)| rid == cid).map(|(_, c)| c.clone()) }; - crate::ix::kernel::canonical_check::validate_canonical_block_single_pass::< - M, - >(entry_addr, &indcs, &resolve_ctor) + crate::canonical_check::validate_canonical_block_single_pass::( + entry_addr, + &indcs, + &resolve_ctor, + ) .map_err(|e| format!("{e}"))?; } @@ -2054,7 +2063,7 @@ fn ingress_muts_block( // Lightweight LeanExpr → KExpr ingress (compile-side) // ============================================================================ -use crate::ix::env::{ +use ix_common::env::{ Expr as LeanExpr, ExprData as LeanExprData, Level, LevelData, }; @@ -2439,7 +2448,7 @@ fn lean_expr_to_zexpr_raw( KExpr::prj_mdata(zid, idx.to_u64().unwrap_or(0), e_k, mdata_layers) }, LeanExprData::Lit(lit, _) => { - use crate::ix::env::Literal; + use ix_common::env::Literal; match lit { Literal::NatVal(n) => { // Address must match the Ixon-side blob address for this Nat, @@ -2615,6 +2624,7 @@ pub fn ingress_compiled_names( /// Returns `None` for variants without a mutual block (Axio, Quot, Ctor, Rec). /// Ctors/Recs have their own `induct`/`all` but the block identity comes /// from the inductive, which is what's on the map anyway. +#[cfg(not(target_arch = "riscv64"))] fn lean_constant_all(ci: &LeanCI) -> Option<&Vec> { match ci { LeanCI::DefnInfo(v) => Some(&v.all), @@ -2628,6 +2638,7 @@ fn lean_constant_all(ci: &LeanCI) -> Option<&Vec> { /// Look up position of `name` in its mutual `all` list, returning 0 for /// non-mutuals or constants not found in their own `all`. +#[cfg(not(target_arch = "riscv64"))] fn lean_member_idx(name: &Name, all: Option<&Vec>) -> u64 { all.and_then(|a| a.iter().position(|n| n == name)).map_or(0, |i| i as u64) } @@ -2647,6 +2658,7 @@ fn lean_member_idx(name: &Name, all: Option<&Vec>) -> u64 { /// (dangling refs, partial envs) fall through to `lean_name_to_addr` as a /// best-effort — those cases produce mismatched addresses and will surface /// as `UnknownConst` in the type checker rather than silently succeeding. +#[cfg(not(target_arch = "riscv64"))] pub fn build_leon_addr_map(lean_env: &LeanEnv) -> DashMap { // Build in parallel. Each shard's write lock is contended only when // distinct names happen to hash into the same shard — with 64 default @@ -2675,6 +2687,7 @@ pub fn build_leon_addr_map(lean_env: &LeanEnv) -> DashMap { /// well-formed Lean env should never trigger it. Callers that need /// strict resolution (e.g. "does this name exist?") should check /// `n2a.contains_key` directly. +#[cfg(not(target_arch = "riscv64"))] fn leon_addr_of(name: &Name, n2a: &DashMap) -> Address { n2a.get(name).map_or_else(|| lean_name_to_addr(name), |e| e.value().clone()) } @@ -2682,6 +2695,7 @@ fn leon_addr_of(name: &Name, n2a: &DashMap) -> Address { /// Build the `block` KId for a constant's mutual block. For singletons /// (no `all` or `all` length 1), the block id is the constant's own KId. /// For mutuals, it's the representative (first name in `all`). +#[cfg(not(target_arch = "riscv64"))] fn lean_block_id( self_name: &Name, all: Option<&Vec>, @@ -2692,6 +2706,7 @@ fn lean_block_id( } /// Build the `lean_all` KId list in Meta mode. +#[cfg(not(target_arch = "riscv64"))] fn lean_all_ids(all: &[Name], n2a: &DashMap) -> Vec> { all.iter().map(|n| KId::new(leon_addr_of(n, n2a), n.clone())).collect() } @@ -2700,6 +2715,7 @@ fn lean_all_ids(all: &[Name], n2a: &DashMap) -> Vec> { /// `lean_expr_to_zexpr_with_kenv` with the `n2a` map so inner `Const` /// references resolve to LEON addresses (same scheme used for the KId /// addresses in this constant's own fields). +#[cfg(not(target_arch = "riscv64"))] fn lean_const_to_kconst( self_name: &Name, ci: &LeanCI, @@ -2710,7 +2726,7 @@ fn lean_const_to_kconst( // LEON addressing so `Const` refs inside expressions resolve to the same // addresses we're using for KId keys — any KId we construct here and any // Const-ref we ingress agree on where they point. - let mut expr_to_k = |e: &crate::ix::env::Expr, pn: &[Name]| -> KExpr { + let mut expr_to_k = |e: &ix_common::env::Expr, pn: &[Name]| -> KExpr { lean_expr_to_zexpr_with_kenv(e, pn, kenv, Some(n2a), None) }; @@ -2893,6 +2909,7 @@ fn lean_const_to_kconst( /// **Meta-only**: the existing `lean_expr_to_zexpr_*` family is Meta-mode /// only, so this helper is Meta-mode only by extension. Generalizing to /// `Anon` would require generalizing `lean_expr_to_zexpr_raw` too. +#[cfg(not(target_arch = "riscv64"))] pub fn lean_ingress(lean_env: &LeanEnv) -> KEnv { use std::time::Instant; let quiet = std::env::var("IX_QUIET").is_ok(); @@ -3053,8 +3070,7 @@ pub fn lean_ingress(lean_env: &LeanEnv) -> KEnv { // Returns `Err` only if `prims()` has already been called on this // KEnv — fresh `KEnv::new()` above guarantees that hasn't happened, // so we ignore the Result. - let _ = kenv - .set_prims(crate::ix::kernel::primitive::Primitives::from_env_orig(&kenv)); + let _ = kenv.set_prims(crate::primitive::Primitives::from_env_orig(&kenv)); kenv } @@ -3414,6 +3430,7 @@ fn timed_drop_ns(value: T) -> u64 { /// (atomic refcount; the last decrementer destroys exactly once), and none /// of the value types have custom `Drop` impls — so this is a pure /// parallelisation of the existing teardown. +#[cfg(not(target_arch = "riscv64"))] fn timed_drop_dashmap_par(map: DashMap) -> u64 where K: Eq + Hash + Send, @@ -3431,6 +3448,7 @@ where /// a `Vec<(K, V)>` first (a cheap O(n) sequential pass that just moves owned /// pairs) and then `into_par_iter().for_each(drop)` on the Vec, letting /// rayon distribute the actual destructor work. +#[cfg(not(target_arch = "riscv64"))] fn timed_drop_fxmap_par(map: FxHashMap) -> u64 { let start = Instant::now(); let entries: Vec<(K, V)> = map.into_iter().collect(); @@ -3440,14 +3458,30 @@ fn timed_drop_fxmap_par(map: FxHashMap) -> u64 { /// Opt-out for the parallel drop path: set `IX_SEQ_IXON_DROP=1` to fall back /// to single-threaded `drop` for measurement comparisons. +#[cfg(not(target_arch = "riscv64"))] fn seq_ixon_drop_enabled() -> bool { std::env::var_os("IX_SEQ_IXON_DROP").is_some() } +#[cfg(not(target_arch = "riscv64"))] fn ingress_convert_stats_enabled() -> bool { std::env::var_os("IX_INGRESS_CONVERT_STATS").is_some() } +#[cfg(target_arch = "riscv64")] +fn ingress_convert_stats_enabled() -> bool { + false +} +#[cfg(target_arch = "riscv64")] +fn drop_ingress_lookups( + _names: FxHashMap, + _name_to_addr: FxHashMap, + _quiet: bool, +) { + // Auto-dropped at end of scope. +} + +#[cfg(not(target_arch = "riscv64"))] fn drop_ingress_lookups( names: FxHashMap, name_to_addr: FxHashMap, @@ -3456,7 +3490,10 @@ fn drop_ingress_lookups( let total_start = Instant::now(); let names_len = names.len(); let name_to_addr_len = name_to_addr.len(); + #[cfg(not(target_arch = "riscv64"))] let sequential = seq_ixon_drop_enabled(); + #[cfg(target_arch = "riscv64")] + let sequential = true; // Drop the two lookup tables in series; each one fully utilises the rayon // pool internally via `timed_drop_fxmap_par`. Running them in parallel via @@ -3468,20 +3505,29 @@ fn drop_ingress_lookups( name_to_addr_ns: timed_drop_ns(name_to_addr), } } else { - LookupDropTiming { - names_ns: timed_drop_fxmap_par(names), - name_to_addr_ns: timed_drop_fxmap_par(name_to_addr), + #[cfg(not(target_arch = "riscv64"))] + { + LookupDropTiming { + names_ns: timed_drop_fxmap_par(names), + name_to_addr_ns: timed_drop_fxmap_par(name_to_addr), + } } + #[cfg(target_arch = "riscv64")] + unreachable!() }; let total_ns = elapsed_ns(total_start); if !quiet { + #[cfg(not(target_arch = "riscv64"))] + let threads = rayon::current_num_threads(); + #[cfg(target_arch = "riscv64")] + let threads = 1; eprintln!( "[ixon_ingress] drop lookups: {:.2}s {} threads={} \ (names {:.2}s/{} name_to_addr {:.2}s/{})", seconds(total_ns), if sequential { "sequential" } else { "parallel" }, - rayon::current_num_threads(), + threads, seconds(timing.names_ns), names_len, seconds(timing.name_to_addr_ns), @@ -3496,17 +3542,25 @@ fn insert_standalone_entries( ) -> IngressInsertTiming { let mut timing = IngressInsertTiming::default(); + #[cfg(not(target_arch = "riscv64"))] let phase_start = Instant::now(); for (id, _) in &entries { zenv.blocks.entry(id.clone()).or_default().push(id.clone()); } - timing.blocks_ns = elapsed_ns(phase_start); + #[cfg(not(target_arch = "riscv64"))] + { + timing.blocks_ns = elapsed_ns(phase_start); + } + #[cfg(not(target_arch = "riscv64"))] let phase_start = Instant::now(); for (id, zc) in entries { zenv.insert(id, zc); } - timing.consts_ns = elapsed_ns(phase_start); + #[cfg(not(target_arch = "riscv64"))] + { + timing.consts_ns = elapsed_ns(phase_start); + } timing } @@ -3517,6 +3571,7 @@ fn insert_muts_entries( ) -> IngressInsertTiming { let mut timing = IngressInsertTiming::default(); + #[cfg(not(target_arch = "riscv64"))] let phase_start = Instant::now(); let block_id = entries.first().and_then(|(_, zc)| match zc { KConst::Defn { block, .. } @@ -3529,13 +3584,20 @@ fn insert_muts_entries( if let Some(bid) = block_id { zenv.blocks.insert(bid, member_ids); } - timing.blocks_ns = elapsed_ns(phase_start); + #[cfg(not(target_arch = "riscv64"))] + { + timing.blocks_ns = elapsed_ns(phase_start); + } + #[cfg(not(target_arch = "riscv64"))] let phase_start = Instant::now(); for (id, zc) in entries { zenv.insert(id, zc); } - timing.consts_ns = elapsed_ns(phase_start); + #[cfg(not(target_arch = "riscv64"))] + { + timing.consts_ns = elapsed_ns(phase_start); + } timing } @@ -3561,6 +3623,12 @@ pub fn ixon_ingress_owned( result } +#[cfg(target_arch = "riscv64")] +fn drop_ixon_env(_ixon_env: IxonEnv, _quiet: bool) { + // Auto-dropped at end of scope. +} + +#[cfg(not(target_arch = "riscv64"))] fn drop_ixon_env(ixon_env: IxonEnv, quiet: bool) { let total_start = Instant::now(); let IxonEnv { consts, named, blobs, names, comms } = ixon_env; @@ -3576,7 +3644,10 @@ fn drop_ixon_env(ixon_env: IxonEnv, quiet: bool) { // which is single-threaded internally and dominates the total. Doing one // map at a time, fully parallel within, gives clean per-map timing and // saturates the rayon pool on the work that actually matters. + #[cfg(not(target_arch = "riscv64"))] let sequential = seq_ixon_drop_enabled(); + #[cfg(target_arch = "riscv64")] + let sequential = true; let timing = if sequential { IxonDropTiming { consts_ns: timed_drop_ns(consts), @@ -3586,23 +3657,32 @@ fn drop_ixon_env(ixon_env: IxonEnv, quiet: bool) { comms_ns: timed_drop_ns(comms), } } else { - IxonDropTiming { - consts_ns: timed_drop_dashmap_par(consts), - named_ns: timed_drop_dashmap_par(named), - names_ns: timed_drop_dashmap_par(names), - blobs_ns: timed_drop_dashmap_par(blobs), - comms_ns: timed_drop_dashmap_par(comms), + #[cfg(not(target_arch = "riscv64"))] + { + IxonDropTiming { + consts_ns: timed_drop_dashmap_par(consts), + named_ns: timed_drop_dashmap_par(named), + names_ns: timed_drop_dashmap_par(names), + blobs_ns: timed_drop_dashmap_par(blobs), + comms_ns: timed_drop_dashmap_par(comms), + } } + #[cfg(target_arch = "riscv64")] + unreachable!() }; let total_ns = elapsed_ns(total_start); if !quiet { + #[cfg(not(target_arch = "riscv64"))] + let threads = rayon::current_num_threads(); + #[cfg(target_arch = "riscv64")] + let threads = 1; eprintln!( "[ixon_ingress] drop ixon_env: {:.2}s {} threads={} \ (consts {:.2}s/{} named {:.2}s/{} names {:.2}s/{} blobs {:.2}s/{} comms {:.2}s/{})", seconds(total_ns), if sequential { "sequential" } else { "parallel" }, - rayon::current_num_threads(), + threads, seconds(timing.consts_ns), consts_len, seconds(timing.named_ns), @@ -3620,22 +3700,23 @@ fn drop_ixon_env(ixon_env: IxonEnv, quiet: bool) { fn ixon_ingress_inner( ixon_env: &IxonEnv, ) -> Result<(KEnv, InternTable), String> { - let quiet = std::env::var_os("IX_QUIET").is_some(); + #[cfg(not(target_arch = "riscv64"))] let total_start = Instant::now(); + #[cfg(not(target_arch = "riscv64"))] let phase_start = Instant::now(); validate_no_reserved_marker_addresses(ixon_env)?; - if !quiet { - eprintln!( - "[ixon_ingress] validate_reserved: {:.2}s", - phase_start.elapsed().as_secs_f32() - ); - } + #[cfg(not(target_arch = "riscv64"))] + log::info!( + "[ixon_ingress] validate_reserved: {:.2}s", + phase_start.elapsed().as_secs_f32() + ); let mut intern = InternTable::new(); // Build the address → Lean-name lookup and the Lean-name → projection- // address lookup. See `build_ingress_lookups` for the role each plays. + #[cfg(not(target_arch = "riscv64"))] let phase_start = Instant::now(); let mut names: FxHashMap = FxHashMap::default(); for entry in ixon_env.names.iter() { @@ -3645,18 +3726,18 @@ fn ixon_ingress_inner( for entry in ixon_env.named.iter() { name_to_addr.insert(entry.key().clone(), entry.value().addr.clone()); } - if !quiet { - eprintln!( - "[ixon_ingress] build lookups: {:.2}s ({} names, {} named)", - phase_start.elapsed().as_secs_f32(), - names.len(), - name_to_addr.len() - ); - } + #[cfg(not(target_arch = "riscv64"))] + log::info!( + "[ixon_ingress] build lookups: {:.2}s ({} names, {} named)", + phase_start.elapsed().as_secs_f32(), + names.len(), + name_to_addr.len() + ); // Partition named entries into work items without cloning the `Named` // metadata payloads. Each worker resolves its current Named entry just // before conversion. + #[cfg(not(target_arch = "riscv64"))] let phase_start = Instant::now(); let mut work_items: Vec = Vec::new(); let mut standalone_count = 0usize; @@ -3703,17 +3784,17 @@ fn ixon_ingress_inner( }, } } - if !quiet { - eprintln!( - "[ixon_ingress] partition work: {:.2}s ({} standalone, {} muts)", - phase_start.elapsed().as_secs_f32(), - standalone_count, - muts_count - ); - } + #[cfg(not(target_arch = "riscv64"))] + log::info!( + "[ixon_ingress] partition work: {:.2}s ({} standalone, {} muts)", + phase_start.elapsed().as_secs_f32(), + standalone_count, + muts_count + ); // Convert each standalone constant or Muts block sequentially into the // single-threaded KEnv. + #[cfg(not(target_arch = "riscv64"))] let phase_start = Instant::now(); let convert_stats_enabled = ingress_convert_stats_enabled(); let mut zenv: KEnv = KEnv::new(); @@ -3724,26 +3805,38 @@ fn ixon_ingress_inner( match work_item { IngressWorkItem::Standalone(const_name) => { timing.standalone_items += 1; + #[cfg(not(target_arch = "riscv64"))] let lookup_start = Instant::now(); let named = ixon_env .lookup_name(&const_name) .ok_or_else(|| format!("{const_name}: missing Named entry"))?; - timing.lookup_ns += elapsed_ns(lookup_start); + #[cfg(not(target_arch = "riscv64"))] + { + timing.lookup_ns += elapsed_ns(lookup_start); + } + #[cfg(not(target_arch = "riscv64"))] let const_start = Instant::now(); let constant = match ixon_env.get_const(&named.addr) { Some(c) => { - timing.const_get_ns += elapsed_ns(const_start); + #[cfg(not(target_arch = "riscv64"))] + { + timing.const_get_ns += elapsed_ns(const_start); + } c }, None => { - timing.const_get_ns += elapsed_ns(const_start); + #[cfg(not(target_arch = "riscv64"))] + { + timing.const_get_ns += elapsed_ns(const_start); + } timing.missing_consts += 1; timing.convert_stats = convert_stats; stream = stream.merge(&timing); continue; }, }; + #[cfg(not(target_arch = "riscv64"))] let convert_start = Instant::now(); let entries = ingress_standalone( &const_name, @@ -3757,22 +3850,33 @@ fn ixon_ingress_inner( &mut convert_stats, ) .map_err(|e| format!("{const_name}: {e}"))?; - timing.convert_ns += elapsed_ns(convert_start); + #[cfg(not(target_arch = "riscv64"))] + { + timing.convert_ns += elapsed_ns(convert_start); + } timing.output_consts += entries.len() as u64; + #[cfg(not(target_arch = "riscv64"))] let insert_start = Instant::now(); let insert_timing = insert_standalone_entries(&mut zenv, entries); - timing.insert_ns += elapsed_ns(insert_start); + #[cfg(not(target_arch = "riscv64"))] + { + timing.insert_ns += elapsed_ns(insert_start); + } timing.insert_blocks_ns += insert_timing.blocks_ns; timing.insert_consts_ns += insert_timing.consts_ns; }, IngressWorkItem::Muts(entry_name) => { timing.muts_items += 1; + #[cfg(not(target_arch = "riscv64"))] let lookup_start = Instant::now(); let named = ixon_env .lookup_name(&entry_name) .ok_or_else(|| format!("{entry_name}: missing Named entry"))?; - timing.lookup_ns += elapsed_ns(lookup_start); + #[cfg(not(target_arch = "riscv64"))] + { + timing.lookup_ns += elapsed_ns(lookup_start); + } let all = match &named.meta.info { ConstantMetaInfo::Muts { all, .. } => all, @@ -3782,6 +3886,7 @@ fn ixon_ingress_inner( continue; }, }; + #[cfg(not(target_arch = "riscv64"))] let convert_start = Instant::now(); let entries = ingress_muts_block( &entry_name, @@ -3794,12 +3899,19 @@ fn ixon_ingress_inner( &mut convert_stats, ) .map_err(|e| format!("{entry_name}: {e}"))?; - timing.convert_ns += elapsed_ns(convert_start); + #[cfg(not(target_arch = "riscv64"))] + { + timing.convert_ns += elapsed_ns(convert_start); + } timing.output_consts += entries.len() as u64; + #[cfg(not(target_arch = "riscv64"))] let insert_start = Instant::now(); let insert_timing = insert_muts_entries(&mut zenv, entries); - timing.insert_ns += elapsed_ns(insert_start); + #[cfg(not(target_arch = "riscv64"))] + { + timing.insert_ns += elapsed_ns(insert_start); + } timing.insert_blocks_ns += insert_timing.blocks_ns; timing.insert_consts_ns += insert_timing.consts_ns; }, @@ -3807,107 +3919,110 @@ fn ixon_ingress_inner( timing.convert_stats = convert_stats; stream = stream.merge(&timing); } - if !quiet { - eprintln!( - "[ixon_ingress] stream ingress+insert: {:.2}s", - phase_start.elapsed().as_secs_f32() + #[cfg(not(target_arch = "riscv64"))] + log::info!( + "[ixon_ingress] stream ingress+insert: {:.2}s", + phase_start.elapsed().as_secs_f32() + ); + #[cfg(not(target_arch = "riscv64"))] + log::info!( + "[ixon_ingress] stream detail (worker-sum): lookup {:.2}s, const_get {:.2}s, convert {:.2}s, insert {:.2}s (blocks {:.2}s, consts {:.2}s), work {} standalone/{} muts, output {} consts, missing {}", + seconds(stream.lookup_ns), + seconds(stream.const_get_ns), + seconds(stream.convert_ns), + seconds(stream.insert_ns), + seconds(stream.insert_blocks_ns), + seconds(stream.insert_consts_ns), + stream.standalone_items, + stream.muts_items, + stream.output_consts, + stream.missing_consts + ); + #[cfg(not(target_arch = "riscv64"))] + let cs = &stream.convert_stats; + #[cfg(not(target_arch = "riscv64"))] + if cs.enabled { + let cache_lookups = cs.expr_cache_hits + cs.expr_cache_misses; + log::info!( + "[ixon_ingress] convert cache: roots {} process {} hits {} misses {} hit {:.1}% inserts {} peak {} clears {} cleared {} shares {}", + cs.expr_roots, + cs.expr_process, + cs.expr_cache_hits, + cs.expr_cache_misses, + percent(cs.expr_cache_hits, cache_lookups), + cs.expr_cache_inserts, + cs.expr_cache_peak, + cs.expr_cache_clears, + cs.expr_cache_entries_cleared, + cs.share_expansions ); - eprintln!( - "[ixon_ingress] stream detail (worker-sum): lookup {:.2}s, const_get {:.2}s, convert {:.2}s, insert {:.2}s (blocks {:.2}s, consts {:.2}s), work {} standalone/{} muts, output {} consts, missing {}", - seconds(stream.lookup_ns), - seconds(stream.const_get_ns), - seconds(stream.convert_ns), - seconds(stream.insert_ns), - seconds(stream.insert_blocks_ns), - seconds(stream.insert_consts_ns), - stream.standalone_items, - stream.muts_items, - stream.output_consts, - stream.missing_consts + log::info!( + "[ixon_ingress] convert nodes: sort {} var {} ref {} rec {} app {} lam {} all {} let {} prj {} str {} nat {} callsites {} args {}", + cs.sort_nodes, + cs.var_nodes, + cs.ref_nodes, + cs.rec_nodes, + cs.app_nodes, + cs.lam_nodes, + cs.all_nodes, + cs.let_nodes, + cs.prj_nodes, + cs.str_nodes, + cs.nat_nodes, + cs.callsites, + cs.callsite_args ); - let cs = &stream.convert_stats; - if cs.enabled { - let cache_lookups = cs.expr_cache_hits + cs.expr_cache_misses; - eprintln!( - "[ixon_ingress] convert cache: roots {} process {} hits {} misses {} hit {:.1}% inserts {} peak {} clears {} cleared {} shares {}", - cs.expr_roots, - cs.expr_process, - cs.expr_cache_hits, - cs.expr_cache_misses, - percent(cs.expr_cache_hits, cache_lookups), - cs.expr_cache_inserts, - cs.expr_cache_peak, - cs.expr_cache_clears, - cs.expr_cache_entries_cleared, - cs.share_expansions - ); - eprintln!( - "[ixon_ingress] convert nodes: sort {} var {} ref {} rec {} app {} lam {} all {} let {} prj {} str {} nat {} callsites {} args {}", - cs.sort_nodes, - cs.var_nodes, - cs.ref_nodes, - cs.rec_nodes, - cs.app_nodes, - cs.lam_nodes, - cs.all_nodes, - cs.let_nodes, - cs.prj_nodes, - cs.str_nodes, - cs.nat_nodes, - cs.callsites, - cs.callsite_args - ); - eprintln!( - "[ixon_ingress] convert metadata/univ: mdata_nodes {} mdata_kv_maps {} univ_roots {} univ_cache_hits {} univ_cache_misses {} univ_hit {:.1}% univ_cache_peak {} univ_process {} univ_interns {}", - cs.mdata_nodes, - cs.mdata_kv_maps, - cs.univ_roots, - cs.univ_cache_hits, - cs.univ_cache_misses, - percent(cs.univ_cache_hits, cs.univ_cache_hits + cs.univ_cache_misses), - cs.univ_cache_peak, - cs.univ_process, - cs.univ_interns - ); - let ie_lookups = cs.intern_expr_calls; - let iu_lookups = cs.intern_univ_calls; - eprintln!( - "[ixon_ingress] convert timing (worker-sum): \ - resolve_kvmap {:.2}s/{} arena_walk {:.2}s \ - intern_expr {:.2}s/{} (get_hits {:.1}%) \ - intern_univ {:.2}s/{} (get_hits {:.1}%) \ - expr_cache lookup {:.2}s / insert {:.2}s \ - get_blob {:.2}s/{} \ - kexpr_construct {:.2}s/{} \ - process_arm {:.2}s continuation_arms {:.2}s", - seconds(cs.resolve_kvmap_ns), - cs.resolve_kvmap_calls, - seconds(cs.arena_walk_ns), - seconds(cs.intern_expr_ns), - cs.intern_expr_calls, - percent(cs.intern_expr_get_hits, ie_lookups), - seconds(cs.intern_univ_ns), - cs.intern_univ_calls, - percent(cs.intern_univ_get_hits, iu_lookups), - seconds(cs.expr_cache_lookup_ns), - seconds(cs.expr_cache_insert_ns), - seconds(cs.get_blob_ns), - cs.get_blob_calls, - seconds(cs.kexpr_construct_ns), - cs.kexpr_construct_calls, - seconds(cs.process_arm_ns), - seconds(cs.continuation_arms_ns) - ); - } - eprintln!( - "[ixon_ingress] complete: {:.2}s ({} consts, {} blocks)", - total_start.elapsed().as_secs_f32(), - zenv.len(), - zenv.blocks.len() + log::info!( + "[ixon_ingress] convert metadata/univ: mdata_nodes {} mdata_kv_maps {} univ_roots {} univ_cache_hits {} univ_cache_misses {} univ_hit {:.1}% univ_cache_peak {} univ_process {} univ_interns {}", + cs.mdata_nodes, + cs.mdata_kv_maps, + cs.univ_roots, + cs.univ_cache_hits, + cs.univ_cache_misses, + percent(cs.univ_cache_hits, cs.univ_cache_hits + cs.univ_cache_misses), + cs.univ_cache_peak, + cs.univ_process, + cs.univ_interns + ); + let ie_lookups = cs.intern_expr_calls; + let iu_lookups = cs.intern_univ_calls; + log::info!( + "[ixon_ingress] convert timing (worker-sum): \ + resolve_kvmap {:.2}s/{} arena_walk {:.2}s \ + intern_expr {:.2}s/{} (get_hits {:.1}%) \ + intern_univ {:.2}s/{} (get_hits {:.1}%) \ + expr_cache lookup {:.2}s / insert {:.2}s \ + get_blob {:.2}s/{} \ + kexpr_construct {:.2}s/{} \ + process_arm {:.2}s continuation_arms {:.2}s", + seconds(cs.resolve_kvmap_ns), + cs.resolve_kvmap_calls, + seconds(cs.arena_walk_ns), + seconds(cs.intern_expr_ns), + cs.intern_expr_calls, + percent(cs.intern_expr_get_hits, ie_lookups), + seconds(cs.intern_univ_ns), + cs.intern_univ_calls, + percent(cs.intern_univ_get_hits, iu_lookups), + seconds(cs.expr_cache_lookup_ns), + seconds(cs.expr_cache_insert_ns), + seconds(cs.get_blob_ns), + cs.get_blob_calls, + seconds(cs.kexpr_construct_ns), + cs.kexpr_construct_calls, + seconds(cs.process_arm_ns), + seconds(cs.continuation_arms_ns) ); } + #[cfg(not(target_arch = "riscv64"))] + log::info!( + "[ixon_ingress] complete: {:.2}s ({} consts, {} blocks)", + total_start.elapsed().as_secs_f32(), + zenv.len(), + zenv.blocks.len() + ); - drop_ingress_lookups(names, name_to_addr, quiet); + drop_ingress_lookups(names, name_to_addr, false); Ok((zenv, intern)) } @@ -3949,10 +4064,10 @@ fn validate_no_reserved_marker_addresses( #[cfg(test)] mod tests { use super::*; - use crate::ix::env::{self, BinderInfo}; - use crate::ix::ixon::metadata::CallSiteEntry; - use crate::ix::kernel::expr::ExprData; - use crate::ix::kernel::level::UnivData; + use crate::expr::ExprData; + use crate::level::UnivData; + use ix_common::env::{self, BinderInfo}; + use ixon::metadata::CallSiteEntry; fn mk_name(s: &str) -> Name { let mut n = Name::anon(); @@ -4107,10 +4222,10 @@ mod tests { #[test] fn ixon_ingress_rejects_reserved_marker_named_addr() { let env = IxonEnv::new(); - let marker = crate::ix::kernel::primitive::PrimAddrs::new().eager_reduce; + let marker = crate::primitive::PrimAddrs::new().eager_reduce; env.register_name( mk_name("Evil.marker"), - crate::ix::ixon::env::Named::with_addr(marker), + ixon::env::Named::with_addr(marker), ); let err = match ixon_ingress::(&env) { @@ -4124,15 +4239,13 @@ mod tests { #[test] fn ixon_ingress_rejects_reserved_marker_refs() { let env = IxonEnv::new(); - let marker = crate::ix::kernel::primitive::PrimAddrs::new().eager_reduce; + let marker = crate::primitive::PrimAddrs::new().eager_reduce; let constant = Constant::with_tables( - crate::ix::ixon::constant::ConstantInfo::Axio( - crate::ix::ixon::constant::Axiom { - is_unsafe: false, - lvls: 0, - typ: IxonExpr::sort(0), - }, - ), + ixon::constant::ConstantInfo::Axio(ixon::constant::Axiom { + is_unsafe: false, + lvls: 0, + typ: IxonExpr::sort(0), + }), vec![], vec![marker], vec![], @@ -4523,7 +4636,7 @@ mod tests { let list_addr = Address::hash(b"arbitrary"); ie.named.insert( list_name.clone(), - crate::ix::ixon::env::Named::with_addr(list_addr.clone()), + ixon::env::Named::with_addr(list_addr.clone()), ); let (name_map, addr_map) = build_ingress_lookups(&ie); diff --git a/src/ix/kernel/lctx.rs b/crates/kernel/src/lctx.rs similarity index 98% rename from src/ix/kernel/lctx.rs rename to crates/kernel/src/lctx.rs index 32c13347..d522e714 100644 --- a/src/ix/kernel/lctx.rs +++ b/crates/kernel/src/lctx.rs @@ -20,7 +20,7 @@ use rustc_hash::FxHashMap; -use crate::ix::env::{BinderInfo, Name}; +use ix_common::env::{BinderInfo, Name}; use super::env::InternTable; use super::expr::{ExprData, FVarId, KExpr}; @@ -254,8 +254,8 @@ pub fn is_fvar(e: &KExpr) -> bool { #[cfg(test)] mod tests { use super::*; - use crate::ix::kernel::level::KUniv; - use crate::ix::kernel::mode::Anon; + use crate::level::KUniv; + use crate::mode::Anon; type AE = KExpr; type AU = KUniv; diff --git a/src/ix/kernel/level.rs b/crates/kernel/src/level.rs similarity index 99% rename from src/ix/kernel/level.rs rename to crates/kernel/src/level.rs index 58d2b25d..0ff6df8c 100644 --- a/src/ix/kernel/level.rs +++ b/crates/kernel/src/level.rs @@ -37,7 +37,7 @@ use std::collections::BTreeMap; use std::fmt; use std::sync::Arc; -use crate::ix::env::{Name, UIMAX, UMAX, UPARAM, USUCC, UZERO}; +use ix_common::env::{Name, UIMAX, UMAX, UPARAM, USUCC, UZERO}; use super::env::Addr; use super::mode::{KernelMode, MetaDisplay}; @@ -708,7 +708,7 @@ pub fn univ_geq(u: &KUniv, v: &KUniv) -> bool { mod tests { use super::super::mode::{Anon, Meta}; use super::*; - use crate::ix::env::Name; + use ix_common::env::Name; type MU = KUniv; type AU = KUniv; diff --git a/src/ix/kernel.rs b/crates/kernel/src/lib.rs similarity index 96% rename from src/ix/kernel.rs rename to crates/kernel/src/lib.rs index 17f51d75..22d5ae3a 100644 --- a/src/ix/kernel.rs +++ b/crates/kernel/src/lib.rs @@ -3,7 +3,6 @@ pub mod check; pub mod congruence; pub mod constant; pub mod def_eq; -pub mod egress; pub mod env; pub mod equiv; pub mod error; diff --git a/src/ix/kernel/mode.rs b/crates/kernel/src/mode.rs similarity index 98% rename from src/ix/kernel/mode.rs rename to crates/kernel/src/mode.rs index e721cc22..22a6e8d5 100644 --- a/src/ix/kernel/mode.rs +++ b/crates/kernel/src/mode.rs @@ -13,7 +13,7 @@ use std::fmt::{self, Debug}; use std::hash::Hash; -use crate::ix::env::{BinderInfo, DataValue, Name, NameData}; +use ix_common::env::{BinderInfo, DataValue, Name, NameData}; /// Serialize a metadata value into a `blake3::Hasher`. /// The `()` impl is a no-op, so erased metadata contributes nothing. @@ -44,7 +44,7 @@ impl MetaHash for BinderInfo { impl MetaHash for DataValue { fn meta_hash(&self, hasher: &mut blake3::Hasher) { - crate::ix::env::hash_data_value(self, hasher); + ix_common::env::hash_data_value(self, hasher); } } diff --git a/src/ix/kernel/perf.rs b/crates/kernel/src/perf.rs similarity index 100% rename from src/ix/kernel/perf.rs rename to crates/kernel/src/perf.rs diff --git a/src/ix/kernel/primitive.rs b/crates/kernel/src/primitive.rs similarity index 98% rename from src/ix/kernel/primitive.rs rename to crates/kernel/src/primitive.rs index 5ad99bc5..d3c68b8a 100644 --- a/src/ix/kernel/primitive.rs +++ b/crates/kernel/src/primitive.rs @@ -15,7 +15,7 @@ use std::sync::LazyLock; -use crate::ix::address::Address; +use ix_common::address::Address; use super::env::KEnv; use super::id::KId; @@ -895,7 +895,7 @@ impl Primitives { /// `@` fallbacks. pub fn from_addr_names(mut name_for_addr: F) -> Self where - F: FnMut(&Address) -> Option, + F: FnMut(&Address) -> Option, { Self::from_addrs_with(&PrimAddrs::new(), |addr| { name_for_addr(addr) @@ -925,16 +925,16 @@ impl Primitives { let mut r = |addr: &Address| -> KId { resolve(addr).unwrap_or_else(|| { let hex = addr.hex(); - let name = crate::ix::env::Name::str( - crate::ix::env::Name::anon(), + let name = ix_common::env::Name::str( + ix_common::env::Name::anon(), format!("@{}", &hex[..8]), ); KId::new(addr.clone(), M::meta_field(name)) }) }; let marker = |addr: &Address, marker_name: &str| -> KId { - let name = crate::ix::env::Name::str( - crate::ix::env::Name::anon(), + let name = ix_common::env::Name::str( + ix_common::env::Name::anon(), format!("@{marker_name}"), ); KId::new(addr.clone(), M::meta_field(name)) @@ -1047,12 +1047,12 @@ mod tests { use std::collections::HashMap; use super::*; - use crate::ix::env::Name; - use crate::ix::kernel::constant::KConst; - use crate::ix::kernel::expr::KExpr; - use crate::ix::kernel::id::KId; - use crate::ix::kernel::level::KUniv; - use crate::ix::kernel::mode::Anon; + use crate::constant::KConst; + use crate::expr::KExpr; + use crate::id::KId; + use crate::level::KUniv; + use crate::mode::Anon; + use ix_common::env::Name; /// Collect every (field_name, addr) pair from `PrimAddrs` via reflection /// over a macro invocation at the caller — done here by an inline array. @@ -1249,7 +1249,7 @@ mod tests { // With an empty env, every `r(&a.*)` lookup misses and produces a // synthetic `@` KId. Confirm construction succeeds and // yields recognizable synthetic names (in Meta mode). - let env = KEnv::::new(); + let env = KEnv::::new(); let p = Primitives::from_env(&env); // The fallback name is `@`, a string part under an // anonymous Name. Verify the `nat` field lives at the expected @@ -1287,7 +1287,7 @@ mod tests { #[test] fn primitives_from_env_orig_uses_orig_addrs() { // from_env_orig uses PrimAddrs::new_orig (LEON addrs), not new(). - let env = KEnv::::new(); + let env = KEnv::::new(); let p = Primitives::from_env_orig(&env); let orig = PrimAddrs::new_orig(); let canon = PrimAddrs::new(); @@ -1302,7 +1302,7 @@ mod tests { // Check that the synthetic fallback name has the `@<8hex>` shape for // an address that doesn't exist in the env. Uses Meta mode so the // name metadata is observable. - let env = KEnv::::new(); + let env = KEnv::::new(); let p = Primitives::from_env_orig(&env); // Name of `p.nat` should be `@`. let orig = PrimAddrs::new_orig(); diff --git a/src/ix/kernel/subst.rs b/crates/kernel/src/subst.rs similarity index 99% rename from src/ix/kernel/subst.rs rename to crates/kernel/src/subst.rs index 04a7dbaf..d31c613c 100644 --- a/src/ix/kernel/subst.rs +++ b/crates/kernel/src/subst.rs @@ -281,7 +281,7 @@ fn simul_subst_cached( cache.insert(key, r.clone()); return r; } else if i >= depth + n { - KExpr::var(i - n, M::meta_field(crate::ix::env::Name::anon())) + KExpr::var(i - n, M::meta_field(ix_common::env::Name::anon())) } else { let r = body.clone(); cache.insert(key, r.clone()); @@ -661,7 +661,7 @@ fn instantiate_rev_cached( return r; } else if i >= depth + n { // Free variable above the instantiated range: shift down by `n`. - KExpr::var(i - n, M::meta_field(crate::ix::env::Name::anon())) + KExpr::var(i - n, M::meta_field(ix_common::env::Name::anon())) } else { // i < depth: bound by an inner binder we walked under; unchanged. let r = body.clone(); @@ -780,7 +780,7 @@ fn abstract_fvars_cached( // pass through unchanged (they belong to outer abstractions). if let Some(&p) = pos.get(id) { let new_var = - KExpr::var(depth + p, M::meta_field(crate::ix::env::Name::anon())); + KExpr::var(depth + p, M::meta_field(ix_common::env::Name::anon())); let interned = env.intern_expr(new_var); cache.insert(key, interned.clone()); return interned; @@ -874,11 +874,11 @@ impl ExprData { #[cfg(test)] mod tests { use super::*; - use crate::ix::address::Address; - use crate::ix::kernel::id::KId; - use crate::ix::kernel::level::KUniv; - use crate::ix::kernel::mode::Anon; - use lean_ffi::nat::Nat; + use crate::id::KId; + use crate::level::KUniv; + use crate::mode::Anon; + use bignat::Nat; + use ix_common::address::Address; type AE = KExpr; diff --git a/src/ix/kernel/tc.rs b/crates/kernel/src/tc.rs similarity index 98% rename from src/ix/kernel/tc.rs rename to crates/kernel/src/tc.rs index 4acda9bd..2bf91e82 100644 --- a/src/ix/kernel/tc.rs +++ b/crates/kernel/src/tc.rs @@ -11,8 +11,8 @@ use std::sync::LazyLock; use rustc_hash::FxHashMap; use rustc_hash::FxHashSet; -use crate::ix::address::Address; -use crate::ix::ixon::env::Env as IxonEnv; +use ix_common::address::Address; +use ixon::env::Env as IxonEnv; use super::constant::{KConst, RecRule}; use super::env::{Addr, KEnv}; @@ -488,8 +488,8 @@ impl<'a, M: KernelMode> TypeChecker<'a, M> { /// the binder scope. pub fn open_binder( &mut self, - name: M::MField, - bi: M::MField, + name: M::MField, + bi: M::MField, ty: KExpr, body: &KExpr, ) -> (KExpr, FVarId) { @@ -509,8 +509,8 @@ impl<'a, M: KernelMode> TypeChecker<'a, M> { ty: KExpr, body: &KExpr, ) -> (KExpr, FVarId) { - let name = M::meta_field(crate::ix::env::Name::anon()); - let bi = M::meta_field(crate::ix::env::BinderInfo::Default); + let name = M::meta_field(ix_common::env::Name::anon()); + let bi = M::meta_field(ix_common::env::BinderInfo::Default); self.open_binder(name, bi, ty, body) } @@ -519,8 +519,8 @@ impl<'a, M: KernelMode> TypeChecker<'a, M> { /// abstract_fvars / structural identity comparisons). pub fn open_binder_with_fv( &mut self, - name: M::MField, - bi: M::MField, + name: M::MField, + bi: M::MField, ty: KExpr, body: &KExpr, ) -> (KExpr, KExpr, FVarId) { @@ -538,8 +538,8 @@ impl<'a, M: KernelMode> TypeChecker<'a, M> { ty: KExpr, body: &KExpr, ) -> (KExpr, KExpr, FVarId) { - let name = M::meta_field(crate::ix::env::Name::anon()); - let bi = M::meta_field(crate::ix::env::BinderInfo::Default); + let name = M::meta_field(ix_common::env::Name::anon()); + let bi = M::meta_field(ix_common::env::BinderInfo::Default); self.open_binder_with_fv(name, bi, ty, body) } @@ -549,7 +549,7 @@ impl<'a, M: KernelMode> TypeChecker<'a, M> { /// for downstream WHNF zeta-reduction). pub fn open_let( &mut self, - name: M::MField, + name: M::MField, ty: KExpr, val: KExpr, body: &KExpr, @@ -567,8 +567,8 @@ impl<'a, M: KernelMode> TypeChecker<'a, M> { /// later or in parallel). Returns the fvar id and the interned fvar /// expression. pub fn push_fvar_decl_anon(&mut self, ty: KExpr) -> (FVarId, KExpr) { - let name = M::meta_field(crate::ix::env::Name::anon()); - let bi = M::meta_field(crate::ix::env::BinderInfo::Default); + let name = M::meta_field(ix_common::env::Name::anon()); + let bi = M::meta_field(ix_common::env::BinderInfo::Default); let fv_id = self.fresh_fvar_id(); let fv = self.intern(KExpr::fvar(fv_id, name.clone())); self.lctx.push(fv_id, LocalDecl::CDecl { name, bi, ty }); @@ -1047,8 +1047,8 @@ mod tests { apps, cnst, mk_addr, mk_id, mk_name, pi, sort0, sort1, uzero, var, }; use super::*; - use crate::ix::address::Address; - use crate::ix::kernel::mode::Meta; + use crate::mode::Meta; + use ix_common::address::Address; fn new_tc() -> TypeChecker<'static, Meta> { let env = Box::leak(Box::new(KEnv::::new())); @@ -1564,7 +1564,7 @@ mod tests { // Deep embedding: λ x. app target (var 0) let e = KExpr::::lam( mk_name("x"), - crate::ix::env::BinderInfo::Default, + ix_common::env::BinderInfo::Default, sort0(), KExpr::app(target, var(0)), ); diff --git a/src/ix/kernel/testing.rs b/crates/kernel/src/testing.rs similarity index 97% rename from src/ix/kernel/testing.rs rename to crates/kernel/src/testing.rs index 2fa6e9c9..8c29a274 100644 --- a/src/ix/kernel/testing.rs +++ b/crates/kernel/src/testing.rs @@ -3,9 +3,9 @@ //! Provides convenience constructors for `KExpr`, `KUniv`, `KId`, //! and `KConst` to reduce boilerplate in hand-built test environments. -use crate::ix::address::Address; -use crate::ix::env::{BinderInfo, DefinitionSafety, Name, ReducibilityHints}; -use crate::ix::ixon::constant::DefKind; +use ix_common::address::Address; +use ix_common::env::{BinderInfo, DefinitionSafety, Name, ReducibilityHints}; +use ixon::constant::DefKind; use super::constant::KConst; use super::env::KEnv; diff --git a/src/ix/kernel/tutorial/basic.rs b/crates/kernel/src/tutorial/basic.rs similarity index 99% rename from src/ix/kernel/tutorial/basic.rs rename to crates/kernel/src/tutorial/basic.rs index e460fdd2..adbc562d 100644 --- a/src/ix/kernel/tutorial/basic.rs +++ b/crates/kernel/src/tutorial/basic.rs @@ -3,10 +3,10 @@ #[cfg(test)] mod tests { - use crate::ix::env::ReducibilityHints; - use crate::ix::kernel::env::KEnv; - use crate::ix::kernel::mode::Meta; - use crate::ix::kernel::testing::*; + use crate::env::KEnv; + use crate::mode::Meta; + use crate::testing::*; + use ix_common::env::ReducibilityHints; // ========================================================================== // Batch 1: Basic definitions (Tutorial.lean lines 16–60) diff --git a/src/ix/kernel/tutorial/defeq.rs b/crates/kernel/src/tutorial/defeq.rs similarity index 98% rename from src/ix/kernel/tutorial/defeq.rs rename to crates/kernel/src/tutorial/defeq.rs index 4c09634b..b97f9ee7 100644 --- a/src/ix/kernel/tutorial/defeq.rs +++ b/crates/kernel/src/tutorial/defeq.rs @@ -3,11 +3,11 @@ #[cfg(test)] mod tests { - use crate::ix::env::Name; - use crate::ix::kernel::constant::{KConst, RecRule}; - use crate::ix::kernel::env::KEnv; - use crate::ix::kernel::mode::Meta; - use crate::ix::kernel::testing::*; + use crate::constant::{KConst, RecRule}; + use crate::env::KEnv; + use crate::mode::Meta; + use crate::testing::*; + use ix_common::env::Name; // ========================================================================== // Batch 4: Proof irrelevance and eta (Tutorial.lean lines 953–1013) @@ -50,7 +50,7 @@ mod tests { vec![], ty, val, - crate::ix::env::ReducibilityHints::Abbrev, + ix_common::env::ReducibilityHints::Abbrev, ); env.insert(id.clone(), c); check_accepts(&mut env, &id); @@ -811,7 +811,7 @@ mod tests { // Value: fun α r a h p => Eq.refl p (BOGUS — claims reduction happened) let val = ME::lam( mk_name("α"), - crate::ix::env::BinderInfo::Implicit, + ix_common::env::BinderInfo::Implicit, sort1(), nlam( "r", @@ -1069,11 +1069,11 @@ mod tests { let minor_r = app(app(var(0), var(1)), eq_refl_r); let rule_rhs = ME::lam( mk_name("α"), - crate::ix::env::BinderInfo::Implicit, + ix_common::env::BinderInfo::Implicit, sort(param(1)), ME::lam( mk_name("a"), - crate::ix::env::BinderInfo::Implicit, + ix_common::env::BinderInfo::Implicit, var(0), nlam("motive", motive_ty_r, nlam("refl", minor_r, var(0))), ), @@ -1396,7 +1396,7 @@ mod tests { vec![], ty, val, - crate::ix::env::ReducibilityHints::Opaque, + ix_common::env::ReducibilityHints::Opaque, ); env.insert(id.clone(), c); check_rejects(&mut env, &id); @@ -1499,7 +1499,7 @@ mod tests { vec![], ty, val, - crate::ix::env::ReducibilityHints::Opaque, + ix_common::env::ReducibilityHints::Opaque, ); env.insert(id.clone(), c); check_rejects(&mut env, &id); @@ -1523,11 +1523,11 @@ mod tests { // fun {a} {b} (h : And a b) => .proj And 0 h let val = ME::lam( mk_name("a"), - crate::ix::env::BinderInfo::Implicit, + ix_common::env::BinderInfo::Implicit, sort0(), ME::lam( mk_name("b"), - crate::ix::env::BinderInfo::Implicit, + ix_common::env::BinderInfo::Implicit, sort0(), nlam("h", and_ab, ME::prj(mk_id("And"), 0, var(0))), ), @@ -1539,7 +1539,7 @@ mod tests { vec![], ty, val, - crate::ix::env::ReducibilityHints::Abbrev, + ix_common::env::ReducibilityHints::Abbrev, ); env.insert(id.clone(), c); check_accepts(&mut env, &id); @@ -1554,11 +1554,11 @@ mod tests { let val = ME::lam( mk_name("a"), - crate::ix::env::BinderInfo::Implicit, + ix_common::env::BinderInfo::Implicit, sort0(), ME::lam( mk_name("b"), - crate::ix::env::BinderInfo::Implicit, + ix_common::env::BinderInfo::Implicit, sort0(), nlam("h", and_ab, ME::prj(mk_id("And"), 1, var(0))), ), @@ -1570,7 +1570,7 @@ mod tests { vec![], ty, val, - crate::ix::env::ReducibilityHints::Abbrev, + ix_common::env::ReducibilityHints::Abbrev, ); env.insert(id.clone(), c); check_accepts(&mut env, &id); @@ -1903,7 +1903,7 @@ mod tests { vec![], ty, val, - crate::ix::env::ReducibilityHints::Opaque, + ix_common::env::ReducibilityHints::Opaque, ); env.insert(id.clone(), c); id @@ -2071,7 +2071,7 @@ mod tests { vec![], ty, val, - crate::ix::env::ReducibilityHints::Opaque, + ix_common::env::ReducibilityHints::Opaque, ); env.insert(id.clone(), c); check_rejects(&mut env, &id); @@ -2279,7 +2279,7 @@ mod tests { vec![], ty, val, - crate::ix::env::ReducibilityHints::Opaque, + ix_common::env::ReducibilityHints::Opaque, ); env.insert(id.clone(), c); check_rejects(&mut env, &id); diff --git a/src/ix/kernel/tutorial/inductive.rs b/crates/kernel/src/tutorial/inductive.rs similarity index 99% rename from src/ix/kernel/tutorial/inductive.rs rename to crates/kernel/src/tutorial/inductive.rs index 08df9731..67591714 100644 --- a/src/ix/kernel/tutorial/inductive.rs +++ b/crates/kernel/src/tutorial/inductive.rs @@ -3,11 +3,11 @@ #[cfg(test)] mod tests { - use crate::ix::env::{Name, ReducibilityHints}; - use crate::ix::kernel::constant::{KConst, RecRule}; - use crate::ix::kernel::env::KEnv; - use crate::ix::kernel::mode::Meta; - use crate::ix::kernel::testing::*; + use crate::constant::{KConst, RecRule}; + use crate::env::KEnv; + use crate::mode::Meta; + use crate::testing::*; + use ix_common::env::{Name, ReducibilityHints}; // ========================================================================== // Batch 3: Bad inductives (Tutorial.lean lines 247–610) diff --git a/src/ix/kernel/tutorial/mod.rs b/crates/kernel/src/tutorial/mod.rs similarity index 100% rename from src/ix/kernel/tutorial/mod.rs rename to crates/kernel/src/tutorial/mod.rs diff --git a/src/ix/kernel/tutorial/reduction.rs b/crates/kernel/src/tutorial/reduction.rs similarity index 98% rename from src/ix/kernel/tutorial/reduction.rs rename to crates/kernel/src/tutorial/reduction.rs index e57e4ae7..aa482201 100644 --- a/src/ix/kernel/tutorial/reduction.rs +++ b/crates/kernel/src/tutorial/reduction.rs @@ -3,12 +3,12 @@ #[cfg(test)] mod tests { - use crate::ix::env::{Name, ReducibilityHints}; - use crate::ix::kernel::constant::KConst; - use crate::ix::kernel::constant::RecRule; - use crate::ix::kernel::env::KEnv; - use crate::ix::kernel::mode::Meta; - use crate::ix::kernel::testing::*; + use crate::constant::KConst; + use crate::constant::RecRule; + use crate::env::KEnv; + use crate::mode::Meta; + use crate::testing::*; + use ix_common::env::{Name, ReducibilityHints}; // ========================================================================== // Batch 5: Peano arithmetic (Tutorial.lean lines 127–153) @@ -985,8 +985,8 @@ mod tests { // The zero kernel's infer_nat_type uses prims.nat to construct the type. // We use N as our Nat, so we need prims.nat = mk_id("N"). // aNatLit : N := NatVal(0) - use crate::ix::address::Address; - use lean_ffi::nat::Nat; + use bignat::Nat; + use ix_common::address::Address; let nat_0 = ME::nat(Nat::from(0u64), Address::hash(b"natval_0")); let (id, c) = mk_defn("aNatLit", 0, vec![], nat(), nat_0, ReducibilityHints::Opaque); @@ -1005,8 +1005,8 @@ mod tests { let mut env = nat_env(); let nat = || cnst("N", &[]); - use crate::ix::address::Address; - use lean_ffi::nat::Nat; + use bignat::Nat; + use ix_common::address::Address; let nat_3 = ME::nat(Nat::from(3u64), Address::hash(b"natval_3")); let succ_succ_succ_zero = app( @@ -1214,11 +1214,11 @@ mod tests { // mk_case fst snd = app(app(var(2), var(1)), var(0)) let rule_rhs = ME::lam( mk_name("α"), - crate::ix::env::BinderInfo::Implicit, + ix_common::env::BinderInfo::Implicit, sort(usucc(param(0))), ME::lam( mk_name("β"), - crate::ix::env::BinderInfo::Implicit, + ix_common::env::BinderInfo::Implicit, sort(usucc(param(1))), nlam( "motive", @@ -1468,7 +1468,7 @@ mod tests { let mut env = KEnv::::new(); add_eq_inductive(&mut env); - use crate::ix::env::QuotKind; + use ix_common::env::QuotKind; // Quot.{u} : {α : Sort u} → (α → α → Prop) → Sort u // depth 1 (inside α): α = var(0) @@ -1627,9 +1627,7 @@ mod tests { env } - fn quot_prims( - env: &KEnv, - ) -> crate::ix::kernel::primitive::Primitives { + fn quot_prims(env: &KEnv) -> crate::primitive::Primitives { let mut prims = test_prims(env); prims.quot_type = mk_id("Quot"); prims.quot_ctor = mk_id("Quot.mk"); diff --git a/src/ix/kernel/whnf.rs b/crates/kernel/src/whnf.rs similarity index 99% rename from src/ix/kernel/whnf.rs rename to crates/kernel/src/whnf.rs index 03d53b08..7934d2c1 100644 --- a/src/ix/kernel/whnf.rs +++ b/crates/kernel/src/whnf.rs @@ -6,8 +6,8 @@ use std::sync::LazyLock; use rustc_hash::FxHashSet; -use crate::ix::address::Address; -use crate::ix::ixon::constant::DefKind; +use ix_common::address::Address; +use ixon::constant::DefKind; /// When set, emit a `[iota stuck]` line whenever `try_iota` can't resolve /// its major premise to a constructor. Set `IX_IOTA_STUCK=1` to activate @@ -69,7 +69,7 @@ use super::mode::KernelMode; use super::subst::{simul_subst, subst, subst_no_intern}; use super::tc::{IotaInfo, MAX_WHNF_FUEL, TypeChecker, collect_app_spine}; -use lean_ffi::nat::Nat; +use bignat::Nat; /// Reduction policy for structural WHNF. /// @@ -323,7 +323,7 @@ impl TypeChecker<'_, M> { } // String literal primitives such as `String.back ""`. - if let Some(reduced) = self.try_reduce_string(&cur)? { + if let Some(reduced) = self.try_reduce_string(&cur) { cur = reduced; continue; } @@ -721,7 +721,7 @@ impl TypeChecker<'_, M> { } // String literal primitives. - if let Some(reduced) = self.try_reduce_string(&cur)? { + if let Some(reduced) = self.try_reduce_string(&cur) { cur = reduced; continue; } @@ -2754,46 +2754,43 @@ impl TypeChecker<'_, M> { // String primitive reduction // ----------------------------------------------------------------------- - pub(super) fn try_reduce_string( - &mut self, - e: &KExpr, - ) -> Result>, TcError> { + pub(super) fn try_reduce_string(&mut self, e: &KExpr) -> Option> { let (head, args) = collect_app_spine(e); if args.len() != 1 { - return Ok(None); + return None; } let ExprData::Const(id, _, _) = head.data() else { - return Ok(None); + return None; }; let is_back = id.addr == self.prims.string_back.addr || id.addr == self.prims.string_legacy_back.addr; let is_utf8_byte_size = id.addr == self.prims.string_utf8_byte_size.addr; let is_to_byte_array = id.addr == self.prims.string_to_byte_array.addr; if !is_back && !is_utf8_byte_size && !is_to_byte_array { - return Ok(None); + return None; } let s = match args[0].data() { ExprData::Str(s, _, _) => s, - _ => return Ok(None), + _ => return None, }; if is_utf8_byte_size { let n = Nat::from(s.len() as u64); let addr = Address::hash(&n.to_le_bytes()); - return Ok(Some(self.intern(KExpr::nat(n, addr)))); + return Some(self.intern(KExpr::nat(n, addr))); } if is_to_byte_array { if s.is_empty() { - return Ok(Some(self.intern(KExpr::cnst( + return Some(self.intern(KExpr::cnst( self.prims.byte_array_empty.clone(), Box::new([]), - )))); + ))); } - return Ok(None); + return None; } let codepoint = s.chars().last().map_or(65u32, u32::from); - Ok(Some(self.char_of_nat_expr(u64::from(codepoint)))) + Some(self.char_of_nat_expr(u64::from(codepoint))) } fn char_of_nat_expr(&mut self, n: u64) -> KExpr { @@ -3025,9 +3022,9 @@ mod tests { use super::super::primitive::Primitives; use super::super::tc::TypeChecker; use super::*; - use crate::ix::address::Address; - use crate::ix::env::{DefinitionSafety, ReducibilityHints}; - use crate::ix::ixon::constant::DefKind; + use ix_common::address::Address; + use ix_common::env::{DefinitionSafety, ReducibilityHints}; + use ixon::constant::DefKind; type AE = KExpr; type AU = KUniv; diff --git a/flake.lock b/flake.lock index 74d923ce..7468797d 100644 --- a/flake.lock +++ b/flake.lock @@ -76,6 +76,21 @@ "type": "github" } }, + "crane_3": { + "locked": { + "lastModified": 1774313767, + "narHash": "sha256-hy0XTQND6avzGEUFrJtYBBpFa/POiiaGBr2vpU6Y9tY=", + "owner": "ipetkov", + "repo": "crane", + "rev": "3d9df76e29656c679c744968b17fbaf28f0e923d", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -121,6 +136,28 @@ "type": "github" } }, + "fenix_3": { + "inputs": { + "nixpkgs": [ + "zisk", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src_3" + }, + "locked": { + "lastModified": 1774596377, + "narHash": "sha256-DiSLMxyTwIUAlhOe34r6kKNQRv6PTF+vf0MG45mAyn4=", + "owner": "nix-community", + "repo": "fenix", + "rev": "a88a1c8cf2f094da6347fcec54089f4bcb518409", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -175,6 +212,42 @@ "type": "github" } }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_4" + }, + "locked": { + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_5": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_5" + }, + "locked": { + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "lean4-nix": { "inputs": { "flake-parts": "flake-parts_3", @@ -255,6 +328,52 @@ "type": "github" } }, + "nixpkgs-lib_4": { + "locked": { + "lastModified": 1772328832, + "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-lib_5": { + "locked": { + "lastModified": 1772328832, + "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1774386573, + "narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "blake3-lean": "blake3-lean", @@ -265,7 +384,9 @@ "nixpkgs": [ "lean4-nix", "nixpkgs" - ] + ], + "sp1": "sp1", + "zisk": "zisk" } }, "rust-analyzer-src": { @@ -301,6 +422,66 @@ "repo": "rust-analyzer", "type": "github" } + }, + "rust-analyzer-src_3": { + "flake": false, + "locked": { + "lastModified": 1774569884, + "narHash": "sha256-E8iWEPzg7OnE0XXXjo75CX7xFauqzJuGZ5wSO9KS8Ek=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "443ddcddd0c73b07b799d052f5ef3b448c2f3508", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, + "sp1": { + "inputs": { + "flake-parts": "flake-parts_4", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1778884899, + "narHash": "sha256-kQahZHfD2f6tEaqD6WBDHDnjSr5m8x/IIS8VKu5glTw=", + "owner": "argumentcomputer", + "repo": "sp1.nix", + "rev": "048405ea52a9acb3fdd4eb7ad8c82346e93c4924", + "type": "github" + }, + "original": { + "owner": "argumentcomputer", + "repo": "sp1.nix", + "type": "github" + } + }, + "zisk": { + "inputs": { + "crane": "crane_3", + "fenix": "fenix_3", + "flake-parts": "flake-parts_5", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1778885240, + "narHash": "sha256-hjbDg9V2q5fwoeBBjE/14a3YwQGwMImV/Apu0CMYSVY=", + "owner": "argumentcomputer", + "repo": "zisk.nix", + "rev": "d7fd3b8353dada23f9530716d1d8265b10c7808e", + "type": "github" + }, + "original": { + "owner": "argumentcomputer", + "ref": "fixups", + "repo": "zisk.nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index ad7c254b..3188ce4c 100644 --- a/flake.nix +++ b/flake.nix @@ -35,18 +35,30 @@ # System packages, follows lean4-nix so we stay in sync inputs.lean4-nix.follows = "lean4-nix"; }; + + # Zisk dev shell (cargo-zisk, ziskemu, RISC-V toolchain) for `zisk-guest`. + zisk.url = "github:argumentcomputer/zisk.nix/fixups"; + + # SP1 dev shell (cargo-prove + succinct Rust toolchain) for `sp1/guest`. + sp1 = { + url = "github:argumentcomputer/sp1.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = inputs @ { - nixpkgs, - flake-parts, - lean4-nix, - fenix, - crane, - blake3-lean, - ... - }: - flake-parts.lib.mkFlake {inherit inputs;} { + outputs = + inputs@{ + nixpkgs, + flake-parts, + lean4-nix, + fenix, + crane, + blake3-lean, + zisk, + sp1, + ... + }: + flake-parts.lib.mkFlake { inherit inputs; } { # Systems we want to build for systems = [ "aarch64-darwin" @@ -55,149 +67,197 @@ "x86_64-linux" ]; - perSystem = { - system, - pkgs, - ... - }: let - # Pins the Rust toolchain - rustToolchain = fenix.packages.${system}.fromToolchainFile { - file = ./rust-toolchain.toml; - sha256 = "sha256-sqSWJDUxc+zaz1nBWMAJKTAGBuGWP25GCftIOlCEAtA="; - }; + perSystem = + { + system, + pkgs, + ... + }: + let + # Pins the Rust toolchain + rustToolchain = fenix.packages.${system}.fromToolchainFile { + file = ./rust-toolchain.toml; + sha256 = "sha256-sqSWJDUxc+zaz1nBWMAJKTAGBuGWP25GCftIOlCEAtA="; + }; + + # Rust package + craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain; + src = craneLib.cleanCargoSource ./.; + craneArgs = { + inherit src; + pname = "ix"; + version = "0.1.0"; + strictDeps = true; - # Rust package - craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain; - src = craneLib.cleanCargoSource ./.; - craneArgs = { - inherit src; - strictDeps = true; - - # build.rs uses LEAN_SYSROOT to locate lean/lean.h for bindgen - LEAN_SYSROOT = "${pkgs.lean.lean-all}"; - # bindgen needs libclang to parse C headers - LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; - - buildInputs = - [] - ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ - # Additional darwin specific inputs can be set here - pkgs.libiconv + # build.rs uses LEAN_SYSROOT to locate lean/lean.h for bindgen + LEAN_SYSROOT = "${pkgs.lean.lean-all}"; + # bindgen needs libclang to parse C headers + LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; + + buildInputs = + [ ] + ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ + # Additional darwin specific inputs can be set here + pkgs.libiconv + ]; + }; + cargoArtifacts = craneLib.buildDepsOnly craneArgs; + + # Test build: parallel + test-ffi (only used by ixTest) + rustPkg = craneLib.buildPackage ( + craneArgs + // { + inherit cargoArtifacts; + cargoExtraArgs = "--locked --features parallel,test-ffi"; + } + ); + + # Release build without test-ffi (for distribution) + rustPkgRelease = craneLib.buildPackage ( + craneArgs + // { + inherit cargoArtifacts; + cargoExtraArgs = "--locked --features parallel"; + } + ); + + # Lake package + lake2nix = pkgs.callPackage lean4-nix.lake { }; + lakeDeps = lake2nix.buildDeps { + src = ./.; + depOverrideDeriv = { + Blake3 = blake3-lean.packages.${system}.rust; + }; + }; + # Shared Lake build args: patches out the Cargo build (Crane handles it) + mkLakeBuildArgs = rustLib: { + inherit lakeDeps; + src = ./.; + # Don't build the `ix_rs` static lib with Lake, since we build it with Crane + postPatch = '' + substituteInPlace lakefile.lean --replace-fail 'proc { cmd := "cargo"' '--proc { cmd := "cargo"' + ''; + # Symlink the Crane-built static lib to where Lake expects it + postConfigure = '' + mkdir -p target/release + ln -s ${rustLib}/lib/libix_ffi.a target/release/ + ''; + buildInputs = [ + pkgs.gmp + pkgs.lean.lean-all + pkgs.rsync ]; - }; - cargoArtifacts = craneLib.buildDepsOnly craneArgs; - - # Test build: parallel + test-ffi (only used by ixTest) - rustPkg = craneLib.buildPackage (craneArgs - // { - inherit cargoArtifacts; - cargoExtraArgs = "--locked --features parallel,test-ffi"; - }); - - # Release build without test-ffi (for distribution) - rustPkgRelease = craneLib.buildPackage (craneArgs - // { - inherit cargoArtifacts; - cargoExtraArgs = "--locked --features parallel"; - }); - - # Lake package - lake2nix = pkgs.callPackage lean4-nix.lake {}; - lakeDeps = lake2nix.buildDeps { - src = ./.; - depOverrideDeriv = { - Blake3 = blake3-lean.packages.${system}.rust; }; - }; - # Shared Lake build args: patches out the Cargo build (Crane handles it) - mkLakeBuildArgs = rustLib: { - inherit lakeDeps; - src = ./.; - # Don't build the `ix_rs` static lib with Lake, since we build it with Crane - postPatch = '' - substituteInPlace lakefile.lean --replace-fail 'proc { cmd := "cargo"' '--proc { cmd := "cargo"' - ''; - # Symlink the Crane-built static lib to where Lake expects it - postConfigure = '' - mkdir -p target/release - ln -s ${rustLib}/lib/libix_rs.a target/release/ - ''; - buildInputs = [pkgs.gmp pkgs.lean.lean-all pkgs.rsync]; - }; - # Release build args (no test-ffi symbols) - lakeBuildArgs = mkLakeBuildArgs rustPkgRelease; - # Test build args (includes test-ffi symbols) - lakeTestBuildArgs = mkLakeBuildArgs rustPkg; - - ixLib = lake2nix.mkPackage (lakeBuildArgs - // { - name = "Ix"; - buildLibrary = true; - }); - lakeBinArgs = - lakeBuildArgs - // { + # Release build args (no test-ffi symbols) + lakeBuildArgs = mkLakeBuildArgs rustPkgRelease; + # Test build args (includes test-ffi symbols) + lakeTestBuildArgs = mkLakeBuildArgs rustPkg; + + ixLib = lake2nix.mkPackage ( + lakeBuildArgs + // { + name = "Ix"; + buildLibrary = true; + } + ); + lakeBinArgs = lakeBuildArgs // { lakeArtifacts = ixLib; # Binaries that import Ix.Meta need .olean files at runtime via LEAN_PATH installArtifacts = true; }; - leanPath = pkgs.lib.concatStringsSep ":" ( - map (d: "${d}/.lake/build/lib/lean") ([ixLib] ++ builtins.attrValues lakeDeps) - ); - wrapBin = drv: - pkgs.runCommand drv.name {nativeBuildInputs = [pkgs.makeWrapper];} '' - mkdir -p $out/bin - for f in ${drv}/bin/*; do - [ -x "$f" ] || continue - makeWrapper "$f" "$out/bin/$(basename "$f")" \ - --set LEAN_SYSROOT "${pkgs.lean.lean-all}" \ - --set LEAN_PATH "${drv}/.lake/build/lib/lean:${leanPath}" - done - ''; - ixCLI = wrapBin (lake2nix.mkPackage (lakeBinArgs // {name = "ix";})); - # Test binary links rustPkg (with test-ffi) instead of rustPkgRelease - ixTest = wrapBin (lake2nix.mkPackage (lakeTestBuildArgs - // { - name = "IxTests"; - installArtifacts = true; - })); - ZKVotingProver = wrapBin (lake2nix.mkPackage (lakeBinArgs - // { - name = "Apps.ZKVoting.Prover"; - installArtifacts = true; - })); - in { - # Lean overlay - _module.args.pkgs = import nixpkgs { - inherit system; - overlays = [(lean4-nix.readToolchainFile ./lean-toolchain)]; - }; + leanPath = pkgs.lib.concatStringsSep ":" ( + map (d: "${d}/.lake/build/lib/lean") ([ ixLib ] ++ builtins.attrValues lakeDeps) + ); + wrapBin = + drv: + pkgs.runCommand drv.name { nativeBuildInputs = [ pkgs.makeWrapper ]; } '' + mkdir -p $out/bin + for f in ${drv}/bin/*; do + [ -x "$f" ] || continue + makeWrapper "$f" "$out/bin/$(basename "$f")" \ + --set LEAN_SYSROOT "${pkgs.lean.lean-all}" \ + --set LEAN_PATH "${drv}/.lake/build/lib/lean:${leanPath}" + done + ''; + ixCLI = wrapBin (lake2nix.mkPackage (lakeBinArgs // { name = "ix"; })); + # Test binary links rustPkg (with test-ffi) instead of rustPkgRelease + ixTest = wrapBin ( + lake2nix.mkPackage ( + lakeTestBuildArgs + // { + name = "IxTests"; + installArtifacts = true; + } + ) + ); + ZKVotingProver = wrapBin ( + lake2nix.mkPackage ( + lakeBinArgs + // { + name = "Apps.ZKVoting.Prover"; + installArtifacts = true; + } + ) + ); + in + { + # Lean overlay + _module.args.pkgs = import nixpkgs { + inherit system; + overlays = [ (lean4-nix.readToolchainFile ./lean-toolchain) ]; + }; - packages = { - default = ixLib; - ix = ixCLI; - test = ixTest; - zkv-prover = ZKVotingProver // {meta.mainProgram = "Apps-ZKVoting-Prover";}; - }; + packages = { + default = ixLib; + ix = ixCLI; + test = ixTest; + zkv-prover = ZKVotingProver // { + meta.mainProgram = "Apps-ZKVoting-Prover"; + }; + }; - # Provide a unified dev shell with Lean + Rust - devShells.default = pkgs.mkShell { - # Add libclang for FFI with rust-bindgen - LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; - packages = with pkgs; [ - pkg-config - openssl - clang - rustToolchain - rust-analyzer - lean.lean-all # Includes Lean compiler, lake, stdlib, etc. - cargo-deny - valgrind - ]; - }; + # Lean + Rust shell for host development (`cargo build`, `lake build`). + devShells.default = pkgs.mkShell { + LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; + packages = with pkgs; [ + pkg-config + openssl + clang + rustToolchain + rust-analyzer + lean.lean-all + cargo-deny + valgrind + ]; + }; - formatter = pkgs.alejandra; - }; + # Zisk shell for `zisk-guest/` (cargo-zisk, ziskemu, RISC-V toolchain). + # Kept separate from `default`: merging cross-pollinates NIX_CFLAGS_COMPILE + # between zisk.nix's and this flake's nixpkgs, which breaks bindgen on + # `lean.h`. + devShells.zisk = zisk.devShells.${system}.default; + + # SP1 shell for `sp1/host` + `sp1/guest`: host Rust toolchain plus + # cargo-prove and the succinct Rust toolchain (~/.sp1) from sp1.nix. + # `rustup-shim` wraps the host `rustc` to dispatch to the succinct + # toolchain when `RUSTUP_TOOLCHAIN=succinct` (set by `sp1-build`); the + # plain host rustc doesn't know `riscv64im-succinct-zkvm-elf`. + # `sp1-prover-types`'s build script needs `protoc`. + devShells.sp1 = pkgs.mkShell { + name = "sp1"; + inputsFrom = [ sp1.devShells.${system}.default ]; + LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; + packages = with pkgs; [ + pkg-config + openssl + protobuf + clang + (sp1.packages.${system}.rustup-shim.override { inherit rustToolchain; }) + ]; + }; + + formatter = pkgs.alejandra; + }; }; } diff --git a/lake-manifest.json b/lake-manifest.json index 05e505ee..2c6d163c 100644 --- a/lake-manifest.json +++ b/lake-manifest.json @@ -25,10 +25,10 @@ "type": "git", "subDir": null, "scope": "", - "rev": "aaf530784082a2c00b0a93648741429d274102ca", + "rev": "d15f36cf76eb5834b0e623e02b97fd4d95e56cc7", "name": "Blake3", "manifestFile": "lake-manifest.json", - "inputRev": "aaf530784082a2c00b0a93648741429d274102ca", + "inputRev": "d15f36cf76eb5834b0e623e02b97fd4d95e56cc7", "inherited": false, "configFile": "lakefile.lean"}, {"url": "https://github.com/argumentcomputer/LSpec", diff --git a/lakefile.lean b/lakefile.lean index 6f401b8c..64ae9b2f 100644 --- a/lakefile.lean +++ b/lakefile.lean @@ -8,7 +8,7 @@ require LSpec from git "https://github.com/argumentcomputer/LSpec" @ "d3c15b93a1dd4e7c8d5c0c3825c9555737e55c3e" require Blake3 from git - "https://github.com/argumentcomputer/Blake3.lean" @ "aaf530784082a2c00b0a93648741429d274102ca" + "https://github.com/argumentcomputer/Blake3.lean" @ "d15f36cf76eb5834b0e623e02b97fd4d95e56cc7" require Cli from git "https://github.com/leanprover/lean4-cli" @ "v4.29.0" @@ -40,7 +40,7 @@ def cargoArgs (testFfi : Bool := false) (net : Bool := false) : IO (Array String if ixNoPar != some "1" then features := features.push "parallel" if net && !System.Platform.isOSX then features := features.push "net" if testFfi then features := features.push "test-ffi" - let buildArgs := #["build", "--release"] + let buildArgs := #["build", "--release", "-p", "ix-ffi"] if features.isEmpty then return buildArgs else return buildArgs ++ #["--features", ",".intercalate features.toList] @@ -48,7 +48,7 @@ def cargoArgs (testFfi : Bool := false) (net : Bool := false) : IO (Array String target ix_rs pkg : FilePath := do let args ← cargoArgs proc { cmd := "cargo", args, cwd := pkg.dir } (quiet := true) - inputBinFile $ pkg.dir / "target" / "release" / nameToStaticLib "ix_rs" + inputBinFile $ pkg.dir / "target" / "release" / nameToStaticLib "ix_ffi" /-- Rebuild the Rust static lib with `test-ffi`. Only triggered by `lake test` (via `moreLinkObjs` on `IxTests`). @@ -57,7 +57,7 @@ target ix_rs_test pkg : FilePath := do let _ ← ix_rs.fetch let args ← cargoArgs (testFfi := true) proc { cmd := "cargo", args, cwd := pkg.dir } (quiet := true) - inputBinFile $ pkg.dir / "target" / "release" / nameToStaticLib "ix_rs" + inputBinFile $ pkg.dir / "target" / "release" / nameToStaticLib "ix_ffi" /-- Build the Rust static lib with `net` for the `ix` CLI. Fetches `ix_rs` first to guarantee ordering before overwriting the lib. -/ @@ -65,7 +65,7 @@ target ix_rs_net pkg : FilePath := do let _ ← ix_rs.fetch let args ← cargoArgs (net := true) proc { cmd := "cargo", args, cwd := pkg.dir } (quiet := true) - inputBinFile $ pkg.dir / "target" / "release" / nameToStaticLib "ix_rs" + inputBinFile $ pkg.dir / "target" / "release" / nameToStaticLib "ix_ffi" end FFI diff --git a/sp1/Cargo.lock b/sp1/Cargo.lock new file mode 100644 index 00000000..b9d08f66 --- /dev/null +++ b/sp1/Cargo.lock @@ -0,0 +1,5892 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addchain" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e33f6a175ec6a9e0aca777567f9ff7c3deefc255660df887e7fa3585e9801d8" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + +[[package]] +name = "addr2line" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "async-scoped" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4042078ea593edffc452eef14e99fdb2b120caa4ad9618bcdeabc4a023b98740" +dependencies = [ + "futures", + "pin-project", + "tokio", +] + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "atomic" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower 0.5.3", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", +] + +[[package]] +name = "backtrace" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "serde", + "windows-link", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "bignat" +version = "0.1.0" +dependencies = [ + "num-bigint 0.4.6", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake3" +version = "1.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa83c34e62843d924f905e0f5c866eb1dd6545fc4d719e803d9ba6030371fce" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "cpufeatures 0.3.0", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array 0.14.9", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "byte-slice-cast" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" + +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "camino" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" +dependencies = [ + "serde_core", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "cc" +version = "1.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +dependencies = [ + "iana-time-zone", + "num-traits", + "windows-link", +] + +[[package]] +name = "clap" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "unicode-width", + "windows-sys 0.59.0", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const_format" +version = "0.2.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4481a617ad9a412be3b97c5d403fef8ed023103368908b9c50af598ff467cc1e" +dependencies = [ + "const_format_proc_macros", + "konst", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "constant_time_eq" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + +[[package]] +name = "crash-context" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031ed29858d90cfdf27fe49fae28028a1f20466db97962fa2f4ea34809aeebf3" +dependencies = [ + "cfg-if", + "libc", + "mach2", +] + +[[package]] +name = "crash-handler" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0df5c9639f4942eb7702b964b3f9adf03a55724a57558cc177407388a8b936e2" +dependencies = [ + "cfg-if", + "crash-context", + "libc", + "mach2", + "parking_lot", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array 0.14.9", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array 0.14.9", + "typenum", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", + "rayon", +] + +[[package]] +name = "dashu" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b3e5ac1e23ff1995ef05b912e2b012a8784506987a2651552db2c73fb3d7e0" +dependencies = [ + "dashu-base", + "dashu-float", + "dashu-int", + "dashu-macros", + "dashu-ratio", + "rustversion", +] + +[[package]] +name = "dashu-base" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b80bf6b85aa68c58ffea2ddb040109943049ce3fbdf4385d0380aef08ef289" + +[[package]] +name = "dashu-float" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85078445a8dbd2e1bd21f04a816f352db8d333643f0c9b78ca7c3d1df71063e7" +dependencies = [ + "dashu-base", + "dashu-int", + "num-modular", + "num-order", + "rustversion", + "static_assertions", +] + +[[package]] +name = "dashu-int" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee99d08031ca34a4d044efbbb21dff9b8c54bb9d8c82a189187c0651ffdb9fbf" +dependencies = [ + "cfg-if", + "dashu-base", + "num-modular", + "num-order", + "rustversion", + "static_assertions", +] + +[[package]] +name = "dashu-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93381c3ef6366766f6e9ed9cf09e4ef9dec69499baf04f0c60e70d653cf0ab10" +dependencies = [ + "dashu-base", + "dashu-float", + "dashu-int", + "dashu-ratio", + "paste", + "proc-macro2", + "quote", + "rustversion", +] + +[[package]] +name = "dashu-ratio" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e33b04dd7ce1ccf8a02a69d3419e354f2bbfdf4eb911a0b7465487248764c9" +dependencies = [ + "dashu-base", + "dashu-float", + "dashu-int", + "num-modular", + "num-order", + "rustversion", +] + +[[package]] +name = "deepsize2" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b5184084af9beed35eecbf4c36baf6e26b9dc47b61b74e02f930c72a58e71b" +dependencies = [ + "deepsize_derive2", + "hashbrown 0.14.5", +] + +[[package]] +name = "deepsize_derive2" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0f8817865cacf3b93b943ca06b0fc5fd8e99eabfdb7ea5d296efcbc4afc4f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive-where" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08b3a0bcc0d079199cd476b2cae8435016ec11d1c0986c6901c5ac223041534" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dynasm" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7d4c414c94bc830797115b8e5f434d58e7e80cb42ba88508c14bc6ea270625" +dependencies = [ + "bitflags", + "byteorder", + "lazy_static", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "dynasmrt" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "602f7458a3859195fb840e6e0cce5f4330dd9dfbfece0edaf31fe427af346f55" +dependencies = [ + "byteorder", + "dynasm", + "fnv", + "memmap2", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "serdect", + "signature", + "spki", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +dependencies = [ + "serde", +] + +[[package]] +name = "elf" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array 0.14.9", + "group", + "pem-rfc7468", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "enum-map" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" +dependencies = [ + "enum-map-derive", + "serde", +] + +[[package]] +name = "enum-map-derive" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "eventsource-stream" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74fef4569247a5f429d9156b9d0a2599914385dd189c539334c625d8099d90ab" +dependencies = [ + "futures-core", + "nom", + "pin-project-lite", +] + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fastrand" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "bitvec", + "byteorder", + "ff_derive", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "ff_derive" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f10d12652036b0e99197587c6ba87a8fc3031986499973c030d8b44fcc151b60" +dependencies = [ + "addchain", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "gcd" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" + +[[package]] +name = "gen_ops" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "304de19db7028420975a296ab0fcbbc8e69438c4ed254a1e41e2a7f37d5f0e0a" + +[[package]] +name = "generic-array" +version = "0.14.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "generic-array" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96512db27971c2c3eece70a1e106fbe6c87760234e31e8f7e5634912fe52794a" +dependencies = [ + "serde", + "typenum", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 5.3.0", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "h2" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "171fefbc92fe4a4de27e0698d6a5b392d6a0e333506bc49133760b3bcf948733" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap 2.14.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", + "serde", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2 0.6.3", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.62.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "indenter" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", + "serde", + "serde_core", +] + +[[package]] +name = "indicatif" +version = "0.17.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" +dependencies = [ + "console", + "number_prefix", + "portable-atomic", + "unicode-width", + "web-time", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "ix-common" +version = "0.1.0" +dependencies = [ + "bignat", + "blake3", + "indexmap 2.14.0", + "rustc-hash", +] + +[[package]] +name = "ix-ixon" +version = "0.1.0" +dependencies = [ + "bignat", + "blake3", + "dashmap", + "indexmap 2.14.0", + "ix-common", + "num-bigint 0.4.6", + "rayon", + "rustc-hash", + "sha2", + "tiny-keccak", +] + +[[package]] +name = "js-sys" +version = "0.3.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" +dependencies = [ + "cfg-if", + "futures-util", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "serdect", + "sha2", + "signature", +] + +[[package]] +name = "konst" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128133ed7824fcd73d6e7b17957c5eb7bacb885649bd8c69708b2331a10bcefb" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libredox" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" +dependencies = [ + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown 0.15.5", +] + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "mach2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" +dependencies = [ + "libc", +] + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "memfd" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad38eb12aea514a0466ea40a80fd8cc83637065948eb4a426e4aa46261175227" +dependencies = [ + "rustix", +] + +[[package]] +name = "memmap2" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714098028fe011992e1c3962653c96b2d578c4b4bce9036e15ff220319b1e0e3" +dependencies = [ + "libc", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "mti" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9563a7d5556636e74bbd8773241fbcbc5c89b9f6bfdc97b29b56e740c2c74b9" +dependencies = [ + "typeid_prefix", + "typeid_suffix", +] + +[[package]] +name = "multimap" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "ntapi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint 0.4.6", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-modular" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17bb261bf36fa7d83f4c294f834e91256769097b3cb505d44831e0a179ac647f" + +[[package]] +name = "num-order" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537b596b97c40fcf8056d153049eb22f481c17ebce72a513ec9286e4986d1bb6" +dependencies = [ + "num-modular", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint 0.4.6", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "crc32fast", + "flate2", + "hashbrown 0.15.5", + "indexmap 2.14.0", + "memchr", + "ruzstd", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "opentelemetry" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b69a91d4893e713e06f724597ad630f1fa76057a5e1026c0ca67054a9032a76" +dependencies = [ + "futures-core", + "futures-sink", + "js-sys", + "once_cell", + "pin-project-lite", + "thiserror 1.0.69", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "p3-air" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a16a8d78c6a37d0eb66b008a18a9e8caa38c3a6a9ca9036416d509faf3dbc86" +dependencies = [ + "p3-field", + "p3-matrix", + "serde", +] + +[[package]] +name = "p3-baby-bear" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d80b9c0a27092644dc22fd8fd6768dab62d325c6f7d121cf896e6bb3789779cf" +dependencies = [ + "cfg-if", + "num-bigint 0.4.6", + "p3-field", + "p3-mds", + "p3-poseidon2", + "p3-symmetric", + "rand 0.8.6", + "rustc_version", + "serde", +] + +[[package]] +name = "p3-bn254-fr" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "577200e3fa7e49e2b21e940a6dc7399dc63acb8581da088558cdf7c455adafc0" +dependencies = [ + "ff", + "num-bigint 0.4.6", + "p3-field", + "p3-poseidon2", + "p3-symmetric", + "rand 0.8.6", + "serde", +] + +[[package]] +name = "p3-challenger" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75358edd6e2562752c01f5064a66d88144a3e75ace0407166dbdf8a727597f52" +dependencies = [ + "p3-field", + "p3-maybe-rayon", + "p3-symmetric", + "p3-util", + "serde", + "tracing", +] + +[[package]] +name = "p3-commit" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0991de9c2f2f8c6a6667eaebe2a5495a2132f9709ffa93357dc18865d154f16" +dependencies = [ + "itertools 0.12.1", + "p3-challenger", + "p3-field", + "p3-matrix", + "p3-util", + "serde", +] + +[[package]] +name = "p3-dft" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "761f1e1b014f2b1b69bd0309124e233d64aa3590e6a41ee786000dd849506d51" +dependencies = [ + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", + "tracing", +] + +[[package]] +name = "p3-field" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2df7cebaa4079b24e0dd7e3aad59eebcbb99a67c1271f79ad884a7c032f5f183" +dependencies = [ + "itertools 0.12.1", + "num-bigint 0.4.6", + "num-traits", + "p3-util", + "rand 0.8.6", + "serde", +] + +[[package]] +name = "p3-fri" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49ef10c7f829294e16a6248200e9571908177c0b5f35bdd70748ac3239a02d29" +dependencies = [ + "itertools 0.12.1", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-interpolation", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", + "serde", + "tracing", +] + +[[package]] +name = "p3-interpolation" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413812d3ada8aa10ece23fc68d47d0c23eed1decbc3844a56f9647c7199796d7" +dependencies = [ + "p3-field", + "p3-matrix", + "p3-util", +] + +[[package]] +name = "p3-keccak-air" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87a087526deb74bf12cc4efc1e50d5c387120624b15ea1de1f3efb440efbcd4d" +dependencies = [ + "p3-air", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", + "tracing", +] + +[[package]] +name = "p3-koala-bear" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cea0ba3389b034b6088d566aea8b57aa29dd2e180966e0c8056f61331c92b4e" +dependencies = [ + "cfg-if", + "num-bigint 0.4.6", + "p3-field", + "p3-mds", + "p3-poseidon2", + "p3-symmetric", + "rand 0.8.6", + "rustc_version", + "serde", +] + +[[package]] +name = "p3-matrix" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fae5cc6ce726cc265cc687c1214e3f1ac1f5c6e973442286ba00d1e75da1c3cb" +dependencies = [ + "itertools 0.12.1", + "p3-field", + "p3-maybe-rayon", + "p3-util", + "rand 0.8.6", + "serde", + "tracing", +] + +[[package]] +name = "p3-maybe-rayon" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac1d2f102cf8c71dba1b449575c99697781fcc028831e83d2245787bd7a650" +dependencies = [ + "rayon", +] + +[[package]] +name = "p3-mds" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f072643e385d65fb9eb089ee6824b320417f78671a0db748566e057e28b250e" +dependencies = [ + "itertools 0.12.1", + "p3-dft", + "p3-field", + "p3-matrix", + "p3-symmetric", + "p3-util", + "rand 0.8.6", +] + +[[package]] +name = "p3-merkle-tree" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "946fcfa239847824c9216db8ac731611c7e82171ef51869bc89d985ad46000d0" +dependencies = [ + "itertools 0.12.1", + "p3-commit", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-symmetric", + "p3-util", + "serde", + "tracing", +] + +[[package]] +name = "p3-poseidon2" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00cc4b6e8a439f79541b0910a016da9e6e12a05a24309bbb713e1db0db396952" +dependencies = [ + "gcd", + "p3-field", + "p3-mds", + "p3-symmetric", + "rand 0.8.6", + "serde", +] + +[[package]] +name = "p3-symmetric" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eebff7fea7deb08a57ccf731a0ed39df25cc66a0e0c2d92c4472c4dee02ee21" +dependencies = [ + "itertools 0.12.1", + "p3-field", + "serde", +] + +[[package]] +name = "p3-uni-stark" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e352e1c9765674f618dbd56e33f673a688d1f85332929fcbefa0fc5e5f4373b5" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", + "serde", + "tracing", +] + +[[package]] +name = "p3-util" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8164df89bbc92e29938f916cc5f1ccbfe6a36fb5040f21ba93c1f21985b9868" +dependencies = [ + "serde", +] + +[[package]] +name = "parity-scale-codec" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" +dependencies = [ + "arrayvec", + "byte-slice-cast", + "const_format", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "rustversion", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "petgraph" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" +dependencies = [ + "fixedbitset", + "indexmap 2.14.0", +] + +[[package]] +name = "pin-project" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.117", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.11+spec-1.1.0", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" +dependencies = [ + "heck", + "itertools 0.14.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.117", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" +dependencies = [ + "anyhow", + "itertools 0.14.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "prost-types" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +dependencies = [ + "prost", +] + +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2 0.6.3", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand 0.9.4", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2 0.6.3", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "range-set-blaze" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8421b5d459262eabbe49048d362897ff3e3830b44eac6cfe341d6acb2f0f13d2" +dependencies = [ + "gen_ops", + "itertools 0.12.1", + "num-integer", + "num-traits", +] + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rayon-scan" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f87cc11a0140b4b0da0ffc889885760c61b13672d80a908920b2c0df078fa14" +dependencies = [ + "rayon", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower 0.5.3", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rrs-succinct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd079cd303257a4cb4e5aadfa79a7fe23f3c8301aa4740ccc3a99673485a352" +dependencies = [ + "downcast-rs", + "num_enum", + "paste", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ruzstd" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7c1c839d570d835527c9a5e4db7cb2198683a988cb9d7293fc8674e6bd58fc8" +dependencies = [ + "twox-hash", +] + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "scale-info" +version = "2.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" +dependencies = [ + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" +dependencies = [ + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "scc" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46e6f046b7fef48e2660c57ed794263155d713de679057f2d0c169bfc6e756cc" +dependencies = [ + "sdd", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sdd" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490dcfcbfef26be6800d11870ff2df8774fa6e86d047e3e8c8a76b25655e41ca" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array 0.14.9", + "pkcs8", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_arrays" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94a16b99c5ea4fe3daccd14853ad260ec00ea043b2708d1fd1da3106dcd8d9df" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + +[[package]] +name = "serial_test" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "911bd979bf1070a3f3aa7b691a3b3e9968f339ceeec89e08c280a8a22207a32f" +dependencies = [ + "futures-executor", + "futures-util", + "log", + "once_cell", + "parking_lot", + "scc", + "serial_test_derive", +] + +[[package]] +name = "serial_test_derive" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a7d91949b85b0d2fb687445e448b40d322b6b3e4af6b44a29b21d9a5f33e6d9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "sha1_smol" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core 0.6.4", +] + +[[package]] +name = "simd-adler32" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "slop-air" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0f533af798f4f9095bbb2a04a91f2026acfc5c5d7578581193bcec71e6a8db" +dependencies = [ + "p3-air", +] + +[[package]] +name = "slop-algebra" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a473c3a06b466dd0708829415a8a9fab451740da066e07862c8c098904aaad6" +dependencies = [ + "itertools 0.14.0", + "p3-field", + "serde", +] + +[[package]] +name = "slop-alloc" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69234b7c30707f1ca518d469a014bbc10d38b97e17fef5dbfd158a8269255595" +dependencies = [ + "serde", + "slop-algebra", + "thiserror 1.0.69", +] + +[[package]] +name = "slop-baby-bear" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0c830173902ff1d5fcb2fa8f40ef34c7d68685059a99a6b9ef91be4bb252abd" +dependencies = [ + "lazy_static", + "p3-baby-bear", + "serde", + "slop-algebra", + "slop-challenger", + "slop-poseidon2", + "slop-symmetric", +] + +[[package]] +name = "slop-basefold" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2dfc41465ee2a8f65afc09da3570997f3c0bf58ae57d559dd7bb05ad5b3f2a0" +dependencies = [ + "derive-where", + "itertools 0.14.0", + "serde", + "slop-algebra", + "slop-alloc", + "slop-baby-bear", + "slop-bn254", + "slop-challenger", + "slop-koala-bear", + "slop-merkle-tree", + "slop-multilinear", + "slop-primitives", + "slop-tensor", + "slop-utils", + "thiserror 1.0.69", +] + +[[package]] +name = "slop-basefold-prover" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fe45ae8840223fb6a1bc9cf1d97c91d0017246b168280242d75c6aa4dfb785" +dependencies = [ + "derive-where", + "itertools 0.14.0", + "rand 0.8.6", + "serde", + "slop-algebra", + "slop-alloc", + "slop-baby-bear", + "slop-basefold", + "slop-bn254", + "slop-challenger", + "slop-commit", + "slop-dft", + "slop-fri", + "slop-futures", + "slop-koala-bear", + "slop-merkle-tree", + "slop-multilinear", + "slop-tensor", + "thiserror 1.0.69", +] + +[[package]] +name = "slop-bn254" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7fbae5dd16a3d1e87c9e99cfd557338171710be01458bd5b12dded3878d3fd8" +dependencies = [ + "ff", + "p3-bn254-fr", + "serde", + "slop-algebra", + "slop-challenger", + "slop-poseidon2", + "slop-symmetric", +] + +[[package]] +name = "slop-challenger" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e80df718cef7d3100658dc8b46fafcc994b814421ec9a7d0763a6ee1e5070c" +dependencies = [ + "futures", + "p3-challenger", + "serde", + "slop-algebra", + "slop-symmetric", +] + +[[package]] +name = "slop-commit" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e3b8f111af56f28eb847662fb87fa8caaee53930a13e8ecea9724163259664" +dependencies = [ + "p3-commit", + "serde", + "slop-alloc", +] + +[[package]] +name = "slop-dft" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29b3439e560ad36f22860c1754e2d6b8715a26dd94fd0acd46a8b07be61add7f" +dependencies = [ + "p3-dft", + "serde", + "slop-algebra", + "slop-alloc", + "slop-matrix", + "slop-tensor", +] + +[[package]] +name = "slop-fri" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "361123ccbbd5faa10edb44c6d76b46053e2f539538a159cd952dd4d5b4606c4b" +dependencies = [ + "p3-fri", +] + +[[package]] +name = "slop-futures" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdae12f26b251c25144bae668d44da582ce12deb86d22ff6ebc10a84b2fc2abf" +dependencies = [ + "crossbeam", + "futures", + "pin-project", + "rayon", + "thiserror 1.0.69", + "tokio", + "tracing", +] + +[[package]] +name = "slop-jagged" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07d9667c28a67f83e42e40c74711f23c072e731e06e9c9997d2e4924d544ce6" +dependencies = [ + "derive-where", + "futures", + "itertools 0.14.0", + "num_cpus", + "rand 0.8.6", + "rayon", + "serde", + "slop-algebra", + "slop-alloc", + "slop-baby-bear", + "slop-basefold", + "slop-basefold-prover", + "slop-bn254", + "slop-challenger", + "slop-commit", + "slop-futures", + "slop-koala-bear", + "slop-merkle-tree", + "slop-multilinear", + "slop-stacked", + "slop-sumcheck", + "slop-symmetric", + "slop-tensor", + "slop-utils", + "thiserror 1.0.69", + "tracing", +] + +[[package]] +name = "slop-keccak-air" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13601bdd494e77e2d431ba4f555788caf1dc5e5812df49061fedbc957e1e19e3" +dependencies = [ + "p3-keccak-air", +] + +[[package]] +name = "slop-koala-bear" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6586b1c0e66c503e4026a8cb007349fa99c2466957c5b09d18fe658d1391ed8" +dependencies = [ + "lazy_static", + "p3-koala-bear", + "serde", + "slop-algebra", + "slop-challenger", + "slop-poseidon2", + "slop-symmetric", +] + +[[package]] +name = "slop-matrix" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e44c7beb600f1e47c43c2745711cf412872999b1ce6a44b8fb5683cd0b1a64a2" +dependencies = [ + "p3-matrix", +] + +[[package]] +name = "slop-maybe-rayon" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a2e15a4db7cbc703c203c1ea00d5a889bf3ff9646e8cfd7076ef584ebca441" +dependencies = [ + "p3-maybe-rayon", +] + +[[package]] +name = "slop-merkle-tree" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3d8df667dc00a44093c22564cfc0140b0ca16e41e6b0be7368822832d71d45" +dependencies = [ + "derive-where", + "itertools 0.14.0", + "p3-merkle-tree", + "serde", + "slop-algebra", + "slop-alloc", + "slop-baby-bear", + "slop-bn254", + "slop-challenger", + "slop-commit", + "slop-futures", + "slop-koala-bear", + "slop-matrix", + "slop-poseidon2", + "slop-symmetric", + "slop-tensor", + "slop-utils", + "thiserror 1.0.69", +] + +[[package]] +name = "slop-multilinear" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f33c77ba8c2c516592bc23669b47c38babdd3aed64389e368cc1f2f499f8b75e" +dependencies = [ + "derive-where", + "futures", + "num_cpus", + "rand 0.8.6", + "rayon", + "serde", + "slop-algebra", + "slop-alloc", + "slop-challenger", + "slop-commit", + "slop-futures", + "slop-matrix", + "slop-tensor", +] + +[[package]] +name = "slop-poseidon2" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c956b11fff1b8a071fa4ba982dc35e458cff1620dc7b33d9cf22d8df30895f79" +dependencies = [ + "p3-poseidon2", +] + +[[package]] +name = "slop-primitives" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de169e0ca381847f9efa0db5a54533371c10558d7aaed4cb3b2a9bae24a0fe83" +dependencies = [ + "slop-algebra", +] + +[[package]] +name = "slop-stacked" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9103802fef961c064a96457b60da838b2d4aa336b00a89fe3af948d684b8226" +dependencies = [ + "derive-where", + "futures", + "itertools 0.14.0", + "serde", + "slop-algebra", + "slop-alloc", + "slop-basefold", + "slop-basefold-prover", + "slop-challenger", + "slop-commit", + "slop-futures", + "slop-merkle-tree", + "slop-multilinear", + "slop-tensor", + "thiserror 1.0.69", +] + +[[package]] +name = "slop-sumcheck" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4b3d5051be430c5b47e95f8258221cb40d276fa3461d0239ca3cd96d95f4ccc" +dependencies = [ + "futures", + "itertools 0.14.0", + "rayon", + "serde", + "slop-algebra", + "slop-alloc", + "slop-baby-bear", + "slop-challenger", + "slop-multilinear", + "thiserror 1.0.69", +] + +[[package]] +name = "slop-symmetric" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955145ad6e3a1d083a428f9274071cfbb44c3b29013aae9d6c4c29fb7328cfc0" +dependencies = [ + "p3-symmetric", +] + +[[package]] +name = "slop-tensor" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84835a3d915fb0402eb7b821ba1637399e7f3d330ba8f9b6faca0317d6df7277" +dependencies = [ + "arrayvec", + "derive-where", + "itertools 0.14.0", + "rand 0.8.6", + "rayon", + "serde", + "slop-algebra", + "slop-alloc", + "slop-futures", + "slop-matrix", + "thiserror 1.0.69", + "transpose", +] + +[[package]] +name = "slop-uni-stark" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd531cc607df2b64e68ea80cc1c05584205b06e70dc5b89563f6b74ab1723f74" +dependencies = [ + "p3-uni-stark", +] + +[[package]] +name = "slop-utils" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ce2c30637af6348960554f9aea4cebce7eb172f173f2187892fcac5cceb3729" +dependencies = [ + "p3-util", + "tracing-forest", + "tracing-subscriber", +] + +[[package]] +name = "slop-whir" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf15dc092785295fe2fd22f1057941a3d5f4d0f6f9ffdce43bb1c9fee8e5578" +dependencies = [ + "derive-where", + "futures", + "itertools 0.14.0", + "rand 0.8.6", + "rayon", + "serde", + "slop-algebra", + "slop-alloc", + "slop-baby-bear", + "slop-basefold", + "slop-challenger", + "slop-commit", + "slop-dft", + "slop-jagged", + "slop-koala-bear", + "slop-matrix", + "slop-merkle-tree", + "slop-multilinear", + "slop-stacked", + "slop-tensor", + "slop-utils", + "thiserror 1.0.69", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +dependencies = [ + "serde", +] + +[[package]] +name = "snowbridge-amcl" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460a9ed63cdf03c1b9847e8a12a5f5ba19c4efd5869e4a737e05be25d7c427e5" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "sp1-build" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "082381d1779d12762a5fb4efa150c2ebdede79a3500eb0a93bf875f7cd64efa0" +dependencies = [ + "anyhow", + "cargo_metadata", + "chrono", + "clap", + "dirs", + "sp1-primitives", +] + +[[package]] +name = "sp1-core-executor" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61464c74d36b4ab16d44011be6ec1896ee463d9369238ec9edcc1c6ce61f11fd" +dependencies = [ + "bincode", + "bytemuck", + "cfg-if", + "clap", + "deepsize2", + "elf", + "enum-map", + "eyre", + "hashbrown 0.14.5", + "hex", + "itertools 0.14.0", + "memmap2", + "num", + "object", + "rrs-succinct", + "serde", + "serde_arrays", + "serde_json", + "slop-air", + "slop-algebra", + "slop-maybe-rayon", + "slop-symmetric", + "sp1-curves", + "sp1-hypercube", + "sp1-jit", + "sp1-primitives", + "strum", + "subenum", + "thiserror 1.0.69", + "tiny-keccak", + "tracing", + "typenum", + "vec_map", +] + +[[package]] +name = "sp1-core-executor-runner" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52434a8037fd9f19a259f6a432df02fba3ccd2e23ce6a61a50477aba59e04c6e" +dependencies = [ + "base64", + "bincode", + "cargo_metadata", + "hashbrown 0.14.5", + "hex", + "libc", + "sha2", + "sp1-core-executor", + "sp1-core-executor-runner-binary", + "sp1-jit", + "sp1-primitives", + "sysinfo", + "tracing", + "uuid", +] + +[[package]] +name = "sp1-core-executor-runner-binary" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d79d7911837cf8ef8fcd1fb791f9133914e7067f8bff3e7d6ec6f0ff46cf929b" +dependencies = [ + "bincode", + "crash-handler", + "libc", + "serde", + "sp1-core-executor", + "sp1-jit", + "tracing-subscriber", +] + +[[package]] +name = "sp1-core-machine" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bab240796901b64aa65402d14351b37f8e955438e6ee1861e3c9219bba02691" +dependencies = [ + "bincode", + "cfg-if", + "enum-map", + "futures", + "generic-array 1.1.0", + "hashbrown 0.14.5", + "itertools 0.14.0", + "num", + "num_cpus", + "rayon", + "rayon-scan", + "rrs-succinct", + "serde", + "serde_json", + "slop-air", + "slop-algebra", + "slop-challenger", + "slop-futures", + "slop-keccak-air", + "slop-matrix", + "slop-maybe-rayon", + "slop-uni-stark", + "snowbridge-amcl", + "sp1-core-executor", + "sp1-core-executor-runner", + "sp1-curves", + "sp1-derive", + "sp1-hypercube", + "sp1-jit", + "sp1-primitives", + "static_assertions", + "struct-reflection", + "strum", + "sysinfo", + "tempfile", + "thiserror 1.0.69", + "tokio", + "tracing", + "tracing-forest", + "tracing-subscriber", + "typenum", +] + +[[package]] +name = "sp1-curves" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac661914a8708368643c805fbc6aeadba004a0619c2f5f1fbfc1866fd37b5c10" +dependencies = [ + "cfg-if", + "dashu", + "elliptic-curve", + "generic-array 1.1.0", + "itertools 0.14.0", + "k256", + "num", + "p256", + "serde", + "slop-algebra", + "snowbridge-amcl", + "sp1-primitives", + "typenum", +] + +[[package]] +name = "sp1-derive" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a4f810860abfdc645c4d0589d6efb9302b0d2b3beab8cc60804cb772d5acbe" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sp1-host" +version = "0.1.0" +dependencies = [ + "clap", + "ix-ixon", + "sp1-build", + "sp1-sdk", + "tokio", +] + +[[package]] +name = "sp1-hypercube" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02c2575307ebcd93b4320a06fb48a818669551a64a0fecf3b5666628e15f90e2" +dependencies = [ + "arrayref", + "deepsize2", + "derive-where", + "futures", + "hashbrown 0.14.5", + "itertools 0.14.0", + "num-bigint 0.4.6", + "num-traits", + "num_cpus", + "rayon", + "rayon-scan", + "serde", + "slop-air", + "slop-algebra", + "slop-alloc", + "slop-basefold", + "slop-basefold-prover", + "slop-bn254", + "slop-challenger", + "slop-commit", + "slop-futures", + "slop-jagged", + "slop-koala-bear", + "slop-matrix", + "slop-merkle-tree", + "slop-multilinear", + "slop-poseidon2", + "slop-stacked", + "slop-sumcheck", + "slop-symmetric", + "slop-tensor", + "slop-uni-stark", + "slop-whir", + "sp1-derive", + "sp1-primitives", + "struct-reflection", + "strum", + "thiserror 1.0.69", + "thousands", + "tokio", + "tracing", +] + +[[package]] +name = "sp1-jit" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf63168fc46696206b9a8e664283ea630bda7911eb255e1d96391787858c581" +dependencies = [ + "dynasmrt", + "hashbrown 0.14.5", + "libc", + "memfd", + "memmap2", + "serde", + "sp1-primitives", + "tracing", + "uuid", +] + +[[package]] +name = "sp1-primitives" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4df14efe799ebd675cf530c853153a4787327a2385067716dfad4ede79ff31ad" +dependencies = [ + "bincode", + "blake3", + "elf", + "hex", + "itertools 0.14.0", + "lazy_static", + "num-bigint 0.4.6", + "serde", + "sha2", + "slop-algebra", + "slop-bn254", + "slop-challenger", + "slop-koala-bear", + "slop-poseidon2", + "slop-primitives", + "slop-symmetric", +] + +[[package]] +name = "sp1-prover" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf089b2fc3cacd5040e6eaeec7d96dc97bfd428421492a0be939f72d48a49851" +dependencies = [ + "anyhow", + "bincode", + "clap", + "dirs", + "either", + "enum-map", + "eyre", + "futures", + "hashbrown 0.14.5", + "hex", + "indicatif", + "itertools 0.14.0", + "lru", + "mti", + "num-bigint 0.4.6", + "opentelemetry", + "pin-project", + "rand 0.8.6", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2", + "slop-air", + "slop-algebra", + "slop-basefold", + "slop-bn254", + "slop-challenger", + "slop-futures", + "slop-jagged", + "slop-multilinear", + "slop-stacked", + "slop-symmetric", + "sp1-core-executor", + "sp1-core-executor-runner", + "sp1-core-machine", + "sp1-derive", + "sp1-hypercube", + "sp1-jit", + "sp1-primitives", + "sp1-prover-types", + "sp1-recursion-circuit", + "sp1-recursion-compiler", + "sp1-recursion-executor", + "sp1-recursion-gnark-ffi", + "sp1-recursion-machine", + "sp1-verifier", + "static_assertions", + "sysinfo", + "tempfile", + "thiserror 1.0.69", + "tokio", + "tonic", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "sp1-prover-types" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e29236cc1217ab04fdc548dbc83c817ecbf78c348879f5dbe65649680cd2ce89" +dependencies = [ + "anyhow", + "async-scoped", + "bincode", + "chrono", + "futures-util", + "hashbrown 0.14.5", + "mti", + "prost", + "serde", + "sp1-core-machine", + "sp1-hypercube", + "sp1-primitives", + "tokio", + "tonic", + "tonic-build", + "tracing", +] + +[[package]] +name = "sp1-recursion-circuit" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c809d2ff42f22ebeafac078f7fae717e50f9658bcd1a5e847c0c7d7d7bf94019" +dependencies = [ + "bincode", + "itertools 0.14.0", + "rand 0.8.6", + "rayon", + "serde", + "slop-air", + "slop-algebra", + "slop-alloc", + "slop-basefold", + "slop-basefold-prover", + "slop-bn254", + "slop-challenger", + "slop-commit", + "slop-jagged", + "slop-koala-bear", + "slop-matrix", + "slop-merkle-tree", + "slop-multilinear", + "slop-stacked", + "slop-sumcheck", + "slop-symmetric", + "slop-tensor", + "slop-whir", + "sp1-core-executor", + "sp1-core-machine", + "sp1-derive", + "sp1-hypercube", + "sp1-primitives", + "sp1-recursion-compiler", + "sp1-recursion-executor", + "sp1-recursion-machine", + "tracing", +] + +[[package]] +name = "sp1-recursion-compiler" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9162e3ad6f369307142a81d627c4883316f7d65b1e5a0ece3dd45780e29ea2" +dependencies = [ + "backtrace", + "cfg-if", + "itertools 0.14.0", + "serde", + "slop-algebra", + "slop-bn254", + "slop-symmetric", + "sp1-core-machine", + "sp1-hypercube", + "sp1-primitives", + "sp1-recursion-executor", + "tracing", + "vec_map", +] + +[[package]] +name = "sp1-recursion-executor" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec793f4c6c032d141476c97fb83dd86abfe3c68f8aace603d57a3d20859a10c5" +dependencies = [ + "backtrace", + "cfg-if", + "hashbrown 0.14.5", + "itertools 0.14.0", + "range-set-blaze", + "serde", + "slop-algebra", + "slop-maybe-rayon", + "slop-poseidon2", + "slop-symmetric", + "smallvec", + "sp1-derive", + "sp1-hypercube", + "static_assertions", + "thiserror 1.0.69", + "tracing", +] + +[[package]] +name = "sp1-recursion-gnark-ffi" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac3939b80a23bc369c2ffc1fdb136de3fd83323fe53b03b17fbb11ea383f330" +dependencies = [ + "anyhow", + "bincode", + "cfg-if", + "hex", + "num-bigint 0.4.6", + "serde", + "serde_json", + "sha2", + "slop-algebra", + "slop-symmetric", + "sp1-hypercube", + "sp1-primitives", + "sp1-recursion-compiler", + "sp1-verifier", + "tempfile", + "tracing", +] + +[[package]] +name = "sp1-recursion-machine" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e60fd9a5f5b9bc39e3ddb39c5ac49da32b6aa7ab63c4fef7b6bb2565c2e98b9e" +dependencies = [ + "itertools 0.14.0", + "rand 0.8.6", + "slop-air", + "slop-algebra", + "slop-basefold", + "slop-matrix", + "slop-maybe-rayon", + "slop-symmetric", + "sp1-derive", + "sp1-hypercube", + "sp1-primitives", + "sp1-recursion-executor", + "strum", + "tracing", +] + +[[package]] +name = "sp1-sdk" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c15071380f43c33b3dbe5650cd5acf54a8e0af4b80a833075a56309256a383" +dependencies = [ + "anyhow", + "async-trait", + "bincode", + "cfg-if", + "dirs", + "eventsource-stream", + "futures", + "hex", + "indicatif", + "itertools 0.14.0", + "k256", + "num-bigint 0.4.6", + "serde", + "sha2", + "sp1-build", + "sp1-core-executor", + "sp1-core-executor-runner", + "sp1-core-machine", + "sp1-hypercube", + "sp1-primitives", + "sp1-prover", + "sp1-prover-types", + "sp1-recursion-executor", + "sp1-verifier", + "strum", + "tempfile", + "thiserror 1.0.69", + "tokio", + "tracing", +] + +[[package]] +name = "sp1-verifier" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91895b72db38423e477635cf22d65a3dc9dc333a872fc2fe0cd6e8daf9661891" +dependencies = [ + "bincode", + "blake3", + "cfg-if", + "dirs", + "hex", + "lazy_static", + "serde", + "sha2", + "slop-algebra", + "slop-challenger", + "slop-primitives", + "slop-symmetric", + "sp1-hypercube", + "sp1-primitives", + "sp1-recursion-executor", + "sp1-recursion-machine", + "strum", + "substrate-bn-succinct-rs", + "thiserror 2.0.18", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strength_reduce" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "struct-reflection" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "701b671d1ad68e250e05718f95dae3014a17f4e69cbe51842531c30495ff3301" +dependencies = [ + "struct-reflection-derive", +] + +[[package]] +name = "struct-reflection-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ab74230a0592602e361bd63c645413fa8cbe4500d10274e849179e5c72548f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "strum" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "subenum" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee3fb942ed39f3971438fcc7e05e20717e599e14c5c7cb50edd0df2a44b274" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "substrate-bn-succinct-rs" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a241fd7c1016fb8ad30fcf5a20986c0c4538e8f15a1b41a1761516299e377ec1" +dependencies = [ + "bytemuck", + "byteorder", + "cfg-if", + "crunchy", + "lazy_static", + "num-bigint 0.4.6", + "rand 0.8.6", + "rustc-hex", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "symlink" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "sysinfo" +version = "0.30.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "rayon", + "windows", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.2", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "thousands" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "time-macros" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.6.3", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.14.0", + "toml_datetime 0.6.11", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.25.11+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" +dependencies = [ + "indexmap 2.14.0", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "winnow 1.0.3", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow 1.0.3", +] + +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64", + "bytes", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "prost", + "rustls-pemfile", + "socket2 0.5.10", + "tokio", + "tokio-rustls", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-build" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "prost-types", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand 0.8.6", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68d6fdd9f81c2819c9a8b0e0cd91660e7746a8e6ea2ba7c6b2b057985f6bcb51" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower 0.5.3", + "tower-layer", + "tower-service", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-appender" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "050686193eb999b4bb3bc2acfa891a13da00f79734704c4b8b4ef1a10b368a3c" +dependencies = [ + "crossbeam-channel", + "symlink", + "thiserror 2.0.18", + "time", + "tracing-subscriber", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-forest" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee40835db14ddd1e3ba414292272eddde9dad04d3d4b65509656414d1c42592f" +dependencies = [ + "ansi_term", + "smallvec", + "thiserror 1.0.69", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "transpose" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad61aed86bc3faea4300c7aee358b4c6d0c8d6ccc36524c96e4c92ccf26e77e" +dependencies = [ + "num-integer", + "strength_reduce", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "twox-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" + +[[package]] +name = "typeid_prefix" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9da1387307fdee46aa441e4f08a1b491e659fcac1aca9cd71f2c624a0de5d1b" + +[[package]] +name = "typeid_suffix" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77b55e96f110c6db5d1a2f24072552537f0091dc90cebeaa679540bac93e7405" +dependencies = [ + "uuid", +] + +[[package]] +name = "typenum" +version = "1.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" +dependencies = [ + "atomic", + "getrandom 0.4.2", + "js-sys", + "md-5", + "sha1_smol", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +dependencies = [ + "serde", +] + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.3+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +dependencies = [ + "wit-bindgen 0.57.1", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen 0.51.0", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96492d0d3ffba25305a7dc88720d250b1401d7edca02cc3bcd50633b424673b8" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.117", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap 2.14.0", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap 2.14.0", + "semver", +] + +[[package]] +name = "web-sys" +version = "0.3.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f5ee44c96cf55f1b349600768e3ece3a8f26010c05265ab73f945bb1a2eb9d" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap 2.14.0", + "prettyplease", + "syn 2.0.117", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.117", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap 2.14.0", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.14.0", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/sp1/Cargo.toml b/sp1/Cargo.toml new file mode 100644 index 00000000..91757491 --- /dev/null +++ b/sp1/Cargo.toml @@ -0,0 +1,6 @@ +[workspace] +members = ["host"] +# `guest/` is built via `sp1-build` for the RISC-V zkVM target and only +# compiles under `cargo-prove`; excluded so host workspace ops don't pick it up. +exclude = ["guest"] +resolver = "2" diff --git a/sp1/guest/Cargo.lock b/sp1/guest/Cargo.lock new file mode 100644 index 00000000..57840b83 --- /dev/null +++ b/sp1/guest/Cargo.lock @@ -0,0 +1,1271 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addchain" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e33f6a175ec6a9e0aca777567f9ff7c3deefc255660df887e7fa3585e9801d8" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bignat" +version = "0.1.0" +dependencies = [ + "num-bigint 0.4.6", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake3" +version = "1.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa83c34e62843d924f905e0f5c866eb1dd6545fc4d719e803d9ba6030371fce" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "cpufeatures 0.3.0", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cc" +version = "1.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "const-default" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b396d1f76d455557e1218ec8066ae14bba60b4b36ecd55577ba979f5db7ecaa" + +[[package]] +name = "constant_time_eq" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", + "rayon", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elf" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" + +[[package]] +name = "embedded-alloc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f2de9133f68db0d4627ad69db767726c99ff8585272716708227008d3f1bddd" +dependencies = [ + "const-default", + "critical-section", + "linked_list_allocator", + "rlsf", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "bitvec", + "byteorder", + "ff_derive", + "rand_core", + "subtle", +] + +[[package]] +name = "ff_derive" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f10d12652036b0e99197587c6ba87a8fc3031986499973c030d8b44fcc151b60" +dependencies = [ + "addchain", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "gcd" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "ix-common" +version = "0.1.0" +dependencies = [ + "bignat", + "blake3", + "indexmap", + "rustc-hash", +] + +[[package]] +name = "ix-ixon" +version = "0.1.0" +dependencies = [ + "bignat", + "blake3", + "dashmap", + "indexmap", + "ix-common", + "num-bigint 0.4.6", + "rayon", + "rustc-hash", + "sha2", + "tiny-keccak", +] + +[[package]] +name = "ix-kernel" +version = "0.1.0" +dependencies = [ + "bignat", + "blake3", + "dashmap", + "indexmap", + "itertools 0.14.0", + "ix-common", + "ix-ixon", + "log", + "num-bigint 0.4.6", + "rayon", + "rustc-hash", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "linked_list_allocator" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b23ac50abb8261cb38c6e2a7192d3302e0836dac1628f6a93b82b4fad185897" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "p3-bn254-fr" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "577200e3fa7e49e2b21e940a6dc7399dc63acb8581da088558cdf7c455adafc0" +dependencies = [ + "ff", + "num-bigint 0.4.6", + "p3-field", + "p3-poseidon2", + "p3-symmetric", + "rand", + "serde", +] + +[[package]] +name = "p3-challenger" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75358edd6e2562752c01f5064a66d88144a3e75ace0407166dbdf8a727597f52" +dependencies = [ + "p3-field", + "p3-maybe-rayon", + "p3-symmetric", + "p3-util", + "serde", + "tracing", +] + +[[package]] +name = "p3-dft" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "761f1e1b014f2b1b69bd0309124e233d64aa3590e6a41ee786000dd849506d51" +dependencies = [ + "p3-field", + "p3-matrix", + "p3-maybe-rayon", + "p3-util", + "tracing", +] + +[[package]] +name = "p3-field" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2df7cebaa4079b24e0dd7e3aad59eebcbb99a67c1271f79ad884a7c032f5f183" +dependencies = [ + "itertools 0.12.1", + "num-bigint 0.4.6", + "num-traits", + "p3-util", + "rand", + "serde", +] + +[[package]] +name = "p3-koala-bear" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cea0ba3389b034b6088d566aea8b57aa29dd2e180966e0c8056f61331c92b4e" +dependencies = [ + "cfg-if", + "num-bigint 0.4.6", + "p3-field", + "p3-mds", + "p3-poseidon2", + "p3-symmetric", + "rand", + "rustc_version", + "serde", +] + +[[package]] +name = "p3-matrix" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fae5cc6ce726cc265cc687c1214e3f1ac1f5c6e973442286ba00d1e75da1c3cb" +dependencies = [ + "itertools 0.12.1", + "p3-field", + "p3-maybe-rayon", + "p3-util", + "rand", + "serde", + "tracing", +] + +[[package]] +name = "p3-maybe-rayon" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac1d2f102cf8c71dba1b449575c99697781fcc028831e83d2245787bd7a650" + +[[package]] +name = "p3-mds" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f072643e385d65fb9eb089ee6824b320417f78671a0db748566e057e28b250e" +dependencies = [ + "itertools 0.12.1", + "p3-dft", + "p3-field", + "p3-matrix", + "p3-symmetric", + "p3-util", + "rand", +] + +[[package]] +name = "p3-poseidon2" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00cc4b6e8a439f79541b0910a016da9e6e12a05a24309bbb713e1db0db396952" +dependencies = [ + "gcd", + "p3-field", + "p3-mds", + "p3-symmetric", + "rand", + "serde", +] + +[[package]] +name = "p3-symmetric" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eebff7fea7deb08a57ccf731a0ed39df25cc66a0e0c2d92c4472c4dee02ee21" +dependencies = [ + "itertools 0.12.1", + "p3-field", + "serde", +] + +[[package]] +name = "p3-util" +version = "0.3.3-succinct" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8164df89bbc92e29938f916cc5f1ccbfe6a36fb5040f21ba93c1f21985b9868" +dependencies = [ + "serde", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rlsf" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1646a59a9734b8b7a0ac51689388a60fe1625d4b956348e9de07591a1478457a" +dependencies = [ + "cfg-if", + "const-default", + "libc", + "rustversion", + "svgbobdoc", +] + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "slop-algebra" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a473c3a06b466dd0708829415a8a9fab451740da066e07862c8c098904aaad6" +dependencies = [ + "itertools 0.14.0", + "p3-field", + "serde", +] + +[[package]] +name = "slop-bn254" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7fbae5dd16a3d1e87c9e99cfd557338171710be01458bd5b12dded3878d3fd8" +dependencies = [ + "ff", + "p3-bn254-fr", + "serde", + "slop-algebra", + "slop-challenger", + "slop-poseidon2", + "slop-symmetric", +] + +[[package]] +name = "slop-challenger" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4e80df718cef7d3100658dc8b46fafcc994b814421ec9a7d0763a6ee1e5070c" +dependencies = [ + "futures", + "p3-challenger", + "serde", + "slop-algebra", + "slop-symmetric", +] + +[[package]] +name = "slop-koala-bear" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6586b1c0e66c503e4026a8cb007349fa99c2466957c5b09d18fe658d1391ed8" +dependencies = [ + "lazy_static", + "p3-koala-bear", + "serde", + "slop-algebra", + "slop-challenger", + "slop-poseidon2", + "slop-symmetric", +] + +[[package]] +name = "slop-poseidon2" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c956b11fff1b8a071fa4ba982dc35e458cff1620dc7b33d9cf22d8df30895f79" +dependencies = [ + "p3-poseidon2", +] + +[[package]] +name = "slop-primitives" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de169e0ca381847f9efa0db5a54533371c10558d7aaed4cb3b2a9bae24a0fe83" +dependencies = [ + "slop-algebra", +] + +[[package]] +name = "slop-symmetric" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955145ad6e3a1d083a428f9274071cfbb44c3b29013aae9d6c4c29fb7328cfc0" +dependencies = [ + "p3-symmetric", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "sp1-guest" +version = "0.1.0" +dependencies = [ + "ix-ixon", + "ix-kernel", + "sp1-zkvm", +] + +[[package]] +name = "sp1-lib" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02cd166e010c80e542585bf74585ea80eff117c361656cae43f2968cf0af12d4" +dependencies = [ + "bincode", + "serde", + "sp1-primitives", +] + +[[package]] +name = "sp1-primitives" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4df14efe799ebd675cf530c853153a4787327a2385067716dfad4ede79ff31ad" +dependencies = [ + "bincode", + "blake3", + "elf", + "hex", + "itertools 0.14.0", + "lazy_static", + "num-bigint 0.4.6", + "serde", + "sha2", + "slop-algebra", + "slop-bn254", + "slop-challenger", + "slop-koala-bear", + "slop-poseidon2", + "slop-primitives", + "slop-symmetric", +] + +[[package]] +name = "sp1-zkvm" +version = "6.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa10f689c4384daf7ece04176c727e6f2e56193e10a406406aa7c9c6c8f8f478" +dependencies = [ + "cfg-if", + "critical-section", + "embedded-alloc", + "getrandom 0.2.17", + "getrandom 0.3.4", + "lazy_static", + "libm", + "rand", + "sha2", + "sp1-lib", + "sp1-primitives", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "svgbobdoc" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2c04b93fc15d79b39c63218f15e3fdffaa4c227830686e3b7c5f41244eb3e50" +dependencies = [ + "base64", + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-width", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "typenum" +version = "1.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.3+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] diff --git a/sp1/guest/Cargo.toml b/sp1/guest/Cargo.toml new file mode 100644 index 00000000..722adc2e --- /dev/null +++ b/sp1/guest/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "sp1-guest" +version = "0.1.0" +edition = "2024" + +[dependencies] +ixon = { path = "../../crates/ixon" } +ix-kernel = { path = "../../crates/kernel" } +sp1-zkvm = "6.2.0" diff --git a/sp1/guest/src/main.rs b/sp1/guest/src/main.rs new file mode 100644 index 00000000..1cf6753c --- /dev/null +++ b/sp1/guest/src/main.rs @@ -0,0 +1,49 @@ +//! SP1 guest binary: prove that every named constant in a serialized Ixon +//! environment typechecks under the Ix kernel. +//! +//! Input (via `sp1_zkvm::io::read_vec`): +//! - `Vec`: Ixon-serialized environment (`ixon::env::Env::get` format). +//! +//! Output (via `sp1_zkvm::io::commit`): +//! - `u32`: count of constants that failed typechecking (0 = all pass). + +#![no_main] +sp1_zkvm::entrypoint!(main); + +use ixon::env::Env as IxonEnv; +use ixon::metadata::ConstantMetaInfo; +use ix_kernel::id::KId; +use ix_kernel::ingress::ixon_ingress_owned; +use ix_kernel::mode::Meta; +use ix_kernel::tc::TypeChecker; + +pub fn main() { + let env_bytes: Vec = sp1_zkvm::io::read_vec(); + + let env = + IxonEnv::get(&mut &env_bytes[..]).expect("invalid Ixon environment"); + + // Skip `Muts` entries: they're mutual-block pointers, not standalone + // checkable constants. This matches `all_checkable_ixon_names` in + // `crates/ffi/src/kernel.rs` used by `ix check-ixon`. + let named: Vec<(_, _)> = env + .named + .iter() + .filter(|e| !matches!(e.value().meta.info, ConstantMetaInfo::Muts { .. })) + .map(|e| (e.key().clone(), e.value().addr.clone())) + .collect(); + + let (mut kenv, _intern) = + ixon_ingress_owned::(env).expect("ingress failed"); + + let mut failures: u32 = 0; + let mut tc = TypeChecker::new(&mut kenv); + for (name, addr) in named { + let kid = KId::::new(addr, name); + if tc.check_const(&kid).is_err() { + failures = failures.saturating_add(1); + } + } + + sp1_zkvm::io::commit(&failures); +} diff --git a/sp1/host/Cargo.toml b/sp1/host/Cargo.toml new file mode 100644 index 00000000..a652c4ca --- /dev/null +++ b/sp1/host/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "sp1-host" +version = "0.1.0" +edition = "2024" +default-run = "sp1-host" + +[[bin]] +name = "sp1-host" +path = "src/main.rs" + +[dependencies] +ixon = { path = "../../crates/ixon" } +sp1-sdk = "6.2.0" +tokio = { version = "1", features = ["rt-multi-thread", "macros"] } +clap = { version = "4.0", features = ["derive"] } + +[build-dependencies] +sp1-build = "6.2.0" diff --git a/sp1/host/build.rs b/sp1/host/build.rs new file mode 100644 index 00000000..cefceb4b --- /dev/null +++ b/sp1/host/build.rs @@ -0,0 +1,3 @@ +fn main() { + sp1_build::build_program("../guest"); +} diff --git a/sp1/host/src/main.rs b/sp1/host/src/main.rs new file mode 100644 index 00000000..17d62366 --- /dev/null +++ b/sp1/host/src/main.rs @@ -0,0 +1,84 @@ +//! Drive the SP1 guest: load an Ixon environment, execute (or prove) the +//! kernel typecheck over it. +//! +//! ```shell +//! RUST_LOG=info cargo run --release -- --execute +//! RUST_LOG=info cargo run --release -- --execute --ixe ../../minimal.ixe +//! RUST_LOG=info cargo run --release # prove (compressed) +//! ``` + +use std::fs; +use std::path::PathBuf; +use std::time::Instant; + +use clap::Parser; +use ixon::env::Env as IxonEnv; +use sp1_sdk::{ + include_elf, Elf, ProveRequest, Prover, ProverClient, ProvingKey, SP1Stdin, +}; + +pub const GUEST_ELF: Elf = include_elf!("sp1-guest"); + +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +struct Args { + /// Run the program in the VM only - no proof. + #[arg(long)] + execute: bool, + + /// Path to a `.ixe` file produced by `lake exe ix compile`. If omitted, an + /// empty `IxonEnv` is used. + #[arg(long)] + ixe: Option, +} + +fn load_env_bytes(ixe: Option<&PathBuf>) -> Vec { + match ixe { + Some(path) => fs::read(path).expect("read ixe input"), + None => { + let env = IxonEnv::new(); + let mut buf = Vec::new(); + env.put(&mut buf).expect("env.put"); + buf + }, + } +} + +#[tokio::main] +async fn main() { + sp1_sdk::utils::setup_logger(); + + let args = Args::parse(); + let env_bytes = load_env_bytes(args.ixe.as_ref()); + + let mut stdin = SP1Stdin::new(); + stdin.write_vec(env_bytes); + + let client = ProverClient::from_env().await; + + if args.execute { + let (output, report) = + client.execute(GUEST_ELF, stdin).await.expect("execute"); + let failures = u32::from_le_bytes( + output.as_slice()[..4].try_into().expect("output too short"), + ); + println!("failures: {failures}"); + println!("cycles: {}", report.total_instruction_count()); + return; + } + + let pk = client.setup(GUEST_ELF).await.expect("setup"); + let start = Instant::now(); + let proof = client + .prove(&pk, stdin) + .compressed() + .await + .expect("prove"); + let prove_duration = start.elapsed(); + println!("proof generated in {:.2}s", prove_duration.as_secs_f64()); + + client + .verify(&proof, pk.verifying_key(), None) + .expect("verify"); + println!("proof verified"); +} diff --git a/sp1/rust-toolchain.toml b/sp1/rust-toolchain.toml new file mode 100644 index 00000000..7ac9c9e3 --- /dev/null +++ b/sp1/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +profile = "default" +components = ["llvm-tools", "rustc-dev"] +channel = "1.92" diff --git a/src/ffi.rs b/src/ffi.rs deleted file mode 100644 index 1cb987fb..00000000 --- a/src/ffi.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Lean and C don't support feature flags, so the _iroh module is exposed as a fallback for when the `net` feature is disabled and/or on the `aarch64-darwin` target. -// This fallback module contains dummy functions that can still be called via Lean->Rust FFI, but will return an error message that Lean then prints before exiting. -#[cfg(any( - not(feature = "net"), - all(target_os = "macos", target_arch = "aarch64") -))] -pub mod _iroh; -pub mod aiur; -pub mod byte_array; -#[cfg(all( - feature = "net", - not(all(target_os = "macos", target_arch = "aarch64")) -))] -pub mod iroh; -pub mod keccak; -pub mod lean_env; -pub mod unsigned; - -// Modular FFI structure -pub mod builder; // IxEnvBuilder struct -pub mod compile; // Compilation: rs_compile_env_full, rs_compile_phases, etc. -pub mod graph; // Graph/SCC: rs_build_ref_graph, rs_compute_sccs -pub mod ix; // Ix types: Name, Level, Expr, ConstantInfo, Environment -pub mod ixon; // Ixon types: Univ, Expr, Constant, metadata -pub mod kernel; // Kernel type-checker FFI: rs_kernel_check_consts, rs_kernel_ingress (production); rs_kernel_roundtrip* (test-only) -pub mod primitives; // Primitives: rs_roundtrip_nat, rs_roundtrip_string, etc. -#[cfg(feature = "test-ffi")] -pub mod refcount; // Reference counting / ownership tests (test-only) - -#[cfg(feature = "test-ffi")] -use lean_ffi::object::{ - LeanArray, LeanBorrowed, LeanByteArray, LeanOwned, LeanRef, -}; - -#[cfg(feature = "test-ffi")] -#[unsafe(no_mangle)] -extern "C" fn rs_boxed_u32s_are_equivalent_to_bytes( - u32s: LeanArray, - bytes: LeanByteArray>, -) -> bool { - let u32s_flat: Vec = u32s - .map(|elem| elem.unbox_u32()) - .into_iter() - .flat_map(u32::to_le_bytes) - .collect(); - u32s_flat == bytes.as_bytes() -} diff --git a/src/ix.rs b/src/ix.rs deleted file mode 100644 index af5d3329..00000000 --- a/src/ix.rs +++ /dev/null @@ -1,19 +0,0 @@ -//! Ix: content-addressed representation of Lean kernel types. -//! -//! This module contains the Lean type representation (`env`), the Ixon -//! serialization format (`ixon`), and the compilation/decompilation pipeline -//! that transforms between them. - -pub mod address; -pub mod compile; -pub mod condense; -pub mod congruence; -pub mod decompile; -pub mod env; -pub mod graph; -pub mod ground; -pub mod ixon; -pub mod kernel; -pub mod mutual; -pub mod store; -pub mod strong_ordering; diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 1482ceac..00000000 --- a/src/lib.rs +++ /dev/null @@ -1,48 +0,0 @@ -#![allow(clippy::type_complexity)] -#![allow(clippy::too_many_arguments)] -#![allow(clippy::unnecessary_wraps)] - -// Use mimalloc as the global allocator for Rust-side allocations. -// -// Dropping the post-ingress IxonEnv is dominated by freeing millions of nested -// `Arc` / `Arc` trees concurrently across rayon workers. glibc -// malloc serializes freelist updates per-arena and scales poorly past ~16 -// threads on free-heavy workloads; mimalloc has fully thread-local free lists -// and consistently outperforms glibc by 1.5–2× on this kind of teardown. -// -// `ix_rs` is `crate-type = ["staticlib"]` linked into Lean. This declaration -// only governs Rust-side allocations (DashMap, Arc, Vec, etc.); Lean's runtime -// continues to manage its own heap, and the FFI boundary routes Lean-owned -// objects through `lean-ffi`, so there is no allocator-mismatch risk on -// cross-boundary frees. -#[global_allocator] -static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; - -#[allow(unused_extern_crates)] -#[cfg(test)] -extern crate quickcheck; -#[allow(unused_extern_crates)] -#[cfg(test)] -#[macro_use(quickcheck)] -extern crate quickcheck_macros; -#[allow(unused_extern_crates)] -#[cfg(test)] -extern crate rand; - -use indexmap::{IndexMap, IndexSet}; -use rustc_hash::FxBuildHasher; - -pub mod aiur; -pub mod ffi; -// Iroh functionality is enabled by the `net` feature. However, Iroh doesn't work on `aarch64-darwin`, so it is always disabled for that target. -#[cfg(all( - feature = "net", - not(all(target_os = "macos", target_arch = "aarch64")) -))] -pub mod iroh; -pub mod ix; -pub mod lean; -mod sha256; - -pub type FxIndexMap = IndexMap; -pub type FxIndexSet = IndexSet; diff --git a/zisk/Cargo.lock b/zisk/Cargo.lock new file mode 100644 index 00000000..cbcabcbf --- /dev/null +++ b/zisk/Cargo.lock @@ -0,0 +1,4607 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "alloy-json-abi" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9dbe713da0c737d9e5e387b0ba790eb98b14dd207fe53eef50e19a5a8ec3dac" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-primitives" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3b431b4e72cd8bd0ec7a50b4be18e73dab74de0dba180eef171055e5d5926e" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "foldhash 0.2.0", + "hashbrown 0.16.1", + "indexmap", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.9.4", + "rapidhash", + "ruint", + "rustc-hash 2.1.2", + "serde", + "sha3", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc90b1e703d3c03f4ff7f48e82dd0bc1c8211ab7d079cd836a06fcfeb06651cb" +dependencies = [ + "arrayvec", + "bytes", +] + +[[package]] +name = "alloy-sol-macro" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab81bab693da9bb79f7a95b64b394718259fdd7e41dceeced4cad57cb71c4f6a" +dependencies = [ + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "489f1620bb7e2483fb5819ed01ab6edc1d2f93939dce35a5695085a1afd1d699" +dependencies = [ + "alloy-sol-macro-input", + "const-hex", + "heck", + "indexmap", + "proc-macro-error2", + "proc-macro2", + "quote", + "sha3", + "syn 2.0.117", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56cef806ad22d4392c5fc83cf8f2089f988eb99c7067b4e0c6f1971fc1cca318" +dependencies = [ + "const-hex", + "dunce", + "heck", + "macro-string", + "proc-macro2", + "quote", + "syn 2.0.117", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6df77fea9d6a2a75c0ef8d2acbdfd92286cc599983d3175ccdc170d3433d249" +dependencies = [ + "serde", + "winnow 0.7.15", +] + +[[package]] +name = "alloy-sol-types" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64612d29379782a5dde6f4b6570d9c756d734d760c0c94c254d361e678a6591f" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-macro", + "serde", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-bn254" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" +dependencies = [ + "ark-ec", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-poly", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.5", + "itertools 0.13.0", + "num-bigint", + "num-integer", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.1", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "educe", + "itertools 0.13.0", + "num-bigint", + "num-traits", + "paste", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.5", +] + +[[package]] +name = "ark-secp256k1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8bd211c48debd3037b48873a7aa22c3aba034e83388aa4124795c9f220b88c7" +dependencies = [ + "ark-ec", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-secp256r1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cf8be5820de567729bfa73a410ddd07cec8ad102d9a4bf61fd6b2e60db264e8" +dependencies = [ + "ark-ec", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.6", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.6", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand 0.8.6", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "asn1-rs" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56624a96882bb8c26d61312ae18cb45868e5a9992ea73c58e45c3101e56a1e60" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror 2.0.18", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "aurora-engine-modexp" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "518bc5745a6264b5fd7b09dffb9667e400ee9e2bbe18555fac75e1fe9afa0df9" +dependencies = [ + "hex", + "num", +] + +[[package]] +name = "auto_impl" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "aws-lc-rs" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ec2f1fc3ec205783a5da9a7e6c1509cc69dedf09a1949e412c1e18469326d00" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a2f9779ce85b93ab6170dd940ad0169b5766ff848247aff13bb788b832fe3f4" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "bignat" +version = "0.1.0" +dependencies = [ + "num-bigint", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bindgen" +version = "0.69.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.12.1", + "lazy_static", + "lazycell", + "proc-macro2", + "quote", + "regex", + "rustc-hash 1.1.0", + "shlex", + "syn 2.0.117", +] + +[[package]] +name = "bindgen" +version = "0.72.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash 2.1.2", + "shlex", + "syn 2.0.117", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec 0.8.0", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bit-vec" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51" +dependencies = [ + "serde", +] + +[[package]] +name = "bitcoin-io" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dee39a0ee5b4095224a0cfc6bf4cc1baf0f9624b96b367e53b66d974e51d953" + +[[package]] +name = "bitcoin_hashes" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26ec84b80c482df901772e931a9a681e26a1b9ee2302edeff23cb30328745c8b" +dependencies = [ + "bitcoin-io", + "hex-conservative", +] + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake3" +version = "1.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa83c34e62843d924f905e0f5c866eb1dd6545fc4d719e803d9ba6030371fce" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "cpufeatures 0.3.0", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blst" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcdb4c7013139a150f9fc55d123186dbfaba0d912817466282c73ac49e71fb45" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + +[[package]] +name = "borsh" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd1e3f8955a5d7de9fab72fc8373fade9fb8a703968cb200ae3dc6cf08e185a" +dependencies = [ + "borsh-derive", + "bytes", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfcfdc083699101d5a7965e49925975f2f55060f94f9a05e7187be95d530ca59" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "build-probe-mpi" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78ace2bb02fc18ad937f1599a853fcf3da2327bc1eb3c8e62b1f2fe4573bfd6" +dependencies = [ + "pkg-config", + "shell-words", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "byte-slice-cast" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" + +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +dependencies = [ + "serde", +] + +[[package]] +name = "cc" +version = "1.2.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-link 0.2.1", +] + +[[package]] +name = "circuit" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v0.17.0#b63274507a040bf9e09d22214df43066e8f80cb7" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + +[[package]] +name = "colored" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "const-hex" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20d9a563d167a9cce0f94153382b33cb6eded6dfabff03c69ad65a28ea1514e0" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "proptest", + "serde_core", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const_format" +version = "0.2.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4481a617ad9a412be3b97c5d403fef8ed023103368908b9c50af598ff467cc1e" +dependencies = [ + "const_format_proc_macros", + "konst", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "constant_time_eq" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" + +[[package]] +name = "conv" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299" +dependencies = [ + "custom_derive", +] + +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "csv" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52cd9d68cf7efc6ddfaaee42e7288d3a99d613d4b50f76ce9827ae0c6e14f938" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde_core", +] + +[[package]] +name = "csv-core" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "704a3c26996a80471189265814dbc2c257598b96b8a7feae2d31ace646bb9782" +dependencies = [ + "memchr", +] + +[[package]] +name = "ctor" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "curves" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v0.17.0#ff0e33a9b40f2467b35ef26aa2aabb4a624dfed3" +dependencies = [ + "fields", + "num-bigint", + "num-traits", +] + +[[package]] +name = "custom_derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", + "rayon", +] + +[[package]] +name = "data-encoding" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "der-parser" +version = "10.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07da5016415d5a3c4dd39b11ed26f915f52fc4e0dc197d87908bc916e51bc1a6" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.1", + "syn 2.0.117", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elf" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "enum-ordinalize" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1091a7bb1f8f2c4b28f1fe2cef4980ca2d410a3d727d67ecc3178c9b0800f0" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "env" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc95de49ad098572c02d3fbf368c9a020bfff5ae78483685b77f51d8a7e9486d" +dependencies = [ + "num_threads", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fastbloom" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7f34442dbe69c60fe8eaf58a8cafff81a1f278816d8ab4db255b3bef4ac3c4" +dependencies = [ + "getrandom 0.3.4", + "libm", + "rand 0.9.4", + "siphasher", +] + +[[package]] +name = "fastrand" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" + +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fields" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v0.17.0#ff0e33a9b40f2467b35ef26aa2aabb4a624dfed3" +dependencies = [ + "cfg-if", + "num-bigint", + "paste", + "serde", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand 0.8.6", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 5.3.0", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash 0.2.0", + "serde", + "serde_core", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-conservative" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda06d18ac606267c40c04e41b9947729bf8b9efe74bd4e82b61a5f26a510b9f" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core 0.62.2", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", + "serde", + "serde_core", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "ix-common" +version = "0.1.0" +dependencies = [ + "bignat", + "blake3", + "indexmap", + "rustc-hash 2.1.2", +] + +[[package]] +name = "ix-ixon" +version = "0.1.0" +dependencies = [ + "bignat", + "blake3", + "dashmap", + "indexmap", + "ix-common", + "num-bigint", + "rayon", + "rustc-hash 2.1.2", + "sha2", + "tiny-keccak", +] + +[[package]] +name = "ix-kernel" +version = "0.1.0" +dependencies = [ + "bignat", + "blake3", + "dashmap", + "indexmap", + "itertools 0.14.0", + "ix-common", + "ix-ixon", + "log", + "num-bigint", + "rayon", + "rustc-hash 2.1.2", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.117", +] + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" +dependencies = [ + "cfg-if", + "futures-util", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", +] + +[[package]] +name = "keccak" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb26cec98cce3a3d96cbb7bced3c4b16e3d13f27ec56dbd62cbc8f39cfb9d653" +dependencies = [ + "cpufeatures 0.2.17", +] + +[[package]] +name = "keccak-asm" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1766b89733097006f3a1388a02849865d6bc98c89273cb622e29fdd209922183" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + +[[package]] +name = "konst" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128133ed7824fcd73d6e7b17957c5eb7bacb885649bd8c69708b2331a10bcefb" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "lib-c" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v0.17.0#b63274507a040bf9e09d22214df43066e8f80cb7" + +[[package]] +name = "lib-float" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v0.17.0#b63274507a040bf9e09d22214df43066e8f80cb7" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libffi" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0498fe5655f857803e156523e644dcdcdc3b3c7edda42ea2afdae2e09b2db87b" +dependencies = [ + "libc", + "libffi-sys", +] + +[[package]] +name = "libffi-sys" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d4f1d4ce15091955144350b75db16a96d4a63728500122706fb4d29a26afbb" +dependencies = [ + "cc", +] + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link 0.2.1", +] + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "macro-string" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "mpi" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41457b69d35846af2fec1877a4f3b866a72b6ab2c9500218f115e65e10993b21" +dependencies = [ + "build-probe-mpi", + "conv", + "libffi", + "mpi-sys", + "once_cell", + "smallvec", + "thiserror 2.0.18", +] + +[[package]] +name = "mpi-sys" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f655543f54b263cbc3d2456bf714bd807d66a33eff8f70136687f0776d34f76" +dependencies = [ + "bindgen 0.69.5", + "build-probe-mpi", + "cc", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "ntapi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags", +] + +[[package]] +name = "objc2-io-kit" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33fafba39597d6dc1fb709123dfa8289d39406734be322956a69f0931c73bb15" +dependencies = [ + "libc", + "objc2-core-foundation", +] + +[[package]] +name = "oid-registry" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f40cff3dde1b6087cc5d5f5d4d65712f34016a03ed60e9c08dcc392736b5b7" +dependencies = [ + "asn1-rs", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "parity-scale-codec" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "const_format", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link 0.2.1", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pem" +version = "3.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be" +dependencies = [ + "base64", + "serde_core", +] + +[[package]] +name = "pest" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pil-std-lib" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v0.17.0#ff0e33a9b40f2467b35ef26aa2aabb4a624dfed3" +dependencies = [ + "colored", + "fields", + "num-bigint", + "num-traits", + "proofman-common", + "proofman-hints", + "proofman-util", + "rayon", + "rustc-hash 2.1.2", + "serde", + "serde_json", + "tracing", + "witness", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "precompiles-helpers" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v0.17.0#b63274507a040bf9e09d22214df43066e8f80cb7" +dependencies = [ + "ark-bls12-381", + "ark-bn254", + "ark-ff 0.5.0", + "ark-secp256k1", + "ark-secp256r1", + "ark-std 0.5.0", + "cfg-if", + "circuit", + "crunchy", + "lib-c", + "num-bigint", + "num-traits", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.117", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proofman" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v0.17.0#ff0e33a9b40f2467b35ef26aa2aabb4a624dfed3" +dependencies = [ + "bincode", + "blake3", + "borsh", + "bytemuck", + "chrono", + "colored", + "crossbeam-channel", + "csv", + "curves", + "fields", + "libloading", + "mpi", + "num-bigint", + "num-traits", + "pil-std-lib", + "proofman-common", + "proofman-hints", + "proofman-macros", + "proofman-starks-lib-c", + "proofman-util", + "proofman-verifier", + "rayon", + "serde", + "serde_json", + "tokio", + "tokio-util", + "tracing", + "witness", +] + +[[package]] +name = "proofman-common" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v0.17.0#ff0e33a9b40f2467b35ef26aa2aabb4a624dfed3" +dependencies = [ + "bincode", + "borsh", + "bytemuck", + "colored", + "crossbeam-channel", + "crossbeam-queue", + "csv", + "env", + "fields", + "lazy_static", + "libc", + "libloading", + "mpi", + "num_cpus", + "proofman-macros", + "proofman-starks-lib-c", + "proofman-util", + "rayon", + "serde", + "serde_json", + "sysinfo", + "thiserror 2.0.18", + "tracing", + "tracing-subscriber", + "yansi", +] + +[[package]] +name = "proofman-hints" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v0.17.0#ff0e33a9b40f2467b35ef26aa2aabb4a624dfed3" +dependencies = [ + "fields", + "itoa", + "proofman-common", + "proofman-starks-lib-c", + "proofman-util", + "tracing", +] + +[[package]] +name = "proofman-macros" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v0.17.0#ff0e33a9b40f2467b35ef26aa2aabb4a624dfed3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "proofman-starks-lib-c" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v0.17.0#ff0e33a9b40f2467b35ef26aa2aabb4a624dfed3" +dependencies = [ + "crossbeam-channel", + "tracing", +] + +[[package]] +name = "proofman-util" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v0.17.0#ff0e33a9b40f2467b35ef26aa2aabb4a624dfed3" +dependencies = [ + "bincode", + "bytemuck", + "colored", + "serde", + "sysinfo", +] + +[[package]] +name = "proofman-verifier" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v0.17.0#ff0e33a9b40f2467b35ef26aa2aabb4a624dfed3" +dependencies = [ + "bytemuck", + "fields", + "proofman-util", + "rayon", + "tracing", +] + +[[package]] +name = "proptest" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +dependencies = [ + "bit-set", + "bit-vec 0.8.0", + "bitflags", + "num-traits", + "rand 0.9.4", + "rand_chacha 0.9.0", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.1.2", + "rustls", + "socket2", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "bytes", + "fastbloom", + "getrandom 0.3.4", + "lru-slab", + "rand 0.9.4", + "ring", + "rustc-hash 2.1.2", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", + "serde", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", + "serde", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core 0.9.5", +] + +[[package]] +name = "rapidhash" +version = "4.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e48930979c155e2f33aa36ab3119b5ee81332beb6482199a8ecd6029b80b59" +dependencies = [ + "rustversion", +] + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rcgen" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57f6d249aad744e274e682777a50283a225a32705394ee6d5fcc01efa25e4055" +dependencies = [ + "pem", + "ring", + "rustls-pki-types", + "time", + "x509-parser", + "yasna", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "riscv" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v0.17.0#b63274507a040bf9e09d22214df43066e8f80cb7" + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "ruint" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0298da754d1395046b0afdc2f20ee76d29a8ae310cd30ffa84ed42acba9cb12a" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "ark-ff 0.5.0", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint", + "num-integer", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand 0.8.6", + "rand 0.9.4", + "rlp", + "ruint-macro", + "serde_core", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.28", +] + +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" +dependencies = [ + "aws-lc-rs", + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "rusty-fork" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3c81b43dc2d8877c216a3fccf76677ee1ebccd429566d3e67447290d0c42b2" +dependencies = [ + "bitcoin_hashes", + "rand 0.9.4", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb913707158fadaf0d8702c2db0e857de66eb003ccfdda5924b5f5ac98efb38" +dependencies = [ + "cc", +] + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "indexmap", + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77fd7028345d415a4034cf8777cd4f8ab1851274233b45f84e3d955502d93874" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sha3-asm" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f3f15d4e239ebe08413eed880e0f9b5af4b40ee0472543320efa91d488e96a7" +dependencies = [ + "cc", + "cfg-if", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shell-words" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77" + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "siphasher" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn-solidity" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53f425ae0b12e2f5ae65542e00898d500d4d318b4baf09f40fd0d410454e9947" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "sysinfo" +version = "0.35.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3ffa3e4ff2b324a57f7aeb3c349656c7b127c3c189520251a648102a92496e" +dependencies = [ + "libc", + "memchr", + "ntapi", + "objc2-core-foundation", + "objc2-io-kit", + "windows", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.2", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "time" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "time-macros" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.11+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "winnow 1.0.2", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow 1.0.2", +] + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "typenum" +version = "1.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-segmentation" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.3+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +dependencies = [ + "wit-bindgen 0.57.1", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen 0.51.0", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.117", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver 1.0.28", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31141ce3fc3e300ae89b78c0dd67f9708061d1d2eda54b8209346fd6be9a92c" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link 0.1.3", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link 0.2.1", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link 0.2.1", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link 0.1.3", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn 2.0.117", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.117", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver 1.0.28", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "witness" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v0.17.0#ff0e33a9b40f2467b35ef26aa2aabb4a624dfed3" +dependencies = [ + "colored", + "fields", + "libloading", + "proofman-common", + "proofman-util", + "serde_json", + "tracing", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "x509-parser" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d43b0f71ce057da06bc0851b23ee24f3f86190b07203dd8f567d0b706a185202" +dependencies = [ + "asn1-rs", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "ring", + "rusticata-macros", + "thiserror 2.0.18", + "time", +] + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + +[[package]] +name = "yasna" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5f6765e852b9b4dc8e2a76843e4d64d1cea8e79bcde0b6901aea8e7c7f08282" +dependencies = [ + "bit-vec 0.9.1", + "time", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zisk-common" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v0.17.0#b63274507a040bf9e09d22214df43066e8f80cb7" +dependencies = [ + "alloy-sol-types", + "anyhow", + "bincode", + "fields", + "libc", + "proofman", + "proofman-common", + "proofman-util", + "proofman-verifier", + "quinn", + "rcgen", + "rustls", + "serde", + "serde_json", + "sha2", + "thiserror 2.0.18", + "tokio", + "tracing", + "tracing-subscriber", + "zisk-core", +] + +[[package]] +name = "zisk-core" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v0.17.0#b63274507a040bf9e09d22214df43066e8f80cb7" +dependencies = [ + "elf", + "fields", + "lib-c", + "lib-float", + "paste", + "precompiles-helpers", + "rayon", + "riscv", + "serde", + "sha2", + "tiny-keccak", + "zisk-definitions", + "ziskos-hints", +] + +[[package]] +name = "zisk-definitions" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v0.17.0#b63274507a040bf9e09d22214df43066e8f80cb7" + +[[package]] +name = "zisk-guest" +version = "0.1.0" +dependencies = [ + "ix-common", + "ix-ixon", + "ix-kernel", + "ziskos", +] + +[[package]] +name = "zisk-host" +version = "0.1.0" +dependencies = [ + "ix-common", + "ix-ixon", +] + +[[package]] +name = "zisk-verifier" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v0.17.0#b63274507a040bf9e09d22214df43066e8f80cb7" +dependencies = [ + "proofman-verifier", +] + +[[package]] +name = "ziskos" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v0.17.0#b63274507a040bf9e09d22214df43066e8f80cb7" +dependencies = [ + "anyhow", + "ark-bn254", + "ark-ec", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "aurora-engine-modexp", + "bincode", + "blst", + "bytes", + "cfg-if", + "ctor", + "fields", + "getrandom 0.2.17", + "lazy_static", + "lib-c", + "num-bigint", + "num-integer", + "num-traits", + "once_cell", + "paste", + "precompiles-helpers", + "rand 0.8.6", + "ripemd", + "secp256k1", + "serde", + "sha2", + "tiny-keccak", + "tokio", + "zisk-common", + "zisk-definitions", + "zisk-verifier", + "zkvm-interface", +] + +[[package]] +name = "ziskos-hints" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v0.17.0#b63274507a040bf9e09d22214df43066e8f80cb7" +dependencies = [ + "anyhow", + "bincode", + "cfg-if", + "fields", + "getrandom 0.2.17", + "lazy_static", + "lib-c", + "num-bigint", + "num-integer", + "num-traits", + "paste", + "precompiles-helpers", + "rand 0.8.6", + "ripemd", + "serde", + "sha2", + "tiny-keccak", + "zisk-verifier", + "zkvm-interface", +] + +[[package]] +name = "zkvm-interface" +version = "0.17.0" +source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v0.17.0#b63274507a040bf9e09d22214df43066e8f80cb7" +dependencies = [ + "bindgen 0.72.1", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/zisk/Cargo.toml b/zisk/Cargo.toml new file mode 100644 index 00000000..59420199 --- /dev/null +++ b/zisk/Cargo.toml @@ -0,0 +1,14 @@ +[workspace] +members = ["host"] +# `guest/` is built via `zisk_sdk::build_program` for the +# riscv64ima-zisk-zkvm-elf target and only compiles under `cargo-zisk`; +# excluded so host workspace ops don't pick it up. +exclude = ["guest"] +resolver = "2" + +[workspace.dependencies] +zisk-sdk = { git = "https://github.com/0xPolygonHermez/zisk.git", tag = "v0.17.0" } +ziskos = { git = "https://github.com/0xPolygonHermez/zisk.git", tag = "v0.17.0" } + +[profile.release] +panic = "abort" diff --git a/zisk/guest/Cargo.toml b/zisk/guest/Cargo.toml new file mode 100644 index 00000000..ab859667 --- /dev/null +++ b/zisk/guest/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "zisk-guest" +version = "0.1.0" +edition = "2024" + +[dependencies] +ixon = { path = "../../crates/ixon" } +ix-kernel = { path = "../../crates/kernel" } +ziskos = { git = "https://github.com/0xPolygonHermez/zisk.git", tag = "v0.17.0" } diff --git a/zisk/guest/src/main.rs b/zisk/guest/src/main.rs new file mode 100644 index 00000000..ba4e9399 --- /dev/null +++ b/zisk/guest/src/main.rs @@ -0,0 +1,62 @@ +//! Zisk guest binary: prove that every named constant in a serialized Ixon +//! environment typechecks under the Ix kernel. +//! +//! Input (via `ziskos::io::read`): +//! - `Vec`: Ixon-serialized environment (`ixon::env::Env::get` format). +//! +//! Output (via `ziskos::io::commit`): +//! - `u32`: count of constants that failed typechecking (0 = all pass). + +#![no_main] +ziskos::entrypoint!(main); + +use ixon::env::Env as IxonEnv; +use ixon::metadata::ConstantMetaInfo; +use ix_kernel::id::KId; +use ix_kernel::ingress::ixon_ingress_owned; +use ix_kernel::mode::Meta; +use ix_kernel::tc::TypeChecker; + +fn main() { + println!("[guest] start"); + let env_bytes: &[u8] = ziskos::io::read_input_slice(); + println!("[guest] read input: {} bytes", env_bytes.len()); + + let env = + IxonEnv::get(&mut &env_bytes[..]).expect("invalid Ixon environment"); + println!( + "[guest] env: consts={} named={} names={} blobs={} comms={}", + env.consts.len(), + env.named.len(), + env.names.len(), + env.blobs.len(), + env.comms.len() + ); + + // Skip `Muts` entries: they're mutual-block pointers, not standalone + // checkable constants. This matches `all_checkable_ixon_names` in + // `crates/ffi/src/kernel.rs` used by `ix check-ixon`. + let named: Vec<(_, _)> = env + .named + .iter() + .filter(|e| !matches!(e.value().meta.info, ConstantMetaInfo::Muts { .. })) + .map(|e| (e.key().clone(), e.value().addr.clone())) + .collect(); + println!("[guest] collected {} named entries", named.len()); + + let (mut kenv, _intern) = + ixon_ingress_owned::(env).expect("ingress failed"); + println!("[guest] ingress complete"); + + let mut failures: u32 = 0; + let mut tc = TypeChecker::new(&mut kenv); + for (name, addr) in named { + let kid = KId::::new(addr, name); + if tc.check_const(&kid).is_err() { + failures = failures.saturating_add(1); + } + } + println!("[guest] typecheck done: {} failures", failures); + + ziskos::io::commit(&failures); +} diff --git a/zisk/host/Cargo.toml b/zisk/host/Cargo.toml new file mode 100644 index 00000000..6bad99e1 --- /dev/null +++ b/zisk/host/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "zisk-host" +version = "0.1.0" +edition = "2024" +default-run = "zisk-host" + +[[bin]] +name = "zisk-host" +path = "src/main.rs" + +[dependencies] +ixon = { path = "../../crates/ixon" } +zisk-sdk = { workspace = true } +anyhow = "1" +clap = { version = "4.0", features = ["derive"] } +tokio = { version = "1", features = ["macros", "rt-multi-thread"] } + +[build-dependencies] +zisk-sdk = { workspace = true } diff --git a/zisk/host/build.rs b/zisk/host/build.rs new file mode 100644 index 00000000..e9149855 --- /dev/null +++ b/zisk/host/build.rs @@ -0,0 +1,3 @@ +fn main() { + zisk_sdk::build_program("../guest"); +} diff --git a/zisk/host/src/lib.rs b/zisk/host/src/lib.rs new file mode 100644 index 00000000..b92d8d56 --- /dev/null +++ b/zisk/host/src/lib.rs @@ -0,0 +1,3 @@ +use zisk_sdk::{load_program, GuestProgram}; + +pub static PROGRAM: GuestProgram = load_program!("zisk-guest"); diff --git a/zisk/host/src/main.rs b/zisk/host/src/main.rs new file mode 100644 index 00000000..75ecb97e --- /dev/null +++ b/zisk/host/src/main.rs @@ -0,0 +1,99 @@ +//! Drive the Zisk guest: load an Ixon environment, execute (or prove) the +//! kernel typecheck over it. +//! +//! ```shell +//! RUST_LOG=info cargo run --release -- --execute +//! RUST_LOG=info cargo run --release -- --execute --ixe ../minimal.ixe +//! RUST_LOG=info cargo run --release # prove +//! ``` + +use std::fs; +use std::path::PathBuf; +use std::time::{Duration, Instant}; + +use anyhow::Result; +use clap::Parser; +use ixon::env::Env as IxonEnv; +use zisk_host::PROGRAM; +use zisk_sdk::{ExecutorKind, ProverClient, ZiskStdin}; + +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +struct Args { + /// Run the program in the VM only — no proof. + #[arg(long, conflicts_with = "verify_constraints")] + execute: bool, + + /// Run the constraint checker without generating a proof. + #[arg(long)] + verify_constraints: bool, + + /// Path to a `.ixe` file produced by `lake exe ix compile`. If omitted, an + /// empty `IxonEnv` is used. + #[arg(long)] + ixe: Option, +} + +fn load_env_bytes(ixe: Option<&PathBuf>) -> Vec { + match ixe { + Some(path) => fs::read(path).expect("read ixe input"), + None => { + let env = IxonEnv::new(); + let mut buf = Vec::new(); + env.put(&mut buf).expect("env.put"); + buf + }, + } +} + +#[tokio::main] +async fn main() -> Result<()> { + zisk_sdk::setup_logger(); + + let args = Args::parse(); + let env_bytes = load_env_bytes(args.ixe.as_ref()); + + let stdin = ZiskStdin::new(); + stdin.write_slice(&env_bytes); + + let client = + ProverClient::embedded().executor(ExecutorKind::Assembly).build()?; + + client.upload(&PROGRAM).run()?; + client.setup(&PROGRAM).run()?.await?; + + if args.execute { + let result = client + .execute(&PROGRAM, stdin) + .executor(ExecutorKind::Assembly) + .run()? + .await?; + println!("cycles: {}", result.get_execution_steps()); + return Ok(()); + } + + if args.verify_constraints { + client.verify_constraints(&PROGRAM, stdin).run()?.await?; + println!("constraints verified"); + return Ok(()); + } + + let start = Instant::now(); + let result = client + .prove(&PROGRAM, stdin) + .executor(ExecutorKind::Assembly) + .run()? + .await?; + let duration = Duration::from_millis(result.get_proving_time()); + println!( + "proof generated in {:.2}s (wall {:.2}s, {} steps)", + duration.as_secs_f64(), + start.elapsed().as_secs_f64(), + result.get_execution_steps() + ); + + result.verify()?; + println!("proof verified"); + + Ok(()) +}