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: optimize brillig execution of split_X_bits functions #47

Merged

Conversation

TomAFrench
Copy link
Member

Description

Problem*

Resolves

Summary*

This PR reworks the split_120_bits and `split_60_bits functions to abuse the truncation we perform when casting to avoid the need to perform byte decompositions (and the massive blowup in execution trace that brings)

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

@vezenovm vezenovm left a comment

Choose a reason for hiding this comment

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

Some minor nits

src/utils/split_bits.nr Outdated Show resolved Hide resolved
src/utils/split_bits.nr Outdated Show resolved Hide resolved
src/utils/split_bits.nr Outdated Show resolved Hide resolved
src/utils/split_bits.nr Outdated Show resolved Hide resolved
Copy link
Collaborator

@iAmMichaelConnor iAmMichaelConnor left a comment

Choose a reason for hiding this comment

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

Very neat!

@iAmMichaelConnor iAmMichaelConnor merged commit 31ebc7c into main Nov 5, 2024
5 checks passed
@github-actions github-actions bot mentioned this pull request Nov 5, 2024
TomAFrench added a commit that referenced this pull request Nov 8, 2024
* main:
  feat: remove generic parameter from the `BigNum` trait (#44)
  fix: fix broken tests in `runtime_bignum_test.nr` (#39)
  feat: remove a bunch of unnecessary bytecode from unconstrained ops (#50)
  fix: Fix barrett reduction bug (#51)
  feat: optimize brillig execution of `split_X_bits` functions (#47)
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.

3 participants