Repository navigation
feat(prover-ray): pack up to 4 fractions per log-derivative column - #4211
Open
ThomasPiellard wants to merge 1 commit into
Open
ThomasPiellard wants to merge 1 commit into
ThomasPiellard wants to merge 1 commit into
Conversation
Signed-off-by: Thomas Piellard <thomas.piellard@gmail.com>
This branch has not been deployed
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.
feat(prover-ray): pack up to 4 fractions per log-derivative column
Follow-up of #4171 (cyclic
logderivativesumrunning sums).Summary
The
logderivativesumcompiler packs the fractions of a module into running-sum (Z) columns. It used to pack exactly 3 per column (packingArity = 3). It now packs up to 4, greedily and in order, as long as the column's recurrence stays of degree factor at most 5.With linear filters, numerators and denominators (all lookup fractions), modules with many fractions get up to 25% fewer Z columns, and as many fewer average cells, at no extra cost in the quotient.
Why 4 is now free
A Z column packing fractions
F_j·N_j/D_jhas the cyclic recurrencezNum − (Z − Z[−1] + C)·zDen, of degree factorthat is 4 for 3 linear fractions and 5 for 4.
localvanishingwith a Lagrange selector of degree factor 1. 4 fractions gave degree factor 6, so the global quotient ratio jumped from 4 to 8.globalcompiler's ratio isNextPowerOfTwo(degree − 1), which is 4 for both degree 4 and degree 5.I checked this directly: a column of 3 and a column of 4 linear filtered fractions both get the same four ratio-4 quotient shares (
q-r4-s0…s3).Change
packingArityis 4.maxPackedDegree = 5, applies to the recurrence's degree factor.packedDegreecomputes it from the expressions'DegreeFactor().packFractionsis now greedy: a group takes the next fraction while it has fewer than 4 and the degree stays at most 5. A group always holds at least one fraction, whatever its degree.Soundness
None of the argument changes. Packing is only algebra on the same fractions: a column's total is still the sum of its fractions. The cyclic recurrence, the average cells and the verifier's
Σ n·C = Resultcheck are unchanged.The shape of compiled systems changes, though: there are fewer Z columns and average cells. Proofs from before this change don't verify after it.
verifier-ray
verifier-ray pins its prover-ray version, so this PR doesn't affect it. When verifier-ray is bumped past it, its generated fixtures must be regenerated (
make generate-testdata), since the number of entries per log-derivative query changes. No code change is needed there: the codegen reads the entries from the compiled system.Tests
TestCompile_PacksFractionsis now table-driven:Every case also checks that each recurrence has degree factor ≤ 5 and cancels no row.
go test ./wiop/...passes, including the full pipeline (lookups → log-derivative → local vanishing → global → PCS).go test ./zkcdriverpasses (it proves zkc systems end to end), exceptTestZkcIntegrationTestSynced, which needsmake download-zkc-testdataand fails onmaintoo without it.🤖 Generated with Claude Code
Note
Medium Risk
Changes compiled WIOP shape (fewer Z columns and average cells), so proofs and verifier-ray fixtures must be regenerated after bump; constraint logic is unchanged but deployment coupling is real.
Overview
The log-derivative sum compiler now packs up to four fractions per running-sum Z column (was three), using greedy in-order grouping instead of fixed-size chunks.
Packing is capped by a new
maxPackedDegree(5) on the cyclic recurrence’s degree factor, computed bypackedDegreefrom numerator, denominator, and filterDegreeFactor()values. Higher-degree fractions still pack fewer per column so the global quotient ratio stays at 4 (degree 4 and 5 both map to the same ratio after cyclic recurrence). The unusedutilsimport is dropped.TestCompile_PacksFractionsis table-driven and asserts column counts, recurrence degree ≤ 5, and that no rows are cancelled on the cyclic vanishing.Reviewed by Cursor Bugbot for commit d00e248. Bugbot is set up for automated code reviews on this repo. Configure here.