Skip to content

chore: Fix translator's static assert#22695

Merged
federicobarbacovi merged 2 commits into
merge-train/barretenbergfrom
fb/fix_translator_assertion
Apr 21, 2026
Merged

chore: Fix translator's static assert#22695
federicobarbacovi merged 2 commits into
merge-train/barretenbergfrom
fb/fix_translator_assertion

Conversation

@federicobarbacovi

@federicobarbacovi federicobarbacovi commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Fix the static assert in Translator: the size for the translator is determined by the MINI_CIRCUIT_SIZE * CONCATENATION_GROUP_SIZE. This number must be bigger than SORTED_STEPS (which is the max size of the microlimbs divided by 3) times NUM_ORDERED_RANGE (1 + the number of interleaved polynomials) plus the masking rows in the overflow column (which are equal to 4 * 64 / 5 (see the README).

The old static assert compared SORTED_STEPS times 1 + NUM_CONCATENATED_POLYS with the size of the translator.

@federicobarbacovi federicobarbacovi marked this pull request as ready for review April 21, 2026 13:09

// The number of masking values in the overflow columns used for the ordered range constraint
static constexpr size_t MASKING_OVERFLOW_COLUMN =
MAX_RANDOM_VALUES_PER_ORDERED * (NUM_CONCATENATED_POLYS - 1) / NUM_CONCATENATED_POLYS;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should use NUM_ORDERED_RANGE here instead of NUM_CONCATENATED_POLYS because although both are currently equal (to 5), NUM_CONCATENATED_POLYS could change in future.

We calculate NUM_CONCATENATED_POLYS as $\bigg\lceil \frac{64 + 13}{16} \bigg\rceil = 5$. But if you add 7 more witness columns (in future), it will increase to $\bigg\lceil \frac{64 + 13 + 7}{16} \bigg\rceil = 6$

@suyash67 suyash67 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, thanks for fixing this!

@federicobarbacovi federicobarbacovi merged commit 5d80072 into merge-train/barretenberg Apr 21, 2026
14 checks passed
@federicobarbacovi federicobarbacovi deleted the fb/fix_translator_assertion branch April 21, 2026 14:03
dipkakwani pushed a commit to dipkakwani/aztec-packages that referenced this pull request Apr 22, 2026
BEGIN_COMMIT_OVERRIDE
chore!: masking at the top of the trace (AztecProtocol#22334)
chore: Fix translator's static assert (AztecProtocol#22695)
chore: bump mem for large circuit test (AztecProtocol#22690)
END_COMMIT_OVERRIDE
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