Skip to content

added e2e tests from cairo repo#1589

Open
TomerStarkware wants to merge 1 commit intomainfrom
tomer/add_e2e_libfuncs_tests
Open

added e2e tests from cairo repo#1589
TomerStarkware wants to merge 1 commit intomainfrom
tomer/add_e2e_libfuncs_tests

Conversation

@TomerStarkware
Copy link
Copy Markdown
Collaborator

@TomerStarkware TomerStarkware commented Apr 5, 2026

Added e2e tests from cairo repo

Closes #NA

Introduces Breaking Changes?

No.


This change is Reviewable

@TomerStarkware TomerStarkware requested a review from orizi April 5, 2026 09:14
@TomerStarkware TomerStarkware force-pushed the tomer/add_e2e_libfuncs_tests branch from b0d2fd4 to 35de010 Compare April 5, 2026 09:42
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 2.088 ± 0.037 2.050 2.152 1.04 ± 0.02
base dict_insert.cairo (AOT) 2.005 ± 0.030 1.963 2.054 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 2.068 ± 0.012 2.046 2.089 1.03 ± 0.01
head dict_insert.cairo (AOT) 2.002 ± 0.019 1.963 2.030 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 1.818 ± 0.017 1.796 1.850 1.08 ± 0.02
base dict_snapshot.cairo (AOT) 1.677 ± 0.023 1.650 1.715 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 1.814 ± 0.016 1.791 1.834 1.07 ± 0.01
head dict_snapshot.cairo (AOT) 1.693 ± 0.015 1.674 1.726 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 2.177 ± 0.011 2.162 2.197 1.03 ± 0.01
base factorial_2M.cairo (AOT) 2.117 ± 0.008 2.104 2.131 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 2.196 ± 0.019 2.168 2.240 1.02 ± 0.01
head factorial_2M.cairo (AOT) 2.148 ± 0.022 2.116 2.180 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 1.727 ± 0.012 1.707 1.744 1.03 ± 0.01
base fib_2M.cairo (AOT) 1.672 ± 0.013 1.644 1.688 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 1.766 ± 0.020 1.744 1.810 1.05 ± 0.01
head fib_2M.cairo (AOT) 1.687 ± 0.009 1.674 1.702 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 1.855 ± 0.019 1.835 1.899 1.09 ± 0.01
base linear_search.cairo (AOT) 1.709 ± 0.014 1.687 1.728 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 1.864 ± 0.014 1.846 1.887 1.07 ± 0.01
head linear_search.cairo (AOT) 1.735 ± 0.017 1.713 1.775 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 2.025 ± 0.025 1.996 2.076 1.07 ± 0.02
base logistic_map.cairo (AOT) 1.897 ± 0.019 1.877 1.927 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 2.041 ± 0.020 2.009 2.064 1.10 ± 0.01
head logistic_map.cairo (AOT) 1.861 ± 0.009 1.844 1.874 1.00

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.333 ± 0.051 11.240 11.397 5.73 ± 0.13
cairo-native (embedded AOT) 1.979 ± 0.045 1.928 2.072 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 2.041 ± 0.025 2.002 2.094 1.03 ± 0.03

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 532.5 ± 5.3 526.1 542.6 1.00
cairo-native (embedded AOT) 1655.2 ± 14.6 1630.8 1671.2 3.11 ± 0.04
cairo-native (embedded JIT using LLVM's ORC Engine) 1761.4 ± 12.3 1739.5 1779.5 3.31 ± 0.04

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.940 ± 0.040 4.898 5.023 2.35 ± 0.03
cairo-native (embedded AOT) 2.100 ± 0.022 2.072 2.131 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 2.163 ± 0.012 2.146 2.186 1.03 ± 0.01

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.827 ± 0.053 4.785 4.961 2.91 ± 0.05
cairo-native (embedded AOT) 1.658 ± 0.022 1.625 1.688 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 1.709 ± 0.017 1.688 1.735 1.03 ± 0.02

Benchmark for program linear_search

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 587.5 ± 10.2 574.7 608.3 1.00
cairo-native (embedded AOT) 1702.8 ± 28.3 1669.6 1744.9 2.90 ± 0.07
cairo-native (embedded JIT using LLVM's ORC Engine) 1825.3 ± 19.2 1799.1 1869.3 3.11 ± 0.06

Benchmark for program logistic_map

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 488.9 ± 5.6 482.4 501.5 1.00
cairo-native (embedded AOT) 1821.8 ± 18.8 1800.3 1855.3 3.73 ± 0.06
cairo-native (embedded JIT using LLVM's ORC Engine) 1985.7 ± 17.9 1957.4 2020.0 4.06 ± 0.06

@TomerStarkware TomerStarkware force-pushed the tomer/add_e2e_libfuncs_tests branch from 35de010 to 77ffb9b Compare April 5, 2026 11:10
Copy link
Copy Markdown
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: 3 of 9 files reviewed, 1 unresolved discussion (waiting on TomerStarkware).


Makefile line 194 at r1 (raw file):

pull-external-projects:
	python3 ./scripts/pull_external_projects.py v${CAIRO_2_VERSION}
	python3 ./scripts/extract_e2e_sierra.py

this sounds not like a part of this

Code quote:

	python3 ./scripts/extract_e2e_sierra.py

Copy link
Copy Markdown
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi made 3 comments.
Reviewable status: 3 of 9 files reviewed, 4 unresolved discussions (waiting on TomerStarkware).


src/types/circuit.rs line 114 at r1 (raw file):

    info: WithSelf<InfoOnlyConcreteType>,
) -> Result<Type<'ctx>> {
    if metadata.get::<ReallocBindingsMeta>().is_none() {

get_or_insert_with?


src/types/circuit.rs line 218 at r1 (raw file):

    info: WithSelf<InfoOnlyConcreteType>,
) -> Result<Type<'ctx>> {
    if metadata.get::<ReallocBindingsMeta>().is_none() {

get_or_insert_with?


src/types/circuit.rs line 313 at r1 (raw file):

    info: WithSelf<InfoOnlyConcreteType>,
) -> Result<Type<'ctx>> {
    if metadata.get::<ReallocBindingsMeta>().is_none() {

get_or_insert_with?

Copy link
Copy Markdown
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi reviewed 1 file and made 1 comment.
Reviewable status: 4 of 9 files reviewed, 5 unresolved discussions (waiting on TomerStarkware).


tests/tests/e2e_libfuncs.rs line 13 at r1 (raw file):

    if !sierra_dir.exists() {
        eprintln!(
            "Skipping e2e libfunc tests: {} not found. Run 'make pull-external-projects' first.",

add e2e_sierra as a non-phony target in the makefile as well.

Copy link
Copy Markdown
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi made 1 comment.
Reviewable status: 4 of 9 files reviewed, 6 unresolved discussions (waiting on TomerStarkware).


tests/tests/e2e_libfuncs.rs line 28 at r1 (raw file):

        .sort_by_file_name()
        .into_iter()
    {

already happens implicitly.

Suggestion:

    for entry in walkdir::WalkDir::new(&sierra_dir)
        .sort_by_file_name()
    {

@TomerStarkware TomerStarkware force-pushed the tomer/add_e2e_libfuncs_tests branch from 77ffb9b to f9de09e Compare April 9, 2026 10:57
Copy link
Copy Markdown
Collaborator Author

@TomerStarkware TomerStarkware left a comment

Choose a reason for hiding this comment

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

@TomerStarkware made 6 comments.
Reviewable status: 4 of 9 files reviewed, 6 unresolved discussions (waiting on orizi).


Makefile line 194 at r1 (raw file):

Previously, orizi wrote…

this sounds not like a part of this

Done.


src/types/circuit.rs line 114 at r1 (raw file):

Previously, orizi wrote…

get_or_insert_with?

Done.


src/types/circuit.rs line 218 at r1 (raw file):

Previously, orizi wrote…

get_or_insert_with?

Done.


src/types/circuit.rs line 313 at r1 (raw file):

Previously, orizi wrote…

get_or_insert_with?

Done.


tests/tests/e2e_libfuncs.rs line 13 at r1 (raw file):

Previously, orizi wrote…

add e2e_sierra as a non-phony target in the makefile as well.

Why not phony like pull-external-projects:


tests/tests/e2e_libfuncs.rs line 28 at r1 (raw file):

Previously, orizi wrote…

already happens implicitly.

Done.

@TomerStarkware TomerStarkware force-pushed the tomer/add_e2e_libfuncs_tests branch from f9de09e to 085f051 Compare April 9, 2026 13:47
Copy link
Copy Markdown
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi reviewed 6 files and all commit messages, made 1 comment, and resolved 4 discussions.
Reviewable status: 8 of 54 files reviewed, 3 unresolved discussions (waiting on TomerStarkware).


test_data/e2e_libfuncs_raw/array line 2 at r2 (raw file):

//! > array_new libfunc

?

@TomerStarkware TomerStarkware force-pushed the tomer/add_e2e_libfuncs_tests branch from 085f051 to 1e1f6f1 Compare April 12, 2026 15:24
Copy link
Copy Markdown
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi reviewed 1 file and all commit messages, made 2 comments, and resolved 1 discussion.
Reviewable status: 9 of 54 files reviewed, 2 unresolved discussions (waiting on TomerStarkware).


test_data/e2e_libfuncs_raw/array line 2 at r2 (raw file):

Previously, orizi wrote…

?

assuming all this files where added by mistake - so add their dir to .gitignore - as well as put them in a more temporarily named dir.


tests/tests/e2e_libfuncs.rs line 13 at r1 (raw file):

Previously, TomerStarkware wrote…

Why not phony like pull-external-projects:

i don't understand what you mean - i just mean that these should be generated by requirement.

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.

2 participants