Omri/add math cairo test#2384
Closed
OmriEshhar1 wants to merge 33 commits into
Closed
Conversation
…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>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… noise Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…y function name error #[macro_export] macros containing closures (|x| ...) cause llvm-cov to emit a "function name is empty" error. Replaced unwrap_or_else(|e| panic!(...)) with match expressions to eliminate closures from macro expansions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Follow-up to dropping the function_runner feature flag. Gate test_helpers module and function_runner module under test_utils, and update the doc comment in function_runner.rs accordingly. 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>
…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>
|
|
Benchmark Results for unmodified programs 🚀
|
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