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: replace usage of Directive::Quotient with brillig opcode #1766

Merged
merged 16 commits into from
Aug 3, 2023

Conversation

guipublic
Copy link
Contributor

Description

Use brillig opcode instead of the quotient directive

Problem*

Resolves

Summary*

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

I will mark the PR as ready once the PRs for inverse directive and truncation removal are merged.

PR Checklist*

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

@kevaundray
Copy link
Contributor

For reference, putting the quotient directive here: https://github.com/noir-lang/acvm/blob/7d28f42c71d8434e73dfa69b94257c00ef7b6036/acvm/src/pwg/directives/mod.rs#L48

This uses BigUint, which is not a native type in Brillig. What steps,if any, are we taking to make this work?

@kevaundray
Copy link
Contributor

Related to #1772

@guipublic
Copy link
Contributor Author

For reference, putting the quotient directive here: https://github.com/noir-lang/acvm/blob/7d28f42c71d8434e73dfa69b94257c00ef7b6036/acvm/src/pwg/directives/mod.rs#L48

This uses BigUint, which is not a native type in Brillig. What steps,if any, are we taking to make this work?

We do not use BigUint here, we have the bit size of the inputs and so we simply use brillig integer division.

@guipublic guipublic marked this pull request as ready for review July 4, 2023 13:47
@kevaundray
Copy link
Contributor

@guipublic what is the status of this PR?

* master: (50 commits)
  fix(globals): Accurately filter literals for resolving globals (#2126)
  feat: Optimize away constant calls to black box functions (#1981)
  fix: Rename `Option::value` to `Option::_value` (#2127)
  feat: replace boolean `AND`s with multiplication (#1954)
  chore: create a `const` to hold the panic message (#2122)
  feat: Add support for bitshifts by distances known at runtime (#2072)
  feat: Add additional `BinaryOp` simplifications (#2124)
  fix: flattening pass no longer overwrites previously mapped condition values (#2117)
  chore(noirc_driver): Unify crate preparation (#2119)
  feat!: Support workspaces and package selection on every nargo command (#1992)
  chore: Make a more clear error for slices passed to std::println (#2113)
  feat: Implement type aliases (#2112)
  feat: Add `Option<T>` to noir stdlib (#1781)
  feat: Format strings for prints  (#1952)
  feat(acir_gen): RecursiveAggregation opcode and updates to black box func call generation (#2097)
  fix: Mutating a variable no longer mutates its copy (#2057)
  fix: Implement `.len()` in Acir-Gen (#2077)
  chore: clippy fixes (#2101)
  chore: Update `noir-source-resolver` to v1.1.3 (#1912)
  chore: Document `GeneratedAcir::more_than_eq_comparison` (#2085)
  ...
TomAFrench
TomAFrench previously approved these changes Aug 2, 2023
Copy link
Member

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

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

This should be good to go as the relevant ACVM PR is now being used.

@TomAFrench TomAFrench changed the title chore: replace quotient directive with brillig opcode chore: replace usage of Directive::Quotient with brillig opcode Aug 2, 2023
@TomAFrench
Copy link
Member

@guipublic are we good to merge this?

* master:
  chore: rename `ssa_refactor` module to `ssa` (#2129)
  chore: Use `--show-output` flag on execution rather than compilation  (#2116)
@guipublic
Copy link
Contributor Author

@guipublic are we good to merge this?

Yes

@TomAFrench TomAFrench added this pull request to the merge queue Aug 3, 2023
Merged via the queue into master with commit 8e976ea Aug 3, 2023
@TomAFrench TomAFrench deleted the gd/brillig_quotient branch August 3, 2023 08:37
TomAFrench added a commit that referenced this pull request Aug 3, 2023
* master:
  chore: replace usage of `Directive::Quotient` with brillig opcode  (#1766)
  chore: clippy fix (#2136)
  feat: Initial work on rewriting closures to regular functions with hi… (#1959)
  chore: Decouple acir blockid from ssa valueid (#2103)
  chore: Initialize copy array from previous values in `array_set` (#2106)
  chore: rename `ssa_refactor` module to `ssa` (#2129)
  chore: Use `--show-output` flag on execution rather than compilation  (#2116)
  fix(globals): Accurately filter literals for resolving globals (#2126)
  feat: Optimize away constant calls to black box functions (#1981)
TomAFrench added a commit that referenced this pull request Aug 4, 2023
* master: (50 commits)
  chore: update stale comment on `create_circuit` (#2173)
  chore: Replace `resolve_path` function with a trait that impls normalize (#2157)
  chore: clippy fix (#2174)
  feat!: Allow specifying new package name with `--name` flag (#2144)
  chore!: remove unused flags on LSP command (#2170)
  chore: Hide the `show_ssa` and `show_brillig` flags (#2171)
  chore: bump `clap` to 4.3.19 (#2167)
  chore: Move the long line of `nargo info` to `long_about` (#2151)
  chore: Refactor `normalize_path` into an API on FileManager (#2156)
  fix: Implement slices of structs (#2150)
  chore: Refreshed ACIR artifacts (#2148)
  chore: Rebuild ACIR test artifacts (#2147)
  chore: remove short flags for `--show-ssa` and `--deny-warnings` (#2141)
  chore: replace usage of `Directive::Quotient` with brillig opcode  (#1766)
  chore: clippy fix (#2136)
  feat: Initial work on rewriting closures to regular functions with hi… (#1959)
  chore: Decouple acir blockid from ssa valueid (#2103)
  chore: Initialize copy array from previous values in `array_set` (#2106)
  chore: rename `ssa_refactor` module to `ssa` (#2129)
  chore: Use `--show-output` flag on execution rather than compilation  (#2116)
  ...
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.

4 participants