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: Document gate savings around no_predicates #5657

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jzaki
Copy link
Contributor

@jzaki jzaki commented Aug 1, 2024

No description provided.

@jzaki jzaki added the documentation Improvements or additions to documentation label Aug 1, 2024
Copy link
Contributor

github-actions bot commented Aug 1, 2024

@jzaki jzaki changed the title Document gate savings around if, loop, and no_predicates docs: Document gate savings around if, loop, and no_predicates Aug 1, 2024
@jzaki jzaki changed the title docs: Document gate savings around if, loop, and no_predicates chore: Document gate savings around if, loop, and no_predicates Aug 1, 2024
@@ -149,6 +161,17 @@ Use ` if is_unconstrained() { /`, to conditionally execute code if being called

Unless you're well into the depth of gate optimization, this advanced section can be ignored.

### `#[no_predicates]` over for "pure" functions
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about advertising no_predicates yet as for unexperienced developers it is a bit more dangerous and less obvious about what is happening. @jfecher what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also we have a few errors such as #5672 that still exist so I would rather not advertise publicly yet @jzaki

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I put this in the advanced section with plenty of caveats.
Whilst the start is more general to help devs new to Noir start to appreciate what optimisations do/don't look like, the Advanced section is caveated ( the line above). I'll make this a warning.

The contents below came up as a question in slack (by a more advanced ecosystem dev), they happened to refer to the form of predicates in passing.

@jzaki jzaki force-pushed the jz/docs-no-predicates branch from e0de8d7 to 3e44738 Compare December 13, 2024 12:44
@jzaki
Copy link
Contributor Author

jzaki commented Dec 13, 2024

if/loop tip separated into #6806

Copy link
Contributor

Peak Memory Sample

Program Peak Memory
keccak256 79.14M
workspace 122.04M
regression_4709 295.99M
ram_blowup_regression 2.44G
private-kernel-tail 210.43M
private-kernel-reset 862.22M
private-kernel-inner 307.94M
parity-root 175.78M

Copy link
Contributor

github-actions bot commented Dec 13, 2024

Compilation Report

Program Compilation Time %
sha256_regression 1.284s 2%
regression_4709 0.777s -1%
ram_blowup_regression 18.280s 0%
rollup-base-public 41.520s 6%
rollup-base-private 12.460s -3%
private-kernel-tail 0.982s -5%

@jzaki
Copy link
Contributor Author

jzaki commented Dec 13, 2024

@vezenovm is any of this still relevant or should I just close this?

TomAFrench added a commit to winderica/noir that referenced this pull request Jan 3, 2025
* master:
  chore: add if/loop tip (separate from no-predicate noir-lang#5657) (noir-lang#6806)
  chore: move implementation of print foreign call into `nargo` (noir-lang#6865)
  chore: document format strings (noir-lang#6920)
  chore: add `rollup_root` and `rollup_block_merge` to tracked protocol circuits (noir-lang#6903)
  fix: consistent file_id across installation paths (noir-lang#6912)
  fix: bigint builtins are foreigns (noir-lang#6892)
  fix: remove unnecessary cast in bit-shift (noir-lang#6890)
  chore: Release Noir(1.0.0-beta.1) (noir-lang#6622)
  chore: Add `Instruction::Noop` (noir-lang#6899)
  chore: remove malformed functions from brillig reports (noir-lang#6898)
  chore: clean up gates reports script (noir-lang#6896)
  chore: move empty programs to `compile_success_empty` (noir-lang#6891)
  feat: add a warning when using unsafe blocks without safety comments (noir-lang#6860)
  chore: quick docs fix for noir-lang#6839 (noir-lang#6840)
  chore: Avoid duplicate Not instructions during flattening (noir-lang#6886)
  chore: Use smallvec for instruction results (noir-lang#6877)
  chore(ci): Display times in compilation and execution reports only with seconds (noir-lang#6880)
  feat: flatten nested if-else statements with equivalent conditions (noir-lang#6875)
  chore(ci): Take averages for compilation and execution report of small programs (noir-lang#6874)
  fix: don't deduplicate binary math of unsigned types (noir-lang#6848)
TomAFrench added a commit that referenced this pull request Jan 3, 2025
* master: (47 commits)
  chore: delete a bunch of dead code from `noirc_evaluator` (#6939)
  feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (#6882)
  chore: Bump arkworks to version `0.5.0` (#6871)
  feat(ssa): Hoist add and mul binary ops using known induction variables (#6910)
  chore: fix warning (#6927)
  chore(ci): Memory reports for execution (#6907)
  chore: use ssa parser in flattening pass tests (#6868)
  feat(LSP): suggest trait methods from where clauses (#6915)
  feat: warn on trait method visibility (#6923)
  feat!: Switch to using `jsonrpsee` for foreign calls; refactor `run_test`; foreign call layering (#6849)
  chore: add rollup circuits to memory reports (#6897)
  chore: remove unused dependency (#6922)
  chore: add if/loop tip (separate from no-predicate #5657) (#6806)
  chore: move implementation of print foreign call into `nargo` (#6865)
  chore: document format strings (#6920)
  chore: add `rollup_root` and `rollup_block_merge` to tracked protocol circuits (#6903)
  fix: consistent file_id across installation paths (#6912)
  fix: bigint builtins are foreigns (#6892)
  fix: remove unnecessary cast in bit-shift (#6890)
  chore: Release Noir(1.0.0-beta.1) (#6622)
  ...
Copy link
Contributor

Compilation Memory Report

Program Peak Memory
keccak256 78.11M
workspace 123.80M
regression_4709 422.96M
ram_blowup_regression 1.58G
rollup-base-public 4.85G
rollup-base-private 1.26G
private-kernel-tail 207.08M
private-kernel-reset 730.50M
private-kernel-inner 294.30M

Copy link
Contributor

Execution Memory Report

Program Peak Memory
keccak256 74.66M
workspace 123.80M
regression_4709 315.99M
ram_blowup_regression 512.41M
rollup-base-public 482.46M
rollup-base-private 328.58M
private-kernel-tail 180.93M
private-kernel-reset 249.60M
private-kernel-inner 209.77M

Copy link
Contributor

Execution Report

Program Execution Time %
sha256_regression 0.054s 0%
regression_4709 0.001s 0%
ram_blowup_regression 0.575s -1%
rollup-base-public 1.246s 0%
rollup-base-private 0.471s 0%
private-kernel-tail 0.021s 0%

@jzaki jzaki changed the title chore: Document gate savings around if, loop, and no_predicates chore: Document gate savings around no_predicates Jan 10, 2025
@TomAFrench
Copy link
Member

@noir-lang/developerrelations

Copy link
Contributor

FYI @noir-lang/developerrelations on Noir doc changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants