Skip to content

Conversation

JulianGCalderon
Copy link
Contributor

@JulianGCalderon JulianGCalderon commented Sep 2, 2025

Depends on #2191

Resolves constants by full path, instead of only constant name. Currently, we are matching the first constant that shares the name, ignoring the full path to the constant. This has undefined behaviour if multiple constants have the same name.

To properly implement the lookup of constants, we need access two new elements:

I've added a test that fails with the current implementation. This PR solves it.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

Copy link

github-actions bot commented Sep 2, 2025

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.164 ± 0.015 2.141 2.192 1.00 ± 0.01
head big_factorial 2.162 ± 0.024 2.143 2.222 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.089 ± 0.012 2.073 2.111 1.00 ± 0.01
head big_fibonacci 2.089 ± 0.018 2.074 2.139 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.698 ± 0.056 7.609 7.781 1.00
head blake2s_integration_benchmark 9.217 ± 0.065 9.115 9.289 1.20 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.206 ± 0.009 2.195 2.222 1.00
head compare_arrays_200000 2.221 ± 0.023 2.196 2.261 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.440 ± 0.009 1.430 1.462 1.00
head dict_integration_benchmark 15.605 ± 0.180 15.402 15.985 10.84 ± 0.14
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.235 ± 0.018 1.222 1.283 1.00
head field_arithmetic_get_square_benchmark 6.077 ± 0.079 5.959 6.239 4.92 ± 0.10
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.839 ± 0.040 7.782 7.906 1.00
head integration_builtins 7.861 ± 0.085 7.760 8.007 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.140 ± 0.195 7.956 8.540 1.00
head keccak_integration_benchmark 10.738 ± 0.196 10.577 11.137 1.32 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.194 ± 0.007 2.183 2.206 1.00 ± 0.01
head linear_search 2.192 ± 0.022 2.176 2.252 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.525 ± 0.012 1.513 1.555 1.00
head math_cmp_and_pow_integration_benchmark 13.776 ± 0.148 13.531 13.969 9.03 ± 0.12
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.491 ± 0.033 1.470 1.584 1.00
head math_integration_benchmark 18.959 ± 0.132 18.756 19.228 12.72 ± 0.30
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.238 ± 0.012 1.225 1.265 1.00
head memory_integration_benchmark 6.502 ± 0.129 6.353 6.812 5.25 ± 0.12
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.586 ± 0.005 1.579 1.593 1.00
head operations_with_data_structures_benchmarks 9.977 ± 0.093 9.851 10.149 6.29 ± 0.06
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 531.4 ± 1.7 529.0 534.5 1.00
head pedersen 541.0 ± 7.3 534.8 557.7 1.02 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 632.7 ± 4.8 623.7 639.0 1.00
head poseidon_integration_benchmark 1378.0 ± 19.3 1353.8 1422.2 2.18 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.854 ± 0.012 1.843 1.885 1.00
head secp_integration_benchmark 12.762 ± 0.114 12.627 13.026 6.88 ± 0.08
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 678.5 ± 6.6 666.5 689.4 1.00
head set_integration_benchmark 2712.6 ± 16.6 2689.2 2748.0 4.00 ± 0.05
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.301 ± 0.019 4.267 4.329 1.00
head uint256_integration_benchmark 23.981 ± 0.139 23.788 24.221 5.58 ± 0.04

Copy link

codecov bot commented Sep 2, 2025

Codecov Report

❌ Patch coverage is 99.51338% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.67%. Comparing base (e8978b6) to head (bff6af0).

Files with missing lines Patch % Lines
...int_processor/builtin_hint_processor_definition.rs 95.45% 2 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           store-idents-in-hints    #2192      +/-   ##
=========================================================
+ Coverage                  96.66%   96.67%   +0.01%     
=========================================================
  Files                        103      103              
  Lines                      43646    43825     +179     
=========================================================
+ Hits                       42191    42369     +178     
- Misses                      1455     1456       +1     

☔ View full report in Codecov by Sentry.
📢 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.

@gabrielbosio gabrielbosio added this to the 2.5.0 milestone Sep 9, 2025
@gabrielbosio gabrielbosio moved this to In Progress in Starknet Sep 9, 2025
@JulianGCalderon JulianGCalderon force-pushed the resolve-constants-by-full-path branch from 587f490 to e1f7c8a Compare September 9, 2025 20:33
Base automatically changed from store-idents-in-hints to 2.x.y September 10, 2025 21:36
The python implementation takes the references, while our implementation
doesn't allow taking references when it expects a constants.

For this reason, the example doesn't work as is in our current
implementation.

To fix this, I changed the example to not receive the values as
parameters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants