Skip to content

chore: sync main with a16z/jolt - #62

Closed
omibo wants to merge 161 commits into
mainfrom
codex/sync-upstream-main-20261117
Closed

omibo wants to merge 161 commits into
mainfrom
codex/sync-upstream-main-20261117

Conversation

@omibo

@omibo omibo commented Nov 17, 2026 •

Copy link
Copy Markdown

Synchronize this fork with a16z/jolt main at 1baa8f4 before opening the Akita dependency update against upstream.

This branch points directly to the fetched upstream commit. Direct fast-forward and GitHub's merge-upstream endpoint were both rejected because fork main requires a pull request, an independent approving review, and the two Socket Security checks.

0xAndoroid and others added 30 commits November 3, 2026 10:55
…2203)

* ci: add AI merge gate for verifier-safe core pull requests

Add one required check, ai-merge-gate, published by a dedicated GitHub App.
It passes on a writer's approval of the head, or, for a pull request written
or authorized by a core team member, when a CI classifier (GPT-6 Astra at
reasoning effort max) finds the change cannot change which proofs the verifier
accepts and an Astra Max review of the exact head found no issues.

The gate runs only default-branch code on issue_comment and workflow_run, reads
pull request bytes through the API as data, keeps its secrets in a
default-branch-only environment, and records paid verdicts as App check runs.
Every piece of evidence names the head, so a push voids it.

Rewrite ci-code-review as one review pass and add the verifier-classifier skill.
.github/ai-merge-gate.md holds the decision table and the admin setup; no
repository setting is changed here.

* ci: ground the AI merge gate in pinned source and fresh review state

- Give the classifier and the CI review the changed files in full and two
  read-only tools (read_file, search) over the pinned merge base and head,
  served from GitHub's archive of each commit and checked against its tree;
  oversized input fails closed, oversized answers return errors, and the last
  turn withholds the tools.
- Keep the gate check in progress while evaluating and re-read the pull
  request, comments, reviews, membership and permissions before publishing a
  pass, reusing the paid model results.
- Fail any pull request that changes the events workflow, even when approved;
  it is maintained with the off switch on.
- Protect all of .github/workflows/ and scripts/ci/ (the gate's import path)
  instead of a per-file list and a blanket .github/ rule.
- Follow GitHub's review state for human approvals instead of requiring an
  approval of the head commit.
- Reject a non-array findings value; document a local review command Codex
  accepts; add Contents read to the App and its token.

* ci: bind the AI merge gate's path guards to the evaluated commits

The pull request's file list follows its branch: a push and a revert during
an evaluation let it describe another commit with the same file count, and a
head that deleted the events workflow passed on a persisting approval.

Derive the changed paths, both names of a rename included, from the complete
tree listings of the pinned merge base and head, and use that one set for the
event-source row, the gate-input row and the changed files sent to the model.
A truncated listing fails closed; the diff count check stays.

Document the second review's accepted limits: the size bounds do not cap peak
memory, and a withdrawn authorization does not stop an already-requested CI
review before the final re-read fails the gate.

* ci: require head attestations and classify PR risk

* fix(ci): reject publishing-app review attestations

* ci: word the review attestation line in passive voice

The attestation check now accepts only:

This pull request #<number> has been reviewed at commit <full 40-char head SHA> using skill <skill name> and model <model name> with <effort> reasoning effort, and no issues were found.

The old first-person line no longer passes. The PR number, current-head SHA, nonempty skill,
model and effort fields, exact standalone-line match and attestation authority are unchanged.
The regex, the failure guidance, the test formatter and the three documented examples move together.

* docs(ci): let the review skill run the deepest review it can

The ci-code-review skill no longer prescribes a review method: the checklist, finding scores,
false-positive list, tone rules and complexity lens are gone. It asks for the deepest review
possible, encourages parallel subagents, points to CLAUDE.md for Jolt's invariants and rules,
and keeps the soundness and untrusted-input notes, the authority and sandbox limits, the
attestation rules and the post-one-review routine.

The local command switches from `codex exec review` to plain `codex exec`. In Codex CLI 0.162.0
the review subcommand runs the built-in review mode, which disables the multi_agent feature
(subagent tools) and supplies its own rubric (codex-rs/core/src/tasks/review.rs).

* ci: let the gate approve attested heads instead of publishing required checks

Merging into main now rests on GitHub's own approval rule. The gate approves
the exact current head as github-actions[bot] when a maintainer wrote or
authorized the pull request, the Pika App bot or a maintainer attested a
review of that head, the classifier put it at risk-1 through risk-3, it
changes no gate input and no maintainer or writer has a standing change
request. It never approves risk-4, dismisses only its own approvals when a
condition stops holding or an evaluation fails, and re-reads the head after
approving.

- Manage risk-1..4, needs-maintainer-review, merge-eligible and
  no-reviewer-assigned labels; drop needs-human-review.
- Bound the classifier: 20,000 output tokens and 150,000 counted input
  tokens per request, 4 tool turns, 2 attempts per head and 3 per pull
  request counted in the classifier comment before paying, 15 minutes per
  request, standard service tier.
- Use the workflow's GITHUB_TOKEN instead of a publishing App, the
  AI_MERGE_GATE_MAINTAINERS variable instead of a team, and the repository
  secret OPENAI_API_KEY; trust cached classifier results only from the
  gate's own default-branch runs.
- Remove the attestation-only job and check, and route review requests and
  assignments to the gate.

* fix(ci): approve only classified heads and withdraw on every gate exit

The gate no longer approves a head without a classifier result: the
path rule's risk-1 for scripts and docs only labels, since a script can
be a build input. A head whose classifier attempts are spent now needs
a person's approval.

Any failure after the gate script starts, including a failed write of
its own check run, removes merge-eligible and dismisses the gate's
approval before the original error is reported, each step attempted
independently.

Closing a pull request, or retargeting it away from main, now reaches
the gate through the events workflow and a resolver that also finds
closed and retargeted pull requests; the gate removes merge-eligible
and dismisses its approval, except on a merged pull request, which
keeps the approval that let it merge.

The guide now gives two price figures: the nominal $43.125 per pull
request from the gate's own count, which omits OpenAI's framing, and
the $416.25 ceiling that OpenAI's published context window and
long-context prices give.

* fix(ci): route each gate event to its own pull request

The events workflow's run name now carries its pull request number,
which the resolver reads from the workflow_run payload's display_title.
A closed or retargeted pull request is therefore evaluated itself and
loses the gate's approval and merge-eligible, even when its branch also
heads another pull request into main or a more recently updated one.
The resolver no longer reads the API, so its job keeps only Contents
read.

The guide now states that the $416.25 figure bounds the cost of
accepted requests only, assuming OpenAI does not bill requests it
rejects for exceeding the context window and that writers leave the
attempt ledger intact.

* ci: classify with GPT-6.1 Sol and accept only listed review models

- The classifier calls gpt-6.1-sol at reasoning effort xhigh. Every turn
  sends the same instructions, tools and a per-pull-request
  prompt_cache_key (repo#number), and the job log records each
  response's input, cache-read, cache-write and output token counts,
  naming any count a response leaves out.
- Review attestations must name GPT-6 Astra or Claude Opus 5.5 at max or
  xhigh effort; other models, efforts, aliases and case variants no
  longer count.
- CLAUDE.md (and AGENTS.md through its symlink) describes the merge
  paths and when a reviewer posts the attestation line.
- The gate guide recomputes the spend figures at gpt-6.1-sol prices
  ($8.625 nominal, $83.25 accepted-request bound per pull request) and
  records two local runs on pull request a16z#2231 that read 52% and 76% of
  their input tokens from OpenAI's prompt cache.

* fix(ci): bind merge-gate routing and cached verdicts to trusted inputs

* fix(ci): bind every event run to its exact pull request source

* ci: enforce maintainer authorship and deterministic gate risks

* ci: distinguish cfg attributes from conditional attributes

* ci: enforce effective risk limits and Rust line boundaries

* ci: isolate dependency bumps from review escalation
…16z#2174)

Point dory-pcs at a16z/dory#36, pinned by git rev until a dory-pcs release
includes it. ArkGT scaling there uses cyclotomic exponentiation, and the Dory
verifier's multi-term GT updates use the new PairingCurve::gt_msm, which
shares one cyclotomic squaring chain across all terms.

DoryScheme::combine uses gt_msm for the commitment combination, and
Bn254GT::scalar_mul/msm use cyclotomic_exp instead of Fq12::pow.

Cyclotomic arithmetic is valid only in the cyclotomic subgroup, so remove
Bn254GT's unchecked From<Fq12>, which had no callers. Every Bn254GT is now a
pairing output, a product of them, or subgroup-checked on deserialization.

Single-threaded verification of fib at 2^16 drops from 1.222B to 0.483B
instructions retired (Callgrind, -60%).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The RAM table holds word indices 0..ram_K, so ram_K must exceed the highest
word index a run touches. Two formulas fell one word short:

- The prover rounded the highest touched index itself up to a power of two.
  When that index is already a power of two, ram_K equals it and the table
  leaves that word out. It now rounds up from the index plus one.
- The verifier's maximum, compute_max_ram_k, counted total_bytes / 8 whole
  words. The tracer admits any access that starts below heap_end, so when
  heap_end - lowest_address is not a multiple of 8 a run may touch a partial
  last word that this count drops. It now uses total_bytes.div_ceil(8).

The two changes are needed together: with only the prover fix, a run that
touches the partial last word needs a ram_K above the verifier's maximum.

Addresses item 4 of a16z#1951.
…16z#2251)

* fix(ci): report human-needed gate outcomes as neutral

* fix(ci): narrow protected AI gate inputs

* fix(ci): classify prover risk by semantic reachability

* fix(ci): keep uncertain verifier-sensitive changes at risk four
JoltOneHotK256Direct inherited the committed source class of Akita's
default OneHot config instead of naming its chunk size, unlike the K=16
preset. Akita's default is 256 at the current pin, so behavior is
unchanged, but an Akita update that changes the default would silently
change the K=256 policy and its proofs. Name AKITA_ONE_HOT_K256 explicitly
and test that both presets keep 16 and 256.
* perf(kernels): initialize paired sums from their first value

* perf(field): seed iterator sums and products from the first item

`Sum` and `Product` for every `impl_ring_ops!` type folded from the
identity, so each call paid a `zero + x` reduction or `one * x`
multiplication the optimizer cannot elide. Seed from the first item and
keep the identity for empty iterators; the by-ref impls delegate to the
owned ones. Stored representations are canonical, so values are
unchanged.

The paired-gather visits go back to plain `.sum()`, which now carries
the saving this PR measured, and every other `Sum`/`Product` caller
(including rayon's per-split folds and combines) gets it too.

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

---------

Co-authored-by: Michael Zhu <mchl.zhu.96@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Bumps [bnjbvr/cargo-machete](https://github.com/bnjbvr/cargo-machete) from fb7ff0f4aa2a60cf75ab656d27f67d47d719b830 to 22eb7be1d0a498d00a4e5954fbf71ebfbd266a0c.
- [Release notes](https://github.com/bnjbvr/cargo-machete/releases)
- [Changelog](https://github.com/bnjbvr/cargo-machete/blob/main/CHANGELOG.md)
- [Commits](bnjbvr/cargo-machete@fb7ff0f...22eb7be)

---
updated-dependencies:
- dependency-name: bnjbvr/cargo-machete
  dependency-version: 22eb7be1d0a498d00a4e5954fbf71ebfbd266a0c
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#2298)

Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.87.32 to 2.89.1.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](taiki-e/install-action@5488ac5...682ce6c)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.89.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.51.1 to 1.52.0.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/main/CHANGELOG.md)
- [Commits](crate-ci/typos@7f9d081...4c8b7f5)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-version: 1.52.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [log](https://github.com/rust-lang/log) from 0.4.34 to 0.4.35.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/main/CHANGELOG.md)
- [Commits](rust-lang/log@0.4.34...v0.4.35)

---
updated-dependencies:
- dependency-name: log
  dependency-version: 0.4.35
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/actions-rust-lang/setup-rust-toolchain/releases)
- [Changelog](https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/CHANGELOG.md)
- [Commits](actions-rust-lang/setup-rust-toolchain@ecabd13...a188e68)

---
updated-dependencies:
- dependency-name: actions-rust-lang/setup-rust-toolchain
  dependency-version: 2.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.190 to 0.2.191.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.191/CHANGELOG.md)
- [Commits](rust-lang/libc@0.2.190...0.2.191)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.191
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 2.0.20 to 2.0.21.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](dtolnay/thiserror@2.0.20...2.0.21)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-version: 2.0.21
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(deps): bump sysinfo from 0.39.6 to 0.40.1

Bumps [sysinfo](https://github.com/GuillaumeGomez/sysinfo) from 0.39.6 to 0.40.1.
- [Changelog](https://github.com/GuillaumeGomez/sysinfo/blob/main/CHANGELOG.md)
- [Commits](GuillaumeGomez/sysinfo@v0.39.6...v0.40.1)

---
updated-dependencies:
- dependency-name: sysinfo
  dependency-version: 0.40.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(cli): handle fallible sysinfo system initialization

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Tretyakov <42178850+0xAndoroid@users.noreply.github.com>
* perf(akita): reconstruct directly from signed Montgomery residues

* docs(akita): state why signed Montgomery residues are centered

The reconstruct comment now gives the reason the direct residue is
already centered. Akita's signed reduction of a*1 is (a - t*p)/2^32,
where a and t are signed 32-bit words. NttPrime::new asserts p < 2^30,
so the intermediate fits in i64 and |z| < (p+1)/2. MontCoeff is now
imported through the akita_algebra crate-root re-export, matching
one_hot_ntt.rs.

The code change is the comment and the import only. The reconstruct
loop is unchanged.

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
* perf(akita): align commitment tasks to NTT reconstruction batches

* refactor(akita): absorb NTT schedule remainder into the last task

When the 252-position batch alignment caps a block's parts, cap at
floor(N/252) instead of ceil(N/252) and let the last part end at the
block end. This removes the short trailing task (for example [252, 256)
for N = 256) that paid for its own scratch, final flush and merge pass.
Every part still starts at a multiple of 252 and the parts cover the
block exactly once. For unaligned schedules the alignment divides N, so
part_range is unchanged there.

with_minimum_ring_alignment becomes with_ring_alignment, which asserts
the schedule is unaligned. The general form was only batch-aligned when
the old alignment divided 252. The NTT path aligns its schedule at the
call site, replacing an associated function that only supplied the
batch constant. The partition test now
checks the 252-aligned starts and the no-short-tail property.

The NTT accumulate/reconstruct loop in commit_part is unchanged. Only
the task partition differs: fewer tasks when the cap binds, and the last
task reconstructs one extra short batch.

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
* fix(akita): gate parallel-only I/O error imports

* perf(akita): vectorize bounded mixed challenge opening folds

* refactor(akita): share the byte reverse-convolution loop across coefficients

Collapse the four copies of the reverse-direction window loop in
try_add_byte_rows into one const-generic add_scaled_byte_windows::<SCALE>
dispatched by an explicit match on the admitted coefficients {-2, -1, 1, 2};
any other coefficient hits unreachable! instead of silently taking a +-1 arm.
Rename PreparedByteChallenge::weight to num_positions, and make the overflow
comment name both distinctness sources (hot < K shifts, validated challenge
positions) and which direction needs them.

Hot loop: the match is once per coefficient class, outside the window loops.
Each monomorphized instance is the same straight-line i8 loop as before, with
a constant multiplier (value * 2, value * -2, value, -value); the former
`-= value * 2` / `-= value` arms become `+= value * -2` / `+= value * -1`,
which are the same i8 values and fold to the same sub. Forward direction and
the i32 widening are untouched.

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
* perf(kernels): skip RAM gathers for all-cold row groups

* test(kernels): cover cold RAM groups through wider lazy binds

* refactor(kernels): move the RAM no-access group check onto RamAddresses

The all-no-access shortcut in RamAddressChunks::gather_pairs open-coded the
implicit no-access suffix rule of RamAddresses at the call site. Move it to
RamAddresses::no_access_in(range), which owns the suffix invariant and keeps
the release-mode bounds assert, and zero the output with out.fill.

Rename the extracted default body lazy_ra::gather_pairs to
gather_pairs_by_index so it no longer shares the trait method's name.

Hot path unchanged: the per-group guard is the same bounds assert, clipped
prefix slice and early-exit compare over at most 2w addresses (now an
#[inline] method), and the fallback is the same function under a new name.

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
…16z#2235)

* perf(kernels): retain instruction rows across address preparations

* refactor(kernels): document the instruction-row carry lifetime

SharedInstructionRows now states the carry protocol precisely, including
that for random-access witnesses the strong carry parked by stage 5 and the
stage-6a address preparations is released by the first InstructionCycleRow
::shared call (an optimized stage-6b cycle consumer, else the stage-7
Hamming-weight reduction). A registry with none of those consumers optimized
keeps the rows alive until KernelContext::finish. Production installs every
optimized consumer, and an optimized Hamming prepare already releases the
carry, so no release hook is added.

The booleanity module doc no longer describes the old take/clone/park
protocol; it points at SharedInstructionRows instead.

shared_for_next_consumer reuses or collects the rows and parks the strong
carry directly, instead of calling shared (which took the carry and parked a
weak one) and then parking strong again.

No kernel hot loop changes; only the two stage-6a address prepares' row
acquisition is touched (one fewer session take and weak park each).

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
…ables (a16z#2254)

* perf(kernels): pair instruction histogram updates

* perf(kernels): store paired histograms in contiguous tables

* refactor(kernels): bundle instruction histogram layout options

Store the chunk width and zero policy in the Digits variant, set once in
InstructionHistogram::new, so add and fold_into can no longer receive a
k_chunk or omit_zero that disagrees with the chosen layout. Pairs is only
built with zero buckets omitted and 16-bucket digits, so its scatter passes
the constants PAIR_BUCKETS and true and its fold starts at digit 1. Name the
16/256 pair constants and state the block-size threshold.

Hot loop: the Pairs scatter runs the same add_instruction_digits code on the
same Vec<[F::SumAccumulator; 256]> tables, now with a compile-time true in
place of the runtime omit_zero flag (always true there). The Digits scatter
reads k_chunk and omit_zero from the variant, next to the bucket vector
header it already reads, instead of from closure captures. Storage,
allocation, arithmetic and parallel granularity are unchanged.

Factor the dense equality oracle out of the tensor test and add an Akita test
that drives the paired layout through pushforwards on a 2^20-row trace
(empty, one-block and partial-block prefixes).

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
…6z#2244)

* perf(kernels): apply folded Spartan B coefficients to native rows

* perf(kernels): avoid unused B construction in transposed folds

* docs(kernels): place accumulator rationale beside scalar products

* style(kernels): import Spartan variable constants directly

* test(kernels): follow module assertion lint convention

* refactor(kernels): fail loudly on unsupported Spartan B columns

PreparedBFolds::new now returns Result and reports an InvariantViolation
when the canonical B matrix puts nonzero weight on a column the native
fold does not read. OuterRemainderKernel::prepare propagates it with `?`
and the unreachable group_values()/fold_b() fallback arm is deleted in
non-field-inline builds. Field-inline builds keep their separate
group_values path (b_folds is not compiled there), unchanged.

The second-group weights are split into SECOND_WORD_COLUMNS (7 u64
columns) and SECOND_WIDE_COLUMNS (4 signed/128-bit columns), and fold
zips each weight array with its value array, as the first group already
did, instead of gathering by literal indices into an 11-entry table. The
negated-weight table shrinks from 11 to the 4 entries that use it.

Hot loop: same fmadd_u64/fmadd_s256 calls, same zero skips, same term
order, same accumulators and reductions, no new allocation or dispatch;
only the weight lookup changes from constant-index loads to fixed-length
zips. #[inline(never)] on fold is kept as is.

The oracle test now asserts is_err() for an unsupported column and adds
rows with wide columns at the zero, u64::MAX and 2^64 boundaries.

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
* perf(kernels): fit symmetric Booleanity tables within small trace budgets

* refactor(kernels): share the Booleanity categorical budget inputs

prove_round tried the full and triangular categorical layouts with two
copies of the same guarded fits/build/lookup block. Check for tables once
and hoist the address count and cycle count both budget checks use; each
layout is now a fits-then-lookup arm. Layout precedence, CategoricalProducts
and its lookup loop are unchanged.

Add kernel parity tests at log_t = 12 and 13. Round 0 there caches with the
triangular and the full table respectively, so the production
BooleanityChunks visitor reaches both layouts against the reference tier.

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
* perf(kernels): pair instruction virtualization branch gathers

* refactor(kernels): give paired lo/hi gathers one owner in lazy_ra

Booleanity's `PairedLoHi` and instruction RA virtualization's
`PairedInstructionGather` were the same struct, width enum, width
dispatch and amortization rule (one paired entry per 16 live rows), the
latter with the threshold as a bare literal. Move one generic
`PairedLoHi<F, S: ChunkIndexSource>` and `MIN_ROWS_PER_CACHED_VALUE`
into `lazy_ra::paired` next to `PairedBranchTables`, reached through
`LazyFoldedRa::paired_lo_hi(columns)`, which owns the eligibility rule:
single-factor lazy set, width 4 or 8, every table of 16-address
branches, and entries(width) <= constant_suffix_start / 16.

The per-source digit walk moves into the trait: `visit_paired_values(row)`
becomes `visit_paired_branches::<F, BRANCHES>(start)`, and the
`LookupIndexChunks` and `BooleanityChunks` overrides take any branch
count. Materialization calls it with 16 branches. Both keep their
runtime four-bit check: table length alone does not pin the source's
chunk width (2-bit sources reach the 16-branch materialization), so
non-four-bit sources still take `visit_indexed`. `PAIRED_MATERIALIZE_BRANCHES` becomes
private to lazy_ra.

Hot loops: `PairedLoHi::gather` compiles to the same per-row work as
both deleted copies -- the same width match, `gather_width::<W>`
monomorphized per width, and per side the source's `#[inline(always)]`
override calling `visit_four_bit::<W>` (plus `visit_indexed` over the
non-instruction columns for Booleanity) with the same closures. No dyn,
allocation or extra per-row branch. The only arithmetic change is in
Booleanity's 16-branch materialization, which now applies the
(always-zero there) instruction-digit skip shift that its prove_round
path already applied.

The multilinear unit tests move with their owners: the
`LookupIndexChunks` one to `lazy_ra::paired`, the `BooleanityChunks`
one to `booleanity::bulk`.

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
* perf(kernels): specialize packed chunk gathers

* test(kernels): format packed-gather seed literal

* refactor(kernels): pass packed chunk width as an inlined argument

Replace the `const BITS` parameter, whose 0 meant "use the runtime
width", with an ordinary `bits` argument on an `#[inline(always)]`
helper. The 4- and 16-bit arms still pass literals, so each inlined copy
shifts by an immediate; the fallback arm passes the runtime width. No
value sentinel stands for the runtime case.

Delete `packed_chunk_pairs_match_dense_binding`: it restated the selector
digit formula and the branch eq-weight layout by hand, and every dispatch
arm is already checked against the reference tier (ReadRaf
parity_default_geometry and constant_suffix_rounds_match_reference for
16-bit, parity_virtual_chunk_widths_across_dense_switch for the fallback,
RA-virtualization parity_production_geometry and
parity_categorical_quartics for 4-bit).

---------

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
…6z#2220)

* feat(akita): add deferred setup recursion and SHA2-chain benchmark

Pin Akita external setup accumulation at 953129576 and connect Jolt's opening verifier to inherited setup claims. Embed prepared verifier material and retain a reusable two-proof SHA2-chain cycle benchmark with per-inner accounting and no outer proving.

* fix(ci): refresh recursion inventories and proof setup

* fix(akita): pin verifier optimizations and reproduce committed recursion

* refactor: pass backend verification contexts through PCS

* perf(field): use the shared signed-sum implementation

* refactor(akita): reuse prepared setup domains

* refactor(host): keep recursion build settings in examples

Restore the upstream host API and configure guest linker limits and execution memory in the recursion examples. Register the transcript hash inlines, route the saved bundle through untrusted advice, and check zero-padded guest output.

Validate native Check/Defer replay and the complete saved outer verifier: 962,012,241 cycles with an identical guest ELF and public statement. Update the recorded cycle breakdown.

* chore(ci): restore upstream HOL Light setup

* Remove experiment-specific schedule generator flags

* build: update Akita to merged main and refresh schedules

* fix: address Akita recursion review feedback

---------

Co-authored-by: Codex <codex@openai.com>
Acentelles and others added 19 commits November 16, 2026 15:42
…a16z#2455)

A verifier that runs as a guest pays one trace row per instruction. Two
places on its path spent more rows than the work needs:

- Fp128 deserialization assembled a 16-byte array and then the element.
  It now assembles two 64-bit words while the bytes arrive. The wire
  format, the canonical check and the error order are unchanged; the
  serializer is the same code as before, written next to the decoder.
- Fp128::mul_add on a field-instruction guest ran in software limb
  arithmetic (widening multiply, add, reduction), although the multiply
  alone already has a field instruction. It now loads the three
  operands, multiplies and adds in the field registers and reads out
  only the sum. Host builds and other fields are untouched.

The recursion example's guest kernel check gains multiply-add cases,
compared with native arithmetic and with the guest's own multiply then
add, including inside a signed-sum iterator. A host test compares the
decoder with the byte encoding on boundary, single-bit and random
values, and its errors on non-canonical values and short inputs.
…2475)

CLAUDE.md's review section links the existing Comments and Tests rules as a standing review check. The ci-code-review skill gains a step that lists each bloat instance with its file:line as a finding to fix before merge, on fork pull requests too.
* Close the in-place binds' block gaps and release dense tables on the pool

Two copies ran on the calling thread while the pool idled, about 0.4 s
of a 26 s CPU-only proof at 2^27 cycles.

The in-place sparse binds compact 16K-entry blocks in parallel and then
closed the gaps between them with one copy_within per block, in order,
over nearly the whole table every round. A run lands on storage earlier
runs occupied, so the order matters, but every run whose destination
ends before the first unmoved run starts can move at once; the gap ahead
of a run grows with the runs behind it, so close_block_gaps moves the
runs in batches that grow geometrically and copies each large batch
across the pool.

bind_prefix_waves shrinks a dense table once its capacity is eight times
its length. The allocator moves such a table by copying it, on the
calling thread; tables of 2^18 values or more are now copied into a
fitted allocation across the pool.

CPU-only Fibonacci, chrome profile: stage 4 1.86 -> 1.77 s, stage 6b
5.74 -> 5.66 s, proof 25.93 -> 25.59 s.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix(jolt-poly): release dense tables with shrink_to_fit again

The review of a16z#2457 tested the premise of release_capacity: that an
allocator moves a table shrunk to an eighth of its allocation and copies
it on the calling thread. A probe of 24 cases (three element layouts,
2^18 to 2^24 values, main thread and pool thread) found that
shrink_to_fit moved the table in 0 of 24 on Linux glibc 2.43 and in 0 of
24 on macOS 27.0.1 system malloc. The pool release therefore replaced no
copy: it added a copy of the live table and a second buffer.

dense.rs is back to main's version. The gap closing in the sparse binds
is unchanged in code.

The review's comment pass over ops.rs is applied: five comment lines
that restated a name or a helper body, or gave a performance rationale
that does not hold for small tables, are cut, and the test comment that
claimed pool batches for three cases now sits on the one case that forms
one. The test helper's parameters are renamed to block_len and live_len
in place of its doc comment.

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Andrew Tretyakov <42178850+0xAndoroid@users.noreply.github.com>
…16z#2467)

* perf(kernels): fold the RAM address column over cycles on the pool

fold_cycles filled a 2^20-entry window of eq values on the pool and then
added them into the K-entry result on the calling thread, one access at a
time, so RamRafEvaluation::prepare waited on one core for a pass over the
whole trace. The cycles now split into one part per pool thread; each part
multiplies eq factors only for its cycles with an access and adds into a
K-entry sum of its own, and the sums are added at the end.

Memory: the part sums beside the result are capped at 256 MiB (eight at
K = 2^21, where the old window took 16 MiB); a larger address space takes
fewer parts, down to one walk.

B-Tree, 2^27 cycles (K = 2^21), CPU backend, M5 Max, profiled on a branch
carrying this change with other work: RamRafEvaluation::prepare
125-129 ms at 5.5 busy cores -> 27-30 ms at 9.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* docs(kernels): cut cycle-fold comments that restate the code

Remove the doc lines on `fold_cycles` and on
`cycle_fold_matches_the_eq_table_across_parts` that narrate the split and
the assertion. The byte bound stays documented on
`FOLD_CYCLES_PART_BYTES`.

`RamReadWriteBytes::new` listed RAF's fold staging among the transients
the memory budget does not count. That vector is gone; the part tables
are the transient now.

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Andrew Tretyakov <42178850+0xAndoroid@users.noreply.github.com>
… values (a16z#2458)

* Leave room for the commitment's padding in the increment values

The fused increment values were collected into a vector of exactly the
trace's length. Akita pads a bounded object to a multiple of its largest
ring dimension, so a trace that ends short of one (134217720 rows of
2^27) grew the vector and reallocated it: 2 GB copied on one thread,
245 ms before the increment commitment could start. The vector now has
capacity for up to 4096 more values, inside the domain.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* perf(akita): reserve commitment padding in the full-width object copy

Review of a16z#2458 found the reallocation it removes for the fused
increments still present on the field-inline `FieldRdInc` commitment.
`AkitaScheme::commit_full_width_object` copied the dense evaluation
prefix with `to_vec`, so the copy's capacity equaled its length, and
Akita's `DensePoly::from_field_prefix` then padded it to a multiple of
the largest supported commitment ring dimension (2048 at the pinned
revision), reallocating every prefix whose length is not such a
multiple. The copy now reserves the padded length.

Only the copy's capacity changes. A probe that commits 14 prefix shapes
in a 2^14 domain gives byte-identical serialized commitments before and
after, each equal to the commitment of the same values as a full table,
and no growing reallocation of the copy after.

Comments, from the same review: the call-site comment in
`commit_fused_inc` goes, and the `PADDING_ROOM` doc names the Akita
padding the room is for. The figure the removed comment gave, two
gigabytes copied on one thread at 2^27 cycles, was sampled on macOS;
glibc grows a block of that size with `mremap`, without copying it.

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Andrew Tretyakov <42178850+0xAndoroid@users.noreply.github.com>
…6z#2479)

parse_diff kept the TAB git writes after a path that holds a space, left
a quoted path quoted when that TAB followed it, decoded octal escapes one
byte at a time, and split lines at every Unicode line boundary. The diff
classifier therefore counted a Rust file named `src/a b.rs` under helper
scripts, and a changed line holding a form feed followed by `+` made the
AI merge gate report an incomplete diff.

The parser now ends an unquoted path at the TAB, decodes a quoted path's
escapes as UTF-8 bytes, and splits lines at LF only.
…d arithmetic (a16z#2474)

* docs(akita): cite the Akita pin from Cargo.toml instead of a stale hash

* docs(book): state that the Akita build enables jolt-field asm and uses the shared Fp128 type

* docs(book): state that the Akita builds enable asm in the field-kernels introduction
…2480)

A fork's pull_request token cannot write a comment, so fork pull requests
only got the classification in the job summary. The sticky comment now comes
from a workflow_run workflow that runs default-branch code: a read-only job
re-reads the pull request from the API, fetches its head as git objects and
classifies them without checking them out, and a second job, the only one
with pull-request write, posts the rendered counts. diff-classifier.yml keeps
the job summary and drops its comment step and write permission, so same-repo
and fork pull requests share one comment path.
Port of a16z#2457's gap closing to the streaming RAM family.

`bind_groups_in_place` binds runs of whole key groups in parallel, then
moved every run's output down with one `copy_within` per run on the
calling thread. It now hands the runs' live prefixes to
`close_block_gaps` in 16K-entry blocks, which moves a batch of 4 MiB or
more across the pool.

The blocks are cut inside the key runs because a run is
1 / (8 x pool threads) of the table: with whole runs as blocks, a bind
that keeps 99% of its entries would still move every run on the calling
thread.
…ion docs (a16z#2477)

* docs(jolt-algebra): cut restating comments and correct two stale passages

Follow-up to a16z#2455, whose merged diff was checked for comment bloat
after the merge. Comments and docs only; no code or test changes.

- Cut three comments that restate the code beside them: the doc of the
  `out_add_a` emitter and two lines narrating assertions in
  `fp128_serde_decodes_canonical_byte_tuples_only`.
- `word_decode.rs` module doc: say why `Fp128` does not use
  `impl_serde_bytes!` (fewer guest rows) instead of restating the file.
- `CanonicalEncoding` doc: `Fp128`'s decoder calls `from_u128_checked`,
  the check its `from_bytes_le_checked` calls, not
  `from_bytes_le_checked` itself.
- `specs/recursion-guest.md`: list multiply-adds among the operations
  the routed field runs through field-inline instructions.

* docs(recursion): say the field-kernel check is run by hand, not in CI

The recursion README said CI runs `check-field-kernels` in both builds.
No workflow has run it since a16z#2242 removed the recursion guest verdicts
job from rust.yml, so the sentence now tells the reader to run it by
hand.

* docs(recursion): correct two stale statements in the guest spec

specs/recursion-guest.md, "Levers not taken here": the proof field
decoding bullet described the decoder that a16z#2455 replaced (a `[u8; 16]`
buffer, about 100 rows per element) and said any faster path changes
the bincode wire format. Since a16z#2455 the decoder assembles two 64-bit
words from the same 16 bytes, with the same wire format. The bullet now
states that, and names the remaining lever exactly: decoding an element
as `u64`/`u128` integers or as a byte string, which bincode's standard
configuration encodes differently. No per-element row count is given,
because none has been measured for the current decoder.

Same file, "Reproduction": the spec said CI runs the flow and the
tampered-opening rejection. No workflow has run the recursion example
since a16z#2242 removed its job, so the sentence now says both are run by
hand.
…de flag classes directly (a16z#2439)

* perf(verifier): reuse instruction-read public values and index bytecode flag classes directly

* refactor(verifier): make evaluate_output_expression a free function and cut restating comments

- `evaluate_output_expression` moves from a provided `ConcreteSumcheck`
  method to a crate-private `#[inline]` free function with the same
  body, so a relation cannot override it and the "Not meant to be
  overridden" note goes.
- The `instruction_read_raf` test module carries one
  `#[expect(clippy::unwrap_used)]` in place of one per test.
- The `FlagClasses` doc drops the sentence that restated `new` and
  `index`.
- The comment on the weighted inputs of the read-RAF output test states
  why they are chosen.

No behavior change.

---------

Co-authored-by: Andrew Tretyakov <42178850+0xAndoroid@users.noreply.github.com>
* build: add justfile

Recipes give short names to the format, lint and test commands that rust.yml and the docs already use; CI does not call just. The Clippy recipes pass -D warnings to Clippy rather than through RUSTFLAGS, which denies the same lints while every path package is a workspace member.

* build: run both machete modes and quote the e2e-matrix feature set

The machete job runs cargo-machete in its action step before cargo machete --with-metadata, and the two modes disagree on a dependency whose library name differs from its package name. e2e-matrix now reads its parameter as "$1" so a space-separated feature list stays one argument.

* build: deny warnings in the Clippy recipes through RUSTFLAGS, as rust.yml does

Passing -- -D warnings kept a contributor's own rustflags, which CI replaces. With -C target-cpu=native in build.rustflags the recipes linted different cfg(target_feature) code than the clippy job, so they could pass where CI fails and the reverse.
…6z#2418)

* fix(program): enforce memory layout and ELF admission checks

* fix(tracer): align native backing and guest-read bounds

Port dbd1978, 95cf8d0 and f78f878 without protected-store, flag-word or general low-load rules. Preserve logical bounds while rounding native backing and checkpoint images to whole doublewords. Check each device-load byte against io_end and propagate bounded host-read failures.

Retain this branch’s JoltDevice APIs, fast_run entry point and RAM-relative final-memory convention. Exercise the final partial heap word at offset 1160 with heap_size 8: offset 1152 with zero heap remains inside the existing canary and cannot succeed without changing excluded store rules. Omit the interpreter host-read underflow case until the general low-load guard is ported.

Validation: cargo fmt --all -- --check; workspace host clippy; x86_64-unknown-linux-gnu tracer clippy; all 180 tracer nextest tests. Native runtime tests require x86 Linux.

* fix(tracer): treat panic and termination words as plain memory

* test(kernels): store the termination word in the output-check fixture

* test(memory): complete plain flag-word fixture coverage

Store the final termination word explicitly in the field-inline prover fixture and port the public-I/O mask test from FINAL.

* fix(tracer): preserve protected memory words across execution backends

* fix(tracer): preserve host-read parity before low-load guards

* docs(program): describe stored flag bytes in memory images

* fix(tracer): reject host-call reads below mapped memory

* fix(program): share source-word intervals with ELF admission

* Drop the plain flag-word contract from a16z#2417

Halt instructions replace the plain flag-word contract, and the halt work
keeps main's panic latch, flag words, ValIo segments and witness synthesis.
Revert FlagWords, InvalidFlagWords, JoltDeviceMemory, the absolute-address
final memory image, the canonical SDK flag-pair stores, and their tests,
fixtures and docs to a16z#2416's text.

What stays: the fallible tracer plumbing (try_trace, and finish_emulator
returning Result), JoltDevice::is_output ending at output_end, and the x86
run_machine entry point for the ACT4 runner.

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

* Add the jolt.success and Panic halt instructions

Introduce Jolt's halt instructions on unchanged constraints:

- jolt-riscv: JOLT_SUCCESS_WORD (0x0000_305B, `.insn i 0x5B, 3, x0, x0, 0`)
  and two source/final kinds, JoltSuccess => Success ("jolt.success", tag
  0x00a8) and JoltPanic => Panic ("jolt.panic", tag 0x00a9). Both carry only
  the Jump circuit flag, no instruction flags, have side effects and target
  ControlFlow.
- jolt-lookup-tables: both kinds are table-free (lookup output 0, so their
  jump targets address 0, where only padding sits). A registry test pins
  that exactly the halts are table-free jumps.
- jolt-program: the image decoder accepts jolt.success with I-type operands
  and rejects every other funct3-3 custom-2 word; EBREAK lowers to one Panic
  row that links into a temporary instead of `JAL discard, 0`. The three
  EBREAK expansion goldens are re-blessed.
- tracer: Cpu gains `halted: Option<HaltKind>` (captured, installed and
  compared with chunk state), `Cpu::halt` writes the link and halts in
  place, and a tick after a halt is a no-op. The JoltSuccess/JoltPanic
  instructions and EBREAK's direct exec use it. The halt tick also sets the
  stall flag, so drivers that still stop on stalls stop at halts.
- jolt-tracer-x86: ExitReason::Terminated is renamed Stalled (value 1) and
  HaltedSuccess (7) and HaltedPanic (8) are appended; the JIT emits halt
  rows that write their link and exit in place. check_exit accepts the
  halts exactly as it accepts a stall until the drivers require a halt.
- jolt-claims: R1CS witness tests show a final halt row satisfies the
  unchanged constraints and a halt cannot be followed by a real row.

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

* End guests at jolt.success and ebreak

SDK and platform:
- The #[jolt::provable] epilogue writes the outputs and the termination
  byte, then executes jolt.success (`.insn i 0x5B, 3, x0, x0, 0`) instead
  of spinning in `j .`.
- jolt_panic writes the panic byte and halts at ebreak (it now diverges);
  __platform_abort calls it.
- __platform_exit, jolt_platform::platform_exit and the std trap
  handler's fallback execute ebreak for every code. The trap handler no
  longer steps past a trapping EBREAK: EBREAK never traps in Jolt.
- Exit-style paths that write no panic byte (std::process::exit,
  __platform_exit, the trap fallback) stay unprovable, as on main: the
  witness still synthesizes termination = 1 for a non-panic claim.

Guests and e2e harness:
- The memory-ops guest gains two entries: exact_rows, a no-op sled whose
  run length is affine in its input, and panic_halt.
- A halt cannot be followed by a real row, so the harness no longer fills
  a full-domain case by repeating its final `j .`. The exact_domain case
  replaces muldiv_full_domain and field_ops_full_domain: it runs
  exact_rows padded so the run fills 2^12 rows, which is Akita's padding
  floor and above Dory's, so the proof has no padding row and the halt
  sits at T-1. The harness asserts that such a case fills its domain
  exactly.
- panic_halt proves a guest panic with panic = true, in both profiles.
- Every case asserts its panic flag and that its run ends at the
  expected halt (JoltSuccess, or JoltPanic for a panic).

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

* Require Jolt runs to end at a halt

A Jolt run now ends only at a halt instruction: jolt.success, or ebreak,
Jolt's failure halt. A run that stops anywhere else, such as a `j .` or
other PC stall, fails with the new TraceError::EndedWithoutHalt { pc }.
Constraints, layout, the device panic latch and witness synthesis are
unchanged.

tracer:
- finish_emulator, shared by the eager, execute-only, parallel and
  chunked paths, returns EndedWithoutHalt unless the hart halted. It
  logs a panic halt with the guest backtrace, keyed on HaltKind::Panic
  rather than the device latch. The infallible trace/execute wrappers
  and the lazy iterator panic with that error.
- Every driver stops at a halt, a PC stall, or a zero-row tick.
  `execute` now also stops on a zero-row tick, as `trace` does.
  LazyTracer::has_panicked reports a Panic halt. HaltKind is re-exported.
- Emulator::run_test returns 0 for jolt.success and PANIC_HALT_ENDCODE
  (1) for an ebreak halt, so jolt-emu and `jolt run` exit 1 for an
  abnormal end. HTIF tohost handling and bare stalls are unchanged.

jolt-tracer-x86:
- check_exit returns a MachineExit (a halt kind or a stall PC). Jolt
  paths (fast_run, record, chunked execute and replay) call
  require_halt. run_machine still accepts a stall for the ACT4 runner.
- The harness terminal row is a jolt.success halt that links into x0.
  ExitReason is re-exported for tests, which now name exit reasons
  instead of using raw numbers.

Tests cover the halt state and link at the CPU level, every TracerBackend
driver with each halt and with both stall shapes, run_test's halt
endcodes, run_machine against fast_run, a JIT-versus-interpreter
differential for both halt rows, and a real panicking guest
(memory-ops panic_halt) through the x86 fast and record paths.

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

* Document halt instructions

- specs/m-mode-trap-csr-semantics.md: EBREAK and c.ebreak lower to one
  Panic row, Jolt's failure halt; a run ends successfully only at
  jolt.success. The Debug-Mode argument stays; the SDK's panic, abort
  and exit paths end at EBREAK.
- book emulation page: EBREAK is the failure halt and jolt.success the
  success halt; the tracer rejects a run that stops anywhere else.
- book guests page: foreign toolchains end a run with the termination
  byte and jolt.success, or the panic byte and ebreak.
- specs/x86-tracer-backend.md: Jolt runs end at halt rows
  (HaltedSuccess/HaltedPanic); PC stalls exit with Stalled, which the
  Jolt paths reject with EndedWithoutHalt and run_machine, used by the
  ACT4 runner, accepts.
- book testing-gates page: the exact_domain and panic_halt cases, the
  halt check, and the new case counts.

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

* Update CLAUDE.md e2e matrix case lists

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

* Say where the end-at-a-halt rule is enforced

These texts described the halt rule as a property of every Jolt run, or
still described the old self-jump exit:

- specs/m-mode-trap-csr-semantics.md said a run ends successfully only
  at jolt.success. The tracers stop at either halt, but the proved
  claim does not depend on which one ends the run: the constraints
  accept any final jump, and the public panic bit comes from the panic
  and termination words that ValIo binds. Say so.
- JoltInstructionRow::self_jump_repeats said a run that stops at the
  PC-stall fixed point "is rejected"; name the tracers and their
  TraceError::EndedWithoutHalt.
- ProverError::TraceDoesNotEndInJump told users that only a jump to
  itself ends a provable trace, the exit every tracer now rejects. The
  variant and its check stay: the halt rows carry the jump flag.

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

* Fail a jolt-emu run that stalls without a halt

Emulator::run_test, which jolt-emu and therefore `jolt run` use, still
reported a PC stall in an ELF without a `tohost` symbol as a success.
Every riscv-tests and ACT4 ELF defines `tohost`, so only a Jolt guest
reaches that branch, and a Jolt run must end at a halt: a guest built
by an older SDK or a foreign toolchain that ends at `j .` passed
`jolt run` and then failed to trace.

Such a stall now logs TraceError::EndedWithoutHalt and returns the
nonzero ENDED_WITHOUT_HALT_ENDCODE. A test ELF that spins with `tohost`
untouched still returns 0. The tohost probe after each tick now runs
only for test ELFs; without `tohost` it read address 0, which only the
JoltDevice jolt-emu installs happened to serve.

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

* Annotate the expect calls in trace and execute

Both infallible entry points panic through .expect when a run does not
end at a halt. Give each the #[expect(clippy::expect_used)] the lint
policy asks for, with the reason, as finish_emulator already has.

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

* Test stall rejection on the lazy iterator and x86 chunked execute

Two drivers enforce the end-at-a-halt rule in their own code, and no
test reached either check: CheckpointingTracer::lazy_step_cycle, the
only guard for trace_lazy, trace_to_file and trace_checkpoints, and the
x86 backend's chunked execute. jolt_runs_end_at_halts now also drains
trace_lazy on each stall program and requires the EndedWithoutHalt
panic, and chunked_execute_rejects_a_stall runs a BEQ x0, x0, 0 program
through the x86 chunked execute. Deleting either check fails its test.

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

* Check that the panic_halt equivalence guests panic

The panic_halt equivalence tests compared the x86 backend with the
reference interpreter but never checked that the guest panicked. Had
`trigger` decoded as false, both runs would end at jolt.success and
agree, and the tests would pass without running the JIT's panic halt.

Both helpers now take the expected panic flag and check the reference
run against it; record mode also checks that the reference run ends at
the matching halt row.

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

* Drop a duplicate halt R1CS test

halt_rejects_a_real_successor writes ShouldJump and a nonzero
NextUnexpandedPC by hand and expects row 14 to fail, which
jal_rejects_fall_through_next_pc and
last_row_rejects_final_jump_that_still_claims_to_jump already check.
Its LookupOutput of 0 is the witness default, not a halt table's
output, so it cannot notice a halt that gains a lookup table
(table_free_jumps_are_exactly_the_halts pins that), and a halt that
loses Jump already fails last_row_accepts_final_halt.

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

* Adopt a16z#2416's pushed host-call tests

Take the host-call bound tests as a16z#2416 now has them (a VirtualHostIO
row in both tracers, `advice_write_follows_guest_load_bounds`) and
expect the success halt the x86 harness now ends each program with.

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

* test(tracer-x86): ignore host-call reads below the lowest mapped word

Add a range that starts below lowest_address to the native print test,
which must print nothing for it, and to the VirtualHostIO instances that
diff_host_io runs through both backends.

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

* docs(memory): state how host calls treat addresses below lowest_address

The tracer memory guard sections say guest loads below lowest_address
fault but did not say what a host call does with such a buffer. Host
calls never stop the run: both tracers check the buffer with
identity_loads_succeed and log and ignore a call that a guest load would
reject.

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

* fix(tracer): name stack_size in canary store errors

The protected-store check that replaced the StackCanary fault dropped
its hint. A value-changing store into the stack canary now tells the
user, in both tracers, to increase stack_size in MemoryConfig and gives
its current value, as the old fault did.

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

* docs(memory): describe value-preserving store guards in the m-mode spec and guest guide

The m-mode spec still described the stack-canary guard this branch
replaced: every store into the canary panicked, so a failed SC's
write-back did too. The tracers now reject only stores that change a
byte of a doubleword holding a source instruction or overlapping the
canary, so a failed SC passes everywhere. Name that guard in the LR/SC
section and in the tracer-panic lists, and note that code stores are
not yet constraint-checked.

The guest guide said a self-modifying guest can still produce a valid
proof; the honest tracers now refuse to trace it.

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

* docs(memory): say the tracer faults on carrying accesses below lowest_address

The byte-addressable spec's Tier 1 note and constraint 0's NOTE in
rv64.rs still said the tracer reads loads below lowest_address as 0.
This branch makes those loads fault, so a carrying access faults in
every case. The rv64.rs comment takes a16z#2408's wording.

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

* refactor(tracer): drop the dead store clause from the low-load fault

address_fault exempted stores at or below RAM_START_ADDRESS - 8 from
the I/O-underflow fault, which reads as if stores just above that bound
still underflow. MemoryLayout::try_new pads at least two I/O words, so
lowest_address <= RAM_START_ADDRESS - 16 and the clause always equals
!is_write. Say that directly; stores below lowest_address still fail
as unmapped device stores.

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

* refactor(tracer): drop two redundant device lookups behind unchecked expects

create_emulator read lowest_address back out of the MMU through an
expect after moving the device in; read it from the local device
before the move instead. Its two remaining expects (ELF decoding and
code-word intervals) are its contract, like the input-size asserts, so
annotate them with #[expect(clippy::expect_used)].

assert_write_protected_store re-borrowed the device with unwrap() on
each touched word after an outer let-else had already checked it. Keep
one let-else inside the loop instead, which the per-word load still
needs because it takes &mut self.

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

* test(tracer): say why a store below the I/O region is an unmapped-device fault

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

* Check I/O lengths against the rounded layout and align heap_end

Build the checked layout first and compare trusted advice, untrusted advice
and input lengths with the layout's rounded capacities, in the tracer and in
the native x86 tracer. The rounded size is the effective maximum: the
verifier already checks lengths against it, and the SDK now slices the I/O
regions by it.

Round heap_end up to a doubleword in MemoryLayout::try_new, matching the
linker's 8-aligned __heap_end, and reject an unaligned heap_end at admission.

Add e2e cases for 16 bytes of advice under a 12-byte maximum and for a store
to the last heap byte.

* Expect a doubleword-aligned heap_end in the last-heap-word tests

The layout now rounds heap_end up to a doubleword, so with a 1025-byte
program the heap ends at RAM_START + 1168 instead of 1161. The interpreter
and native tests now accept stores to the whole last word and reject the
next two doublewords.

* Fault on loads at io_end in both tracers

The padding between io_end and RAM_START_ADDRESS is unmapped, but the
interpreter and the native x86 helper only faulted on loads above io_end,
so a load at exactly io_end succeeded and returned zero. Both now fault on
any access at or above io_end below DRAM, which matches the unmapped-word
mask the RAM read-write relation applies from io_end.

* Move the rounded-advice entry point into the memory-ops guest

The advice-consumer guest is built without a function name by the verifier
and Akita tests, so a second provable function there emits a second main.
memory-ops already holds several guest_only entry points selected by name.

* Import UntrustedAdvice in the memory-ops guest

* Scope the memory-ops guest helpers to the entry points that use them

A guest build compiles only the guest_only entry point that JOLT_FUNC_NAME
selects, so with -D warnings the heap_top, rounded_advice and memory_ops
builds failed on unused items. Import asm inside the two functions that use
it, declare the linker's layout symbol inside heap_top, make Scratch public
so the builds that skip its users do not see dead code, and drop guest_only
from rounded_advice, which compiles on the host.

* docs(guests): name the jolt.success halt in the foreign-toolchain environment

The foreign-toolchain intro called the guest environment plain RV64IMAC
with a halt-instruction exit, but a successful run ends at jolt.success,
Jolt's custom-2 instruction (opcode 0x5B), which is not RV64IMAC. Name it,
and ebreak for a failed run, as the "Ending the run" bullet below does.

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

* docs(tracer): give the io_end fault a tracer-local reason

The comment above the interpreter's `ea >= io_end` fault justified it by
the RAM read-write relation's unmapped-word mask, which this branch does
not have: that mask arrives with a16z#2408. State the tracer's own reason
instead, so the comment does not describe a tracer-only guard as
constraint-enforced.

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

* test(tracer-x86): fault device stores below lowest_address and at or above io_end

slow_store_doubleword's two device-store faults had no test. A store
below lowest_address reported "I/O underflow: Attempted to write to",
while the interpreter sends the same store to AddressFault::UnmappedDevice
("Illegal device store: Unknown memory mapping: ..."), because only loads
there are underflows. Use the interpreter's wording.

device_stores_outside_the_io_region_fault runs an SD at lowest_address - 8,
io_end and io_end + 8 and checks for the helper-fault exit and the
interpreter's message with the faulting address. With the old wording
the first case fails.

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

* fix(tracer): protect code words when jolt-emu runs a Jolt guest

Only create_emulator installed the code-word intervals, so jolt-emu
(`jolt run`) let a Jolt guest rewrite its own code while every tracing
path and jolt-emu-x86 fault the store.

Move the ELF decode and interval install from create_emulator into
Emulator::protect_code_words, which reads lowest_address from the
installed JoltDevice, and call it from create_emulator and from jolt-emu
once the device is installed. jolt-emu calls it only for an ELF without
`tohost`, the case run_test already treats as a Jolt guest, so riscv-tests
and ACT4 ELFs run as before. The expect_used expectation moves with the
expects.

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

* docs(guests): end foreign images on a doubleword boundary

The tracers write-protect every doubleword that overlaps the stack
canary, and the canary starts at program_end without rounding. With an
unaligned program_end the image's last bytes share the first canary
doubleword, so a store that changes them fails with a stack-overflow
message that a larger stack_size cannot fix. SDK guests avoid this
through the `. = ALIGN(8)` at the end of the template's `.bss`; tell
foreign toolchains to do the same.

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

* refactor(tracer): consolidate failure endcodes and run outputs

* refactor(tracer): consolidate machine execution entry points

Replace fast_run with run_machine and explicit halt validation at Jolt call sites. Require ELF bytes in the shared runner.

* docs: clarify host-call memory guard guarantees

* perf(tracer): optimize code interval guards

* Revert "perf(tracer): optimize code interval guards"

This reverts commit 3c6f7ab.

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

* fix(tracer): protect code as one contiguous range

Replace the merged source-instruction word intervals with a single code
range: the doubleword holding the first source instruction through the
one holding the last. Padding and read-only data between instructions
are protected with the code, and ELF admission rejects any writable
section that overlaps the range, so code words never fragment.

- jolt-program: code_words and bytecode_code_words return Range<usize>;
  merge_word_intervals and is_code_word are removed, and
  InvalidCodeWordIntervals is renamed InvalidCodeWords.
- tracer: the MMU, the replay seed and the parallel workers hold the
  range; each touched word costs one range check.
- jolt-tracer-x86: each store site compiles one two-bound comparison.
- ACT4 link.ld: place .tohost after .text.rvmodel. jolt-emu-x86 decodes
  ACT4 ELFs through decode_elf and would otherwise reject them.
- Docs: the book's tracer guards, the foreign-toolchain layout, and the
  byte-addressable spec's admission rule.

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

* refactor(tracer): call the protected code span the code region

"Code words" reads as the coding-theory term. Rename the API and prose
for the range from the doubleword holding the first source instruction
through the one holding the last:

- jolt-program: code_words -> code_region, bytecode_code_words ->
  bytecode_code_region, PreprocessingError::InvalidCodeWords ->
  InvalidCodeRegion ("invalid code region: ...").
- tracer: Emulator::protect_code_words -> protect_code_region; the MMU,
  the replay seed and the parallel workers hold `code_region`.
- jolt-tracer-x86: the emitter holds `code_region`.
- decode_elf: "writable section overlaps the protected code region".
- Docs and comments say "code region" instead of "code range" or
  "code words".

RAMPreprocessing::bytecode_words, the program-image words, is unrelated
and unchanged.

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

* fix(arch-tests): pin ACT4 data addresses with a fixed rvmodel slot

ACT4 builds every test twice: a signature build that Sail runs, with
RVMODEL_* routines from sail_macros.h, and a self-checking build that
uses rvmodel_macros.h and embeds the values Sail produced. Some expected
values depend on .data addresses, so .data must sit at the same address
in both builds even though .text.rvmodel differs in size.

Moving .tohost after .text.rvmodel left the variable-size section
directly ahead of .tohost and .data, so for some tests .data moved by
256 bytes between the builds and 8 Zaamo/Zalrsc tests failed in CI.
The old order only held because .tohost's 256-byte alignment happened to
absorb the size difference.

Upstream places .text.rvmodel after .data, but Jolt's code region may
contain no writable section. Give .text.rvmodel a 4 KiB-aligned slot
padded to the next 4 KiB boundary instead, so every later section keeps
its address in both builds, and assert that the routines fit the slot.

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

* fix(tracer): fault on fetches outside the decoded instructions

The native tracer compiles only a program's decoded source instructions,
so a jump into data, padding or the middle of an instruction faults with
FaultBadJumpTarget. The interpreter instead decoded whatever memory held
at the PC and executed it; only the proving path's bytecode check
rejected the run afterwards, and jolt-emu never did.

Bundle the code region with the decoded instruction addresses in one
CodeGuard, which Emulator::protect_code (renamed from
protect_code_region) installs for Jolt guests, and check the PC on every
decode-cache miss, the only path that fills the cache. Replay workers
carry the same guard. Test ELFs reporting through tohost get no guard and
still fetch from memory.

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

* fix(tracer): guard code for test ELFs in jolt-emu

jolt-emu installed the code guards only for ELFs without a `tohost`
symbol, so ACT4 ran under looser rules than tracing for a proof. Since
a16z#2320 the ELF decoder skips assembler-marked data, so ACT4's inline
failure pointers no longer stop the decode and the guards can apply to
every ELF; `tohost` now selects only the HTIF exit and the test memory
size.

One test executes bytes the decoder leaves out: I-fence-00 writes its
reserved and hint FENCE encodings with .word, which the assembler marks
as data, and falls through into them. Skip it, and allow that reason in
the arch-tests README. The generated suite gives 127 passed, 6 skipped.

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

---------

Co-authored-by: Michael Zhu <mchl.zhu.96@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…wed (a16z#2486)

GitHub reports the base repository as a pull_request_review run's head repository, so the resolver's source-repository match rejected every review event on a fork pull request and the gate never re-evaluated it. Review runs now bind by number, branch name and exact head; pull_request runs keep the source-repository match.
…row (a16z#2485)

The native tracer emits the code of consecutive bytecode rows back to
back and never compared a row's address with the end of the previous
instruction. Execution that ran sequentially into an address with no
row continued in the next row's code: the instruction at that address
was skipped, and `trace` returned Ok with the wrong guest state.

`compile` now ends each group of rows with `emit_fallthrough`, which
emits an exit when the next group does not start where the previous
instruction ends, and after the last row. The exit reports
`TraceError::MissingBytecodePc` for that address, the error the
interpreter returns for the same program. The error's
`virtual_sequence_remaining` is that of the first row of the
instruction at the address, which `check_exit` decodes from guest
memory and expands as the interpreter does.
…16z#2482)

The streaming RAM family's stage-2 RAF kernel summed the RAM event log
into its K-entry `ra_folded` table on one thread. a16z#2467 moved the default
kernel's same fold onto the pool in byte-capped parts. Move that part
logic into `fold_parts`, called by `fold_cycles` over the address column
and by `StreamingRamRafEvaluation` over the event log, so both folds
share one sizing rule: at most min(pool threads, 1 + 256 MiB / table
bytes) parts, each but the last of at least `ram_K` items. The part
tables beside the result stay within 256 MiB and within
`events * size_of::<F>()`.

Field addition is exact, so the table and the proof bytes are unchanged.
`fold_cycles` takes the same parts as before.

The RAF parity tests gain a case whose folds take four parts in both
slots. It supersedes `cycle_fold_matches_the_eq_table_across_parts`,
which is removed: under the mutations tried, that test fails only where
the new case fails too.
… request (a16z#2491)

On the risk-4, unclassified and non-maintainer-author rows the gate
required the maintainer's approval to name the current head. It now
counts any undismissed approval from an eligible maintainer and leaves
staleness to GitHub's dismissal of stale approvals on push. The paid
classifier is skipped on the same condition. Review attestations and the
gate's own approval still name the exact head.
Comment thread scripts/bench/ingest.py
output.write(summary + '\n')
if plan['tier'] == 'pr' and plan['provenance'].get('pr_number') and os.environ.get('GITHUB_OUTPUT'):
with open(os.environ['GITHUB_OUTPUT'], 'a') as output:
output.write(f'pr_number={plan["provenance"]["pr_number"]}\n')
Comment thread scripts/bench/run.py
path = Path(path)
path.parent.mkdir(parents=True, exist_ok=True)
temporary = path.with_suffix(path.suffix + '.tmp')
temporary.write_text(json.dumps(value, indent=2, allow_nan=False) + '\n')
assert_eq!(
native_print_output(ptr, len, JOLT_PRINT_STRING),
b"",
"print at {ptr:#x} of length {len}"
Comment on lines +384 to +386
"store to {address:#x}: expected the helper-fault exit reason, got {} ({:?})",
outcome.exit,
outcome.helper_error
let message = outcome.helper_error.expect("a helper error message");
assert!(
message.contains(needle) && message.contains(&format!("{address:#X}")),
"store to {address:#x}: unexpected helper error: {message}"
Comment on lines +414 to +415
"address {address:#x}: {:?}",
outcome.helper_error
assert_eq!(
outcome.advice_tape,
Vec::from_iter(tape),
"address {address:#x}"

use super::{format::format_i::FormatI, Cycle, Instruction, RISCVInstruction, RISCVTrace};

declare_riscv_instr!(

use super::{format::format_i::FormatI, Cycle, Instruction, RISCVInstruction, RISCVTrace};

declare_riscv_instr!(

use super::{format::format_i::FormatI, Cycle, Instruction, RISCVInstruction, RISCVTrace};

declare_riscv_instr!(

use super::{format::format_i::FormatI, Cycle, Instruction, RISCVInstruction, RISCVTrace};

declare_riscv_instr!(

use super::{format::format_i::FormatI, RISCVInstruction, RISCVTrace};

declare_riscv_instr!(
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Benchmark comparison (crates)

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

7 of 84 benchmarks differ by more than ±10%:

Benchmark base_run (merge target) pr_run (this PR) Δ
F128/mul 3.0±0.09ns 7.9±0.19ns ${\color{red}\mathbf{+161.2\%}}$
gt_scalar_mul 594.9±10.45µs 355.4±3.60µs ${\color{green}\mathbf{-40.3\%}}$
fp64_prime64_offset59/ext2_scalar_square 5.8±0.08ns 7.9±0.73ns ${\color{red}\mathbf{+36.9\%}}$
fp64_prime64_offset59/ext2_dependent_mul_1024 7.2±0.07µs 8.8±0.04µs ${\color{red}\mathbf{+23.0\%}}$
append_bytes/Keccak/32B 59.6±4.96ns 67.7±4.73ns ${\color{red}\mathbf{+13.5\%}}$
fp64_prime64_offset59/ext2_scalar_mul 6.8±0.05ns 6.0±0.07ns ${\color{green}\mathbf{-11.6\%}}$
F128/square 2.9±0.03ns 3.2±0.03ns ${\color{red}\mathbf{+10.8\%}}$
All 84 benchmarks
Benchmark base_run (merge target) pr_run (this PR) Δ
EqPolynomial::evals/17 1.6±0.03ms 1.6±0.03ms +0.0%
EqPolynomial::evals/19 6.1±0.23ms 6.5±0.38ms +5.5%
EqPolynomial::evals/20 16.9±0.83ms 17.6±0.44ms +4.0%
EqPolynomial::evals/22 68.2±2.01ms 70.4±2.14ms +3.3%
EqPolynomial::evaluations/14 468.5±28.35µs 457.5±15.32µs -2.4%
EqPolynomial::evaluations/18 5.6±0.09ms 5.6±0.08ms +1.2%
EqPolynomial::evaluations/20 35.0±0.26ms 35.8±0.25ms +2.3%
F128/accumulator/deferred 2.0±0.07µs 2.0±0.07µs +0.1%
F128/accumulator/naive 3.7±0.13µs 3.5±0.08µs -3.9%
F128/mul 3.0±0.09ns 7.9±0.19ns ${\color{red}\mathbf{+161.2\%}}$
F128/mul_slice 2.8±0.05µs 2.8±0.13µs +0.1%
F128/square 2.9±0.03ns 3.2±0.03ns ${\color{red}\mathbf{+10.8\%}}$
F192/accumulator/deferred 4.2±0.05µs 4.2±0.12µs +0.5%
F192/accumulator/naive 7.3±0.04µs 7.3±0.13µs +0.4%
F192/mul 7.0±0.10ns 6.9±0.25ns -1.7%
F192/mul_slice 6.7±0.12µs 6.7±0.08µs -0.2%
F192/square 4.9±0.25ns 4.9±0.05ns -0.6%
F64/accumulator/deferred 847.8±5.78ns 855.6±53.09ns +0.9%
F64/accumulator/naive 1.7±0.04µs 1.7±0.02µs -0.1%
F64/mul 1.6±0.02ns 1.6±0.03ns +0.5%
F64/mul_slice 1.7±0.01µs 1.7±0.01µs +0.0%
F64/square 1.6±0.06ns 1.6±0.02ns -0.4%
Polynomial::bind/14 117.5±10.42µs 113.6±1.84µs -3.3%
Polynomial::bind/18 1.7±0.03ms 1.7±0.03ms +0.1%
Polynomial::bind/20 6.6±0.13ms 6.7±0.21ms +0.4%
Polynomial::bind_low_to_high_in_place/Fr/14 173.5±5.11µs 173.7±3.94µs +0.1%
Polynomial::bind_low_to_high_in_place/Fr/20 6.8±0.12ms 6.9±0.10ms +0.3%
Polynomial::bind_low_to_high_in_place/Fr/24 107.3±3.97ms 107.1±2.56ms -0.1%
Polynomial::evaluate/20 45.8±0.35ms 46.8±0.34ms +2.1%
UnivariatePoly::from_evals/16 46.4±2.98µs 46.4±0.61µs +0.0%
UnivariatePoly::from_evals/3 5.6±0.11µs 5.6±0.06µs +0.9%
UnivariatePoly::from_evals/4 8.4±0.19µs 8.5±0.15µs +1.0%
UnivariatePoly::from_evals/8 20.5±0.46µs 20.8±0.35µs +1.5%
append_bytes/Blake2b/256B 304.8±12.23ns 314.5±13.32ns +3.2%
append_bytes/Blake2b/32B 72.4±3.89ns 75.4±7.24ns +4.2%
append_bytes/Keccak/256B 701.7±37.41ns 714.4±19.75ns +1.8%
append_bytes/Keccak/32B 59.6±4.96ns 67.7±4.73ns ${\color{red}\mathbf{+13.5\%}}$
append_bytes/Poseidon/256B 173.8±1.47µs 174.9±1.98µs +0.6%
append_bytes/Poseidon/32B 58.4±2.44µs 58.6±1.29µs +0.4%
challenge/Blake2b 722.2±28.80ns 746.7±35.65ns +3.4%
challenge/Keccak 495.0±5.79ns 494.2±15.66ns -0.2%
field arithmetic/add/fp32_c99 2.7±0.05µs 2.7±0.06µs -0.2%
field arithmetic/add/fp64_c59 2.8±0.02µs 2.8±0.03µs -0.2%
field arithmetic/mul/fp32_c99 4.8±0.08µs 4.8±0.04µs -0.3%
field arithmetic/mul/fp64_c59 7.0±0.11µs 7.0±0.05µs -0.2%
field arithmetic/square/fp32_c99 4.8±0.09µs 4.5±0.06µs -5.6%
field arithmetic/square/fp64_c59 5.8±0.02µs 5.8±0.11µs +0.3%
field arithmetic/sub/fp32_c99 2.0±0.01µs 2.0±0.01µs +0.1%
field arithmetic/sub/fp64_c59 2.1±0.04µs 2.2±0.03µs +9.4%
fp64_prime63_offset259/ext2_packed_mul 14.2±0.17ns 14.2±0.10ns -0.2%
fp64_prime63_offset259/ext2_scalar_mul 6.6±0.11ns 6.6±0.09ns -0.2%
fp64_prime63_offset259/packed_mul 6.7±0.07ns 7.2±0.12ns +8.0%
fp64_prime63_offset259/scalar_mul 2.3±0.03ns 2.4±0.03ns +1.2%
fp64_prime64_offset59/ext2_dependent_mul_1024 7.2±0.07µs 8.8±0.04µs ${\color{red}\mathbf{+23.0\%}}$
fp64_prime64_offset59/ext2_neg_one_scalar_mul 5.9±0.05ns 5.7±0.20ns -3.4%
fp64_prime64_offset59/ext2_packed_mul 17.1±0.28ns 17.3±0.15ns +1.2%
fp64_prime64_offset59/ext2_scalar_mul 6.8±0.05ns 6.0±0.07ns ${\color{green}\mathbf{-11.6\%}}$
fp64_prime64_offset59/ext2_scalar_square 5.8±0.08ns 7.9±0.73ns ${\color{red}\mathbf{+36.9\%}}$
g1_add 362.5±7.56ns 358.9±5.12ns -1.0%
g1_deserialize_bincode 7.4±0.14µs 7.5±0.11µs +1.8%
g1_double 180.0±4.12ns 178.4±2.90ns -0.9%
g1_msm/1024 10.9±0.16ms 10.9±0.35ms +0.1%
g1_msm/16 466.0±10.41µs 462.8±5.39µs -0.7%
g1_msm/256 3.6±0.01ms 3.6±0.05ms -0.2%
g1_msm/4 220.4±3.25µs 216.8±1.73µs -1.6%
g1_msm/64 1.3±0.01ms 1.3±0.02ms -0.2%
g1_scalar_mul 55.5±0.69µs 55.2±0.21µs -0.4%
g1_serialize_bincode 102.2±2.45ns 103.0±2.98ns +0.8%
g2_msm/16 1.5±0.02ms 1.5±0.02ms -0.3%
g2_msm/256 13.4±0.11ms 13.4±0.07ms -0.3%
g2_msm/4 663.5±9.96µs 670.2±46.71µs +1.0%
g2_msm/64 4.9±0.03ms 4.9±0.02ms +0.1%
g2_scalar_mul 280.1±3.74µs 280.2±1.94µs +0.1%
gt_scalar_mul 594.9±10.45µs 355.4±3.60µs ${\color{green}\mathbf{-40.3\%}}$
multi_pairing/16 4.9±0.05ms 4.9±0.02ms -0.7%
multi_pairing/2 814.8±11.95µs 820.3±8.29µs +0.7%
multi_pairing/4 1.5±0.04ms 1.5±0.02ms +0.1%
multi_pairing/8 2.7±0.03ms 2.7±0.04ms -0.3%
pairing 609.9±8.39µs 615.4±10.01µs +0.9%
pedersen_commit/1024 10.9±0.03ms 11.0±0.32ms +0.2%
pedersen_commit/16 526.5±6.45µs 520.7±6.24µs -1.1%
pedersen_commit/256 3.7±0.01ms 3.7±0.02ms -0.6%
pedersen_commit/4 275.5±4.59µs 274.0±6.76µs -0.5%
pedersen_commit/64 1.3±0.01ms 1.3±0.01ms -0.9%

84 benchmark(s) present in only one run: Polynomial::bind_low_to_high_in_place/Prime128Offset6A23801F/14, Polynomial::bind_low_to_high_in_place/Prime128Offset6A23801F/20, Polynomial::bind_low_to_high_in_place/Prime128Offset6A23801F/24, Polynomial::bind_low_to_high_in_place/Prime128OffsetA7F7/14, Polynomial::bind_low_to_high_in_place/Prime128OffsetA7F7/20, Polynomial::bind_low_to_high_in_place/Prime128OffsetA7F7/24, eq_builders/Fr/evals_budget/14, eq_builders/Fr/evals_budget/17, eq_builders/Fr/evals_budget/20, eq_builders/Fr/mapped/16, …

GUJustin and others added 6 commits November 17, 2026 12:50
* perf(kernels): sample full bytecode grouping windows

* docs(kernels): clarify long-window sampling gates

* test(kernels): run the full-window sampling branch and cut restating comments

Review of a16z#2378 at fbf465f found that no test or benchmark guest runs the
branch the PR adds: it needs more than four bytecode RA factors, and every
committed fixture has at most four.

- Add a five-factor fixture whose loop repeats every 3,001 groups: longer
  than a cache-sized sample of 2,048 groups and shorter than a 16,384-group
  batch, so only a full-window sample finds it. One test checks the merged
  round evaluations against the dense oracle. A second checks the factor
  gate and the worker gate in fixed-size rayon pools.
- Delete four comment lines that restate the code under them. One of them
  described `sample_groups` wrongly for the cache-sized case.

---------

Co-authored-by: Codex <codex@localhost>
Co-authored-by: Andrew Tretyakov <42178850+0xAndoroid@users.noreply.github.com>
…ng booleanity (a16z#2408)

* fix(prover): prove traces that exactly fill their padded domain

The honest prover reserved a final no-op row, padding to
max(next_pow2(T + 1), MIN), and refused when that exceeded
max_padded_trace_length. The verifier accepts any power-of-two trace
length up to that maximum, so for T == 2^floor(log2 max) a prover that
skipped the padding row was accepted where the honest prover refused.
This is the "No Maximum-Length Trace" assumption in the Jolt-QED
formalization.

Pad to max(next_pow2(T), MIN) instead. At T - 1 the no-wraparound shift
already gives a final jump no-op successor values, so no row needs to be
reserved. ShouldJump now treats a missing successor as a no-op, the same
way NextIsNoop, NextPc and NextUnexpandedPc already do, and the
optimized Spartan-outer bundle calls that extractor instead of keeping
its own copy of the rule.

The verifier, claims, transcript and wire format are unchanged. Proofs
are byte-identical unless the executed length is a power of two at or
above MIN.

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

* fix(constraints): require repeatable self-jumps at trace end

Authenticate CanEnd from source instructions and expansion boundaries, and enforce it with a packed Spartan outer row. Preserve the existing uni-skip domains and optimized limb bounds. Carry the flag through bytecode reductions, trace representations and tracer stopping decisions.

* Store exit flags as plain bytes and validate layout bounds

Keep live device state in two stored flag words and derive public panic only after validating the canonical final pair. Preserve raw bytes through checkpoints and final witness images, canonicalize SDK exits, and retain raw ACT4 machine execution for HTIF guests.

Centralize maximum padded RAM admission in MemoryLayout, check heap headroom and address-space extent at construction and verifier-key decoding, and reject odd ELF instruction addresses. Keep public I/O values, proof relations, and digest domains unchanged.

* Isolate guest build caches by source checkout

Concurrent worktrees share guest names but can compile different SDK macros. Separate their default target directories so a relink cannot reuse another checkout’s guest artifacts.

* Supply the stored termination byte in the RAM output fixture

The witness now reads flag words from the final memory image. Include termination=1 in the synthetic success image so its zero output-check claim remains valid, and describe the stored flag in the fixture comment.

* fix: address trace-bound review feedback

* Guard RAM code words and require memory address selection

Authenticate canonical source-word intervals in full and committed program preprocessing. Fold code preservation and memory-access counts into the existing cubic RAM relation using the existing value, increment, selector and flag openings.

Keep optimized cycle-first and address-first kernels sparse, bind interval boundaries structurally, and use the same relation in clear verification and BlindFold. Cover malicious witnesses, interval admission, round identities and feature-specific digest compatibility; document the relations and costs.

* Reject code-word changes and low loads in every tracer

Share canonical source-word protection intervals with interpreter snapshots and parallel replay, and compile interval admission into native fast stores. Reject changed protected lanes before mutation while accepting same-value stores, including atomic and conditional writes.

Require loads to start at or above the lowest mapped RAM word. Add lane, reservation, replay, native and backend-agreement coverage so tracing matches the strengthened RAM relation.

* fix(trace): preserve and validate source stopping metadata

Normalize typed jump markers and reject stopping metadata that compact rows cannot preserve. Exercise actual expansion output, malicious prefixes, and reference/optimized transcript agreement at the trace-domain boundary. Refresh the versioned expansion, preprocessing and verifier fixtures for the new flag.

* Isolate guest build caches by source checkout

Concurrent worktrees share guest names but can compile different SDK macros. Separate their default target directories so a relink cannot reuse another checkout’s guest artifacts.

* Update program preprocessing digests for the combined guards

* Restore engine_twins after the guards/end merge and format imports

* fix: reconcile RAM, flag-memory, and stopping guard fixtures

Initialize source_can_end to false in the RAM preprocessing ADDI fixture.
Include can_end in both the exhaustive Akita stage-1 destructure and the
scalar visitor, retaining tamper coverage for the new opening.

Supply the field-inline trace fixtures with an explicit final termination
byte. W2 stopped synthesizing flag words from the public device, so the
missing memory image made RamOutputCheck compare a zero final termination
word with the required one and fail at round zero. Preserve the existing
termination store and all stage checks. Append the existing successful
flag-exit sequence to W1's code-preserving-store tracer guest, retaining its
code-word load and same-value store before eager/lazy/parallel comparison.

Pass each fixture backend's actual code-word intervals to checked inputs.
The ADDI-only program protects two words; the arithmetic program protects
three. Reusing arithmetic metadata for both gave the ADDI fixture the wrong
W1 code mask.

Update the field-inline committed stage-1 expectation from 50 to 51 hidden
claims: 21 nonflag openings + 15 ordinary flags (including W3's CanEnd) +
10 field-inline flags + 5 field value/product openings. W1 consumes the
existing Load/Store openings, and its code-mask weight is public derived
data, so it adds no stage-1 output opening. W3 adds exactly one opening;
its packed R1CS row retains the designed uni-skip domain. No protocol
formula, CanEnd definition, digest domain, or golden digest changes.

Validation (run sequentially): cargo fmt --all -- --check; workspace
Clippy with host and host,zk; nextest for common, tracer, jolt-riscv,
jolt-claims, jolt-kernels, jolt-poly, jolt-program, jolt-witness, jolt-sdk,
z3-verifier, and zklean-extractor; verifier prover-fixtures suites in
standard, akita, and field-inline modes; prover prover-fixtures suites in
standard, zk, akita, field-inline, and field-inline+zk modes; and the
jolt-tracer-x86 x86_64-unknown-linux-gnu all-target check. Link Z3 from the
installed /opt/homebrew/lib via LIBRARY_PATH during local tests.

Independent review found no issues and passed jolt-prover all-target
Clippy with prover-fixtures,field-inline,zk.

* Restore one-multiplication RAM slopes for unprotected words

Keep gamma separate from the code-mask increment coefficient and skip its multiplication when it is zero. This restores the ordinary sparse-entry cost without changing protected or bound RAM relations.

* Name the stopping tamper test for stage-1 opening consistency

Describe the target and CanEnd opening mutations at the stage they exercise. The test does not run bytecode authentication, and its assertions remain unchanged.

* Stream code interval coverage checks during full-key verification

Compare ordered source extents with canonical intervals using constant temporary storage, retaining the sorting fallback for unordered bytecode. Preserve admission checks and shrink merged interval storage to avoid instruction-sized retained capacity.

* Revert "Isolate guest build caches by source checkout"

This reverts commit 5b320e68309d85b1e46b35103d6e57e95b2f1328.

* spec: memory and termination guards

* fix(prover): accept full-domain traces in the bench and cover more full-domain configurations

* fix(tracer-x86): read protected words through byte copies

x86 CI rejected the byte-pointer cast under cast_ptr_alignment. Match the existing guest advice reader by copying eight admitted bytes and decoding the little-endian word, preserving the protected-store comparison without requiring a stronger pointer alignment.

* fix(verifier): inventory code intervals as preprocessing input

The FS source census rejected unclassified ProgramMetadata.code_word_intervals. Regenerate its schema inventory to include the field alongside the sibling public metadata fields. ProgramPreprocessing::digest already binds all serialized metadata, including these intervals; no transcript site or challenge changes.

* fix(inlines): refresh expansion hashes for termination metadata

The golden expansion fixture failed because row JSON now serializes source_can_end for CanEnd classification. All 108 scenarios retain identical registration metadata and row counts; only their hashes changed. Regenerate with the repository fixture test.

* fix(verifier): regenerate fuzz bundles for memory termination guards

The fuzz targets could not decode bundles serialized before the new proof and preprocessing fields. Regenerate all three transparent and all three ZK bundles through generate_fuzz_fixture; each generator round-trips and verifies its output. Existing seeds encode selectors or malformed bytes and need no format migration.

* test(claims): pin the last-row rule and run field_ops_full_domain in every mode

Add R1CS witness tests for the last row of a trace that fills its padded
domain, where every shifted Next* column is 0 and NextIsNoop is 1. A final
j . stall passes; a final jump that still sets ShouldJump fails row 14; ADD
and LD fail row 16; a taken BEQ fails row 15 and an untaken one row 16; an
unfinished virtual sequence fails row 16, and row 17 on its own. The e2e
tests only show that honest full-domain proofs succeed, so these tests catch
a future change to EqPlusOne wraparound or to the row-16 guard.

Move field_ops_full_domain into the field-inline guest list so it runs under
Akita and ZK as well as in clear mode.

* docs(skill): state the padded-length floor; narrow a lint expectation

agent-skills/jolt/SKILL.md now says in the parameter table and the error
table that max_trace_length is the smallest power of 2 at or above the
cycle count and at least 256 on Dory or 4096 on Akita, matching the
tightening step later in the file.

The clippy::expect_used expectation in ProverTimeObjective::setup now covers
only the padded_trace_length call instead of the whole function.

* Preserve input, advice and canary RAM values

Derive one sorted, merged RAM-index mask from source instructions and the
public memory layout, restricted to the proof's address domain. Share it
between the prover, clear verifier and BlindFold while retaining the
optimized kernel's O(s) interval blocks and existing gamma-squared relation.

Accept stores only when touched protected bytes retain their values in the
interpreter, replay and native x86 tracer. Round canary protection outward
to doublewords and keep the LR/SC RAM-only guards and other address checks.

The full and committed preprocessing digests already bind the entire
memory layout. The extra intervals therefore need no new digest input or
change to the PR's v3/v2 domain strings. Tests confirm that changing the
layout changes both the mask and the digest.

Add store, failed/successful SC, verifier tampering and interval-kernel
coverage. Update the spec and RAM book page. Regenerate the six accepted
clear/ZK fuzz proof bundles through the repository generators because the
enlarged mask changes the stage 2 proof data; both generators verify their
serialized output. Frozen digest and inline expansion fixtures stay stable.

* fix(tracer): admit final partial RAM doublewords

* fix(tracer): reject native loads above the I/O bound

* fix(tracer): bound native host-call guest memory reads

* fix(program): enforce memory layout and ELF admission checks

* fix(tracer): align native backing and guest-read bounds

Port dbd1978787, 95cf8d053f and f78f8785dd without protected-store, flag-word or general low-load rules. Preserve logical bounds while rounding native backing and checkpoint images to whole doublewords. Check each device-load byte against io_end and propagate bounded host-read failures.

Retain this branch’s JoltDevice APIs, fast_run entry point and RAM-relative final-memory convention. Exercise the final partial heap word at offset 1160 with heap_size 8: offset 1152 with zero heap remains inside the existing canary and cannot succeed without changing excluded store rules. Omit the interpreter host-read underflow case until the general low-load guard is ported.

Validation: cargo fmt --all -- --check; workspace host clippy; x86_64-unknown-linux-gnu tracer clippy; all 180 tracer nextest tests. Native runtime tests require x86 Linux.

* fix(tracer): treat panic and termination words as plain memory

* test(kernels): store the termination word in the output-check fixture

* test(memory): complete plain flag-word fixture coverage

Store the final termination word explicitly in the field-inline prover fixture and port the public-I/O mask test from FINAL.

* fix(tracer): preserve protected memory words across execution backends

* fix(tracer): preserve host-read parity before low-load guards

* docs(program): describe stored flag bytes in memory images

* fix(tracer): reject host-call reads below mapped memory

* fix(program): share source-word intervals with ELF admission

* refactor(guards): keep the final stack diff scoped to constraints

* style(tracer): preserve advice-test spacing from the stack base

* docs(book): point the R1CS page at the rv64 constraint definitions

* Drop the plain flag-word contract from #2417

Halt instructions replace the plain flag-word contract, and the halt work
keeps main's panic latch, flag words, ValIo segments and witness synthesis.
Revert FlagWords, InvalidFlagWords, JoltDeviceMemory, the absolute-address
final memory image, the canonical SDK flag-pair stores, and their tests,
fixtures and docs to #2416's text.

What stays: the fallible tracer plumbing (try_trace, and finish_emulator
returning Result), JoltDevice::is_output ending at output_end, and the x86
run_machine entry point for the ACT4 runner.

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

* Add the jolt.success and Panic halt instructions

Introduce Jolt's halt instructions on unchanged constraints:

- jolt-riscv: JOLT_SUCCESS_WORD (0x0000_305B, `.insn i 0x5B, 3, x0, x0, 0`)
  and two source/final kinds, JoltSuccess => Success ("jolt.success", tag
  0x00a8) and JoltPanic => Panic ("jolt.panic", tag 0x00a9). Both carry only
  the Jump circuit flag, no instruction flags, have side effects and target
  ControlFlow.
- jolt-lookup-tables: both kinds are table-free (lookup output 0, so their
  jump targets address 0, where only padding sits). A registry test pins
  that exactly the halts are table-free jumps.
- jolt-program: the image decoder accepts jolt.success with I-type operands
  and rejects every other funct3-3 custom-2 word; EBREAK lowers to one Panic
  row that links into a temporary instead of `JAL discard, 0`. The three
  EBREAK expansion goldens are re-blessed.
- tracer: Cpu gains `halted: Option<HaltKind>` (captured, installed and
  compared with chunk state), `Cpu::halt` writes the link and halts in
  place, and a tick after a halt is a no-op. The JoltSuccess/JoltPanic
  instructions and EBREAK's direct exec use it. The halt tick also sets the
  stall flag, so drivers that still stop on stalls stop at halts.
- jolt-tracer-x86: ExitReason::Terminated is renamed Stalled (value 1) and
  HaltedSuccess (7) and HaltedPanic (8) are appended; the JIT emits halt
  rows that write their link and exit in place. check_exit accepts the
  halts exactly as it accepts a stall until the drivers require a halt.
- jolt-claims: R1CS witness tests show a final halt row satisfies the
  unchanged constraints and a halt cannot be followed by a real row.

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

* End guests at jolt.success and ebreak

SDK and platform:
- The #[jolt::provable] epilogue writes the outputs and the termination
  byte, then executes jolt.success (`.insn i 0x5B, 3, x0, x0, 0`) instead
  of spinning in `j .`.
- jolt_panic writes the panic byte and halts at ebreak (it now diverges);
  __platform_abort calls it.
- __platform_exit, jolt_platform::platform_exit and the std trap
  handler's fallback execute ebreak for every code. The trap handler no
  longer steps past a trapping EBREAK: EBREAK never traps in Jolt.
- Exit-style paths that write no panic byte (std::process::exit,
  __platform_exit, the trap fallback) stay unprovable, as on main: the
  witness still synthesizes termination = 1 for a non-panic claim.

Guests and e2e harness:
- The memory-ops guest gains two entries: exact_rows, a no-op sled whose
  run length is affine in its input, and panic_halt.
- A halt cannot be followed by a real row, so the harness no longer fills
  a full-domain case by repeating its final `j .`. The exact_domain case
  replaces muldiv_full_domain and field_ops_full_domain: it runs
  exact_rows padded so the run fills 2^12 rows, which is Akita's padding
  floor and above Dory's, so the proof has no padding row and the halt
  sits at T-1. The harness asserts that such a case fills its domain
  exactly.
- panic_halt proves a guest panic with panic = true, in both profiles.
- Every case asserts its panic flag and that its run ends at the
  expected halt (JoltSuccess, or JoltPanic for a panic).

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

* Require Jolt runs to end at a halt

A Jolt run now ends only at a halt instruction: jolt.success, or ebreak,
Jolt's failure halt. A run that stops anywhere else, such as a `j .` or
other PC stall, fails with the new TraceError::EndedWithoutHalt { pc }.
Constraints, layout, the device panic latch and witness synthesis are
unchanged.

tracer:
- finish_emulator, shared by the eager, execute-only, parallel and
  chunked paths, returns EndedWithoutHalt unless the hart halted. It
  logs a panic halt with the guest backtrace, keyed on HaltKind::Panic
  rather than the device latch. The infallible trace/execute wrappers
  and the lazy iterator panic with that error.
- Every driver stops at a halt, a PC stall, or a zero-row tick.
  `execute` now also stops on a zero-row tick, as `trace` does.
  LazyTracer::has_panicked reports a Panic halt. HaltKind is re-exported.
- Emulator::run_test returns 0 for jolt.success and PANIC_HALT_ENDCODE
  (1) for an ebreak halt, so jolt-emu and `jolt run` exit 1 for an
  abnormal end. HTIF tohost handling and bare stalls are unchanged.

jolt-tracer-x86:
- check_exit returns a MachineExit (a halt kind or a stall PC). Jolt
  paths (fast_run, record, chunked execute and replay) call
  require_halt. run_machine still accepts a stall for the ACT4 runner.
- The harness terminal row is a jolt.success halt that links into x0.
  ExitReason is re-exported for tests, which now name exit reasons
  instead of using raw numbers.

Tests cover the halt state and link at the CPU level, every TracerBackend
driver with each halt and with both stall shapes, run_test's halt
endcodes, run_machine against fast_run, a JIT-versus-interpreter
differential for both halt rows, and a real panicking guest
(memory-ops panic_halt) through the x86 fast and record paths.

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

* Document halt instructions

- specs/m-mode-trap-csr-semantics.md: EBREAK and c.ebreak lower to one
  Panic row, Jolt's failure halt; a run ends successfully only at
  jolt.success. The Debug-Mode argument stays; the SDK's panic, abort
  and exit paths end at EBREAK.
- book emulation page: EBREAK is the failure halt and jolt.success the
  success halt; the tracer rejects a run that stops anywhere else.
- book guests page: foreign toolchains end a run with the termination
  byte and jolt.success, or the panic byte and ebreak.
- specs/x86-tracer-backend.md: Jolt runs end at halt rows
  (HaltedSuccess/HaltedPanic); PC stalls exit with Stalled, which the
  Jolt paths reject with EndedWithoutHalt and run_machine, used by the
  ACT4 runner, accepts.
- book testing-gates page: the exact_domain and panic_halt cases, the
  halt check, and the new case counts.

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

* Update CLAUDE.md e2e matrix case lists

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

* Say where the end-at-a-halt rule is enforced

These texts described the halt rule as a property of every Jolt run, or
still described the old self-jump exit:

- specs/m-mode-trap-csr-semantics.md said a run ends successfully only
  at jolt.success. The tracers stop at either halt, but the proved
  claim does not depend on which one ends the run: the constraints
  accept any final jump, and the public panic bit comes from the panic
  and termination words that ValIo binds. Say so.
- JoltInstructionRow::self_jump_repeats said a run that stops at the
  PC-stall fixed point "is rejected"; name the tracers and their
  TraceError::EndedWithoutHalt.
- ProverError::TraceDoesNotEndInJump told users that only a jump to
  itself ends a provable trace, the exit every tracer now rejects. The
  variant and its check stay: the halt rows carry the jump flag.

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

* Fail a jolt-emu run that stalls without a halt

Emulator::run_test, which jolt-emu and therefore `jolt run` use, still
reported a PC stall in an ELF without a `tohost` symbol as a success.
Every riscv-tests and ACT4 ELF defines `tohost`, so only a Jolt guest
reaches that branch, and a Jolt run must end at a halt: a guest built
by an older SDK or a foreign toolchain that ends at `j .` passed
`jolt run` and then failed to trace.

Such a stall now logs TraceError::EndedWithoutHalt and returns the
nonzero ENDED_WITHOUT_HALT_ENDCODE. A test ELF that spins with `tohost`
untouched still returns 0. The tohost probe after each tick now runs
only for test ELFs; without `tohost` it read address 0, which only the
JoltDevice jolt-emu installs happened to serve.

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

* Annotate the expect calls in trace and execute

Both infallible entry points panic through .expect when a run does not
end at a halt. Give each the #[expect(clippy::expect_used)] the lint
policy asks for, with the reason, as finish_emulator already has.

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

* Test stall rejection on the lazy iterator and x86 chunked execute

Two drivers enforce the end-at-a-halt rule in their own code, and no
test reached either check: CheckpointingTracer::lazy_step_cycle, the
only guard for trace_lazy, trace_to_file and trace_checkpoints, and the
x86 backend's chunked execute. jolt_runs_end_at_halts now also drains
trace_lazy on each stall program and requires the EndedWithoutHalt
panic, and chunked_execute_rejects_a_stall runs a BEQ x0, x0, 0 program
through the x86 chunked execute. Deleting either check fails its test.

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

* Check that the panic_halt equivalence guests panic

The panic_halt equivalence tests compared the x86 backend with the
reference interpreter but never checked that the guest panicked. Had
`trigger` decoded as false, both runs would end at jolt.success and
agree, and the tests would pass without running the JIT's panic halt.

Both helpers now take the expected panic flag and check the reference
run against it; record mode also checks that the reference run ends at
the matching halt row.

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

* Drop a duplicate halt R1CS test

halt_rejects_a_real_successor writes ShouldJump and a nonzero
NextUnexpandedPC by hand and expects row 14 to fail, which
jal_rejects_fall_through_next_pc and
last_row_rejects_final_jump_that_still_claims_to_jump already check.
Its LookupOutput of 0 is the witness default, not a halt table's
output, so it cannot notice a halt that gains a lookup table
(table_free_jumps_are_exactly_the_halts pins that), and a halt that
loses Jump already fails last_row_accepts_final_halt.

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

* Adopt #2416's pushed host-call tests

Take the host-call bound tests as #2416 now has them (a VirtualHostIO
row in both tracers, `advice_write_follows_guest_load_bounds`) and
expect the success halt the x86 harness now ends each program with.

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

* test(tracer-x86): ignore host-call reads below the lowest mapped word

Add a range that starts below lowest_address to the native print test,
which must print nothing for it, and to the VirtualHostIO instances that
diff_host_io runs through both backends.

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

* docs(memory): state how host calls treat addresses below lowest_address

The tracer memory guard sections say guest loads below lowest_address
fault but did not say what a host call does with such a buffer. Host
calls never stop the run: both tracers check the buffer with
identity_loads_succeed and log and ignore a call that a guest load would
reject.

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

* fix(tracer): name stack_size in canary store errors

The protected-store check that replaced the StackCanary fault dropped
its hint. A value-changing store into the stack canary now tells the
user, in both tracers, to increase stack_size in MemoryConfig and gives
its current value, as the old fault did.

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

* docs(memory): describe value-preserving store guards in the m-mode spec and guest guide

The m-mode spec still described the stack-canary guard this branch
replaced: every store into the canary panicked, so a failed SC's
write-back did too. The tracers now reject only stores that change a
byte of a doubleword holding a source instruction or overlapping the
canary, so a failed SC passes everywhere. Name that guard in the LR/SC
section and in the tracer-panic lists, and note that code stores are
not yet constraint-checked.

The guest guide said a self-modifying guest can still produce a valid
proof; the honest tracers now refuse to trace it.

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

* docs(memory): say the tracer faults on carrying accesses below lowest_address

The byte-addressable spec's Tier 1 note and constraint 0's NOTE in
rv64.rs still said the tracer reads loads below lowest_address as 0.
This branch makes those loads fault, so a carrying access faults in
every case. The rv64.rs comment takes #2408's wording.

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

* refactor(tracer): drop the dead store clause from the low-load fault

address_fault exempted stores at or below RAM_START_ADDRESS - 8 from
the I/O-underflow fault, which reads as if stores just above that bound
still underflow. MemoryLayout::try_new pads at least two I/O words, so
lowest_address <= RAM_START_ADDRESS - 16 and the clause always equals
!is_write. Say that directly; stores below lowest_address still fail
as unmapped device stores.

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

* refactor(tracer): drop two redundant device lookups behind unchecked expects

create_emulator read lowest_address back out of the MMU through an
expect after moving the device in; read it from the local device
before the move instead. Its two remaining expects (ELF decoding and
code-word intervals) are its contract, like the input-size asserts, so
annotate them with #[expect(clippy::expect_used)].

assert_write_protected_store re-borrowed the device with unwrap() on
each touched word after an outer let-else had already checked it. Keep
one let-else inside the loop instead, which the per-word load still
needs because it takes &mut self.

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

* test(tracer): say why a store below the I/O region is an unmapped-device fault

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

* Check I/O lengths against the rounded layout and align heap_end

Build the checked layout first and compare trusted advice, untrusted advice
and input lengths with the layout's rounded capacities, in the tracer and in
the native x86 tracer. The rounded size is the effective maximum: the
verifier already checks lengths against it, and the SDK now slices the I/O
regions by it.

Round heap_end up to a doubleword in MemoryLayout::try_new, matching the
linker's 8-aligned __heap_end, and reject an unaligned heap_end at admission.

Add e2e cases for 16 bytes of advice under a 12-byte maximum and for a store
to the last heap byte.

* refactor(guards): drop the CanEnd end rule from the memory guards

Remove Change 3: the CanEnd circuit flag, R1CS row 19 and its stage-1
opening, the read-RAF and committed lanes, the row's source_can_end
field and flag_class bit, the tracers' CanEnd stopping rules, the
field-inline meta repack, and the CanEnd tests and docs. Runs end at
halt instructions instead, which the base branch provides.

The 67 files that carried only Change 3 return to their
fix/tracer-memory-guards versions, including both expansion fixtures.
The seven mixed files keep their protected-region, selected-address and
code-interval hunks, and the book keeps its R1CS source-path fix.

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

* Expect a doubleword-aligned heap_end in the last-heap-word tests

The layout now rounds heap_end up to a doubleword, so with a 1025-byte
program the heap ends at RAM_START + 1168 instead of 1161. The interpreter
and native tests now accept stores to the whole last word and reject the
next two doublewords.

* Fault on loads at io_end in both tracers

The padding between io_end and RAM_START_ADDRESS is unmapped, but the
interpreter and the native x86 helper only faulted on loads above io_end,
so a load at exactly io_end succeeded and returned zero. Both now fault on
any access at or above io_end below DRAM, which matches the unmapped-word
mask the RAM read-write relation applies from io_end.

* Reject accesses to unmapped RAM words with a public mask N

Add a fifth claim to the RAM read-write sumcheck, 0 = Σ eq·N·ra with batch
coefficient γ⁴, modeled on the code claim. N is the public mask of the I/O
padding [io_end, RAM_START_ADDRESS) and the heap padding [heap_end,
lowest + 8·ram_K), clipped to the proof's RAM domain. Both bounds are
doubleword aligned, and the panic and termination words lie below io_end.

RamWordMasks carries C and N together from preprocessing to the relation.
The reference kernel adds an UnmappedEqCycle table; the optimized kernel
binds a second interval mask in lockstep with C and folds γ⁴·N into the
count coefficient. The clear verifier and BlindFold derive eq·N from the
same intervals.

* Share mask N's work with C in prover and verifier

The prover classifies an address for both masks with one binary search
over their merged, tagged intervals, as before N, and skips N's multiply
on column pairs where N is zero. RamWordMasks rejects overlapping masks,
which the merged search requires.

The verifier's RAM read-write output check evaluates the cycle equality
once and each mask once instead of once per derived leaf.

* feat(ram)!: retire RAM Hamming booleanity; the access-count term is the RAM one-hotness check

The RAM read-write relation's access-count term proves
`Σ_k ra(k, j) = Load(j) + Store(j)` on every cycle. With Booleanity of
every committed `RamRa` chunk and exclusive Boolean Load/Store flags, it
makes `ra = Π_i ra_i` select one word on memory rows and none on other
rows. That makes the stage-6b RAM Hamming-booleanity sumcheck and the RAM
leg of the stage-7 Hamming-weight reduction redundant, so both go:

- jolt-claims: delete the `HammingBooleanity` relation,
  `ram_hamming_weight()` and `RamHammingBooleanityPublic`. The serialized
  slots stay reserved: `JoltRelationId::Reserved12`,
  `JoltVirtualPolynomial::Reserved34` and `JoltDerivedId::Reserved6`
  (`#[from(skip)]`), each carrying `RetiredIdentifier`.
- Stage 7, base: the gamma stride stays 3 per polynomial; RAM skips
  `γ^{3i}` (`has_hamming_weight_leg`). Akita: two legs per polynomial at
  `γ^{2i}` and `γ^{2i+1}`, unrecentered for RAM.
- Verifier: stage 6b loses the member, its claim and its batching
  coefficient. BlindFold drops the member's rows and `EqCycle` public, and
  registers the stage-7 `GammaPow` publics from the relation's own
  expressions (`gamma_power_bound` is deleted).
- Prover, kernels and witness: delete the reference and optimized
  kernels, the kernel slot and the `RamHammingWeight` witness; the
  optimized stage-7 kernel builds the new weights.
- A comment at the access-count term records that it is the only RAM
  one-hotness check.

Tests: wire tags around the retired slots; the base and Akita stage-7
expressions; and two RAM-guard rejections that only the access-count term
catches now: a selection on a non-memory row and two selected words on a
memory row.

Proofs change shape (stage 6b has one claim fewer). The preprocessing
digest goldens, fuzz bundles and fixture magic are regenerated in a later
commit.

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

* docs(ram): describe the RAM guards without CanEnd or RAM Hamming booleanity

Rename specs/memory-termination-guards.md to specs/ram-guards.md and
rewrite it around what this branch keeps: the protected-region and
access-count terms of RAM read-write checking, code-interval admission,
and the removal of RAM Hamming booleanity. It drops the CanEnd end rule,
#2417's plain flag words and the layout admission items that #2415 owns.

The book's RAM page derives RAM one-hotness from the access-count term
and Booleanity instead of Hamming booleanity, and the BlindFold stage
table and the field-inline stage-6 lists drop the retired member. The
guest guide and the m-mode spec say the constraints, not only the
tracers, reject a store that changes a protected word.
byte-addressable-memory.md and digit-zero-virtualization.md describe
RAM without a Hamming check, and proof-trace-row-layout.md drops "RAM
hamming".

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

* Move the rounded-advice entry point into the memory-ops guest

The advice-consumer guest is built without a function name by the verifier
and Akita tests, so a second provable function there emits a second main.
memory-ops already holds several guest_only entry points selected by name.

* Check the mask tests against brute-force sums

The verifier test evaluates the relation's output expression with the cycle
equality and both masks computed by brute force, instead of comparing the
shared evaluation with the per-leaf one. The kernel test compares the
interleaved masks with block sums over the hypercube instead of with each mask
built alone.

* Regenerate the verifier fuzz bundles for the unmapped-word mask

* Import UntrustedAdvice in the memory-ops guest

* test(verifier): regenerate digests, fuzz bundles and fixture magic

The full-program preprocessing digest goldens move in all four builds
(Dory, Dory field-inline, Akita, Akita field-inline) because bytecode
rows no longer carry `source_can_end`. The committed-program goldens hash
metadata and commitments rather than bytecode rows, so they are
unchanged. The digest domains stay at v3 (Dory) and v2 (Akita), one
above fix/tracer-memory-guards.

FIXTURE_MAGIC becomes JVCF0014. #2408's JVCF0013 tagged CanEnd-protocol
ZK caches, which load without an acceptance check, so that value is not
reused.

The six fuzz bundles (transparent and ZK muldiv, committed-muldiv and
advice-consumer) are regenerated for the new proofs, and fuzz replay
passes against them. The advice-consumer bundles grow by about 37 KB
because, with the base branch's guest code, that guest's bytecode table
now pads to 8192 rows instead of 4096.

The golden BlindFold shape in tests/completeness/zk.rs needs no update.
It passes on a freshly generated ZK proof with the same 221 coefficient,
16 output-claim, 37 auxiliary and 64 error rows. No stage gains or loses
sumcheck rounds (one coefficient row per round), and output claims and
auxiliary values are packed into fixed-length rows, so stage 6b's
dropped claim, stage 7's dropped RAM legs and stage 2's two new terms
leave every row count unchanged. The expansion goldens and the
Fiat-Shamir inventory also need no update.

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

* Import RamWordMasks in the field-inline stage twins

* docs(ram): describe the unmapped-word mask in the RAM guards

byte-addressable-memory.md's "Current RAM guards" section described the
four-claim relation. It now shows the gamma^4 N(k) term and the fifth
claim (input zero, weight E*N), says where N comes from
(unmapped_word_intervals over the I/O and heap padding; the aligned
io_end and heap_end and the checks that keep them aligned; RamWordMasks
rejecting overlap), how the optimized kernel classifies both masks with
one search and folds N into the count coefficient, what the fifth
identity tests, and the batching bound for five identities (4/|F|, was
3/|F| for four). The tracer paragraph adds the io_end and heap_end
faults.

The m-mode spec's "Tracer panics are halting failures" lists the tracer
panics whose continuations the constraints reject. A load or store
outside the memory map now belongs there: RAF evaluation with the
access-count term rejects an address outside the RAM domain, and the
unmapped-word term rejects the I/O and heap padding. The open decision
"Faults instead of panics" lists it too.

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

* Scope the memory-ops guest helpers to the entry points that use them

A guest build compiles only the guest_only entry point that JOLT_FUNC_NAME
selects, so with -D warnings the heap_top, rounded_advice and memory_ops
builds failed on unused items. Import asm inside the two functions that use
it, declare the linker's layout symbol inside heap_top, make Scratch public
so the builds that skip its users do not see dead code, and drop guest_only
from rounded_advice, which compiles on the host.

* test(verifier): regenerate digests and fuzz bundles

Only the six verifier fuzz bundles move: transparent and ZK muldiv,
committed-muldiv and advice-consumer. The merge of the author's
unmapped-word mask N adds a fifth batched claim to the RAM read-write
sumcheck, 0 = sum eq*N*ra at gamma^4. That changes stage 2's round
polynomials and every later transcript value, so the bundles generated
before N no longer verify. The new bundles pass fuzz.py replay, whose
tamper targets first require each honest bundle to verify.

Every bundle keeps its byte length. N is a public mask the verifier
evaluates; its claim reuses the existing RamRa opening, so the proofs
carry the same claims as before. In the transparent bundles only the
proof bytes differ; preprocessing, public I/O and the advice commitment
are byte-identical. The ZK committed-muldiv and advice-consumer bundles
also differ in their committed-program and trusted-advice commitments,
which are hiding and get fresh blinding on every run.

Unchanged goldens:
- FULL_PROGRAM_DIGEST and COMMITTED_PROGRAM_DIGEST pass as they are in
  all four builds (Dory, Dory field-inline, Akita, Akita field-inline).
  The digest binds the program and its memory layout. N is derived from
  the layout and is not stored, and the golden layout's heap_end is
  already doubleword-aligned, so #2415's rounding leaves it unchanged.
  The digest domains stay at v3 (Dory) and v2 (Akita).
- FIXTURE_MAGIC stays JVCF0014, which was never pushed. The local
  caches tagged with it held proofs from before N, so they were deleted
  and regenerated rather than bumping the magic again.
- The golden BlindFold shape in tests/completeness/zk.rs (221
  coefficient, 16 output-claim, 37 auxiliary and 64 error rows) passes
  on fresh ZK proofs. The new claim adds no sumcheck round and no
  opening.
- The Fiat-Shamir inventory and both expansion goldens.

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

* docs(guests): name the jolt.success halt in the foreign-toolchain environment

The foreign-toolchain intro called the guest environment plain RV64IMAC
with a halt-instruction exit, but a successful run ends at jolt.success,
Jolt's custom-2 instruction (opcode 0x5B), which is not RV64IMAC. Name it,
and ebreak for a failed run, as the "Ending the run" bullet below does.

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

* docs(tracer): give the io_end fault a tracer-local reason

The comment above the interpreter's `ea >= io_end` fault justified it by
the RAM read-write relation's unmapped-word mask, which this branch does
not have: that mask arrives with #2408. State the tracer's own reason
instead, so the comment does not describe a tracer-only guard as
constraint-enforced.

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

* test(tracer-x86): fault device stores below lowest_address and at or above io_end

slow_store_doubleword's two device-store faults had no test. A store
below lowest_address reported "I/O underflow: Attempted to write to",
while the interpreter sends the same store to AddressFault::UnmappedDevice
("Illegal device store: Unknown memory mapping: ..."), because only loads
there are underflows. Use the interpreter's wording.

device_stores_outside_the_io_region_fault runs an SD at lowest_address - 8,
io_end and io_end + 8 and checks for the helper-fault exit and the
interpreter's message with the faulting address. With the old wording
the first case fails.

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

* fix(tracer): protect code words when jolt-emu runs a Jolt guest

Only create_emulator installed the code-word intervals, so jolt-emu
(`jolt run`) let a Jolt guest rewrite its own code while every tracing
path and jolt-emu-x86 fault the store.

Move the ELF decode and interval install from create_emulator into
Emulator::protect_code_words, which reads lowest_address from the
installed JoltDevice, and call it from create_emulator and from jolt-emu
once the device is installed. jolt-emu calls it only for an ELF without
`tohost`, the case run_test already treats as a Jolt guest, so riscv-tests
and ACT4 ELFs run as before. The expect_used expectation moves with the
expects.

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

* docs(guests): end foreign images on a doubleword boundary

The tracers write-protect every doubleword that overlaps the stack
canary, and the canary starts at program_end without rounding. With an
unaligned program_end the image's last bytes share the first canary
doubleword, so a store that changes them fails with a stack-overflow
message that a larger stack_size cannot fix. SDK guests avoid this
through the `. = ALIGN(8)` at the end of the template's `.bss`; tell
foreign toolchains to do the same.

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

* docs(tracer): tie the io_end fault to the unmapped-word mask

#2418' gave the interpreter's io_end fault a tracer-local reason because
the unmapped-word mask did not exist there. On this branch it does: the
I/O gap of unmapped_word_intervals is the words from io_end up to
RAM_START_ADDRESS (DRAM_BASE), exactly where the tracer faults, and the
gamma^4 claim rejects any load or store that selects one of them. Name
that coupling so a change to either bound updates both.

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

* docs(ram): name Akita's verifier caps and fix the gamma^4 soundness step

specs/ram-guards.md: the Akita bullet defended dropping the RAM Hamming
checks with data-flow facts alone and ended by attributing RAM
one-hotness to Booleanity and the access-count term, which a reader
takes as per-chunk one-hotness. Those give only a zero-or-one-hot
selector: on a non-memory row the chunks other than a zero one may hold
several ones, so an accepted Akita proof can commit RAM chunk columns
outside Akita's UnitOneHot source class, which the removed Hamming
checks used to exclude. Name the mechanism that keeps this sound: Jolt
checks the class only on the prover's witness (validate_witness), and
Akita's verifier enforces its frozen, matrix-certified response caps
(TerminalFoldParams::validate_terminal_linf_cap, response_l2_sq_cap in
akita-params/src/schedule.rs at the pinned rev 1196c340) whatever the
source, as akita-params/src/sis/committed_source.rs states.

book/src/how/architecture/ram.md: the gamma^4 step called the summed
terms E(j)N(k)ra(k,j) nonnegative integers fixed before r_0, but E(j)
depends on r_0. State it on each cycle's count v(j) = sum_k N(k)ra(k,j),
which is 0 or 1 and fixed before r_0; the sum is the multilinear
extension of v at r_0, which vanishes only if every count is zero,
except with probability log T/|F|.

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

* test(verifier): classify ram_word_masks in the statement-binding test

CheckedInputs gained ram_word_masks with the RAM guards, and stage 2 and
BlindFold read it, but statement_binds_each_field_the_verifier_reads
named it in neither list. JoltStatement does not encode it: validation
derives it from the code intervals and memory layout, which the
preprocessing digest binds, and from ram_K, which the statement binds.
List it as unbound with that reason, so a later change that binds it
must move it to the bound list.

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

* docs(guests): note the RAM constraints protect the canary doublewords too

#2418' told foreign toolchains to end the image on a doubleword boundary
because the tracers protect every doubleword that overlaps the canary.
On this branch the constraints do the same: write_protected_word_intervals
rounds the canary extent [stack_end, stack_end + STACK_CANARY_SIZE)
outward to doublewords, so mask C covers the doubleword an unaligned
program_end shares with the image, and the gamma^2 claim rejects any
store that changes it.

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

* refactor(prover): take stage-2 RAM masks from the checked inputs

Prover stage 2 built the RAM read-write relation from masks it re-derived
from the witness's own program (KernelContext::ram_word_masks), while the
verifier, the ZK replay and BlindFold take them from CheckedInputs, which
validate_inputs_from_parts derives from the verifier preprocessing. The
masks are not absorbed into the transcript, so a disagreement between the
two sources would surface only as a stage-2 output mismatch or an
unsatisfied BlindFold instance.

prove_stage2 now takes the stage-0 CheckedInputs, as stages 4 and later
do, and uses its ram_word_masks. KernelContext::ram_word_masks loses its
last production caller and leaves the public backend: the stage fixtures'
test_checked_inputs derives the masks from the fixture program, and the
stage-2 replay twin takes the checked inputs, like the verifier's stage 2.

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

* refactor(verifier): one owner for the RAM read-write mask publics

The stage-2 RAM read-write relation computed its public weights twice:
expected_output (the clear verifier's output check) and
derive_output_term (which the kernels' derived-table drift checks pin
against) each spelled out the cycle equality and the eq-times-mask
products. If the copies drifted, the kernel cross-check would stop
protecting the formula the verifier uses.

address_and_eq_cycle now owns the split of the opening point and the
EqCycle evaluation, and public_value maps each RamReadWritePublic to its
value; both trait methods call them. expected_output still evaluates the
cycle equality once, and each mask once because each masked weight
occurs once in the output expression. BlindFold's stage-2 lowering builds
only symbolic relations and keeps its lockstep copy.

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

* refactor(ram)!: name mask C's public WriteProtectedEqCycle

Mask C covers source instructions, program input, trusted and untrusted
advice and the stack canary, and the rest of the change already calls it
write-protected (RamWordMasks::write_protected,
write_protected_word_intervals, InvalidWriteProtectedIntervals). Its
public weight and the plumbing around it still said "code".

RamReadWritePublic::CodeEqCycle becomes WriteProtectedEqCycle, with a doc
line like its UnmappedEqCycle sibling. The optimized kernel's batch
coefficients code/code_increment become write_protected and
write_protected_increment, and test locals follow. The relation, kernel
and spec text says write-protected where it means mask C; text about
words that hold instructions keeps "code". RAMPreprocessing's
code_word_intervals is documented as the source-instruction part of C.

RamReadWritePublic is serialized by variant index, so the rename moves no
wire byte, and no golden, fixture or inventory names the variant.

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

* test(kernels): pin the RAM read-write kernel to the reference tier

The optimized RAM read-write tests checked both kernels' round
polynomials against a dense sum of a hand-written copy of the batched
summand, a second implementation of the formula jolt-claims'
ReadWriteChecking owns: every change to the γ layout had to be mirrored
there.

The tests again compare the optimized kernel's round messages, output
claims and derived tables with the reference kernel's through
testing::assert_parity, as before #2408; the reference kernel checks
s(0) + s(1) against the running claim in every round. dense_input_claim
sums the relation's own output expression over the Boolean domain, each
public weight at its Boolean value, instead of spelling out the γ powers.
Brute force stays where it is independent ground truth: the bound
address masks' block sums (interleaved_masks_match_brute_force_sums).

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

* refactor(tracer): consolidate failure endcodes and run outputs

* refactor(tracer): consolidate machine execution entry points

Replace fast_run with run_machine and explicit halt validation at Jolt call sites. Require ELF bytes in the shared runner.

* refactor(kernels): pick a round-0 pair's mask column without a sentinel

round0_pair_quadratic classified a row pair that holds one column by
`even.or(odd).map_or(0, |entry| entry.col)`, so an empty pair would have
looked up address 0 in the RAM masks before quadratic_evals rejected it.
The single-column arm now binds the entry it reads the column from, and
the empty pair is the unreachable arm quadratic_evals already asserts;
both callers skip empty pairs before calling. Round messages are
unchanged.

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

* docs(ram): name the streaming read-write slot in the consistency invariant

Main's #2376 added an opt-in streaming slot for the stage-2 RAM
read-write kernel, which reads its cycle rounds off the RAM event log
and shares the default slot's per-entry coefficients and address masks.
The prover/verifier consistency invariant spoke of one optimized kernel;
it now names both slots, whose round messages the kernel parity tests
pin to the reference kernel's.

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

* docs: clarify host-call memory guard guarantees

* perf(tracer): optimize code interval guards

* Revert "perf(tracer): optimize code interval guards"

This reverts commit 3c6f7ab3a2ac973633a69882fd4373f7b64803f3.

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

* fix(tracer): protect code as one contiguous range

Replace the merged source-instruction word intervals with a single code
range: the doubleword holding the first source instruction through the
one holding the last. Padding and read-only data between instructions
are protected with the code, and ELF admission rejects any writable
section that overlaps the range, so code words never fragment.

- jolt-program: code_words and bytecode_code_words return Range<usize>;
  merge_word_intervals and is_code_word are removed, and
  InvalidCodeWordIntervals is renamed InvalidCodeWords.
- tracer: the MMU, the replay seed and the parallel workers hold the
  range; each touched word costs one range check.
- jolt-tracer-x86: each store site compiles one two-bound comparison.
- ACT4 link.ld: place .tohost after .text.rvmodel. jolt-emu-x86 decodes
  ACT4 ELFs through decode_elf and would otherwise reject them.
- Docs: the book's tracer guards, the foreign-toolchain layout, and the
  byte-addressable spec's admission rule.

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

* refactor(tracer): call the protected code span the code region

"Code words" reads as the coding-theory term. Rename the API and prose
for the range from the doubleword holding the first source instruction
through the one holding the last:

- jolt-program: code_words -> code_region, bytecode_code_words ->
  bytecode_code_region, PreprocessingError::InvalidCodeWords ->
  InvalidCodeRegion ("invalid code region: ...").
- tracer: Emulator::protect_code_words -> protect_code_region; the MMU,
  the replay seed and the parallel workers hold `code_region`.
- jolt-tracer-x86: the emitter holds `code_region`.
- decode_elf: "writable section overlaps the protected code region".
- Docs and comments say "code region" instead of "code range" or
  "code words".

RAMPreprocessing::bytecode_words, the program-image words, is unrelated
and unchanged.

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

* fix(arch-tests): pin ACT4 data addresses with a fixed rvmodel slot

ACT4 builds every test twice: a signature build that Sail runs, with
RVMODEL_* routines from sail_macros.h, and a self-checking build that
uses rvmodel_macros.h and embeds the values Sail produced. Some expected
values depend on .data addresses, so .data must sit at the same address
in both builds even though .text.rvmodel differs in size.

Moving .tohost after .text.rvmodel left the variable-size section
directly ahead of .tohost and .data, so for some tests .data moved by
256 bytes between the builds and 8 Zaamo/Zalrsc tests failed in CI.
The old order only held because .tohost's 256-byte alignment happened to
absorb the size difference.

Upstream places .text.rvmodel after .data, but Jolt's code region may
contain no writable section. Give .text.rvmodel a 4 KiB-aligned slot
padded to the next 4 KiB boundary instead, so every later section keeps
its address in both builds, and assert that the routines fit the slot.

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

* fix(tracer): fault on fetches outside the decoded instructions

The native tracer compiles only a program's decoded source instructions,
so a jump into data, padding or the middle of an instruction faults with
FaultBadJumpTarget. The interpreter instead decoded whatever memory held
at the PC and executed it; only the proving path's bytecode check
rejected the run afterwards, and jolt-emu never did.

Bundle the code region with the decoded instruction addresses in one
CodeGuard, which Emulator::protect_code (renamed from
protect_code_region) installs for Jolt guests, and check the PC on every
decode-cache miss, the only path that fills the cache. Replay workers
carry the same guard. Test ELFs reporting through tohost get no guard and
still fetch from memory.

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

* fix(tracer): guard code for test ELFs in jolt-emu

jolt-emu installed the code guards only for ELFs without a `tohost`
symbol, so ACT4 ran under looser rules than tracing for a proof. Since
#2320 the ELF decoder skips assembler-marked data, so ACT4's inline
failure pointers no longer stop the decode and the guards can apply to
every ELF; `tohost` now selects only the HTIF exit and the test memory
size.

One test executes bytes the decoder leaves out: I-fence-00 writes its
reserved and hint FENCE encodings with .word, which the assembler marks
as data, and falls through into them. Skip it, and allow that reason in
the arch-tests README. The generated suite gives 127 passed, 6 skipped.

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

* test(jolt-verifier): regenerate the FS inventory and fuzz bundles

ProgramMetadata's code_word_intervals became code_region, so the source
schema inventory lists the new field. The six fuzz bundles are
regenerated for the new preprocessing digest, which every proof absorbs.

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

* chore: align RAM guard docs and remove redundant tests

---------

Co-authored-by: Michael Zhu <mchl.zhu.96@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…in the guest (a16z#2448)

`JoltProof::narg` is a `Vec<u8>`, which serde decodes as a sequence: one
call into the decoder and one push per byte. A verifier running as a
guest pays that in trace rows for every byte of the argument, and in
Akita proofs the argument is about 75 KB.

Asking every decoder for a byte string instead would be unsafe on
hosts: a decoder asked for an owned byte buffer may allocate the length
the input announces before it reads. So the field keeps its encoding
and its element-wise decoding, and only names itself: it is read as a
newtype struct called `PROOF_ARGUMENT_NEWTYPE` around the same byte
sequence. bincode, postcard and serde_json decode such a newtype as its
content, with the errors they gave before, and a deserializer that
forwards it as a sequence is accepted as well. One difference remains
for a deserializer that forwards a newtype struct and presents a byte
string: it is now accepted where a `Vec<u8>` refuses it.

The recursion example's size-limiting adapter recognises the name and
asks its decoder for borrowed bytes. That decoder reads from a slice,
so it checks the announced length against the bytes that remain before
borrowing them. The adapter charges the argument as the sequence it
stands for, so its budget accepts exactly what it accepted before.

Tests: a proof announcing 2^46, 2^62 or 2^64-1 argument bytes is a
decode error in bincode's slice and reader decoders, in postcard and in
a decoder that recognises the name; the proof type round-trips through
such a decoder; a forwarded sequence decodes; the example's adapter
takes the byte string at the sequence charge.
…16z#2496)

The gate's review attestation now accepts `GPT-6.2 Astra`, `Claude Opus 5.5`
and `Claude Fable 5.2`; a line naming `GPT-6 Astra` no longer counts. The gate
guide, the CONTRIBUTING format example and the ci-code-review skill's local
review command name the new model. The skill also says which Codex CLI has
the model in its model list: 0.169.0 does, 0.162.0 falls back to generic
metadata.

The classifier model (gpt-6.1-sol) and its pinned Codex CLI are unchanged.
@omibo omibo closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.