feat: add math cairo tests under vm/src/tests/cairo_test_suite#2379
Open
naor-starkware wants to merge 31 commits intonaor/feat/add_test_helpersfrom
Open
feat: add math cairo tests under vm/src/tests/cairo_test_suite#2379naor-starkware wants to merge 31 commits intonaor/feat/add_test_helpersfrom
naor-starkware wants to merge 31 commits intonaor/feat/add_test_helpersfrom
Conversation
6 tasks
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Mar 29, 2026
|
Benchmark Results for unmodified programs 🚀
|
421425b to
981fce6
Compare
646dd9e to
2bc600b
Compare
981fce6 to
4e1af25
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## naor/refactor/Makefile-include-test_cairo_suite_target #2379 +/- ##
=======================================================================================
Coverage 96.07% 96.07%
=======================================================================================
Files 107 107
Lines 37852 37852
=======================================================================================
Hits 36366 36366
Misses 1486 1486 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
naor-starkware
added a commit
that referenced
this pull request
Mar 29, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4e1af25 to
fa0fe77
Compare
2bc600b to
6fd8964
Compare
naor-starkware
added a commit
that referenced
this pull request
Mar 29, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fa0fe77 to
fd27b62
Compare
c106a57 to
106cbb4
Compare
naor-starkware
added a commit
that referenced
this pull request
Mar 30, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
106cbb4 to
ff56720
Compare
fd27b62 to
1e0b48e
Compare
naor-starkware
added a commit
that referenced
this pull request
Apr 6, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1e0b48e to
fd5cce6
Compare
ff56720 to
6c03214
Compare
…on_runner flag - Create vm/src/test_helpers/ with error_utils.rs and test_utils.rs - Move from cairo_test_suite/ (fix filename typo: utlis → utils) - Fix crate:: import paths (were cairo_vm:: when outside the crate) - Fix $crate in macro_export macro (clippy::crate_in_macro_def) - Simplify load_cairo_program! path using with_file_name() - Gate module behind function_runner feature in lib.rs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ram! and error_utils checkers Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add AlwaysFailConversion helper + 2 tests for assert_mr_eq! unwrap_or_else panic branch (no-message and message variants) - Allow clippy::result_large_err on hint_err test helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
naor-starkware
added a commit
that referenced
this pull request
Apr 7, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
985c1fe to
f0f279f
Compare
d11f204 to
b2799c2
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nt::Internal These errors arrive wrapped as Hint(Internal(...)) since they originate inside hint execution, not as bare VirtualMachineError variants. Remove now-unused expect_vm_error helper and vm_err test helper. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ation Makefile: - Add CAIRO_TEST_SUITE_ROOT, CAIRO_TEST_SUITE_FILES, COMPILED_CAIRO_TEST_SUITE variables to track cairo test suite sources - Add pattern rule to compile each .cairo to .json via cairo-compile - Add cairo_test_suite_programs target - Hook cairo_test_suite_programs into the test target - Add cairo_test_suite_programs to .PHONY CI (rust.yml): - Add cairo_test_suite_programs to the build-programs matrix - Add vm/src/tests/cairo_test_suite/**/*.json to CAIRO_PROGRAMS_PATH cache - Update all program cache keys to hash test suite source files - Add function_runner feature flag to the tests job Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Create cairo_test_suite module skeleton (mod.rs, test_math/mod.rs) - Add main_math_test.cairo stub (imports all math.cairo functions) - Add math_test_utils.rs (RC_BOUND, MAX_DIV, is_quad_residue_mod_prime) - Move test_math_cairo.rs from cairo_test_suite/, update all imports - cairo_vm:: → crate:: for all internal paths - crate::error_utils → crate::test_helpers::error_utils - cairo_function_runner → function_runner module path - Fix 5x runner.runner.vm → runner.vm (old struct design remnant) - Register cairo_test_suite mod behind function_runner feature Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- new() → new_for_testing() (type alias has no 1-arg constructor) - runner.get_return_values() → runner.vm.get_return_values() (method is on VirtualMachine) - Add missing macro imports: assert_mr_eq! and load_cairo_program! Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename main_math_test.cairo → math_test.cairo for clarity. Add `from starkware.cairo.common.math_utils import horner_eval` so the compiled JSON includes horner_eval (used in test_horner_eval). Update the load_cairo_program! call to reference math_test.json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add missing assert_not_nullptr, safe_div, safe_mult. Move horner_eval and assert_is_power_of_2 into the math.cairo import block (both are defined there, not in math_utils). Match declaration order to match math.cairo. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove isize from MaybeRelocatable tuple literals (inferred from From impl) - Remove usize from add_usize() calls (inferred from param type) - Remove _i64 suffixes in split_int cases (inferred from param types) - Remove usize from shift/bit operations - Use type annotation on variable instead of inline i64 suffixes on literals Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CairoFunctionRunner type alias was removed, use CairoRunner directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f0f279f to
d6a6c58
Compare
b2799c2 to
f0bb2d0
Compare
Base automatically changed from
naor/refactor/Makefile-include-test_cairo_suite_target
to
naor/feat/add_test_helpers
April 19, 2026 07:09
67106b9 to
dc5490c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

TITLE
Description
Description of the pull request changes and motivation.
Checklist
This change is