Skip to content

Commit 75405a0

Browse files
arthurpaulinogabriel-barrettsamuelburnham
authored andcommitted
Aiur2 prove/verify (#183)
* prove and verify for Aiur2 * env var to opt out of parallelism * bump the Rust toolchain --------- Co-authored-by: Gabriel Barreto <gabriel.aquino.barreto@gmail.com> Co-authored-by: Samuel Burnham <45365069+samuelburnham@users.noreply.github.com>
1 parent f4129dc commit 75405a0

34 files changed

+1937
-489
lines changed

Cargo.lock

Lines changed: 347 additions & 194 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ binius_utils = { git = "https://github.com/IrreducibleOSS/binius.git", rev = "23
2121
bumpalo = "3"
2222
groestl_crypto = { package = "groestl", version = "0.10.1" }
2323
proptest = "1"
24-
p3-goldilocks = "0.3.0"
25-
p3-field = "0.3.0"
26-
rayon = "1"
24+
multi-stark = { git = "https://github.com/argumentcomputer/multi-stark.git", rev = "f3017f7f1ad5f3e3149b552e188e9f9e09370a97" }
25+
rayon = "1.7.0"
2726
rand = "0.9.1"
2827
rustc-hash = "2"
29-
indexmap = "2"
28+
indexmap = { version = "2", features = ["rayon"] }
3029
bytes = "1.10.1"
3130
tiny-keccak = { version = "2.0.2", features = ["keccak"] }
3231

@@ -37,4 +36,4 @@ iroh-base = "0.34.0"
3736
iroh-blobs = { version = "0.34.0", features = ["rpc"] }
3837

3938
[features]
40-
default = []
39+
parallel = ["multi-stark/parallel"]

Ix/Aiur2/Bytecode.lean

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ inductive Op
1313
| add : ValIdx → ValIdx → Op
1414
| sub : ValIdx → ValIdx → Op
1515
| mul : ValIdx → ValIdx → Op
16-
| call : FunIdx → Array ValIdx → Op
16+
| call : FunIdx → Array ValIdx → (outputSize : Nat) → Op
1717
| store : Array ValIdx → Op
18-
| load : (width : Nat) → ValIdx → Op
18+
| load : (size : Nat) → ValIdx → Op
1919
deriving Repr
2020

2121
mutual
@@ -33,37 +33,30 @@ mutual
3333
end
3434

3535
/-- The circuit layout of a function -/
36-
structure CircuitLayout where
36+
structure FunctionLayout where
37+
inputSize : Nat
38+
outputSize : Nat
3739
/-- Bit values that identify which path the computation took.
3840
Exactly one selector must be set. -/
3941
selectors : Nat
4042
/-- Represent registers that hold temporary values and can be shared by
4143
different circuit paths, since they never overlap. -/
4244
auxiliaries : Nat
43-
/-- Constraint slots that can be shared in different paths of the circuit. -/
44-
sharedConstraints : Nat
45+
/-- Lookups can be shared across calls, stores, loads and returns from
46+
different paths. -/
47+
lookups : Nat
4548
deriving Inhabited, Repr
4649

4750
structure Function where
48-
inputSize : Nat
49-
outputSize : Nat
5051
body : Block
51-
circuitLayout: CircuitLayout
52+
layout: FunctionLayout
5253
deriving Inhabited, Repr
5354

5455
structure Toplevel where
5556
functions : Array Function
56-
memoryWidths : Array Nat
57+
memorySizes : Array Nat
5758
deriving Repr
5859

59-
@[extern "c_rs_toplevel_execute_test"]
60-
private opaque Toplevel.executeTest' :
61-
@& Toplevel → @& FunIdx → @& Array G → USize → Array G
62-
63-
def Toplevel.executeTest (toplevel : Toplevel) (funIdx : FunIdx) (args : Array G) : Array G :=
64-
let function := toplevel.functions[funIdx]!
65-
toplevel.executeTest' funIdx args function.outputSize.toUSize
66-
6760
end Bytecode
6861

6962
end Aiur

0 commit comments

Comments
 (0)