Skip to content

Conversation

@hero78119
Copy link
Collaborator

@hero78119 hero78119 commented Dec 4, 2025

Related to #1145
Build on top of #1202

design rationale

Make init chip across shard, and assure consecutive address across shards without overlap. The mechanism to read from previous shard works as usual.

remove pitfall of Platform clone

wrap Platform -> prog_data into Arc otherwise each platform clone with a massive and hidden prover cost which we do not aware.

benchmark

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

Component base Time Init-Across-Shard Time Custom Serde Time Init-Across-Shard Improvement Custom Serde Improvement
app.prove 203 s 175 s 167 s ↓ 13.8% ↓ 17.7%
emulator.preflight-execute 43.9 s 35.8 s 36.7 s ↓ 18.5% ↓ 16.4%
app_prove.inner 158 s 139 s 130 s ↓ 12.0% ↓ 17.7%
create_proof_of_shard (shard_id = 0) 14.9 s 4.91 s 8.02 s ↓ 67.0% ↓ 46.2%
create_proof_of_shard (shard_id = 1) 16.4 s 12.7 s 3.56 s ↓ 22.6% ↓ 78.3%

verifier sound TODOs in next PR

This PR got some verifier change, but not fully sound yet. A refactor is need to constrain specific chip number of instance is on the way, in short to support this pi[<chip_id>].num_instance == chip_proof.num_instance. This is needed and assure init heap/hint in each shard are constrain within [platform.heap.start, platform.heap.end) or [platform.hint.start, platform.hint.end)

  • constraint pi[heap_length], pi[hint_length] equal to number of instance of respective init chip.
  • constraint pi[xxx_start_addr] + pi[xxx_length] within range
  • both rust/recursion verifier
  • constrain init chip across shard only allow 1 chip proof

Another TODO for Hint read and rkyz

rkyz serialized data from hint_end -> hint_start, so right now hint still mostly happened in shard one because in first read max_hint_addr goes from end address. This make first shard still need to write bunch of records to shard ram circuit. To further improve this, we need to find way, e.g. make rykv go from lower address to high. So the first shard issue can be solved entirely

@hero78119 hero78119 marked this pull request as draft December 4, 2025 02:02
@hero78119 hero78119 changed the title track heap watermark OMC: init heap table across different shard Dec 5, 2025
@hero78119
Copy link
Collaborator Author

need to figure out soundness #1178

@hero78119 hero78119 added the speed label Dec 5, 2025
@hero78119
Copy link
Collaborator Author

TODO

  • check is there any debug revert, e.g. debug log, or par -> seq change

@hero78119 hero78119 marked this pull request as ready for review December 22, 2025 13:28
@hero78119 hero78119 changed the title OMC: init heap table across different shard OMC: init heap/hint table across different shard Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants