Repository navigation
PR6066 signed halves admit exact restoration with a charged tape kernel - #6092
Merged
Mister-Meeseeks merged 1 commit intoOct 28, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Result
One signed stochastic half from PR #6066 now has an explicit reversible Boolean word and fixed-tape program. For every signed width W≥2, either sign and either resident coin, it returns the exact rounded value, preserves the coin, and retains the one parity bit needed to restore the dirty input. Reversing the program clears that residue and all W clean working cells. No extra arithmetic guard bit is required within the declared signed input range.
The literal tape program includes every head walk and both head returns. For instruction-word length L, each direction costs 2L+2 interpreter steps, with 2W+2 binary data cells, W clean work bits, one retained parity, a read-only program of L+2 fixed-alphabet cells and a fixed finite interpreter. The program length is O(W²), and its preparation/storage are charged. For example, at W=64 the positive and negative directions cost 203,002 and 386,482 steps respectively. These are explicit baseline costs, not a faster tariff.
Significance for researchers
This resolves the single signed-half lowering requested by PR #6066, with separate integer, gate and tape semantics and a complete local scratch/guard/motion ledger. It provides a concrete primitive to price when composing the optimal retained-log boundary from PR #6091. That composition, clean-work availability, resident random-bit delivery and the other scalar/native operations remain open; none is assigned zero cost.
Validation
CPython 3.12 normal and optimized registered checks pass 2,032 exhaustive signed gate cases through eight bits, 324 literal tape forward/inverse round trips, and 96 larger-width guard cases through 128 bits. Checks include signed endpoints, exact residue/work/coin cleanup, every head return, gate counts, program hashes and rejection controls. Source binding confirms the historical prefix's 18 positive and 66 negative half sites. Exact committed-byte preflight passes at
39df190f3a8a04cccb88ef1a6ca9aad39ed0364d; committed export integrity/input coverage also pass.Only an isolated research package is added. The resident coin and clean work are explicit caller preconditions. No full prefix/caller, physical sampler, native MOVE, selected cold replay, κ increase, independent human review or formal-kernel approval is claimed. The existing base navigation failures tracked by PR #6050 remain separate.
Open next questions
Install this kernel at one actual reached site with paid coin delivery, clean-work allocation, scalar layout and finite guard bounds. Then lower a rounded ADD and the other SCALEs, handle the inferred-residue sites of PR #6091, and total the physical word's bill before claiming a supplier or exponent effect. A faster tape layout can be compared against this fully specified baseline.
Prepared by zxv with substantial OpenAI Codex assistance. Credit Nick Petalas's PR #6026, Ali Romman's PR #5599, PR #6066's ABI and the retained source lineage. Ripple carries and reversible gate decompositions are classical; the signed stochastic-half/tape contract and source-relative invoice are the contribution. Apache-2.0.
A fresh optimized replay from the committed export also passes. Hosted run 40640170043 stops during planning on the same two unchanged base navigation failures addressed by PR #6050, before this package's scientific job can run. Local scientific checks and the shared CI blocker are separate.