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

chore: clean up for loops and breaks #1234

Merged
merged 17 commits into from
Jan 21, 2025
Merged

chore: clean up for loops and breaks #1234

merged 17 commits into from
Jan 21, 2025

Conversation

yi-sun
Copy link
Collaborator

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

  • Removes breaks
  • Removes RangeBuilder, old IteratorBuilder, builder.iter()
  • Renames compile_zip! to iter_zip!

Closes INT-3015

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.

This comment has been minimized.

This comment has been minimized.

Copy link

group app.proof_time_ms app.cycles app.cells_used leaf.proof_time_ms leaf.cycles leaf.cells_used
verify_fibair (-29 [-0.9%]) 3,377 711,714 25,523,654 - - -
fibonacci_program (-14 [-0.2%]) 6,047 1,500,137 51,505,102 - - -
regex_program (-58 [-0.3%]) 18,877 4,190,904 165,028,173 - - -
ecrecover_program (+17 [+0.7%]) 2,619 285,401 15,092,297 - - -

Commit: 1b9f504

Benchmark Workflow

@@ -815,7 +781,8 @@ impl<F: PrimeField32 + TwoAdicField, EF: ExtensionField<F> + TwoAdicField> IfCom
}
}

// Zipped for loop -- loop extends over the first entry in starts and ends
// Zipped for loop -- loop extends over the first entry in starts and end0
// ATTENTION: starting with starts[0] > end0 will lead to undefined behavior.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bit scary in the VM case: is there any way we could prevent this at compile time?
Is it basically only used to iterate through arrays and in the range(0, ?) cases (where it's safe)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct, only via builder.zip() and builder.range()

Copy link
Contributor

@jonathanpwang jonathanpwang left a comment

Choose a reason for hiding this comment

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

LGTM, truly was a cleanup, no behavior changes.

@yi-sun yi-sun merged commit ab01b0c into main Jan 21, 2025
20 checks passed
@yi-sun yi-sun deleted the chore/cleanup-loops branch January 21, 2025 01:18
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