Skip to content

Add a counted 1,024-bit Word RAM multiplier with exact recovery - #5466

Open
Dugongue wants to merge 1 commit into
CrocSwap:mainfrom
Dugongue:research/wordram-ntt-kernel-20261024
Open

Dugongue wants to merge 1 commit into
CrocSwap:mainfrom
Dugongue:research/wordram-ntt-kernel-20261024

Conversation

@Dugongue

Copy link
Copy Markdown
Contributor

Adds a portable bounded multiplication kernel applying four pinned Lean-library interfaces: tcslib Word RAM semantics, FastPoly fixed circuit sharing, CatCrypt NTT convolution/inversion, and mpfx sufficient recovery.

The exact backend assembles and interprets a fixed literal 64-bit RAM program for operands of up to 256 hexadecimal digits. It charges constant synthesis, reduction, carrying, clearing and halt; preserves operands and exterior memory; and clears every owned intermediate. The informal proof covers all admitted inputs. At maximal 1,024-bit operands, sharing costs 391,079 instructions versus 636,835 for the explicit same-ABI recomputation control, saving 245,756 instructions (38.59%). This is a bounded cost comparison, not a new asymptotic kappa or a comparison against the selected construction.

A separate fixed-point FFT backend has complete sufficient error propagation and rational twiddle certificates: 31 fractional bits suffice under its conservative bound, while 40 bits bound coefficient error below 0.001. Its multiword costs are kept separate from RAM64. Full source interfaces and predecessor credit are retained; upstream Lean libraries are not claimed rebuilt or imported. See the local Lean helper status in the package for its exact audit outcome; the complete machine theorem remains informal.

Validation: python3 -B research/wordram-ntt-kernel/verify.py passes eight NTT test groups, a 65,537-case modular-multiply slice, 5,096 butterfly cases, 2,197 circuit cases, 277 complete-program controls, and 20 approximate-backend pairs at each precision. Python 3.10+ standard library only, with no platform-specific runtime dependency; replay was run on Windows, not independently on Linux.

Scope and overlap: pinned main 32890bc5de034ab8fc93ac88ead7279a6a416d04; no selected-record changes. The PR 5413/5407/5414 lineage remains authoritative. Pending #5443, #5438, #5451 and #5442 have distinct lifetime/grid/operator/all-width statements and are acknowledged. Classical transform/sharing/recovery ideas and all source contributors retain credit. Prepared for Dugongue with substantial OpenAI Codex assistance from four workers. Open next questions are in the README.

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.

1 participant