Reuse advice commitments for sparse witness deltas - #328
Conversation
4767fdd to
5ea1a8d
Compare
5ea1a8d to
8466214
Compare
|
I'm really excited for this, once we figure out how to expose it for voting as well, will be a big win. Were fine with the timing variance leakage here. In practical terms, this is likely the largest timing variation we are introducing into proving. (E.g. a 1% proving time variation dependent on if your spending notes created from a single change split) |
|
Note Complete: Audit complete. V12 did not find any issues that need review. Open the full results here. Analyzed three files, diff |
|
damn just caught it was benchmarking the 2-action tx using the same g_d^{old}, which is applicable in some cases, e.g. change splitting, but also wrong in many others |
39fd417 to
d9c5ffb
Compare
d9c5ffb to
d9d4c70
Compare
|
Rebased conflict-free onto current main This refresh also replaces the old 256-row density sample with exact full-row On the real post-NU6.3 two-spend fixture, all ten later-action advice columns The most recent completed same-binary full-prover results use the earlier
A two-block route-negative padded screen quantifies the exact count-scan cost
Thus the target real witness win is larger than the observed route-negative All modes generated, verified, and byte-compared the same 7,264-byte proof. API-surface audit:
There are no other signature or visibility changes. The public trait method is |
dae7350 to
6f40009
Compare
6f40009 to
0dd71ab
Compare
|
Rebased onto current main
Exact-current topology is The prior
The exact density route remains positive for all ten later-action advice The same binary produced and verified byte-identical 7,264-byte proofs in all We also rejected parallelizing the small ten-column work gate: API-surface audit is unchanged:
There are no other signature or visibility changes. Current head Stacked scheduling status: in the frozen four-block experiment, the surviving
Both order strata favored |
Summary
has a cheaper sparse witness delta;
reject observed digit/window regressions; and
For advice polynomial
a_iand blindr_i, the routed path usesCom(a_i, r_i) = Com(a_0, r_0) + Com(a_i - a_0, r_i - r_0).The original advice polynomials and blinds remain available for openings.
Proof format, transcript order, RNG consumption, and verification are
unchanged.
Routing
Routing is limited to prepared multicore, no-
orbits,k = 11proofs with atleast two circuits and no more workers than the prepared backend's measured
cap.
For each later circuit, the exact full-row density pass requires:
Every column must then pass an independent eight-row prepared-recoder work
check. Pasta compares main-window span and digit visits, plus residual-tail
span and visits, componentwise. The density decision is exact. The eight-row
work check remains a performance heuristic: it can reject a profitable delta
or miss unobserved digit work, but it cannot change the commitment result.
Unsupported and exceptional cases fail closed to the direct path.
On the real post-NU6.3 two-spend fixture, all ten later-action advice columns
route. Exact direct/delta nonzero counts fall from 15,865 to 13,654, saving
2,211 entries (13.94%), and no column gains nonzeros. In the eight-row work
sample, main-plus-tail digit visits fall from 1,069 to 891 (16.65%). The padded
two-action fixture saves only 3.69% and declines the exact density gate; all
three later circuits in the four-action fixture decline too.
End-to-end Ironwood measurements
Negative is faster. A single diagnostic executable selected unmodified main
(
M), this PR (S), or the stacked scheduling candidate (O). Eachinvocation proved the real post-NU6.3 two-spend fixture with a prepared
k = 11key. Criterion used Flat sampling, ten samples, a two-second warmup, and a15-second measurement. Four balanced, interleaved macroblocks were retained
per host.
S/M)S/M)O/S)O/S)All four Linux
S/Mblocks favored this PR. Three of four M4 blocks favoredit; the M4 point estimate is favorable but dispersed, and its conservative
Student-t interval also crosses zero. All four
O/Sblocks favored the stackedcandidate on both hosts. The stacked result is reported here to show the
measured phase interaction; it is not part of this PR.
Those four-block measurements were frozen at main
42f5dd4e. #403 istarget-equivalent for that experiment, but #405 changes runtime field doubling
on Apple AArch64 and may change the phase balance. The five #328 commits were
therefore restacked on exact current main
4d14a1d1as0dd71aba; theirrange-diff and patch IDs are unchanged, with no conflicts.
The exact-current same-binary confirmation retained four Linux blocks and two
M4 blocks. Linux was extended without rebuilding because its initial
S/Mpair was mixed:
S/M)S/M)O/S)O/S)Exact-current topology is main
4d14a1d1, this PR0dd71aba, stacked v22a06abe3, and diagnostic32ef6b23. The source bundle SHA-256 is3e2e97484837b4213d0e2b185173fa9dfbf3db8145db84f23bc74b9d364d1f23.Exact-current result archives are
ebd168c5208494d5eb00cb3e8d0529d45480e86f448816fda0fd7f9eeb527860and
06200616bfabe664f1d9e761132e9521e2ac0310f3497ffd03f8fb682d378326for the Linux initial run and extension, and
1018ec9dbdcab55bbfd2e87b7b731d1125b8908cbf0496e9e318b392a4a8b5aaon M4. The no-rebuild extension runner and combined analyzer are
e04f59fa12b16ac5eff72715192f81dc0d07f9984c4ef8e1a590c5e36fce72f7and
4177be3ce918b15d1254962ee81cb9c7a910bf2d04a357704c49808a43874de9.Proof, route, binary, source, worker-width, and contamination gates all passed.
Linux retained and excluded
landscape-sysinfo- andfwupd-contaminatedextension attempts. M4 retained and excluded two launchd-contaminated
attempts.
The same binary generated, verified, and byte-compared a 7,264-byte proof in
every mode, SHA-256
04d18c448a3fc2497daca547a90ef9a5b6d0bb8a1391e39f55529e1f95a51dc8.Preflight route markers confirmed the real fixture routed, while padded
two-action and four-action fixtures declined. Accepted blocks had stable
binary/source hashes and no in-run competing process, swap, steal, or thermal
warning; rejected attempts were retained and replaced.
The frozen same-binary source bundle is
ae596cdaa133cab426d93f6fc3082a7ab291888178751381d3cb75131e9bb51c.Result archives are retained for both hosts.
Route-negative cost
The exact density scan is not free. A separate two-block padded two-action
screen measured +0.140% on Linux (blocks -0.129%/+0.409%, noisy) and +0.173%
on M4 (blocks +0.209%/+0.138%). These proofs decline before the work check and
otherwise retain the original schedule. The target real-witness saving above
is larger.
Alternatives measured
Parallelizing the ten-column work check (
P) was rejected: it regressed M4by +0.510% in both retained blocks and was only -0.166% on Linux. The entire
serial check is about 8.9 microseconds, so even deleting it caps the direct
full-proof gain near 0.013%; the observed larger movement is scheduling
noise or contention.
The original stacked scheduler (
v1), which placed more planning work inthe overlap, regressed Reuse advice commitments for sparse witness deltas #328 by about +0.30% on M4 and +0.34% on Linux.
A
v3scheduler that moved the work check before the fork but overlappeddelta materialization regressed Reuse advice commitments for sparse witness deltas #328 by +0.774% on M4 and +0.952% on Linux.
The surviving stacked
v2deliberately leaves the serial work check insidethe commitment arm. That stagger lets transforms start before delta
materialization and MSM pressure arrive. Its remaining route-negative risk
is the case where the exact count passes but the work check rejects after
transforms have started. A forced first-/last-column rejection gate favored
the stacked schedule:
X0/D0: -0.712%, two-block bootstrap[-1.090%, -0.333%];X9/D9: -0.455%,[-0.586%, -0.324%];X0/D0: -0.230%,[-0.521%, +0.061%]; andX9/D9: -0.487%,[-0.592%, -0.382%].Dpreserves Reuse advice commitments for sparse witness deltas #328's nested direct fallback;Xstarts transforms beforethe forced rejection and then uses global direct commitments. Both order
strata favored
Xin all four contrasts.Correctness and compatibility
magnitude-inversion, high-window, sample-evasion, and exact-density-evasion
profiles.
comparisons, and exceptional inputs fail closed.
synthesis and synthesis failure before prover RNG use.
orbitsconfigurations pass.On the exact-current stacked head, the full Halo2 suites pass with 238 default,
191 no-default, and 199
batch,orbitstests. The focused advice-delta tests pass5/5, the Pasta multicore scalar-work tests pass 2/2, and the Orchard library
suite passes 170 tests with 3 ignored. Formatting and
git diff --checkalsopass.
Risks and cost
sparsity and similarity through proving latency. The affected public proving
APIs document that contract.
k = 11two-spend workload. Othereligible prepared circuits can route when they satisfy the same gates.
count scan. The padded screen above measures this overhead.
approximately 640 KiB for ten 2,048-entry columns of 32-byte scalars, plus
vector metadata.
API surface
PreparedZeroCheck::scalar_work_is_at_most_vartime. This must cross theexisting Halo2/Pasta crate boundary through
Arc<dyn PreparedZeroCheck<_>>; the changelog records its public re-export.Params::prepared_lagrange_commitments_active(&self, usize) -> bool.Codebook::recode_pairhelper topub(super)so theprepared backend can compare exact recoder work.
No other signature or visibility changes are introduced.
Current head
0dd71abais clean and mergeable. All 65 GitHub checks aregreen.