Skip to content

Conversation

@notnotraju
Copy link
Contributor

@notnotraju notnotraju commented Nov 20, 2025

🧾 Audit Context

Remove dead code, mostly having to do with the structured trace.

🛠️ Changes Made

  • List the changes or refactor steps performed.
  • Mention if there are any functional changes or if it's purely structural.
  • If your modifications results in circuit changes (i.e., changes to the VKs), please describe them qualitatively and quantitatively.

✅ Checklist

  • Audited all methods of the relevant module/class
  • Audited the interface of the module/class with other (relevant) components
  • Documented existing functionality and any changes made (as per Doxygen requirements)
  • Resolved and/or closed all issues/TODOs pertaining to the audited files
  • Confirmed and documented any security or other issues found (if applicable)
  • Verified that tests cover all critical paths (and added tests if necessary)
  • Updated audit tracking for the files audited (check the start of each file you audited)

📌 Notes for Reviewers

@notnotraju notnotraju added ci-full Run all master checks. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure labels Nov 25, 2025
@notnotraju notnotraju marked this pull request as ready for review November 25, 2025 14:45
@notnotraju notnotraju changed the title chore: removes ActiveRegionData, a remnant of the structured trace chore: audit Permutation argument 2r Nov 25, 2025
@notnotraju notnotraju changed the title chore: audit Permutation argument 2r chore: audit Permutation argument 2 Nov 25, 2025
{}
};

template <size_t NUM_WIRES, bool generalized> struct PermutationMapping {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

generalized toggled whether we compute the id polynomials or not. This was controlled by an IsUltraOrMega<Flavor>, which is all we'll use this for, so I think the logic is simpler when we remove this template parameter.

auto row_idx = get_active_range_poly_idx(i);
if constexpr (IsUltraOrMegaHonk<Flavor>) {
row = full_polynomials.get_row_for_permutation_arg(row_idx);
row = full_polynomials.get_row_for_permutation_arg(i);
Copy link
Contributor

Choose a reason for hiding this comment

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

is any other flavor using this method?

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 think ECCVM and Translator? (E.g., see eccvm_prover.cpp and translator_prover.cpp)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, translator_flavor doesn't have the sigma wires, and has a different compute_grand_product_numerator (resp. denominator) method. In particular, there is no get_row_for_permutation_arg, nor do I think there could be without changing the translator itself. I think we therefore do need the IsUltraOrMega concept :-/

// For Ultra/Mega, the first row is an inactive zero row thus the grand prod takes value 1 at both i = 0 and i = 1
// For Ultra/Mega, the first row is a zero row thus the grand prod takes value 1 at both i = 0 and i = 1
if constexpr (IsUltraOrMegaHonk<Flavor>) {
grand_product_polynomial.at(1) = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

it's the same 1 that was confusing in permutation_lib.hpp. can we make sure we are using this consistently?

Copy link
Contributor Author

@notnotraju notnotraju Nov 26, 2025

Choose a reason for hiding this comment

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

z_perm.at(1) == 1 follows automatically for ultra/mega, so just removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(as we aren't killing IsUltraOrMega, I could add this as a constexpr conditional BB_ASSERT_EQ; I initially thought grand_product_polynomial.at(1) == 1 was true for all flavors, and I put in an assert, but I got an error in one of the noir protocol circuits.)

Copy link
Contributor

@iakovenkos iakovenkos left a comment

Choose a reason for hiding this comment

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

please make the usage of z_perm start index consistent across different methods + make sure we still need IsUltraOrMega concept

using CyclicPermutation = std::vector<cycle_node>;

namespace {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for easier reasoning-about-indices

@notnotraju notnotraju merged commit 6d03f58 into merge-train/barretenberg Nov 26, 2025
6 checks passed
@notnotraju notnotraju deleted the rk/nuke-active-region-data branch November 26, 2025 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run all master checks. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants