Skip to content

refactor(stm): Reuse the cached unsafe SRS in the SNARK test setups - #3443

Open
damrobi wants to merge 6 commits into
mainfrom
damrobi/msnark/3433-reuse-cached-unsafe-srs
Open

refactor(stm): Reuse the cached unsafe SRS in the SNARK test setups#3443
damrobi wants to merge 6 commits into
mainfrom
damrobi/msnark/3433-reuse-cached-unsafe-srs

Conversation

@damrobi

@damrobi damrobi commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Content

This PR includes an update to the way we use the unsafe SNARK setup in tests in order to reduce the runtime of the tests.

Changes

  • Reuse existing unsafe SRS files on disk instead of regenerating them each run.
  • Stop unconditionally downsizing test SRS when it already matches the circuit's degree, avoiding a needless FFT.
  • Split build_for_test into a fast default (exact degree) and an explicit oversized variant, for both SnarkProverSetup and IvcSnarkProverSetup.
  • Drop SRS degree from the IVC key-cache fingerprint, since derived keys don't depend on it. This lets tests at different degrees share one key cache.
  • Cache the unsafe SRS by degree and seed only, shared across all parameter sets instead of duplicated per test.

Gain in test time

Baseline: 1h11m47s (nightly 30/07 https://github.com/IntersectMBO/mithril/actions/runs/30506077425/job/90756011560)

After commit 1: 1h00m56s (https://github.com/IntersectMBO/mithril/actions/runs/30538872179/job/90858636858)

After commit 2: 40m50s (https://github.com/IntersectMBO/mithril/actions/runs/30552401815/job/90904114168?pr=3443)

After commit 5: 34m49s (https://github.com/IntersectMBO/mithril/actions/runs/30643293824/job/91198342959?pr=3443)

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Comments

Issue(s)

Closes #3433

@damrobi damrobi self-assigned this Jul 30, 2026
@damrobi damrobi added the run-slow-tests Technical label to run slow tests tiers in the CI. label Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Test Results

     5 files  ± 0     209 suites  ±0   2h 26m 5s ⏱️ + 1h 31m 0s
 3 411 tests +81   3 411 ✅ +81  0 💤 ±0  0 ❌ ±0 
11 180 runs  +90  11 180 ✅ +90  0 💤 ±0  0 ❌ ±0 

Results for commit bd12ad0. ± Comparison against base commit a2e77d8.

♻️ This comment has been updated with latest results.

@damrobi
damrobi force-pushed the damrobi/msnark/3433-reuse-cached-unsafe-srs branch from 46c9d3e to 875d634 Compare July 31, 2026 09:09
@damrobi
damrobi temporarily deployed to testing-2-preview July 31, 2026 16:24 — with GitHub Actions Inactive
@damrobi
damrobi temporarily deployed to testing-preview July 31, 2026 16:24 — with GitHub Actions Inactive
@damrobi
damrobi force-pushed the damrobi/msnark/3433-reuse-cached-unsafe-srs branch 2 times, most recently from dec4f2c to 3545175 Compare August 3, 2026 09:03
@damrobi
damrobi marked this pull request as ready for review August 3, 2026 09:06
@damrobi
damrobi force-pushed the damrobi/msnark/3433-reuse-cached-unsafe-srs branch from 3545175 to bd12ad0 Compare August 3, 2026 10:06
@damrobi
damrobi deployed to testing-2-preview August 3, 2026 11:24 — with GitHub Actions Active
@damrobi
damrobi deployed to testing-preview August 3, 2026 11:24 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-slow-tests Technical label to run slow tests tiers in the CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reuse the cached unsafe SRS in the SNARK test setups

1 participant