Skip to content
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

feat: add iterator-based for loops #1176

Open
wants to merge 37 commits into
base: native-cleanup
Choose a base branch
from

Conversation

yi-sun
Copy link
Collaborator

@yi-sun yi-sun commented Jan 6, 2025

Closes INT-2930, INT-2946

@yi-sun yi-sun added run-benchmark triggers benchmark workflows on the pr run-benchmark-e2e labels Jan 6, 2025

This comment has been minimized.

This comment has been minimized.

@yi-sun yi-sun force-pushed the feat/optimize-for-loop branch from 1f9f911 to b242cd7 Compare January 7, 2025 05:35

This comment has been minimized.

@yi-sun yi-sun force-pushed the feat/optimize-for-loop branch from b242cd7 to e6b8852 Compare January 8, 2025 05:37

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@yi-sun yi-sun marked this pull request as ready for review January 8, 2025 08:42
@yi-sun yi-sun changed the title wip: optimize for loops feat: add iterator-based for loops Jan 8, 2025

This comment has been minimized.

This comment has been minimized.

@yi-sun yi-sun force-pushed the feat/optimize-for-loop branch from 24c5898 to f92aea1 Compare January 9, 2025 04:24

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@@ -134,7 +133,7 @@ impl<C: Config, V: MemVariable<C>> Array<C, V> {
}

let slice_len = builder.eval(end - start);
let address = builder.eval(ptr.address + start);
let address = builder.eval(ptr.address + start * RVar::from(V::size_of()));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe this fixes a previous bug, please check.

@@ -78,10 +78,9 @@ impl<C: Config, V: MemVariable<C>> Array<C, V> {
}
}
Self::Dyn(ptr, len) => {
assert_eq!(V::size_of(), 1, "only support variables of size 1");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure why this restriction was previously present, as it seems easily removed on L83 below.

Copy link

group app.proof_time_ms app.cycles app.cells_used leaf.proof_time_ms leaf.cycles leaf.cells_used
verify_fibair (-141 [-3.7%]) 3,653 (+3621 [+0.5%]) 749,954 (-2594710 [-8.6%]) 27,418,604 - - -
fibonacci_program (+14 [+0.2%]) 6,117 1,500,137 51,505,102 (-907 [-5.9%]) 14,359 (+37398 [+1.2%]) 3,209,412 (-9820651 [-7.6%]) 119,044,836
regex_program (-97 [-0.5%]) 18,439 4,190,904 165,028,173 (-937 [-3.1%]) 29,736 (-408670 [-6.3%]) 6,111,736 (-32503883 [-11.2%]) 258,768,896
fib_e2e 42,927 12,000,137 410,820,430 87,256 19,214,580 710,044,829
ecrecover_program 2,602 285,401 15,092,297 (-3079 [-7.2%]) 39,841 (-774463 [-8.0%]) 8,888,841 (-52733556 [-12.0%]) 387,824,820

Commit: 7d8670b

Benchmark Workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-benchmark triggers benchmark workflows on the pr run-benchmark-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant