feat: add host configurable memory cell type to MemoryConfig#1903
Conversation
CodSpeed WallTime Performance ReportMerging #1903 will degrade performances by 23.01%Comparing
|
| Benchmark | BASE |
HEAD |
Change | |
|---|---|---|---|---|
| ⚡ | benchmark_execute[fibonacci_iterative] |
52.8 ms | 40.9 ms | +28.98% |
| ⚡ | benchmark_execute[fibonacci_recursive] |
81.4 ms | 66.7 ms | +22.03% |
| ❌ | benchmark_execute[keccak256] |
37 ms | 48.1 ms | -23.01% |
| ❌ | benchmark_execute[sha256] |
37.2 ms | 46.5 ms | -20.03% |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@Golovanov399 should be ready for review |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| ## [Unreleased] | ||
|
|
||
| ### Added | ||
| - (Config) Added `addr_spaces` vector of `AddressSpaceHostConfig` to `MemoryConfig`. |
There was a problem hiding this comment.
And removed addr_space_sizes?
There was a problem hiding this comment.
addr_space_sizes was only added in feat/new-execution so 1.3.0 doesn't know about it
| Self::Null => unreachable!(), | ||
| Self::U8 => F::from_canonical_u8(*value.get_unchecked(0)), | ||
| Self::U16 => F::from_canonical_u16(core::ptr::read(value.as_ptr() as *const u16)), | ||
| Self::U32 => F::from_canonical_u32(core::ptr::read(value.as_ptr() as *const u32)), |
There was a problem hiding this comment.
is there any advantage of U32 <-> F being not the same as Native <-> F?
There was a problem hiding this comment.
I just put it there in case for some reason we want to use canonical form instead of Montgomery form or maybe to support PrimeField64, but right now we don't need it
Co-authored-by: Golovanov399 <Golovanov12345@gmail.com>
Commit: e82c995 |
Add trait
AddressSpaceHostLayoutwith concrete implementation as enumMemoryCellType.Add
AddressSpaceHostConfigstruct and nowMemoryConfigstores a vec of these, one per address space.Now all handling of conversions from raw bytes to
Fis done through this config.Comparison: https://github.com/axiom-crypto/openvm-reth-benchmark/actions/runs/16532679208
Memory finalize time seems to have increased significantly percentage-wise, but it is still on the order of milliseconds so I think negligible?