diff --git a/research/gf2-side-verification/CODE-SOURCES.json b/research/gf2-side-verification/CODE-SOURCES.json new file mode 100644 index 0000000000..5648e7ae21 --- /dev/null +++ b/research/gf2-side-verification/CODE-SOURCES.json @@ -0,0 +1,15 @@ +{ + "check_artifacts.py": "472211cc36381b6ec097f19cd98a7dd04d3d3158b5917acd7f2bf37ec5d144ac", + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "full_B.py": "db552a7a9561b01289dff84fa15b53e095ec4740b7bb94a8b88d118d79822c90", + "full_C.py": "82bc9c2bf905fa8fa05f327c68ed3f021c7ba20d4d8e6d35accbd041bd706d44", + "guard.py": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a", + "replay.py": "b121f83fd6e451d56a3095c611a7b0a2e0ccd24e7dd94447ecec37b7bce9408c", + "source/complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "source/complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b", + "verify.py": "5983283dab626963a5c69e78a1cdf69d1d195f4d7dda38c3309be3c8588c4b4a" +} diff --git a/research/gf2-side-verification/README.md b/research/gf2-side-verification/README.md new file mode 100644 index 0000000000..61078be42a --- /dev/null +++ b/research/gf2-side-verification/README.md @@ -0,0 +1,161 @@ +# Exact native GF(2) for the frozen H25 side verifier + +The complete frozen H=25 **complex-side verification segment** runs in +**24.807329 rather than 35.075541 seconds median wall time (29.2746% less)** +and **24.76 rather than 35.01 seconds median CPU (29.2773% less)** on the +recorded Linux host. All six fresh cold processes retain identical complete +results, structural/basis/role witnesses, every Gram-rank observation and every +ordered complement input/output. Compilation, linking, loading and every added +finite/binding/fallback check are paid in each candidate command. Both arms pay +the same complete witness serialization and complement-stream hashing. + +This is a scoped verification implementation improvement. It is **not the full +complex-network certificate**, a PR5864 speedup, a hosted performance factor, +a new mathematical construction, or a kappa/selected-frontier claim. Percentages +from these different workloads cannot be added. The further PR5864 target is +not established by this package. + +## Frozen workload and change + +Canonical base is `de5ec2e7a6074068452f45b1a191b5c72832df4a`. The unchanged +caller `scripts/complex_network.py:certificate` fixes H=25. The isolated scope +constructs `ComplexSideCircuit(25)`, initializes `Checks`, compiles physical +roles and performs **all** of `verify_map`, `verify_labels` and +`verify_role_frames`, in the caller's original order. No parameter is searched +and no source instruction is deleted or weakened. The two complete original +source files are copied byte-for-byte and pinned in SOURCES.json. + +The opt-in C backend changes only `Label.complement_in` and +`Label.nondegenerate`. It uses packed unsigned 64-bit GF(2) elimination and +Gram construction. Checked input widths and augmentation bounds precede all +shifts and array accesses. Unsupported widths, negative/nonexact values and +container cases use the original Python path rather than truncating. The +complete H25 workload takes 238,685 native complements and 59,959 native Gram +calls, with zero fallback. The reference `echelon`, `reduce`, `contains`, source +construction and all verification predicates remain active. + +The complement kernel preserves the source's pivot selection, all-row +elimination, insertion order and returned-vector order. The Gram path retains +the exact GF(2) field and all packed rows/ranks. This is unrelated to using a +modular lower bound as an exact rational-rank certificate. + +## Complete identity and qualification bill + +Each baseline and candidate command recomputes these source-pinned identities: + +| Observation | SHA-256 or count | +| --- | --- | +| Full result | `342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c` | +| Full structural/basis/role witness | `4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82` | +| Ordered Gram-rank transcript | `85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f` | +| Rank calls / distinct matrices | 59,959 / 252 | +| Ordered complement stream | `7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838` | +| Complement calls / canonical bytes | 238,685 / 55,839,507 | + +The complete witness is 58,143,622 canonical bytes; the rank transcript is +2,674,272 bytes. Each timed arm writes the same full bytes. One compressed +canonical copy is retained under `evidence/canonical/`; its decompressed bytes +and hashes are authoritative, while gzip hashes describe transport only. All +raw per-run artifacts remain in the donor's checkpoint, with source/evidence +receipts retained here. No witness or complement was sampled away. The +complement stream is hashed in constant memory, including call index, ordered +input vectors, exact list/None output type and every output vector. + +New finite controls include 5,329 exhaustive ordered small complement pairs, +585 small Gram cases, an independent dense-list elimination oracle, exact +ordered outputs, 64/65-bit and augmented-width boundaries, unsupported +type/iterator/fallback behavior, source/live builtin/helper/class/dispatch +drift rejection and zero-side-effect native-proxy rejection. Normal and +optimized finite modes retain the same explicit checks. Complete measurements +require normal assertion mode, preserving every assertion in the unchanged +source; optimized full verification is deliberately rejected. + +The initial profile showed that rank alone was too small to fund construction; +the measured wider boundary was complement/Gram work. Its instrumented 78-second +outer diagnostic is not a performance benchmark. Independent static review +found two gaps in v1: resolved helper freshness and missing complete complement +observations. V2 fixes both. Every v1 source/finite/baseline record is retained; +no v1 candidate complete timing was performed. One explicitly declared literal +v2 anchor constructed the new complement identity before the fixed timing +sequence; the literal digest was then frozen into **both** arms. Candidate mode +requires this expected digest before creating output or building native code. + +## Fixed cold comparison + +The predeclared order is B,C,C,B,B,C. All six science identities match. GNU +time includes compiler-child CPU. Every process starts with fresh mutable +circuit state, labels, verdicts, transcripts and native build; no answer/PASS +cache crosses a process or backend. The same source snapshots retain authenticated bytes/modes, with live method +environment guards under the declared serial stable-runtime contract. + +| Complete side segment | Median wall seconds | Median CPU seconds | +| --- | ---: | ---: | +| Unchanged Python baseline | 35.075541058 | 35.01 | +| Native complement/Gram candidate | 24.807329345 | 24.76 | +| Absolute saving | 10.268211713 | 10.25 | +| Reduction | 29.2746% | 29.2773% | +| Maximum within-arm spread | 1.115459876 | 1.10 | + +Both savings exceed 15%, 0.50 seconds and each arm's repeat spread. The first +pair passed the same declared screen before the remaining fixed samples were +run. No sample was dropped, no failed timing was replaced, and no automated +retry was made. See [the complete gate](evidence/MATRIX-COMPLETE-GATE.json), +[declared plan](evidence/MATRIX-PLAN.json), and retained raw receipts. + +## Reproduction + +Tested on Linux x86-64, CPython 3.12.3 and GCC 13.3. Existing `cc` and Python +development headers are required. No third-party dependency is installed and +no compiled binary is committed. This uses the tested CPython 3.12 C ABI; +abi3, free-threaded and subinterpreter support are not claimed. + +Fresh registered finite/source/native checks, about two seconds per mode here: + +```sh +python3.12 -B scripts/research_package.py --package research/gf2-side-verification +``` + +One complete guarded candidate replay, with a new external evidence directory: + +```sh +python3.12 -B research/gf2-side-verification/replay.py C /tmp/gf2-side-new-evidence +``` + +Use arm B for the complete unchanged baseline. The portable guard applies one +serial runner, 180 seconds per command, 1 GiB sampled process-group RSS and +zero automatic retries; the recorded round used 600 seconds initial feasibility +and a 1,500-second shared cap. New evidence directories prevent overwriting +retained runs. Parent source-inventory/transport checks are separate from the +timed cold scientific process, as documented by the raw guard receipts. +Metadata, committed bytes/modes, export, readonly replay and exact-head hosted +correctness CI are publication checks, not hosted performance evidence. + +## Credit + +Original complex-side source/caller and all retained CrocSwap construction, +verification and contributor notices remain unchanged. Ali Romman and the +retained predecessor authors are credited through the source history. Existing +GMP/FLINT/native precedents [PR5168](https://github.com/CrocSwap/integer-mult-bounds/pull/5168), +[PR5382](https://github.com/CrocSwap/integer-mult-bounds/pull/5382), +[PR2853](https://github.com/CrocSwap/integer-mult-bounds/pull/2853) and +[PR3143](https://github.com/CrocSwap/integer-mult-bounds/pull/3143) are adjacent +engineering precedents; this implementation adds no dependency or novel linear +algebra claim. The inherited Ali Romman PR5761 routing-test repair remains +unchanged and separately credited. + +Prepared by Chris R / Clear1nsight with substantial OpenAI Codex implementation, +user-requested GPT-6-astra xhigh design and separate static review. Only the +parent performed compiler/numerical execution, serially. Apache-2.0. Source +translation, finite independent comparisons and complete hashes are assisted +engineering evidence, not human or proof-kernel acceptance of a theorem. + +## Open next questions + +The smallest useful follow-up is a bounded profile of the complete original +complex-network caller before attempting any wider integration or claiming a +whole-certificate factor. Preserve the exact field, every additional stage and +its independent checks. That caller was not replayed here; its cost and resource +requirements remain unpriced. No shared helper or selected construction is +changed by this opt-in package. A broader matrix basis kernel would also need +canonical pivot/sign/vector and full witness contracts, not merely equal rank. +See [structured questions](TASK.json) and the retained independent source review. diff --git a/research/gf2-side-verification/SOURCES.json b/research/gf2-side-verification/SOURCES.json new file mode 100644 index 0000000000..ec55be86ce --- /dev/null +++ b/research/gf2-side-verification/SOURCES.json @@ -0,0 +1,52 @@ +{ + "schema_version": 1, + "base_commit": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "581f8d87008354eb5b869f7ed9de1317ad837ce8", + "sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + }, + { + "path": "scripts/complex_circuit.py", + "usage": "provenance", + "git_blob": "9e83a1065cd5b5f337b39de58d61bac335feb7ce", + "sha256": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1" + }, + { + "path": "scripts/complex_network.py", + "usage": "provenance", + "git_blob": "af9bb6d7b31f3006189761d99bdd919da84656a8", + "sha256": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + }, + { + "path": "research/gf2-side-verification/source/complex_circuit.py", + "usage": "input", + "git_blob": "9e83a1065cd5b5f337b39de58d61bac335feb7ce", + "sha256": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "pin": "head:b47911b3054242b95d5e0de259c7e6ff05942ff3:research/gf2-side-verification/source/complex_circuit.py" + }, + { + "path": "research/gf2-side-verification/source/complex_network.py", + "usage": "input", + "git_blob": "af9bb6d7b31f3006189761d99bdd919da84656a8", + "sha256": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b", + "pin": "head:b47911b3054242b95d5e0de259c7e6ff05942ff3:research/gf2-side-verification/source/complex_network.py" + } + ], + "predecessors": [ + 5168, + 5382, + 2853, + 3143 + ], + "native_source_sha256": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "scope": "No fullnetwork/PR5864/kappa/selected-frontier claim" +} diff --git a/research/gf2-side-verification/TASK.json b/research/gf2-side-verification/TASK.json new file mode 100644 index 0000000000..a1bdf4fa63 --- /dev/null +++ b/research/gf2-side-verification/TASK.json @@ -0,0 +1,60 @@ +{ + "schema_version": 1, + "task_id": "replay-runtime", + "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" + ] + }, + "bottleneck_link": "Faster trustworthy replays increase review throughput and let mechanism candidates be checked sooner.", + "author": "Chris R / Clear1nsight", + "base_commit": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "scope_status": "refined", + "scope_change_reason": "Donor requested all four C verification opportunities and at least15% improvement. This separate frozenH25side workload passes29.27%complete wallCPU afterallnewbills; noPR5864/fullnetwork/kappa claim.", + "actual_scope": "frozenH25/complete-side-verification/native-GF2-complement-Gram", + "stop_rule": "One bounded source-pinned profile, fixed finite controls, complete anchor then BCCBBC. Preserve all samples/drafts and no automatic retries; stop on field/witness/source/resource/noise mismatch.", + "time_budget_minutes": 60, + "outcome": "completed", + "evidence": "README.md and evidence/MATRIX-COMPLETE-GATE.json; allfourwitness identities, finite normalO, exact source bytes and complete cold resource receipts.", + "ai_assistance": "Substantial OpenAI Codex implementation; user-requested GPT-6-astra xhigh design and separate static review. One parent serial numerical runner; no human/proof-kernel acceptance.", + "open_questions": [ + { + "question": "Does this native side kernel improve the complete original complex-network certificate after every other stage and control is priced?", + "why_it_matters": "The measured29.27%scope is the entire side-verification segment, not the full network orPR5864.", + "first_step": "One unchanged complete-caller source/resource profile before proposing integration or another timing round.", + "blocked_by": "Full caller dependencies/costs/resources unpriced; no whole-network replay performed." + } + ] +} diff --git a/research/gf2-side-verification/VALIDATION.json b/research/gf2-side-verification/VALIDATION.json new file mode 100644 index 0000000000..244e934ea9 --- /dev/null +++ b/research/gf2-side-verification/VALIDATION.json @@ -0,0 +1,20 @@ +{ + "status": "PASS_LOCAL_COMPLETE_SIDE_15_PERCENT_AND_NOISE_GATES", + "normal_optimized_finite": "PASS", + "finite_exhaustive_ordered_complements": 5329, + "finite_small_Gram_cases": 585, + "complete_cold_processes": 6, + "complete_witnesses_all_equal": true, + "ordered_complement_calls": 238685, + "ordered_complement_bytes": 55839507, + "rank_calls": 59959, + "distinct_rank_matrices": 252, + "wall_reduction_percent": 29.27456399324708, + "CPU_reduction_percent": 29.2773493287632, + "same_measured_scientificcore_bytes": true, + "readonly_export_full_candidate": "PASS_FULL_CANDIDATE_AND_FINITE_NORMAL_OPTIMIZED_SOURCE_MODES_UNCHANGED", + "metadata_and_committed_bytes": "PASS_105_FILES_BEFORE_TRANSPORT_EVIDENCE_ADDITION", + "hosted_correctness": "UNCLAIMED_SEE_EXACT_HEAD_PR_RUN", + "primary_PR5864_target": "UNMET_BY_THIS_SEPARATE_SCOPE", + "full_complex_network_caller": "UNRUN" +} diff --git a/research/gf2-side-verification/VERIFY.json b/research/gf2-side-verification/VERIFY.json new file mode 100644 index 0000000000..d8fe8a8116 --- /dev/null +++ b/research/gf2-side-verification/VERIFY.json @@ -0,0 +1,40 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/gf2-side-verification/source/complex_circuit.py", + "research/gf2-side-verification/source/complex_network.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 30, + "checks": "Fresh cold native independent dense/source/binding/fallback finite controls; no full or timing run." + }, + { + "argv": [ + "{python}", + "-O", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 30, + "checks": "Same explicit finite controls in optimized mode; complete source assertions are never disabled." + }, + { + "argv": [ + "{python}", + "-B", + "{package}/check_artifacts.py" + ], + "timeout_seconds": 30, + "checks": "Separate byte-transport check: complete decompressed canonical witness and ordered Gram-rank transcript; no benchmark or mathematical acceptance." + } + ] +} diff --git a/research/gf2-side-verification/check_artifacts.py b/research/gf2-side-verification/check_artifacts.py new file mode 100644 index 0000000000..55e3c43d16 --- /dev/null +++ b/research/gf2-side-verification/check_artifacts.py @@ -0,0 +1,19 @@ +"""Byte-transport check of the complete canonical witness, separate from timing.""" +import gzip +from hashlib import sha256 +import json +from pathlib import Path + +root = Path(__file__).resolve().parent / 'evidence' / 'canonical' +manifest = json.loads((root / 'MANIFEST.json').read_text()) +for name, row in manifest.items(): + path = root / (name + '.gz') + digest = sha256() + size = 0 + with gzip.open(path, 'rb') as stream: + for block in iter(lambda: stream.read(1024 * 1024), b''): + size += len(block) + digest.update(block) + if size != row['canonical_bytes'] or digest.hexdigest() != row['canonical_sha256']: + raise ValueError('complete canonical artifact changed: ' + name) +print('PASS_COMPLETE_CANONICAL_WITNESS_AND_RANK_TRANSPORT') diff --git a/research/gf2-side-verification/compare_side_verifier.py b/research/gf2-side-verification/compare_side_verifier.py new file mode 100644 index 0000000000..d94920c274 --- /dev/null +++ b/research/gf2-side-verification/compare_side_verifier.py @@ -0,0 +1,190 @@ +#!/usr/bin/env python3 +"""One cold finite or complete side-verification run, under the parent's guard. + +The baseline and candidate serialize identical complete result, structural/ +label/role witness, and rank transcript artifacts. Candidate additionally pays +all C compilation/link/load and independent finite/binding/fallback controls. +No profile or warm-build reuse; no orchestration, retry, search or parallelism. +""" +from __future__ import annotations + +import time +START_WALL = time.perf_counter() +import argparse +import hashlib +import json +from pathlib import Path +import resource +import sys + +sys.dont_write_bytecode = True +from native_backend import (ROOT, SOURCE_SHA256, CALLER_SHA256, ComplementTrace, attach_trace, + bind, build_native, guard_module, load_source, require) +from finite_controls import run_controls +from profile_side_verifier import canonical, source_check + +EXPECTED = { + "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c", + "exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", + "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", + "rank_call_count": 59959, + "rank_distinct_matrix_count": 252, +} + + +def cpu_seconds(): + own = resource.getrusage(resource.RUSAGE_SELF) + children = resource.getrusage(resource.RUSAGE_CHILDREN) + return own.ru_utime + own.ru_stime + children.ru_utime + children.ru_stime + + +def scientific_run(module, phases): + def phase(name, action): + wall, cpu = time.perf_counter(), cpu_seconds() + answer = action() + phases[name] = {"wall_seconds": time.perf_counter() - wall, + "cpu_seconds_including_children": cpu_seconds() - cpu} + return answer + + c = phase("construction", lambda: module.ComplexSideCircuit(25)) + checks = phase("checks_initialization", lambda: module.Checks(c)) + code = phase("compile_roles", lambda: module.compile_roles(c)) + side_map = phase("verify_map", checks.verify_map) + labels = phase("verify_labels", checks.verify_labels) + roles = phase("verify_role_frames", lambda: module.verify_role_frames(c, checks, code)) + result = {"circuit": c.stats(), "side_map": side_map, "labels": labels, "role_frames": roles} + # This exactly matches profile_side_verifier.py's predeclared witness + # representation. Preserve basis and code dict insertion order as lists. + witness = { + "support": c.support, + "args": c.args, + "kind": c.kind, + "active": sorted(c.active), + "pieces": [(target, node, (coefficient.numerator, coefficient.denominator)) + for target, node, coefficient in c.pieces], + "labels": [(key, list(label.basis.items()), label.dim, label.key) + for key, label in checks.cache.items()], + "code": {"roles": code["roles"], "gates": code["gates"], + "sources": list(code["sources"].items()), + "outputs": list(code["outputs"].items())}, + } + return result, witness + + +def write_scientific(output, result, witness, rank_calls): + encoded_result = canonical(result) + encoded_witness = canonical(witness) + encoded_trace = canonical(rank_calls) + receipt = { + "result_sha256": hashlib.sha256(encoded_result).hexdigest(), + "exact_witness_sha256": hashlib.sha256(encoded_witness).hexdigest(), + "rank_trace_sha256": hashlib.sha256(encoded_trace).hexdigest(), + "rank_call_count": len(rank_calls), + "rank_distinct_matrix_count": len({rows for rows, _ in rank_calls}), + } + require(receipt == EXPECTED, "Complete output, ordered witness, or rank trace changed from the frozen profile") + # Same exact bytes and serialization work in both arms; file hashes omit + # a trailing newline exactly as the existing profile's digest did. + (output / "result.json").write_bytes(encoded_result) + (output / "witness.json").write_bytes(encoded_witness) + (output / "rank-trace.json").write_bytes(encoded_trace) + receipt["serialized_bytes"] = {"result": len(encoded_result), "witness": len(encoded_witness), + "rank_trace": len(encoded_trace)} + return receipt + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--mode", choices=("finite", "baseline", "candidate"), required=True) + parser.add_argument("--output", type=Path, required=True) + parser.add_argument("--expected-complement-sha256", help="Lock to the parent-recorded fresh v2 baseline complement stream") + args = parser.parse_args() + require(args.mode != "candidate" or args.expected_complement_sha256 is not None, "Candidate requires the fresh baseline complement SHA-256 before execution") + require(args.expected_complement_sha256 is None or (args.mode != "finite" and len(args.expected_complement_sha256) == 64 and all(c in "0123456789abcdef" for c in args.expected_complement_sha256)), "Invalid or inapplicable expected complement SHA-256") + require(not args.output.exists(), "Refusing to overwrite earlier run evidence") + args.output.mkdir(parents=True) + require(source_check() == 25, "Frozen H changed") + if args.mode != "finite": + require(sys.flags.optimize == 0, "Complete measurements require all unchanged source assertions") + phases = {} + controls = None + native = None + build = None + if args.mode in ("finite", "candidate"): + wall, cpu = time.perf_counter(), cpu_seconds() + native, build = build_native(args.output / "cold-build") + phases["cold_compile_link_load"] = {"wall_seconds": time.perf_counter() - wall, + "cpu_seconds_including_children": cpu_seconds() - cpu} + wall, cpu = time.perf_counter(), cpu_seconds() + controls = run_controls(native) + phases["all_finite_independent_binding_fallback_controls"] = { + "wall_seconds": time.perf_counter() - wall, + "cpu_seconds_including_children": cpu_seconds() - cpu, + } + (args.output / "finite-controls.json").write_text(json.dumps(controls, indent=2, sort_keys=True) + "\n") + complete = None + binding = None + if args.mode != "finite": + rank_calls = [] + wall, cpu = time.perf_counter(), cpu_seconds() + module = load_source("_matrix_complete_" + args.mode) + complement_trace = ComplementTrace(module.Label) + if args.mode == "candidate": + binding = bind(module, native, rank_calls, complement_trace) + else: + guard_module(module) + attach_trace(module, rank_calls, complement_trace) + phases["cold_source_load_guard_bind"] = {"wall_seconds": time.perf_counter() - wall, + "cpu_seconds_including_children": cpu_seconds() - cpu} + result, witness = scientific_run(module, phases) + wall, cpu = time.perf_counter(), cpu_seconds() + complete = write_scientific(args.output, result, witness, rank_calls) + phases["same_complete_witness_trace_serialization"] = { + "wall_seconds": time.perf_counter() - wall, + "cpu_seconds_including_children": cpu_seconds() - cpu, + } + complete["result"] = result + complete["complement_trace"] = complement_trace.receipt() + require(complete["complement_trace"]["calls"] == 238685, "Complete ordered complement call coverage changed") + if args.expected_complement_sha256 is not None: + require(complete["complement_trace"]["sha256"] == args.expected_complement_sha256, "Complete complement stream differs from the fresh baseline") + (args.output / "complement-transcript.json").write_text(json.dumps(complete["complement_trace"], indent=2, sort_keys=True) + "\n") + if binding is not None: + expected_calls = {"complement_native": 238685, "complement_fallback": 0, + "gram_native": 59959, "gram_fallback": 0} + require(binding["counters"] == expected_calls, "Frozen complete native call coverage changed") + complete["native_calls"] = dict(binding["counters"]) + source_files = ("native_gf2.c", "native_backend.py", "finite_controls.py", + "compare_side_verifier.py", "profile_side_verifier.py") + sources = {name: hashlib.sha256((ROOT / name).read_bytes()).hexdigest() for name in source_files} + receipt = { + "status": "FINITE_PASS" if args.mode == "finite" else "COMPLETE_SIDE_PASS", + "mode": args.mode, + "qualification_revision": 2, + "expected_complement_sha256": args.expected_complement_sha256, + "base_main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "frozen_sources": {"complex_circuit.py": SOURCE_SHA256, "complex_network.py": CALLER_SHA256}, + "engineering_sources": sources, + "complete": complete, + "controls": controls, + "build": build, + "phases": phases, + "measured_wall_seconds_before_receipt_write": time.perf_counter() - START_WALL, + "process_plus_compiler_cpu_seconds_before_receipt_write": cpu_seconds(), + "environment": {"python": sys.version, "executable": sys.executable, + "platform": sys.platform, "optimization": sys.flags.optimize}, + "measurement_scope": "Cold entire process; parent guard outer wall/CPU is authoritative. Both arms write identical complete witness bytes. Candidate additionally compiles, links, loads and runs every finite/native/binding control.", + "scientific_scope": "Frozen H=25 complex side verification only; no full network certificate, selected frontier, PR5864 gain, new construction, parameter search or kappa admission.", + } + (args.output / "receipt.json").write_text(json.dumps(receipt, indent=2, sort_keys=True) + "\n") + print(json.dumps({"status": receipt["status"], "mode": args.mode, + "wall_seconds": receipt["measured_wall_seconds_before_receipt_write"], + "cpu_seconds_with_compiler": receipt["process_plus_compiler_cpu_seconds_before_receipt_write"], + "complete_hashes": None if complete is None else {key: complete[key] for key in EXPECTED}, + "complement_trace": None if complete is None else complete["complement_trace"], + "controls": None if controls is None else controls["status"], + "phases": phases}, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/gf2-side-verification/evidence/MATRIX-COMPLETE-GATE.json b/research/gf2-side-verification/evidence/MATRIX-COMPLETE-GATE.json new file mode 100644 index 0000000000..cc8fc3d018 --- /dev/null +++ b/research/gf2-side-verification/evidence/MATRIX-COMPLETE-GATE.json @@ -0,0 +1,101 @@ +{ + "status": "PASS_15_PERCENT_COMPLETE_SIDE_GATE", + "scope": "Entire H25 complex-side verification segment, not fullnetwork orPR5864", + "order": [ + "B1", + "C1", + "C2", + "B2", + "B3", + "C3" + ], + "samples": { + "B": [ + { + "label": "B1", + "wall": 35.17702062198077, + "cpu": 35.07 + }, + { + "label": "B2", + "wall": 34.0615607459913, + "cpu": 33.97 + }, + { + "label": "B3", + "wall": 35.07554105800227, + "cpu": 35.01 + } + ], + "C": [ + { + "label": "C1", + "wall": 24.85352278899518, + "cpu": 24.77 + }, + { + "label": "C2", + "wall": 24.807329344999744, + "cpu": 24.76 + }, + { + "label": "C3", + "wall": 24.61743560800096, + "cpu": 24.51 + } + ] + }, + "medians": { + "B": { + "wall": 35.07554105800227, + "cpu": 35.01 + }, + "C": { + "wall": 24.807329344999744, + "cpu": 24.76 + } + }, + "spreads": { + "B": { + "wall": 1.1154598759894725, + "cpu": 1.1000000000000014 + }, + "C": { + "wall": 0.23608718099421822, + "cpu": 0.259999999999998 + } + }, + "absolute_saving_seconds": { + "wall": 10.268211713002529, + "cpu": 10.249999999999996 + }, + "fractional_saving": { + "wall": 0.2927456399324708, + "cpu": 0.292773493287632 + }, + "noise_gate": { + "wall": true, + "cpu": true + }, + "same_complete_result_rank_label_role_complement_witnesses": true, + "scientific_identity": { + "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c", + "exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", + "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", + "rank_call_count": 59959, + "rank_distinct_matrix_count": 252, + "complement_trace": { + "calls": 238685, + "canonical_stream_bytes": 55839507, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838" + }, + "serialized_bytes": { + "rank_trace": 2674272, + "result": 527, + "witness": 58143622 + } + }, + "cold_compile_and_all_new_controls_paid": true, + "no_samples_discarded": true +} diff --git a/research/gf2-side-verification/evidence/MATRIX-PLAN.json b/research/gf2-side-verification/evidence/MATRIX-PLAN.json new file mode 100644 index 0000000000..4ee4c545ed --- /dev/null +++ b/research/gf2-side-verification/evidence/MATRIX-PLAN.json @@ -0,0 +1,21 @@ +{ + "scope": "Entire cold H25 complex-side verifier segment, all original side checks plus complete result/label/role/rank/complement witness identity; NOT fullnetwork orPR5864", + "anchor_complement": { + "calls": 238685, + "canonical_stream_bytes": 55839507, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838" + }, + "anchor_role": "New missing-witness coverage construction only, not a selected benchmark sample. v1source/finites/baseline preserved; noCcandidate timed beforev2.", + "order": [ + "B1", + "C1", + "C2", + "B2", + "B3", + "C3" + ], + "initial_pair_gate": "both complete wall and CPU reduction>=15%, delta>.50sec, all hashes/calls/bills equal; no repeatsifgatefails", + "final_gate": "both median reduction>=15%, delta>.50sec andgreaterthan eacharmrepeatspread; allsamplespreserved; no automaticretries", + "compiler_and_checks": "candidate pays fresh cold build/load and all finite/binding/independent/fallback controls. Both arms pay identical full streamed complement and witness serialization." +} diff --git a/research/gf2-side-verification/evidence/astra-matrix-independent-review.md b/research/gf2-side-verification/evidence/astra-matrix-independent-review.md new file mode 100644 index 0000000000..942471097f --- /dev/null +++ b/research/gf2-side-verification/evidence/astra-matrix-independent-review.md @@ -0,0 +1,370 @@ +# Independent static review: bounded packed GF(2) side verifier + +Reviewed 2026-10-27, against the frozen stage +outputs/c-verification-all-opportunities-20261027/stages/matrix-qualification-v1. +This reviewer only read source and wrote this report. No compiler, import of the +reviewed modules, numerical run, timing, browser, Git operation or dispatch was +performed. The parent owns the sole serial runner. No measured source was edited. +The rational nomination remains closed; this separate H=25 side workload does +not contribute a PR5864 improvement or reopen mathematics. + +## Decision + +**No blocking C memory-safety, integer-width, field-semantics or complement-order +error found in the supported finite domain.** The implementation is a plausible +source-faithful optimization of the frozen side checks, supported by substantial +finite independent validation. The parent must still determine complete measured +performance from its retained outer receipts. + +Two concrete evidence/binding limits require either narrow documentation or a +separately frozen repair. Neither is evidence that a freshly loaded, unchanged +H=25 measurement is numerically wrong: + +1. The runtime guard authenticates function code and the ownership of the globals + dictionary, but does not authenticate all resolved globals/builtins, and it + is not rechecked after installation. It does not establish arbitrary live + runtime-drift equivalence or dynamic fallback. +2. The three complete hashes and native call count do not compare every ordered + complement result. They cover complete structural/label/role witnesses and the + complete Gram rank transcript. Complement order has a direct source argument + and finite exact comparisons, not a full complement transcript. + +Do not silently broaden either boundary in a release note. If stronger claims +are required, freeze changed instrumentation/guards separately, retain the old +samples and charge their cost before a new complete comparison. + +## Inputs and pins + +Inspected native_gf2.c, native_backend.py, finite_controls.py, +compare_side_verifier.py, profile_side_verifier.py and both files under source/. +The frozen source pins in the stage are: + +- complex_circuit.py: + d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1; +- complex_network.py: + 0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b; +- upstream base recorded by the harness: + de5ec2e7a6074068452f45b1a191b5c72832df4a. + +The source caller fixes H=25. The harness executes exactly the construction, +Checks initialization, compile_roles, verify_map, verify_labels and +verify_role_frames side segment in the caller's order. It does not execute the +remaining complex_network.certificate claims or admit a kappa result. + +## Finding 1: the live-binding claim exceeds the actual guard + +Relevant locations: native_backend.py:42-68 and 122-166. + +The guard checks the bytes of both frozen Python files; expected function code, +co_filename, defaults/closure shape; globals-dictionary identity; Label's exact +class/MRO/attribute names; and each Label method's function code. These are useful +checks. Globals-dictionary identity is not equality of the values a function +will resolve from that dictionary or its builtins mapping. + +Concrete static counterexample, without executing it: after load_source and +before bind, assign module.sum = lambda values: 0. Source bytes and every checked +function code remain identical. guard_module accepts the same module dictionary +ownership and class shape. A raw Label with basis {0: 1} has a literal Gram row +of zero under that changed sum, so literal nondegenerate returns False. The native +Gram is [1], rank 1, and the installed method returns True. The existing finite +binding-rejection controls change dot, rank or the target method; they do not +cover a module shadow of sum, list, enumerate, range, len, next or max, nor changes +to a function's builtins mapping. + +A second static example is post-bind module.dot = lambda a, b: 0: supported +calls continue to invoke C without a freshness check, while captured original +fallback methods retain dynamic access to module.dot. Returning original_dot and +original_rank in the binding receipt does not enforce their continued use or +identity. Changes to Label attribute hooks after bind likewise are outside the +one-time guard. + +Recommended bounded claim for the existing measurement: an isolated, freshly +loaded frozen module with standard resolved dependencies, whose globals/class +and input state remain stable for the run. Under that premise, the harness itself +does not introduce the counterexamples and the current scientific comparison is +not invalidated. Do not claim that arbitrary late runtime mutations automatically +fallback safely or preserve original semantics. + +If broader reusable binding is required, capture and validate the resolved names +used by the affected functions and their nested code objects, including their +builtins mappings; explicitly handle the rank-trace wrapper as an allowed owned +replacement. Add pre-bind global-shadow and post-bind drift controls. Check +freshness at an appropriate paid boundary, or refuse native use once drift is +observed. A one-time initial guard can be sufficient for a deliberately private +stable module; it is not a live-drift proof. + +## Finding 2: complete hashes omit the complement-return transcript + +Relevant locations: compare_side_verifier.py:scientific_run/write_scientific and +source/complex_circuit.py:Checks.residual_ok/label_ok. + +The complete witness contains circuit support/arguments/kinds, active nodes, +pieces with exact rational pairs, all cached Label bases/dimensions/keys, and +compiled role/source/output data. The rank transcript contains each original +ordered Gram matrix and its rank. Neither contains the ordered lists returned by +Label.complement_in. + +The source consumes a complement through `not res or odd(res)` in residual_ok and +through the analogous predicate in label_ok. A reordered list or a different +same-span complement can preserve those predicates, all stored Label data and +all Gram calls. The native complement count 238,685 proves route/volume coverage, +not equality of the 238,685 returned lists. Thus a complete pair matching all +three hashes does not itself prove complete complement-witness equality. + +The implementation nevertheless has a strong direct source argument: its +augmented rows, pivot choice, all-row XOR elimination and output traversal are +literal translations, and finite_controls.exact_list checks exact order against +a separate unchanged source module. Report these as the evidence for ordered +complement preservation. Do not attribute that conclusion to a transcript that +was not recorded. + +If exact complete complement evidence is required, instrument both baseline and +candidate symmetrically to record/hash the full ordered (small rows, big rows, +returned vectors) stream, preserving insertion order and multiplicity. Price the +conversion, recording/hash and serialization in both commands. This changes the +measured workload identity and requires new frozen receipts; it should not be +retroactively attached to existing timings as though it had been paid. + +## C memory and ownership review + +native_gf2.c uses only fixed arrays of 64 uint64_t values. read_vectors first +requires an exact dict, rejects length >64, and checks `at >= length` before each +array write. It validates the final count. Every accepted value is an exact +Python int, excluding bool and int subclasses, and conversion through +PyLong_AsUnsignedLongLong either produces the full unsigned 64-bit value or +returns NotImplemented after an OverflowError. Negative and oversized integers +are not masked or truncated; the Python wrapper calls the original method. +Other Python errors propagate. + +PyDict_Next supplies borrowed entries. In the accepted branch, only exact-int +conversion occurs before values are copied into C arrays. It invokes no foreign +numeric protocol; the GIL remains held and there is no release block. C arrays +are the only inputs used during elimination and result allocation, so Python +allocation/GC while constructing outputs does not leave borrowed vector pointers +in use. No caller dictionary or Label object is changed by the kernel. Keys are +not accessed semantically, matching the original values-only algorithms. + +Every tuple/list allocation is checked. Newly created integers are transferred +with PyTuple_SET_ITEM/PyList_SET_ITEM into newly allocated containers. On a later +allocation failure, decref of the partially populated container safely releases +filled entries and tolerates its remaining NULL slots. gram_rank correctly +releases the Gram tuple when rank allocation fails, and releases both owned +objects if the final pair allocation fails. Both entries are stolen exactly once +on success. complement decrefs its partially filled list on an invariant or +integer-allocation failure. No leak, double-decref or unchecked reference use was +identified in these paths. + +The native extension has no mutable cache/global answer state, no callback API, +no manual long-integer digit access and no recursion. Scratch is local and bounded +(three 64-element arrays in each main kernel). The busy/reentry complexity of the +rational cache is absent here. The static ABI assertion requires a 64-bit unsigned +long long, matching both conversion and output constructors. Unsupported compiler +platforms fail compilation rather than silently narrowing values. + +## Shift and index proof + +All shifts operate on uint64_t or UINT64_C values, never on a signed 32-bit `1`. + +- parity64 shifts by 32, 16, 8 and 4; its table shift is in 0..15. Folding XORs + together all nibbles and 0x6996 returns their final parity. +- Gram construction has n <=64 and j in 0..n-1, so every shift is in 0..63. +- binary_rank visits columns 0..63. It only accesses rows[rank] after finding a + pivot with rank <= pivot < n; the loop additionally stops when rank == n. +- complement requires k+n <=64 before forming augmented rows. With n>0, + k+i <=k+n-1 <=63. Pairing shifts j=2^64; 65 vectors; and all-zero/dependent inputs. Static inspection found +no untested shift-by-64 expression reachable through the accepted domain. + +## Exact field, pivots and observable order + +The source operates over GF(2), with packed integer vectors and dot equal to +parity(x & y). The native parity operation and XOR elimination implement that +same field. This is not modular evidence for a rational-rank claim. + +For complement, both implementations copy other.basis values first and then +self.basis values in dict insertion order. They put pairings in the low k bits +and coefficient identity in bit k+i, scan pairing columns from low to high, +choose the first available pivot at/after the current rank, swap it into that +rank, and clear its column in every other row. Both emit rows rank..n-1 in their +current order and reconstruct each vector by XORing the same ordered ambient +basis coefficients. They neither sort nor recanonicalize the complement list. +This preserves repeated/zero vectors too: a dependent ambient list can produce +zero/dependent image vectors while the coefficient-kernel basis cardinality is +still n-rank(pairing). + +For Gram rank, C deliberately clears only lower rows, while the source clears +all other rows. Only scalar rank is returned by source.rank, so forward Gaussian +elimination is sufficient. The transcript uses the original Gram rows, copied +before C elimination, not a falsely advertised identical reduced matrix. Above- +pivot rows cannot affect the remaining below-pivot elimination subproblem. Native +Gram rows retain input insertion order, and nondegenerate returns an exact bool, +including True for an empty basis. C returns exact Python ints/list/tuple outputs. + +## Independent oracle and coverage assessment + +finite_controls loads two distinct source modules: an untouched oracle module and +a separately bound candidate module. It also implements an independent dense +binary oracle using lists, multiplication/addition modulo two and descending +pivot order, without calling packed source/native linear-algebra helpers. + +For complements, dense checks establish orthogonality, membership in the ambient +span, coefficient-kernel output count and complete image dimension. For dependent +ambient inputs, the checked dimension formula rank(B)-rank(pairing) is valid +because ker(B) is contained in ker(pairing); expecting every output vector to be +independent would have been incorrect. Exact ordered-list comparison to the +unchanged source supplies the algorithm-specific witness-order check that the +mathematical span oracle intentionally does not provide. + +The core corpus covers 5,329 ordered small/big pairs over three-bit vectors and +585 ordered Gram lists, including zeros and dependence. Additional controls cover +64-bit/augmented boundaries, 24 genuine Label insertion permutations, unsupported +numeric/container types, missing attributes, subclasses, broken iterators, source +method/helper replacement and wrong-math/reordered-output oracle negatives. The +source-control predicates use explicit require, so they survive -O. Complete +measurements explicitly reject -O to retain every original scientific assertion. + +The parent reported normal finite success and an optimized finite run in progress +at assignment. This reviewer did not independently execute either mode and does +not certify the eventual optimized result from static inspection. No sanitizer, +allocation-fault or arbitrary runtime-drift verification is claimed. All defined +complete scientific outputs and every Gram input/rank are compared against fixed +expected hashes, and fixed native counts prevent silently using fallback for the +claimed H=25 complete path. Finding 2 bounds what that complete comparison says +about complements. + +## Source/build and timing boundaries + +The cold builder requires a new build directory, records the C source hash, +compiler command/output and extension hash, and checks unchanged source bytes +after compilation. The parent guard authenticates the frozen stage inventory. +The command compiles, links, loads and runs every finite/binding/fallback control +inside the candidate process; child compiler CPU is included by the outer guard. +Both complete arms serialize the same structural witness and rank-trace bytes. + +The compiler reads the stage's C path directly rather than an independently +immutable source snapshot. Pre/post equality plus the parent's frozen-source +contract is sufficient for this stable private stage, but is not protection +against an adversarial transient file change restored between checks. Do not +claim stronger concurrent-source authentication than is enforced. + +The finite suite contains its fixed diagnostic micro in every candidate control +bill. Those micro timings are not complete performance evidence. The parent's +outer full-process receipts, including build/controls and serialization, govern +any side-workload performance claim. A successful matrix result is scoped to this +frozen H=25 side verification, not the full network certificate, PR5864 speed, +selected frontier, new construction or kappa admission. + +## V2 source-only follow-up review + +The parent requested review of the separately owned matrix/ v2 drafts before +freezing new measurements. I read native_backend.py, finite_controls.py and +compare_side_verifier.py there, without importing, compiling or executing them. +C bytes match the reviewed v1 exactly: SHA256 +e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc. +The v1 source/receipt conclusions above remain historical and are not rewritten. + +**V2 addresses both earlier findings at source level under its explicit serial, +no-mutation-during-a-call contract.** This is clearance to freeze and qualify the +new source, not a finite/runtime or performance pass. + +The revised initial guard verifies canonical resolved builtin lookup, rejects +source-level shadows, checks each function's captured __builtins__ pointer as +well as the module slot, and authenticates exact immutable source-code metadata +before equality comparisons. Custom Label descriptors/MRO/dispatch are rejected. +A forged function constructed with alternate builtins cannot become acceptable +merely by restoring the module's __builtins__ slot. Builtin identities are checked +before source file/path work; compilation for inspection uses an anchored compile +function. These changes address the concrete pre-bind sum-shadow counterexample. + +RuntimeGuard snapshots source/helper/class identities, live function code, +defaults, closures/cells, captured builtin pointers and native entry functions. +It runs before either native arithmetic or fallback. Installing the guard object +into the wrapper closure before initializing its snapshots avoids immediately +invalidating the guard's own runtime cell. Checks are identity-based after binding, +so changed callables/descriptors need not be executed to detect drift. The new +controls explicitly cover source shadows, captured builtins, source/helper code, +class dispatch, inherited lookup, shared builtin drift and native dispatch. +These checks do not protect arbitrary mutation of guard/backend memory, unrelated +module globals, or mutation during a call; the module now states those limits. + +ComplementTrace snapshots exact Label/exact dict/exact integer inputs in the +same other-then-self order in both arms and streams canonical newline-delimited +JSON containing call index, ordered self/other vectors and typed ordered output. +It distinguishes [] from None and preserves input/output order, multiplicity, +signs and unbounded exact integer values. The raw stream is not retained: its +SHA256, canonical byte count and call count are recorded. Thus the new evidence +is a complete ordered stream digest, not a downloadable full JSONL witness. + +Finite fallback controls leave observation disabled, avoiding additional +values()/iterator invocations on arbitrary custom containers. Complete tracing +is deliberately restricted to exact objects; its independent tests include +large-integer fallback while retaining exact plain dict/int inputs. New negative +controls distinguish input reorder, output reorder and [] versus None. C's normal +complement result remains an exact list; None support is only a recorder control. + +The complete command now requires 238,685 streamed calls and can compare the +stream digest with a fresh baseline. At the reviewed draft, the expected digest +CLI argument was still optional for candidate mode. A candidate without that +argument records a digest but does not compare it; its COMPLETE_SIDE_PASS cannot +by itself establish complement equality. I recommended requiring a nonempty +--expected-complement-sha256 for candidate mode before output/build work. At +minimum, the parent's acceptance gate must supply the fresh v2 baseline digest to +every candidate command or explicitly compare the complete stream receipts. +This is an operational qualification condition, not a found arithmetic error. + +One minor interface hardening recommendation was also sent: bind should check +that native is an exact ModuleType before reading native.complement or +native.gram_rank. Root's freshly built native module already satisfies that +condition, but doing the check first prevents an unsupported proxy's attribute +hooks from running before its eventual rejection. + +Reviewed draft Python hashes, before any final small hardening in response: + +- native_backend.py: + ff67d20a97287de84b71aaf3de759bb3b0d6ad1caa40ffa16d5e13750a5cb629; +- finite_controls.py: + e90c663b7be03d6f28d4741b015697a24c56140fbb6fe33bbc149506b4d1cf85; +- compare_side_verifier.py: + 95aa0d249eb1906589f643d7507123d0113592c628e1da7c4eab02d5db29b8aa. + +The new per-call guard and symmetric transcript costs belong to the new complete +workload. Preserve prior samples as v1 evidence and use freshly frozen v2 finite +and full-process receipts for any v2 performance conclusion. No new issue was +found that requires changing the C arithmetic implementation. + +### Final v2 source disposition + +I read the two final hardening changes and the added NativeProxy control. +Candidate mode now requires the expected complement SHA256 immediately after +argument parsing, before creating output or compiling. bind checks exact native +ModuleType and owned builtin entry points through direct dictionary lookup before +accessing native attributes. The proxy control requires rejection without any +attribute hook invocation. + +**Static disposition: CLEARED TO FREEZE FOR V2 QUALIFICATION.** Both original +findings and the two final operational/purity recommendations are addressed in +the reviewed source under its stated stable-runtime boundary. No remaining +blocking issue was identified. This does not substitute for the parent's finite +normal/-O or complete performance/equality receipts. + +Final reviewed Python hashes: + +- native_backend.py: + e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5; +- finite_controls.py: + df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a; +- compare_side_verifier.py: + 6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68. + +C remains unchanged from the reviewed v1 hash above. No reviewed matrix source, +measured stage or evidence was edited by this reviewer. diff --git a/research/gf2-side-verification/evidence/astra-matrix.md b/research/gf2-side-verification/evidence/astra-matrix.md new file mode 100644 index 0000000000..f490fb87ea --- /dev/null +++ b/research/gf2-side-verification/evidence/astra-matrix.md @@ -0,0 +1,84 @@ +# Opportunity 3: exact matrix / finite-field feasibility + +Source-only preparatory status: no compiler, imported verifier, numerical check or timing was executed by this agent. The parent owns the sole serial guarded numerical runner. + +The proposed first workload is the unchanged `complex_network.certificate()` side-verification segment at its literal `H = 25`: construct `ComplexSideCircuit(25)`, initialize `Checks`, compile physical roles, and run **all** of `verify_map`, `verify_labels`, and `verify_role_frames`. These are called in the identical order by the pinned caller. This is a genuine complete finite side-check segment, not the full network certificate, the selected construction replay, or a PR5864 timing workload. No h or mathematical parameters are searched. + +Sources are pinned to `de5ec2e7a6074068452f45b1a191b5c72832df4a`. Authentic source copies are in `matrix/source/`; their SHA-256 hashes are enforced by `matrix/profile_side_verifier.py`. The caller is parsed only to confirm its fixed H. Only the self-contained side-verifier module is imported by the proposed run. Existing synced or predecessor source files are unchanged. + +## Why this scope + +`complex_circuit.rank` is literal GF(2) elimination and returns only a Python `int`. A packed native GF(2) kernel can preserve its exact field without adding FLINT/GMP dependencies or confusing modular lower bounds with rational rank. In contrast, `rational_span_frames.basis` exposes exact primitive integer rows, canonical signs and pivots; merely returning the same rational rank would violate its contract. `audit_stage_pair.modular_rank` is a mod-101 lower-bound screen inside a larger rational certificate. Speeding it would neither prove equality with rational rank nor remove the exact rational fallback. Those alternatives need their own expensive caller and independent arithmetic validation. + +The profile also records `echelon`, `reduce`, `dot`, `Label.complement_in` and `Label.nondegenerate`, because a rank-only call may be too small to pay compiler/load and finite checks. Moving those surrounding routines is a wider contract: dictionary insertion order, canonical basis rows/pivot masks, exact list/dict/int types, complement vector order, exceptions, and all observable witness bytes must match. No source rewrite is justified before this cost evidence. + +## Parent's one proposed diagnostic run + +Under the already authorized **serial**, **180-second**, **1-GiB process-group RSS** guard, using the declared shared time budget, run from the workspace: + +```sh +python3 -B outputs/c-verification-all-opportunities-20261027/matrix/profile_side_verifier.py --output outputs/c-verification-all-opportunities-20261027/matrix/profile-run-1 +``` + +No automatic retry. The output path must not exist. `-O` is rejected for this profile because the unchanged verifier uses `assert`. The script neither compiles C nor alters imports in the source files. Instrumentation wraps rank only to retain each actual input matrix and scalar output. It profiles cold module load, construction, all side checks and role compilation; writes raw cProfile data, exact rank transcript/corpus, unmodified result fields and complete structural/basis/role hashes. Profiling and transcript overhead make these timings diagnostic only. Nested cumulative times cannot be summed or turned into claimed complete speedup. + +## Conditional native design and controls + +If measured costs leave a credible complete gain, the smallest candidate is a self-contained C extension with a checked `uint64_t` fast path for exact nonnegative built-in Python integers of at most 64 bits. Inputs outside that domain retain the untouched Python rank function. Every arbitrary-width/negative/subclass/iterable compatibility path must be explicit; silent truncation or changed exceptions are forbidden. Native forward elimination may clear only lower rows because rank is its sole returned observation, but this optimization is inappropriate for basis-producing helpers without exact witness comparison. + +The qualification bill must include source hashing, compilation, linking, cold loading, conversion, every actual traced matrix, finite exhaustive small binary matrices, boundary bits and arbitrary-width fallback, negative/type/iterator controls, independent dense-list GF(2) elimination, and all complete unchanged side checks. Preserve the unchanged Python verifier as oracle. Repeat complete baseline/candidate runs only if the first one-pair screen remains favorable after those costs. No new third-party dependency or shared-helper replacement is needed for this smallest route. + +A wider kernel must separately preserve `echelon` insertion/pivot order and `complement_in` row order and prove all bound/fallback cases. The existing whole-witness receipt will make these observations explicit, but matching hashes by itself is not independent mathematical correctness. + +## Credit and limits + +Credit existing PR5168 and PR5382 for optional FLINT producer/discovery use and deliberately separate clean integer verification; PR2853 and PR3143 for optional gmpy2/integer acceleration and its replay environment. These predecessors do not establish that adding those dependencies speeds this frozen verifier. Preserve the source's authorship, including the inherited complex-side construction and its distinct finite-verification scope. + +This opportunity is independent of the remaining ≥15% complete PR5864 target. Matrix microseconds, instrumented totals, or side-only speedups cannot count toward that objective. A negative cost screen is a useful result and should stop construction within this round. + +Open next question: does the fixed h25 complete side profile assign enough avoidable work to native finite-field kernels to fund their complete cold and independent-check bill? This remains unmeasured until the parent executes the bounded run. + +## Profile received and wider source-only implementation + +The parent completed the single diagnostic profile successfully: 78.065 seconds outer elapsed, about 414 MB process-group RSS; 75.838 seconds inside the profiled side segment. The relevant nested costs were `complement_in` 41.831 seconds (238,685 calls), `nondegenerate` 8.772 seconds (59,959 calls), and `rank` 2.028 seconds. `dot`'s 15.998 seconds is included in the callers and is not an additional saving. These are instrumented diagnostics, not unprofiled baseline speed measurements. The rank-only route is stopped as too small to be a compelling first candidate. + +The wider source-only candidate replaces **only** `Label.complement_in` and `Label.nondegenerate`, leaving `echelon`, `reduce`, `contains`, canonical labels and the entire side verifier untouched. Files are in `matrix/`: + +- `native_gf2.c`: dependency-free C extension with bounded unsigned 64-bit vectors; literal ordered augmented elimination for complements and packed Gram construction plus scalar rank. +- `native_backend.py`: cold compile/link/load, pinned-source and current-function-code guards, binding and untouched Python fallbacks. +- `finite_controls.py`: unchanged-source comparisons, an independent dense-list GF(2) oracle, exhaustive ordered small matrices, word/augmentation boundaries, type/iterator/negative/large-integer fallbacks, runtime rebinding rejection, permutation checks and fixed conversion-plus-kernel diagnostics. +- `compare_side_verifier.py`: one finite or complete cold run, no retries, no search or orchestration. + +The C complement follows the source's first available pivot, all-row clearing, and output row order exactly. It never canonicalizes or sorts the output. All vectors must be exact nonnegative built-in integers fitting 64 bits. Exact dict insertion order is preserved; map keys are unobserved by both original methods. Complement augmentation additionally requires `len(self.basis) + len(other.basis) <= 64`; unsupported domains fall back to the unchanged source. No narrowing conversion is accepted. Gram processing returns exact ordered Gram rows and rank to retain the **same full rank transcript**, while the bound public method returns the original exact bool type. + +The complete harness predeclares and checks all three diagnostic hashes: + +- Result: `342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c`. +- Full structural/basis/role witness: `4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82`. +- Ordered rank trace: `85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f`. + +Both complete arms perform identical result, complete-witness and rank-trace serialization and write those same bytes to their own output directory. Candidate additionally pays every cold compiler/link/load and finite-control cost; child compiler CPU is included in its internal CPU report. The outer parent guard remains the authoritative complete measurement. Each output directory and candidate build is fresh; reuse and overwrite are refused. Complete measurements reject `-O`; finite controls can be run under `-O` because their qualification decisions use explicit exceptions and the finite fixtures do not depend on assertion elimination. + +Proposed first discriminating execution by the parent, under the existing serial 180-second/1-GiB limits: + +```sh +python3 -B outputs/c-verification-all-opportunities-20261027/matrix/compare_side_verifier.py --mode finite --output outputs/c-verification-all-opportunities-20261027/runtime/matrix-finite-1 +``` + +Only after finite success and a credible cost screen, one complete baseline and candidate pair use `--mode baseline` / `--mode candidate` and distinct new output directories. If the paid complete pair remains promising, the declared B1,C1,C2,B2,B3,C3 order can establish whether this **separate H=25 side-verification scope** improves at least 15% in both complete wall and CPU time, beyond the parent-declared noise/spread allowance. No numerical/compiler execution has been performed by this agent. Source compilation, controls, complete correctness and speed remain unverified until the parent runs them. + +## Correctness revision 2: effective lookup guards and complete complements + +Independent static review by the rational-design agent found two gaps after the parent's version 1 normal/`-O` finite passes. Version 1 sources are preserved under `matrix/drafts/v1/`; the parent retains all original stage/evidence/sample directories. `matrix/V2-CORRECTNESS-REVISION.md` records the reason for the new version. This is a correctness and coverage change before candidate timing, not a timing retry. + +The binding now has an explicit stable-runtime contract. At installation it validates source bytes, exact function code/calling shape, each function's **captured `__builtins__` pointer** as well as the module slot, ordinary built-in resolution (including `sum`, `list`, `rank`'s helpers and the Label constructor/containment helpers), and the original class/descriptor dispatch. Before every optional native method call it checks identities of the effective lookup environment, helper/method code/defaults/closure cells, Label namespace/MRO and native entry points. Drift raises an explicit `RuntimeError` before either native work or Python fallback; altered helpers and descriptors are not called as probes. Ordinary unsupported widths, values and mapping types still go through the unchanged source when the runtime is stable. The implementation does not promise protection against arbitrary modification of the backend's own internals, interpreter binary or native process memory. + +Both complete arms now stream every actual complement call into the same canonical SHA-256 transcript: call index, ordered `us` and `vs` vectors, and a typed output record. The source method normally returns a list; the recorder distinguishes a list from `None` and tests that distinction without claiming that the source method emits `None`. Complete H25 input snapshots are restricted to exact Label objects, ordinary dictionaries and exact integer vectors. The observer is disabled for the side-effecting finite fallback fixtures, so it does not add extra `values()` calls or consume iterators twice. + +The complete run requires all 238,685 complement calls and retains the original three hashes. A **new complement digest must come from the first fresh version 2 baseline**, then be matched by its candidate and remaining samples. It is not inferred from the old profile. `compare_side_verifier.py` accepts `--expected-complement-sha256 ` to enforce that lock. The stream receipt stores its byte count and SHA-256 with constant retained state; both arms pay identical per-call serialization and hashing. The large ordered input/output stream itself is not retained. + +Added finite controls cover each builtin shadow, a forged function with a stale alternate builtins pointer, custom descriptors, post-binding helper identity/code/default changes, source class/global changes, actual builtin drift and native dispatch replacement. They require rejection before either native or fallback counters change and verify that no modified helper was invoked. Separate finite baseline/candidate observers must produce the same ordered complement stream; negative checks ensure that changed input order, changed result order and list/None distinctions alter the digest. + +The C source is byte-identical to version 1 (`e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc`). No compiler, numerical execution, imports or tests were run by this source-owning agent for version 2. + +Final v2 static-review correction: `--expected-complement-sha256` is now **mandatory for every complete candidate**, checked before output/build work, so `COMPLETE_SIDE_PASS` cannot be issued without matching the first fresh baseline's complement digest. The first baseline omits the option; later baselines can supply it too. Native module and entry-point types are checked by direct dictionary access before any possible attribute dispatch, and the finite suite checks rejection of a custom native proxy without invoking it. The independent static review found no other blocking arithmetic/binding issue under the declared serial stable-runtime boundary; execution is still unrun by this agent. diff --git a/research/gf2-side-verification/evidence/canonical/MANIFEST.json b/research/gf2-side-verification/evidence/canonical/MANIFEST.json new file mode 100644 index 0000000000..e5043669cf --- /dev/null +++ b/research/gf2-side-verification/evidence/canonical/MANIFEST.json @@ -0,0 +1,14 @@ +{ + "witness.json": { + "canonical_bytes": 58143622, + "canonical_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", + "gzip_bytes": 17086956, + "gzip_sha256_transport_only": "f6951e682dda05824f28af78efb860905ba6d9d9ff2ead447d057ab5fada7379" + }, + "rank-trace.json": { + "canonical_bytes": 2674272, + "canonical_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", + "gzip_bytes": 25914, + "gzip_sha256_transport_only": "fdb6a2430337947ff0d1ce7a0c885c61a6d91ba05626830a431f150d37fe41a7" + } +} diff --git a/research/gf2-side-verification/evidence/canonical/rank-trace.json.gz b/research/gf2-side-verification/evidence/canonical/rank-trace.json.gz new file mode 100644 index 0000000000..4e3bcd7a21 Binary files /dev/null and b/research/gf2-side-verification/evidence/canonical/rank-trace.json.gz differ diff --git a/research/gf2-side-verification/evidence/canonical/witness.json.gz b/research/gf2-side-verification/evidence/canonical/witness.json.gz new file mode 100644 index 0000000000..2c47922787 Binary files /dev/null and b/research/gf2-side-verification/evidence/canonical/witness.json.gz differ diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-B1/receipt.json b/research/gf2-side-verification/evidence/inner/matrix-v2-B1/receipt.json new file mode 100644 index 0000000000..48338c9fd8 --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-B1/receipt.json @@ -0,0 +1,111 @@ +{ + "base_main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "build": null, + "complete": { + "complement_trace": { + "calls": 238685, + "canonical_stream_bytes": 55839507, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838" + }, + "exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", + "rank_call_count": 59959, + "rank_distinct_matrix_count": 252, + "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", + "result": { + "circuit": { + "additions": 80595, + "disjoint_additions": 68595, + "h": 25, + "injections": 27600, + "pair_star_additions": 12000, + "roles": 108195, + "roles_per_target": 47.041, + "v": 2300 + }, + "labels": { + "active_nodes": 82895, + "all_labels_nondegenerate": true, + "all_residuals_have_odd_vectors": true, + "checked_inclusions": 188790 + }, + "role_frames": { + "forward_frames_nested": true, + "reverse_complement_frames_nested": true, + "roles": 108195 + }, + "side_map": { + "coefficients": "+1/2 disjoint, -1/2 intersection two", + "nonzero_coefficients": 3693800, + "side_map_exact": true, + "targets": 2300 + } + }, + "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c", + "serialized_bytes": { + "rank_trace": 2674272, + "result": 527, + "witness": 58143622 + } + }, + "controls": null, + "engineering_sources": { + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a" + }, + "environment": { + "executable": "/usr/bin/python3.12", + "optimization": 0, + "platform": "linux", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]" + }, + "expected_complement_sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838", + "frozen_sources": { + "complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + }, + "measured_wall_seconds_before_receipt_write": 34.841609198978404, + "measurement_scope": "Cold entire process; parent guard outer wall/CPU is authoritative. Both arms write identical complete witness bytes. Candidate additionally compiles, links, loads and runs every finite/native/binding control.", + "mode": "baseline", + "phases": { + "checks_initialization": { + "cpu_seconds_including_children": 5.999999999994898e-05, + "wall_seconds": 5.963401054032147e-05 + }, + "cold_source_load_guard_bind": { + "cpu_seconds_including_children": 0.019816999999999974, + "wall_seconds": 0.019816012994851917 + }, + "compile_roles": { + "cpu_seconds_including_children": 0.3623130000000001, + "wall_seconds": 0.36240896000526845 + }, + "construction": { + "cpu_seconds_including_children": 1.6442160000000001, + "wall_seconds": 1.644305074994918 + }, + "same_complete_witness_trace_serialization": { + "cpu_seconds_including_children": 1.0896370000000033, + "wall_seconds": 1.092581083998084 + }, + "verify_labels": { + "cpu_seconds_including_children": 24.455796, + "wall_seconds": 24.465771699004108 + }, + "verify_map": { + "cpu_seconds_including_children": 5.124392, + "wall_seconds": 5.126138591993367 + }, + "verify_role_frames": { + "cpu_seconds_including_children": 1.5558680000000003, + "wall_seconds": 1.5562180209963117 + } + }, + "process_plus_compiler_cpu_seconds_before_receipt_write": 34.966088, + "qualification_revision": 2, + "scientific_scope": "Frozen H=25 complex side verification only; no full network certificate, selected frontier, PR5864 gain, new construction, parameter search or kappa admission.", + "status": "COMPLETE_SIDE_PASS" +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-B1/result.json b/research/gf2-side-verification/evidence/inner/matrix-v2-B1/result.json new file mode 100644 index 0000000000..3a31cfa1ef --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-B1/result.json @@ -0,0 +1 @@ +{"circuit":{"additions":80595,"disjoint_additions":68595,"h":25,"injections":27600,"pair_star_additions":12000,"roles":108195,"roles_per_target":47.041,"v":2300},"labels":{"active_nodes":82895,"all_labels_nondegenerate":true,"all_residuals_have_odd_vectors":true,"checked_inclusions":188790},"role_frames":{"forward_frames_nested":true,"reverse_complement_frames_nested":true,"roles":108195},"side_map":{"coefficients":"+1/2 disjoint, -1/2 intersection two","nonzero_coefficients":3693800,"side_map_exact":true,"targets":2300}} \ No newline at end of file diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-B2/receipt.json b/research/gf2-side-verification/evidence/inner/matrix-v2-B2/receipt.json new file mode 100644 index 0000000000..f9675fa3e1 --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-B2/receipt.json @@ -0,0 +1,111 @@ +{ + "base_main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "build": null, + "complete": { + "complement_trace": { + "calls": 238685, + "canonical_stream_bytes": 55839507, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838" + }, + "exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", + "rank_call_count": 59959, + "rank_distinct_matrix_count": 252, + "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", + "result": { + "circuit": { + "additions": 80595, + "disjoint_additions": 68595, + "h": 25, + "injections": 27600, + "pair_star_additions": 12000, + "roles": 108195, + "roles_per_target": 47.041, + "v": 2300 + }, + "labels": { + "active_nodes": 82895, + "all_labels_nondegenerate": true, + "all_residuals_have_odd_vectors": true, + "checked_inclusions": 188790 + }, + "role_frames": { + "forward_frames_nested": true, + "reverse_complement_frames_nested": true, + "roles": 108195 + }, + "side_map": { + "coefficients": "+1/2 disjoint, -1/2 intersection two", + "nonzero_coefficients": 3693800, + "side_map_exact": true, + "targets": 2300 + } + }, + "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c", + "serialized_bytes": { + "rank_trace": 2674272, + "result": 527, + "witness": 58143622 + } + }, + "controls": null, + "engineering_sources": { + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a" + }, + "environment": { + "executable": "/usr/bin/python3.12", + "optimization": 0, + "platform": "linux", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]" + }, + "expected_complement_sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838", + "frozen_sources": { + "complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + }, + "measured_wall_seconds_before_receipt_write": 33.758580699999584, + "measurement_scope": "Cold entire process; parent guard outer wall/CPU is authoritative. Both arms write identical complete witness bytes. Candidate additionally compiles, links, loads and runs every finite/native/binding control.", + "mode": "baseline", + "phases": { + "checks_initialization": { + "cpu_seconds_including_children": 5.999999999994898e-05, + "wall_seconds": 6.011399091221392e-05 + }, + "cold_source_load_guard_bind": { + "cpu_seconds_including_children": 0.024173, + "wall_seconds": 0.02417061899905093 + }, + "compile_roles": { + "cpu_seconds_including_children": 0.3510200000000001, + "wall_seconds": 0.3510973629890941 + }, + "construction": { + "cpu_seconds_including_children": 1.651359, + "wall_seconds": 1.65242633401067 + }, + "same_complete_witness_trace_serialization": { + "cpu_seconds_including_children": 1.0699410000000071, + "wall_seconds": 1.0717631149746012 + }, + "verify_labels": { + "cpu_seconds_including_children": 23.525641999999998, + "wall_seconds": 23.554776420991402 + }, + "verify_map": { + "cpu_seconds_including_children": 4.972300000000001, + "wall_seconds": 4.973463397007436 + }, + "verify_role_frames": { + "cpu_seconds_including_children": 1.5610219999999977, + "wall_seconds": 1.5638749210047536 + } + }, + "process_plus_compiler_cpu_seconds_before_receipt_write": 33.863431, + "qualification_revision": 2, + "scientific_scope": "Frozen H=25 complex side verification only; no full network certificate, selected frontier, PR5864 gain, new construction, parameter search or kappa admission.", + "status": "COMPLETE_SIDE_PASS" +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-B2/result.json b/research/gf2-side-verification/evidence/inner/matrix-v2-B2/result.json new file mode 100644 index 0000000000..3a31cfa1ef --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-B2/result.json @@ -0,0 +1 @@ +{"circuit":{"additions":80595,"disjoint_additions":68595,"h":25,"injections":27600,"pair_star_additions":12000,"roles":108195,"roles_per_target":47.041,"v":2300},"labels":{"active_nodes":82895,"all_labels_nondegenerate":true,"all_residuals_have_odd_vectors":true,"checked_inclusions":188790},"role_frames":{"forward_frames_nested":true,"reverse_complement_frames_nested":true,"roles":108195},"side_map":{"coefficients":"+1/2 disjoint, -1/2 intersection two","nonzero_coefficients":3693800,"side_map_exact":true,"targets":2300}} \ No newline at end of file diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-B3/receipt.json b/research/gf2-side-verification/evidence/inner/matrix-v2-B3/receipt.json new file mode 100644 index 0000000000..af2faaa39b --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-B3/receipt.json @@ -0,0 +1,111 @@ +{ + "base_main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "build": null, + "complete": { + "complement_trace": { + "calls": 238685, + "canonical_stream_bytes": 55839507, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838" + }, + "exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", + "rank_call_count": 59959, + "rank_distinct_matrix_count": 252, + "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", + "result": { + "circuit": { + "additions": 80595, + "disjoint_additions": 68595, + "h": 25, + "injections": 27600, + "pair_star_additions": 12000, + "roles": 108195, + "roles_per_target": 47.041, + "v": 2300 + }, + "labels": { + "active_nodes": 82895, + "all_labels_nondegenerate": true, + "all_residuals_have_odd_vectors": true, + "checked_inclusions": 188790 + }, + "role_frames": { + "forward_frames_nested": true, + "reverse_complement_frames_nested": true, + "roles": 108195 + }, + "side_map": { + "coefficients": "+1/2 disjoint, -1/2 intersection two", + "nonzero_coefficients": 3693800, + "side_map_exact": true, + "targets": 2300 + } + }, + "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c", + "serialized_bytes": { + "rank_trace": 2674272, + "result": 527, + "witness": 58143622 + } + }, + "controls": null, + "engineering_sources": { + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a" + }, + "environment": { + "executable": "/usr/bin/python3.12", + "optimization": 0, + "platform": "linux", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]" + }, + "expected_complement_sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838", + "frozen_sources": { + "complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + }, + "measured_wall_seconds_before_receipt_write": 34.82705215201713, + "measurement_scope": "Cold entire process; parent guard outer wall/CPU is authoritative. Both arms write identical complete witness bytes. Candidate additionally compiles, links, loads and runs every finite/native/binding control.", + "mode": "baseline", + "phases": { + "checks_initialization": { + "cpu_seconds_including_children": 6.200000000022854e-05, + "wall_seconds": 6.159598706290126e-05 + }, + "cold_source_load_guard_bind": { + "cpu_seconds_including_children": 0.01997500000000002, + "wall_seconds": 0.0199721860117279 + }, + "compile_roles": { + "cpu_seconds_including_children": 0.3713630000000001, + "wall_seconds": 0.3714567669958342 + }, + "construction": { + "cpu_seconds_including_children": 1.640095, + "wall_seconds": 1.6403012970113195 + }, + "same_complete_witness_trace_serialization": { + "cpu_seconds_including_children": 1.086162999999999, + "wall_seconds": 1.0891685120004695 + }, + "verify_labels": { + "cpu_seconds_including_children": 24.431302, + "wall_seconds": 24.476630095014116 + }, + "verify_map": { + "cpu_seconds_including_children": 5.006442, + "wall_seconds": 5.00855585798854 + }, + "verify_role_frames": { + "cpu_seconds_including_children": 1.6273419999999987, + "wall_seconds": 1.628750341013074 + } + }, + "process_plus_compiler_cpu_seconds_before_receipt_write": 34.911673, + "qualification_revision": 2, + "scientific_scope": "Frozen H=25 complex side verification only; no full network certificate, selected frontier, PR5864 gain, new construction, parameter search or kappa admission.", + "status": "COMPLETE_SIDE_PASS" +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-B3/result.json b/research/gf2-side-verification/evidence/inner/matrix-v2-B3/result.json new file mode 100644 index 0000000000..3a31cfa1ef --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-B3/result.json @@ -0,0 +1 @@ +{"circuit":{"additions":80595,"disjoint_additions":68595,"h":25,"injections":27600,"pair_star_additions":12000,"roles":108195,"roles_per_target":47.041,"v":2300},"labels":{"active_nodes":82895,"all_labels_nondegenerate":true,"all_residuals_have_odd_vectors":true,"checked_inclusions":188790},"role_frames":{"forward_frames_nested":true,"reverse_complement_frames_nested":true,"roles":108195},"side_map":{"coefficients":"+1/2 disjoint, -1/2 intersection two","nonzero_coefficients":3693800,"side_map_exact":true,"targets":2300}} \ No newline at end of file diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-C1/finite-controls.json b/research/gf2-side-verification/evidence/inner/matrix-v2-C1/finite-controls.json new file mode 100644 index 0000000000..954c682bbe --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-C1/finite-controls.json @@ -0,0 +1,54 @@ +{ + "counts": { + "binding_rejections": 3, + "boundary_cases": 17, + "fallback_cases": 38, + "gram_cases": 621, + "oracle_negative_controls": 2, + "ordered_complements": 5344, + "real_label_permutations": 24 + }, + "fixture_sha256": "fbf7cb44bb99c96ee7d393eb91f2ebfbfb94375917c78a902d547320afd75d84", + "independent_oracle": "Dense binary lists, descending pivots, addition modulo 2; no packed/source/native helpers", + "micro": { + "native_with_conversion": { + "cpu_seconds": 0.020535698999999852, + "wall_seconds": 0.020533547998638824 + }, + "unchanged_python": { + "cpu_seconds": 0.14545603799999995, + "wall_seconds": 0.14546467398758978 + } + }, + "micro_fixtures": 4, + "micro_repetitions": 128, + "micro_scope": "Fixed h25 label families with conversion; diagnostic only, not complete side speed", + "native_and_fallback_calls": { + "complement_fallback": 30, + "complement_native": 5875, + "gram_fallback": 20, + "gram_native": 1638 + }, + "status": "FINITE_NATIVE_GF2_CONTROLS_PASS", + "v2_controls": { + "complement_fixture_stream": { + "calls": 7, + "canonical_stream_bytes": 597, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "ed44b2291db9f1bafc9bdb02e6d3b53e1926b01e549ef8bdccc1991922a6345d" + }, + "counts": { + "class_dispatch_rejections": 2, + "effective_builtins_rejections": 2, + "native_proxy_rejections": 1, + "postbind_drift_rejections": 25, + "prebind_shadow_rejections": 10, + "real_builtin_drift_rejections": 2, + "trace_negative_controls": 4, + "trace_pairs": 7 + }, + "modified_helper_invocations": 0, + "runtime_policy": "Reject before native/fallback on source helper, effective builtins, class, function, closure or native dispatch drift", + "status": "V2_RUNTIME_AND_COMPLEMENT_STREAM_PASS" + } +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-C1/receipt.json b/research/gf2-side-verification/evidence/inner/matrix-v2-C1/receipt.json new file mode 100644 index 0000000000..b8dde825ee --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-C1/receipt.json @@ -0,0 +1,200 @@ +{ + "base_main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "build": { + "c_source_sha256": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "command": [ + "x86_64-linux-gnu-gcc", + "-shared", + "-fPIC", + "-O3", + "-std=c11", + "-Wall", + "-Wextra", + "-Werror", + "-I/usr/include/python3.12", + "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/c-verification-all-opportunities-20261027/stages/matrix-qualification-v2/native_gf2.c", + "-o", + "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/c-verification-all-opportunities-20261027/runtime/matrix-v2-C1/cold-build/_packed_gf2.cpython-312-x86_64-linux-gnu.so" + ], + "extension_sha256": "d990705af645971612df802a427642bdb4cd79de0bb028a2f8ed3667bcf44c04", + "no_cached_binary": true, + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "returncode": 0, + "stderr": "", + "stdout": "" + }, + "complete": { + "complement_trace": { + "calls": 238685, + "canonical_stream_bytes": 55839507, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838" + }, + "exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", + "native_calls": { + "complement_fallback": 0, + "complement_native": 238685, + "gram_fallback": 0, + "gram_native": 59959 + }, + "rank_call_count": 59959, + "rank_distinct_matrix_count": 252, + "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", + "result": { + "circuit": { + "additions": 80595, + "disjoint_additions": 68595, + "h": 25, + "injections": 27600, + "pair_star_additions": 12000, + "roles": 108195, + "roles_per_target": 47.041, + "v": 2300 + }, + "labels": { + "active_nodes": 82895, + "all_labels_nondegenerate": true, + "all_residuals_have_odd_vectors": true, + "checked_inclusions": 188790 + }, + "role_frames": { + "forward_frames_nested": true, + "reverse_complement_frames_nested": true, + "roles": 108195 + }, + "side_map": { + "coefficients": "+1/2 disjoint, -1/2 intersection two", + "nonzero_coefficients": 3693800, + "side_map_exact": true, + "targets": 2300 + } + }, + "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c", + "serialized_bytes": { + "rank_trace": 2674272, + "result": 527, + "witness": 58143622 + } + }, + "controls": { + "counts": { + "binding_rejections": 3, + "boundary_cases": 17, + "fallback_cases": 38, + "gram_cases": 621, + "oracle_negative_controls": 2, + "ordered_complements": 5344, + "real_label_permutations": 24 + }, + "fixture_sha256": "fbf7cb44bb99c96ee7d393eb91f2ebfbfb94375917c78a902d547320afd75d84", + "independent_oracle": "Dense binary lists, descending pivots, addition modulo 2; no packed/source/native helpers", + "micro": { + "native_with_conversion": { + "cpu_seconds": 0.020535698999999852, + "wall_seconds": 0.020533547998638824 + }, + "unchanged_python": { + "cpu_seconds": 0.14545603799999995, + "wall_seconds": 0.14546467398758978 + } + }, + "micro_fixtures": 4, + "micro_repetitions": 128, + "micro_scope": "Fixed h25 label families with conversion; diagnostic only, not complete side speed", + "native_and_fallback_calls": { + "complement_fallback": 30, + "complement_native": 5875, + "gram_fallback": 20, + "gram_native": 1638 + }, + "status": "FINITE_NATIVE_GF2_CONTROLS_PASS", + "v2_controls": { + "complement_fixture_stream": { + "calls": 7, + "canonical_stream_bytes": 597, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "ed44b2291db9f1bafc9bdb02e6d3b53e1926b01e549ef8bdccc1991922a6345d" + }, + "counts": { + "class_dispatch_rejections": 2, + "effective_builtins_rejections": 2, + "native_proxy_rejections": 1, + "postbind_drift_rejections": 25, + "prebind_shadow_rejections": 10, + "real_builtin_drift_rejections": 2, + "trace_negative_controls": 4, + "trace_pairs": 7 + }, + "modified_helper_invocations": 0, + "runtime_policy": "Reject before native/fallback on source helper, effective builtins, class, function, closure or native dispatch drift", + "status": "V2_RUNTIME_AND_COMPLEMENT_STREAM_PASS" + } + }, + "engineering_sources": { + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a" + }, + "environment": { + "executable": "/usr/bin/python3.12", + "optimization": 0, + "platform": "linux", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]" + }, + "expected_complement_sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838", + "frozen_sources": { + "complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + }, + "measured_wall_seconds_before_receipt_write": 24.555542759015225, + "measurement_scope": "Cold entire process; parent guard outer wall/CPU is authoritative. Both arms write identical complete witness bytes. Candidate additionally compiles, links, loads and runs every finite/native/binding control.", + "mode": "candidate", + "phases": { + "all_finite_independent_binding_fallback_controls": { + "cpu_seconds_including_children": 1.1727319999999999, + "wall_seconds": 1.1728168460249435 + }, + "checks_initialization": { + "cpu_seconds_including_children": 6.299999999992423e-05, + "wall_seconds": 6.351998308673501e-05 + }, + "cold_compile_link_load": { + "cpu_seconds_including_children": 0.19227899999999998, + "wall_seconds": 0.19211230901419185 + }, + "cold_source_load_guard_bind": { + "cpu_seconds_including_children": 0.016005000000000047, + "wall_seconds": 0.016002263000700623 + }, + "compile_roles": { + "cpu_seconds_including_children": 0.35738400000000015, + "wall_seconds": 0.3575979949964676 + }, + "construction": { + "cpu_seconds_including_children": 1.6916020000000003, + "wall_seconds": 1.6922254489909392 + }, + "same_complete_witness_trace_serialization": { + "cpu_seconds_including_children": 1.0936749999999975, + "wall_seconds": 1.0953993599978276 + }, + "verify_labels": { + "cpu_seconds_including_children": 13.155743000000001, + "wall_seconds": 13.169879032007884 + }, + "verify_map": { + "cpu_seconds_including_children": 5.241856000000002, + "wall_seconds": 5.271870495984331 + }, + "verify_role_frames": { + "cpu_seconds_including_children": 0.9926220000000008, + "wall_seconds": 0.9930327390029561 + } + }, + "process_plus_compiler_cpu_seconds_before_receipt_write": 24.651076, + "qualification_revision": 2, + "scientific_scope": "Frozen H=25 complex side verification only; no full network certificate, selected frontier, PR5864 gain, new construction, parameter search or kappa admission.", + "status": "COMPLETE_SIDE_PASS" +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-C1/result.json b/research/gf2-side-verification/evidence/inner/matrix-v2-C1/result.json new file mode 100644 index 0000000000..3a31cfa1ef --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-C1/result.json @@ -0,0 +1 @@ +{"circuit":{"additions":80595,"disjoint_additions":68595,"h":25,"injections":27600,"pair_star_additions":12000,"roles":108195,"roles_per_target":47.041,"v":2300},"labels":{"active_nodes":82895,"all_labels_nondegenerate":true,"all_residuals_have_odd_vectors":true,"checked_inclusions":188790},"role_frames":{"forward_frames_nested":true,"reverse_complement_frames_nested":true,"roles":108195},"side_map":{"coefficients":"+1/2 disjoint, -1/2 intersection two","nonzero_coefficients":3693800,"side_map_exact":true,"targets":2300}} \ No newline at end of file diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-C2/finite-controls.json b/research/gf2-side-verification/evidence/inner/matrix-v2-C2/finite-controls.json new file mode 100644 index 0000000000..4afed1ea43 --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-C2/finite-controls.json @@ -0,0 +1,54 @@ +{ + "counts": { + "binding_rejections": 3, + "boundary_cases": 17, + "fallback_cases": 38, + "gram_cases": 621, + "oracle_negative_controls": 2, + "ordered_complements": 5344, + "real_label_permutations": 24 + }, + "fixture_sha256": "fbf7cb44bb99c96ee7d393eb91f2ebfbfb94375917c78a902d547320afd75d84", + "independent_oracle": "Dense binary lists, descending pivots, addition modulo 2; no packed/source/native helpers", + "micro": { + "native_with_conversion": { + "cpu_seconds": 0.019639576000000103, + "wall_seconds": 0.019637446996057406 + }, + "unchanged_python": { + "cpu_seconds": 0.13415110100000005, + "wall_seconds": 0.1341587630158756 + } + }, + "micro_fixtures": 4, + "micro_repetitions": 128, + "micro_scope": "Fixed h25 label families with conversion; diagnostic only, not complete side speed", + "native_and_fallback_calls": { + "complement_fallback": 30, + "complement_native": 5875, + "gram_fallback": 20, + "gram_native": 1638 + }, + "status": "FINITE_NATIVE_GF2_CONTROLS_PASS", + "v2_controls": { + "complement_fixture_stream": { + "calls": 7, + "canonical_stream_bytes": 597, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "ed44b2291db9f1bafc9bdb02e6d3b53e1926b01e549ef8bdccc1991922a6345d" + }, + "counts": { + "class_dispatch_rejections": 2, + "effective_builtins_rejections": 2, + "native_proxy_rejections": 1, + "postbind_drift_rejections": 25, + "prebind_shadow_rejections": 10, + "real_builtin_drift_rejections": 2, + "trace_negative_controls": 4, + "trace_pairs": 7 + }, + "modified_helper_invocations": 0, + "runtime_policy": "Reject before native/fallback on source helper, effective builtins, class, function, closure or native dispatch drift", + "status": "V2_RUNTIME_AND_COMPLEMENT_STREAM_PASS" + } +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-C2/receipt.json b/research/gf2-side-verification/evidence/inner/matrix-v2-C2/receipt.json new file mode 100644 index 0000000000..dd1073cfde --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-C2/receipt.json @@ -0,0 +1,200 @@ +{ + "base_main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "build": { + "c_source_sha256": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "command": [ + "x86_64-linux-gnu-gcc", + "-shared", + "-fPIC", + "-O3", + "-std=c11", + "-Wall", + "-Wextra", + "-Werror", + "-I/usr/include/python3.12", + "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/c-verification-all-opportunities-20261027/stages/matrix-qualification-v2/native_gf2.c", + "-o", + "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/c-verification-all-opportunities-20261027/runtime/matrix-v2-C2/cold-build/_packed_gf2.cpython-312-x86_64-linux-gnu.so" + ], + "extension_sha256": "d990705af645971612df802a427642bdb4cd79de0bb028a2f8ed3667bcf44c04", + "no_cached_binary": true, + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "returncode": 0, + "stderr": "", + "stdout": "" + }, + "complete": { + "complement_trace": { + "calls": 238685, + "canonical_stream_bytes": 55839507, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838" + }, + "exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", + "native_calls": { + "complement_fallback": 0, + "complement_native": 238685, + "gram_fallback": 0, + "gram_native": 59959 + }, + "rank_call_count": 59959, + "rank_distinct_matrix_count": 252, + "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", + "result": { + "circuit": { + "additions": 80595, + "disjoint_additions": 68595, + "h": 25, + "injections": 27600, + "pair_star_additions": 12000, + "roles": 108195, + "roles_per_target": 47.041, + "v": 2300 + }, + "labels": { + "active_nodes": 82895, + "all_labels_nondegenerate": true, + "all_residuals_have_odd_vectors": true, + "checked_inclusions": 188790 + }, + "role_frames": { + "forward_frames_nested": true, + "reverse_complement_frames_nested": true, + "roles": 108195 + }, + "side_map": { + "coefficients": "+1/2 disjoint, -1/2 intersection two", + "nonzero_coefficients": 3693800, + "side_map_exact": true, + "targets": 2300 + } + }, + "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c", + "serialized_bytes": { + "rank_trace": 2674272, + "result": 527, + "witness": 58143622 + } + }, + "controls": { + "counts": { + "binding_rejections": 3, + "boundary_cases": 17, + "fallback_cases": 38, + "gram_cases": 621, + "oracle_negative_controls": 2, + "ordered_complements": 5344, + "real_label_permutations": 24 + }, + "fixture_sha256": "fbf7cb44bb99c96ee7d393eb91f2ebfbfb94375917c78a902d547320afd75d84", + "independent_oracle": "Dense binary lists, descending pivots, addition modulo 2; no packed/source/native helpers", + "micro": { + "native_with_conversion": { + "cpu_seconds": 0.019639576000000103, + "wall_seconds": 0.019637446996057406 + }, + "unchanged_python": { + "cpu_seconds": 0.13415110100000005, + "wall_seconds": 0.1341587630158756 + } + }, + "micro_fixtures": 4, + "micro_repetitions": 128, + "micro_scope": "Fixed h25 label families with conversion; diagnostic only, not complete side speed", + "native_and_fallback_calls": { + "complement_fallback": 30, + "complement_native": 5875, + "gram_fallback": 20, + "gram_native": 1638 + }, + "status": "FINITE_NATIVE_GF2_CONTROLS_PASS", + "v2_controls": { + "complement_fixture_stream": { + "calls": 7, + "canonical_stream_bytes": 597, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "ed44b2291db9f1bafc9bdb02e6d3b53e1926b01e549ef8bdccc1991922a6345d" + }, + "counts": { + "class_dispatch_rejections": 2, + "effective_builtins_rejections": 2, + "native_proxy_rejections": 1, + "postbind_drift_rejections": 25, + "prebind_shadow_rejections": 10, + "real_builtin_drift_rejections": 2, + "trace_negative_controls": 4, + "trace_pairs": 7 + }, + "modified_helper_invocations": 0, + "runtime_policy": "Reject before native/fallback on source helper, effective builtins, class, function, closure or native dispatch drift", + "status": "V2_RUNTIME_AND_COMPLEMENT_STREAM_PASS" + } + }, + "engineering_sources": { + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a" + }, + "environment": { + "executable": "/usr/bin/python3.12", + "optimization": 0, + "platform": "linux", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]" + }, + "expected_complement_sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838", + "frozen_sources": { + "complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + }, + "measured_wall_seconds_before_receipt_write": 24.54664336401038, + "measurement_scope": "Cold entire process; parent guard outer wall/CPU is authoritative. Both arms write identical complete witness bytes. Candidate additionally compiles, links, loads and runs every finite/native/binding control.", + "mode": "candidate", + "phases": { + "all_finite_independent_binding_fallback_controls": { + "cpu_seconds_including_children": 1.1028819999999997, + "wall_seconds": 1.1030606599815655 + }, + "checks_initialization": { + "cpu_seconds_including_children": 9.000000000014552e-05, + "wall_seconds": 8.936499943956733e-05 + }, + "cold_compile_link_load": { + "cpu_seconds_including_children": 0.19693500000000003, + "wall_seconds": 0.19688948901602998 + }, + "cold_source_load_guard_bind": { + "cpu_seconds_including_children": 0.014989999999999837, + "wall_seconds": 0.015003323002019897 + }, + "compile_roles": { + "cpu_seconds_including_children": 0.3342450000000001, + "wall_seconds": 0.3344006109982729 + }, + "construction": { + "cpu_seconds_including_children": 1.7173869999999998, + "wall_seconds": 1.7179188650043216 + }, + "same_complete_witness_trace_serialization": { + "cpu_seconds_including_children": 1.0824269999999991, + "wall_seconds": 1.0843385549960658 + }, + "verify_labels": { + "cpu_seconds_including_children": 13.436663999999999, + "wall_seconds": 13.45439318800345 + }, + "verify_map": { + "cpu_seconds_including_children": 5.028192000000001, + "wall_seconds": 5.03588097501779 + }, + "verify_role_frames": { + "cpu_seconds_including_children": 1.0107660000000038, + "wall_seconds": 1.0108844279893674 + } + }, + "process_plus_compiler_cpu_seconds_before_receipt_write": 24.655914999999997, + "qualification_revision": 2, + "scientific_scope": "Frozen H=25 complex side verification only; no full network certificate, selected frontier, PR5864 gain, new construction, parameter search or kappa admission.", + "status": "COMPLETE_SIDE_PASS" +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-C2/result.json b/research/gf2-side-verification/evidence/inner/matrix-v2-C2/result.json new file mode 100644 index 0000000000..3a31cfa1ef --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-C2/result.json @@ -0,0 +1 @@ +{"circuit":{"additions":80595,"disjoint_additions":68595,"h":25,"injections":27600,"pair_star_additions":12000,"roles":108195,"roles_per_target":47.041,"v":2300},"labels":{"active_nodes":82895,"all_labels_nondegenerate":true,"all_residuals_have_odd_vectors":true,"checked_inclusions":188790},"role_frames":{"forward_frames_nested":true,"reverse_complement_frames_nested":true,"roles":108195},"side_map":{"coefficients":"+1/2 disjoint, -1/2 intersection two","nonzero_coefficients":3693800,"side_map_exact":true,"targets":2300}} \ No newline at end of file diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-C3/finite-controls.json b/research/gf2-side-verification/evidence/inner/matrix-v2-C3/finite-controls.json new file mode 100644 index 0000000000..c7f261b1e7 --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-C3/finite-controls.json @@ -0,0 +1,54 @@ +{ + "counts": { + "binding_rejections": 3, + "boundary_cases": 17, + "fallback_cases": 38, + "gram_cases": 621, + "oracle_negative_controls": 2, + "ordered_complements": 5344, + "real_label_permutations": 24 + }, + "fixture_sha256": "fbf7cb44bb99c96ee7d393eb91f2ebfbfb94375917c78a902d547320afd75d84", + "independent_oracle": "Dense binary lists, descending pivots, addition modulo 2; no packed/source/native helpers", + "micro": { + "native_with_conversion": { + "cpu_seconds": 0.019239444000000105, + "wall_seconds": 0.019238017994211987 + }, + "unchanged_python": { + "cpu_seconds": 0.130354152, + "wall_seconds": 0.13035992698860355 + } + }, + "micro_fixtures": 4, + "micro_repetitions": 128, + "micro_scope": "Fixed h25 label families with conversion; diagnostic only, not complete side speed", + "native_and_fallback_calls": { + "complement_fallback": 30, + "complement_native": 5875, + "gram_fallback": 20, + "gram_native": 1638 + }, + "status": "FINITE_NATIVE_GF2_CONTROLS_PASS", + "v2_controls": { + "complement_fixture_stream": { + "calls": 7, + "canonical_stream_bytes": 597, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "ed44b2291db9f1bafc9bdb02e6d3b53e1926b01e549ef8bdccc1991922a6345d" + }, + "counts": { + "class_dispatch_rejections": 2, + "effective_builtins_rejections": 2, + "native_proxy_rejections": 1, + "postbind_drift_rejections": 25, + "prebind_shadow_rejections": 10, + "real_builtin_drift_rejections": 2, + "trace_negative_controls": 4, + "trace_pairs": 7 + }, + "modified_helper_invocations": 0, + "runtime_policy": "Reject before native/fallback on source helper, effective builtins, class, function, closure or native dispatch drift", + "status": "V2_RUNTIME_AND_COMPLEMENT_STREAM_PASS" + } +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-C3/receipt.json b/research/gf2-side-verification/evidence/inner/matrix-v2-C3/receipt.json new file mode 100644 index 0000000000..82a2cba61e --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-C3/receipt.json @@ -0,0 +1,200 @@ +{ + "base_main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "build": { + "c_source_sha256": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "command": [ + "x86_64-linux-gnu-gcc", + "-shared", + "-fPIC", + "-O3", + "-std=c11", + "-Wall", + "-Wextra", + "-Werror", + "-I/usr/include/python3.12", + "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/c-verification-all-opportunities-20261027/stages/matrix-qualification-v2/native_gf2.c", + "-o", + "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/c-verification-all-opportunities-20261027/runtime/matrix-v2-C3/cold-build/_packed_gf2.cpython-312-x86_64-linux-gnu.so" + ], + "extension_sha256": "d990705af645971612df802a427642bdb4cd79de0bb028a2f8ed3667bcf44c04", + "no_cached_binary": true, + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "returncode": 0, + "stderr": "", + "stdout": "" + }, + "complete": { + "complement_trace": { + "calls": 238685, + "canonical_stream_bytes": 55839507, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838" + }, + "exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", + "native_calls": { + "complement_fallback": 0, + "complement_native": 238685, + "gram_fallback": 0, + "gram_native": 59959 + }, + "rank_call_count": 59959, + "rank_distinct_matrix_count": 252, + "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", + "result": { + "circuit": { + "additions": 80595, + "disjoint_additions": 68595, + "h": 25, + "injections": 27600, + "pair_star_additions": 12000, + "roles": 108195, + "roles_per_target": 47.041, + "v": 2300 + }, + "labels": { + "active_nodes": 82895, + "all_labels_nondegenerate": true, + "all_residuals_have_odd_vectors": true, + "checked_inclusions": 188790 + }, + "role_frames": { + "forward_frames_nested": true, + "reverse_complement_frames_nested": true, + "roles": 108195 + }, + "side_map": { + "coefficients": "+1/2 disjoint, -1/2 intersection two", + "nonzero_coefficients": 3693800, + "side_map_exact": true, + "targets": 2300 + } + }, + "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c", + "serialized_bytes": { + "rank_trace": 2674272, + "result": 527, + "witness": 58143622 + } + }, + "controls": { + "counts": { + "binding_rejections": 3, + "boundary_cases": 17, + "fallback_cases": 38, + "gram_cases": 621, + "oracle_negative_controls": 2, + "ordered_complements": 5344, + "real_label_permutations": 24 + }, + "fixture_sha256": "fbf7cb44bb99c96ee7d393eb91f2ebfbfb94375917c78a902d547320afd75d84", + "independent_oracle": "Dense binary lists, descending pivots, addition modulo 2; no packed/source/native helpers", + "micro": { + "native_with_conversion": { + "cpu_seconds": 0.019239444000000105, + "wall_seconds": 0.019238017994211987 + }, + "unchanged_python": { + "cpu_seconds": 0.130354152, + "wall_seconds": 0.13035992698860355 + } + }, + "micro_fixtures": 4, + "micro_repetitions": 128, + "micro_scope": "Fixed h25 label families with conversion; diagnostic only, not complete side speed", + "native_and_fallback_calls": { + "complement_fallback": 30, + "complement_native": 5875, + "gram_fallback": 20, + "gram_native": 1638 + }, + "status": "FINITE_NATIVE_GF2_CONTROLS_PASS", + "v2_controls": { + "complement_fixture_stream": { + "calls": 7, + "canonical_stream_bytes": 597, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "ed44b2291db9f1bafc9bdb02e6d3b53e1926b01e549ef8bdccc1991922a6345d" + }, + "counts": { + "class_dispatch_rejections": 2, + "effective_builtins_rejections": 2, + "native_proxy_rejections": 1, + "postbind_drift_rejections": 25, + "prebind_shadow_rejections": 10, + "real_builtin_drift_rejections": 2, + "trace_negative_controls": 4, + "trace_pairs": 7 + }, + "modified_helper_invocations": 0, + "runtime_policy": "Reject before native/fallback on source helper, effective builtins, class, function, closure or native dispatch drift", + "status": "V2_RUNTIME_AND_COMPLEMENT_STREAM_PASS" + } + }, + "engineering_sources": { + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a" + }, + "environment": { + "executable": "/usr/bin/python3.12", + "optimization": 0, + "platform": "linux", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]" + }, + "expected_complement_sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838", + "frozen_sources": { + "complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + }, + "measured_wall_seconds_before_receipt_write": 24.265411901986226, + "measurement_scope": "Cold entire process; parent guard outer wall/CPU is authoritative. Both arms write identical complete witness bytes. Candidate additionally compiles, links, loads and runs every finite/native/binding control.", + "mode": "candidate", + "phases": { + "all_finite_independent_binding_fallback_controls": { + "cpu_seconds_including_children": 1.0829659999999997, + "wall_seconds": 1.0830194080190267 + }, + "checks_initialization": { + "cpu_seconds_including_children": 6.800000000017903e-05, + "wall_seconds": 6.744600250385702e-05 + }, + "cold_compile_link_load": { + "cpu_seconds_including_children": 0.17880399999999996, + "wall_seconds": 0.17988828200032003 + }, + "cold_source_load_guard_bind": { + "cpu_seconds_including_children": 0.013246999999999787, + "wall_seconds": 0.013244048022897914 + }, + "compile_roles": { + "cpu_seconds_including_children": 0.349726, + "wall_seconds": 0.35019330997602083 + }, + "construction": { + "cpu_seconds_including_children": 1.6870770000000004, + "wall_seconds": 1.6872132970020175 + }, + "same_complete_witness_trace_serialization": { + "cpu_seconds_including_children": 1.0882969999999972, + "wall_seconds": 1.0888235789898317 + }, + "verify_labels": { + "cpu_seconds_including_children": 13.253531000000002, + "wall_seconds": 13.256456922012148 + }, + "verify_map": { + "cpu_seconds_including_children": 4.949355999999999, + "wall_seconds": 4.951173745008418 + }, + "verify_role_frames": { + "cpu_seconds_including_children": 1.0338250000000002, + "wall_seconds": 1.0343899079889525 + } + }, + "process_plus_compiler_cpu_seconds_before_receipt_write": 24.400893999999997, + "qualification_revision": 2, + "scientific_scope": "Frozen H=25 complex side verification only; no full network certificate, selected frontier, PR5864 gain, new construction, parameter search or kappa admission.", + "status": "COMPLETE_SIDE_PASS" +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-C3/result.json b/research/gf2-side-verification/evidence/inner/matrix-v2-C3/result.json new file mode 100644 index 0000000000..3a31cfa1ef --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-C3/result.json @@ -0,0 +1 @@ +{"circuit":{"additions":80595,"disjoint_additions":68595,"h":25,"injections":27600,"pair_star_additions":12000,"roles":108195,"roles_per_target":47.041,"v":2300},"labels":{"active_nodes":82895,"all_labels_nondegenerate":true,"all_residuals_have_odd_vectors":true,"checked_inclusions":188790},"role_frames":{"forward_frames_nested":true,"reverse_complement_frames_nested":true,"roles":108195},"side_map":{"coefficients":"+1/2 disjoint, -1/2 intersection two","nonzero_coefficients":3693800,"side_map_exact":true,"targets":2300}} \ No newline at end of file diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-anchor/receipt.json b/research/gf2-side-verification/evidence/inner/matrix-v2-anchor/receipt.json new file mode 100644 index 0000000000..9289d6e3bb --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-anchor/receipt.json @@ -0,0 +1,111 @@ +{ + "base_main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "build": null, + "complete": { + "complement_trace": { + "calls": 238685, + "canonical_stream_bytes": 55839507, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838" + }, + "exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", + "rank_call_count": 59959, + "rank_distinct_matrix_count": 252, + "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", + "result": { + "circuit": { + "additions": 80595, + "disjoint_additions": 68595, + "h": 25, + "injections": 27600, + "pair_star_additions": 12000, + "roles": 108195, + "roles_per_target": 47.041, + "v": 2300 + }, + "labels": { + "active_nodes": 82895, + "all_labels_nondegenerate": true, + "all_residuals_have_odd_vectors": true, + "checked_inclusions": 188790 + }, + "role_frames": { + "forward_frames_nested": true, + "reverse_complement_frames_nested": true, + "roles": 108195 + }, + "side_map": { + "coefficients": "+1/2 disjoint, -1/2 intersection two", + "nonzero_coefficients": 3693800, + "side_map_exact": true, + "targets": 2300 + } + }, + "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c", + "serialized_bytes": { + "rank_trace": 2674272, + "result": 527, + "witness": 58143622 + } + }, + "controls": null, + "engineering_sources": { + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a" + }, + "environment": { + "executable": "/usr/bin/python3.12", + "optimization": 0, + "platform": "linux", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]" + }, + "expected_complement_sha256": null, + "frozen_sources": { + "complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + }, + "measured_wall_seconds_before_receipt_write": 35.857453499978874, + "measurement_scope": "Cold entire process; parent guard outer wall/CPU is authoritative. Both arms write identical complete witness bytes. Candidate additionally compiles, links, loads and runs every finite/native/binding control.", + "mode": "baseline", + "phases": { + "checks_initialization": { + "cpu_seconds_including_children": 6.300000000036832e-05, + "wall_seconds": 6.284000119194388e-05 + }, + "cold_source_load_guard_bind": { + "cpu_seconds_including_children": 0.019830000000000014, + "wall_seconds": 0.019828849006444216 + }, + "compile_roles": { + "cpu_seconds_including_children": 0.3766470000000002, + "wall_seconds": 0.3766869060054887 + }, + "construction": { + "cpu_seconds_including_children": 1.7136879999999999, + "wall_seconds": 1.7138633870054036 + }, + "same_complete_witness_trace_serialization": { + "cpu_seconds_including_children": 1.0552819999999983, + "wall_seconds": 1.05667901301058 + }, + "verify_labels": { + "cpu_seconds_including_children": 25.005594000000002, + "wall_seconds": 25.193313104013214 + }, + "verify_map": { + "cpu_seconds_including_children": 5.373737, + "wall_seconds": 5.376434844976757 + }, + "verify_role_frames": { + "cpu_seconds_including_children": 1.5150259999999989, + "wall_seconds": 1.515806892013643 + } + }, + "process_plus_compiler_cpu_seconds_before_receipt_write": 35.795717, + "qualification_revision": 2, + "scientific_scope": "Frozen H=25 complex side verification only; no full network certificate, selected frontier, PR5864 gain, new construction, parameter search or kappa admission.", + "status": "COMPLETE_SIDE_PASS" +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-anchor/result.json b/research/gf2-side-verification/evidence/inner/matrix-v2-anchor/result.json new file mode 100644 index 0000000000..3a31cfa1ef --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-anchor/result.json @@ -0,0 +1 @@ +{"circuit":{"additions":80595,"disjoint_additions":68595,"h":25,"injections":27600,"pair_star_additions":12000,"roles":108195,"roles_per_target":47.041,"v":2300},"labels":{"active_nodes":82895,"all_labels_nondegenerate":true,"all_residuals_have_odd_vectors":true,"checked_inclusions":188790},"role_frames":{"forward_frames_nested":true,"reverse_complement_frames_nested":true,"roles":108195},"side_map":{"coefficients":"+1/2 disjoint, -1/2 intersection two","nonzero_coefficients":3693800,"side_map_exact":true,"targets":2300}} \ No newline at end of file diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-finite/finite-controls.json b/research/gf2-side-verification/evidence/inner/matrix-v2-finite/finite-controls.json new file mode 100644 index 0000000000..e867dd406d --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-finite/finite-controls.json @@ -0,0 +1,54 @@ +{ + "counts": { + "binding_rejections": 3, + "boundary_cases": 17, + "fallback_cases": 38, + "gram_cases": 621, + "oracle_negative_controls": 2, + "ordered_complements": 5344, + "real_label_permutations": 24 + }, + "fixture_sha256": "fbf7cb44bb99c96ee7d393eb91f2ebfbfb94375917c78a902d547320afd75d84", + "independent_oracle": "Dense binary lists, descending pivots, addition modulo 2; no packed/source/native helpers", + "micro": { + "native_with_conversion": { + "cpu_seconds": 0.01950881300000007, + "wall_seconds": 0.019559950014809147 + }, + "unchanged_python": { + "cpu_seconds": 0.13026391399999993, + "wall_seconds": 0.1303495999891311 + } + }, + "micro_fixtures": 4, + "micro_repetitions": 128, + "micro_scope": "Fixed h25 label families with conversion; diagnostic only, not complete side speed", + "native_and_fallback_calls": { + "complement_fallback": 30, + "complement_native": 5875, + "gram_fallback": 20, + "gram_native": 1638 + }, + "status": "FINITE_NATIVE_GF2_CONTROLS_PASS", + "v2_controls": { + "complement_fixture_stream": { + "calls": 7, + "canonical_stream_bytes": 597, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "ed44b2291db9f1bafc9bdb02e6d3b53e1926b01e549ef8bdccc1991922a6345d" + }, + "counts": { + "class_dispatch_rejections": 2, + "effective_builtins_rejections": 2, + "native_proxy_rejections": 1, + "postbind_drift_rejections": 25, + "prebind_shadow_rejections": 10, + "real_builtin_drift_rejections": 2, + "trace_negative_controls": 4, + "trace_pairs": 7 + }, + "modified_helper_invocations": 0, + "runtime_policy": "Reject before native/fallback on source helper, effective builtins, class, function, closure or native dispatch drift", + "status": "V2_RUNTIME_AND_COMPLEMENT_STREAM_PASS" + } +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-finite/receipt.json b/research/gf2-side-verification/evidence/inner/matrix-v2-finite/receipt.json new file mode 100644 index 0000000000..ecb7411685 --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-finite/receipt.json @@ -0,0 +1,116 @@ +{ + "base_main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "build": { + "c_source_sha256": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "command": [ + "x86_64-linux-gnu-gcc", + "-shared", + "-fPIC", + "-O3", + "-std=c11", + "-Wall", + "-Wextra", + "-Werror", + "-I/usr/include/python3.12", + "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/c-verification-all-opportunities-20261027/stages/matrix-anchor-v2/native_gf2.c", + "-o", + "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/c-verification-all-opportunities-20261027/runtime/matrix-v2-finite/cold-build/_packed_gf2.cpython-312-x86_64-linux-gnu.so" + ], + "extension_sha256": "d990705af645971612df802a427642bdb4cd79de0bb028a2f8ed3667bcf44c04", + "no_cached_binary": true, + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "returncode": 0, + "stderr": "", + "stdout": "" + }, + "complete": null, + "controls": { + "counts": { + "binding_rejections": 3, + "boundary_cases": 17, + "fallback_cases": 38, + "gram_cases": 621, + "oracle_negative_controls": 2, + "ordered_complements": 5344, + "real_label_permutations": 24 + }, + "fixture_sha256": "fbf7cb44bb99c96ee7d393eb91f2ebfbfb94375917c78a902d547320afd75d84", + "independent_oracle": "Dense binary lists, descending pivots, addition modulo 2; no packed/source/native helpers", + "micro": { + "native_with_conversion": { + "cpu_seconds": 0.01950881300000007, + "wall_seconds": 0.019559950014809147 + }, + "unchanged_python": { + "cpu_seconds": 0.13026391399999993, + "wall_seconds": 0.1303495999891311 + } + }, + "micro_fixtures": 4, + "micro_repetitions": 128, + "micro_scope": "Fixed h25 label families with conversion; diagnostic only, not complete side speed", + "native_and_fallback_calls": { + "complement_fallback": 30, + "complement_native": 5875, + "gram_fallback": 20, + "gram_native": 1638 + }, + "status": "FINITE_NATIVE_GF2_CONTROLS_PASS", + "v2_controls": { + "complement_fixture_stream": { + "calls": 7, + "canonical_stream_bytes": 597, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "ed44b2291db9f1bafc9bdb02e6d3b53e1926b01e549ef8bdccc1991922a6345d" + }, + "counts": { + "class_dispatch_rejections": 2, + "effective_builtins_rejections": 2, + "native_proxy_rejections": 1, + "postbind_drift_rejections": 25, + "prebind_shadow_rejections": 10, + "real_builtin_drift_rejections": 2, + "trace_negative_controls": 4, + "trace_pairs": 7 + }, + "modified_helper_invocations": 0, + "runtime_policy": "Reject before native/fallback on source helper, effective builtins, class, function, closure or native dispatch drift", + "status": "V2_RUNTIME_AND_COMPLEMENT_STREAM_PASS" + } + }, + "engineering_sources": { + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a" + }, + "environment": { + "executable": "/usr/bin/python3.12", + "optimization": 0, + "platform": "linux", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]" + }, + "expected_complement_sha256": null, + "frozen_sources": { + "complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + }, + "measured_wall_seconds_before_receipt_write": 1.464233073987998, + "measurement_scope": "Cold entire process; parent guard outer wall/CPU is authoritative. Both arms write identical complete witness bytes. Candidate additionally compiles, links, loads and runs every finite/native/binding control.", + "mode": "finite", + "phases": { + "all_finite_independent_binding_fallback_controls": { + "cpu_seconds_including_children": 1.1082770000000002, + "wall_seconds": 1.108601727988571 + }, + "cold_compile_link_load": { + "cpu_seconds_including_children": 0.19273600000000002, + "wall_seconds": 0.19265605101827532 + } + }, + "process_plus_compiler_cpu_seconds_before_receipt_write": 1.6113699999999997, + "qualification_revision": 2, + "scientific_scope": "Frozen H=25 complex side verification only; no full network certificate, selected frontier, PR5864 gain, new construction, parameter search or kappa admission.", + "status": "FINITE_PASS" +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-finite_O/finite-controls.json b/research/gf2-side-verification/evidence/inner/matrix-v2-finite_O/finite-controls.json new file mode 100644 index 0000000000..56f858e887 --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-finite_O/finite-controls.json @@ -0,0 +1,54 @@ +{ + "counts": { + "binding_rejections": 3, + "boundary_cases": 17, + "fallback_cases": 38, + "gram_cases": 621, + "oracle_negative_controls": 2, + "ordered_complements": 5344, + "real_label_permutations": 24 + }, + "fixture_sha256": "fbf7cb44bb99c96ee7d393eb91f2ebfbfb94375917c78a902d547320afd75d84", + "independent_oracle": "Dense binary lists, descending pivots, addition modulo 2; no packed/source/native helpers", + "micro": { + "native_with_conversion": { + "cpu_seconds": 0.02188155299999983, + "wall_seconds": 0.02187909500207752 + }, + "unchanged_python": { + "cpu_seconds": 0.13507606500000013, + "wall_seconds": 0.1351196300238371 + } + }, + "micro_fixtures": 4, + "micro_repetitions": 128, + "micro_scope": "Fixed h25 label families with conversion; diagnostic only, not complete side speed", + "native_and_fallback_calls": { + "complement_fallback": 30, + "complement_native": 5875, + "gram_fallback": 20, + "gram_native": 1638 + }, + "status": "FINITE_NATIVE_GF2_CONTROLS_PASS", + "v2_controls": { + "complement_fixture_stream": { + "calls": 7, + "canonical_stream_bytes": 597, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "ed44b2291db9f1bafc9bdb02e6d3b53e1926b01e549ef8bdccc1991922a6345d" + }, + "counts": { + "class_dispatch_rejections": 2, + "effective_builtins_rejections": 2, + "native_proxy_rejections": 1, + "postbind_drift_rejections": 25, + "prebind_shadow_rejections": 10, + "real_builtin_drift_rejections": 2, + "trace_negative_controls": 4, + "trace_pairs": 7 + }, + "modified_helper_invocations": 0, + "runtime_policy": "Reject before native/fallback on source helper, effective builtins, class, function, closure or native dispatch drift", + "status": "V2_RUNTIME_AND_COMPLEMENT_STREAM_PASS" + } +} diff --git a/research/gf2-side-verification/evidence/inner/matrix-v2-finite_O/receipt.json b/research/gf2-side-verification/evidence/inner/matrix-v2-finite_O/receipt.json new file mode 100644 index 0000000000..e387a970c2 --- /dev/null +++ b/research/gf2-side-verification/evidence/inner/matrix-v2-finite_O/receipt.json @@ -0,0 +1,116 @@ +{ + "base_main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "build": { + "c_source_sha256": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "command": [ + "x86_64-linux-gnu-gcc", + "-shared", + "-fPIC", + "-O3", + "-std=c11", + "-Wall", + "-Wextra", + "-Werror", + "-I/usr/include/python3.12", + "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/c-verification-all-opportunities-20261027/stages/matrix-anchor-v2/native_gf2.c", + "-o", + "/home/d3lerium/.codex/.chatgpt-projects/g-p-6ad5817fd84881918865926b6fd51453/outputs/c-verification-all-opportunities-20261027/runtime/matrix-v2-finite_O/cold-build/_packed_gf2.cpython-312-x86_64-linux-gnu.so" + ], + "extension_sha256": "d990705af645971612df802a427642bdb4cd79de0bb028a2f8ed3667bcf44c04", + "no_cached_binary": true, + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "returncode": 0, + "stderr": "", + "stdout": "" + }, + "complete": null, + "controls": { + "counts": { + "binding_rejections": 3, + "boundary_cases": 17, + "fallback_cases": 38, + "gram_cases": 621, + "oracle_negative_controls": 2, + "ordered_complements": 5344, + "real_label_permutations": 24 + }, + "fixture_sha256": "fbf7cb44bb99c96ee7d393eb91f2ebfbfb94375917c78a902d547320afd75d84", + "independent_oracle": "Dense binary lists, descending pivots, addition modulo 2; no packed/source/native helpers", + "micro": { + "native_with_conversion": { + "cpu_seconds": 0.02188155299999983, + "wall_seconds": 0.02187909500207752 + }, + "unchanged_python": { + "cpu_seconds": 0.13507606500000013, + "wall_seconds": 0.1351196300238371 + } + }, + "micro_fixtures": 4, + "micro_repetitions": 128, + "micro_scope": "Fixed h25 label families with conversion; diagnostic only, not complete side speed", + "native_and_fallback_calls": { + "complement_fallback": 30, + "complement_native": 5875, + "gram_fallback": 20, + "gram_native": 1638 + }, + "status": "FINITE_NATIVE_GF2_CONTROLS_PASS", + "v2_controls": { + "complement_fixture_stream": { + "calls": 7, + "canonical_stream_bytes": 597, + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", + "sha256": "ed44b2291db9f1bafc9bdb02e6d3b53e1926b01e549ef8bdccc1991922a6345d" + }, + "counts": { + "class_dispatch_rejections": 2, + "effective_builtins_rejections": 2, + "native_proxy_rejections": 1, + "postbind_drift_rejections": 25, + "prebind_shadow_rejections": 10, + "real_builtin_drift_rejections": 2, + "trace_negative_controls": 4, + "trace_pairs": 7 + }, + "modified_helper_invocations": 0, + "runtime_policy": "Reject before native/fallback on source helper, effective builtins, class, function, closure or native dispatch drift", + "status": "V2_RUNTIME_AND_COMPLEMENT_STREAM_PASS" + } + }, + "engineering_sources": { + "compare_side_verifier.py": "6e507bb0c7e00d090a60289fddb6c55e90c946d0850c42c3c5e3e15c27604a68", + "finite_controls.py": "df989a831aac43cc1af95169dad8c64a7548760e6e1f96976da996703f2c8f7a", + "native_backend.py": "e473c38245c3668715b5a78dfe980b2fe3ed0d0c9b8c97c666fbae6ecf1fffd5", + "native_gf2.c": "e9c3c9194a08718bd1575c1cf08c6c6772d3b644c2e274c25a84a1f9249d06cc", + "profile_side_verifier.py": "9c994378171c20a91539418d93cb8387e1daa93465d6862beefea90e12999c2a" + }, + "environment": { + "executable": "/usr/bin/python3.12", + "optimization": 1, + "platform": "linux", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]" + }, + "expected_complement_sha256": null, + "frozen_sources": { + "complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + }, + "measured_wall_seconds_before_receipt_write": 1.4666977040178608, + "measurement_scope": "Cold entire process; parent guard outer wall/CPU is authoritative. Both arms write identical complete witness bytes. Candidate additionally compiles, links, loads and runs every finite/native/binding control.", + "mode": "finite", + "phases": { + "all_finite_independent_binding_fallback_controls": { + "cpu_seconds_including_children": 1.107308, + "wall_seconds": 1.110673424002016 + }, + "cold_compile_link_load": { + "cpu_seconds_including_children": 0.18729499999999993, + "wall_seconds": 0.18723529801354744 + } + }, + "process_plus_compiler_cpu_seconds_before_receipt_write": 1.60549, + "qualification_revision": 2, + "scientific_scope": "Frozen H=25 complex side verification only; no full network certificate, selected frontier, PR5864 gain, new construction, parameter search or kappa admission.", + "status": "FINITE_PASS" +} diff --git a/research/gf2-side-verification/evidence/profile/profile.pstats b/research/gf2-side-verification/evidence/profile/profile.pstats new file mode 100644 index 0000000000..6378794b2f Binary files /dev/null and b/research/gf2-side-verification/evidence/profile/profile.pstats differ diff --git a/research/gf2-side-verification/evidence/profile/rank-corpus.json b/research/gf2-side-verification/evidence/profile/rank-corpus.json new file mode 100644 index 0000000000..db6591f339 --- /dev/null +++ b/research/gf2-side-verification/evidence/profile/rank-corpus.json @@ -0,0 +1 @@ +[{"rank":1,"rows":[1]},{"rank":2,"rows":[1,2]},{"rank":3,"rows":[1,2,4]},{"rank":4,"rows":[1,2,4,8]},{"rank":5,"rows":[1,2,4,8,16]},{"rank":6,"rows":[1,2,4,8,16,32]},{"rank":7,"rows":[1,2,4,8,16,32,64]},{"rank":8,"rows":[1,2,4,8,16,32,64,128]},{"rank":9,"rows":[1,2,4,8,16,32,64,128,256]},{"rank":10,"rows":[1,2,4,8,16,32,64,128,256,512]},{"rank":11,"rows":[1,2,4,8,16,32,64,128,256,512,1024]},{"rank":12,"rows":[1,2,4,8,16,32,64,128,256,512,1024,2048]},{"rank":13,"rows":[1,2,4,8,16,32,64,128,256,512,1024,2048,4096]},{"rank":14,"rows":[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192]},{"rank":15,"rows":[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384]},{"rank":16,"rows":[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768]},{"rank":17,"rows":[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536]},{"rank":18,"rows":[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072]},{"rank":19,"rows":[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144]},{"rank":20,"rows":[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288]},{"rank":21,"rows":[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576]},{"rank":24,"rows":[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,8388608,4194304]},{"rank":2,"rows":[2,3]},{"rank":2,"rows":[3,1]},{"rank":3,"rows":[6,5,7]},{"rank":3,"rows":[6,7,3]},{"rank":3,"rows":[7,5,3]},{"rank":4,"rows":[14,13,11,15]},{"rank":4,"rows":[14,13,15,7]},{"rank":4,"rows":[14,15,11,7]},{"rank":4,"rows":[15,13,11,7]},{"rank":5,"rows":[30,29,27,23,31]},{"rank":5,"rows":[30,29,27,31,15]},{"rank":5,"rows":[30,29,31,23,15]},{"rank":5,"rows":[30,31,27,23,15]},{"rank":5,"rows":[31,29,27,23,15]},{"rank":6,"rows":[62,61,59,55,47,63]},{"rank":6,"rows":[62,61,59,55,63,31]},{"rank":6,"rows":[62,61,59,63,47,31]},{"rank":6,"rows":[62,61,63,55,47,31]},{"rank":6,"rows":[62,63,59,55,47,31]},{"rank":6,"rows":[63,61,59,55,47,31]},{"rank":7,"rows":[126,125,123,119,111,95,127]},{"rank":7,"rows":[126,125,123,119,111,127,63]},{"rank":7,"rows":[126,125,123,119,127,95,63]},{"rank":7,"rows":[126,125,123,127,111,95,63]},{"rank":7,"rows":[126,125,127,119,111,95,63]},{"rank":7,"rows":[126,127,123,119,111,95,63]},{"rank":7,"rows":[127,125,123,119,111,95,63]},{"rank":8,"rows":[254,253,251,247,239,223,191,255]},{"rank":8,"rows":[254,253,251,247,239,223,255,127]},{"rank":8,"rows":[254,253,251,247,239,255,191,127]},{"rank":8,"rows":[254,253,251,247,255,223,191,127]},{"rank":8,"rows":[254,253,251,255,239,223,191,127]},{"rank":8,"rows":[254,253,255,247,239,223,191,127]},{"rank":8,"rows":[254,255,251,247,239,223,191,127]},{"rank":8,"rows":[255,253,251,247,239,223,191,127]},{"rank":9,"rows":[510,509,507,503,495,479,447,383,511]},{"rank":9,"rows":[510,509,507,503,495,479,447,511,255]},{"rank":9,"rows":[510,509,507,503,495,479,511,383,255]},{"rank":9,"rows":[510,509,507,503,495,511,447,383,255]},{"rank":9,"rows":[510,509,507,503,511,479,447,383,255]},{"rank":9,"rows":[510,509,507,511,495,479,447,383,255]},{"rank":9,"rows":[510,509,511,503,495,479,447,383,255]},{"rank":9,"rows":[510,511,507,503,495,479,447,383,255]},{"rank":9,"rows":[511,509,507,503,495,479,447,383,255]},{"rank":10,"rows":[1022,1021,1019,1015,1007,991,959,895,767,1023]},{"rank":10,"rows":[1022,1021,1019,1015,1007,991,959,895,1023,511]},{"rank":10,"rows":[1022,1021,1019,1015,1007,991,959,1023,767,511]},{"rank":10,"rows":[1022,1021,1019,1015,1007,991,1023,895,767,511]},{"rank":10,"rows":[1022,1021,1019,1015,1007,1023,959,895,767,511]},{"rank":10,"rows":[1022,1021,1019,1015,1023,991,959,895,767,511]},{"rank":10,"rows":[1022,1021,1019,1023,1007,991,959,895,767,511]},{"rank":10,"rows":[1022,1021,1023,1015,1007,991,959,895,767,511]},{"rank":10,"rows":[1022,1023,1019,1015,1007,991,959,895,767,511]},{"rank":10,"rows":[1023,1021,1019,1015,1007,991,959,895,767,511]},{"rank":11,"rows":[2046,2045,2043,2039,2031,2015,1983,1919,1791,1535,2047]},{"rank":11,"rows":[2046,2045,2043,2039,2031,2015,1983,1919,1791,2047,1023]},{"rank":11,"rows":[2046,2045,2043,2039,2031,2015,1983,1919,2047,1535,1023]},{"rank":11,"rows":[2046,2045,2043,2039,2031,2015,1983,2047,1791,1535,1023]},{"rank":11,"rows":[2046,2045,2043,2039,2031,2015,2047,1919,1791,1535,1023]},{"rank":11,"rows":[2046,2045,2043,2039,2031,2047,1983,1919,1791,1535,1023]},{"rank":11,"rows":[2046,2045,2043,2039,2047,2015,1983,1919,1791,1535,1023]},{"rank":11,"rows":[2046,2045,2043,2047,2031,2015,1983,1919,1791,1535,1023]},{"rank":11,"rows":[2046,2045,2047,2039,2031,2015,1983,1919,1791,1535,1023]},{"rank":11,"rows":[2046,2047,2043,2039,2031,2015,1983,1919,1791,1535,1023]},{"rank":11,"rows":[2047,2045,2043,2039,2031,2015,1983,1919,1791,1535,1023]},{"rank":12,"rows":[4094,4093,4091,4087,4079,4063,4031,3967,3839,3583,3071,4095]},{"rank":12,"rows":[4094,4093,4091,4087,4079,4063,4031,3967,3839,3583,4095,2047]},{"rank":12,"rows":[4094,4093,4091,4087,4079,4063,4031,3967,3839,4095,3071,2047]},{"rank":12,"rows":[4094,4093,4091,4087,4079,4063,4031,3967,4095,3583,3071,2047]},{"rank":12,"rows":[4094,4093,4091,4087,4079,4063,4031,4095,3839,3583,3071,2047]},{"rank":12,"rows":[4094,4093,4091,4087,4079,4063,4095,3967,3839,3583,3071,2047]},{"rank":12,"rows":[4094,4093,4091,4087,4079,4095,4031,3967,3839,3583,3071,2047]},{"rank":12,"rows":[4094,4093,4091,4087,4095,4063,4031,3967,3839,3583,3071,2047]},{"rank":12,"rows":[4094,4093,4091,4095,4079,4063,4031,3967,3839,3583,3071,2047]},{"rank":12,"rows":[4094,4093,4095,4087,4079,4063,4031,3967,3839,3583,3071,2047]},{"rank":12,"rows":[4094,4095,4091,4087,4079,4063,4031,3967,3839,3583,3071,2047]},{"rank":12,"rows":[4095,4093,4091,4087,4079,4063,4031,3967,3839,3583,3071,2047]},{"rank":13,"rows":[8190,8189,8187,8183,8175,8159,8127,8063,7935,7679,7167,6143,8191]},{"rank":13,"rows":[8190,8189,8187,8183,8175,8159,8127,8063,7935,7679,7167,8191,4095]},{"rank":13,"rows":[8190,8189,8187,8183,8175,8159,8127,8063,7935,7679,8191,6143,4095]},{"rank":13,"rows":[8190,8189,8187,8183,8175,8159,8127,8063,7935,8191,7167,6143,4095]},{"rank":13,"rows":[8190,8189,8187,8183,8175,8159,8127,8063,8191,7679,7167,6143,4095]},{"rank":13,"rows":[8190,8189,8187,8183,8175,8159,8127,8191,7935,7679,7167,6143,4095]},{"rank":13,"rows":[8190,8189,8187,8183,8175,8159,8191,8063,7935,7679,7167,6143,4095]},{"rank":13,"rows":[8190,8189,8187,8183,8175,8191,8127,8063,7935,7679,7167,6143,4095]},{"rank":13,"rows":[8190,8189,8187,8183,8191,8159,8127,8063,7935,7679,7167,6143,4095]},{"rank":13,"rows":[8190,8189,8187,8191,8175,8159,8127,8063,7935,7679,7167,6143,4095]},{"rank":13,"rows":[8190,8189,8191,8183,8175,8159,8127,8063,7935,7679,7167,6143,4095]},{"rank":13,"rows":[8190,8191,8187,8183,8175,8159,8127,8063,7935,7679,7167,6143,4095]},{"rank":13,"rows":[8191,8189,8187,8183,8175,8159,8127,8063,7935,7679,7167,6143,4095]},{"rank":14,"rows":[16382,16381,16379,16375,16367,16351,16319,16255,16127,15871,15359,14335,12287,16383]},{"rank":14,"rows":[16382,16381,16379,16375,16367,16351,16319,16255,16127,15871,15359,14335,16383,8191]},{"rank":14,"rows":[16382,16381,16379,16375,16367,16351,16319,16255,16127,15871,15359,16383,12287,8191]},{"rank":14,"rows":[16382,16381,16379,16375,16367,16351,16319,16255,16127,15871,16383,14335,12287,8191]},{"rank":14,"rows":[16382,16381,16379,16375,16367,16351,16319,16255,16127,16383,15359,14335,12287,8191]},{"rank":14,"rows":[16382,16381,16379,16375,16367,16351,16319,16255,16383,15871,15359,14335,12287,8191]},{"rank":14,"rows":[16382,16381,16379,16375,16367,16351,16319,16383,16127,15871,15359,14335,12287,8191]},{"rank":14,"rows":[16382,16381,16379,16375,16367,16351,16383,16255,16127,15871,15359,14335,12287,8191]},{"rank":14,"rows":[16382,16381,16379,16375,16367,16383,16319,16255,16127,15871,15359,14335,12287,8191]},{"rank":14,"rows":[16382,16381,16379,16375,16383,16351,16319,16255,16127,15871,15359,14335,12287,8191]},{"rank":14,"rows":[16382,16381,16379,16383,16367,16351,16319,16255,16127,15871,15359,14335,12287,8191]},{"rank":14,"rows":[16382,16381,16383,16375,16367,16351,16319,16255,16127,15871,15359,14335,12287,8191]},{"rank":14,"rows":[16382,16383,16379,16375,16367,16351,16319,16255,16127,15871,15359,14335,12287,8191]},{"rank":14,"rows":[16383,16381,16379,16375,16367,16351,16319,16255,16127,15871,15359,14335,12287,8191]},{"rank":15,"rows":[32766,32765,32763,32759,32751,32735,32703,32639,32511,32255,31743,30719,28671,24575,32767]},{"rank":15,"rows":[32766,32765,32763,32759,32751,32735,32703,32639,32511,32255,31743,30719,28671,32767,16383]},{"rank":15,"rows":[32766,32765,32763,32759,32751,32735,32703,32639,32511,32255,31743,30719,32767,24575,16383]},{"rank":15,"rows":[32766,32765,32763,32759,32751,32735,32703,32639,32511,32255,31743,32767,28671,24575,16383]},{"rank":15,"rows":[32766,32765,32763,32759,32751,32735,32703,32639,32511,32255,32767,30719,28671,24575,16383]},{"rank":15,"rows":[32766,32765,32763,32759,32751,32735,32703,32639,32511,32767,31743,30719,28671,24575,16383]},{"rank":15,"rows":[32766,32765,32763,32759,32751,32735,32703,32639,32767,32255,31743,30719,28671,24575,16383]},{"rank":15,"rows":[32766,32765,32763,32759,32751,32735,32703,32767,32511,32255,31743,30719,28671,24575,16383]},{"rank":15,"rows":[32766,32765,32763,32759,32751,32735,32767,32639,32511,32255,31743,30719,28671,24575,16383]},{"rank":15,"rows":[32766,32765,32763,32759,32751,32767,32703,32639,32511,32255,31743,30719,28671,24575,16383]},{"rank":15,"rows":[32766,32765,32763,32759,32767,32735,32703,32639,32511,32255,31743,30719,28671,24575,16383]},{"rank":15,"rows":[32766,32765,32763,32767,32751,32735,32703,32639,32511,32255,31743,30719,28671,24575,16383]},{"rank":15,"rows":[32766,32765,32767,32759,32751,32735,32703,32639,32511,32255,31743,30719,28671,24575,16383]},{"rank":15,"rows":[32766,32767,32763,32759,32751,32735,32703,32639,32511,32255,31743,30719,28671,24575,16383]},{"rank":15,"rows":[32767,32765,32763,32759,32751,32735,32703,32639,32511,32255,31743,30719,28671,24575,16383]},{"rank":16,"rows":[65534,65533,65531,65527,65519,65503,65471,65407,65279,65023,64511,63487,61439,57343,49151,65535]},{"rank":16,"rows":[65534,65533,65531,65527,65519,65503,65471,65407,65279,65023,64511,63487,61439,57343,65535,32767]},{"rank":16,"rows":[65534,65533,65531,65527,65519,65503,65471,65407,65279,65023,64511,63487,61439,65535,49151,32767]},{"rank":16,"rows":[65534,65533,65531,65527,65519,65503,65471,65407,65279,65023,64511,63487,65535,57343,49151,32767]},{"rank":16,"rows":[65534,65533,65531,65527,65519,65503,65471,65407,65279,65023,64511,65535,61439,57343,49151,32767]},{"rank":16,"rows":[65534,65533,65531,65527,65519,65503,65471,65407,65279,65023,65535,63487,61439,57343,49151,32767]},{"rank":16,"rows":[65534,65533,65531,65527,65519,65503,65471,65407,65279,65535,64511,63487,61439,57343,49151,32767]},{"rank":16,"rows":[65534,65533,65531,65527,65519,65503,65471,65407,65535,65023,64511,63487,61439,57343,49151,32767]},{"rank":16,"rows":[65534,65533,65531,65527,65519,65503,65471,65535,65279,65023,64511,63487,61439,57343,49151,32767]},{"rank":16,"rows":[65534,65533,65531,65527,65519,65503,65535,65407,65279,65023,64511,63487,61439,57343,49151,32767]},{"rank":16,"rows":[65534,65533,65531,65527,65519,65535,65471,65407,65279,65023,64511,63487,61439,57343,49151,32767]},{"rank":16,"rows":[65534,65533,65531,65527,65535,65503,65471,65407,65279,65023,64511,63487,61439,57343,49151,32767]},{"rank":16,"rows":[65534,65533,65531,65535,65519,65503,65471,65407,65279,65023,64511,63487,61439,57343,49151,32767]},{"rank":16,"rows":[65534,65533,65535,65527,65519,65503,65471,65407,65279,65023,64511,63487,61439,57343,49151,32767]},{"rank":16,"rows":[65534,65535,65531,65527,65519,65503,65471,65407,65279,65023,64511,63487,61439,57343,49151,32767]},{"rank":16,"rows":[65535,65533,65531,65527,65519,65503,65471,65407,65279,65023,64511,63487,61439,57343,49151,32767]},{"rank":17,"rows":[131070,131069,131067,131063,131055,131039,131007,130943,130815,130559,130047,129023,126975,122879,114687,98303,131071]},{"rank":17,"rows":[131070,131069,131067,131063,131055,131039,131007,130943,130815,130559,130047,129023,126975,122879,114687,131071,65535]},{"rank":17,"rows":[131070,131069,131067,131063,131055,131039,131007,130943,130815,130559,130047,129023,126975,122879,131071,98303,65535]},{"rank":17,"rows":[131070,131069,131067,131063,131055,131039,131007,130943,130815,130559,130047,129023,126975,131071,114687,98303,65535]},{"rank":17,"rows":[131070,131069,131067,131063,131055,131039,131007,130943,130815,130559,130047,129023,131071,122879,114687,98303,65535]},{"rank":17,"rows":[131070,131069,131067,131063,131055,131039,131007,130943,130815,130559,130047,131071,126975,122879,114687,98303,65535]},{"rank":17,"rows":[131070,131069,131067,131063,131055,131039,131007,130943,130815,130559,131071,129023,126975,122879,114687,98303,65535]},{"rank":17,"rows":[131070,131069,131067,131063,131055,131039,131007,130943,130815,131071,130047,129023,126975,122879,114687,98303,65535]},{"rank":17,"rows":[131070,131069,131067,131063,131055,131039,131007,130943,131071,130559,130047,129023,126975,122879,114687,98303,65535]},{"rank":17,"rows":[131070,131069,131067,131063,131055,131039,131007,131071,130815,130559,130047,129023,126975,122879,114687,98303,65535]},{"rank":17,"rows":[131070,131069,131067,131063,131055,131039,131071,130943,130815,130559,130047,129023,126975,122879,114687,98303,65535]},{"rank":17,"rows":[131070,131069,131067,131063,131055,131071,131007,130943,130815,130559,130047,129023,126975,122879,114687,98303,65535]},{"rank":17,"rows":[131070,131069,131067,131063,131071,131039,131007,130943,130815,130559,130047,129023,126975,122879,114687,98303,65535]},{"rank":17,"rows":[131070,131069,131067,131071,131055,131039,131007,130943,130815,130559,130047,129023,126975,122879,114687,98303,65535]},{"rank":17,"rows":[131070,131069,131071,131063,131055,131039,131007,130943,130815,130559,130047,129023,126975,122879,114687,98303,65535]},{"rank":17,"rows":[131070,131071,131067,131063,131055,131039,131007,130943,130815,130559,130047,129023,126975,122879,114687,98303,65535]},{"rank":17,"rows":[131071,131069,131067,131063,131055,131039,131007,130943,130815,130559,130047,129023,126975,122879,114687,98303,65535]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262111,262079,262015,261887,261631,261119,260095,258047,253951,245759,229375,196607,262143]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262111,262079,262015,261887,261631,261119,260095,258047,253951,245759,229375,262143,131071]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262111,262079,262015,261887,261631,261119,260095,258047,253951,245759,262143,196607,131071]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262111,262079,262015,261887,261631,261119,260095,258047,253951,262143,229375,196607,131071]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262111,262079,262015,261887,261631,261119,260095,258047,262143,245759,229375,196607,131071]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262111,262079,262015,261887,261631,261119,260095,262143,253951,245759,229375,196607,131071]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262111,262079,262015,261887,261631,261119,262143,258047,253951,245759,229375,196607,131071]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262111,262079,262015,261887,261631,262143,260095,258047,253951,245759,229375,196607,131071]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262111,262079,262015,261887,262143,261119,260095,258047,253951,245759,229375,196607,131071]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262111,262079,262015,262143,261631,261119,260095,258047,253951,245759,229375,196607,131071]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262111,262079,262143,261887,261631,261119,260095,258047,253951,245759,229375,196607,131071]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262111,262143,262015,261887,261631,261119,260095,258047,253951,245759,229375,196607,131071]},{"rank":18,"rows":[262142,262141,262139,262135,262127,262143,262079,262015,261887,261631,261119,260095,258047,253951,245759,229375,196607,131071]},{"rank":18,"rows":[262142,262141,262139,262135,262143,262111,262079,262015,261887,261631,261119,260095,258047,253951,245759,229375,196607,131071]},{"rank":18,"rows":[262142,262141,262139,262143,262127,262111,262079,262015,261887,261631,261119,260095,258047,253951,245759,229375,196607,131071]},{"rank":18,"rows":[262142,262141,262143,262135,262127,262111,262079,262015,261887,261631,261119,260095,258047,253951,245759,229375,196607,131071]},{"rank":18,"rows":[262142,262143,262139,262135,262127,262111,262079,262015,261887,261631,261119,260095,258047,253951,245759,229375,196607,131071]},{"rank":18,"rows":[262143,262141,262139,262135,262127,262111,262079,262015,261887,261631,261119,260095,258047,253951,245759,229375,196607,131071]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524223,524159,524031,523775,523263,522239,520191,516095,507903,491519,458751,393215,524287]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524223,524159,524031,523775,523263,522239,520191,516095,507903,491519,458751,524287,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524223,524159,524031,523775,523263,522239,520191,516095,507903,491519,524287,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524223,524159,524031,523775,523263,522239,520191,516095,507903,524287,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524223,524159,524031,523775,523263,522239,520191,516095,524287,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524223,524159,524031,523775,523263,522239,520191,524287,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524223,524159,524031,523775,523263,522239,524287,516095,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524223,524159,524031,523775,523263,524287,520191,516095,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524223,524159,524031,523775,524287,522239,520191,516095,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524223,524159,524031,524287,523263,522239,520191,516095,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524223,524159,524287,523775,523263,522239,520191,516095,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524223,524287,524031,523775,523263,522239,520191,516095,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524255,524287,524159,524031,523775,523263,522239,520191,516095,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524271,524287,524223,524159,524031,523775,523263,522239,520191,516095,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524279,524287,524255,524223,524159,524031,523775,523263,522239,520191,516095,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524283,524287,524271,524255,524223,524159,524031,523775,523263,522239,520191,516095,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524285,524287,524279,524271,524255,524223,524159,524031,523775,523263,522239,520191,516095,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524286,524287,524283,524279,524271,524255,524223,524159,524031,523775,523263,522239,520191,516095,507903,491519,458751,393215,262143]},{"rank":19,"rows":[524287,524285,524283,524279,524271,524255,524223,524159,524031,523775,523263,522239,520191,516095,507903,491519,458751,393215,262143]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1015807,983039,917503,786431,1048575]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1015807,983039,917503,1048575,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1015807,983039,1048575,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1015807,1048575,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1048575,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1048575,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1048575,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1048575,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1048575,1044479,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1048575,1046527,1044479,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048575,1047551,1046527,1044479,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048575,1048063,1047551,1046527,1044479,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048511,1048575,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048543,1048575,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048559,1048575,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048567,1048575,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048571,1048575,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048573,1048575,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048574,1048575,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":20,"rows":[1048575,1048573,1048571,1048567,1048559,1048543,1048511,1048447,1048319,1048063,1047551,1046527,1044479,1040383,1032191,1015807,983039,917503,786431,524287]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,2097151]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,2097151,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,2097151,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,2097151,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2097151,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2097151,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2097151,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2097151,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2097151,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2097151,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2097151,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2097151,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2097151,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097087,2097151,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097119,2097151,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097135,2097151,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097143,2097151,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097147,2097151,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097149,2097151,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097150,2097151,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]},{"rank":21,"rows":[2097151,2097149,2097147,2097143,2097135,2097119,2097087,2097023,2096895,2096639,2096127,2095103,2093055,2088959,2080767,2064383,2031615,1966079,1835007,1572863,1048575]}] diff --git a/research/gf2-side-verification/evidence/profile/receipt.json b/research/gf2-side-verification/evidence/profile/receipt.json new file mode 100644 index 0000000000..e1a6918e8b --- /dev/null +++ b/research/gf2-side-verification/evidence/profile/receipt.json @@ -0,0 +1,710 @@ +{ + "all_source_functions": [ + { + "cumulative_seconds": 41.830508911, + "line": 232, + "name": "complement_in", + "primitive_calls": 238685, + "self_seconds": 11.585129098000001, + "total_calls": 238685 + }, + { + "cumulative_seconds": 23.483221633000003, + "line": 235, + "name": "", + "primitive_calls": 38556565, + "self_seconds": 10.379858962, + "total_calls": 38556565 + }, + { + "cumulative_seconds": 15.997713481000002, + "line": 202, + "name": "dot", + "primitive_calls": 42629900, + "self_seconds": 10.352292097000001, + "total_calls": 42629900 + }, + { + "cumulative_seconds": 3.821821067, + "line": 329, + "name": "", + "primitive_calls": 154100, + "self_seconds": 3.4510645110000002, + "total_calls": 154100 + }, + { + "cumulative_seconds": 3.325288291, + "line": 328, + "name": "", + "primitive_calls": 3544300, + "self_seconds": 3.325288291, + "total_calls": 3544300 + }, + { + "cumulative_seconds": 6.571738651, + "line": 164, + "name": "cover", + "primitive_calls": 96795, + "self_seconds": 2.9389913880000003, + "total_calls": 96795 + }, + { + "cumulative_seconds": 5.103359091000001, + "line": 230, + "name": "", + "primitive_calls": 8218076, + "self_seconds": 2.23077198, + "total_calls": 8218076 + }, + { + "cumulative_seconds": 1.7201757530000001, + "line": 196, + "name": "reduce", + "primitive_calls": 1374583, + "self_seconds": 1.499383739, + "total_calls": 1374583 + }, + { + "cumulative_seconds": 1.265838956, + "line": 169, + "name": "", + "primitive_calls": 13204304, + "self_seconds": 1.265838956, + "total_calls": 13204304 + }, + { + "cumulative_seconds": 2.0277389390000002, + "line": 206, + "name": "rank", + "primitive_calls": 59959, + "self_seconds": 1.226728991, + "total_calls": 59959 + }, + { + "cumulative_seconds": 1.337128114, + "line": 182, + "name": "echelon", + "primitive_calls": 85196, + "self_seconds": 1.199187258, + "total_calls": 85196 + }, + { + "cumulative_seconds": 27.602288614000003, + "line": 296, + "name": "residual_ok", + "primitive_calls": 568670, + "self_seconds": 0.8286655270000001, + "total_calls": 568670 + }, + { + "cumulative_seconds": 6.482882137000001, + "line": 271, + "name": "label", + "primitive_calls": 442075, + "self_seconds": 0.72955733, + "total_calls": 442075 + }, + { + "cumulative_seconds": 0.588319323, + "line": 240, + "name": "", + "primitive_calls": 1974058, + "self_seconds": 0.588319323, + "total_calls": 1974058 + }, + { + "cumulative_seconds": 1.0855141000000001, + "line": 68, + "name": "vec", + "primitive_calls": 13443, + "self_seconds": 0.514249219, + "total_calls": 131627 + }, + { + "cumulative_seconds": 2.212718036, + "line": 226, + "name": "", + "primitive_calls": 1553309, + "self_seconds": 0.492542283, + "total_calls": 1553309 + }, + { + "cumulative_seconds": 0.5407521820000001, + "line": 351, + "name": "compile_roles", + "primitive_calls": 1, + "self_seconds": 0.47146393600000003, + "total_calls": 1 + }, + { + "cumulative_seconds": 27.483299907000003, + "line": 304, + "name": "label_ok", + "primitive_calls": 377580, + "self_seconds": 0.46757793000000003, + "total_calls": 377580 + }, + { + "cumulative_seconds": 8.772145292000001, + "line": 228, + "name": "nondegenerate", + "primitive_calls": 59959, + "self_seconds": 0.458151729, + "total_calls": 59959 + }, + { + "cumulative_seconds": 3.5699033960000004, + "line": 376, + "name": "verify_role_frames", + "primitive_calls": 1, + "self_seconds": 0.375245946, + "total_calls": 1 + }, + { + "cumulative_seconds": 59.22530346200001, + "line": 335, + "name": "verify_labels", + "primitive_calls": 1, + "self_seconds": 0.346071318, + "total_calls": 1 + }, + { + "cumulative_seconds": 0.509058523, + "line": 47, + "name": "add", + "primitive_calls": 419497, + "self_seconds": 0.31349360600000004, + "total_calls": 419497 + }, + { + "cumulative_seconds": 0.501484875, + "line": 256, + "name": "odd", + "primitive_calls": 283478, + "self_seconds": 0.20583716200000002, + "total_calls": 283478 + }, + { + "cumulative_seconds": 2.6723380810000004, + "line": 225, + "name": "contains", + "primitive_calls": 178726, + "self_seconds": 0.18542350700000002, + "total_calls": 178726 + }, + { + "cumulative_seconds": 0.259234424, + "line": 208, + "name": "", + "primitive_calls": 659434, + "self_seconds": 0.17449539900000002, + "total_calls": 659434 + }, + { + "cumulative_seconds": 1.6040279100000001, + "line": 221, + "name": "__init__", + "primitive_calls": 85196, + "self_seconds": 0.156693134, + "total_calls": 85196 + }, + { + "cumulative_seconds": 0.149112888, + "line": 262, + "name": "", + "primitive_calls": 906200, + "self_seconds": 0.149112888, + "total_calls": 906200 + }, + { + "cumulative_seconds": 0.196905101, + "line": 257, + "name": "", + "primitive_calls": 358017, + "self_seconds": 0.128686987, + "total_calls": 358017 + }, + { + "cumulative_seconds": 8.148587646000001, + "line": 313, + "name": "verify_map", + "primitive_calls": 1, + "self_seconds": 0.115321451, + "total_calls": 1 + }, + { + "cumulative_seconds": 0.39315212600000005, + "line": 261, + "name": "tmask", + "primitive_calls": 227700, + "self_seconds": 0.095548424, + "total_calls": 227700 + }, + { + "cumulative_seconds": 0.397447938, + "line": 379, + "name": "step", + "primitive_calls": 379880, + "self_seconds": 0.09227162300000001, + "total_calls": 379880 + }, + { + "cumulative_seconds": 0.09217106, + "line": 210, + "name": "", + "primitive_calls": 599475, + "self_seconds": 0.09217106, + "total_calls": 599475 + }, + { + "cumulative_seconds": 0.411657551, + "line": 288, + "name": "target_frame", + "primitive_calls": 82800, + "self_seconds": 0.090119473, + "total_calls": 82800 + }, + { + "cumulative_seconds": 3.726751154, + "line": 114, + "name": "build_disjoint", + "primitive_calls": 1, + "self_seconds": 0.080545192, + "total_calls": 1 + }, + { + "cumulative_seconds": 0.14106513, + "line": 154, + "name": "prune", + "primitive_calls": 1, + "self_seconds": 0.075194987, + "total_calls": 1 + }, + { + "cumulative_seconds": 0.341931973, + "line": 79, + "name": "pairs", + "primitive_calls": 100, + "self_seconds": 0.04225762, + "total_calls": 1064 + }, + { + "cumulative_seconds": 2.66770912, + "line": 144, + "name": "emit", + "primitive_calls": 27600, + "self_seconds": 0.034134682, + "total_calls": 28800 + }, + { + "cumulative_seconds": 0.107196964, + "line": 60, + "name": "total", + "primitive_calls": 15282, + "self_seconds": 0.033926363, + "total_calls": 15282 + }, + { + "cumulative_seconds": 0.41184956300000003, + "line": 130, + "name": "build_pair_stars", + "primitive_calls": 1, + "self_seconds": 0.024091714, + "total_calls": 1 + }, + { + "cumulative_seconds": 0.013228198, + "line": 147, + "name": "", + "primitive_calls": 112800, + "self_seconds": 0.013228198, + "total_calls": 112800 + }, + { + "cumulative_seconds": 0.0127008, + "line": 44, + "name": "x", + "primitive_calls": 16100, + "self_seconds": 0.008614189000000001, + "total_calls": 16100 + }, + { + "cumulative_seconds": 0.008103109, + "line": 161, + "name": "", + "primitive_calls": 82896, + "self_seconds": 0.008103109, + "total_calls": 82896 + }, + { + "cumulative_seconds": 0.007203677, + "line": 178, + "name": "", + "primitive_calls": 82896, + "self_seconds": 0.007203677, + "total_calls": 82896 + }, + { + "cumulative_seconds": 0.006771328, + "line": 177, + "name": "", + "primitive_calls": 82896, + "self_seconds": 0.006771328, + "total_calls": 82896 + }, + { + "cumulative_seconds": 0.00674641, + "line": 292, + "name": "", + "primitive_calls": 59800, + "self_seconds": 0.00674641, + "total_calls": 59800 + }, + { + "cumulative_seconds": 0.06940723600000001, + "line": 100, + "name": "tri", + "primitive_calls": 2, + "self_seconds": 0.00447709, + "total_calls": 30 + }, + { + "cumulative_seconds": 4.284650095, + "line": 27, + "name": "__init__", + "primitive_calls": 1, + "self_seconds": 0.003948701000000001, + "total_calls": 1 + }, + { + "cumulative_seconds": 0.0036261130000000003, + "line": 21, + "name": "subsets", + "primitive_calls": 1108, + "self_seconds": 0.003046632, + "total_calls": 1108 + }, + { + "cumulative_seconds": 0.381495352, + "line": 92, + "name": "tri_parts", + "primitive_calls": 1, + "self_seconds": 0.0022367750000000003, + "total_calls": 15 + }, + { + "cumulative_seconds": 0.0017195460000000002, + "line": 97, + "name": "", + "primitive_calls": 1206, + "self_seconds": 0.00044936700000000005, + "total_calls": 1206 + }, + { + "cumulative_seconds": 0.0015474400000000002, + "line": 96, + "name": "", + "primitive_calls": 1094, + "self_seconds": 0.000375692, + "total_calls": 1094 + }, + { + "cumulative_seconds": 0.026589829000000002, + "line": 173, + "name": "stats", + "primitive_calls": 1, + "self_seconds": 2.0301e-05, + "total_calls": 1 + }, + { + "cumulative_seconds": 0.010446769, + "line": 1, + "name": "", + "primitive_calls": 1, + "self_seconds": 1.3150000000000001e-05, + "total_calls": 1 + }, + { + "cumulative_seconds": 8.030300000000001e-05, + "line": 267, + "name": "__init__", + "primitive_calls": 1, + "self_seconds": 9.348000000000001e-06, + "total_calls": 1 + }, + { + "cumulative_seconds": 3.991e-06, + "line": 26, + "name": "ComplexSideCircuit", + "primitive_calls": 1, + "self_seconds": 3.991e-06, + "total_calls": 1 + }, + { + "cumulative_seconds": 1.881e-06, + "line": 265, + "name": "Checks", + "primitive_calls": 1, + "self_seconds": 1.881e-06, + "total_calls": 1 + }, + { + "cumulative_seconds": 1.4030000000000002e-06, + "line": 219, + "name": "Label", + "primitive_calls": 1, + "self_seconds": 1.4030000000000002e-06, + "total_calls": 1 + } + ], + "base_main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "environment": { + "executable": "/usr/bin/python3.12", + "pid": 3231384, + "platform": "linux", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]" + }, + "exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", + "h": 25, + "limitations": [ + "Profiled timings include cProfile and exact rank-trace instrumentation.", + "Cumulative times are nested and must not be summed.", + "No native code or candidate execution; no speedup established.", + "The complete side verification segment is not the full complex-network certificate.", + "No PR5864 workload is executed and no matrix time counts toward its improvement target.", + "No new construction, parameter search, kappa admission or formal theorem verification." + ], + "profiled_complete_side_cpu_seconds": 74.99698459999999, + "profiled_complete_side_wall_seconds": 75.83844015499926, + "profiled_phases": { + "checks_initialization": { + "cpu_seconds": 8.904700000034182e-05, + "wall_seconds": 8.887899457477033e-05 + }, + "compile_roles": { + "cpu_seconds": 0.5589633070000009, + "wall_seconds": 0.5598336379916873 + }, + "construction": { + "cpu_seconds": 4.283536778, + "wall_seconds": 4.28466073598247 + }, + "load": { + "cpu_seconds": 0.016139446000000002, + "wall_seconds": 0.01641332800500095 + }, + "verify_labels": { + "cpu_seconds": 58.398762473, + "wall_seconds": 59.22531290599727 + }, + "verify_map": { + "cpu_seconds": 8.137714076999998, + "wall_seconds": 8.149399436981184 + }, + "verify_role_frames": { + "cpu_seconds": 3.5750674030000056, + "wall_seconds": 3.575986206997186 + } + }, + "rank_call_count": 59959, + "rank_distinct_matrix_count": 252, + "rank_shape_counts": [ + { + "calls": 2300, + "columns": 1, + "rows": 1 + }, + { + "calls": 600, + "columns": 2, + "rows": 2 + }, + { + "calls": 600, + "columns": 3, + "rows": 3 + }, + { + "calls": 3422, + "columns": 4, + "rows": 4 + }, + { + "calls": 4184, + "columns": 5, + "rows": 5 + }, + { + "calls": 5961, + "columns": 6, + "rows": 6 + }, + { + "calls": 5769, + "columns": 7, + "rows": 7 + }, + { + "calls": 4584, + "columns": 8, + "rows": 8 + }, + { + "calls": 2165, + "columns": 9, + "rows": 9 + }, + { + "calls": 4052, + "columns": 10, + "rows": 10 + }, + { + "calls": 6080, + "columns": 11, + "rows": 11 + }, + { + "calls": 4236, + "columns": 12, + "rows": 12 + }, + { + "calls": 3712, + "columns": 13, + "rows": 13 + }, + { + "calls": 1245, + "columns": 14, + "rows": 14 + }, + { + "calls": 1497, + "columns": 15, + "rows": 15 + }, + { + "calls": 3660, + "columns": 16, + "rows": 16 + }, + { + "calls": 1131, + "columns": 17, + "rows": 17 + }, + { + "calls": 658, + "columns": 18, + "rows": 18 + }, + { + "calls": 603, + "columns": 19, + "rows": 19 + }, + { + "calls": 600, + "columns": 20, + "rows": 20 + }, + { + "calls": 600, + "columns": 21, + "rows": 21 + }, + { + "calls": 2300, + "columns": 24, + "rows": 24 + } + ], + "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", + "result": { + "circuit": { + "additions": 80595, + "disjoint_additions": 68595, + "h": 25, + "injections": 27600, + "pair_star_additions": 12000, + "roles": 108195, + "roles_per_target": 47.041, + "v": 2300 + }, + "labels": { + "active_nodes": 82895, + "all_labels_nondegenerate": true, + "all_residuals_have_odd_vectors": true, + "checked_inclusions": 188790 + }, + "role_frames": { + "forward_frames_nested": true, + "reverse_complement_frames_nested": true, + "roles": 108195 + }, + "side_map": { + "coefficients": "+1/2 disjoint, -1/2 intersection two", + "nonzero_coefficients": 3693800, + "side_map_exact": true, + "targets": 2300 + } + }, + "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c", + "sources": { + "complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + }, + "status": "DIAGNOSTIC_COMPLETE_SIDE_SCOPE_ONLY", + "targeted_functions": [ + { + "cumulative_seconds": 41.830508911, + "line": 232, + "name": "complement_in", + "primitive_calls": 238685, + "self_seconds": 11.585129098000001, + "total_calls": 238685 + }, + { + "cumulative_seconds": 15.997713481000002, + "line": 202, + "name": "dot", + "primitive_calls": 42629900, + "self_seconds": 10.352292097000001, + "total_calls": 42629900 + }, + { + "cumulative_seconds": 8.772145292000001, + "line": 228, + "name": "nondegenerate", + "primitive_calls": 59959, + "self_seconds": 0.458151729, + "total_calls": 59959 + }, + { + "cumulative_seconds": 2.0277389390000002, + "line": 206, + "name": "rank", + "primitive_calls": 59959, + "self_seconds": 1.226728991, + "total_calls": 59959 + }, + { + "cumulative_seconds": 1.7201757530000001, + "line": 196, + "name": "reduce", + "primitive_calls": 1374583, + "self_seconds": 1.499383739, + "total_calls": 1374583 + }, + { + "cumulative_seconds": 1.337128114, + "line": 182, + "name": "echelon", + "primitive_calls": 85196, + "self_seconds": 1.199187258, + "total_calls": 85196 + } + ], + "unchanged_caller": "scripts/complex_network.py:certificate (side verification segment)" +} diff --git a/research/gf2-side-verification/evidence/publication/matrix-publication-finite/receipt.json b/research/gf2-side-verification/evidence/publication/matrix-publication-finite/receipt.json new file mode 100644 index 0000000000..9af4d7ebef --- /dev/null +++ b/research/gf2-side-verification/evidence/publication/matrix-publication-finite/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-publication-finite", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "b452e1e65f100a56bb9ad061f223487862654e6d05a7e45c5b70e923923fe50f", + "sampled_process_group_rss_bytes": 89604096, + "script": "stages/matrix-publication-v1/run_finite.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "a6dc9a497a46113d9e621685d4e5c824d00a15245e7dfd67ff99e1f673814958", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1171, + "stdout_sha256": "f8374716f0d3b91dbaf3739cb11bb033cb09949c146ef5fb5a8c6a0587a932c3", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 41020, + "system_seconds": 0.1, + "user_seconds": 3.44 + }, + "wall_seconds": 3.5717414160026237 +} diff --git a/research/gf2-side-verification/evidence/publication/matrix-publication-finite/stderr.txt b/research/gf2-side-verification/evidence/publication/matrix-publication-finite/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/publication/matrix-publication-finite/stdout.txt b/research/gf2-side-verification/evidence/publication/matrix-publication-finite/stdout.txt new file mode 100644 index 0000000000..8d2d07c59b --- /dev/null +++ b/research/gf2-side-verification/evidence/publication/matrix-publication-finite/stdout.txt @@ -0,0 +1,6 @@ +{"complement_trace": null, "complete_hashes": null, "controls": "FINITE_NATIVE_GF2_CONTROLS_PASS", "cpu_seconds_with_compiler": 1.532298, "mode": "finite", "phases": {"all_finite_independent_binding_fallback_controls": {"cpu_seconds_including_children": 1.0694059999999999, "wall_seconds": 1.0695209570112638}, "cold_compile_link_load": {"cpu_seconds_including_children": 0.171292, "wall_seconds": 0.1711642110021785}}, "status": "FINITE_PASS", "wall_seconds": 1.3619874709984288} +PASS_GF2_SIDE_NATIVE_FINITE_SOURCE_CONTROLS +{"complement_trace": null, "complete_hashes": null, "controls": "FINITE_NATIVE_GF2_CONTROLS_PASS", "cpu_seconds_with_compiler": 1.5190040000000002, "mode": "finite", "phases": {"all_finite_independent_binding_fallback_controls": {"cpu_seconds_including_children": 1.0395540000000003, "wall_seconds": 1.0397307809907943}, "cold_compile_link_load": {"cpu_seconds_including_children": 0.172284, "wall_seconds": 0.17218490701634437}}, "status": "FINITE_PASS", "wall_seconds": 1.3363573119859211} +PASS_GF2_SIDE_NATIVE_FINITE_SOURCE_CONTROLS +PASS_COMPLETE_CANONICAL_WITNESS_AND_RANK_TRANSPORT +PASS_MATRIX_PUBLICATION_FINITE_AND_FULL_ARTIFACT_TRANSPORT diff --git a/research/gf2-side-verification/evidence/publication/matrix-publication-finite/usage.json b/research/gf2-side-verification/evidence/publication/matrix-publication-finite/usage.json new file mode 100644 index 0000000000..c043c48387 --- /dev/null +++ b/research/gf2-side-verification/evidence/publication/matrix-publication-finite/usage.json @@ -0,0 +1 @@ +{"user_seconds":3.44,"system_seconds":0.10,"kernel_max_rss_kib":41020,"exit":0} diff --git a/research/gf2-side-verification/evidence/publication/matrix-readonly-finite-complete/receipt.json b/research/gf2-side-verification/evidence/publication/matrix-readonly-finite-complete/receipt.json new file mode 100644 index 0000000000..be3d2b02f4 --- /dev/null +++ b/research/gf2-side-verification/evidence/publication/matrix-readonly-finite-complete/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-readonly-finite-complete", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "322ed5768878fb66bd6253cc022cba299473c0600820474cb7431868e3f97bf4", + "sampled_process_group_rss_bytes": 424636416, + "script": "stages/matrix-readonly-v1/run.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "5a72424a1d69f9a3cd8b62f46be8cadca9c7de605590bef77339467ae5661f33", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 3161, + "stdout_sha256": "49bae19c4104f26eec6b9f7120b7ec95e2884b8fb622cec379134c4b493c6ca0", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 430176, + "system_seconds": 0.36, + "user_seconds": 26.3 + }, + "wall_seconds": 26.693505982024362 +} diff --git a/research/gf2-side-verification/evidence/publication/matrix-readonly-finite-complete/stderr.txt b/research/gf2-side-verification/evidence/publication/matrix-readonly-finite-complete/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/publication/matrix-readonly-finite-complete/stdout.txt b/research/gf2-side-verification/evidence/publication/matrix-readonly-finite-complete/stdout.txt new file mode 100644 index 0000000000..aae324aba9 --- /dev/null +++ b/research/gf2-side-verification/evidence/publication/matrix-readonly-finite-complete/stdout.txt @@ -0,0 +1,7 @@ +{"complement_trace": null, "complete_hashes": null, "controls": "FINITE_NATIVE_GF2_CONTROLS_PASS", "cpu_seconds_with_compiler": 1.5102539999999998, "mode": "finite", "phases": {"all_finite_independent_binding_fallback_controls": {"cpu_seconds_including_children": 1.0256919999999998, "wall_seconds": 1.0259871850139461}, "cold_compile_link_load": {"cpu_seconds_including_children": 0.18879899999999988, "wall_seconds": 0.18874615299864672}}, "status": "FINITE_PASS", "wall_seconds": 1.3397460819978733} +PASS_GF2_SIDE_NATIVE_FINITE_SOURCE_CONTROLS +{"complement_trace": null, "complete_hashes": null, "controls": "FINITE_NATIVE_GF2_CONTROLS_PASS", "cpu_seconds_with_compiler": 1.4935139999999998, "mode": "finite", "phases": {"all_finite_independent_binding_fallback_controls": {"cpu_seconds_including_children": 0.9995989999999999, "wall_seconds": 0.9999990419892129}, "cold_compile_link_load": {"cpu_seconds_including_children": 0.20396399999999998, "wall_seconds": 0.2038644109852612}}, "status": "FINITE_PASS", "wall_seconds": 1.3255621400021482} +PASS_GF2_SIDE_NATIVE_FINITE_SOURCE_CONTROLS +PASS_COMPLETE_CANONICAL_WITNESS_AND_RANK_TRANSPORT +{"complement_trace": {"calls": 238685, "canonical_stream_bytes": 55839507, "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838"}, "complete_hashes": {"exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", "rank_call_count": 59959, "rank_distinct_matrix_count": 252, "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c"}, "controls": "FINITE_NATIVE_GF2_CONTROLS_PASS", "cpu_seconds_with_compiler": 22.856462, "mode": "candidate", "phases": {"all_finite_independent_binding_fallback_controls": {"cpu_seconds_including_children": 1.001213, "wall_seconds": 1.0013483370130416}, "checks_initialization": {"cpu_seconds_including_children": 0.00010799999999999699, "wall_seconds": 0.00010732698137871921}, "cold_compile_link_load": {"cpu_seconds_including_children": 0.16705400000000004, "wall_seconds": 0.16702818300109357}, "cold_source_load_guard_bind": {"cpu_seconds_including_children": 0.01119200000000009, "wall_seconds": 0.01119119898066856}, "compile_roles": {"cpu_seconds_including_children": 0.3132410000000001, "wall_seconds": 0.3132857049931772}, "construction": {"cpu_seconds_including_children": 1.591022, "wall_seconds": 1.5912204239866696}, "same_complete_witness_trace_serialization": {"cpu_seconds_including_children": 1.022639999999999, "wall_seconds": 1.0232266809907742}, "verify_labels": {"cpu_seconds_including_children": 12.414832, "wall_seconds": 12.418379109003581}, "verify_map": {"cpu_seconds_including_children": 4.6750609999999995, "wall_seconds": 4.676511940982891}, "verify_role_frames": {"cpu_seconds_including_children": 0.9522639999999996, "wall_seconds": 0.9522661209921353}}, "status": "COMPLETE_SIDE_PASS", "wall_seconds": 22.725110497005517} +PASS_READONLY_GITFREE_MATRIX_FINITE_AND_COMPLETE_CANDIDATE diff --git a/research/gf2-side-verification/evidence/publication/matrix-readonly-finite-complete/usage.json b/research/gf2-side-verification/evidence/publication/matrix-readonly-finite-complete/usage.json new file mode 100644 index 0000000000..be136802a6 --- /dev/null +++ b/research/gf2-side-verification/evidence/publication/matrix-readonly-finite-complete/usage.json @@ -0,0 +1 @@ +{"user_seconds":26.30,"system_seconds":0.36,"kernel_max_rss_kib":430176,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-complete-B1/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-complete-B1/receipt.json new file mode 100644 index 0000000000..21b5658a65 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-complete-B1/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-complete-B1", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "bca8a42f85a7bc2fbac353240f8713bda4ace5fa9e20d19845d0613e56bbb43a", + "sampled_process_group_rss_bytes": 377716736, + "script": "stages/matrix-qualification-v1/run_B1.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "38234b0608d38b5a905017d9affab582a74af83cb9db75c007376bfec7957506", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1428, + "stdout_sha256": "7462b38144d6127eaeef7198c860f1a80afc7afa3375ca51160a83c709e72c8a", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 424164, + "system_seconds": 0.2, + "user_seconds": 29.13 + }, + "wall_seconds": 29.47890840700711 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-complete-B1/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-complete-B1/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-complete-B1/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-complete-B1/stdout.txt new file mode 100644 index 0000000000..de1f69332d --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-complete-B1/stdout.txt @@ -0,0 +1 @@ +{"complete_hashes": {"exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", "rank_call_count": 59959, "rank_distinct_matrix_count": 252, "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c"}, "controls": null, "cpu_seconds_with_compiler": 29.234706, "mode": "baseline", "phases": {"checks_initialization": {"cpu_seconds_including_children": 6.000000000017103e-05, "wall_seconds": 6.004399619996548e-05}, "cold_source_load_guard_bind": {"cpu_seconds_including_children": 0.019005999999999967, "wall_seconds": 0.019004978006705642}, "compile_roles": {"cpu_seconds_including_children": 0.3610430000000002, "wall_seconds": 0.36130081600276753}, "construction": {"cpu_seconds_including_children": 1.629732, "wall_seconds": 1.6302538639865816}, "same_complete_witness_trace_serialization": {"cpu_seconds_including_children": 1.084060000000001, "wall_seconds": 1.0868409180257004}, "verify_labels": {"cpu_seconds_including_children": 18.892245000000003, "wall_seconds": 18.923976498976117}, "verify_map": {"cpu_seconds_including_children": 5.116917000000001, "wall_seconds": 5.127579642983619}, "verify_role_frames": {"cpu_seconds_including_children": 1.4182019999999973, "wall_seconds": 1.4196603849995881}}, "status": "COMPLETE_SIDE_PASS", "wall_seconds": 29.136460099980468} diff --git a/research/gf2-side-verification/evidence/runs/matrix-complete-B1/usage.json b/research/gf2-side-verification/evidence/runs/matrix-complete-B1/usage.json new file mode 100644 index 0000000000..553c05dd58 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-complete-B1/usage.json @@ -0,0 +1 @@ +{"user_seconds":29.13,"system_seconds":0.20,"kernel_max_rss_kib":424164,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-finite-O-v1/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-finite-O-v1/receipt.json new file mode 100644 index 0000000000..1e798b207f --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-finite-O-v1/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-finite-O-v1", + "optimized": true, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "bca8a42f85a7bc2fbac353240f8713bda4ace5fa9e20d19845d0613e56bbb43a", + "sampled_process_group_rss_bytes": 61628416, + "script": "stages/matrix-qualification-v1/run_finite_O.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "38234b0608d38b5a905017d9affab582a74af83cb9db75c007376bfec7957506", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 466, + "stdout_sha256": "79a65d988801d0a2b6968c0e3c99085153e3754bff8838bf551470084442bfc4", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 40960, + "system_seconds": 0.04, + "user_seconds": 1.09 + }, + "wall_seconds": 1.1471193479956128 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-finite-O-v1/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-finite-O-v1/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-finite-O-v1/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-finite-O-v1/stdout.txt new file mode 100644 index 0000000000..a620adf0b9 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-finite-O-v1/stdout.txt @@ -0,0 +1 @@ +{"complete_hashes": null, "controls": "FINITE_NATIVE_GF2_CONTROLS_PASS", "cpu_seconds_with_compiler": 1.128312, "mode": "finite", "phases": {"all_finite_independent_binding_fallback_controls": {"cpu_seconds_including_children": 0.6427449999999998, "wall_seconds": 0.6428383190068416}, "cold_compile_link_load": {"cpu_seconds_including_children": 0.18048600000000004, "wall_seconds": 0.1805112379952334}}, "status": "FINITE_PASS", "wall_seconds": 0.9796719919831958} diff --git a/research/gf2-side-verification/evidence/runs/matrix-finite-O-v1/usage.json b/research/gf2-side-verification/evidence/runs/matrix-finite-O-v1/usage.json new file mode 100644 index 0000000000..a7b096b340 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-finite-O-v1/usage.json @@ -0,0 +1 @@ +{"user_seconds":1.09,"system_seconds":0.04,"kernel_max_rss_kib":40960,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-finite-v1/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-finite-v1/receipt.json new file mode 100644 index 0000000000..7d8c867ff6 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-finite-v1/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-finite-v1", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "bca8a42f85a7bc2fbac353240f8713bda4ace5fa9e20d19845d0613e56bbb43a", + "sampled_process_group_rss_bytes": 72380416, + "script": "stages/matrix-qualification-v1/run_finite.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "38234b0608d38b5a905017d9affab582a74af83cb9db75c007376bfec7957506", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 467, + "stdout_sha256": "1e8361f4fe486124ce251d5480280d11c4ed18fd9fbd055045daad4007d83cf8", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 40724, + "system_seconds": 0.04, + "user_seconds": 1.13 + }, + "wall_seconds": 1.2022827299952041 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-finite-v1/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-finite-v1/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-finite-v1/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-finite-v1/stdout.txt new file mode 100644 index 0000000000..b1d295ec9c --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-finite-v1/stdout.txt @@ -0,0 +1 @@ +{"complete_hashes": null, "controls": "FINITE_NATIVE_GF2_CONTROLS_PASS", "cpu_seconds_with_compiler": 1.166043, "mode": "finite", "phases": {"all_finite_independent_binding_fallback_controls": {"cpu_seconds_including_children": 0.6756389999999998, "wall_seconds": 0.6757610750210006}, "cold_compile_link_load": {"cpu_seconds_including_children": 0.20209200000000005, "wall_seconds": 0.20987035299185663}}, "status": "FINITE_PASS", "wall_seconds": 1.0337727539881598} diff --git a/research/gf2-side-verification/evidence/runs/matrix-finite-v1/usage.json b/research/gf2-side-verification/evidence/runs/matrix-finite-v1/usage.json new file mode 100644 index 0000000000..1f10211d13 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-finite-v1/usage.json @@ -0,0 +1 @@ +{"user_seconds":1.13,"system_seconds":0.04,"kernel_max_rss_kib":40724,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-profile-1/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-profile-1/receipt.json new file mode 100644 index 0000000000..02c28b6a58 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-profile-1/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-profile-1", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "5b0b7fcce4461dd513f29ae213ed7e6a7ece27065bfcecfdf2de739c7652b6c0", + "sampled_process_group_rss_bytes": 414490624, + "script": "stages/matrix-profile-v1/run_profile.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "154b19f2730943643813fdca6cea5b64461d035c51b805fd10c5285f29553ba8", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1315, + "stdout_sha256": "6b193258710eda53c07eefa479dcdb1bcdbecde9a4235d531b2289ba3bc14158", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 446972, + "system_seconds": 0.29, + "user_seconds": 76.89 + }, + "wall_seconds": 78.06534614201519 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-profile-1/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-profile-1/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-profile-1/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-profile-1/stdout.txt new file mode 100644 index 0000000000..f6c61bffac --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-profile-1/stdout.txt @@ -0,0 +1 @@ +{"cpu_seconds": 74.99698459999999, "exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", "h": 25, "rank_calls": 59959, "rank_distinct_matrices": 252, "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c", "status": "DIAGNOSTIC_COMPLETE_SIDE_SCOPE_ONLY", "targeted_functions": [{"cumulative_seconds": 41.830508911, "line": 232, "name": "complement_in", "primitive_calls": 238685, "self_seconds": 11.585129098000001, "total_calls": 238685}, {"cumulative_seconds": 15.997713481000002, "line": 202, "name": "dot", "primitive_calls": 42629900, "self_seconds": 10.352292097000001, "total_calls": 42629900}, {"cumulative_seconds": 8.772145292000001, "line": 228, "name": "nondegenerate", "primitive_calls": 59959, "self_seconds": 0.458151729, "total_calls": 59959}, {"cumulative_seconds": 2.0277389390000002, "line": 206, "name": "rank", "primitive_calls": 59959, "self_seconds": 1.226728991, "total_calls": 59959}, {"cumulative_seconds": 1.7201757530000001, "line": 196, "name": "reduce", "primitive_calls": 1374583, "self_seconds": 1.499383739, "total_calls": 1374583}, {"cumulative_seconds": 1.337128114, "line": 182, "name": "echelon", "primitive_calls": 85196, "self_seconds": 1.199187258, "total_calls": 85196}], "wall_seconds": 75.83844015499926} diff --git a/research/gf2-side-verification/evidence/runs/matrix-profile-1/usage.json b/research/gf2-side-verification/evidence/runs/matrix-profile-1/usage.json new file mode 100644 index 0000000000..335cf34917 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-profile-1/usage.json @@ -0,0 +1 @@ +{"user_seconds":76.89,"system_seconds":0.29,"kernel_max_rss_kib":446972,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-anchor/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-v2-anchor/receipt.json new file mode 100644 index 0000000000..eb1114c9b1 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-anchor/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-v2-anchor", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "ecc6e9d05ec96717b9fb37d723336d70caf0a28a14dd17f7c3e7a0d188d51b9d", + "sampled_process_group_rss_bytes": 384454656, + "script": "stages/matrix-anchor-v2/run_anchor.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "c75bb62a0771b176dfc4869b9494767ecfde17da864186af659bb6f2191aed27", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1681, + "stdout_sha256": "2b2314aa11a97a1129b572a3dbd847733c6f9d7c5f1d4009d1f7a307502f9cee", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 429672, + "system_seconds": 0.23, + "user_seconds": 35.68 + }, + "wall_seconds": 36.136785055015935 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-anchor/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-anchor/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-anchor/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-anchor/stdout.txt new file mode 100644 index 0000000000..e46f4436a8 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-anchor/stdout.txt @@ -0,0 +1 @@ +{"complement_trace": {"calls": 238685, "canonical_stream_bytes": 55839507, "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838"}, "complete_hashes": {"exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", "rank_call_count": 59959, "rank_distinct_matrix_count": 252, "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c"}, "controls": null, "cpu_seconds_with_compiler": 35.795717, "mode": "baseline", "phases": {"checks_initialization": {"cpu_seconds_including_children": 6.300000000036832e-05, "wall_seconds": 6.284000119194388e-05}, "cold_source_load_guard_bind": {"cpu_seconds_including_children": 0.019830000000000014, "wall_seconds": 0.019828849006444216}, "compile_roles": {"cpu_seconds_including_children": 0.3766470000000002, "wall_seconds": 0.3766869060054887}, "construction": {"cpu_seconds_including_children": 1.7136879999999999, "wall_seconds": 1.7138633870054036}, "same_complete_witness_trace_serialization": {"cpu_seconds_including_children": 1.0552819999999983, "wall_seconds": 1.05667901301058}, "verify_labels": {"cpu_seconds_including_children": 25.005594000000002, "wall_seconds": 25.193313104013214}, "verify_map": {"cpu_seconds_including_children": 5.373737, "wall_seconds": 5.376434844976757}, "verify_role_frames": {"cpu_seconds_including_children": 1.5150259999999989, "wall_seconds": 1.515806892013643}}, "status": "COMPLETE_SIDE_PASS", "wall_seconds": 35.857453499978874} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-anchor/usage.json b/research/gf2-side-verification/evidence/runs/matrix-v2-anchor/usage.json new file mode 100644 index 0000000000..738c181c94 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-anchor/usage.json @@ -0,0 +1 @@ +{"user_seconds":35.68,"system_seconds":0.23,"kernel_max_rss_kib":429672,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B1/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B1/receipt.json new file mode 100644 index 0000000000..53eaef9f59 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B1/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-v2-complete-B1", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "e5186be525006b186b131431b3d742ff35405c569880e6bfd95833ac49ffee50", + "sampled_process_group_rss_bytes": 383201280, + "script": "stages/matrix-qualification-v2/run_B1.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "7c0409b758511d5ead69f59dc3f63bd979db03db3923831aec1ea653360f0514", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1674, + "stdout_sha256": "0dba4766b0968d619fb28e9ed336360463b9fb0c045f4014fa5db05dd69b101e", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 429520, + "system_seconds": 0.23, + "user_seconds": 34.84 + }, + "wall_seconds": 35.17702062198077 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B1/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B1/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B1/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B1/stdout.txt new file mode 100644 index 0000000000..241188d7dc --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B1/stdout.txt @@ -0,0 +1 @@ +{"complement_trace": {"calls": 238685, "canonical_stream_bytes": 55839507, "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838"}, "complete_hashes": {"exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", "rank_call_count": 59959, "rank_distinct_matrix_count": 252, "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c"}, "controls": null, "cpu_seconds_with_compiler": 34.966088, "mode": "baseline", "phases": {"checks_initialization": {"cpu_seconds_including_children": 5.999999999994898e-05, "wall_seconds": 5.963401054032147e-05}, "cold_source_load_guard_bind": {"cpu_seconds_including_children": 0.019816999999999974, "wall_seconds": 0.019816012994851917}, "compile_roles": {"cpu_seconds_including_children": 0.3623130000000001, "wall_seconds": 0.36240896000526845}, "construction": {"cpu_seconds_including_children": 1.6442160000000001, "wall_seconds": 1.644305074994918}, "same_complete_witness_trace_serialization": {"cpu_seconds_including_children": 1.0896370000000033, "wall_seconds": 1.092581083998084}, "verify_labels": {"cpu_seconds_including_children": 24.455796, "wall_seconds": 24.465771699004108}, "verify_map": {"cpu_seconds_including_children": 5.124392, "wall_seconds": 5.126138591993367}, "verify_role_frames": {"cpu_seconds_including_children": 1.5558680000000003, "wall_seconds": 1.5562180209963117}}, "status": "COMPLETE_SIDE_PASS", "wall_seconds": 34.841609198978404} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B1/usage.json b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B1/usage.json new file mode 100644 index 0000000000..a16f22613b --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B1/usage.json @@ -0,0 +1 @@ +{"user_seconds":34.84,"system_seconds":0.23,"kernel_max_rss_kib":429520,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B2/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B2/receipt.json new file mode 100644 index 0000000000..afdad484ef --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B2/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-v2-complete-B2", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "e5186be525006b186b131431b3d742ff35405c569880e6bfd95833ac49ffee50", + "sampled_process_group_rss_bytes": 403849216, + "script": "stages/matrix-qualification-v2/run_B2.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "7c0409b758511d5ead69f59dc3f63bd979db03db3923831aec1ea653360f0514", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1668, + "stdout_sha256": "c69ffe4a17f07b338518122e5b5a4f9546e5c33a17659d35af66b78497e605fb", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 429668, + "system_seconds": 0.24, + "user_seconds": 33.73 + }, + "wall_seconds": 34.0615607459913 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B2/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B2/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B2/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B2/stdout.txt new file mode 100644 index 0000000000..5552992e44 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B2/stdout.txt @@ -0,0 +1 @@ +{"complement_trace": {"calls": 238685, "canonical_stream_bytes": 55839507, "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838"}, "complete_hashes": {"exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", "rank_call_count": 59959, "rank_distinct_matrix_count": 252, "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c"}, "controls": null, "cpu_seconds_with_compiler": 33.863431, "mode": "baseline", "phases": {"checks_initialization": {"cpu_seconds_including_children": 5.999999999994898e-05, "wall_seconds": 6.011399091221392e-05}, "cold_source_load_guard_bind": {"cpu_seconds_including_children": 0.024173, "wall_seconds": 0.02417061899905093}, "compile_roles": {"cpu_seconds_including_children": 0.3510200000000001, "wall_seconds": 0.3510973629890941}, "construction": {"cpu_seconds_including_children": 1.651359, "wall_seconds": 1.65242633401067}, "same_complete_witness_trace_serialization": {"cpu_seconds_including_children": 1.0699410000000071, "wall_seconds": 1.0717631149746012}, "verify_labels": {"cpu_seconds_including_children": 23.525641999999998, "wall_seconds": 23.554776420991402}, "verify_map": {"cpu_seconds_including_children": 4.972300000000001, "wall_seconds": 4.973463397007436}, "verify_role_frames": {"cpu_seconds_including_children": 1.5610219999999977, "wall_seconds": 1.5638749210047536}}, "status": "COMPLETE_SIDE_PASS", "wall_seconds": 33.758580699999584} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B2/usage.json b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B2/usage.json new file mode 100644 index 0000000000..8492f1032a --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B2/usage.json @@ -0,0 +1 @@ +{"user_seconds":33.73,"system_seconds":0.24,"kernel_max_rss_kib":429668,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B3/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B3/receipt.json new file mode 100644 index 0000000000..3b9dbc13db --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B3/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-v2-complete-B3", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "e5186be525006b186b131431b3d742ff35405c569880e6bfd95833ac49ffee50", + "sampled_process_group_rss_bytes": 383242240, + "script": "stages/matrix-qualification-v2/run_B3.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "7c0409b758511d5ead69f59dc3f63bd979db03db3923831aec1ea653360f0514", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1658, + "stdout_sha256": "3246e3e31c4466799393d998f4bc957e96bba8795208fc0998a7d5b0e1b340e6", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 429528, + "system_seconds": 0.21, + "user_seconds": 34.8 + }, + "wall_seconds": 35.07554105800227 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B3/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B3/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B3/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B3/stdout.txt new file mode 100644 index 0000000000..e54c97c013 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B3/stdout.txt @@ -0,0 +1 @@ +{"complement_trace": {"calls": 238685, "canonical_stream_bytes": 55839507, "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838"}, "complete_hashes": {"exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", "rank_call_count": 59959, "rank_distinct_matrix_count": 252, "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c"}, "controls": null, "cpu_seconds_with_compiler": 34.911673, "mode": "baseline", "phases": {"checks_initialization": {"cpu_seconds_including_children": 6.200000000022854e-05, "wall_seconds": 6.159598706290126e-05}, "cold_source_load_guard_bind": {"cpu_seconds_including_children": 0.01997500000000002, "wall_seconds": 0.0199721860117279}, "compile_roles": {"cpu_seconds_including_children": 0.3713630000000001, "wall_seconds": 0.3714567669958342}, "construction": {"cpu_seconds_including_children": 1.640095, "wall_seconds": 1.6403012970113195}, "same_complete_witness_trace_serialization": {"cpu_seconds_including_children": 1.086162999999999, "wall_seconds": 1.0891685120004695}, "verify_labels": {"cpu_seconds_including_children": 24.431302, "wall_seconds": 24.476630095014116}, "verify_map": {"cpu_seconds_including_children": 5.006442, "wall_seconds": 5.00855585798854}, "verify_role_frames": {"cpu_seconds_including_children": 1.6273419999999987, "wall_seconds": 1.628750341013074}}, "status": "COMPLETE_SIDE_PASS", "wall_seconds": 34.82705215201713} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B3/usage.json b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B3/usage.json new file mode 100644 index 0000000000..1f0fc5628d --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-B3/usage.json @@ -0,0 +1 @@ +{"user_seconds":34.80,"system_seconds":0.21,"kernel_max_rss_kib":429528,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C1/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C1/receipt.json new file mode 100644 index 0000000000..9ffa6b29be --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C1/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-v2-complete-C1", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "e5186be525006b186b131431b3d742ff35405c569880e6bfd95833ac49ffee50", + "sampled_process_group_rss_bytes": 402239488, + "script": "stages/matrix-qualification-v2/run_C1.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "7c0409b758511d5ead69f59dc3f63bd979db03db3923831aec1ea653360f0514", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1988, + "stdout_sha256": "8fefb084e2eaae4c0980ffa85b5232f481d407c60d51eb0fa38855d87e934619", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 430016, + "system_seconds": 0.25, + "user_seconds": 24.52 + }, + "wall_seconds": 24.85352278899518 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C1/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C1/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C1/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C1/stdout.txt new file mode 100644 index 0000000000..4ca4354cb4 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C1/stdout.txt @@ -0,0 +1 @@ +{"complement_trace": {"calls": 238685, "canonical_stream_bytes": 55839507, "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838"}, "complete_hashes": {"exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", "rank_call_count": 59959, "rank_distinct_matrix_count": 252, "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c"}, "controls": "FINITE_NATIVE_GF2_CONTROLS_PASS", "cpu_seconds_with_compiler": 24.651076, "mode": "candidate", "phases": {"all_finite_independent_binding_fallback_controls": {"cpu_seconds_including_children": 1.1727319999999999, "wall_seconds": 1.1728168460249435}, "checks_initialization": {"cpu_seconds_including_children": 6.299999999992423e-05, "wall_seconds": 6.351998308673501e-05}, "cold_compile_link_load": {"cpu_seconds_including_children": 0.19227899999999998, "wall_seconds": 0.19211230901419185}, "cold_source_load_guard_bind": {"cpu_seconds_including_children": 0.016005000000000047, "wall_seconds": 0.016002263000700623}, "compile_roles": {"cpu_seconds_including_children": 0.35738400000000015, "wall_seconds": 0.3575979949964676}, "construction": {"cpu_seconds_including_children": 1.6916020000000003, "wall_seconds": 1.6922254489909392}, "same_complete_witness_trace_serialization": {"cpu_seconds_including_children": 1.0936749999999975, "wall_seconds": 1.0953993599978276}, "verify_labels": {"cpu_seconds_including_children": 13.155743000000001, "wall_seconds": 13.169879032007884}, "verify_map": {"cpu_seconds_including_children": 5.241856000000002, "wall_seconds": 5.271870495984331}, "verify_role_frames": {"cpu_seconds_including_children": 0.9926220000000008, "wall_seconds": 0.9930327390029561}}, "status": "COMPLETE_SIDE_PASS", "wall_seconds": 24.555542759015225} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C1/usage.json b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C1/usage.json new file mode 100644 index 0000000000..4d1485fe92 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C1/usage.json @@ -0,0 +1 @@ +{"user_seconds":24.52,"system_seconds":0.25,"kernel_max_rss_kib":430016,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C2/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C2/receipt.json new file mode 100644 index 0000000000..56f5b1c725 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C2/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-v2-complete-C2", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "e5186be525006b186b131431b3d742ff35405c569880e6bfd95833ac49ffee50", + "sampled_process_group_rss_bytes": 384057344, + "script": "stages/matrix-qualification-v2/run_C2.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "7c0409b758511d5ead69f59dc3f63bd979db03db3923831aec1ea653360f0514", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1993, + "stdout_sha256": "01f0fb04084ae2a4dd33d21ba530453865b0b57bd4ce110279bc8e4aaa5d5c7b", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 430324, + "system_seconds": 0.25, + "user_seconds": 24.51 + }, + "wall_seconds": 24.807329344999744 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C2/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C2/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C2/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C2/stdout.txt new file mode 100644 index 0000000000..9640221b34 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C2/stdout.txt @@ -0,0 +1 @@ +{"complement_trace": {"calls": 238685, "canonical_stream_bytes": 55839507, "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838"}, "complete_hashes": {"exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", "rank_call_count": 59959, "rank_distinct_matrix_count": 252, "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c"}, "controls": "FINITE_NATIVE_GF2_CONTROLS_PASS", "cpu_seconds_with_compiler": 24.655914999999997, "mode": "candidate", "phases": {"all_finite_independent_binding_fallback_controls": {"cpu_seconds_including_children": 1.1028819999999997, "wall_seconds": 1.1030606599815655}, "checks_initialization": {"cpu_seconds_including_children": 9.000000000014552e-05, "wall_seconds": 8.936499943956733e-05}, "cold_compile_link_load": {"cpu_seconds_including_children": 0.19693500000000003, "wall_seconds": 0.19688948901602998}, "cold_source_load_guard_bind": {"cpu_seconds_including_children": 0.014989999999999837, "wall_seconds": 0.015003323002019897}, "compile_roles": {"cpu_seconds_including_children": 0.3342450000000001, "wall_seconds": 0.3344006109982729}, "construction": {"cpu_seconds_including_children": 1.7173869999999998, "wall_seconds": 1.7179188650043216}, "same_complete_witness_trace_serialization": {"cpu_seconds_including_children": 1.0824269999999991, "wall_seconds": 1.0843385549960658}, "verify_labels": {"cpu_seconds_including_children": 13.436663999999999, "wall_seconds": 13.45439318800345}, "verify_map": {"cpu_seconds_including_children": 5.028192000000001, "wall_seconds": 5.03588097501779}, "verify_role_frames": {"cpu_seconds_including_children": 1.0107660000000038, "wall_seconds": 1.0108844279893674}}, "status": "COMPLETE_SIDE_PASS", "wall_seconds": 24.54664336401038} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C2/usage.json b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C2/usage.json new file mode 100644 index 0000000000..0461e6913e --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C2/usage.json @@ -0,0 +1 @@ +{"user_seconds":24.51,"system_seconds":0.25,"kernel_max_rss_kib":430324,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C3/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C3/receipt.json new file mode 100644 index 0000000000..324dc80f99 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C3/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-v2-complete-C3", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "e5186be525006b186b131431b3d742ff35405c569880e6bfd95833ac49ffee50", + "sampled_process_group_rss_bytes": 384073728, + "script": "stages/matrix-qualification-v2/run_C3.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "7c0409b758511d5ead69f59dc3f63bd979db03db3923831aec1ea653360f0514", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1987, + "stdout_sha256": "7d1925c5763e60dd86b972f3bf6574623e715ad731e0ee5311c30278642e645d", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 430360, + "system_seconds": 0.26, + "user_seconds": 24.25 + }, + "wall_seconds": 24.61743560800096 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C3/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C3/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C3/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C3/stdout.txt new file mode 100644 index 0000000000..a5263324f7 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C3/stdout.txt @@ -0,0 +1 @@ +{"complement_trace": {"calls": 238685, "canonical_stream_bytes": 55839507, "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors", "sha256": "7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838"}, "complete_hashes": {"exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", "rank_call_count": 59959, "rank_distinct_matrix_count": 252, "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c"}, "controls": "FINITE_NATIVE_GF2_CONTROLS_PASS", "cpu_seconds_with_compiler": 24.400893999999997, "mode": "candidate", "phases": {"all_finite_independent_binding_fallback_controls": {"cpu_seconds_including_children": 1.0829659999999997, "wall_seconds": 1.0830194080190267}, "checks_initialization": {"cpu_seconds_including_children": 6.800000000017903e-05, "wall_seconds": 6.744600250385702e-05}, "cold_compile_link_load": {"cpu_seconds_including_children": 0.17880399999999996, "wall_seconds": 0.17988828200032003}, "cold_source_load_guard_bind": {"cpu_seconds_including_children": 0.013246999999999787, "wall_seconds": 0.013244048022897914}, "compile_roles": {"cpu_seconds_including_children": 0.349726, "wall_seconds": 0.35019330997602083}, "construction": {"cpu_seconds_including_children": 1.6870770000000004, "wall_seconds": 1.6872132970020175}, "same_complete_witness_trace_serialization": {"cpu_seconds_including_children": 1.0882969999999972, "wall_seconds": 1.0888235789898317}, "verify_labels": {"cpu_seconds_including_children": 13.253531000000002, "wall_seconds": 13.256456922012148}, "verify_map": {"cpu_seconds_including_children": 4.949355999999999, "wall_seconds": 4.951173745008418}, "verify_role_frames": {"cpu_seconds_including_children": 1.0338250000000002, "wall_seconds": 1.0343899079889525}}, "status": "COMPLETE_SIDE_PASS", "wall_seconds": 24.265411901986226} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C3/usage.json b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C3/usage.json new file mode 100644 index 0000000000..1de2168b98 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-complete-C3/usage.json @@ -0,0 +1 @@ +{"user_seconds":24.25,"system_seconds":0.26,"kernel_max_rss_kib":430360,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-finite/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-v2-finite/receipt.json new file mode 100644 index 0000000000..1d7b981f41 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-finite/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-v2-finite", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "ecc6e9d05ec96717b9fb37d723336d70caf0a28a14dd17f7c3e7a0d188d51b9d", + "sampled_process_group_rss_bytes": 60764160, + "script": "stages/matrix-anchor-v2/run_finite.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "c75bb62a0771b176dfc4869b9494767ecfde17da864186af659bb6f2191aed27", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 501, + "stdout_sha256": "9f7d5f241fd64eaec107e1d51a234c524c9b176805606f91d9e975b2f27c5368", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 40784, + "system_seconds": 0.03, + "user_seconds": 1.58 + }, + "wall_seconds": 1.6907252260134555 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-finite/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-finite/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-finite/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-finite/stdout.txt new file mode 100644 index 0000000000..02b68122ce --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-finite/stdout.txt @@ -0,0 +1 @@ +{"complement_trace": null, "complete_hashes": null, "controls": "FINITE_NATIVE_GF2_CONTROLS_PASS", "cpu_seconds_with_compiler": 1.6113699999999997, "mode": "finite", "phases": {"all_finite_independent_binding_fallback_controls": {"cpu_seconds_including_children": 1.1082770000000002, "wall_seconds": 1.108601727988571}, "cold_compile_link_load": {"cpu_seconds_including_children": 0.19273600000000002, "wall_seconds": 0.19265605101827532}}, "status": "FINITE_PASS", "wall_seconds": 1.464233073987998} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-finite/usage.json b/research/gf2-side-verification/evidence/runs/matrix-v2-finite/usage.json new file mode 100644 index 0000000000..8228df2b6a --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-finite/usage.json @@ -0,0 +1 @@ +{"user_seconds":1.58,"system_seconds":0.03,"kernel_max_rss_kib":40784,"exit":0} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-finite_O/receipt.json b/research/gf2-side-verification/evidence/runs/matrix-v2-finite_O/receipt.json new file mode 100644 index 0000000000..c368f905c4 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-finite_O/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "matrix-v2-finite_O", + "optimized": true, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "7540f8cc4ae4d12ed86c844ef0837a74184d3ada653979608c295c09f200a751", + "runtime_policy_sha256": "ecc6e9d05ec96717b9fb37d723336d70caf0a28a14dd17f7c3e7a0d188d51b9d", + "sampled_process_group_rss_bytes": 62521344, + "script": "stages/matrix-anchor-v2/run_finite_O.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "c75bb62a0771b176dfc4869b9494767ecfde17da864186af659bb6f2191aed27", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 481, + "stdout_sha256": "3cd1c3b5ae469fd527f39f7d2669cb03e29ff9b5077010a3d37b9dbba3b82937", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 40888, + "system_seconds": 0.03, + "user_seconds": 1.57 + }, + "wall_seconds": 1.635278328001732 +} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-finite_O/stderr.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-finite_O/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-finite_O/stdout.txt b/research/gf2-side-verification/evidence/runs/matrix-v2-finite_O/stdout.txt new file mode 100644 index 0000000000..41be01d908 --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-finite_O/stdout.txt @@ -0,0 +1 @@ +{"complement_trace": null, "complete_hashes": null, "controls": "FINITE_NATIVE_GF2_CONTROLS_PASS", "cpu_seconds_with_compiler": 1.60549, "mode": "finite", "phases": {"all_finite_independent_binding_fallback_controls": {"cpu_seconds_including_children": 1.107308, "wall_seconds": 1.110673424002016}, "cold_compile_link_load": {"cpu_seconds_including_children": 0.18729499999999993, "wall_seconds": 0.18723529801354744}}, "status": "FINITE_PASS", "wall_seconds": 1.4666977040178608} diff --git a/research/gf2-side-verification/evidence/runs/matrix-v2-finite_O/usage.json b/research/gf2-side-verification/evidence/runs/matrix-v2-finite_O/usage.json new file mode 100644 index 0000000000..b434bbe0ff --- /dev/null +++ b/research/gf2-side-verification/evidence/runs/matrix-v2-finite_O/usage.json @@ -0,0 +1 @@ +{"user_seconds":1.57,"system_seconds":0.03,"kernel_max_rss_kib":40888,"exit":0} diff --git a/research/gf2-side-verification/evidence/v1-drafts/compare_side_verifier.py.txt b/research/gf2-side-verification/evidence/v1-drafts/compare_side_verifier.py.txt new file mode 100644 index 0000000000..29722ec2f5 --- /dev/null +++ b/research/gf2-side-verification/evidence/v1-drafts/compare_side_verifier.py.txt @@ -0,0 +1,178 @@ +#!/usr/bin/env python3 +"""One cold finite or complete side-verification run, under the parent's guard. + +The baseline and candidate serialize identical complete result, structural/ +label/role witness, and rank transcript artifacts. Candidate additionally pays +all C compilation/link/load and independent finite/binding/fallback controls. +No profile or warm-build reuse; no orchestration, retry, search or parallelism. +""" +from __future__ import annotations + +import time +START_WALL = time.perf_counter() +import argparse +import hashlib +import json +from pathlib import Path +import resource +import sys + +sys.dont_write_bytecode = True +from native_backend import (ROOT, SOURCE_SHA256, CALLER_SHA256, attach_trace, + bind, build_native, guard_module, load_source, require) +from finite_controls import run_controls +from profile_side_verifier import canonical, source_check + +EXPECTED = { + "result_sha256": "342e99212b12e518902ae9598613f5484113bacee8747c27a13b58a4b1d3986c", + "exact_witness_sha256": "4b170c1dbfc33c7cb141a2284c6fd69eac7b6d100971d3e9ee625502b5893f82", + "rank_trace_sha256": "85006ca332bbc57c2ba9fd06f61a0281d4cee600c9f3b449342379bf2aedec8f", + "rank_call_count": 59959, + "rank_distinct_matrix_count": 252, +} + + +def cpu_seconds(): + own = resource.getrusage(resource.RUSAGE_SELF) + children = resource.getrusage(resource.RUSAGE_CHILDREN) + return own.ru_utime + own.ru_stime + children.ru_utime + children.ru_stime + + +def scientific_run(module, phases): + def phase(name, action): + wall, cpu = time.perf_counter(), cpu_seconds() + answer = action() + phases[name] = {"wall_seconds": time.perf_counter() - wall, + "cpu_seconds_including_children": cpu_seconds() - cpu} + return answer + + c = phase("construction", lambda: module.ComplexSideCircuit(25)) + checks = phase("checks_initialization", lambda: module.Checks(c)) + code = phase("compile_roles", lambda: module.compile_roles(c)) + side_map = phase("verify_map", checks.verify_map) + labels = phase("verify_labels", checks.verify_labels) + roles = phase("verify_role_frames", lambda: module.verify_role_frames(c, checks, code)) + result = {"circuit": c.stats(), "side_map": side_map, "labels": labels, "role_frames": roles} + # This exactly matches profile_side_verifier.py's predeclared witness + # representation. Preserve basis and code dict insertion order as lists. + witness = { + "support": c.support, + "args": c.args, + "kind": c.kind, + "active": sorted(c.active), + "pieces": [(target, node, (coefficient.numerator, coefficient.denominator)) + for target, node, coefficient in c.pieces], + "labels": [(key, list(label.basis.items()), label.dim, label.key) + for key, label in checks.cache.items()], + "code": {"roles": code["roles"], "gates": code["gates"], + "sources": list(code["sources"].items()), + "outputs": list(code["outputs"].items())}, + } + return result, witness + + +def write_scientific(output, result, witness, rank_calls): + encoded_result = canonical(result) + encoded_witness = canonical(witness) + encoded_trace = canonical(rank_calls) + receipt = { + "result_sha256": hashlib.sha256(encoded_result).hexdigest(), + "exact_witness_sha256": hashlib.sha256(encoded_witness).hexdigest(), + "rank_trace_sha256": hashlib.sha256(encoded_trace).hexdigest(), + "rank_call_count": len(rank_calls), + "rank_distinct_matrix_count": len({rows for rows, _ in rank_calls}), + } + require(receipt == EXPECTED, "Complete output, ordered witness, or rank trace changed from the frozen profile") + # Same exact bytes and serialization work in both arms; file hashes omit + # a trailing newline exactly as the existing profile's digest did. + (output / "result.json").write_bytes(encoded_result) + (output / "witness.json").write_bytes(encoded_witness) + (output / "rank-trace.json").write_bytes(encoded_trace) + receipt["serialized_bytes"] = {"result": len(encoded_result), "witness": len(encoded_witness), + "rank_trace": len(encoded_trace)} + return receipt + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--mode", choices=("finite", "baseline", "candidate"), required=True) + parser.add_argument("--output", type=Path, required=True) + args = parser.parse_args() + require(not args.output.exists(), "Refusing to overwrite earlier run evidence") + args.output.mkdir(parents=True) + require(source_check() == 25, "Frozen H changed") + if args.mode != "finite": + require(sys.flags.optimize == 0, "Complete measurements require all unchanged source assertions") + phases = {} + controls = None + native = None + build = None + if args.mode in ("finite", "candidate"): + wall, cpu = time.perf_counter(), cpu_seconds() + native, build = build_native(args.output / "cold-build") + phases["cold_compile_link_load"] = {"wall_seconds": time.perf_counter() - wall, + "cpu_seconds_including_children": cpu_seconds() - cpu} + wall, cpu = time.perf_counter(), cpu_seconds() + controls = run_controls(native) + phases["all_finite_independent_binding_fallback_controls"] = { + "wall_seconds": time.perf_counter() - wall, + "cpu_seconds_including_children": cpu_seconds() - cpu, + } + (args.output / "finite-controls.json").write_text(json.dumps(controls, indent=2, sort_keys=True) + "\n") + complete = None + binding = None + if args.mode != "finite": + rank_calls = [] + wall, cpu = time.perf_counter(), cpu_seconds() + module = load_source("_matrix_complete_" + args.mode) + if args.mode == "candidate": + binding = bind(module, native, rank_calls) + else: + guard_module(module) + attach_trace(module, rank_calls) + phases["cold_source_load_guard_bind"] = {"wall_seconds": time.perf_counter() - wall, + "cpu_seconds_including_children": cpu_seconds() - cpu} + result, witness = scientific_run(module, phases) + wall, cpu = time.perf_counter(), cpu_seconds() + complete = write_scientific(args.output, result, witness, rank_calls) + phases["same_complete_witness_trace_serialization"] = { + "wall_seconds": time.perf_counter() - wall, + "cpu_seconds_including_children": cpu_seconds() - cpu, + } + complete["result"] = result + if binding is not None: + expected_calls = {"complement_native": 238685, "complement_fallback": 0, + "gram_native": 59959, "gram_fallback": 0} + require(binding["counters"] == expected_calls, "Frozen complete native call coverage changed") + complete["native_calls"] = dict(binding["counters"]) + source_files = ("native_gf2.c", "native_backend.py", "finite_controls.py", + "compare_side_verifier.py", "profile_side_verifier.py") + sources = {name: hashlib.sha256((ROOT / name).read_bytes()).hexdigest() for name in source_files} + receipt = { + "status": "FINITE_PASS" if args.mode == "finite" else "COMPLETE_SIDE_PASS", + "mode": args.mode, + "base_main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "frozen_sources": {"complex_circuit.py": SOURCE_SHA256, "complex_network.py": CALLER_SHA256}, + "engineering_sources": sources, + "complete": complete, + "controls": controls, + "build": build, + "phases": phases, + "measured_wall_seconds_before_receipt_write": time.perf_counter() - START_WALL, + "process_plus_compiler_cpu_seconds_before_receipt_write": cpu_seconds(), + "environment": {"python": sys.version, "executable": sys.executable, + "platform": sys.platform, "optimization": sys.flags.optimize}, + "measurement_scope": "Cold entire process; parent guard outer wall/CPU is authoritative. Both arms write identical complete witness bytes. Candidate additionally compiles, links, loads and runs every finite/native/binding control.", + "scientific_scope": "Frozen H=25 complex side verification only; no full network certificate, selected frontier, PR5864 gain, new construction, parameter search or kappa admission.", + } + (args.output / "receipt.json").write_text(json.dumps(receipt, indent=2, sort_keys=True) + "\n") + print(json.dumps({"status": receipt["status"], "mode": args.mode, + "wall_seconds": receipt["measured_wall_seconds_before_receipt_write"], + "cpu_seconds_with_compiler": receipt["process_plus_compiler_cpu_seconds_before_receipt_write"], + "complete_hashes": None if complete is None else {key: complete[key] for key in EXPECTED}, + "controls": None if controls is None else controls["status"], + "phases": phases}, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/gf2-side-verification/evidence/v1-drafts/finite_controls.py.txt b/research/gf2-side-verification/evidence/v1-drafts/finite_controls.py.txt new file mode 100644 index 0000000000..aa6903e548 --- /dev/null +++ b/research/gf2-side-verification/evidence/v1-drafts/finite_controls.py.txt @@ -0,0 +1,290 @@ +"""Finite independent qualification for the bounded packed GF(2) backend. + +The source oracle is a fresh unchanged module. The second oracle uses dense +0/1 lists and addition modulo two; it never calls the native extension or the +source's packed rank, dot, echelon, reduce, or complement routines. +""" +from __future__ import annotations + +from collections import UserDict +import hashlib +from itertools import permutations, product +import json +import time + +from native_backend import bind, guard_module, load_source, require + + +def dense_rank(rows, width): + work = [list(row) for row in rows] + require(all(len(row) == width and all(x in (0, 1) for x in row) for row in work), + "Independent oracle requires dense binary rows") + rank = 0 + for column in range(width - 1, -1, -1): + pivot = next((i for i in range(rank, len(work)) if work[i][column]), None) + if pivot is None: + continue + work[rank], work[pivot] = work[pivot], work[rank] + for i in range(rank + 1, len(work)): + if work[i][column]: + work[i] = [(a + b) % 2 for a, b in zip(work[i], work[rank])] + rank += 1 + return rank + + +def dense_vectors(vectors, width): + return [[(value // (2 ** column)) % 2 for column in range(width)] for value in vectors] + + +def pairing_rows(left, right, width): + left_dense = dense_vectors(left, width) + right_dense = dense_vectors(right, width) + return [[sum(a * b for a, b in zip(x, y)) % 2 for y in right_dense] for x in left_dense] + + +def independent_complement(small, big, out): + width = max((x.bit_length() for x in small + big + out), default=0) + big_dense = dense_vectors(big, width) + out_dense = dense_vectors(out, width) + big_rank = dense_rank(big_dense, width) + pairing = pairing_rows(big, small, width) + pairing_rank = dense_rank(pairing, len(small)) + require(all(value == 0 for row in pairing_rows(out, small, width) for value in row), + "Independent oracle found a nonorthogonal complement vector") + require(dense_rank(big_dense + out_dense, width) == big_rank, + "Independent oracle found a complement vector outside the ambient span") + require(len(out) == len(big) - pairing_rank, + "Independent oracle found a wrong number of coefficient-kernel vectors") + require(dense_rank(out_dense, width) == big_rank - pairing_rank, + "Independent oracle found an incomplete complement span") + + +def raw(label, rows, factory=dict): + obj = object.__new__(label) + obj.basis = factory((i, value) for i, value in enumerate(rows)) + return obj + + +def exact_list(actual, expected): + require(type(actual) is list and type(expected) is list, "Complement output is not an exact list") + require(all(type(value) is int for value in actual), "Complement output contains a non-int") + require(actual == expected, "Ordered complement vectors differ from the unchanged source") + + +def capture(action): + try: + value = action() + except Exception as error: + return ("error", type(error).__name__, str(error)) + return ("value", type(value).__name__, value) + + +class IntSubclass(int): + pass + + +class DictSubclass(dict): + pass + + +class ValuesOnly: + def __init__(self, pairs): + self.rows = tuple(value for _, value in pairs) + + def values(self): + return iter(self.rows) + + +class BrokenValues: + def __init__(self, pairs): + self.rows = tuple(value for _, value in pairs) + + def values(self): + def iterator(): + yield from self.rows[:1] + raise ValueError("frozen broken values iterator") + return iterator() + + +def run_controls(native): + oracle = load_source("_matrix_finite_unchanged_oracle") + candidate = load_source("_matrix_finite_candidate") + guard_module(oracle) + state = bind(candidate, native) + counts = {"ordered_complements": 0, "gram_cases": 0, "fallback_cases": 0, + "boundary_cases": 0, "real_label_permutations": 0, "binding_rejections": 0, + "oracle_negative_controls": 0} + transcript = hashlib.sha256() + + def record(tag, *values): + transcript.update(json.dumps((tag, values), separators=(",", ":"), sort_keys=True).encode("ascii") + b"\n") + + def complement_case(small, big): + reference = oracle.Label.complement_in(raw(oracle.Label, small), raw(oracle.Label, big)) + actual = candidate.Label.complement_in(raw(candidate.Label, small), raw(candidate.Label, big)) + exact_list(actual, reference) + independent_complement(list(small), list(big), actual) + record("complement", small, big, actual) + counts["ordered_complements"] += 1 + + def gram_case(vectors): + reference = oracle.Label.nondegenerate(raw(oracle.Label, vectors)) + actual = candidate.Label.nondegenerate(raw(candidate.Label, vectors)) + width = max((x.bit_length() for x in vectors), default=0) + dense = pairing_rows(vectors, vectors, width) + independent = dense_rank(dense, len(vectors)) == len(vectors) + require(type(actual) is bool and actual is reference and actual is independent, + "Gram nondegeneracy differs from an independent oracle") + answer = native.gram_rank(dict(enumerate(vectors))) + if answer is not NotImplemented: + rows, rank = answer + reference_rows = tuple(sum(value * (2 ** j) for j, value in enumerate(row)) for row in dense) + require(type(rows) is tuple and all(type(row) is int for row in rows), "Native Gram row types changed") + require(type(rank) is int and rows == reference_rows and rank == dense_rank(dense, len(vectors)), + "Native Gram transcript differs from the dense oracle") + record("gram", vectors, actual) + counts["gram_cases"] += 1 + + # Exhaustive ordered row lists (including zero/dependence), widths <= 3. + short = [()] + [tuple(row) for n in (1, 2) for row in product(range(8), repeat=n)] + for small in short: + for big in short: + complement_case(small, big) + for n in range(4): + for rows in product(range(8), repeat=n): + gram_case(rows) + + # Cross native word, augmented-width, independent/dependent and permutation + # boundaries without assuming a machine word bound for the Python fallback. + coordinates64 = tuple(1 << i for i in range(64)) + boundary_pairs = [ + ((), coordinates64), + ((1 << 63,), coordinates64[:63]), + (coordinates64[:63], (1 << 63,)), + (coordinates64, ()), + ((1,), coordinates64), # augmented 65 -> fallback + (coordinates64, (1,)), # augmented 65 -> fallback + ((), coordinates64 + (1 << 64,)), # 65 values -> fallback + ((1 << 64,), (1, 1 << 64)), # vector-width fallback + ((1 << 127,), (1 << 64, 1 << 127)), + ((1 << 63 | 7,), (3, 5, 1 << 63, 1 << 63 | 7)), + ((0,) * 32, (0,) * 32), + ] + for small, big in boundary_pairs: + complement_case(small, big) + gram_case(small) + gram_case(big) + counts["boundary_cases"] += 1 + for rows in ((0,), (2 ** 64 - 1,), (1 << 63,), coordinates64, + coordinates64 + (1 << 64,), (1 << 200, 3 << 199)): + gram_case(rows) + counts["boundary_cases"] += 1 + + # Actual Label construction and dictionary insertion order are retained. + for ordered in permutations((1, 2, 4, 8)): + small_o, big_o = oracle.Label(ordered[:2]), oracle.Label(ordered) + small_c, big_c = candidate.Label(ordered[:2]), candidate.Label(ordered) + require(list(small_c.basis.items()) == list(small_o.basis.items()) and + list(big_c.basis.items()) == list(big_o.basis.items()) and + small_c.key == small_o.key and big_c.key == big_o.key, + "Label constructor or canonical keys changed") + actual = small_c.complement_in(big_c) + exact_list(actual, small_o.complement_in(big_o)) + independent_complement(list(small_o.basis.values()), list(big_o.basis.values()), actual) + record("real_label_order", ordered, actual) + counts["real_label_permutations"] += 1 + + # Unsupported kinds must preserve ordinary return/exception behavior; no + # coercion, narrowing or mask repair is allowed before calling the fallback. + fallback_fixtures = [ + ((-1, 2), dict), ((True, False, 2), dict), ((IntSubclass(3), 5), dict), + ((1 << 100, 3), dict), ((1.5, 2), dict), (("1", 2), dict), + ((1, 2), DictSubclass), ((1, 2), UserDict), ((1, 2), ValuesOnly), + ((1, 2), BrokenValues), + ] + for values, factory in fallback_fixtures: + left_o, left_c = raw(oracle.Label, values, factory), raw(candidate.Label, values, factory) + right_o, right_c = raw(oracle.Label, (1, 2, 4)), raw(candidate.Label, (1, 2, 4)) + expected = capture(lambda: left_o.nondegenerate()) + actual = capture(lambda: left_c.nondegenerate()) + require(actual == expected, "Nondegenerate fallback result/exception changed") + expected_pair = capture(lambda: left_o.complement_in(right_o)) + actual_pair = capture(lambda: left_c.complement_in(right_c)) + require(actual_pair == expected_pair, "Complement fallback result/exception changed") + reverse_expected = capture(lambda: right_o.complement_in(left_o)) + reverse_actual = capture(lambda: right_c.complement_in(left_c)) + require(reverse_actual == reverse_expected, "Other-basis fallback result/exception changed") + record("fallback", factory.__name__, repr(values), actual, actual_pair, reverse_actual) + counts["fallback_cases"] += 3 + for factory in (lambda cls: object.__new__(cls), lambda cls: raw(cls, (), lambda _: None)): + left_o, left_c = factory(oracle.Label), factory(candidate.Label) + require(capture(left_o.nondegenerate) == capture(left_c.nondegenerate), "Missing basis fallback changed") + right_o, right_c = raw(oracle.Label, (1,)), raw(candidate.Label, (1,)) + require(capture(lambda: left_o.complement_in(right_o)) == capture(lambda: left_c.complement_in(right_c)), + "Missing self basis exception changed") + require(capture(lambda: right_o.complement_in(left_o)) == capture(lambda: right_c.complement_in(left_c)), + "Missing other basis exception changed") + counts["fallback_cases"] += 3 + class OracleChild(oracle.Label): + pass + class CandidateChild(candidate.Label): + pass + child_o, child_c = OracleChild((3, 5)), CandidateChild((3, 5)) + require(child_c.nondegenerate() is child_o.nondegenerate(), "Subclass nondegenerate fallback changed") + exact_list(child_c.complement_in(candidate.Label((1, 2, 4))), child_o.complement_in(oracle.Label((1, 2, 4)))) + counts["fallback_cases"] += 2 + + # Reject rebinding modules whose helpers or target methods have changed. + for name in ("dot", "rank", "method"): + changed = load_source("_matrix_binding_rejection_" + name) + if name == "method": + changed.Label.complement_in = lambda self, other: [] + else: + setattr(changed, name, lambda *args: 0) + failure = capture(lambda: bind(changed, native)) + require(failure[0] == "error" and failure[1] == "RuntimeError", "Binding guard admitted changed source code") + counts["binding_rejections"] += 1 + for bad in ((1 << 64,), (-1,), (True,), (IntSubclass(1),)): + require(native.gram_rank(dict(enumerate(bad))) is NotImplemented, "Native bound/type fallback failed") + require(native.complement(dict(enumerate((1,))), dict(enumerate(coordinates64))) is NotImplemented, + "Native augmented-width bound failed") + + # These independent checks must catch a mathematically wrong result and a + # same-subspace reordered witness respectively, including under python -O. + bad_math = capture(lambda: independent_complement([1], [1, 2], [1])) + require(bad_math[0] == "error", "Independent complement control accepted a wrong result") + bad_order = capture(lambda: exact_list([4, 2], [2, 4])) + require(bad_order[0] == "error", "Ordered witness control accepted a reordered result") + counts["oracle_negative_controls"] += 2 + + # A bounded fixed corpus drawn from the frozen h25 label families; repeated + # timings include dict conversion and dispatch, and remain diagnostic only. + full = tuple(1 << i for i in range(25)) + star = tuple(3 | (1 << i) for i in range(2, 25)) + fixtures = [(full[:12], full), (star, full), ((7,), full), ((), full)] + for small, big in fixtures: + complement_case(small, big) + gram_case(small) + gram_case(big) + oracle_pairs = [(raw(oracle.Label, u), raw(oracle.Label, v)) for u, v in fixtures] + candidate_pairs = [(raw(candidate.Label, u), raw(candidate.Label, v)) for u, v in fixtures] + micro = {} + micro_results = {} + for name, pairs in (("unchanged_python", oracle_pairs), ("native_with_conversion", candidate_pairs)): + start_wall, start_cpu = time.perf_counter(), time.process_time() + saved = [] + for _ in range(128): + for small, big in pairs: + saved.append((small.complement_in(big), small.nondegenerate(), big.nondegenerate())) + micro[name] = {"wall_seconds": time.perf_counter() - start_wall, + "cpu_seconds": time.process_time() - start_cpu} + micro_results[name] = saved + require(micro_results["unchanged_python"] == micro_results["native_with_conversion"], + "Fixed conversion-plus-kernel micro corpus changed") + require(all(value > 0 for value in state["counters"].values()), "A native or fallback path was untested") + return {"status": "FINITE_NATIVE_GF2_CONTROLS_PASS", "counts": counts, + "native_and_fallback_calls": dict(state["counters"]), + "fixture_sha256": transcript.hexdigest(), "micro": micro, + "micro_repetitions": 128, "micro_fixtures": len(fixtures), + "micro_scope": "Fixed h25 label families with conversion; diagnostic only, not complete side speed", + "independent_oracle": "Dense binary lists, descending pivots, addition modulo 2; no packed/source/native helpers"} diff --git a/research/gf2-side-verification/evidence/v1-drafts/native_backend.py.txt b/research/gf2-side-verification/evidence/v1-drafts/native_backend.py.txt new file mode 100644 index 0000000000..fae7477f54 --- /dev/null +++ b/research/gf2-side-verification/evidence/v1-drafts/native_backend.py.txt @@ -0,0 +1,166 @@ +"""Source-bound optional packed GF(2) backend; never changes frozen sources.""" +from __future__ import annotations + +import hashlib +import importlib.util +import json +from pathlib import Path +import shlex +import subprocess +import sys +import sysconfig +from types import CodeType, FunctionType, ModuleType + +ROOT = Path(__file__).resolve().parent +SOURCE = ROOT / "source" / "complex_circuit.py" +SOURCE_SHA256 = "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1" +CALLER_SHA256 = "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + + +def require(condition, message): + if not condition: + raise RuntimeError(message) + + +def verify_sources(): + raw = SOURCE.read_bytes() + require(hashlib.sha256(raw).hexdigest() == SOURCE_SHA256, "Frozen complex source changed") + caller = (ROOT / "source" / "complex_network.py").read_bytes() + require(hashlib.sha256(caller).hexdigest() == CALLER_SHA256, "Frozen caller source changed") + return raw + + +def load_source(name): + verify_sources() + spec = importlib.util.spec_from_file_location(name, SOURCE) + require(spec is not None and spec.loader is not None, "Missing frozen module loader") + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def guard_module(module): + """Check exact source bytes and current runtime function code/globals/shape.""" + raw = verify_sources() + require(type(module) is ModuleType, "Unexpected source module type") + require(Path(module.__file__).resolve() == SOURCE.resolve(), "Unexpected source module path") + expected = compile(raw, str(SOURCE), "exec", dont_inherit=True, optimize=sys.flags.optimize) + codes = {code.co_name: code for code in expected.co_consts if type(code) is CodeType} + + def check(function, expected_code, name): + require(type(function) is FunctionType, "Non-function replacement: " + name) + require(function.__globals__ is module.__dict__, "Changed function globals: " + name) + require(function.__closure__ is None and function.__defaults__ is None and + function.__kwdefaults__ is None, "Changed function calling contract: " + name) + require(function.__code__ == expected_code and function.__code__.co_filename == str(SOURCE), + "Changed frozen function code: " + name) + + for name in ("echelon", "reduce", "dot", "rank"): + check(module.__dict__.get(name), codes[name], name) + label = module.__dict__.get("Label") + require(type(label) is type and label.__mro__ == (label, object), "Changed Label class shape") + require(label.__module__ == module.__name__, "Changed Label module ownership") + methods = {code.co_name: code for code in codes["Label"].co_consts if type(code) is CodeType} + require(set(label.__dict__) == {"__module__", "__doc__", "__dict__", "__weakref__"} | set(methods), + "Changed Label class attributes") + for name, code in methods.items(): + check(label.__dict__.get(name), code, "Label." + name) + return label + + +def build_native(directory): + """Always cold compile/link/load once. The parent supplies the outer guard.""" + require(sys.implementation.name == "cpython" and sys.version_info[:2] == (3, 12), + "This qualification is frozen to CPython 3.12") + require(sys.platform.startswith("linux"), "This qualification is frozen to Linux") + directory = Path(directory) + require(not directory.exists(), "Refusing to reuse a native build directory") + directory.mkdir(parents=True) + source = ROOT / "native_gf2.c" + source_before = source.read_bytes() + source_hash = hashlib.sha256(source_before).hexdigest() + suffix = sysconfig.get_config_var("EXT_SUFFIX") + require(type(suffix) is str and suffix.endswith(".so"), "Unexpected extension suffix") + target = directory / ("_packed_gf2" + suffix) + compiler = shlex.split(sysconfig.get_config_var("CC") or "cc") + require(compiler, "Missing configured C compiler") + command = compiler + ["-shared", "-fPIC", "-O3", "-std=c11", "-Wall", "-Wextra", "-Werror", + "-I" + sysconfig.get_paths()["include"], str(source), "-o", str(target)] + completed = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + text=True, timeout=90, check=False) + manifest = {"command": command, "returncode": completed.returncode, + "stdout": completed.stdout, "stderr": completed.stderr, + "c_source_sha256": source_hash, "python": sys.version, + "no_cached_binary": True} + (directory / "build.json").write_text(json.dumps(manifest, indent=2, sort_keys=True) + "\n") + require(completed.returncode == 0, "Native compilation failed; see build.json (no retry)") + require(source.read_bytes() == source_before, "Native source changed during compilation") + manifest["extension_sha256"] = hashlib.sha256(target.read_bytes()).hexdigest() + spec = importlib.util.spec_from_file_location("_packed_gf2", target) + require(spec is not None and spec.loader is not None, "Missing extension loader") + native = importlib.util.module_from_spec(spec) + spec.loader.exec_module(native) + (directory / "build.json").write_text(json.dumps(manifest, indent=2, sort_keys=True) + "\n") + return native, manifest + + +def attach_trace(module, rank_calls): + """Baseline trace with the same rows, integer output and append as candidate.""" + original_rank = module.rank + + def traced_rank(rows): + frozen_rows = tuple(rows) + answer = original_rank(frozen_rows) + require(type(answer) is int, "Rank output type changed") + rank_calls.append((frozen_rows, answer)) + return answer + + module.rank = traced_rank + return original_rank + + +def bind(module, native, rank_calls=None): + """Replace only two Label methods, retaining literal untouched fallbacks.""" + label = guard_module(module) + original_complement = label.complement_in + original_nondegenerate = label.nondegenerate + original_dot = module.dot + original_rank = module.rank + if rank_calls is not None: + attach_trace(module, rank_calls) + counters = {"complement_native": 0, "complement_fallback": 0, + "gram_native": 0, "gram_fallback": 0} + missing = object() + + def complement_in(self, other): + if type(self) is label and type(other) is label: + big = vars(other).get("basis", missing) + small = vars(self).get("basis", missing) + if type(big) is dict and type(small) is dict: + result = native.complement(small, big) + if result is not NotImplemented: + counters["complement_native"] += 1 + return result + counters["complement_fallback"] += 1 + return original_complement(self, other) + + def nondegenerate(self): + if type(self) is label: + basis = vars(self).get("basis", missing) + if type(basis) is dict: + answer = native.gram_rank(basis) + if answer is not NotImplemented: + rows, rank = answer + if rank_calls is not None: + require(type(rank) is int, "Native rank output type changed") + rank_calls.append((rows, rank)) + counters["gram_native"] += 1 + return rank == len(rows) + counters["gram_fallback"] += 1 + return original_nondegenerate(self) + + label.complement_in = complement_in + label.nondegenerate = nondegenerate + return {"counters": counters, "original_complement": original_complement, + "original_nondegenerate": original_nondegenerate, "original_dot": original_dot, + "original_rank": original_rank, "label": label} diff --git a/research/gf2-side-verification/finite_controls.py b/research/gf2-side-verification/finite_controls.py new file mode 100644 index 0000000000..4168f5c7e4 --- /dev/null +++ b/research/gf2-side-verification/finite_controls.py @@ -0,0 +1,456 @@ +"""Finite independent qualification for the bounded packed GF(2) backend. + +The source oracle is a fresh unchanged module. The second oracle uses dense +0/1 lists and addition modulo two; it never calls the native extension or the +source's packed rank, dot, echelon, reduce, or complement routines. +""" +from __future__ import annotations + +from collections import UserDict +import builtins +from types import FunctionType +import hashlib +from itertools import permutations, product +import json +import time + +from native_backend import ComplementTrace, attach_trace, bind, guard_module, load_source, require + + +def dense_rank(rows, width): + work = [list(row) for row in rows] + require(all(len(row) == width and all(x in (0, 1) for x in row) for row in work), + "Independent oracle requires dense binary rows") + rank = 0 + for column in range(width - 1, -1, -1): + pivot = next((i for i in range(rank, len(work)) if work[i][column]), None) + if pivot is None: + continue + work[rank], work[pivot] = work[pivot], work[rank] + for i in range(rank + 1, len(work)): + if work[i][column]: + work[i] = [(a + b) % 2 for a, b in zip(work[i], work[rank])] + rank += 1 + return rank + + +def dense_vectors(vectors, width): + return [[(value // (2 ** column)) % 2 for column in range(width)] for value in vectors] + + +def pairing_rows(left, right, width): + left_dense = dense_vectors(left, width) + right_dense = dense_vectors(right, width) + return [[sum(a * b for a, b in zip(x, y)) % 2 for y in right_dense] for x in left_dense] + + +def independent_complement(small, big, out): + width = max((x.bit_length() for x in small + big + out), default=0) + big_dense = dense_vectors(big, width) + out_dense = dense_vectors(out, width) + big_rank = dense_rank(big_dense, width) + pairing = pairing_rows(big, small, width) + pairing_rank = dense_rank(pairing, len(small)) + require(all(value == 0 for row in pairing_rows(out, small, width) for value in row), + "Independent oracle found a nonorthogonal complement vector") + require(dense_rank(big_dense + out_dense, width) == big_rank, + "Independent oracle found a complement vector outside the ambient span") + require(len(out) == len(big) - pairing_rank, + "Independent oracle found a wrong number of coefficient-kernel vectors") + require(dense_rank(out_dense, width) == big_rank - pairing_rank, + "Independent oracle found an incomplete complement span") + + +def raw(label, rows, factory=dict): + obj = object.__new__(label) + obj.basis = factory((i, value) for i, value in enumerate(rows)) + return obj + + +def exact_list(actual, expected): + require(type(actual) is list and type(expected) is list, "Complement output is not an exact list") + require(all(type(value) is int for value in actual), "Complement output contains a non-int") + require(actual == expected, "Ordered complement vectors differ from the unchanged source") + + +def capture(action): + try: + value = action() + except Exception as error: + return ("error", type(error).__name__, str(error)) + return ("value", type(value).__name__, value) + + +class IntSubclass(int): + pass + + +class DictSubclass(dict): + pass + + +class ValuesOnly: + def __init__(self, pairs): + self.rows = tuple(value for _, value in pairs) + + def values(self): + return iter(self.rows) + + +class BrokenValues: + def __init__(self, pairs): + self.rows = tuple(value for _, value in pairs) + + def values(self): + def iterator(): + yield from self.rows[:1] + raise ValueError("frozen broken values iterator") + return iterator() + + +def run_controls(native): + oracle = load_source("_matrix_finite_unchanged_oracle") + candidate = load_source("_matrix_finite_candidate") + guard_module(oracle) + state = bind(candidate, native) + counts = {"ordered_complements": 0, "gram_cases": 0, "fallback_cases": 0, + "boundary_cases": 0, "real_label_permutations": 0, "binding_rejections": 0, + "oracle_negative_controls": 0} + transcript = hashlib.sha256() + + def record(tag, *values): + transcript.update(json.dumps((tag, values), separators=(",", ":"), sort_keys=True).encode("ascii") + b"\n") + + def complement_case(small, big): + reference = oracle.Label.complement_in(raw(oracle.Label, small), raw(oracle.Label, big)) + actual = candidate.Label.complement_in(raw(candidate.Label, small), raw(candidate.Label, big)) + exact_list(actual, reference) + independent_complement(list(small), list(big), actual) + record("complement", small, big, actual) + counts["ordered_complements"] += 1 + + def gram_case(vectors): + reference = oracle.Label.nondegenerate(raw(oracle.Label, vectors)) + actual = candidate.Label.nondegenerate(raw(candidate.Label, vectors)) + width = max((x.bit_length() for x in vectors), default=0) + dense = pairing_rows(vectors, vectors, width) + independent = dense_rank(dense, len(vectors)) == len(vectors) + require(type(actual) is bool and actual is reference and actual is independent, + "Gram nondegeneracy differs from an independent oracle") + answer = native.gram_rank(dict(enumerate(vectors))) + if answer is not NotImplemented: + rows, rank = answer + reference_rows = tuple(sum(value * (2 ** j) for j, value in enumerate(row)) for row in dense) + require(type(rows) is tuple and all(type(row) is int for row in rows), "Native Gram row types changed") + require(type(rank) is int and rows == reference_rows and rank == dense_rank(dense, len(vectors)), + "Native Gram transcript differs from the dense oracle") + record("gram", vectors, actual) + counts["gram_cases"] += 1 + + # Exhaustive ordered row lists (including zero/dependence), widths <= 3. + short = [()] + [tuple(row) for n in (1, 2) for row in product(range(8), repeat=n)] + for small in short: + for big in short: + complement_case(small, big) + for n in range(4): + for rows in product(range(8), repeat=n): + gram_case(rows) + + # Cross native word, augmented-width, independent/dependent and permutation + # boundaries without assuming a machine word bound for the Python fallback. + coordinates64 = tuple(1 << i for i in range(64)) + boundary_pairs = [ + ((), coordinates64), + ((1 << 63,), coordinates64[:63]), + (coordinates64[:63], (1 << 63,)), + (coordinates64, ()), + ((1,), coordinates64), # augmented 65 -> fallback + (coordinates64, (1,)), # augmented 65 -> fallback + ((), coordinates64 + (1 << 64,)), # 65 values -> fallback + ((1 << 64,), (1, 1 << 64)), # vector-width fallback + ((1 << 127,), (1 << 64, 1 << 127)), + ((1 << 63 | 7,), (3, 5, 1 << 63, 1 << 63 | 7)), + ((0,) * 32, (0,) * 32), + ] + for small, big in boundary_pairs: + complement_case(small, big) + gram_case(small) + gram_case(big) + counts["boundary_cases"] += 1 + for rows in ((0,), (2 ** 64 - 1,), (1 << 63,), coordinates64, + coordinates64 + (1 << 64,), (1 << 200, 3 << 199)): + gram_case(rows) + counts["boundary_cases"] += 1 + + # Actual Label construction and dictionary insertion order are retained. + for ordered in permutations((1, 2, 4, 8)): + small_o, big_o = oracle.Label(ordered[:2]), oracle.Label(ordered) + small_c, big_c = candidate.Label(ordered[:2]), candidate.Label(ordered) + require(list(small_c.basis.items()) == list(small_o.basis.items()) and + list(big_c.basis.items()) == list(big_o.basis.items()) and + small_c.key == small_o.key and big_c.key == big_o.key, + "Label constructor or canonical keys changed") + actual = small_c.complement_in(big_c) + exact_list(actual, small_o.complement_in(big_o)) + independent_complement(list(small_o.basis.values()), list(big_o.basis.values()), actual) + record("real_label_order", ordered, actual) + counts["real_label_permutations"] += 1 + + # Unsupported kinds must preserve ordinary return/exception behavior; no + # coercion, narrowing or mask repair is allowed before calling the fallback. + fallback_fixtures = [ + ((-1, 2), dict), ((True, False, 2), dict), ((IntSubclass(3), 5), dict), + ((1 << 100, 3), dict), ((1.5, 2), dict), (("1", 2), dict), + ((1, 2), DictSubclass), ((1, 2), UserDict), ((1, 2), ValuesOnly), + ((1, 2), BrokenValues), + ] + for values, factory in fallback_fixtures: + left_o, left_c = raw(oracle.Label, values, factory), raw(candidate.Label, values, factory) + right_o, right_c = raw(oracle.Label, (1, 2, 4)), raw(candidate.Label, (1, 2, 4)) + expected = capture(lambda: left_o.nondegenerate()) + actual = capture(lambda: left_c.nondegenerate()) + require(actual == expected, "Nondegenerate fallback result/exception changed") + expected_pair = capture(lambda: left_o.complement_in(right_o)) + actual_pair = capture(lambda: left_c.complement_in(right_c)) + require(actual_pair == expected_pair, "Complement fallback result/exception changed") + reverse_expected = capture(lambda: right_o.complement_in(left_o)) + reverse_actual = capture(lambda: right_c.complement_in(left_c)) + require(reverse_actual == reverse_expected, "Other-basis fallback result/exception changed") + record("fallback", factory.__name__, repr(values), actual, actual_pair, reverse_actual) + counts["fallback_cases"] += 3 + for factory in (lambda cls: object.__new__(cls), lambda cls: raw(cls, (), lambda _: None)): + left_o, left_c = factory(oracle.Label), factory(candidate.Label) + require(capture(left_o.nondegenerate) == capture(left_c.nondegenerate), "Missing basis fallback changed") + right_o, right_c = raw(oracle.Label, (1,)), raw(candidate.Label, (1,)) + require(capture(lambda: left_o.complement_in(right_o)) == capture(lambda: left_c.complement_in(right_c)), + "Missing self basis exception changed") + require(capture(lambda: right_o.complement_in(left_o)) == capture(lambda: right_c.complement_in(left_c)), + "Missing other basis exception changed") + counts["fallback_cases"] += 3 + class OracleChild(oracle.Label): + pass + class CandidateChild(candidate.Label): + pass + child_o, child_c = OracleChild((3, 5)), CandidateChild((3, 5)) + require(child_c.nondegenerate() is child_o.nondegenerate(), "Subclass nondegenerate fallback changed") + exact_list(child_c.complement_in(candidate.Label((1, 2, 4))), child_o.complement_in(oracle.Label((1, 2, 4)))) + counts["fallback_cases"] += 2 + + # Reject rebinding modules whose helpers or target methods have changed. + for name in ("dot", "rank", "method"): + changed = load_source("_matrix_binding_rejection_" + name) + if name == "method": + changed.Label.complement_in = lambda self, other: [] + else: + setattr(changed, name, lambda *args: 0) + failure = capture(lambda: bind(changed, native)) + require(failure[0] == "error" and failure[1] == "RuntimeError", "Binding guard admitted changed source code") + counts["binding_rejections"] += 1 + for bad in ((1 << 64,), (-1,), (True,), (IntSubclass(1),)): + require(native.gram_rank(dict(enumerate(bad))) is NotImplemented, "Native bound/type fallback failed") + require(native.complement(dict(enumerate((1,))), dict(enumerate(coordinates64))) is NotImplemented, + "Native augmented-width bound failed") + + # These independent checks must catch a mathematically wrong result and a + # same-subspace reordered witness respectively, including under python -O. + bad_math = capture(lambda: independent_complement([1], [1, 2], [1])) + require(bad_math[0] == "error", "Independent complement control accepted a wrong result") + bad_order = capture(lambda: exact_list([4, 2], [2, 4])) + require(bad_order[0] == "error", "Ordered witness control accepted a reordered result") + counts["oracle_negative_controls"] += 2 + + # A bounded fixed corpus drawn from the frozen h25 label families; repeated + # timings include dict conversion and dispatch, and remain diagnostic only. + full = tuple(1 << i for i in range(25)) + star = tuple(3 | (1 << i) for i in range(2, 25)) + fixtures = [(full[:12], full), (star, full), ((7,), full), ((), full)] + for small, big in fixtures: + complement_case(small, big) + gram_case(small) + gram_case(big) + oracle_pairs = [(raw(oracle.Label, u), raw(oracle.Label, v)) for u, v in fixtures] + candidate_pairs = [(raw(candidate.Label, u), raw(candidate.Label, v)) for u, v in fixtures] + micro = {} + micro_results = {} + for name, pairs in (("unchanged_python", oracle_pairs), ("native_with_conversion", candidate_pairs)): + start_wall, start_cpu = time.perf_counter(), time.process_time() + saved = [] + for _ in range(128): + for small, big in pairs: + saved.append((small.complement_in(big), small.nondegenerate(), big.nondegenerate())) + micro[name] = {"wall_seconds": time.perf_counter() - start_wall, + "cpu_seconds": time.process_time() - start_cpu} + micro_results[name] = saved + require(micro_results["unchanged_python"] == micro_results["native_with_conversion"], + "Fixed conversion-plus-kernel micro corpus changed") + require(all(value > 0 for value in state["counters"].values()), "A native or fallback path was untested") + v2 = v2_binding_and_trace_controls(native) + return {"status": "FINITE_NATIVE_GF2_CONTROLS_PASS", "counts": counts, + "native_and_fallback_calls": dict(state["counters"]), + "fixture_sha256": transcript.hexdigest(), "micro": micro, "v2_controls": v2, + "micro_repetitions": 128, "micro_fixtures": len(fixtures), + "micro_scope": "Fixed h25 label families with conversion; diagnostic only, not complete side speed", + "independent_oracle": "Dense binary lists, descending pivots, addition modulo 2; no packed/source/native helpers"} + + +def v2_binding_and_trace_controls(native): + """Fail-closed lookup/dispatch drift and symmetric complete transcript controls.""" + counts = {"prebind_shadow_rejections": 0, "effective_builtins_rejections": 0, + "postbind_drift_rejections": 0, "class_dispatch_rejections": 0, + "real_builtin_drift_rejections": 0, "trace_pairs": 0, + "trace_negative_controls": 0, "native_proxy_rejections": 0} + observed = [] + + def bad_helper(*args, **kwargs): + observed.append("modified helper executed") + return 0 + + def rejected(action, message): + before = list(observed) + outcome = capture(action) + require(outcome[0] == "error" and outcome[1] == "RuntimeError", message) + require(observed == before, "A drift check invoked the modified helper/descriptor") + + class NativeProxy: + def __getattribute__(self, name): + observed.append("native proxy attribute read") + return bad_helper + proxy_source = load_source("_matrix_v2_native_proxy") + rejected(lambda: bind(proxy_source, NativeProxy()), "Native proxy admitted before type check") + counts["native_proxy_rejections"] += 1 + + # Check every relevant effective builtin lookup, not just function bytecode. + for name in ("list", "sum", "enumerate", "len", "range", "next", "max", "all", "tuple", "sorted"): + changed = load_source("_matrix_v2_shadow_" + name) + changed.__dict__[name] = bad_helper + rejected(lambda: bind(changed, native), "Prebind global builtin shadow admitted: " + name) + counts["prebind_shadow_rejections"] += 1 + + # FunctionType captures the active builtins pointer at construction time. + # Restoring module.__builtins__ cannot make this forged function acceptable. + changed = load_source("_matrix_v2_function_builtins") + canonical_builtins = changed.__dict__["__builtins__"] + changed.__dict__["__builtins__"] = dict(canonical_builtins, sum=bad_helper) + forged = FunctionType(changed.Label.nondegenerate.__code__, changed.__dict__) + changed.__dict__["__builtins__"] = canonical_builtins + changed.Label.nondegenerate = forged + rejected(lambda: bind(changed, native), "Forged effective function builtins admitted") + counts["effective_builtins_rejections"] += 1 + changed = load_source("_matrix_v2_module_builtins") + changed.__dict__["__builtins__"] = dict(changed.__dict__["__builtins__"]) + rejected(lambda: bind(changed, native), "Alternate module builtins owner admitted") + counts["effective_builtins_rejections"] += 1 + + for name in ("basis", "__getattribute__"): + changed = load_source("_matrix_v2_pre_descriptor_" + name) + if name == "basis": + changed.Label.basis = property(bad_helper) + else: + changed.Label.__getattribute__ = bad_helper + rejected(lambda: bind(changed, native), "Prebind custom Label dispatch admitted") + counts["class_dispatch_rejections"] += 1 + + mutations = ( + ("dot_identity", lambda module, state: setattr(module, "dot", bad_helper)), + ("rank_identity", lambda module, state: setattr(module, "rank", bad_helper)), + ("sum_shadow", lambda module, state: setattr(module, "sum", bad_helper)), + ("list_shadow", lambda module, state: setattr(module, "list", bad_helper)), + ("module_builtins", lambda module, state: module.__dict__.__setitem__("__builtins__", dict(builtins.__dict__))), + ("dot_code", lambda module, state: setattr(module.dot, "__code__", (lambda x, y: 0).__code__)), + ("dot_defaults", lambda module, state: setattr(module.dot, "__defaults__", (0,))), + ("saved_method_code", lambda module, state: setattr(state["original_nondegenerate"], "__code__", (lambda self: False).__code__)), + ("label_init_code", lambda module, state: setattr(module.Label.__init__, "__code__", (lambda self, vectors: None).__code__)), + ("basis_descriptor", lambda module, state: setattr(module.Label, "basis", property(bad_helper))), + ("getattribute_dispatch", lambda module, state: setattr(module.Label, "__getattribute__", bad_helper)), + ("label_global", lambda module, state: setattr(module, "Label", object)), + ) + for name, mutate in mutations: + module = load_source("_matrix_v2_post_" + name) + state = bind(module, native) + small, big = raw(module.Label, (1,)), raw(module.Label, (1, 2)) + # Capture bound entry points before changing class attribute dispatch. + gram_call = small.nondegenerate + complement_call = small.complement_in + before = dict(state["counters"]) + mutate(module, state) + rejected(gram_call, "Postbind drift admitted by nondegenerate: " + name) + rejected(lambda: complement_call(big), "Postbind drift admitted by complement: " + name) + require(state["counters"] == before, "Drift reached native work or fallback") + counts["postbind_drift_rejections"] += 2 + + # The shared builtins dictionary is restored in finally before any following + # numerical fixture. No altered builtin is called to observe the mutation. + for postbind in (False, True): + module = load_source("_matrix_v2_real_builtin_" + str(postbind)) + if postbind: + state = bind(module, native) + small = raw(module.Label, (1,)) + call = small.nondegenerate + before = dict(state["counters"]) + original_sum = builtins.sum + try: + builtins.sum = bad_helper + rejected(call if postbind else lambda: bind(module, native), "Shared builtin drift admitted") + finally: + builtins.sum = original_sum + if postbind: + require(state["counters"] == before, "Shared builtin drift reached arithmetic") + counts["real_builtin_drift_rejections"] += 1 + + # Native dispatch mutation is rejected even though the wrapper retains the + # original C callable. Restore it before another independently bound module. + module = load_source("_matrix_v2_native_dispatch") + state = bind(module, native) + small = raw(module.Label, (1,)) + before = dict(state["counters"]) + original_native = native.gram_rank + try: + native.gram_rank = bad_helper + rejected(small.nondegenerate, "Changed native dispatch admitted") + finally: + native.gram_rank = original_native + require(state["counters"] == before, "Native dispatch drift reached arithmetic") + counts["postbind_drift_rejections"] += 1 + + # Both complete arms have the same observer and bytes; ordinary unsupported + # integer width still works with tracing, while custom containers are never + # observed by the full-run trace and keep their existing finite fallback tests. + oracle = load_source("_matrix_v2_trace_oracle") + candidate = load_source("_matrix_v2_trace_candidate") + guard_module(oracle) + oracle_rank, candidate_rank = [], [] + oracle_trace = ComplementTrace(oracle.Label) + candidate_trace = ComplementTrace(candidate.Label) + attach_trace(oracle, oracle_rank, oracle_trace) + bind(candidate, native, candidate_rank, candidate_trace) + fixtures = [((), ()), ((), (1, 2, 4)), ((1,), (1, 2, 4)), + ((3, 5), (1, 2, 4)), ((4, 1), (4, 2, 1)), + ((1 << 64,), (1, 1 << 64)), ((1 << 100,), (1, 2, 1 << 100))] + for us, vs in fixtures: + left_o, right_o = raw(oracle.Label, us), raw(oracle.Label, vs) + left_c, right_c = raw(candidate.Label, us), raw(candidate.Label, vs) + exact_list(left_c.complement_in(right_c), left_o.complement_in(right_o)) + require(left_c.nondegenerate() is left_o.nondegenerate(), "Traced Gram result changed") + counts["trace_pairs"] += 1 + require(oracle_trace.receipt() == candidate_trace.receipt() and oracle_rank == candidate_rank, + "Baseline/candidate exact ordered stream differs") + list_trace, none_trace = ComplementTrace(oracle.Label), ComplementTrace(oracle.Label) + list_trace.after(((), ()), []) + none_trace.after(((), ()), None) + require(list_trace.receipt()["sha256"] != none_trace.receipt()["sha256"], "Trace conflates [] with None") + order_a, order_b = ComplementTrace(oracle.Label), ComplementTrace(oracle.Label) + order_a.after(((1,), (1, 2, 4)), [2, 4]) + order_b.after(((1,), (1, 2, 4)), [4, 2]) + require(order_a.receipt()["sha256"] != order_b.receipt()["sha256"], "Trace loses output order") + input_a, input_b = ComplementTrace(oracle.Label), ComplementTrace(oracle.Label) + input_a.after(((1, 2), (1, 2, 4)), [4]) + input_b.after(((2, 1), (1, 2, 4)), [4]) + require(input_a.receipt()["sha256"] != input_b.receipt()["sha256"], "Trace loses input order") + invalid = raw(oracle.Label, (1,), BrokenValues) + rejected(lambda: oracle_trace.before(invalid, raw(oracle.Label, (1,))), "Full trace accepted a side-effecting fallback container") + counts["trace_negative_controls"] += 4 + require(observed == [], "A guarded modified helper was invoked") + return {"status": "V2_RUNTIME_AND_COMPLEMENT_STREAM_PASS", "counts": counts, + "complement_fixture_stream": oracle_trace.receipt(), + "modified_helper_invocations": len(observed), + "runtime_policy": "Reject before native/fallback on source helper, effective builtins, class, function, closure or native dispatch drift"} diff --git a/research/gf2-side-verification/full_B.py b/research/gf2-side-verification/full_B.py new file mode 100644 index 0000000000..885e311003 --- /dev/null +++ b/research/gf2-side-verification/full_B.py @@ -0,0 +1,7 @@ +from pathlib import Path +import os,runpy,sys +here=Path(__file__).resolve().parent +output=Path(os.environ['CROC_GF2_SIDE_OUTPUT']).resolve() +if output.is_relative_to(here):raise ValueError('external scientific output required') +sys.argv=[str(here/'compare_side_verifier.py'),'--mode','baseline','--expected-complement-sha256','7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838','--output',str(output)] +runpy.run_path(sys.argv[0],run_name='__main__') diff --git a/research/gf2-side-verification/full_C.py b/research/gf2-side-verification/full_C.py new file mode 100644 index 0000000000..3a7e3d6a4e --- /dev/null +++ b/research/gf2-side-verification/full_C.py @@ -0,0 +1,7 @@ +from pathlib import Path +import os,runpy,sys +here=Path(__file__).resolve().parent +output=Path(os.environ['CROC_GF2_SIDE_OUTPUT']).resolve() +if output.is_relative_to(here):raise ValueError('external scientific output required') +sys.argv=[str(here/'compare_side_verifier.py'),'--mode','candidate','--expected-complement-sha256','7dec2bf33303c37e1c699609e83768d61df7e19104d34a26a148f66d5ccc4838','--output',str(output)] +runpy.run_path(sys.argv[0],run_name='__main__') diff --git a/research/gf2-side-verification/guard.py b/research/gf2-side-verification/guard.py new file mode 100644 index 0000000000..bf4265b129 --- /dev/null +++ b/research/gf2-side-verification/guard.py @@ -0,0 +1,120 @@ +"""Serial bounded Linux measurements; preserve the complete frozen precision contract.""" +import argparse +import fcntl +import hashlib +import json +import os +from pathlib import Path +import platform +import signal +import statistics +import subprocess +import sys +import tempfile +import time + +HERE = Path(__file__).resolve().parent +SOURCE = HERE +CLOSURE = ('frozen.py','primitive_profile.py','guard.py','dispatch.py','inputs/PR5848.tar','../feasibility/fraction_table.py','../feasibility/finite.py','/usr/lib/python3.12/fractions.py','../feasibility/actual_audit.py') +TIMEOUT = 180 +RSS_CAP = 1024**3 +OUTPUT_CAP = 2*1024**2 +AGGREGATE = 600 +PREVIOUS_WALL_SECONDS = 0 + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + +def inventory(): + result = {} + for name in CLOSURE: + path = SOURCE / name + if path.is_symlink() or not path.is_file(): + raise ValueError('Regular complete runtime file: ' + name) + result[name] = [sha(path.read_bytes()), path.stat().st_mode & 0o777] + return result + +def group_rss(group): + total = 0 + count = 0 + for p in Path('/proc').iterdir(): + if not p.name.isdigit(): + continue + try: + raw = (p/'stat').read_text() + fields = raw[raw.rfind(')')+2:].split() + if int(fields[2]) == group: + total += int(fields[21])*os.sysconf('SC_PAGE_SIZE') + count += 1 + except (FileNotFoundError, ProcessLookupError, PermissionError): + pass + return total, count + +def run(label, script, optimized=False): + records = HERE/'runs' + records.mkdir(exist_ok=True) + prior = list(records.glob('*/receipt.json')) + spent = PREVIOUS_WALL_SECONDS + sum(json.loads(p.read_bytes())['wall_seconds'] for p in prior) + if spent >= AGGREGATE: + raise ValueError('Aggregate budget consumed') + folder = records/label + folder.mkdir() + before = inventory() + env = os.environ.copy() + for key in ('PYTHONPATH','PYTHONOPTIMIZE','PYTHONINSPECT','PYTHONSTARTUP','PYTHONPYCACHEPREFIX'): + env.pop(key,None) + env.update(PYTHONHASHSEED='0', LC_ALL='C.UTF-8', TZ='UTC') + usage = folder/'usage.json' + with tempfile.TemporaryDirectory(prefix='linux5757-bytecode-') as cache: + command = ['/usr/bin/python3.12', '-B', '-X', 'pycache_prefix='+cache] + if optimized: + command.append('-O') + command.append(str(SOURCE/script)) + timed = ['/usr/bin/time','-f','{"user_seconds":%U,"system_seconds":%S,"kernel_max_rss_kib":%M,"exit":%x}', '-o', str(usage),'--',*command] + start = time.monotonic() + peak = 0 + stop = None + with (folder/'stdout.txt').open('wb') as out, (folder/'stderr.txt').open('wb') as err: + p = subprocess.Popen(timed, cwd=SOURCE, env=env, stdout=out, stderr=err, start_new_session=True) + try: + while p.poll() is None: + rss, _ = group_rss(p.pid) + peak = max(peak,rss) + elapsed = time.monotonic()-start + if rss > RSS_CAP: + stop='sampled_group_rss_cap' + elif elapsed > min(TIMEOUT,AGGREGATE-spent): + stop='wall_or_aggregate_cap' + elif max((folder/'stdout.txt').stat().st_size,(folder/'stderr.txt').stat().st_size)>OUTPUT_CAP: + stop='output_cap' + if stop: + os.killpg(p.pid,signal.SIGKILL) + break + time.sleep(0.05) + code=p.wait() + finally: + try: os.killpg(p.pid,signal.SIGKILL) + except ProcessLookupError: pass + p.wait() + elapsed = time.monotonic()-start + stdout=(folder/'stdout.txt').read_bytes() + stderr=(folder/'stderr.txt').read_bytes() + after=inventory() + measurement=None + if usage.exists(): + try: measurement=json.loads(usage.read_bytes()) + except json.JSONDecodeError: measurement={'raw':usage.read_text()} + receipt={'label':label,'script':script,'optimized':optimized,'wall_seconds':elapsed, + 'exit':code,'termination':stop,'sampled_process_group_rss_bytes':peak, + 'usage':measurement,'stdout_sha256':sha(stdout),'stdout_bytes':len(stdout), + 'stderr_sha256':sha(stderr),'stderr_bytes':len(stderr), + 'source_inventory_sha256':sha(json.dumps(before,sort_keys=True,separators=(',',':')).encode()), + 'source_bytes_and_modes_unchanged':before==after, + 'python':sys.version,'platform':platform.platform(), + 'runner_sha256':sha(Path(__file__).read_bytes()),'runtime_policy_sha256':sha(json.dumps(CLOSURE).encode())} + receipt['status']='PASS' if code==0 and stop is None and not stderr and before==after else 'STOP' + (folder/'receipt.json').write_text(json.dumps(receipt,indent=2,sort_keys=True)+'\n') + print(json.dumps(receipt,sort_keys=True),flush=True) + if receipt['status']!='PASS': + raise SystemExit(1) + return receipt diff --git a/research/gf2-side-verification/native_backend.py b/research/gf2-side-verification/native_backend.py new file mode 100644 index 0000000000..77e55ce9d0 --- /dev/null +++ b/research/gf2-side-verification/native_backend.py @@ -0,0 +1,386 @@ +"""Source-bound packed GF(2), with a fail-closed stable-runtime boundary. + +Supported bindings use the literal frozen source, ordinary built-ins and the +original Label dispatch. Resolved method/helper globals and built-ins, helper +code/defaults/closures and class/native dispatch must remain unchanged after +binding. Calls run serially with no mutation during a call; detected boundary +drift is rejected before arithmetic or fallback. This is not a sandbox +against arbitrary mutation of this backend or native process memory. +""" +from __future__ import annotations + +import builtins +import hashlib +import importlib.util +import json +from pathlib import Path +import shlex +import subprocess +import sys +import sysconfig +from types import BuiltinFunctionType, CodeType, FunctionType, GetSetDescriptorType, ModuleType + +ROOT = Path(__file__).resolve().parent +SOURCE = ROOT / "source" / "complex_circuit.py" +SOURCE_SHA256 = "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1" +CALLER_SHA256 = "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b" + +# Anchored operations keep drift checks independent of the source's lookup +# environment and avoid executing modified helper functions or descriptors. +_TYPE = type +_LEN = len +_INT = int +_DICT = dict +_LIST = list +_TUPLE = tuple +_OBJECT = object +_RUNTIME_ERROR = RuntimeError +_COMPILE = compile +_DICT_GET = dict.get +_DICT_VALUES = dict.values +_OBJECT_GETATTRIBUTE = object.__getattribute__ +_BUILTINS = builtins.__dict__ +_BUILTIN_NAMES = ("all", "enumerate", "len", "list", "max", "next", "range", + "sorted", "sum", "tuple", "int", "dict", "type", "object") +_CANONICAL_BUILTINS = {name: _BUILTINS[name] for name in _BUILTIN_NAMES} +_HELPER_NAMES = ("echelon", "reduce", "dot", "rank") +_TYPE_BUILTINS = {"list": _LIST, "tuple": _TUPLE, "int": _INT, + "dict": _DICT, "type": _TYPE, "object": _OBJECT} +_BIT_DESCRIPTORS = tuple((_INT, name, getattr(_INT, name)) for name in + ("bit_count", "bit_length", "__and__", "__xor__", "__lshift__", "__rshift__")) + + +def require(condition, message): + if not condition: + raise _RUNTIME_ERROR(message) + + +def _check_builtins(): + for name, expected in _CANONICAL_BUILTINS.items(): + require(_DICT_GET(_BUILTINS, name) is expected, "Runtime drift: builtin " + name) + if name in _TYPE_BUILTINS: + require(expected is _TYPE_BUILTINS[name], "Unexpected builtin type: " + name) + elif name in ("enumerate", "range"): + require(_TYPE(expected) is _TYPE and expected.__name__ == name and + expected.__module__ == "builtins" and not (expected.__flags__ & (1 << 9)), + "Unexpected builtin class: " + name) + else: + require(_TYPE(expected) is BuiltinFunctionType and expected.__name__ == name and + expected.__module__ == "builtins", "Unexpected builtin function: " + name) + for owner, name, descriptor in _BIT_DESCRIPTORS: + require(_TYPE.__getattribute__(owner, name) is descriptor, "Runtime drift: builtin integer semantics") + + +def verify_sources(): + raw = SOURCE.read_bytes() + require(hashlib.sha256(raw).hexdigest() == SOURCE_SHA256, "Frozen complex source changed") + caller = (ROOT / "source" / "complex_network.py").read_bytes() + require(hashlib.sha256(caller).hexdigest() == CALLER_SHA256, "Frozen caller source changed") + return raw + + +def load_source(name): + verify_sources() + spec = importlib.util.spec_from_file_location(name, SOURCE) + require(spec is not None and spec.loader is not None, "Missing frozen module loader") + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def _code_shape(code): + """Compare source code using only exact immutable values, never user equality.""" + require(_TYPE(code) is CodeType, "Unexpected function code type") + def constant(value): + kind = _TYPE(value) + if value is None or value is Ellipsis: + return ("singleton", value is Ellipsis) + if kind is _INT or kind is bool or kind is str or kind is bytes: + return (kind.__name__, value) + if kind is _TUPLE: + return ("tuple", _TUPLE(constant(item) for item in value)) + if kind is CodeType: + return ("code", _code_shape(value)) + raise _RUNTIME_ERROR("Unexpected mutable or custom constant in frozen function") + fields = (code.co_argcount, code.co_posonlyargcount, code.co_kwonlyargcount, + code.co_nlocals, code.co_stacksize, code.co_flags, code.co_code, + code.co_names, code.co_varnames, code.co_freevars, code.co_cellvars, + code.co_exceptiontable, code.co_linetable, code.co_firstlineno, + code.co_filename, code.co_name, code.co_qualname, code.co_consts) + return _TUPLE(constant(value) for value in fields) + + +def guard_module(module): + """Validate code AND every resolved builtin/helper/Label dispatch owner.""" + _check_builtins() + raw = verify_sources() + require(_TYPE(module) is ModuleType, "Unexpected source module type") + namespace = module.__dict__ + require(_TYPE(_DICT_GET(namespace, "__file__")) is str and _TYPE(_DICT_GET(namespace, "__name__")) is str, "Unexpected source module metadata types") + require(Path(namespace["__file__"]).resolve() == SOURCE.resolve(), "Unexpected source module path") + require(_DICT_GET(namespace, "__builtins__") is _BUILTINS, "Changed source builtins owner") + for name in _BUILTIN_NAMES: + require(name not in namespace, "Source builtin shadow: " + name) + expected = _COMPILE(raw, str(SOURCE), "exec", dont_inherit=True, optimize=sys.flags.optimize) + codes = {code.co_name: code for code in expected.co_consts if _TYPE(code) is CodeType} + + def check(function, expected_code, name): + require(_TYPE(function) is FunctionType, "Non-function replacement: " + name) + require(function.__globals__ is namespace, "Changed function globals: " + name) + # A function captures its own builtins pointer when created; checking + # only the module's current __builtins__ slot would miss a forged one. + require(function.__builtins__ is _BUILTINS, "Changed effective function builtins: " + name) + require(function.__closure__ is None and function.__defaults__ is None and + function.__kwdefaults__ is None, "Changed function calling contract: " + name) + require(_code_shape(function.__code__) == _code_shape(expected_code), + "Changed frozen function code: " + name) + + for name in _HELPER_NAMES: + check(_DICT_GET(namespace, name), codes[name], name) + label = _DICT_GET(namespace, "Label") + require(_TYPE(label) is _TYPE and label.__mro__ == (label, _OBJECT), "Changed Label class shape") + require(_TYPE(label.__module__) is str and label.__module__ == module.__name__, "Changed Label module ownership") + methods = {code.co_name: code for code in codes["Label"].co_consts if _TYPE(code) is CodeType} + attributes = label.__dict__ + require(_LEN(attributes) == 4 + _LEN(methods), "Changed Label class attributes") + for name in ("__module__", "__doc__", "__dict__", "__weakref__"): + require(name in attributes, "Missing original Label descriptor") + for name in ("__dict__", "__weakref__"): + descriptor = attributes[name] + require(_TYPE(descriptor) is GetSetDescriptorType and descriptor.__objclass__ is label, + "Custom Label descriptor: " + name) + for name, code in methods.items(): + check(attributes.get(name), code, "Label." + name) + require(label.__getattribute__ is _OBJECT.__getattribute__ and label.__new__ is _OBJECT.__new__, + "Custom Label attribute or construction dispatch") + return label + + +class RuntimeGuard: + """Identity-only freshness checks; no modified callable is invoked.""" + def __init__(self, module, label, native, original_functions): + self.module = module + self.namespace = module.__dict__ + self.label = label + self.mro = label.__mro__ + self.class_items = _TUPLE(label.__dict__.items()) + self.global_items = _TUPLE((name, self.namespace[name]) for name in _HELPER_NAMES + ("Label", "__builtins__")) + functions = _LIST(original_functions) + functions.extend(value for _, value in self.class_items if _TYPE(value) is FunctionType) + functions.append(self.namespace["rank"]) + self.functions = _TUPLE((function, function.__code__, function.__globals__, function.__builtins__, + function.__defaults__, function.__kwdefaults__, function.__closure__, + () if function.__closure__ is None else + _TUPLE((cell, cell.cell_contents) for cell in function.__closure__)) + for function in functions) + self.native = native + require(_TYPE(native) is ModuleType, "Unexpected native module type") + self.native_items = _TUPLE((name, native.__dict__[name]) for name in ("gram_rank", "complement")) + for name, function in self.native_items: + require(_TYPE(function) is BuiltinFunctionType and function.__self__ is native, + "Changed native entry point: " + name) + self.check() + + def check(self): + # The source globals and Label remain a normal module and exact class; + # lookups below therefore do not invoke user-defined descriptors. + require(_TYPE(self.module) is ModuleType and self.module.__dict__ is self.namespace, + "Runtime drift: source module dispatch") + require(_TYPE(self.label) is _TYPE and self.label.__mro__ is self.mro, + "Runtime drift: Label class dispatch") + for name, value in self.global_items: + require(_DICT_GET(self.namespace, name) is value, "Runtime drift: source helper " + name) + for name, expected in _CANONICAL_BUILTINS.items(): + require(name not in self.namespace and _DICT_GET(_BUILTINS, name) is expected, + "Runtime drift: builtin lookup " + name) + attributes = self.label.__dict__ + require(_LEN(attributes) == _LEN(self.class_items), "Runtime drift: Label descriptors") + for name, value in self.class_items: + require(attributes.get(name) is value, "Runtime drift: Label member " + name) + for function, code, namespace, effective_builtins, defaults, kwdefaults, closure, cells in self.functions: + require(function.__code__ is code and function.__globals__ is namespace and + function.__builtins__ is effective_builtins and function.__defaults__ is defaults and + function.__kwdefaults__ is kwdefaults and function.__closure__ is closure, + "Runtime drift: function code or calling environment") + for cell, value in cells: + require(cell.cell_contents is value, "Runtime drift: wrapper closure") + require(_TYPE(self.native) is ModuleType, "Runtime drift: native module dispatch") + for name, function in self.native_items: + require(_DICT_GET(self.native.__dict__, name) is function, "Runtime drift: native entry point " + name) + + +class ComplementTrace: + """Stream every ordered complement input and typed output, without retention. + + Snapshotting is confined to the exact Label/exact dict/int domain of the + complete H25 workload. Finite fallback tests leave this observer disabled. + """ + def __init__(self, label): + self.label = label + self.count = 0 + self.bytes = 0 + self.hasher = hashlib.sha256() + + def before(self, small, big): + require(_TYPE(small) is self.label and _TYPE(big) is self.label, "Trace requires exact frozen Label objects") + big_dict = _OBJECT_GETATTRIBUTE(big, "__dict__") + small_dict = _OBJECT_GETATTRIBUTE(small, "__dict__") + require(_TYPE(big_dict) is _DICT and _TYPE(small_dict) is _DICT, "Trace requires ordinary instance dictionaries") + vs_basis = _DICT_GET(big_dict, "basis") + us_basis = _DICT_GET(small_dict, "basis") + require(_TYPE(vs_basis) is _DICT and _TYPE(us_basis) is _DICT, "Trace requires exact basis dictionaries") + vs = _TUPLE(_DICT_VALUES(vs_basis)) + us = _TUPLE(_DICT_VALUES(us_basis)) + require(all(_TYPE(value) is _INT for value in us + vs), "Trace requires exact integer vectors") + return us, vs + + def after(self, inputs, output): + us, vs = inputs + if output is None: + result = {"type": "None"} + else: + require(_TYPE(output) is _LIST and all(_TYPE(value) is _INT for value in output), + "Trace requires an exact integer list or None result") + result = {"type": "list", "values": output} + record = {"call": self.count, "us": us, "vs": vs, "result": result} + encoded = json.dumps(record, sort_keys=True, separators=(",", ":"), ensure_ascii=True).encode("ascii") + b"\n" + self.hasher.update(encoded) + self.bytes += _LEN(encoded) + self.count += 1 + + def receipt(self): + return {"calls": self.count, "canonical_stream_bytes": self.bytes, + "sha256": self.hasher.hexdigest(), + "schema": "v2-jsonl:call,us,vs,result(type=list+values or type=None); ordered exact integer vectors"} + + +def build_native(directory): + """Always cold compile/link/load once. The parent supplies the outer guard.""" + require(sys.implementation.name == "cpython" and sys.version_info[:2] == (3, 12), + "This qualification is frozen to CPython 3.12") + require(sys.platform.startswith("linux"), "This qualification is frozen to Linux") + directory = Path(directory) + require(not directory.exists(), "Refusing to reuse a native build directory") + directory.mkdir(parents=True) + source = ROOT / "native_gf2.c" + source_before = source.read_bytes() + source_hash = hashlib.sha256(source_before).hexdigest() + suffix = sysconfig.get_config_var("EXT_SUFFIX") + require(_TYPE(suffix) is str and suffix.endswith(".so"), "Unexpected extension suffix") + target = directory / ("_packed_gf2" + suffix) + compiler = shlex.split(sysconfig.get_config_var("CC") or "cc") + require(compiler, "Missing configured C compiler") + command = compiler + ["-shared", "-fPIC", "-O3", "-std=c11", "-Wall", "-Wextra", "-Werror", + "-I" + sysconfig.get_paths()["include"], str(source), "-o", str(target)] + completed = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + text=True, timeout=90, check=False) + manifest = {"command": command, "returncode": completed.returncode, + "stdout": completed.stdout, "stderr": completed.stderr, + "c_source_sha256": source_hash, "python": sys.version, + "no_cached_binary": True} + (directory / "build.json").write_text(json.dumps(manifest, indent=2, sort_keys=True) + "\n") + require(completed.returncode == 0, "Native compilation failed; see build.json (no retry)") + require(source.read_bytes() == source_before, "Native source changed during compilation") + manifest["extension_sha256"] = hashlib.sha256(target.read_bytes()).hexdigest() + spec = importlib.util.spec_from_file_location("_packed_gf2", target) + require(spec is not None and spec.loader is not None, "Missing extension loader") + native = importlib.util.module_from_spec(spec) + spec.loader.exec_module(native) + (directory / "build.json").write_text(json.dumps(manifest, indent=2, sort_keys=True) + "\n") + return native, manifest + + +def attach_trace(module, rank_calls, complement_trace=None): + """Baseline observers; original arithmetic and return objects stay intact.""" + original_rank = module.rank + original_complement = module.Label.complement_in + + def traced_rank(rows): + frozen_rows = _TUPLE(rows) + answer = original_rank(frozen_rows) + require(_TYPE(answer) is _INT, "Rank output type changed") + rank_calls.append((frozen_rows, answer)) + return answer + + def traced_complement(self, other): + inputs = complement_trace.before(self, other) + answer = original_complement(self, other) + complement_trace.after(inputs, answer) + return answer + + module.rank = traced_rank + if complement_trace is not None: + module.Label.complement_in = traced_complement + return original_rank + + +def bind(module, native, rank_calls=None, complement_trace=None): + """Replace two methods only; any detected runtime drift is a hard failure.""" + require(_TYPE(native) is ModuleType, "Unexpected native module type") + native_complement = _DICT_GET(native.__dict__, "complement") + native_gram = _DICT_GET(native.__dict__, "gram_rank") + require(_TYPE(native_complement) is BuiltinFunctionType and native_complement.__self__ is native and + _TYPE(native_gram) is BuiltinFunctionType and native_gram.__self__ is native, + "Missing or replaced native entry points") + label = guard_module(module) + original_functions = [module.__dict__[name] for name in _HELPER_NAMES] + original_functions.extend(value for value in label.__dict__.values() if _TYPE(value) is FunctionType) + original_complement = label.complement_in + original_nondegenerate = label.nondegenerate + original_dot = module.dot + original_rank = module.rank + if rank_calls is not None: + attach_trace(module, rank_calls) + counters = {"complement_native": 0, "complement_fallback": 0, + "gram_native": 0, "gram_fallback": 0} + runtime = None + + def complement_in(self, other): + runtime.check() + inputs = None if complement_trace is None else complement_trace.before(self, other) + if _TYPE(self) is label and _TYPE(other) is label: + big_dict = _OBJECT_GETATTRIBUTE(other, "__dict__") + small_dict = _OBJECT_GETATTRIBUTE(self, "__dict__") + if _TYPE(big_dict) is _DICT and _TYPE(small_dict) is _DICT: + big = _DICT_GET(big_dict, "basis") + small = _DICT_GET(small_dict, "basis") + if _TYPE(big) is _DICT and _TYPE(small) is _DICT: + result = native_complement(small, big) + if result is not NotImplemented: + counters["complement_native"] += 1 + if complement_trace is not None: + complement_trace.after(inputs, result) + return result + counters["complement_fallback"] += 1 + result = original_complement(self, other) + if complement_trace is not None: + complement_trace.after(inputs, result) + return result + + def nondegenerate(self): + runtime.check() + if _TYPE(self) is label: + instance = _OBJECT_GETATTRIBUTE(self, "__dict__") + if _TYPE(instance) is _DICT: + basis = _DICT_GET(instance, "basis") + if _TYPE(basis) is _DICT: + answer = native_gram(basis) + if answer is not NotImplemented: + rows, rank = answer + if rank_calls is not None: + require(_TYPE(rank) is _INT, "Native rank output type changed") + rank_calls.append((rows, rank)) + counters["gram_native"] += 1 + return rank == _LEN(rows) + counters["gram_fallback"] += 1 + return original_nondegenerate(self) + + label.complement_in = complement_in + label.nondegenerate = nondegenerate + # Set the closure before capturing it, then initialize the guard in place. + # Thus every captured cell identity is its final stable value. + runtime = _OBJECT.__new__(RuntimeGuard) + RuntimeGuard.__init__(runtime, module, label, native, original_functions) + return {"counters": counters, "original_complement": original_complement, + "original_nondegenerate": original_nondegenerate, "original_dot": original_dot, + "original_rank": original_rank, "label": label, "runtime_guard": runtime} diff --git a/research/gf2-side-verification/native_gf2.c b/research/gf2-side-verification/native_gf2.c new file mode 100644 index 0000000000..0b6a835981 --- /dev/null +++ b/research/gf2-side-verification/native_gf2.c @@ -0,0 +1,209 @@ +#define PY_SSIZE_T_CLEAN +#include +#include +#include + +/* This module is deliberately bounded. Unsupported inputs return the sentinel + * NotImplemented; the Python binder calls the unchanged source implementation. + * No Python integer is truncated, and the GIL remains held for each bounded call. + */ +_Static_assert(sizeof(unsigned long long) * CHAR_BIT == 64, + "This finite backend requires 64-bit unsigned long long"); + +/* Read exact dict values in their insertion order. Keys are not observed by the + * original two methods either. Return 1 for supported inputs, 0 for fallback, + * and -1 for a genuine Python error. No caller object is changed. + */ +static int read_vectors(PyObject *basis, uint64_t vectors[64], Py_ssize_t *count) { + Py_ssize_t position = 0; + Py_ssize_t length; + Py_ssize_t at = 0; + PyObject *key; + PyObject *value; + if (!PyDict_CheckExact(basis)) return 0; + length = PyDict_Size(basis); + if (length < 0) return -1; + if (length > 64) return 0; + while (PyDict_Next(basis, &position, &key, &value)) { + unsigned long long converted; + (void)key; + if (!PyLong_CheckExact(value)) return 0; + converted = PyLong_AsUnsignedLongLong(value); + if (PyErr_Occurred()) { + if (PyErr_ExceptionMatches(PyExc_OverflowError)) { + PyErr_Clear(); + return 0; + } + return -1; + } + if (at >= length) { + PyErr_SetString(PyExc_RuntimeError, "basis size changed during conversion"); + return -1; + } + vectors[at++] = (uint64_t)converted; + } + if (at != length) { + PyErr_SetString(PyExc_RuntimeError, "basis size changed during conversion"); + return -1; + } + *count = length; + return 1; +} + +/* XOR folding preserves parity; 0x6996 encodes parity of the low four bits. */ +static unsigned parity64(uint64_t x) { + x ^= x >> 32; + x ^= x >> 16; + x ^= x >> 8; + x ^= x >> 4; + return (unsigned)((UINT64_C(0x6996) >> (x & UINT64_C(15))) & UINT64_C(1)); +} + +/* Only the scalar rank is observed. Forward elimination is sufficient. */ +static Py_ssize_t binary_rank(uint64_t rows[64], Py_ssize_t n) { + Py_ssize_t rank = 0; + unsigned column; + for (column = 0; column < 64 && rank < n; ++column) { + uint64_t bit = UINT64_C(1) << column; + Py_ssize_t pivot = rank; + Py_ssize_t i; + uint64_t temp; + while (pivot < n && !(rows[pivot] & bit)) ++pivot; + if (pivot == n) continue; + temp = rows[rank]; rows[rank] = rows[pivot]; rows[pivot] = temp; + for (i = rank + 1; i < n; ++i) { + if (rows[i] & bit) rows[i] ^= rows[rank]; + } + ++rank; + } + return rank; +} + +/* Return (the original ordered Gram rows, its exact rank), so the same full + * rank transcript can be recorded by both benchmark arms. The public Label + * method still returns exactly bool, including True for the empty basis. + */ +static PyObject *gram_rank(PyObject *self, PyObject *args) { + PyObject *basis; + uint64_t vectors[64]; + uint64_t rows[64]; + uint64_t work[64]; + Py_ssize_t n = 0; + Py_ssize_t i; + Py_ssize_t j; + Py_ssize_t rank; + int accepted; + PyObject *gram; + PyObject *rank_value; + PyObject *answer; + (void)self; + if (!PyArg_ParseTuple(args, "O:gram_rank", &basis)) return NULL; + accepted = read_vectors(basis, vectors, &n); + if (accepted < 0) return NULL; + if (!accepted) Py_RETURN_NOTIMPLEMENTED; + for (i = 0; i < n; ++i) { + uint64_t row = 0; + for (j = 0; j < n; ++j) { + row |= (uint64_t)parity64(vectors[i] & vectors[j]) << (unsigned)j; + } + rows[i] = row; + work[i] = row; + } + rank = binary_rank(work, n); + gram = PyTuple_New(n); + if (gram == NULL) return NULL; + for (i = 0; i < n; ++i) { + PyObject *value = PyLong_FromUnsignedLongLong((unsigned long long)rows[i]); + if (value == NULL) { Py_DECREF(gram); return NULL; } + PyTuple_SET_ITEM(gram, i, value); + } + rank_value = PyLong_FromSsize_t(rank); + if (rank_value == NULL) { Py_DECREF(gram); return NULL; } + answer = PyTuple_New(2); + if (answer == NULL) { Py_DECREF(gram); Py_DECREF(rank_value); return NULL; } + PyTuple_SET_ITEM(answer, 0, gram); + PyTuple_SET_ITEM(answer, 1, rank_value); + return answer; +} + +/* Literal ordered augmented-row algorithm from Label.complement_in. + * low k bits: pairings against self, in self.basis insertion order. + * high n bits: coefficient identity for other.basis, in its insertion order. + * The first available pivot and ALL-row clearing match the source exactly; + * output rows stay in the identical order and are not re-canonicalized. + */ +static PyObject *complement(PyObject *self, PyObject *args) { + PyObject *small; + PyObject *big; + uint64_t us[64]; + uint64_t vs[64]; + uint64_t rows[64]; + Py_ssize_t k = 0; + Py_ssize_t n = 0; + Py_ssize_t i; + Py_ssize_t j; + Py_ssize_t column; + Py_ssize_t rank = 0; + int accepted; + uint64_t low_mask; + PyObject *out; + (void)self; + if (!PyArg_ParseTuple(args, "OO:complement", &small, &big)) return NULL; + accepted = read_vectors(big, vs, &n); + if (accepted < 0) return NULL; + if (!accepted) Py_RETURN_NOTIMPLEMENTED; + accepted = read_vectors(small, us, &k); + if (accepted < 0) return NULL; + if (!accepted || k + n > 64) Py_RETURN_NOTIMPLEMENTED; + for (i = 0; i < n; ++i) { + uint64_t row = UINT64_C(1) << (unsigned)(k + i); + for (j = 0; j < k; ++j) { + row |= (uint64_t)parity64(vs[i] & us[j]) << (unsigned)j; + } + rows[i] = row; + } + for (column = 0; column < k; ++column) { + uint64_t bit = UINT64_C(1) << (unsigned)column; + Py_ssize_t pivot = rank; + uint64_t temp; + while (pivot < n && !(rows[pivot] & bit)) ++pivot; + if (pivot == n) continue; + temp = rows[rank]; rows[rank] = rows[pivot]; rows[pivot] = temp; + for (i = 0; i < n; ++i) { + if (i != rank && (rows[i] & bit)) rows[i] ^= rows[rank]; + } + ++rank; + } + low_mask = k == 64 ? UINT64_MAX : ((UINT64_C(1) << (unsigned)k) - UINT64_C(1)); + out = PyList_New(n - rank); + if (out == NULL) return NULL; + for (i = rank; i < n; ++i) { + uint64_t x = 0; + PyObject *value; + if (rows[i] & low_mask) { + Py_DECREF(out); + PyErr_SetString(PyExc_AssertionError, ""); + return NULL; + } + for (j = 0; j < n; ++j) { + if ((rows[i] >> (unsigned)(k + j)) & UINT64_C(1)) x ^= vs[j]; + } + value = PyLong_FromUnsignedLongLong((unsigned long long)x); + if (value == NULL) { Py_DECREF(out); return NULL; } + PyList_SET_ITEM(out, i - rank, value); + } + return out; +} + +static PyMethodDef methods[] = { + {"gram_rank", gram_rank, METH_VARARGS, "Ordered GF(2) Gram rows and exact rank, or NotImplemented."}, + {"complement", complement, METH_VARARGS, "Exact ordered GF(2) complement vectors, or NotImplemented."}, + {NULL, NULL, 0, NULL} +}; +static struct PyModuleDef module_definition = { + PyModuleDef_HEAD_INIT, "_packed_gf2", "Bounded exact GF(2) verification kernels.", + -1, methods, NULL, NULL, NULL, NULL +}; +PyMODINIT_FUNC PyInit__packed_gf2(void) { + return PyModule_Create(&module_definition); +} diff --git a/research/gf2-side-verification/profile_side_verifier.py b/research/gf2-side-verification/profile_side_verifier.py new file mode 100644 index 0000000000..807855eb87 --- /dev/null +++ b/research/gf2-side-verification/profile_side_verifier.py @@ -0,0 +1,193 @@ +#!/usr/bin/env python3 +"""Diagnostic profile of an unchanged, frozen h=25 side verification scope. + +This is not complex_network.certificate(), a selected-frontier replay, a +construction search, or a performance qualification. Run only under the +parent's serial process-group guard. No compiler or third-party dependency. +""" +from __future__ import annotations + +import argparse +import ast +from collections import Counter +import cProfile +import hashlib +import importlib.util +import json +import os +from pathlib import Path +import pstats +import sys +import time + +BASE_MAIN = "de5ec2e7a6074068452f45b1a191b5c72832df4a" +PINS = { + "complex_circuit.py": "d623617f7c5cb3189580883a8ab30c0bd3832688ae3f1f0c1f881bbbbff8e0c1", + "complex_network.py": "0da395e67ac04fa213494e71012c1b19b544596d34cdce5a3b172b1fb6af5f1b", +} +ROOT = Path(__file__).resolve().parent + + +def require(condition, message): + if not condition: + raise RuntimeError(message) + + +def canonical(value): + return json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=True).encode("ascii") + + +def digest(value): + return hashlib.sha256(canonical(value)).hexdigest() + + +def source_check(): + for name, expected in PINS.items(): + actual = hashlib.sha256((ROOT / "source" / name).read_bytes()).hexdigest() + require(actual == expected, "Source digest changed: " + name) + tree = ast.parse((ROOT / "source" / "complex_network.py").read_text()) + hs = [ast.literal_eval(node.value) for node in tree.body + if isinstance(node, ast.Assign) and + any(isinstance(target, ast.Name) and target.id == "H" for target in node.targets)] + require(hs == [25], "The unchanged caller no longer freezes H=25") + return hs[0] + + +def run_side(h, rank_calls, phases): + def phase(name, action): + start_wall = time.perf_counter() + start_cpu = time.process_time() + value = action() + phases[name] = {"wall_seconds": time.perf_counter() - start_wall, + "cpu_seconds": time.process_time() - start_cpu} + return value + + def load(): + spec = importlib.util.spec_from_file_location("_frozen_matrix_complex_circuit", ROOT / "source" / "complex_circuit.py") + require(spec is not None and spec.loader is not None, "Cannot load frozen module") + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + module = phase("load", load) + original_rank = module.rank + + def traced_rank(rows): + frozen_rows = tuple(rows) + result = original_rank(frozen_rows) + require(type(result) is int, "Rank result changed its exact type") + rank_calls.append((frozen_rows, result)) + return result + + module.rank = traced_rank + circuit = phase("construction", lambda: module.ComplexSideCircuit(h)) + checks = phase("checks_initialization", lambda: module.Checks(circuit)) + code = phase("compile_roles", lambda: module.compile_roles(circuit)) + side_map = phase("verify_map", checks.verify_map) + labels = phase("verify_labels", checks.verify_labels) + roles = phase("verify_role_frames", lambda: module.verify_role_frames(circuit, checks, code)) + # These are exactly the complete finite side checks called, in this order, + # by complex_network.certificate(). No mathematical parameters are varied. + result = {"circuit": circuit.stats(), "side_map": side_map, + "labels": labels, "role_frames": roles} + return circuit, checks, code, result + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--output", type=Path, required=True) + args = parser.parse_args() + require(sys.flags.optimize == 0, "This source uses assert; profile must run without -O") + sys.dont_write_bytecode = True + require(not args.output.exists(), "Refusing to overwrite diagnostic evidence") + args.output.mkdir(parents=True) + h = source_check() + profile = cProfile.Profile() + rank_calls = [] + phases = {} + start_wall = time.perf_counter() + start_cpu = time.process_time() + circuit, checks, code, result = profile.runcall(run_side, h, rank_calls, phases) + profile_cpu = time.process_time() - start_cpu + profile_wall = time.perf_counter() - start_wall + profile.dump_stats(str(args.output / "profile.pstats")) + stats = pstats.Stats(profile) + targeted = [] + all_source = [] + for (filename, line, name), (primitive, total, self_time, cumulative, callers) in stats.stats.items(): + if filename.endswith("complex_circuit.py"): + row = {"name": name, "line": line, "primitive_calls": primitive, + "total_calls": total, "self_seconds": self_time, + "cumulative_seconds": cumulative} + all_source.append(row) + if name in {"rank", "echelon", "reduce", "dot", "complement_in", "nondegenerate"}: + targeted.append(row) + shape_counts = Counter((len(rows), max((x.bit_length() for x in rows), default=0)) + for rows, _ in rank_calls) + unique = {} + for rows, rank in rank_calls: + previous = unique.setdefault(rows, rank) + require(previous == rank, "Identical rank matrices produced different outputs") + # Preserve the ordered trace, exact rows and expected outputs. This frozen + # corpus enables a later conversion-plus-native check without a new search. + with (args.output / "rank-trace.jsonl").open("x", encoding="ascii") as output: + for rows, rank in rank_calls: + output.write(canonical({"rows": rows, "rank": rank}).decode("ascii") + "\n") + rank_corpus = [{"rows": rows, "rank": rank} for rows, rank in sorted(unique.items())] + (args.output / "rank-corpus.json").write_bytes(canonical(rank_corpus) + b"\n") + # Basis dictionary insertion order, labels, pivots, role order and coefficient + # numerators/denominators are all hashed without normalization of witnesses. + witnesses = { + "support": circuit.support, + "args": circuit.args, + "kind": circuit.kind, + "active": sorted(circuit.active), + "pieces": [(target, node, (coefficient.numerator, coefficient.denominator)) + for target, node, coefficient in circuit.pieces], + "labels": [(key, list(label.basis.items()), label.dim, label.key) + for key, label in checks.cache.items()], + "code": {"roles": code["roles"], "gates": code["gates"], + "sources": list(code["sources"].items()), + "outputs": list(code["outputs"].items())}, + } + receipt = { + "status": "DIAGNOSTIC_COMPLETE_SIDE_SCOPE_ONLY", + "base_main": BASE_MAIN, + "sources": PINS, + "unchanged_caller": "scripts/complex_network.py:certificate (side verification segment)", + "h": h, + "result": result, + "result_sha256": digest(result), + "exact_witness_sha256": digest(witnesses), + "rank_trace_sha256": digest(rank_calls), + "rank_call_count": len(rank_calls), + "rank_distinct_matrix_count": len(unique), + "rank_shape_counts": [{"rows": r, "columns": c, "calls": n} + for (r, c), n in sorted(shape_counts.items())], + "profiled_complete_side_wall_seconds": profile_wall, + "profiled_complete_side_cpu_seconds": profile_cpu, + "profiled_phases": phases, + "targeted_functions": sorted(targeted, key=lambda item: item["cumulative_seconds"], reverse=True), + "all_source_functions": sorted(all_source, key=lambda item: item["self_seconds"], reverse=True), + "environment": {"python": sys.version, "executable": sys.executable, + "platform": sys.platform, "pid": os.getpid()}, + "limitations": [ + "Profiled timings include cProfile and exact rank-trace instrumentation.", + "Cumulative times are nested and must not be summed.", + "No native code or candidate execution; no speedup established.", + "The complete side verification segment is not the full complex-network certificate.", + "No PR5864 workload is executed and no matrix time counts toward its improvement target.", + "No new construction, parameter search, kappa admission or formal theorem verification.", + ], + } + (args.output / "receipt.json").write_text(json.dumps(receipt, indent=2, sort_keys=True) + "\n") + print(json.dumps({"status": receipt["status"], "h": h, + "wall_seconds": profile_wall, "cpu_seconds": profile_cpu, + "rank_calls": len(rank_calls), "rank_distinct_matrices": len(unique), + "result_sha256": receipt["result_sha256"], + "exact_witness_sha256": receipt["exact_witness_sha256"], + "targeted_functions": receipt["targeted_functions"]}, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/gf2-side-verification/replay.py b/research/gf2-side-verification/replay.py new file mode 100644 index 0000000000..2fef23fc04 --- /dev/null +++ b/research/gf2-side-verification/replay.py @@ -0,0 +1,23 @@ +"""One cold complete side replay, bounded and serial; no automatic repetition.""" +import fcntl +import os +from pathlib import Path +import sys +import guard + +PACKAGE = Path(__file__).resolve().parent +if len(sys.argv) != 3 or sys.argv[1] not in ('B', 'C'): + raise ValueError('replay.py B|C NEW_EXTERNAL_EVIDENCE_DIRECTORY') +evidence = Path(sys.argv[2]).resolve() +if evidence.exists() or evidence.is_relative_to(PACKAGE): + raise ValueError('new evidence directory outside the immutable package required') +evidence.mkdir(parents=True) +os.environ['CROC_GF2_SIDE_OUTPUT'] = str(evidence / 'scientific') +guard.HERE = evidence +guard.SOURCE = PACKAGE +guard.CLOSURE = tuple(sorted(str(p.relative_to(PACKAGE)) for p in PACKAGE.rglob('*') + if p.is_file() and '__pycache__' not in p.parts)) +guard.AGGREGATE = 600 +with (evidence / 'execution.lock').open('a') as lock: + fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB) + guard.run('complete-' + sys.argv[1], 'full_' + sys.argv[1] + '.py') diff --git a/research/gf2-side-verification/source/complex_circuit.py b/research/gf2-side-verification/source/complex_circuit.py new file mode 100644 index 0000000000..9e83a1065c --- /dev/null +++ b/research/gf2-side-verification/source/complex_circuit.py @@ -0,0 +1,454 @@ +#!/usr/bin/env python3 +"""Compressed side correction for the complex network, with binary frames. + +Target S must receive (1/2) * sum{x_T : T disjoint from S} +minus (1/2) * sum{x_T : |S cap T| = 2}. Both sums are computed by +cancellation-free addition graphs and injected as pieces with those weights. + +Labels are subspaces of F2^h with the dot product. A disjoint-sum node carries +the coordinate space of its covered points; a pair-star node carries the span +of its triple indicators, which is orthonormal. An injected piece must leave a +point outside S uncovered: the residual up to t_S^perp then contains an odd +coordinate vector. A disjoint piece covering every point outside S would have +the alternating residual , so the disjoint sum is split. +""" +from fractions import Fraction as Q +from itertools import combinations + +EMPTY = frozenset() + + +def subsets(points, k): + return [frozenset(c) for j in range(min(k, len(points))+1) + for c in combinations(points, j)] + + +class ComplexSideCircuit: + def __init__(self, h): + assert h >= 8, 'Need at least four points outside every target' + self.h = h + self.triples = list(combinations(range(h), 3)) + self.index = {t: i for i, t in enumerate(self.triples)} + self.support = [0]; self.args = [None]; self.kind = [None] + self.lookup = {}; self.input = {} + for i, t in enumerate(self.triples): + self.input[t] = len(self.support) + self.support.append(1 << i); self.args.append(None); self.kind.append('in') + self.points = {} # covered point masks, filled lazily + self.pieces = [] # (target, node, coefficient) + self.build_disjoint() + self.build_pair_stars() + self.prune() + + # -- node store ------------------------------------------------------- + def x(self, *pts): + return self.input[tuple(sorted(pts))] + + def add(self, a, b, kind): + if not a: return b + if not b: return a + sa, sb = self.support[a], self.support[b] + assert not sa & sb, 'Cancellation is forbidden' + key = (kind, sa | sb) + node = self.lookup.get(key) + if node is None: + node = len(self.support) + self.lookup[key] = node + self.support.append(sa | sb); self.args.append((a, b)); self.kind.append(kind) + return node + + def total(self, nodes, kind): + nodes = [x for x in nodes if x] + while len(nodes) > 1: + nodes = [self.add(nodes[i], nodes[i+1], kind) if i+1 < len(nodes) else nodes[i] + for i in range(0, len(nodes), 2)] + return nodes[0] if nodes else 0 + + # -- disjoint sums ---------------------------------------------------- + def vec(self, items, k): + """{E: sum of item nodes whose points avoid E}, |E| <= k.""" + if not items: return {EMPTY: 0} + if len(items) == 1: + p, node = items[0] + return {EMPTY: node, frozenset([p]): 0} if k else {EMPTY: node} + half = len(items)//2 + A = self.vec(items[:half], k); B = self.vec(items[half:], k) + return {ea | eb: self.add(xa, xb, 'd0') for ea, xa in A.items() + for eb, xb in B.items() if len(ea)+len(eb) <= k} + + def pairs(self, pts, weight, k): + """{E: sum of weight(u,v) over pairs avoiding E}, |E| <= k.""" + if len(pts) < 2: return {E: 0 for E in subsets(pts, k)} + half = len(pts)//2; L, R = pts[:half], pts[half:] + PL = self.pairs(L, weight, k); PR = self.pairs(R, weight, k) + rows = {u: self.vec([(r, weight(u, r)) for r in R], k) for u in L} + cross = {} + for ER in subsets(R, k): + for EL, node in self.vec([(u, rows[u][ER]) for u in L], k-len(ER)).items(): + cross[EL, ER] = node + return {EL | ER: self.total([xl, xr, cross[EL, ER]], 'd0') + for EL, xl in PL.items() for ER, xr in PR.items() if len(EL)+len(ER) <= k} + + def tri_parts(self, pts, k): + """Recursive halves and the two mixed families, before combination.""" + half = len(pts)//2; L, R = pts[:half], pts[half:] + TL = self.tri(L, k); TR = self.tri(R, k) + PR = {r: self.pairs(L, lambda u, v, r=r: self.x(u, v, r), k) for r in R} + PL = {u: self.pairs(R, lambda a, b, u=u: self.x(u, a, b), k) for u in L} + return L, R, TL, TR, PR, PL + + def tri(self, pts, k): + """{E: sum of triples inside pts avoiding E}, |E| <= k.""" + if len(pts) < 3: return {E: 0 for E in subsets(pts, k)} + L, R, TL, TR, PR, PL = self.tri_parts(pts, k) + c21 = {}; c12 = {} + for EL in subsets(L, k): + for ER, node in self.vec([(r, PR[r][EL]) for r in R], k-len(EL)).items(): + c21[EL, ER] = node + for ER in subsets(R, k): + for EL, node in self.vec([(u, PL[u][ER]) for u in L], k-len(ER)).items(): + c12[EL, ER] = node + return {EL | ER: self.total([xl, xr, c21[EL, ER], c12[EL, ER]], 'd0') + for EL, xl in TL.items() for ER, xr in TR.items() if len(EL)+len(ER) <= k} + + def build_disjoint(self): + """Six pieces per target, each leaving an outside point uncovered.""" + pts = list(range(self.h)) + L, R, TL, TR, PR, PL = self.tri_parts(pts, 3) + R1, R2 = R[:len(R)//2], R[len(R)//2:] + L1, L2 = L[:len(L)//2], L[len(L)//2:] + for S in self.triples: + E = frozenset(S); EL = E & frozenset(L); ER = E & frozenset(R) + pieces = [TL[EL], TR[ER]] + for half in (R1, R2): + pieces.append(self.vec([(r, PR[r][EL]) for r in half], 3-len(EL))[ER & frozenset(half)]) + for half in (L1, L2): + pieces.append(self.vec([(u, PL[u][ER]) for u in half], 3-len(ER))[EL & frozenset(half)]) + for node in pieces: self.emit(S, node, Q(1, 2)) + + # -- pair stars ------------------------------------------------------- + def build_pair_stars(self): + """Prefix and suffix pair-star sums around each excluded third point.""" + h = self.h + for a, b in combinations(range(h), 2): + others = [u for u in range(h) if u not in (a, b)] + n = len(others) + pre = [0] + for u in others: pre.append(self.add(pre[-1], self.x(a, b, u), 'd2')) + suf = [0]*(n+1) + for i in range(n-1, -1, -1): suf[i] = self.add(self.x(a, b, others[i]), suf[i+1], 'd2') + for i, c in enumerate(others): + S = tuple(sorted((a, b, c))) + self.emit(S, pre[i], Q(-1, 2)); self.emit(S, suf[i+1], Q(-1, 2)) + + def emit(self, S, node, coef): + """Inject a piece, splitting it until it leaves a point outside S uncovered.""" + if not node: return + if self.cover(node) | sum(1 << p for p in S) == (1 << self.h)-1: + a, b = self.args[node] + self.emit(S, a, coef); self.emit(S, b, coef) + else: + self.pieces.append((S, node, coef)) + + # -- bookkeeping ------------------------------------------------------ + def prune(self): + self.active = set(); stack = [node for _, node, _ in self.pieces] + while stack: + node = stack.pop() + if node in self.active: continue + self.active.add(node) + if self.args[node]: stack.extend(self.args[node]) + self.additions = sum(self.args[n] is not None for n in self.active) + self.roles = self.additions + len(self.pieces) + + def cover(self, node): + """Mask of ground points covered by the node's source triples.""" + if node not in self.points: + s = self.support[node]; mask = 0 + while s: + low = s & -s; mask |= sum(1 << p for p in self.triples[low.bit_length()-1]); s ^= low + self.points[node] = mask + return self.points[node] + + def stats(self): + v = len(self.triples) + return dict(h=self.h, v=v, additions=self.additions, injections=len(self.pieces), + roles=self.roles, roles_per_target=round(self.roles/v, 3), + disjoint_additions=sum(self.kind[n] == 'd0' for n in self.active), + pair_star_additions=sum(self.kind[n] == 'd2' for n in self.active)) + + +# -- binary linear algebra on F2^h, vectors as integer masks --------------- +def echelon(vectors): + """Reduced basis {pivot bit: vector}; raises on dependence.""" + basis = {} + for x in vectors: + for bit, b in basis.items(): + if x & bit: x ^= b + assert x, 'Dependent label vectors' + bit = x & -x + for other in basis: + if basis[other] & bit: basis[other] ^= x + basis[bit] = x + return basis + + +def reduce(basis, x): + for bit, b in basis.items(): + if x & bit: x ^= b + return x + + +def dot(x, y): + return (x & y).bit_count() & 1 + + +def rank(rows): + rows = list(rows); r = 0 + for col in range(max((x.bit_length() for x in rows), default=0)): + bit = 1 << col + pivot = next((i for i in range(r, len(rows)) if rows[i] & bit), None) + if pivot is None: continue + rows[r], rows[pivot] = rows[pivot], rows[r] + for i in range(len(rows)): + if i != r and rows[i] & bit: rows[i] ^= rows[r] + r += 1 + return r + + +class Label: + """A binary subspace with a canonical basis.""" + def __init__(self, vectors): + self.basis = echelon(vectors); self.dim = len(self.basis) + self.key = tuple(sorted(self.basis.values())) + + def contains(self, other): + return all(not reduce(self.basis, x) for x in other.basis.values()) + + def nondegenerate(self): + vs = list(self.basis.values()) + return rank([sum(dot(a, b) << j for j, b in enumerate(vs)) for a in vs]) == len(vs) + + def complement_in(self, other): + """Basis of other ∩ self^perp, assuming self ⊆ other.""" + vs = list(other.basis.values()); us = list(self.basis.values()); k = len(us) + rows = [sum(dot(v, u) << j for j, u in enumerate(us)) | 1 << (k+i) + for i, v in enumerate(vs)] + r = 0 + for col in range(k): + bit = 1 << col + piv = next((i for i in range(r, len(rows)) if rows[i] & bit), None) + if piv is None: continue + rows[r], rows[piv] = rows[piv], rows[r] + for i in range(len(rows)): + if i != r and rows[i] & bit: rows[i] ^= rows[r] + r += 1 + out = [] + for row in rows[r:]: + assert not row & ((1 << k)-1) + x = 0 + for i, v in enumerate(vs): + if row >> (k+i) & 1: x ^= v + out.append(x) + return out + + +def odd(vectors): + return any(x.bit_count() & 1 for x in vectors) + + +# -- exact checks ----------------------------------------------------------- +def tmask(t): + return sum(1 << p for p in t) + + +class Checks: + """Exact verification of the side map, labels and compiled roles.""" + def __init__(self, c): + self.c = c; self.h = c.h; self.cache = {}; self.verdicts = {} + self.everything = Label([1 << p for p in range(c.h)]) + + def label(self, node): + if node in self.cache: return self.cache[node] + c = self.c; kind = c.kind[node] + if kind == 'in': + vectors = [tmask(c.triples[node-1])] + elif kind == 'd0': + m = c.cover(node); vectors = [1 << p for p in range(self.h) if m >> p & 1] + else: + s = c.support[node]; ts = [] + while s: + low = s & -s; ts.append(c.triples[low.bit_length()-1]); s ^= low + common = set(ts[0]).intersection(*ts) + assert len(common) >= 2, 'Pair-star node without a common pair' + vectors = [tmask(t) for t in ts] + lab = Label(vectors); self.cache[node] = lab + return lab + + def target_frame(self, S): + t = tmask(S) + key = ('perp', S) + if key not in self.cache: + self.cache[key] = Label([x for x in (1 << p for p in range(self.h)) + if not dot(x, t)] + [tmask((S[0], S[1])), tmask((S[1], S[2]))]) + return self.cache[key] + + def residual_ok(self, small, big): + """small ⊆ big and big ⊖ small is zero or has an odd vector.""" + key = (small.key, big.key) + if key not in self.verdicts: + res = small.complement_in(big) if big.contains(small) else None + self.verdicts[key] = res is not None and (not res or odd(res)) + return self.verdicts[key] + + def label_ok(self, lab): + """Nondegenerate, contains an odd vector, and its complement is zero or does.""" + key = ('label', lab.key) + if key not in self.verdicts: + perp = lab.complement_in(self.everything) + self.verdicts[key] = (lab.nondegenerate() and odd(lab.basis.values()) + and (not perp or odd(perp))) + return self.verdicts[key] + + def verify_map(self): + c = self.c + for node in c.active: + if c.args[node]: + a, b = c.args[node] + assert a < node and b < node and not c.support[a] & c.support[b] + assert c.support[node] == c.support[a] | c.support[b] + got = {} + for S, node, coef in c.pieces: + assert coef in (Q(1, 2), Q(-1, 2)) + key = (S, coef) + assert not got.get(key, 0) & c.support[node], 'Overlapping pieces' + got[key] = got.get(key, 0) | c.support[node] + nonzero = 0 + for S in c.triples: + zero = sum(1 << i for i, T in enumerate(c.triples) if not set(S) & set(T)) + two = sum(1 << i for i, T in enumerate(c.triples) if len(set(S) & set(T)) == 2) + assert got.get((S, Q(1, 2)), 0) == zero and got.get((S, Q(-1, 2)), 0) == two + nonzero += zero.bit_count()+two.bit_count() + return dict(targets=len(c.triples), nonzero_coefficients=nonzero, + side_map_exact=True, coefficients='+1/2 disjoint, -1/2 intersection two') + + def verify_labels(self): + c = self.c; checked = 0 + for node in sorted(c.active): + lab = self.label(node) + assert self.label_ok(lab), node # includes the exit to the full space + if c.args[node]: + for child in c.args[node]: + assert self.residual_ok(self.label(child), lab), (node, child) + checked += 1 + for S, node, coef in c.pieces: + assert self.residual_ok(self.label(node), self.target_frame(S)), (S, node) + checked += 1 + return dict(active_nodes=len(c.active), checked_inclusions=checked, + all_labels_nondegenerate=True, all_residuals_have_odd_vectors=True) + + +def compile_roles(c): + """Reversible roles: one per addition plus one per injected piece.""" + users = {x: [] for x in c.active} + for node in sorted(c.active): + if c.args[node]: + for pos, x in enumerate(c.args[node]): users[x].append(('gate', node, pos)) + for i, (_, node, _) in enumerate(c.pieces): users[node].append(('output', i)) + edge = {}; sources = {}; outputs = {}; gates = []; size = 0 + for node in sorted(c.active): + if c.args[node]: + ins = (edge[node, 0], edge[node, 1]); pivot = ins[0] + else: + pivot = size; size += 1; ins = (pivot,); sources[c.triples[node-1]] = pivot + assert users[node] + outs = (pivot,)+tuple(range(size, size+len(users[node])-1)) + size += len(users[node])-1 + assert len(set(ins)) == len(ins) and set(ins) & set(outs) == {pivot} + gates.append((node, ins, outs)) + for user, slot in zip(users[node], outs): + if user[0] == 'gate': edge[user[1], user[2]] = slot + else: outputs[user[1]] = slot + assert size == c.roles + return dict(roles=size, gates=gates, sources=sources, outputs=outputs) + + +def verify_role_frames(c, checks, code=None): + """Follow every physical role in both directions through its frames.""" + code = code or compile_roles(c) + def step(small, big): assert checks.residual_ok(small, big) + frames = [None]*code['roles'] + for T, slot in code['sources'].items(): frames[slot] = checks.label(c.input[T]) + for node, ins, outs in code['gates']: + lab = checks.label(node) + for slot in set(ins+outs): + if frames[slot] is None: assert checks.label_ok(lab) # entry from D0 + else: step(frames[slot], lab) + frames[slot] = lab + for i, slot in code['outputs'].items(): + S = c.pieces[i][0]; J = checks.target_frame(S) + step(frames[slot], J); frames[slot] = J + for lab in frames: + assert checks.label_ok(lab) # includes the exit residual to D1 + # Reverse stage: complements, traversed backward. U^perp grows iff U shrinks. + # Its entries and exits have the forward residuals U^perp and U, checked above. + back = [None]*code['roles'] + for i, slot in code['outputs'].items(): back[slot] = ('line', c.pieces[i][0]) + for node, ins, outs in reversed(code['gates']): + lab = checks.label(node) + for slot in set(ins+outs): + prev = back[slot] + if prev is None: + assert checks.label_ok(lab) # reverse entry residual is lab^perp + elif prev[0] == 'line': # ⊆ U^perp iff U ⊆ t_S^perp + step(lab, checks.target_frame(prev[1])) + else: + step(lab, prev[1]) # prev^perp ⊆ lab^perp iff lab ⊆ prev + back[slot] = ('node', lab) + for T, slot in code['sources'].items(): + assert back[slot][1].key == checks.label(c.input[T]).key # ends at t_T^perp + return dict(roles=code['roles'], forward_frames_nested=True, + reverse_complement_frames_nested=True) + + +def simulate_invocation(c, code, x, y, side, center, inverse=False): + """Scalar invocation over Q with arbitrary scratch; returns the new state. + + Forward: L,-J,L^-1,-R,V,G,R,L,J,L^-1,G^-1,V^-1 gives y <- y + x. + inverse=True runs the inverted schedule, giving x <- x - y. + """ + h = c.h; T = c.triples + side = list(side); center = dict(center); x = dict(x); y = dict(y) + def L(sign=1): + order = code['gates'] if sign > 0 else list(reversed(code['gates'])) + for node, ins, outs in order: + if sign > 0: + if len(ins) == 2: side[ins[0]] += side[ins[1]] + for o in outs[1:]: side[o] += side[outs[0]] + else: + for o in outs[1:]: side[o] -= side[outs[0]] + if len(ins) == 2: side[ins[0]] -= side[ins[1]] + def J(target, sign): + for i, slot in code['outputs'].items(): + S, _, coef = c.pieces[i]; target[S] += sign*coef*side[slot] + def V(source, sign): + for t, slot in code['sources'].items(): side[slot] += sign*source[t] + def G(source, sign): + for i in range(h): center[i] += sign*sum(source[t] for t in T if i in t) + center['*'] += sign*sum(source.values()) + def R(target, sign): + for t in T: target[t] += sign*(sum(center[i] for i in t)-center['*'])/2 + if not inverse: + L(); J(y, -1); L(-1); R(y, -1); V(x, 1); G(x, 1); R(y, 1) + L(); J(y, 1); L(-1); G(x, -1); V(x, -1) + else: # inverse schedule with logical source y and target x + V(y, 1); G(y, 1); L(); J(x, -1); L(-1); R(x, -1); G(y, -1); V(y, -1) + R(x, 1); L(); J(x, 1); L(-1) + return x, y, side, center + + +if __name__ == '__main__': + import sys, time + for h in map(int, sys.argv[1:] or ['10', '12', '16']): + t = time.time(); c = ComplexSideCircuit(h) + print(c.stats(), f'{time.time()-t:.1f}s', flush=True) diff --git a/research/gf2-side-verification/source/complex_network.py b/research/gf2-side-verification/source/complex_network.py new file mode 100644 index 0000000000..af9bb6d7b3 --- /dev/null +++ b/research/gf2-side-verification/source/complex_network.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python3 +"""Conditional 59/10^11 witness: a compressed complex side circuit. + +The compact-control witness was limited by the original complex motif, whose +v*z_c side wires per invocation dilute its rank deficit. The new side circuit +computes the same correction with shared sums, binary coordinate and pair-star +labels, and the bit network's transparent twelve-operation schedule. The bit +network, compact-control movement and assembly recipe are unchanged. +""" +from fractions import Fraction as Q +from math import comb +from pathlib import Path +import json + +from certify import Parameters, constraints, margins, require, verify_sources +from compact_control_layer import layer_exponents +from complex_circuit import ComplexSideCircuit, Checks, compile_roles, verify_role_frames +from paired_network import BIT_SAVING +from prepare_layers import serializable +from search_network import log_integer_bounds + +ROOT = Path(__file__).resolve().parents[1] +H = 25 +COMPLEX_SAVING = Q(14, 10**9) +LOG_BOUND = Q(966, 100) +KAPPA = Q(59, 10**11) + + +def counts(c): + h = c.h; v = comb(h, 3); m = h**3; N = v**3; I = 3*v*v + R = c.roles; W = 2*N+I*(R+h+1); L = I*(h+1)*h + s = W*m-2*N+2*L + require(L < N, 'Complex deficit is not positive') + return dict(h=h, v=v, m=m, N=N, I=I, side_roles_per_invocation=R, + central_roles=h+1, W=W, L=L, s=s, deficit=W*m-s, eta=Q(W*m-s, W*m), + original_side_wires_per_invocation=v*(comb(h-3, 3)+3*(h-3))) + + +def gate_count(c, n): + """Per invocation: four mixer passes, two copies, two injections, four central gates.""" + per = 4*len(c.active)+4*n['v']+4 + require(n['I']*per <= 12*n['W'], 'The 12W gate bound behind E=64(W+m+1)^3 failed') + return dict(gates_per_invocation=per, total_gates=n['I']*per, twelve_W=12*n['W']) + + +def guard(n, beta, zeta): + """Generalized stopped-depth guard with the new complex constants.""" + m, s, W = n['m'], n['s'], n['W'] + E = 64*(W+m+1)**3; B = s+E + require(m >= 3 and 2 <= s < m**5, 'Unverified coefficient-depth hypothesis') + require(s*(8+E) <= 9*B*B, 'One-piece constant failed') + C1 = 5-4*beta+zeta + raw = max(Q(128*m*B*B), 18*m*B*B*(1+1/zeta)) + C0 = -(-raw.numerator//raw.denominator) + require(9*m*B*B*(1+1/zeta)+18 <= C0, 'Whole-layer constant failed') + return dict(m=m, s=s, E=E, B=B, beta=beta, zeta=zeta, C0=C0, C1=C1) + + +def parameters(): + return Parameters(tau=1-BIT_SAVING, sigma=1-COMPLEX_SAVING, + epsilon=Q(19999, 100000), c=Q(999, 1000), + lam=1-Q(2958, 10**12), lamp=1-Q(2956, 10**12), + kappa=KAPPA, beta=Q(1, 1000), delta=Q(1, 10**6), + C1=Q(49961, 10000)) + + +def witness(p, n): + g = guard(n, p.beta, Q(1, 10000)) + require(p.C1 == g['C1'], 'Guard mismatch') + e = layer_exponents(p.tau, p.sigma, p.beta, p.c) + slacks = constraints(p, layout_model='nonadjacent', assembly_model='tight-gaussian') + slacks['packed_overhead'] = p.lam-e['internal'] # compact control: internal = max exponent + slacks['reserved_axes'] = p.lamp-e['preprocessing'] + for name, slack in slacks.items(): require(slack > 0, 'Constraint failed: '+name) + gs = margins(p, layout_model='nonadjacent', assembly_model='tight-gaussian') + require(min(gs.values()) > p.kappa, 'No final absorption gap') + return dict(parameters=vars(p), guard=g, recurrence=e, constraint_slacks=slacks, + margins=gs, minimum_margin=min(gs.values()), + limiting_margins=[k for k, v in gs.items() if v == min(gs.values())], + absorption_gap=min(gs.values())-p.kappa) + + +def witness_only(): + """Counts and parameter witness without the full finite checks (for the patch).""" + n = counts(ComplexSideCircuit(H)) + require(n['eta'] > COMPLEX_SAVING*LOG_BOUND, 'Complex saving failed') + return witness(parameters(), n) + + +def certificate(): + c = ComplexSideCircuit(H); checks = Checks(c); code = compile_roles(c) + side = checks.verify_map(); labels = checks.verify_labels() + roles = verify_role_frames(c, checks, code) + n = counts(c) + lo, hi = log_integer_bounds(n['m']) + require(hi < LOG_BOUND, 'Logarithm enclosure failed') + require(n['eta'] > COMPLEX_SAVING*LOG_BOUND, 'Complex saving failed') + p = parameters(); w = witness(p, n) + require(Q(1, 2**31) < KAPPA < Q(1, 2**30), 'Unexpected dyadic scale') + # With the bit exponent fixed, g3 <= epsilon*(1-lambda) < epsilon*a_b < a_b/5. + ceiling = BIT_SAVING/5 + require(ceiling < Q(1, 2**30), 'This bit network could cross 2^-30') + return dict(status='CONDITIONAL 59/10^11 WITNESS; COMPRESSED COMPLEX SIDE CIRCUIT; NOT FORMAL VERIFICATION', + upstream_commit=verify_sources(), circuit=c.stats(), side_map=side, + labels=labels, role_frames=roles, gates=gate_count(c, n), + complex_counts=n, complex_saving=COMPLEX_SAVING, log_m_upper=LOG_BOUND, + log_enclosure=(lo, hi), complex_deficit_slack=n['eta']-COMPLEX_SAVING*LOG_BOUND, + bit_saving=BIT_SAVING, witness=w, + improvement_over_compact_control=KAPPA/Q(83, 10**12), + scoped_ceiling=dict(upper=ceiling, below_2_to_minus_30=True, + scope='Published h=50 paired bit network and retained Gaussian margin; not a bound on other networks or algorithms.'), + scope='Conditional on the pinned upstream interfaces, the compact-control movement and guard proofs, the paired bit network, and the written binary-frame transfer for this complex side circuit. Exact arithmetic and finite checks are not formal verification.') + + +if __name__ == '__main__': + result = serializable(certificate()) + (ROOT/'certificates/complex-network.json').write_text(json.dumps(result, indent=2, sort_keys=True)+'\n') + print('PASS conditional', KAPPA, '> 2^-31; minimum margin', result['witness']['minimum_margin']) + print('Side roles per invocation', result['complex_counts']['side_roles_per_invocation'], + 'vs original', result['complex_counts']['original_side_wires_per_invocation']) diff --git a/research/gf2-side-verification/verify.py b/research/gf2-side-verification/verify.py new file mode 100644 index 0000000000..a044017230 --- /dev/null +++ b/research/gf2-side-verification/verify.py @@ -0,0 +1,19 @@ +"""Fresh bounded native/dense/source/fallback controls; no full timing claim.""" +from hashlib import sha256 +import json +from pathlib import Path +import runpy +import sys +import tempfile + +HERE = Path(__file__).resolve().parent +manifest = json.loads((HERE / 'CODE-SOURCES.json').read_text()) +for name, expected in manifest.items(): + path = HERE / name + if path.is_symlink() or sha256(path.read_bytes()).hexdigest() != expected: + raise ValueError('exact native verifier source: ' + name) +with tempfile.TemporaryDirectory(prefix='gf2-side-finite-') as temporary: + sys.argv = [str(HERE / 'compare_side_verifier.py'), '--mode', 'finite', + '--output', str(Path(temporary) / 'evidence')] + runpy.run_path(sys.argv[0], run_name='__main__') +print('PASS_GF2_SIDE_NATIVE_FINITE_SOURCE_CONTROLS')