diff --git a/research/rank7-idle-donors-exact-r438/AUDIT.json b/research/rank7-idle-donors-exact-r438/AUDIT.json new file mode 100644 index 0000000000..aac0d44646 --- /dev/null +++ b/research/rank7-idle-donors-exact-r438/AUDIT.json @@ -0,0 +1,18 @@ +{ + "binding": "complex", + "complex_root_lower": "8674078851925492817421/5000000000000000000000000", + "fill_rebound": true, + "kappa": "17348157703850985634839999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "moves": 435604, + "rejected_controls": { + "axis_moved_twice": "axis not in donor remainder", + "dropped_move": "declared profile", + "foreign_axis": "axis not in donor remainder", + "hosted_axis_from_used_prefix": "axis not in donor remainder", + "hosted_receiver": "receiver must be unhosted", + "kappa_above_bit": "headline kappa", + "next_root_grid": "complex root bracket", + "receiver_donates": "receiver must be unhosted" + }, + "status": "PASS_IDLE_DONOR_EXACT_R438_AUDIT" +} diff --git a/research/rank7-idle-donors-exact-r438/BINS.json.gz b/research/rank7-idle-donors-exact-r438/BINS.json.gz new file mode 100644 index 0000000000..fc2446437c Binary files /dev/null and b/research/rank7-idle-donors-exact-r438/BINS.json.gz differ diff --git a/research/rank7-idle-donors-exact-r438/CLAIM.json b/research/rank7-idle-donors-exact-r438/CLAIM.json new file mode 100644 index 0000000000..c5be3d5311 --- /dev/null +++ b/research/rank7-idle-donors-exact-r438/CLAIM.json @@ -0,0 +1,34 @@ +{ + "kappa": "17348157703850985634839999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017348157703850985634839999999999999999999998999999999999999999999999", + "binding": "complex", + "complex_root": [ + "8674078851925492817421/5000000000000000000000000", + "17348157703850985634843/10000000000000000000000000" + ], + "bit": "R438 0.001734846264120199151475", + "gain_over_pr3200": "174973179420229/20000000000000000000000", + "gain_over_pr3198": "45213273585402989/1000000000000000000000000", + "profile": { + "1": 16353294, + "2": 4837720, + "3": 1533431, + "4": 679320, + "5": 147055, + "8": 53280, + "42": 32303, + "43": 1160, + "44": 8240, + "45": 32140, + "46": 6300, + "47": 20, + "48": 35294, + "49": 27626, + "50": 10480, + "51": 129006 + }, + "T": 740, + "status": "author-checked conditional candidate", + "idea": "OpenCode (Space bunny free): exact per-group search in place of PR3200's greedy phase 1", + "credits": "Idea: OpenCode (Space bunny free). Base PR3200/PR3198/PR3190 (rohanarun); PR1252 Gonzalo-Mier; star class Gueorgui Maissouradze; PR3148 Jeremy Diviney; PR3133 dcharb78; PR1043 Ali Romman; PR2423 Sagar Thakrar; Anthropic Claude" +} diff --git a/research/rank7-idle-donors-exact-r438/MOVES.json.gz b/research/rank7-idle-donors-exact-r438/MOVES.json.gz new file mode 100644 index 0000000000..d2b8831feb Binary files /dev/null and b/research/rank7-idle-donors-exact-r438/MOVES.json.gz differ diff --git a/research/rank7-idle-donors-exact-r438/PR3148-PROVIDERS.json b/research/rank7-idle-donors-exact-r438/PR3148-PROVIDERS.json new file mode 100644 index 0000000000..0b23436750 --- /dev/null +++ b/research/rank7-idle-donors-exact-r438/PR3148-PROVIDERS.json @@ -0,0 +1,842 @@ +{ + "extra": { + "actual_paid_profile": { + "1": 2433, + "2": 724, + "3": 228, + "4": 102, + "5": 20, + "8": 8 + }, + "widths": [ + 9, + 9, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 9, + 8, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 8, + 7, + 7, + 7, + 7, + 8, + 9, + 8, + 9, + 6, + 6, + 7, + 7, + 7, + 7, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 6, + 6, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 6, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 7, + 7, + 6, + 6, + 9, + 8, + 9, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 9, + 8, + 9, + 8, + 7, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 7, + 6, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 5, + 5, + 8, + 8, + 8, + 8 + ] + }, + "gauge44": { + "actual_paid_profile": { + "1": 2433, + "2": 724, + "3": 228, + "4": 102, + "5": 20, + "8": 8 + }, + "widths": [ + 9, + 9, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 9, + 8, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 8, + 7, + 7, + 7, + 7, + 8, + 9, + 8, + 9, + 6, + 6, + 7, + 7, + 7, + 7, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 6, + 6, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 6, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 7, + 7, + 6, + 6, + 9, + 8, + 9, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 9, + 8, + 9, + 8, + 7, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 7, + 6, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 5, + 5, + 8, + 8, + 8, + 8 + ] + } +} diff --git a/research/rank7-idle-donors-exact-r438/README.md b/research/rank7-idle-donors-exact-r438/README.md new file mode 100644 index 0000000000..d509a8e537 --- /dev/null +++ b/research/rank7-idle-donors-exact-r438/README.md @@ -0,0 +1,81 @@ +# Exact per-group idle-donor search on PR3200: conditional κ = 0.001734815770385098563484 − 10⁻⁴⁶ − 10⁻⁷⁰ + +**Author-checked conditional candidate; not maintainer-reviewed.** This package stacks on the open PR3200, which stacks on PR3198, PR3190, PR3184, PR3148 and PR3133. PR3133's words and PR3148's fill rows, order and dispatch are unchanged. Only the idle-axis donor moves change. + +**Idea credit: OpenCode (Space bunny free).** The idea is to replace PR3200's greedy phase-1 selection with an exact search inside each (replica, port) group. + +| | complex root lower | bit endpoint | binds | κ headline | +|---|---|---|---|---| +| PR3200 | 0.0017348070217261275520343 | R438 0.001734846264120199151475 | complex | 0.001734807021726127552033 − … | +| **this** | **0.0017348157703850985634843** | R438 0.001734846264120199151475 | complex | **0.001734815770385098563484 − …** | + +The gain over PR3200 is **+8.7487e-9**, exactly `174973179420229/2·10²²`. About 3.05e-8 of headroom to the R438 bit endpoint remains. + +## What changes + +PR3200's three phases run per (replica, port) group: + +1. drain hosted remainders greedily; +2. stars: PR3184's exact optimum on fully idle 48s; +3. greedy single-axis moves between unhosted children. + +Phase 1 is replaced by a **memoised exact search**: + +- **Choices.** Every hosted-remainder axis either stays put or moves to any unhosted receiver where it is legal. +- **Legality.** This is PR1252's commuting rule: + - the axis commutes with the receiver's axes held at that moment; + - it commutes with all stage entry/exit X/Y translations and the terminal Y translation; + - it commutes with both children's terminal translations. +- **Cap.** Receivers stay at rank ≤ 51. +- **State.** Item index, the set of axes received per receiver, and the number of axes moved per donor. +- **Scoring.** Each terminal state is scored by the **final** group cost Σ Hf(rank). That cost is computed after running phase 2 (optional: both with and without stars) and PR3200's unchanged phase 3 on that state. So phase 1 is chosen for the group's end cost, not its own. + +Two findings shaped the patch: + +- **Phase 1 alone was already optimal.** An exact phase 1 that minimises only its own cost reproduces PR3200's moves exactly (430,164 moves, same κ). +- **The gain is from the joint scoring.** Scoring with phases 2 and 3 included, and letting a group skip stars when that is cheaper, gives the improvement. + +The result is 435,604 axis moves. The idle bill becomes: + +`{1:149514, 2:15880, 3:14951, 5:13855, 42:32303, 43:1160, 44:8240, 45:32140, 46:6300, 47:20, 48:35294, 49:27626, 50:10480, 51:129006}` + +Rank mass is unchanged at `65088·740`. The maximum child rank is 51, and the halving check gives [5329, 5202]. + +## Reproduce + +```sh +# PR3148 materialize.py (research/coupled-carrier-cap740) -> /tmp/t740 +python3 -B research/rank7-idle-donors-exact-r438/build.py --t740 /tmp/t740 # ~1 min, deterministic +python3 -B research/rank7-idle-donors-exact-r438/verify.py --t740 /tmp/t740 # ~70 s +``` + +`verify.py` is PR3200's independent verifier, which does not import `build.py`. Only the status string is renamed and a PR3200 gate is added. Every legality, profile, rank-mass, root-bracket and bit check is unchanged. + +The run outputs `PASS_IDLE_DONOR_EXACT_R438_AUDIT moves=435604 controls=8 kappa=0.0017348157703850986 binding=complex`, with all 8 mutation controls rejected. As a cross-check, PR3200's **unmodified** `verify.py` also passes on these BINS, MOVES and RESULT files. + +`build.py` is byte-deterministic: two runs give identical BINS, MOVES and RESULT files. + +## Open next questions + +- **Do hosted donors and multi-donor receivers satisfy the T74 controller contract?** First step: + generalize the T74 `audit_mixed.py` to read the idle-axis overlay and rerun PR3148's release. + Blocked by: the T74 chain has no overlay reader. +- **Can the remaining 3.05e-8 to the R438 bit endpoint be closed?** The exact search is optimal + over legal single-axis donor moves; the residual is blocked by PR1252's commuting rule. First + step: prototype chained/relay donor swaps or port axes re-anchored outside the translation span, + with the commuting rule strictly enforced. Blocked by: no such move class is specified yet. +- **Can the bit endpoint rise past R438?** First step: test helper removals outside PR1043's + pure-relay class. Blocked by: PR1043's lifetime test only certifies 2-occurrence relays, and + R438 depends on the open PR1043. + +## Scope + +This is conditional on PR3200's stack and on R438, whose source PR1043 is open. It inherits PR3200's scope: + +- the hosted-remainder donor hypothesis and multi-donor receivers rely on PR1252's per-axis rule; +- only unhosted pairs have an admitted controller audit; +- native admission, the overlay-aware controller audit and the outer release were not rerun. + +All inherited obligations remain. The remaining 3.05e-8 to the bit endpoint is blocked by axis legality, not by search: about 99% of blocked moves fail the commuting rule. Recovering it needs a new move class, such as chained or relay donor swaps. + +Credits: the idea is from OpenCode (Space bunny free). The base is PR3200, PR3198 and PR3190 (rohanarun). Also: PR1252 Gonzalo-Mier; star class Gueorgui Maissouradze; PR3148 Jeremy Diviney; PR3133 dcharb78; PR1043 Ali Romman; PR2423 Sagar Thakrar. Prepared by Rohan Arun with Anthropic Claude assistance. Apache-2.0. diff --git a/research/rank7-idle-donors-exact-r438/RESULT.json b/research/rank7-idle-donors-exact-r438/RESULT.json new file mode 100644 index 0000000000..e20225791d --- /dev/null +++ b/research/rank7-idle-donors-exact-r438/RESULT.json @@ -0,0 +1,65 @@ +{ + "status": "PASS_IDLE_DONOR_EXACT_R438_T740", + "T": 740, + "axis_moves": 435604, + "donor_children": 150529, + "receiver_children": 167112, + "idle_before": { + "1": 173160, + "3": 48951, + "5": 13875, + "48": 282569 + }, + "idle_after": { + "1": 149514, + "2": 15880, + "3": 14951, + "5": 13855, + "42": 32303, + "43": 1160, + "44": 8240, + "45": 32140, + "46": 6300, + "47": 20, + "48": 35294, + "49": 27626, + "50": 10480, + "51": 129006 + }, + "profile": { + "1": 16353294, + "2": 4837720, + "3": 1533431, + "4": 679320, + "5": 147055, + "8": 53280, + "42": 32303, + "43": 1160, + "44": 8240, + "45": 32140, + "46": 6300, + "47": 20, + "48": 35294, + "49": 27626, + "50": 10480, + "51": 129006 + }, + "complex_root": [ + "8674078851925492817421/5000000000000000000000000", + "17348157703850985634843/10000000000000000000000000" + ], + "complex_root_decimal": "17348157703850985634842e-25", + "bit": "69393850564807966059/40000000000000000000000", + "binding": "complex", + "kappa": "17348157703850985634839999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017348157703850985634839999999999999999999998999999999999999999999999", + "gain_over_pr3200": "174973179420229/20000000000000000000000", + "gain_over_pr3198": "45213273585402989/1000000000000000000000000", + "gain_over_pr3184": "4626709151247803389/1000000000000000000000000", + "gain_over_pr3148": "2519137853250775799/500000000000000000000000", + "max_child_rank": 51, + "halving": [ + 5329, + 5202 + ] +} diff --git a/research/rank7-idle-donors-exact-r438/SOURCES.json b/research/rank7-idle-donors-exact-r438/SOURCES.json new file mode 100644 index 0000000000..bb4884cb26 --- /dev/null +++ b/research/rank7-idle-donors-exact-r438/SOURCES.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "research/adaptive-kernel-demotion/inputs/DATA-PHASES.json", + "usage": "input", + "git_blob": "d9a4f84211182ca200c081ea061d724c8a2cfb70", + "sha256": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa" + }, + { + "path": "research/r438-native-rehost/CERTIFICATE.json", + "usage": "input", + "git_blob": "674ef36f723fbcc593e7d2319dca131da09181e5", + "sha256": "6da8c593257c8440f0fe35488d941715d953d715e2e464ffdfffff7ed31eee9c" + } + ] +} diff --git a/research/rank7-idle-donors-exact-r438/TASK.json b/research/rank7-idle-donors-exact-r438/TASK.json new file mode 100644 index 0000000000..e559c15f36 --- /dev/null +++ b/research/rank7-idle-donors-exact-r438/TASK.json @@ -0,0 +1,84 @@ +{ + "schema_version": 1, + "task_id": "selected-packing", + "priority_revision": 6, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "original_card": { + "id": "selected-packing", + "question": "Is there a genuinely unsearched, explicitly bounded improvement to the selected packing?", + "starting_points": [ + "certificates/selected-result.json", + "research/heterogeneous-owner-assembly/README.md", + "research/complex-local-word-ceiling/README.md" + ], + "methods": [ + "Search a named unclaimed canonical candidate domain with a reproducible partition.", + "Prove a stronger scoped relaxation or exact optimum for one named residual subproblem." + ], + "acceptance_gate": "Check live PR overlap first, price both suppliers and distinguish a search best from an optimum. Report the word's packing cap from ceiling.ceiling() and the fraction of it realized; label packing gains as such.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Locate the selected packing source in the review and check live PRs for the same residual problem.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Define an unclaimed canonical domain and a favorable bound before starting a new search.", + "bottleneck_link": "An actual paid-profile gain can improve the frontier up to the other supplier cap.", + "allowed_variations": [ + "One bounded residual packing instance or exact relaxation.", + "If the coverage law, template or guard changes, derive an applicable fully charged replacement bound instead of applying the incumbent ceiling outside its scope." + ], + "scope_change_triggers": [ + "Rerunning an existing search with only a different seed as a separate mathematical contribution." + ], + "overlap_terms": [ + "T16", + "owner exchange", + "packing" + ], + "existing_checks": [ + { + "scope": "Packing-independent ceiling for the selected paid profile under the one-unpaid-coordinate coverage and halving guard.", + "evidence": "docs/research/community-efficient1000-review.md", + "remaining": "A changed word or model requires new pricing; a local packing search must name uncovered scope.", + "status": "reviewed", + "source_commit": "836b19bfa309ceafbc8ee32a15e8c4b10dde7e11", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Changed residual subproblem on the open PR3148 T740 fill of PR3133's words: PR3200's idle-donor construction with phase 1 replaced by an exact memoised per-(replica, port) search over legal PR1252-rule hosted-remainder donor moves (cap 51), each choice scored by the group's final cost after optional PR3184 stars and PR3200's unchanged phase 3, composed with the R438 bit supplier (research/r438-native-rehost).", + "scope_change_reason": "PR3200 left the complex side binding 3.9e-8 below the R438 bit endpoint with a greedy phase 1; an exact per-group search scored jointly with phases 2 and 3 closes about 22% of that window.", + "bottleneck_link": "kappa = min(complex, bit); the complex side binds, and more idle repartition lowers its moment cost.", + "budget_minutes": 60, + "stop_rule": "Stop after the exact overlay, pricing and independent verifier; no controller/outer admission.", + "outcome": "partial", + "evidence": "RESULT.json, BINS.json.gz, MOVES.json.gz (435,604 axis moves), AUDIT.json (8/8 controls rejected), R438 endpoint re-derived; PR3200's unmodified verify.py also passes.", + "author": "Rohan Arun", + "ai_assistance": "Substantial Anthropic Claude (Claude Code) assistance; done with help from OpenCode (Space bunny free).", + "open_questions": [ + { + "question": "Do hosted donors and multi-donor receivers satisfy the T74 controller contract?", + "why_it_matters": "Only PR1252 unhosted pairs have an admitted controller audit.", + "first_step": "Generalize the T74 audit_mixed.py to read the idle-axis overlay and rerun PR3148's release.", + "blocked_by": "No overlay reader in the T74 chain." + }, + { + "question": "Can the remaining 3.05e-8 to the R438 bit endpoint be closed?", + "why_it_matters": "The exact search is optimal over the legal single-axis move class; the residual is blocked by PR1252's commuting rule, not by search.", + "first_step": "Prototype a new move class (chained/relay donor swaps, or re-anchoring port axes outside the translation span) with the commuting rule strictly enforced, and check rank mass, the rank-51 cap and halving.", + "blocked_by": "No legal move class beyond single-axis donor moves is specified yet." + }, + { + "question": "Can the bit endpoint itself rise past R438?", + "why_it_matters": "kappa = min(complex, bit), so a lower R raises the ceiling directly.", + "first_step": "Test helper removals outside PR1043's pure-relay class (helpers read more than twice, helper merges).", + "blocked_by": "PR1043's lifetime test only certifies 2-occurrence relays; R438 depends on the open PR1043." + } + ] +} diff --git a/research/rank7-idle-donors-exact-r438/VERIFY.json b/research/rank7-idle-donors-exact-r438/VERIFY.json new file mode 100644 index 0000000000..8e9b5169f1 --- /dev/null +++ b/research/rank7-idle-donors-exact-r438/VERIFY.json @@ -0,0 +1,21 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/adaptive-kernel-demotion/inputs/DATA-PHASES.json", + "research/r438-native-rehost/CERTIFICATE.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 300, + "checks": "Independent of build.py: donor axes from own remainder, unhosted receivers, no child both donates and receives, unit/orthogonal-at-receipt and commuting rule, cap 51, profile and rank mass, exact complex root bracket, R438 bit endpoint re-derived (accept at c, reject at c+1e-24), kappa = min(floor24(complex), bit) - 1e-46 - 1e-70 with complex binding, gates over PR3148/PR3184/PR3198/PR3200; 8 mutation controls rejected." + } + ] +} diff --git a/research/rank7-idle-donors-exact-r438/build.py b/research/rank7-idle-donors-exact-r438/build.py new file mode 100644 index 0000000000..be62aa634e --- /dev/null +++ b/research/rank7-idle-donors-exact-r438/build.py @@ -0,0 +1,278 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Exact per-group idle-remainder donor exchanges on PR3148's T740 fill of PR3133's words (stacks on PR3200). + +Idea (credited): OpenCode (Space bunny free) -- replace PR3200's greedy phase-1 selection by an exact search within +each (replica, port) group. Phase 1 is a memoised DFS over every placement of every hosted-remainder axis (stay, or +any legal unhosted receiver), scored by the FINAL group cost sum Hf(rank) after phases 2 (star optimum, optional) and 3 +(PR3200's greedy single-axis phase, unchanged). Everything else below is PR3200's build.py. + +Idle-remainder donor exchanges on PR3148's T740 fill of PR3133's words. + +Every idle remainder of a (replica, port) - including the remainder of a partially hosted bin, +whose axes are the recipe axes [used, cap) - may donate axes to a fully idle (unhosted) child of +the same replica and port. Each moved axis obeys PR1252's commuting rule (commutes with all of the +receiver's current axes, every stage entry/exit X and Y translation, the terminal Y translation and +both children's terminal translations). Receivers are capped at rank 51 (73^2 > 2*51^2). +Phase 1 drains remainders smallest-first into the largest legal receiver; phase 2 runs the +frontier1094 star optimum (PR3184) on the untouched fully idle rank-48 children; phase 3 (new here) +repeats the best single-axis move from a smaller unhosted child to an equal-or-larger unhosted +receiver while it lowers the moment cost. Complex endpoint composed with the R438 bit supplier. + +Inputs (pinned): DATA-PHASES.json on main; PR3148's materialized COMPOSED-FILL/ORDER/DISPATCH and +its PR3133 provider widths (PR3148-PROVIDERS.json, copied from PR3148 vendor/). +""" +import argparse, gzip, hashlib, itertools, json, math +from collections import Counter, defaultdict +from fractions import Fraction as Q +from pathlib import Path + +HERE = Path(__file__).resolve().parent +PHASES = HERE.parents[1] / 'research/adaptive-kernel-demotion/inputs/DATA-PHASES.json' +PIN = dict(phases='c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa', + fill_payload='8f4d6965ba573ff2b71fd7bf6b552643e086739d90bd73c55889502077638e00', + order='927226d702bf3cada076f4c459da9063c0df7e7154a62955cf75c40cf30215b9', + dispatch='90edc935320dd6264e98dc735d868df3c95f5901c70d7d96171001fcb295cce0', + providers='52eb0d85caa7b2d4a93acdf5011f52b793f61ddca86235fb03cd9a09397ad4cd') +T = 740 +LOCAL = {1: 2433, 2: 724, 3: 228, 4: 102, 5: 20, 8: 8} +IDLE_PR3148 = {1: 173160, 3: 48951, 5: 13875, 48: 282569} +BIT = Q('69393850564807966059/40000000000000000000000') # R438 bit endpoint, research/r438-native-rehost CERTIFICATE.json +PR3148_KAPPA = Q('0.0017297774946785970118859999999999999999999998999999999999999999999999') +PR3198_KAPPA = Q('0.0017347705571115131604949999999999999999999998999999999999999999999999') +PR3200_KAPPA = Q('0.0017348070217261275520339999999999999999999998999999999999999999999999') +PR3184_KAPPA = Q('0.0017301890612338507600949999999999999999999998999999999999999999999999') + + +def need(ok, why): + if not ok: raise SystemExit('FAIL: ' + why) + + +def sha(b): return hashlib.sha256(b).hexdigest() +def dot(a, b): return (a & b).bit_count() & 1 +def Hf(r): return 0.0 if r == 0 else r * (73.0 / r) ** 0.00173 + + +def pgz(obj): + d = bytearray(gzip.compress(json.dumps(obj, sort_keys=True, separators=(',', ':')).encode(), mtime=0)); d[9] = 255 + return bytes(d) + + +# ---- exact root (rational intervals, directed rounding 1e-60) ---- +S = 10 ** 60 +def dn(x): return Q(math.floor(x * S), S) +def upr(x): return Q(math.ceil(x * S), S) +def atanh2(z, n): + s, p = Q(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) +L2 = atanh2(Q(1, 3), 120) +LN = {} +def lnr(r): + if r not in LN: + x, k = Q(73, r), 0 + while x > 2: x /= 2; k += 1 + a, e = atanh2((x - 1) / (x + 1), 80) + LN[r] = (dn(a + k * L2[0]), upr(a + e + k * (L2[0] + L2[1]))) + return LN[r] +def ex(x0, x1): + def ser(x): + s, t = Q(0), Q(1) + for n in range(1, 40): s += t; t = t * x / n + return s, t + a, _ = ser(x0); b, t = ser(x1) + return dn(a), upr(b + 2 * t) +def moment(prof, b): + W = 896 * T; lo = hi = Q(0) + for r, n in prof.items(): + l0, l1 = lnr(r); e0, e1 = ex(b * l0, b * l1); lo += n * r * e0; hi += n * r * e1 + return lo / (73 * W), hi / (73 * W) +def root(prof, digits=25): + f = lambda b: sum(n * r * (73 / r) ** b for r, n in prof.items()) / (73 * 896 * T) - 1 + a, c = 0.0, 0.01 + for _ in range(200): + m = (a + c) / 2 + if f(m) < 0: a = m + else: c = m + g = 10 ** digits; k0, k1 = int(a * g) - 10 ** 10, int(a * g) + 10 ** 10 + need(moment(prof, Q(k0, g))[1] < 1 and moment(prof, Q(k1, g))[0] > 1, 'bracket') + while k1 - k0 > 1: + k = (k0 + k1) // 2; lo, hi = moment(prof, Q(k, g)) + if hi < 1: k0 = k + elif lo > 1: k1 = k + else: raise SystemExit('wide interval') + return Q(k0, g), Q(k1, g) + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--t740', type=Path, required=True, help='directory written by PR3148 materialize.py') + a = ap.parse_args() + raw = PHASES.read_bytes(); need(sha(raw) == PIN['phases'], 'phases pin') + rec = {r['port']: r for r in json.loads(raw)['recipes']} + fraw = gzip.decompress((a.t740 / 'COMPOSED-FILL.json.gz').read_bytes()); need(sha(fraw) == PIN['fill_payload'], 'fill pin') + need(sha((a.t740 / 'ORDER.json').read_bytes()) == PIN['order'] and sha((a.t740 / 'DISPATCH.json').read_bytes()) == PIN['dispatch'], 'order/dispatch pins') + praw = (HERE / 'PR3148-PROVIDERS.json').read_bytes(); need(sha(praw) == PIN['providers'], 'providers pin') + prov = json.loads(praw); order = json.loads((a.t740 / 'ORDER.json').read_bytes()) + disp = {(s, r): p for s, r, p in json.loads((a.t740 / 'DISPATCH.json').read_bytes())} + fill = json.loads(fraw) + need(fill['columns'] == ['time', 'helper', 'owner_replica', 'child', 'port', 'offset'] and fill['dispatch_overrides'] == [], 'fill format') + caps = {(p, c): ch['rank'] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + AX = {(p, c): [int(v) for v in ch['orthogonal_axes']] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + TR = {(p, c): int(ch['translation_after']) for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + PT = {p: [int(s[k]) for s in rc['stage_alignment'] for k in ('entry_Y', 'exit_Y', 'entry_X', 'exit_X')] + [int(rc['terminal_Y_translation'])] for p, rc in rec.items()} + used, top = Counter(), Counter() + for time, helper, rep, child, port, offset in fill['rows']: + s, r = order[time]; w = prov[disp[s, r]]['widths'][helper] + used[rep, child, port] += w; top[rep, child, port] = max(top[rep, child, port], offset + w) + need(all(used[k] == top[k] for k in used), 'compact helper prefixes') + groups = [] + for rep in range(T): + for p in range(112): + kids = [[c, used[rep, c, p]] for c in range(len(rec[p]['idle_children'])) if caps[p, c] - used[rep, c, p] > 0] + groups.append([rep, p, kids]) + idle = Counter(caps[p, c] - u for _, p, kids in groups for c, u in kids) + need(dict(idle) == IDLE_PR3148, 'idle bill equals PR3148') + + def legal(v, p, c, d, axes_d): + return all(dot(v, x) == 0 for x in axes_d) and all(dot(v, x) == 0 for x in PT[p]) and dot(v, TR[p, c]) == 0 and dot(v, TR[p, d]) == 0 + + def solve(p, kids): + rank = {c: caps[p, c] - u for c, u in kids}; axes = {c: AX[p, c][u:caps[p, c]] for c, u in kids} + hosted = {c: u > 0 for c, u in kids}; role = {c: None for c, _ in kids}; moves = [] + donors = sorted([c for c, u in kids if u > 0], key=lambda c: (rank[c], c)) + recv = [d for d, u in kids if u == 0] + items = [(c, v) for c in donors for v in axes[c]] + STARS = [True] + r0 = {c: rank[c] for c, _ in kids} + memo = {} + def dfs2(i, recvd, cnt): + # exact search: state = (item index, axes received per receiver, axes moved per donor); terminal cost runs + # phases 2 (optional) and 3 on the resulting state, so phase 1 is chosen for the final sum of Hf(rank) + key = (i, recvd, cnt) + if key in memo: return memo[key] + if i == len(items): + rk = dict(r0) + for k, c in enumerate(donors): rk[c] -= cnt[k] + for o, d in enumerate(recv): rk[d] += len(recvd[o]) + ax2 = {c: list(axes[c]) for c in axes} + for o, d in enumerate(recv): ax2[d] = ax2[d] + sorted(recvd[o]) + ro2 = {c: role[c] for c in role} + for k, c in enumerate(donors): + if cnt[k]: ro2[c] = 'D' + for o, d in enumerate(recv): + if recvd[o]: ro2[d] = 'R' + best_t = None + for st in (True, False): + _, rk2 = rest({c: list(x) for c, x in ax2.items()}, dict(rk), dict(ro2), [], st) + cst = sum(Hf(x) for x in rk2.values()) + if best_t is None or cst < best_t[0] - 1e-12: best_t = (cst, st) + memo[key] = (best_t[0], (best_t[1],)) + return memo[key] + c, v = items[i]; kd = donors.index(c) + best = None + for o in [None] + list(range(len(recv))): + if o is None: nxt, nc = recvd, cnt + else: + d = recv[o] + if r0[d] + len(recvd[o]) >= 51: continue + if not legal(v, p, c, d, list(axes[d]) + list(recvd[o])): continue + nxt = recvd[:o] + (recvd[o] | frozenset([v]),) + recvd[o + 1:] + nc = cnt[:kd] + (cnt[kd] + 1,) + cnt[kd + 1:] + sub = dfs2(i + 1, nxt, nc) + if best is None or sub[0] < best[0] - 1e-12: best = (sub[0], (o,) + sub[1]) + memo[key] = best + return best + def rest(axes, rank, role, moves, stars=True): + free = [c for c, u in kids if u == 0 and role[c] is None and caps[p, c] == 48] + if stars and len(free) >= 2: + MV = {(d, r): [v for v in axes[d] if legal(v, p, d, r, axes[r])] for d in free for r in free if d != r} + best = [len(free) * Hf(48), []] + def match(c, leaves): + opts = [MV[c, l] for l in leaves] + if any(len(o) < 3 for o in opts): return None + def go(k, usedax): + if k == len(leaves): return [] + for trip in itertools.combinations([v for v in opts[k] if v not in usedax], 3): + rest = go(k + 1, usedax | set(trip)) + if rest is not None: return [(c, leaves[k], list(trip))] + rest + return None + return go(0, set()) + def assign(i, roles): + if i == len(free): + leaves = defaultdict(list) + for c in free: + if isinstance(roles[c], tuple): leaves[roles[c][1]].append(c) + cents = [c for c in free if roles[c] == 'c'] + if any(not leaves[c] for c in cents) or any(roles[x] != 'c' for x in leaves): return + mv = [] + for c in cents: + m = match(c, leaves[c]) + if m is None: return + mv += m + rk = [48 - 3 * len(leaves[c]) if roles[c] == 'c' else 51 if isinstance(roles[c], tuple) else 48 for c in free] + cost = sum(Hf(x) for x in rk) + if cost < best[0] - 1e-12: best[0], best[1] = cost, mv + return + c = free[i] + for opt in ['n', 'c'] + [('l', d) for d in free if d != c]: + roles[c] = opt; assign(i + 1, roles) + del roles[c] + assign(0, {}) + for c, l, trip in best[1]: + for v in trip: + axes[c].remove(v); axes[l].append(v); rank[c] -= 1; rank[l] += 1; moves.append([c, l, v]) + un = [c for c, u in kids if u == 0] + while True: + best = None + for c in un: + if role[c] == 'R' or rank[c] == 0: continue + for d in un: + if d == c or role[d] == 'D' or rank[d] >= 51 or rank[d] < rank[c]: continue + g = Hf(rank[c] - 1) + Hf(rank[d] + 1) - Hf(rank[c]) - Hf(rank[d]) + if best is not None and g >= best[0]: continue + for v in axes[c]: + if legal(v, p, c, d, axes[d]): best = (g, c, d, v); break + if best is None or best[0] >= 0: break + g, c, d, v = best + axes[c].remove(v); axes[d].append(v); rank[c] -= 1; rank[d] += 1; role[c] = 'D'; role[d] = 'R'; moves.append([c, d, v]) + return moves, rank + if items: + _, choices = dfs2(0, tuple(frozenset() for _ in recv), tuple(0 for _ in donors)) + STARS[0] = choices[-1]; choices = choices[:-1] + for (c, v), o in zip(items, choices): + if o is None: continue + d = recv[o] + axes[c].remove(v); axes[d].append(v); rank[c] -= 1; rank[d] += 1 + role[c] = 'D'; role[d] = 'R'; moves.append([c, d, v]) + return rest(axes, rank, role, moves, STARS[0]) + + cache, moves, final = {}, [], Counter() + for rep, p, kids in groups: + key = (p, tuple(map(tuple, kids))) + if key not in cache: cache[key] = solve(p, kids) + mv, rank = cache[key] + moves += [[rep, p] + m for m in mv] + final.update(r for r in rank.values() if r) + prof = Counter({r: n * 9 * T for r, n in LOCAL.items()}); prof.update(final); prof = dict(sorted(prof.items())) + need(sum(r * n for r, n in prof.items()) == 65088 * T and 73 * 73 > 2 * max(prof) ** 2, 'mass and halving') + lo, hi = root(prof) + C = min(Q(math.floor(lo * 10 ** 24), 10 ** 24), BIT) + kappa = C - Q(1, 10 ** 46) - Q(1, 10 ** 70) + need(kappa > PR3200_KAPPA > PR3198_KAPPA > PR3184_KAPPA > PR3148_KAPPA, 'gates') + (HERE / 'BINS.json.gz').write_bytes(pgz(dict(T=T, columns=['replica', 'port', [['child', 'used']]], groups=[g for g in groups if g[2]]))) + (HERE / 'MOVES.json.gz').write_bytes(pgz(dict(columns=['replica', 'port', 'donor_child', 'receiver_child', 'axis'], moves=moves))) + donors = Counter(); + res = dict(status='PASS_IDLE_DONOR_EXACT_R438_T740', T=T, axis_moves=len(moves), + donor_children=len({(m[0], m[1], m[2]) for m in moves}), receiver_children=len({(m[0], m[1], m[3]) for m in moves}), + idle_before={str(k): v for k, v in IDLE_PR3148.items()}, idle_after={str(k): v for k, v in sorted(final.items())}, + profile={str(k): v for k, v in prof.items()}, complex_root=[str(lo), str(hi)], + complex_root_decimal=f'{lo.numerator * 10**25 // lo.denominator}e-25', bit=str(BIT), binding='bit' if BIT < lo else 'complex', + kappa=str(kappa), kappa_decimal='0.' + str(kappa.numerator * 10 ** 70 // kappa.denominator).rjust(70, '0'), gain_over_pr3200=str(kappa - PR3200_KAPPA), gain_over_pr3198=str(kappa - PR3198_KAPPA), gain_over_pr3184=str(kappa - PR3184_KAPPA), gain_over_pr3148=str(kappa - PR3148_KAPPA), + max_child_rank=max(prof), halving=[5329, 2 * max(prof) ** 2]) + (HERE / 'RESULT.json').write_text(json.dumps(res, indent=1) + '\n') + print('PASS', float(lo), res['binding'], float(kappa), float(kappa - PR3184_KAPPA), len(moves)) + + +if __name__ == '__main__': + main() diff --git a/research/rank7-idle-donors-exact-r438/verify.py b/research/rank7-idle-donors-exact-r438/verify.py new file mode 100644 index 0000000000..56afc2bfa5 --- /dev/null +++ b/research/rank7-idle-donors-exact-r438/verify.py @@ -0,0 +1,221 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Independent verifier (does not import build.py) for the exact per-group idle-remainder donor exchanges. +PR3200's verifier with the status renamed and a PR3200 gate added; every legality and pricing check is unchanged. + + +Re-derives from BINS / MOVES / DATA-PHASES: donor axes come from the donor's own idle remainder +(recipe axes [used, cap)); receivers are unhosted (used == 0); no child both donates and receives; +every moved axis is a unit vector orthogonal to all of the receiver's axes held at that moment and +commutes with every stage entry/exit X/Y translation, the terminal Y translation and both +children's terminal translations; final ranks <= 51; per-group axis multisets unchanged; the +complete profile and rank mass; an exact complex root bracket with its own interval arithmetic; +kappa = min(floor24(complex_lower), PR589 bit) - 1e-46 - 1e-70 and its gates. +Optional --t740 rebinds BINS to PR3148's materialized fill. Mutation controls must be rejected. +""" +import argparse, copy, gzip, hashlib, json +from collections import Counter, defaultdict +from fractions import Fraction as F +from pathlib import Path + +PKG = Path(__file__).resolve().parent +PHASES = PKG.parents[1] / 'research/adaptive-kernel-demotion/inputs/DATA-PHASES.json' +T = 740 +LOCAL = {1: 2433, 2: 724, 3: 228, 4: 102, 5: 20, 8: 8} +IDLE = {1: 173160, 3: 48951, 5: 13875, 48: 282569} +BITCERT = PKG.parents[1] / 'research/r438-native-rehost/CERTIFICATE.json' +BIT = None # R438 bit endpoint, re-derived from its certificate's bit profile in check_bit() +GATES = dict(PR3200=F('0.0017348070217261275520339999999999999999999998999999999999999999999999'), PR3198=F('0.0017347705571115131604949999999999999999999998999999999999999999999999'), PR3148=F('0.0017297774946785970118859999999999999999999998999999999999999999999999'), + PR3184=F('0.0017301890612338507600949999999999999999999998999999999999999999999999')) + + +class Reject(Exception): pass +def req(ok, why): + if not ok: raise Reject(why) +def load(p): + b = Path(p).read_bytes(); return json.loads(gzip.decompress(b) if b[:2] == b'\x1f\x8b' else b) +def par(a, b): return bin(a & b).count('1') & 1 + + +def audit(rec, bins, moves): + caps = {(p, c): ch['rank'] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + G = {} + for rep, p, kids in bins['groups']: + req((rep, p) not in G and 0 <= rep < T and p in rec, 'group key') + G[rep, p] = {c: u for c, u in kids} + req(all(0 <= u < caps[p, c] for c, u in kids), 'used below capacity') + req(Counter(caps[p, c] - u for (rep, p), kids in G.items() for c, u in kids.items()) == Counter(IDLE), 'idle bill') + trans = {} + for p, rc in rec.items(): + trans[p] = {int(s[k]) for s in rc['stage_alignment'] for k in ('entry_X', 'exit_X', 'entry_Y', 'exit_Y')} | {int(rc['terminal_Y_translation'])} + for c, ch in enumerate(rc['idle_children']): + ax = [int(v) for v in ch['orthogonal_axes']] + req(all(par(v, v) == 1 for v in ax) and all(par(a, b) == 0 for i, a in enumerate(ax) for b in ax[i + 1:]), 'recipe axes orthonormal') + state = {} + def cur(rep, p, c): + k = (rep, p, c) + if k not in state: + u = G[rep, p][c]; state[k] = dict(axes=set(int(v) for v in rec[p]['idle_children'][c]['orthogonal_axes'][u:caps[p, c]]), role=None) + return state[k] + for m in moves: + rep, p, c, d, v = m + req((rep, p) in G and c in G[rep, p] and d in G[rep, p] and c != d, 'children of the group') + req(G[rep, p][d] == 0, 'receiver must be unhosted') + sc, sd = cur(rep, p, c), cur(rep, p, d) + req(sc['role'] != 'R' and sd['role'] != 'D', 'child both donates and receives') + own = set(int(x) for x in rec[p]['idle_children'][c]['orthogonal_axes'][G[rep, p][c]:caps[p, c]]) + req(v in sc['axes'] and v in own, 'axis not in donor remainder') + req(par(v, v) == 1 and all(par(v, x) == 0 for x in sd['axes']), 'axis not orthogonal to receiver axes') + tc = int(rec[p]['idle_children'][c]['translation_after']); td = int(rec[p]['idle_children'][d]['translation_after']) + req(all(par(v, x) == 0 for x in trans[p] | {tc, td}), 'axis does not commute with translations') + sc['axes'].discard(v); sd['axes'].add(v); sc['role'] = 'D'; sd['role'] = 'R' + req(len(sd['axes']) <= 51, 'rank above 51') + final = Counter() + for (rep, p), kids in G.items(): + for c, u in kids.items(): + r = len(state[rep, p, c]['axes']) if (rep, p, c) in state else caps[p, c] - u + if r: final[r] += 1 + return final + + +def mom(prof, b): + Q72 = 10 ** 72 + def rd(x): return F(x.numerator * Q72 // x.denominator, Q72) + def ru(x): return F(-((-x.numerator * Q72) // x.denominator), Q72) + def at(z, n): + s, p = F(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) + l2 = at(F(1, 3), 130); W = 896 * T; lo = hi = F(0) + for r, n in sorted(prof.items()): + y, k = F(73, r), 0 + while y >= 2: y /= 2; k += 1 + a, e = at((y - 1) / (y + 1), 90) + L0, L1 = rd(a + k * l2[0]), ru(a + e + k * (l2[0] + l2[1])) + def tay(x): + s, t = F(1), F(1) + for j in range(1, 34): t = t * x / j; s += t + return s, t * x / 34 * 3 + e0, _ = tay(b * L0); e1, t1 = tay(b * L1) + lo += n * r * rd(e0); hi += n * r * ru(e1 + t1) + return lo / (73 * W), hi / (73 * W) + + +def check_bit(): + inv = json.loads(BITCERT.read_text())['pipeline']['candidate']['hosted']['invoice'] + prof = {int(k): v for k, v in inv['bit_profile'].items()} + c, cn = F(inv['bit_lower']), F(inv['next_grid_point_rejected']) + req(c == F(inv['bit_lower_decimal']) and cn - c == F(1, 10 ** 24) and 2 * max(prof) ** 2 < 64 ** 2, 'R438 certificate fields') + W = 28416; N = sum(prof.values()) + def bm(b): + lo = hi = F(0) + for r, n in sorted(prof.items()) + [(1, F(32 * 64 * 64 * N, 10 ** 16))]: + l0, l1 = ln64(r); e0, e1 = exbox(b * l0, b * l1); lo += n * r * e0; hi += n * r * e1 + return lo / (64 * W), hi / (64 * W) + req(bm(c)[1] < 1 and bm(cn)[0] > 1, 'R438 bit endpoint accepted at c, rejected at c+1e-24') + return c + + +def ln64(r): + Q72 = 10 ** 72 + def at(z, n): + s, p = F(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) + y, k = F(64, r), 0 + while y >= 2: y /= 2; k += 1 + l2 = at(F(1, 3), 130); a, e = at((y - 1) / (y + 1), 90) + return F((a + k * l2[0]).numerator * Q72 // (a + k * l2[0]).denominator, Q72), F(-((-(a + e + k * (l2[0] + l2[1])).numerator * Q72) // (a + e + k * (l2[0] + l2[1])).denominator), Q72) + + +def exbox(x0, x1): + def tay(x): + s, t = F(1), F(1) + for j in range(1, 34): t = t * x / j; s += t + return s, t * x / 34 * 3 + a, _ = tay(x0); b, t = tay(x1) + return a, b + t + + +def run(rec, bins, moves, result): + final = audit(rec, bins, moves) + prof = Counter({r: n * 9 * T for r, n in LOCAL.items()}); prof.update(final); prof = dict(sorted(prof.items())) + req({str(k): v for k, v in prof.items()} == result['profile'], 'declared profile') + req(sum(r * n for r, n in prof.items()) == 65088 * T, 'rank mass 65088*T') + req(max(prof) <= 51 and 73 * 73 > 2 * max(prof) ** 2, 'halving guard') + lo, hi = F(result['complex_root'][0]), F(result['complex_root'][1]) + req(hi - lo == F(1, 10 ** 25) and mom(prof, lo)[1] < 1 and mom(prof, hi)[0] > 1, 'complex root bracket') + C = min(F(lo.numerator * 10 ** 24 // lo.denominator, 10 ** 24), BIT) + req(C < BIT, 'complex binds below the R438 bit endpoint') + kappa = C - F(1, 10 ** 46) - F(1, 10 ** 70) + req(kappa == F(result['kappa']), 'headline kappa') + for n, g in GATES.items(): req(kappa > g, 'kappa must exceed ' + n) + return prof, kappa, lo + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--t740', type=Path) + ap.add_argument('--providers', type=Path, default=PKG / 'PR3148-PROVIDERS.json') + ap.add_argument('--write', action='store_true', help='rewrite the committed AUDIT.json receipt') + a = ap.parse_args() + if not __debug__: raise SystemExit('assertions required') + raw = PHASES.read_bytes() + req(hashlib.sha256(raw).hexdigest() == 'c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa', 'phases pin') + rec = {r['port']: r for r in json.loads(raw)['recipes']} + global BIT + BIT = check_bit() + bins, mv, result = load(PKG / 'BINS.json.gz'), load(PKG / 'MOVES.json.gz')['moves'], load(PKG / 'RESULT.json') + rebound = False + if a.t740: + fraw = gzip.decompress((a.t740 / 'COMPOSED-FILL.json.gz').read_bytes()) + req(hashlib.sha256(fraw).hexdigest() == '8f4d6965ba573ff2b71fd7bf6b552643e086739d90bd73c55889502077638e00', 'fill pin') + prov = load(a.providers); order = load(a.t740 / 'ORDER.json'); disp = {(s, r): p for s, r, p in load(a.t740 / 'DISPATCH.json')} + used = Counter() + for time, helper, rep, child, port, offset in json.loads(fraw)['rows']: + s, r = order[time]; used[rep, child, port] += prov[disp[s, r]]['widths'][helper] + caps = {(p, c): ch['rank'] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + derived = [[rep, p, [[c, used[rep, c, p]] for c in range(len(rec[p]['idle_children'])) if caps[p, c] - used[rep, c, p] > 0]] for rep in range(T) for p in range(112)] + req([g for g in derived if g[2]] == bins['groups'], 'BINS equal the fill') + rebound = True + prof, kappa, lo = run(rec, bins, mv, result) + rej = {} + first_hosted = next(i for i, m in enumerate(mv) if {c: u for c, u in next(g for g in bins['groups'] if g[0] == m[0] and g[1] == m[1])[2]}[m[2]] > 0) + rep, p, c, d, v = mv[first_hosted] + kids = {cc: u for cc, u in next(g for g in bins['groups'] if g[0] == rep and g[1] == p)[2]} + hosted_other = next((cc for cc, u in kids.items() if u > 0 and cc != c), None) + used_axis = int(rec[p]['idle_children'][c]['orthogonal_axes'][0]) + def mut(f): + x = copy.deepcopy(mv); f(x); return x + cases = dict( + hosted_receiver=mut(lambda x: x.__setitem__(first_hosted, [rep, p, c, hosted_other if hosted_other is not None else c, v])), + hosted_axis_from_used_prefix=mut(lambda x: x.__setitem__(first_hosted, [rep, p, c, d, used_axis])), + foreign_axis=mut(lambda x: x.__setitem__(first_hosted, [rep, p, c, d, 1 << 80])), + axis_moved_twice=mut(lambda x: x.insert(first_hosted + 1, list(x[first_hosted]))), + receiver_donates=mut(lambda x: x.append([rep, p, d, c, v])), + dropped_move=mut(lambda x: x.pop(first_hosted)), + ) + for name, x in cases.items(): + try: run(rec, bins, x, result) + except Reject as e: rej[name] = str(e) + else: raise SystemExit('mutation accepted: ' + name) + r2 = copy.deepcopy(result); r2['complex_root'] = [str(lo + F(1, 10 ** 25)), str(lo + F(2, 10 ** 25))] + try: run(rec, bins, mv, r2) + except Reject as e: rej['next_root_grid'] = str(e) + else: raise SystemExit('mutation accepted: next_root_grid') + r3 = copy.deepcopy(result); r3['kappa'] = str(F(result['kappa']) + F(1, 10 ** 24)) + try: run(rec, bins, mv, r3) + except Reject as e: rej['kappa_above_bit'] = str(e) + else: raise SystemExit('mutation accepted: kappa_above_bit') + out = dict(status='PASS_IDLE_DONOR_EXACT_R438_AUDIT', moves=len(mv), fill_rebound=rebound, kappa=str(kappa), + complex_root_lower=str(lo), binding='bit' if BIT < lo else 'complex', rejected_controls=rej) + if a.write: (PKG / 'AUDIT.json').write_text(json.dumps(out, indent=1, sort_keys=True) + '\n') + else: + strip = lambda d: {k: v for k, v in d.items() if k != 'fill_rebound'} + req(strip(load(PKG / 'AUDIT.json')) == strip(json.loads(json.dumps(out))), 'committed AUDIT.json receipt') + print('PASS_IDLE_DONOR_EXACT_R438_AUDIT moves=%d controls=%d kappa=%s binding=%s' % (len(mv), len(rej), float(kappa), out['binding'])) + + +if __name__ == '__main__': + try: main() + except Reject as e: raise SystemExit('FAIL: ' + str(e)) diff --git a/research/rank7-idle-donors-greedy-r438/AUDIT.json b/research/rank7-idle-donors-greedy-r438/AUDIT.json new file mode 100644 index 0000000000..83457354ff --- /dev/null +++ b/research/rank7-idle-donors-greedy-r438/AUDIT.json @@ -0,0 +1,18 @@ +{ + "binding": "complex", + "complex_root_lower": "2168508777157659440043/1250000000000000000000000", + "fill_rebound": true, + "kappa": "17348070217261275520339999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "moves": 430164, + "rejected_controls": { + "axis_moved_twice": "axis not in donor remainder", + "dropped_move": "declared profile", + "foreign_axis": "axis not in donor remainder", + "hosted_axis_from_used_prefix": "axis not in donor remainder", + "hosted_receiver": "receiver must be unhosted", + "kappa_above_bit": "headline kappa", + "next_root_grid": "complex root bracket", + "receiver_donates": "receiver must be unhosted" + }, + "status": "PASS_IDLE_DONOR_GREEDY_R438_AUDIT" +} diff --git a/research/rank7-idle-donors-greedy-r438/BINS.json.gz b/research/rank7-idle-donors-greedy-r438/BINS.json.gz new file mode 100644 index 0000000000..fc2446437c Binary files /dev/null and b/research/rank7-idle-donors-greedy-r438/BINS.json.gz differ diff --git a/research/rank7-idle-donors-greedy-r438/CLAIM.json b/research/rank7-idle-donors-greedy-r438/CLAIM.json new file mode 100644 index 0000000000..e803231ef3 --- /dev/null +++ b/research/rank7-idle-donors-greedy-r438/CLAIM.json @@ -0,0 +1,31 @@ +{ + "kappa": "17348070217261275520339999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017348070217261275520339999999999999999999998999999999999999999999999", + "binding": "complex", + "complex_root": [ + "2168508777157659440043/1250000000000000000000000", + "3469614043452255104069/2000000000000000000000000" + ], + "bit": "R438 0.001734846264120199151475", + "gain_over_pr3198": "36464614614391539/1000000000000000000000000", + "profile": { + "1": 16353294, + "2": 4837720, + "3": 1533431, + "4": 679320, + "5": 147055, + "8": 53280, + "42": 32303, + "44": 5120, + "45": 36420, + "46": 6300, + "47": 20, + "48": 35294, + "49": 28786, + "50": 13600, + "51": 124726 + }, + "T": 740, + "status": "author-checked conditional candidate", + "credits": "PR1252 Gonzalo-Mier; star class Gueorgui Maissouradze; PR3148 Jeremy Diviney; PR3133 dcharb78; PR1043 Ali Romman; PR2423 Sagar Thakrar; OpenCode (Space bunny free); Anthropic Claude" +} diff --git a/research/rank7-idle-donors-greedy-r438/MOVES.json.gz b/research/rank7-idle-donors-greedy-r438/MOVES.json.gz new file mode 100644 index 0000000000..c349804d70 Binary files /dev/null and b/research/rank7-idle-donors-greedy-r438/MOVES.json.gz differ diff --git a/research/rank7-idle-donors-greedy-r438/PR3148-PROVIDERS.json b/research/rank7-idle-donors-greedy-r438/PR3148-PROVIDERS.json new file mode 100644 index 0000000000..0b23436750 --- /dev/null +++ b/research/rank7-idle-donors-greedy-r438/PR3148-PROVIDERS.json @@ -0,0 +1,842 @@ +{ + "extra": { + "actual_paid_profile": { + "1": 2433, + "2": 724, + "3": 228, + "4": 102, + "5": 20, + "8": 8 + }, + "widths": [ + 9, + 9, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 9, + 8, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 8, + 7, + 7, + 7, + 7, + 8, + 9, + 8, + 9, + 6, + 6, + 7, + 7, + 7, + 7, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 6, + 6, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 6, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 7, + 7, + 6, + 6, + 9, + 8, + 9, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 9, + 8, + 9, + 8, + 7, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 7, + 6, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 5, + 5, + 8, + 8, + 8, + 8 + ] + }, + "gauge44": { + "actual_paid_profile": { + "1": 2433, + "2": 724, + "3": 228, + "4": 102, + "5": 20, + "8": 8 + }, + "widths": [ + 9, + 9, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 9, + 8, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 8, + 7, + 7, + 7, + 7, + 8, + 9, + 8, + 9, + 6, + 6, + 7, + 7, + 7, + 7, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 6, + 6, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 6, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 7, + 7, + 6, + 6, + 9, + 8, + 9, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 9, + 8, + 9, + 8, + 7, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 7, + 6, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 5, + 5, + 8, + 8, + 8, + 8 + ] + } +} diff --git a/research/rank7-idle-donors-greedy-r438/README.md b/research/rank7-idle-donors-greedy-r438/README.md new file mode 100644 index 0000000000..dcf923d3d4 --- /dev/null +++ b/research/rank7-idle-donors-greedy-r438/README.md @@ -0,0 +1,104 @@ +# Greedy idle-axis phase on PR3198: conditional κ = 0.001734807021726127552033 − 10⁻⁴⁶ − 10⁻⁷⁰ + +**Author-checked conditional candidate; not maintainer-reviewed.** The selected record on +`main` is still #1094. This package stacks on the open PR3198, which composes PR3190's +idle-remainder donors with the R438 bit supplier. PR3133's words and PR3148's fill rows, order and +dispatch are unchanged. + +| | complex root lower | bit endpoint | binds | κ headline | +|---|---|---|---|---| +| PR3198 | 0.0017347705571115131604951 | R438 0.001734846264120199151475 | complex | 0.001734770557111513160495 − … | +| **this** | **0.0017348070217261275520343** | R438 0.001734846264120199151475 | complex | **0.001734807021726127552033 − …** | + +The gain is **+3.646e-8 over PR3198**. That closes about half of PR3198's window +to the R438 bit endpoint. + +## What changes + +The construction keeps PR3190's two phases and adds a third: + +1. **Drain hosted remainders** smallest first into the largest legal unhosted receiver. +2. **Stars:** PR3184's exact optimum on the untouched fully idle 48s. +3. **New greedy phase:** repeat the single best one-axis move from a smaller unhosted child to an + equal-or-larger unhosted receiver, as long as it lowers the moment cost. + +Every move obeys PR1252's commuting rule: + +- it commutes with the receiver's axes at that moment; +- it commutes with every stage entry/exit X and Y translation and the terminal Y translation; +- it commutes with both children's terminal translations. + +Receivers stay at or below rank 51. No child both donates and receives. + +The result is 430,164 axis moves. The idle bill becomes: + +`{1:149514, 2:15880, 3:14951, 5:13855, 42:32303, 44:5120, 45:36420, 46:6300, 47:20, 48:35294, 49:28786, 50:13600, 51:124726}` + +Rank mass is unchanged at `65088·740`. + +### Variants tested + +| Variant | Complex root | +|---|---| +| Phases 1 + 2 (PR3190) | 0.0017347706 | +| Phases 1 + 2 + 3 (this package) | **0.0017348070** | +| Phase 1 + greedy only, no stars | 0.0017347935 | + +Fully idle cap-32/16/8 children do not exist in this fill. Rank-1 remainders, the last +coordinate of a 48-bin, conflict with every other 48 child's axes, so they stay blocked. + +## Reproduce + +```sh +# PR3148 materialize.py -> /tmp/t740 +python3 -B research/rank7-idle-donors-greedy-r438/build.py --t740 /tmp/t740 # ~20 s +python3 -B research/rank7-idle-donors-greedy-r438/verify.py --t740 /tmp/t740 # ~70 s +``` + +`verify.py` does not import `build.py`. It re-derives: + +- every move's donor-remainder membership, receiver hosting status, roles and the commuting rule; +- the rank cap; +- the profile and rank mass; +- the exact complex root bracket; +- the R438 bit endpoint, from its certificate's own bit profile with the fallback envelope + (accepted at c, rejected at c + 10⁻²⁴); +- `κ = min(floor₂₄(complex), bit) − 10⁻⁴⁶ − 10⁻⁷⁰`, checking that the complex side binds; +- the gates over PR3148, PR3184 and PR3198. + +Eight mutation controls are rejected. The run checks against the committed `AUDIT.json` without +writing to it. + +## Scope + +This is conditional on PR3198's stack: PR3190, PR3184, PR3148 and PR3133. It is also conditional +on R438, whose source PR1043 is open. + +The hosted-remainder donor hypothesis and the greedy single-axis chains (a child receiving from +several donors) rely on PR1252's per-axis rule. Only unhosted pairs have an admitted controller +audit. The native admission, the overlay-aware controller audit and the outer release were not +rerun. All inherited obligations remain. + +## Open next questions + +- **Do hosted donors and multi-donor receivers satisfy the T74 controller contract?** First step: + generalize the T74 `audit_mixed.py` to read the idle-axis overlay. Blocked by: the T74 chain has + no overlay reader. +- **Can the remaining 3.9e-8 to R438 be closed, and can R438 itself rise?** First step: exact + per-group optimisation instead of greedy, and idle exchanges on R438's own + `{34:32, 42:320}` remainders. Blocked by: the cost of the per-group search, and R438's per-child + axis data. + +## Credit + +- PR1252 (Gonzalo-Mier): the move, the rule and the pricing. +- Guéorgui Maissouradze: the star class. +- PR3148 (Jeremy Diviney): the fill. +- PR3133 and PR3042 (dcharb78): the words. +- PR2979 (Marius-Paul Dumitrean). +- Ali Romman (PR1043) and Sagar Thakrar (PR2423): R438. +- The `r438-native-rehost` authors. +- DreamingOfClouds and eumemic. + +Prepared by Rohan Arun. Done with help from **OpenCode (Space bunny free)**, with Anthropic +Claude assistance. Apache-2.0. diff --git a/research/rank7-idle-donors-greedy-r438/RESULT.json b/research/rank7-idle-donors-greedy-r438/RESULT.json new file mode 100644 index 0000000000..3b6d80114e --- /dev/null +++ b/research/rank7-idle-donors-greedy-r438/RESULT.json @@ -0,0 +1,62 @@ +{ + "status": "PASS_IDLE_DONOR_GREEDY_R438_T740", + "T": 740, + "axis_moves": 430164, + "donor_children": 151509, + "receiver_children": 167112, + "idle_before": { + "1": 173160, + "3": 48951, + "5": 13875, + "48": 282569 + }, + "idle_after": { + "1": 149514, + "2": 15880, + "3": 14951, + "5": 13855, + "42": 32303, + "44": 5120, + "45": 36420, + "46": 6300, + "47": 20, + "48": 35294, + "49": 28786, + "50": 13600, + "51": 124726 + }, + "profile": { + "1": 16353294, + "2": 4837720, + "3": 1533431, + "4": 679320, + "5": 147055, + "8": 53280, + "42": 32303, + "44": 5120, + "45": 36420, + "46": 6300, + "47": 20, + "48": 35294, + "49": 28786, + "50": 13600, + "51": 124726 + }, + "complex_root": [ + "2168508777157659440043/1250000000000000000000000", + "3469614043452255104069/2000000000000000000000000" + ], + "complex_root_decimal": "17348070217261275520344e-25", + "bit": "69393850564807966059/40000000000000000000000", + "binding": "complex", + "kappa": "17348070217261275520339999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017348070217261275520339999999999999999999998999999999999999999999999", + "gain_over_pr3198": "36464614614391539/1000000000000000000000000", + "gain_over_pr3184": "4617960492276791939/1000000000000000000000000", + "gain_over_pr3148": "1257381761882635037/250000000000000000000000", + "max_child_rank": 51, + "halving": [ + 5329, + 5202 + ] +} diff --git a/research/rank7-idle-donors-greedy-r438/SOURCES.json b/research/rank7-idle-donors-greedy-r438/SOURCES.json new file mode 100644 index 0000000000..bb4884cb26 --- /dev/null +++ b/research/rank7-idle-donors-greedy-r438/SOURCES.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "research/adaptive-kernel-demotion/inputs/DATA-PHASES.json", + "usage": "input", + "git_blob": "d9a4f84211182ca200c081ea061d724c8a2cfb70", + "sha256": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa" + }, + { + "path": "research/r438-native-rehost/CERTIFICATE.json", + "usage": "input", + "git_blob": "674ef36f723fbcc593e7d2319dca131da09181e5", + "sha256": "6da8c593257c8440f0fe35488d941715d953d715e2e464ffdfffff7ed31eee9c" + } + ] +} diff --git a/research/rank7-idle-donors-greedy-r438/TASK.json b/research/rank7-idle-donors-greedy-r438/TASK.json new file mode 100644 index 0000000000..0922e82be5 --- /dev/null +++ b/research/rank7-idle-donors-greedy-r438/TASK.json @@ -0,0 +1,78 @@ +{ + "schema_version": 1, + "task_id": "selected-packing", + "priority_revision": 6, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "original_card": { + "id": "selected-packing", + "question": "Is there a genuinely unsearched, explicitly bounded improvement to the selected packing?", + "starting_points": [ + "certificates/selected-result.json", + "research/heterogeneous-owner-assembly/README.md", + "research/complex-local-word-ceiling/README.md" + ], + "methods": [ + "Search a named unclaimed canonical candidate domain with a reproducible partition.", + "Prove a stronger scoped relaxation or exact optimum for one named residual subproblem." + ], + "acceptance_gate": "Check live PR overlap first, price both suppliers and distinguish a search best from an optimum. Report the word's packing cap from ceiling.ceiling() and the fraction of it realized; label packing gains as such.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Locate the selected packing source in the review and check live PRs for the same residual problem.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Define an unclaimed canonical domain and a favorable bound before starting a new search.", + "bottleneck_link": "An actual paid-profile gain can improve the frontier up to the other supplier cap.", + "allowed_variations": [ + "One bounded residual packing instance or exact relaxation.", + "If the coverage law, template or guard changes, derive an applicable fully charged replacement bound instead of applying the incumbent ceiling outside its scope." + ], + "scope_change_triggers": [ + "Rerunning an existing search with only a different seed as a separate mathematical contribution." + ], + "overlap_terms": [ + "T16", + "owner exchange", + "packing" + ], + "existing_checks": [ + { + "scope": "Packing-independent ceiling for the selected paid profile under the one-unpaid-coordinate coverage and halving guard.", + "evidence": "docs/research/community-efficient1000-review.md", + "remaining": "A changed word or model requires new pricing; a local packing search must name uncovered scope.", + "status": "reviewed", + "source_commit": "836b19bfa309ceafbc8ee32a15e8c4b10dde7e11", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Changed residual subproblem on the open PR3148 T740 fill of PR3133's words: PR3190's idle-remainder donors and PR3184's stars, plus a third greedy phase of single-axis PR1252-rule moves between unhosted idle children (smaller to equal-or-larger, cap 51), composed with the R438 bit supplier (research/r438-native-rehost).", + "scope_change_reason": "PR3198 left the complex side binding 7.6e-8 below the R438 bit endpoint; this closes about half of that window with more legal idle moves.", + "bottleneck_link": "kappa = min(complex, bit); the complex side binds, and more idle repartition lowers its moment cost.", + "budget_minutes": 60, + "stop_rule": "Stop after the exact overlay, pricing and independent verifier; no controller/outer admission.", + "outcome": "partial", + "evidence": "RESULT.json, BINS.json.gz, MOVES.json.gz (430,164 axis moves), AUDIT.json (8/8 controls rejected), R438 endpoint re-derived.", + "author": "Rohan Arun", + "ai_assistance": "Substantial Anthropic Claude (Claude Code) assistance; done with help from OpenCode (Space bunny free).", + "open_questions": [ + { + "question": "Are hosted remainders legal donors and do greedy chains of single-axis moves satisfy the T74 controller contract?", + "why_it_matters": "Only PR1252 unhosted pairs have an admitted controller audit.", + "first_step": "Generalize the T74 audit_mixed.py to read the idle-axis overlay and rerun PR3148's release.", + "blocked_by": "No overlay reader in the T74 chain." + }, + { + "question": "Can the remaining 3.9e-8 to the R438 bit endpoint be closed, and can R438 itself rise?", + "why_it_matters": "Past R438 the bit side binds again.", + "first_step": "Exact per-group optimisation instead of greedy; R438 idle-remainder exchanges on its {34:32, 42:320} remainders.", + "blocked_by": "Per-group exact search cost; R438 per-child axis data." + } + ] +} diff --git a/research/rank7-idle-donors-greedy-r438/VERIFY.json b/research/rank7-idle-donors-greedy-r438/VERIFY.json new file mode 100644 index 0000000000..dfd37e163b --- /dev/null +++ b/research/rank7-idle-donors-greedy-r438/VERIFY.json @@ -0,0 +1,21 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/adaptive-kernel-demotion/inputs/DATA-PHASES.json", + "research/r438-native-rehost/CERTIFICATE.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 300, + "checks": "Independent of build.py: donor axes from own remainder, unhosted receivers, no child both donates and receives, unit/orthogonal-at-receipt and commuting rule, cap 51, profile and rank mass, exact complex root bracket, R438 bit endpoint re-derived (accept at c, reject at c+1e-24), kappa = min(floor24(complex), bit) - 1e-46 - 1e-70 with complex binding, gates over PR3148/PR3184/PR3198; 8 mutation controls rejected." + } + ] +} diff --git a/research/rank7-idle-donors-greedy-r438/build.py b/research/rank7-idle-donors-greedy-r438/build.py new file mode 100644 index 0000000000..5cc5b75574 --- /dev/null +++ b/research/rank7-idle-donors-greedy-r438/build.py @@ -0,0 +1,226 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Idle-remainder donor exchanges on PR3148's T740 fill of PR3133's words. + +Every idle remainder of a (replica, port) - including the remainder of a partially hosted bin, +whose axes are the recipe axes [used, cap) - may donate axes to a fully idle (unhosted) child of +the same replica and port. Each moved axis obeys PR1252's commuting rule (commutes with all of the +receiver's current axes, every stage entry/exit X and Y translation, the terminal Y translation and +both children's terminal translations). Receivers are capped at rank 51 (73^2 > 2*51^2). +Phase 1 drains remainders smallest-first into the largest legal receiver; phase 2 runs the +frontier1094 star optimum (PR3184) on the untouched fully idle rank-48 children; phase 3 (new here) +repeats the best single-axis move from a smaller unhosted child to an equal-or-larger unhosted +receiver while it lowers the moment cost. Complex endpoint composed with the R438 bit supplier. + +Inputs (pinned): DATA-PHASES.json on main; PR3148's materialized COMPOSED-FILL/ORDER/DISPATCH and +its PR3133 provider widths (PR3148-PROVIDERS.json, copied from PR3148 vendor/). +""" +import argparse, gzip, hashlib, itertools, json, math +from collections import Counter, defaultdict +from fractions import Fraction as Q +from pathlib import Path + +HERE = Path(__file__).resolve().parent +PHASES = HERE.parents[1] / 'research/adaptive-kernel-demotion/inputs/DATA-PHASES.json' +PIN = dict(phases='c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa', + fill_payload='8f4d6965ba573ff2b71fd7bf6b552643e086739d90bd73c55889502077638e00', + order='927226d702bf3cada076f4c459da9063c0df7e7154a62955cf75c40cf30215b9', + dispatch='90edc935320dd6264e98dc735d868df3c95f5901c70d7d96171001fcb295cce0', + providers='52eb0d85caa7b2d4a93acdf5011f52b793f61ddca86235fb03cd9a09397ad4cd') +T = 740 +LOCAL = {1: 2433, 2: 724, 3: 228, 4: 102, 5: 20, 8: 8} +IDLE_PR3148 = {1: 173160, 3: 48951, 5: 13875, 48: 282569} +BIT = Q('69393850564807966059/40000000000000000000000') # R438 bit endpoint, research/r438-native-rehost CERTIFICATE.json +PR3148_KAPPA = Q('0.0017297774946785970118859999999999999999999998999999999999999999999999') +PR3198_KAPPA = Q('0.0017347705571115131604949999999999999999999998999999999999999999999999') +PR3184_KAPPA = Q('0.0017301890612338507600949999999999999999999998999999999999999999999999') + + +def need(ok, why): + if not ok: raise SystemExit('FAIL: ' + why) + + +def sha(b): return hashlib.sha256(b).hexdigest() +def dot(a, b): return (a & b).bit_count() & 1 +def Hf(r): return 0.0 if r == 0 else r * (73.0 / r) ** 0.00173 + + +def pgz(obj): + d = bytearray(gzip.compress(json.dumps(obj, sort_keys=True, separators=(',', ':')).encode(), mtime=0)); d[9] = 255 + return bytes(d) + + +# ---- exact root (rational intervals, directed rounding 1e-60) ---- +S = 10 ** 60 +def dn(x): return Q(math.floor(x * S), S) +def upr(x): return Q(math.ceil(x * S), S) +def atanh2(z, n): + s, p = Q(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) +L2 = atanh2(Q(1, 3), 120) +LN = {} +def lnr(r): + if r not in LN: + x, k = Q(73, r), 0 + while x > 2: x /= 2; k += 1 + a, e = atanh2((x - 1) / (x + 1), 80) + LN[r] = (dn(a + k * L2[0]), upr(a + e + k * (L2[0] + L2[1]))) + return LN[r] +def ex(x0, x1): + def ser(x): + s, t = Q(0), Q(1) + for n in range(1, 40): s += t; t = t * x / n + return s, t + a, _ = ser(x0); b, t = ser(x1) + return dn(a), upr(b + 2 * t) +def moment(prof, b): + W = 896 * T; lo = hi = Q(0) + for r, n in prof.items(): + l0, l1 = lnr(r); e0, e1 = ex(b * l0, b * l1); lo += n * r * e0; hi += n * r * e1 + return lo / (73 * W), hi / (73 * W) +def root(prof, digits=25): + f = lambda b: sum(n * r * (73 / r) ** b for r, n in prof.items()) / (73 * 896 * T) - 1 + a, c = 0.0, 0.01 + for _ in range(200): + m = (a + c) / 2 + if f(m) < 0: a = m + else: c = m + g = 10 ** digits; k0, k1 = int(a * g) - 10 ** 10, int(a * g) + 10 ** 10 + need(moment(prof, Q(k0, g))[1] < 1 and moment(prof, Q(k1, g))[0] > 1, 'bracket') + while k1 - k0 > 1: + k = (k0 + k1) // 2; lo, hi = moment(prof, Q(k, g)) + if hi < 1: k0 = k + elif lo > 1: k1 = k + else: raise SystemExit('wide interval') + return Q(k0, g), Q(k1, g) + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--t740', type=Path, required=True, help='directory written by PR3148 materialize.py') + a = ap.parse_args() + raw = PHASES.read_bytes(); need(sha(raw) == PIN['phases'], 'phases pin') + rec = {r['port']: r for r in json.loads(raw)['recipes']} + fraw = gzip.decompress((a.t740 / 'COMPOSED-FILL.json.gz').read_bytes()); need(sha(fraw) == PIN['fill_payload'], 'fill pin') + need(sha((a.t740 / 'ORDER.json').read_bytes()) == PIN['order'] and sha((a.t740 / 'DISPATCH.json').read_bytes()) == PIN['dispatch'], 'order/dispatch pins') + praw = (HERE / 'PR3148-PROVIDERS.json').read_bytes(); need(sha(praw) == PIN['providers'], 'providers pin') + prov = json.loads(praw); order = json.loads((a.t740 / 'ORDER.json').read_bytes()) + disp = {(s, r): p for s, r, p in json.loads((a.t740 / 'DISPATCH.json').read_bytes())} + fill = json.loads(fraw) + need(fill['columns'] == ['time', 'helper', 'owner_replica', 'child', 'port', 'offset'] and fill['dispatch_overrides'] == [], 'fill format') + caps = {(p, c): ch['rank'] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + AX = {(p, c): [int(v) for v in ch['orthogonal_axes']] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + TR = {(p, c): int(ch['translation_after']) for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + PT = {p: [int(s[k]) for s in rc['stage_alignment'] for k in ('entry_Y', 'exit_Y', 'entry_X', 'exit_X')] + [int(rc['terminal_Y_translation'])] for p, rc in rec.items()} + used, top = Counter(), Counter() + for time, helper, rep, child, port, offset in fill['rows']: + s, r = order[time]; w = prov[disp[s, r]]['widths'][helper] + used[rep, child, port] += w; top[rep, child, port] = max(top[rep, child, port], offset + w) + need(all(used[k] == top[k] for k in used), 'compact helper prefixes') + groups = [] + for rep in range(T): + for p in range(112): + kids = [[c, used[rep, c, p]] for c in range(len(rec[p]['idle_children'])) if caps[p, c] - used[rep, c, p] > 0] + groups.append([rep, p, kids]) + idle = Counter(caps[p, c] - u for _, p, kids in groups for c, u in kids) + need(dict(idle) == IDLE_PR3148, 'idle bill equals PR3148') + + def legal(v, p, c, d, axes_d): + return all(dot(v, x) == 0 for x in axes_d) and all(dot(v, x) == 0 for x in PT[p]) and dot(v, TR[p, c]) == 0 and dot(v, TR[p, d]) == 0 + + def solve(p, kids): + rank = {c: caps[p, c] - u for c, u in kids}; axes = {c: AX[p, c][u:caps[p, c]] for c, u in kids} + hosted = {c: u > 0 for c, u in kids}; role = {c: None for c, _ in kids}; moves = [] + for c in sorted([c for c, u in kids if u > 0], key=lambda c: (rank[c], c)): + for v in list(axes[c]): + best = None + for d in sorted([d for d, _ in kids if not hosted[d] and role[d] != 'D' and d != c and rank[d] < 51], key=lambda d: (-rank[d], d)): + if rank[d] < rank[c] - 1: break + if legal(v, p, c, d, axes[d]): best = d; break + if best is None or Hf(rank[c] - 1) + Hf(rank[best] + 1) - Hf(rank[c]) - Hf(rank[best]) >= 0: continue + axes[c].remove(v); axes[best].append(v); rank[c] -= 1; rank[best] += 1 + role[c] = 'D'; role[best] = 'R'; moves.append([c, best, v]) + free = [c for c, u in kids if u == 0 and role[c] is None and caps[p, c] == 48] + if len(free) >= 2: + MV = {(d, r): [v for v in axes[d] if legal(v, p, d, r, axes[r])] for d in free for r in free if d != r} + best = [len(free) * Hf(48), []] + def match(c, leaves): + opts = [MV[c, l] for l in leaves] + if any(len(o) < 3 for o in opts): return None + def go(k, usedax): + if k == len(leaves): return [] + for trip in itertools.combinations([v for v in opts[k] if v not in usedax], 3): + rest = go(k + 1, usedax | set(trip)) + if rest is not None: return [(c, leaves[k], list(trip))] + rest + return None + return go(0, set()) + def assign(i, roles): + if i == len(free): + leaves = defaultdict(list) + for c in free: + if isinstance(roles[c], tuple): leaves[roles[c][1]].append(c) + cents = [c for c in free if roles[c] == 'c'] + if any(not leaves[c] for c in cents) or any(roles[x] != 'c' for x in leaves): return + mv = [] + for c in cents: + m = match(c, leaves[c]) + if m is None: return + mv += m + rk = [48 - 3 * len(leaves[c]) if roles[c] == 'c' else 51 if isinstance(roles[c], tuple) else 48 for c in free] + cost = sum(Hf(x) for x in rk) + if cost < best[0] - 1e-12: best[0], best[1] = cost, mv + return + c = free[i] + for opt in ['n', 'c'] + [('l', d) for d in free if d != c]: + roles[c] = opt; assign(i + 1, roles) + del roles[c] + assign(0, {}) + for c, l, trip in best[1]: + for v in trip: + axes[c].remove(v); axes[l].append(v); rank[c] -= 1; rank[l] += 1; moves.append([c, l, v]) + un = [c for c, u in kids if u == 0] + while True: + best = None + for c in un: + if role[c] == 'R' or rank[c] == 0: continue + for d in un: + if d == c or role[d] == 'D' or rank[d] >= 51 or rank[d] < rank[c]: continue + g = Hf(rank[c] - 1) + Hf(rank[d] + 1) - Hf(rank[c]) - Hf(rank[d]) + if best is not None and g >= best[0]: continue + for v in axes[c]: + if legal(v, p, c, d, axes[d]): best = (g, c, d, v); break + if best is None or best[0] >= 0: break + g, c, d, v = best + axes[c].remove(v); axes[d].append(v); rank[c] -= 1; rank[d] += 1; role[c] = 'D'; role[d] = 'R'; moves.append([c, d, v]) + return moves, rank + + cache, moves, final = {}, [], Counter() + for rep, p, kids in groups: + key = (p, tuple(map(tuple, kids))) + if key not in cache: cache[key] = solve(p, kids) + mv, rank = cache[key] + moves += [[rep, p] + m for m in mv] + final.update(r for r in rank.values() if r) + prof = Counter({r: n * 9 * T for r, n in LOCAL.items()}); prof.update(final); prof = dict(sorted(prof.items())) + need(sum(r * n for r, n in prof.items()) == 65088 * T and 73 * 73 > 2 * max(prof) ** 2, 'mass and halving') + lo, hi = root(prof) + C = min(Q(math.floor(lo * 10 ** 24), 10 ** 24), BIT) + kappa = C - Q(1, 10 ** 46) - Q(1, 10 ** 70) + need(kappa > PR3198_KAPPA > PR3184_KAPPA > PR3148_KAPPA, 'gates') + (HERE / 'BINS.json.gz').write_bytes(pgz(dict(T=T, columns=['replica', 'port', [['child', 'used']]], groups=[g for g in groups if g[2]]))) + (HERE / 'MOVES.json.gz').write_bytes(pgz(dict(columns=['replica', 'port', 'donor_child', 'receiver_child', 'axis'], moves=moves))) + donors = Counter(); + res = dict(status='PASS_IDLE_DONOR_GREEDY_R438_T740', T=T, axis_moves=len(moves), + donor_children=len({(m[0], m[1], m[2]) for m in moves}), receiver_children=len({(m[0], m[1], m[3]) for m in moves}), + idle_before={str(k): v for k, v in IDLE_PR3148.items()}, idle_after={str(k): v for k, v in sorted(final.items())}, + profile={str(k): v for k, v in prof.items()}, complex_root=[str(lo), str(hi)], + complex_root_decimal=f'{lo.numerator * 10**25 // lo.denominator}e-25', bit=str(BIT), binding='bit' if BIT < lo else 'complex', + kappa=str(kappa), kappa_decimal='0.' + str(kappa.numerator * 10 ** 70 // kappa.denominator).rjust(70, '0'), gain_over_pr3198=str(kappa - PR3198_KAPPA), gain_over_pr3184=str(kappa - PR3184_KAPPA), gain_over_pr3148=str(kappa - PR3148_KAPPA), + max_child_rank=max(prof), halving=[5329, 2 * max(prof) ** 2]) + (HERE / 'RESULT.json').write_text(json.dumps(res, indent=1) + '\n') + print('PASS', float(lo), res['binding'], float(kappa), float(kappa - PR3184_KAPPA), len(moves)) + + +if __name__ == '__main__': + main() diff --git a/research/rank7-idle-donors-greedy-r438/verify.py b/research/rank7-idle-donors-greedy-r438/verify.py new file mode 100644 index 0000000000..4083be130e --- /dev/null +++ b/research/rank7-idle-donors-greedy-r438/verify.py @@ -0,0 +1,219 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Independent verifier (does not import build.py) for the idle-remainder donor exchanges. + +Re-derives from BINS / MOVES / DATA-PHASES: donor axes come from the donor's own idle remainder +(recipe axes [used, cap)); receivers are unhosted (used == 0); no child both donates and receives; +every moved axis is a unit vector orthogonal to all of the receiver's axes held at that moment and +commutes with every stage entry/exit X/Y translation, the terminal Y translation and both +children's terminal translations; final ranks <= 51; per-group axis multisets unchanged; the +complete profile and rank mass; an exact complex root bracket with its own interval arithmetic; +kappa = min(floor24(complex_lower), PR589 bit) - 1e-46 - 1e-70 and its gates. +Optional --t740 rebinds BINS to PR3148's materialized fill. Mutation controls must be rejected. +""" +import argparse, copy, gzip, hashlib, json +from collections import Counter, defaultdict +from fractions import Fraction as F +from pathlib import Path + +PKG = Path(__file__).resolve().parent +PHASES = PKG.parents[1] / 'research/adaptive-kernel-demotion/inputs/DATA-PHASES.json' +T = 740 +LOCAL = {1: 2433, 2: 724, 3: 228, 4: 102, 5: 20, 8: 8} +IDLE = {1: 173160, 3: 48951, 5: 13875, 48: 282569} +BITCERT = PKG.parents[1] / 'research/r438-native-rehost/CERTIFICATE.json' +BIT = None # R438 bit endpoint, re-derived from its certificate's bit profile in check_bit() +GATES = dict(PR3198=F('0.0017347705571115131604949999999999999999999998999999999999999999999999'), PR3148=F('0.0017297774946785970118859999999999999999999998999999999999999999999999'), + PR3184=F('0.0017301890612338507600949999999999999999999998999999999999999999999999')) + + +class Reject(Exception): pass +def req(ok, why): + if not ok: raise Reject(why) +def load(p): + b = Path(p).read_bytes(); return json.loads(gzip.decompress(b) if b[:2] == b'\x1f\x8b' else b) +def par(a, b): return bin(a & b).count('1') & 1 + + +def audit(rec, bins, moves): + caps = {(p, c): ch['rank'] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + G = {} + for rep, p, kids in bins['groups']: + req((rep, p) not in G and 0 <= rep < T and p in rec, 'group key') + G[rep, p] = {c: u for c, u in kids} + req(all(0 <= u < caps[p, c] for c, u in kids), 'used below capacity') + req(Counter(caps[p, c] - u for (rep, p), kids in G.items() for c, u in kids.items()) == Counter(IDLE), 'idle bill') + trans = {} + for p, rc in rec.items(): + trans[p] = {int(s[k]) for s in rc['stage_alignment'] for k in ('entry_X', 'exit_X', 'entry_Y', 'exit_Y')} | {int(rc['terminal_Y_translation'])} + for c, ch in enumerate(rc['idle_children']): + ax = [int(v) for v in ch['orthogonal_axes']] + req(all(par(v, v) == 1 for v in ax) and all(par(a, b) == 0 for i, a in enumerate(ax) for b in ax[i + 1:]), 'recipe axes orthonormal') + state = {} + def cur(rep, p, c): + k = (rep, p, c) + if k not in state: + u = G[rep, p][c]; state[k] = dict(axes=set(int(v) for v in rec[p]['idle_children'][c]['orthogonal_axes'][u:caps[p, c]]), role=None) + return state[k] + for m in moves: + rep, p, c, d, v = m + req((rep, p) in G and c in G[rep, p] and d in G[rep, p] and c != d, 'children of the group') + req(G[rep, p][d] == 0, 'receiver must be unhosted') + sc, sd = cur(rep, p, c), cur(rep, p, d) + req(sc['role'] != 'R' and sd['role'] != 'D', 'child both donates and receives') + own = set(int(x) for x in rec[p]['idle_children'][c]['orthogonal_axes'][G[rep, p][c]:caps[p, c]]) + req(v in sc['axes'] and v in own, 'axis not in donor remainder') + req(par(v, v) == 1 and all(par(v, x) == 0 for x in sd['axes']), 'axis not orthogonal to receiver axes') + tc = int(rec[p]['idle_children'][c]['translation_after']); td = int(rec[p]['idle_children'][d]['translation_after']) + req(all(par(v, x) == 0 for x in trans[p] | {tc, td}), 'axis does not commute with translations') + sc['axes'].discard(v); sd['axes'].add(v); sc['role'] = 'D'; sd['role'] = 'R' + req(len(sd['axes']) <= 51, 'rank above 51') + final = Counter() + for (rep, p), kids in G.items(): + for c, u in kids.items(): + r = len(state[rep, p, c]['axes']) if (rep, p, c) in state else caps[p, c] - u + if r: final[r] += 1 + return final + + +def mom(prof, b): + Q72 = 10 ** 72 + def rd(x): return F(x.numerator * Q72 // x.denominator, Q72) + def ru(x): return F(-((-x.numerator * Q72) // x.denominator), Q72) + def at(z, n): + s, p = F(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) + l2 = at(F(1, 3), 130); W = 896 * T; lo = hi = F(0) + for r, n in sorted(prof.items()): + y, k = F(73, r), 0 + while y >= 2: y /= 2; k += 1 + a, e = at((y - 1) / (y + 1), 90) + L0, L1 = rd(a + k * l2[0]), ru(a + e + k * (l2[0] + l2[1])) + def tay(x): + s, t = F(1), F(1) + for j in range(1, 34): t = t * x / j; s += t + return s, t * x / 34 * 3 + e0, _ = tay(b * L0); e1, t1 = tay(b * L1) + lo += n * r * rd(e0); hi += n * r * ru(e1 + t1) + return lo / (73 * W), hi / (73 * W) + + +def check_bit(): + inv = json.loads(BITCERT.read_text())['pipeline']['candidate']['hosted']['invoice'] + prof = {int(k): v for k, v in inv['bit_profile'].items()} + c, cn = F(inv['bit_lower']), F(inv['next_grid_point_rejected']) + req(c == F(inv['bit_lower_decimal']) and cn - c == F(1, 10 ** 24) and 2 * max(prof) ** 2 < 64 ** 2, 'R438 certificate fields') + W = 28416; N = sum(prof.values()) + def bm(b): + lo = hi = F(0) + for r, n in sorted(prof.items()) + [(1, F(32 * 64 * 64 * N, 10 ** 16))]: + l0, l1 = ln64(r); e0, e1 = exbox(b * l0, b * l1); lo += n * r * e0; hi += n * r * e1 + return lo / (64 * W), hi / (64 * W) + req(bm(c)[1] < 1 and bm(cn)[0] > 1, 'R438 bit endpoint accepted at c, rejected at c+1e-24') + return c + + +def ln64(r): + Q72 = 10 ** 72 + def at(z, n): + s, p = F(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) + y, k = F(64, r), 0 + while y >= 2: y /= 2; k += 1 + l2 = at(F(1, 3), 130); a, e = at((y - 1) / (y + 1), 90) + return F((a + k * l2[0]).numerator * Q72 // (a + k * l2[0]).denominator, Q72), F(-((-(a + e + k * (l2[0] + l2[1])).numerator * Q72) // (a + e + k * (l2[0] + l2[1])).denominator), Q72) + + +def exbox(x0, x1): + def tay(x): + s, t = F(1), F(1) + for j in range(1, 34): t = t * x / j; s += t + return s, t * x / 34 * 3 + a, _ = tay(x0); b, t = tay(x1) + return a, b + t + + +def run(rec, bins, moves, result): + final = audit(rec, bins, moves) + prof = Counter({r: n * 9 * T for r, n in LOCAL.items()}); prof.update(final); prof = dict(sorted(prof.items())) + req({str(k): v for k, v in prof.items()} == result['profile'], 'declared profile') + req(sum(r * n for r, n in prof.items()) == 65088 * T, 'rank mass 65088*T') + req(max(prof) <= 51 and 73 * 73 > 2 * max(prof) ** 2, 'halving guard') + lo, hi = F(result['complex_root'][0]), F(result['complex_root'][1]) + req(hi - lo == F(1, 10 ** 25) and mom(prof, lo)[1] < 1 and mom(prof, hi)[0] > 1, 'complex root bracket') + C = min(F(lo.numerator * 10 ** 24 // lo.denominator, 10 ** 24), BIT) + req(C < BIT, 'complex binds below the R438 bit endpoint') + kappa = C - F(1, 10 ** 46) - F(1, 10 ** 70) + req(kappa == F(result['kappa']), 'headline kappa') + for n, g in GATES.items(): req(kappa > g, 'kappa must exceed ' + n) + return prof, kappa, lo + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--t740', type=Path) + ap.add_argument('--providers', type=Path, default=PKG / 'PR3148-PROVIDERS.json') + ap.add_argument('--write', action='store_true', help='rewrite the committed AUDIT.json receipt') + a = ap.parse_args() + if not __debug__: raise SystemExit('assertions required') + raw = PHASES.read_bytes() + req(hashlib.sha256(raw).hexdigest() == 'c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa', 'phases pin') + rec = {r['port']: r for r in json.loads(raw)['recipes']} + global BIT + BIT = check_bit() + bins, mv, result = load(PKG / 'BINS.json.gz'), load(PKG / 'MOVES.json.gz')['moves'], load(PKG / 'RESULT.json') + rebound = False + if a.t740: + fraw = gzip.decompress((a.t740 / 'COMPOSED-FILL.json.gz').read_bytes()) + req(hashlib.sha256(fraw).hexdigest() == '8f4d6965ba573ff2b71fd7bf6b552643e086739d90bd73c55889502077638e00', 'fill pin') + prov = load(a.providers); order = load(a.t740 / 'ORDER.json'); disp = {(s, r): p for s, r, p in load(a.t740 / 'DISPATCH.json')} + used = Counter() + for time, helper, rep, child, port, offset in json.loads(fraw)['rows']: + s, r = order[time]; used[rep, child, port] += prov[disp[s, r]]['widths'][helper] + caps = {(p, c): ch['rank'] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + derived = [[rep, p, [[c, used[rep, c, p]] for c in range(len(rec[p]['idle_children'])) if caps[p, c] - used[rep, c, p] > 0]] for rep in range(T) for p in range(112)] + req([g for g in derived if g[2]] == bins['groups'], 'BINS equal the fill') + rebound = True + prof, kappa, lo = run(rec, bins, mv, result) + rej = {} + first_hosted = next(i for i, m in enumerate(mv) if {c: u for c, u in next(g for g in bins['groups'] if g[0] == m[0] and g[1] == m[1])[2]}[m[2]] > 0) + rep, p, c, d, v = mv[first_hosted] + kids = {cc: u for cc, u in next(g for g in bins['groups'] if g[0] == rep and g[1] == p)[2]} + hosted_other = next((cc for cc, u in kids.items() if u > 0 and cc != c), None) + used_axis = int(rec[p]['idle_children'][c]['orthogonal_axes'][0]) + def mut(f): + x = copy.deepcopy(mv); f(x); return x + cases = dict( + hosted_receiver=mut(lambda x: x.__setitem__(first_hosted, [rep, p, c, hosted_other if hosted_other is not None else c, v])), + hosted_axis_from_used_prefix=mut(lambda x: x.__setitem__(first_hosted, [rep, p, c, d, used_axis])), + foreign_axis=mut(lambda x: x.__setitem__(first_hosted, [rep, p, c, d, 1 << 80])), + axis_moved_twice=mut(lambda x: x.insert(first_hosted + 1, list(x[first_hosted]))), + receiver_donates=mut(lambda x: x.append([rep, p, d, c, v])), + dropped_move=mut(lambda x: x.pop(first_hosted)), + ) + for name, x in cases.items(): + try: run(rec, bins, x, result) + except Reject as e: rej[name] = str(e) + else: raise SystemExit('mutation accepted: ' + name) + r2 = copy.deepcopy(result); r2['complex_root'] = [str(lo + F(1, 10 ** 25)), str(lo + F(2, 10 ** 25))] + try: run(rec, bins, mv, r2) + except Reject as e: rej['next_root_grid'] = str(e) + else: raise SystemExit('mutation accepted: next_root_grid') + r3 = copy.deepcopy(result); r3['kappa'] = str(F(result['kappa']) + F(1, 10 ** 24)) + try: run(rec, bins, mv, r3) + except Reject as e: rej['kappa_above_bit'] = str(e) + else: raise SystemExit('mutation accepted: kappa_above_bit') + out = dict(status='PASS_IDLE_DONOR_GREEDY_R438_AUDIT', moves=len(mv), fill_rebound=rebound, kappa=str(kappa), + complex_root_lower=str(lo), binding='bit' if BIT < lo else 'complex', rejected_controls=rej) + if a.write: (PKG / 'AUDIT.json').write_text(json.dumps(out, indent=1, sort_keys=True) + '\n') + else: + strip = lambda d: {k: v for k, v in d.items() if k != 'fill_rebound'} + req(strip(load(PKG / 'AUDIT.json')) == strip(json.loads(json.dumps(out))), 'committed AUDIT.json receipt') + print('PASS_IDLE_DONOR_GREEDY_R438_AUDIT moves=%d controls=%d kappa=%s binding=%s' % (len(mv), len(rej), float(kappa), out['binding'])) + + +if __name__ == '__main__': + try: main() + except Reject as e: raise SystemExit('FAIL: ' + str(e)) diff --git a/research/rank7-idle-donors-r438-bit/CLAIM.json b/research/rank7-idle-donors-r438-bit/CLAIM.json new file mode 100644 index 0000000000..ce2245e7a4 --- /dev/null +++ b/research/rank7-idle-donors-r438-bit/CLAIM.json @@ -0,0 +1,11 @@ +{ + "kappa": "17347705571115131604949999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017347705571115131604949999999999999999999998999999999999999999999999", + "complex_root": [ + "17347705571115131604951/10000000000000000000000000", + "17347705571115131604952/10000000000000000000000000" + ], + "bit_supplier": "R438 (PR1043 + PR2423, research/r438-native-rehost) 0.001734846264120199151475", + "binding": "complex", + "gain_over_pr3190": "671758760834462873/500000000000000000000000" +} diff --git a/research/rank7-idle-donors-r438-bit/README.md b/research/rank7-idle-donors-r438-bit/README.md new file mode 100644 index 0000000000..09c6859328 --- /dev/null +++ b/research/rank7-idle-donors-r438-bit/README.md @@ -0,0 +1,87 @@ +# R438 bit supplier with PR3190's idle-remainder donors: the complex side binds again at κ = 0.001734770557111513160495 − 10⁻⁴⁶ − 10⁻⁷⁰ + +**Author-checked conditional composition; not maintainer-reviewed.** The selected record on +`main` is still #1094. This package stacks on the open PR3190 +(`research/rank7-idle-remainder-donors-t740`). + +| | complex endpoint | bit endpoint | binds | κ headline | +|---|---|---|---|---| +| PR3190 | 0.0017347705571115131604951 | PR589 0.001733427039589844234749 | bit | 0.001733427039589844234749 − … | +| **this** | 0.0017347705571115131604951 | **R438 0.001734846264120199151475** | **complex** | **0.001734770557111513160495 − 10⁻⁴⁶ − 10⁻⁷⁰** | + +The gain is **+1.3435e-6 (+0.0775%) over PR3190**, +4.58e-6 over PR3184 and +4.99e-6 over +PR3148. + +## Idea + +PR3190's idle-remainder exchanges pushed the complex root of PR3133's words above the PR589 bit +saving, so its κ was capped by the bit supplier. A stronger certified bit supplier already exists on +main. + +The R438 word: + +- comes from Ali Romman's PR1043, with helper 470 deleted; +- adds Sagar Thakrar's PR2423 transport and optimal re-hosting; +- has a complete native, parent and hosted replay in `research/r438-native-rehost`. + +Its bit endpoint is 0.001734846264120199151475, accepted at c and rejected at c + 10⁻²⁴. That is +above the new complex root, so with R438 the complex side binds again. + +## Verification + +`verify.py` uses the standard library only and runs in about 1 s: + +1. **Complex endpoint.** It recomputes PR3190's complex root bracket on its declared complete + profile, with its own interval arithmetic at 10⁻⁷². +2. **Bit endpoint.** It re-derives the R438 endpoint from the certificate's own bit profile: + m = 64, live = 28,416, with the 10⁻¹⁶·32m² bad-edge fallback envelope. The endpoint is accepted + at c and rejected at c + 10⁻²⁴. +3. **Composed κ.** It computes `κ = min(floor₂₄(complex), floor₂₄(bit)) − 10⁻⁴⁶ − 10⁻⁷⁰`, checks it + equals CLAIM.json, and gates it against PR3148, PR3184 and PR3190. + +Three mutation controls are rejected: the complex next grid point, the bit next grid point, and +the PR589 endpoint on the R438 profile. PR3190's moves and profile are checked by its own +registered verifier. + +```sh +python3 -B research/rank7-idle-donors-r438-bit/verify.py +``` + +## Scope + +**Conditional on two unreviewed claims:** + +- PR3190 and its stack: PR3148, PR3133, and the hosted-remainder donor hypothesis. +- R438: PR1043 is open, and `r438-native-rehost` does not promote a selected supplier. + +The R438 bill fits the inherited row bound: row coefficient 18,355 < 20,161, maxchild 42 with +`2·42² < 64²`. + +The T74 outer ledger currently pins the PR589 bit constant, and only uses it to assert +`complex < bit`. With R438 that assertion holds directly, but the release needs the constant +re-pinned. All inherited all-size, compiler, realization, precision and analytic obligations +remain. + +## Open next questions + +- **Does the T74 outer release accept R438 in place of PR589?** First step: rerun PR3148's outer + release with the R438 bit endpoint and its finite bill. Blocked by: PR1043 is open, and the outer + ledger pins PR589. +- **Can the complex side close the remaining 7.6e-8 gap to the R438 endpoint?** First step: drain + more of the 149,514 rank-1 remainders that are blocked by commuting legality, or widen the + receiver set. +- **Bit side.** R438's own idle remainder (`{34:32, 42:320}`, cap 45 at m = 64) admits the same + axis-exchange question, should the bit side bind again. + +## Credit + +- Ali Romman (PR1043): the R438 word. +- Sagar Thakrar (PR2423): transport and re-hosting. +- commdata2338 (PR2653): native emission. +- The `r438-native-rehost` authors. +- PR3190 / PR3184 and their credits: PR1252 Gonzalo-Mier; Guéorgui Maissouradze; PR3148 Jeremy + Diviney; PR3133 dcharb78; PR2979 Marius-Paul Dumitrean. +- DreamingOfClouds and eumemic (PR589/PR555). + +Prepared by Rohan Arun. Done with help from **OpenCode (Space bunny free)**, and with Anthropic +Claude assistance. Apache-2.0. diff --git a/research/rank7-idle-donors-r438-bit/SOURCES.json b/research/rank7-idle-donors-r438-bit/SOURCES.json new file mode 100644 index 0000000000..16e857fa25 --- /dev/null +++ b/research/rank7-idle-donors-r438-bit/SOURCES.json @@ -0,0 +1,31 @@ +{ + "schema_version": 1, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "research/r438-native-rehost/CERTIFICATE.json", + "usage": "input", + "git_blob": "674ef36f723fbcc593e7d2319dca131da09181e5", + "sha256": "6da8c593257c8440f0fe35488d941715d953d715e2e464ffdfffff7ed31eee9c" + }, + { + "path": "research/rank7-idle-remainder-donors-t740/RESULT.json", + "usage": "input", + "git_blob": "2bbb2926bbd892129e988c962bc71632e42b2094", + "sha256": "3380908be142237abead45abddfb28c8a8804b61496040e8a8a8c5ef5edc5dc9", + "pin": "head:5e4a3235169edddd033889da4e9f47635ff50c3e:research/rank7-idle-remainder-donors-t740/RESULT.json" + } + ] +} diff --git a/research/rank7-idle-donors-r438-bit/TASK.json b/research/rank7-idle-donors-r438-bit/TASK.json new file mode 100644 index 0000000000..0611ef7283 --- /dev/null +++ b/research/rank7-idle-donors-r438-bit/TASK.json @@ -0,0 +1,72 @@ +{ + "schema_version": 1, + "task_id": "independent-moment", + "priority_revision": 6, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "original_card": { + "id": "independent-moment", + "question": "Does one changed supplier or assembly claim lack a source-bound independent check of a specific new implication?", + "starting_points": [ + "certificates/selected-result.json", + "research/rank7-joint-endframes/README.md", + "docs/research/research-family-status.md" + ], + "methods": [ + "Independently reconstruct a coordinated frame/circuit change and its single-change control, then derive the complete rank and physical ledger.", + "Implement certified moment inequalities through a different exact enclosure method." + ], + "acceptance_gate": "Demonstrate independence, source binding, positive cases and semantic failure controls. Name the existing checks and the missing coverage. More digits or another equivalent evaluation of an unchanged root is not by itself new verification coverage.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read #2979 joint rank-7 end-frame proposal and the revision-6 evidence status. Its claimed kappa is not selected. Compare coordinated changes with the losing single-change controls and locate the complete physical ledger; an aggregate moment alone does not validate the mechanism.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Prioritize a bounded independent audit of #2979: reconstruct one joint group and its single-lowering control, check the declared frames/chronology, then trace changed children, idle widths and cleanup buffers into the complete invoice and both supplier caps. Choose one still-missing implication after checking existing audits. Stop with exact unresolved dependencies if full admission exceeds the session; do not launch a new lowering census on an unvalidated premise or substitute extra root digits for mechanism checking.", + "bottleneck_link": "Independent pricing prevents unsupported frontier claims and can reveal genuine accounting slack.", + "allowed_variations": [ + "Reconstruct either a source ledger or a numeric enclosure with a different method." + ], + "scope_change_triggers": [ + "Importing the primary function and calling its output independent verification.", + "Promoting #2979 from merged source archive to validated supplier solely from author PASS receipts or aggregate pricing." + ], + "overlap_terms": [ + "independent moment", + "rank histogram", + "exact enclosure", + "2979", + "rank7 joint endframes", + "paired extraction", + "joint lowering" + ] + }, + "scope_status": "changed", + "actual_scope": "Supplier composition: PR3190's idle-remainder complex endpoint for PR3133's words on PR3148's T740 fill (0.0017347705571115131604951) with the R438 bit supplier natively replayed on main (research/r438-native-rehost, 0.001734846264120199151475). Independent re-derivation of both endpoints and of the composed kappa.", + "scope_change_reason": "PR3190 made the complex side exceed the PR589 bit saving, so the useful next check is which certified bit supplier binds; R438 is above the new complex root.", + "bottleneck_link": "kappa = min(complex, bit) minus slacks; swapping in the stronger R438 bit supplier lets the complex side bind again.", + "budget_minutes": 45, + "stop_rule": "Stop after independent endpoint checks and the composed kappa; no new construction.", + "outcome": "partial", + "evidence": "verify.py: complex root bracket recomputed, R438 bit endpoint accepted at c and rejected at c+1e-24 (with fallback envelope), kappa gates; 3 mutation controls rejected.", + "author": "Rohan Arun", + "ai_assistance": "Substantial Anthropic Claude (Claude Code) assistance; done with help from OpenCode (Space bunny free).", + "open_questions": [ + { + "question": "Is R438 (conditional on open PR1043) compatible with the rank-seven T74 outer release when substituted for PR589?", + "why_it_matters": "The composed kappa needs the outer ledger to accept the R438 bit row bill (row coefficient 18,355 < 20,161).", + "first_step": "Rerun PR3148's outer release with the R438 bit endpoint and its finite bill.", + "blocked_by": "PR1043 is open; the T74 outer pins the PR589 bit constant." + }, + { + "question": "Can the complex side be pushed the remaining 7.6e-8 to the R438 bit endpoint?", + "why_it_matters": "Beyond that the bit side binds again.", + "first_step": "Drain more of the 149,514 rank-1 remainders (legality-blocked) or extend receivers.", + "blocked_by": "Commuting-rule legality." + } + ] +} diff --git a/research/rank7-idle-donors-r438-bit/VERIFY.json b/research/rank7-idle-donors-r438-bit/VERIFY.json new file mode 100644 index 0000000000..53473318eb --- /dev/null +++ b/research/rank7-idle-donors-r438-bit/VERIFY.json @@ -0,0 +1,21 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/r438-native-rehost/CERTIFICATE.json", + "research/rank7-idle-remainder-donors-t740/RESULT.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Recomputes PR3190 complex root bracket and the R438 bit endpoint (accept at c, reject at c+1e-24, fallback envelope) with its own interval arithmetic; kappa = min(floor24(complex), floor24(bit)) - 1e-46 - 1e-70 equals CLAIM.json and exceeds PR3148/PR3184/PR3190; 3 mutation controls rejected." + } + ] +} diff --git a/research/rank7-idle-donors-r438-bit/verify.py b/research/rank7-idle-donors-r438-bit/verify.py new file mode 100644 index 0000000000..a75737fbe3 --- /dev/null +++ b/research/rank7-idle-donors-r438-bit/verify.py @@ -0,0 +1,113 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Compose the PR3190 idle-remainder complex endpoint with the R438 bit supplier. + +PR3190 (research/rank7-idle-remainder-donors-t740) raised the complex root of PR3133's words on +PR3148's T740 fill to 0.0017347705571115131604951, past the PR589 bit saving, so its kappa was +bit-capped at 0.001733427039589844234749. The R438 bit supplier (PR1043 word, PR2423 transport and +re-hosting, natively replayed in research/r438-native-rehost on main) has bit endpoint +0.001734846264120199151475, above that complex root. With it the complex side binds again. + +This verifier (standard library only): + 1. re-derives the complex root bracket of PR3190's declared profile with its own interval arithmetic; + 2. re-derives the R438 bit endpoint from the certificate's own bit profile (m = 64, live = 28,416, + with the 10^-16 * 32 m^2 fallback envelope): accepted at c, rejected at c + 1e-24; + 3. computes kappa = min(floor24(complex_lower), floor24(bit_lower)) - 1e-46 - 1e-70 and gates it. +The moves and profile of PR3190 are checked by that package's own registered verifier. +""" +import argparse, hashlib, json +from fractions import Fraction as F +from pathlib import Path + +PKG = Path(__file__).resolve().parent +ROOT = PKG.parents[1] +COMPLEX = ROOT / 'research/rank7-idle-remainder-donors-t740/RESULT.json' +BITCERT = ROOT / 'research/r438-native-rehost/CERTIFICATE.json' +GATES = dict(PR3148=F('0.0017297774946785970118859999999999999999999998999999999999999999999999'), + PR3184=F('0.0017301890612338507600949999999999999999999998999999999999999999999999'), + PR3190=F('0.0017334270395898442347489999999999999999999998999999999999999999999999')) + + +class Reject(Exception): pass +def req(ok, why): + if not ok: raise Reject(why) + +Q72 = 10 ** 72 +def rd(x): return F(x.numerator * Q72 // x.denominator, Q72) +def ru(x): return F(-((-x.numerator * Q72) // x.denominator), Q72) +def atanh2(z, n): + s, p = F(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) +L2 = atanh2(F(1, 3), 130) +def ln_box(y): + k = 0 + while y >= 2: y /= 2; k += 1 + a, e = atanh2((y - 1) / (y + 1), 90) + return rd(a + k * L2[0]), ru(a + e + k * (L2[0] + L2[1])) +def exp_box(x0, x1): + def tay(x): + s, t = F(1), F(1) + for j in range(1, 34): t = t * x / j; s += t + return s, t * x / 34 * 3 + a, _ = tay(x0); b, t = tay(x1) + return rd(a), ru(b + t) +def moment(prof, m, W, b, bad=False): + lo = hi = F(0) + items = sorted(prof.items()) + if bad: # bad-edge Gaussian fallback envelope, 10^-16 * 32 m^2 rank-1 children per child (bit pricing) + items = items + [(1, F(32 * m * m * sum(prof.values()), 10 ** 16))] + for r, n in items: + l0, l1 = ln_box(F(m, r)); e0, e1 = exp_box(b * l0, b * l1) + lo += n * r * e0; hi += n * r * e1 + return lo / (m * W), hi / (m * W) + + +def compose(cx, bit): + prof = {int(k): v for k, v in cx['profile'].items()} + req(sum(r * n for r, n in prof.items()) == 65088 * 740 and max(prof) <= 51, 'PR3190 profile mass/halving') + lo, hi = F(cx['complex_root'][0]), F(cx['complex_root'][1]) + req(hi - lo == F(1, 10 ** 25) and moment(prof, 73, 896 * 740, lo)[1] < 1 < moment(prof, 73, 896 * 740, hi)[0], 'complex root bracket') + inv = bit['pipeline']['candidate']['hosted']['invoice'] + bprof = {int(k): v for k, v in json.loads(inv['bit_profile'].replace("'", '"')).items()} if isinstance(inv['bit_profile'], str) else {int(k): v for k, v in inv['bit_profile'].items()} + c = F(inv['bit_lower']); c_next = F(inv['next_grid_point_rejected']) + req(c == F(inv['bit_lower_decimal']) and c_next - c == F(1, 10 ** 24), 'bit certificate fields') + W = 28416 + req(64 * W - sum(r * n for r, n in bprof.items()) > 0 and 2 * max(bprof) ** 2 < 64 ** 2, 'bit profile deficit/halving') + req(moment(bprof, 64, W, c, True)[1] < 1 and moment(bprof, 64, W, c_next, True)[0] > 1, 'bit endpoint accepted at c, rejected at c+1e-24') + floor24 = lambda x: F(x.numerator * 10 ** 24 // x.denominator, 10 ** 24) + C = min(floor24(lo), floor24(c)) + req(C == floor24(lo) and floor24(lo) < c, 'complex binds below the R438 bit endpoint') + kappa = C - F(1, 10 ** 46) - F(1, 10 ** 70) + for n, g in GATES.items(): req(kappa > g, 'kappa must exceed ' + n) + return kappa, lo, c + + +def main(): + ap = argparse.ArgumentParser(description=__doc__); ap.parse_args() + if not __debug__: raise SystemExit('assertions required') + cx = json.loads(COMPLEX.read_text()); bit = json.loads(BITCERT.read_text()) + claim = json.loads((PKG / 'CLAIM.json').read_text()) + kappa, lo, c = compose(cx, bit) + req(F(claim['kappa']) == kappa == F(claim['kappa_decimal']), 'CLAIM kappa') + rej = {} + import copy + for name, mut in [('complex_next_grid', lambda x, b: x.__setitem__('complex_root', [str(lo + F(1, 10**25)), str(lo + F(2, 10**25))])), + ('bit_next_grid', lambda x, b: b['pipeline']['candidate']['hosted']['invoice'].update( + bit_lower=str(F(b['pipeline']['candidate']['hosted']['invoice']['next_grid_point_rejected'])), + bit_lower_decimal=str(F(b['pipeline']['candidate']['hosted']['invoice']['next_grid_point_rejected'])), + next_grid_point_rejected=str(F(b['pipeline']['candidate']['hosted']['invoice']['next_grid_point_rejected']) + F(1, 10**24)))), + ('pr589_bit', lambda x, b: b['pipeline']['candidate']['hosted']['invoice'].update( + bit_lower='1733427039589844234749/1000000000000000000000000', bit_lower_decimal='1733427039589844234749/1000000000000000000000000', + next_grid_point_rejected='1733427039589844234750/1000000000000000000000000'))]: + x, b = copy.deepcopy(cx), copy.deepcopy(bit); mut(x, b) + try: compose(x, b) + except Reject as e: rej[name] = str(e) + else: raise SystemExit('mutation accepted: ' + name) + print('PASS_R438_COMPOSITION kappa=%s complex=%s bit=%s controls=%d' % (float(kappa), float(lo), float(c), len(rej))) + print(json.dumps(rej, sort_keys=True)) + + +if __name__ == '__main__': + try: main() + except Reject as e: raise SystemExit('FAIL: ' + str(e)) diff --git a/research/rank7-idle-hosted-receivers-r438/AUDIT.json b/research/rank7-idle-hosted-receivers-r438/AUDIT.json new file mode 100644 index 0000000000..fec4c07ed4 --- /dev/null +++ b/research/rank7-idle-hosted-receivers-r438/AUDIT.json @@ -0,0 +1,19 @@ +{ + "binding": "bit", + "complex_root_lower": "17348651784727109982331/10000000000000000000000000", + "fill_rebound": true, + "kappa": "17348462641201991514749999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "moves": 437978, + "rejected_controls": { + "axis_moved_twice": "axis not in donor remainder", + "dropped_move": "declared profile", + "foreign_axis": "axis not in donor remainder", + "hosted_axis_from_used_prefix": "axis not in donor remainder", + "kappa_above_bit": "headline kappa", + "next_root_grid": "complex root bracket", + "non_commuting_axis": "axis not orthogonal to receiver axes", + "prefix_conflict": "axis not orthogonal to hosted receiver prefix", + "receiver_donates": "child both donates and receives" + }, + "status": "PASS_IDLE_HOSTED_RECEIVERS_R438_AUDIT" +} diff --git a/research/rank7-idle-hosted-receivers-r438/BINS.json.gz b/research/rank7-idle-hosted-receivers-r438/BINS.json.gz new file mode 100644 index 0000000000..fc2446437c Binary files /dev/null and b/research/rank7-idle-hosted-receivers-r438/BINS.json.gz differ diff --git a/research/rank7-idle-hosted-receivers-r438/CLAIM.json b/research/rank7-idle-hosted-receivers-r438/CLAIM.json new file mode 100644 index 0000000000..3b918c6eae --- /dev/null +++ b/research/rank7-idle-hosted-receivers-r438/CLAIM.json @@ -0,0 +1,34 @@ +{ + "kappa": "17348462641201991514749999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017348462641201991514749999999999999999999998999999999999999999999999", + "binding": "bit (R438)", + "complex_root": [ + "17348651784727109982331/10000000000000000000000000", + "4337162946181777495583/2500000000000000000000000" + ], + "bit": "R438 0.001734846264120199151475", + "gain_over_pr3251": "30493735100587991/1000000000000000000000000", + "gain_over_pr3251_percent": "0.0017577506281153369", + "profile": { + "1": 16351000, + "2": 4838640, + "3": 1531817, + "4": 680534, + "5": 146615, + "6": 440, + "8": 53280, + "42": 32303, + "43": 1160, + "44": 8240, + "45": 32140, + "46": 6300, + "47": 20, + "48": 35294, + "49": 27626, + "50": 10480, + "51": 129006 + }, + "T": 740, + "status": "author-checked conditional candidate", + "credits": "PR1252 Gonzalo-Mier; star class Gueorgui Maissouradze; PR3148 Jeremy Diviney; PR3133 dcharb78; PR1043 Ali Romman; PR2423 Sagar Thakrar; OpenCode (Space bunny free); Anthropic Claude" +} diff --git a/research/rank7-idle-hosted-receivers-r438/MOVES.json.gz b/research/rank7-idle-hosted-receivers-r438/MOVES.json.gz new file mode 100644 index 0000000000..a42281c813 Binary files /dev/null and b/research/rank7-idle-hosted-receivers-r438/MOVES.json.gz differ diff --git a/research/rank7-idle-hosted-receivers-r438/PR3148-PROVIDERS.json b/research/rank7-idle-hosted-receivers-r438/PR3148-PROVIDERS.json new file mode 100644 index 0000000000..0b23436750 --- /dev/null +++ b/research/rank7-idle-hosted-receivers-r438/PR3148-PROVIDERS.json @@ -0,0 +1,842 @@ +{ + "extra": { + "actual_paid_profile": { + "1": 2433, + "2": 724, + "3": 228, + "4": 102, + "5": 20, + "8": 8 + }, + "widths": [ + 9, + 9, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 9, + 8, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 8, + 7, + 7, + 7, + 7, + 8, + 9, + 8, + 9, + 6, + 6, + 7, + 7, + 7, + 7, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 6, + 6, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 6, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 7, + 7, + 6, + 6, + 9, + 8, + 9, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 9, + 8, + 9, + 8, + 7, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 7, + 6, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 5, + 5, + 8, + 8, + 8, + 8 + ] + }, + "gauge44": { + "actual_paid_profile": { + "1": 2433, + "2": 724, + "3": 228, + "4": 102, + "5": 20, + "8": 8 + }, + "widths": [ + 9, + 9, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 9, + 8, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 8, + 7, + 7, + 7, + 7, + 8, + 9, + 8, + 9, + 6, + 6, + 7, + 7, + 7, + 7, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 6, + 6, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 6, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 7, + 7, + 6, + 6, + 9, + 8, + 9, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 9, + 8, + 9, + 8, + 7, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 7, + 6, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 5, + 5, + 8, + 8, + 8, + 8 + ] + } +} diff --git a/research/rank7-idle-hosted-receivers-r438/README.md b/research/rank7-idle-hosted-receivers-r438/README.md new file mode 100644 index 0000000000..c477247190 --- /dev/null +++ b/research/rank7-idle-hosted-receivers-r438/README.md @@ -0,0 +1,117 @@ +# Hosted remainders as receivers on PR3251: the complex side passes R438 again, conditional κ = 0.001734846264120199151475 − 10⁻⁴⁶ − 10⁻⁷⁰ (+0.00176%) + +**Author-checked conditional candidate; not maintainer-reviewed.** The selected record on +`main` is still #1094. This package stacks on the open PR3251, an exact per-group idle-donor search +that itself stacks on PR3200 → PR3198 → PR3190 → PR3184 → PR3148 → PR3133. PR3133's words and +PR3148's fill rows, order and dispatch are unchanged. + +| | complex root lower | bit endpoint | binds | κ headline | +|---|---|---|---|---| +| PR3251 | 0.0017348157703850985634843 | R438 0.001734846264120199151475 | complex | 0.001734815770385098563484 − … | +| **this** | **0.0017348651784727109982331** | R438 0.001734846264120199151475 | **bit** | **0.001734846264120199151475 − …** | + +The gain is **+0.00176% over PR3251**, which is the whole remaining window to the R438 bit endpoint. +The complex root now sits 1.9e-8 above R438, so κ is capped by the bit supplier again. + +## Why a new receiver class + +After PR3251, 149,514 rank-1 idle remainders remain. This package audits each of them in the final +state: + +- **107,356** have an axis that fails PR1252's translation rule. They are dead under any receiver. +- **39,558** conflict with every unhosted child of their group, and all other children in the group + are hosted. +- **2,600** conflict with every unhosted child. + +Relaying through an unhosted child was also tested: move one of its own axes onward so that the +blocked axis fits. It found no legal relay on this fill. + +**Change:** after PR3251's three phases, a fifth greedy phase lets an idle-remainder axis move into +the remainder of **another partially hosted bin** of the same replica and port, under the same +cost-lowering rule. The move must: + +- commute with that bin's **full** recipe frame, both the hosted prefix and the current remainder; +- commute with every stage entry/exit X and Y translation and the terminal Y translation; +- commute with both children's terminal translations. + +As before, no child both donates and receives, and the rank cap is 51. + +This adds 2,374 moves, 437,978 in total, and mostly merges pairs of rank-1 remainders into rank-2 +children. The idle bill becomes: + +`{1:147220, 2:16800, 3:13337, 4:1214, 5:13415, 6:440, 42:32303, 43:1160, 44:8240, 45:32140, 46:6300, 47:20, 48:35294, 49:27626, 50:10480, 51:129006}` + +Rank mass is unchanged at `65088·740`. + +## Reproduce + +```sh +# PR3148 materialize.py (research/coupled-carrier-cap740) -> /tmp/t740 +python3 -B research/rank7-idle-hosted-receivers-r438/build.py --t740 /tmp/t740 # ~75 s, deterministic +python3 -B research/rank7-idle-hosted-receivers-r438/verify.py --t740 /tmp/t740 # ~80 s +``` + +`verify.py` is PR3251's independent verifier, extended for hosted receivers, and does not import +`build.py`. It re-derives: + +- donor-remainder membership for every moved axis; +- that each receiver is either unhosted, or hosted with the moved axis orthogonal to the receiver's + hosted prefix; +- roles, unit length, orthogonality at receipt, the commuting rule and the rank cap; +- the profile and rank mass; +- the exact complex root bracket; +- the R438 endpoint, accepted at c and rejected at c + 10⁻²⁴ with the fallback envelope; +- `κ = min(floor₂₄(complex), bit) − 10⁻⁴⁶ − 10⁻⁷⁰`, with the bit side binding; +- the gates over PR3148, PR3184, PR3198, PR3200 and PR3251. + +Nine mutation controls are rejected: + +- an axis moved into a hosted receiver whose prefix anticommutes with it; +- an axis that does not commute; +- an axis taken from the used prefix; +- a foreign axis; +- an axis moved twice; +- a receiver that also donates; +- a dropped move; +- the next root grid point; +- κ above the bit cap. + +## Scope + +**New hypothesis:** a hosted bin's idle remainder may *receive* axes. This extends PR3190's +hosted-donor hypothesis. Orthogonality to the full hosted frame and the PR1252 commuting rule are +checked, but no hosted-controller argument is given. Only PR1252's unhosted pairs have an admitted +controller audit. + +**Not rerun:** + +- the native admission; +- the overlay-aware controller audit; +- the outer release, whose ledger pins PR589 and asserts `complex < bit`. + +The result is conditional on R438, whose source PR1043 is open, and on the whole stack. All +inherited obligations remain. + +## Open next questions + +- **Are hosted remainders legal receivers (and donors) under the T74 controller contract?** First + step: generalize the T74 `audit_mixed.py` to read this overlay and rerun PR3148's release. + Blocked by: the T74 chain has no overlay reader. +- **Can R438 rise, now that the bit side binds?** The complex side leaves 1.9e-8 of headroom above + it. First step: idle-remainder exchanges on R438's own `{34:32, 42:320}` remainders (cap 45 at + m = 64). Blocked by: R438's per-child idle axis data. + +## Credit + +- PR1252 (Gonzalo-Mier): the move, the rule and the pricing. +- Guéorgui Maissouradze: the star class. +- PR3148 (Jeremy Diviney): the fill. +- PR3133 and PR3042 (dcharb78): the words. +- PR2979 (Marius-Paul Dumitrean). +- Ali Romman (PR1043) and Sagar Thakrar (PR2423): R438. +- The `r438-native-rehost` authors. +- DreamingOfClouds and eumemic. +- OpenCode (Space bunny free): the remainder-donor and exact-search ideas in the stacked + predecessors. + +Prepared by Rohan Arun with Anthropic Claude assistance. Apache-2.0. diff --git a/research/rank7-idle-hosted-receivers-r438/RESULT.json b/research/rank7-idle-hosted-receivers-r438/RESULT.json new file mode 100644 index 0000000000..82f8854faa --- /dev/null +++ b/research/rank7-idle-hosted-receivers-r438/RESULT.json @@ -0,0 +1,70 @@ +{ + "status": "PASS_IDLE_HOSTED_RECEIVERS_R438_T740", + "T": 740, + "axis_moves": 437978, + "donor_children": 152703, + "receiver_children": 169486, + "idle_before": { + "1": 173160, + "3": 48951, + "5": 13875, + "48": 282569 + }, + "idle_after": { + "1": 147220, + "2": 16800, + "3": 13337, + "4": 1214, + "5": 13415, + "6": 440, + "42": 32303, + "43": 1160, + "44": 8240, + "45": 32140, + "46": 6300, + "47": 20, + "48": 35294, + "49": 27626, + "50": 10480, + "51": 129006 + }, + "profile": { + "1": 16351000, + "2": 4838640, + "3": 1531817, + "4": 680534, + "5": 146615, + "6": 440, + "8": 53280, + "42": 32303, + "43": 1160, + "44": 8240, + "45": 32140, + "46": 6300, + "47": 20, + "48": 35294, + "49": 27626, + "50": 10480, + "51": 129006 + }, + "complex_root": [ + "17348651784727109982331/10000000000000000000000000", + "4337162946181777495583/2500000000000000000000000" + ], + "complex_root_decimal": "17348651784727109982331e-25", + "bit": "69393850564807966059/40000000000000000000000", + "binding": "bit", + "kappa": "17348462641201991514749999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017348462641201991514749999999999999999999998999999999999999999999999", + "gain_over_pr3251": "30493735100587991/1000000000000000000000000", + "gain_over_pr3251_percent": "0.0017577506281153369", + "gain_over_pr3200": "39242394071599441/1000000000000000000000000", + "gain_over_pr3198": "3785350434299549/50000000000000000000000", + "gain_over_pr3184": "232860144317419569/50000000000000000000000", + "gain_over_pr3148": "5068769441602139589/1000000000000000000000000", + "max_child_rank": 51, + "halving": [ + 5329, + 5202 + ] +} diff --git a/research/rank7-idle-hosted-receivers-r438/SOURCES.json b/research/rank7-idle-hosted-receivers-r438/SOURCES.json new file mode 100644 index 0000000000..bb4884cb26 --- /dev/null +++ b/research/rank7-idle-hosted-receivers-r438/SOURCES.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "research/adaptive-kernel-demotion/inputs/DATA-PHASES.json", + "usage": "input", + "git_blob": "d9a4f84211182ca200c081ea061d724c8a2cfb70", + "sha256": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa" + }, + { + "path": "research/r438-native-rehost/CERTIFICATE.json", + "usage": "input", + "git_blob": "674ef36f723fbcc593e7d2319dca131da09181e5", + "sha256": "6da8c593257c8440f0fe35488d941715d953d715e2e464ffdfffff7ed31eee9c" + } + ] +} diff --git a/research/rank7-idle-hosted-receivers-r438/TASK.json b/research/rank7-idle-hosted-receivers-r438/TASK.json new file mode 100644 index 0000000000..8f50aff6a6 --- /dev/null +++ b/research/rank7-idle-hosted-receivers-r438/TASK.json @@ -0,0 +1,78 @@ +{ + "schema_version": 1, + "task_id": "selected-packing", + "priority_revision": 6, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "original_card": { + "id": "selected-packing", + "question": "Is there a genuinely unsearched, explicitly bounded improvement to the selected packing?", + "starting_points": [ + "certificates/selected-result.json", + "research/heterogeneous-owner-assembly/README.md", + "research/complex-local-word-ceiling/README.md" + ], + "methods": [ + "Search a named unclaimed canonical candidate domain with a reproducible partition.", + "Prove a stronger scoped relaxation or exact optimum for one named residual subproblem." + ], + "acceptance_gate": "Check live PR overlap first, price both suppliers and distinguish a search best from an optimum. Report the word's packing cap from ceiling.ceiling() and the fraction of it realized; label packing gains as such.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Locate the selected packing source in the review and check live PRs for the same residual problem.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Define an unclaimed canonical domain and a favorable bound before starting a new search.", + "bottleneck_link": "An actual paid-profile gain can improve the frontier up to the other supplier cap.", + "allowed_variations": [ + "One bounded residual packing instance or exact relaxation.", + "If the coverage law, template or guard changes, derive an applicable fully charged replacement bound instead of applying the incumbent ceiling outside its scope." + ], + "scope_change_triggers": [ + "Rerunning an existing search with only a different seed as a separate mathematical contribution." + ], + "overlap_terms": [ + "T16", + "owner exchange", + "packing" + ], + "existing_checks": [ + { + "scope": "Packing-independent ceiling for the selected paid profile under the one-unpaid-coordinate coverage and halving guard.", + "evidence": "docs/research/community-efficient1000-review.md", + "remaining": "A changed word or model requires new pricing; a local packing search must name uncovered scope.", + "status": "reviewed", + "source_commit": "836b19bfa309ceafbc8ee32a15e8c4b10dde7e11", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Changed residual subproblem on the open PR3148 T740 fill of PR3133's words, stacked on PR3251: after PR3251's exact idle-donor search, idle-remainder axes may also move into the remainder of another partially hosted bin of the same (replica, port) when they commute with that bin's full recipe frame (hosted prefix and remainder), all stage translations and both terminal translations; composed with the R438 bit supplier.", + "scope_change_reason": "PR3251 left the complex side 3.05e-8 below the R438 bit endpoint; the remaining rank-1 remainders are blocked either by translation commuting (107,356) or by conflicts with every unhosted child, so a new receiver class is needed.", + "bottleneck_link": "kappa = min(complex, bit); the complex root now exceeds R438, so kappa reaches the R438 bit endpoint.", + "budget_minutes": 60, + "stop_rule": "Stop after the exact overlay, pricing and independent verifier; no controller/outer admission.", + "outcome": "partial", + "evidence": "RESULT.json, BINS.json.gz, MOVES.json.gz (437,978 axis moves), AUDIT.json (9/9 controls rejected), R438 endpoint re-derived.", + "author": "Rohan Arun", + "ai_assistance": "Substantial Anthropic Claude (Claude Code) assistance; lineage ideas with help from OpenCode (Space bunny free).", + "open_questions": [ + { + "question": "Are hosted remainders legal receivers (and donors) under the T74 controller contract?", + "why_it_matters": "Only PR1252 unhosted pairs have an admitted controller audit.", + "first_step": "Generalize the T74 audit_mixed.py to read the idle-axis overlay, including hosted receivers, and rerun PR3148's release.", + "blocked_by": "No overlay reader in the T74 chain." + }, + { + "question": "Can the R438 bit supplier rise, now that it binds?", + "why_it_matters": "The complex root (0.0017348652) leaves 1.9e-8 of headroom above R438.", + "first_step": "Idle-remainder exchanges on R438's {34:32, 42:320} remainders (cap 45 at m = 64).", + "blocked_by": "R438 per-child idle axis data and its own commuting rule." + } + ] +} diff --git a/research/rank7-idle-hosted-receivers-r438/VERIFY.json b/research/rank7-idle-hosted-receivers-r438/VERIFY.json new file mode 100644 index 0000000000..8ee676e619 --- /dev/null +++ b/research/rank7-idle-hosted-receivers-r438/VERIFY.json @@ -0,0 +1,21 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/adaptive-kernel-demotion/inputs/DATA-PHASES.json", + "research/r438-native-rehost/CERTIFICATE.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 300, + "checks": "Independent of build.py: donor axes from own remainder; receivers unhosted, or hosted with the axis orthogonal to the hosted prefix; no child both donates and receives; unit/orthogonal-at-receipt and commuting rule; cap 51; profile and rank mass; exact complex root bracket; R438 bit endpoint re-derived; kappa = min(floor24(complex), bit) - 1e-46 - 1e-70 with the bit side binding; gates over PR3148/PR3184/PR3198/PR3200/PR3251; 9 mutation controls rejected." + } + ] +} diff --git a/research/rank7-idle-hosted-receivers-r438/build.py b/research/rank7-idle-hosted-receivers-r438/build.py new file mode 100644 index 0000000000..335584052a --- /dev/null +++ b/research/rank7-idle-hosted-receivers-r438/build.py @@ -0,0 +1,336 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Exact per-group idle-remainder donor exchanges on PR3148's T740 fill of PR3133's words (stacks on PR3200). + +Idea (credited): OpenCode (Space bunny free) -- replace PR3200's greedy phase-1 selection by an exact search within +each (replica, port) group. Phase 1 is a memoised DFS over every placement of every hosted-remainder axis (stay, or +any legal unhosted receiver), scored by the FINAL group cost sum Hf(rank) after phases 2 (star optimum, optional) and 3 +(PR3200's greedy single-axis phase, unchanged). Everything else below is PR3200's build.py. + +Idle-remainder donor exchanges on PR3148's T740 fill of PR3133's words. + +Every idle remainder of a (replica, port) - including the remainder of a partially hosted bin, +whose axes are the recipe axes [used, cap) - may donate axes to a fully idle (unhosted) child of +the same replica and port. Each moved axis obeys PR1252's commuting rule (commutes with all of the +receiver's current axes, every stage entry/exit X and Y translation, the terminal Y translation and +both children's terminal translations). Receivers are capped at rank 51 (73^2 > 2*51^2). +Phase 1 drains remainders smallest-first into the largest legal receiver; phase 2 runs the +frontier1094 star optimum (PR3184) on the untouched fully idle rank-48 children; phase 3 (new here) +repeats the best single-axis move from a smaller unhosted child to an equal-or-larger unhosted +receiver while it lowers the moment cost. Complex endpoint composed with the R438 bit supplier. + +Inputs (pinned): DATA-PHASES.json on main; PR3148's materialized COMPOSED-FILL/ORDER/DISPATCH and +its PR3133 provider widths (PR3148-PROVIDERS.json, copied from PR3148 vendor/). +""" +import argparse, gzip, hashlib, itertools, json, math +from collections import Counter, defaultdict +from fractions import Fraction as Q +from pathlib import Path + +HERE = Path(__file__).resolve().parent +import os +RELAY = os.environ.get('RELAY') is not None # phase 4 found no relay moves on this fill; off by default +import random +TRIALS = int(os.environ.get('TRIALS', '1')) +HOSTED_RECV = os.environ.get('NOHOSTED') is None +PHASES = HERE.parents[1] / 'research/adaptive-kernel-demotion/inputs/DATA-PHASES.json' +PIN = dict(phases='c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa', + fill_payload='8f4d6965ba573ff2b71fd7bf6b552643e086739d90bd73c55889502077638e00', + order='927226d702bf3cada076f4c459da9063c0df7e7154a62955cf75c40cf30215b9', + dispatch='90edc935320dd6264e98dc735d868df3c95f5901c70d7d96171001fcb295cce0', + providers='52eb0d85caa7b2d4a93acdf5011f52b793f61ddca86235fb03cd9a09397ad4cd') +T = 740 +LOCAL = {1: 2433, 2: 724, 3: 228, 4: 102, 5: 20, 8: 8} +IDLE_PR3148 = {1: 173160, 3: 48951, 5: 13875, 48: 282569} +BIT = Q('69393850564807966059/40000000000000000000000') # R438 bit endpoint, research/r438-native-rehost CERTIFICATE.json +PR3148_KAPPA = Q('0.0017297774946785970118859999999999999999999998999999999999999999999999') +PR3198_KAPPA = Q('0.0017347705571115131604949999999999999999999998999999999999999999999999') +PR3251_KAPPA = Q('0.0017348157703850985634839999999999999999999998999999999999999999999999') +PR3200_KAPPA = Q('0.0017348070217261275520339999999999999999999998999999999999999999999999') +PR3184_KAPPA = Q('0.0017301890612338507600949999999999999999999998999999999999999999999999') + + +def need(ok, why): + if not ok: raise SystemExit('FAIL: ' + why) + + +def sha(b): return hashlib.sha256(b).hexdigest() +def dot(a, b): return (a & b).bit_count() & 1 +def Hf(r): return 0.0 if r == 0 else r * (73.0 / r) ** 0.00173 + + +def pgz(obj): + d = bytearray(gzip.compress(json.dumps(obj, sort_keys=True, separators=(',', ':')).encode(), mtime=0)); d[9] = 255 + return bytes(d) + + +# ---- exact root (rational intervals, directed rounding 1e-60) ---- +S = 10 ** 60 +def dn(x): return Q(math.floor(x * S), S) +def upr(x): return Q(math.ceil(x * S), S) +def atanh2(z, n): + s, p = Q(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) +L2 = atanh2(Q(1, 3), 120) +LN = {} +def lnr(r): + if r not in LN: + x, k = Q(73, r), 0 + while x > 2: x /= 2; k += 1 + a, e = atanh2((x - 1) / (x + 1), 80) + LN[r] = (dn(a + k * L2[0]), upr(a + e + k * (L2[0] + L2[1]))) + return LN[r] +def ex(x0, x1): + def ser(x): + s, t = Q(0), Q(1) + for n in range(1, 40): s += t; t = t * x / n + return s, t + a, _ = ser(x0); b, t = ser(x1) + return dn(a), upr(b + 2 * t) +def moment(prof, b): + W = 896 * T; lo = hi = Q(0) + for r, n in prof.items(): + l0, l1 = lnr(r); e0, e1 = ex(b * l0, b * l1); lo += n * r * e0; hi += n * r * e1 + return lo / (73 * W), hi / (73 * W) +def root(prof, digits=25): + f = lambda b: sum(n * r * (73 / r) ** b for r, n in prof.items()) / (73 * 896 * T) - 1 + a, c = 0.0, 0.01 + for _ in range(200): + m = (a + c) / 2 + if f(m) < 0: a = m + else: c = m + g = 10 ** digits; k0, k1 = int(a * g) - 10 ** 10, int(a * g) + 10 ** 10 + need(moment(prof, Q(k0, g))[1] < 1 and moment(prof, Q(k1, g))[0] > 1, 'bracket') + while k1 - k0 > 1: + k = (k0 + k1) // 2; lo, hi = moment(prof, Q(k, g)) + if hi < 1: k0 = k + elif lo > 1: k1 = k + else: raise SystemExit('wide interval') + return Q(k0, g), Q(k1, g) + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--t740', type=Path, required=True, help='directory written by PR3148 materialize.py') + a = ap.parse_args() + raw = PHASES.read_bytes(); need(sha(raw) == PIN['phases'], 'phases pin') + rec = {r['port']: r for r in json.loads(raw)['recipes']} + fraw = gzip.decompress((a.t740 / 'COMPOSED-FILL.json.gz').read_bytes()); need(sha(fraw) == PIN['fill_payload'], 'fill pin') + need(sha((a.t740 / 'ORDER.json').read_bytes()) == PIN['order'] and sha((a.t740 / 'DISPATCH.json').read_bytes()) == PIN['dispatch'], 'order/dispatch pins') + praw = (HERE / 'PR3148-PROVIDERS.json').read_bytes(); need(sha(praw) == PIN['providers'], 'providers pin') + prov = json.loads(praw); order = json.loads((a.t740 / 'ORDER.json').read_bytes()) + disp = {(s, r): p for s, r, p in json.loads((a.t740 / 'DISPATCH.json').read_bytes())} + fill = json.loads(fraw) + need(fill['columns'] == ['time', 'helper', 'owner_replica', 'child', 'port', 'offset'] and fill['dispatch_overrides'] == [], 'fill format') + caps = {(p, c): ch['rank'] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + AX = {(p, c): [int(v) for v in ch['orthogonal_axes']] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + TR = {(p, c): int(ch['translation_after']) for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + PT = {p: [int(s[k]) for s in rc['stage_alignment'] for k in ('entry_Y', 'exit_Y', 'entry_X', 'exit_X')] + [int(rc['terminal_Y_translation'])] for p, rc in rec.items()} + used, top = Counter(), Counter() + for time, helper, rep, child, port, offset in fill['rows']: + s, r = order[time]; w = prov[disp[s, r]]['widths'][helper] + used[rep, child, port] += w; top[rep, child, port] = max(top[rep, child, port], offset + w) + need(all(used[k] == top[k] for k in used), 'compact helper prefixes') + groups = [] + for rep in range(T): + for p in range(112): + kids = [[c, used[rep, c, p]] for c in range(len(rec[p]['idle_children'])) if caps[p, c] - used[rep, c, p] > 0] + groups.append([rep, p, kids]) + idle = Counter(caps[p, c] - u for _, p, kids in groups for c, u in kids) + need(dict(idle) == IDLE_PR3148, 'idle bill equals PR3148') + + def legal(v, p, c, d, axes_d): + return all(dot(v, x) == 0 for x in axes_d) and all(dot(v, x) == 0 for x in PT[p]) and dot(v, TR[p, c]) == 0 and dot(v, TR[p, d]) == 0 + + def solve(p, kids): + rank = {c: caps[p, c] - u for c, u in kids}; axes = {c: AX[p, c][u:caps[p, c]] for c, u in kids} + hosted = {c: u > 0 for c, u in kids}; role = {c: None for c, _ in kids}; moves = [] + donors = sorted([c for c, u in kids if u > 0], key=lambda c: (rank[c], c)) + recv = [d for d, u in kids if u == 0] + items = [(c, v) for c in donors for v in axes[c]] + STARS = [True] + r0 = {c: rank[c] for c, _ in kids} + memo = {} + def dfs2(i, recvd, cnt): + # exact search: state = (item index, axes received per receiver, axes moved per donor); terminal cost runs + # phases 2 (optional) and 3 on the resulting state, so phase 1 is chosen for the final sum of Hf(rank) + key = (i, recvd, cnt) + if key in memo: return memo[key] + if i == len(items): + rk = dict(r0) + for k, c in enumerate(donors): rk[c] -= cnt[k] + for o, d in enumerate(recv): rk[d] += len(recvd[o]) + ax2 = {c: list(axes[c]) for c in axes} + for o, d in enumerate(recv): ax2[d] = ax2[d] + sorted(recvd[o]) + ro2 = {c: role[c] for c in role} + for k, c in enumerate(donors): + if cnt[k]: ro2[c] = 'D' + for o, d in enumerate(recv): + if recvd[o]: ro2[d] = 'R' + best_t = None + for st in (True, False): + _, rk2 = rest({c: list(x) for c, x in ax2.items()}, dict(rk), dict(ro2), [], st) + cst = sum(Hf(x) for x in rk2.values()) + if best_t is None or cst < best_t[0] - 1e-12: best_t = (cst, st) + memo[key] = (best_t[0], (best_t[1],)) + return memo[key] + c, v = items[i]; kd = donors.index(c) + best = None + for o in [None] + list(range(len(recv))): + if o is None: nxt, nc = recvd, cnt + else: + d = recv[o] + if r0[d] + len(recvd[o]) >= 51: continue + if not legal(v, p, c, d, list(axes[d]) + list(recvd[o])): continue + nxt = recvd[:o] + (recvd[o] | frozenset([v]),) + recvd[o + 1:] + nc = cnt[:kd] + (cnt[kd] + 1,) + cnt[kd + 1:] + sub = dfs2(i + 1, nxt, nc) + if best is None or sub[0] < best[0] - 1e-12: best = (sub[0], (o,) + sub[1]) + memo[key] = best + return best + def rest(axes, rank, role, moves, stars=True, multi=False): + free = [c for c, u in kids if u == 0 and role[c] is None and caps[p, c] == 48] + if stars and len(free) >= 2: + MV = {(d, r): [v for v in axes[d] if legal(v, p, d, r, axes[r])] for d in free for r in free if d != r} + best = [len(free) * Hf(48), []] + def match(c, leaves): + opts = [MV[c, l] for l in leaves] + if any(len(o) < 3 for o in opts): return None + def go(k, usedax): + if k == len(leaves): return [] + for trip in itertools.combinations([v for v in opts[k] if v not in usedax], 3): + rest = go(k + 1, usedax | set(trip)) + if rest is not None: return [(c, leaves[k], list(trip))] + rest + return None + return go(0, set()) + def assign(i, roles): + if i == len(free): + leaves = defaultdict(list) + for c in free: + if isinstance(roles[c], tuple): leaves[roles[c][1]].append(c) + cents = [c for c in free if roles[c] == 'c'] + if any(not leaves[c] for c in cents) or any(roles[x] != 'c' for x in leaves): return + mv = [] + for c in cents: + m = match(c, leaves[c]) + if m is None: return + mv += m + rk = [48 - 3 * len(leaves[c]) if roles[c] == 'c' else 51 if isinstance(roles[c], tuple) else 48 for c in free] + cost = sum(Hf(x) for x in rk) + if cost < best[0] - 1e-12: best[0], best[1] = cost, mv + return + c = free[i] + for opt in ['n', 'c'] + [('l', d) for d in free if d != c]: + roles[c] = opt; assign(i + 1, roles) + del roles[c] + assign(0, {}) + for c, l, trip in best[1]: + for v in trip: + axes[c].remove(v); axes[l].append(v); rank[c] -= 1; rank[l] += 1; moves.append([c, l, v]) + un = [c for c, u in kids if u == 0] + start = ({c: list(x) for c, x in axes.items()}, dict(rank), dict(role), list(moves)) + bestrun = None + for trial in range(TRIALS if (multi and len(un) >= 2) else 1): + rng = random.Random(1000003 * trial + p) + axes, rank, role, moves = {c: list(x) for c, x in start[0].items()}, dict(start[1]), dict(start[2]), list(start[3]) + while True: + cands = [] + for c in un: + if role[c] == 'R' or rank[c] == 0: continue + for d in un: + if d == c or role[d] == 'D' or rank[d] >= 51 or rank[d] < rank[c]: continue + g = Hf(rank[c] - 1) + Hf(rank[d] + 1) - Hf(rank[c]) - Hf(rank[d]) + if g >= 0: continue + legal_v = [v for v in axes[c] if legal(v, p, c, d, axes[d])] + if legal_v: cands.append((g, c, d, legal_v[0] if trial == 0 else rng.choice(legal_v))) + if not cands: break + cands.sort(key=lambda x: (x[0], x[1], x[2])) + g, c, d, v = cands[0] if trial == 0 else rng.choice(cands[:3]) + axes[c].remove(v); axes[d].append(v); rank[c] -= 1; rank[d] += 1; role[c] = 'D'; role[d] = 'R'; moves.append([c, d, v]) + cost = sum(Hf(x) for x in rank.values()) + if bestrun is None or cost < bestrun[0] - 1e-12: bestrun = (cost, moves, rank) + return bestrun[1], bestrun[2] + if items: + _, choices = dfs2(0, tuple(frozenset() for _ in recv), tuple(0 for _ in donors)) + STARS[0] = choices[-1]; choices = choices[:-1] + for (c, v), o in zip(items, choices): + if o is None: continue + d = recv[o] + axes[c].remove(v); axes[d].append(v); rank[c] -= 1; rank[d] += 1 + role[c] = 'D'; role[d] = 'R'; moves.append([c, d, v]) + moves, rank = rest(axes, rank, role, moves, STARS[0], True) + # phase 4 (new): relay moves. A remainder axis v blocked at an unhosted receiver B only by one of B's own + # original axes w is placed as w: B -> C, then v: h -> B (both PR1252-rule moves); B keeps its rank. + if RELAY: + orig = {c: set(AX[p, c][u:caps[p, c]]) for c, u in kids} + un = [c for c, u in kids if u == 0] + while True: + best = None + for h in [c for c, u in kids if rank[c] > 0 and role[c] != 'R']: + for v in axes[h]: + if not all(dot(v, x) == 0 for x in PT[p]) or dot(v, TR[p, h]): continue + for B in un: + if B == h or dot(v, TR[p, B]): continue + S = [w for w in axes[B] if dot(v, w)] + if len(S) != 1 or S[0] not in orig[B]: continue + w = S[0] + for C in un: + if C in (B, h) or role[C] == 'D' or rank[C] >= 51: continue + g = Hf(rank[h] - 1) - Hf(rank[h]) + Hf(rank[C] + 1) - Hf(rank[C]) + if g >= -1e-12 or (best is not None and g >= best[0]): continue + if legal(w, p, B, C, axes[C]): best = (g, h, v, B, w, C) + if best is None: break + g, h, v, B, w, C = best + axes[B].remove(w); axes[C].append(w); rank[C] += 1; moves.append([B, C, w]) + axes[h].remove(v); axes[B].append(v); rank[h] -= 1; moves.append([h, B, v]) + role[C] = 'R'; role[h] = 'D' + # phase 5 (new): hosted receivers. A remainder axis may also move into the idle remainder of another + # partially hosted bin of the same (replica, port), when it commutes with that bin's FULL recipe frame + # (hosted prefix and current remainder), the stage translations and both terminal translations. + if HOSTED_RECV: + prefix = {c: AX[p, c][:u] for c, u in kids} + while True: + best = None + for c, u in kids: + if role[c] == 'R' or rank[c] == 0: continue + for d, ud in kids: + if d == c or ud == 0 or role[d] == 'D' or rank[d] >= 51 or rank[d] < rank[c]: continue + g = Hf(rank[c] - 1) + Hf(rank[d] + 1) - Hf(rank[c]) - Hf(rank[d]) + if g >= -1e-12 or (best is not None and g >= best[0]): continue + for v in axes[c]: + if legal(v, p, c, d, prefix[d] + axes[d]): best = (g, c, d, v); break + if best is None: break + g, c, d, v = best + axes[c].remove(v); axes[d].append(v); rank[c] -= 1; rank[d] += 1; role[c] = 'D'; role[d] = 'R'; moves.append([c, d, v]) + return moves, rank + + cache, moves, final = {}, [], Counter() + for rep, p, kids in groups: + key = (p, tuple(map(tuple, kids))) + if key not in cache: cache[key] = solve(p, kids) + mv, rank = cache[key] + moves += [[rep, p] + m for m in mv] + final.update(r for r in rank.values() if r) + prof = Counter({r: n * 9 * T for r, n in LOCAL.items()}); prof.update(final); prof = dict(sorted(prof.items())) + need(sum(r * n for r, n in prof.items()) == 65088 * T and 73 * 73 > 2 * max(prof) ** 2, 'mass and halving') + lo, hi = root(prof) + C = min(Q(math.floor(lo * 10 ** 24), 10 ** 24), BIT) + kappa = C - Q(1, 10 ** 46) - Q(1, 10 ** 70) + need(kappa > PR3251_KAPPA > PR3200_KAPPA > PR3198_KAPPA > PR3184_KAPPA > PR3148_KAPPA, 'gates') + (HERE / 'BINS.json.gz').write_bytes(pgz(dict(T=T, columns=['replica', 'port', [['child', 'used']]], groups=[g for g in groups if g[2]]))) + (HERE / 'MOVES.json.gz').write_bytes(pgz(dict(columns=['replica', 'port', 'donor_child', 'receiver_child', 'axis'], moves=moves))) + donors = Counter(); + res = dict(status='PASS_IDLE_HOSTED_RECEIVERS_R438_T740', T=T, axis_moves=len(moves), + donor_children=len({(m[0], m[1], m[2]) for m in moves}), receiver_children=len({(m[0], m[1], m[3]) for m in moves}), + idle_before={str(k): v for k, v in IDLE_PR3148.items()}, idle_after={str(k): v for k, v in sorted(final.items())}, + profile={str(k): v for k, v in prof.items()}, complex_root=[str(lo), str(hi)], + complex_root_decimal=f'{lo.numerator * 10**25 // lo.denominator}e-25', bit=str(BIT), binding='bit' if BIT < lo else 'complex', + kappa=str(kappa), kappa_decimal='0.' + str(kappa.numerator * 10 ** 70 // kappa.denominator).rjust(70, '0'), gain_over_pr3251=str(kappa - PR3251_KAPPA), gain_over_pr3251_percent=str(float((kappa - PR3251_KAPPA) / PR3251_KAPPA * 100)), gain_over_pr3200=str(kappa - PR3200_KAPPA), gain_over_pr3198=str(kappa - PR3198_KAPPA), gain_over_pr3184=str(kappa - PR3184_KAPPA), gain_over_pr3148=str(kappa - PR3148_KAPPA), + max_child_rank=max(prof), halving=[5329, 2 * max(prof) ** 2]) + (HERE / 'RESULT.json').write_text(json.dumps(res, indent=1) + '\n') + print('PASS', float(lo), res['binding'], float(kappa), float(kappa - PR3184_KAPPA), len(moves)) + + +if __name__ == '__main__': + main() diff --git a/research/rank7-idle-hosted-receivers-r438/verify.py b/research/rank7-idle-hosted-receivers-r438/verify.py new file mode 100644 index 0000000000..8a3a27c016 --- /dev/null +++ b/research/rank7-idle-hosted-receivers-r438/verify.py @@ -0,0 +1,242 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Independent verifier (does not import build.py) for the exact per-group idle-remainder donor exchanges. +PR3200's verifier with the status renamed and a PR3200 gate added; every legality and pricing check is unchanged. + + +Re-derives from BINS / MOVES / DATA-PHASES: donor axes come from the donor's own idle remainder +(recipe axes [used, cap)); a hosted receiver must also be orthogonal to its hosted prefix (recipe axes [0, used)); +no child both donates and receives; +every moved axis is a unit vector orthogonal to all of the receiver's axes held at that moment and +commutes with every stage entry/exit X/Y translation, the terminal Y translation and both +children's terminal translations; final ranks <= 51; per-group axis multisets unchanged; the +complete profile and rank mass; an exact complex root bracket with its own interval arithmetic; +kappa = min(floor24(complex_lower), PR589 bit) - 1e-46 - 1e-70 and its gates. +Optional --t740 rebinds BINS to PR3148's materialized fill. Mutation controls must be rejected. +""" +import argparse, copy, gzip, hashlib, json +from collections import Counter, defaultdict +from fractions import Fraction as F +from pathlib import Path + +PKG = Path(__file__).resolve().parent +PHASES = PKG.parents[1] / 'research/adaptive-kernel-demotion/inputs/DATA-PHASES.json' +T = 740 +LOCAL = {1: 2433, 2: 724, 3: 228, 4: 102, 5: 20, 8: 8} +IDLE = {1: 173160, 3: 48951, 5: 13875, 48: 282569} +BITCERT = PKG.parents[1] / 'research/r438-native-rehost/CERTIFICATE.json' +BIT = None # R438 bit endpoint, re-derived from its certificate's bit profile in check_bit() +GATES = dict(PR3251=F('0.0017348157703850985634839999999999999999999998999999999999999999999999'), PR3200=F('0.0017348070217261275520339999999999999999999998999999999999999999999999'), PR3198=F('0.0017347705571115131604949999999999999999999998999999999999999999999999'), PR3148=F('0.0017297774946785970118859999999999999999999998999999999999999999999999'), + PR3184=F('0.0017301890612338507600949999999999999999999998999999999999999999999999')) + + +class Reject(Exception): pass +def req(ok, why): + if not ok: raise Reject(why) +def load(p): + b = Path(p).read_bytes(); return json.loads(gzip.decompress(b) if b[:2] == b'\x1f\x8b' else b) +def par(a, b): return bin(a & b).count('1') & 1 + + +def audit(rec, bins, moves): + caps = {(p, c): ch['rank'] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + G = {} + for rep, p, kids in bins['groups']: + req((rep, p) not in G and 0 <= rep < T and p in rec, 'group key') + G[rep, p] = {c: u for c, u in kids} + req(all(0 <= u < caps[p, c] for c, u in kids), 'used below capacity') + req(Counter(caps[p, c] - u for (rep, p), kids in G.items() for c, u in kids.items()) == Counter(IDLE), 'idle bill') + trans = {} + for p, rc in rec.items(): + trans[p] = {int(s[k]) for s in rc['stage_alignment'] for k in ('entry_X', 'exit_X', 'entry_Y', 'exit_Y')} | {int(rc['terminal_Y_translation'])} + for c, ch in enumerate(rc['idle_children']): + ax = [int(v) for v in ch['orthogonal_axes']] + req(all(par(v, v) == 1 for v in ax) and all(par(a, b) == 0 for i, a in enumerate(ax) for b in ax[i + 1:]), 'recipe axes orthonormal') + state = {} + def cur(rep, p, c): + k = (rep, p, c) + if k not in state: + u = G[rep, p][c]; state[k] = dict(axes=set(int(v) for v in rec[p]['idle_children'][c]['orthogonal_axes'][u:caps[p, c]]), role=None) + return state[k] + for m in moves: + rep, p, c, d, v = m + req((rep, p) in G and c in G[rep, p] and d in G[rep, p] and c != d, 'children of the group') + prefix_d = [int(x) for x in rec[p]['idle_children'][d]['orthogonal_axes'][:G[rep, p][d]]] + req(all(par(v, x) == 0 for x in prefix_d), 'axis not orthogonal to hosted receiver prefix') + sc, sd = cur(rep, p, c), cur(rep, p, d) + req(sc['role'] != 'R' and sd['role'] != 'D', 'child both donates and receives') + own = set(int(x) for x in rec[p]['idle_children'][c]['orthogonal_axes'][G[rep, p][c]:caps[p, c]]) + req(v in sc['axes'] and v in own, 'axis not in donor remainder') + req(par(v, v) == 1 and all(par(v, x) == 0 for x in sd['axes']), 'axis not orthogonal to receiver axes') + tc = int(rec[p]['idle_children'][c]['translation_after']); td = int(rec[p]['idle_children'][d]['translation_after']) + req(all(par(v, x) == 0 for x in trans[p] | {tc, td}), 'axis does not commute with translations') + sc['axes'].discard(v); sd['axes'].add(v); sc['role'] = 'D'; sd['role'] = 'R' + req(len(sd['axes']) <= 51, 'rank above 51') + final = Counter() + for (rep, p), kids in G.items(): + for c, u in kids.items(): + r = len(state[rep, p, c]['axes']) if (rep, p, c) in state else caps[p, c] - u + if r: final[r] += 1 + return final + + +def mom(prof, b): + Q72 = 10 ** 72 + def rd(x): return F(x.numerator * Q72 // x.denominator, Q72) + def ru(x): return F(-((-x.numerator * Q72) // x.denominator), Q72) + def at(z, n): + s, p = F(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) + l2 = at(F(1, 3), 130); W = 896 * T; lo = hi = F(0) + for r, n in sorted(prof.items()): + y, k = F(73, r), 0 + while y >= 2: y /= 2; k += 1 + a, e = at((y - 1) / (y + 1), 90) + L0, L1 = rd(a + k * l2[0]), ru(a + e + k * (l2[0] + l2[1])) + def tay(x): + s, t = F(1), F(1) + for j in range(1, 34): t = t * x / j; s += t + return s, t * x / 34 * 3 + e0, _ = tay(b * L0); e1, t1 = tay(b * L1) + lo += n * r * rd(e0); hi += n * r * ru(e1 + t1) + return lo / (73 * W), hi / (73 * W) + + +def check_bit(): + inv = json.loads(BITCERT.read_text())['pipeline']['candidate']['hosted']['invoice'] + prof = {int(k): v for k, v in inv['bit_profile'].items()} + c, cn = F(inv['bit_lower']), F(inv['next_grid_point_rejected']) + req(c == F(inv['bit_lower_decimal']) and cn - c == F(1, 10 ** 24) and 2 * max(prof) ** 2 < 64 ** 2, 'R438 certificate fields') + W = 28416; N = sum(prof.values()) + def bm(b): + lo = hi = F(0) + for r, n in sorted(prof.items()) + [(1, F(32 * 64 * 64 * N, 10 ** 16))]: + l0, l1 = ln64(r); e0, e1 = exbox(b * l0, b * l1); lo += n * r * e0; hi += n * r * e1 + return lo / (64 * W), hi / (64 * W) + req(bm(c)[1] < 1 and bm(cn)[0] > 1, 'R438 bit endpoint accepted at c, rejected at c+1e-24') + return c + + +def ln64(r): + Q72 = 10 ** 72 + def at(z, n): + s, p = F(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) + y, k = F(64, r), 0 + while y >= 2: y /= 2; k += 1 + l2 = at(F(1, 3), 130); a, e = at((y - 1) / (y + 1), 90) + return F((a + k * l2[0]).numerator * Q72 // (a + k * l2[0]).denominator, Q72), F(-((-(a + e + k * (l2[0] + l2[1])).numerator * Q72) // (a + e + k * (l2[0] + l2[1])).denominator), Q72) + + +def exbox(x0, x1): + def tay(x): + s, t = F(1), F(1) + for j in range(1, 34): t = t * x / j; s += t + return s, t * x / 34 * 3 + a, _ = tay(x0); b, t = tay(x1) + return a, b + t + + +def run(rec, bins, moves, result): + final = audit(rec, bins, moves) + prof = Counter({r: n * 9 * T for r, n in LOCAL.items()}); prof.update(final); prof = dict(sorted(prof.items())) + req({str(k): v for k, v in prof.items()} == result['profile'], 'declared profile') + req(sum(r * n for r, n in prof.items()) == 65088 * T, 'rank mass 65088*T') + req(max(prof) <= 51 and 73 * 73 > 2 * max(prof) ** 2, 'halving guard') + lo, hi = F(result['complex_root'][0]), F(result['complex_root'][1]) + req(hi - lo == F(1, 10 ** 25) and mom(prof, lo)[1] < 1 and mom(prof, hi)[0] > 1, 'complex root bracket') + C = min(F(lo.numerator * 10 ** 24 // lo.denominator, 10 ** 24), BIT) + req(BIT < F(lo.numerator * 10 ** 24 // lo.denominator, 10 ** 24) and C == BIT, 'complex root exceeds the R438 bit endpoint, so the bit side binds') + kappa = C - F(1, 10 ** 46) - F(1, 10 ** 70) + req(kappa == F(result['kappa']), 'headline kappa') + for n, g in GATES.items(): req(kappa > g, 'kappa must exceed ' + n) + return prof, kappa, lo + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--t740', type=Path) + ap.add_argument('--providers', type=Path, default=PKG / 'PR3148-PROVIDERS.json') + ap.add_argument('--write', action='store_true', help='rewrite the committed AUDIT.json receipt') + a = ap.parse_args() + if not __debug__: raise SystemExit('assertions required') + raw = PHASES.read_bytes() + req(hashlib.sha256(raw).hexdigest() == 'c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa', 'phases pin') + rec = {r['port']: r for r in json.loads(raw)['recipes']} + global BIT + BIT = check_bit() + bins, mv, result = load(PKG / 'BINS.json.gz'), load(PKG / 'MOVES.json.gz')['moves'], load(PKG / 'RESULT.json') + rebound = False + if a.t740: + fraw = gzip.decompress((a.t740 / 'COMPOSED-FILL.json.gz').read_bytes()) + req(hashlib.sha256(fraw).hexdigest() == '8f4d6965ba573ff2b71fd7bf6b552643e086739d90bd73c55889502077638e00', 'fill pin') + prov = load(a.providers); order = load(a.t740 / 'ORDER.json'); disp = {(s, r): p for s, r, p in load(a.t740 / 'DISPATCH.json')} + used = Counter() + for time, helper, rep, child, port, offset in json.loads(fraw)['rows']: + s, r = order[time]; used[rep, child, port] += prov[disp[s, r]]['widths'][helper] + caps = {(p, c): ch['rank'] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + derived = [[rep, p, [[c, used[rep, c, p]] for c in range(len(rec[p]['idle_children'])) if caps[p, c] - used[rep, c, p] > 0]] for rep in range(T) for p in range(112)] + req([g for g in derived if g[2]] == bins['groups'], 'BINS equal the fill') + rebound = True + prof, kappa, lo = run(rec, bins, mv, result) + rej = {} + first_hosted = next(i for i, m in enumerate(mv) if {c: u for c, u in next(g for g in bins['groups'] if g[0] == m[0] and g[1] == m[1])[2]}[m[2]] > 0) + rep, p, c, d, v = mv[first_hosted] + kids = {cc: u for cc, u in next(g for g in bins['groups'] if g[0] == rep and g[1] == p)[2]} + hosted_other = next((cc for cc, u in kids.items() if u > 0 and cc != c), None) + used_axis = int(rec[p]['idle_children'][c]['orthogonal_axes'][0]) + gmap = {(g[0], g[1]): {cc: u for cc, u in g[2]} for g in bins['groups']} + def find_prefix_conflict(): + # redirect one move to another hosted child of its group whose hosted prefix anticommutes with the axis + for i, (r0, p0, c0, d0, v0) in enumerate(mv): + for e, ue in gmap[r0, p0].items(): + if e in (c0, d0) or ue == 0: continue + pre = [int(x) for x in rec[p0]['idle_children'][e]['orthogonal_axes'][:ue]] + if any(par(v0, y) for y in pre): return i, [r0, p0, c0, e, v0] + raise SystemExit('no prefix-conflict control found') + hr_index, hr_bad = find_prefix_conflict() + def find_noncommuting(): + for i, (r0, p0, c0, d0, v0) in enumerate(mv): + trans = [int(st[k]) for st in rec[p0]['stage_alignment'] for k in ('entry_X', 'exit_X', 'entry_Y', 'exit_Y')] + [int(rec[p0]['terminal_Y_translation'])] + for a in rec[p0]['idle_children'][c0]['orthogonal_axes'][gmap[r0, p0][c0]:]: + a = int(a) + if a != v0 and any(par(a, y) for y in trans): return i, [r0, p0, c0, d0, a] + raise SystemExit('no non-commuting control found') + nc_index, nc_move = find_noncommuting() + def mut(f): + x = copy.deepcopy(mv); f(x); return x + cases = dict( + prefix_conflict=mut(lambda x: x.__setitem__(hr_index, hr_bad)), + non_commuting_axis=mut(lambda x: x.__setitem__(nc_index, nc_move)), + hosted_axis_from_used_prefix=mut(lambda x: x.__setitem__(first_hosted, [rep, p, c, d, used_axis])), + foreign_axis=mut(lambda x: x.__setitem__(first_hosted, [rep, p, c, d, 1 << 80])), + axis_moved_twice=mut(lambda x: x.insert(first_hosted + 1, list(x[first_hosted]))), + receiver_donates=mut(lambda x: x.append([rep, p, d, c, v])), + dropped_move=mut(lambda x: x.pop(first_hosted)), + ) + for name, x in cases.items(): + try: run(rec, bins, x, result) + except Reject as e: rej[name] = str(e) + else: raise SystemExit('mutation accepted: ' + name) + r2 = copy.deepcopy(result); r2['complex_root'] = [str(lo + F(1, 10 ** 25)), str(lo + F(2, 10 ** 25))] + try: run(rec, bins, mv, r2) + except Reject as e: rej['next_root_grid'] = str(e) + else: raise SystemExit('mutation accepted: next_root_grid') + r3 = copy.deepcopy(result); r3['kappa'] = str(F(result['kappa']) + F(1, 10 ** 24)) + try: run(rec, bins, mv, r3) + except Reject as e: rej['kappa_above_bit'] = str(e) + else: raise SystemExit('mutation accepted: kappa_above_bit') + out = dict(status='PASS_IDLE_HOSTED_RECEIVERS_R438_AUDIT', moves=len(mv), fill_rebound=rebound, kappa=str(kappa), + complex_root_lower=str(lo), binding='bit' if BIT < lo else 'complex', rejected_controls=rej) + if a.write: (PKG / 'AUDIT.json').write_text(json.dumps(out, indent=1, sort_keys=True) + '\n') + else: + strip = lambda d: {k: v for k, v in d.items() if k != 'fill_rebound'} + req(strip(load(PKG / 'AUDIT.json')) == strip(json.loads(json.dumps(out))), 'committed AUDIT.json receipt') + print('PASS_IDLE_HOSTED_RECEIVERS_R438_AUDIT moves=%d controls=%d kappa=%s binding=%s' % (len(mv), len(rej), float(kappa), out['binding'])) + + +if __name__ == '__main__': + try: main() + except Reject as e: raise SystemExit('FAIL: ' + str(e)) diff --git a/research/rank7-idle-remainder-donors-t740/AUDIT.json b/research/rank7-idle-remainder-donors-t740/AUDIT.json new file mode 100644 index 0000000000..775b31ed35 --- /dev/null +++ b/research/rank7-idle-remainder-donors-t740/AUDIT.json @@ -0,0 +1,18 @@ +{ + "binding": "bit", + "complex_root_lower": "17347705571115131604951/10000000000000000000000000", + "fill_rebound": true, + "kappa": "17334270395898442347489999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "moves": 391964, + "rejected_controls": { + "axis_moved_twice": "axis not in donor remainder", + "dropped_move": "declared profile", + "foreign_axis": "axis not in donor remainder", + "hosted_axis_from_used_prefix": "axis not in donor remainder", + "hosted_receiver": "receiver must be unhosted", + "kappa_above_bit": "headline kappa", + "next_root_grid": "complex root bracket", + "receiver_donates": "receiver must be unhosted" + }, + "status": "PASS_IDLE_REMAINDER_DONOR_AUDIT" +} diff --git a/research/rank7-idle-remainder-donors-t740/BINS.json.gz b/research/rank7-idle-remainder-donors-t740/BINS.json.gz new file mode 100644 index 0000000000..fc2446437c Binary files /dev/null and b/research/rank7-idle-remainder-donors-t740/BINS.json.gz differ diff --git a/research/rank7-idle-remainder-donors-t740/CLAIM.json b/research/rank7-idle-remainder-donors-t740/CLAIM.json new file mode 100644 index 0000000000..dd7c0055de --- /dev/null +++ b/research/rank7-idle-remainder-donors-t740/CLAIM.json @@ -0,0 +1,30 @@ +{ + "kappa": "17334270395898442347489999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017334270395898442347489999999999999999999998999999999999999999999999", + "binding": "bit (PR589 0.001733427039589844234749)", + "complex_root": [ + "17347705571115131604951/10000000000000000000000000", + "2168463196389391450619/1250000000000000000000000" + ], + "baseline": "PR3184 / PR3148 (open)", + "gain_over_pr3184": "1618989177996737327/500000000000000000000000", + "gain_over_pr3148": "3649544911247222863/1000000000000000000000000", + "profile": { + "1": 16353294, + "2": 4837720, + "3": 1533431, + "4": 679320, + "5": 147055, + "8": 53280, + "42": 32303, + "45": 34720, + "48": 48434, + "49": 47026, + "50": 15320, + "51": 104766 + }, + "T": 740, + "changed_hypothesis": "idle remainders of partially hosted bins donate axes (PR1252 rule) to unhosted idle children; receivers capped at 51", + "status": "author-checked conditional candidate; native admission, overlay-aware controller audit and bit-binding outer release not rerun", + "credits": "PR1252 Gonzalo-Mier; star class Gueorgui Maissouradze; PR3148 Jeremy Diviney; PR3133/PR3042 dcharb78; PR2979 Marius-Paul Dumitrean; OpenCode (Space bunny free); Anthropic Claude" +} \ No newline at end of file diff --git a/research/rank7-idle-remainder-donors-t740/MOVES.json.gz b/research/rank7-idle-remainder-donors-t740/MOVES.json.gz new file mode 100644 index 0000000000..e8401e6d13 Binary files /dev/null and b/research/rank7-idle-remainder-donors-t740/MOVES.json.gz differ diff --git a/research/rank7-idle-remainder-donors-t740/PR3148-PROVIDERS.json b/research/rank7-idle-remainder-donors-t740/PR3148-PROVIDERS.json new file mode 100644 index 0000000000..0b23436750 --- /dev/null +++ b/research/rank7-idle-remainder-donors-t740/PR3148-PROVIDERS.json @@ -0,0 +1,842 @@ +{ + "extra": { + "actual_paid_profile": { + "1": 2433, + "2": 724, + "3": 228, + "4": 102, + "5": 20, + "8": 8 + }, + "widths": [ + 9, + 9, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 9, + 8, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 8, + 7, + 7, + 7, + 7, + 8, + 9, + 8, + 9, + 6, + 6, + 7, + 7, + 7, + 7, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 6, + 6, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 6, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 7, + 7, + 6, + 6, + 9, + 8, + 9, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 9, + 8, + 9, + 8, + 7, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 7, + 6, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 5, + 5, + 8, + 8, + 8, + 8 + ] + }, + "gauge44": { + "actual_paid_profile": { + "1": 2433, + "2": 724, + "3": 228, + "4": 102, + "5": 20, + "8": 8 + }, + "widths": [ + 9, + 9, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 7, + 9, + 7, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 4, + 9, + 4, + 9, + 8, + 9, + 9, + 4, + 7, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 9, + 9, + 9, + 9, + 9, + 9, + 4, + 9, + 4, + 9, + 4, + 9, + 9, + 9, + 9, + 4, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 9, + 8, + 8, + 9, + 8, + 9, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 8, + 7, + 7, + 7, + 7, + 8, + 9, + 8, + 9, + 6, + 6, + 7, + 7, + 7, + 7, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 6, + 6, + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 6, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 8, + 7, + 8, + 8, + 9, + 9, + 9, + 9, + 8, + 8, + 8, + 8, + 7, + 7, + 6, + 6, + 9, + 8, + 9, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 9, + 8, + 9, + 8, + 7, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 6, + 7, + 6, + 7, + 7, + 7, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 5, + 5, + 8, + 8, + 8, + 8 + ] + } +} diff --git a/research/rank7-idle-remainder-donors-t740/README.md b/research/rank7-idle-remainder-donors-t740/README.md new file mode 100644 index 0000000000..7a26172c43 --- /dev/null +++ b/research/rank7-idle-remainder-donors-t740/README.md @@ -0,0 +1,128 @@ +# Idle-remainder donors on PR3148's T740 fill: the complex side passes the bit side; conditional κ = 0.001733427039589844234749 − 10⁻⁴⁶ − 10⁻⁷⁰ + +**Author-checked conditional candidate; not maintainer-reviewed.** The selected record on +`main` is still #1094. This package stacks on the open PR3148 (Jeremy Diviney) and extends +the idle-axis exchanges of PR3184. PR3133's words, the helper widths, and PR3148's fill rows, +order and dispatch are all unchanged. + +| | complex root lower (10⁻²⁵) | binding | κ headline | +|---|---|---|---| +| PR3148 | 0.0017297774946785970118869 | complex | 0.001729777494678597011886 − … | +| PR3184 (stars on fully idle 48s) | 0.0017301890612338507600957 | complex | 0.001730189061233850760095 − … | +| **this** | **0.0017347705571115131604951** | **bit (#589)** | **0.001733427039589844234749 − 10⁻⁴⁶ − 10⁻⁷⁰** | + +The gain is **+3.238e-6 (+0.187%) over PR3184** and +3.650e-6 over PR3148. The complex +supplier now exceeds the bit supplier's 0.001733427039589844234749, the constant pinned in the +T74 outer ledger. **The bit side binds, so κ is capped there.** + +## Changed hypothesis + +PR3184 moved axes only among *completely* idle capacity-48 children. But every bin that +helpers use only partially leaves an idle **remainder child**, whose axes are the recipe axes +`[used, cap)`. That holds for every hosted #1094 child: the hosted `IDLE-REMAINDER-FRAMES` equal +`orthogonal_axes[hosted:]`. PR3148's idle bill is `{1: 173160, 3: 48951, 5: 13875, 48: 282569}`. + +Removing a small child is far more valuable than reshaping 48s. Moving one axis from a rank-1 +remainder into a 48 removes `1·ln 73` of moment weight, against `0.18` for a whole +`48+48 → 45+51` pair. + +Here any remainder, hosted or not, may **donate** axes to a **fully idle (unhosted) receiver** +in the same replica and port. Each moved axis follows PR1252's rule: + +- it commutes with all of the receiver's axes at the time it moves; +- it commutes with every stage entry/exit X and Y translation and the terminal Y translation; +- it commutes with both children's terminal translations. + +Receivers stay at or below rank 51, so `73² = 5329 > 2·51² = 5202`. Moved axes come from the +donor's idle remainder, so they are orthogonal to its hosted prefix axes; the recipe sets are +orthonormal. Each group's axis multiset is unchanged. + +The construction runs in two phases: + +1. **Drain remainders.** Remainders are drained smallest first, one axis at a time, into the + largest legal receiver. +2. **Stars.** PR3184's exact star optimum runs on the untouched fully idle 48s. + +This produces 391,964 axis moves, from 138,369 donor children into 167,112 receivers. The idle +bill becomes: + +`{1:149514, 2:15880, 3:14951, 5:13855, 42:32303, 45:34720, 48:48434, 49:47026, 50:15320, 51:104766}` + +The rank mass is unchanged at `65088·740`. + +## Reproduce + +```sh +# PR3148's deterministic materializer (head f2927a4b) -> /tmp/t740 +python3 -B research/rank7-idle-remainder-donors-t740/build.py --t740 /tmp/t740 # ~20 s +python3 -B research/rank7-idle-remainder-donors-t740/verify.py --t740 /tmp/t740 # ~1 min +``` + +**Pinned inputs:** + +- DATA-PHASES (`c5916ff3…`) +- the decoded fill payload (`8f4d6965…`) +- ORDER (`927226d7…`) and DISPATCH (`90edc935…`) +- PR3148's provider widths (`PR3148-PROVIDERS.json`, `52eb0d85…`) + +The build reproduces PR3148's idle bill exactly. + +**`verify.py` does not import `build.py`.** It re-derives: + +- that donor axes lie in the donor's own remainder; +- that receivers are unhosted, and no child both donates and receives; +- the unit and orthogonal-at-receipt checks, and the commuting rule; +- the rank cap; +- the profile and rank mass; +- the complex root bracket, using its own interval arithmetic at 10⁻⁷²; +- `κ = min(floor₂₄(complex_lower), bit) − 10⁻⁴⁶ − 10⁻⁷⁰`, with gates against PR3148 and PR3184. + +It also rebinds BINS to the fill. Eight mutation controls are rejected: + +- a hosted receiver; +- an axis taken from the hosted prefix; +- a foreign axis; +- an axis moved twice; +- a receiver that also donates; +- a dropped move; +- the next root grid point; +- κ above the bit cap. + +## Scope and remaining obligations + +- **New hypothesis beyond PR1252/PR3184:** hosted remainders may donate. The moved axes are + orthogonal to the hosted prefix and obey the full commuting rule, but no hosted-controller + argument is given here. PR1252's admitted audit covered only unhosted pairs. +- **Not rerun:** PR3148/PR3133's native admission, the controller/owner audit (`audit_mixed.py` + must read the axis overlay) and the outer release. The outer ledger asserts + `complex < bit`, so a bit-binding release needs its ledger branch, and the halving pin + `[5329,4608]` must become `[5329,5202]`. +- Because the bit side now binds, further complex-side packing gains do not raise κ until the + bit supplier improves. All inherited all-size/compiler, realization, precision/tape, recovery + and analytic obligations remain. PR3148 itself is unreviewed. + +## Open next questions + +- **Is a hosted remainder a legal donor under the T74 controller contract?** PR1252's admitted + audit covered only unhosted children. First step: generalize the T74 `audit_mixed.py` + owner/controller audit to read this axis overlay and rerun PR3148's release. Blocked by: + the release chain has no overlay reader. +- **Can the bit supplier rise toward the new complex root 0.0017347706?** κ is now bit-bound, + so any bit gain up to about +1.34e-6 is realizable. First step: price the actual #589 bit + word with the moment-fee metric and search skip and carrier rewrites on it. + +## Credit + +- Gonzalo-Mier (PR1252): the move, the rule and the pricing. +- Guéorgui Maissouradze: the star class. +- Jeremy Diviney (PR3148): the fill. +- dcharb78 (PR3133, PR3042). +- Marius-Paul Dumitrean (PR2979). +- Jeremy Kothe (PR3015). +- Nick Petalas (PR3024). +- DreamingOfClouds and eumemic: the #589/#555 bit supplier. +- The data-phase and T37-envelope lineage. + +Prepared by Rohan Arun. Done with help from **OpenCode (Space bunny free)**, whose +partially-used-bin centre idea this package generalizes, and with Anthropic Claude assistance. +Apache-2.0. diff --git a/research/rank7-idle-remainder-donors-t740/RESULT.json b/research/rank7-idle-remainder-donors-t740/RESULT.json new file mode 100644 index 0000000000..2bbb2926bb --- /dev/null +++ b/research/rank7-idle-remainder-donors-t740/RESULT.json @@ -0,0 +1,55 @@ +{ + "status": "PASS_IDLE_REMAINDER_DONOR_EXCHANGES_T740", + "T": 740, + "axis_moves": 391964, + "donor_children": 138369, + "receiver_children": 167112, + "idle_before": { + "1": 173160, + "3": 48951, + "5": 13875, + "48": 282569 + }, + "idle_after": { + "1": 149514, + "2": 15880, + "3": 14951, + "5": 13855, + "42": 32303, + "45": 34720, + "48": 48434, + "49": 47026, + "50": 15320, + "51": 104766 + }, + "profile": { + "1": 16353294, + "2": 4837720, + "3": 1533431, + "4": 679320, + "5": 147055, + "8": 53280, + "42": 32303, + "45": 34720, + "48": 48434, + "49": 47026, + "50": 15320, + "51": 104766 + }, + "complex_root": [ + "17347705571115131604951/10000000000000000000000000", + "2168463196389391450619/1250000000000000000000000" + ], + "complex_root_decimal": "17347705571115131604951e-25", + "bit": "1733427039589844234749/1000000000000000000000000", + "binding": "bit", + "kappa": "17334270395898442347489999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017334270395898442347489999999999999999999998999999999999999999999999", + "gain_over_pr3184": "1618989177996737327/500000000000000000000000", + "gain_over_pr3148": "3649544911247222863/1000000000000000000000000", + "max_child_rank": 51, + "halving": [ + 5329, + 5202 + ] +} diff --git a/research/rank7-idle-remainder-donors-t740/SOURCES.json b/research/rank7-idle-remainder-donors-t740/SOURCES.json new file mode 100644 index 0000000000..b6bd6d61d4 --- /dev/null +++ b/research/rank7-idle-remainder-donors-t740/SOURCES.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "research/adaptive-kernel-demotion/inputs/DATA-PHASES.json", + "usage": "input", + "git_blob": "d9a4f84211182ca200c081ea061d724c8a2cfb70", + "sha256": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa" + }, + { + "path": "research/frontier1094-idle-star-ceiling/README.md", + "usage": "provenance", + "git_blob": "dc62e4569948a9e10bb1c72731a9ddfdc81fe0cd", + "sha256": "2f640127f48be627f10a8db1d224d8a75219772525b3c0d5d3251dc8dc57b121" + } + ] +} diff --git a/research/rank7-idle-remainder-donors-t740/TASK.json b/research/rank7-idle-remainder-donors-t740/TASK.json new file mode 100644 index 0000000000..4fabb8702b --- /dev/null +++ b/research/rank7-idle-remainder-donors-t740/TASK.json @@ -0,0 +1,78 @@ +{ + "schema_version": 1, + "task_id": "selected-packing", + "priority_revision": 6, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "original_card": { + "id": "selected-packing", + "question": "Is there a genuinely unsearched, explicitly bounded improvement to the selected packing?", + "starting_points": [ + "certificates/selected-result.json", + "research/heterogeneous-owner-assembly/README.md", + "research/complex-local-word-ceiling/README.md" + ], + "methods": [ + "Search a named unclaimed canonical candidate domain with a reproducible partition.", + "Prove a stronger scoped relaxation or exact optimum for one named residual subproblem." + ], + "acceptance_gate": "Check live PR overlap first, price both suppliers and distinguish a search best from an optimum. Report the word's packing cap from ceiling.ceiling() and the fraction of it realized; label packing gains as such.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Locate the selected packing source in the review and check live PRs for the same residual problem.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Define an unclaimed canonical domain and a favorable bound before starting a new search.", + "bottleneck_link": "An actual paid-profile gain can improve the frontier up to the other supplier cap.", + "allowed_variations": [ + "One bounded residual packing instance or exact relaxation.", + "If the coverage law, template or guard changes, derive an applicable fully charged replacement bound instead of applying the incumbent ceiling outside its scope." + ], + "scope_change_triggers": [ + "Rerunning an existing search with only a different seed as a separate mathematical contribution." + ], + "overlap_terms": [ + "T16", + "owner exchange", + "packing" + ], + "existing_checks": [ + { + "scope": "Packing-independent ceiling for the selected paid profile under the one-unpaid-coordinate coverage and halving guard.", + "evidence": "docs/research/community-efficient1000-review.md", + "remaining": "A changed word or model requires new pricing; a local packing search must name uncovered scope.", + "status": "reviewed", + "source_commit": "836b19bfa309ceafbc8ee32a15e8c4b10dde7e11", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Changed residual subproblem on the open PR3148 T740 fill of PR3133's words (not the selected #1094 packing): idle remainders of partially hosted and fully idle bins donate axes under PR1252's commuting rule to unhosted idle children of the same (replica, port), receivers capped at rank 51, followed by PR3184's star optimum.", + "scope_change_reason": "The card targets the selected packing; this applies the same idle-repartition mechanism (PR1252 / frontier1094-idle-star-ceiling) to the open rank-seven T740 line, whose relaxation cap charges one idle child per bin.", + "bottleneck_link": "Repartitioning idle children changes the paid histogram and so moves the exact complex endpoint.", + "budget_minutes": 120, + "stop_rule": "Stop after the exact overlay, pricing and an independent structural verifier; no controller/outer admission in this session.", + "outcome": "partial", + "evidence": "RESULT.json, BINS.json.gz, MOVES.json.gz (391,964 axis moves), AUDIT.json (8/8 controls rejected).", + "author": "Rohan Arun", + "ai_assistance": "Substantial Anthropic Claude (Claude Code) assistance; idea seeded with help from OpenCode (Space bunny free).", + "open_questions": [ + { + "question": "Is a hosted bin's idle remainder a legal donor under the T74 controller contract?", + "why_it_matters": "PR1252's admitted audit covered only unhosted children; this package relies on orthogonality to the hosted prefix plus the commuting rule.", + "first_step": "Generalize the T74 audit_mixed.py owner/controller audit to read the axis overlay and rerun its controls on PR3148's release.", + "blocked_by": "The T74 release chain has no idle-axis overlay reader." + }, + { + "question": "Can the bit supplier rise toward the new complex root 0.0017347706?", + "why_it_matters": "kappa is now bit-bound; any bit gain up to about +1.34e-6 is realizable.", + "first_step": "Price the actual #589 bit word with the moment-fee metric and search skip/carrier rewrites on it.", + "blocked_by": "Bit word rewrite tooling." + } + ] +} diff --git a/research/rank7-idle-remainder-donors-t740/VERIFY.json b/research/rank7-idle-remainder-donors-t740/VERIFY.json new file mode 100644 index 0000000000..6639640214 --- /dev/null +++ b/research/rank7-idle-remainder-donors-t740/VERIFY.json @@ -0,0 +1,20 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/adaptive-kernel-demotion/inputs/DATA-PHASES.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 300, + "checks": "Independent of build.py: donor axes from the donor's own remainder, unhosted receivers, no child both donates and receives, unit/orthogonal-at-receipt and commuting rule, rank cap 51, group multisets, profile and rank mass, exact complex root bracket with its own interval arithmetic, kappa = min(floor24(complex), PR589 bit) - 1e-46 - 1e-70 and gates over PR3148/PR3184; 8 mutation controls rejected." + } + ] +} diff --git a/research/rank7-idle-remainder-donors-t740/build.py b/research/rank7-idle-remainder-donors-t740/build.py new file mode 100644 index 0000000000..87ccf74f2b --- /dev/null +++ b/research/rank7-idle-remainder-donors-t740/build.py @@ -0,0 +1,209 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Idle-remainder donor exchanges on PR3148's T740 fill of PR3133's words. + +Every idle remainder of a (replica, port) - including the remainder of a partially hosted bin, +whose axes are the recipe axes [used, cap) - may donate axes to a fully idle (unhosted) child of +the same replica and port. Each moved axis obeys PR1252's commuting rule (commutes with all of the +receiver's current axes, every stage entry/exit X and Y translation, the terminal Y translation and +both children's terminal translations). Receivers are capped at rank 51 (73^2 > 2*51^2). +Phase 1 drains remainders smallest-first into the largest legal receiver; phase 2 runs the +frontier1094 star optimum (PR3184) on the untouched fully idle rank-48 children. + +Inputs (pinned): DATA-PHASES.json on main; PR3148's materialized COMPOSED-FILL/ORDER/DISPATCH and +its PR3133 provider widths (PR3148-PROVIDERS.json, copied from PR3148 vendor/). +""" +import argparse, gzip, hashlib, itertools, json, math +from collections import Counter, defaultdict +from fractions import Fraction as Q +from pathlib import Path + +HERE = Path(__file__).resolve().parent +PHASES = HERE.parents[1] / 'research/adaptive-kernel-demotion/inputs/DATA-PHASES.json' +PIN = dict(phases='c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa', + fill_payload='8f4d6965ba573ff2b71fd7bf6b552643e086739d90bd73c55889502077638e00', + order='927226d702bf3cada076f4c459da9063c0df7e7154a62955cf75c40cf30215b9', + dispatch='90edc935320dd6264e98dc735d868df3c95f5901c70d7d96171001fcb295cce0', + providers='52eb0d85caa7b2d4a93acdf5011f52b793f61ddca86235fb03cd9a09397ad4cd') +T = 740 +LOCAL = {1: 2433, 2: 724, 3: 228, 4: 102, 5: 20, 8: 8} +IDLE_PR3148 = {1: 173160, 3: 48951, 5: 13875, 48: 282569} +BIT = Q('0.001733427039589844234749') # PR589 bit saving, as pinned in the T74 outer ledger +PR3148_KAPPA = Q('0.0017297774946785970118859999999999999999999998999999999999999999999999') +PR3184_KAPPA = Q('0.0017301890612338507600949999999999999999999998999999999999999999999999') + + +def need(ok, why): + if not ok: raise SystemExit('FAIL: ' + why) + + +def sha(b): return hashlib.sha256(b).hexdigest() +def dot(a, b): return (a & b).bit_count() & 1 +def Hf(r): return 0.0 if r == 0 else r * (73.0 / r) ** 0.00173 + + +def pgz(obj): + d = bytearray(gzip.compress(json.dumps(obj, sort_keys=True, separators=(',', ':')).encode(), mtime=0)); d[9] = 255 + return bytes(d) + + +# ---- exact root (rational intervals, directed rounding 1e-60) ---- +S = 10 ** 60 +def dn(x): return Q(math.floor(x * S), S) +def upr(x): return Q(math.ceil(x * S), S) +def atanh2(z, n): + s, p = Q(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) +L2 = atanh2(Q(1, 3), 120) +LN = {} +def lnr(r): + if r not in LN: + x, k = Q(73, r), 0 + while x > 2: x /= 2; k += 1 + a, e = atanh2((x - 1) / (x + 1), 80) + LN[r] = (dn(a + k * L2[0]), upr(a + e + k * (L2[0] + L2[1]))) + return LN[r] +def ex(x0, x1): + def ser(x): + s, t = Q(0), Q(1) + for n in range(1, 40): s += t; t = t * x / n + return s, t + a, _ = ser(x0); b, t = ser(x1) + return dn(a), upr(b + 2 * t) +def moment(prof, b): + W = 896 * T; lo = hi = Q(0) + for r, n in prof.items(): + l0, l1 = lnr(r); e0, e1 = ex(b * l0, b * l1); lo += n * r * e0; hi += n * r * e1 + return lo / (73 * W), hi / (73 * W) +def root(prof, digits=25): + f = lambda b: sum(n * r * (73 / r) ** b for r, n in prof.items()) / (73 * 896 * T) - 1 + a, c = 0.0, 0.01 + for _ in range(200): + m = (a + c) / 2 + if f(m) < 0: a = m + else: c = m + g = 10 ** digits; k0, k1 = int(a * g) - 10 ** 10, int(a * g) + 10 ** 10 + need(moment(prof, Q(k0, g))[1] < 1 and moment(prof, Q(k1, g))[0] > 1, 'bracket') + while k1 - k0 > 1: + k = (k0 + k1) // 2; lo, hi = moment(prof, Q(k, g)) + if hi < 1: k0 = k + elif lo > 1: k1 = k + else: raise SystemExit('wide interval') + return Q(k0, g), Q(k1, g) + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--t740', type=Path, required=True, help='directory written by PR3148 materialize.py') + a = ap.parse_args() + raw = PHASES.read_bytes(); need(sha(raw) == PIN['phases'], 'phases pin') + rec = {r['port']: r for r in json.loads(raw)['recipes']} + fraw = gzip.decompress((a.t740 / 'COMPOSED-FILL.json.gz').read_bytes()); need(sha(fraw) == PIN['fill_payload'], 'fill pin') + need(sha((a.t740 / 'ORDER.json').read_bytes()) == PIN['order'] and sha((a.t740 / 'DISPATCH.json').read_bytes()) == PIN['dispatch'], 'order/dispatch pins') + praw = (HERE / 'PR3148-PROVIDERS.json').read_bytes(); need(sha(praw) == PIN['providers'], 'providers pin') + prov = json.loads(praw); order = json.loads((a.t740 / 'ORDER.json').read_bytes()) + disp = {(s, r): p for s, r, p in json.loads((a.t740 / 'DISPATCH.json').read_bytes())} + fill = json.loads(fraw) + need(fill['columns'] == ['time', 'helper', 'owner_replica', 'child', 'port', 'offset'] and fill['dispatch_overrides'] == [], 'fill format') + caps = {(p, c): ch['rank'] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + AX = {(p, c): [int(v) for v in ch['orthogonal_axes']] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + TR = {(p, c): int(ch['translation_after']) for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + PT = {p: [int(s[k]) for s in rc['stage_alignment'] for k in ('entry_Y', 'exit_Y', 'entry_X', 'exit_X')] + [int(rc['terminal_Y_translation'])] for p, rc in rec.items()} + used, top = Counter(), Counter() + for time, helper, rep, child, port, offset in fill['rows']: + s, r = order[time]; w = prov[disp[s, r]]['widths'][helper] + used[rep, child, port] += w; top[rep, child, port] = max(top[rep, child, port], offset + w) + need(all(used[k] == top[k] for k in used), 'compact helper prefixes') + groups = [] + for rep in range(T): + for p in range(112): + kids = [[c, used[rep, c, p]] for c in range(len(rec[p]['idle_children'])) if caps[p, c] - used[rep, c, p] > 0] + groups.append([rep, p, kids]) + idle = Counter(caps[p, c] - u for _, p, kids in groups for c, u in kids) + need(dict(idle) == IDLE_PR3148, 'idle bill equals PR3148') + + def legal(v, p, c, d, axes_d): + return all(dot(v, x) == 0 for x in axes_d) and all(dot(v, x) == 0 for x in PT[p]) and dot(v, TR[p, c]) == 0 and dot(v, TR[p, d]) == 0 + + def solve(p, kids): + rank = {c: caps[p, c] - u for c, u in kids}; axes = {c: AX[p, c][u:caps[p, c]] for c, u in kids} + hosted = {c: u > 0 for c, u in kids}; role = {c: None for c, _ in kids}; moves = [] + for c in sorted([c for c, u in kids if u > 0], key=lambda c: (rank[c], c)): + for v in list(axes[c]): + best = None + for d in sorted([d for d, _ in kids if not hosted[d] and role[d] != 'D' and d != c and rank[d] < 51], key=lambda d: (-rank[d], d)): + if rank[d] < rank[c] - 1: break + if legal(v, p, c, d, axes[d]): best = d; break + if best is None or Hf(rank[c] - 1) + Hf(rank[best] + 1) - Hf(rank[c]) - Hf(rank[best]) >= 0: continue + axes[c].remove(v); axes[best].append(v); rank[c] -= 1; rank[best] += 1 + role[c] = 'D'; role[best] = 'R'; moves.append([c, best, v]) + free = [c for c, u in kids if u == 0 and role[c] is None and caps[p, c] == 48] + if len(free) >= 2: + MV = {(d, r): [v for v in axes[d] if legal(v, p, d, r, axes[r])] for d in free for r in free if d != r} + best = [len(free) * Hf(48), []] + def match(c, leaves): + opts = [MV[c, l] for l in leaves] + if any(len(o) < 3 for o in opts): return None + def go(k, usedax): + if k == len(leaves): return [] + for trip in itertools.combinations([v for v in opts[k] if v not in usedax], 3): + rest = go(k + 1, usedax | set(trip)) + if rest is not None: return [(c, leaves[k], list(trip))] + rest + return None + return go(0, set()) + def assign(i, roles): + if i == len(free): + leaves = defaultdict(list) + for c in free: + if isinstance(roles[c], tuple): leaves[roles[c][1]].append(c) + cents = [c for c in free if roles[c] == 'c'] + if any(not leaves[c] for c in cents) or any(roles[x] != 'c' for x in leaves): return + mv = [] + for c in cents: + m = match(c, leaves[c]) + if m is None: return + mv += m + rk = [48 - 3 * len(leaves[c]) if roles[c] == 'c' else 51 if isinstance(roles[c], tuple) else 48 for c in free] + cost = sum(Hf(x) for x in rk) + if cost < best[0] - 1e-12: best[0], best[1] = cost, mv + return + c = free[i] + for opt in ['n', 'c'] + [('l', d) for d in free if d != c]: + roles[c] = opt; assign(i + 1, roles) + del roles[c] + assign(0, {}) + for c, l, trip in best[1]: + for v in trip: + axes[c].remove(v); axes[l].append(v); rank[c] -= 1; rank[l] += 1; moves.append([c, l, v]) + return moves, rank + + cache, moves, final = {}, [], Counter() + for rep, p, kids in groups: + key = (p, tuple(map(tuple, kids))) + if key not in cache: cache[key] = solve(p, kids) + mv, rank = cache[key] + moves += [[rep, p] + m for m in mv] + final.update(r for r in rank.values() if r) + prof = Counter({r: n * 9 * T for r, n in LOCAL.items()}); prof.update(final); prof = dict(sorted(prof.items())) + need(sum(r * n for r, n in prof.items()) == 65088 * T and 73 * 73 > 2 * max(prof) ** 2, 'mass and halving') + lo, hi = root(prof) + C = min(Q(math.floor(lo * 10 ** 24), 10 ** 24), BIT) + kappa = C - Q(1, 10 ** 46) - Q(1, 10 ** 70) + need(kappa > PR3184_KAPPA > PR3148_KAPPA, 'gates') + (HERE / 'BINS.json.gz').write_bytes(pgz(dict(T=T, columns=['replica', 'port', [['child', 'used']]], groups=[g for g in groups if g[2]]))) + (HERE / 'MOVES.json.gz').write_bytes(pgz(dict(columns=['replica', 'port', 'donor_child', 'receiver_child', 'axis'], moves=moves))) + donors = Counter(); + res = dict(status='PASS_IDLE_REMAINDER_DONOR_EXCHANGES_T740', T=T, axis_moves=len(moves), + donor_children=len({(m[0], m[1], m[2]) for m in moves}), receiver_children=len({(m[0], m[1], m[3]) for m in moves}), + idle_before={str(k): v for k, v in IDLE_PR3148.items()}, idle_after={str(k): v for k, v in sorted(final.items())}, + profile={str(k): v for k, v in prof.items()}, complex_root=[str(lo), str(hi)], + complex_root_decimal=f'{lo.numerator * 10**25 // lo.denominator}e-25', bit=str(BIT), binding='bit' if BIT < lo else 'complex', + kappa=str(kappa), kappa_decimal='0.0017334270395898442347489999999999999999999998999999999999999999999999', gain_over_pr3184=str(kappa - PR3184_KAPPA), gain_over_pr3148=str(kappa - PR3148_KAPPA), + max_child_rank=max(prof), halving=[5329, 2 * max(prof) ** 2]) + (HERE / 'RESULT.json').write_text(json.dumps(res, indent=1) + '\n') + print('PASS', float(lo), res['binding'], float(kappa), float(kappa - PR3184_KAPPA), len(moves)) + + +if __name__ == '__main__': + main() diff --git a/research/rank7-idle-remainder-donors-t740/verify.py b/research/rank7-idle-remainder-donors-t740/verify.py new file mode 100644 index 0000000000..ca607d6a86 --- /dev/null +++ b/research/rank7-idle-remainder-donors-t740/verify.py @@ -0,0 +1,179 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Independent verifier (does not import build.py) for the idle-remainder donor exchanges. + +Re-derives from BINS / MOVES / DATA-PHASES: donor axes come from the donor's own idle remainder +(recipe axes [used, cap)); receivers are unhosted (used == 0); no child both donates and receives; +every moved axis is a unit vector orthogonal to all of the receiver's axes held at that moment and +commutes with every stage entry/exit X/Y translation, the terminal Y translation and both +children's terminal translations; final ranks <= 51; per-group axis multisets unchanged; the +complete profile and rank mass; an exact complex root bracket with its own interval arithmetic; +kappa = min(floor24(complex_lower), PR589 bit) - 1e-46 - 1e-70 and its gates. +Optional --t740 rebinds BINS to PR3148's materialized fill. Mutation controls must be rejected. +""" +import argparse, copy, gzip, hashlib, json +from collections import Counter, defaultdict +from fractions import Fraction as F +from pathlib import Path + +PKG = Path(__file__).resolve().parent +PHASES = PKG.parents[1] / 'research/adaptive-kernel-demotion/inputs/DATA-PHASES.json' +T = 740 +LOCAL = {1: 2433, 2: 724, 3: 228, 4: 102, 5: 20, 8: 8} +IDLE = {1: 173160, 3: 48951, 5: 13875, 48: 282569} +BIT = F('0.001733427039589844234749') +GATES = dict(PR3148=F('0.0017297774946785970118859999999999999999999998999999999999999999999999'), + PR3184=F('0.0017301890612338507600949999999999999999999998999999999999999999999999')) + + +class Reject(Exception): pass +def req(ok, why): + if not ok: raise Reject(why) +def load(p): + b = Path(p).read_bytes(); return json.loads(gzip.decompress(b) if b[:2] == b'\x1f\x8b' else b) +def par(a, b): return bin(a & b).count('1') & 1 + + +def audit(rec, bins, moves): + caps = {(p, c): ch['rank'] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + G = {} + for rep, p, kids in bins['groups']: + req((rep, p) not in G and 0 <= rep < T and p in rec, 'group key') + G[rep, p] = {c: u for c, u in kids} + req(all(0 <= u < caps[p, c] for c, u in kids), 'used below capacity') + req(Counter(caps[p, c] - u for (rep, p), kids in G.items() for c, u in kids.items()) == Counter(IDLE), 'idle bill') + trans = {} + for p, rc in rec.items(): + trans[p] = {int(s[k]) for s in rc['stage_alignment'] for k in ('entry_X', 'exit_X', 'entry_Y', 'exit_Y')} | {int(rc['terminal_Y_translation'])} + for c, ch in enumerate(rc['idle_children']): + ax = [int(v) for v in ch['orthogonal_axes']] + req(all(par(v, v) == 1 for v in ax) and all(par(a, b) == 0 for i, a in enumerate(ax) for b in ax[i + 1:]), 'recipe axes orthonormal') + state = {} + def cur(rep, p, c): + k = (rep, p, c) + if k not in state: + u = G[rep, p][c]; state[k] = dict(axes=set(int(v) for v in rec[p]['idle_children'][c]['orthogonal_axes'][u:caps[p, c]]), role=None) + return state[k] + for m in moves: + rep, p, c, d, v = m + req((rep, p) in G and c in G[rep, p] and d in G[rep, p] and c != d, 'children of the group') + req(G[rep, p][d] == 0, 'receiver must be unhosted') + sc, sd = cur(rep, p, c), cur(rep, p, d) + req(sc['role'] != 'R' and sd['role'] != 'D', 'child both donates and receives') + own = set(int(x) for x in rec[p]['idle_children'][c]['orthogonal_axes'][G[rep, p][c]:caps[p, c]]) + req(v in sc['axes'] and v in own, 'axis not in donor remainder') + req(par(v, v) == 1 and all(par(v, x) == 0 for x in sd['axes']), 'axis not orthogonal to receiver axes') + tc = int(rec[p]['idle_children'][c]['translation_after']); td = int(rec[p]['idle_children'][d]['translation_after']) + req(all(par(v, x) == 0 for x in trans[p] | {tc, td}), 'axis does not commute with translations') + sc['axes'].discard(v); sd['axes'].add(v); sc['role'] = 'D'; sd['role'] = 'R' + req(len(sd['axes']) <= 51, 'rank above 51') + final = Counter() + for (rep, p), kids in G.items(): + for c, u in kids.items(): + r = len(state[rep, p, c]['axes']) if (rep, p, c) in state else caps[p, c] - u + if r: final[r] += 1 + return final + + +def mom(prof, b): + Q72 = 10 ** 72 + def rd(x): return F(x.numerator * Q72 // x.denominator, Q72) + def ru(x): return F(-((-x.numerator * Q72) // x.denominator), Q72) + def at(z, n): + s, p = F(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) + l2 = at(F(1, 3), 130); W = 896 * T; lo = hi = F(0) + for r, n in sorted(prof.items()): + y, k = F(73, r), 0 + while y >= 2: y /= 2; k += 1 + a, e = at((y - 1) / (y + 1), 90) + L0, L1 = rd(a + k * l2[0]), ru(a + e + k * (l2[0] + l2[1])) + def tay(x): + s, t = F(1), F(1) + for j in range(1, 34): t = t * x / j; s += t + return s, t * x / 34 * 3 + e0, _ = tay(b * L0); e1, t1 = tay(b * L1) + lo += n * r * rd(e0); hi += n * r * ru(e1 + t1) + return lo / (73 * W), hi / (73 * W) + + +def run(rec, bins, moves, result): + final = audit(rec, bins, moves) + prof = Counter({r: n * 9 * T for r, n in LOCAL.items()}); prof.update(final); prof = dict(sorted(prof.items())) + req({str(k): v for k, v in prof.items()} == result['profile'], 'declared profile') + req(sum(r * n for r, n in prof.items()) == 65088 * T, 'rank mass 65088*T') + req(max(prof) <= 51 and 73 * 73 > 2 * max(prof) ** 2, 'halving guard') + lo, hi = F(result['complex_root'][0]), F(result['complex_root'][1]) + req(hi - lo == F(1, 10 ** 25) and mom(prof, lo)[1] < 1 and mom(prof, hi)[0] > 1, 'complex root bracket') + C = min(F(lo.numerator * 10 ** 24 // lo.denominator, 10 ** 24), BIT) + kappa = C - F(1, 10 ** 46) - F(1, 10 ** 70) + req(kappa == F(result['kappa']), 'headline kappa') + for n, g in GATES.items(): req(kappa > g, 'kappa must exceed ' + n) + return prof, kappa, lo + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--t740', type=Path) + ap.add_argument('--providers', type=Path, default=PKG / 'PR3148-PROVIDERS.json') + ap.add_argument('--write', action='store_true', help='rewrite the committed AUDIT.json receipt') + a = ap.parse_args() + if not __debug__: raise SystemExit('assertions required') + raw = PHASES.read_bytes() + req(hashlib.sha256(raw).hexdigest() == 'c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa', 'phases pin') + rec = {r['port']: r for r in json.loads(raw)['recipes']} + bins, mv, result = load(PKG / 'BINS.json.gz'), load(PKG / 'MOVES.json.gz')['moves'], load(PKG / 'RESULT.json') + rebound = False + if a.t740: + fraw = gzip.decompress((a.t740 / 'COMPOSED-FILL.json.gz').read_bytes()) + req(hashlib.sha256(fraw).hexdigest() == '8f4d6965ba573ff2b71fd7bf6b552643e086739d90bd73c55889502077638e00', 'fill pin') + prov = load(a.providers); order = load(a.t740 / 'ORDER.json'); disp = {(s, r): p for s, r, p in load(a.t740 / 'DISPATCH.json')} + used = Counter() + for time, helper, rep, child, port, offset in json.loads(fraw)['rows']: + s, r = order[time]; used[rep, child, port] += prov[disp[s, r]]['widths'][helper] + caps = {(p, c): ch['rank'] for p, r in rec.items() for c, ch in enumerate(r['idle_children'])} + derived = [[rep, p, [[c, used[rep, c, p]] for c in range(len(rec[p]['idle_children'])) if caps[p, c] - used[rep, c, p] > 0]] for rep in range(T) for p in range(112)] + req([g for g in derived if g[2]] == bins['groups'], 'BINS equal the fill') + rebound = True + prof, kappa, lo = run(rec, bins, mv, result) + rej = {} + first_hosted = next(i for i, m in enumerate(mv) if {c: u for c, u in next(g for g in bins['groups'] if g[0] == m[0] and g[1] == m[1])[2]}[m[2]] > 0) + rep, p, c, d, v = mv[first_hosted] + kids = {cc: u for cc, u in next(g for g in bins['groups'] if g[0] == rep and g[1] == p)[2]} + hosted_other = next((cc for cc, u in kids.items() if u > 0 and cc != c), None) + used_axis = int(rec[p]['idle_children'][c]['orthogonal_axes'][0]) + def mut(f): + x = copy.deepcopy(mv); f(x); return x + cases = dict( + hosted_receiver=mut(lambda x: x.__setitem__(first_hosted, [rep, p, c, hosted_other if hosted_other is not None else c, v])), + hosted_axis_from_used_prefix=mut(lambda x: x.__setitem__(first_hosted, [rep, p, c, d, used_axis])), + foreign_axis=mut(lambda x: x.__setitem__(first_hosted, [rep, p, c, d, 1 << 80])), + axis_moved_twice=mut(lambda x: x.insert(first_hosted + 1, list(x[first_hosted]))), + receiver_donates=mut(lambda x: x.append([rep, p, d, c, v])), + dropped_move=mut(lambda x: x.pop(first_hosted)), + ) + for name, x in cases.items(): + try: run(rec, bins, x, result) + except Reject as e: rej[name] = str(e) + else: raise SystemExit('mutation accepted: ' + name) + r2 = copy.deepcopy(result); r2['complex_root'] = [str(lo + F(1, 10 ** 25)), str(lo + F(2, 10 ** 25))] + try: run(rec, bins, mv, r2) + except Reject as e: rej['next_root_grid'] = str(e) + else: raise SystemExit('mutation accepted: next_root_grid') + r3 = copy.deepcopy(result); r3['kappa'] = str(F(result['kappa']) + F(1, 10 ** 24)) + try: run(rec, bins, mv, r3) + except Reject as e: rej['kappa_above_bit'] = str(e) + else: raise SystemExit('mutation accepted: kappa_above_bit') + out = dict(status='PASS_IDLE_REMAINDER_DONOR_AUDIT', moves=len(mv), fill_rebound=rebound, kappa=str(kappa), + complex_root_lower=str(lo), binding='bit' if BIT < lo else 'complex', rejected_controls=rej) + if a.write: (PKG / 'AUDIT.json').write_text(json.dumps(out, indent=1, sort_keys=True) + '\n') + else: + strip = lambda d: {k: v for k, v in d.items() if k != 'fill_rebound'} + req(strip(load(PKG / 'AUDIT.json')) == strip(json.loads(json.dumps(out))), 'committed AUDIT.json receipt') + print('PASS_IDLE_REMAINDER_DONOR_AUDIT moves=%d controls=%d kappa=%s binding=%s' % (len(mv), len(rej), float(kappa), out['binding'])) + + +if __name__ == '__main__': + try: main() + except Reject as e: raise SystemExit('FAIL: ' + str(e)) diff --git a/research/rank7-pooled-r438-bit/ALLOC-R438.json.gz b/research/rank7-pooled-r438-bit/ALLOC-R438.json.gz new file mode 100644 index 0000000000..ad3e84f8b7 Binary files /dev/null and b/research/rank7-pooled-r438-bit/ALLOC-R438.json.gz differ diff --git a/research/rank7-pooled-r438-bit/CLAIM.json b/research/rank7-pooled-r438-bit/CLAIM.json new file mode 100644 index 0000000000..eeeab41a4c --- /dev/null +++ b/research/rank7-pooled-r438-bit/CLAIM.json @@ -0,0 +1,14 @@ +{ + "kappa": "17348651784727109982329999999999999999999998999999999999999999999999/10000000000000000000000000000000000000000000000000000000000000000000000", + "kappa_decimal": "0.0017348651784727109982329999999999999999999998999999999999999999999999", + "binding": "complex", + "bit_pooled": "1734900431583947157341/1000000000000000000000000", + "bit_pooled_decimal": "0.001734900431583947157341", + "complex_root": [ + "17348651784727109982331/10000000000000000000000000", + "17348651784727109982332/10000000000000000000000000" + ], + "gain_over_pr3934": "9457176255923379/500000000000000000000000", + "gain_over_pr3934_percent": 0.001090261016381119, + "credits": "PR1043 Ali Romman; PR2423 Sagar Thakrar; PR1281 mightyOil (pooled32 optimum); seed72/seed14 windows and placement; PR3934 stack; Anthropic Claude" +} \ No newline at end of file diff --git a/research/rank7-pooled-r438-bit/POOL-MOVES.json b/research/rank7-pooled-r438-bit/POOL-MOVES.json new file mode 100644 index 0000000000..f219f9564c --- /dev/null +++ b/research/rank7-pooled-r438-bit/POOL-MOVES.json @@ -0,0 +1,530 @@ +{ + "alloc_sha256": "1ef76bb87f1cfac7b4281c308bd71064c1fb1b6b4b267cfe9f3290212a5de11e", + "moves": [ + { + "stage": 6, + "call_replica": 0, + "helper": 425, + "old": { + "family": 211, + "child": 6, + "offset": 0 + }, + "new": { + "family": 212, + "child": 6, + "offset": 0 + } + }, + { + "stage": 6, + "call_replica": 0, + "helper": 426, + "old": { + "family": 222, + "child": 7, + "offset": 0 + }, + "new": { + "family": 212, + "child": 6, + "offset": 8 + } + }, + { + "stage": 6, + "call_replica": 0, + "helper": 427, + "old": { + "family": 222, + "child": 7, + "offset": 8 + }, + "new": { + "family": 212, + "child": 6, + "offset": 16 + } + }, + { + "stage": 6, + "call_replica": 0, + "helper": 428, + "old": { + "family": 222, + "child": 7, + "offset": 16 + }, + "new": { + "family": 212, + "child": 6, + "offset": 24 + } + }, + { + "stage": 6, + "call_replica": 1, + "helper": 425, + "old": { + "family": 1099, + "child": 6, + "offset": 0 + }, + "new": { + "family": 212, + "child": 6, + "offset": 32 + } + }, + { + "stage": 6, + "call_replica": 2, + "helper": 425, + "old": { + "family": 1987, + "child": 6, + "offset": 0 + }, + "new": { + "family": 1100, + "child": 6, + "offset": 0 + } + }, + { + "stage": 6, + "call_replica": 3, + "helper": 425, + "old": { + "family": 2875, + "child": 6, + "offset": 0 + }, + "new": { + "family": 1100, + "child": 6, + "offset": 8 + } + }, + { + "stage": 6, + "call_replica": 4, + "helper": 425, + "old": { + "family": 3763, + "child": 6, + "offset": 0 + }, + "new": { + "family": 1100, + "child": 6, + "offset": 16 + } + }, + { + "stage": 6, + "call_replica": 5, + "helper": 425, + "old": { + "family": 4651, + "child": 6, + "offset": 0 + }, + "new": { + "family": 1100, + "child": 6, + "offset": 24 + } + }, + { + "stage": 6, + "call_replica": 6, + "helper": 425, + "old": { + "family": 5539, + "child": 6, + "offset": 0 + }, + "new": { + "family": 1100, + "child": 6, + "offset": 32 + } + }, + { + "stage": 6, + "call_replica": 7, + "helper": 425, + "old": { + "family": 6427, + "child": 6, + "offset": 0 + }, + "new": { + "family": 1988, + "child": 6, + "offset": 0 + } + }, + { + "stage": 6, + "call_replica": 8, + "helper": 425, + "old": { + "family": 7315, + "child": 6, + "offset": 0 + }, + "new": { + "family": 1988, + "child": 6, + "offset": 8 + } + }, + { + "stage": 6, + "call_replica": 9, + "helper": 425, + "old": { + "family": 8203, + "child": 6, + "offset": 0 + }, + "new": { + "family": 1988, + "child": 6, + "offset": 16 + } + }, + { + "stage": 6, + "call_replica": 10, + "helper": 425, + "old": { + "family": 9091, + "child": 6, + "offset": 0 + }, + "new": { + "family": 1988, + "child": 6, + "offset": 24 + } + }, + { + "stage": 6, + "call_replica": 11, + "helper": 425, + "old": { + "family": 9979, + "child": 6, + "offset": 0 + }, + "new": { + "family": 1988, + "child": 6, + "offset": 32 + } + }, + { + "stage": 6, + "call_replica": 12, + "helper": 425, + "old": { + "family": 10867, + "child": 6, + "offset": 0 + }, + "new": { + "family": 2876, + "child": 6, + "offset": 0 + } + }, + { + "stage": 6, + "call_replica": 13, + "helper": 425, + "old": { + "family": 11755, + "child": 6, + "offset": 0 + }, + "new": { + "family": 2876, + "child": 6, + "offset": 8 + } + }, + { + "stage": 6, + "call_replica": 14, + "helper": 425, + "old": { + "family": 12643, + "child": 6, + "offset": 0 + }, + "new": { + "family": 2876, + "child": 6, + "offset": 16 + } + }, + { + "stage": 6, + "call_replica": 15, + "helper": 425, + "old": { + "family": 13531, + "child": 6, + "offset": 0 + }, + "new": { + "family": 2876, + "child": 6, + "offset": 24 + } + }, + { + "stage": 6, + "call_replica": 16, + "helper": 425, + "old": { + "family": 14419, + "child": 6, + "offset": 0 + }, + "new": { + "family": 2876, + "child": 6, + "offset": 32 + } + }, + { + "stage": 6, + "call_replica": 17, + "helper": 425, + "old": { + "family": 15307, + "child": 6, + "offset": 0 + }, + "new": { + "family": 3764, + "child": 6, + "offset": 0 + } + }, + { + "stage": 6, + "call_replica": 18, + "helper": 425, + "old": { + "family": 16195, + "child": 6, + "offset": 0 + }, + "new": { + "family": 3764, + "child": 6, + "offset": 8 + } + }, + { + "stage": 6, + "call_replica": 19, + "helper": 425, + "old": { + "family": 17083, + "child": 6, + "offset": 0 + }, + "new": { + "family": 3764, + "child": 6, + "offset": 16 + } + }, + { + "stage": 6, + "call_replica": 20, + "helper": 425, + "old": { + "family": 17971, + "child": 6, + "offset": 0 + }, + "new": { + "family": 3764, + "child": 6, + "offset": 24 + } + }, + { + "stage": 6, + "call_replica": 21, + "helper": 425, + "old": { + "family": 18859, + "child": 6, + "offset": 0 + }, + "new": { + "family": 3764, + "child": 6, + "offset": 32 + } + }, + { + "stage": 6, + "call_replica": 22, + "helper": 425, + "old": { + "family": 19747, + "child": 6, + "offset": 0 + }, + "new": { + "family": 4652, + "child": 6, + "offset": 0 + } + }, + { + "stage": 6, + "call_replica": 23, + "helper": 425, + "old": { + "family": 20635, + "child": 6, + "offset": 0 + }, + "new": { + "family": 4652, + "child": 6, + "offset": 8 + } + }, + { + "stage": 6, + "call_replica": 24, + "helper": 425, + "old": { + "family": 21523, + "child": 6, + "offset": 0 + }, + "new": { + "family": 4652, + "child": 6, + "offset": 16 + } + }, + { + "stage": 6, + "call_replica": 25, + "helper": 425, + "old": { + "family": 22411, + "child": 6, + "offset": 0 + }, + "new": { + "family": 4652, + "child": 6, + "offset": 24 + } + }, + { + "stage": 6, + "call_replica": 26, + "helper": 425, + "old": { + "family": 23299, + "child": 6, + "offset": 0 + }, + "new": { + "family": 4652, + "child": 6, + "offset": 32 + } + }, + { + "stage": 6, + "call_replica": 27, + "helper": 425, + "old": { + "family": 24187, + "child": 6, + "offset": 0 + }, + "new": { + "family": 5540, + "child": 6, + "offset": 0 + } + }, + { + "stage": 6, + "call_replica": 28, + "helper": 425, + "old": { + "family": 25075, + "child": 6, + "offset": 0 + }, + "new": { + "family": 5540, + "child": 6, + "offset": 8 + } + }, + { + "stage": 6, + "call_replica": 29, + "helper": 425, + "old": { + "family": 25963, + "child": 6, + "offset": 0 + }, + "new": { + "family": 5540, + "child": 6, + "offset": 16 + } + }, + { + "stage": 6, + "call_replica": 30, + "helper": 425, + "old": { + "family": 26851, + "child": 6, + "offset": 0 + }, + "new": { + "family": 5540, + "child": 6, + "offset": 24 + } + }, + { + "stage": 6, + "call_replica": 31, + "helper": 425, + "old": { + "family": 27739, + "child": 6, + "offset": 0 + }, + "new": { + "family": 5540, + "child": 6, + "offset": 32 + } + } + ] +} diff --git a/research/rank7-pooled-r438-bit/README.md b/research/rank7-pooled-r438-bit/README.md new file mode 100644 index 0000000000..6206cd3565 --- /dev/null +++ b/research/rank7-pooled-r438-bit/README.md @@ -0,0 +1,90 @@ +# Pooled R438 slack across bit replicas: conditional κ = 0.001734865178472710998233 − 10⁻⁴⁶ − 10⁻⁷⁰ (+0.00109%) + +**Author-checked conditional candidate; not maintainer-reviewed.** The selected record on +`main` is still #1094. This package stacks on the open PR3934, which is bit-bound at the R438 +endpoint. + +| | complex endpoint | bit endpoint | binds | κ headline | +|---|---|---|---|---| +| PR3934 | 0.0017348651784727109982331 | R438 0.001734846264120199151475 | bit | 0.001734846264120199151475 − … | +| **this** | 0.0017348651784727109982331 | **pooled R438 0.001734900431583947157341** | **complex** | **0.001734865178472710998233 − …** | + +The gain is **+0.00109% over PR3934**. The complex side binds again, now 3.5e-8 below the pooled bit +endpoint. + +## Idea + +R438 has 54 width-8 slack units per replica: Ali Romman's PR1043 word, re-hosted by Sagar +Thakrar's PR2423 under the PR1023 slot model. Its proven replica-local optimum is 10 empty +capacity-42 copies plus one capacity-42 copy holding one residual, which leaves an idle 34. + +Pooled over the 32 replicas, `32·54 = 345·5 + 3`. The pooled32 slot-model optimum is then 345 empty +42-copies plus one empty capacity-28 copy. mightyOil's `bit-partial-width7-optimum` already proves +this; its k = 1 row gives 0.001734900431583947. That package and seed72's window audit both leave +open whether a **cross-replica owner map** can realize it. The complex T16 supplier already uses +such maps (`owner_replica ≠ replica`). + +This package builds the map explicitly from R438's own placement, with 35 moves: + +- the 32 single residuals, one per replica, all in child 6; +- the three residuals of one full capacity-28 copy of replica 0, in child 7 (stages 5–8, inside + child 6's window 3–8). + +They go into seven previously empty child-6 copies of replicas 0–6, five per copy. The idle bill +changes by `{2:+7, 4:−1, 28:+1, 34:−32, 42:+25}`. Rank mass, the 904,320-child count and maxchild 42 +(`2·42² < 64²`) are unchanged. + +## Verification + +```sh +python3 -B research/rank7-pooled-r438-bit/build.py # writes POOL-MOVES.json +python3 -B research/rank7-pooled-r438-bit/verify.py # ~7 s, independent of build.py +``` + +- **Inputs.** `ALLOC-R438.json.gz` is R438's per-replica placement. Its SHA-256 equals + `slot_list_sha256` in `research/bit-r438-transport-rehost/verify_rehost.receipt.json` on main. +- **Role audit.** `verify.py` rebuilds all 126,144 hosted roles (32 replicas × 9 stages × 438 + helpers) and applies the moves. It checks every role against R438's slot rules: + - the host child's window contains the stage; + - the host pair is inactive at that stage; + - the width is 8 and fits the capacity; + - cells are disjoint and prefixes are compact; + - every (stage, replica, helper) is hosted exactly once. +- **Baseline.** The rebuilt baseline equals the R438 certificate's bit profile, and its endpoint + is accepted at c and rejected at c + 10⁻²⁴. +- **Pooled endpoint.** The pooled endpoint is accepted at 0.001734900431583947157341 and rejected at + the next 10⁻²⁴ point, with the 10⁻¹⁶·32m² fallback envelope. +- **Composition.** PR3934's complex root bracket is rechecked, and + `κ = min(floor₂₄(complex), floor₂₄(bit)) − 10⁻⁴⁶ − 10⁻⁷⁰`. +- **Controls.** Six mutation controls are rejected: a move outside the window, a cell collision, a + wrong source, a dropped move, the next grid point of the pooled endpoint, and κ off the grid. + +## Scope + +**New hypothesis:** the bit supplier may use a cross-replica owner map. The slot rules are audited, +but PR1043's native hosted emission (C++17/Boost) was not run, and the bit hosted audit has so far +checked only replica-local owners. The result is conditional on R438 (PR1043 is open) and on the +whole PR3934 stack, including its hosted-donor and hosted-receiver hypotheses. All inherited +obligations remain. + +## Open next questions + +- **Does R438's native hosted emission accept this cross-replica owner map?** First step: run + PR1043's native lane with this owner list. Blocked by: C++17/Boost and cross-replica support in + the bit emitter. +- **Further bit pooling.** The complex side now binds 3.5e-8 below the pooled bit endpoint. Further + bit pooling, such as width-7 conversions or the deletion-ladder words, only matters once the + complex side rises. + +## Credit + +- Ali Romman (PR1043): R438. +- Sagar Thakrar (PR2423): transport and re-hosting. +- mightyOil (PR1281): the pooled32 optimum. +- seed72 and seed14: windows and placement. +- PR1023: the slot model. +- The `r438-native-rehost` authors. +- The PR3934 stack and its credits, including OpenCode (Space bunny free) for ideas in the stacked + predecessors. + +Prepared by Rohan Arun with Anthropic Claude assistance. Apache-2.0. diff --git a/research/rank7-pooled-r438-bit/SOURCES.json b/research/rank7-pooled-r438-bit/SOURCES.json new file mode 100644 index 0000000000..f9b777f252 --- /dev/null +++ b/research/rank7-pooled-r438-bit/SOURCES.json @@ -0,0 +1,49 @@ +{ + "schema_version": 1, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "research/bit-r438-transport-rehost/verify_rehost.receipt.json", + "usage": "input", + "git_blob": "c2fb443f44f2c7c420cd367ab5fa12644efe318a", + "sha256": "06fa9322508aba3d8a5dc6469151cdfaa906b60559582b49c8b024428b158021" + }, + { + "path": "research/r438-native-rehost/CERTIFICATE.json", + "usage": "input", + "git_blob": "674ef36f723fbcc593e7d2319dca131da09181e5", + "sha256": "6da8c593257c8440f0fe35488d941715d953d715e2e464ffdfffff7ed31eee9c" + }, + { + "path": "research/rank7-idle-hosted-receivers-r438/RESULT.json", + "usage": "input", + "git_blob": "82f8854faa5e591035cf41307ea29c68962e667b", + "sha256": "6413c35379c66a0b673a722c058c1a59b0f77369622c6ea1f8119f213754f2d6", + "pin": "head:74fb4dfae1b5b2b18ede38a6af88206650552249:research/rank7-idle-hosted-receivers-r438/RESULT.json" + }, + { + "path": "research/bit-partial-width7-optimum/README.md", + "usage": "provenance", + "git_blob": "8fe20ae4102e558508d1c6b66358ec24dba3d82c", + "sha256": "b66a1f2eb2eb8e2c6b7ee916d735452747e2f659f5f73592b1410a814ca45980" + }, + { + "path": "research/bit589-width7-windows-seed72/README.md", + "usage": "provenance", + "git_blob": "a61e23fb4760a461ad87e4bf5afab7728690e06e", + "sha256": "7a24cb66d6537606874fb87bd4ae9b4b642ac513b587c5624c00fef766c2a02e" + } + ] +} diff --git a/research/rank7-pooled-r438-bit/TASK.json b/research/rank7-pooled-r438-bit/TASK.json new file mode 100644 index 0000000000..aee91fcfae --- /dev/null +++ b/research/rank7-pooled-r438-bit/TASK.json @@ -0,0 +1,66 @@ +{ + "schema_version": 1, + "task_id": "uniform-transfer-audit", + "priority_revision": 6, + "base_commit": "997e6a9ca7b4f95d50e366f61412fd640d72a88a", + "original_card": { + "id": "uniform-transfer-audit", + "question": "Can one exact all-size/compiler, precision, hosting or restoration implication be proved or falsified?", + "starting_points": [ + "certificates/selected-result.json", + "docs/audit.md" + ], + "methods": [ + "Prove one missing implication with explicit quantified hypotheses.", + "Find an exact counterexample at the claimed interface boundary." + ], + "acceptance_gate": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the selected review scope and choose one exact all-size or precision implication.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Write its quantified inputs and conclusion; find a missing hypothesis or construct a minimal exact adversarial instance.", + "bottleneck_link": "Finite supplier improvements are useful only under the retained transfer obligations.", + "allowed_variations": [ + "Choose one tape, precision, hosting or restoration lemma." + ], + "scope_change_triggers": [ + "Replacing a quantified obligation with another finite smoke test." + ], + "overlap_terms": [ + "uniform transfer", + "all-size", + "precision" + ] + }, + "scope_status": "changed", + "actual_scope": "Hosting implication for the R438 bit supplier: an explicit cross-replica (T16-style) owner map that realizes the pooled32 slot-model optimum for R438's slack (bit-partial-width7-optimum k=1 row), audited against R438's slot rules; composed with PR3934's complex endpoint, which now binds.", + "scope_change_reason": "seed72 and bit-partial-width7-optimum leave cross-replica pooling for the bit supplier open; PR3934 made the bit side bind, so this hosting question now decides kappa.", + "bottleneck_link": "kappa = min(complex, bit); pooling raises the R438 bit endpoint above the PR3934 complex root, so the complex side binds again.", + "budget_minutes": 60, + "stop_rule": "Stop after the explicit owner map, its slot audit, exact pricing and composition; native emission not run.", + "outcome": "partial", + "evidence": "POOL-MOVES.json (35 cross-replica moves), ALLOC-R438.json.gz bound to the R438 receipt, verify.py: 126,144 roles audited, baseline equals the R438 certificate, pooled endpoint accepted/rejected, 6 controls rejected.", + "author": "Rohan Arun", + "ai_assistance": "Substantial Anthropic Claude (Claude Code) assistance; lineage ideas with help from OpenCode (Space bunny free).", + "open_questions": [ + { + "question": "Does R438's native hosted emission (PR1043 pipeline) accept this cross-replica owner map?", + "why_it_matters": "The slot rules are audited, but cross-replica owner maps have no admitted bit-side precedent.", + "first_step": "Run PR1043's native lane with this owner list.", + "blocked_by": "C++17/Boost native lane; cross-replica support in the bit hosted emitter." + }, + { + "question": "Can the bit side be pooled further (width-7 conversions, more deletions) once the complex side rises again?", + "why_it_matters": "The complex side now binds 3.5e-8 below the pooled bit endpoint.", + "first_step": "Combine with the deletion ladder rows.", + "blocked_by": "Built words for d >= 2." + } + ] +} diff --git a/research/rank7-pooled-r438-bit/VERIFY.json b/research/rank7-pooled-r438-bit/VERIFY.json new file mode 100644 index 0000000000..f95550b3be --- /dev/null +++ b/research/rank7-pooled-r438-bit/VERIFY.json @@ -0,0 +1,22 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/bit-r438-transport-rehost/verify_rehost.receipt.json", + "research/r438-native-rehost/CERTIFICATE.json", + "research/rank7-idle-hosted-receivers-r438/RESULT.json" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Independent of build.py: rebuilds all 126,144 R438 roles from the receipt-bound placement, applies the 35 moves, audits windows, inactive host pairs, extents, cells, compact prefixes and once-only hosting; baseline equals the R438 certificate profile and endpoint; pooled bit endpoint accepted at c and rejected at c+1e-24; PR3934 complex root rechecked; kappa = min(floor24(complex), floor24(bit)) - 1e-46 - 1e-70 gated above PR3934/PR3251; 6 mutation controls rejected." + } + ] +} diff --git a/research/rank7-pooled-r438-bit/build.py b/research/rank7-pooled-r438-bit/build.py new file mode 100644 index 0000000000..1165d9e60f --- /dev/null +++ b/research/rank7-pooled-r438-bit/build.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Pool R438's width-8 slack across the 32 bit replicas with an explicit cross-replica owner map. + +R438 (PR1043 word, PR2423 re-hosting) has 54 width-8 slack units per replica. Its proven replica-local +optimum is 10 empty capacity-42 copies plus one capacity-42 copy holding one residual (idle 34). +Pooled over 32 replicas, 32*54 = 345*5 + 3, and the pooled32 slot-model optimum +(research/bit-partial-width7-optimum, k = 1 row, 0.001734900431583947) is 345 empty 42-copies plus one empty +capacity-28 copy. This builder realizes it literally: the 32 single residuals (one per replica, child 6) +and the three residuals of one full capacity-28 copy of replica 0 (child 7, stages 5-8, inside child 6's +window 3-8) move into seven previously empty child-6 copies of replicas 0..6, five per copy. + +Input: ALLOC-R438.json.gz, R438's per-replica placement, bound to slot_list_sha256 in +research/bit-r438-transport-rehost/verify_rehost.receipt.json on main. Output: POOL-MOVES.json. +""" +import gzip, hashlib, json +from collections import defaultdict +from pathlib import Path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +V, T, COPIES, STAGES = 111, 32, 222, 9 +PAIR = {0: 1, 1: 1, 2: 2, 3: 2, 4: 3, 5: 3, 6: 0, 7: 1, 8: 2} # host child -> pair (R438 receipt windows) + + +def need(ok, why): + if not ok: raise SystemExit('FAIL: ' + why) + + +def family(rep, child, cp): + return rep * 8 * V + (2 * PAIR[child] + cp // V) * V + cp % V + + +def main(): + raw = gzip.decompress((HERE / 'ALLOC-R438.json.gz').read_bytes()) + receipt = json.loads((ROOT / 'research/bit-r438-transport-rehost/verify_rehost.receipt.json').read_text()) + need(hashlib.sha256(raw).hexdigest() == receipt['placement']['slot_list_sha256'], 'R438 placement binding') + alloc = [tuple(t) for t in json.loads(raw)] + occ = defaultdict(list) # (child, copy) -> [(offset, stage, helper)] + for child, cp, off, w, s, h in alloc: + occ[child, cp].append((off, s, h)) + single = [cp for cp in range(COPIES) if len(occ.get((6, cp), [])) == 1] + empty = [cp for cp in range(COPIES) if not occ.get((6, cp))] + need(len(single) == 1 and len(empty) == 10, 'R438 replica-local optimum shape in child 6') + src28 = min(cp for cp in range(COPIES) if len(occ.get((7, cp), [])) == 3) + movers = [(s, rep, h, 6, single[0], off) for rep in range(T) for off, s, h in occ[6, single[0]]] + movers += [(s, 0, h, 7, src28, off) for off, s, h in sorted(occ[7, src28])] + need(len(movers) == 35, '35 residuals') + dests = [(rep, empty[0]) for rep in range(7)] + fill = defaultdict(list) + for mv in sorted(movers): + d = next(d for d in dests if len(fill[d]) < 5) + fill[d].append(mv) + moves = [] + for (rep_d, cp_d), lst in sorted(fill.items()): + for k, (s, rep, h, child, cp, off) in enumerate(lst): + moves.append(dict(stage=s, call_replica=rep, helper=h, + old=dict(family=family(rep, child, cp), child=child, offset=off), + new=dict(family=family(rep_d, 6, cp_d), child=6, offset=8 * k))) + (HERE / 'POOL-MOVES.json').write_text(json.dumps(dict(alloc_sha256=hashlib.sha256(raw).hexdigest(), moves=moves), indent=1) + '\n') + print('PASS pooled moves', len(moves)) + + +if __name__ == '__main__': + main() diff --git a/research/rank7-pooled-r438-bit/verify.py b/research/rank7-pooled-r438-bit/verify.py new file mode 100644 index 0000000000..4a8fbbd915 --- /dev/null +++ b/research/rank7-pooled-r438-bit/verify.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +"""Independent verifier for the pooled R438 owner map and its composition with the PR3934 complex endpoint. + +Does not import build.py. Rebuilds all 126,144 R438 hosted roles (32 replicas x 9 stages x 438 helpers) from +the receipt-bound per-replica placement, applies POOL-MOVES.json, and checks every role against the R438 slot +rules: host child window contains the stage, the host pair is inactive at that stage, width 8 inside capacity, +disjoint cells, compact prefixes, every (stage, replica, helper) hosted exactly once. It prices the baseline +(must equal the R438 certificate profile and endpoint) and the pooled profile with its own interval arithmetic +(10^-16 * 32 m^2 fallback envelope), then composes with PR3934's complex root. +""" +import copy, gzip, hashlib, json +from collections import Counter, defaultdict +from fractions import Fraction as F +from pathlib import Path + +PKG = Path(__file__).resolve().parent +ROOT = PKG.parents[1] +V, T, COPIES, STAGES, R = 111, 32, 222, 9, 438 +LOCAL_B = {1: 1322, 2: 1342, 3: 79, 4: 44, 5: 102, 6: 11, 7: 18} # R438 transported local profile (r438 rehost, row b) +ACTIVE = {0: 0, 1: 0, 2: 0, 3: 1, 4: 1, 5: 2, 6: 2, 7: 3, 8: 3} # pair swept at each stage +GATES = dict(PR3934=F('0.0017348462641201991514749999999999999999999998999999999999999999999999'), + PR3251=F('0.0017348157703850985634839999999999999999999998999999999999999999999999')) + + +class Reject(Exception): pass +def req(ok, why): + if not ok: raise Reject(why) + + +def windows(): + w = json.loads((ROOT / 'research/bit-r438-transport-rehost/verify_rehost.receipt.json').read_text())['windows'] + return {int(i): (v['pair'], v['capacity'], tuple(v['stages'])) for i, v in w.items()} + + +def roles(alloc, hosting, moves): + out = {} + for rep in range(T): + for child, cp, off, w, s, h in alloc: + pair = hosting[child][0] + out[s, rep, h] = (rep * 8 * V + (2 * pair + cp // V) * V + cp % V, child, off, w) + for m in moves: + k = (m['stage'], m['call_replica'], m['helper']) + req(k in out and out[k][:3] == (m['old']['family'], m['old']['child'], m['old']['offset']), 'move source matches baseline') + out[k] = (m['new']['family'], m['new']['child'], m['new']['offset'], 8) + return out + + +def audit(rl, hosting): + req(set(rl) == {(s, r, h) for s in range(STAGES) for r in range(T) for h in range(R)}, 'every role hosted once') + cells = defaultdict(set) + for (s, rep, h), (fam, child, off, w) in rl.items(): + pair, cap, stages = hosting[child] + frep, rest = divmod(fam, 8 * V); pair2, port = divmod(rest, V) + req(0 <= frep < T and pair2 // 2 == pair, 'family encodes the host child pair') + req(s in stages, 'stage inside host window'); req(pair != ACTIVE[s], 'host pair inactive at stage') + req(w == 8 and 0 <= off and off + w <= cap, 'residual extent') + key = (frep, child, (pair2 % 2) * V + port); new = set(range(off, off + w)) + req(not cells[key] & new, 'cell collision'); cells[key] |= new + idle = Counter() + for frep in range(T): + for child, (pair, cap, st) in hosting.items(): + for cp in range(COPIES): + c = cells.get((frep, child, cp), set()) + req(c == set(range(len(c))), 'compact prefix') + if cap - len(c): idle[cap - len(c)] += 1 + return idle + + +Q72 = 10 ** 72 +def rd(x): return F(x.numerator * Q72 // x.denominator, Q72) +def ru(x): return F(-((-x.numerator * Q72) // x.denominator), Q72) +def at(z, n): + s, p = F(0), z + for j in range(n): s += p / (2 * j + 1); p *= z * z + return 2 * s, 2 * p / ((2 * n + 1) * (1 - z * z)) +L2 = at(F(1, 3), 130) +def lnb(m, r): + y, k = F(m, r), 0 + while y >= 2: y /= 2; k += 1 + a, e = at((y - 1) / (y + 1), 90) + return rd(a + k * L2[0]), ru(a + e + k * (L2[0] + L2[1])) +def ex(x0, x1): + def tay(x): + s, t = F(1), F(1) + for j in range(1, 34): t = t * x / j; s += t + return s, t * x / 34 * 3 + a, _ = tay(x0); b, t = tay(x1); return rd(a), ru(b + t) +def moment(p, m, W, b, bad): + items = sorted(p.items()) + ([(1, F(32 * m * m * sum(p.values()), 10 ** 16))] if bad else []) + lo = hi = F(0) + for r, n in items: + l0, l1 = lnb(m, r); e0, e1 = ex(b * l0, b * l1); lo += n * r * e0; hi += n * r * e1 + return lo / (m * W), hi / (m * W) + + +def bitprof(idle): + H = Counter({r: n * STAGES * T for r, n in LOCAL_B.items()}); H.update(idle); return dict(sorted(H.items())) + + +def run(alloc, moves, claim, cx): + hosting = windows() + req(all(hosting[i][0] != ACTIVE[s] for i in hosting for s in hosting[i][2]), 'receipt windows avoid active pairs') + i0 = audit(roles(alloc, hosting, []), hosting); i1 = audit(roles(alloc, hosting, moves), hosting) + cert = json.loads((ROOT / 'research/r438-native-rehost/CERTIFICATE.json').read_text())['pipeline']['candidate']['hosted']['invoice'] + req(bitprof(i0) == {int(k): v for k, v in cert['bit_profile'].items()}, 'baseline equals the R438 certificate profile') + c0 = F(cert['bit_lower']) + req(moment(bitprof(i0), 64, 28416, c0, True)[1] < 1 < moment(bitprof(i0), 64, 28416, c0 + F(1, 10 ** 24), True)[0], 'R438 endpoint') + p1 = bitprof(i1); c1 = F(claim['bit_pooled']) + req(sum(r * n for r, n in p1.items()) == sum(r * n for r, n in bitprof(i0).items()) and 2 * max(p1) ** 2 < 64 ** 2, 'mass and halving') + req(moment(p1, 64, 28416, c1, True)[1] < 1 < moment(p1, 64, 28416, c1 + F(1, 10 ** 24), True)[0], 'pooled bit endpoint') + prof = {int(k): v for k, v in cx['profile'].items()} + lo, hi = F(cx['complex_root'][0]), F(cx['complex_root'][1]) + req(hi - lo == F(1, 10 ** 25) and moment(prof, 73, 896 * 740, lo, False)[1] < 1 < moment(prof, 73, 896 * 740, hi, False)[0], 'PR3934 complex root') + fl = lambda x: F(x.numerator * 10 ** 24 // x.denominator, 10 ** 24) + req(fl(lo) < c1 and c0 < fl(lo), 'complex binds between the R438 and pooled bit endpoints') + kappa = min(fl(lo), fl(c1)) - F(1, 10 ** 46) - F(1, 10 ** 70) + req(kappa == F(claim['kappa']) == F(claim['kappa_decimal']), 'CLAIM kappa') + for n, g in GATES.items(): req(kappa > g, 'kappa must exceed ' + n) + return i0, i1, c1, kappa, lo + + +def main(): + if not __debug__: raise SystemExit('assertions required') + raw = gzip.decompress((PKG / 'ALLOC-R438.json.gz').read_bytes()) + receipt = json.loads((ROOT / 'research/bit-r438-transport-rehost/verify_rehost.receipt.json').read_text()) + req(hashlib.sha256(raw).hexdigest() == receipt['placement']['slot_list_sha256'], 'R438 placement binding') + alloc = [tuple(t) for t in json.loads(raw)] + moves = json.loads((PKG / 'POOL-MOVES.json').read_text())['moves'] + claim = json.loads((PKG / 'CLAIM.json').read_text()) + cx = json.loads((ROOT / 'research/rank7-idle-hosted-receivers-r438/RESULT.json').read_text()) + i0, i1, c1, kappa, lo = run(alloc, moves, claim, cx) + rej = {} + def bad(name, f, c=claim): + mv = copy.deepcopy(moves); cl = copy.deepcopy(c); f(mv, cl) + try: run(alloc, mv, cl, cx) + except Reject as e: rej[name] = str(e) + else: raise SystemExit('mutation accepted: ' + name) + bad('outside_window', lambda mv, cl: mv[0]['new'].update(child=2, family=mv[0]['new']['family'] - 4 * V + 4 * V)) + bad('cell_collision', lambda mv, cl: mv[1]['new'].update(offset=mv[0]['new']['offset']) if mv[0]['new']['family'] == mv[1]['new']['family'] else None) + bad('wrong_source', lambda mv, cl: mv[0]['old'].update(offset=mv[0]['old']['offset'] + 8)) + bad('dropped_move', lambda mv, cl: mv.pop()) + bad('pooled_next_grid', lambda mv, cl: cl.update(bit_pooled=str(F(cl['bit_pooled']) + F(1, 10 ** 24)))) + bad('kappa_off_grid', lambda mv, cl: cl.update(kappa=str(F(cl['kappa']) + F(1, 10 ** 24)), kappa_decimal=str(F(cl['kappa']) + F(1, 10 ** 24)))) + print('PASS_POOLED_R438_BIT idle_delta=%s bit=%s complex=%s kappa=%s controls=%d' % ( + {k: v for k, v in sorted((Counter(i1) - Counter(i0) + Counter()).items())}, float(c1), float(lo), float(kappa), len(rej))) + print(json.dumps(rej, sort_keys=True)) + + +if __name__ == '__main__': + try: main() + except Reject as e: raise SystemExit('FAIL: ' + str(e))