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(ssa): array sort #754

Merged
merged 10 commits into from
Feb 13, 2023
Merged

feat(ssa): array sort #754

merged 10 commits into from
Feb 13, 2023

Conversation

guipublic
Copy link
Contributor

Description

Summary of changes

This is the first step to implement dynamic arrays. We can now generate constrains for sorting network. The PR uses this to implement array::sort in an efficient way.

Dependency additions / changes

This PR requires first ACVM to be updated with the PermutationSort directive.

Test additions / changes

A test for array::sort is added to the array_len integration test.
Unit test ensure the constrains properly enforce a permutation of the inputs.

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.
  • This PR requires documentation updates when merged.

Additional context

I had to extend the comparator operand rules, but some cases are still missing.

noir_stdlib/src/array.nr Outdated Show resolved Hide resolved
crates/noirc_frontend/src/hir/type_check/expr.rs Outdated Show resolved Hide resolved
noir_stdlib/src/array.nr Outdated Show resolved Hide resolved
@guipublic guipublic added this pull request to the merge queue Feb 13, 2023
Merged via the queue into master with commit 32e9320 Feb 13, 2023
@guipublic guipublic deleted the gd/dynamic_array branch February 13, 2023 17:09
TomAFrench added a commit that referenced this pull request Feb 14, 2023
* master: (28 commits)
  chore(ci): Add release token to enable runs against release PR (#840)
  feat(ssa): array sort (#754)
  chore: update readme (#811)
  chore: fix clippy (#825)
  chore: remove stale comment on HirFunction.unchecked_from_expr (#827)
  chore: Getter naming refactor (#803)
  chore: updated "HirFunction::unsafe_from_expr" to "HirFunction::unchecked_from_expr" (#823)
  chore: Forbid unsafe code (#824)
  chore: Follow rust naming convention (#801)
  feat(ci): Add concurrency group for rust workflow (#806)
  chore(ssa): rename impl method to follow Rust guideline (#782)
  fix(nargo): `nargo test` now only runs test functions defined in the current module (#805)
  chore(nargo): Remove outdated error message when Prover/Verifier.toml is missing (#807)
  chore(ssa): rename codegen to ssa_gen + reorg of `Value` struct (#797)
  chore(nargo): abstract paths from nargo's working directory (#761)
  chore(ci): Rename workflows (#804)
  feat: Impls with generics (#798)
  chore(ssa): Add doc comments on `Opcode` struct (#778)
  fix: operators issuing type errors when used with matching integer types arising from generic code (#789)
  chore(nargo)!: bump MSRV to 1.66.0 (#799)
  ...
TomAFrench added a commit that referenced this pull request Feb 14, 2023
* master:
  chore(ci): Add release token to enable runs against release PR (#840)
  feat(ssa): array sort (#754)
  chore: update readme (#811)
  chore: fix clippy (#825)
  chore: remove stale comment on HirFunction.unchecked_from_expr (#827)
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