Skip to content

feat(akita): add multi-chunk one-hot profiles - #1976

Merged
moodlezoup merged 49 commits into
a16z:mainfrom
LayerZero-Labs:codex/akita-multi-chunk-on-1948
Oct 6, 2026
Merged

moodlezoup merged 49 commits into
a16z:mainfrom
LayerZero-Labs:codex/akita-multi-chunk-on-1948

Conversation

@RadNi

@RadNi RadNi commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Port the multi-chunk one-hot witness feature from #1896 onto #1948's updated Akita API. This PR targets #1948's branch so its diff contains the multi-chunk feature without repeating the Akita version bump.

Dense producer performance tradeoff

Dense advice and committed-program producers deliberately use the fixed W8R2 response geometry across all trace profiles, including Single. This keeps producer selection independent of the consuming trace profile, simplifies the logic, conservatively covers the maximum supported chunk count, and permits cross-profile commitment reuse. We accept that this changes the standalone producer geometry and can slow the default Single path.

Reviewer measurements compared df4ad5c3d with a007b8efc using the same guests on an M3 Max with four threads, six balanced old/new pairs, and the Single profile:

Fixture Prove ms, old → new Reported change
No advice (control) 216.1 → 216.5 Essentially unchanged
Advice 285.8 → 307.3 +7.8%
Committed program 584.2 → 623.3 +6.4%
Advice + committed program 658.6 → 717.1 +8.7%

Trusted-advice commitment was approximately 20% slower and program commitment approximately 8% slower. Commitment size stayed at 166 bytes; proof size changed by at most 225 bytes. These are indicative small-fixture, whole-head comparisons, rather than an isolated measurement of the producer geometry change.

Validation

  • cargo nextest run -p jolt-akita --cargo-quiet --no-fail-fast (80 passed)
  • cargo nextest run -p jolt-prover --features akita,prover-fixtures --cargo-quiet (28 passed)
  • cargo nextest run -p jolt-prover --features akita,prover-fixtures -E 'binary(akita_e2e)' --cargo-quiet (9 passed)
  • cargo nextest run -p jolt-verifier --features akita,prover-fixtures --test-threads 1 --cargo-quiet (91 passed, 9 skipped)
  • cargo clippy --all --features host -q --all-targets -- -D warnings
  • cargo clippy --all --features host,zk -q --all-targets -- -D warnings
  • cargo fmt --check
  • git diff --check

0xAndoroid and others added 18 commits September 27, 2026 22:04
Akita main (includes LayerZero-Labs/akita#37): akita-transcript on
spongefish 0.7.4 rev ef974134 (u64 squeeze counters, pointer-width
independent challenges). One workspace spongefish source; jolt-poly joins
the a16z/jolt path patch because akita now depends on it via git.
akita db5efa20 (akita#37) replaces the typed batched proof and its
transcript with Spongefish argument bytes keyed by a session label, moves
the CPU prover behind an owning CpuBackend with CommitmentHandles, and
verifies through AkitaVerifier. Bridge Jolt's statement-bound challenge
into the session bytes, commit via CpuBackend::import_source/commit, keep
the retained source in the handle instead of a second copy in the hint,
cache prepared AkitaVerifiers per flavor, and port TracePackedOneHot to the
akita_pcs::custom_source contracts. The proof-shape guard goes away with
the structured proof layer; only the commitment payload guard remains.
The akita_prover groups commit through CpuBackend::commit and prove to
Spongefish argument bytes; sources are imported once outside the timed
region. akita-prover and akita-transcript are no longer direct
dependencies of jolt-dory.
cargo metadata per sub-workspace; no wholesale update.
akita#37 changed the planner policy identity (cost model
NativeNoncePayloadAndSetupEnvelopeV2, selection objectives V5/V6), so the
checked-in .aks envelopes no longer pass the policy-digest check. Rows:
k16 46 (37 changed), k256 64 (38 changed), dense 42 (40 changed); no rows
added or removed, and the direct/offloaded cutover is unchanged.
An Akita CommitmentHandle proves only on the CpuBackend that committed it,
and advice / committed-program objects are committed on their own
transparent setups' dense backends. Import each precommitted handle into
the trace one-hot backend before the grouped batched_prove; Akita
recomputes the dense commitment from the retained source and checks it
against the shared public matrix. The trailing-garbage fold_paths test now
expects Akita's own EOF rejection (VerificationFailed) since the adapter no
longer deserializes the proof.
a16z#1941 rewrote the K<D commit accumulate on digit windows and added a
streamed-vs-materialized commit test built on akita-internal hooks
(compile_commitment_request, ComputeBackendSetup::prepare_setup,
commit_resolved_inner_host) that db5efa20 keeps crate-private or dropped.
commit_packed now takes the expanded setup directly, and the test's oracle
is the single-digit inner map over Akita's canonical one-hot table.
@github-actions github-actions Bot added spec Tracking issue for a feature spec implementation PR contains implementation of a spec labels Sep 30, 2026
@0xAndoroid
0xAndoroid force-pushed the feat/akita-spongefish-bump branch from 1ac07d1 to 519d2d0 Compare September 30, 2026 16:37
@0xAndoroid
0xAndoroid force-pushed the feat/akita-spongefish-bump branch from 519d2d0 to 9580f22 Compare September 30, 2026 16:51
@RadNi
RadNi marked this pull request as ready for review September 30, 2026 23:23
@RadNi
RadNi changed the base branch from feat/akita-spongefish-bump to main October 1, 2026 14:42

@quangvdao quangvdao left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at df4ad5c3d. I found no soundness, transcript-binding or prover/verifier-disagreement problem, and the chunk layout and canonical-range enforcement look right. Tampering with the verifier setup (swapping the profile, or re-encoding a chunked setup as the legacy variant) is rejected with a family-token mismatch. cargo nextest run -p jolt-akita and the akita_e2e binary in jolt-prover pass.

One functional gap I think should be settled before merge, then smaller items.

1. Four and Eight cannot be set up with an advice group (ran it)

With ProverConfig.one_hot_chunk_profile = Four or Eight, the jolt-prover advice guest fails at preprocessing:

Akita preprocessing: Openings(InvalidSetup("Invalid or missing setup file: Unsupported proof
schedule: no multi-group schedule in the audited fold domain for num_vars=22"))

The same guest passes with Two (advice_e2e_akita_two_chunks), and non-advice guests prove and verify under all three chunked profiles. It is a clean error, not a bad proof.

Calling GroupedScheduleParams::extend_catalog directly over advice arity 11..=22 and every supported final arity:

Profile Advice 14 (fixture default) Advice 15–17 Advice 18 Advice 19–22
Single OK OK OK OK
Two, K16 OK OK OK OK, except final arity 31, 32 with both advice groups at 21–22
Two, K256 fails at final arity 20 fails at final arity 20 OK OK
Four fails at every final arity fails at final 18–21 OK fails at every final arity
Eight fails at every final arity fails at final 19–21 OK fails at every final arity

plan_row (crates/jolt-akita/src/schedule_registry.rs:173-223) only falls back to a full plan_schedule for the single full-width producer shape, so a chunked main row with a precommitted group has no fallback. I did not trace why the Akita planner finds nothing; that only arity 18 works throughout suggests the adapted-schedule search is pinned to a shape, not that the parameters are infeasible.

Either make grouped provisioning work for the chunked profiles, or reject the combination up front in provision_groups_for_config with a message naming the profile and group arity. A grouped test per profile would pin whichever you choose. If #51 in the stack changes this picture, gating here is enough.

2. Range check is not profile-aware (ran it)

schedule_registry.rs:369-381 checks against K16_NUM_VARS/K256_NUM_VARS (min 12) for every profile, while chunked catalogs start at MULTI_CHUNK_MIN_NUM_VARS = 16. K16 with Two at num_vars 12, or Eight at 15, passes the check and then fails later with "setup matrix sizing found no admitted schedules for max_num_vars=N", which does not point at the profile.

3. Single-chunk path: digit expansion now always copies (by reading, unmeasured)

crates/jolt-akita/src/trace_onehot/decomposition.rs:779-787: the old code moved the buffer when num_digits == 1; the new code always allocates and copies. Same file, l.724-736: the Compact fallback calls add_rotated per contribution instead of accumulating locally first. The dense single-chunk hot path is otherwise kept by the dst.len() == 1 fast path.

4. AkitaSetupParams positional encoding changed (by reading)

crates/jolt-akita/src/adapters.rs:348: one_hot_chunk_profile is inserted mid-struct with #[serde(default)], which does not help bincode. Old prover-side params will not decode; same for the six new fields on AkitaScheduleArtifacts (l.52). The Single verifier setup encoding is preserved. Moving the field to the end, or noting the break, would do.

Smaller

  • crates/jolt-akita/src/configs.rs:219,228: W8R2 is built from ChunkedWitnessCfg::d64_production() while W2R2/W4R2 use from_profile. If Akita changes its production alias, W8R2 changes silently and the checked-in catalog stops matching.
  • ProverConfig.one_hot_chunk_profile is read only at preprocessing and is always Single from derive_from_rows; a different value at prove time is silently ignored.
  • specs/akita-multi-chunk-witnesses.md still links #1896 and describes a nine-artifact bundle; its checked box for grouped provisioning is the claim item 1 contradicts.

Test gaps

  • No grouped + chunked test in jolt-akita.
  • No e2e for Four or Eight; the streamed chunked commit path is covered end to end only for Two.
  • No negative test for a verifier setup whose profile disagrees with the catalog (it does reject).
  • No single-chunk benchmark comparison.

Not run on my side: clippy, the feature matrix, benchmarks, catalog regeneration.

@Acentelles Acentelles left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at df4ad5c3d. Requesting changes for the Four/Eight default-advice setup failure. This confirms item 1 in the existing review and adds a root cause: the chunked response exceeds the dense producer's frozen A bound, so expanding Jolt's planner fallback alone cannot fix this case.

The existing advice guest fails preprocessing under both profiles with no multi-group schedule in the audited fold domain for num_vars=22. A direct setup with K16, final arity 22 and GroupedScheduleParams::new(Some(14), Some(14), vec![], 22) reproduces it. Two passes the stock advice test; separate muldiv probes prove and verify under Four and Eight.

At the pinned Akita revision:

For advice arity 14 at K16/final arity 22, the production sizing helpers give:

Profile Smallest required A bound across packing candidates Frozen producer A bound
Two 427,818,804 427,818,804
Four 1,275,068,340 427,818,804
Eight 1,275,068,340 427,818,804

Unrestricted akita_planner::find_schedule also rejects the Four/K16/final-22 case with one advice-14 producer. Advice arity 18 has a different inner decomposition basis and can save a fold digit, explaining its successful cases. This diagnosis is specific to the demonstrated Four/Eight failures; the secondary K256/Two failures need separate tracing.

Please either provision compatible dense producer parameters, or explicitly gate unsupported profile/group shapes with an error naming the profile and advice arity. Preserve the certificate admission check, add grouped setup coverage for each profile, and update the spec's grouped-support claim to match the supported combinations.

The remaining findings are nonblocking:

  • Setup range: schedule_registry.rs:368-382 accepts the single-chunk minimum of 12, whereas chunked catalogs start at 16. K16/Two/12 and K16/Eight/15 reproduce late sizing or missing-row errors. Share the profile-specific range between catalog emission and setup validation.
  • Bincode compatibility: reproduced legacy AkitaSetupParams decoding failure (UnexpectedVariant) and legacy AkitaScheduleArtifacts failure (UnexpectedEnd). Moving the profile field to the end does not restore compatibility: serde(default) does not supply absent positional bincode fields, and the artifact bundle independently changed. Document the break/regeneration path, or provide versioned decoding if persisted recipes are supported. AkitaVerifierSetup compatibility is preserved; scheme.rs::tests::legacy_single_setup_keeps_its_transcript passes its frozen-preamble and bincode checks.
  • Single-chunk cost: the unconditional allocation/copy at trace_onehot/decomposition.rs:779-787 is confirmed by reading. Keep the buffer move when num_chunks == 1 && num_digits == 1. The Compact fallback also loses local accumulation; neither cost was benchmarked.
  • Profile selection: pin W8R2 explicitly with from_profile(MultiChunkProfileId::W8R2) instead of d64_production(). Separately, preprocessing as Single then proving with config Eight still proves and verifies as Single; document the configuration field's setup-only lifecycle or reject the mismatch.
  • Regression coverage: the chunked differential test selects its rotation mode from the environment. Explicitly loop over dense/sparse/compact so all three remain covered at every tested ring dimension. The serial chunked path is already covered. A Single baseline alongside chunked proof-size/prover/verifier measurements would also make the tradeoff assessable.

Validation on this head: cargo fmt --check; both cargo clippy --all --features host -q --all-targets -- -D warnings and the host,zk lane; jolt-akita nextest 87/87; akita_e2e 9/9; FS inventory with fs-audit 1/1; and the trace one-hot suite with each forced rotation mode 16/16 per mode, all pass. A bincode-transported Two verifier setup verifies normally and rejects profile swaps or legacy-variant re-encoding with a family-token mismatch. No soundness or transcript-binding defect was found in the reviewed paths. Benchmarks and full catalog regeneration were not run.

RadNi added 2 commits October 5, 2026 12:47
Certify bounded and full-width dense producers for the maximum eight-chunk response budget and regenerate their catalogs. Remove profile-specific producer replanning so advice commitments can be created once and reused across all supported trace chunk profiles.

Cover producer certificate admission, commitment reuse, and committed-program proofs across Single, Two, Four, and Eight.
@RadNi

RadNi commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Following up on item 3 (single-chunk performance) in the review.

Decision: restore buffer reuse for single-chunk, single-digit expansion; keep direct Compact accumulation.

The expansion currently allocates and copies even when num_chunks == 1 && num_digits == 1. In that case, compressed already has the required layout. The prepared local patch uses vec![compressed] to transfer ownership of the coefficient buffer instead of allocating and copying it. Other chunk/digit combinations retain their existing expansion. Correctness coverage now compares one-digit streamed witnesses with Akita's materialized implementation, including Dense, Sparse, and Compact rotation modes.

For the Compact fallback, we compared direct destination updates with the previous strategy of accumulating into a local [i32; D] and merging it into the destination afterward. The local accumulator was slower in all six isolated cases:

Ring dimension D Contributions per position Direct (ms) Local accumulator (ms) Local overhead
64 3 0.074 0.100 35%
64 16 0.344 0.365 6%
64 64 1.343 1.400 4%
256 3 0.181 0.312 72%
256 16 0.875 1.175 34%
256 64 3.463 4.399 27%

These are standalone microbenchmarks using synthetic inputs and the production Compact rotation routine, compiled with rustc -O -C target-cpu=native. Each case processes 4,096 positions; reported timings are medians from 16 samples, with eight passes per sample and alternating measurement order. Both strategies produced identical outputs. The benchmark excludes trace traversal, runtime dispatch, and the rest of proving: it does not establish a full-proof speedup or rule out a workload-specific regression. It does give us no measured reason to restore the old accumulator, so we are retaining direct accumulation.

The buffer-reuse patch is implemented locally and has not yet been pushed to this PR. Its expanded blockwise_opening_kernels_match_materialized_onehot Nextest test passed, along with workspace Clippy in host and host,zk, formatting, and diff checks.

RadNi added 3 commits October 5, 2026 14:05
Rename the chunk-profile API and reject prove-time profile mismatches. Reuse the single-chunk, single-digit buffer, reject tampered verifier setups in existing round trips, and document cache compatibility, migration, and benchmark findings.

Validation: targeted Akita tests, the Akita e2e suite, Fiat-Shamir inventory, both workspace Clippy modes, formatting, and diff checks passed.
@RadNi

RadNi commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@quangvdao Thanks for the detailed review. The follow-up addresses the functional and validation gaps and documents the remaining single-chunk performance concern.

The PR currently points to 0efa41001. The final diagnostic-classification, W8R2 catalog-test expectation, and documentation corrections are committed locally as 30ad1f502; that commit has not yet been pushed. The descriptions below include those final local corrections.

  1. Grouped provisioning: chunked traces can now fall back to full planning for at most two bounded producers, within the opening-assignment budget. Producer commitment profiles remain fixed, and generated rows undergo the normal schedule audit.

    The earlier exhaustive run checked both K values, all four profiles, every catalog-supported one-polynomial final arity, and independent untrusted/trusted advice choices of absent or physical arity 11–22, excluding the empty advice batch:

    • 39,984 requests checked.
    • 22,671 provisions succeeded.
    • 16,422 requests used producer arities absent from the dense catalog.
    • 891 requests hit the explicit Single-profile capability limitation described below.
    • Zero unexpected provisioning failures.

    This includes the K16 final-arity 31–32 cases with both advice groups at 21–22. Those 24 Two/Four/Eight boundary cases have a permanent regression test.

    Small Single scalar schedules have no recursive child fold, while grouped roots require one; guided adaptation cannot add that fold. Bounded grouped setups at K16 arities 12–15 and K256 arities 12–16 now fail before planner search with K, profile, final arity, and requested groups in the error. This is a documented provisioning limitation, not a claim that all alternative schedules are infeasible.

    The diagnostic now accepts only that specific Single-profile capability rejection as expected. Other schedule rejections count as failures, including all chunked-profile rejections. A regression test pins this classification. I also rechecked the earlier CSV: all 891 grouped rejections match the tightened classification.

  2. Range checks: setup and grouped provisioning validate the selected profile and polynomial count. The companion catalogs were extended to smaller admitted shapes, so the former blanket minimum of 16 no longer applies. Unsupported shapes fail with profile-aware errors.

  3. Single-chunk path: the one-chunk/one-digit expansion reuses its coefficient buffer again. Compact accumulation still uses the contribution-wise path. The spec records a comparison against the pre-chunk kernels, including measurable overhead in small D64 cases: approximately +22.2% Dense/one-digit, +16.7% Dense/three-digit, and +18.2% Compact/one-digit. These are isolated kernel measurements; I am not claiming that the single-chunk performance concern is fully eliminated.

  4. Serialization: the bincode break for AkitaSetupParams and AkitaScheduleArtifacts is explicitly documented. These preprocessing caches must be regenerated; serde defaults do not provide positional-format compatibility. The legacy Single verifier-setup encoding remains unchanged.

The smaller items are addressed too:

  • W8R2 production configurations and catalog test expectations explicitly select from_profile(W8R2).
  • Proving rejects a chunk-profile mismatch with preprocessing before commitments.
  • The spec and artifact documentation reflect the current implementation. The book now qualifies four-file compatibility as requiring the updated dense catalogs; the spec distinguishes unchanged absorption under the label rename from changed dense-catalog binding after regeneration.
  • Coverage includes grouped provisioning, Four/Eight streamed advice proofs, and transported verifier-profile mismatch rejection.

There are additional migration changes: the selector is now AkitaChunkProfile / akita_chunk_profile, and the nondefault profile's transcript label changed. Earlier chunked proofs must be regenerated. Both dense producer catalogs were regenerated for the fixed eight-chunk response budget, independently of the trace profile; deployment directories need the updated dense catalogs.

For the latest narrow follow-up, all four focused Nextest tests, the 24-case boundary diagnostic, formatting, diff checks, and both workspace Clippy modes (host and host,zk) passed. The four focused Nextest tests, formatting, and diff checks were also rerun after the final documentation corrections and passed. I did not rerun the full e2e/feature matrix or the 39,984-request matrix after tightening the diagnostic classification.

The full provisioning matrix is reproducible with:

cargo run --release -p jolt-akita --bin check_grouped_schedules -- \
  crates/jolt-akita/schedules /tmp/jolt-grouped-schedules.csv full

Use boundary instead of full for the 24 cutover cases.

@RadNi

RadNi commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@Acentelles Thanks for tracing the dense producer bound. Your diagnosis is right: expanding the planner fallback alone cannot make an incompatible frozen producer certificate admissible.

The follow-up is now pushed at a007b8efc, including a merge of the current base branch (main at 8e536f199). The changes described as local in the earlier reply are now included in the PR.

  • Dense producer compatibility: 872094992 makes both bounded and full-width dense producer configurations use a fixed, explicit W8R2 response budget and regenerates their catalogs. Advice and committed-program commitments are created independently of the eventual trace profile and can be reused across Single/Two/Four/Eight. Grouped planning preserves their exact commitment profiles and retains the normal certificate admission and schedule audits; it does not relax the frozen-bound check. Permanent coverage checks producer certificates across chunk counts, grouped profile preservation, and reuse of the same trusted-advice commitment across all four trace profiles.
  • Grouped provisioning and ranges: full planning is allowed for chunked traces with at most two bounded producers within the opening-assignment budget. Catalog emission and setup validation share the profile- and polynomial-count-dependent admitted ranges. Small Single scalar guides that cannot acquire the required child fold receive the explicit capability error described in the earlier reply.
  • Serialization and selection: the bincode cache break and regeneration path are documented; the legacy Single verifier-setup serialization layout is preserved. W8R2 selection is explicit, and stage 0 rejects a prove-time profile that disagrees with preprocessing before commitments. The updated dense catalogs are required in deployment directories.
  • Rotation-mode coverage: 29227a151 extends the existing differential test to run Dense, Sparse, and Compact explicitly for each admitted fixture chunk count (1/2/4/8) at every tested ring dimension (64/128/256/512). Each response, including the aggregate chunked response, is compared with Akita's materialized kernel. The production batch-dispatch comparison is retained, and the explicit checks do not mutate environment variables.
  • Single-chunk cost: the one-chunk/one-digit path moves its coefficient buffer again. Compact remains contribution-wise. The spec records the isolated comparison with the pre-chunk kernels, including the remaining small-D64 regressions; this is not a claim that all single-chunk overhead is eliminated. A matched Single/Two/Four/Eight comparison of full-proof size, prover time, and verifier time remains open.

Validation after merging the base:

  • cargo nextest run -p jolt-akita --cargo-quiet: 85 passed, including the 24-case cutover regression.
  • cargo nextest run -p jolt-prover --features akita,prover-fixtures -E 'binary(akita_e2e)' --cargo-quiet: 13 passed, including Four/Eight advice proofs and commitment reuse. Guest builds used a CLI rebuilt from the merged source.
  • cargo nextest run -p jolt-verifier --features fs-audit --test fs_obligations --cargo-quiet: 1 passed.
  • Both workspace Clippy modes (host and host,zk), formatting, and diff checks passed.

The full feature matrix, the 39,984-request provisioning matrix, catalog regeneration, and full-profile performance benchmarks were not rerun after this merge. The earlier provisioning report and its migration details are recorded in the previous reply.

@RadNi
RadNi requested review from Acentelles and quangvdao October 6, 2026 04:29

@Acentelles Acentelles left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-checked at a007b8efc, thanks. Everything from my review is addressed:

  • The default advice-14 producer now fits the unchanged certificate (427,818,804). Required A at K16/final 22 is 79,691,700 for Four and 159,383,476 for Eight. Unrestricted planning and the original advice guest pass under both.
  • Ranges are shared and profile-aware.
  • The bincode break is documented.
  • Stage 0 rejects a profile mismatch.
  • W8R2 is explicit.
  • All rotation modes are covered.
  • Gates on this head: fmt, both clippy lanes, jolt-akita 85, akita_e2e 13, fs-audit 1, check_grouped_schedules … boundary 24/24.

One tradeoff worth stating in the description. Fixing the dense producers at the W8R2 budget also changes the default Single path, because advice and committed-program commitments use the new producer geometry. Same guests, same box (M3 Max, 4 threads), six balanced old/new pairs against df4ad5c3d, Single profile:

Fixture Prove ms old → new Change
no advice (control) 216.1 → 216.5 +1.0% (noise)
advice 285.8 → 307.3 +7.8%
committed program 584.2 → 623.3 +6.4%
advice + committed program 658.6 → 717.1 +8.7%

Trusted-advice commitment is about 20% slower; program commitment about 8% slower. Commitment bytes are unchanged (166) and proof bytes move by at most 225. These are small shapes and a whole-head comparison, so they are indicative only. If cross-profile commitment reuse is worth this, a sentence plus these numbers in the PR description is enough. Otherwise, certifying producers for the 8-chunk envelope without making the standalone dense schedule 8-chunk (or choosing the producer catalog by profile) would keep Single unchanged.

@RadNi

RadNi commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for checking and quantifying this. Using W8R2 for the dense producers across all trace profiles is deliberate: it keeps producer selection independent of the consuming trace profile, simplifies the logic, and conservatively covers the maximum supported chunk count while allowing cross-profile commitment reuse.

We accept the resulting Single performance tradeoff and will document your indicative measurements in the PR description. This choice changes the standalone producer geometry, so we should not claim that Single performance is unchanged.

@RadNi

RadNi commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up on the single-chunk performance concern: the inefficiency in trace z computation is addressed in the optimization PR, stacked on the native trace-batching PR (amir/akita-batch).

The optimization restores batched accumulation and coefficient-buffer reuse within one shared kernel for 1, 2, 4, and 8 chunks, adapted to the native layout where each chunk receives the same cycle range from every polynomial. It introduces no single-chunk special case.

Against the saved pre-codex/akita-multi-chunk-on-1948 kernel measurements, the three previously regressed D64 cases now measure approximately 31.4% faster for Dense/one-digit, 21.2% faster for Dense/three-digit, and 19.1% faster for Compact/one-digit. The sweep covers log2 trace lengths 12–28 and all four chunk counts. At log2 length 28 with D128 and 48 columns, timings across chunk counts differ by 0.9% for K16 and 0.3% for K256.

These are isolated kernel measurements, including the native layout change, rather than end-to-end prover timings. Short traces still incur additional chunk-output and aggregation costs. This addresses the trace z kernel concern; the fixed W8R2 dense-producer geometry tradeoff described above is separate.

@Acentelles Acentelles left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGMT!

@moodlezoup
moodlezoup merged commit 8e19897 into a16z:main Oct 6, 2026
53 checks passed
markosg04 added a commit that referenced this pull request Oct 7, 2026
Ports main's work onto the NARG transcript:

- Spartan and HyperKZG (#1880) run on jolt-transcript: HyperKZG's fold
  commitments, evaluation rows, and KZG witnesses, and Spartan's statement,
  outer evaluations, and witness evaluation, are exchanged through one
  Channel-generic schedule per crate that both roles call. Their tests
  tamper with the decoded argument string; the zero-challenge test needs
  an injectable transcript and is dropped.
- Akita's setup absorb keeps main's one-hot chunk-profile binding (#1976)
  and binds the full setup shape again as typed public messages, before the
  catalog digest.
- The packed trace view implements Akita's evaluate_and_fold_batch (#169).
- Tests main pruned (#1998) are dropped where this branch only ported them,
  and kept where this branch replaced them with argument-string tests.
- The Fiat-Shamir inventory is re-blessed for the new sites.
moodlezoup added a commit that referenced this pull request Oct 8, 2026
Conflict resolutions:
- Akita pin: main pins akita d98400c5 (LayerZero-Labs/akita#175); this
  branch pins the recursion companion 22530c7b (akita main 2607265b plus
  LayerZero-Labs/akita#186-#190). markos/recursion-integration now merges
  d98400c5 into the companion (f2fbf8be; akita-config's schedule-artifact
  test file was the only conflict, both sides' tests kept) and adds
  868045fd, which keeps #175's new optional fold fields in binary
  encodings so the companion's postcard catalog view decodes again. Both
  sides' pins move to 868045fd.
- jolt-akita: main's multi-chunk one-hot families (#1976) and native
  trace batch (#2012) are taken as is; they subsume this branch's
  akita-params import moves. The prepared verifier is ported onto
  OneHotFamily: AkitaOneHotBackendScheme gains from_verifier_view and
  verifier_for_selection, the chunked schedule-artifact variants carry
  PreparedBytes, and AkitaVerifierSetup reads a flavor's catalog from its
  prepared view or its artifact in one place (catalog_source).
- main's legacy_single_setup_keeps_its_transcript pinned bincode
  compatibility of single-profile verifier setups. This branch's
  prepared field and optional payload bytes change that encoding, so the
  test keeps its transcript pin and variant check
  (single_profile_setup_keeps_its_transcript) and drops the byte-equality
  assertions.
- jolt-claims lattice strategy: main's native-batch v8 layout digest,
  hashed with the shared Blake2b256.
- CI: main's job name with this branch's 90-minute timeout.
- Fiat-Shamir inventories re-blessed; fs_obligations keeps this branch's
  absorb-method list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

implementation PR contains implementation of a spec spec Tracking issue for a feature spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants