Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fully support intermediate columns #2009

Open
5 tasks
georgwiese opened this issue Oct 31, 2024 · 0 comments
Open
5 tasks

Fully support intermediate columns #2009

georgwiese opened this issue Oct 31, 2024 · 0 comments

Comments

@georgwiese
Copy link
Collaborator

georgwiese commented Oct 31, 2024

Intermediate columns are just algebraic expressions, but they are not in-lined by the condenser. We've always had them, but usually access them via Analyzed::identities_with_inlined_intermediate_polynomials, so they actually end up being the same as an expression in PIL. I think we should stop doing that and eventually remove the function. There are 2 major use-cases:

Inlined expressions can be exponentially large

In cases where the same sub-expression is repeated many times, extracting that into an intermediate polynomial can reduce the size of the expression exponentially:

All constraints need to be evaluated:

  • By witness generation in every row of the trace (to solve for the witness)
  • By the prover at every point of the quotient domain (e.g. twice the number of rows of the trace), to compute the quotient polynomial
  • By the verifier at a random point

Hence, having an efficient algorithm to evaluate a polynomial constraint benefits all three steps.

Next steps:

Intermediate polynomials can be turned into witness polynomials to reduce the constraint degree

A good example is Poseidon: Since it is an algebraic hash function, each output can be directly expressed as a very nested (and high-degree) algebraic expression of the inputs. The only reason we'd commit to any intermediate results would be to reduce the degree of the constraints.

Currently, we explicitly introduce witness columns to keep the degree low. That's not great for two reasons:

  • The degree bound depends on the backend, and we want the Poseidon implementation to not depend on the backend.
  • Even if we know the degree bound when writing the machine, we're likely not making optimal choices on which column to materialize, see this comment.

Next steps:

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

No branches or pull requests

1 participant