Commit Graph

41 Commits

Author SHA1 Message Date
Lucas Clemente Vella
83e2c841e6 Trying buildjet CI runner (#1777) 2024-09-11 08:53:12 +00:00
Georg Wiese
41a61b1638 Add Mersene31Field (#1781)
Adds Plonky3's implementation of the Mersenne-31 field.

To test:
```
cargo run pil test_data/pil/fibonacci.pil -o output -f --field m31
```

The implementation is basically the same wrapper as for BabyBear, so I
moved the code to a macro and used it for both fields.
2024-09-10 16:24:12 +00:00
Georg Wiese
831edf3412 Print tracing profiling log (for Plonky3) (#1753)
With this change, we also print profiling logs for crates that are
instrumented using the `tracing` crate (if we're at least in the `DEBUG`
log level).

For example, for:
```bash
cargo run -r --bin powdr-rs compile riscv/tests/riscv_data/keccak -o output
RUST_LOG=debug cargo run -r --features plonky3,halo2 pil output/keccak.asm -o output -f --field gl --prove-with plonky3-composite
```

This prints:
```
== Proving machine: main (size 131072), stage 0
INFO     prove_with_key [ 1.84s | 0.23% / 100.00% ]
INFO     ┝━ infer log of constraint degree [ 141µs | 0.01% ]
INFO     ┝━ commit to trace data [ 458ms | 19.13% / 24.94% ]
INFO     │  ┕━ coset_lde_batch [ 107ms | 5.81% ] dims: 74x131072
INFO     ┝━ compute quotient polynomial [ 1.16s | 62.90% ]
INFO     ┝━ commit to quotient poly chunks [ 58.7ms | 2.14% / 3.19% ]
INFO     │  ┝━ coset_lde_batch [ 10.6ms | 0.58% ] dims: 2x131072
INFO     │  ┕━ coset_lde_batch [ 8.86ms | 0.48% ] dims: 2x131072
INFO     ┝━ compute_inverse_denominators [ 26.3ms | 1.43% ]
INFO     ┝━ reduce matrix quotient [ 10.9ms | 0.00% / 0.59% ] dims: 4x262144
INFO     │  ┝━ compute opened values with Lagrange interpolation [ 8.46ms | 0.46% ]
INFO     │  ┕━ reduce rows [ 2.42ms | 0.13% ]
INFO     ┝━ reduce matrix quotient [ 10.9ms | 0.00% / 0.59% ] dims: 4x262144
INFO     │  ┝━ compute opened values with Lagrange interpolation [ 8.91ms | 0.48% ]
INFO     │  ┕━ reduce rows [ 2.01ms | 0.11% ]
INFO     ┝━ reduce matrix quotient [ 20.4ms | 0.00% / 1.11% ] dims: 74x262144
INFO     │  ┝━ compute opened values with Lagrange interpolation [ 14.0ms | 0.76% ]
INFO     │  ┕━ reduce rows [ 6.35ms | 0.35% ]
INFO     ┝━ reduce matrix quotient [ 17.6ms | 0.00% / 0.96% ] dims: 74x262144
INFO     │  ┝━ compute opened values with Lagrange interpolation [ 11.2ms | 0.61% ]
INFO     │  ┕━ reduce rows [ 6.44ms | 0.35% ]
INFO     ┝━ reduce matrix quotient [ 7.55ms | 0.00% / 0.41% ] dims: 2x262144
INFO     │  ┝━ compute opened values with Lagrange interpolation [ 6.63ms | 0.36% ]
INFO     │  ┕━ reduce rows [ 913µs | 0.05% ]
INFO     ┝━ reduce matrix quotient [ 8.74ms | 0.00% / 0.48% ] dims: 2x262144
INFO     │  ┝━ compute opened values with Lagrange interpolation [ 7.92ms | 0.43% ]
INFO     │  ┕━ reduce rows [ 817µs | 0.04% ]
INFO     ┕━ FRI prover [ 57.8ms | 0.00% / 3.15% ]
INFO        ┝━ commit phase [ 56.0ms | 3.05% ]
INFO        ┝━ grind for proof-of-work witness [ 654µs | 0.04% ]
INFO        ┕━ query phase [ 1.09ms | 0.06% ]
INFO     verify_with_key [ 42.6ms | 99.63% / 100.00% ]
INFO     ┕━ infer log of constraint degree [ 158µs | 0.37% ]
==> Proof stage computed in 1.934923926s
```
2024-09-05 13:45:55 +00:00
Leo
c7fdc6cb2b baby bear field only (#1696)
Most minimal attempt at adding BabyBear, only adds the field and field
tests, but no powdr tests using the field.
2024-08-16 13:40:26 +00:00
Leo
2ecb5e578b add prover features to cli-rs (#1668) 2024-08-08 12:52:31 +00:00
Thibaut Schaeffer
01acfd736e Add plonky3 support (#1158)
plonky3 backend integration for witness columns only
2024-06-26 20:05:05 +00:00
Leo
34d04ed873 move internal dependencies to shared version (#1379)
Trying this out which will make releases much easier
2024-05-15 10:46:34 +00:00
Leo
101829b230 Split Rust compilation into its own CLI bin (#1348)
As suggested by @lvella .
I'm not too sure about this actually. I agree that compiling Rust ->
powdr-asm should have a separate pipeline somewhere, but before we could
do Rust -> proof in a single command, and with this we can't anymore.

- Do we expose the `prove` command and everything else here as well?
That'd be a lot of duplicated code.
- Do we force the user to first run `powdr-rs compile <rust_proj>` then
`powdr pil/prove ...`? That's potentially worse UX than right now.
- Do we keep all the Rust stuff in the `cli` crate?
2024-05-13 08:33:15 +00:00
chriseth
62c3eadc4c Re-enable non-inlined format args (#1362)
Fixes https://github.com/powdr-labs/powdr/issues/1360
2024-05-08 16:27:22 +00:00
Leo
c1f76f9bbf Halo2 single/aggr SNARK with Solidity verifier (#1256)
Co-authored-by: Georg Wiese <georgwiese@gmail.com>
Co-authored-by: Lucas Clemente Vella <lvella@powdrlabs.com>
2024-05-03 18:47:51 +00:00
Lucas Clemente Vella
5063ad670c Restore outputing commits and constants in the pipeline. (#1325) 2024-04-30 10:02:40 +00:00
Lucas Clemente Vella
ac9dcfda87 zkEVM prover backend (#1211)
Similar to #1193, but in here I am just interested in having it working
end-to-end, at least for a few cases, so that everybody can try it and
build upon.

<!--

Please follow this protocol when creating or reviewing PRs in this
repository:

- Leave the PR as draft until review is required.
- When reviewing a PR, every reviewer should assign themselves as soon
as they
start, so that other reviewers know the PR is covered. You should not be
discouraged from reviewing a PR with assignees, but you will know it is
not
  strictly needed.
- Unless the PR is very small, help the reviewers by not making forced
pushes, so
that GitHub properly tracks what has been changed since the last review;
use
  "merge" instead of "rebase". It can be squashed after approval.
- Once the comments have been addressed, explicitly let the reviewer
know the PR
  is ready again.

-->

---------

Co-authored-by: Leo <leo@powdrlabs.com>
2024-04-18 09:16:09 +00:00
Lucas Clemente Vella
9d104c2088 Removing pub and "test_" from test functions. (#1274)
One is unecessary, the other is redundant.

Co-authored-by: Lucas Clemente Vella <lucas.vella@powdrlabs.com>
2024-04-15 20:01:47 +00:00
Leo
001bd9a753 expose publics in CLI (#1236) 2024-04-04 11:29:27 +00:00
Leandro Pacheco
50eaab464e Coprocessors refactor (#1224)
- Refactor `CoProcessors` into a `Runtime` with submachines and syscalls
- Calls into prover functionality and submachines done via `ecall`
instead of "call symbol replacement"
- Call `poseidon_gl` machine with riscv registers by using the stack
(~50% speedup in many_chunks benchmark)
- New `riscv-syscalls` crate keeps the list of syscalls and related
constants
2024-04-03 18:37:32 +00:00
Vu Vo
6d6b4c9e14 Add log option in powdr command line (#1212)
# Context 
Now powdr can allow handle log in cli option. 

Example 

```bash
powdr --log DEBUG pil test_data/asm/book/hello_world.asm --field bn254 --force --inputs 0
``` 

--log value is LevelFilter 

```rust
pub enum LevelFilter {
    /// A level lower than all log levels.
    Off,
    /// Corresponds to the `Error` log level.
    Error,
    /// Corresponds to the `Warn` log level.
    Warn,
    /// Corresponds to the `Info` log level.
    Info,
    /// Corresponds to the `Debug` log level.
    Debug,
    /// Corresponds to the `Trace` log level.
    Trace,
} 
```

Fixes #164
2024-04-02 08:31:43 +00:00
Leandro Pacheco
02c52b5cb3 Remove support for running stand-alone rust files (#1220)
Change both tests and CLI to only support running rust crates
2024-04-01 18:45:40 +00:00
Leo Alt
2908938726 simplify coprocessors 2024-03-22 19:58:44 +01:00
Georg Wiese
80fafbe19c Spell-check 2024-03-20 16:12:55 +01:00
Leo Alt
b9b1d24455 allow riscv_executor::execute to take in the initial memory state 2024-03-19 20:49:21 +01:00
Georg Wiese
06866e4408 Fix soundness bug in mul instruction of RISC-V machine 2024-03-19 12:32:54 +01:00
Leo Alt
efe11f40fc enum declarations 2024-03-18 22:09:44 +01:00
schaeff
2378a2498e remove unused dependencies 2024-03-13 18:23:39 +01:00
chriseth
349f9aa461 Parse numbers as integers. 2024-03-08 15:48:49 +01:00
Leo Alt
18ddc65ef9 refactor pipeline to be a DAG instead of a linear path 2024-02-23 16:41:37 +01:00
Leo Alt
ef663bc649 make pilo output opt in 2024-02-22 14:19:06 +01:00
Georg Wiese
eb2f59aab3 Set default binary to powdr 2024-02-15 15:27:35 +01:00
Champii1
0cf2b977dc Add versioning for the analyzed types and schema validation
Remove dangling function in  macro

Fix variable name in schema_update.rs

Read the version number at runtime instread of compile time

Fix version_number parsing and write new schema after it

Add schemars feature `preserve_order`

Change unwrap for expect in schema_update.rs

Moved schema binary in its own crate

Graceful error management in powdr-schema instead of panic

Better graceful error handling in the pipeline and the cli

Fix clippy

Put the magic number at the start of the serialized data

Revert magic at the start of the file

Moved the SerializedAnalyzed to the schemas crate

Changed serialized.rs to analyzed.rs

Changed the magic number to be the ASCII `powdr`
2024-02-15 13:48:16 +01:00
Champii1
0c6ac7d2c2 Add serialization for Analyzed<T> and pipeline resume
Fix pipeline name from file name with suffix

Variable naming

Replace `splitted` with `split`

Co-authored-by: Leo <leo@ethereum.org>

Fix clippy

Add test for serde of PIL

Changed the optimized PIL file extension to .pilo

Changed function names to reflect the operation on pil object
2024-02-13 20:41:40 +01:00
Lucas Clemente Vella
390f3a191f New backend interface. 2024-02-13 11:24:47 +00:00
Lucas Clemente Vella
40950a9feb Cleanup on file reads and writes. 2024-02-09 11:04:08 +00:00
Lucas Clemente Vella
07835e0fec Updating rust version from 1.72 to 1.74. 2024-02-08 19:17:40 +00:00
Leo Alt
45069c968b Add verification key to Halo2 and support to vkey generation and proof
verification in CLI.
2024-02-06 14:50:53 +01:00
Georg Wiese
61b26b67fb Simplify continuations with clonable pipeline 2024-01-30 17:53:49 +01:00
Leo Alt
3daf9d90be add package info 2024-01-29 18:35:32 +01:00
Leo Alt
607c0043d7 add powdr- prefix to all crates 2024-01-23 18:51:29 +01:00
Lucas Clemente Vella
fca134cb9d Binary CLI renamed to powdr 2023-05-18 16:10:08 +01:00
schaeff
0b23b5bd40 make everything generic over FieldElementTrait 2023-05-12 14:56:30 +02:00
chriseth
a323e04671 Auto-detect if argument is crate or not. 2023-04-24 18:40:37 +02:00
schaeff
6616f66d10 workaround regex feature unification issue 2023-04-21 18:39:13 +02:00
schaeff
82cfa54696 split into small crates 2023-04-21 17:16:22 +02:00