Skip to content

Conversation

@hero78119
Copy link
Collaborator

@hero78119 hero78119 commented Dec 24, 2025

Follow up on #1171
replace rkyv with custom serde for 2 reasons

  • serialization to bytes need to implement rkyv friendly struct, or leverage external library, e.g. "rkyv + bincode". rkyv friendly struct is not friendly for existing application in particular struct are defined in 3rd-party library. Thus previously we integrate bincode for the serialiation to bytes. This bring extra effort for guest program as we need bincode to deserialize back to owned struct.
  • in deserialize rkyv will access high addr to retrieve some meta information before sequential read. Below are example read pattern
hint address 28000004
hint address 28000008
hint address 280c8770 <- high addr accessed to fetch meta data
hint address 280c876c
hint address 280c876c
hint address 280c8770
hint address 28000010
hint address 28000010
hint address 28000010
hint address 28000010
hint address 28000014
hint address 28000014
hint address 28000014
...

The high order access not friendly if we want to record max accessed address in each shard for memory region initialized across shard.

New ceno_serde crates credits to https://github.com/openvm-org/openvm/tree/main/crates/toolchain/openvm/src/serde

benchmark

Run on 23817600 with K=6, cache trace = none, 1x4090

Component Base Time Init-Across-Shard Custom Serde Improvement (vs Base)
app.prove 203 s 175 s 172 s ↓ 15.3%
emulator.preflight-execute 43.9 s 35.8 s 36.3 s ↓ 17.3%
app_prove.inner 158 s 139 s 135 s ↓ 14.6%
create_proof_of_shard (shard_id = 0) 14.9 s 4.91 s 6.83 s ↓ 54.2%
create_proof_of_shard (shard_id = 1) 16.4 s 12.7 s 12.0s ↓ 26.8%

Overall cycle 322620252 -> 315955342 (2.06%)

@hero78119 hero78119 force-pushed the feat/hint_region_seq_read branch from 585ecec to 84625fd Compare December 24, 2025 07:03
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