Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ab14251
chore: enable '--pedantic-solving' on more tests
michaeljklein Mar 13, 2025
28efc12
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Mar 13, 2025
49515fe
accumulate to zero instead of 'point_at_infinity' in 'multi_scalar_mu…
michaeljklein Mar 17, 2025
1ccd346
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Mar 18, 2025
81d026e
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Mar 25, 2025
99dc97d
patch 'multi_scalar_mul' execution test w/ 'accumulator = 1'
michaeljklein Mar 25, 2025
db529c4
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Mar 26, 2025
d62a5c7
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Mar 26, 2025
7768e86
move pedantic solving flag to execute.rs
michaeljklein Mar 27, 2025
777d708
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Mar 28, 2025
7481a46
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Apr 9, 2025
0a6794d
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Apr 11, 2025
743dafb
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Apr 15, 2025
656900b
skip failing tests, update snapshots, use '--pedantic-solving' for ex…
michaeljklein Apr 15, 2025
5ade20a
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Apr 15, 2025
e5ac54d
nargo fmt
michaeljklein Apr 15, 2025
3374914
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Apr 21, 2025
62adf29
cargo insta
michaeljklein Apr 21, 2025
82accbf
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Apr 21, 2025
543d8c4
remove --pedantic-solving from rebuild.sh
michaeljklein Apr 21, 2025
658343f
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Apr 21, 2025
324f79b
remove unused snapshot
michaeljklein Apr 22, 2025
5f07370
use method from 'master' to generate-solidity-verifiers.sh, but inclu…
michaeljklein Apr 22, 2025
83b2411
Merge branch 'master' into michaeljklein/pedantic-flag-tests
michaeljklein Apr 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/run-external-repo-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ sed -i '/^compiler_version/d' {Nargo.toml,./**/Nargo.toml}
set -e

BEFORE=$SECONDS
$NARGO test --silence-warnings --skip-brillig-constraints-check --format json $NARGO_ARGS | tee $OUTPUT_FILE
$NARGO test --silence-warnings --skip-brillig-constraints-check --pedantic-solving --format json $NARGO_ARGS | tee $OUTPUT_FILE
TIME=$(($SECONDS-$BEFORE))

if [ ! -s $OUTPUT_FILE ]; then
# The file is empty so we delete it to signal that `nargo test` failed before it could run any tests
rm -f $OUTPUT_FILE
fi

jq --null-input "[{ name: \"$NAME\", value: (\"$TIME\" | tonumber), unit: \"s\" }]" > $BENCHMARK_FILE
jq --null-input "[{ name: \"$NAME\", value: (\"$TIME\" | tonumber), unit: \"s\" }]" > $BENCHMARK_FILE
4 changes: 2 additions & 2 deletions compiler/integration-tests/scripts/compile-programs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ self_path=$(dirname "$(readlink -f "$0")")
package_root=$self_path/../

assert_lt_dir=$package_root/circuits/assert_lt/
nargo --program-dir $assert_lt_dir compile
nargo --program-dir $assert_lt_dir compile --pedantic-solving

fold_fibonacci_dir=$package_root/circuits/fold_fibonacci/
nargo --program-dir $fold_fibonacci_dir compile
nargo --program-dir $fold_fibonacci_dir compile --pedantic-solving
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ KEYS=$(mktemp -d)

# Codegen verifier contract for 1_mul
mul_dir=$repo_root/test_programs/execution_success/1_mul
nargo --program-dir $mul_dir compile
nargo --program-dir $mul_dir compile --pedantic-solving
$NARGO_BACKEND_PATH write_vk -b $mul_dir/target/1_mul.json -o $KEYS --oracle_hash keccak
$NARGO_BACKEND_PATH write_solidity_verifier -k $KEYS/vk -o $contracts_dir/1_mul.sol

# Codegen verifier contract for assert_statement
assert_statement_dir=$repo_root/test_programs/execution_success/assert_statement
nargo --program-dir $assert_statement_dir compile
nargo --program-dir $assert_statement_dir compile --pedantic-solving
$NARGO_BACKEND_PATH write_vk -b $assert_statement_dir/target/assert_statement.json -o $KEYS --oracle_hash keccak
$NARGO_BACKEND_PATH write_solidity_verifier -k $KEYS/vk -o $contracts_dir/assert_statement.sol

# Codegen verifier contract for recursion
recursion_dir=$repo_root/compiler/integration-tests/circuits/recursion
nargo --program-dir $recursion_dir compile
nargo --program-dir $recursion_dir compile --pedantic-solving
$NARGO_BACKEND_PATH write_vk --scheme ultra_honk --oracle_hash keccak -b $recursion_dir/target/recursion.json -o $KEYS
$NARGO_BACKEND_PATH write_solidity_verifier --scheme ultra_honk -k $KEYS/vk -o $contracts_dir/recursion.sol

Expand Down
6 changes: 3 additions & 3 deletions compiler/wasm/scripts/build-fixtures.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash

nargo compile --program-dir ./test/fixtures/simple
nargo compile --program-dir ./test/fixtures/with-deps
nargo compile --program-dir ./test/fixtures/noir-contract
nargo compile --program-dir ./test/fixtures/simple --pedantic-solving
nargo compile --program-dir ./test/fixtures/with-deps --pedantic-solving
nargo compile --program-dir ./test/fixtures/noir-contract --pedantic-solving
2 changes: 1 addition & 1 deletion examples/oracle_transcript/log_and_exec_transcript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cat Oracle.test.jsonl \
> Oracle.jsonl

# Execute `main` with the Prover.toml and Oracle.jsonl files.
nargo execute --skip-underconstrained-check --oracle-file Oracle.jsonl
nargo execute --skip-underconstrained-check --pedantic-solving --oracle-file Oracle.jsonl

# Also execute through `noir-execute`
noir-execute \
Expand Down
6 changes: 3 additions & 3 deletions examples/recursion/generate_recursive_proof.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BACKEND=${BACKEND:-bb}

# Execute and prove inner circuit (sum)
mkdir -p ./target/sum
nargo execute sum_witness --package sum
nargo execute sum_witness --package sum --pedantic-solving
$BACKEND prove -b ./target/sum.json -w ./target/sum_witness.gz --init_kzg_accumulator --output_format bytes_and_fields -o ./target/sum

# Generate vk for inner circuit
Expand All @@ -23,7 +23,7 @@ echo "key_hash = 0x0" >> $RECURSE_LEAF_PROVER_TOML # VK hash is not implemented


# Execute and prove `recurse_leaf`
nargo execute recurse_leaf_witness --package recurse_leaf
nargo execute recurse_leaf_witness --package recurse_leaf --pedantic-solving

mkdir -p ./target/leaf
$BACKEND prove -b ./target/recurse_leaf.json -w ./target/recurse_leaf_witness.gz --output_format bytes_and_fields --init_kzg_accumulator -o ./target/leaf
Expand All @@ -43,7 +43,7 @@ echo "public_inputs = $(cat ./target/leaf/public_inputs_fields.json)" >> $RECURS


# Execute and prove `recurse_node`
nargo execute recurse_node_witness --package recurse_node
nargo execute recurse_node_witness --package recurse_node --pedantic-solving

mkdir -p ./target/node
$BACKEND prove -b ./target/recurse_node.json -w ./target/recurse_node_witness.gz -o ./target/node --init_kzg_accumulator
Expand Down
2 changes: 1 addition & 1 deletion test_programs/compilation_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for dir in ${tests_to_profile[@]}; do
TOTAL_TIME=0

for ((i = 1; i <= NUM_RUNS; i++)); do
NOIR_LOG=trace NARGO_LOG_DIR=./tmp nargo compile --force --silence-warnings $FLAGS
NOIR_LOG=trace NARGO_LOG_DIR=./tmp nargo compile --force --pedantic-solving --silence-warnings $FLAGS
done

TIMES=($(jq -r '. | select(.target == "nargo::cli" and .fields.message == "close") | .fields."time.busy"' ./tmp/*))
Expand Down
2 changes: 1 addition & 1 deletion test_programs/execution_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ for dir in ${tests_to_profile[@]}; do
TOTAL_TIME=0

for ((i = 1; i <= NUM_RUNS; i++)); do
NOIR_LOG=trace NARGO_LOG_DIR=./tmp nargo execute --silence-warnings
NOIR_LOG=trace NARGO_LOG_DIR=./tmp nargo execute --pedantic-solving --silence-warnings
done

TIMES=($(jq -r '. | select(.target == "nargo::ops::execute" and .fields.message == "close") | .fields."time.busy"' ./tmp/*))
Expand Down
14 changes: 14 additions & 0 deletions tooling/nargo_cli/tests/comptime_correctness.proptest-regressions
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Seeds for failure cases proptest has generated in the past. It is
# automatically read and these particular cases re-run before any
# novel cases are generated.
#
# It is recommended to check this file in to source control so that
# everyone who runs the test benefits from these saved cases.
cc 61042657e25848176247cad004d50238ed31fa0f0ef493dbfc504515c5a65cd1 # shrinks to (comptime_expr, runtime_expr, a, b) = ("78981287 / 1661494462", "a / b", 78981287, 1661494462)
cc 18cc582c81f2b4f993fb27b6a84e20830a03598b4f347ee2307a26cda0290044 # shrinks to (comptime_expr, runtime_expr, a, b) = ("153856295 - 3543581023", "a - b", 153856295, 3543581023)
cc 51662878a1f23ce05f5afda7ed0b2534c9cc35ac022d69a3e7f3f688d816e9f1 # shrinks to (comptime_expr, runtime_expr, a, b) = ("249512460 * 1654372632", "a * b", 249512460, 1654372632)
cc 47956ca2b12d1b1d575fcc9057502aeb3d2c9040c206c9c6cbc53d5897b99d53 # shrinks to (comptime_expr, runtime_expr, a, b) = ("29480924 + 3961410066", "a + b", 29480924, 3961410066)
cc 92a2baa828fb65dc55ce2b7dee53d9dcd9956423e3b04b6aada44a22eee53347 # shrinks to (comptime_expr, runtime_expr, a, b) = ("7533799 / 3594186306", "a / b", 7533799, 3594186306)
cc 75c3e62019d6e9b6b274d97b93649067ab0bc8e53f7bb27f3de2a597e2822ac8 # shrinks to (comptime_expr, runtime_expr, a, b) = ("234831728 - 3534706463", "a - b", 234831728, 3534706463)
cc d57cf1d61b4b71a383a313b06f9b51a373e800818fce3feefa7692df2af6d354 # shrinks to (comptime_expr, runtime_expr, a, b) = ("249626379 + 1522826944", "a + b", 249626379, 1522826944)
cc 5fcb8310b679ebc865ff81ba03c7f313b3de71236c56f826cfb0faf2ef0b2228 # shrinks to (comptime_expr, runtime_expr, a, b) = ("196454304 * 4072824723", "a * b", 196454304, 4072824723)
18 changes: 18 additions & 0 deletions tooling/nargo_cli/tests/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ mod tests {
// Allow more bytecode in exchange to catch illegal states.
nargo.arg("--enable-brillig-debug-assertions");

// Enable pedantic solving
let skip_pedantic_solving = [
// TODO(https://github.com/noir-lang/noir/issues/8098): all of these are failing with:
// ```
// Failed to solve program:
// \'Failed to solve blackbox function: embedded_curve_add, reason: Infinite input: embedded_curve_add(infinity, infinity)\'
// ```
"execution_success/multi_scalar_mul",
"execution_success/regression_5045",
"execution_success/regression_7744",
];
if !skip_pedantic_solving
.into_iter()
.any(|test_to_skip| test_program_dir.ends_with(test_to_skip))
{
nargo.arg("--pedantic-solving");
}

// Enable enums and ownership as unstable features
nargo.arg("-Zenums");

Expand Down
1 change: 1 addition & 0 deletions tooling/nargo_cli/tests/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ fn hello_world_example() {

let mut cmd = Command::cargo_bin("nargo").unwrap();
cmd.arg("execute");
cmd.arg("--pedantic-solving");
cmd.assert().success();
}
10 changes: 5 additions & 5 deletions tooling/noir_js/scripts/compile_test_programs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
NARGO=${NARGO:-nargo}

rm -rf ./test/noir_compiled_examples/**/target
$NARGO --program-dir ./test/noir_compiled_examples/assert_lt compile --force
$NARGO --program-dir ./test/noir_compiled_examples/assert_msg_runtime compile --force
$NARGO --program-dir ./test/noir_compiled_examples/fold_fibonacci compile --force
$NARGO --program-dir ./test/noir_compiled_examples/assert_raw_payload compile --force
$NARGO --program-dir ./test/noir_compiled_examples/databus compile --force
$NARGO --program-dir ./test/noir_compiled_examples/assert_lt compile --force --pedantic-solving
$NARGO --program-dir ./test/noir_compiled_examples/assert_msg_runtime compile --force --pedantic-solving
$NARGO --program-dir ./test/noir_compiled_examples/fold_fibonacci compile --force --pedantic-solving
$NARGO --program-dir ./test/noir_compiled_examples/assert_raw_payload compile --force --pedantic-solving
$NARGO --program-dir ./test/noir_compiled_examples/databus compile --force --pedantic-solving
Loading