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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions research/three-base-census-recount/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Independent recount of #4450: the THREE-base paid-event census

**Claim type:** an independent recount by separately written GF(2) code. **No new κ.** It covers
mihir-s-05's [#4450](https://github.com/CrocSwap/integer-mult-bounds/pull/4450) (head `e8305f07`).
That PR closed the supplier-census handoff of my earlier #4426.

## Method

The code reads only the two pinned inputs: the native program, in both orientations, and the canonical
frame table.

- **Frame bases.** All 1,159 bases are checked independent by elimination.
- **Paid events.** Every paid `climb` event (`[phase, field, from, to, rank]`) and `center` event must
move between **nested** frames. Its rank is recomputed as the dimension gap, and the declared rank is
only compared. Forward centers shrink (`8 → 3 → 0`) and backward centers grow (`0 → 3 → 8`).
- **Centers.** The 16 split center events are coalesced in adjacent pairs through their shared middle
frame.
- **Helpers.** The helper increments are the nested gaps between the start and final frames of fields
224..631.

## Results

These are identical in both orientations, and every number matches #4450.

| | value |
| --- | --- |
| events | 22,633 |
| split paid profile | {1:2487, 2:713, 3:232, 4:102, 5:28} |
| unsplit paid profile | **{1:2487, 2:713, 3:224, 4:102, 5:20, 8:8}** |
| paid calls / rank mass | **3,554 / 5,157** |
| phase A | {1:950, 2:12, 3:20, 4:38} |
| phase B | {1:1161, 2:571, 3:150, 4:64, 5:20} |
| cleanup tail | {1:72, 2:53} |
| final | {1:304, 2:77, 3:54} |
| helper increments (fields 224..631) | {5:28, 6:18, 7:56, 8:93, 9:213}, mass **3,301** |

## Not covered

The same operator-level boundary as #4450 applies:

- operator equality, Clifford phases and physical admission;
- scalar and warp pricing;
- the controller (#4426).

## Reproduce

```sh
python3.12 -B scripts/research_package.py --package research/three-base-census-recount --check-only
python3.12 -B scripts/research_package.py --package research/three-base-census-recount
```

The verifier prints `PASS_THREE_BASE_CENSUS_RECOUNT`, using only the standard library.

## Open next questions

1. **None for the census.** It now has two independent implementations, #4450 and this one.

## Credit

- The census and the question are mihir-s-05's (#4450).
- The native program comes from the retained THREE-base lineage.

Prepared by Ryanson Jonathan with substantial Claude Code (Claude Opus 5.5) assistance.
Apache-2.0.
30 changes: 30 additions & 0 deletions research/three-base-census-recount/SOURCES.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"schema_version": 1,
"base_commit": "2a13eb1827784206202db90e5dc8327cf8a250db",
"files": [
{
"path": "certificates/selected-result.json",
"usage": "provenance",
"git_blob": "ed33caef5c5827693e9572d252a66f99cbb73d40",
"sha256": "5732707cc1e460b090b53f2463162749ad860de878a18f7408938671d295a9d9"
},
{
"path": "docs/research/agent-task-catalog.json",
"usage": "provenance",
"git_blob": "64bfc5af6709ed9811171e0a2108f05e1219cb65",
"sha256": "352a6184713b8843d96fd2c2071eb7aeaa655906b7c51d45ad444912666c8a96"
},
{
"path": "research/kappa-rebuild/complex/full-identity-certificates/THREE-base-FULL-IDENTITY-CANONICAL.json.gz",
"usage": "input",
"git_blob": "4a8c4ed26e53a72362d571c972e65aff546be784",
"sha256": "6418ec3da24d548a57f5c3fe5b9062c26c9478e638504a61c387f5cfb5f4ed61"
},
{
"path": "research/kappa-rebuild/complex/full-identity-certificates/THREE-base-FULL-IDENTITY-NATIVE.json.gz",
"usage": "input",
"git_blob": "b46d44c6ee624968dd57be928b0c15d9d45f3b2c",
"sha256": "c54b0a3e129d28e6dbf74fa731fc3bb70fe3c6705f07256750fbecddcc842d39"
}
]
}
100 changes: 100 additions & 0 deletions research/three-base-census-recount/TASK.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"schema_version": 1,
"task_id": "independent-moment",
"priority_revision": 7,
"base_commit": "2a13eb1827784206202db90e5dc8327cf8a250db",
"original_card": {
"id": "independent-moment",
"question": "Does a new paid-profile or mixture-ceiling claim have independent source-bound coverage of its actual changed ledger?",
"starting_points": [
"docs/research/research-family-status.md",
"certificates/selected-result.json",
"research/staged544-mixed-fourth-entry/README.md",
"research/staged-fourth-mixture-ceiling/README.md",
"research/r437-two-window-carrier/README.md"
],
"methods": [
"Independently reconstruct one changed paid ledger or pooled dual with exact source and model binding.",
"Check a genuinely uncovered moment implication with a different enclosure method and semantic controls."
],
"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": "Choose one uncovered implication in #4088 literal mixed fill, #4091 pooled dual/model binding or #4067 changed frame/host bill. #4091 pins an earlier #4088 head: validate word, capacity and stock equivalence before applying that ceiling to the later fill.",
"scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately."
},
"first_experiment": "Independently reconstruct one changed ledger or pooled certificate with a positive case and a semantic failure control. Compare exact sources and name what existing checks miss. Keep this separate from supplier-boundary-audit (ordinary/outer dispatch) and uniform-transfer-audit (all-size proof). Stop after the chosen implication; more digits of an unchanged root are not additional mechanism coverage.",
"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.",
"Calling an aggregate histogram or source archive an independently accepted physical supplier."
],
"overlap_terms": [
"independent moment",
"rank histogram",
"exact enclosure",
"2979",
"rank7 joint endframes",
"paired extraction",
"joint lowering",
"4088",
"4091",
"4067",
"staged544-mixed-fourth-entry",
"staged-fourth-mixture-ceiling",
"r437-two-window-carrier"
],
"existing_checks": [
{
"scope": "PR #4088: mixed local/owner/phase ledger and moment reported.",
"evidence": "research/staged544-mixed-fourth-entry/README.md",
"remaining": "Independent binding of changed construction to paid histogram, distinct from full admission.",
"status": "author-checked",
"source_commit": "72d7efc181edb21806a878f174847c96dd410ab0",
"selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129"
},
{
"scope": "PR #4091: sharp pooled ceiling proposed for fixed THREE/FOUR words and inventory.",
"evidence": "research/staged-fourth-mixture-ceiling/README.md",
"remaining": "Validate dual, exhaustive pattern scope and exact source equivalence before applying to newer fills.",
"status": "author-checked",
"source_commit": "a29bdd8f56cd18b805917775cdec09ff935eddc4",
"selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129"
},
{
"scope": "PR #4067: paid (2,2) to (1,3) exchange and fixed OQ4 host reported.",
"evidence": "research/r437-two-window-carrier/README.md",
"remaining": "Independent full cost delta; remaining caller/precision/stock obligations are separate.",
"status": "author-checked",
"source_commit": "a95f11c52e3ca1e4c5171b3c20d8f4b0815aee2e",
"selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129"
}
]
},
"scope_status": "refined",
"actual_scope": "Independent recount of #4450's THREE-base paid census.",
"scope_change_reason": "Independent coverage of a fresh census PR.",
"bottleneck_link": "Side result: second implementation of the supplier census used by the p7 controller audit.",
"budget_minutes": 20,
"stop_rule": "Stop at the census.",
"outcome": "completed",
"evidence": "Unsplit {1:2487,2:713,3:224,4:102,5:20,8:8}: 3,554 calls, rank mass 5,157 in both orientations; per-phase table and helper increments (mass 3,301) match #4450.",
"author": "Ryanson Jonathan, with Claude Code (Claude Opus 5.5) assistance",
"ai_assistance": "Substantial Claude Code (Claude Opus 5.5) assistance; no independent human review.",
"open_questions": [
{
"question": "None for the census.",
"why_it_matters": "Two independent implementations now agree.",
"first_step": "n/a",
"blocked_by": "None."
}
]
}
21 changes: 21 additions & 0 deletions research/three-base-census-recount/VERIFY.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"schema_version": 1,
"status": "ready",
"python": "3.12",
"requirements": [],
"inputs": [
"research/kappa-rebuild/complex/full-identity-certificates/THREE-base-FULL-IDENTITY-CANONICAL.json.gz",
"research/kappa-rebuild/complex/full-identity-certificates/THREE-base-FULL-IDENTITY-NATIVE.json.gz"
],
"commands": [
{
"argv": [
"{python}",
"-B",
"{package}/verify.py"
],
"timeout_seconds": 120,
"checks": "Independent GF(2) recount of the THREE-base paid census (#4450): independent bases, nested-frame paid events with recomputed ranks, center coalescing, both orientations, per-phase table, helper increments mass 3,301."
}
]
}
84 changes: 84 additions & 0 deletions research/three-base-census-recount/verify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/usr/bin/env python3
"""Independent recount of #4450: the THREE-base supplier's paid-event census, by separately written GF(2) code.

Reads the pinned native program (both orientations) and canonical frame table. Every frame basis is checked
independent; every paid `climb` and `center` event must move between nested frames, and its rank is recomputed as the
dimension gap (the declared rank is only compared). The 16 split center events are coalesced in adjacent pairs through
their shared middle frame. Expected (#4450): split {1:2487, 2:713, 3:232, 4:102, 5:28}; unsplit {1:2487, 2:713, 3:224,
4:102, 5:20, 8:8} = 3,554 calls, rank mass 5,157, identical in both orientations, with #4450's per-phase table; helper
increments for fields 224..631 {5:28, 6:18, 7:56, 8:93, 9:213}, mass 3,301.
Ryanson Jonathan with Claude Code (Claude Opus 5.5) assistance. Apache-2.0.
"""
from collections import Counter
import gzip
import hashlib
import json
from pathlib import Path
import sys

HERE = Path(__file__).resolve().parent
ROOT = HERE.parents[1]
EXPECT_UNSPLIT = {1: 2487, 2: 713, 3: 224, 4: 102, 5: 20, 8: 8}
EXPECT_SPLIT = {1: 2487, 2: 713, 3: 232, 4: 102, 5: 28}
EXPECT_PHASE = {"A": {1: 950, 2: 12, 3: 20, 4: 38}, "B": {1: 1161, 2: 571, 3: 150, 4: 64, 5: 20},
"cleanup_tail": {1: 72, 2: 53}, "final": {1: 304, 2: 77, 3: 54}}
EXPECT_HELPER = {5: 28, 6: 18, 7: 56, 8: 93, 9: 213}


def census():
c=json.loads(gzip.decompress(open(ROOT / 'research/kappa-rebuild/complex/full-identity-certificates/THREE-base-FULL-IDENTITY-CANONICAL.json.gz', 'rb').read()))
d=json.loads(gzip.decompress(open(ROOT / 'research/kappa-rebuild/complex/full-identity-certificates/THREE-base-FULL-IDENTITY-NATIVE.json.gz', 'rb').read()))
def rank(vs):
basis={}; r=0
for v in vs:
while v:
h=v.bit_length()-1
if h in basis: v^=basis[h]
else: basis[h]=v; r+=1; break
return r
F=c['frames']; dim=[rank(f) for f in F]
assert all(dim[i]==len(F[i]) for i in range(len(F)))
def nested_gap(a,b):
lo,hi=(a,b) if dim[a]<=dim[b] else (b,a)
assert rank(F[lo]+F[hi])==dim[hi], "nested frames"
return abs(dim[a]-dim[b])
res={}
for orient in ('forward','backward'):
hist=Counter(); byphase={}; cen=[]
for e in d[orient]:
if e[0]=='climb':
_,ph,field,a,b,r=e; rr=nested_gap(a,b); assert rr==r>0 and dim[b]>dim[a]
hist[rr]+=1; byphase.setdefault(ph,Counter())[rr]+=1
elif e[0]=='center':
_,field,a,b,r=e; rr=nested_gap(a,b); assert rr==r>0; cen.append((a,b))
split=hist+Counter(abs(dim[a]-dim[b]) for a,b in cen)
pairs=[(cen[i],cen[i+1]) for i in range(0,len(cen),2)]
assert len(cen)==16 and all(p[0][1]==p[1][0] for p in pairs)
unsplit=hist+Counter(nested_gap(p[0][0],p[1][1]) for p in pairs)
res[orient]={"split":dict(sorted(split.items())),"unsplit":dict(sorted(unsplit.items())),"calls":sum(unsplit.values()),
"rank_mass":sum(k*v for k,v in unsplit.items()),"events":len(d[orient]),
"by_phase":{k:dict(sorted(v.items())) for k,v in sorted(byphase.items())}}
inc=Counter(nested_gap(c['start'][i],c['final'][i]) for i in range(224,632))
res["helper_increments"]=dict(sorted(inc.items())); res["helper_mass"]=sum(k*v for k,v in inc.items())


return res


def main():
for row in json.loads((HERE / "SOURCES.json").read_text(encoding="utf-8"))["files"]:
assert hashlib.sha256((ROOT / row["path"]).read_bytes()).hexdigest() == row["sha256"], row["path"]
res = census()
for orient in ("forward", "backward"):
r = res[orient]
assert r["split"] == EXPECT_SPLIT and r["unsplit"] == EXPECT_UNSPLIT, orient
assert r["calls"] == 3554 and r["rank_mass"] == 5157 and r["events"] == 22633, orient
assert r["by_phase"] == EXPECT_PHASE, orient
assert res["helper_increments"] == EXPECT_HELPER and res["helper_mass"] == 3301
print(json.dumps({"status": "PASS_THREE_BASE_CENSUS_RECOUNT", "calls": 3554, "rank_mass": 5157,
"unsplit": {str(k): v for k, v in EXPECT_UNSPLIT.items()}, "helper_mass": 3301,
"orientations": 2, "new_kappa_claimed": False}, indent=1))


if __name__ == "__main__":
sys.exit(main())
Loading