Skip to content

Update documentation #1254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Update documentation #1254

wants to merge 17 commits into from

Conversation

DiegoCivi
Copy link
Contributor

@DiegoCivi DiegoCivi commented Jun 13, 2025

Tidy up and update documentation

Checklist

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

Copy link

github-actions bot commented Jun 14, 2025

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 5.035 ± 0.023 5.002 5.076 1.02 ± 0.01
base dict_insert.cairo (AOT) 4.959 ± 0.039 4.914 5.051 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 5.168 ± 0.034 5.101 5.209 1.02 ± 0.01
head dict_insert.cairo (AOT) 5.076 ± 0.032 5.039 5.130 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 5.035 ± 0.054 4.945 5.110 1.03 ± 0.01
base dict_snapshot.cairo (AOT) 4.887 ± 0.030 4.851 4.941 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 5.083 ± 0.030 5.037 5.129 1.03 ± 0.01
head dict_snapshot.cairo (AOT) 4.955 ± 0.022 4.913 4.988 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 5.317 ± 0.024 5.289 5.359 1.01 ± 0.01
base factorial_2M.cairo (AOT) 5.290 ± 0.035 5.251 5.353 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 5.418 ± 0.033 5.352 5.470 1.00 ± 0.01
head factorial_2M.cairo (AOT) 5.392 ± 0.025 5.360 5.434 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 4.855 ± 0.022 4.818 4.885 1.01 ± 0.01
base fib_2M.cairo (AOT) 4.793 ± 0.024 4.753 4.841 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 4.988 ± 0.029 4.943 5.027 1.01 ± 0.01
head fib_2M.cairo (AOT) 4.932 ± 0.038 4.867 5.013 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 5.053 ± 0.042 5.006 5.139 1.03 ± 0.01
base linear_search.cairo (AOT) 4.897 ± 0.023 4.859 4.924 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 5.197 ± 0.057 5.119 5.318 1.03 ± 0.01
head linear_search.cairo (AOT) 5.041 ± 0.033 4.992 5.088 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 5.141 ± 0.045 5.092 5.207 1.04 ± 0.01
base logistic_map.cairo (AOT) 4.953 ± 0.032 4.916 5.030 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 5.252 ± 0.025 5.216 5.295 1.03 ± 0.01
head logistic_map.cairo (AOT) 5.097 ± 0.039 5.044 5.159 1.00

Copy link

github-actions bot commented Jun 14, 2025

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.375 ± 0.063 11.291 11.502 2.31 ± 0.02
cairo-native (embedded AOT) 4.935 ± 0.021 4.899 4.972 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 4.999 ± 0.036 4.957 5.065 1.01 ± 0.01

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 789.4 ± 6.4 783.8 803.9 1.00
cairo-native (embedded AOT) 4836.2 ± 36.9 4773.7 4919.2 6.13 ± 0.07
cairo-native (embedded JIT using LLVM's ORC Engine) 4925.8 ± 26.4 4880.8 4956.6 6.24 ± 0.06

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.253 ± 0.061 5.189 5.398 1.00 ± 0.01
cairo-native (embedded AOT) 5.246 ± 0.034 5.198 5.303 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 5.270 ± 0.020 5.231 5.296 1.00 ± 0.01

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.087 ± 0.030 5.061 5.164 1.06 ± 0.02
cairo-native (embedded AOT) 4.816 ± 0.067 4.727 4.914 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 4.846 ± 0.046 4.773 4.928 1.01 ± 0.02

Benchmark for program linear_search

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 806.8 ± 4.3 802.3 816.3 1.00
cairo-native (embedded AOT) 4888.1 ± 43.4 4848.0 4984.5 6.06 ± 0.06
cairo-native (embedded JIT using LLVM's ORC Engine) 5079.7 ± 34.5 5043.3 5155.8 6.30 ± 0.05

Benchmark for program logistic_map

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 534.7 ± 6.8 527.3 550.5 1.00
cairo-native (embedded AOT) 4926.5 ± 32.9 4876.4 4990.6 9.21 ± 0.13
cairo-native (embedded JIT using LLVM's ORC Engine) 5101.3 ± 51.7 5040.2 5189.8 9.54 ± 0.16

@codecov-commenter
Copy link

codecov-commenter commented Jun 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@b92123c). Learn more about missing BASE report.
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1254   +/-   ##
=======================================
  Coverage        ?   80.21%           
=======================================
  Files           ?      112           
  Lines           ?    29880           
  Branches        ?        0           
=======================================
  Hits            ?    23967           
  Misses          ?     5913           
  Partials        ?        0           

☔ 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.

Copy link
Contributor

@JulianGCalderon JulianGCalderon left a comment

Choose a reason for hiding this comment

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

Nice work. I left some minor comments. Also, please update the PR description

README.md Outdated
Comment on lines 216 to 223
Example: `echo '1' | cairo-native-run 'program.cairo' 'program::program::main' --inputs - --outputs -`
Example: `cairo-native-run --available-gas 5000 './programs/program.cairo'`
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this example file exist? (./programs/program.cairo)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, it was just as an example. Changed it to one that exists here 5b18317

Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this file removed?

src/compiler.rs Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this changes are unrelated, and should be moved to another pull request.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The changes were undone in c42454d

Comment on lines 250 to 254
When using the JIT it'll be automatically linked (if compiled with support for
it, which is enabled by default). If using the AOT, the
`CAIRO_NATIVE_RUNTIME_LIBRARY` environment variable will have to be modified to
point to the `libcairo_native_runtime.a` file, which is built and placed in said
folder by `make build`.
Copy link
Contributor

Choose a reason for hiding this comment

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

This paragraph is outdated. We no longer have a runtime library. This PR #1051 may have more details on how the new runtime mechanism works.

Comment on lines 263 to 266
The syscall handler is similar to the runtime in the sense that we have
C-compatible functions called from MLIR, but it's different in that they're
built into Cairo Native itself rather than an external library, and that their
implementation is user-dependent.
Copy link
Contributor

Choose a reason for hiding this comment

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

Idem. We don't have an external library for the runtime anymore.

@JulianGCalderon
Copy link
Contributor

Also, there are some things that could be done, but I'm not sure that this PR is the right place:

  • Update cairo-native tools usages (--help).
  • Update trace-dump Replay documentation (or link to the replay documentation).
  • Remove the ignore on the rust examples, to ensure that they don't get outdated.

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.

5 participants