Skip to content

chore: pipp review#23407

Open
iakovenkos wants to merge 13 commits into
lde/zacs-pippengerfrom
si/reviewing_new_pipp
Open

chore: pipp review#23407
iakovenkos wants to merge 13 commits into
lde/zacs-pippengerfrom
si/reviewing_new_pipp

Conversation

@iakovenkos
Copy link
Copy Markdown
Contributor

.

@iakovenkos iakovenkos force-pushed the si/reviewing_new_pipp branch from 89c2f72 to 6a640b6 Compare May 21, 2026 09:13
@iakovenkos iakovenkos self-assigned this May 21, 2026
@iakovenkos iakovenkos added the ci-full Run all master checks. label May 21, 2026
Centralise the per-worker Zone W byte walk in pippenger_arena_layout.hpp so
the sizer, live allocator, and arena-fit test all share one source of truth
(prior drift here caused four historical arena bugs). Move the 270-line
pippenger_bn254_arena_layout_fits_for_test helper out of
scalar_multiplication.cpp into the test TU and expose
compute_arena_bytes_for_msm via the header (BN254 explicitly instantiated).
The sizer (outer + per-schedule lambda) and the live allocator each carried
their own copy of the per_window_bytes / phase_one_prologue_bytes / phase_a
caps / wpb solver formulas — 5 duplicates total. Replace the three copies
with shared free functions in pippenger_arena_layout.hpp
(compute_per_window_bytes, compute_phase_one_prologue_bytes,
compute_phase_a_caps, compute_dense_stride, compute_bucket_partials_max,
compute_global_max_overflow_per_window, solve_wpb). Net -85 lines and the
formulas can no longer drift across sites.
…antine.hpp

Move the ~360 lines of Constantine slice params, scalar packed-digit recoder,
and SIMD x4 specialisations out of scalar_multiplication.cpp into a dedicated
pippenger_constantine.hpp under the same round_parallel_detail namespace.
Pure code motion.
#include <wasm_simd128.h>
#endif

namespace bb::scalar_multiplication::round_parallel_detail {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

simply moving the constantine logic from the main file

return bump_alloc_within.template operator()<T>(count, arena_cursor, arena_capacity, 0);
};
const size_t arena_total_bytes = compute_arena_bytes_for_msm<Curve>(n_input, external_glv_provided, dedup_active);
round_parallel_detail::MsmArena arena(arena_total_bytes, external_arena);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

trying to make this method more readable

uint8_t empty = 1;
};

template <typename Curve> struct PerWorkerArenaLayout {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

was duplicated across several places

{
const size_t saved_threads = bb::get_num_cpus();

// CI regression from HonkRecursionConstraintTestWithoutPredicate/2.GenerateVKFromConstraints:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Inspired by real regression where arena layout was incorrectly computed

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant