Put PowModBench.lean at PrimeCertTest/PowModBench.lean on the windowed-power PR branch, then run:
POWMOD_CASES=/absolute/path/cases.json POWMOD_SAMPLES=/tmp/powmod.csv POWMOD_BLOCKS=4 lake build PrimeCertTest.PowModBench
The baseline is the exact previous wrapper around the retained powModK.aux, checked with the same kernel, imports, numerical inputs, and equality application as the new wrapper. Each timed sample uses a fresh Kernel.check; input construction and independent expected-value calculation are outside the timer. Both implementations must reject wrong-result controls at 255 and 521 bits. Four adjacent AB/BA blocks. Native powMod is unchanged by this PR.
The dispatch thresholds are inherited from Lean #15167, whose tuning evidence is attached there. This artifact compares that complete policy with the former binary implementation on Lean 4.33.0; it does not retune individual window widths on this toolchain. The full-base fallback is retained from that policy, not justified by the policy-versus-baseline comparison alone.
Median milliseconds (small base 2; full base floor(modulus/3); exponent modulus−1):
| Input | Previous binary | Window policy | Ratio |
|---|---|---|---|
| 255-small | 1.795 | 0.520 | 3.45× |
| 255-full | 1.733 | 0.591 | 2.93× |
| 521-small | 3.727 | 1.231 | 3.03× |
| 521-full | 3.666 | 1.621 | 2.26× |
| 2048-small | 19.309 | 9.693 | 1.99× |
| 2048-full | 18.657 | 15.633 | 1.19× |
| 8192-small | 647.944 | 153.114 | 4.23× |
| 8192-full | 249.363 | 246.830 | 1.01× |
| 16384-small | 99007.895 | 697.826 | 141.88× |
| 16384-full | 55469.559 | 56039.591 | 0.99× |
samples.csv contains every completed main-run sample; record-final.json records affinity, host load and command output. The large full-base cases use the retained binary fallback. These absolute times are observations on a shared host, not budgets or asymptotic claims.
certificate-builds.json contains all eight adjacent full Curve25519 certificate builds, including the first baseline build which rebuilt a dependency. Medians: 1.731 s previous, 1.621 s windowed. This end-to-end build cost includes imports and elaboration; it does not show the full ratio of the isolated arithmetic check.
Earlier harness runs are retained separately: record.json records a missing-meta-import error before any timing; invalid-unfolded-baseline-samples.csv used an inlined/precomputed baseline expression instead of the original wrapper and is unsuitable for the comparison; large-negative-control-run-samples.csv contains completed checks before stopping a costly large wrong-result control. Corresponding records retain failure/termination status. The final harness uses exact wrappers and small wrong-result controls.