Repository navigation
perf(algebra): optional no-carry tensor contraction for dense residual equality weights - #272
Closed
Acentelles wants to merge 2 commits into
Conversation
This was referenced Oct 26, 2026
Collaborator
Author
|
Folded into #277. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
A new feature
tensor-no-carryinakita-algebra, off by default.With the feature on,
materialize(offset_eq/tensor_pair/materialize.rs) separates the dense residual equality weights into a high-part sum and a low span through the newmaterialize/separate.rs(prepareandevaluate). The low span is contracted without carry propagation. Shapes that do not fit (carry-mixed residues, possible overflow) are declined and take the existing path. Without the feature, the code path is unchanged.The branch also carries the lockfile-only
ctutils0.4.6 bump for RUSTSEC-2026-0385.Why
When the verifier runs inside a zkVM guest, every executed instruction is a trace row of the outer proof. Separating the high-part sum lets the low span be contracted without carry propagation, which costs fewer guest instructions and gives the same field values.
Benefit
Total trace rows (real plus virtual) of Jolt's recursion example (a16z/jolt#2143), whose guest verifies one Akita proof of an inner Jolt proof, without and with this feature:
The gain is smaller on the last build because it interacts with that register-allocation setting. The Akita proof is unchanged (72,672 bytes at$2^{12}$ , 75,817 at $2^{20}$ ). The effect on this branch alone, without the other recursion changes, was not separately measured, and no published-build figure isolates this change.
How it was tested
separate.rscompare the separated residual with boolean equality at zero and one challenges, and check that carry-mixed residues and overflow are declined.Risks and limits
timeout-minutes: 40in.github/workflows/ci.ymlon the base branch) on this branch, as on every PR in this series againstmarkos/recursion-integration, including those that do not touch the code it runs. It is a CI time budget, not a test failure; Format, Clippy and the Test shards pass.How to turn it off
The feature is off by default. A consumer enables
tensor-no-carryonakita-algebra.Evidence
Commits: this head
3c10baf5; the change9371be51.