Skip to content

Audit rounded matching-layer execution and stored-coordinate widths - #5240

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
apoursh:research/matching-layer-rounding-audit
Oct 23, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
apoursh:research/matching-layer-rounding-audit

Conversation

@apoursh

@apoursh apoursh commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Change and mathematical scope

PR #4976's sublayer precision implication assumes that the original rounding-event count is retained. This source-bound audit proves that premise for rational-unitary-fft/exact.py:apply and distinguishes Euclidean amplitude from stored-component width.

Within a valid matching layer, every gate reads a saved input, computes all outputs, and rounds each output once. The rounded gate maps commute. The realized residuals aggregate into one vector per original layer, retaining the original D-layer error budget. At every completed coordinate write, the stored state is a coordinate splice of the adjacent rounded endpoints, including cuts between the outputs of a two-wire gate.

Consequently the original fractional grid F and signed component width I remain sufficient under the retained complete-layer stability and exact-local-arithmetic premises. A Euclidean cut radius may still increase by sqrt(2); that does not require enlarging a component-width bound. The swap witness has intermediate state (1,1), Euclidean norm sqrt(2), component bound one and a singular partial-write map. No partial inverse contract is inferred.

This explains an implicit valid step in the predecessor; it does not change its compiler, allocator, selected exponent or frozen inputs. Local products/sums and their temporary widths, coefficient preparation, tape execution and all-size conditioning remain separate obligations.

Task and overlap

Task uniform-transfer-audit, priority revision 7, refined to the actual rounded-execution/word-width interface. Base: a5df48c55ea806d7952b65acc9c76d878ff09b13.

The scoped overlap check searched all 6,918 upstream local notes and targeted current PRs. Canonical main was refreshed to ff3cc58e370d0f678e529246f8c73e8094e18fcf before publication. Governing guidance and all declared scientific inputs were unchanged; the updated runner only changes Git-reader process cleanup. Adjacent #5153 studies coefficient-rounding guards, a distinct question from rounded output execution and component width. Public coordination pages were read, but Discussion #4202 could not be fetched and remote pagination/unpublished work were not exhausted. No exhaustive novelty claim. Exact live input pins and the full task card are in the package.

Validation

At 6d0a6043120880c696d0850e9242a16e6fb980a5, CPython 3.12.14, standard library only:

  • Registered warning-strict normal and optimized replay passes; outputs agree byte for byte.
  • Ten fixtures, 145 gate orders, 607 rounded prefix checks and 83 source coordinate writes. Two complex inputs exercise the actual n=2 Builder shear.
  • Seven controls cover input overwrite, extra product rounding, overlap, residual leakage and stale exact-path residuals. Signed ties, nonzero complex rounding errors and the singular intermediate swap are explicit.
  • A single observation callback records writes. Removing it reproduces the original source AST; observed/unmodified endpoints and all tracking statistics agree. Rounding and synchronous layer evaluation use an independent oracle.
  • Committed-byte/source-history preflight passes for all 12 package/input files. Official export integrity passes. Both direct checks pass from the read-only 13-file export with PATH=/nonexistent; all bytes and modes remain unchanged. Source corruption rejects.
  • Replay planning selects only this new package. Hosted CI, full multiplier/native/Lean replay and proof-kernel acceptance are unclaimed.
python3.12 -B scripts/research_package.py --package research/matching-layer-rounding
python3.12 -B scripts/check_research_commit.py --package research/matching-layer-rounding --check-source-history

The quantified argument is written in the package README; finite execution checks corroborate its runtime binding.

Credit

Prepared by apoursh with substantial OpenAI Codex assistance, including separate mathematical, overlap and verifier reviews. Credit Jose Manuel/jmbarrancoml for the rounded executor and numerical contracts, Vlado Vojdanovski for the schedule, Chafik Boukhalfa for phases, Brian/JoyboyBrian for the cut and allocator work, James Reed for the existing #4976 review, Nick Petalas for the dirty-shear refinement, and Cinna Davis and the retained caller lineage. Apache-2.0; original notices are unchanged. No independent human acceptance is claimed for this contribution.

Open next questions

The package's open next question is to certify one concrete bounded-word two-coordinate multiply/add/round kernel, including signed ties and maximum temporary widths. This would connect the stored-state theorem to physical execution; that arithmetic specification remains the blocker.

@Mister-Meeseeks
Mister-Meeseeks merged commit 3b785d5 into CrocSwap:main Oct 23, 2026
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