Skip to content

Reduce general multiplier setup with streamed ternary cover stock - #7868

Open
aliromman wants to merge 2 commits into
CrocSwap:mainfrom
aliromman:codex/bounded-general-multiplier
Open

aliromman wants to merge 2 commits into
CrocSwap:mainfrom
aliromman:codex/bounded-general-multiplier

Conversation

@aliromman

@aliromman aliromman commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

This construction reduces fixed setup, generated instructions, tape count and the minimum stock needed by the general mixed-rank integer multiplier. It preserves the proposed complete saving κ = 0.00387992803556 for arbitrary signed binary operands. Its largest improvement comes from removing the fixed program entry and physical tape for every invertible low matrix. A separate change to the finite branch gives a measured 108.11-fold speedup over the published Python implementation on 33,554,432-bit operands. Complete resource proof · Carrier proof · Exact receipts · Measurements

Quantity Pinned complete construction This construction
Binary dimension 2^1285200000000000 2^240000000000000
Complex dimension 2^15171300000000000000 2^3300000000
Ordinary radix and elementary buckets q > 2^6426000000000045, with q² buckets 3 and 9
Fixed setup, generated code and peak fixed backing The low splitter alone requires log₂(log₂ S) > 2570399999999999 The entire fixed machine has S ≤ 2^4800000000000000000, so log₂(log₂ S) < 63
Ordinary width in radix digits Necessary log₂ e > 2580722891566266 Sufficient log₂ e ≥ 481927710843386 for all six stock reserves

The baseline's splitter explicitly names and writes to each of its L = B·|GL| destination tapes. That gives a lower bound on its emitted program even if a separate matrix directory is generated on demand. The new router temporarily extends the real low rows to the full ternary matrix cube, less than doubling this local volume. It transports every high value and carry, finishes the low right action, and removes the singular rows before calling a child. Removing singular rows earlier can destroy genuine data. Five temporary spools replace the L-dependent splitter bank at the cost of O((1 + log₃ L)V) moves per split, compared with the earlier bound of 94V. Serial stacks preserve independently changed child returns. Old physical splitter · Streaming implementation · Sibling transfers

A chronological compiler gives each selected coordinate either one or five occurrences. The signed complex action has order four and each aligned binary exchange has order two. This buys the smaller dimensions and funds all nine children of an alternate ternary pivot. The build includes separately owned zero fields, the actual ordered paid requests, high-field routing, both directions and erasure. The written complete fixed-tape bound is S + C n (1 + log n)^(1−κ) time and S + O(n) backing. A conservative bound for C is a common outer factor times (N_b^20000)^100. Its least value and the cofinal wall-clock crossover remain unknown. The direct outer controller first admits one axis at 2,575,826,973 × 2^2575826941 + 1 bits. It can use elementary work at that length. Compiler and ownership · Stock, generation and input thresholds · Weighted leaf

At feasible lengths, the compiled two-prime branch takes 1.170 seconds versus 126.519 seconds for the pinned Python caller and 0.169 seconds for GMP on the same 33,554,432-bit inputs (median times across the same three input pairs). The C work area is 64 MiB there. At 4,194,304 bits the measured process peak rose from 34,766,848 to 40,026,112 bytes. The comparison includes the move from Python to C. The finite scalar routine also ran inside the direct Fourier product. The full three-transform regression on (3,5) used the true ternary low router in both input CRTs and the inverse CRT. The production-size generated machine remains beyond hardware. Dispatcher · Packed C · Finite integration and comparisons

From the repository root use CPython 3.12 for the registered checks. For the formal checks, install the pinned Lean 4.34.1 toolchain and mathlib dependencies.

p=research/bounded-general-multiplier
python3.12 -B scripts/research_package.py --package "$p"
python3.12 -IB "$p/verify_formal.py"
PASS_REGISTERED_RESEARCH_PACKAGE research/bounded-general-multiplier outcome=completed
PASS_GENERAL_KERNEL 18 modules 51 axiom reports ['Classical.choice', 'Quot.sound', 'propext']

The seven portable commands passed in an immutable Git-free export. Independent address oracles checked 384,426 right-route records. The complete product returned 345550037539 and uncarried coefficients 11811, 10996, 4152, 868, 77. ASan and UBSan passed 1,073 additional packed products and three invalid extents. Lean checks carrier funding, chronological action, the core weighted leaf, cube padding and simultaneous stock. The native bindings, full machine clock and Fourier-to-tape composition have written proofs. Unchanged historical analytic suites were not replayed in full. Independent scientific review remains open. Reproduction and formal coverage · Source hashes

GitHub's onboarding step ran 760 tests. One navigation test failed and 24 tests were skipped. The selected record requires make frontier7000-verify and the CI guide documents make frontier6030-verify. The same assertion fails on the unmodified base. GitHub skipped its hosted package replay. Hosted failure · Assertion · Base guide.

For the GMP comparison, the benchmark host used GMP 6.3.0 under the following prefix. Set the prefix to the installed headers and library on another host. The benchmark times complete products and checks every result outside the timer.

p=research/bounded-general-multiplier
gmp_prefix=/opt/homebrew/opt/gmp
gmp_adapter=/tmp/bounded-multiply-gmp-benchmark.so
cc -std=c11 -O3 -fPIC -shared "$p/short_product.c" -o "$p/short_product.so"
cc -std=c11 -O3 -fPIC -shared -I"$gmp_prefix/include" "$p/bench_gmp.c" -L"$gmp_prefix/lib" -lgmp -o "$gmp_adapter"
python3.12 -IB "$p/benchmark.py" "$p/short_product.so" --gmp-library "$gmp_adapter" --sizes 4096 16384 65536 262144 1048576 4194304 --rounds 5
python3.12 -IB "$p/benchmark.py" "$p/short_product.so" --gmp-library "$gmp_adapter" --sizes 33554432 --rounds 3 --skip-profile

The concurrent 451-factor proposal advertises κ = 0.00387992804346, a difference of 0.00000000000790. Its consumer retains five premises, including the seven-stage physical and precision transfer from a completed seed. The comparisons above use the six-stage 480-factor proposal that has a written complete realization. PR #7863 · 451-factor proof · Consumer receipt.

The base is e54523517d0f03e58352e647c403a5af3e525a57. @Clear1nsight supplied the mixed price at 87fbf4f7b35b0f18ab12b5767775a9a424cf0b15. The native all-column words are at a7f99a5f5f919dd3ffb2987f90c1e7d6527feb1e, their uniform composition at 343f7b1817e26ad3f89d2ddad313b12741d53602 and the direct caller at 3615fd982f2f4dc7172bef6f0dc9a4f77d5ab6dd. The fixed-port router by @thu-nmrc and the prior finite compiler, batching, pivoted fallback and single-grade work retain their source credits. @aliromman prepared this contribution with substantial OpenAI Codex assistance. PR #7830 · PR #7837 · PR #7846 · PR #7849 · PR #4235 · PR #4507 · PR #7828 · Credits · Scoped finding

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