-
Notifications
You must be signed in to change notification settings - Fork 131
multiPCS: make Oink-phase BATCH_SIZE-agnostic #1658
Copy link
Copy link
Open
Description
Context
The OinkProver handles interleaved (BS > 1) and non-interleaved (BS = 1) commitment paths via if constexpr (BATCH_SIZE > 1) branches in every commit_to_* method.
The BS > 1 path currently hardcodes entity-to-group mappings by name.
This approach does not scale — adding BS = 2 or changing the group structure requires editing every method.
Proposed solution
Have the Flavor define round-to-group mappings and let OinkProver iterate generically:
// Flavor defines which groups are committed in each round:
static constexpr std::array WIRE_GROUP_INDICES = {8, 9, 10, 11, 12, 13};
static constexpr std::array W4_GROUP_INDICES = {16, 14};
// OinkProver iterates:
if constexpr (BATCH_SIZE > 1) {
for (auto g : Flavor::WIRE_GROUP_INDICES) {
commit_group_by_index(g);
}
}Benefits
- Eliminates per-entity naming in the
BS > 1path - Makes adding new batch sizes (e.g.
BS = 2) trivial — just defineGroupAccessors - Removes
commit_group’sO(n)linear scan for group buffer lookup (use index directly) - Consolidates ZK tail logic, which currently also performs a linear scan to find the group index
Current state
The explicit approach works correctly for BS = 1 and BS = 4.
Related
allocate_interleaved_groupsinprover_polynomials.hppis already generic overBSGroupAccessors_<BS>already defines group structure per batch sizeGemini/ShpleminiPCS infrastructure already supports arbitraryshift_exponent
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels