Repository navigation
perf(flock): bound ARM Round1 conversion traversal - #558
Merged
tcoratger merged 7 commits intoOct 8, 2026
Merged
Conversation
Benchmarks: base against this PR, on one runnerf19e7b0 merged into its base, against the base f52bd99: each benchmark run in turns on one runner, base and PR 5 times each. A size is shown when it changed; a time or a peak memory when it moved the same way in every round and its median by at least 1% (the change is the median ratio, with the rounds' range). Proving time
Prover stages
Verifying time
Every resultProving time
Prover stages
Verifying time
Time per operation
Proof size
Peak memory
allocations
heap-peak
|
kevaundray
marked this pull request as ready for review
October 8, 2026 12:22
tcoratger
approved these changes
Oct 8, 2026
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.
Change
Keep the ARM Round1 medium-to-F192 conversion in bounded groups of four medium rows, visiting all 64 lanes before advancing to the next group. Two stack-resident lane arrays preserve the unweighted sums; the equality weight is applied after the complete window, including a partial final group. Extend the existing arithmetic regression test to cover every tail count, empty accumulation and repeated full windows.
The packed AB sweep and C transpose are unchanged. There are no protocol, guest, transcript, proof-layout or version changes, no runtime feature detection, and no new ISA requirement. Non-ARM conversion paths are unchanged. The existing module documentation describes the traversal.
Native measurements
Paired baseline is
f52bd991c8623894e7b03a2e50bede6c248ea1ad, which includes #549/#550 and excludes #552. Final head isf19e7b084abad98b6e9d7fc51f07c5e96532c004. Both sides use Rust 1.99,-C target-cpu=native, release thin LTO and one codegen unit on the same actual V2 or Xeon. Five alternating pairs per worker count. Default pools are 16 and 32 respectively. Negative percentages mean faster; percentages below are medians of paired changes, not ratios of independent medians.Rate1 candidate screen and exact-head rate2/aggregation confirmation:
At rate2, a genuine four-leaf tree over leanXMSS2, first/higher arity2, improves the actual whole-tree proving median by1.17%,1.09%,0.87%,0.28% at1/4/8/default workers. These are measured whole-tree runs after leaf proofs, not sums of separate component timings.
Small default-worker limitations
The initial rate2 cohort has real measured default-worker regressions: the separately measured small leaf is +4.07% (paired range -0.74% to +23.22%), and the first aggregation node is +2.50% (-0.83% to +16.67%). Higher-node proof is -0.83% (-3.23% to +16.53%), and whole-tree proof is -0.28% (-0.56% to +15.79%). These samples are retained, not discarded or declared an external-noise effect. Round1 itself improves, but this does not establish a uniform small-tree whole-proof speedup.
A single predeclared control cohort repeats only that exact small tree at default workers: 12 balanced triplets of head, baseline and an identical-baseline-executable control. Every ordering appears twice, shuffled with a fixed seed; each side occupies each execution position four times. All samples are retained. The control measures ordinary run variability, not permission to erase regressions.
V2 first/higher Round1 improves about11% against both references in the control cohort, while the unchanged Basis medians are0% against baseline. The original regressions and the overlapping control ranges remain limitations. No further variants or favorable-result retries were run.
Xeon, memory and compiler shape
Xeon is not an optimization claim: its conversion disassembly is literally unchanged, and the enclosing fold-reduce and drain-into-slots instruction bodies differ only in anonymous LLVM symbol hashes in disassembler comments. Observed leaf whole-proof paired medians at1/4/8/default workers are -0.10%/-0.67%/0%/0% at rate1 and +0.52%/-0.27%/+0.91%/-0.74% at rate2. Rate1 eight-worker samples range from -8.76% to +3.91%; rate2 eight-worker samples range from -6.44% to +4.11%. Positive observations are retained.
The source adds3072B of logical stack scratch, not heap allocation. WorkerState remains8192B. Actual native V2 enclosing-frame size is6464B baseline and8016B selected, an emitted increase of1552B. The full AB medium loop retains128 packed-byte loads,208 PMULL-family instructions and64B spill stores/reloads. Conversion emits bounded vector-pair/scalar loads and EOR3; no hardware-counter attribution is claimed because perf access is denied.
Rate1 V2 RSS medians in MiB, baseline/head at1/4/8/default:1591.62/1593.57,1653.70/1654.05,1691.23/1689.54,1752.68/1752.71. In the controlled default small tree they are1256.59/1253.35, with identical-base control1252.52. Heap measurements and allocation counts are recorded in the artifacts; some higher-worker allocation counts vary between runs, so global allocation-count equality is not claimed.
Rejected alternatives
Only the four-row conversion is retained. Full medium-major conversion regresses default-worker Round1 by3.49%. A separate Horner AB candidate removes the loop spills and lowers208 to192 PMULL instructions, but regresses V2 Round1 by5.21%/4.84%/3.61%/2.18% at1/4/8/default. Optional SVE2 BGRP improves the isolated C transpose from12.34ns to8.60ns without a useful whole-proof win, adds worker state and a branch per medium, and is not included. This is distinct from the previously rejected quarter-tiled AB mechanism. Standalone microkernel timings are not added to span or whole-proof gains.
Standard PR benchmark confirmation
The complete automatic PR Bench passed all 46 native jobs on the exact shipping head. Its five-pair comparisons independently support the retained improvement: V2 leanXMSS100 whole-proof paired medians are -2.00%, -1.92%, -1.75% and -1.11% at 1/4/8/default workers. Every V2 tracked CLI whole-proof row has an improved median, including the 16 first/higher aggregation rows, whose medians range from -0.80% to -1.92%. Other V2 CLI medians range from -1.20% to -1.89%. Positive individual samples remain, including default leanXMSS100's range of -1.79% to +1.71%.
This does not imply every benchmark improves. V2 wrapping-add batch is +0.55% (-2.41% to +4.68%), widening-multiply batch is +0.58% (+0.26% to +2.95%), and PCS-open is +0.36% (-0.13% to +6.04%). These observed regressions are retained. V2 wrapping-multiply and hash batches improve by 3.00% and 2.30% respectively. No uniform microbenchmark benefit or external-noise explanation is claimed.
The unchanged Xeon backend continues to show mixed observations: leanXMSS100 paired medians are -0.72%, -0.03%, -0.13% and +0.37% at 1/4/8/default workers; shielded is +1.50% (-0.51% to +2.68%), and eight-worker 4-to-1 first-node aggregation is +1.09% (-1.58% to +6.38%). Eight-worker 2-to-1 higher-node aggregation includes a +17.71% sample despite a +0.33% median. All 90 timing rows, including standalone unchanged kernels, were inspected. These results supplement, rather than replace, the earlier small-tree regressions and fixed-control limitations.
Correctness and checks