Skip to content

perf(planner): prefer narrower roots within payload slack - #344

Closed
markosg04 wants to merge 5 commits into
LayerZero-Labs:mainfrom
markosg04:perf/akita-protocol-opts
Closed

perf(planner): prefer narrower roots within payload slack#344
markosg04 wants to merge 5 commits into
LayerZero-Labs:mainfrom
markosg04:perf/akita-protocol-opts

Conversation

@markosg04

@markosg04 markosg04 commented Aug 1, 2026

Copy link
Copy Markdown

Summary

The scalar planner currently chooses the smallest proof payload even when a negligible payload difference requires a wider root commitment. This adds an opt-in payload budget: find the minimum-payload candidates, admit candidates within ceil(min_payload * (1000 + slack_permille) / 1000), then choose the smallest root inner rank and payload. Recursive configurations carry the same budget into direct fallback.

The Akita default remains zero; Jolt's adapters use 10 (1%). The parameter is included in generated-catalog identity, and every selected candidate still passes the existing SIS, fold-bound, setup-envelope, and schedule checks.

Testing

  • Ran tests for modified crates
  • cargo fmt --all --check passes
  • Relevant cargo clippy mode passes

The full local nextest suite passes (1,202 tests), schedule regeneration is clean, and all three required Clippy configurations pass with warnings denied.

Security Considerations

  • Verifier acceptance behavior is unchanged, or the intended change is specified.
  • Verifier-reachable malformed inputs return typed errors instead of panicking.
  • Transcript labels, challenge order, and domain separation are unchanged, or the intended change is specified.
  • Serialization changes preserve canonical decoding and bounded untrusted input handling.
  • New dependencies, Git dependencies, or CI actions are justified and pass supply-chain policy.
  • Unsafe code is unchanged, or each new unsafe block has a local safety argument.

This changes schedule selection and catalog identity, not verifier equations or Fiat-Shamir ordering.

Breaking Changes

SelectionPolicyId::MinFirstDirectSetupThenPayloadWithinSupportedEnvelope now carries its direct-fallback payload slack. Generated catalogs using this policy need regeneration.

# Conflicts:
#	crates/akita-config/src/lib.rs
#	crates/akita-config/tests/runtime_fallback.rs
#	crates/akita-planner/src/schedule_params.rs
#	crates/akita-schedules/src/runtime.rs
@markosg04
markosg04 marked this pull request as ready for review August 3, 2026 18:07
@markosg04

Copy link
Copy Markdown
Author

Closing per review feedback (thread with @quangvdao): the payload-slack selection policy comes out of the stack entirely. #345 now reverts the planner, config policy surface, and catalog identity to their main state and keeps only the prover optimizations; the Jolt-side adapter and catalogs are being regenerated at the default min-payload policy.

One data point worth keeping for the planner rework: at the 2^28 D128 shape, the rank-3 / P=2^21 schedule proves 15.6% faster with ~4 GiB lower peak RSS and an identical proof payload to the selected rank-4 / P=2^18 schedule — that case is an equal-payload tie-break, not a payload trade. Happy to pick that up as a planner-native tie-break or via the adaptive-dimension candidate sets once #356/#355 settle.

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