Skip to content

Commit 28da946

Browse files
committed
Implement milestone 2 vanilla STARK proofs
1 parent 42832d1 commit 28da946

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1519
-27121
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,22 @@ path = "src/bin/tvm.rs"
1414

1515
[features]
1616
default = []
17-
burn-model = ["dep:burn", "dep:serde_json"]
18-
onnx-export = ["dep:onnx-protobuf", "dep:protobuf", "dep:serde_json", "dep:tract-onnx"]
17+
burn-model = ["dep:burn"]
18+
onnx-export = ["dep:onnx-protobuf", "dep:protobuf", "dep:tract-onnx"]
1919
full = ["burn-model", "onnx-export"]
2020

2121
[dependencies]
22+
ark-ff = "0.5"
23+
blake2 = "0.10"
2224
burn = { version = "=0.20.1", features = ["ndarray"], optional = true }
2325
clap = { version = "4.5.38", features = ["derive"] }
2426
crossterm = "0.28.1"
2527
onnx-protobuf = { version = "0.2.3", optional = true }
2628
protobuf = { version = "=3.4.0", optional = true }
2729
ratatui = "0.29.0"
2830
serde = { version = "1.0.219", features = ["derive"] }
29-
serde_json = { version = "1.0.140", optional = true }
31+
serde_json = "1.0.140"
32+
sha3 = "0.10"
3033
thiserror = "2.0.12"
3134
tract-onnx = { version = "0.23.0-dev.2", optional = true }
3235

@@ -40,3 +43,7 @@ proptest = "1.6"
4043
[[bench]]
4144
name = "hull_benchmark"
4245
harness = false
46+
47+
[[bench]]
48+
name = "vanillastark_benchmark"
49+
harness = false

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ A working implementation of the Percepta architecture in Rust:
6363

6464
### Milestone 2: Vanilla STARK Proof
6565

66-
*Status: planned.*
66+
*Status: implemented for the average-hard execution path and the current arithmetic / control-flow VM subset. Unsupported instructions are rejected explicitly.*
67+
68+
The in-repo prototype now lives under `src/vanillastark/` and is exposed as
69+
`transformer_vm_rs::vanillastark`.
6770

6871
Build a minimal, self-contained STARK prover from scratch over the execution trace. No dependencies on production proving systems --- the goal is to understand and validate the proof construction end to end.
6972

@@ -139,6 +142,12 @@ cargo run --bin tvm -- run programs/counter.tvm --max-steps 128 --trace
139142
# Verify transformer matches the native interpreter
140143
cargo run --bin tvm -- run programs/fibonacci.tvm --layers 3 --verify-native
141144

145+
# Produce a standalone vanilla STARK proof for a program execution
146+
cargo run --bin tvm -- prove-stark programs/fibonacci.tvm -o fibonacci.proof.json
147+
148+
# Verify a saved vanilla STARK proof without re-running the program
149+
cargo run --bin tvm -- verify-stark fibonacci.proof.json
150+
142151
# Interactive TUI
143152
cargo run --bin tvm -- tui programs/fibonacci.tvm --layers 3 --max-steps 128
144153

@@ -389,9 +398,9 @@ This is what makes long execution traces tractable. At step 1,000,000, each memo
389398

390399
This is an MVP. Intentionally narrow, intentionally correct.
391400

392-
**Implemented:** compact ISA, transformer execution, hull-backed memory, multiple attention modes, native interpreter, differential verification, CLI, TUI, benchmarks.
401+
**Implemented:** compact ISA, transformer execution, hull-backed memory, multiple attention modes, native interpreter, differential verification, CLI, TUI, benchmarks, vanilla STARK proofs for the current average-hard arithmetic / control-flow subset.
393402

394-
**Not implemented:** WASM frontend, learned/trained weights, GPU acceleration, shared-address attention, STARK proof generation.
403+
**Not implemented:** WASM frontend, learned/trained weights, GPU acceleration, shared-address attention, full-ISA STARK AIR (bitwise / compare), non-average-hard proof paths, production STWO prover integration.
395404

396405
The narrowness is the point. The semantics are small enough to inspect, strong enough to test, and structured enough to prove over.
397406

0 commit comments

Comments
 (0)