Skip to content

perf(akita)!: batch native trace columns with first-fold cycle locality - #2012

Merged
0xAndoroid merged 30 commits into
mainfrom
amir/akita-batch
Oct 7, 2026
Merged

0xAndoroid merged 30 commits into
mainfrom
amir/akita-batch

Conversation

@sumchecker

Copy link
Copy Markdown
Collaborator

Mirrors LayerZero-Labs#51 (originally opened by @RadNi), retargeted at main now that the Akita e2c49ed bump (#2006) has landed.

Summary

Replace the selector-packed Akita trace polynomial with one native commitment group containing the actual trace columns. Every column has log_T + log_K variables and opens at the same point; the prover and verifier share the canonical group claim. Native batching establishes first-fold cycle locality: each chunk owns the same cycle range across all trace columns.

Later folds still halve one flat recursive witness, so boundary blocks and the tail can cross chunk owners from the second fold onward. Recursive ownership alignment is tracked separately in Akita #175, which is outside this PR's pinned revision. Adopting that change requires a later pin upgrade and regeneration of the affected Jolt multi-chunk catalogs.

Changes

  • Intentionally carry the Akita pin upgrade in this PR, from e2c49ed450f1999a743e7fd4a648f230ce45472f to its immediate successor 83574331d4e51f8cce1d8689d05592fa4ef4c138. The successor merges Akita #169, adding batched opening preparation and source evaluation, including batch-only source kernels; the fused trace opening uses this batch dispatch.

  • Import lightweight column views over one shared trace owner. Fuse commitment, evaluation/folding, decomposition, and coefficient packing across columns while retaining the streaming kernels, rotations, SIMD paths, deferred reductions, and position tiling. Source coefficient materialization remains unavailable.

  • Remove trace selector reduction from stage 8, retain one trace commitment slot and one joint PCS proof, and keep auxiliary object layouts.

  • Carry the native group layout and actual polynomial count through setup and scheduling; retain K=16 production coverage plus explicit fixtures, and restrict native K=256 trace keys to the exact benchmark, cutover, advice, and forced-guest fixtures, and update layout digests and transcript domains. The ten checked-in catalogs contain 1,611 rows (1,548 one-hot and 63 dense), totaling 20,256,534 bytes. The updated base's one- and two-polynomial adapter/planner grids are retained alongside the native trace keys, including smaller multi-chunk arities. The generator and key-membership tests share the admitted keys. Shipped K=256 native trace keys provide fixture and benchmark coverage only; the scalar adapter/planner grid remains available. They do not provide a general production trace range. Other K=256 shapes require a deployment-owned catalog containing the exact shape; grouped setup rejects missing shapes with guidance to use production K=16 or supply that catalog.

  • Preserve the updated base's chunk-profile validation and transcript label, conservative dense producer catalogs, cross-profile advice commitment reuse, and grouped-planner diagnostic.

  • Use the checked-out SDK in both generated-project CI jobs so fork PR merge commits are not fetched from a16z/jolt.

Review follow-ups

  • Accumulate opening folds and coefficient-packing coordinates directly into the final column-owned vectors. Merge commitment partials into the final coefficient buffers and move those buffers into RingVec, removing the intermediate per-column copies while preserving fused trace traversal and tiled accumulation.
  • Resolve all 266 production K=16 keys (widths 51–64, arities 16–34) through the production field-inline provisioner under Single, W2R2, W4R2, and W8R2. Keep the explicit K=256 fixture checks and advice-subset coverage.
  • Extend opening parity to nonconstant Subfield multipliers for K=16/K=256 and D=64/128/256/512, including partial-block geometry and committed digit zero. Verify the original statement before asserting that swapping distinct column evaluations rejects. Existing shared-owner/dimension/column-order rejection remains covered.
  • Replace obsolete trace/protocol “packed” vocabulary in code, test labels, CI labels, and current documentation. Rename the protocol config variant and commitment absorption helpers to Akita; freeze the unchanged binary enum encoding. Retain terminology for actual auxiliary prefix layouts and coefficient packing, and mark historical format investigations explicitly.

Testing

Post-review follow-up validation:

  • 94 field-inline adapter tests across runs, including all 1,064 production width/arity/profile combinations, Base/Subfield source parity, and swapped evaluation rejection. The unchanged scalar grouped-cutover test is excluded here; it passed in merge validation below.
  • 116 ordinary and 113 field-inline Akita prover/verifier tests, including acceptance matrices, backend proof parity, cross-profile advice reuse, tampering, and Fiat-Shamir inventory.
  • Clear muldiv and four ZK completeness/BlindFold fixtures; explicit binary wire-format assertions in both modes.
  • Workspace Clippy with host and host,zk; Akita/field-inline/profiling/prover-fixtures/FS-audit Clippy; formatting and repository style checks.

The exhaustive production-grid tests run real schedule adaptation per key. Local runtimes were 1.5 s for Single, 6.6 minutes for W8R2, 13.2 minutes for W4R2, and 20.7 minutes for W2R2.

Validation after merging base revision 45fc2e03a:

  • 189 Akita/claims tests, including scalar and native-column grouped cutover coverage; 91 field-inline adapter tests. The shared cutover test was run once.
  • 116 ordinary Akita prover/verifier tests and 113 field-inline prover/verifier tests, including both guest matrices, advice and committed-program proofs, cross-profile advice commitment reuse, tampering, and Fiat-Shamir inventory checks.
  • Clear muldiv verifier fixture and four ZK completeness/BlindFold shape fixtures.
  • Workspace Clippy with host and host,zk; Akita/field-inline/prover-fixtures/FS-audit Clippy across adapter, prover, and verifier targets; formatting and repository style checks.
  • Jolt CLI rebuilt from the merged checkout before guest testing.
  • Canonical catalog rendering and validation: 1,611 rows audited, 87 scalar rows replanned for the native cutover, 1,524 unchanged rows reused. The Akita pin upgrade changes no planner, config, params, or schedules source.

Catalog freshness enforcement was run locally: gen_jolt_schedules crates/jolt-akita/schedules k256 --check replanned all 12 rows across the four K=256 catalogs and reproduced every artifact byte for byte. A negative check against a stale temporary dense-full catalog rejected it with stale schedule artifacts, confirming content drift fails the check. A complete ten-catalog --check replan and CI enforcement remain follow-ups.

Performance

Measured 2026-10-06 on an Apple M4 Max, 16 workers, 64 GiB RAM, macOS 26.5.2, Rust 1.95.0. Exact PR base 45fc2e03a versus head f00ec0b5c, including the intentional Akita pin upgrade. Both use ci, akita,profiling, optimized backend, and tracing disabled. Three fresh-process samples per revision/case, alternating base/head, head/base, base/head; tables show medians. All 48 proofs passed both 16-worker and one-worker verification (96 successful calls); guest ELF hashes and raw trace lengths match across revisions.

Workload / profile Prove base → head (s) Change Peak RSS base → head (MiB) Change Peak footprint base → head (MiB)
fibonacci 2^18 / single 1.319 → 0.913 -30.8% 343.4 → 370.9 +8.0% 259.0 → 284.3
fibonacci 2^20 / single 4.635 → 4.638 +0.1% 585.3 → 625.6 +6.9% 513.7 → 556.1
sha2-chain 2^20 / single 4.350 → 4.385 +0.8% 575.7 → 616.6 +7.1% 521.8 → 540.3
sha2-chain 2^22 / single 16.868 → 16.397 -2.8% 1261.2 → 1230.0 -2.5% 936.7 → 1058.5
fibonacci 2^20 / w2r2 4.323 → 4.246 -1.8% 625.7 → 607.3 -2.9% 529.3 → 559.9
fibonacci 2^20 / w4r2 4.491 → 4.561 +1.6% 735.2 → 736.1 +0.1% 636.3 → 637.6
fibonacci 2^20 / w8r2 4.610 → 4.601 -0.2% 994.8 → 799.0 -19.7% 892.9 → 703.2
fibonacci 2^24 / w8r2 65.762 → 71.078 +8.1% 3959.8 → 5696.9 +43.9% 3713.3 → 5684.8
Workload / profile Parallel verify base → head (ms) Single-thread verify base → head (ms) Proof base → head (bytes)
fibonacci 2^18 / single 9.77 → 8.72 15.80 → 13.70 87,672 → 86,042
fibonacci 2^20 / single 11.47 → 10.94 22.31 → 24.52 89,124 → 88,781
sha2-chain 2^20 / single 11.39 → 11.52 21.77 → 26.27 89,527 → 89,173
sha2-chain 2^22 / single 10.83 → 12.26 19.49 → 24.51 93,497 → 93,473
fibonacci 2^20 / w2r2 11.35 → 11.31 25.80 → 26.15 89,158 → 89,120
fibonacci 2^20 / w4r2 11.81 → 11.63 25.62 → 26.28 89,755 → 89,771
fibonacci 2^20 / w8r2 13.15 → 12.87 32.61 → 30.54 91,559 → 91,464
fibonacci 2^24 / w8r2 17.01 → 25.80 47.44 → 82.62 97,657 → 99,173

The level-3 witness growth is real: 2,514,944 → 8,831,232 coefficients (3.51×).
At the measured W8R2/2^24 shape, total proving changes by
+8.1%, peak RSS by +43.9%,
parallel verification by +51.7%, and single-threaded
verification by +74.2%. Its proof changes from
97,657 to 99,173 bytes.
The first recursive input shrinks while subsequent schedules change; the
level-3 ratio alone does not predict whole-proof time or process memory.

The measured W8R2/2^24 packing-versus-batching regression is tracked in Akita #191, related to the planner cost-model investigation in Akita #183. Both measured schedules have six recursive folds; native batching adds a second setup-prefix group and changes per-fold geometry. This is a suspected schedule-cost issue, not a demonstrated cheaper valid native schedule. Per-fold timing/allocation attribution and alternative-schedule benchmarks are needed to establish the cause and fix.

PCS setup is measured separately; it ranges from 20.9–203.1 ms at base and 88.2–2249.7 ms at head. Guest compilation, tracing, witness construction, catalog loading, and other preprocessing are outside the prove timer. RSS/footprint are process lifetime peaks. The host had about 8.94 GiB of swap in use, unchanged between the before/after readings; these are three-sample observations, not confidence intervals. Full ranges, setup timings, witness lengths, reproduction patches, and binary hashes are in the benchmark report, with all 48 individual samples in the CSV. Source snapshots, binaries, and process logs are retained under benchmark-runs/pr51-performance-20261006/.

Security Considerations

The common-point claim assembler checks canonical column order and arity. Batch construction checks shared trace ownership, dimensions, and source order. Native decomposition indexes challenges by column and block and aggregates by witness chunk. Existing verifier and tamper tests cover the changed opening statement; transcript domains and the trace layout digest change with the new geometry.

Breaking Changes

The obsolete Rust/textual config name CommitmentConfig::Packed becomes CommitmentConfig::Akita, and commitment-absorption helper names follow suit. The binary enum ordinal remains unchanged and is pinned by a wire-format test.

Jolt Akita proof and preprocessing compatibility changes. Setup now uses the actual native column arity and count. The trace source API and grouped schedule parameters change accordingly; there is one current trace path without a packing/batching runtime switch.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

📏 PR diff

Note

Actual code changed: 1,456 lines

🟢 +657 added    🔴 −799 removed

Tests, docs, fixtures, and helper scripts excluded.

Category 🟢 Added 🔴 Removed
⌨️ Actual code +657 −799
🧪 Tests +988 −520
📚 Docs +863 −242
📦 Fixtures +18 −17
🔧 Helper scripts +17,211 −3,015
Total diff +19,737 −4,593

Every changed line is classified once.

@github-actions github-actions Bot added spec Tracking issue for a feature spec implementation PR contains implementation of a spec labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark comparison (crates)

Same-runner A/B: base_run = ceef2e5 (merge target) vs pr_run = dd8e4c5 (PR head merged onto it). Bold = faster run; Δ colored when the difference exceeds the ±10% noise threshold.

1 of 66 benchmarks differ by more than ±10%:

Benchmark base_run (merge target) pr_run (this PR) Δ
append_bytes/Keccak/32B 37.4±1.52ns 41.4±4.64ns ${\color{red}\mathbf{+10.6\%}}$
All 66 benchmarks
Benchmark base_run (merge target) pr_run (this PR) Δ
EqPolynomial::evals/17 1.8±0.04ms 1.8±0.02ms -0.2%
EqPolynomial::evals/19 6.8±0.04ms 6.8±0.05ms -0.3%
EqPolynomial::evals/20 14.3±0.10ms 14.4±0.11ms +0.9%
EqPolynomial::evals/22 54.1±0.53ms 54.2±0.39ms +0.1%
EqPolynomial::evaluations/14 484.6±10.96µs 494.7±11.01µs +2.1%
EqPolynomial::evaluations/18 6.3±0.06ms 6.2±0.08ms -1.0%
EqPolynomial::evaluations/20 28.5±0.70ms 29.3±0.33ms +2.8%
Polynomial::bind/14 136.1±4.62µs 137.7±4.22µs +1.2%
Polynomial::bind/18 1.8±0.02ms 1.8±0.03ms -0.3%
Polynomial::bind/20 7.1±0.02ms 7.2±0.08ms +0.4%
Polynomial::evaluate/20 40.4±0.75ms 40.9±0.38ms +1.2%
UnivariatePoly::from_evals/16 43.6±0.76µs 43.6±0.36µs -0.1%
UnivariatePoly::from_evals/3 5.3±0.10µs 5.3±0.19µs +0.2%
UnivariatePoly::from_evals/4 8.0±0.15µs 8.0±0.10µs +0.0%
UnivariatePoly::from_evals/8 19.5±0.19µs 19.6±0.26µs +0.3%
append_bytes/Blake2b/256B 355.5±5.93ns 351.9±7.77ns -1.0%
append_bytes/Blake2b/32B 43.0±2.61ns 42.2±2.46ns -1.9%
append_bytes/Keccak/256B 792.3±6.44ns 806.8±16.40ns +1.8%
append_bytes/Keccak/32B 37.4±1.52ns 41.4±4.64ns ${\color{red}\mathbf{+10.6\%}}$
append_bytes/Poseidon/256B 268.0±4.92µs 266.8±2.51µs -0.5%
append_bytes/Poseidon/32B 85.0±1.42µs 85.1±2.09µs +0.2%
challenge/Blake2b 696.5±4.62ns 696.3±10.65ns +0.0%
challenge/Keccak 377.4±8.49ns 376.7±2.47ns -0.2%
challenge/Poseidon 42.1±0.66µs 41.9±0.83µs -0.4%
field arithmetic/add/fp128_a7f7 4.3±0.08µs 4.4±0.11µs +0.2%
field arithmetic/add/fp32_c99 2.8±0.05µs 2.8±0.05µs +0.2%
field arithmetic/add/fp64_c59 2.9±0.02µs 2.9±0.02µs +0.0%
field arithmetic/mul/fp128_a7f7 14.8±0.10µs 14.8±0.11µs +0.1%
field arithmetic/mul/fp32_c99 5.0±0.05µs 5.0±0.12µs +0.0%
field arithmetic/mul/fp64_c59 7.6±0.03µs 7.6±0.09µs +0.2%
field arithmetic/square/fp128_a7f7 18.1±0.10µs 18.2±0.23µs +0.1%
field arithmetic/square/fp32_c99 5.3±0.03µs 5.3±0.09µs +0.1%
field arithmetic/square/fp64_c59 6.3±0.08µs 6.3±0.03µs -0.1%
field arithmetic/sub/fp128_a7f7 4.0±0.13µs 4.1±0.13µs +0.7%
field arithmetic/sub/fp32_c99 2.4±0.05µs 2.4±0.03µs +0.0%
field arithmetic/sub/fp64_c59 2.5±0.04µs 2.5±0.01µs -0.1%
fp64_prime63_offset259/ext2_packed_mul 19.3±0.12ns 19.3±0.24ns +0.1%
fp64_prime63_offset259/ext2_scalar_mul 8.1±0.11ns 8.1±0.12ns +0.1%
fp64_prime63_offset259/packed_mul 7.8±0.12ns 7.8±0.05ns -0.1%
fp64_prime63_offset259/scalar_mul 1.9±0.03ns 1.9±0.01ns -0.1%
g1_add 382.8±8.03ns 381.3±7.13ns -0.4%
g1_deserialize_bincode 8.0±0.02µs 8.0±0.09µs +0.2%
g1_double 182.7±1.34ns 182.9±1.33ns +0.1%
g1_msm/1024 11.8±0.02ms 11.8±0.02ms +0.0%
g1_msm/16 512.7±8.20µs 511.2±3.45µs -0.3%
g1_msm/256 4.0±0.04ms 4.0±0.01ms -0.2%
g1_msm/4 230.5±5.47µs 230.9±4.64µs +0.2%
g1_msm/64 1.5±0.02ms 1.5±0.02ms +0.2%
g1_scalar_mul 58.2±0.89µs 58.2±0.70µs +0.0%
g1_serialize_bincode 104.2±0.86ns 105.1±0.54ns +0.9%
g2_msm/16 1.8±0.01ms 1.8±0.04ms +0.3%
g2_msm/256 14.8±0.08ms 14.8±0.04ms -0.1%
g2_msm/4 756.4±6.57µs 757.4±9.09µs +0.1%
g2_msm/64 5.4±0.02ms 5.4±0.02ms +0.1%
g2_scalar_mul 310.7±8.29µs 310.3±5.28µs -0.1%
gt_scalar_mul 883.4±14.40µs 884.6±14.47µs +0.1%
multi_pairing/16 5.6±0.02ms 5.6±0.03ms +0.3%
multi_pairing/2 1.2±0.02ms 1.2±0.01ms -0.2%
multi_pairing/4 1.8±0.01ms 1.8±0.03ms +0.1%
multi_pairing/8 3.1±0.01ms 3.1±0.03ms +0.4%
pairing 936.8±11.81µs 933.4±10.11µs -0.4%
pedersen_commit/1024 11.9±0.02ms 12.0±0.09ms +0.4%
pedersen_commit/16 587.3±5.99µs 586.9±4.18µs -0.1%
pedersen_commit/256 4.0±0.01ms 4.0±0.01ms +0.1%
pedersen_commit/4 289.5±6.40µs 289.5±5.41µs +0.0%
pedersen_commit/64 1.5±0.02ms 1.5±0.01ms +0.2%

@sumchecker

Copy link
Copy Markdown
Collaborator Author

Mirrored from LayerZero-Labs#51 — comment by @quangvdao on 2026-10-03 (original). Copied verbatim; commit hashes and file:line references point at that PR's history.


Review at head eca990e4f6d795df946190d0f18ce3d5573b37a0 (base 15e14a21a). The code looks correct to me: removing the selector reduction loses nothing (one leaf per canonical column at one shared point; commitments incl. poly_count and ordered evaluations are absorbed before Akita derives batching challenges; the layout digest is injective and checked on the verifier), and the kernel orderings match Akita at the pinned rev (poly-major challenges i·B + j, shared block weights, source-ordered outputs). Items below, most important first.

1. Moderate: spec and book still describe the deleted design. The PR touches nothing under specs/ or book/.

  • specs/lattice-claims.md:36-38 (calls itself the current claim boundary; one physical polynomial + selector reduction)
  • book/src/how/akita.md:15,23-33 (packing equation and selector sampling)
  • book/src/how/architecture/opening-proof.md:42 ((slot || cycle || address))
  • Also stale: CLAUDE.md ("Akita packs the one-hot trace"), module name stage8/packed.rs, "packed setup's …" error strings in jolt-prover/src/akita/stage0.rs, witness.rs:114,120, doc comments at scheme.rs:61 and adapters.rs:166,475,542.

2. Low: the 64-column limit lost its single owner. OneHotTraceLayout::plan dropped the TooManyOneHotTraceColumns check (strategy.rs#L48-L77), while jolt-prover/src/akita/witness.rs:239-243 does an unchecked 1u64 << column; the typed check is later in trace_onehot/source.rs:99. Not reachable today because catalog admission at preprocessing rejects wider shapes (schedule_registry.rs:402-406), but the shift's safety now depends on a catalog constant in another crate. Suggest restoring the check in plan() with a 64-ok / 65-typed-error test.

3. Low: PR-body numbers and the "drift test". Head has 1,410 catalog rows / 18.9 MB (1,347 one-hot + 63 dense) against 503 rows / 5.9 MB at base; "2,984 → 1,011" and "1,074" describe intermediate commits (the last commit added 336 rows). tests/schedules.rs:425-505 compares key sets only and shares one_hot_keys with the generator, so it cannot detect stale row content or a missing reachable key. The width/arity ranges in schedules/mod.rs are hand-maintained rather than derived from one_hot_trace_columns.

4. Low: K=256 grid. 276 rows / 4.4 MB at head (232 / 2.8 MB at base), but jolt-prover/src/config.rs:221-235 always selects 4-bit chunks under akita. Is explicit K=256 a supported path? If not, these could be reduced to the fixtures.

5. Low: per-column buffer copies. opening.rs:276 (folded.to_vec() per column), traversal.rs:328, commit.rs:303-310. Linear, unmeasured.

6. Test gaps. No permanent streamed N>1 prove/verify round trip with wrong/swapped-evaluation rejection (the grouped streamed fixture has N=1); OpeningFoldPlan::Subfield untested; the chunk loop filters chunks <= num_blocks, so empty-range cases are not exercised.

Notes: the FS inventory scanner does not recognise append_values, so the inventory file alone does not certify point binding (I confirmed it by reading the absorb code). I did not independently verify the ±2% performance claim. When the Akita pin moves past akita#175, the six -multi-chunk/-w2r2/-w4r2 catalogs (1,002 rows) will need regeneration.

@sumchecker

Copy link
Copy Markdown
Collaborator Author

Mirrored from LayerZero-Labs#51 — review by @quangvdao on 2026-10-05 (original). Copied verbatim; commit hashes and file:line references point at that PR's history.


Re-reviewed at efee957d7a. The switch to native column batching looks sound to me and I have no blocking findings. Follow-ups below.

Since my comment at eca990e4f6

  • Addressed: the 64-column limit has a single owner with a test, and the K256 grid is pruned.
  • Mostly addressed: the stale "packed" naming (some strings and specs/akita-optimal-committed-data.md:283-301 remain).
  • Partly addressed: catalog drift. gen_jolt_schedules --check exists, but nothing runs it.
  • Still open: the per-column buffer copies (opening.rs:276, traversal.rs:346, commit.rs:299), and some test gaps (below).

Soundness of the switch (traced)

  • Prover and verifier share the claim assembler (crates/jolt-verifier/src/stages/stage8/akita.rs:379); column order comes from the plan and is bound into the layout digest.
  • Every column needs exactly one leaf claim and the point arity is checked.
  • Commitment, point and all M evaluations are absorbed before Akita's challenges are derived (crates/jolt-akita/src/native_batching.rs:154-199).
  • The ! is a real proof and setup break; I found no stale fixtures, zk+akita is still a compile error, and non-akita builds are untouched.

Findings

  1. Description vs what lands. The description says packing forces cross-chunk transfers from the second fold onward and motivates the PR with that. As I read the code, and as specs/akita-native-trace-batching.md:72-76,179 says, this PR makes the first fold chunk-local; the recursive witness is still one flat polynomial halved again, so the boundary block and the tail still cross owners from the second fold on. That is fine as a step, but the title/description should say so and link the follow-up.

  2. No performance numbers in the PR. I measured on a 16-core M-series machine (ci profile, three alternating runs each, with other builds running, so treat as rough):

    Workload Base prove (s) Head prove (s) Peak RSS
    fibonacci 2^18 1.31–1.37 0.89–0.90 +8%
    fibonacci 2^20 4.53–4.67 4.59–4.97 +8%
    sha2-chain 2^20 4.37–4.43 4.38–4.48 +8%
    sha2-chain 2^22 16.34–16.71 16.14–16.22 −4%

    So prover time holds, with a 7–9% peak-memory rise up to 2^20 that is worth a line. Verifier time, proof size and multi-chunk configurations are unmeasured; the catalog shows a 3.5× larger level-3 witness for the w8r2 row at log_T=24, which I would like to see measured.

  3. Catalog regeneration is not enforced. No CI job or test runs --check, and the remaining test compares keys only. gen_jolt_schedules … k256 --check reproduces all four artifacts byte for byte; I did not finish the K16 and dense catalogs.

  4. Akita pin. Head pins 83574331d4, one commit past chore(akita): bump dependency to e2c49ed LayerZero-Labs/jolt#52's e2c49ed. Is that intended to ride here, or should chore(akita): bump dependency to e2c49ed LayerZero-Labs/jolt#52 carry it?

  5. crates/jolt-akita/src/schedule_registry.rs:193: the full-width rejection lost its only test.

  6. Field-inline provisioning is tested at width 51 only (19 of 266 K16 keys). Not a known failure, a coverage gap.

  7. K=256 traces are now provisionable for fixture shapes only.

  8. trace_onehot/kernels.rs:82: the single-source kernel computes all M columns and discards all but one. Dormant at the current pin.

Test gaps

  • No jolt-akita-level test that a swapped evaluation or a permuted column order is rejected.
  • No test of OpeningFoldPlan::Subfield.
  • No second-fold locality test (relevant once the follow-up lands).

Ran

  • cargo nextest run --cargo-profile ci -p jolt-akita -p jolt-claims: 303 pass.
  • -p jolt-akita --features field-inline: 92 pass.
  • -p jolt-prover --features akita,prover-fixtures: 31 pass, 2 skipped, including the Akita end-to-end prove/verify tests.

Not run: field-inline end to end, the full catalog --check.

@sumchecker

Copy link
Copy Markdown
Collaborator Author

Mirrored from LayerZero-Labs#51 — comment by @RadNi on 2026-10-06 (original). Copied verbatim; commit hashes and file:line references point at that PR's history.


@quangvdao Following up on findings 2 and 3 in your review:

The PR description now includes the full base/head performance comparison, with verifier timings, proof sizes, and Single/W2R2/W4R2/W8R2 measurements. There are three alternating fresh-process samples per side/case; all 48 proofs passed both verification modes. The report and raw samples are checked in.

The W8R2 Fibonacci 2^24 regression is confirmed: proving 65.762 -> 71.078 s (+8.1%), peak RSS 3,959.8 -> 5,696.9 MiB (+43.9%), parallel verification 17.01 -> 25.80 ms (+51.7%), single-threaded verification 47.44 -> 82.62 ms (+74.2%), and proof size 97,657 -> 99,173 bytes (+1.6%). PCS setup is separately timed; memory figures are lifetime process peaks.

Opened Akita #191 and linked it from the description. Both schedules have six recursive folds, but native batching adds a second setup-prefix group and increases the third recursive input by 3.51x. The issue records the exact geometry and measurements and asks for per-fold profiling and valid alternative-schedule comparisons. It is related to #183, but we have not established that the current native schedule can be replaced by a cheaper valid one.

Catalog freshness enforcement was also run locally: gen_jolt_schedules crates/jolt-akita/schedules k256 --check replanned all 12 rows across the four K=256 artifacts and matched them byte for byte. A negative check against a stale temporary dense-full artifact correctly failed with stale schedule artifacts. The description now reports this scope explicitly; a complete ten-catalog replan and CI enforcement remain follow-ups.

@sumchecker
sumchecker requested review from markosg04 and quangvdao and removed request for markosg04 and quangvdao October 6, 2026 23:31

@0xAndoroid 0xAndoroid 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.

Two-model review at d60ffac. Soundness looks right: every column evaluation and the commitment's poly_count are absorbed before Akita draws batching challenges (native_batching.rs:152-199, adapters.rs:984); prover and verifier stage 8 build the trace group claim through the one assembler (stage8/akita.rs:376); the column·B + block challenge index and source-ordered outputs match the pinned Akita (decompose_fold.rs:328); CommitmentConfig::Akita keeps ordinal 1 and the layout digest is prefix-free.

We ran the full ten-catalog gen_jolt_schedules crates/jolt-akita/schedules --check at HEAD: 1,611 rows byte-identical (14.5 min, 88 GB RSS). The body's "all 12 rows across the four K=256 catalogs" predates d97705d (HEAD holds 256 K=256 rows), and nothing in CI runs the check.

Inline: 3 major (default-profile verifier/setup regression untracked, +25 min on the slowest CI job, dead single-source opening kernel), 6 minor.

Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.


## Verification and proof size

| Workload / profile | Parallel verify base → head (ms) | Single-thread verify base → head (ms) | Proof base → head (bytes) |

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.

This table shows the default (Single) profile's single-thread verifier regressing with non-overlapping sample ranges: sha2 2^22 +26% (19.5→24.5 ms), sha2 2^20 +21%, fib 2^20 +10%; PCS setup is 2.5–11× slower in all 8 cases (fib 2^18: 20.9→88.8 ms). The prose and Akita #191 cover only W8R2/2^24. Track the Single-profile verifier/setup regression (own issue or widen #191) or explain it here; perf in the title holds for fib 2^18 single only.

Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added a dedicated section documenting the Single-profile verifier regressions: +10% for Fibonacci 2^20, +21% for SHA2 2^20, and +26% for SHA2 2^22, with non-overlapping sample ranges. Single-profile setup is 2.5–4.2× slower; across all measured cases it is 2.5–11.1× slower. These regressions are documented, not fixed. Setup and recursive geometry changes remain possible causes requiring profiling. The report explicitly states that the measurements do not establish a general speedup. I agree that refactor(akita)! is the more accurate title prefix.

}
}

fn assert_k16_production_coverage(profile: AkitaChunkProfile) {

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.

The W2R2/W4R2/W8R2 sweeps cost 1,947 / 1,378 / 816 s on this PR's job (112543437084); the jolt-akita field-inline step goes 490 s on main (job 112528801193) → 1,988 s, and the job to 58m46s, the longest of the 69 checks. Keep the Single sweep (3 s) plus width 51/64 × arity 16/25/34 per profile in PR CI; put the exhaustive sweeps behind #[ignore = "exhaustive grid: …"] with the command in schedules/README.md, or a scheduled job.

Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR CI now retains the complete Single grid and width 51/64 × arity 16/25/34 for each chunked profile. A nextest filter excludes exactly the three exhaustive chunked sweeps; their manual command is documented in schedules/README.md. The Single sweep and all three boundary tests passed.

}

impl<E, const D: usize> OpeningFoldKernel<TracePackedOneHotView<'_, D>, AkitaField, D>
impl<E, const D: usize> OpeningFoldKernel<TraceOneHotColumnView<'_, D>, AkitaField, D>

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.

Dead path. The pinned Akita (83574331) dispatches only evaluate_and_fold_batch for root sources (akita-cpu-backend/src/opaque/source.rs:56); OpeningProveBackendFor requires only the batch kernels (sources/poly.rs:310-313), and type OpeningView<'a> = () is admitted (sources/dense/tests.rs:366). The only callers of opening_view/this impl are trace_onehot/tests.rs:123,421-428. Make TraceOneHotColumn batch-only: OpeningView = (), delete TraceOneHotColumnView, this impl, opening_fold_column and the column_start/active_columns parameters with their checks in the hot loops (opening.rs:155-265). That also brings tests.rs back under 1,000 lines (921 → 1,028 here).

Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Made the source batch-only with OpeningView = (). Removed TraceOneHotColumnView, the single-column kernel, opening_fold_column, and the column-range parameters and checks. Streamed batch parity against Akita’s materialized one-hot implementation passes. I also moved the trace-read-count helper and its two tests intact into a focused module: trace_onehot/tests.rs is now 875 lines, and all 15 trace kernel tests are retained and pass.

&proof,
&mut verifier_transcript,
)
.expect("original ordered evaluations must verify");

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.

This exercises BatchOpeningScheme::verify_batch over two dense polynomials. Jolt's trace opening goes through AkitaScheme::verify_batch → verify_trace_batch (scheme.rs:732-739, native_batching.rs:345), with the grouped transcript and the streamed one-hot source; prove_trace_batch/verify_trace_batch have no test caller that tampers an M>1 trace group. Add one: commit an M≥2 TraceOneHotColumn group, prove, verify the original, swap two distinct evaluations, assert rejection.

Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added a two-column streamed trace test through AkitaScheme::prove_batch/verify_batch, exercising the grouped trace-opening path. It verifies the original statement and matching prover/verifier transcript state, asserts that the evaluations differ, then swaps them and requires rejection. The test passed.

@@ -0,0 +1,31 @@
--- a/crates/jolt-prover/src/profile.rs

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.

Line-offset hunks against profile.rs with PR51_ eprintln probes, a JOLT_PR51_CHUNKS env switch, and a runner (run_comparison.py) that is not in the repo; they rot with the next edit to profile.rs. Make the chunk-profile selection a profile --akita-chunk-profile flag, drop both patches and the CSV, and keep the tables in the PR body / Akita #191.

Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added and documented profile --akita-chunk-profile with single, w2r2, w4r2, and w8r2. Removed both benchmark-specific patches and the sample CSV, retaining historical provenance links.

Chunked runs now carry their profile suffix in artifact directories, latest links, CSV benchmark names, and summary workload names. The summary script supports explicit profile selection, and the plot reader keeps the CSV series separate. Real Fibonacci 2^16 Single and W4R2 proofs passed parallel and single-threaded verification; their emitted identities and summary selection were also checked.

Comment thread crates/jolt-prover/src/akita/mod.rs Outdated
/// The Akita path's stand-in for the streaming witness-commit slot: stage 0
/// commits the native `OneHotTrace` group directly, so this slot is never
/// reached.
struct PackedCommitStub;

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.

PackedCommitStub survives the rename the body says is complete; AkitaCommitStub.

Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Renamed it to AkitaCommitStub and updated all references.

@@ -1,4 +1,4 @@
//! Packed (Akita) field-inline parity and tamper tests over fp128.
//! Akita (Akita) field-inline parity and tamper tests over fp128.

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.

"Akita (Akita)" — rename garble; same at jolt-verifier/tests/soundness/tampering/akita.rs:92 ("Akita akita fixtures").

Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Corrected both “Akita (Akita)” and “Akita akita fixtures.”

Comment thread crates/jolt-prover/src/akita/stage0.rs Outdated
if preprocessing.pcs_setup.max_num_vars() != plan.packing().packed_num_vars()
|| preprocessing.pcs_setup.max_num_polys_per_commitment_group() != 1
let required_batch_polys = auxiliary_groups.len() + plan.ids().len();
// The setup is shape-exact for the canonical OneHotTrace group.

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.

Narrates the two checks below it; delete.

Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deleted the comment.

Comment thread specs/akita-optimal-committed-data.md Outdated
protocol is specified in [Akita Native Trace Batching](akita-native-trace-batching.md).
`OneHotTrace` is one native commitment group containing the actual trace columns,
with each polynomial in `(cycle || address)` order. There are no selector slots
or selector challenge for the trace. Logical address row zero is public and

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.

Wrong for RAM: digit zero is committed on cycles with a remappable RAM access (jolt-prover/src/akita/witness.rs:189 ram_digit_zero_mask, trace_onehot/traversal.rs:13 committed_zero_mask); lattice-claims.md:131 states it correctly. Restrict the omission/recentering sentence to instruction, bytecode, digit and carry columns.

Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Restricted digit-zero omission and Stage-7 recentering to instruction, bytecode, digit, and carry columns. The spec now explicitly states that RAM columns retain digit zero on cycles with a remappable RAM access, matching the witness and streamed kernel behavior.

@0xAndoroid 0xAndoroid 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 58b9bce: the earlier threads look addressed. Three new issues:

  1. evaluate_and_fold_batch and opening.rs (278 lines) never run in production. All 1,548 one-hot catalog roots use SubringCoefficientPacking (Akita owned.rs:183), so the fold path is reached only from unit tests. A panic there fails 2 unit tests and nothing else. Either route a real root through it or delete it. The reply on the dead-kernel thread cited the dispatch for the wrong path.
  2. Tests nothing runs: profile/tests.rs, since no CI job runs profiling, and scripts/tests/test_benchmark_profiles.py, which no workflow invokes. Wire them into CI or delete them.
  3. Narration comments: zkvm_profiling.md:109-111 and the perf spec line 160 restate the code. Delete them.

Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself.

@sumchecker

Copy link
Copy Markdown
Collaborator Author

@0xAndoroid Addressed all three points from your latest review:

  1. Unused opening fold: e62631e53 deletes trace_onehot/opening.rs and its test-only coverage. The trait-required evaluate_and_fold_batch method now returns UnsupportedSchedule; trace one-hot sources use subring coefficient packing. You're right that the earlier reply cited the wrong dispatch path.
  2. CI coverage: f13ac87c9 runs the Rust profiling identity test in the existing Akita job with cargo nextest run --cargo-profile ci -p jolt-prover --features akita,profiling --lib -E 'test(profile::tests)' --cargo-quiet, and the Python benchmark tests in the style job with python3 -m unittest scripts.tests.test_benchmark_profiles -v. Both commands passed locally (one Rust test and two Python tests). The Rust command selects library tests, so it does not run the memory-heavy profiling smoke test.
  3. Documentation: e62631e removes the identified passages from zkvm_profiling.md and the performance spec.

@0xAndoroid
0xAndoroid merged commit 9ecf871 into main Oct 7, 2026
69 checks passed
moodlezoup added a commit to 0xAndoroid/jolt that referenced this pull request Oct 7, 2026
Resolve the akita/mod.rs doc conflict with a16z#2012: keep main's "Akita"
wording and this branch's removal of the stale no-`akita`-feature
rationale (jolt-kernels now has an `akita` feature).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@0xAndoroid
0xAndoroid deleted the amir/akita-batch branch October 7, 2026 21:37
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>
moodlezoup added a commit that referenced this pull request Oct 8, 2026
A fresh Fibonacci proof at this revision accepts at 78,896,208 rows
(76,805,832 verification cycles), 11,787,344 over 2^26. Input mode
accepts at 86,254,204 rows and the tampered opening proof is rejected
after 60,145,138. The increase over 67,622,320 is in the Akita
trace-batch opening's root fold under main's native trace batching
(#2012); the guest still verifies through its prepared payloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
markosg04 added a commit that referenced this pull request Oct 19, 2026
Ports main onto the argument-string transcript: the native Akita trace
batching (#2012), backends bound to execution contexts (#2028), unified
trace rows (#1996), whole-bytecode commitments (bytecode chunking
removal), the binary fields and their sum-check (#2034 and the binary
backend), and the clear proof-type cleanup, which this branch already
subsumes. Binary fields gain the spongefish codecs every transcript atom
carries, and main's new tests are rewritten for argument strings.

Akita's runtime witness-chunking policy (LayerZero-Labs/akita#246, now
in akita#185) moves chunking out of the commitment config, so each Jolt
catalog family fixes its own through `CatalogChunking`, and the schedule
generator preplans the direct rows below the setup-offloading cutover.
Acentelles added a commit that referenced this pull request Nov 2, 2026
* feat(field,inlines): field-inline guest kernels and hash/NTT inlines

Fp128 and Fr dot, weighted-row dot, and multiply kernels over the
field-inline ISA for RISC-V guests, with canonical readout checks. A
digest adapter over the Blake2b inline, used by the transcripts and the
shared Blake2b-256 hasher. A 64-point i32 NTT and six-product pointwise
dot inline expanded into existing proved instructions.

The tracer fixes the unit's modulus, so a guest selects the one field that
routes through it: field-inline-guest-bn254 (Fr) or
field-inline-guest-fp128 (Prime128OffsetA7F7). Every other field keeps
the software path.

* feat(sdk,platform): guest runtime for verifier-as-guest workloads

Size-class allocator for std guests, word-wise memset/memcmp and an
asm-load memcpy, write(2) and clock_gettime(2) trap shims, and an
execute-with-output host entry point.

* perf(claims,verifier): shape verifier algebra for guest costs

Derived leaves for batching powers, direct output-claim value walks,
indexed claim lookups, the factored Spartan outer clear check, and
column-dot bytecode folds. The preprocessing digest hashes through the
shared Blake2b-256 hasher, and the wire form is public for verifiers
whose trust root fixes the digest.

* feat(akita): prepared verifier for recursion guests

AkitaVerifierSetup::prepare_verifier carries the expanded key, a
selected-row catalog view, and the terminal NTT cache for the row a
proof selected; detach/attach moves the payloads out of the record so a
guest views them in place. Byte payloads serialize through serde_bytes.
The backend pool is behind a default parallel feature.

* feat(recursion): Akita verifier guest with embedded setup

The recursion example verifies an Akita field-inline proof as a guest.
Embedded mode bakes the setup, compiled bytecode rows, and the
preprocessing digest into the image. trace --expect checks the verdict;
CI requires acceptance and rejection of a tampered opening. Adds the
design note.

* perf(claims,poly,transcript): cheaper verifier bookkeeping for the guest

- Bytecode read-RAF stage values fold against the address eq table by
  decoded flag class: rows sharing a flag set share one gamma bucket, and
  register operands accumulate into per-register buckets. The flag-to-gamma
  mapping has one owner, read_raf_flag_terms; the flag-class table uses
  word-sized slots.
- The stage-1 outer remainder reads its produced openings off its Az and Bz
  factors instead of expanding tau*Az*Bz; every expanded term is a distinct
  unit-coefficient monomial, and a test pins the result to the expansion.
- Contiguous sparse MLE runs read their low eq factor from one table.
- The digest transcript updates one hasher in place instead of threading it
  through chain_update; transcript bytes are unchanged.

* perf(field,inlines,akita): guest kernels, inline tuning, and the companion pin

- jolt-field: shared-operand dot_rows, four-factor sum_of_products4, and
  register-resident signed sums (Field::signed_sum) on the field-inline guest.
- jolt-inlines-ntt: butterfly sums reduce by a Montgomery product with the
  stage's first twiddle (the Montgomery form of 1), 5 rows instead of a 7-row
  conditional reduction; the registered expansion fixture is regenerated.
- jolt-inlines-blake2: Blake2b::update_block_eager compresses a full
  non-final block now, so a hasher sharing a constant first block can be
  prepared once.
- Recursion guest: the Keccak inline backs Akita's SHAKE sampling
  (hash-inlines feature).
- Akita companion pinned at markosg04/akita@6faec6c78: an inline Blake2b
  transcript sponge byte-identical to spongefish's Blake2b512 (checked by
  jolt-akita against spongefish), word-window Golomb-Rice decoding,
  coefficient-major terminal folds, doubleword NTT input stores, inline
  proof-atom encoding, and batched compression-column evaluation.

* perf(transcript)!: absorb opening claims and round coefficients as one message

Sumcheck round coefficients and each batch of opening claims now absorb as
one labeled message carrying the count and the big-endian values, instead
of one message per scalar. This changes the transcript, and so the proof
bytes, for every proof.

Prover, verifier, and BlindFold absorb through the shared
append_round_coefficients and append_opening_claims helpers in
jolt-sumcheck, whose transcript-facing bounds move from AppendToTranscript
to CanonicalBytes. The Fiat-Shamir absorb- and challenge-site inventories
are re-blessed, the checked-in jolt-verifier fuzz proof bundles are
regenerated by their documented ignored tests, and the sumcheck
compressed-round differential reference frames rounds through the shared
helper. The standalone sumcheck consumer's field implements CanonicalBytes.

jolt-blindfold's pairwise and lag-one correlation checks used a fixed 0.25
bound, under 3 sigma at 128 samples, which also fails for
transcript-independent projections at other seeds; they now use 4 sigma,
4/sqrt(n) over n samples.

* docs(recursion): record the guest-cost mechanisms and the 2^26 ladder

* build(akita): pin canonical LayerZero-Labs/akita

The Akita companion moves from the personal markosg04/akita fork to
LayerZero-Labs/akita branch markos/recursion-integration: akita main
2607265b2 plus the recursion verifier-guest PRs
(LayerZero-Labs/akita#186-#190). Repin to akita main once those merge.

Akita main moved schedule, geometry, and dispatch types into a new
akita-params crate and renamed AkitaScheduleLookupKey to
ScheduleLookupKey; jolt-akita imports them from there. The trace-packed
one-hot source implements the new
OpeningBatchKernel::evaluate_and_fold_batch by folding each source.

Akita main's guided planner now admits the four-group and
two-full-width batches the schedules test expected it to reject. Neither
shape reaches the full-planner fallback, which still admits only one
full-width increment plus at most two advice groups, so the test now
asserts that they plan through guided planning.

The guest accepts at 66,175,726 rows (was 66,116,859 on the fork); the
ported companion validates the setup descriptor and prefix registry and
decodes the catalog view with postcard.

* fix(recursion): close review findings on trust boundaries and guest paths

Adversarial review of the recursion guest PR:

- Prepared Akita payloads: the backend key and terminal cache are used
  unchecked, so an inline copy decoded from a setup record is refused
  there; only payloads this process prepared or a guest attached serve.
  Attached bodies are akita TrustedBytes tokens, so the one unchecked
  assumption (canonical key words) is made where the token is built, in
  the guest or host, and jolt-akita stays free of unsafe code.
  detach_prepared_payloads checks every payload before moving any. The
  host verifies proofs through the same detach-and-attach path the guest
  takes, and an integration test pins it.
- Field-inline selectors are exclusive on riscv64 (a compile error
  otherwise); the unit's modulus contract and the reserved FR registers
  are documented. Row kernels (dot_base_rows, weighted_dot_base_rows)
  require matching row shapes on every path, as the guest kernels do.
- Blake2b: jolt-transcript and jolt-claims use the inline hasher only on
  riscv64, so a host build with blake2-inline no longer panics.
- The clear Spartan outer check accepts only shapes with affine terms,
  the shapes its factored form matches.
- tamper-opening flips a bit inside the Akita opening proof, so CI's
  reject case runs through the PCS verifier (rejected after ~47.8M rows
  rather than at stage 1).
- Guest runtime: zero-length write shim guarded; allocator and heap-split
  comments corrected; assume_static is an unsafe fn.
- Docs: flag-class soundness guard, opening-claim message boundaries,
  non-additive jolt-sdk akita feature, spec measurements at this revision.
- Akita pin: LayerZero-Labs/akita markos/recursion-integration, main plus
  the reviewed LayerZero-Labs/akita#186-#190.

* chore(verifier): drop the redundant bn254 feature on jolt-crypto

jolt-verifier's library code uses only jolt-crypto's ungated commitment
traits. The BN254 types appear only in its unit tests, and jolt-blindfold,
a non-optional dependency, enables jolt-crypto/bn254 itself, so the
explicit feature changed nothing in the resolved build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sdk): share one size-class arena between Rust and musl in std guests

Under guest-size-class-alloc, std guests split the heap at boot: ZeroOS's
kernel heap kept a fixed heap_size/8 and the Rust arena the rest. The kernel
heap backs every musl mmap (malloc arenas, pthread stacks, C allocations), so
a guest that mapped more than an eighth of its heap failed with ENOMEM even
when the Rust side had room.

std guests on the size-class allocator now register it as ZeroOS's kernel
heap, as no_std guests already do, and kinit hands it the whole heap. The
Rust global allocator draws from the same arena. The allocator's SAFETY
comment now states why calls cannot overlap with threads enabled.

A guest runtime test maps a 3 MiB malloc and a 3 MiB pthread stack beside a
4 MiB Rust allocation on a 16 MiB heap; it failed on the split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(field): rename fr_inline to field_inline

The guest kernels serve whichever field the field-inline unit computes
in (Fr or Fp128), so the module and its comments use the field-inline
terminology: field_inline.rs, "field registers", and the field-inline
instruction profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(claims): list read-RAF and digit-zero output openings directly

The default expected_output_openings expands output_expression only to
collect its opening ids, and the clear verifier's output-shape check
calls it before verification builds the expression again. Read-RAF and
the digit-zero claim reduction have large expansions. Both outputs are
sums of distinct monomials, so their openings are listed directly; a
test pins each list to the expanded expression, as for the stage-1
outer remainder. The recursion guest drops 813,367 rows on the
Fibonacci proof (66,254,853 to 65,441,486).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(platform,sdk): drop the fast-mem guest routines

Remove jolt-platform's word-wise memcpy, memset, and memcmp overrides
(the fast-mem feature) and jolt-sdk's guest-fast-mem, so guests use
musl's routines. Owning libc replacements is not worth it here; the
sub-word access cost they dodge belongs in the ISA (Tiers 1 and 2 of
specs/byte-addressable-memory.md, #2013).

The recursion guest's Fibonacci trace grows from 65,441,486 to
69,059,130 rows, 1,950,266 over 2^26. The following commits recover
part of that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(inlines): pack Blake2b input into message words

The Blake2b SDK staged input through a 128-byte byte buffer. On a guest,
each update's variable-length copy and each finalize's padding fill
lowered to libc memcpy/memset calls, and every hasher clone copied the
whole 216-byte struct. The Jolt digest transcript and Akita's transcript
sponge both hash through this type.

The buffer is now 16 little-endian message words whose bytes past the
buffered length stay zero. Input is ORed in word by word (one aligned
load per word when the source is aligned), finalize needs no padding
pass, and Clone copies only the buffered words. Volatile word accesses
keep LLVM from lowering these loops back into libc calls. Output bytes
are unchanged; a new test checks every source alignment and split point
against the blake2 crate.

On its own, this saves the recursion guest 232,593 rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(platform): copy whole words when size-class realloc moves a block

Both blocks are class-aligned and span whole words, so realloc copies
8-byte words instead of calling memcpy, which a std guest's libc
performs partly in sub-word loads and stores. On its own, this saves
the recursion guest 61,164 rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(cli): inline constant-size guest copies and fills up to 32 stores

LLVM's RISC-V defaults lower constant-size memcpy/memset above a few
stores to libc calls. In a guest those calls move data partly in
sub-word loads and stores, each a multi-row sequence, so guest builds
now raise the inline limits to 32 stores (-max-store-memcpy,
-max-store-memset). On its own, this saves the recursion guest 948,480
rows; btreemap, alloc, collatz, the stdlib and large-alloc guests each
drop slightly. 64 and 128 measured worse on the recursion guest than 32.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(spec): record recursion-guest rows without fast-mem

The guest now accepts the Fibonacci inner proof at 67,622,320 rows,
513,456 over 2^26. Record the post-rebase rows, mark the target as
unmet, and list cheaper sub-word memory as the lever.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(inlines): keep the Blake2b word-packing helper out of the absorb inventory

The Fiat-Shamir inventory scanner treats any call named `absorb*` as a
transcript absorb site, so the Blake2b hasher's input-packing helper,
named `absorb` by db157e7, left fs_obligations failing on an
unlisted site. It packs hash input into message words and touches no
transcript; rename it `or_into_words` and drop its inventory entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(spec): record recursion-guest rows after merging main

A fresh Fibonacci proof at this revision accepts at 78,896,208 rows
(76,805,832 verification cycles), 11,787,344 over 2^26. Input mode
accepts at 86,254,204 rows and the tampered opening proof is rejected
after 60,145,138. The increase over 67,622,320 is in the Akita
trace-batch opening's root fold under main's native trace batching
(#2012); the guest still verifies through its prepared payloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sdk): name jolt-sdk's akita feature when it breaks a provable host build

jolt-sdk's `akita` feature compiles out the Dory host helpers, because
jolt-prover's `akita` compiles out `jolt_prover::dory`. `#[jolt::provable]`
still expanded calls to them, so any host build that unified the feature
with a provable crate (`--all-features`, or the recursion example's
`akita` alongside another example) failed with unresolved paths into the
missing Dory API: six errors for the fibonacci guest alone.

The macro now wraps its Dory prove and verify functions in
`jolt::__dory_host_items!`. jolt-sdk passes them through, except with
both `host` and `akita` enabled, where it replaces them with a single
compile error that names the feature and points at
`jolt::jolt_prover::akita`. Guest builds and tracing helpers are
unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(field): generalize sum_of_products4 to sum_of_products<K>

Field::sum_of_products::<K> computes Σ_i Π_k terms[i][k] for any arity
(an empty product is one). On a field-inline guest the kernel loads each
term's K factors into the register file with K - 1 multiplies and reads
the sum out once, as the four-factor kernel did. Akita's compression
evaluation, its one caller, compiles to the same per-term sequence: the
recursion guest accepts at 78,895,414 rows (was 78,896,208).

sum_of_products4 forwards to it until the Akita companion calls
sum_of_products; the repin that follows removes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* build(akita): repin the companion and drop sum_of_products4

markos/recursion-integration now calls Field::sum_of_products directly
(LayerZero-Labs/akita 38d8deb6, which also pins Jolt at e19eda7), so the
four-factor forwarder has no caller left. The recursion guest accepts at
78,895,975 rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(riscv): make flag_class name every row field

The verifier's folded read-RAF evaluation reads each flag class's flags
from one row, so a row field that a flag reads but flag_class omits
breaks soundness, and the class test would not vary a new field.
flag_class now destructures the row without `..`: adding a field to
JoltInstructionRow fails to compile there until it is keyed or
explicitly excluded. Flags starting to read the already excluded
address or operands remain guarded only by
flag_class_determines_read_raf_flag_terms. Guest rows are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sdk): emit trapped stdout writes in one host call

The trap handler answered write(2) to fds 1 and 2 by calling putchar per
byte, one host print per byte. The tracer decodes each print as UTF-8, so
every non-ASCII character reached the host as replacement characters:
a std guest's `println!("σ→²")` printed seven U+FFFD. The shim
intercepts these writes before ZeroOS's console, so it bypassed #1960's
single-call fix for every std guest.

It now calls __platform_stdout_write, the console's single-call path,
which also covers a null or empty buffer. The comment notes that fds 1
and 2 reach the host even if the guest redirected them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(guests): document what std::time returns in a guest

std guests' clock_gettime is answered by the runtime with a zero
timestamp for every clock, so Instant::now and SystemTime::now succeed
but never advance. The guest page now says so under Standard Library,
the security model's no-clock rule links to it, and the recursion spec
states what its trap shims return.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(verifier): repin the ZK muldiv BlindFold shape at trace length 512

The jolt CLI's inline-store limits (83b9472) compile the muldiv guest
to fewer instructions, so it now runs in under 512 cycles and its padded
trace length halves. The golden-shape audit pinned 1024, which failed
CI's ZK job on every push since the branch could run CI again (from
179e7a6). With the CLI built without those two flags the old pins
pass, so the change is the fixture, not the protocol. At 512 the
BlindFold shape has 221 coefficient rows (was 227: one fewer committed
round in each of six cycle sumchecks); the other counts are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(field): bind the field-inline unit's modulus at guest boot

jolt-field's guest kernels range-check readouts against the selected
field's modulus, which assumes the tracer's field-inline unit computes in
that field. Nothing checked it: a BN254-selected guest traced under the
fp128 unit computed 3*5 in Fr as a wrong value that still read out
canonically, and returned it without error.

jolt_field::bind_field_inline_modulus accumulates the selected field's
modulus into a cleared field register and asserts zero, proving that the
unit's prime divides it and so equals it. jolt-sdk's std runtime calls it
once from __platform_bootstrap, before main; it is a no-op without a
selector. The same probe guest now fails at trace time
("FIELD_ASSERT_ZERO of nonzero field register 4"), and under the matching
unit it returns the right product.

Binding at boot keeps readouts free. Checking a static flag on every
readout cost the recursion guest 2.33M rows; this path costs nothing
measurable (78,892,856 rows, was 78,895,975). jolt-field has no no_std
build, so its kernels only run in std guests, and jolt-sdk takes jolt-field
under guest-std only, without its default BN254 field.
Fr::MODULUS_LIMBS and Fp128::MODULUS_LIMBS match #1995's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(field,poly): keep signed_sum's accumulator safe from its iterator

- field_inline::signed_sum holds its partial sum in REG_ACC while it pulls
  terms, so an iterator that called dot (or any accumulating kernel)
  overwrote the sum. The accumulators are now marked lent until the
  readout; Fp128 dispatch then takes the software path for dot, dot_rows,
  weighted dot rows, sum_of_products, and a nested signed_sum. The guard
  costs about 9,000 rows on the recursion guest.
- sparse_mle_msb advanced its index past the final block, which overflowed
  for a run ending at index u128::MAX; it now returns after the last block.

* build(akita): repin to the reviewed LayerZero-Labs/akita#186-#190

The companion moves to recursion-integration 78d31e124: Akita main
401e7972 plus the review revisions of #186-#190.

- jolt-akita's config presets follow main's RingDimensionSchedule (#192).
- Akita's guest transcript is now spongefish's own Blake2b sponge over the
  inline digest adapter, so the jolt-akita test pinning the hand-written
  sponge and Blake2b::update_block_eager, which only that sponge used, are
  removed.
- specs/recursion-guest.md records a fresh proof at 79,348,402 rows.

* docs(recursion): record rows after merging main and the Akita review fixes

* docs(recursion): record rows after merging main

* fix(recursion): follow main's sumcheck transcript and Akita prove APIs

* docs(recursion): record rows after merging main

* test(sumcheck): drop the external consumer's unused opening-claim imports

* ci(recursion): run the Akita guest verdicts as their own job

* docs(recursion): re-measure rows with an isolated guest build

* Fix transcript feature selection after main merge

* Adapt recursion code to main API renames

* Reject malformed recursion records without panicking

Use checked framing, bounded record decoding, and fallible proof and device reads. Return verdict zero for input errors while retaining distinct failures for corrupt embedded preprocessing. Exercise the guest parser on the host with truncations, excessive lengths, invalid padding, noncanonical fields, and malformed devices.

(cherry picked from commit 3e308a58ac0861db2041222a5266dfc733111261)

* Authenticate input setup against an image-fixed digest

Bake the complete framed setup digest into input-mode guests and check it before setup decoding or trusted payload attachment. Cover the setup record and every detached key, catalog, and terminal-cache body; reject absent pins and substitutions. Keep embedded setup bound directly by the image.

(cherry picked from commit 4bb679f41f8f8393dd546d41861a94639fe14534)

* Require nonempty recursion batches and complete input consumption

Reject zero proofs and trailing bytes after the final device record. Document the exact statement established by the unchanged one-word verdict and the need for consumers to bind the intended count and devices through the runtime input.

(cherry picked from commit 0e3816c2e297a0443865125b9714d1035b66b658)

* Size recursion input regions from the runtime proof section

Use one checked input capacity for the generated guest macro and tracer configuration, including alignment and serialization overhead. Cover embedded muldiv in both commitment builds and check framing across length-prefix boundaries for every example.

(cherry picked from commit f5b9684e907607d671dd327ba923a0496ae4ca41)

* Document and pin the current Akita setup encoding

State the incompatible optional-payload and prepared-verifier encoding and the required regeneration of stored preprocessing. Restore a frozen decode fixture covering absent and present prepared state, detached bodies, and decoded payload provenance. No independent setup-format version exists to bump.

(cherry picked from commit 85a44076c6ba8e0f5f87a69ffe2545b60b54a41d)

* Exercise recursion rejection boundaries and field kernel tails

Add typed sumcheck, opening-claim, device-output, panic-bit, and empty-batch fixtures, plus input-mode and two-proof acceptance in CI. Compare compiled field arithmetic with native software folds across all row and element tails, including nested accumulator use and boundary operands. Run the checks through the existing guest build and tracer path for both field selectors.

(cherry picked from commit 105e9e841b0891ef7b023efccf01193687848cf1)

* Describe the Akita opening-body tamper accurately

Identify the PCS proof body as the mutation target and state that the command requires an Akita build. Keep the separate Stage1 claim mutation documented under the typed tamper command.

(cherry picked from commit fe2121ac8503ffe9e5705e51884c0aaa84941bf4)

* Assert matching field dot-product lengths in debug builds

Check the equal-length contract in the default Field method and the Fp128 override so neither dispatch silently hides a shape mismatch during development.

(cherry picked from commit ff6877f7080c2782bae6a21a969c5dbd9a3cc969)

* Reject conflicting field accumulator loans in release builds

Keep the signed-sum accumulator availability check in optimized guests so an unexpected nested kernel entry fails closed instead of overwriting a live sum.

(cherry picked from commit aee7062319b221015a46106f74a15925431f29a1)

* Define the setup pin in fresh guest builds

* Preserve the lattice test round geometry

* Reject malformed recursion input lengths

(cherry picked from commit e352ad8585b2a7c4bd31aa34ab1b557f398ba6fa)

* Reject nonzero recursion transport padding

(cherry picked from commit 94224503199ecd9f0a3b4304944a546ada357614)

* Select the field instruction profile for Dory inner proofs

(cherry picked from commit 1d37c54a55ae3dbcd90b9d5ce6f73d1bffa5324f)

* Acquire lent field accumulators atomically

(cherry picked from commit 2acd6a2ec404327203958334266f750c67eab708)

* Cover mixed proof batches and Dory tamper rejection

(cherry picked from commit 517df4adb9024d30157825680ff1aefdf7b95863)

* Derive recursion record limits when building the image

(cherry picked from commit a2a5fb2a0e3f75e06bbbd110fc4575f9a6f0c541)

* Fix merged Blake2 finalization and field instruction dispatch

* Revert "Assert matching field dot-product lengths in debug builds"

This reverts commit 4baee14.

* Pin Akita to main

LayerZero-Labs/akita#279 is merged; Akita main 1160b0a8 has the same tree as the previously pinned #279 head.

* Regenerate verifier fuzz fixtures and lock for the Akita pin

The six verifier fuzz bundles are regenerated from the merged protocol and pass decode and verification in clear and ZK builds. Cargo.lock resolves the Akita main pin.

* Apply recorded formatting fixes

* Fix imports and lint findings after main merge

---------

Co-authored-by: Michael Zhu <mchl.zhu.96@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: acentelles <centelles.alberto@gmail.com>
Acentelles added a commit that referenced this pull request Nov 4, 2026
… at inner 2^12 (22.5% below main, 15.6% below #1911) (#2143)

* perf(blake2): reuse packed Spongefish prefix compressions

* perf(recursion): forward Akita's factored compression-weight feature

l3-compression-weights on jolt-akita, the recursion host and the recursion
guest selects Akita's factored evaluation of the compression relation
weights (same field values). Feature-off guests compile byte for byte as
before: only Cargo feature tables and host-only code change.

* perf(recursion): turn factored compression weights on by default

The recursion example enables l3-compression-weights by default. The feature
forwards weakly (jolt-akita?/l3-compression-weights) and the host adds the
guest feature only together with akita, so Dory builds are unchanged.
--no-default-features turns it off. Host-side Cargo and cfg changes only.

* perf(recursion): forward Akita's terminal quotient certificate feature

Adds l2-terminal-quotient to jolt-akita (enabling akita-pcs's feature), the
recursion host and the verifier guest, the host's guest-feature line, and a
tamper-l2 tool for the rejection fixtures (quotient flip, noncanonical,
extra, short, response flip). Feature-off guest sources are untouched.

* perf(recursion): turn the terminal quotient certificate on by default

The recursion example enables l2-terminal-quotient by default next to
l3-compression-weights. The feature forwards weakly
(jolt-akita?/l2-terminal-quotient), and the host's guest-feature line, the
tamper-l2 command and its helpers are compiled only together with akita, so
Dory builds are unchanged and Akita builds prove and verify with the
quotient certificate. --no-default-features turns both off. Host-side Cargo
and cfg changes only.

* perf(field,transcript): word-sized Fp128 decoding and transcript scalars

Adds the word-decode and word-transcript features: Fp128 proof elements are
deserialized from fixed 16-byte tuples with register-sized accumulators, and
transcript scalars can be absorbed as whole words. Both are off by default.

* Define canonical big-endian bytes for transcript feature callers

* Gate Solinas encoding tests before lint expectations

* perf(recursion): turn word decoding on by default

The recursion example enables word-decode by default next to the factored
compression weights and the terminal quotient certificate. The feature
forwards weakly (jolt-akita?/word-decode) and the host forwards it to the
guest only together with akita, so Dory builds are unchanged.
--no-default-features turns all three off. Host-side Cargo and cfg changes
only.

* perf(verifier): reuse instruction read RAF public inputs

* style: rustfmt the instruction read RAF tests

* Add opt-in RV64 word memory routines for recursion

* Preserve assembler sections around word memory routines

* perf(recursion): turn word memory routines on by default

The recursion example enables word-memory by default next to the factored
compression weights, the terminal quotient certificate and word decoding.
The host forwards it to the guest only together with akita, so Dory builds
are unchanged. --no-default-features turns all four off. Host-side Cargo and
cfg changes only.

* build(akita): pin the recursion verifier changes on the Akita fork

The recursion example's default features use Akita changes that are not in
LayerZero-Labs/akita yet. Pin the Akita crates to the fork commit that carries
them so a fresh checkout builds the measured configuration.

* perf(recursion): build the recursion verifier guest with inline-threshold 1000 and one codegen unit by default

The recursion host now builds the verifier guest with
ZEROOS_GUEST_RUSTFLAGS=-Cllvm-args=-inline-threshold=1000 and
CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 (new default feature guest-codegen).
The settings apply to the verifier guest build only; the inner guests and
their proofs are unchanged. A value the caller already set for either
variable wins. RECURSION_GUEST_CODEGEN=off, or building without the
feature (--no-default-features), restores the stock guest build. Host-side
Cargo and source changes only.

* perf(recursion): raise the recursion verifier guest inline threshold to 1750

The guest-codegen default for the recursion verifier guest build moves
from -Cllvm-args=-inline-threshold=1000 to -Cllvm-args=-inline-threshold=1750,
still with one codegen unit. Thresholds of 2000 and above fail to link the
guest. A caller value for ZEROOS_GUEST_RUSTFLAGS still wins, and
RECURSION_GUEST_CODEGEN=off restores the stock guest build. Host-side source
change only; the inner guests and their proofs are unchanged.

* perf(recursion): enable GVN hoisting and DFA jump threading in the recursion verifier guest build

The guest-codegen default for the recursion verifier guest build adds
-Cllvm-args=-enable-gvn-hoist and -Cllvm-args=-enable-dfa-jump-thread to
-Cllvm-args=-inline-threshold=1750, still with one codegen unit. A caller
value for ZEROOS_GUEST_RUSTFLAGS still wins, and RECURSION_GUEST_CODEGEN=off
restores the stock guest build. Host-side source change only; the inner
guests and their proofs are unchanged.

* perf(recursion): use ExtTSP block placement without tail merging in the recursion verifier guest build

The guest-codegen default for the recursion verifier guest build adds
-Cllvm-args=-enable-ext-tsp-block-placement and
-Cllvm-args=-enable-tail-merge=false to the existing inline threshold,
GVN hoisting and DFA jump threading flags, still with one codegen unit.
A caller value for ZEROOS_GUEST_RUSTFLAGS still wins, and
RECURSION_GUEST_CODEGEN=off restores the stock guest build. Host-side
source change only; the inner guests and their proofs are unchanged.

* test(jolt-sdk): skip the Dory verifier fixture test under akita

The verifier_api test verifies Dory fixtures with VerifierPCS (Dory). With
jolt-sdk's akita feature, jolt_verifier::verify is the Akita path, whose
OneHotTrace metadata bounds Dory does not implement, so the test target
failed to compile (E0277) whenever akita was unified into jolt-sdk, for
example through the recursion example's akita feature. Gate the test to
builds without akita, like verifier_preprocessing_from_prover.

* perf(recursion): use size-oriented spill splitting in the recursion verifier guest build

The guest-codegen default for the recursion verifier guest build adds
-Cllvm-args=-split-spill-mode=size to the existing inline threshold,
GVN hoisting, DFA jump threading, ExtTSP block placement and no tail
merging flags, still with one codegen unit. A caller value for
ZEROOS_GUEST_RUSTFLAGS still wins, and RECURSION_GUEST_CODEGEN=off
restores the stock guest build. Host-side source change only; the inner
guests and their proofs are unchanged.

* perf(recursion): disable the RISC-V register cost-per-use model in the recursion verifier guest build

The guest-codegen default for the recursion verifier guest build adds
-Cllvm-args=-riscv-disable-cost-per-use=true to the existing inline
threshold, GVN hoisting, DFA jump threading, ExtTSP block placement, no
tail merging and size-oriented spill splitting flags, still with one
codegen unit. A caller value for ZEROOS_GUEST_RUSTFLAGS still wins, and
RECURSION_GUEST_CODEGEN=off restores the stock guest build. Host-side
source change only; the inner guests and their proofs are unchanged.

* Forward optional no-carry tensor contractions to recursion guests

* perf(recursion): turn no-carry tensor contractions on by default

The recursion host enables tensor-no-carry by default (weak dependency on
jolt-akita, as the other default verifier arms) and forwards it to the
verifier guest. The guest's Akita separates dense residual equality weights
into a high-part sum and a no-carry low span; the field values, proofs and
transcripts are unchanged. Turn it off with --no-default-features.

* build(akita): pin the Akita fork commit that adds no-carry tensor contractions

Moves the Acentelles/akita-lz pin from 9db4ee25 to a6a34dcf, which is
9db4ee25 plus the optional no-carry tensor contraction (feature
tensor-no-carry). Cargo.lock changes only the git source revisions.

* build(akita): fetch the Akita pin from LayerZero-Labs/akita

The Akita crates keep rev a6a34dcf (the previous pin 9db4ee25 plus the
optional no-carry tensor contraction) and are now fetched from
LayerZero-Labs/akita, which serves the commit by hash, instead of a fork
URL. Cargo.lock changes only the git source URLs.

* perf(recursion): split every critical edge in PHI elimination in the recursion verifier guest build

The guest-codegen default for the recursion verifier guest build adds
-Cllvm-args=-phi-elim-split-all-critical-edges=true to the existing inline
threshold, GVN hoisting, DFA jump threading, ExtTSP block placement, no
tail merging, size-oriented spill splitting and no cost-per-use flags,
still with one codegen unit. A caller value for ZEROOS_GUEST_RUSTFLAGS
still wins, and RECURSION_GUEST_CODEGEN=off restores the stock guest
build. Host-side source change only; the inner guests and their proofs
are unchanged.

* perf(field-inline): hold weighted-dot row pointers in registers (default off)

Behind the jolt-field feature `field-inline-rowptr` (recursion guest feature
`rowptr-registers`), `weighted_dot_rows` copies each block's row slices into
locals before its element loop, so the row base pointers stay in registers
across the field-inline asm blocks instead of being reloaded from
`block_rows` on every term. Arithmetic, operand order and results are
unchanged. The feature-off build keeps every source line number.

* fix(field-inline): wrap the weighted-dot block macro body in a block

The row-pointer copies under field-inline-rowptr are statements, and the
macro is invoked in expression position, so its body must be a block.
The feature-off expansion keeps the same loop inside a block and every
source line number.

* perf(recursion): hold the weighted-dot row pointers in registers by default in recursion

The recursion host enables rowptr-registers by default and forwards it to the
verifier guest, whose jolt-field keeps each block's row base pointers in
registers across the field-inline element loop instead of reloading them
on every term. Field values, proofs and transcripts are unchanged. Turn it
off with --no-default-features.

* perf(recursion): keep PHI-elimination live-out checks, eliminate spill copies and schedule after register allocation in the recursion verifier guest build

The guest-codegen default for the recursion verifier guest build adds
-Cllvm-args=-no-phi-elim-live-out-early-exit=true,
-Cllvm-args=-enable-spill-copy-elim=true and
-Cllvm-args=-enable-post-misched=true to the existing inline threshold,
GVN hoisting, DFA jump threading, ExtTSP block placement, no tail
merging, size-oriented spill splitting, no cost-per-use and
critical-edge splitting flags, still with one codegen unit. A caller
value for ZEROOS_GUEST_RUSTFLAGS still wins, and
RECURSION_GUEST_CODEGEN=off restores the stock guest build. Host-side
source change only; the inner guests and their proofs are unchanged.

* build(recursion): optionally leave unchanged generated guest sources untouched

With RECURSION_WRITE_IF_CHANGED set, the host compares each generated guest
source (provable_macro.rs, embedded.bin, embedded_bytecode.rs,
embedded_bytes.rs) with the file on disk and skips the write when the bytes
match, so an unchanged embedded setup no longer bumps mtimes and forces the
fat-LTO guest rebuild. Unset, behaviour is unchanged. Tooling only: the
written bytes, guest image, rows and verdict are the same either way.

* build(recursion): optional content-keyed cache for the verifier guest ELF

With RECURSION_GUEST_ELF_CACHE=<dir> set, the host computes a content key of
the verifier-guest build (workspace tree and diff, every file under
examples/recursion including the generated guest sources, the Cargo git
checkouts, the toolchain and jolt CLI, this host binary, the guest build
environment and the target directory) and reuses <dir>/<key>.elf instead of
running the guest build; a fresh build is stored under its key. Unset,
behaviour is unchanged. Tooling only: a hit reuses an ELF built from the same
inputs, so rows, image and verdict are the same.

* fix(recursion): key the guest ELF cache on every CARGO_PROFILE_ and CARGO_BUILD_ variable

The environment filter of the cache key required '=' right after the
CARGO_PROFILE_ and CARGO_BUILD_ prefixes, so no such variable entered the key
and a changed codegen-units setting could reuse a stale ELF. Match the full
variable names.

* build(recursion): leave unchanged generated guest sources untouched by default

Generated guest sources whose bytes already match the file on disk are no
longer rewritten, so an unchanged embedded setup does not force the fat-LTO
guest rebuild. RECURSION_WRITE_IF_CHANGED=off restores the unconditional
rewrite. Tooling only: the bytes on disk, guest image, rows and verdict are
the same.

* build(recursion): key-only probe for the guest ELF cache

With RECURSION_GUEST_ELF_CACHE and RECURSION_GUEST_ELF_CACHE_PROBE set, the
host logs the guest ELF cache key and whether the lookup hits, then exits
without building, so a key change can be checked without a guest build.
Tooling only; unset, behaviour is unchanged.

* perf(recursion): build the recursion verifier guest without debug information by default

The guest-codegen defaults add CARGO_PROFILE_RELEASE_DEBUG=0 to the
verifier-guest build only (the inner guests keep the workspace release
profile, debug = 1). Line-table debug information is not codegen-neutral
in LLVM; without it the verifier guest executes fewer rows. Proofs and
transcripts are unchanged. A caller value wins, and
RECURSION_GUEST_CODEGEN=off restores the stock guest build.

* perf(recursion): forward the optional tensor equality run feature to the verifier guest

* style(recursion): one statement per line in the guest feature forwarding

Formatting only (the rustfmt reflow of the tensor-eq-runs forwarding line
in the host); no behaviour change.

* perf(recursion): traverse constant-high equality runs by default in recursion

The recursion host enables tensor-eq-runs by default (weak dependency on
jolt-akita, as the other default verifier features) and forwards it to the
verifier guest, whose Akita materializes dense tensor equality weights by
traversing their constant-high runs. The field values, proofs and
transcripts are unchanged. Turn it off with --no-default-features.

* build(akita): pin Akita to the tensor equality run accumulation

The Akita crates move from rev a6a34dcf to 178e2f0f, which is a6a34dcf plus
the optional tensor equality run accumulation (LayerZero-Labs/akita#274) and
line-neutral rustfmt skip attributes, still fetched from LayerZero-Labs/akita
by hash. Cargo.lock changes only the git source revisions.

* perf(recursion): forward the optional structured setup-scan sums of products to the verifier guest

* perf(recursion): sum the structured setup-scan contractions by default in recursion

The recursion host enables setup-sop-structured by default (weak dependency
on jolt-akita, as the other default verifier features) and forwards it to the
verifier guest, whose Akita sums the cached structured E, T and Z
contractions of the setup scan through sums of products. The field values,
proofs and transcripts are unchanged. Turn it off with --no-default-features.

* build(akita): pin Akita to the structured setup-scan sums of products

The Akita crates move from rev 178e2f0f to f238e0e2, which is 178e2f0f plus
the optional structured setup-scan sums of products
(LayerZero-Labs/akita#276), still fetched from LayerZero-Labs/akita by hash.
Cargo.lock changes only the git source revisions.

* perf(recursion): add optional segment-setup and terminal-contraction features

Forwards two optional Akita verifier features through jolt-akita and the
recursion example: segment-setup (the ratio-one, single-functional reduced
setup scan evaluated once over its shared linear functional, segment by
segment) and terminal-contraction (signed 16-bit and weighted-row dot
products in jolt-field, with a field-inline guest path). Both are off here.
With either feature off, every existing source line keeps its location, so
the verifier guest image is unchanged.

* perf(recursion): evaluate the shared reduced setup scan by default in recursion

The recursion host enables segment-setup by default (weak dependency on
jolt-akita, as the other default verifier features) and forwards it to the
verifier guest, whose Akita evaluates the ratio-one, single-functional
reduced setup scan once over its shared linear functional, segment by
segment. The field values, proofs and transcripts are unchanged. The
terminal-contraction feature stays off. Turn it off with
--no-default-features.

* build(akita): pin Akita to the segment-setup scan

The Akita crates move from rev f238e0e2 to 334379a1, which is f238e0e2 plus
the optional segment-setup and terminal-contraction scans, still fetched
from LayerZero-Labs/akita by hash. Cargo.lock changes only the git source
revisions.

* perf(field-inline): evaluate geometric weighted dots by Horner's rule (default off)

With the new jolt-field feature field-inline-horner, the Fp128 field-inline
weighted dot first checks whether its 64 powers are 1, alpha, alpha^2, ...
and, when they are and there are at least five rows, evaluates each row by
a reverse Horner recurrence with alpha held in a field register, five rows
at a time. Any other input takes the existing kernel. The recursion example
forwards the optional weighted-dot-horner feature to the verifier guest.

* test(field-inline): type the geometric-power recognition test by the public field alias

* style(field-inline): match formatter spacing in the weighted-dot kernel without moving source lines

* perf(recursion): evaluate geometric weighted dots by Horner's rule by default in recursion

The recursion host enables weighted-dot-horner by default and forwards it to
the verifier guest, whose field-inline weighted dot checks that its 64 powers
are 1, alpha, alpha^2, ... and, for at least five rows, evaluates each row by
a reverse Horner recurrence with alpha held in a field register; any other
input takes the unchanged kernel. The field values, proofs and transcripts
are unchanged. Turn it off with --no-default-features.

* feat(verifier): evaluate stage claim expressions from optional precomputed recipe tables

With the new immutable-recipes feature (off by default; jolt-field,
jolt-claims, jolt-verifier, jolt-verifier-derive, jolt-sdk and the
recursion example), a stage's symbolic claim expression can be evaluated
from a recipe found by relation and phase in a generated table: a list of
coefficient-weighted products of openings, challenges and derived values.
A recipe is used only in a non-zk Full-mode verification with the Fp128
field-inline guest field; a key absent from the table, or any other
context, takes the canonical expression path. The native recorder that
observes the canonical expressions and writes the tables is behind
immutable-recipes-record.

* Fix recipe macro lint violations

* Fix recipe test panic and stale lint expectation

* Place recipe macros before final test modules

* Place recursion recipe macros before the test module

Move the immutable_recursion_program macros, their pub(crate) use and the
immutable_recipe_generation module above mod tests in
examples/recursion/src/main.rs, clearing clippy::items_after_test_module.
Layout only; no logic change.

* Enable syn visit-mut only with immutable recipes

jolt-verifier-derive turned on syn's visit-mut feature unconditionally. That
changes syn's build metadata for every crate that depends on syn, including
serde_derive, so the feature-off recursion guest was linked in a different
order and executed 93 more rows than its base.

Move visit-mut behind a new jolt-verifier-derive/immutable-recipes feature,
forwarded from jolt-verifier/immutable-recipes, and keep it as a
dev-dependency feature for the crate's own tests. Without the feature the
recipe attributes are never applied, and batch_companions returns the driver
unchanged, as its companions are compiled out anyway.

* Name the failing check in recipe Representation errors

Canonical recipe generation fails at inner 2^12 and 2^20 with
CaptureError::Representation, which eight different checks return. Give the
variant the name of the failing check and one detail value (the factor count
or the offending index) so that a generation failure identifies its cause.
The recorder is native-only and behind immutable-recipes-record, so guest
builds are unaffected.

* Format the named Representation errors

Apply rustfmt's layout to the error sites added in the previous commit, as
reported by cargo fmt --check. No other change.

* Report the relation tag and phase of an over-wide recipe term

The more-than-12-factors check now also packs the recipe key's relation tag
and the phase into its detail value, so the failing relation can be read
from the error. Native recorder only; guest builds are unaffected.

* Fall back to canonical evaluation for over-wide recipe keys

A recipe term with more than 12 factors cannot be represented in the compact
form. Generation used to fail on the first such term; the composed bytecode
recipe has one with 62 factors (gamma^4 times stage5_gamma^57 times one
opening).

Instead, leave such a key out of the generated tables and list it, with its
phase, widest term and observation count, in capture.json as fallback_keys.
The coverage check accepts a listed fallback for a required tag and phase.
Guests need no change: a key absent from the tables already evaluates
canonically before any recipe parsing or callback.

* Reject a recipe key seen both narrow and over-wide

A key and phase could be recorded from a narrow observation and also listed
as a fallback from an over-wide one. The table would then carry the narrow
recipe and the guest would apply it to every observation. Return Conflict in
both directions: when recording a key already listed as a fallback, and when
listing a key already recorded.

Also bound the fallback list at MAX_KEYS entries, like the records.

* Format the fallback coverage check

Apply rustfmt's layout to the coverage condition added with the over-wide
fallback, as reported by cargo fmt --check. No other
change.

* Write recipe coefficients as decimal strings in capture.json

capture.json is built with serde_json, which cannot represent integers wider
than 64 bits. Canonical coefficients are Fp128 values, so publishing the
capture panicked with "number out of range" once generation got past
capture. Serialize the coefficient list as decimal strings. The generated
recipe source is unaffected.

* Emit generated recipe tables from an inline const slice

* Format the inline-const table emitters

* Generate recipe tables in process before the recursion guest build

With immutable-recipes, the recursion host now verifies every proof of the
stream it embeds, natively and inside one recording session, before the
verifier guest is built. When every proof verifies and the capture closes,
it renders the tables; otherwise, or with RECURSION_IMMUTABLE_RECIPES=off,
it uses three empty tables, so every lookup misses and the guest keeps its
canonical expression path. Either file is written by content digest under
the guest target directory and named in JOLT_IMMUTABLE_RECIPES_RS for that
build only, so the caller never has to set the variable. A caller-set
variable is kept.

The host feature now carries the native recording code it needs; the
publication path stays behind immutable-recipes-record.

* Key the guest ELF cache on the recipe tables file contents

The optional verifier-guest ELF cache keyed on the environment and the
example sources but not on the immutable recipe tables, so a hit could reuse
an ELF built with other tables. The key now includes the sha256 of the bytes
of the file named by JOLT_IMMUTABLE_RECIPES_RS (or a fixed marker when it is
unset), by content and not by path.

* docs(recursion): add immutable-recipes to the recursion reproduce commands

The recursion flow's stock feature list is now
akita,field-inline,ntt-inline,immutable-recipes. Cargo's default features
are unchanged, and CI keeps its own feature list.

* fix(claims): define the CircuitFlags recipe ids in the Spartan flag carrier

The protocol boundary test confines field-inline feature gates to the
common ISA flag carriers and the composed module. The recipe id list for
CircuitFlags gated its field instruction flags in immutable_recipes/flags.rs.
Move that list, unchanged, into a macro in protocols/jolt/geometry/spartan.rs,
which already mirrors CircuitFlags with the same gates, and expand it from
flags.rs as before. The generated impl and its tokens are unchanged.

* style(recipes): use imported names for the immutable recipe paths

Import the types, traits and constants that the immutable recipe code and
its derive helpers spelled with qualified paths (syn and proc-macro types,
fmt, io and slice types, PhantomData, the field-inline Fp128 modulus, the
recipe key traits). Paths inside generated code are bound once with quote!
so the expansions keep the same tokens. In the guest-compiled files the new
imports are placed so that no existing line moves except after the last
item that can panic.

* style(toml): taplo-format the jolt-akita, jolt-claims, jolt-transcript and jolt-verifier manifests

* test(fs): inventory the word-transcript append_scalars absorption site

append_scalars has a word-sized branch under the word-transcript feature
that absorbs the same message bytes (label word, then each scalar big-endian)
with one append_bytes call. The source inventory sees it as a second site;
record it next to the default branch's site.

* style(toml): taplo-format the recursion example, its guest and jolt-sdk manifests

* style(recursion): import std::process::Command in the guest ELF cache key

* build(akita): move the Akita pin to bcc1f30c

bcc1f30c is the previous pin 334379a1 plus five Akita commits: the fused
setup-scan job, its job loop and its row collection kept inline when
terminal-contraction is enabled, and an optional, default-off rebuild of a
byte-equal verifier view from prevalidated values (prevalidated-catalog).
Only the pin and the lockfile sources change.

* Keep the field-inline weighted dot and its kernel inline when terminal contraction is enabled

With terminal-contraction both the field-inline weighted dot and the kernel
it calls are marked inline(always), so the kernel stays inside the
setup-scan row kernel in the guest. The attributes sit on the existing
signature lines; feature-off builds keep every source line.

* Keep the Fp128 weighted dot product inline under terminal contraction

The Fp128 weighted dot product that the terminal contraction adds is marked
inline(always), so it stays inside its caller in the guest. The file is only
compiled with the feature.

* feat(recursion): contract the terminal relations by default

The recursion host enables terminal-contraction by default and forwards it to
the verifier guest and to the host's Akita, so the stock feature list builds
with it. The guest contracts the terminal ring relations with signed 16-bit
coefficients, and the fused setup scan, its jobs and the weighted dots stay
inline. The field values, proofs and transcripts are unchanged. Turn it off
with --no-default-features.

* build(recursion): link the verifier guest with its main entry first in .text

ZeroOS's weak __main_entry stub sits at the start of .text and reaches
__default_main_entry with j, whose reach is 1 MiB. The verifier guest can place
more than 1 MiB of code between the two, and its link then fails with an out of
range jump. The recursion host now passes an lld symbol ordering file that lists
__default_main_entry to the verifier guest build only, through
ZEROOS_GUEST_RUSTFLAGS, so that function's section is placed next to the stub.
The guest code and the ZeroOS pin are unchanged, and the inner guests are built
and linked as before. RECURSION_GUEST_LINK_ORDER=off links without the file.

* Rebuild the recursion guest's one-hot catalog view from a build-time record behind a default-off feature

prevalidated-catalog: before the verifier guest build, the recursion host loads
the one-hot catalog view of the setup section it embeds through Akita's
canonical loader and writes the recorded values to a generated file named in
JOLT_PREVALIDATED_CATALOG_RS. The guest uses the record only for view bytes
equal to the recorded ones (length, bytes, then policy digest); any other view
takes the unchanged canonical path. In guest-compiled files the only changed
line is the one-hot catalog match arm in adapters.rs (same-line attribute);
everything else is appended after the last original line or before the final
test module.

* Instantiate the prevalidated catalog rebuild for the guest's own family only

The generated file names its family, so the guest instantiates one rebuild.
The rebuild and the dispatch are kept out of line. The host dispatch still
covers every family and checks each family's config against its variant at
compile time.

* Make the recursion host's prevalidated catalog effective only with akita

The prevalidated-catalog feature now reaches jolt-akita through a weak
dependency edge, like the other Akita features, and the host's catalog module,
its call sites and the guest forwarding are compiled only with akita as well.
Builds that enable akita resolve the same features as before; builds without
akita no longer pull akita in through this feature.

* feat(recursion): rebuild the guest's catalog view from the host record by default

The recursion host enables prevalidated-catalog by default, so the stock
feature list records the embedded setup's one-hot catalog view and the verifier
guest rebuilds a byte-equal view from that record instead of validating it
again; any other view takes the canonical path. Proofs, Akita proof bytes and
transcripts are unchanged. Turn it off with --no-default-features.

* style(toml): taplo-format the prevalidated-catalog feature lists

* Add a default-off three-coefficient step to the Horner weighted dot

The field-inline Horner weighted dot evaluates five rows of 64 two-limb
elements with register-resident accumulators. With the new jolt-field feature
`field-inline-horner-triplet`, each full five-row block advances every row by
three coefficients per pointer and branch group: one base pointer covers three
consecutive elements through the offsets of the existing load-accumulate
instruction. Other block shapes keep the existing path. Field values are
unchanged.

The recursion host gains `weighted-dot-horner-triplet` (implies
`weighted-dot-horner`) and forwards it to the verifier guest, whose feature of
the same name enables the jolt-field feature. Default off in this commit.

* feat(recursion): use the three-coefficient Horner step by default

The recursion host enables weighted-dot-horner-triplet by default and forwards
it to the verifier guest, so the stock feature list builds with it. Inside each
full five-row block of 64 two-limb elements, the guest's Horner weighted dot
advances every row by three coefficients per pointer and branch group. Field
values, proofs, Akita proof bytes and transcripts are unchanged. Turn it off
with --no-default-features.

* style(jolt-field): rustfmt the terminal-contraction attribute lines

Put each attribute of the terminal-contraction items in algebra.rs,
field_inline.rs and solinas/fp128.rs on its own line, as cargo fmt --check
requires. Formatting only; no code change.

* style(jolt-akita): import the one-hot types in the host stub of the prevalidated catalog

* build(akita): move the Akita pin to b90491fa

b90491fa is the previous pin bcc1f30c plus four optional, default-off
verifier features and one comment-only commit: lazy-scan-errors (the
setup-scan kernels build InvalidProof only on the failure path),
digest-nozero (the prevalidated verifier view copies its row digests without
zero-filling first), golomb-word (doubleword table and packed doubleword
stores in the terminal z Golomb-Rice decoder) and fill-ingress (each bounded
equality-fill run is scaled through Field::scale_slice_into). With the
features off the Akita sources keep every line. Only the pin, its comment and
the lockfile sources change.

* feat(recursion): add five default-off verifier guest features

Each feature keeps the field values, proofs and transcripts and is forwarded
from the recursion host to the verifier guest (and to the host's Akita) only
when `akita` is enabled:

- lazy-scan-errors: Akita's setup-scan kernels build InvalidProof only on the
  failure path.
- digest-nozero: with prevalidated-catalog, the verifier view rebuild copies
  its row digests without zero-filling first.
- golomb-word: doubleword trailing-ones table and packed doubleword stores in
  Akita's terminal z Golomb-Rice decoder.
- bytecode-fold (jolt-claims): the stage 6b bytecode read-RAF fold indexes its
  flag classes through a direct word table, with open addressing kept for keys
  beyond it; same classes, sums and first error.
- fill-ingress (jolt-field, Akita): Field::scale_slice_into, which a
  field-inline Fp128 guest serves by loading the scale once per slice; Akita's
  bounded equality fill scales each run through it.

All five are off by default.

* feat(recursion): turn the five verifier guest features on by default

lazy-scan-errors, digest-nozero, golomb-word, bytecode-fold and fill-ingress join the recursion host's default features, after weighted-dot-horner-triplet. Builds without `akita` do not pull Akita in; `--no-default-features` turns all of them off.

* style(jolt-field): end the fill-ingress forwarding call with a semicolon

Clippy's semicolon_if_nothing_returned (pedantic, denied by -D warnings) flags the unit-valued tail call in Fp128's scale_slice_into. Adding the semicolon does not change the generated code.

* build(akita): move the Akita pin to b215e829

b215e829 is the previous pin b90491fa plus the optional, default-off
setup-lane-streams root setup scan (each lane streamed with its row scales
hoisted; implies terminal-contraction) and its import gate. With the feature
off the Akita sources keep every line. Only the pin, its comment and the
lockfile sources change.

* feat(recursion): add the default-off setup-lane-streams verifier guest feature

jolt-akita forwards setup-lane-streams to akita-pcs. The recursion host
reaches it through a weak dependency edge and forwards it to the verifier
guest only with akita, so builds without akita do not pull akita in. Field
values, proofs, Akita proof bytes and transcripts are unchanged.

* feat(recursion): turn setup-lane-streams on by default

The recursion host enables setup-lane-streams by default and forwards it to
the verifier guest, so the stock feature list builds with it. Field values,
proofs, Akita proof bytes and transcripts are unchanged. Turn it off with
--no-default-features.

* fix(jolt-akita): align the embedded prevalidated catalog view to 8 bytes

The generated prevalidated catalog file stored the view bytes as an
alignment-1 array. The run-time check compares them with the setup copy,
which is 8-aligned, and the comparison takes its word loop only when both
addresses agree modulo 8. Depending on how the guest data happened to be
laid out, the comparison could fall into its byte loop. Store the bytes in
an 8-aligned wrapper so the comparison stays on the word path. The bytes,
digests and accept set are unchanged.

* build(akita): move the Akita pin to d04bf51f

d04bf51f is the previous pin b215e829 plus the optional, default-off
compiled carry-state graphs for the eq-pair tensor recurrences
(akita-algebra/carry-graph). With the feature off the Akita sources keep
every line. Only the pin, its comment and the lockfile sources change.

* feat(recursion): add the default-off carry-graph verifier guest feature

With `carry-graph` (and `akita`), the host reads the padded trace length
shared by the inner proofs in the stream it is about to verify, emits
Akita's fixed carry-state graph source for that size, and names the file in
JOLT_CARRY_GRAPH_RS for the verifier guest build only. The guest then
evaluates the eq-pair tensor recurrences through the compiled graphs. The
graphs depend only on the size, never on a proof's values. If the proofs
do not share one supported size, or RECURSION_CARRY_GRAPH=off, the file
holds no graph and the guest keeps the recurrence path. The graph file is
part of the guest build cache key.

* feat(recursion): turn carry-graph on by default

* build(akita): move the Akita pin to 9f778c0c

9f778c0c is the previous pin d04bf51f plus two optional, default-off verifier
features: MLE leaf tiles (akita-algebra/mle-leaf-tiles) and signed-byte
challenge evaluation (akita-challenges/signed-byte-sum). With both features
off the Akita sources keep every line. Only the pin, its comment and the
lockfile sources change.

* feat(recursion): add the default-off mle-leaf-tiles and signed-byte-sum verifier guest features

Two optional verifier features, both default off and both effective only
with `akita`; each is forwarded to the verifier guest and to the host's Akita.
Same field values, proofs and transcripts.

- mle-leaf-tiles: Akita evaluates low-variable multilinear extensions by
  fixed leaf tiles (akita-pcs/mle-leaf-tiles).
- signed-byte-sum: Akita evaluates a sparse challenge at powers by taking its
  signed byte coefficients in through one field sum. jolt-field gains the
  matching default-off feature `signed-byte-sum`: Field::sum_signed_bytes
  (a generic fold) and, in the field-inline guest, an Fp128 override that
  accumulates each nonzero coefficient's magnitude in the field accumulator
  register. tests/signed_byte_sum.rs checks the integer contract, including
  i8::MIN and the empty sum, for both 128-bit Solinas primes.

* feat(recursion): turn mle-leaf-tiles and signed-byte-sum on by default

Both features join the recursion example default list. Turn them off with
--no-default-features plus the other defaults.

* build(akita): move the Akita pin to 13128559

13128559 is the previous pin 9f778c0c plus two optional, default-off verifier
features: setup-weight tiles in the direct setup scan
(akita-verifier/setup-weight-tiles) and word-level challenge decode
(akita-challenges/challenge-word-decode). With both features off the Akita
sources keep every line. Only the pin, its comment and the lockfile sources
change.

* feat(recursion): add the default-off setup-weight-tiles verifier guest feature

New feature jolt-field/setup-weight-tiles: Field::add_scaled_slice adds
scale * src[i] to dst[i] over the shorter slice. The default is the plain
loop; the field-inline Fp128 guest path keeps the scale in a field register
and adds each product to its destination through the field register add, four
elements per tile, then checks every result as a canonical value. Same field
values; tests/setup_weight_tiles.rs compares it with the plain loop on random
and boundary inputs for both 128-bit primes.

The feature is forwarded recursion -> jolt-akita -> akita-pcs (whose direct
setup scan uses it) and to the verifier guest. Default off.

* feat(recursion): add the default-off challenge-word-decode verifier guest feature

Forwards Akita's akita-challenges/challenge-word-decode (through
jolt-akita and akita-pcs) to the recursion host and the verifier guest. With
it on, sampling a signed sparse challenge decodes positions and signs from
whole 64-bit SHAKE output words instead of byte by byte; same consumption,
rejection and challenges. Default off.

* feat(recursion): turn setup-weight-tiles and challenge-word-decode on by default

Both features join the recursion default list after signed-byte-sum. They are
forwarded in the weak form (jolt-akita?/...), so --no-default-features builds
are unchanged and the defaults take effect only with akita. No Akita default
changes.

* perf(instruction): compute native quadratic coefficients directly (#2230)

* perf(kernels): factor RAM products with a common zero endpoint (#2231)

* perf(kernels): reuse equal categorical quartet values (#2232)

* perf: reuse zero-prefix range-check moments across address phases (#2224)

* perf(spartan): reuse upstream product claims in uniskip (#2225)

* perf(spartan): reuse upstream claims for product base nodes

* perf(kernels): iterate product base nodes without feature-specific range lint

* refactor(kernels): share uniskip node geometry and name the claim check

Derive the product uni-skip base offset from the centered domain starts,
the same law the outer uni-skip uses (correct for even domains too), and
say where agreement between the reused stage-1 openings and the witness is
enforced now that the uni-skip round sum holds by construction.

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>

* perf(instruction): accumulate operand claims from native scalars (#2227)

* perf(bytecode): detect repeated work across longer loops (#2229)

* perf(bytecode): detect repetitions across longer loops

* refactor(bytecode): reuse the long repeat window's merge cache per worker

- grouped_evals keeps the same per-batch task split, but reuses one merge
  cache per rayon split via map_init instead of allocating 2048 entries
  (8192 slots) per batch per round; drain() already leaves the cache empty.
- CycleGrouping carries min_groups instead of identifying the short plan by
  its entry count, and names the long sizes. The long window keeps the
  same threshold (one full task): a higher gate measured slower on SHA-2.

The per-group merge loop is unchanged.

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>

* perf(akita): prepare sparse shift views once per batch (#2226)

* Prepare bounded sparse commitment source views before tile accumulation

* refactor(akita): one chunked digit-window kernel for sparse shift batches

Fold the prepared-view fast path and the old per-tile window/shift walk
into one kernel. accumulate_slots resolves full-length shifted views into
a stack array of VIEW_BATCH (64) thin slices and runs the tile loop once
per full chunk, so batches above 64 shifts take extra passes over dst
instead of falling back to a second copy of the tile loop. This removes
the bool return, the >64 fallback, and the impossible first_chunk-failure
branch (now an expect on the 2*D digit layout).

Every production batch (<= D/16 <= 32 from commit.rs, < 60 from
ntt_commit.rs) is one chunk, so the hot path is unchanged: the same view
collection, the same tile loop, and the same per-tile work as before.

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>

* perf(spartan): group weighted products by repeated guard endpoints (#2233)

* perf(spartan): reuse guard folds during remainder preparation

* perf(spartan): group weighted products by repeated guard endpoints

* refactor(kernels): back spartan guard endpoints with RepeatCache

Consolidate the outer-remainder guard grouping from #2222/#2233:

- Delete `fold_group`, which restated `fold_guards` + `fold_values`. The
  constant-tail row and field-inline rows now call those two directly
  (`RowGroupValues::fold_b` / `FieldGroupValues::fold_b` own the B folds).
- `GuardEndpoints` stores its groups in the shared `RepeatCache` (same
  128 slots: 32 entries x 4) instead of a hand-rolled slot array. The cache
  is allocated once per rayon split via `map_init` (once for the serial
  path) and `finish(self)` drains it, so blocks no longer zero-initialize a
  22-43 KB stack array each. The slot hash stays a single multiply (byte
  swapped so `RepeatCache`'s low-bit mask sees the product's high bits)
  rather than `repeat_hash`'s three.
- Active field-inline rows go through `add` (their A side is the same
  integer guard fold), so `add_direct` is private to the out-of-range
  fallback.
- Add `remainder_matches_reference_with_repeated_guard_rows` (log_t = 12,
  period 48) so hits, multi-row groups, and collision flushes in the real
  `prepare` path are checked against the reference kernel.

The per-row hot loop is unchanged: same row decode, B folds, lookup, and
two accumulator fmadds per row.

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>

* feat(recursion): Akita field-inline verifier guest on main (#1911)

* feat(field,inlines): field-inline guest kernels and hash/NTT inlines

Fp128 and Fr dot, weighted-row dot, and multiply kernels over the
field-inline ISA for RISC-V guests, with canonical readout checks. A
digest adapter over the Blake2b inline, used by the transcripts and the
shared Blake2b-256 hasher. A 64-point i32 NTT and six-product pointwise
dot inline expanded into existing proved instructions.

The tracer fixes the unit's modulus, so a guest selects the one field that
routes through it: field-inline-guest-bn254 (Fr) or
field-inline-guest-fp128 (Prime128OffsetA7F7). Every other field keeps
the software path.

* feat(sdk,platform): guest runtime for verifier-as-guest workloads

Size-class allocator for std guests, word-wise memset/memcmp and an
asm-load memcpy, write(2) and clock_gettime(2) trap shims, and an
execute-with-output host entry point.

* perf(claims,verifier): shape verifier algebra for guest costs

Derived leaves for batching powers, direct output-claim value walks,
indexed claim lookups, the factored Spartan outer clear check, and
column-dot bytecode folds. The preprocessing digest hashes through the
shared Blake2b-256 hasher, and the wire form is public for verifiers
whose trust root fixes the digest.

* feat(akita): prepared verifier for recursion guests

AkitaVerifierSetup::prepare_verifier carries the expanded key, a
selected-row catalog view, and the terminal NTT cache for the row a
proof selected; detach/attach moves the payloads out of the record so a
guest views them in place. Byte payloads serialize through serde_bytes.
The backend pool is behind a default parallel feature.

* feat(recursion): Akita verifier guest with embedded setup

The recursion example verifies an Akita field-inline proof as a guest.
Embedded mode bakes the setup, compiled bytecode rows, and the
preprocessing digest into the image. trace --expect checks the verdict;
CI requires acceptance and rejection of a tampered opening. Adds the
design note.

* perf(claims,poly,transcript): cheaper verifier bookkeeping for the guest

- Bytecode read-RAF stage values fold against the address eq table by
  decoded flag class: rows sharing a flag set share one gamma bucket, and
  register operands accumulate into per-register buckets. The flag-to-gamma
  mapping has one owner, read_raf_flag_terms; the flag-class table uses
  word-sized slots.
- The stage-1 outer remainder reads its produced openings off its Az and Bz
  factors instead of expanding tau*Az*Bz; every expanded term is a distinct
  unit-coefficient monomial, and a test pins the result to the expansion.
- Contiguous sparse MLE runs read their low eq factor from one table.
- The digest transcript updates one hasher in place instead of threading it
  through chain_update; transcript bytes are unchanged.

* perf(field,inlines,akita): guest kernels, inline tuning, and the companion pin

- jolt-field: shared-operand dot_rows, four-factor sum_of_products4, and
  register-resident signed sums (Field::signed_sum) on the field-inline guest.
- jolt-inlines-ntt: butterfly sums reduce by a Montgomery product with the
  stage's first twiddle (the Montgomery form of 1), 5 rows instead of a 7-row
  conditional reduction; the registered expansion fixture is regenerated.
- jolt-inlines-blake2: Blake2b::update_block_eager compresses a full
  non-final block now, so a hasher sharing a constant first block can be
  prepared once.
- Recursion guest: the Keccak inline backs Akita's SHAKE sampling
  (hash-inlines feature).
- Akita companion pinned at markosg04/akita@6faec6c78: an inline Blake2b
  transcript sponge byte-identical to spongefish's Blake2b512 (checked by
  jolt-akita against spongefish), word-window Golomb-Rice decoding,
  coefficient-major terminal folds, doubleword NTT input stores, inline
  proof-atom encoding, and batched compression-column evaluation.

* perf(transcript)!: absorb opening claims and round coefficients as one message

Sumcheck round coefficients and each batch of opening claims now absorb as
one labeled message carrying the count and the big-endian values, instead
of one message per scalar. This changes the transcript, and so the proof
bytes, for every proof.

Prover, verifier, and BlindFold absorb through the shared
append_round_coefficients and append_opening_claims helpers in
jolt-sumcheck, whose transcript-facing bounds move from AppendToTranscript
to CanonicalBytes. The Fiat-Shamir absorb- and challenge-site inventories
are re-blessed, the checked-in jolt-verifier fuzz proof bundles are
regenerated by their documented ignored tests, and the sumcheck
compressed-round differential reference frames rounds through the shared
helper. The standalone sumcheck consumer's field implements CanonicalBytes.

jolt-blindfold's pairwise and lag-one correlation checks used a fixed 0.25
bound, under 3 sigma at 128 samples, which also fails for
transcript-independent projections at other seeds; they now use 4 sigma,
4/sqrt(n) over n samples.

* docs(recursion): record the guest-cost mechanisms and the 2^26 ladder

* build(akita): pin canonical LayerZero-Labs/akita

The Akita companion moves from the personal markosg04/akita fork to
LayerZero-Labs/akita branch markos/recursion-integration: akita main
2607265b2 plus the recursion verifier-guest PRs
(LayerZero-Labs/akita#186-#190). Repin to akita main once those merge.

Akita main moved schedule, geometry, and dispatch types into a new
akita-params crate and renamed AkitaScheduleLookupKey to
ScheduleLookupKey; jolt-akita imports them from there. The trace-packed
one-hot source implements the new
OpeningBatchKernel::evaluate_and_fold_batch by folding each source.

Akita main's guided planner now admits the four-group and
two-full-width batches the schedules test expected it to reject. Neither
shape reaches the full-planner fallback, which still admits only one
full-width increment plus at most two advice groups, so the test now
asserts that they plan through guided planning.

The guest accepts at 66,175,726 rows (was 66,116,859 on the fork); the
ported companion validates the setup descriptor and prefix registry and
decodes the catalog view with postcard.

* fix(recursion): close review findings on trust boundaries and guest paths

Adversarial review of the recursion guest PR:

- Prepared Akita payloads: the backend key and terminal cache are used
  unchecked, so an inline copy decoded from a setup record is refused
  there; only payloads this process prepared or a guest attached serve.
  Attached bodies are akita TrustedBytes tokens, so the one unchecked
  assumption (canonical key words) is made where the token is built, in
  the guest or host, and jolt-akita stays free of unsafe code.
  detach_prepared_payloads checks every payload before moving any. The
  host verifies proofs through the same detach-and-attach path the guest
  takes, and an integration test pins it.
- Field-inline selectors are exclusive on riscv64 (a compile error
  otherwise); the unit's modulus contract and the reserved FR registers
  are documented. Row kernels (dot_base_rows, weighted_dot_base_rows)
  require matching row shapes on every path, as the guest kernels do.
- Blake2b: jolt-transcript and jolt-claims use the inline hasher only on
  riscv64, so a host build with blake2-inline no longer panics.
- The clear Spartan outer check accepts only shapes with affine terms,
  the shapes its factored form matches.
- tamper-opening flips a bit inside the Akita opening proof, so CI's
  reject case runs through the PCS verifier (rejected after ~47.8M rows
  rather than at stage 1).
- Guest runtime: zero-length write shim guarded; allocator and heap-split
  comments corrected; assume_static is an unsafe fn.
- Docs: flag-class soundness guard, opening-claim message boundaries,
  non-additive jolt-sdk akita feature, spec measurements at this revision.
- Akita pin: LayerZero-Labs/akita markos/recursion-integration, main plus
  the reviewed LayerZero-Labs/akita#186-#190.

* chore(verifier): drop the redundant bn254 feature on jolt-crypto

jolt-verifier's library code uses only jolt-crypto's ungated commitment
traits. The BN254 types appear only in its unit tests, and jolt-blindfold,
a non-optional dependency, enables jolt-crypto/bn254 itself, so the
explicit feature changed nothing in the resolved build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sdk): share one size-class arena between Rust and musl in std guests

Under guest-size-class-alloc, std guests split the heap at boot: ZeroOS's
kernel heap kept a fixed heap_size/8 and the Rust arena the rest. The kernel
heap backs every musl mmap (malloc arenas, pthread stacks, C allocations), so
a guest that mapped more than an eighth of its heap failed with ENOMEM even
when the Rust side had room.

std guests on the size-class allocator now register it as ZeroOS's kernel
heap, as no_std guests already do, and kinit hands it the whole heap. The
Rust global allocator draws from the same arena. The allocator's SAFETY
comment now states why calls cannot overlap with threads enabled.

A guest runtime test maps a 3 MiB malloc and a 3 MiB pthread stack beside a
4 MiB Rust allocation on a 16 MiB heap; it failed on the split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(field): rename fr_inline to field_inline

The guest kernels serve whichever field the field-inline unit computes
in (Fr or Fp128), so the module and its comments use the field-inline
terminology: field_inline.rs, "field registers", and the field-inline
instruction profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(claims): list read-RAF and digit-zero output openings directly

The default expected_output_openings expands output_expression only to
collect its opening ids, and the clear verifier's output-shape check
calls it before verification builds the expression again. Read-RAF and
the digit-zero claim reduction have large expansions. Both outputs are
sums of distinct monomials, so their openings are listed directly; a
test pins each list to the expanded expression, as for the stage-1
outer remainder. The recursion guest drops 813,367 rows on the
Fibonacci proof (66,254,853 to 65,441,486).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(platform,sdk): drop the fast-mem guest routines

Remove jolt-platform's word-wise memcpy, memset, and memcmp overrides
(the fast-mem feature) and jolt-sdk's guest-fast-mem, so guests use
musl's routines. Owning libc replacements is not worth it here; the
sub-word access cost they dodge belongs in the ISA (Tiers 1 and 2 of
specs/byte-addressable-memory.md, #2013).

The recursion guest's Fibonacci trace grows from 65,441,486 to
69,059,130 rows, 1,950,266 over 2^26. The following commits recover
part of that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(inlines): pack Blake2b input into message words

The Blake2b SDK staged input through a 128-byte byte buffer. On a guest,
each update's variable-length copy and each finalize's padding fill
lowered to libc memcpy/memset calls, and every hasher clone copied the
whole 216-byte struct. The Jolt digest transcript and Akita's transcript
sponge both hash through this type.

The buffer is now 16 little-endian message words whose bytes past the
buffered length stay zero. Input is ORed in word by word (one aligned
load per word when the source is aligned), finalize needs no padding
pass, and Clone copies only the buffered words. Volatile word accesses
keep LLVM from lowering these loops back into libc calls. Output bytes
are unchanged; a new test checks every source alignment and split point
against the blake2 crate.

On its own, this saves the recursion guest 232,593 rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(platform): copy whole words when size-class realloc moves a block

Both blocks are class-aligned and span whole words, so realloc copies
8-byte words instead of calling memcpy, which a std guest's libc
performs partly in sub-word loads and stores. On its own, this saves
the recursion guest 61,164 rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(cli): inline constant-size guest copies and fills up to 32 stores

LLVM's RISC-V defaults lower constant-size memcpy/memset above a few
stores to libc calls. In a guest those calls move data partly in
sub-word loads and stores, each a multi-row sequence, so guest builds
now raise the inline limits to 32 stores (-max-store-memcpy,
-max-store-memset). On its own, this saves the recursion guest 948,480
rows; btreemap, alloc, collatz, the stdlib and large-alloc guests each
drop slightly. 64 and 128 measured worse on the recursion guest than 32.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(spec): record recursion-guest rows without fast-mem

The guest now accepts the Fibonacci inner proof at 67,622,320 rows,
513,456 over 2^26. Record the post-rebase rows, mark the target as
unmet, and list cheaper sub-word memory as the lever.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(inlines): keep the Blake2b word-packing helper out of the absorb inventory

The Fiat-Shamir inventory scanner treats any call named `absorb*` as a
transcript absorb site, so the Blake2b hasher's input-packing helper,
named `absorb` by db157e75a, left fs_obligations failing on an
unlisted site. It packs hash input into message words and touches no
transcript; rename it `or_into_words` and drop its inventory entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(spec): record recursion-guest rows after merging main

A fresh Fibonacci proof at this revision accepts at 78,896,208 rows
(76,805,832 verification cycles), 11,787,344 over 2^26. Input mode
accepts at 86,254,204 rows and the tampered opening proof is rejected
after 60,145,138. The increase over 67,622,320 is in the Akita
trace-batch opening's root fold under main's native trace batching
(#2012); the guest still verifies through its prepared payloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sdk): name jolt-sdk's akita feature when it breaks a provable host build

jolt-sdk's `akita` feature compiles out the Dory host helpers, because
jolt-prover's `akita` compiles out `jolt_prover::dory`. `#[jolt::provable]`
still expanded calls to them, so any host build that unified the feature
with a provable crate (`--all-features`, or the recursion example's
`akita` alongside another example) failed with unresolved paths into the
missing Dory API: six errors for the fibonacci guest alone.

The macro now wraps its Dory prove and verify functions in
`jolt::__dory_host_items!`. jolt-sdk passes them through, except with
both `host` and `akita` enabled, where it replaces them with a single
compile error that names the feature and points at
`jolt::jolt_prover::akita`. Guest builds and tracing helpers are
unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(field): generalize sum_of_products4 to sum_of_products<K>

Field::sum_of_products::<K> computes Σ_i Π_k terms[i][k] for any arity
(an empty product is one). On a field-inline guest the kernel loads each
term's K factors into the register file with K - 1 multiplies and reads
the sum out once, as the four-factor kernel did. Akita's compression
evaluation, its one caller, compiles to the same per-term sequence: the
recursion guest accepts at 78,895,414 rows (was 78,896,208).

sum_of_products4 forwards to it until the Akita companion calls
sum_of_products; the repin that follows removes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* build(akita): repin the companion and drop sum_of_products4

markos/recursion-integration now calls Field::sum_of_products directly
(LayerZero-Labs/akita 38d8deb6, which also pins Jolt at e19eda725), so the
four-factor forwarder has no caller left. The recursion guest accepts at
78,895,975 rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(riscv): make flag_class name every row field

The verifier's folded read-RAF evaluation reads each flag class's flags
from one row, so a row field that a flag reads but flag_class omits
breaks soundness, and the class test would not vary a new field.
flag_class now destructures the row without `..`: adding a field to
JoltInstructionRow fails to compile there until it is keyed or
explicitly excluded. Flags starting to read the already excluded
address or operands remain guarded only by
flag_class_determines_read_raf_flag_terms. Guest rows are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sdk): emit trapped stdout writes in one host call

The trap handler answered write(2) to fds 1 and 2 by calling putchar per
byte, one host print per byte. The tracer decodes each print as UTF-8, so
every non-ASCII character reached the host as replacement characters:
a std guest's `println!("σ→²")` printed seven U+FFFD. The shim
intercepts these writes before ZeroOS's console, so it bypassed #1960's
single-call fix for every std guest.

It now calls __platform_stdout_write, the console's single-call path,
which also covers a null or empty buffer. The comment notes that fds 1
and 2 reach the host even if the guest redirected them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(guests): document what std::time returns in a guest

std guests' clock_gettime is answered by the runtime with a zero
timestamp for every clock, so Instant::now and SystemTime::now succeed
but never advance. The guest page now says so under Standard Library,
the security model's no-clock rule links to it, and the recursion spec
states what its trap shims return.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(verifier): repin the ZK muldiv BlindFold shape at trace length 512

The jolt CLI's inline-store limits (83b94726f) compile the muldiv guest
to fewer instructions, so it now runs in under 512 cycles and its padded
trace length halves. The golden-shape audit pinned 1024, which failed
CI's ZK job on every push since the branch could run CI again (from
179e7a605). With the CLI built without those two flags the old pins
pass, so the change is the fixture, not the protocol. At 512 the
BlindFold shape has 221 coefficient rows (was 227: one fewer committed
round in each of six cycle sumchecks); the other counts are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(field): bind the field-inline unit's modulus at guest boot

jolt-field's guest kernels range-check readouts against the selected
field's modulus, which assumes the tracer's field-inline unit computes in
that field. Nothing checked it: a BN254-selected guest traced under the
fp128 unit computed 3*5 in Fr as a wrong value that still read out
canonically, and returned it without error.

jolt_field::bind_field_inline_modulus accumulates the selected field's
modulus into a cleared field register and asserts zero, proving that the
unit's prime divides it and so equals it. jolt-sdk's std runtime calls it
once from __platform_bootstrap, before main; it is a no-op without a
selector. The same probe guest now fails at trace time
("FIELD_ASSERT_ZERO of nonzero field register 4"), and under the matching
unit it returns the right product.

Binding at boot keeps readouts free. Checking a static flag on every
readout cost the recursion guest 2.33M rows; this path costs nothing
measurable (78,892,856 rows, was 78,895,975). jolt-field has no no_std
build, so its kernels only run in std guests, and jolt-sdk takes jolt-field
under guest-std only, without its default BN254 field.
Fr::MODULUS_LIMBS and Fp128::MODULUS_LIMBS match a16z/jolt#1995's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(field,poly): keep signed_sum's accumulator safe from its iterator

- field_inline::signed_sum holds its partial sum in REG_ACC while it pulls
  terms, so an iterator that called dot (or any accumulating kernel)
  overwrote the sum. The accumulators are now marked lent until the
  readout; Fp128 dispatch then takes the software path for dot, dot_rows,
  weighted dot rows, sum_of_products, and a nested signed_sum. The guard
  costs about 9,000 rows on the recursion guest.
- sparse_mle_msb advanced its index past the final block, which overflowed
  for a run ending at index u128::MAX; it now returns after the last block.

* build(akita): repin to the reviewed LayerZero-Labs/akita#186-#190

The companion moves to recursion-integration 78d31e124: Akita main
401e7972 plus the review revisions of #186-#190.

- jolt-akita's config presets follow main's RingDimensionSchedule (#192).
- Akita's guest transcript is now spongefish's own Blake2b sponge over the
  inline digest adapter, so the jolt-akita test pinning the hand-written
  sponge and Blake2b::update_block_eager, which only that sponge used, are
  removed.
- specs/recursion-guest.md records a fresh proof at 79,348,402 rows.

* docs(recursion): record rows after merging main and the Akita review fixes

…
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.

3 participants