You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consolidate the halo2_snark slow proof tests around shared and golden proofs #3463
Each of the 16 halo2_snark::proof::slow tests generates its own full proof (100s to 620s each, 3458s aggregated) even when the assertion only needs proof bytes to tamper with.
What
Prove once per configuration and run each negative verify assertion as its own unit test against a committed golden proof or a cached proof, keeping 4 or 5 genuine proving tests.
How
All tests live in mithril-stm/src/proof_system/halo2_snark/proof.rs.
Route the verify-only tests to the committed golden proof (GOLDEN_PROOF_JSON and golden_proof(), parameters m=200, k=3, phi_f=0.8, depth 4):
valid_proof_verifies, then merge it into golden_conversion if routing makes them identical
Prove once into the content-keyed cache directory for different_parameters_prove_and_verify_fails, which needs two parameter sets the single golden proof cannot serve (a proof is a few KB; fingerprint by parameters, depth, message, and prover seed)
Proving is only ~0.74 s of that test. The other ~3.6 s is the two build_for_test calls, which the cache cannot avoid: the verifying keys still have to be derived from the current circuit to check the cached proof against. So it removes the cheapest part of the test and adds the derivations to the rest.
On CI the cache directory is empty on every run, so this is a pure +0.65 s regression until the test caches are persisted.
I left the test unchanged and the item unticked; the patch is ready if you disagree. Are you fine with this conclusion?
Wrong key read from the embedded production key instead of a second prover
1 test
3.5 s
0.05 s
included above
Fresh-proof prepare_and_check coverage added back
1 test
2.82 s
2.84 s
+0.03 s
Forged proof read from the content-keyed cache
1 test
4.6 s
5.3 s
not shipped, regression
Suite
Before
After
Gain
halo2_snark::proof slow, local warm
33.9 s
15.3 s
-18.5 s (-55 %)
halo2_snark::proof slow, local cold
65.8 s
47.1 s
-18.7 s (-28 %)
halo2_snark::proof slow, CI
1358 s
1140 s
-218 s (-16 %)
Local figures are serial (--test-threads 1); the CI row compares PR #3483 against the nightly on 58b575afb, the branch's base commit.
Remarks
The CI baseline for these 16 tests is 1358 s, not the 3458 s in the issue: that figure predates Reuse the cached unsafe SRS in the SNARK test setups #3433's key cache. The tier was already about 2.5x cheaper than the estimate assumed, so the saving is proportionally smaller than the ~35 minutes stated.
On CI the change removed 324 s outright: the seven routed tests fall from 302.7 s to 4.3 s, and the deleted one was 25.8 s. The aggregate improves by 218 s rather than 324 s because the eight untouched tests billed +106 s more than in the nightly. They are byte-identical to main, the differences are spread across them and one is negative, so this is CI wall-clock variance rather than added work.
The cold floor does not move: 31.8 s before and after, locally. It is the five distinct parameter sets, each paying one unsafe SRS generation plus keygen on first touch, and all five are still required by tests this ticket keeps. We removed proving, not keygen. Retiring parameter sets rather than proofs is where the remaining time sits, and that would change what the surviving proving tests prove.
Activity
hjeljeli32 commentedon Aug 18, 2026
Dear @jpraynaud @damrobi
The cached proof for
different_parameters_prove_and_verify_failsdoes not payMeasured locally,
ci-tests-snark,--test-threads 1:Proving is only ~0.74 s of that test. The other ~3.6 s is the two
build_for_testcalls, which the cache cannot avoid: the verifying keys still have to be derived from the current circuit to check the cached proof against. So it removes the cheapest part of the test and adds the derivations to the rest.On CI the cache directory is empty on every run, so this is a pure +0.65 s regression until the test caches are persisted.
I left the test unchanged and the item unticked; the patch is ready if you disagree. Are you fine with this conclusion?
hjeljeli32 commentedon Aug 19, 2026
Dear @jpraynaud and @damrobi, here is the gain
prepare_and_checkcoverage added backhalo2_snark::proofslow, local warmhalo2_snark::proofslow, local coldhalo2_snark::proofslow, CILocal figures are serial (
--test-threads 1); the CI row compares PR #3483 against the nightly on58b575afb, the branch's base commit.Remarks
main, the differences are spread across them and one is negative, so this is CI wall-clock variance rather than added work.