Skip repeated Sinsemilla input sort work - #478
Merged
Merged
Conversation
ValarDragon
marked this pull request as ready for review
September 22, 2026 19:40
|
Note Complete: Audit complete. No review-worthy issues remain after automated review. One finding was auto-invalidated. Open the full results here. Analyzed one file, diff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
proving key before lookup tasks are scheduled
sorting Pasta keys, then reinsert its canonical sorted run
bytes, sort scratch capacity, and retained proving-key memory
Motivation
#467 skips sorting the repeated first-row value in the shared fixed
Sinsemilla table. The two Sinsemilla inputs per Action have the same stronger
shape, but they were still sorting all 2,042 usable rows. In the benchmark
fixtures, 1,056--1,108 of those rows equal the table's first compressed value.
Waiting for shared table preparation would serialize independently scheduled
tasks. Instead, this change reconstructs the same value from the three
unrotated row-zero fixed values with two Horner steps, then reuses #467's
validated repeated-value sorter. Non-Pasta fields, zero or non-dominant
repetitions, and structurally unrelated tables retain the generic sort.
Benchmarks
Paired proofs used Rust 1.97.1. Every control/candidate pair produced identical
proof bytes. The focused metric is the sum of the two Sinsemilla input sorts
per Action; it excludes the already-optimized u10 lookup.
x86_64-asmx86_64-asmUninstrumented full-proof measurements were noise-limited: M4/10 measured
43.231 -> 43.246 ms at one Action and 110.261 -> 110.055 ms at four Actions,
with both paired confidence intervals crossing zero. This PR therefore claims
the resolved focused saving, not a resolved full-proof delta.
Correctness and API
q_0derivation uses the same fixed columns, row, expressionorder, and theta-Horner order as table compression
otherwise leaves both buffers untouched for the generic fallback
new test covers direct row-zero derivation and rotated-query rejection
pub(crate)API, transcript, RNG consumption, cache, allocationcapacity, or retained-memory shape changes; only a private helper signature
gains the optional value