formal: the statement records are the circuit inputs, projected off the proof - #379
Merged
Merged
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
martyall
force-pushed
the
pickles/accumulator-carry
branch
from
September 18, 2026 07:26
594000a to
bfa50b0
Compare
…indexed by their sizes `PlonkInCircuit f sf`, `DeferredValues k f sf`, `UnfinalizedProof k f bc sf`, the wrap statement family, `AllEvals f`, `PlonkClaims f`, `IvpInput k f bc sf`, `BulletproofOpening k f sf`, `CheckBulletproofInput k f sf`: the cell type `f` (a field element in a value, `FVar F` in a circuit) and the boolean cell `bc` are parameters instead of being derived from the field, and the round challenges, the `(L, R)` pairs, the mask and the slots are vectors at their static sizes (`k` rounds, `MaxProofsVerified`) instead of lists — the shape PureScript's records have had all along. Every use site says `(FVar F) (BoolVar F)` where it said `F`; no field, gadget or proof changes beyond `.toList` where a list is consumed, and `GroupHalf` gains the round index its claims carry. `Pickles.Encoding`: the `CircuitType` instance of every record, derived from its product decomposition (`CircuitType.ofEquiv`), with the reading lemmas the readings gate demands — a value record is seeded and a bundle allocated the way any input is, and the bundle IS the gadget's record. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ojected off the proof `StepFop k` and `WrapFop k` (PicklesFixture.Fop) are products of the gadgets' own records — the unfinalized proof, the evaluations, the mask, the previous-challenge vectors, the domain — and the harnesses hand the allocated bundle to `finalizeOtherProofStep`/`Wrap` as it is. The driver projects them off the wrap statement's cells and the checked proof (`stepFopInput`, `wrapFopInput`, `allEvalsOf`); the named flat bundles (`FopInput`, `FopWrapInput`) and their layout arithmetic go. The flat 151/148-cell harnesses stay for the dump comparison, which is byte-level against those layouts. `bench-fop` runs on the records and imports `Snarky.Compile` itself. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… projected off the proof The step statement packs too: `StepStatement.packed` is its `x_hat` walk (PS `PackedStepPublicInput`) beside `WrapStatement.packed`, with a boolean packed kind for the parity and `should_finalize` cells and `packLeavesOf` shared by both statements; the step statement is indexed by its slot count, and `Pickles.Encoding` covers it. `StepGroup` and `WrapGroup` (PicklesFixture.Group) are products of the gadgets' records — the two statements, the unfinalized proof, the proof's commitments and opening (`IvpProof`), the `sg_old` points — and `ivpInputOf` lays them out as the gadget's input with the key as constants. The wrap side reads its keep bits off the wrap statement's branch data and its booleanity checks off the step statement's packing. The named flat bundles, their instances and their offset projections go; the dump comparison builds `IvpProof` from its offsets. The driver unpacks the two statements once (`wrapStatementOf`, `stepStatementOf`) and every lane projects off them and the checked proof (`ivpProofOf`, `sgOldOf`). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
martyall
force-pushed
the
pickles/records-as-values
branch
from
September 18, 2026 07:29
9ca9707 to
34e1d8d
Compare
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.
Stacked on #378 (which is stacked on #377).
The fixture drivers fed the pickles gadgets through flat cell bundles (
FopInput,GroupStepInput, …): every layout spelled twice, offset arithmetic in three places, and a proof reaching a gadget through a vector that was neither its wire form nor the gadget's record. The gadget records could not be the input type because their cell type was hard-wired toFVar Fand their round-indexed fields wereLists.The records
Three commits.
PlonkInCircuit f sf,DeferredValues k f sf,UnfinalizedProof k f bc sf, the wrap statement family,AllEvals f,PlonkClaims f,IvpInput k f bc sf,BulletproofOpening k f sf,CheckBulletproofInput k f sf:fis a field element in a value andFVar Fin a circuit (PureScript's letter;Fstays the field),bcthe boolean cell, and the round challenges,(L, R)pairs and mask areVectors at their static sizes — PureScript's shape. Use sites say(FVar F) (BoolVar F)where they saidF; no gadget or proof changed beyond.toListwhere a list is consumed, andGroupHalfcarries the round index its claims have.Pickles.Encodingderives every record'sCircuitTypefrom its product decomposition, with the reading lemmas the gate demands.StepFop k/WrapFop k, products of the gadgets' records; the driver projects them off the wrap statement and the checked proof.FopInput.leanis gone; the flat 151/148 harnesses stay for the dump comparison, which is byte-level against those layouts.StepStatement.packed, itsx_hatwalk, besideWrapStatement.packed, with a boolean packed kind andpackLeavesOfshared),StepGroup/WrapGroupare products of the statements, the unfinalized proof,IvpProof(a proof's commitments and opening, sized) and thesg_oldpoints;ivpInputOflays them out as the gadget's input with the key as constants. The wrap side reads its keep bits off the branch data and its booleanity checks off the packing.Group.leanloses its two bundles and their projections; the driver unpacks each statement once (wrapStatementOf,stepStatementOf) and every lane projects off them.Not done
IvpInput's commitment lists stayList(the batch-order proofs use them at ~330 sites), so the group half's proof part is the sized tupleIvpProofbeside the record rather than the record itself.Layout.lean's offset readers andFop.lean's flat harnesses stay for check_cs.Verified
Full build, check-cs (54 circuits), check-halves 37/37 on the records, dead-code, readings, shake on the CI list, runLinter on
PicklesandPicklesFixture, style (the three long carry-lane lines belong to #378).🤖 Generated with Claude Code