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

Merge trace writer and trace generator. #672

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

alonh5
Copy link
Contributor

@alonh5 alonh5 commented Jun 23, 2024

This change is Reviewable

Copy link
Contributor Author

alonh5 commented Jun 23, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @alonh5 and the rest of your teammates on Graphite Graphite

@alonh5 alonh5 mentioned this pull request Jun 23, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 23, 2024

Codecov Report

Attention: Patch coverage is 8.00000% with 23 lines in your changes missing coverage. Please review.

Project coverage is 90.09%. Comparing base (91a2833) to head (2ce2998).

Files Patch % Lines
crates/prover/src/trace_generation/registry.rs 0.00% 12 Missing ⚠️
crates/prover/src/core/prover/mod.rs 15.38% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #672      +/-   ##
==========================================
- Coverage   90.29%   90.09%   -0.21%     
==========================================
  Files          75       75              
  Lines       10030    10053      +23     
  Branches    10030    10053      +23     
==========================================
  Hits         9057     9057              
- Misses        892      915      +23     
  Partials       81       81              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch from 8da2844 to ad0dfc3 Compare June 23, 2024 14:19
Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 10 files at r1, all commit messages.
Reviewable status: 9 of 10 files reviewed, 2 unresolved discussions (waiting on @alonh5)


crates/prover/src/examples/fibonacci/component.rs line 142 at r1 (raw file):

        _registry: &mut ComponentRegistry,
    ) -> ColumnVec<CircleEvaluation<CpuBackend, BaseField, BitReversedOrder>> {
        vec![]

Do we want to implement write_trace here?
Could be done in another pr

What would it require to use this write_trace function instead of the current implementation?

Code quote:

vec![]

crates/prover/src/examples/wide_fibonacci/component.rs line 266 at r1 (raw file):

        _registry: &mut ComponentRegistry,
    ) -> ColumnVec<CircleEvaluation<CpuBackend, BaseField, BitReversedOrder>> {
        vec![]

same

Code quote:

        vec![]

Copy link
Contributor Author

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 9 of 10 files reviewed, 2 unresolved discussions (waiting on @shaharsamocha7)


crates/prover/src/examples/fibonacci/component.rs line 142 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Do we want to implement write_trace here?
Could be done in another pr

What would it require to use this write_trace function instead of the current implementation?

Yes I'll start working on it in a new PR.


crates/prover/src/examples/wide_fibonacci/component.rs line 266 at r1 (raw file):

Previously, shaharsamocha7 wrote…

same

same

Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 9 of 10 files reviewed, 2 unresolved discussions (waiting on @alonh5)


crates/prover/src/trace_generation/mod.rs line 19 at r1 (raw file):

// A trait to generate a a trace.
// Generates the trace given a list of inputs collects inputs for subcomponents.
pub trait TraceGenerator<B: Backend> {

Do you think we should do this renaming? because I see that we also have AirTraceGenertor.

If so, can you do it in another pr?

Suggestion:

pub trait ComponentTraceGenerator<B: Backend> {

crates/prover/src/trace_generation/mod.rs line 45 at r1 (raw file):

pub trait AirTraceVerifier {
    fn interaction_elements(&self, channel: &mut Blake2sChannel) -> InteractionElements;
}

I think that this trait should be in the core library (it is used also by the verifier)

Code quote:

pub trait AirTraceVerifier {
    fn interaction_elements(&self, channel: &mut Blake2sChannel) -> InteractionElements;
}

Copy link
Contributor Author

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 9 of 10 files reviewed, 2 unresolved discussions (waiting on @shaharsamocha7)


crates/prover/src/trace_generation/mod.rs line 19 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Do you think we should do this renaming? because I see that we also have AirTraceGenertor.

If so, can you do it in another pr?

Done in this PR.


crates/prover/src/trace_generation/mod.rs line 45 at r1 (raw file):

Previously, shaharsamocha7 wrote…

I think that this trait should be in the core library (it is used also by the verifier)

Technically the verify function receives an Air which is also an AirTraceVerifier, but I think it's better to leave it close to the AirTraceGenerator. Do you think that's okay?

@alonh5 alonh5 force-pushed the 06-20-air_is_airtraceverifier branch from d52fcf0 to 645ada3 Compare June 24, 2024 10:03
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch from ad0dfc3 to f3e308f Compare June 24, 2024 10:03
Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 10 files reviewed, 1 unresolved discussion (waiting on @alonh5)


crates/prover/src/trace_generation/mod.rs line 45 at r1 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

Technically the verify function receives an Air which is also an AirTraceVerifier, but I think it's better to leave it close to the AirTraceGenerator. Do you think that's okay?

Yes, but that raises another question?
Why isn't the function interaction_elements just part of the Air trait?

Copy link
Contributor Author

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 10 files reviewed, 1 unresolved discussion (waiting on @shaharsamocha7)


crates/prover/src/trace_generation/mod.rs line 45 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Yes, but that raises another question?
Why isn't the function interaction_elements just part of the Air trait?

That's because for the prover we need that function before we know all the components, in the trace generation phase. If we want it to be part of Air then AirTraceGenerator would also have to be an Air and therefore know it's components (we've talked about this before).

Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 10 files at r1, 8 of 8 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @alonh5)


crates/prover/src/trace_generation/mod.rs line 45 at r1 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

That's because for the prover we need that function before we know all the components, in the trace generation phase. If we want it to be part of Air then AirTraceGenerator would also have to be an Air and therefore know it's components (we've talked about this before).

right

This was referenced Jun 24, 2024
@alonh5 alonh5 force-pushed the 06-20-air_is_airtraceverifier branch from 645ada3 to b878fc3 Compare June 25, 2024 08:38
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch from f3e308f to c629f7d Compare June 25, 2024 08:38
@alonh5 alonh5 force-pushed the 06-20-air_is_airtraceverifier branch from b878fc3 to 4694a06 Compare June 26, 2024 10:24
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch from c629f7d to f39cfea Compare June 26, 2024 10:24
@alonh5 alonh5 force-pushed the 06-20-air_is_airtraceverifier branch from 4694a06 to 59886e5 Compare June 27, 2024 10:56
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch from f39cfea to 3aa5079 Compare June 27, 2024 10:56
@alonh5 alonh5 force-pushed the 06-20-air_is_airtraceverifier branch from 59886e5 to aec56e7 Compare June 27, 2024 11:43
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch from 3aa5079 to 673b1b3 Compare June 27, 2024 11:43
@alonh5 alonh5 force-pushed the 06-20-air_is_airtraceverifier branch from aec56e7 to 3bce92a Compare June 30, 2024 08:32
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch from 673b1b3 to 50be746 Compare June 30, 2024 08:32
@alonh5 alonh5 force-pushed the 06-20-air_is_airtraceverifier branch from 3bce92a to 9b97335 Compare July 1, 2024 10:48
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch from 50be746 to ca2c907 Compare July 1, 2024 10:48
@alonh5 alonh5 force-pushed the 06-20-air_is_airtraceverifier branch from 9b97335 to f7132f1 Compare July 1, 2024 11:09
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch from ca2c907 to 2f0aac7 Compare July 1, 2024 11:10
@alonh5 alonh5 force-pushed the 06-20-air_is_airtraceverifier branch from f7132f1 to a60ae54 Compare July 2, 2024 12:58
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch 2 times, most recently from 0d56bd7 to 93dd654 Compare July 3, 2024 07:49
Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 8 of 8 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alonh5)


crates/prover/src/trace_generation/mod.rs line 37 at r3 (raw file):

    ) -> ColumnVec<CircleEvaluation<B, BaseField, BitReversedOrder>>;

    fn write_interaction_trace(

Add documentation

Code quote:

fn write_interaction_trace(

@alonh5 alonh5 force-pushed the 06-20-air_is_airtraceverifier branch from a60ae54 to 718f366 Compare July 8, 2024 07:31
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch from 93dd654 to f8d5799 Compare July 8, 2024 07:32
@alonh5 alonh5 force-pushed the 06-20-air_is_airtraceverifier branch from 718f366 to 5b306cd Compare July 8, 2024 08:07
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch from f8d5799 to 9bb7d3a Compare July 8, 2024 08:07
@alonh5 alonh5 force-pushed the 06-20-air_is_airtraceverifier branch from 5b306cd to 2e8eed6 Compare July 8, 2024 10:30
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch 2 times, most recently from 4e36e51 to ddf0fe6 Compare July 8, 2024 11:00
@alonh5 alonh5 changed the base branch from 06-20-air_is_airtraceverifier to dev July 8, 2024 11:00
@alonh5 alonh5 force-pushed the 06-23-merge_trace_writer_and_trace_generator branch from ddf0fe6 to 2ce2998 Compare July 8, 2024 11:06
Copy link
Contributor Author

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 11 files reviewed, 1 unresolved discussion (waiting on @shaharsamocha7)


crates/prover/src/trace_generation/mod.rs line 37 at r3 (raw file):

Previously, shaharsamocha7 wrote…

Add documentation

Done.

Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 9 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @alonh5)

Copy link
Contributor Author

alonh5 commented Jul 8, 2024

Merge activity

  • Jul 8, 7:18 AM EDT: @alonh5 started a stack merge that includes this pull request via Graphite.
  • Jul 8, 7:18 AM EDT: @alonh5 merged this pull request with Graphite.

@alonh5 alonh5 merged commit 4231088 into dev Jul 8, 2024
14 checks 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.

3 participants