Skip to content

Reflect reviews#35

Merged
mellowcroc merged 5 commits into
mainfrom
jason/reflect-reviews-3
Oct 23, 2025
Merged

Reflect reviews#35
mellowcroc merged 5 commits into
mainfrom
jason/reflect-reviews-3

Conversation

@mellowcroc

Copy link
Copy Markdown
Collaborator

No description provided.

@mellowcroc mellowcroc changed the title Reflect reviews from Mathias Reflect reviews Sep 30, 2025
@mellowcroc
mellowcroc requested a review from rot256 September 30, 2025 13:30
@mellowcroc mellowcroc self-assigned this Sep 30, 2025

@rot256 rot256 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

Comment thread src/SUMMARY.md
- [AIR Development](air-development/index.md)

- [Writing a Simple AIR](air-development/writing-a-simple-air/index.md)
- [First Breath of AIR](air-development/writing-a-simple-air/index.md)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Comment thread src/air-development/additional-examples/index.md
</figure>

When we implement this in Stwo, the traces of each component will look like [Figure 2](#fig-component-trace) above. Each component has its own original and LogUp traces, and each the inputs and outputs of each component are connected by lookups. Since the scheduling component sets the LogUp value as a positive multiplicity and the computing component sets the same value as a negative multiplicity, the verifier can simply check that the sum of the two LogUp columns is zero. Note that we combine the input and output randomly (as $\dfrac{1}{Z - x \cdot \alpha^0 - (x^5+1) \cdot \alpha^1}$) to form a single lookup. This is because we want to ensure that each input is paired with the correct output. If we add the input and output as separate lookups (as $\dfrac{1}{Z - x} + \dfrac{1}{Z - (x^5+1)}$), a malicious prover can switch the output with a different row and still come up with a valid proof. For example, the following traces would be valid:
When we implement this in Stwo, the traces of each component will look like [Figure 2](#fig-component-trace) above. Each component has its own original and LogUp traces, and the inputs and outputs of each component are connected by lookups. Since the scheduling component sets the LogUp value as a positive multiplicity and the computing component sets the same value as a negative multiplicity, the verifier can simply check that the sum of the two LogUp columns is zero. Note that we combine the input and output randomly as

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we combine the input and output randomly as:

Nit, is the combination of the (input,output) tuple not just $x \cdot \alpha^0 - (x^5+1) \cdot \alpha^1$

Comment thread src/air-development/components/index.md Outdated
Comment thread src/air-development/components/index.md Outdated
Comment thread src/air-development/writing-a-simple-air/constraints-over-trace-polynomials.md Outdated
When precomputing twiddles, we need to set the `log_size` of the domain to `log_num_rows + LOG_CONSTRAINT_EVAL_BLOWUP_FACTOR + config.fri_config.log_blowup_factor`. Simply put, `log_num_rows + LOG_CONSTRAINT_EVAL_BLOWUP_FACTOR` corresponds to the log degree of the composition polynomial and `config.fri_config.log_blowup_factor` is required to run FRI on the composition polynomial.

Note, however, that this is not a precise explanation, since we do not commit directly to the composition polynomial. Instead, we commit to the quotient polynomial $Q(x,y)$, which is computed by dividing the composition polynomial $C(x,y)$ by the vanishing polynomial $V(x,y)$. The vanishing polynomial vanishes (i.e. evaluates to 0) over the trace domain and thus has a degree of `1 << log_num_rows`. We can therefore calculate the size of the domain that we need as `(1 << (log_num_rows + LOG_CONSTRAINT_EVAL_BLOWUP_FACTOR) - 1 << log_num_rows) * (1 << config.fri_config.log_blowup_factor)`. However, since the size of the domain needs to be a power of 2, we will need to use the value `1 << (log_num_rows + LOG_CONSTRAINT_EVAL_BLOWUP_FACTOR + config.fri_config.log_blowup_factor)` unless `LOG_CONSTRAINT_EVAL_BLOWUP_FACTOR <= 1`. Thus, Stwo simply requires that the maximum domain size is to the value we defined above: the degree of the composition polynomial multiplied by the FRI blowup factor.
````

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is one too many ` here

Comment thread src/air-development/writing-a-simple-air/constraints-over-trace-polynomials.md Outdated
Comment thread src/air-development/writing-a-simple-air/constraints-over-trace-polynomials.md Outdated
Comment thread src/how-it-works/lookups.md Outdated
@mellowcroc
mellowcroc force-pushed the jason/reflect-reviews-3 branch from 0b3ecd3 to 4052c29 Compare October 23, 2025 05:58
@mellowcroc
mellowcroc merged commit 0394484 into main Oct 23, 2025
1 check passed
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.

2 participants