Skip to content

Certify sharp numerical scratch bounds for BIT arithmetic - #2759

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/selected-word-scratch-20261015
Oct 16, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/selected-word-scratch-20261015

Conversation

@petalas

@petalas petalas commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Ring.inverse, above all borrowed/caller-resident words
  four Euclidean words
  + quotient and remainder
  + four words inside modular multiplication
  = ten additional words, sharp

This closes one arithmetic-interior component of the first BIT node reserve handoff. The written lifetime proof covers arbitrary legal word widths in the pinned implementation. If L words are live on entry and words have b bits, inversion occupies at most (L+11)*(b+1) non-LEFT symbols, including its permanent template. The package also proves sharp bounds for division, addition, subtraction, negation and multiplication.

Only research/selected-word-scratch/ is added. It contains the proof in README.md, a fixed receipt, explicit replay hook, literal allocation/cell checks, failure controls and two unchanged source/notice exports. Scientific source: Jose Manuel/jmbarrancoml's PR2697 at a53fdf4bcbe33c6732f0bec1badc8c023380f9d1. SNAPSHOTS.json retains original paths, Git blobs and SHA256 hashes; the complete predecessor notice is preserved. The arithmetic algorithms and implementation are not claimed as new.

Task selection drew bit-helper-contract, nonce 1875c0a59c67cabd5d78220a2c84dcc9, priority revision 5. TASK.json explicitly changes scope to this live numerical-storage handoff because the helper-contract leads have newer completions. This complements PR2708/2731/2743 payload bounds, PR2749's count-storage component and the adjacent serialized-continuation and larger-child claims. It does not repeat them.

Evidence

  • Before: total numerical reserve remains open in PR2697; a nine-word scratch budget or twelve-slot arena rejects the actual inverse witness.
    After: ten additional words suffice, and the unmodified M=5,a=2 routine attains ten and returns 3. Three borrowed words plus the template give exactly 70 occupied non-LEFT symbols. Seven unrelated borrowed words raise the measured total to 105. Thirteen arena slots suffice.
  • Registered CPython 3.12.15 replay passes 12,345 finite arithmetic calls and 56 alias/width cases. Results agree with independent integer arithmetic; literal cell scans, operand/head preservation, result ownership and full erasure pass. Nonunit inversion also reaches ten and releases all temporaries.
  • Thirteen focused tests pass under -O, including one-word-underbudget rejection for all six primitives, exact capacity, constant aliasing, nonunit cleanup, explicit caller rollback, source rejection before import, dependency/path/blob/pin corruption and an understated receipt. A Git-free export remains byte-unchanged.
  • All 70 repository research-workflow tests and scoped Ruff diagnostics pass. Optimized direct replay also passes on CPython 3.13.5. Platform: Linux x86_64 under WSL2.
uv run --python 3.12 --no-project python -I -Werror -B \
  scripts/research_package.py --package research/selected-word-scratch
uv run --python 3.12 --no-project python -B -m unittest discover \
  -s tests -p 'test_research_*.py'

The finite domain checks the actual code; the uniform bound rests on the written lifetime invariant. Evidence is author-checked, without a separate reviewer process or formal kernel. Caller-resident matrices, callback frames/index words, other storage categories, physical placement and total reserve admission remain open. Allocation exceptions require caller rollback. No selected GL64 execution, full caller/cold replay, supplier adoption or new kappa is claimed.

Started from canonical main e93f2ebd9c60b79e564b07acffdbbb99b477c28c. Submission refresh checked 936fac15b1b1b59dc5285c713a77f9f3c07b2906, unchanged guidance/selection/runner and unchanged PR2697 head. Complete overlap covered 705 open PRs and 1393 Discussion records without warnings; the scoped thread was also read directly. Metadata coverage is not a novelty guarantee.

Merge Danger

Door: two-way

Additive research package with immutable predecessor exports. No selected frontier, production implementation, guidance or frozen evidence is changed.

Blast Radius: research

Bind the unmodified PR2697 binary-word implementation and prove its\nsimultaneous allocation bounds, including ten additional words for\nmodular inversion. Retain source credit and scoped reserve limitations.\n\nAdd literal arithmetic, occupied-cell, ownership and rejection checks.
@Mister-Meeseeks
Mister-Meeseeks merged commit 291799b into CrocSwap:main Oct 16, 2026
21 of 61 checks passed
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