Skip to content

perf: cache compiled hint data on the runner - #2393

Closed
orizi wants to merge 1 commit into
orizi/09-09-fix_run_hints_of_each_visited_pc_in_run_for_stepsfrom
orizi/09-09-perf_cache_compiled_hint_data_on_the_runner
Closed

orizi wants to merge 1 commit into
orizi/09-09-fix_run_hints_of_each_visited_pc_in_run_for_stepsfrom
orizi/09-09-perf_cache_compiled_hint_data_on_the_runner

Conversation

@orizi

@orizi orizi commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

get_hint_data compiled every hint in the program on each run call; proof-mode trace padding calls run_for_steps/run_until_next_power_of_2 in a loop, recompiling all hints per padding step. Compile once on first use and reuse across the runner's run calls (assumes the same hint processor across a runner's runs).

Based on #2392.

🤖 Generated with Claude Code


This change is Reviewable

@orizi
orizi force-pushed the orizi/09-09-perf_cache_compiled_hint_data_on_the_runner branch from ae48ead to 40fa70f Compare September 9, 2026 08:39
@orizi
orizi force-pushed the orizi/09-09-fix_run_hints_of_each_visited_pc_in_run_for_steps branch from 1c7d205 to 0b69496 Compare September 9, 2026 08:39
@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 1.883 ± 0.044 1.840 1.968 1.02 ± 0.03
head big_factorial 1.847 ± 0.031 1.815 1.919 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 1.784 ± 0.031 1.732 1.831 1.00 ± 0.03
head big_fibonacci 1.780 ± 0.037 1.743 1.845 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 5.349 ± 0.073 5.254 5.462 1.00 ± 0.02
head blake2s_integration_benchmark 5.327 ± 0.086 5.233 5.538 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 1.866 ± 0.033 1.834 1.931 1.01 ± 0.02
head compare_arrays_200000 1.851 ± 0.027 1.813 1.898 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.218 ± 0.011 1.202 1.239 1.00
head dict_integration_benchmark 1.233 ± 0.033 1.190 1.300 1.01 ± 0.03
Command Mean [ms] Min [ms] Max [ms] Relative
base field_arithmetic_get_square_benchmark 881.6 ± 15.7 869.6 920.9 1.00 ± 0.02
head field_arithmetic_get_square_benchmark 878.0 ± 13.4 865.5 899.9 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 5.313 ± 0.167 5.166 5.751 1.00
head integration_builtins 5.326 ± 0.147 5.207 5.679 1.00 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 5.521 ± 0.091 5.403 5.677 1.00
head keccak_integration_benchmark 5.634 ± 0.194 5.364 6.120 1.02 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base linear_search 1.873 ± 0.027 1.846 1.939 1.00
head linear_search 1.894 ± 0.048 1.856 1.984 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.385 ± 0.026 1.357 1.438 1.00 ± 0.02
head math_cmp_and_pow_integration_benchmark 1.385 ± 0.022 1.356 1.431 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.302 ± 0.036 1.267 1.373 1.00 ± 0.03
head math_integration_benchmark 1.297 ± 0.015 1.279 1.330 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.128 ± 0.030 1.087 1.176 1.02 ± 0.03
head memory_integration_benchmark 1.102 ± 0.022 1.081 1.136 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.304 ± 0.021 1.274 1.338 1.00 ± 0.02
head operations_with_data_structures_benchmarks 1.304 ± 0.020 1.283 1.350 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 395.7 ± 9.3 388.7 419.2 1.01 ± 0.03
head pedersen 389.9 ± 4.8 380.7 397.7 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 511.2 ± 19.7 498.4 563.8 1.00
head poseidon_integration_benchmark 514.1 ± 10.6 504.6 531.2 1.01 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.330 ± 0.023 1.310 1.377 1.00
head secp_integration_benchmark 1.343 ± 0.032 1.318 1.417 1.01 ± 0.03
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 513.4 ± 22.1 481.2 544.1 1.03 ± 0.04
head set_integration_benchmark 498.2 ± 3.1 494.0 502.8 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 3.335 ± 0.080 3.255 3.542 1.00 ± 0.03
head uint256_integration_benchmark 3.333 ± 0.035 3.263 3.385 1.00

@orizi
orizi force-pushed the orizi/09-09-perf_cache_compiled_hint_data_on_the_runner branch from 40fa70f to 355ff3f Compare September 9, 2026 09:47
@orizi
orizi force-pushed the orizi/09-09-fix_run_hints_of_each_visited_pc_in_run_for_steps branch from 0b69496 to 681c028 Compare September 9, 2026 09:47
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (orizi/09-09-fix_run_hints_of_each_visited_pc_in_run_for_steps@681c028). Learn more about missing BASE report.

Files with missing lines Patch % Lines
vm/src/vm/runners/cairo_runner.rs 83.33% 3 Missing ⚠️
Additional details and impacted files
@@                                       Coverage Diff                                        @@
##             orizi/09-09-fix_run_hints_of_each_visited_pc_in_run_for_steps    #2393   +/-   ##
================================================================================================
  Coverage                                                                 ?   96.23%           
================================================================================================
  Files                                                                    ?      107           
  Lines                                                                    ?    38018           
  Branches                                                                 ?        0           
================================================================================================
  Hits                                                                     ?    36585           
  Misses                                                                   ?     1433           
  Partials                                                                 ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@orizi
orizi force-pushed the orizi/09-09-perf_cache_compiled_hint_data_on_the_runner branch from 355ff3f to 952641b Compare September 9, 2026 10:06
@orizi
orizi force-pushed the orizi/09-09-fix_run_hints_of_each_visited_pc_in_run_for_steps branch from 681c028 to 258ef43 Compare September 9, 2026 10:06
get_hint_data compiled every hint in the program on each run call;
proof-mode trace padding calls run_for_steps/run_until_next_power_of_2
in a loop, recompiling all hints per padding step. Compile once on
first use and reuse across the runner's run calls.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@orizi
orizi force-pushed the orizi/09-09-perf_cache_compiled_hint_data_on_the_runner branch from c4904cb to 42afa08 Compare September 9, 2026 10:17
@orizi
orizi force-pushed the orizi/09-09-fix_run_hints_of_each_visited_pc_in_run_for_steps branch from 258ef43 to 1ebfbb4 Compare September 9, 2026 10:17
@orizi

orizi commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of a re-filed PR: this PR's cache scope has a stuck cache reservation (Unable to reserve cache with key cairo_bench_programs-..., left by a cancelled duplicate run) that blocks every bench-programs cache save, so merge-caches can never succeed here. Same branch, fresh PR = fresh cache scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant