Skip to content

feat: add Goldilocks backend + two-field differential fixtures#460

Open
BornPsych wants to merge 9 commits into
worldfnd:sl/goldilocks-field-abstractionfrom
BornPsych:ys/goldilocks-backend-and-fixtures
Open

feat: add Goldilocks backend + two-field differential fixtures#460
BornPsych wants to merge 9 commits into
worldfnd:sl/goldilocks-field-abstractionfrom
BornPsych:ys/goldilocks-backend-and-fixtures

Conversation

@BornPsych

Copy link
Copy Markdown
Collaborator

Summary

Adds provekit-backend-goldilocks, a second backend that instantiates the field-generic spine over the ~192-bit Goldilocks cubic extension Field64_3, and restructures provekit-fixtures so the prove→verify and soundness suites run over both bn254 and goldilocks from shared, field-generic test bodies. bn254 is unchanged.

This is the backend half of the field-generic work: #458/#459 made the spine generic over <P: ProofField> and added the scheme builder + fixtures; this PR shows a second, structurally different field plugs in with no spine edits.

Why

The spine was made field-generic precisely so a non-bn254 field could be added as a backend crate plus an instantiation, with no changes to common / prover / verifier. Goldilocks is the validation field: a 64-bit prime whose cubic extension Field64_3 is large enough (~192 bits) to draw Fiat-Shamir challenges from. This PR is the proof that the seam holds — the backend is a marker type implementing ProofField / FieldHash plus a register() call, nothing more. (Pre-EF/BF the embedding is Identity<Field64_3>, so base == ext for now; the base≠ext split lands once zkWHIR supports it.)

What changed

  • provekit-backend-goldilocks (new): GoldilocksField with Embedding = Identity<Field64_3>; a FieldHash impl with a Sha256 default hash, 24-byte little-endian canonical bytes, digest-spread hashing, and a transcript sponge; register() installs the Field64_3 NTT engine in whir's global registry. Mirrors the provekit-backend-bn254 layout.
  • provekit-fixtures: the bn254-only roundtrip.rs / soundness.rs are replaced by tests/shared/mod.rs — field-generic <P: FieldHash> test bodies plus roundtrip_suite! / soundness_suite! macros — and four thin per-field instantiation files (bn254_*, goldilocks_*). The same assertions now run over both fields.
  • Workspace: registers the new crate as a member + workspace dep, and adds it as a fixtures dev-dep.

Verification

  • cargo build --workspace green.
  • provekit-fixtures: bn254 6 roundtrip + 4 soundness, goldilocks 6 roundtrip + 4 soundness — all pass; 2 benches ignored.
  • provekit-backend-goldilocks unit tests (byte roundtrip) pass.

Stacks on #459 (open); until that merges, the commit list above includes #459's commits — the Goldilocks-specific changes are the final 2 commits.

@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@BornPsych is attempting to deploy a commit to the World Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@BornPsych BornPsych changed the base branch from main to sl/goldilocks-field-abstraction June 24, 2026 04:42
BornPsych pushed a commit that referenced this pull request Jun 30, 2026
Rebased onto PR #460 head (dual-commit + LogUp/multi-challenge fixtures). The
base-field split breaks the challenge-bearing fixtures: they place ext challenge
values in the witness, which a base witness can't hold (that needs the k-base
LogUp construction, plan T12). Resolution:

- GoldilocksField = Basefield<Field64_3> stays the canonical field (the real
  target); GoldilocksEfField = Identity<Field64_3> is an explicitly-TEMPORARY
  crutch, to be deleted once T12 lets challenge fixtures run on base.
- Split the suite macros: roundtrip_suite!/soundness_suite! keep the
  base-compatible tests (run on GoldilocksField); new challenge_roundtrip_suite!/
  challenge_soundness_suite! hold the LogUp/multi-challenge tests (run on
  GoldilocksEfField for goldilocks, Bn254Field for bn254).

All fixtures green: goldilocks base suite on BaseField + challenge suite on
Identity, bn254 full set. The planning signal for the frontend work: the LogUp/
dual-commit fixtures need T12 (base challenges, k=3 parallel repetition) to run
under the real base-field target.
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.

1 participant