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
114 changes: 114 additions & 0 deletions research/p104-two-handoffs/LITERAL-CHANGES.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
--- closure/research/p104-productive-controller/local.py
+++ p104-two-handoffs/local.py
@@ -107,19 +107,19 @@
program.append(['INIT' if op == 'private_init' else 'CLEAR', e['register'], frame(e['frame'])])
else:
program.append([{'add':'ADD', 'scale':'SCALE', 'private_copy':'COPY'}[op], *e['registers'], e['coefficient'], frame(e['frame'])])
- return {'schema':'p104-productive-source/1', 'public':735, 'live':live, 'ports':built['ports'],
+ return {'schema':'p104-productive-source/1', 'public':737, 'live':live, 'ports':built['ports'],
'frames':frames, 'initial':initial, 'final':final, 'program':program}


def replay(w):
need(len(w['program']) < 26000, 'Fixed operation bound')
frames = [span(x) for x in w['frames']]
- rows = [{r:Q(1)} for r in range(743)]
+ rows = [{r:Q(1)} for r in range(745)]
current = list(w['initial']) + [None]*8
paid, scalar, live_owned, peak = Counter(), 0, set(), 0
for e in w['program']:
op, r = e[:2]
- need(0 <= r < 743, 'Role index')
+ need(0 <= r < 745, 'Role index')
if op == 'MOVE':
_, r, a, b, private = e
need(current[r] == a and (r in live_owned) == private, 'Transport source and ownership')
@@ -127,7 +127,7 @@
paid[abs(len(w['frames'][b])-len(w['frames'][a]))] += 1
current[r] = b
elif op == 'INIT':
- need(r >= 735 and r not in live_owned, 'Owned initialization')
+ need(r >= 737 and r not in live_owned, 'Owned initialization')
live_owned.add(r)
peak = max(peak, len(live_owned))
rows[r] = {}
@@ -151,7 +151,7 @@
scalar += 2*(abs(n.bit_length()-d.bit_length()) + int(q < 0))
else:
s = e[2]
- need(s != r and 0 <= s < 743 and current[s] == f, 'Common scalar chart')
+ need(s != r and 0 <= s < 745 and current[s] == f, 'Common scalar chart')
if op == 'COPY':
need(r in live_owned and not rows[r], 'COPY into cleared owned field')
rows[r] = {k:q*x for k,x in rows[s].items()}
@@ -159,23 +159,23 @@
need(op == 'ADD', 'Scalar opcode')
add(rows[r], rows[s], q)
scalar += 2*(3+n.bit_length()-1+n.bit_count()+d.bit_length()-1)
- need(not live_owned and peak == 1 and current[:735] == w['final'], 'All public and owned exits')
+ need(not live_owned and peak == 1 and current[:737] == w['final'], 'All public and owned exits')
live = set(w['live'])
for r,row in enumerate(rows):
- expected = {r:Q(1)} if r < 735 else {}
+ expected = {r:Q(1)} if r < 737 else {}
if r-112 in live:
expected[r-112] = Q(1)
- need(row == expected, 'All 743 public and owned rows')
+ need(row == expected, 'All 745 public and owned rows')
main = live | {r+112 for r in live}
- helpers = Counter(len(w['frames'][w['final'][r]])-len(w['frames'][w['initial'][r]]) for r in range(735) if r not in main)
+ helpers = Counter(len(w['frames'][w['final'][r]])-len(w['frames'][w['initial'][r]]) for r in range(737) if r not in main)
need(len(live) == len(w['ports']) == 104 and len(main) == 208 and min(helpers) > 0, 'Independent productive inputs')
- return {'paid':dict(paid), 'helpers':dict(helpers), 'public_inputs':735, 'owned_lifetimes':8,
- 'peak_owned_fields':peak, 'real_scalar_allowance':scalar, 'endpoint_coefficients':743*743}
+ return {'paid':dict(paid), 'helpers':dict(helpers), 'public_inputs':737, 'owned_lifetimes':8,
+ 'peak_owned_fields':peak, 'real_scalar_allowance':scalar, 'endpoint_coefficients':745*745}


def reverse_columns(w):
"""Check the transpose with dense dyadic rows and the reverse chronology."""
- n = 743
+ n = 745
rows = [[int(i == j) for j in range(n)] for i in range(n)]
exponents = [0]*n
for e in reversed(w['program']):
@@ -206,7 +206,7 @@
exponents[r] -= 1
for r,row in enumerate(rows):
expected = [0]*n
- if r < 735:
+ if r < 737:
expected[r] = 1 << exponents[r]
if r in w['live']:
expected[r+112] = 1 << exponents[r]
@@ -234,7 +234,7 @@
check(e[2],e[3])
main = set(w['live']) | {r+112 for r in w['live']}
helper_profile = Counter()
- for r in range(735):
+ for r in range(737):
if r not in main:
helper_profile[check(w['initial'][r],w['final'][r])['rank']] += 1
adapters = []
--- p104-joint-contact/pricing.py (PR5551)
+++ p104-two-handoffs/pricing.py
@@ -11,8 +11,8 @@
from fractions import Fraction as Q
import local as L

-KAPPA, TESTED = Q('.00304153'), Q('.0030415305')
-PREVIOUS = Q('.00304117')
+KAPPA, TESTED = Q('.00304282'), Q('.0030428205')
+PREVIOUS = Q('.00304153')


def encode(x):
@@ -61,7 +61,7 @@
second_p[8*(j+1)] += 208
L.need((targets,paid) == (second_t,second_p), 'Independent full invoice')
L.need(max(targets) == 145 and max(paid) == 72, 'Maximum recursive ranks')
- L.need(sum(targets.values()) == 12814 and sum(paid.values()) == 69912, 'Complete field and call counts')
+ L.need(sum(targets.values()) == 12850 and sum(paid.values()) == 69912, 'Complete field and call counts')
L.need(sum(r*n for r,n in targets.items())-sum(r*n for r,n in paid.items()) == 760, 'Complete rank surplus')
return targets,paid,counts

45 changes: 45 additions & 0 deletions research/p104-two-handoffs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Two successor hand-offs on the P104 word (conditional kappa .0030428242)

Complete conditional kappa **.0030428242** (**+1.29e-6** over
[PR5551](https://github.com/CrocSwap/integer-mult-bounds/pull/5551)'s .0030415312). The claim is
tested at .0030428205; the exact raw crossing lies in
(76070606559/25000000000000, 304282426237/100000000000000) =
(.00304282426236, .00304282426237).

**Conditional on** (a) the five framework assumptions retained by PR5544/5545/5551; (b) the validity of
PR5551, which is unreproduced at the time of writing; (c) admissibility of a fresh helper that
starts at a non-canonical mid frame. For (c): "Variant A" below passes the **unmodified** PR5545
`local.py`, and the canonical start-frame rule exists only in the #4610 compact-width verifier. The
selected record is not changed; no independent human or proof-kernel acceptance is claimed.

## Mechanism
Helper 473 (event 13725) and helper 531 (event 13941) finish their first rank-1 climb at a dim-2
frame (608, 613) and then idle; no other register holds their symbol. Following the successor
hand-off pattern of PR5472, the rest of each helper's life moves to a fresh helper that starts at
that frame: 473 climbs 8 as 1+7, 531 climbs 7 as 1+6. This is a pure rename: the same 25,310 events,
no extra ADD, identical paid profile (69,912 calls, rank-mass surplus 760). Only the helper targets change (12,814 -> 12,850 productive fields, the extra rank-1 spectators being
moment-neutral): at each of the 18 calls a rank-8 climb becomes 1+7 and a rank-7 climb 1+6, and by
subadditivity the concave moment gains 1-(8^t-7^t) resp. 1-(7^t-6^t), i.e. +6.6e-7 and +6.3e-7 in kappa.

## Files
- `handoff.py` derives `WORD.json.gz` (and Variant A `WORD-VARIANT-A.json.gz`) from PR5551's pinned word `inputs/pr5551-WORD.json.gz` (sha256 48f8734c...).
- `local.py`, `pricing.py` are PR5545/5551's files with ONLY literal changes: 735->737 public inputs, 743->745 rows, targets 12814->12850, kappa constants. See `LITERAL-CHANGES.diff`; `verify.py` re-applies the substitutions and checks byte equality.
- Variant A: the two helpers' leading MOVE is deleted and they start at frames 608/613 (public stays 735). It passes the unmodified `local.py`/native/caller; only the call-count literal in pricing changes (69,912 -> 69,876), and the crossing is identical.
- `verify.py` / `verify.sh` (stdlib, Python 3.12, a few minutes): both words, replay, transpose, native maps, physical caller, pricing with both moment engines, all 54 strict + 4 functional outer checks, exact crossing interval. `--write` refreshes `RESULT.json`.
- `inputs/pr5545-source-closure.tar.gz` is PR5551's byte-pinned capsule (`SOURCES.json`).

## Independent audit
An internal AI audit (separate read-only Claude agent, own builder and pipeline) found the literal
edits identical, the word byte-equal, extra targets double-count free, and reproduced the crossing
.003042824262. It rated legality of the mid-frame start as unresolved, which is why this is conditional.

## Credits
Builds on PR5551 (thu-nmrc), the successor hand-off pattern of PR5472 (GamingPuzzled), and the P104
word line of PR5544/5545 (aliromman; lineage PR2305/2152/2219). All predecessor credit is retained.

Prepared by DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code.

## Open next questions

- Is a fresh helper starting at a non-canonical mid frame admissible? The gain depends on it; Variant A passes the unmodified PR5545 `local.py`, and the canonical-start rule exists only in the #4610 compact-width verifier.
- Independent reproduction of PR5551, on which this package builds.
Loading
Loading