Skip to content

Research: exact modular borrowed-port echoes with endpoint-sized data - #1159

Merged
Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
bitplane:research/pass20-recursive-seed52
Oct 14, 2026
Merged

Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
bitplane:research/pass20-recursive-seed52

Conversation

@bitplane

Copy link
Copy Markdown
Contributor

This supplies an explicit finite-width modular backend for PR1057's borrowed-port echo. Integer matrix factors execute modulo 2^w, restore every dirty bit pattern, and recover the exact signed output from input/output bounds. Large intermediate integer lifts need not fit the data registers. Recursive-interface construction; no new kappa.

For the 52-factor fixture, the existing plan still takes 1,376 complete leaf calls and three dirty length-two arrays, using 56-bit data. The inherited integer-prefix majorant gives 114 sufficient bits for entry values bounded by seven, or 167 for arbitrary signed 56-bit dirt. These are sufficient-bound comparisons, not integer-width minima. The retained arbitrary-dirt integer lift actually reaches 90 signed bits.

The cost is explicit: 38 scalar/access commands per two-dimensional leaf instead of 28, including ten reductions. The full kernel executes 52,292 commands, of which 13,760 are reductions. All five arrays occupy 560 model bits; the four private work registers occupy 283 bits, including a 112-bit product register. Coefficient/input conversion, final decoding, original input storage, planning, metadata, routing and physical adapters have separate paid terms. No measured speedup follows from this invoice.

Reproduce and evidence

python3 -I -B research/modular-port-borrowing/verify.py
python3 -I -B research/modular-port-borrowing/test_package.py -v

Python 3.10+ and standard library only. Expected marker: PASS_MODULAR_PORT_BORROWING.

  • 5,280 exact matrix cases covering all ten input columns: all 861 ordered binary/ternary trees through seven factors at three widths and both signs, plus each parent plan from eight through 64 in both directions.
  • A separate control-stack and matrix implementation checks 528,302 leaf prefixes and 667,416 recursive returns, including borrowed ancestor ports.
  • 33,280 exhaustive scalar cases over the declared small quotient rings execute 2,160,640 actual scalar/access commands; another 144 dense cases vary dimension, signs, zero factors and width.
  • Four primary executions compare every leaf with the integer lift, restore arbitrary dirty bits and replay the literal inverse. Closed operation and address invoices agree with literal execution.
  • 19 mathematical/admission controls, 12 package tests and 25 existing selected-record tests pass. Final normal CPython 3.14.4 and read-only, relocated, isolated optimized 3.12.3 receipts are byte-identical.
  • Recovery failure is explicit: residue 12 modulo 16 decodes as −4 when the true result is 12 and the bound is omitted. Saturation corrupts a helper; rounded division fails the quotient contract. The guard separately preserves input representability when a zero product makes the output small.

Scope and credit

Only research/modular-port-borrowing/ is added. Base ba82555, OS seed 52. Six exact Git-object/SHA-256 source/context pins include five unchanged PR1057 files at 78a062d. The generator/planner and additive-group identity remain credited predecessor work; the contribution is their concrete quotient-register backend, recovery guard and full cost/validation evidence.

The all-tree argument applies to integer linear factors and residue-valued recursive boundaries. Rounded, irrational or general dyadic leaves need another interface. The Python interpreter models bounded registers; its host allocation is not the stated data-space bound. A physical fixed-tape compiler, supplier/frame adapters, hosting and outer analytic transfer remain open. Leaf multiplicities and the direct all-role obstruction are unchanged. No supplier admission, full repository suite, selected cold replay, CI success or formal multiplication theorem is claimed.

The final queue was checked through #1157. Ali Romman's #1135 was read through its exact-lift proof: it studies rounded restoration and a common-denominator rational embedding with q^D initialization and numerator headroom. This integer modular backend does not remove its denominator costs or solve its rounded-leaf obstruction. #1103's rectangular batching, #1155's deferred batch restoration and #835/#1144's modular verification have different objects and are acknowledged. This backend restores every completed child boundary and does not defer those restorations. Upstream advanced to ce7ad1b, selecting conditional PR1094; the experimental context remains frozen.

Credit Gareth Davidson PR1057, shhxera PR822, androolloyd PR673, Sagar Thakrar PR730, Chafik Boukhalfa PR628 and the retained lineage. The Ben-Or–Cleve register principle and modular arithmetic are classical; no priority claim is made for them. Prepared by Gareth Davidson (@bitplane) with substantial OpenAI Codex assistance; new material Apache-2.0.

@Mister-Meeseeks
Mister-Meeseeks merged commit 71cad44 into CrocSwap:main Oct 14, 2026
60 checks passed
@Mister-Meeseeks

Copy link
Copy Markdown
Contributor

100-PR batch review at f38bfe5da0bed21f42ce5251d23491a56519d7c4.

Merged to main, preserving the original contributor commits and package attribution.

Reviewed scope: Modular borrowed-port echo with endpoint-sized data, arbitrary dirt restoration and paid reductions; smaller data width is a space/work tradeoff, not a free precision theorem.

The pinned scoped command passed; the batch ledger contains its command, input hashes, environment and log. This incorporates the research/tooling contribution and does not change the selected κ or discharge the inherited multiplication-theorem assumptions.

Batch review, attribution and evidence. Thank you for the contribution.

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.

2 participants