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: Use NumericType not Type for casts and numeric constants #6769

Merged
merged 3 commits into from
Dec 11, 2024

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Dec 11, 2024

Description

Problem*

Broken out of a larger change to remove Type from the Value enum entirely, which is also broken out of the even larger change to remove ValueId.

Summary*

Use NumericType instead of Type for constants and casts to avoid a clone operation and for stronger type safety.
Getting rid of clones isn't expected to improve performance since these types would just be a Type::Numeric wrapper around a Copy type anyway.

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

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

@jfecher jfecher requested a review from a team December 11, 2024 15:19
Copy link
Contributor

github-actions bot commented Dec 11, 2024

Peak Memory Sample

Program Peak Memory
keccak256 81.14M
workspace 122.05M
regression_4709 327.82M
ram_blowup_regression 2.54G
private-kernel-tail 231.33M
private-kernel-reset 1.24G
private-kernel-inner 336.12M
parity-root 198.47M

Copy link
Contributor

github-actions bot commented Dec 11, 2024

Compilation Sample

Program Compilation Time %
sha256_regression 0m1.465s 2%
regression_4709 0m1.528s 1%
ram_blowup_regression 0m16.943s 1%
private-kernel-tail 0m1.311s -5%
private-kernel-reset 0m9.479s -8%
private-kernel-inner 0m2.405s -3%
parity-root 0m1.063s 6%
noir-contracts 2m44.562s -4%

@jfecher jfecher added this pull request to the merge queue Dec 11, 2024
Merged via the queue into master with commit e973397 Dec 11, 2024
62 checks passed
@jfecher jfecher deleted the jf/numeric-type branch December 11, 2024 17:47
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Dec 11, 2024
…g/noir#6747)

chore: Use `NumericType` not `Type` for casts and numeric constants (noir-lang/noir#6769)
chore(ci): Extend compiler memory report to external repos (noir-lang/noir#6768)
chore(ci): Handle external libraries in compilation timing report (noir-lang/noir#6750)
feat(ssa): Implement missing brillig constraints SSA check (noir-lang/noir#6658)
fix: Do not merge expressions that contain output witnesses (noir-lang/noir#6757)
fix: parser would hand on function type with colon in it (noir-lang/noir#6764)
chore(docs): Update branding (noir-lang/noir#6759)
feat(cli): Run command on the package closest to the current directory (noir-lang/noir#6752)
chore: lock CI to use ubuntu 22.04 (noir-lang/noir#6755)
chore: free memory for silenced warnings early (noir-lang/noir#6748)
chore(stdlib)!: Remove Schnorr (noir-lang/noir#6749)
fix: Improve type error when indexing a variable of unknown type (noir-lang/noir#6744)
fix: println("{{}}") was printing "{{}}" instead of "{}" (noir-lang/noir#6745)
feat: `std::hint::black_box` function. (noir-lang/noir#6529)
feat(ci): Initial compilation report on test_programs (noir-lang/noir#6731)
chore: Cleanup unrolling pass (noir-lang/noir#6743)
fix: allow empty loop headers (noir-lang/noir#6736)
fix: map entry point indexes after all ssa passes (noir-lang/noir#6740)
chore: Update url to 2.5.4 (noir-lang/noir#6741)
feat: Order attribute execution by their source ordering (noir-lang/noir#6326)
feat(test): Check that `nargo::ops::transform_program` is idempotent (noir-lang/noir#6694)
feat: Sync from aztec-packages (noir-lang/noir#6730)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Dec 11, 2024
chore: Use `NumericType` not `Type` for casts and numeric constants (noir-lang/noir#6769)
chore(ci): Extend compiler memory report to external repos (noir-lang/noir#6768)
chore(ci): Handle external libraries in compilation timing report (noir-lang/noir#6750)
feat(ssa): Implement missing brillig constraints SSA check (noir-lang/noir#6658)
fix: Do not merge expressions that contain output witnesses (noir-lang/noir#6757)
fix: parser would hand on function type with colon in it (noir-lang/noir#6764)
chore(docs): Update branding (noir-lang/noir#6759)
feat(cli): Run command on the package closest to the current directory (noir-lang/noir#6752)
chore: lock CI to use ubuntu 22.04 (noir-lang/noir#6755)
chore: free memory for silenced warnings early (noir-lang/noir#6748)
chore(stdlib)!: Remove Schnorr (noir-lang/noir#6749)
fix: Improve type error when indexing a variable of unknown type (noir-lang/noir#6744)
fix: println("{{}}") was printing "{{}}" instead of "{}" (noir-lang/noir#6745)
feat: `std::hint::black_box` function. (noir-lang/noir#6529)
feat(ci): Initial compilation report on test_programs (noir-lang/noir#6731)
chore: Cleanup unrolling pass (noir-lang/noir#6743)
fix: allow empty loop headers (noir-lang/noir#6736)
fix: map entry point indexes after all ssa passes (noir-lang/noir#6740)
chore: Update url to 2.5.4 (noir-lang/noir#6741)
feat: Order attribute execution by their source ordering (noir-lang/noir#6326)
feat(test): Check that `nargo::ops::transform_program` is idempotent (noir-lang/noir#6694)
feat: Sync from aztec-packages (noir-lang/noir#6730)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Dec 12, 2024
)

chore: Try replace callstack with a linked list (noir-lang/noir#6747)
chore: Use `NumericType` not `Type` for casts and numeric constants (noir-lang/noir#6769)
chore(ci): Extend compiler memory report to external repos (noir-lang/noir#6768)
chore(ci): Handle external libraries in compilation timing report (noir-lang/noir#6750)
feat(ssa): Implement missing brillig constraints SSA check (noir-lang/noir#6658)
fix: Do not merge expressions that contain output witnesses (noir-lang/noir#6757)
fix: parser would hand on function type with colon in it (noir-lang/noir#6764)
chore(docs): Update branding (noir-lang/noir#6759)
feat(cli): Run command on the package closest to the current directory (noir-lang/noir#6752)
chore: lock CI to use ubuntu 22.04 (noir-lang/noir#6755)
chore: free memory for silenced warnings early (noir-lang/noir#6748)
chore(stdlib)!: Remove Schnorr (noir-lang/noir#6749)
fix: Improve type error when indexing a variable of unknown type (noir-lang/noir#6744)
fix: println("{{}}") was printing "{{}}" instead of "{}" (noir-lang/noir#6745)
feat: `std::hint::black_box` function. (noir-lang/noir#6529)
feat(ci): Initial compilation report on test_programs (noir-lang/noir#6731)
chore: Cleanup unrolling pass (noir-lang/noir#6743)
fix: allow empty loop headers (noir-lang/noir#6736)
fix: map entry point indexes after all ssa passes (noir-lang/noir#6740)
chore: Update url to 2.5.4 (noir-lang/noir#6741)
feat: Order attribute execution by their source ordering (noir-lang/noir#6326)
feat(test): Check that `nargo::ops::transform_program` is idempotent (noir-lang/noir#6694)
feat: Sync from aztec-packages (noir-lang/noir#6730)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Dec 12, 2024
chore: Try replace callstack with a linked list (noir-lang/noir#6747)
chore: Use `NumericType` not `Type` for casts and numeric constants (noir-lang/noir#6769)
chore(ci): Extend compiler memory report to external repos (noir-lang/noir#6768)
chore(ci): Handle external libraries in compilation timing report (noir-lang/noir#6750)
feat(ssa): Implement missing brillig constraints SSA check (noir-lang/noir#6658)
fix: Do not merge expressions that contain output witnesses (noir-lang/noir#6757)
fix: parser would hand on function type with colon in it (noir-lang/noir#6764)
chore(docs): Update branding (noir-lang/noir#6759)
feat(cli): Run command on the package closest to the current directory (noir-lang/noir#6752)
chore: lock CI to use ubuntu 22.04 (noir-lang/noir#6755)
chore: free memory for silenced warnings early (noir-lang/noir#6748)
chore(stdlib)!: Remove Schnorr (noir-lang/noir#6749)
fix: Improve type error when indexing a variable of unknown type (noir-lang/noir#6744)
fix: println("{{}}") was printing "{{}}" instead of "{}" (noir-lang/noir#6745)
feat: `std::hint::black_box` function. (noir-lang/noir#6529)
feat(ci): Initial compilation report on test_programs (noir-lang/noir#6731)
chore: Cleanup unrolling pass (noir-lang/noir#6743)
fix: allow empty loop headers (noir-lang/noir#6736)
fix: map entry point indexes after all ssa passes (noir-lang/noir#6740)
chore: Update url to 2.5.4 (noir-lang/noir#6741)
feat: Order attribute execution by their source ordering (noir-lang/noir#6326)
feat(test): Check that `nargo::ops::transform_program` is idempotent (noir-lang/noir#6694)
feat: Sync from aztec-packages (noir-lang/noir#6730)
TomAFrench added a commit to AztecProtocol/aztec-packages that referenced this pull request Dec 12, 2024
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
feat: several `nargo test` improvements
(noir-lang/noir#6728)
chore: Try replace callstack with a linked list
(noir-lang/noir#6747)
chore: Use `NumericType` not `Type` for casts and numeric constants
(noir-lang/noir#6769)
chore(ci): Extend compiler memory report to external repos
(noir-lang/noir#6768)
chore(ci): Handle external libraries in compilation timing report
(noir-lang/noir#6750)
feat(ssa): Implement missing brillig constraints SSA check
(noir-lang/noir#6658)
fix: Do not merge expressions that contain output witnesses
(noir-lang/noir#6757)
fix: parser would hand on function type with colon in it
(noir-lang/noir#6764)
chore(docs): Update branding
(noir-lang/noir#6759)
feat(cli): Run command on the package closest to the current directory
(noir-lang/noir#6752)
chore: lock CI to use ubuntu 22.04
(noir-lang/noir#6755)
chore: free memory for silenced warnings early
(noir-lang/noir#6748)
chore(stdlib)!: Remove Schnorr
(noir-lang/noir#6749)
fix: Improve type error when indexing a variable of unknown type
(noir-lang/noir#6744)
fix: println("{{}}") was printing "{{}}" instead of "{}"
(noir-lang/noir#6745)
feat: `std::hint::black_box` function.
(noir-lang/noir#6529)
feat(ci): Initial compilation report on test_programs
(noir-lang/noir#6731)
chore: Cleanup unrolling pass
(noir-lang/noir#6743)
fix: allow empty loop headers
(noir-lang/noir#6736)
fix: map entry point indexes after all ssa passes
(noir-lang/noir#6740)
chore: Update url to 2.5.4 (noir-lang/noir#6741)
feat: Order attribute execution by their source ordering
(noir-lang/noir#6326)
feat(test): Check that `nargo::ops::transform_program` is idempotent
(noir-lang/noir#6694)
feat: Sync from aztec-packages
(noir-lang/noir#6730)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <[email protected]>
Co-authored-by: thunkar <[email protected]>
Co-authored-by: maramihali <[email protected]>
Co-authored-by: TomAFrench <[email protected]>
Co-authored-by: aakoshh <[email protected]>
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