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 > 1 path
- Makes adding new batch sizes (e.g.
BS = 2) trivial — just define GroupAccessors
- Removes
commit_group’s O(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_groups in prover_polynomials.hpp is already generic over BS
GroupAccessors_<BS> already defines group structure per batch size
Gemini / Shplemini PCS infrastructure already supports arbitrary shift_exponent
Context
The
OinkProverhandles interleaved (BS > 1) and non-interleaved (BS = 1) commitment paths viaif constexpr (BATCH_SIZE > 1)branches in everycommit_to_*method.The
BS > 1path currently hardcodes entity-to-group mappings by name.This approach does not scale — adding
BS = 2or changing the group structure requires editing every method.Proposed solution
Have the
Flavordefine round-to-group mappings and letOinkProveriterate generically:Benefits
BS > 1pathBS = 2) trivial — just defineGroupAccessorscommit_group’sO(n)linear scan for group buffer lookup (use index directly)Current state
The explicit approach works correctly for
BS = 1andBS = 4.Related
allocate_interleaved_groupsinprover_polynomials.hppis already generic overBSGroupAccessors_<BS>already defines group structure per batch sizeGemini/ShpleminiPCS infrastructure already supports arbitraryshift_exponent