Skip to content

add mobench support to ProveKit v1#451

Merged
dcbuild3r merged 26 commits into
v1from
dcbuilder/pr430-mobench-v1-browserstack
Jul 20, 2026
Merged

add mobench support to ProveKit v1#451
dcbuild3r merged 26 commits into
v1from
dcbuilder/pr430-mobench-v1-browserstack

Conversation

@dcbuild3r

Copy link
Copy Markdown
Collaborator

Reopened from #430 using the new dcbuilder/* branch naming.

Old PR: #430
Replacement branch: dcbuilder/pr430-mobench-v1-browserstack
Old head branch: dcbuild3r/mobench-v1-browserstack
Head SHA: 94786155017ac2b11505a012ddb181f9e8a1a1c6

Previous PR CI / benchmark runs from #430:

Summary

  • add v1 mobench BrowserStack wiring for passport age-check and OPRF prove benchmarks
  • run the same full Android/iOS triad matrix as PR add mobench support to ProveKit main #429
  • fix Android prove timing so fixture clone/setup is outside the measured prove span
  • use jemalloc as the Android fallback allocator under the native C FFI allocator
  • harden Android incomplete-fixture reporting with timeout/build/kill-evidence fields

Android mobench fix note

The earlier failing run was https://github.com/worldfnd/provekit/actions/runs/26002840796. The missing Vivo Y21 monolithic cell did not recover a BrowserStack session payload or summary.json; available artifacts only show the BrowserStack fetch timeout after 7200s for build b1ebace919a1b8cad3861313180ac9a18a7e461d.

Before/failure memory from that run:

  • Vivo Y21 OPRF: 291 MB process peak, 9.614s
  • Vivo Y21 fragmented age check: 1206 MB process peak, 44.896s
  • Vivo Y21 monolithic age check: no row; BrowserStack timeout/no summary
  • S24 OPRF: 365 MB process peak, 2.216s

What changed:

  • Android and iOS now use the same semantic boundary for prove benches: per-iteration fixture setup happens before the measured closure, and profile_phase("prove") wraps only the prover entry point. Previously prepared.clone() ran inside profile_phase("prove"), so clone cost and peak memory were charged to proving.
  • Android native C FFI fallback allocation now routes through jemalloc instead of Bionic malloc when no host callback/mmap allocator is active.
  • If BrowserStack returns no summary, failure.json now records attempts, fetch timeout seconds, build id, and any LMK/OOM/SIGKILL lines recovered from attempt/device logs.

Latest benchmark numbers were reposted as a PR comment from #430.

Validation

  • cargo fmt --all
  • cargo test -p bench-mobile --lib
  • cargo test -p bench-mobile --test examples_smoke
  • cargo test -p bench-mobile --test passport_smoke
  • cargo check -p provekit-ffi --target aarch64-linux-android with NDK 26.1 aarch64-linux-android34-clang
  • ruby -e 'require "yaml"; YAML.load_file(".github/workflows/mobile-bench-reusable.yml")'
  • git diff --check

Copy link
Copy Markdown
Collaborator Author

Latest mobile benchmark numbers

Reposted from #430 comment #430 (comment).

Source: Mobile Bench PR Auto run 26368378198 on dcbuild3r/mobench-v1-browserstack at 94786155.
Mobench version: 0.1.42. Artifact summaries report 2 measured runs per function/device plus 1 warmup run.

iOS

Benchmark Device Runs Warmup Mean/run Median p95 Min Max Wall total CPU median/run CPU total CPU/wall Peak growth Peak memory Process peak
OPRF iPhone 16 Pro Max 2 1 510.137ms 510.137ms 513.350ms 506.923ms 513.350ms 1.020s 1.214s 2.429s 238.1% 12.20 MB 12.20 MB 355.25 MB
OPRF iPhone 14 2 1 1.323s 1.323s 1.334s 1.312s 1.334s 2.646s 2.176s 4.353s 164.5% 10.86 MB 10.86 MB 147.92 MB
OPRF iPhone SE 2022 2 1 956.647ms 956.647ms 1.053s 860.161ms 1.053s 1.913s 1.784s 3.569s 186.5% 11.02 MB 11.02 MB 148.77 MB
Passport fragmented iPhone 16 Pro Max 2 1 3.085s 3.085s 3.124s 3.046s 3.124s 6.170s 12.666s 25.333s 410.6% 186.78 MB 186.78 MB 1014.66 MB
Passport fragmented iPhone 14 2 1 4.215s 4.215s 4.243s 4.187s 4.243s 8.429s 16.325s 32.650s 387.3% 247.11 MB 247.11 MB 730.53 MB
Passport fragmented iPhone SE 2022 2 1 4.345s 4.345s 4.389s 4.302s 4.389s 8.691s 16.986s 33.973s 390.9% 247.08 MB 247.08 MB 731.81 MB
Passport complete iPhone 16 Pro Max 2 1 3.344s 3.344s 3.368s 3.320s 3.368s 6.688s 14.587s 29.174s 436.2% 359.48 MB 359.48 MB 1485.80 MB
Passport complete iPhone 14 2 1 4.843s 4.843s 5.060s 4.625s 5.060s 9.685s 20.282s 40.565s 418.8% 489.75 MB 489.75 MB 1062.66 MB
Passport complete iPhone SE 2022 2 1 4.842s 4.842s 5.069s 4.615s 5.069s 9.684s 20.403s 40.807s 421.4% 487.70 MB 487.70 MB 1057.06 MB

Android

Benchmark Device Runs Warmup Mean/run Median p95 Min Max Wall total CPU median/run CPU total CPU/wall Peak growth Peak memory Process peak
OPRF Samsung Galaxy S24 2 1 2.096s 2.096s 2.104s 2.088s 2.104s 4.192s 5.343s 10.687s 254.9% 39.83 MB 39.83 MB 430.64 MB
OPRF Google Pixel 7 2 1 5.686s 5.686s 5.915s 5.457s 5.915s 11.372s 7.901s 15.802s 139.0% 2.85 MB 2.85 MB 201.77 MB
OPRF Samsung Galaxy M32 2 1 6.116s 6.116s 6.717s 5.515s 6.717s 12.232s 10.126s 20.252s 165.6% 1.80 MB 1.80 MB 286.83 MB
Passport fragmented Samsung Galaxy S24 2 1 13.130s 13.130s 13.281s 12.978s 13.281s 26.260s 41.271s 82.543s 314.3% 263.05 MB 263.05 MB 984.10 MB
Passport fragmented Google Pixel 7 2 1 17.882s 17.882s 17.919s 17.845s 17.919s 35.764s 45.644s 91.289s 255.3% 192.33 MB 192.33 MB 716.82 MB
Passport fragmented Samsung Galaxy M32 2 1 30.928s 30.928s 30.973s 30.884s 30.973s 61.857s 85.175s 170.350s 275.4% 308.50 MB 308.50 MB 854.13 MB
Passport complete Samsung Galaxy S24 2 1 9.409s 9.409s 9.424s 9.395s 9.424s 18.819s 34.250s 68.501s 364.0% 442.15 MB 442.15 MB 1205.77 MB
Passport complete Google Pixel 7 2 1 16.684s 16.684s 16.891s 16.477s 16.891s 33.368s 47.877s 95.755s 287.0% 378.04 MB 378.04 MB 956.37 MB
Passport complete Samsung Galaxy M32 2 1 28.874s 28.874s 29.144s 28.604s 29.144s 57.748s 89.707s 179.414s 310.7% 586.32 MB 586.32 MB 1335.73 MB

Memory growth is the benchmark-reported peak growth above baseline; process peak is the reported process RSS peak.

@dcbuild3r dcbuild3r added the bench Run mobile benchmarks on PRs label Jun 11, 2026
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Mobench Benchmark Results

Ios Benchmark Results

Benchmark Summary

  • Generated: 2026-07-20T09:00:11.869313818Z
  • Target: iOS
  • Function: multiple
  • Iterations/Warmup: 2 / 1
  • Devices: iPhone 14-16, iPhone 16 Pro Max-18, iPhone SE 2022-15
Device Function Samples Warmup Wall mean / iter Wall total CPU median / iter CPU total CPU / wall Peak growth Process peak
iPhone 14-16 bench_mobile::bench_oprf_prove 2 1 1.186s 2.372s 2.055s 4.110s 173.3% 16.36 MB 152.34 MB
iPhone 14-16 bench_mobile::bench_passport_complete_age_check_prove 2 1 4.840s 9.680s 19.856s 39.712s 410.2% 533.58 MB 1044.62 MB
iPhone 14-16 bench_mobile::bench_passport_fragmented_age_check_prove 2 1 4.275s 8.550s 16.414s 32.828s 383.9% 272.12 MB 704.34 MB
iPhone 16 Pro Max-18 bench_mobile::bench_oprf_prove 2 1 510.218ms 1.020s 1.198s 2.397s 234.9% 9.70 MB 355.44 MB
iPhone 16 Pro Max-18 bench_mobile::bench_passport_complete_age_check_prove 2 1 3.449s 6.898s 14.906s 29.813s 432.2% 787.09 MB 1479.66 MB
iPhone 16 Pro Max-18 bench_mobile::bench_passport_fragmented_age_check_prove 2 1 3.164s 6.328s 12.669s 25.339s 400.4% 287.52 MB 1006.98 MB
iPhone SE 2022-15 bench_mobile::bench_oprf_prove 2 1 1.166s 2.332s 2.001s 4.003s 171.6% 15.45 MB 151.20 MB
iPhone SE 2022-15 bench_mobile::bench_passport_complete_age_check_prove 2 1 5.159s 10.317s 21.040s 42.080s 407.9% 535.69 MB 1039.34 MB
iPhone SE 2022-15 bench_mobile::bench_passport_fragmented_age_check_prove 2 1 4.413s 8.826s 16.960s 33.920s 384.3% 273.17 MB 704.50 MB

Note: memory growth excludes warmup/baseline retained before the measured iteration.

Android Benchmark Results

Benchmark Summary

  • Generated: 2026-07-20T10:22:34.338894869Z
  • Target: Android
  • Function: multiple
  • Iterations/Warmup: 2 / 1
  • Devices: Google Pixel 7-13.0, Samsung Galaxy M32-11.0, Samsung Galaxy S24-14.0
Device Function Samples Warmup Wall mean / iter Wall total CPU median / iter CPU total CPU / wall Peak growth Process peak
Google Pixel 7-13.0 bench_mobile::bench_oprf_prove 2 1 5.897s 11.794s 7.545s 15.091s 128.0% 4.02 MB 205.38 MB
Google Pixel 7-13.0 bench_mobile::bench_passport_complete_age_check_prove 2 1 16.644s 33.289s 46.575s 93.150s 279.8% 389.34 MB 954.95 MB
Google Pixel 7-13.0 bench_mobile::bench_passport_fragmented_age_check_prove 2 1 21.591s 43.182s 47.225s 94.451s 218.7% 227.01 MB 685.41 MB
Samsung Galaxy M32-11.0 bench_mobile::bench_oprf_prove 2 1 6.347s 12.695s 10.260s 20.521s 161.6% 0.26 MB 291.31 MB
Samsung Galaxy M32-11.0 bench_mobile::bench_passport_complete_age_check_prove 2 1 27.762s 55.524s 90.178s 180.356s 324.8% 374.70 MB 1305.99 MB
Samsung Galaxy M32-11.0 bench_mobile::bench_passport_fragmented_age_check_prove 2 1 30.372s 60.744s 85.100s 170.201s 280.2% 238.81 MB 836.78 MB
Samsung Galaxy S24-14.0 bench_mobile::bench_oprf_prove 2 1 2.180s 4.360s 5.095s 10.190s 233.7% 34.28 MB 429.50 MB
Samsung Galaxy S24-14.0 bench_mobile::bench_passport_complete_age_check_prove 2 1 14.158s 28.317s 53.854s 107.708s 380.4% 526.38 MB 1143.13 MB
Samsung Galaxy S24-14.0 bench_mobile::bench_passport_fragmented_age_check_prove 2 1 15.933s 31.867s 54.429s 108.859s 341.6% 436.52 MB 915.59 MB

Note: memory growth excludes warmup/baseline retained before the measured iteration.

@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs-provekit-org Error Error Jul 20, 2026 8:07am

Request Review

@dcbuild3r

dcbuild3r commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator Author

@Bisht13 ready for review once the fresh rerun settles.

I pushed ae3d6c09 to add the five-sample mobile trigger and kicked off full CI with [mobench:both:5]: https://github.com/worldfnd/provekit/actions/runs/27893152094

@veljkovranic veljkovranic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great

@dcbuild3r
dcbuild3r merged commit 9b2a6f3 into v1 Jul 20, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bench Run mobile benchmarks on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants