Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions research/current-half-add-service/PROOF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# The terminal half-ADD bridge

## Exact source and local domain

Fix the candidate bytes in VENDORED.json. The source is the 150009-event
native word from PR7660 at d12b854d4825e9edfa3a3466909e1abf3525e929.
The verifier replays chart metadata through clock 100503. Both public
roles 210 and 457 are then in chart 218. Clock 100504 is the literal
half-coefficient ADD recorded in RESULT.json. The registry key includes
that clock and the complete event tuple.

Assume canonical finite signed fields on physically distinct tapes, with
the same shape and grid. Public and borrowed context heads start at their
origins. Each private work body is contiguous, has a blank historical
tail, and its head lies in that body or at its frontier. These are the
retained primitive's input premises. They are not inferred from the
local scalar values.

## Specialize the retained literal service

For coefficient -1/2, the retained rounded-ADD compiler forms
`2x-y+1`, takes mathematical floor after division by two, and checks the
final signed range. Since x is an integer,

```text
floor((2x-y+1)/2) = x - floor(y/2).
```

This includes negative odd y and the smallest signed inputs. The retained
carry proof and staged-installation proof apply to every positive width
and every nonempty complete complex field. The finite graph has 669 rows
and 210 states. Its only runtime instructions are the six existing tape
opcodes. The compiler's integer construction is not a runtime callback.

Let L=-2^(W-1) and U=2^(W-1)-1. For each fixed source y, the exact success
domain for x is the intersection of [L,U] with
[L+floor(y/2), U+floor(y/2)]. This interval describes final range only;
there is no divisibility restriction. On success the source stays fixed,
all heads return and private work is retired. Staging all components
before installation protects the whole public target on a late failure.
Failure does not promise clean work or returned heads.

The general retained cost theorem, with denominator two-adic exponent
one, gives 512(S+1)+64R+7(A_0+A_1)+16Q_c in physical/control units.
It includes source reads, carry work, staging, copying, rewind, head return
and both retirements. Its private backing bound is
max(H_0,3S)+max(H_1,3(S+1)). Positive setup, public, context and ancestor
charges are separate. These bounds do not use a conversion to the source's
815804876 ordinary-model units.

## Exact error transport through the current suffix

Write y=2k+b, where b is zero or one, including for negative y. The rounded
output x-k differs from x-y/2 by b/2. For grid step Delta the real error is
Delta*b/2. With N complex entries, there are 2N real components, so
squared field error is at most N*Delta^2/2. Equality holds when all real
components have odd source numerators and the rounded outputs fit.
For the 512-entry fixture, the squared error is exactly 256*Delta^2.

Now compare executions that differ only by this local error. Inspect every
one of the 49504 later events. No event reads role 210 as a source. The
only event that writes it is clock 100527:

```text
ADD 210,292,-1/2,218
```

The source of that update is unchanged between the two executions. All
other roles evolve from identical inputs under identical local operations.
The update adds the same value to role 210 in both executions. Its existing
difference is therefore preserved exactly. The same statement holds if
that later ADD uses a source-only rounded increment, when both executions
are in the service's range domain. It does not assert that the later
exact-halving service has already been replaced or is defined off-grid.

Role 210 returns in chart 218. Its error multiplier is exactly one. No
other public field and no owned observation or erasure receives this
one-site error. This follows from the literal dependency graph; it needs
no unitary bound for a later MOVE because no later MOVE acts on the changed
field. It still assumes the stated local operation semantics and distinct
logical fields. It does not prove those physical interfaces globally.

A separate positive forward-envelope pass gives peak and terminal gain
one, public squared gain sum one, and zero gain at all 75 later CLEARs.
An independently ordered backward pass returns the same coefficient at
the injection site. The exact dependency certificate is stronger than
this norm corroboration. A legal reversed ADD at 100527 would export the
error, and a legal SCALE there would change its gain; both controls reject.

## What this does not compose

The isolated arithmetic is a rounded alternative to the exact-child
service. It changes that service's numerical semantics. The later
half-ADD, all other scalar services and the complete caller remain open.
The local fixtures are admitted primitive inputs, not full-prefix traces.
The local native-return error is not a complete signed-caller error.

The word's operator, owned erasure, compiler, precision/tape and analytic
recovery assumptions remain. A full contribution to the multiplication
exponent needs all 17 local bindings, complete error transport, the common
physical tariff and rounded outer recovery. No such admission is claimed.
129 changes: 129 additions & 0 deletions research/current-half-add-service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# A rounded service at the current half-ADD boundary

This source-bound construction joins an existing literal rounded ADD to
one exposed boundary in [PR 7660](https://github.com/CrocSwap/integer-mult-bounds/pull/7660).
It also proves an exact terminal-error property of the current native word.
No new kappa or complete caller admission is claimed.

At head `d12b854d4825e9edfa3a3466909e1abf3525e929`, the candidate word has
SHA256 `f0753b6614b2d351723dddc307a39b6ecd748a43008c6fdb9335b01feeec9669`.
Its zero-based clock 100504 is `ADD 210,457,-1/2` in chart 218, after the
role-457 MOVE from chart 966. Exact same-grid arithmetic requires an even
source numerator. The retained nearest-up service computes
`x - floor(y/2)` on every canonical signed field whose rounded output fits.
No evenness condition is needed on that domain.

The source-specific result is stronger than a norm estimate. Among all
49504 later native events, only clock 100527 touches role 210, with
`ADD 210,292,-1/2`. No later event reads role 210 as a source. Therefore
the difference from this single rounded site reaches native return only
in public role 210, with multiplier one. It affects no owned erasure.

Read [PROOF.md](PROOF.md), [RESULT.json](RESULT.json),
[VENDORED.json](VENDORED.json), and the retained input pins in
[SOURCES.json](SOURCES.json).

## Literal execution and charge

The unchanged compiler and primitive executor from
[PR 6988](https://github.com/CrocSwap/integer-mult-bounds/pull/6988)
produce a 669-row, 210-state table with three reachable carry values.
The table uses only branch, write, unit move, goto, halt and reject.
Runtime tape payloads are not read by a numerical callback.
The exact local source token selects the table in the primitive fixture.

The service uses two distinct private work banks. For R real components,
S=sum(w_i+1), old dirty physical lengths A_0,A_1, and Q_c borrowed contexts,
the retained all-size bound is:

```text
512(S+1) + 64R + 7(A_0+A_1) + 16Q_c
```

The units include physical reads, writes, unit moves and executed control
rows. Private resident backing is
`max(H_0,3S) + max(H_1,3(S+1))`, with prior capacities H_0,H_1.
Source/table setup, public fields, metadata and protected ancestors remain
separate positive charges. No exchange rate to the old supplier tariff is
assumed.

At widths 1 through 5, the literal interpreter checks all 1364 signed
input pairs: 1193 succeed and 171 correctly reject on final range.
Further checks cover both odd signs, late whole-field overflow, reuse of
87 dirty work cells after failure, and a 512-complex-value field.
That field uses 985272 measured physical/control actions including a
64-step wrapper allowance, below the bound 2687504.
These are operation counts, not wall-time performance measurements.

On success, the source and context stay unchanged, all heads return and
both work bodies are erased. On failure, the complete public target stays
unchanged; work and heads can remain dirty. Six controls cover a wrong
clock, wrong coefficient token, wrong-sign table, late overflow, a legal
outbound read of role 210, and a legal SCALE that changes the error gain.

## Error and range

For each real component, the error relative to exact halving is
`Delta*(y mod 2)/2`, where Delta is the grid step. It lies in
`{0, Delta/2}`. For N complex coordinates the field error is at most
`Delta*sqrt(N/2)` in Euclidean norm. The odd-pair fixture attains this
bound. The exact native-return multiplier is one; all other field and
owned-observation differences from this one site are zero.

For a W-bit signed target with endpoints L and U, success holds exactly
when every component satisfies `L <= x-floor(y/2) <= U`.
This is a range contract, not a proof that every full-word trajectory
stays in range. The other half-ADD at 100527 remains a separate scalar
obligation. The comparison holds the other operations fixed and uses
their stated local semantics and nonaliasing.

## Limits

The result reuses CubeJerry's all-size scalar/lifecycle theorem. It does
not claim a new rounding algorithm or an independent replacement proof
of the retained compiler. The new work is the current source binding,
literal consumer fixture, precise charge specialization and terminal
error theorem. The fixture invokes the unchanged primitive method on
its required state. It does not run the complete recursive Controller.

No full native prefix is executed on these local odd fixtures. No complete
17-call rounded caller, all-coefficient installation, common physical
tariff, private backing schedule, native provider or outer recovery is
established. The five inherited assumptions remain: `native_all_columns`,
`owned_erasure`, `compiler`, `precision_tape`, `analytic_recovery`.
The source's conditional bound and the selected record are unchanged.

## Reproduce

Use Python 3.12 and the standard library:

```sh
python3.12 -B scripts/research_package.py --package research/current-half-add-service
```

Both commands must print `PASS_CURRENT_HALF_ADD_SERVICE`. The runner must
print `PASS_REGISTERED_RESEARCH_PACKAGE`. The normal and optimized isolated
commands read only the declared inputs. They write no files and use no Git
or network. The official export includes the retained source closure.

## Open next questions

Check whether the two half-ADDs can share a rounded-domain guarantee or a
joint rounding rule without changing the input epochs. Then bind all
17 occurrences to the signed caller and charge the physical work.
[TASK.json](TASK.json) records these questions and their open obligations.

## Credit

Clear1nsight supplied the exact PR7660 candidate and requested this scalar
review. Its retained NOTICE credits DreamingOfClouds, SYLforge, Ali Romman,
Rohan Arun and the source lineage. CubeJerry supplied the unchanged literal
rounded scalar compiler, lifecycle executor, physical fixtures and all-size
cost proof. [PR 6990](https://github.com/CrocSwap/integer-mult-bounds/pull/6990) and
Nick Petalas's [PR 7268](https://github.com/CrocSwap/integer-mult-bounds/pull/7268)
are related general compiler work; neither is imported here. The scalar source headers and the declared
source closure retain their licenses and attribution.

Ali Romman directed the new source-bound proof and verification with
substantial OpenAI Codex assistance. New work is Apache-2.0. The base is
`e54523517d0f03e58352e647c403a5af3e525a57`.
118 changes: 118 additions & 0 deletions research/current-half-add-service/RESULT.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"word_sha256": "f0753b6614b2d351723dddc307a39b6ecd748a43008c6fdb9335b01feeec9669",
"clock": 100504,
"raw": [
"ADD",
210,
457,
"-1/2",
218
],
"physical": {
"construction": {
"operation": "ADD",
"coefficient": "-1/2",
"denominator_twos": 1,
"odd_denominator": 1,
"rounding_offset": 1,
"carry_bound": 5,
"carry_states": 3,
"residue_states": 0,
"rows": 669,
"states": 210,
"public_ports": 2,
"work_ports": 2,
"residue_prepass": false
},
"table_sha256": "fc45cabd70bd9b2ea4c35b8f46a87a13c5e96127e036b630ea46cf9f28a4a152",
"exhaustive_pairs": 1364,
"successful_pairs": 1193,
"range_rejections": 171,
"maximum_observed_charge": 2542,
"minimum_bound_slack": 1754,
"odd_boundary": {
"fits": true,
"output": [
0,
1
],
"charged": 2158,
"bound": 5832,
"table_steps": 251,
"old_dirty": 8
},
"late_overflow": {
"fits": false,
"output": null,
"charged": 1010,
"bound": 11024,
"table_steps": 141,
"old_dirty": 0
},
"reuse_after_failure": {
"fits": true,
"output": [
0,
1
],
"charged": 1949,
"bound": 4337,
"table_steps": 159,
"old_dirty": 87
},
"native_512_field": {
"fits": true,
"charged": 985272,
"bound": 2687504,
"table_steps": 119825,
"old_dirty": 0
},
"controls": [
"wrong clock",
"wrong coefficient token",
"wrong-sign table",
"late whole-field overflow"
]
},
"suffix_error": {
"suffix_events": 49504,
"maximum_field_gain": "1",
"maximum_field_gain_witness": [
100505,
210
],
"strict_peak_power_of_two": 1,
"maximum_public_gain": "1",
"maximum_public_role": 210,
"public_sum_squared_gains": "1",
"nonzero_public_upper_bounds": 1,
"suffix_clear_count": 75,
"nonzero_clear_upper_bounds": 0,
"clear_bounds_sha256": "2ab471dcd110ff6a8dedce2aec26f4cf9e29ac2171ef61501f2291b135296069",
"public_gains_sha256": "202c0b98e5187c2dbb6233dd51ca806d086b5fac7b1006be773a2f402adb0ea6",
"backward_witness_gain": "1"
},
"terminal_dependency": {
"later_target_updates": [
[
100527,
[
"ADD",
210,
292,
"-1/2",
218
]
]
],
"later_source_reads": 0,
"returned_public_role": 210,
"returned_chart": 218,
"other_public_and_owned_differences": 0,
"exact_difference_multiplier": 1
},
"dependency_controls": [
"legal reversed ADD exports the error",
"legal SCALE changes the error gain"
]
}
Loading
Loading