diff --git a/research/e7-orbit-hash-partition/README.md b/research/e7-orbit-hash-partition/README.md new file mode 100644 index 0000000000..cef4991c9f --- /dev/null +++ b/research/e7-orbit-hash-partition/README.md @@ -0,0 +1,136 @@ +# The E7 weight-12 kernel words are the two receipt orbits + +**Coverage check of a published classification receipt. No new κ.** The +selected conditional exponent stays `781451/250000000`. An independent +half-split of the pinned 27-dimensional E7 kernel returns the same 1638 +weight-12 words as the union of the two reflection orbits recorded in +`research/e7-bitsliced-exhaustion/source/RESULT.json`. + +## Result + +The kernel basis is the one constructed by the pinned PR #5238 geometry: +135 frames and 27 free coordinates on which the basis is the identity. The +census splits that ordered basis after 13 generators and after 16. Each half +is listed by doubling. A pair `(high, low)` contributes `high XOR low`, +scored by integer popcount. Both splits, and `low_weight_words` at batch +sizes 16 and 8, return one set: zero plus 1638 words of weight 12. No nonzero +word in the `2^27` span is lighter. + +The 63 reflection permutations are the frozen `reflections` function in +`research/e7-bitsliced-exhaustion/source/verify.py`. Each is a permutation of +the 63 roots and preserves the frame set, because that function rejects a +failure. Starting from the two receipt representatives: + +| Orbit | Size | SHA256 of the sorted masks | +|---|---:|---| +| diagonal | 630 | `d08f659fab919baab7b2c87c0b7e55edb5a3e23e05a313522f0b17e684d8ee39` | +| product | 1008 | `a9bb36def7396f184d343e38f410d705a50be3188b40725235f866ad0753309b` | + +Those are the `orbit_sha256` fields of `source/RESULT.json`. The orbits are +disjoint, every element has weight 12, and their union is the census. The +hash is `SHA256` of `json.dumps(sorted(masks))` with the standard separators, +the same encoding as the predecessor. + +Deleting one census word makes the predecessor partition check fail. Feeding +it an overlapping second orbit fails. Deleting one diagonal-orbit word changes +its hash. Clearing one bit of the diagonal representative produces a weight-11 +seed whose orbit hash differs and which does not stay inside the weight-12 set. + +## Scope + +Task card `replay-runtime`, priority revision 8, base +`7c49fe32c55de02c2c873655c804b16e4c3fef0a`. Scope status is **refined**. + +The card asks for a new measured speedup that keeps coverage. PR #5729 +published the bit-lane speedup and was archived without an independent +scientific replay. `research/e7-bitslice-coverage-check` compared the iterator +with this census and left the reflection orbits unreplayed. This package is +that orbit comparison. It does not time the engine, recompute quadratic ranks +or single-omission kernels, rerun the 120 ambient root slices, or install the +iterator into another consumer. + +Ordered eligible list for session r93, rebuilt on 2026-11-03 against +`7c49fe32c55de02c2c873655c804b16e4c3fef0a`. The overlap snapshot at +2026-11-03T13:22:29Z had 572 open PR bodies and 6625 discussion records. +Structured handoffs are dropped when the post is completed, a merged result +answers the question, or the canonical artifact is an open pull request. That +removes the 19 October index, the H25 requests, the 2 November PR6353 review +chain (#6355, #6357, #6359, #6360, #6361), and the later #6376, #6378 and +#6396 artifacts. The 28 October null-artifact handoffs that were later +answered are dropped with them, including the absolute-phase word, the +residual two-cycle incidence, the Schur-bandwidth carve and the RootPlan +descriptor bound. Prose handoffs already marked DONE or RELEASED, and the +PR6551 kappa handoff whose artifact is an open pull request, are dropped. +No structured claim was unexpired. Work already delivered by this account, +including the named upstream pull requests and fork `cursor/*` branches, is +dropped. The revision-8 "Next bounded decisions" table then supplies six +rows. A row stays while that table still states the decision. Catalogue +cards not named by those rows follow in file order. + +1. Complex helpers (`p104-side-correction`, `coverage-law-change`). +2. BIT (`bit-helper-contract`). +3. New decoders and interfaces. +4. Supplier audit (`supplier-boundary-audit`). +5. All-size audit (`uniform-transfer-audit`). +6. **This package.** Verification tooling (`replay-runtime`): the orbit-hash + partition left open by the #5729 coverage check. +7. `bit-new-register-model`. +8. `r437-carrier-integration`. +9. `complex-rank-shape-decoder`. +10. `complex-new-helper-inventory`. + +Rows 1 through 5 stay because the priority text still states those +decisions. `research/e7-bitslice-coverage-check` answered the word-set half +of row 6 and named this orbit comparison as its first open question. The six +rows already name `p104-side-correction`, `coverage-law-change`, +`bit-helper-contract`, `supplier-boundary-audit`, `uniform-transfer-audit` +and `replay-runtime`. Items 7 through 10 are the next catalogue cards in file +order after those six names. + +## Reproduce + +Python 3.12 and the standard library, from the repository root. The two +half-splits scan `2^27` words each. + +```sh +python3 -B scripts/research_package.py --package research/e7-orbit-hash-partition --check-only +python3 -I -B research/e7-orbit-hash-partition/verify.py +python3 -I -O -B research/e7-orbit-hash-partition/verify.py +python3 -B scripts/research_package.py --package research/e7-orbit-hash-partition +``` + +The direct verifier prints + +```text +PASS_E7_ORBIT_HASH_PARTITION supports=1638 diagonal=630 product=1008 reflections=63 quadratic_ranks_replayed=false no_new_kappa=true +``` + +Not run: the #5729 timing harness, quadratic ranks, single-omission kernels, +the 120 ambient root slices, another decoder code, Lean, Docker, and +`make frontier6030-verify`. + +## Open next questions + +1. Do the two receipt representatives still have quadratic ranks 6 and 2, + with every single omission of rank 11? The orbit hashes identify the sets + and do not rerun that half of the classification. First evaluate `form_a` + and `form_b` in `source/verify.py` and compare `supported_rank` and + `quadratic_matrix` with the receipt. +2. Does the same set equality hold for one other deletion or decoder code? + The bit-lane proof leaves that consumer unbound. First name its generators, + width and weight bound, then compare one half-split with `low_weight_words` + on that basis alone. + +## Credit + +The geometry and minimum-support statement are Nick Petalas's PR #5238, +retained in `research/e7-bitsliced-exhaustion/source/vendor/PR5238.py`. The +equality classification, reflection code and receipt are Ali Romman's +PR #5669, frozen in `research/e7-bitsliced-exhaustion/source/verify.py` and +`source/RESULT.json`. The bit-lane engine is Ali Romman's PR #5729. The +word-set comparison that left this orbit question open is +`research/e7-bitslice-coverage-check`. This package does not modify those +files. + +Prepared by unpaidmoon with substantial Cursor Grok assistance. Apache-2.0. +No independent human review and no formal-kernel acceptance are claimed. diff --git a/research/e7-orbit-hash-partition/SOURCES.json b/research/e7-orbit-hash-partition/SOURCES.json new file mode 100644 index 0000000000..f69f736883 --- /dev/null +++ b/research/e7-orbit-hash-partition/SOURCES.json @@ -0,0 +1,42 @@ +{ + "schema_version": 1, + "base_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "d59b5035e7b4cbaa9d688a1d32dd0d6eb79c466a", + "sha256": "9b8d0eea95b3bf0dfcb7938a732a6439b87a2685dec2a5ab9e525b3b34debbfa" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "research/e7-bitsliced-exhaustion/binary.py", + "usage": "input", + "git_blob": "cad9fc43ec0244bce415a76bc61b6445ffbd7519", + "sha256": "e79ad4d1d4be1748cf09aacc4274a316000d4b5922f13495778892b9309dc56e" + }, + { + "path": "research/e7-bitsliced-exhaustion/source/RESULT.json", + "usage": "input", + "git_blob": "d32035693b23f114723c953c94370b349aa13cad", + "sha256": "2742bd01c85c988cb4b8c13359839ce9e10672bde1a40c8bf668aae70b12c98d" + }, + { + "path": "research/e7-bitsliced-exhaustion/source/vendor/PR5238.py", + "usage": "input", + "git_blob": "781a074d45126b1a84b92ee2393dc95790c0cb1b", + "sha256": "95502bb9e551302cbb0483097250441e96e5f858a5624745678875e3cedba9d2" + }, + { + "path": "research/e7-bitsliced-exhaustion/source/verify.py", + "usage": "input", + "git_blob": "dc91e3362d7074d9655afc3b07109bff219f3572", + "sha256": "bac0023fe4a1d42af4c57412b7974158ca1a56b89da25c45e28b8e106e5b2649" + } + ] +} diff --git a/research/e7-orbit-hash-partition/TASK.json b/research/e7-orbit-hash-partition/TASK.json new file mode 100644 index 0000000000..81c533260a --- /dev/null +++ b/research/e7-orbit-hash-partition/TASK.json @@ -0,0 +1,67 @@ +{ + "schema_version": 1, + "task_id": "replay-runtime", + "priority_revision": 8, + "base_commit": "7c49fe32c55de02c2c873655c804b16e4c3fef0a", + "original_card": { + "id": "replay-runtime", + "question": "Can one measured replay bottleneck be sped up without dropping coverage?", + "starting_points": [ + "scripts/run_isolated_tests.py", + "scripts/verify_replay_coverage.py", + "certificates/selected-result.json" + ], + "methods": [ + "Profile one isolated replay and optimize the measured bottleneck.", + "Design source-bound reuse with explicit dependency invalidation and negative controls." + ], + "acceptance_gate": "Report before/after wall time on the same fixture, retained checks and invalidation behavior.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "Measure one unchanged fixture, preserve check coverage, and test one optimization with invalidation controls.", + "bottleneck_link": "Faster trustworthy replays increase review throughput and let mechanism candidates be checked sooner.", + "allowed_variations": [ + "Profile one stage or design one source-bound cache boundary." + ], + "scope_change_triggers": [ + "Skipping coverage or comparing different fixtures to claim speedup." + ], + "overlap_terms": [ + "replay runtime", + "cache invalidation", + "isolated tests" + ] + }, + "scope_status": "refined", + "actual_scope": "Do the two predecessor E7 reflection-orbit hashes partition the weight-at-most-12 words recovered by an independent half-split of the pinned kernel?", + "scope_change_reason": "The replay-runtime card asks for a new measured speedup. PR #5729 already published the bit-lane speedup, and research/e7-bitslice-coverage-check compared the iterator with a full-kernel census while leaving the reflection orbits unreplayed. This package applies those frozen permutations to that recovered set and compares both receipt hashes. It does not time the engine or add another optimization.", + "bottleneck_link": "A faster E7 exhaustion is coverage for deletion and decoder checks only when its minimum-weight words are still the classified orbits. Matching the two receipt hashes on an independently recovered set closes that gap in the published replay. It does not change a supplier bill or kappa.", + "budget_minutes": 60, + "stop_rule": "Stop after the two receipt orbits are hashed with the frozen reflections and compared with one independent weight-12 census. Do not remeasure the #5729 timing claim, recompute quadratic ranks, or bind another decoder.", + "outcome": "completed", + "evidence": "Two half-splits and engine batches 16 and 8 agree on zero plus 1638 weight-12 words. The frozen 63 reflections send the two receipt representatives to orbits of sizes 630 and 1008 whose SHA256 values are the receipt hashes. Those orbits are disjoint and their union is the census. Deleting one word, overlapping the orbits, or moving the diagonal representative fails.", + "author": "unpaidmoon", + "ai_assistance": "Substantial Cursor Grok assistance.", + "open_questions": [ + { + "question": "Do the two receipt representatives still have quadratic ranks 6 and 2, with every single omission of rank 11, on this same support set?", + "why_it_matters": "The orbit hashes identify the sets. They do not rerun the rational-lift or quadratic-form half of the classification, so the receipt is not a fully replayed theorem.", + "first_step": "Evaluate form_a and form_b from source/verify.py on the pinned roots and compare supported_rank and quadratic_matrix with the receipt.", + "blocked_by": "This package does not recompute those ranks." + }, + { + "question": "Does the same orbit partition hold for one other deletion or decoder code named by the bit-lane proof?", + "why_it_matters": "The published iterator open question asks to bind another consumer before treating the speedup as coverage outside this E7 kernel.", + "first_step": "Name that code's generators, width and weight bound, then compare one half-split with low_weight_words on that basis alone.", + "blocked_by": "No second consumer is pinned here." + } + ] +} diff --git a/research/e7-orbit-hash-partition/VERIFY.json b/research/e7-orbit-hash-partition/VERIFY.json new file mode 100644 index 0000000000..5264462f64 --- /dev/null +++ b/research/e7-orbit-hash-partition/VERIFY.json @@ -0,0 +1,24 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/e7-bitsliced-exhaustion/binary.py", + "research/e7-bitsliced-exhaustion/source/RESULT.json", + "research/e7-bitsliced-exhaustion/source/vendor/PR5238.py", + "research/e7-bitsliced-exhaustion/source/verify.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Hash the four live inputs, recover the weight-12 set by two half-splits, match engine batches 16 and 8, and compare both frozen reflection orbits with the receipt hashes. Reject a deleted word, an overlapping orbit, and a moved representative." + } + ] +} diff --git a/research/e7-orbit-hash-partition/verify.py b/research/e7-orbit-hash-partition/verify.py new file mode 100644 index 0000000000..059a7fb40c --- /dev/null +++ b/research/e7-orbit-hash-partition/verify.py @@ -0,0 +1,214 @@ +#!/usr/bin/env python3 +"""The independent E7 weight-12 set is the two receipt reflection orbits. + +The half-split census does not call the predecessor Gray-code loop, orbit +search, or quadratic-rank checks. It lists one basis split by doubling. The +orbit maps are the frozen functions in source/verify.py. +""" + +import json +from hashlib import sha256 +from pathlib import Path +from runpy import run_path + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +WIDTH = 63 +DIMENSION = 27 +WEIGHT_BOUND = 12 +DIAGONAL_HASH = "d08f659fab919baab7b2c87c0b7e55edb5a3e23e05a313522f0b17e684d8ee39" +PRODUCT_HASH = "a9bb36def7396f184d343e38f410d705a50be3188b40725235f866ad0753309b" + + +def need(condition, message): + if not condition: + raise ValueError(message) + + +def authenticate(): + sources = json.loads((HERE / "SOURCES.json").read_text(encoding="utf-8")) + checked = 0 + for row in sources["files"]: + if row["usage"] != "input": + continue + path = ROOT / row["path"] + digest = sha256(path.read_bytes()).hexdigest() + need(digest == row["sha256"], "input hash mismatch: " + row["path"]) + checked += 1 + need(checked == 4, "four live inputs") + return checked + + +def span(generators): + words = [0] + for generator in generators: + # Snapshot this span. A generator would also visit the elements extend appends. + words.extend([word ^ generator for word in words]) + need(len(set(words)) == len(words), "half span repeats a word") + return words + + +def half_split(basis, maximum, low_dimension): + need(0 < low_dimension < len(basis), "split must use both halves") + lows = span(basis[:low_dimension]) + highs = span(basis[low_dimension:]) + distinct = len(lows) * len(highs) + need(distinct == 1 << len(basis), "halves do not cover the basis span") + found = set() + minimum = maximum + 1 + for high in highs: + for low in lows: + word = high ^ low + weight = word.bit_count() + if word and weight < minimum: + minimum = weight + if weight <= maximum: + found.add(word) + return found, minimum, distinct + + +def free_coordinate_identity(basis, free): + need(len(basis) == len(free) == DIMENSION, "E7 kernel dimension") + need(len(set(free)) == DIMENSION, "repeated free coordinate") + for index, vector in enumerate(basis): + need(0 < vector < 1 << WIDTH, "kernel vector outside F_2^63") + pattern = tuple((vector >> coordinate) & 1 for coordinate in free) + identity = tuple(int(place == index) for place in range(DIMENSION)) + need(pattern == identity, "free coordinates are not a basis identity") + + +def orbit_digest(words): + return sha256(json.dumps(sorted(words)).encode()).hexdigest() + + +def mask_of(indices): + mask = 0 + for index in indices: + need(0 <= index < WIDTH, "support index outside F_2^63") + bit = 1 << index + need(mask & bit == 0, "repeated support index") + mask |= bit + return mask + + +def reject(fn): + try: + fn() + except ValueError: + return + raise ValueError("invalid control accepted") + + +def load_receipt(): + receipt = json.loads( + (ROOT / "research/e7-bitsliced-exhaustion/source/RESULT.json").read_text( + encoding="utf-8" + ) + ) + orbits = receipt["orbits"] + need(len(orbits) == 2, "receipt orbit count") + need(orbits[0]["type"] == "diagonal" and orbits[0]["supports"] == 630, "diagonal orbit") + need(orbits[1]["type"] == "product" and orbits[1]["supports"] == 1008, "product orbit") + need(orbits[0]["orbit_sha256"] == DIAGONAL_HASH, "diagonal hash pin") + need(orbits[1]["orbit_sha256"] == PRODUCT_HASH, "product hash pin") + need(DIAGONAL_HASH != PRODUCT_HASH, "orbit hashes are not distinct") + need(receipt["minimum_support"] == WEIGHT_BOUND, "receipt minimum") + need(receipt["minimum_supports"] == 1638, "receipt support count") + need(receipt["reflection_generators"] == 63, "receipt reflection count") + return receipt + + +def check(): + authenticate() + receipt = load_receipt() + frozen = run_path( + str(ROOT / "research/e7-bitsliced-exhaustion/source/verify.py"), + run_name="e7_frozen_orbits", + ) + geometry = run_path( + str(ROOT / "research/e7-bitsliced-exhaustion/source/vendor/PR5238.py"), + run_name="e7_orbit_geometry", + ) + roots = geometry["intrinsic_e7"]() + frames = geometry["orthogonal_frames"](roots) + need(len(roots) == 63 and len(frames) == 135, "root or frame count") + rows = tuple(sum(1 << index for index in frame) for frame in frames) + basis, free = geometry["binary_kernel"](rows) + free_coordinate_identity(basis, free) + permutations = frozen["reflections"](roots, frames, geometry["dot"]) + need(len(permutations) == 63, "frozen reflection count") + need(all(sorted(perm) == list(range(63)) for perm in permutations), "root permutation") + + splits = {} + for low_dimension in (13, 16): + found, minimum, distinct = half_split(basis, WEIGHT_BOUND, low_dimension) + splits[low_dimension] = (found, minimum, distinct) + need(splits[13][0] == splits[16][0], "two basis splits disagree") + need(splits[13][1] == splits[16][1] == WEIGHT_BOUND, "minimum left twelve") + need(splits[13][2] == splits[16][2] == 1 << DIMENSION, "span missed a codeword") + found = splits[16][0] + supports = found - {0} + need(0 in found and len(supports) == 1638, "support count") + need(all(word.bit_count() == WEIGHT_BOUND for word in supports), "a lighter nonzero word") + + engine = run_path( + str(ROOT / "research/e7-bitsliced-exhaustion/binary.py"), + run_name="e7_orbit_engine", + )["low_weight_words"] + for batch_bits in (16, 8): + produced = set(engine(basis, WIDTH, WEIGHT_BOUND, batch_bits)) + need(produced == found, "engine batch " + str(batch_bits) + " is not the census") + + built = [] + for row in receipt["orbits"]: + mask = mask_of(row["representative_support"]) + need(mask.bit_count() == WEIGHT_BOUND, "representative weight") + current = frozen["orbit"](mask, permutations) + need(mask in current, "representative left its orbit") + need(len(current) == row["supports"], "orbit size") + need(orbit_digest(current) == row["orbit_sha256"], "orbit hash") + need(current <= supports, "orbit left the weight-12 set") + need(all(word.bit_count() == WEIGHT_BOUND for word in current), "orbit weight") + built.append(current) + frozen["partition"](supports, built) + need(built[0].isdisjoint(built[1]), "orbits meet") + need(built[0] | built[1] == supports, "orbit union missed a weight-12 word") + + witness = next(iter(supports)) + reject(lambda: frozen["partition"](supports - {witness}, built)) + reject(lambda: frozen["partition"](supports, [built[0], built[1] | built[0]])) + damaged = set(built[0]) + damaged.pop() + need(orbit_digest(damaged) != DIAGONAL_HASH, "a deleted orbit word kept the receipt hash") + moved = mask_of(receipt["orbits"][0]["representative_support"]) + moved ^= 1 << receipt["orbits"][0]["representative_support"][0] + moved_orbit = frozen["orbit"](moved, permutations) + need(orbit_digest(moved_orbit) != DIAGONAL_HASH, "a moved representative kept the receipt hash") + need(not moved_orbit <= supports, "a weight-11 seed stayed inside the weight-12 set") + return { + "status": "PASS_E7_ORBIT_HASH_PARTITION", + "minimum_supports": len(supports), + "diagonal_supports": len(built[0]), + "product_supports": len(built[1]), + "diagonal_sha256": DIAGONAL_HASH, + "product_sha256": PRODUCT_HASH, + "reflection_generators": len(permutations), + "splits": [13, 16], + "engine_batches": [16, 8], + "quadratic_ranks_replayed": False, + "no_new_kappa": True, + } + + +if __name__ == "__main__": + result = check() + print( + "PASS_E7_ORBIT_HASH_PARTITION" + " supports={minimum_supports}" + " diagonal={diagonal_supports}" + " product={product_supports}" + " reflections={reflection_generators}" + " quadratic_ranks_replayed=false" + " no_new_kappa=true".format(**result) + ) + print(json.dumps(result, indent=2, sort_keys=True))