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

fix: Experiment with DecrementRc #7629

Merged
merged 13 commits into from
Mar 18, 2025
Merged

fix: Experiment with DecrementRc #7629

merged 13 commits into from
Mar 18, 2025

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Mar 7, 2025

Description

Problem*

Resolves

Summary*

This is an experimental branch where I'm hoping to fix the underlying issues with our usage of dec_rc. Currently this PR:

  • Reverts dec_rc value original_value back to a single valued dec_rc value
  • Changes dec_rc on parameters to always be issued on the original load value rather than creating a new load. This should fix the original underflow issue we changed dec_rc for.
  • Splits the reference_counts into a separate test for each inliner setting: min, 0, and max. The inliner 0 setting was actually seeing different optimization characteristics compared to the other two just due to optimization ordering. The behavior is still correct though.
  • Changes the "assert if rc drops below 1" debug setting to "assert if rc drops below 0" since an rc of zero is a valid state - it indicates an array that should no longer be used.

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.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 19c19c0 Previous: e3f8398 Ratio
AztecProtocol_aztec-packages_noir-projects_noir-contracts 99 s 77 s 1.29

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@jfecher jfecher marked this pull request as ready for review March 7, 2025 20:38
@jfecher jfecher requested a review from a team March 7, 2025 20:39
@jfecher
Copy link
Contributor Author

jfecher commented Mar 7, 2025

Opening this to review because I think this solves the original issue which #7297 patched. As far as I can see performance with this PR is similar to before it, although ref counts are slightly different depending on inliner 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.

LGTM just curious about the splitting up of reference_counts

Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
Copy link
Contributor

github-actions bot commented Mar 18, 2025

Changes to Brillig bytecode sizes

Generated at commit: dbbb491c8a59bfdb13251e75709d19b0ff85c9d9, compared to commit: cbbfc384d2e70de7246d0161478e9c3962a955e5

🧾 Summary (10% most significant diffs)

Program Brillig opcodes (+/-) %
brillig_rc_regression_6123_inliner_max -150 ✅ -88.24%
brillig_rc_regression_6123_inliner_zero -150 ✅ -88.24%

Full diff report 👇
Program Brillig opcodes (+/-) %
regression_6674_2_inliner_zero 157 (+3) +1.95%
regression_6674_2_inliner_max 206 (+3) +1.48%
regression_6674_3_inliner_min 822 (-10) -1.20%
regression_6674_2_inliner_min 289 (-10) -3.34%
brillig_rc_regression_6123_inliner_min 215 (-22) -9.28%
brillig_rc_regression_6123_inliner_max 20 (-150) -88.24%
brillig_rc_regression_6123_inliner_zero 20 (-150) -88.24%

@jfecher
Copy link
Contributor Author

jfecher commented Mar 18, 2025

Looks like merging master broke the tests

Edit: #7739
Edit2: Blocked by #7740

@jfecher jfecher added this pull request to the merge queue Mar 18, 2025
Merged via the queue into master with commit b059fd1 Mar 18, 2025
106 checks passed
@jfecher jfecher deleted the jf/rc branch March 18, 2025 17:46
aakoshh added a commit to AztecProtocol/aztec-packages that referenced this pull request Mar 19, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: add `mapi`/`for_eachi` functions
(noir-lang/noir#7705)
fix: Experiment with `DecrementRc`
(noir-lang/noir#7629)
chore: delete honk programs from `test_programs`
(noir-lang/noir#7727)
chore(docs): Landing page jargonless intro
(noir-lang/noir#7649)
chore(docs): More acir docs
(noir-lang/noir#7731)
chore: add extra docs lint (noir-lang/noir#7742)
fix: Fix stdout testing when running test programs
(noir-lang/noir#7741)
chore(ci): enforce rustdoc lints
(noir-lang/noir#7738)
chore: bump bb (noir-lang/noir#7726)
fix: handle predicate value reduction in array get also for the databus
(noir-lang/noir#7730)
chore(refactor): Move resolved error structures out of acir crate
(noir-lang/noir#7734)
chore(ci): private-kernel-inner timeout bump
(noir-lang/noir#7732)
END_COMMIT_OVERRIDE

---------

Co-authored-by: aakoshh <akosh@aztecprotocol.com>
Co-authored-by: Akosh Farkash <aakoshh@gmail.com>
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