Skip to content

feat: higher FRI arity - #2

Open
OsamaAlkhodairy wants to merge 16 commits into
mainfrom
feat/fri-higher-arity-2
Open

feat: higher FRI arity#2
OsamaAlkhodairy wants to merge 16 commits into
mainfrom
feat/fri-higher-arity-2

Conversation

@OsamaAlkhodairy

Copy link
Copy Markdown

No description provided.

@OsamaAlkhodairy OsamaAlkhodairy changed the title Feat: higher FRI arity feat: higher FRI arity Dec 20, 2024
Comment thread fri/src/prover.rs Outdated
Comment thread fri/src/prover.rs
Comment thread fri/src/prover.rs Outdated
cur_folded_len /= 2;
}

let folded_matrix = RowMajorMatrix::new(folded.clone(), arity);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

it would be best to avoid this folded.clone() since that's an entire matrix. below, can you use leaves in place of folded? it would make the code a little more readable too

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

it actually makes the code uglier since leaves gives you only a reference, so the first fold will be a bit special. I'll also need to figure out how to pass that matrix reference to g.fold_matrix but with the width changed (to 2). do you know how to do that?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

at least for now, DenseMatrix has pub width so you could just do folded_matrix.width = 2 since the underlying storage is row major vector.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

leaves only give us an immutable reference

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

noting we're leaving for now, but could probably use .as_view()

Comment thread fri/src/prover.rs
Comment thread fri/src/prover.rs
Comment thread fri/src/verifier.rs Outdated
Comment thread fri/src/verifier.rs Outdated
Comment thread fri/src/verifier.rs Outdated
Comment thread fri/src/verifier.rs Outdated
Comment thread fri/src/verifier.rs

@jonathanpwang jonathanpwang left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Mostly looks good to me but:

  1. there is an assumptions that two matrices don't have the same height, which is not necessarily true
  2. avoid clone of matrices
  3. add example in the code

One last thing I'm not sure about: if arity is 4 and we start with max height of 8, what happens? it will fold down to 2 and then stop? do we need the final poly height to equal 2?

Comment thread fri/src/prover.rs Outdated

@jonathanpwang jonathanpwang left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

@OsamaAlkhodairy
OsamaAlkhodairy force-pushed the feat/fri-higher-arity-2 branch from c396e2c to 9908231 Compare January 11, 2025 18:01
@OsamaAlkhodairy
OsamaAlkhodairy force-pushed the feat/fri-higher-arity-2 branch from 697ec61 to 90d461d Compare March 23, 2025 22:45
@OsamaAlkhodairy
OsamaAlkhodairy force-pushed the feat/fri-higher-arity-2 branch from 90d461d to 64639b0 Compare March 23, 2025 22:51
jonathanpwang pushed a commit that referenced this pull request Apr 27, 2025
* Another take on expanding Serializing Hasher.

If we add methods to fields letting us decompose them in u8's/u32's we can have those decompositions work with the hashes.

* Add Hashing trait to field

* Adding comments and impls for all our fields

* Added Comments

* Comment improvements

* Removing Undefined Behaviour

* Implementing our own ArrayChunks

* fmt

* Adding tests

* Fixing a big. (Turns out testing things can be useful...)

* Using macro's to avoid duplicated implementations.

* Minor comments and improving IntoRawBytes for extension fields.

* comment fixes.
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