plonky2 icon indicating copy to clipboard operation
plonky2 copied to clipboard

Remove unstable features

Open nbgl opened this issue 3 years ago • 3 comments

We should work towards making Plonky2 compile on stable.

Unstable features that need to either be removed from Plonky2 or that need to be stabilized in Rust:

  • [x] asm_sym Used in one asm! block but I can easily remove it and just pass a pointer.
  • [x] generic_const_exprs Used by PackedField (in from_arr/to_arr); these methods can be removed, although having to do so will make me curse Rust's half-baked type system. I think it's also used in the plonky2 crate, but I'm not sure where.
  • [ ] specialization There are two traits that use this: Square and Packable. The default implementation of the former is just for convenience and can be removed. The latter has a default implementation so Rust can prove that every Field is Packable. We can remove the default impl if we merge both traits.
  • [x] stdsimd Used for Neon support in Poseidon. Also used for packed AVX-512 arithmetic in #400. ARM Poseidon can be done in pure asm, removing the need for intrinsics. We can replace AVX-512 with AVX2 when compiling on stable, at a performance penalty.

nbgl avatar Jan 03 '22 22:01 nbgl

Removed the generic_const_exprs feature from the field crate in #1020 and from the plonky2 crate in #1024.

unzvfu avatar May 10 '23 11:05 unzvfu

Would the EVM crate also be aimed for compiling on stable? If so, we'd need to remove the let_chains and generic_const_exprs features. The first one would be easy to do, and perf. penalty (if any) by the two nested loops wouldn't be an issue as this is only used for building the Kernel. Removing the latter would be more painful though.

Nashtare avatar Aug 02 '23 13:08 Nashtare

I'm also assuming here that the same goal is desired in starky? But that means that Stark::COLUMNS and Stark::PUBLIC_INPUTS have to be removed.

eightfilms avatar Sep 12 '23 02:09 eightfilms