Skip to content

perf(bb): bb experimental optimizations behind feature flag - #25798

Draft
IlyasRidhuan wants to merge 14 commits into
nextfrom
design/bb-experimental-optimizations
Draft

IlyasRidhuan wants to merge 14 commits into
nextfrom
design/bb-experimental-optimizations

Conversation

@IlyasRidhuan

Copy link
Copy Markdown
Collaborator

Benchmarked against the AVM and two (Public + Root) large rollup circuits.

Group AVM Public Rollup Root Rollup
Thread Pool (484c9d2) 29.70% 6.36% 1.71%
IFMA 19.56% 13.18% 8.10%
Scalar Arithmetic (the rest) 10.02% 6.14% 5.30%

once. Later environment changes have no effect. Hot arithmetic reads cached
booleans without an initialization guard, mutex or atomic load.

bb.js accepts `experimentalOptimizations` in backend initialization options.

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.

Nice. Watch out that bbjs and the IPC in next and v6 differ quite a lot. Have the agent double check the plumning in v6 when porting.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yep i will manually port this

IlyasRidhuan and others added 14 commits November 12, 2026 17:15
Use the bounded reciprocal path for eligible BN254 operands, simplify truncated wide multiplication and retain aligned modulus copies for arithmetic.

Category: shared-scalar
Source-patch: d1ee8661ce6f72dab2c85012885665f24820603c

Co-authored-by: opt <a@b>
Co-authored-by: bench <bench@local>
Co-authored-by: Sol research <sol-research@local>
Co-authored-by: Astra ideator2 <astra-ideator2@local>
Co-authored-by: IlyasRidhuan <ilyasridhuan@gmail.com>
Store gate tiles in geometrically growing chunks so append growth does not copy the existing trace. Preserve logical indices and support releasing construction storage.

Category: rollup
Source-patch: d1ee8661ce6f72dab2c85012885665f24820603c

Co-authored-by: opt <a@b>
Co-authored-by: bench <bench@local>
Co-authored-by: Sol research <sol-research@local>
Co-authored-by: Astra ideator2 <astra-ideator2@local>
Co-authored-by: IlyasRidhuan <ilyasridhuan@gmail.com>
Assemble/split limbs using narrower shifts, skip reduction for already reduced values, cache constant modulus bounds and replace quotient-bound division with comparisons.

Category: rollup
Source-patch: d1ee8661ce6f72dab2c85012885665f24820603c

Co-authored-by: opt <a@b>
Co-authored-by: bench <bench@local>
Co-authored-by: Sol research <sol-research@local>
Co-authored-by: Astra ideator2 <astra-ideator2@local>
Co-authored-by: IlyasRidhuan <ilyasridhuan@gmail.com>
Use limb-wise division rather than bitwise wide division for single-limb divisors; retain the WASM fallback where native wide instructions are unavailable.

Category: shared-scalar
Source-patch: d1ee8661ce6f72dab2c85012885665f24820603c

Co-authored-by: opt <a@b>
Co-authored-by: bench <bench@local>
Co-authored-by: Sol research <sol-research@local>
Co-authored-by: Astra ideator2 <astra-ideator2@local>
Co-authored-by: IlyasRidhuan <ilyasridhuan@gmail.com>
@IlyasRidhuan
IlyasRidhuan force-pushed the design/bb-experimental-optimizations branch from 077cf31 to a9f5c25 Compare November 12, 2026 18:44
@IlyasRidhuan
IlyasRidhuan removed this pull request from stack #25800 November 13, 2026 09:26

This branch has not been deployed

No deployments
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