From 71ba94c981477b3527ef21dd0f8140e795a7664d Mon Sep 17 00:00:00 2001 From: Agastya Sondhi Date: Tue, 13 Oct 2026 00:52:13 -0400 Subject: [PATCH] Tooling: use exact bitsets in pinned owner footprint checks Add an opt-in source-pinned adapter, exact-set equivalence argument, repinned negative controls and same-input full-process benchmark evidence. Prepared with substantial OpenAI Codex assistance; no new kappa claim. --- research/owner-footprint-bitsets/CLAIM.json | 59 +++ research/owner-footprint-bitsets/NOTICE.md | 35 ++ research/owner-footprint-bitsets/ORIGINS.json | 58 +++ research/owner-footprint-bitsets/PROOF.md | 55 +++ research/owner-footprint-bitsets/README.md | 144 +++++++ research/owner-footprint-bitsets/adapter.py | 96 +++++ research/owner-footprint-bitsets/benchmark.py | 93 ++++ .../evidence/EXPECTED.json | 39 ++ .../evidence/SUMMARY.json | 28 ++ .../evidence/benchmark-python312.json | 403 ++++++++++++++++++ .../evidence/benchmark-python314-initial.json | 403 ++++++++++++++++++ .../evidence/benchmark-python314.json | 403 ++++++++++++++++++ .../evidence/pilot.json | 22 + .../evidence/validation-final-python312.json | 177 ++++++++ .../evidence/validation-final-python314.json | 177 ++++++++ .../evidence/validation.json | 177 ++++++++ .../owner-footprint-bitsets/test_masks.py | 100 +++++ research/owner-footprint-bitsets/verify.py | 205 +++++++++ .../workflow.example.yml | 22 + 19 files changed, 2696 insertions(+) create mode 100644 research/owner-footprint-bitsets/CLAIM.json create mode 100644 research/owner-footprint-bitsets/NOTICE.md create mode 100644 research/owner-footprint-bitsets/ORIGINS.json create mode 100644 research/owner-footprint-bitsets/PROOF.md create mode 100644 research/owner-footprint-bitsets/README.md create mode 100644 research/owner-footprint-bitsets/adapter.py create mode 100644 research/owner-footprint-bitsets/benchmark.py create mode 100644 research/owner-footprint-bitsets/evidence/EXPECTED.json create mode 100644 research/owner-footprint-bitsets/evidence/SUMMARY.json create mode 100644 research/owner-footprint-bitsets/evidence/benchmark-python312.json create mode 100644 research/owner-footprint-bitsets/evidence/benchmark-python314-initial.json create mode 100644 research/owner-footprint-bitsets/evidence/benchmark-python314.json create mode 100644 research/owner-footprint-bitsets/evidence/pilot.json create mode 100644 research/owner-footprint-bitsets/evidence/validation-final-python312.json create mode 100644 research/owner-footprint-bitsets/evidence/validation-final-python314.json create mode 100644 research/owner-footprint-bitsets/evidence/validation.json create mode 100644 research/owner-footprint-bitsets/test_masks.py create mode 100644 research/owner-footprint-bitsets/verify.py create mode 100644 research/owner-footprint-bitsets/workflow.example.yml diff --git a/research/owner-footprint-bitsets/CLAIM.json b/research/owner-footprint-bitsets/CLAIM.json new file mode 100644 index 0000000000..c2a9c36d0e --- /dev/null +++ b/research/owner-footprint-bitsets/CLAIM.json @@ -0,0 +1,59 @@ +{ + "track": "verification engineering", + "assignment_seed": 91, + "random_source": "Python secrets.randbelow(100), operating-system randomness", + "base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60", + "claimed_at_utc": "2026-10-13T04:40:00Z", + "expected_finish_utc": "2026-10-13T05:16:00Z", + "scope": "Exact integer bit masks for occupied-cell overlap, union, cardinality and compact-prefix checks in PR626 extras/check_owner_map.py. No arithmetic-engine or construction changes.", + "method": "Same-input paired full-check benchmarks; exhaustive small occupancy states, seed-91 randomized larger domains, and repinned whole-check corruptions.", + "deliverable": "Isolated source-pinned opt-in adapter, equivalence argument, negative controls and raw timings. No new kappa.", + "candidates": [ + { + "task": "Selected-source inventory hashing", + "decision": "Not chosen: filesystem-dependent benefit and weaker mathematical focus." + }, + { + "task": "PR626 owner footprint set-to-bitmask substitution", + "decision": "Chosen: narrow exact finite-set operations, distinct from arithmetic PRs 667/672." + }, + { + "task": "R420 closed-frame inclusion by set containment", + "decision": "Not chosen: geometry work overlaps the area of PR709; focus elsewhere." + } + ], + "seed_use": "Seed 91 controls randomized occupancy cases, alternating benchmark order, and selection/rotation of owner mutation sites; the representation change is the substantive distinction.", + "coordination": "Only open issue found is #650 requesting Discussions; no sprint issue available, so claim is local.", + "overlap": { + "latest_pr_seen": 709, + "relevant_prs": [ + 672, + 667, + 662, + 707, + 709, + 452, + 367, + 704 + ], + "searches": [ + "is:open (performance OR tooling OR fast OR reproducibility OR cache)", + "is:open \"owner\" \"performance\"", + "is:open \"bitset\"", + "is:open \"footprint\" \"checker\"" + ], + "finding": "No footprint-mask optimization found. PR672 shares this checker but changes only its exponential arithmetic; neither imported nor composed here." + }, + "result": { + "status": "completed tooling improvement; no new kappa", + "summary": "Exact footprint masks preserve complete receipts and rejection coverage. Final 31-pair medians reduce full independent-check wall time by 18.7% on Python 3.14.6 and 12.9% on Python 3.12.11.", + "reviewable_result": "https://github.com/TMM2009/integer-mult-bounds/tree/codex/owner-footprint-bitsets-seed91/research/owner-footprint-bitsets", + "validation": "Five kernel tests, 19 whole-check negative controls, optimized-Python baselines, source pins and minimal relocated replay.", + "overlap_refresh": { + "open_pr_count": 539, + "latest_pr": 720, + "conclusion": "No occupied-cell bitmask contribution found. Same-checker PR672 changes exponential arithmetic and is credited, not imported." + }, + "upstream_main_at_refresh": "66849e1475c930fd7732b1a0067ffee7e1e95f60" + } +} diff --git a/research/owner-footprint-bitsets/NOTICE.md b/research/owner-footprint-bitsets/NOTICE.md new file mode 100644 index 0000000000..46cb738cf4 --- /dev/null +++ b/research/owner-footprint-bitsets/NOTICE.md @@ -0,0 +1,35 @@ +# Attribution and license + +This isolated tooling contribution was prepared for **Agastya Sondhi +(@TMM2009)** with substantial **OpenAI Codex assistance**, including the +representation change, proof argument, code, tests, benchmarks and writing. +No independent human review is claimed. Apache-2.0 applies through the +repository LICENSE. + +The original independent owner checker and exact rational interval module +are **Chafik Boukhalfa / chafreaky's PR626** contribution. The adapter executes +them from their original repository locations and retains their bytes. The +original Python-set implementation is the reference oracle; it is not a new +contribution here. The four replacement anchors derive from that code. + +**Jeremy Kothe / jeremykothe2's PR622 and PR623**, with their disclosed Claude +assistance, supply the K-triangle providers and inherited dispatch/owner +geometry. PR626 supplies the selected repaired owner map. **GamingPuzzled / +Joel Pulikkan's PR620** is credited in the maintainer review for the owner +headroom lead. The frozen native files used here are the archived PR622 +outputs retained by the maintainer review, not newly reconstructed providers. + +The cumulative supplier work includes **DreamingOfClouds**, **icekylinx**, +**Rohan Arun**, **eumemic**, and their credited predecessors. The original +[package notice](../complex-k492-owner-repair/NOTICE.md), its bundled notices +and the [maintainer review](../../docs/research/community-k492-review.md) +remain the authoritative detailed lineage. Their licensing and AI disclosures +are not replaced by this notice. + +Concurrent **PR672** optimizes exponential intervals in the same independent +checker, and **PR667** optimizes another exact logarithm engine. They informed +overlap avoidance but are not imported or composed. **PR709** caches R420 +geometry, **PR707** reuses Gram determinant prefixes, **PR662** accelerates +Clifford helpers, and **PR367/452** optimize other verification workloads. +This contribution changes only owner occupied-cell representation. No +priority claim is made for the standard bit-set encoding itself. diff --git a/research/owner-footprint-bitsets/ORIGINS.json b/research/owner-footprint-bitsets/ORIGINS.json new file mode 100644 index 0000000000..0b31c4857d --- /dev/null +++ b/research/owner-footprint-bitsets/ORIGINS.json @@ -0,0 +1,58 @@ +{ + "base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60", + "selected_kappa": "51110230636731/31250000000000000", + "source_pr626": "660de893d27bb7abd1d5b01b1640207528a5c851", + "source_pr622": "f69477f4f6d3c7eb1f740b166881bffed4ffa9f6", + "source_pr623": "e39a615ca601ce5d62abeb24f3fcdb8644ca1005", + "native_artifacts": "Archived exact PR622 outputs; no fresh supplier reconstruction claimed. Inherited checker requires these immutable compressed bytes.", + "files": { + "research/complex-k492-owner-repair/extras/check_owner_map.py": { + "sha256": "d240458ad39a08c242d136c0f1edbda0cb0b93977897f6543c9f430576c9c7dd", + "git_blob": "abf1964e62f3dce04801dd80246626209beb13d7" + }, + "research/complex-k492-owner-repair/extras/exact_intervals.py": { + "sha256": "aa3c2327c5d3742248b720a87b2de0bbe2e34ed2af89a578e3c8d5bd2656a9cf", + "git_blob": "8a904997c9692fee7c9447e9a0e43748d0021186" + }, + "research/complex-k492-owner-repair/data/SPEC.json": { + "sha256": "2a2577ac526535826fed9d5f7f83f6e2e0ec058a146c64f7286720b995fa2323", + "git_blob": "cdc4f6ce03e96fd1ffc5a19926e1d0d4bce4e9de" + }, + "research/complex-k492-owner-repair/data/PLAN.json": { + "sha256": "8c48ef6ce079916314126c5c3ff0003b32f24cf0fbfb2a033fc93e1e1949b5d5", + "git_blob": "434a431937757def4e496301e3d33106f0026fa3" + }, + "research/complex-k492-owner-repair/data/OWNERS.json.gz": { + "sha256": "251e82cec1f40e6c1289703667f403104b957f1254dc4f6baa6df9a3d0c751de", + "git_blob": "1fadba6f4217269eabc4994b565f3daef3005d64" + }, + "research/complex-k492-owner-repair/comparison/PR623-SPEC.json": { + "sha256": "436d3df54e6ce2433d56435afd569708e5fb22bc638571f5134ab12a9f9099f5", + "git_blob": "48f6e2a62a121b7f536c432c46ea58575ee0969f" + }, + "research/complex-k492-owner-repair/comparison/PR623-PLAN.json": { + "sha256": "c919c366ef1d3528f1884e47dfce858ab3164b099740e4c17cde6f697b3ec458", + "git_blob": "e310a7e26f141eadcbdfb9360d60858a2a0a1cd9" + }, + "research/complex-k492-owner-repair/comparison/PR622-NATIVE-HASHES.json": { + "sha256": "28479a183387bcb608bd9ee0572f617c17f316b79ce4a6fa1277ed8689fb3431", + "git_blob": "05e48488e9d1d5fe98d32d60777ae88cc272c5ab" + }, + "research/community-k492-audit/pr622/replay/mixed-global/base/providers/ck/CANONICAL-WORD.json.gz": { + "sha256": "ae3018c0646be06f47d345bb8baf0e6ea9220096a949fa30a8f7656aa4ad6f45", + "git_blob": "58cd1be8f28b74bea83c435eee1f52b36a274281" + }, + "research/community-k492-audit/pr622/replay/mixed-global/base/providers/ck/LOCAL-PROGRAMS.json.gz": { + "sha256": "b5da54e049cc127a1065190a647cb71cac0c6ba03d9ccdb71719f4fcbfa886f3", + "git_blob": "61ef73c1f958e0d26f3e7a3a82bc3826b7098c93" + }, + "research/community-k492-audit/pr622/replay/mixed-global/base/providers/jp8/CANONICAL-WORD.json.gz": { + "sha256": "7a3fec1022d3b2b1bd986302a327735ec521d17b043f4a5acb96253a56f6193c", + "git_blob": "7fd7cd1fefbb8b0e12397b355d9f6e227813bd58" + }, + "research/community-k492-audit/pr622/replay/mixed-global/base/providers/jp8/LOCAL-PROGRAMS.json.gz": { + "sha256": "fa0c196f65bd6ec1424fdf7d789f6972075c7bb02bf43f573ea85eafab31be98", + "git_blob": "e22169a1633638213a5c63425a1919c7185f4c43" + } + } +} diff --git a/research/owner-footprint-bitsets/PROOF.md b/research/owner-footprint-bitsets/PROOF.md new file mode 100644 index 0000000000..7b667c0f2b --- /dev/null +++ b/research/owner-footprint-bitsets/PROOF.md @@ -0,0 +1,55 @@ +# Exact representation change + +The domain is the pinned PR626 independent owner checker on integer-valued +JSON owner/plan/native inputs that reach its footprint operations. It checks +`0 <= offset <= offset + w <= cap` before creating the interval. Thus the +interval endpoints and width used by the substitution are nonnegative. +Malformed noninteger inputs are outside this equivalence claim; neither +implementation is presented as a general JSON schema validator. + +For a finite set S of nonnegative integers define + + encode(S) = sum(2**i for i in S). + +Distinct indices occupy distinct binary digits. Consequently: + +- `encode(S) & encode(T)` is zero exactly when S and T are disjoint. +- `encode(S) | encode(T) = encode(S union T)`. +- `encode(S).bit_count() = len(S)`. +- `encode(range(offset, offset + w)) = ((1 << w) - 1) << offset`, + including w = 0. + +A nonnegative integer m has `m & (m + 1) == 0` exactly when m has a suffix +of k one-bits and no higher one-bits, including k = 0. Indeed, adding one +clears the trailing ones and sets the first zero bit. Any higher one-bit +would survive the AND; if no such bit exists, the AND is zero. Therefore +this predicate is equivalent to + + S == set(range(len(S))). + +Induct over the owner rows. The original dictionary defaults to an empty +set; the replacement defaults to zero. Assume both represent the same +occupied cells at a row's start. Every check before interval creation is +unchanged. The interval formula gives the same new cells; the overlap +predicate agrees and, on acceptance, union restores the invariant. Both +stop at the same failed `need` predicate for this row. After all rows, the +compact-prefix predicate and cardinality agree for every owner, including +unused owners. Every idle remainder `cap - len(S)` is identical. The paid +profile, rank-mass check, exact rational moments and outer comparison then +execute the original code on identical values. Dictionary iteration order +and all receipt fields are unchanged. + +The adapter performs four exact, counted textual substitutions, only after +checking SHA-256 pins of the original checker and rational interval module. +It executes every original `need` statement. It neither caches acceptance +nor changes a moment engine, footprint capacity, window or owner row. +The same source-only admission is used for both adapter engines. The timed +reference is the original direct CLI, so the candidate pays its additional +pin/substitution overhead. + +This is a written equivalence argument for the stated finite operations, +corroborated by bounded tests. It is not proof-assistant formalization, +a proof of the construction's inherited physical interfaces, or a proof of +the full multiplication theorem. Tests do not enlarge this mathematical +scope. The original checker itself is a supplemental audit; its recorded +success does not replace the native/controller/outer-assembly pipeline. diff --git a/research/owner-footprint-bitsets/README.md b/research/owner-footprint-bitsets/README.md new file mode 100644 index 0000000000..d838b96c3e --- /dev/null +++ b/research/owner-footprint-bitsets/README.md @@ -0,0 +1,144 @@ +# Exact owner-footprint bitsets + +**Tooling improvement; no new κ.** Replace the occupied-cell Python sets in +PR626's independent owner checker with exact integer bit masks. On the same +frozen inputs, final local 31-pair runs measured **12.9–18.7% less wall time +for the complete checker**. Every result receipt is byte-identical. + +The scope is one supplemental check of 35,424 helper roles. This does not +change a supplier, owner map, mathematical bound, selected pointer or default +verification command. The original source packages and `upstream/` stay intact. + +## Reproduce + +From the repository root, with Python 3.11+ and its standard library: + +```sh +python3 -I -B research/owner-footprint-bitsets/verify.py +``` + +Expected final line: + +```text +PASS_OWNER_FOOTPRINT_MASKS baseline_runs=6 negative_controls=19 positive_controls=1 +``` + +The command uses the immutable archived PR622 native artifacts already in the +repository. It copies only its 12 pinned execution inputs into a temporary +path containing spaces, replays the original direct CLI and both adapter +engines (including optimized Python), then checks repinned corruptions and a +valid row permutation. Temporary files are removed; repository inputs are +unchanged. This is not a fresh reconstruction of the native suppliers. + +Additional arithmetic-oracle tests and reproducible timing: + +```sh +python3 -I -B research/owner-footprint-bitsets/test_masks.py +python3 -I -B -O research/owner-footprint-bitsets/test_masks.py +python3 -I -B research/owner-footprint-bitsets/benchmark.py --pairs 31 --out /tmp/owner-mask-benchmark.json +``` + +Expected: five tests pass in each test invocation, followed by +`PASS_OWNER_FOOTPRINT_BENCHMARK` for the benchmark. Choose a fresh output path; +it is never overwritten. Timing has no pass/fail speed threshold. The +benchmark checks every complete receipt, including the exact moment fractions. + +To use the adapter with the pinned checker on a separately prepared work +directory, pass its original arguments to `adapter.py`, for example +`--work /path/to/work --out /path/to/new-result.json`. The inherited provider +defaults are `work/ck-local` and `work/jp8-local`; original `--provider PID=DIR` +overrides are supported. The default engine is `masks`; `--engine sets` runs +the reference code through the same adapter. Source drift is rejected. +Input changes must satisfy the original checker's plan, owner and native +bindings. The standalone adapter does not claim an audit of a changed supplier. + +## What changes, and why coverage is retained + +The adapter pins the original checker and rational-interval source, then +makes four counted substitutions: empty set to zero, interval to bit mask, +compact-prefix set equality to a binary predicate, and cardinality to +`int.bit_count()`. Intersection and union continue to use `&` and `|`. +Every original `need` statement and the complete moment arithmetic execute +unchanged. The [equivalence argument](PROOF.md) proves these finite-set +operations agree for nonnegative integer cells, including empty intervals. +No accepted result or geometry is cached. + +Validation covers: + +- 18,943 exhaustive subset/interval comparisons for capacities 0 through 8, + 2,000 seed-91 larger cases through capacity 4,096, and sparse/boundary cases + through bit 8,192. The oracle uses Python sets and integer powers. +- Five actual adapter-source mutations caught by the independent set oracle: + omitted offset, off-by-one interval, displaced interval, and two incorrect + compact-prefix predicates. +- Fifteen whole-check mathematical/data controls: overlap, an interior gap, + negative offset, capacity overflow, width, duplicate helper, physical family, + copy, stage, missing role, paid profile, both failed moment thresholds, + native forward/backward disagreement, and changed inherited geometry. +- Two inherited input-pin and two adapter source-pin controls. Changes are + repinned where necessary to reach the stated predicate; the native-program + control also updates its immutable-hash declaration intentionally. These are + invalid-input controls, not defects alleged against the accepted construction. +- Exact matching rejection diagnostics for both adapter engines. A shuffled + valid role list and the six baseline invocations retain the full original + receipt, including idle remainders and both rational moment brackets. + +The final full-control receipts agree on Python 3.14.6 and 3.12.11. Normal and +optimized unit suites pass on 3.14.6; normal unit tests also pass on 3.12.11. +The selected-record binding check and staged whitespace check pass. A separate +minimal relocated package replay is recorded in `evidence/SUMMARY.json`. +A scoped Linux workflow is supplied as `workflow.example.yml` for maintainer +installation. It is not enabled: the publishing credential lacks GitHub +`workflow` scope. Local evidence is not a remote CI claim. + +## Measured result + +All samples start a fresh interpreter. The reference is the **unchanged direct +CLI**; the candidate includes adapter import, source hashing and transformation. +The same archived inputs are used for every sample, with alternating order +starting with the reference (seed 91). OS caches were not flushed, and other +system activity was not controlled. The raw samples, child CPU times and code +hashes are retained in `evidence/benchmark-*.json`. + +| Interpreter, macOS arm64 | Pairs | Original median | Masks median | Wall reduction | Masks faster | +| --- | ---: | ---: | ---: | ---: | ---: | +| CPython 3.14.6 | 31 | 0.5620 s | 0.4571 s | 18.7% | 27/31 | +| CPython 3.12.11 | 31 | 0.5108 s | 0.4447 s | 12.9% | 28/31 | + +An earlier 31-pair 3.14 run measured 21.1%; the seven-pair inline-mask pilot +measured 14.0%. Both are retained, not substituted for the final measurements. +The adapter kernel is unchanged between the 31-pair runs. `verify.py` was +strengthened before the final runs: the physical-family control now reaches +that exact formula guard, and failure strings must match exactly. The older +`validation.json` records the earlier, weaker diagnostic check; the two +`validation-final-*.json` files are the final evidence. + +No full-frontier wall-time, memory reduction, practical multiplication speedup +or universal performance guarantee is claimed. + +## Provenance and remaining scope + +Base: `66849e1475c930fd7732b1a0067ffee7e1e95f60`. +Selected conditional κ remains `51110230636731/31250000000000000`, or +`0.001635527380375392`: #626 with #543, as specified by +`certificates/selected-result.json` and its actual #626 assembly/review. +[ORIGINS.json](ORIGINS.json) pins all 12 execution inputs by SHA-256 and Git blob, +and records the immutable #626/#622/#623 source commits. Native files are +original archived compressed inputs; the inherited exact-byte native check is +retained. No claim about regenerated gzip container equality is added. + +OS assignment seed **91**, verification-engineering track. Three narrow +candidates, the local claim, seed use and overlap review are in +[CLAIM.json](CLAIM.json). No open sprint issue was available. The final refresh +covered 539 open PRs through #720. PR672 optimizes exponential intervals in the +same checker; this work changes footprint representation and does not compose +its kernel. PR667/662/707/709/367/452 address other costs. Their descriptions +were considered for overlap, not independently verified here. + +Repository-wide `make verify`, selected supplier cold replay, full controller +and 47-inequality assembly, and Lean were not rerun for this isolated opt-in +adapter. All-size/compiler/common-label/mutable-basis, whole-call hosting, +residual, precision/tape/exact-recovery and analytic-transfer obligations remain +inherited. Finite equivalence tests are not a formal proof of the multiplication +theorem. Original sources and contributor notices are retained; see +[NOTICE.md](NOTICE.md) for attribution and substantial AI-assistance disclosure. diff --git a/research/owner-footprint-bitsets/adapter.py b/research/owner-footprint-bitsets/adapter.py new file mode 100644 index 0000000000..37657483f6 --- /dev/null +++ b/research/owner-footprint-bitsets/adapter.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 +"""Opt-in exact footprint masks for the pinned PR626 independent owner checker. + +Agastya Sondhi (@TMM2009), with substantial OpenAI Codex assistance. +Apache-2.0. Original checker: Chafik Boukhalfa/chafreaky; see NOTICE.md. +""" +import argparse +import hashlib +import json +from pathlib import Path +import sys + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +PACKAGE = Path('research/complex-k492-owner-repair') +CHECKER = PACKAGE / 'extras/check_owner_map.py' +INTERVALS = PACKAGE / 'extras/exact_intervals.py' + +# Exact, counted edits to the source-pinned checker. Its remaining code executes +# unchanged, including every need(), actual native width and moment calculation. +REPLACEMENTS = ( + ('used=defaultdict(set);', 'used=defaultdict(int);'), + ("cells=set(range(r['offset'],r['offset']+w));", + "cells=interval_mask(r['offset'],w);"), + ('cells==set(range(len(cells)))', 'is_prefix(cells)'), + ('len(cells) 1 for r in paired), samples=rows, + scope='Independent owner checker only, not full supplier replay or multiplication runtime.') + with args.out.open('x') as f: + json.dump(receipt, f, indent=2) + f.write('\n') + print('PASS_OWNER_FOOTPRINT_BENCHMARK', json.dumps(medians), + 'ratio_of_medians=%.3f' % receipt['ratio_of_medians']) + + +if __name__ == '__main__': + main() diff --git a/research/owner-footprint-bitsets/evidence/EXPECTED.json b/research/owner-footprint-bitsets/evidence/EXPECTED.json new file mode 100644 index 0000000000..5386329b0e --- /dev/null +++ b/research/owner-footprint-bitsets/evidence/EXPECTED.json @@ -0,0 +1,39 @@ +{ + "status": "PASS_INDEPENDENT_K492_REPAIR_MAP_NATIVE_PROFILE_AND_EXACT_MOMENT", + "calls": 72, + "roles": 35424, + "profile": { + "1": 181659, + "2": 30016, + "4": 11520, + "8": 576, + "3": 31104, + "5": 5040, + "6": 576, + "48": 2215, + "37": 1 + }, + "idle": { + "48": 2215, + "1": 123, + "37": 1 + }, + "costs": [ + { + "endpoint": "PR623", + "b": "409542469115240367371/250000000000000000000000", + "lower": "840852736013560293328604383133667675650564601155667134897780404027/840852828791136287541189252286806108046178027338759310171139211264", + "upper": "210213184003390073332151095783416918912641150288916835925533601123/210213207197784071885297313071701527011544506834689827542784802816", + "strict_margin_lower": "23194393998553146217288284608098903356545772991617251201693/210213207197784071885297313071701527011544506834689827542784802816" + }, + { + "endpoint": "candidate", + "b": "65528268492323474503/40000000000000000000000", + "lower": "840852828791136287541187279585234899201046420975209615750770325295/840852828791136287541189252286806108046178027338759310171139211264", + "upper": "840852828791136287541187279585234899201046420975209824634958499591/840852828791136287541189252286806108046178027338759310171139211264", + "strict_margin_lower": "1972701571208845131606363549485536180711673/840852828791136287541189252286806108046178027338759310171139211264" + } + ], + "kappa": "51110230636731/31250000000000000", + "scope": "Exact literal owners using the inherited phase-window geometry, native word widths and actual program child counts. Separate strict pipeline supplies physical chart/controller and full finite/outer admission." +} diff --git a/research/owner-footprint-bitsets/evidence/SUMMARY.json b/research/owner-footprint-bitsets/evidence/SUMMARY.json new file mode 100644 index 0000000000..448066d561 --- /dev/null +++ b/research/owner-footprint-bitsets/evidence/SUMMARY.json @@ -0,0 +1,28 @@ +{ + "python": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]", + "base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60", + "minimal_portable_replay": [ + { + "command": "python3 -I -B research/owner-footprint-bitsets/test_masks.py", + "exit_code": 0, + "stdout": "", + "stderr": ".....\n----------------------------------------------------------------------\nRan 5 tests in 1.665s\n\nOK\n" + }, + { + "command": "python3 -I -B research/owner-footprint-bitsets/verify.py", + "exit_code": 0, + "stdout": "PASS_OWNER_FOOTPRINT_MASKS baseline_runs=6 negative_controls=19 positive_controls=1\n", + "stderr": "" + } + ], + "layout": "Only this package plus 12 pinned execution inputs; fresh path with spaces; no .git or other repository files.", + "selected_record_check": "PASS 51110230636731/31250000000000000", + "source_files_sha256": { + "benchmark.py": "f6d568558610d5bb274ac4bfa67d167ca97ff11bac172ab7458ac78d506726ab", + "test_masks.py": "a6550561820e0437b67fc3c51548e83f9dbef79d4a207f8a1799019e55df8aaf", + "adapter.py": "1fc4dfc42a613e5a9ab1b856983dcf52c27f1c3736ea1b72358e206f7fd4f463", + "verify.py": "3dcda41b3a373f6e1bd842d4cde0de1b2d2cf2e9c9b84ca0789ed4280498a410" + }, + "full_repository_replay": "Not run: isolated opt-in adapter; no source/generator/selected construction changes.", + "remote_CI": "Separate from local evidence; not claimed in this receipt." +} diff --git a/research/owner-footprint-bitsets/evidence/benchmark-python312.json b/research/owner-footprint-bitsets/evidence/benchmark-python312.json new file mode 100644 index 0000000000..7bacb3c587 --- /dev/null +++ b/research/owner-footprint-bitsets/evidence/benchmark-python312.json @@ -0,0 +1,403 @@ +{ + "status": "PASS_OWNER_FOOTPRINT_BENCHMARK", + "utc": "2026-10-13T04:48:36.635517+00:00", + "python": "3.12.11 (main, Jun 3 2025, 15:41:47) [Clang 17.0.0 (clang-1700.0.13.3)]", + "executable": "/opt/homebrew/opt/python@3.12/bin/python3.12", + "platform": "macOS-26.6-arm64-arm-64bit", + "pairs": 31, + "order": "alternating; sets first when (91 + pair) % 2 != 0", + "reference": "unchanged pinned checker, direct CLI", + "candidate": "adapter CLI including source pin validation and counted substitution", + "process": "fresh interpreter each sample; same archived inputs; OS caches not flushed", + "code_sha256": { + "adapter.py": "1fc4dfc42a613e5a9ab1b856983dcf52c27f1c3736ea1b72358e206f7fd4f463", + "benchmark.py": "f6d568558610d5bb274ac4bfa67d167ca97ff11bac172ab7458ac78d506726ab", + "test_masks.py": "a6550561820e0437b67fc3c51548e83f9dbef79d4a207f8a1799019e55df8aaf", + "verify.py": "3dcda41b3a373f6e1bd842d4cde0de1b2d2cf2e9c9b84ca0789ed4280498a410" + }, + "origins_sha256": "0491f2d3cce5bdae06295108e82370bfcaa4180e72c1cf41bdc114787d78a33d", + "expected_receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092", + "median_wall_seconds": { + "sets": 0.510805291, + "masks": 0.444691333 + }, + "ratio_of_medians": 1.148673817305992, + "wall_time_reduction_percent": 12.94308402142217, + "median_paired_speedup": 1.1494701979719515, + "pairs_masks_faster": 28, + "samples": [ + { + "pair": 0, + "engine": "sets", + "wall_seconds": 0.673929292, + "child_cpu_seconds": 0.647713 + }, + { + "pair": 0, + "engine": "masks", + "wall_seconds": 0.478294875, + "child_cpu_seconds": 0.46956399999999987 + }, + { + "pair": 1, + "engine": "masks", + "wall_seconds": 0.471083709, + "child_cpu_seconds": 0.4639180000000003 + }, + { + "pair": 1, + "engine": "sets", + "wall_seconds": 0.592671083, + "child_cpu_seconds": 0.5598230000000002 + }, + { + "pair": 2, + "engine": "sets", + "wall_seconds": 0.487758583, + "child_cpu_seconds": 0.4820679999999995 + }, + { + "pair": 2, + "engine": "masks", + "wall_seconds": 0.46473975, + "child_cpu_seconds": 0.45808800000000005 + }, + { + "pair": 3, + "engine": "masks", + "wall_seconds": 0.4659115, + "child_cpu_seconds": 0.46014500000000025 + }, + { + "pair": 3, + "engine": "sets", + "wall_seconds": 0.759341583, + "child_cpu_seconds": 0.6126479999999996 + }, + { + "pair": 4, + "engine": "sets", + "wall_seconds": 0.577620792, + "child_cpu_seconds": 0.5648290000000005 + }, + { + "pair": 4, + "engine": "masks", + "wall_seconds": 0.464044958, + "child_cpu_seconds": 0.4543539999999995 + }, + { + "pair": 5, + "engine": "masks", + "wall_seconds": 0.44638725, + "child_cpu_seconds": 0.44294300000000053 + }, + { + "pair": 5, + "engine": "sets", + "wall_seconds": 0.510805291, + "child_cpu_seconds": 0.5069899999999992 + }, + { + "pair": 6, + "engine": "sets", + "wall_seconds": 0.491377125, + "child_cpu_seconds": 0.4869790000000007 + }, + { + "pair": 6, + "engine": "masks", + "wall_seconds": 0.444691333, + "child_cpu_seconds": 0.4357059999999997 + }, + { + "pair": 7, + "engine": "masks", + "wall_seconds": 0.487514583, + "child_cpu_seconds": 0.45123800000000003 + }, + { + "pair": 7, + "engine": "sets", + "wall_seconds": 0.494041917, + "child_cpu_seconds": 0.4855179999999999 + }, + { + "pair": 8, + "engine": "sets", + "wall_seconds": 0.616789375, + "child_cpu_seconds": 0.6039140000000014 + }, + { + "pair": 8, + "engine": "masks", + "wall_seconds": 0.542731292, + "child_cpu_seconds": 0.5255340000000004 + }, + { + "pair": 9, + "engine": "masks", + "wall_seconds": 0.441419042, + "child_cpu_seconds": 0.4384799999999984 + }, + { + "pair": 9, + "engine": "sets", + "wall_seconds": 1.421212333, + "child_cpu_seconds": 0.7520350000000011 + }, + { + "pair": 10, + "engine": "sets", + "wall_seconds": 0.706790041, + "child_cpu_seconds": 0.6231239999999989 + }, + { + "pair": 10, + "engine": "masks", + "wall_seconds": 0.447310833, + "child_cpu_seconds": 0.4275359999999999 + }, + { + "pair": 11, + "engine": "masks", + "wall_seconds": 0.448248292, + "child_cpu_seconds": 0.44121599999999894 + }, + { + "pair": 11, + "engine": "sets", + "wall_seconds": 0.492849375, + "child_cpu_seconds": 0.4863980000000012 + }, + { + "pair": 12, + "engine": "sets", + "wall_seconds": 0.572104667, + "child_cpu_seconds": 0.5401049999999987 + }, + { + "pair": 12, + "engine": "masks", + "wall_seconds": 0.462942792, + "child_cpu_seconds": 0.44371200000000144 + }, + { + "pair": 13, + "engine": "masks", + "wall_seconds": 0.446379708, + "child_cpu_seconds": 0.4363469999999996 + }, + { + "pair": 13, + "engine": "sets", + "wall_seconds": 0.598457209, + "child_cpu_seconds": 0.565232 + }, + { + "pair": 14, + "engine": "sets", + "wall_seconds": 0.517038667, + "child_cpu_seconds": 0.5039130000000007 + }, + { + "pair": 14, + "engine": "masks", + "wall_seconds": 0.408637208, + "child_cpu_seconds": 0.4049270000000007 + }, + { + "pair": 15, + "engine": "masks", + "wall_seconds": 0.384769042, + "child_cpu_seconds": 0.38200399999999846 + }, + { + "pair": 15, + "engine": "sets", + "wall_seconds": 0.458524292, + "child_cpu_seconds": 0.45525400000000005 + }, + { + "pair": 16, + "engine": "sets", + "wall_seconds": 0.553788375, + "child_cpu_seconds": 0.5353710000000014 + }, + { + "pair": 16, + "engine": "masks", + "wall_seconds": 0.428190208, + "child_cpu_seconds": 0.4178559999999969 + }, + { + "pair": 17, + "engine": "masks", + "wall_seconds": 0.407617, + "child_cpu_seconds": 0.4030930000000019 + }, + { + "pair": 17, + "engine": "sets", + "wall_seconds": 0.453975583, + "child_cpu_seconds": 0.45013700000000156 + }, + { + "pair": 18, + "engine": "sets", + "wall_seconds": 0.835893959, + "child_cpu_seconds": 0.6382439999999967 + }, + { + "pair": 18, + "engine": "masks", + "wall_seconds": 0.887109083, + "child_cpu_seconds": 0.6223859999999988 + }, + { + "pair": 19, + "engine": "masks", + "wall_seconds": 0.540967125, + "child_cpu_seconds": 0.4785130000000031 + }, + { + "pair": 19, + "engine": "sets", + "wall_seconds": 0.515668791, + "child_cpu_seconds": 0.5015070000000001 + }, + { + "pair": 20, + "engine": "sets", + "wall_seconds": 0.463715625, + "child_cpu_seconds": 0.4576299999999982 + }, + { + "pair": 20, + "engine": "masks", + "wall_seconds": 0.426058417, + "child_cpu_seconds": 0.4181410000000021 + }, + { + "pair": 21, + "engine": "masks", + "wall_seconds": 0.43006525, + "child_cpu_seconds": 0.42206799999999944 + }, + { + "pair": 21, + "engine": "sets", + "wall_seconds": 0.451403333, + "child_cpu_seconds": 0.44814799999999977 + }, + { + "pair": 22, + "engine": "sets", + "wall_seconds": 0.469828167, + "child_cpu_seconds": 0.463124999999998 + }, + { + "pair": 22, + "engine": "masks", + "wall_seconds": 0.3884035, + "child_cpu_seconds": 0.385860000000001 + }, + { + "pair": 23, + "engine": "masks", + "wall_seconds": 0.379163042, + "child_cpu_seconds": 0.37621700000000047 + }, + { + "pair": 23, + "engine": "sets", + "wall_seconds": 0.435194834, + "child_cpu_seconds": 0.43266200000000055 + }, + { + "pair": 24, + "engine": "sets", + "wall_seconds": 0.445677375, + "child_cpu_seconds": 0.44234100000000254 + }, + { + "pair": 24, + "engine": "masks", + "wall_seconds": 0.387724167, + "child_cpu_seconds": 0.3814379999999957 + }, + { + "pair": 25, + "engine": "masks", + "wall_seconds": 0.376232333, + "child_cpu_seconds": 0.37245800000000173 + }, + { + "pair": 25, + "engine": "sets", + "wall_seconds": 0.433869166, + "child_cpu_seconds": 0.43109500000000267 + }, + { + "pair": 26, + "engine": "sets", + "wall_seconds": 0.4413435, + "child_cpu_seconds": 0.4384479999999975 + }, + { + "pair": 26, + "engine": "masks", + "wall_seconds": 0.372565042, + "child_cpu_seconds": 0.3701699999999981 + }, + { + "pair": 27, + "engine": "masks", + "wall_seconds": 0.430393917, + "child_cpu_seconds": 0.4253980000000013 + }, + { + "pair": 27, + "engine": "sets", + "wall_seconds": 0.448381625, + "child_cpu_seconds": 0.44544400000000195 + }, + { + "pair": 28, + "engine": "sets", + "wall_seconds": 0.43018325, + "child_cpu_seconds": 0.42827000000000126 + }, + { + "pair": 28, + "engine": "masks", + "wall_seconds": 0.37576775, + "child_cpu_seconds": 0.37280999999999764 + }, + { + "pair": 29, + "engine": "masks", + "wall_seconds": 0.369724125, + "child_cpu_seconds": 0.3669179999999983 + }, + { + "pair": 29, + "engine": "sets", + "wall_seconds": 0.629727459, + "child_cpu_seconds": 0.5721060000000016 + }, + { + "pair": 30, + "engine": "sets", + "wall_seconds": 0.919181916, + "child_cpu_seconds": 0.6967560000000006 + }, + { + "pair": 30, + "engine": "masks", + "wall_seconds": 1.164786833, + "child_cpu_seconds": 0.6654979999999995 + } + ], + "scope": "Independent owner checker only, not full supplier replay or multiplication runtime." +} diff --git a/research/owner-footprint-bitsets/evidence/benchmark-python314-initial.json b/research/owner-footprint-bitsets/evidence/benchmark-python314-initial.json new file mode 100644 index 0000000000..82d1a0205c --- /dev/null +++ b/research/owner-footprint-bitsets/evidence/benchmark-python314-initial.json @@ -0,0 +1,403 @@ +{ + "status": "PASS_OWNER_FOOTPRINT_BENCHMARK", + "utc": "2026-10-13T04:46:06.592431+00:00", + "python": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]", + "executable": "/opt/homebrew/opt/python@3.14/bin/python3.14", + "platform": "macOS-26.6-arm64-arm-64bit-Mach-O", + "pairs": 31, + "order": "alternating; sets first when (91 + pair) % 2 != 0", + "reference": "unchanged pinned checker, direct CLI", + "candidate": "adapter CLI including source pin validation and counted substitution", + "process": "fresh interpreter each sample; same archived inputs; OS caches not flushed", + "code_sha256": { + "adapter.py": "1fc4dfc42a613e5a9ab1b856983dcf52c27f1c3736ea1b72358e206f7fd4f463", + "benchmark.py": "f6d568558610d5bb274ac4bfa67d167ca97ff11bac172ab7458ac78d506726ab", + "test_masks.py": "a6550561820e0437b67fc3c51548e83f9dbef79d4a207f8a1799019e55df8aaf", + "verify.py": "6825c6e40c071b04a638c3ca3230b5e423711b03288166da1d9e0f4e25d8a51d" + }, + "origins_sha256": "0491f2d3cce5bdae06295108e82370bfcaa4180e72c1cf41bdc114787d78a33d", + "expected_receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092", + "median_wall_seconds": { + "sets": 0.544841709, + "masks": 0.429964167 + }, + "ratio_of_medians": 1.2671793391564186, + "wall_time_reduction_percent": 21.084571922888518, + "median_paired_speedup": 1.2916713010365137, + "pairs_masks_faster": 31, + "samples": [ + { + "pair": 0, + "engine": "sets", + "wall_seconds": 1.553962625, + "child_cpu_seconds": 0.8102769999999999 + }, + { + "pair": 0, + "engine": "masks", + "wall_seconds": 0.560508833, + "child_cpu_seconds": 0.5277280000000002 + }, + { + "pair": 1, + "engine": "masks", + "wall_seconds": 0.4131605, + "child_cpu_seconds": 0.40700899999999973 + }, + { + "pair": 1, + "engine": "sets", + "wall_seconds": 0.515110583, + "child_cpu_seconds": 0.5115330000000005 + }, + { + "pair": 2, + "engine": "sets", + "wall_seconds": 0.573521666, + "child_cpu_seconds": 0.5646379999999995 + }, + { + "pair": 2, + "engine": "masks", + "wall_seconds": 0.428295583, + "child_cpu_seconds": 0.4248000000000003 + }, + { + "pair": 3, + "engine": "masks", + "wall_seconds": 0.421926333, + "child_cpu_seconds": 0.41451899999999986 + }, + { + "pair": 3, + "engine": "sets", + "wall_seconds": 0.54296825, + "child_cpu_seconds": 0.5337239999999999 + }, + { + "pair": 4, + "engine": "sets", + "wall_seconds": 0.579978125, + "child_cpu_seconds": 0.5672200000000007 + }, + { + "pair": 4, + "engine": "masks", + "wall_seconds": 0.432456541, + "child_cpu_seconds": 0.4241389999999994 + }, + { + "pair": 5, + "engine": "masks", + "wall_seconds": 0.419185458, + "child_cpu_seconds": 0.4105080000000001 + }, + { + "pair": 5, + "engine": "sets", + "wall_seconds": 0.624912542, + "child_cpu_seconds": 0.6032659999999996 + }, + { + "pair": 6, + "engine": "sets", + "wall_seconds": 0.56501125, + "child_cpu_seconds": 0.5581160000000001 + }, + { + "pair": 6, + "engine": "masks", + "wall_seconds": 0.449780708, + "child_cpu_seconds": 0.44575300000000073 + }, + { + "pair": 7, + "engine": "masks", + "wall_seconds": 0.411719, + "child_cpu_seconds": 0.4064929999999993 + }, + { + "pair": 7, + "engine": "sets", + "wall_seconds": 0.730829709, + "child_cpu_seconds": 0.6843680000000001 + }, + { + "pair": 8, + "engine": "sets", + "wall_seconds": 0.771775917, + "child_cpu_seconds": 0.6345749999999999 + }, + { + "pair": 8, + "engine": "masks", + "wall_seconds": 0.394315208, + "child_cpu_seconds": 0.3892989999999994 + }, + { + "pair": 9, + "engine": "masks", + "wall_seconds": 0.488621583, + "child_cpu_seconds": 0.47790200000000027 + }, + { + "pair": 9, + "engine": "sets", + "wall_seconds": 0.728488875, + "child_cpu_seconds": 0.6973710000000004 + }, + { + "pair": 10, + "engine": "sets", + "wall_seconds": 0.544841709, + "child_cpu_seconds": 0.5395269999999996 + }, + { + "pair": 10, + "engine": "masks", + "wall_seconds": 0.452542833, + "child_cpu_seconds": 0.44702200000000225 + }, + { + "pair": 11, + "engine": "masks", + "wall_seconds": 0.466090458, + "child_cpu_seconds": 0.45491299999999946 + }, + { + "pair": 11, + "engine": "sets", + "wall_seconds": 0.506454583, + "child_cpu_seconds": 0.5015979999999995 + }, + { + "pair": 12, + "engine": "sets", + "wall_seconds": 0.501143834, + "child_cpu_seconds": 0.4977109999999989 + }, + { + "pair": 12, + "engine": "masks", + "wall_seconds": 0.413644958, + "child_cpu_seconds": 0.4108300000000007 + }, + { + "pair": 13, + "engine": "masks", + "wall_seconds": 0.441685541, + "child_cpu_seconds": 0.4315799999999985 + }, + { + "pair": 13, + "engine": "sets", + "wall_seconds": 0.538246166, + "child_cpu_seconds": 0.5251390000000011 + }, + { + "pair": 14, + "engine": "sets", + "wall_seconds": 0.516599416, + "child_cpu_seconds": 0.5102139999999995 + }, + { + "pair": 14, + "engine": "masks", + "wall_seconds": 0.3999465, + "child_cpu_seconds": 0.3967040000000015 + }, + { + "pair": 15, + "engine": "masks", + "wall_seconds": 0.442884583, + "child_cpu_seconds": 0.43431099999999745 + }, + { + "pair": 15, + "engine": "sets", + "wall_seconds": 0.65527825, + "child_cpu_seconds": 0.623659 + }, + { + "pair": 16, + "engine": "sets", + "wall_seconds": 0.541753083, + "child_cpu_seconds": 0.5320570000000018 + }, + { + "pair": 16, + "engine": "masks", + "wall_seconds": 0.444491167, + "child_cpu_seconds": 0.43500700000000236 + }, + { + "pair": 17, + "engine": "masks", + "wall_seconds": 0.438052542, + "child_cpu_seconds": 0.4270209999999963 + }, + { + "pair": 17, + "engine": "sets", + "wall_seconds": 0.527382042, + "child_cpu_seconds": 0.5184490000000004 + }, + { + "pair": 18, + "engine": "sets", + "wall_seconds": 0.539841125, + "child_cpu_seconds": 0.5319490000000009 + }, + { + "pair": 18, + "engine": "masks", + "wall_seconds": 0.395724625, + "child_cpu_seconds": 0.3925379999999983 + }, + { + "pair": 19, + "engine": "masks", + "wall_seconds": 0.490679125, + "child_cpu_seconds": 0.46355000000000146 + }, + { + "pair": 19, + "engine": "sets", + "wall_seconds": 0.571256791, + "child_cpu_seconds": 0.5585079999999998 + }, + { + "pair": 20, + "engine": "sets", + "wall_seconds": 0.538512875, + "child_cpu_seconds": 0.5347310000000007 + }, + { + "pair": 20, + "engine": "masks", + "wall_seconds": 0.424937042, + "child_cpu_seconds": 0.41713299999999975 + }, + { + "pair": 21, + "engine": "masks", + "wall_seconds": 0.429964167, + "child_cpu_seconds": 0.4240239999999993 + }, + { + "pair": 21, + "engine": "sets", + "wall_seconds": 0.534099791, + "child_cpu_seconds": 0.5245499999999979 + }, + { + "pair": 22, + "engine": "sets", + "wall_seconds": 0.538894292, + "child_cpu_seconds": 0.5315910000000024 + }, + { + "pair": 22, + "engine": "masks", + "wall_seconds": 0.40907125, + "child_cpu_seconds": 0.40189499999999967 + }, + { + "pair": 23, + "engine": "masks", + "wall_seconds": 0.410595125, + "child_cpu_seconds": 0.40524500000000074 + }, + { + "pair": 23, + "engine": "sets", + "wall_seconds": 0.633827375, + "child_cpu_seconds": 0.5815179999999991 + }, + { + "pair": 24, + "engine": "sets", + "wall_seconds": 0.609854291, + "child_cpu_seconds": 0.5930350000000004 + }, + { + "pair": 24, + "engine": "masks", + "wall_seconds": 0.456151208, + "child_cpu_seconds": 0.4478570000000026 + }, + { + "pair": 25, + "engine": "masks", + "wall_seconds": 0.442420417, + "child_cpu_seconds": 0.43309099999999745 + }, + { + "pair": 25, + "engine": "sets", + "wall_seconds": 0.528812292, + "child_cpu_seconds": 0.5164299999999997 + }, + { + "pair": 26, + "engine": "sets", + "wall_seconds": 0.531300125, + "child_cpu_seconds": 0.5262430000000009 + }, + { + "pair": 26, + "engine": "masks", + "wall_seconds": 0.442788458, + "child_cpu_seconds": 0.4328249999999976 + }, + { + "pair": 27, + "engine": "masks", + "wall_seconds": 0.422400667, + "child_cpu_seconds": 0.4174760000000042 + }, + { + "pair": 27, + "engine": "sets", + "wall_seconds": 0.593430292, + "child_cpu_seconds": 0.5765290000000007 + }, + { + "pair": 28, + "engine": "sets", + "wall_seconds": 0.54898075, + "child_cpu_seconds": 0.5397699999999972 + }, + { + "pair": 28, + "engine": "masks", + "wall_seconds": 0.416303625, + "child_cpu_seconds": 0.4086040000000004 + }, + { + "pair": 29, + "engine": "masks", + "wall_seconds": 0.449706291, + "child_cpu_seconds": 0.44504399999999933 + }, + { + "pair": 29, + "engine": "sets", + "wall_seconds": 0.521172625, + "child_cpu_seconds": 0.5167709999999985 + }, + { + "pair": 30, + "engine": "sets", + "wall_seconds": 0.5825285, + "child_cpu_seconds": 0.5286000000000044 + }, + { + "pair": 30, + "engine": "masks", + "wall_seconds": 0.419824958, + "child_cpu_seconds": 0.4150229999999979 + } + ], + "scope": "Independent owner checker only, not full supplier replay or multiplication runtime." +} diff --git a/research/owner-footprint-bitsets/evidence/benchmark-python314.json b/research/owner-footprint-bitsets/evidence/benchmark-python314.json new file mode 100644 index 0000000000..6f86482c49 --- /dev/null +++ b/research/owner-footprint-bitsets/evidence/benchmark-python314.json @@ -0,0 +1,403 @@ +{ + "status": "PASS_OWNER_FOOTPRINT_BENCHMARK", + "utc": "2026-10-13T04:48:03.396688+00:00", + "python": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]", + "executable": "/opt/homebrew/opt/python@3.14/bin/python3.14", + "platform": "macOS-26.6-arm64-arm-64bit-Mach-O", + "pairs": 31, + "order": "alternating; sets first when (91 + pair) % 2 != 0", + "reference": "unchanged pinned checker, direct CLI", + "candidate": "adapter CLI including source pin validation and counted substitution", + "process": "fresh interpreter each sample; same archived inputs; OS caches not flushed", + "code_sha256": { + "adapter.py": "1fc4dfc42a613e5a9ab1b856983dcf52c27f1c3736ea1b72358e206f7fd4f463", + "benchmark.py": "f6d568558610d5bb274ac4bfa67d167ca97ff11bac172ab7458ac78d506726ab", + "test_masks.py": "a6550561820e0437b67fc3c51548e83f9dbef79d4a207f8a1799019e55df8aaf", + "verify.py": "3dcda41b3a373f6e1bd842d4cde0de1b2d2cf2e9c9b84ca0789ed4280498a410" + }, + "origins_sha256": "0491f2d3cce5bdae06295108e82370bfcaa4180e72c1cf41bdc114787d78a33d", + "expected_receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092", + "median_wall_seconds": { + "sets": 0.562016125, + "masks": 0.4571185 + }, + "ratio_of_medians": 1.22947578144398, + "wall_time_reduction_percent": 18.664522303519316, + "median_paired_speedup": 1.237118948368968, + "pairs_masks_faster": 27, + "samples": [ + { + "pair": 0, + "engine": "sets", + "wall_seconds": 0.622961958, + "child_cpu_seconds": 0.603775 + }, + { + "pair": 0, + "engine": "masks", + "wall_seconds": 0.730552834, + "child_cpu_seconds": 0.6143449999999999 + }, + { + "pair": 1, + "engine": "masks", + "wall_seconds": 0.455460625, + "child_cpu_seconds": 0.445265 + }, + { + "pair": 1, + "engine": "sets", + "wall_seconds": 0.589048875, + "child_cpu_seconds": 0.5630830000000002 + }, + { + "pair": 2, + "engine": "sets", + "wall_seconds": 0.874960417, + "child_cpu_seconds": 0.6903209999999995 + }, + { + "pair": 2, + "engine": "masks", + "wall_seconds": 1.158734542, + "child_cpu_seconds": 0.7220570000000004 + }, + { + "pair": 3, + "engine": "masks", + "wall_seconds": 0.955961041, + "child_cpu_seconds": 0.6272310000000001 + }, + { + "pair": 3, + "engine": "sets", + "wall_seconds": 0.910027375, + "child_cpu_seconds": 0.7126789999999996 + }, + { + "pair": 4, + "engine": "sets", + "wall_seconds": 0.625356792, + "child_cpu_seconds": 0.6159090000000003 + }, + { + "pair": 4, + "engine": "masks", + "wall_seconds": 0.47475375, + "child_cpu_seconds": 0.4657410000000004 + }, + { + "pair": 5, + "engine": "masks", + "wall_seconds": 0.4571185, + "child_cpu_seconds": 0.45037899999999986 + }, + { + "pair": 5, + "engine": "sets", + "wall_seconds": 0.565509958, + "child_cpu_seconds": 0.5612579999999996 + }, + { + "pair": 6, + "engine": "sets", + "wall_seconds": 0.552324625, + "child_cpu_seconds": 0.5439290000000003 + }, + { + "pair": 6, + "engine": "masks", + "wall_seconds": 0.52644675, + "child_cpu_seconds": 0.5067200000000005 + }, + { + "pair": 7, + "engine": "masks", + "wall_seconds": 0.472918125, + "child_cpu_seconds": 0.46348899999999915 + }, + { + "pair": 7, + "engine": "sets", + "wall_seconds": 0.601962083, + "child_cpu_seconds": 0.5890190000000004 + }, + { + "pair": 8, + "engine": "sets", + "wall_seconds": 0.549944, + "child_cpu_seconds": 0.5448909999999998 + }, + { + "pair": 8, + "engine": "masks", + "wall_seconds": 0.503104083, + "child_cpu_seconds": 0.4923660000000005 + }, + { + "pair": 9, + "engine": "masks", + "wall_seconds": 0.450424291, + "child_cpu_seconds": 0.4438159999999982 + }, + { + "pair": 9, + "engine": "sets", + "wall_seconds": 0.553314, + "child_cpu_seconds": 0.5454630000000016 + }, + { + "pair": 10, + "engine": "sets", + "wall_seconds": 0.511028291, + "child_cpu_seconds": 0.5040509999999987 + }, + { + "pair": 10, + "engine": "masks", + "wall_seconds": 0.425765041, + "child_cpu_seconds": 0.42048800000000064 + }, + { + "pair": 11, + "engine": "masks", + "wall_seconds": 0.430672416, + "child_cpu_seconds": 0.42443700000000106 + }, + { + "pair": 11, + "engine": "sets", + "wall_seconds": 0.559453209, + "child_cpu_seconds": 0.5486920000000008 + }, + { + "pair": 12, + "engine": "sets", + "wall_seconds": 0.569494916, + "child_cpu_seconds": 0.563857999999998 + }, + { + "pair": 12, + "engine": "masks", + "wall_seconds": 0.462862292, + "child_cpu_seconds": 0.45635200000000076 + }, + { + "pair": 13, + "engine": "masks", + "wall_seconds": 0.496752583, + "child_cpu_seconds": 0.488173999999999 + }, + { + "pair": 13, + "engine": "sets", + "wall_seconds": 0.637948333, + "child_cpu_seconds": 0.6250440000000008 + }, + { + "pair": 14, + "engine": "sets", + "wall_seconds": 0.641576125, + "child_cpu_seconds": 0.616676 + }, + { + "pair": 14, + "engine": "masks", + "wall_seconds": 0.450001375, + "child_cpu_seconds": 0.44419500000000056 + }, + { + "pair": 15, + "engine": "masks", + "wall_seconds": 0.453435875, + "child_cpu_seconds": 0.4372100000000003 + }, + { + "pair": 15, + "engine": "sets", + "wall_seconds": 0.485403542, + "child_cpu_seconds": 0.48246899999999826 + }, + { + "pair": 16, + "engine": "sets", + "wall_seconds": 0.47814675, + "child_cpu_seconds": 0.475085 + }, + { + "pair": 16, + "engine": "masks", + "wall_seconds": 0.411090416, + "child_cpu_seconds": 0.4052940000000014 + }, + { + "pair": 17, + "engine": "masks", + "wall_seconds": 0.394712417, + "child_cpu_seconds": 0.387948999999999 + }, + { + "pair": 17, + "engine": "sets", + "wall_seconds": 0.556668334, + "child_cpu_seconds": 0.5437429999999992 + }, + { + "pair": 18, + "engine": "sets", + "wall_seconds": 0.568360209, + "child_cpu_seconds": 0.559860000000004 + }, + { + "pair": 18, + "engine": "masks", + "wall_seconds": 0.449194042, + "child_cpu_seconds": 0.43910399999999683 + }, + { + "pair": 19, + "engine": "masks", + "wall_seconds": 0.417501791, + "child_cpu_seconds": 0.41262000000000043 + }, + { + "pair": 19, + "engine": "sets", + "wall_seconds": 0.540995458, + "child_cpu_seconds": 0.5355810000000005 + }, + { + "pair": 20, + "engine": "sets", + "wall_seconds": 0.541759333, + "child_cpu_seconds": 0.5334229999999991 + }, + { + "pair": 20, + "engine": "masks", + "wall_seconds": 0.5566895, + "child_cpu_seconds": 0.5173190000000005 + }, + { + "pair": 21, + "engine": "masks", + "wall_seconds": 0.51015875, + "child_cpu_seconds": 0.4924210000000002 + }, + { + "pair": 21, + "engine": "sets", + "wall_seconds": 0.876281959, + "child_cpu_seconds": 0.7100539999999995 + }, + { + "pair": 22, + "engine": "sets", + "wall_seconds": 0.64730275, + "child_cpu_seconds": 0.6230270000000004 + }, + { + "pair": 22, + "engine": "masks", + "wall_seconds": 0.5056075, + "child_cpu_seconds": 0.4955570000000016 + }, + { + "pair": 23, + "engine": "masks", + "wall_seconds": 0.430162875, + "child_cpu_seconds": 0.42376999999999754 + }, + { + "pair": 23, + "engine": "sets", + "wall_seconds": 0.503936458, + "child_cpu_seconds": 0.5007310000000018 + }, + { + "pair": 24, + "engine": "sets", + "wall_seconds": 0.506679209, + "child_cpu_seconds": 0.5036219999999965 + }, + { + "pair": 24, + "engine": "masks", + "wall_seconds": 0.497595583, + "child_cpu_seconds": 0.4855070000000019 + }, + { + "pair": 25, + "engine": "masks", + "wall_seconds": 0.400299666, + "child_cpu_seconds": 0.3964149999999975 + }, + { + "pair": 25, + "engine": "sets", + "wall_seconds": 0.562016125, + "child_cpu_seconds": 0.5538270000000018 + }, + { + "pair": 26, + "engine": "sets", + "wall_seconds": 0.569906083, + "child_cpu_seconds": 0.5567139999999995 + }, + { + "pair": 26, + "engine": "masks", + "wall_seconds": 0.422690209, + "child_cpu_seconds": 0.4174500000000023 + }, + { + "pair": 27, + "engine": "masks", + "wall_seconds": 0.389061583, + "child_cpu_seconds": 0.3870229999999957 + }, + { + "pair": 27, + "engine": "sets", + "wall_seconds": 0.499657208, + "child_cpu_seconds": 0.4961470000000041 + }, + { + "pair": 28, + "engine": "sets", + "wall_seconds": 0.696901625, + "child_cpu_seconds": 0.6273949999999999 + }, + { + "pair": 28, + "engine": "masks", + "wall_seconds": 0.547673084, + "child_cpu_seconds": 0.5206179999999989 + }, + { + "pair": 29, + "engine": "masks", + "wall_seconds": 0.493918083, + "child_cpu_seconds": 0.4816690000000001 + }, + { + "pair": 29, + "engine": "sets", + "wall_seconds": 0.529801833, + "child_cpu_seconds": 0.5169669999999975 + }, + { + "pair": 30, + "engine": "sets", + "wall_seconds": 0.537728916, + "child_cpu_seconds": 0.5301960000000037 + }, + { + "pair": 30, + "engine": "masks", + "wall_seconds": 0.45590625, + "child_cpu_seconds": 0.44511799999999724 + } + ], + "scope": "Independent owner checker only, not full supplier replay or multiplication runtime." +} diff --git a/research/owner-footprint-bitsets/evidence/pilot.json b/research/owner-footprint-bitsets/evidence/pilot.json new file mode 100644 index 0000000000..0d8e4edde9 --- /dev/null +++ b/research/owner-footprint-bitsets/evidence/pilot.json @@ -0,0 +1,22 @@ +{ + "stage": "Initial inline-mask experiment, before adapter packaging; full checker receipts byte-identical.", + "order": "Alternating, sets first when (91+i)%2 is nonzero", + "sets_seconds": [ + 0.48069766600383446, + 0.5048906250158325, + 0.5030954999965616, + 0.6633966670196969, + 0.5487507499929052, + 0.4922975840163417, + 0.5356562499946449 + ], + "masks_seconds": [ + 0.3926773749990389, + 0.43412362498929724, + 0.45536129098036326, + 0.4735694999981206, + 0.43204441701527685, + 0.39268437499413267, + 0.48395295900991186 + ] +} diff --git a/research/owner-footprint-bitsets/evidence/validation-final-python312.json b/research/owner-footprint-bitsets/evidence/validation-final-python312.json new file mode 100644 index 0000000000..dacee975c4 --- /dev/null +++ b/research/owner-footprint-bitsets/evidence/validation-final-python312.json @@ -0,0 +1,177 @@ +{ + "status": "PASS_OWNER_FOOTPRINT_MASKS", + "baseline_runs": 6, + "negative_controls": 19, + "positive_controls": 1, + "controls": [ + { + "case": "baseline", + "engine": "sets", + "direct": true, + "optimized": false, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "sets", + "direct": false, + "optimized": false, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "masks", + "direct": false, + "optimized": false, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "sets", + "direct": true, + "optimized": true, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "sets", + "direct": false, + "optimized": true, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "masks", + "direct": false, + "optimized": true, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "overlap", + "expected": "reject", + "diagnostic": "ValueError: disjoint footprints", + "engines_agree": true + }, + { + "case": "gap", + "expected": "reject", + "diagnostic": "ValueError: compacted prefix", + "engines_agree": true + }, + { + "case": "negative_offset", + "expected": "reject", + "diagnostic": "ValueError: window and footprint", + "engines_agree": true + }, + { + "case": "past_capacity", + "expected": "reject", + "diagnostic": "ValueError: window and footprint", + "engines_agree": true + }, + { + "case": "width", + "expected": "reject", + "diagnostic": "ValueError: actual width", + "engines_agree": true + }, + { + "case": "duplicate_helper", + "expected": "reject", + "diagnostic": "ValueError: unique helper and physical family", + "engines_agree": true + }, + { + "case": "family", + "expected": "reject", + "diagnostic": "ValueError: physical family", + "engines_agree": true + }, + { + "case": "copy", + "expected": "reject", + "diagnostic": "ValueError: copy", + "engines_agree": true + }, + { + "case": "stage", + "expected": "reject", + "diagnostic": "ValueError: ordered complete call", + "engines_agree": true + }, + { + "case": "missing_role", + "expected": "reject", + "diagnostic": "ValueError: all helper calls", + "engines_agree": true + }, + { + "case": "profile", + "expected": "reject", + "diagnostic": "ValueError: independent paid profile", + "engines_agree": true + }, + { + "case": "candidate_moment", + "expected": "reject", + "diagnostic": "ValueError: strict exact moment candidate", + "engines_agree": true + }, + { + "case": "predecessor_moment", + "expected": "reject", + "diagnostic": "ValueError: strict exact moment PR623", + "engines_agree": true + }, + { + "case": "native_orientation", + "expected": "reject", + "diagnostic": "ValueError: both actual orientations", + "engines_agree": true + }, + { + "case": "geometry", + "expected": "reject", + "diagnostic": "ValueError: unchanged inherited physical geometry", + "engines_agree": true + }, + { + "case": "plan_pin", + "expected": "reject", + "diagnostic": "ValueError: plan pin", + "engines_agree": true + }, + { + "case": "owner_pin", + "expected": "reject", + "diagnostic": "ValueError: owner pin", + "engines_agree": true + }, + { + "case": "checker_source", + "expected": "reject", + "diagnostic": "ValueError: source/input pin mismatch: research/complex-k492-owner-repair/extras/check_owner_map.py", + "engines_agree": true + }, + { + "case": "interval_source", + "expected": "reject", + "diagnostic": "ValueError: source/input pin mismatch: research/complex-k492-owner-repair/extras/exact_intervals.py", + "engines_agree": true + }, + { + "case": "shuffled_roles", + "expected": "accept", + "diagnostic": "", + "engines_agree": true + } + ], + "seed": 91, + "overlap_rows": [ + 91, + 3130 + ], + "gap_row": 24160, + "scope": "Pinned independent owner checker only; archived native artifacts, no cold supplier rebuild." +} diff --git a/research/owner-footprint-bitsets/evidence/validation-final-python314.json b/research/owner-footprint-bitsets/evidence/validation-final-python314.json new file mode 100644 index 0000000000..dacee975c4 --- /dev/null +++ b/research/owner-footprint-bitsets/evidence/validation-final-python314.json @@ -0,0 +1,177 @@ +{ + "status": "PASS_OWNER_FOOTPRINT_MASKS", + "baseline_runs": 6, + "negative_controls": 19, + "positive_controls": 1, + "controls": [ + { + "case": "baseline", + "engine": "sets", + "direct": true, + "optimized": false, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "sets", + "direct": false, + "optimized": false, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "masks", + "direct": false, + "optimized": false, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "sets", + "direct": true, + "optimized": true, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "sets", + "direct": false, + "optimized": true, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "masks", + "direct": false, + "optimized": true, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "overlap", + "expected": "reject", + "diagnostic": "ValueError: disjoint footprints", + "engines_agree": true + }, + { + "case": "gap", + "expected": "reject", + "diagnostic": "ValueError: compacted prefix", + "engines_agree": true + }, + { + "case": "negative_offset", + "expected": "reject", + "diagnostic": "ValueError: window and footprint", + "engines_agree": true + }, + { + "case": "past_capacity", + "expected": "reject", + "diagnostic": "ValueError: window and footprint", + "engines_agree": true + }, + { + "case": "width", + "expected": "reject", + "diagnostic": "ValueError: actual width", + "engines_agree": true + }, + { + "case": "duplicate_helper", + "expected": "reject", + "diagnostic": "ValueError: unique helper and physical family", + "engines_agree": true + }, + { + "case": "family", + "expected": "reject", + "diagnostic": "ValueError: physical family", + "engines_agree": true + }, + { + "case": "copy", + "expected": "reject", + "diagnostic": "ValueError: copy", + "engines_agree": true + }, + { + "case": "stage", + "expected": "reject", + "diagnostic": "ValueError: ordered complete call", + "engines_agree": true + }, + { + "case": "missing_role", + "expected": "reject", + "diagnostic": "ValueError: all helper calls", + "engines_agree": true + }, + { + "case": "profile", + "expected": "reject", + "diagnostic": "ValueError: independent paid profile", + "engines_agree": true + }, + { + "case": "candidate_moment", + "expected": "reject", + "diagnostic": "ValueError: strict exact moment candidate", + "engines_agree": true + }, + { + "case": "predecessor_moment", + "expected": "reject", + "diagnostic": "ValueError: strict exact moment PR623", + "engines_agree": true + }, + { + "case": "native_orientation", + "expected": "reject", + "diagnostic": "ValueError: both actual orientations", + "engines_agree": true + }, + { + "case": "geometry", + "expected": "reject", + "diagnostic": "ValueError: unchanged inherited physical geometry", + "engines_agree": true + }, + { + "case": "plan_pin", + "expected": "reject", + "diagnostic": "ValueError: plan pin", + "engines_agree": true + }, + { + "case": "owner_pin", + "expected": "reject", + "diagnostic": "ValueError: owner pin", + "engines_agree": true + }, + { + "case": "checker_source", + "expected": "reject", + "diagnostic": "ValueError: source/input pin mismatch: research/complex-k492-owner-repair/extras/check_owner_map.py", + "engines_agree": true + }, + { + "case": "interval_source", + "expected": "reject", + "diagnostic": "ValueError: source/input pin mismatch: research/complex-k492-owner-repair/extras/exact_intervals.py", + "engines_agree": true + }, + { + "case": "shuffled_roles", + "expected": "accept", + "diagnostic": "", + "engines_agree": true + } + ], + "seed": 91, + "overlap_rows": [ + 91, + 3130 + ], + "gap_row": 24160, + "scope": "Pinned independent owner checker only; archived native artifacts, no cold supplier rebuild." +} diff --git a/research/owner-footprint-bitsets/evidence/validation.json b/research/owner-footprint-bitsets/evidence/validation.json new file mode 100644 index 0000000000..e3f6f11e20 --- /dev/null +++ b/research/owner-footprint-bitsets/evidence/validation.json @@ -0,0 +1,177 @@ +{ + "status": "PASS_OWNER_FOOTPRINT_MASKS", + "baseline_runs": 6, + "negative_controls": 19, + "positive_controls": 1, + "controls": [ + { + "case": "baseline", + "engine": "sets", + "direct": true, + "optimized": false, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "sets", + "direct": false, + "optimized": false, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "masks", + "direct": false, + "optimized": false, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "sets", + "direct": true, + "optimized": true, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "sets", + "direct": false, + "optimized": true, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "baseline", + "engine": "masks", + "direct": false, + "optimized": true, + "receipt_sha256": "ec82a647bc3567efef91a1588c86f012cdbb5decac0c25a9f38ba5d11762a092" + }, + { + "case": "overlap", + "expected": "reject", + "diagnostic": "ValueError: disjoint footprints", + "engines_agree": true + }, + { + "case": "gap", + "expected": "reject", + "diagnostic": "ValueError: compacted prefix", + "engines_agree": true + }, + { + "case": "negative_offset", + "expected": "reject", + "diagnostic": "ValueError: window and footprint", + "engines_agree": true + }, + { + "case": "past_capacity", + "expected": "reject", + "diagnostic": "ValueError: window and footprint", + "engines_agree": true + }, + { + "case": "width", + "expected": "reject", + "diagnostic": "ValueError: actual width", + "engines_agree": true + }, + { + "case": "duplicate_helper", + "expected": "reject", + "diagnostic": "ValueError: unique helper and physical family", + "engines_agree": true + }, + { + "case": "family", + "expected": "reject", + "diagnostic": "ValueError: unique helper and physical family", + "engines_agree": true + }, + { + "case": "copy", + "expected": "reject", + "diagnostic": "ValueError: copy", + "engines_agree": true + }, + { + "case": "stage", + "expected": "reject", + "diagnostic": "ValueError: ordered complete call", + "engines_agree": true + }, + { + "case": "missing_role", + "expected": "reject", + "diagnostic": "ValueError: all helper calls", + "engines_agree": true + }, + { + "case": "profile", + "expected": "reject", + "diagnostic": "ValueError: independent paid profile", + "engines_agree": true + }, + { + "case": "candidate_moment", + "expected": "reject", + "diagnostic": "ValueError: strict exact moment candidate", + "engines_agree": true + }, + { + "case": "predecessor_moment", + "expected": "reject", + "diagnostic": "ValueError: strict exact moment PR623", + "engines_agree": true + }, + { + "case": "native_orientation", + "expected": "reject", + "diagnostic": "ValueError: both actual orientations", + "engines_agree": true + }, + { + "case": "geometry", + "expected": "reject", + "diagnostic": "ValueError: unchanged inherited physical geometry", + "engines_agree": true + }, + { + "case": "plan_pin", + "expected": "reject", + "diagnostic": "ValueError: plan pin", + "engines_agree": true + }, + { + "case": "owner_pin", + "expected": "reject", + "diagnostic": "ValueError: owner pin", + "engines_agree": true + }, + { + "case": "checker_source", + "expected": "reject", + "diagnostic": "ValueError: source/input pin mismatch: research/complex-k492-owner-repair/extras/check_owner_map.py", + "engines_agree": true + }, + { + "case": "interval_source", + "expected": "reject", + "diagnostic": "ValueError: source/input pin mismatch: research/complex-k492-owner-repair/extras/exact_intervals.py", + "engines_agree": true + }, + { + "case": "shuffled_roles", + "expected": "accept", + "diagnostic": "", + "engines_agree": true + } + ], + "seed": 91, + "overlap_rows": [ + 91, + 3130 + ], + "gap_row": 24160, + "scope": "Pinned independent owner checker only; archived native artifacts, no cold supplier rebuild." +} diff --git a/research/owner-footprint-bitsets/test_masks.py b/research/owner-footprint-bitsets/test_masks.py new file mode 100644 index 0000000000..68fd2559d7 --- /dev/null +++ b/research/owner-footprint-bitsets/test_masks.py @@ -0,0 +1,100 @@ +"""Exact-set oracle and actual-source mutation tests; stdlib only.""" +import importlib.util +import itertools +from pathlib import Path +import random +import unittest + +sp = importlib.util.spec_from_file_location('adapter', Path(__file__).with_name('adapter.py')) +A = importlib.util.module_from_spec(sp) +sp.loader.exec_module(A) + + +def oracle(interval_mask, is_prefix): + count = 0 + # Every subset of [0,n), n<=8, against every legal interval in [0,n). + # The reference uses Python sets; it never uses the bit-mask predicates. + for n in range(9): + for bits in itertools.product((False, True), repeat=n): + cells = {i for i, bit in enumerate(bits) if bit} + encoded = sum(2 ** i for i in cells) + if is_prefix(encoded) != (cells == set(range(len(cells)))): + raise AssertionError('prefix oracle') + for start in range(n + 1): + for width in range(n - start + 1): + interval = set(range(start, start + width)) + mask = interval_mask(start, width) + if mask != sum(2 ** i for i in interval): + raise AssertionError('interval oracle') + if bool(encoded & mask) != bool(cells & interval): + raise AssertionError('overlap oracle') + joined = encoded | mask + if joined.bit_count() != len(cells | interval): + raise AssertionError('cardinality oracle') + if is_prefix(joined) != (cells | interval == set(range(len(cells | interval)))): + raise AssertionError('union prefix oracle') + count += 1 + return count + + +class Masks(unittest.TestCase): + def test_exhaustive_small_domain(self): + self.assertEqual(oracle(A.interval_mask, A.is_prefix), 18943) + + def test_seeded_large_domain(self): + rng = random.Random(91) + for _ in range(2000): + cap = rng.randrange(4097) + cells = set(rng.sample(range(cap), rng.randrange(min(cap, 200) + 1))) + start = rng.randrange(cap + 1) + width = rng.randrange(cap - start + 1) + old = sum(2 ** i for i in cells) + interval = set(range(start, start + width)) + mask = A.interval_mask(start, width) + self.assertEqual(mask, sum(2 ** i for i in interval)) + self.assertEqual(bool(old & mask), bool(cells & interval)) + joined = old | mask + self.assertEqual(joined.bit_count(), len(cells | interval)) + self.assertEqual(A.is_prefix(joined), cells | interval == set(range(len(cells | interval)))) + + def test_large_sparse_and_empty_boundaries(self): + for end in (0, 1, 31, 32, 48, 63, 64, 65, 1024, 8192): + self.assertEqual(A.interval_mask(end, 0), 0) + self.assertTrue(A.is_prefix(A.interval_mask(0, end))) + if end: + self.assertFalse(A.is_prefix(A.interval_mask(1, end))) + self.assertEqual(A.interval_mask(end, 1).bit_count(), 1) + # Equal cardinality does not imply equal occupied cells or a prefix. + self.assertFalse(A.is_prefix(sum(2 ** i for i in (0, 1, 3, 4)))) + + def test_actual_kernel_mutants_are_detected(self): + source = (A.HERE / 'adapter.py').read_text() + mutations = [ + ('((1 << width) - 1) << offset', '((1 << width) - 1)'), + ('((1 << width) - 1) << offset', '(1 << width) << offset'), + ('((1 << width) - 1) << offset', '((1 << width) - 1) << (offset + 1)'), + ('mask & (mask + 1) == 0', 'True'), + ('mask & (mask + 1) == 0', 'mask == 0'), + ] + for old, new in mutations: + self.assertEqual(source.count(old), 1) + ns = {'__name__': 'mutant', '__file__': str(A.HERE / 'adapter.py')} + exec(compile(source.replace(old, new), '', 'exec'), ns) + with self.assertRaises(AssertionError, msg=new): + oracle(ns['interval_mask'], ns['is_prefix']) + + def test_pins_and_counted_source_substitution(self): + A.check_pins() + source = (A.ROOT / A.CHECKER).read_text() + result = A.transformed(source) + for old, new in A.REPLACEMENTS: + self.assertEqual(result.count(new), 1) + with self.assertRaisesRegex(ValueError, 'anchor changed'): + A.transformed(source.replace(old, '')) + with self.assertRaisesRegex(ValueError, 'anchor changed'): + A.transformed(source + old) + self.assertEqual(result.count('need('), source.count('need(')) + + +if __name__ == '__main__': + unittest.main() diff --git a/research/owner-footprint-bitsets/verify.py b/research/owner-footprint-bitsets/verify.py new file mode 100644 index 0000000000..a6982436b6 --- /dev/null +++ b/research/owner-footprint-bitsets/verify.py @@ -0,0 +1,205 @@ +#!/usr/bin/env python3 +"""Full-check equivalence, repinned negative controls and portable replay.""" +import argparse +from collections import defaultdict +import copy +import gzip +import hashlib +import importlib.util +import json +from pathlib import Path +import random +import shutil +import subprocess +import sys +import tempfile + +HERE = Path(__file__).resolve().parent +sp = importlib.util.spec_from_file_location('adapter', HERE / 'adapter.py') +A = importlib.util.module_from_spec(sp) +sp.loader.exec_module(A) +NATIVE = Path('research/community-k492-audit/pr622/replay/mixed-global/base/providers') + + +def load(path): + data = path.read_bytes() + return json.loads(gzip.decompress(data) if path.suffix == '.gz' else data) + + +def save(path, data): + raw = (json.dumps(data, indent=2) + '\n').encode() + path.write_bytes(gzip.compress(raw, mtime=0) if path.suffix == '.gz' else raw) + + +def command(root, engine, out, optimized=False, direct=False): + cmd = [sys.executable, '-I', '-B'] + (['-O'] if optimized else []) + if direct: + cmd += [str(root / A.CHECKER)] + else: + cmd += [str(HERE / 'adapter.py'), '--root', str(root), '--engine', engine] + return cmd + ['--work', str(root), '--out', str(out), '--provider', + 'ck=' + str(root / NATIVE / 'ck'), '--provider', + 'jp8=' + str(root / NATIVE / 'jp8')] + + +def invoke(root, engine, out, optimized=False, direct=False): + r = subprocess.run(command(root, engine, out, optimized, direct), + capture_output=True, text=True, timeout=30) + diagnostic = r.stderr.strip().splitlines()[-1] if r.stderr.strip() else '' + return r.returncode, r.stdout, diagnostic + + +def copy_inputs(root): + for name in A.origins()['files']: + dst = root / name + dst.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(A.ROOT / name, dst) + + +def repin(root): + pkg = root / A.PACKAGE + spec = load(pkg / 'data/SPEC.json') + for key, file in [('plan_sha256', 'PLAN.json'), ('owners_sha256', 'OWNERS.json.gz')]: + spec['data'][key] = hashlib.sha256((pkg / 'data' / file).read_bytes()).hexdigest() + save(pkg / 'data/SPEC.json', spec) + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--out', type=Path, help='New validation receipt file') + args = ap.parse_args() + if args.out: + A.require(not args.out.exists(), 'output must not already exist') + A.check_pins() + expected = (HERE / 'evidence/EXPECTED.json').read_bytes() + rows = [] + with tempfile.TemporaryDirectory(prefix='owner masks check ') as tmp: + root = Path(tmp) / 'relocated checkout' + copy_inputs(root) + # Original direct CLI and both adapters must agree, including -O runs. + for optimized in (False, True): + for engine, direct in [('sets', True), ('sets', False), ('masks', False)]: + out = Path(tmp) / ('positive-%s-%s-%s.json' % (engine, optimized, direct)) + got = invoke(root, engine, out, optimized, direct) + A.require(got == (0, 'PASS independent map and exact moments\n', ''), str(got)) + A.require(out.read_bytes() == expected, 'complete receipt differs') + rows.append(dict(case='baseline', engine=engine, direct=direct, + optimized=optimized, receipt_sha256=hashlib.sha256(expected).hexdigest())) + + pkg = root / A.PACKAGE + original = {str(p.relative_to(root)): p.read_bytes() for p in root.rglob('*') if p.is_file()} + roles0 = load(pkg / 'data/OWNERS.json.gz') + plan0 = load(pkg / 'data/PLAN.json') + groups = defaultdict(list) + for i, r in enumerate(roles0): + groups[r['owner_replica'], r['child'], r['port']].append(i) + pairs = [ids[:2] for ids in groups.values() if len(ids) > 1] + overlap_i, overlap_j = pairs[91 % len(pairs)] + spare = [] + for key, ids in groups.items(): + cap = plan0['windows'][str(key[0]) + ',' + str(key[1])][0] + i = max(ids, key=lambda k: roles0[k]['offset']) + if roles0[i]['offset'] + roles0[i]['width'] < cap: + spare.append(i) + gap_i = spare[91 % len(spare)] + cases = [ + ('overlap', 'disjoint footprints'), ('gap', 'compacted prefix'), + ('negative_offset', 'window and footprint'), ('past_capacity', 'window and footprint'), + ('width', 'actual width'), ('duplicate_helper', 'unique helper and physical family'), + ('family', 'physical family'), ('copy', 'copy'), ('stage', 'ordered complete call'), + ('missing_role', 'all helper calls'), ('profile', 'independent paid profile'), + ('candidate_moment', 'strict exact moment candidate'), + ('predecessor_moment', 'strict exact moment PR623'), + ('native_orientation', 'both actual orientations'), + ('geometry', 'unchanged inherited physical geometry'), + ('plan_pin', 'plan pin'), ('owner_pin', 'owner pin'), + ('checker_source', 'source/input pin mismatch'), + ('interval_source', 'source/input pin mismatch'), + ('shuffled_roles', None), + ] + for case, failure in cases: + for name, data in original.items(): + (root / name).write_bytes(data) + roles = copy.deepcopy(roles0) + plan = copy.deepcopy(plan0) + spec = load(pkg / 'data/SPEC.json') + if case == 'overlap': + roles[overlap_j]['offset'] = roles[overlap_i]['offset'] + elif case == 'gap': + roles[gap_i]['offset'] += 1 + elif case == 'negative_offset': + roles[91]['offset'] = -1 + elif case == 'past_capacity': + r = roles[91] + cap = plan['windows'][str(r['owner_replica']) + ',' + str(r['child'])][0] + r['offset'] = cap - r['width'] + 1 + elif case == 'width': + roles[91]['width'] += 1 + elif case == 'duplicate_helper': + roles[92] = copy.deepcopy(roles[91]) + elif case in ('family', 'copy', 'stage'): + roles[91][case] += 1000000 if case == 'family' else 1 + elif case == 'missing_role': + roles.pop(91) + elif case == 'profile': + plan['profile']['1'] -= 1 + elif case == 'candidate_moment': + spec['expected']['complex_lower'] = '1/100' + elif case == 'predecessor_moment': + old = load(pkg / 'comparison/PR623-SPEC.json') + old['expected']['complex_lower'] = '1/100' + save(pkg / 'comparison/PR623-SPEC.json', old) + elif case == 'native_orientation': + path = root / NATIVE / 'ck/LOCAL-PROGRAMS.json.gz' + programs = load(path) + event = next(e for e in programs['backward'] if e[0] in ('climb', 'center')) + event[-1] += 1 + save(path, programs) + hashes = load(pkg / 'comparison/PR622-NATIVE-HASHES.json') + hashes['ck/LOCAL-PROGRAMS.json.gz'] = hashlib.sha256(path.read_bytes()).hexdigest() + save(pkg / 'comparison/PR622-NATIVE-HASHES.json', hashes) + elif case == 'geometry': + plan['windows']['0,0'][0] += 1 + elif case == 'shuffled_roles': + random.Random(91).shuffle(roles) + save(pkg / 'data/OWNERS.json.gz', roles) + save(pkg / 'data/PLAN.json', plan) + save(pkg / 'data/SPEC.json', spec) + repin(root) + if case in ('plan_pin', 'owner_pin'): + pin = 'plan_sha256' if case == 'plan_pin' else 'owners_sha256' + spec = load(pkg / 'data/SPEC.json') + spec['data'][pin] = '0' * 64 + save(pkg / 'data/SPEC.json', spec) + if case in ('checker_source', 'interval_source'): + path = root / (A.CHECKER if case == 'checker_source' else A.INTERVALS) + path.write_bytes(path.read_bytes() + b'\n# source drift control\n') + results = [] + for engine in ('sets', 'masks'): + out = Path(tmp) / (case + '-' + engine + '.json') + result = invoke(root, engine, out) + if failure is None: + A.require(result[0] == 0 and out.read_bytes() == expected, case + ': positive control') + else: + matches = (result[2].startswith('ValueError: ' + failure) if case.endswith('_source') + else result[2] == 'ValueError: ' + failure) + A.require(result[0] != 0 and matches and not out.exists(), + case + ': expected ' + failure + ', got ' + str(result)) + results.append(result) + A.require(results[0] == results[1], case + ': acceptance or diagnostic changed') + rows.append(dict(case=case, expected='reject' if failure else 'accept', + diagnostic=results[0][2], engines_agree=True)) + A.check_pins() + receipt = dict(status='PASS_OWNER_FOOTPRINT_MASKS', baseline_runs=6, + negative_controls=19, positive_controls=1, controls=rows, + seed=91, overlap_rows=[overlap_i, overlap_j], gap_row=gap_i, + scope='Pinned independent owner checker only; archived native artifacts, no cold supplier rebuild.') + if args.out: + with args.out.open('x') as f: + json.dump(receipt, f, indent=2) + f.write('\n') + print('PASS_OWNER_FOOTPRINT_MASKS baseline_runs=6 negative_controls=19 positive_controls=1') + + +if __name__ == '__main__': + main() diff --git a/research/owner-footprint-bitsets/workflow.example.yml b/research/owner-footprint-bitsets/workflow.example.yml new file mode 100644 index 0000000000..b6c0683fa8 --- /dev/null +++ b/research/owner-footprint-bitsets/workflow.example.yml @@ -0,0 +1,22 @@ +name: Owner footprint bitsets +on: + pull_request: + paths: + - 'research/owner-footprint-bitsets/**' + - '.github/workflows/owner-footprint-bitsets.yml' + workflow_dispatch: +permissions: + contents: read +jobs: + exact-equivalence: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - run: python -I -B research/owner-footprint-bitsets/test_masks.py + - run: python -I -B -O research/owner-footprint-bitsets/test_masks.py + - run: python -I -B research/owner-footprint-bitsets/verify.py + - run: python -B scripts/verify_selected_result.py