Skip to content

Commit

Permalink
chore: cleanup integration tests (zkonduit#73)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Morton <[email protected]>
  • Loading branch information
alexander-camuto and jasonmorton authored Dec 7, 2022
1 parent e3e39a5 commit 22bd38c
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 260 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
jobs:
build:

runs-on: ubuntu-latest
runs-on: self-hosted

steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ plonk_verifier = { git = "https://github.com/privacy-scaling-explorations/plonk

[dev-dependencies]
criterion = {version = "0.3", features = ["html_reports"]}

seq-macro = "0.3.1"
test-case = "2.2.2"

[[bench]]
name = "affine"
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,17 @@ Commands:
verify Verifies a proof, returning accept or reject
help Print this message or the help of the given subcommand(s)

Options:
Options:
-T, --tolerance <TOLERANCE> The tolerance for error on model outputs [default: 0]
-S, --scale <SCALE> The denominator in the fixed point representation used when quantizing [default: 7]
-B, --bits <BITS> The number of bits used in lookup tables [default: 14]
-K, --logrows <LOGROWS> The log_2 number of rows [default: 16]
-h, --help Print help information
-V, --version Print version information
-S, --scale <SCALE> The denominator in the fixed point representation used when quantizing [default: 7]
-B, --bits <BITS> The number of bits used in lookup tables [default: 16]
-K, --logrows <LOGROWS> The log_2 number of rows [default: 17]
--public-inputs Flags whether inputs are public
--public-outputs Flags whether outputs are public
--public-params Flags whether params are public
-h, --help Print help information
-V, --version Print version information
```

`bits`, `scale`, `tolerance`, and `logrows` have default values. You can use tolerance to express a tolerance to a certain amount of quantization error on the output eg. if set to 2 the circuit will verify even if the generated output deviates by an absolute value of 2 on any dimension from the expected output. `prove`, `mock`, `fullprove` all require `-D` and `-M` parameters, which if not provided, the cli will query the user to manually enter the path(s).
Expand Down
4 changes: 2 additions & 2 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ pub struct Cli {
/// Flags whether inputs are public
#[arg(long, default_value = "false")]
pub public_inputs: bool,
/// Flags whether inputs are public
/// Flags whether outputs are public
#[arg(long, default_value = "true")]
pub public_outputs: bool,
/// Flags whether inputs are public
/// Flags whether params are public
#[arg(long, default_value = "false")]
pub public_params: bool,
}
Expand Down
7 changes: 4 additions & 3 deletions src/tensor/var.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::*;
use crate::abort;
use log::error;
use std::cmp::min;
/// A wrapper around Halo2's `Column<Fixed>` or `Column<Advice>`.
/// The wrapper allows for `VarTensor`'s dimensions to differ from that of the inner (wrapped) columns.
/// The inner vector might, for instance, contain 3 Advice Columns. Each of those columns in turn
Expand Down Expand Up @@ -34,7 +35,7 @@ impl VarTensor {
equality: bool,
) -> Self {
let base = 2u32;
let max_rows = base.pow(k as u32) as usize - cs.blinding_factors() - 1;
let max_rows = min(512, base.pow(k as u32) as usize - cs.blinding_factors() - 1);
let modulo = (capacity / max_rows) + 1;
let mut advices = vec![];
for _ in 0..modulo {
Expand All @@ -61,7 +62,7 @@ impl VarTensor {
equality: bool,
) -> Self {
let base = 2u32;
let max_rows = base.pow(k as u32) as usize - cs.blinding_factors() - 1;
let max_rows = min(512, base.pow(k as u32) as usize - cs.blinding_factors() - 1);
let modulo = (capacity / max_rows) + 1;
let mut fixed = vec![];
for _ in 0..modulo {
Expand Down Expand Up @@ -197,7 +198,7 @@ impl VarTensor {
let t = Tensor::new(None, dims).unwrap();
t.enum_map(|coord, _: usize| {
let (x, y) = self.cartesian_coord(offset + coord);

match region.assign_advice_from_instance(
|| "pub input anchor",
*instance,
Expand Down
Loading

0 comments on commit 22bd38c

Please sign in to comment.