Skip to content

perf(akita): optimize native chunk decomposition - #2020

Closed
RadNi wants to merge 2 commits into
a16z:mainfrom
LayerZero-Labs:codex/akita-native-chunk-optimization
Closed

RadNi wants to merge 2 commits into
a16z:mainfrom
LayerZero-Labs:codex/akita-native-chunk-optimization

Conversation

@RadNi

@RadNi RadNi commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Optimize native trace decomposition across 1, 2, 4, and 8 chunks while preserving the cycle ranges shared by every polynomial. All chunk counts use the same accumulation kernel. This branch is rebased onto a16z main after the underlying native batching work merged in #2012; it replaces LayerZero-Labs#55.

Changes

  • Give each task a contiguous chunk destination and traverse its canonical block range across all columns, eliminating per-contribution chunk routing.
  • Batch row contributions with bounded i16 accumulation, reuse rotation tables, and schedule only chunk ranges intersecting each table batch. Reuse coefficient buffers for one-digit output and parallelize later digit expansion.
  • Extend materialized witness and fused traversal checks for native chunk geometry, signed coefficient limits, and accumulator flushing, retaining upstream's current test layout.
  • Add a documented lazy-source benchmark example and record comparisons against the saved pre-optimization measurements.

Across 464 configurations covering log2 trace lengths 12–28 and all four chunk counts, all 116 one-chunk timings measured below their saved baselines. The three original D64 regression cases measured 31.4%, 21.2%, and 19.1% faster. At log2 length 28, D128, and 48 columns, the spread across chunk counts was 0.9% for K16 and 0.3% for K256. These are the original isolated kernel measurements from separate runs, not a new benchmark after this rebase; short traces still incur additional witness-output and aggregation costs, and the largest cases use one sample.

Validation after rebase

  • cargo nextest run -p jolt-akita -E 'test(trace_onehot)' --cargo-quiet: all 15 focused kernel/traversal tests passed.
  • cargo clippy --all --features host -q --all-targets -- -D warnings: passed.
  • cargo clippy --all --features host,zk -q --all-targets -- -D warnings: passed.
  • Formatting and git diff --check: passed.

The production optimization patch matches the original commit; the rebase adapts the tests to upstream's current test layout and APIs. Full prover integration suites and performance benchmarks were not rerun after rebasing.

The change preserves native chunk ownership and decomposition outputs. Conservative coefficient bounds flush narrow accumulators before overflow; materialized witness checks cover signed limits, negacyclic wrap, digit expansion, and chunk counts. No protocol relations or proof serialization change.

@github-actions github-actions Bot added spec Tracking issue for a feature spec implementation PR contains implementation of a spec labels Oct 7, 2026
@0xAndoroid 0xAndoroid removed spec Tracking issue for a feature spec implementation PR contains implementation of a spec labels Nov 3, 2026
@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch; rebase needed (set by the AI merge gate) label Nov 6, 2026
@moodlezoup moodlezoup closed this Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict Conflicts with the base branch; rebase needed (set by the AI merge gate)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants