diff --git a/research/p104-large-step-audit/.gitattributes b/research/p104-large-step-audit/.gitattributes new file mode 100644 index 0000000000..8e640a9232 --- /dev/null +++ b/research/p104-large-step-audit/.gitattributes @@ -0,0 +1,2 @@ +retained/** -text -whitespace +bit/inputs/** -text -whitespace diff --git a/research/p104-large-step-audit/NOTICE b/research/p104-large-step-audit/NOTICE new file mode 100644 index 0000000000..e0711e38fe --- /dev/null +++ b/research/p104-large-step-audit/NOTICE @@ -0,0 +1,17 @@ +Hao Yan (@FanPUYen), with substantial OpenAI Codex assistance. Apache-2.0. + +This package adds source-bound negative checks and proofs, not a new kappa. +DreamingOfClouds' PR7613 supplies the retained scalar word and invoice; +Clear1nsight's PR7612 supplies its base and contact-rechart pattern. The lineage +retains FanPUYen, SYLforge, ToikY, Rohan Arun and all authors named in +retained/7613/NOTICE. No predecessor source bytes are changed. + +retained/interval_gate.py is the engine from the role902 direct-lift lineage, +reused in FanPUYen's PR7604. retained/independent_interval.py is the unchanged +rational engine retained by the selected paired-query-only BIT package. +The original BIT, native/ordinary/strictification sources retain Ali Romman, +Cinna Davis, zxv, DreamingOfClouds, CubeJerry and all predecessor credit. +See retained/*NOTICE, bit/NOTICE and bit/inputs/*NOTICE. + +Separate OpenAI Codex agents performed implementation-independent checking; +no external human or formal-kernel verification is claimed. diff --git a/research/p104-large-step-audit/PROOF.md b/research/p104-large-step-audit/PROOF.md new file mode 100644 index 0000000000..29d125ae06 --- /dev/null +++ b/research/p104-large-step-audit/PROOF.md @@ -0,0 +1,97 @@ +# Necessary contact-frame cost bound + +This is a necessary-condition rejection at two specified rational C values for +the exact retained #7613 word/invoice. It supplies neither a new κ nor a universal +upper bound for multiplication. + +## Model + +Keep the scalar instructions (order, operands, coefficients), 400 main fields +and their endpoints, 1101 helpers, owned lifetimes/chart trajectories, and the +complete 17-call signed caller. Each public field follows an ascending nested +sequence of subspaces of F2^9. ADD/COPY require coframed operands; owned contacts +retain that owned frame. Arbitrary bases, new subspaces and additional public +moves between scalar contacts are permitted optimistically. + +The first variant fixes all public endpoints and targets. The second frees each +helper's input/output subspace and credits its one target with rank +`dim(output)-dim(input)`. New fields, split targets, scalar rewrites, other callers, +nonmonotone paths and changed owned operators are outside this model. + +Equal spans need not have equal ordered physical bases or phases. We do not +identify their physical operators: we drop extra basis/phase costs and legality +restrictions only when taking a lower bound on paid cost. + +## Necessary corridors + +Start at each fixed public input space (or {0} for a free helper). At a public +contact sum its predecessor lower spaces; at an owned contact use its pinned +space. This gives L. Starting at fixed outputs (or F2^9 for free helpers), +intersect successor upper spaces in reverse order and apply owned pins, giving U. +Induction shows every permitted contact space S satisfies L ⊆ S ⊆ U. SCALE is a +single-field contact. COPY still requires coframed operands and the declared +monotone frame trajectory, despite overwriting one scalar row. + +The independent checker constructs a contact DAG instead of scanning instructions, +then applies topological forward/backward anchors. It checks source MOVE directions +and chart/lifetime states; both implementations obtain identical corridor widths. +Contradictory anchors and forced descending dimensions have rejecting controls. + +## Dimension relaxation and coupled credit + +Set H_C(r)=r^(1-C) for r>0 and H_C(0)=0. Since 0= n and register not in active, 'fresh owned lifetime') + active.add(register) + chart[register] = event[2] + initializations[register] = initializations.get(register, 0) + 1 + elif op == 'CLEAR': + require(register in active and chart[register] == event[2], 'CLEAR at live chart') + retirements[register] = retirements.get(register, 0) + 1 + if register not in OWNERS: + active.remove(register) + chart[register] = None + other_clears.append((event_index, register)) + elif op == 'ADD': + require(len(event) == 4 and register != event[2], 'binary ADD syntax') + require(chart[register] is not None and chart[register] == chart[event[2]] == event[3], 'coframed ADD') + elif op == 'MOVE': + require(chart[register] == event[2], 'MOVE source chart') + chart[register] = event[3] + if register in OWNERS: + descending.append((register, event[2], event[3])) + elif op == 'SWAP': + require(chart[register] is not None and chart[event[2]] is not None, 'live SWAP') + chart[register], chart[event[2]] = chart[event[2]], chart[register] + else: + raise ValueError('unknown source opcode ' + op) + observations = [] + for referenced in (event[1:3] if op in ('ADD', 'SWAP') else event[1:2]): + if chart[referenced] == 0: + observations.append((observation_count, referenced)) + observation_count += 1 + observation_plan.append(observations) + require(active == set(OWNERS), 'only nine promoted fields retained') + require(all(initializations[r] == retirements[r] == 1 for r in OWNERS), 'each promoted field occurs once') + require(descending == [(r, 510 + r - 770, 0) for r in OWNERS], 'exact nine descending moves') + for owner in OWNERS: + references = [event for event in program + if owner in (event[1:3] if event[0] in ('ADD', 'SWAP') else event[1:2])] + require(references[-1] == ['CLEAR', owner, 0], 'original CLEAR is the last access to promoted owner') + require(all(word['frames'][str(a)]['dim'] - word['frames'][str(b)]['dim'] == 7 + for _, a, b in descending), 'all nine descending ranks are seven') + require(observation_count == 39848 and initial_count == 524, 'all post-event plus initial observations') + + # Add final-register outputs, then pre-CLEAR contents of other owned fields. + endpoint_offset = observation_count + clear_offset = endpoint_offset + total + clear_outputs = {event: clear_offset + i for i, (event, _) in enumerate(other_clears)} + adjoints = [1 << (endpoint_offset + r) for r in range(total)] + new_columns = {} + for event_index in reversed(range(len(program))): + for output, register in observation_plan[event_index]: + adjoints[register] ^= 1 << output + op, register, *tail = program[event_index] + if op == 'ADD': + adjoints[tail[0]] ^= adjoints[register] + elif op == 'SWAP': + adjoints[register], adjoints[tail[0]] = adjoints[tail[0]], adjoints[register] + elif op == 'INIT': + if register in OWNERS: + require(register not in new_columns, 'unique fresh input injection') + new_columns[register] = adjoints[register] + adjoints[register] = 0 + elif op == 'CLEAR' and register not in OWNERS: + adjoints[register] = 1 << clear_outputs[event_index] + for output, register in initial_observations: + adjoints[register] ^= 1 << output + require(not any(adjoints[n:]), 'no uninitialized old owned input') + mask = (1 << observation_count) - 1 + old_columns = [column & mask for column in adjoints[:n]] + h_columns = [new_columns[r] & mask for r in OWNERS] + old_basis = column_basis(old_columns) + rank_old = len(old_basis) + rank_full = len(column_basis(old_columns + h_columns)) + require(rank_old == rank_full == 533, 'independent column ranks') + witnesses = [] + for index, column in enumerate(h_columns): + combination = solve(old_basis, column) + support = list(bits(combination)) + require(xor_columns(old_columns, support) ^ column == 0, + 'direct kernel verification against all observations') + witnesses.append(dict(promoted_owner=OWNERS[index], old_input_support=support, + new_input_coordinate=index, + identity_new_block=True, all_observation_pairings_zero=True)) + + # Independently execute the nine concrete input differences simultaneously. + # This verifies the displayed witnesses against the tape, without either + # the reverse propagation or an elimination/rank calculation. + values = [0] * total + for index, witness in enumerate(witnesses): + for old_input in witness['old_input_support']: + values[old_input] ^= 1 << index + current = list(word['start']) + [None] * word['owned_fields'] + require(all(values[r] == 0 for r, f in enumerate(current) if f == 0), + 'concrete witness vanishes at every initial coframe-zero field') + for event in program: + op, register = event[:2] + if op == 'ADD': + values[register] ^= values[event[2]] + elif op == 'SWAP': + values[register], values[event[2]] = values[event[2]], values[register] + current[register], current[event[2]] = current[event[2]], current[register] + elif op == 'MOVE': + current[register] = event[3] + elif op == 'INIT': + values[register] = 1 << OWNERS.index(register) if register in OWNERS else 0 + current[register] = event[2] + elif op == 'CLEAR' and register not in OWNERS: + values[register], current[register] = 0, None + for referenced in (event[1:3] if op in ('ADD', 'SWAP') else event[1:2]): + if current[referenced] == 0: + require(values[referenced] == 0, 'concrete forward witness coframe-zero invariant') + require(all(values[r] == 0 for r in OWNERS), 'final promoted fields indistinguishable under witnesses') + + # These nine verified annihilators (u_j,e_j) imply V intersection H=0: + # a pure new-input vector in V must pair to zero with every e_j. + public_mask = (1 << n) - 1 + leak_counts = {r: ((new_columns[r] >> endpoint_offset) & public_mask).bit_count() for r in OWNERS} + require(leak_counts == dict(zip(OWNERS, [63, 55, 55, 55, 63, 63, 55, 55, 63])), 'final public contamination') + require(all(new_columns[r] >> clear_offset == 0 for r in OWNERS), 'no new-input coefficients erased elsewhere') + terminal_h = [[(new_columns[source] >> (endpoint_offset + destination)) & 1 + for source in OWNERS] for destination in OWNERS] + require(terminal_h == [[int(i == j) for j in range(9)] for i in range(9)], 'retained helper new-input block identity') + + # Meaningful controls: a mixed new-input stock vector changes the joint + # answer even though no single new-input basis vector becomes available. + extra = 1 << observation_count + mixed_h = [column ^ extra if index < 2 else column for index, column in enumerate(h_columns)] + mixed_rank = len(column_basis(old_columns + mixed_h)) + require(mixed_rank == 534, 'joint h0+h1 stock makes intersection dimension one') + individual_still_absent = [] + for index in range(9): + augmented = list(mixed_h) + augmented[index] ^= extra << 1 + individual_still_absent.append(len(column_basis(old_columns + augmented)) == mixed_rank + 1) + require(all(individual_still_absent), 'joint control invisible to singleton membership checks') + all_h_available = [column ^ (extra << index) for index, column in enumerate(h_columns)] + full_stock_rank = len(column_basis(old_columns + all_h_available)) + require(full_stock_rank - rank_old == 9, 'positive control: nine granted pure inputs give full new-input space') + wrong_support = witnesses[0]['old_input_support'][:] + marker = initial_observations[0][1] + changed = set(wrong_support) ^ {marker} + require(xor_columns(old_columns, changed) ^ h_columns[0] != 0, 'altered dual rejected') + tampered = bytes([raw[0] ^ 1]) + raw[1:] + try: + authenticated_word(tampered) + except ValueError as error: + require(str(error) == 'exact immutable BIT word', 'corruption rejected by source authentication') + else: + raise ValueError('corrupt source accepted') + + report = dict(status='PASS_INDEPENDENT_REVERSE_DUAL_FIXED_HISTORY_SCREEN', + source_sha256=SOURCE_SHA, promoted=list(OWNERS), descending_rank=7, + initial_chart0_observations=initial_count, + post_instruction_chart0_observations=observation_count-initial_count, + total_observations=observation_count, old_input_columns=n, new_input_columns=9, + old_column_rank=rank_old, full_column_rank=rank_full, + joint_pure_new_input_intersection_dimension=0, + dual_kernel_witnesses=witnesses, direct_forward_witness_invariant=True, + interleaved_chart0_linear_gate_obstruction='See PROOF.md; uses the verified zero-at-every-chart0-contact invariant.', + public_output_leak_counts=leak_counts, + other_clear_count=len(other_clears), other_clear_new_input_leaks=0, + terminal_promoted_new_input_block=terminal_h, + hypothetical_native_extra_H7_targets=9, + hypothetical_36_call_target_credit='36 * 9 * 7^(1-C), if the independent-output contract were supplied', + controls=dict(mixed_joint_stock_intersection_dimension=1, + mixed_stock_all_singleton_inputs_still_absent=individual_still_absent, + granted_all_nine_inputs_intersection_dimension=9, + altered_dual_rejected=True, corrupt_source_rejected=True), + scope='The original chart trace and all original nonzero-frame operators are fixed. The verified input-difference invariant excludes final or interleaved additional linear gates confined to chart0, with identically initialized extra scratch. Different coframes, additional address maps, altered nonzero-frame operators, extra observations outside chart0, or a changed input/output contract are outside the proof. The ideal H7 credits are hypothetical only.') + return report + + +def main(): + report = audit() + expected_raw = EXPECTED.read_bytes() + require(sha256(expected_raw).hexdigest() == EXPECTED_SHA, 'exact expected receipt bytes') + require(json.loads(json.dumps(report)) == json.loads(expected_raw), + 'complete expected receipt comparison (JSON integer-key normalization)') + print(json.dumps(report, indent=2, sort_keys=True)) + + +if __name__ == '__main__': + main() diff --git a/research/p104-large-step-audit/bit/inputs/BIT-NATIVE-WORD.json.gz b/research/p104-large-step-audit/bit/inputs/BIT-NATIVE-WORD.json.gz new file mode 100644 index 0000000000..b718d6b284 Binary files /dev/null and b/research/p104-large-step-audit/bit/inputs/BIT-NATIVE-WORD.json.gz differ diff --git a/research/p104-large-step-audit/bit/inputs/NATIVE-LINEAGE-NOTICE b/research/p104-large-step-audit/bit/inputs/NATIVE-LINEAGE-NOTICE new file mode 100644 index 0000000000..16c9afd68e --- /dev/null +++ b/research/p104-large-step-audit/bit/inputs/NATIVE-LINEAGE-NOTICE @@ -0,0 +1,25 @@ +This research package contains and adapts Apache-2.0 material from +CrocSwap/integer-mult-bounds. The repository's Apache-2.0 license is +provided as LICENSE. + +The six-field mixed-projector architecture and binary-child recursion +are adapted from research/mixed-projector-query-root and its PR6348/PR6398 +lineage, credited there to Ali Romman and Cinna Davis with substantial +OpenAI Codex assistance. The public complex normalization, dyadic bases +and proof by two central characters are not imported as a binary proof. + +The binary projectors, direct characteristic-two operator verification, +complete binary staged callers, exact incidence enumeration and target +economic relaxation in this directory were constructed and checked in +this research session. No novelty or priority assertion is made. + +inputs/interval_engine.py is an unchanged copy of +research/higher-moment-strictification/verify.py, credited to zxv with +substantial OpenAI Codex assistance; its own source notices remain intact. +The broader finite/compiler/ordinary admission in the sibling root +package retains the credit and assumptions of its pinned predecessors. + +The unchanged native source and baseline construction retain all their +original attribution, including their functional kernel, receiver +compensation, temporal retiming, helper exchange and ordinary admission +lineages. No new source-word saving is claimed by this caller package. diff --git a/research/p104-large-step-audit/bit/inputs/PAIRED-SOURCE-NOTICE b/research/p104-large-step-audit/bit/inputs/PAIRED-SOURCE-NOTICE new file mode 100644 index 0000000000..32c2936ea0 --- /dev/null +++ b/research/p104-large-step-audit/bit/inputs/PAIRED-SOURCE-NOTICE @@ -0,0 +1,26 @@ +Paired E-free BIT specialization and complete accounting, with substantial +OpenAI Codex assistance, for the integer-multiplication research project. +Apache-2.0; LICENSE is retained from the source project. + +DreamingOfClouds (Claude Opus assistance) receives credit for #6834's chain-root +BIT caller, #6937's E-free roots and the underlying two-chain construction. +@CubeJerry (OpenAI assistance) receives credit for #6980's four-input three-query +identity, separated interval replacement and QUERY-only caller. The complete +#6980 proof is retained byte-for-byte in data/6980_PROOF.md. + +The new contribution specializes that existing caller to the actual #6726 BIT +native, supplies the parity-driven pairing of two real 111-port invocations, +and checks the complete E-free finite/compiler/ordinary budget from the selected +ordinary backend. No general QUERY-only mechanism, chain root or new raw kappa +is claimed as new here. + +independent/bit_review.py and independent/interval_gate.py were written by a +separate OpenAI Codex research worker for an implementation-independent scalar +and arithmetic audit. This is model-run checking, not external human review. + +zxv and retained predecessor authors receive credit for #6726's source-native +export, integer-before-mod2 transfer, complete source checking and admission +framework. Ali Romman and Cinna Davis retain the root/native lineage credit. +The copied arithmetic and native checker retain their original headers; see +retained/NOTICE. The selected .0034 backend retains the source and contributor +credits in data/selected_record.json and data/selected_review.md. diff --git a/research/p104-large-step-audit/frames.json b/research/p104-large-step-audit/frames.json new file mode 100644 index 0000000000..b672679fa0 --- /dev/null +++ b/research/p104-large-step-audit/frames.json @@ -0,0 +1,124 @@ +{ + "status": "PASS_SCOPED_CONTACT_FRAME_BOUNDS_NO_KAPPA_GAIN", + "source_canonical_sha256": "df1fc415915abd8d0f1bbfe8ad530c02f9cd82692f548ed2817ba6bd948fc55c", + "cases": [ + { + "mode": "fixed_endpoints", + "target": ".0046502223357", + "public_fields": 1501, + "contact_dimension_width_counts": { + "0": 67435, + "1": 2076, + "2": 266, + "3": 167, + "4": 56, + "5": 255 + }, + "dp_transitions": 159809, + "native_net_cost_interval": [ + "1085259522498794050653939607592797553747450474261278682554587094701434494435455635363/100000000000000000000000000000000000000000000000000000000000000000000000000000000", + "43410380899951762026157584303711902149898018970451147302183483788057379777418252909/4000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "full_target_minus_paid_interval": [ + "-18148127343181019146683670210345144068712010636871172771866921836204965779553693601/50000000000000000000000000000000000000000000000000000000000000000000000000000000", + "-36296254686362038293367340420690288137424021273742345543733843672409931559068372259/100000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "approximate_margin": [ + -362.9625468636204, + -362.9625468636204 + ], + "target_fails_relaxed_moment": true + }, + { + "mode": "fixed_endpoints", + "target": ".0046530568657", + "public_fields": 1501, + "contact_dimension_width_counts": { + "0": 67435, + "1": 2076, + "2": 266, + "3": 167, + "4": 56, + "5": 255 + }, + "dp_transitions": 159809, + "native_net_cost_interval": [ + "1085257127994497634851716315487013321972207399320687331589894600901231163018320477237/100000000000000000000000000000000000000000000000000000000000000000000000000000000", + "542628563997248817425858157743506660986103699660343665794947300450615581509160586413/50000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "full_target_minus_paid_interval": [ + "-36404133344864928937306808554471642840827355978582391428607343470734291361926019191/100000000000000000000000000000000000000000000000000000000000000000000000000000000", + "-18202066672432464468653404277235821420413677989291195714303671735367145680943633773/50000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "approximate_margin": [ + -364.0413334486493, + -364.0413334486493 + ], + "target_fails_relaxed_moment": true + }, + { + "mode": "free_helper_endpoints", + "target": ".0046502223357", + "public_fields": 1501, + "contact_dimension_width_counts": { + "0": 65090, + "1": 2299, + "2": 791, + "3": 882, + "4": 97, + "5": 1080, + "6": 4, + "7": 3, + "9": 9 + }, + "dp_transitions": 350537, + "native_net_cost_interval": [ + "322902513744758124065984922557525179095777175405515692885793607630724162771194322553/100000000000000000000000000000000000000000000000000000000000000000000000000000000", + "64580502748951624813196984511505035819155435081103138577158721526144832554239102113/20000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "full_target_minus_paid_interval": [ + "-6120326622127700779149482769998335252109628395455426284747576797710376518354546167/20000000000000000000000000000000000000000000000000000000000000000000000000000000", + "-30601633110638503895747413849991676260548141977277131423737883988551882591733873363/100000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "approximate_margin": [ + -306.01633110638505, + -306.01633110638505 + ], + "target_fails_relaxed_moment": true + }, + { + "mode": "free_helper_endpoints", + "target": ".0046530568657", + "public_fields": 1501, + "contact_dimension_width_counts": { + "0": 65090, + "1": 2299, + "2": 791, + "3": 882, + "4": 97, + "5": 1080, + "6": 4, + "7": 3, + "9": 9 + }, + "dp_transitions": 350537, + "native_net_cost_interval": [ + "322904270384901154991144724244361418207029988717899088570645493236930871347600821387/100000000000000000000000000000000000000000000000000000000000000000000000000000000", + "80726067596225288747786181061090354551757497179474772142661373309232717836900500353/25000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "full_target_minus_paid_interval": [ + "-3070605913341903375915613846750006547571711247990087049025152793479314854082512119/10000000000000000000000000000000000000000000000000000000000000000000000000000000", + "-30706059133419033759156138467500065475717112479900870490251527934793148540786562529/100000000000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "approximate_margin": [ + -307.06059133419035, + -307.06059133419035 + ], + "target_fails_relaxed_moment": true + } + ], + "controls": { + "ordinary_and_coupled_dp_equal_exhaustive": true, + "forced_descent_rejected": true + } +} diff --git a/research/p104-large-step-audit/frames.py b/research/p104-large-step-audit/frames.py new file mode 100644 index 0000000000..f1e40ea985 --- /dev/null +++ b/research/p104-large-step-audit/frames.py @@ -0,0 +1,240 @@ +#!/usr/bin/env python3 +"""Optimistic contact-corridor bounds; no new supplier or kappa is certified. + +Hao Yan, with substantial OpenAI Codex assistance. Apache-2.0. +See PROOF.md for the relaxation and the precise applicability conditions. +""" +from collections import Counter +from fractions import Fraction as Q +from itertools import product +from pathlib import Path +import argparse +import gzip +import hashlib +import json +import runpy + +if not __debug__: + raise RuntimeError('Assertions are proof checks; run without -O.') +HERE = Path(__file__).resolve().parent +SOURCE = 'df1fc415915abd8d0f1bbfe8ad530c02f9cd82692f548ed2817ba6bd948fc55c' +TARGETS = ('.0046502223357', '.0046530568657') + + +def span(vectors): + result = {0} + for v in vectors: + result |= {x ^ v for x in result} + return frozenset(result) + + +def dimension(space): + d = len(space).bit_length() - 1 + assert len(space) == 1 << d + return d + + +def join(a, b): + if a <= b: + return b + result = set(a) + for v in b: + if v not in result: + result |= {x ^ v for x in result} + return frozenset(result) + + +def corridors(word, free_helpers): + n = word['public'] + mains = (set(word['live']) | {r + 112 for r in word['live']} + | set(word['hosted']['X2']) | set(word['hosted']['Y2'])) + helpers = set(range(n)) - mains + assert len(mains) == 400 and len(helpers) == 1101 + frames = [span(v) for v in word['frames']] + assert all(dimension(s) == len(v) for s, v in zip(frames, word['frames'])) + fixed = mains if free_helpers else set(range(n)) + ops = [e for e in word['program'] if e[0] != 'MOVE'] + lower = [None] * len(ops) + upper = lower.copy() + cur = [frames[f] if r in fixed else frozenset({0}) + for r, f in enumerate(word['initial'])] + [None] * word['owned_fields'] + j = 0 + for e in word['program']: + op, d = e[:2] + if op == 'MOVE': + if d >= n: + assert cur[d] == frames[e[2]] + cur[d] = frames[e[3]] + continue + if op in ('ADD', 'COPY'): + s = e[2] + z = frames[e[4]] if d >= n or s >= n else join(cur[d], cur[s]) + assert cur[d] <= z and cur[s] <= z and z <= frames[e[4]] + cur[d] = cur[s] = lower[j] = z + elif op == 'SCALE': + lower[j] = cur[d] + elif op == 'INIT': + assert cur[d] is None + cur[d] = frames[e[2]] + elif op == 'CLEAR': + assert cur[d] == frames[e[2]] + cur[d] = None + else: + raise ValueError(op) + j += 1 + cur = [frames[f] if r in fixed else frozenset(range(512)) + for r, f in enumerate(word['final'])] + [None] * word['owned_fields'] + j = len(ops) - 1 + for e in reversed(word['program']): + op, d = e[:2] + if op == 'MOVE': + if d >= n: + assert cur[d] == frames[e[3]] + cur[d] = frames[e[2]] + continue + if op in ('ADD', 'COPY'): + s = e[2] + z = frames[e[4]] if d >= n or s >= n else cur[d] & cur[s] + assert frames[e[4]] <= z and z <= cur[d] and z <= cur[s] + cur[d] = cur[s] = upper[j] = z + elif op == 'SCALE': + upper[j] = cur[d] + elif op == 'CLEAR': + assert cur[d] is None + cur[d] = frames[e[2]] + elif op == 'INIT': + assert cur[d] == frames[e[2]] + cur[d] = None + j -= 1 + paths = [[(len(word['frames'][f]),) * 2] if r in fixed else [(0, 9)] + for r, f in enumerate(word['initial'])] + widths = Counter() + for j, e in enumerate(ops): + if e[0] not in ('ADD', 'COPY', 'SCALE'): + continue + assert lower[j] <= upper[j] + a, b = dimension(lower[j]), dimension(upper[j]) + widths[b - a] += 1 + for r in e[1:3] if e[0] in ('ADD', 'COPY') else e[1:2]: + if r < n: + paths[r].append((a, b)) + for r, f in enumerate(word['final']): + paths[r].append((len(word['frames'][f]),) * 2 if r in fixed else (0, 9)) + return paths, widths, helpers + + +def minimum_net_cost(path, powers, productive): + """Enclose min_path(sum H(gaps) - H(end-start) if productive).""" + a, b = path[0] + dp = {(d, d): (0, 0) for d in range(a, b + 1)} + transitions = 0 + for a, b in path[1:]: + new = {} + for (start, previous), (x, y) in dp.items(): + for d in range(max(a, previous), b + 1): + value = x + powers[d - previous][0], y + powers[d - previous][1] + key = start, d + transitions += 1 + if key not in new: + new[key] = value + else: + new[key] = min(new[key][0], value[0]), min(new[key][1], value[1]) + dp = new + values = [] + for (start, d), (x, y) in dp.items(): + if productive: + x -= powers[d - start][1] + y -= powers[d - start][0] + values.append((x, y)) + return ((min(x for x, _ in values), min(y for _, y in values)) + if values else None), transitions + + +def controls(): + # Exact integer prices: compare both ordinary and coupled endpoint-credit DP + # with exhaustive enumeration, including an infeasible forced descent. + prices = {r: (r * 20 - r * r, r * 20 - r * r) for r in range(10)} + fixtures = [[(0, 0), (0, 2), (1, 3), (3, 3)], + [(0, 2), (1, 3), (2, 4)], [(2, 2), (1, 1)]] + for path in fixtures: + for productive in (False, True): + values = [] + for ds in product(*(range(a, b + 1) for a, b in path)): + if any(a > b for a, b in zip(ds, ds[1:])): + continue + cost = sum(prices[b - a][0] for a, b in zip(ds, ds[1:])) + values.append(cost - (prices[ds[-1] - ds[0]][0] if productive else 0)) + expected = (min(values),) * 2 if values else None + assert minimum_net_cost(path, prices, productive)[0] == expected + return {'ordinary_and_coupled_dp_equal_exhaustive': True, + 'forced_descent_rejected': True} + + +def audit(): + word = json.loads(gzip.decompress((HERE / 'retained/7613/word.json.gz').read_bytes())) + canonical = hashlib.sha256(json.dumps(word, sort_keys=True, separators=(',', ':')).encode()).hexdigest() + assert canonical == SOURCE + invoice = json.loads((HERE / 'retained/7613/invoice-new.json').read_text()) + paid = {int(r): v for r, v in invoice['paid'].items()} + targets = {int(r): v for r, v in invoice['targets'].items()} + old_public = Counter() + for e in word['program']: + if e[0] == 'MOVE' and not e[4]: + a, b = (span(word['frames'][f]) for f in e[2:4]) + assert a <= b + old_public[dimension(b) - dimension(a)] += 1 + fixed_paid = {r: paid.get(r, 0) - 17 * old_public[r] for r in paid.keys() | old_public.keys()} + assert min(fixed_paid.values()) >= 0 + engine = runpy.run_path(str(HERE / 'retained/interval_gate.py')) + B = engine['B'] + cases = [] + for free in (False, True): + paths, widths, helpers = corridors(word, free) + old_helper = Counter(len(word['frames'][word['final'][r]]) + - len(word['frames'][word['initial'][r]]) for r in helpers) + remaining = {r: targets.get(r, 0) - (17 * old_helper[r] if free else 0) + for r in targets.keys() | old_helper.keys()} + assert min(remaining.values()) >= 0 + for target in TARGETS: + C = Q(target) + powers = {r: engine['power'](r, C) for r in range(1, 10)} + powers[0] = (0, 0) + lo = hi = transitions = 0 + for r, path in enumerate(paths): + value, count = minimum_net_cost(path, powers, free and r in helpers) + assert value is not None + lo += value[0] + hi += value[1] + transitions += count + t = engine['moment']({r: v for r, v in remaining.items() if v}, C) + p = engine['moment']({r: v for r, v in fixed_paid.items() if v}, C) + margin = t[0] - p[1] - 17 * hi, t[1] - p[0] - 17 * lo + assert margin[1] < 0 + baseline = engine['moment'](old_public, C) + old_credit = engine['moment'](old_helper, C) if free else (0, 0) + assert lo <= baseline[1] - old_credit[0] + cases.append(dict(mode='free_helper_endpoints' if free else 'fixed_endpoints', + target=target, public_fields=word['public'], + contact_dimension_width_counts=dict(sorted(widths.items())), + dp_transitions=transitions, + native_net_cost_interval=[str(Q(x, B)) for x in (lo, hi)], + full_target_minus_paid_interval=[str(Q(x, B)) for x in margin], + approximate_margin=[float(Q(x, B)) for x in margin], + target_fails_relaxed_moment=True)) + return dict(status='PASS_SCOPED_CONTACT_FRAME_BOUNDS_NO_KAPPA_GAIN', + source_canonical_sha256=canonical, cases=cases, controls=controls()) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--write', action='store_true', help='Regenerate deterministic receipt') + args = parser.parse_args() + result = audit() + output = HERE / 'frames.json' + if args.write: + output.write_text(json.dumps(result, indent=2) + '\n') + else: + assert json.loads(output.read_text()) == json.loads(json.dumps(result)) + print(result['status']) + for case in result['cases']: + print(case['mode'], case['target'], case['approximate_margin']) diff --git a/research/p104-large-step-audit/independent-frames.json b/research/p104-large-step-audit/independent-frames.json new file mode 100644 index 0000000000..18bd1e012f --- /dev/null +++ b/research/p104-large-step-audit/independent-frames.json @@ -0,0 +1,157 @@ +{ + "status": "PASS_INDEPENDENT_FRAME_CORRIDOR_BOUNDS", + "source_canonical_sha256": "df1fc415915abd8d0f1bbfe8ad530c02f9cd82692f548ed2817ba6bd948fc55c", + "source_gzip_sha256": "21725d0c4ab84bac4d53701624c44701122a977b445d8facfb2ee7c7eba1afce", + "invoice_sha256": "d362f075d8855cfed1c6c8a2bd1d50af727900d1fff810ebf57a8afb8794e721", + "cases": [ + { + "mode": "fixed_endpoints", + "target": ".0046502223357", + "public_fields": 1501, + "main_fields": 400, + "helper_fields": 1101, + "graph_vertices": 73257, + "contact_vertices": 70255, + "contact_dimension_width_counts": { + "0": 67435, + "1": 2076, + "5": 255, + "2": 266, + "3": 167, + "4": 56 + }, + "reverse_dp_transitions": 159809, + "native_net_cost_interval": [ + "108525952249879405065393960759279755374743989/10000000000000000000000000000000000000000", + "108525952249879405065393960759279755374746197/10000000000000000000000000000000000000000" + ], + "full_target_minus_paid_interval": [ + "-907406367159050957334183510517257203444063/2500000000000000000000000000000000000000", + "-362962546863620382933673404206902881370751/1000000000000000000000000000000000000000" + ], + "full_target_minus_paid_float": [ + -362.9625468636204, + -362.9625468636204 + ], + "primary_intervals_overlap": true + }, + { + "mode": "fixed_endpoints", + "target": ".0046530568657", + "public_fields": 1501, + "main_fields": 400, + "helper_fields": 1101, + "graph_vertices": 73257, + "contact_vertices": 70255, + "contact_dimension_width_counts": { + "0": 67435, + "1": 2076, + "5": 255, + "2": 266, + "3": 167, + "4": 56 + }, + "reverse_dp_transitions": 159809, + "native_net_cost_interval": [ + "4341028511977990539406865261948053287888781/400000000000000000000000000000000000000", + "108525712799449763485171631548701332197221733/10000000000000000000000000000000000000000" + ], + "full_target_minus_paid_interval": [ + "-3640413334486492893730680855447164284108767/10000000000000000000000000000000000000000", + "-3640413334486492893730680855447164284041481/10000000000000000000000000000000000000000" + ], + "full_target_minus_paid_float": [ + -364.0413334486493, + -364.0413334486493 + ], + "primary_intervals_overlap": true + }, + { + "mode": "free_helper_endpoints", + "target": ".0046502223357", + "public_fields": 1501, + "main_fields": 400, + "helper_fields": 1101, + "graph_vertices": 73257, + "contact_vertices": 70255, + "contact_dimension_width_counts": { + "0": 65090, + "1": 2299, + "5": 1080, + "2": 791, + "3": 882, + "4": 97, + "6": 4, + "9": 9, + "7": 3 + }, + "reverse_dp_transitions": 390814, + "native_net_cost_interval": [ + "403628142180947655082481153196906473869699/125000000000000000000000000000000000000", + "3229025137447581240659849225575251790957923/1000000000000000000000000000000000000000" + ], + "full_target_minus_paid_interval": [ + "-3060163311063850389574741384999167626086239/10000000000000000000000000000000000000000", + "-1530081655531925194787370692499583813008587/5000000000000000000000000000000000000000" + ], + "full_target_minus_paid_float": [ + -306.01633110638505, + -306.01633110638505 + ], + "primary_intervals_overlap": true + }, + { + "mode": "free_helper_endpoints", + "target": ".0046530568657", + "public_fields": 1501, + "main_fields": 400, + "helper_fields": 1101, + "graph_vertices": 73257, + "contact_vertices": 70255, + "contact_dimension_width_counts": { + "0": 65090, + "1": 2299, + "5": 1080, + "2": 791, + "3": 882, + "4": 97, + "6": 4, + "9": 9, + "7": 3 + }, + "reverse_dp_transitions": 390814, + "native_net_cost_interval": [ + "32290427038490115499114472424436141820700941/10000000000000000000000000000000000000000", + "32290427038490115499114472424436141820704251/10000000000000000000000000000000000000000" + ], + "full_target_minus_paid_interval": [ + "-3070605913341903375915613846750006547597983/10000000000000000000000000000000000000000", + "-1535302956670951687957806923375003273765187/5000000000000000000000000000000000000000" + ], + "full_target_minus_paid_float": [ + -307.06059133419035, + -307.06059133419035 + ], + "primary_intervals_overlap": true + } + ], + "controls": { + "exhaustive_reverse_dp_cases": 6, + "infeasible_descent_rejected": true, + "conflicting_anchors_rejected": true, + "endpoint_credit_coupled": true + }, + "known_zero_public_gap_audit": { + "modulus": 1000003, + "deterministic_probes": 3, + "nonzero_public_states": 76243, + "zero_public_states": [ + [ + 34010, + 770 + ] + ], + "free_zero_relabeling_gap_rank": 0 + }, + "scope": "Necessary signed-moment bounds for exact7613 fixed scalar word, main endpoints, owned chronology and caller, with monotone public F2^9 frame paths. Free-helper mode also permits arbitrary independent helper endpoints with coupled new rank credit. Shared contact agreement, exact subspace inclusion and extra basis charges are relaxed. No kappa improvement, source admission or general algorithmic impossibility is claimed." +} diff --git a/research/p104-large-step-audit/independent_frames.py b/research/p104-large-step-audit/independent_frames.py new file mode 100644 index 0000000000..3cc5bd8ed9 --- /dev/null +++ b/research/p104-large-step-audit/independent_frames.py @@ -0,0 +1,341 @@ +#!/usr/bin/env python3 +"""Independent contact DAG, reverse endpoint-conditioned DP and rational prices. + +Uses a separately retained positive-Taylor interval implementation. It does not +import frames.py, run a native application, or claim a kappa improvement. +""" +from pathlib import Path +from functools import lru_cache +from collections import Counter +from fractions import Fraction as F +from itertools import product +import argparse +import gzip +import hashlib +import json +import runpy + +HERE = Path(__file__).resolve().parent +CANONICAL = 'df1fc415915abd8d0f1bbfe8ad530c02f9cd82692f548ed2817ba6bd948fc55c' +TARGETS = ('.0046502223357', '.0046530568657') +GRID = 10**40 +AMBIENT = (1 << 512) - 1 + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +@lru_cache(None) +def hull(rows): + values = [0] + for row in rows: + if row not in values: + values.extend([v ^ row for v in values]) + return sum(1 << value for value in values) + + +@lru_cache(None) +def basis(mask): + rows, generated = [], 1 + while mask & ~generated: + missing = mask & ~generated + rows.append((missing & -missing).bit_length() - 1) + generated = hull(tuple(rows)) + need(generated == mask, 'valid binary subspace') + return tuple(rows) + + +@lru_cache(None) +def join(a, b): + return hull(basis(a) + basis(b)) + + +def dimension(mask): + size = mask.bit_count() + need(size > 0 and size & (size - 1) == 0, 'power-of-two subspace size') + return size.bit_length() - 1 + + +def corridors(word, free): + """Graph constraints, with no dependency on proposer corridor arrays.""" + count = word['public'] + frames = [hull(tuple(row)) for row in word['frames']] + need(all(dimension(a) == len(b) for a, b in zip(frames, word['frames'])), + 'all source frame bases independent') + mains = set(word['live']) | {r + 112 for r in word['live']} + mains |= set(word['hosted']['X2']) | set(word['hosted']['Y2']) + helpers = set(range(count)) - mains + need(len(mains) == 400 and len(helpers) == 1101, 'source owner partition') + predecessors, successors, anchors, events = [], [], [], [] + + def vertex(parents, anchor, event): + k = len(predecessors) + parents = list(dict.fromkeys(parents)) + predecessors.append(parents) + successors.append([]) + anchors.append(anchor) + events.append(event) + for p in parents: + need(p < k, 'acyclic chronological contact graph') + successors[p].append(k) + return k + + paths, last = [], [] + for r, frame in enumerate(word['initial']): + k = vertex([], None if free and r in helpers else frames[frame], ('SOURCE', r)) + paths.append([k]) + last.append(k) + charts = word['initial'] + [None] * word['owned_fields'] + public_paid, owned_paid, contacts = Counter(), Counter(), [] + for i, event in enumerate(word['program']): + op, dst = event[:2] + if op == 'MOVE': + before, after, owned = event[2:] + need(charts[dst] == before and owned == (dst >= count), 'source MOVE owner/entrance') + rank = dimension(frames[after]) - dimension(frames[before]) + if dst < count: + need(frames[before] & frames[after] == frames[before] and rank > 0, + 'source public monotone MOVE') + public_paid[rank] += 1 + else: + owned_paid[abs(rank)] += 1 + charts[dst] = after + elif op == 'INIT': + need(dst >= count and charts[dst] is None, 'owned activation') + charts[dst] = event[2] + elif op == 'CLEAR': + need(dst >= count and charts[dst] == event[2], 'owned retirement') + charts[dst] = None + elif op in ('ADD', 'COPY', 'SCALE'): + roles = event[1:3] if op in ('ADD', 'COPY') else event[1:2] + if op in ('ADD', 'COPY'): + need(charts[roles[0]] == charts[roles[1]] == event[4], 'source contact chart') + public = [r for r in roles if r < count] + owned = [r for r in roles if r >= count] + anchor = frames[charts[owned[0]]] if owned else None + k = vertex([last[r] for r in public], anchor, (i, op)) + contacts.append(k) + for r in public: + paths[r].append(k) + last[r] = k + else: + raise ValueError('unexpected opcode ' + op) + need(charts == word['final'] + [None] * word['owned_fields'], 'source endpoints') + for r, frame in enumerate(word['final']): + paths[r].append(vertex([last[r]], None if free and r in helpers else frames[frame], ('TARGET', r))) + lower = [] + for k, parents in enumerate(predecessors): + current = 1 + for p in parents: + current = join(current, lower[p]) + if anchors[k] is not None: + need(current & anchors[k] == current, 'anchor contains predecessor floor') + current = anchors[k] + lower.append(current) + upper = [None] * len(predecessors) + for k in reversed(range(len(predecessors))): + current = AMBIENT + for child in successors[k]: + current &= upper[child] + if anchors[k] is not None: + need(current & anchors[k] == anchors[k], 'anchor contained in successor ceiling') + current = anchors[k] + upper[k] = current + need(lower[k] & current == lower[k], 'nonempty subspace corridor') + intervals = [[(dimension(lower[k]), dimension(upper[k])) for k in path] for path in paths] + zero_contacts = [k for k in paths[770] if events[k][0] in (34010, 34011)] + need(len(zero_contacts) == 2 and all(lower[k] == upper[k] == frames[115] for k in zero_contacts), + 'known-zero public gap forced to identical frame115') + return dict(paths=intervals, public_paid=public_paid, owned_paid=owned_paid, + helpers=helpers, frames=frames, vertices=len(predecessors), + contact_vertices=len(contacts), + widths=Counter(dimension(upper[k]) - dimension(lower[k]) for k in contacts)) + + +def reverse_dp(intervals, powers, helper): + """State (final,current) preserves endpoint pair until credit is charged.""" + low, high = intervals[-1] + tail = {(end, end): (0, 0) for end in range(low, high + 1)} + transitions = 0 + for low, high in reversed(intervals[:-1]): + result = {} + for (end, nxt), (a, b) in tail.items(): + for current in range(low, min(high, nxt) + 1): + increment = powers[nxt - current] + value = a + increment[0], b + increment[1] + key = end, current + transitions += 1 + if key not in result: + result[key] = value + else: + result[key] = min(result[key][0], value[0]), min(result[key][1], value[1]) + if not result: + return None, transitions + tail = result + values = [(a - powers[end - start][1], b - powers[end - start][0]) if helper else (a, b) + for (end, start), (a, b) in tail.items()] + return (min(a for a, b in values), min(b for a, b in values)), transitions + + +def fixtures(): + # Integer prices avoid interval ambiguity and distinguish total endpoint + # credit from incorrectly independent/multiple credited subsegments. + powers = {k: (k * 10 - k * k, k * 10 - k * k) for k in range(5)} + cases = [[(0, 0), (0, 2), (1, 3), (3, 3)], + [(0, 2), (2, 2), (2, 4)], + [(0, 0), (2, 2), (1, 1)]] + checked = 0 + for path in cases: + for helper in (False, True): + candidates = [] + for seq in product(*(range(a, b + 1) for a, b in path)): + if all(a <= b for a, b in zip(seq, seq[1:])): + value = sum(powers[b - a][0] for a, b in zip(seq, seq[1:])) + if helper: + value -= powers[seq[-1] - seq[0]][0] + candidates.append(value) + actual, _ = reverse_dp(path, powers, helper) + expected = (min(candidates),) * 2 if candidates else None + need(actual == expected, 'reverse endpoint DP agrees with exhaustive fixture') + checked += 1 + a, b = hull((1,)), hull((2,)) + need(a & b != a and a & b != b, 'conflicting lower/upper anchor control') + return dict(exhaustive_reverse_dp_cases=checked, infeasible_descent_rejected=True, + conflicting_anchors_rejected=True, endpoint_credit_coupled=True) + + +def zero_guard(word): + # A nonzero modular evaluation is an exact rational nonzero-row witness, + # not a probabilistic inference. All denominators are checked invertible. + prime = 1000003 + count = word['public'] + values = [[int.from_bytes(hashlib.sha256(f'{r}/{j}'.encode()).digest()[:8], 'big') % prime + for j in range(3)] for r in range(count)] + [[0] * 3 for _ in range(word['owned_fields'])] + need(all(any(row) for row in values[:count]), 'initial nonzero witnesses') + + @lru_cache(None) + def coefficient(s): + q = F(s) + need(q.denominator % prime, 'denominator invertible modulo probe prime') + return q.numerator * pow(q.denominator, -1, prime) % prime + + zero, witnessed = [], 0 + for i, event in enumerate(word['program']): + op, dst = event[:2] + if op in ('INIT', 'CLEAR'): + values[dst] = [0] * 3 + elif op in ('ADD', 'COPY'): + if op == 'COPY': + need(not any(values[dst]), 'COPY destination zero in probes') + values[dst] = [(a + coefficient(event[3]) * b) % prime + for a, b in zip(values[dst], values[event[2]])] + elif op == 'SCALE': + values[dst] = [a * coefficient(event[2]) % prime for a in values[dst]] + elif op != 'MOVE': + raise ValueError(op) + if dst < count: + if any(values[dst]): + witnessed += 1 + else: + zero.append([i, dst]) + need(zero == [[34010, 770]], 'sole public zero state') + need(word['program'][34009:34012] == [['COPY', 1525, 770, '1', 115], + ['ADD', 770, 1525, '-1', 115], ['ADD', 770, 607, '1', 115]], 'exact zero interval identity') + return dict(modulus=prime, deterministic_probes=3, nonzero_public_states=witnessed, + zero_public_states=zero, free_zero_relabeling_gap_rank=0) + + +def main(write=False): + blob = (HERE / 'retained/7613/word.json.gz').read_bytes() + word = json.loads(gzip.decompress(blob)) + canonical = hashlib.sha256(json.dumps(word, sort_keys=True, separators=(',', ':')).encode()).hexdigest() + need(canonical == CANONICAL, 'exact latest7613 source canonical hash') + invoice_blob = (HERE / 'retained/7613/invoice-new.json').read_bytes() + invoice = json.loads(invoice_blob) + targets = {int(r): n for r, n in invoice['targets'].items()} + paid = {int(r): n for r, n in invoice['paid'].items()} + engine = runpy.run_path(str(HERE / 'retained/independent_interval.py')) + author = json.loads((HERE / 'frames.json').read_text()) + need(author['source_canonical_sha256'] == canonical, 'primary receipt source identity') + reference = {(row['mode'], row['target']): row for row in author['cases']} + prices = {} + for target in TARGETS: + powers = {0: (0, 0)} + for rank in sorted(set(range(1, 10)) | set(targets) | set(paid)): + low, high = engine['power'](rank, 1 - F(target)) + powers[rank] = (low * GRID).__floor__(), (high * GRID).__ceil__() + prices[target] = powers + cases = [] + for free in (False, True): + model = corridors(word, free) + fixed_paid = {r: paid.get(r, 0) - 17 * model['public_paid'][r] + for r in set(paid) | set(model['public_paid'])} + need(all(n >= 0 for n in fixed_paid.values()), 'fixed debit residual nonnegative') + caller_paid = {r: fixed_paid.get(r, 0) - 17 * model['owned_paid'][r] + for r in set(fixed_paid) | set(model['owned_paid'])} + need(all(n >= 0 for n in caller_paid.values()), 'fixed caller debit nonnegative') + helpers = Counter(dimension(model['frames'][word['final'][r]]) - + dimension(model['frames'][word['initial'][r]]) for r in model['helpers']) + need(all(r > 0 for r in helpers), 'source productive helper ranks positive') + fixed_targets = {r: targets.get(r, 0) - 17 * helpers[r] for r in set(targets) | set(helpers)} + need({r: n for r, n in fixed_targets.items() if n} == + {9:416, 17:416, 25:416, 33:416, 41:416, 49:416, 57:416, 65:416, 73:208, 137:208}, + 'fresh helper target credit separated from complete fixed caller') + for target in TARGETS: + powers = prices[target] + lo = hi = transitions = 0 + for r, path in enumerate(model['paths']): + value, count = reverse_dp(path, powers, free and r in model['helpers']) + need(value is not None, 'nonempty field dimension path') + lo += value[0] + hi += value[1] + transitions += count + def moment(hist): + return tuple(sum(n * powers[r][j] for r, n in hist.items()) for j in (0, 1)) + t, f = moment(fixed_targets if free else targets), moment(fixed_paid) + margin = t[0] - f[1] - 17 * hi, t[1] - f[0] - 17 * lo + need(margin[1] < 0, 'negative optimistic full signed moment') + mode = 'free_helper_endpoints' if free else 'fixed_endpoints' + prior = reference[mode, target] + need(model['widths'] == Counter({int(k): v for k, v in prior['contact_dimension_width_counts'].items()}), + 'independent contact corridor census agrees') + for key, interval in [('native_net_cost_interval', (lo, hi)), + ('full_target_minus_paid_interval', margin)]: + a, b = map(F, prior[key]) + need(max(a, F(interval[0], GRID)) <= min(b, F(interval[1], GRID)), + 'independent rational interval overlap: ' + key) + cases.append(dict(mode=mode, target=target, public_fields=word['public'], + main_fields=400, helper_fields=1101, graph_vertices=model['vertices'], + contact_vertices=model['contact_vertices'], + contact_dimension_width_counts=dict(model['widths']), + reverse_dp_transitions=transitions, + native_net_cost_interval=[str(F(x, GRID)) for x in (lo, hi)], + full_target_minus_paid_interval=[str(F(x, GRID)) for x in margin], + full_target_minus_paid_float=[float(F(x, GRID)) for x in margin], + primary_intervals_overlap=True)) + result = dict(status='PASS_INDEPENDENT_FRAME_CORRIDOR_BOUNDS', source_canonical_sha256=canonical, + source_gzip_sha256=hashlib.sha256(blob).hexdigest(), + invoice_sha256=hashlib.sha256(invoice_blob).hexdigest(), + cases=cases, controls=fixtures(), known_zero_public_gap_audit=zero_guard(word), + scope='Necessary signed-moment bounds for exact7613 fixed scalar word, main endpoints, ' + 'owned chronology and caller, with monotone public F2^9 frame paths. Free-helper mode ' + 'also permits arbitrary independent helper endpoints with coupled new rank credit. ' + 'Shared contact agreement, exact subspace inclusion and extra basis charges are relaxed. ' + 'No kappa improvement, source admission or general algorithmic impossibility is claimed.') + receipt = HERE / 'independent-frames.json' + if write: + receipt.write_text(json.dumps(result, indent=2) + '\n') + else: + frozen = json.loads(receipt.read_text()) + normalized = json.loads(json.dumps(result, sort_keys=True)) + need(normalized == frozen, 'complete independent receipt unchanged') + print(json.dumps(result, indent=2)) + return result + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--write', action='store_true') + main(parser.parse_args().write) diff --git a/research/p104-large-step-audit/retained/7613/NOTICE b/research/p104-large-step-audit/retained/7613/NOTICE new file mode 100644 index 0000000000..b02283b745 --- /dev/null +++ b/research/p104-large-step-audit/retained/7613/NOTICE @@ -0,0 +1,14 @@ +Apache-2.0. DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. + +data/base-7612-word.json.gz and data/invoice-7612.json are the unmodified +word.json.gz and invoice-new.json of research/p104-contact134-329-on7611 at +#7612 (Clear1nsight; prepared with OpenAI Codex / ChatGPT assistance; +Apache-2.0), vendored as data only. The edit applies Clear1nsight's #7612 +contact-rechart pattern (common contact moved from chart 618 to chart 373) to a +second pair. #7612 is built on our #7611 and #7608 (aliromman's #7605 with one +edit); beneath them are FanPUYen's #7604, SYLforge's #7603, ToikY's #7546, our +#7601 and #7542, Clear1nsight's #7334 and #7314, Rohan Arun's signed #7113 +caller and all contributors named in those packages. + +check.py adapts the replay checks of our #7611/#7608 packages; it imports no +other package and none of #7612's code was run. diff --git a/research/p104-large-step-audit/retained/7613/README.md b/research/p104-large-step-audit/retained/7613/README.md new file mode 100644 index 0000000000..e92923fcc2 --- /dev/null +++ b/research/p104-large-step-audit/retained/7613/README.md @@ -0,0 +1,100 @@ +# CONDITIONAL κ = 0.00365305686569 — contact 902/1091 rechart on #7612 (premise: the inherited CLEAR #44 content) + +**κ = 0.003653056865686921592…, ×1.0000867 (+0.00867%) over +[#7612](https://github.com/CrocSwap/integer-mult-bounds/pull/7612)** +(exact crossing 0.00365274031123; #7612 claims 0.003652740309). The official +`evaluate_recursive_power` bracket is [0.0036530568656, 0.0036530568657]. + +The edit applies the contact-rechart move that Clear1nsight's #7612 made at +public fields 134/329 to a second pair, 902/1091. The move pattern is theirs; +this package only applies it to another contact. #7612 is built on our +[#7611](https://github.com/CrocSwap/integer-mult-bounds/pull/7611) and +[#7608](https://github.com/CrocSwap/integer-mult-bounds/pull/7608) (see +[NOTICE](NOTICE)). + +> **Premise (inherited, nothing new).** Conditional on exactly the premise of +> #7608/#7612: owned CLEAR #44 (owned field 1557, chart 595) erases +> `{451:−1, 1495:1}` and `owned_erasure` must let a CLEAR discard that row. +> This word's CLEAR content is identical to #7612's at all 74 CLEARs. If that +> premise is refused, this word is void with #7612. + +## The edit + +On #7612's word (76,667 events → 76,666): +- `ADD 1091 += 1/2·902` is retagged from chart 618 to chart 373. +- Field 902 goes 3→373→913 (was 3→618→913), with a `MOVE 902 3→373` placed just + before the ADD. Field 1091 goes 373→733 (the hop 373→618 is deleted). + Dimensions: 902 0→3→7→8 becomes 0→2→7→8; 1091 …2→3→4… becomes …2→4…. +- Two adjacent MOVEs of different registers (1087 237→238 and 1091 733→238) + swap order; they commute and nothing runs between them. + +It is legal because 1091 already sits at 373 and 902 arrives there just before +the ADD, 373 ⊂ 913 and 373 ⊂ 733 keep every changed MOVE a strict ascent, and +the chart of an ADD is a tag only. No new chart pair appears: (3,373), +(373,913) and (373,733) all occur in #7612. All 1,569 rows and end charts, the +header, the 47 owned MOVEs, the 74 owned lifetimes, the peak (50) and the +coefficient grid (2^25, odd denominator 1125, 40 bits) equal #7612's. +[data/edits.json](data/edits.json) lists every event by #7612 index. + +## Price + +The invoice is #7612's with the native delta charged 17 times (native paid +delta {1:−2, 2:+2, 3:−1, 4:−1, 5:+1}): +- paid positions 110,264 → 110,247; productive 22,461; rank surplus S = 1,424 + unchanged. + +Official tools (`price.py`): +- `scripts/compare_recursive_invoices.py` against #7612: `uniformly_better`, + strictly negative for r^(1−C), paid {1:−34, 2:+34, 3:−17, 4:−17, 5:+17}, + targets unchanged. +- `scripts/evaluate_recursive_power.py` (256 bits): `new_cost_lower` at + C = 0.0036530568656, 0.0036527403112 (#7612's crossing) and 0.0036524238118 + (#7611's); `new_cost_higher` at C = 0.0036530568657. + +## Checks + +```sh +python3.12 -B scripts/research_package.py --package research/p104-contact902-1091-on7612 +``` + +`check.py` (standard library) authenticates the vendored #7612 word, rebuilds +the new word from the edit list, replays both exactly over the rationals with +the legality checks in its docstring, requires every row, end chart, owned MOVE, +lifetime and the header to equal #7612's and all 74 CLEARs to erase #7612's +content (CLEAR #44 asserted), requires that only registers 902 and 1091 change +their MOVE chains with endpoints kept and no new chart pair, recomputes the +invoice and κ and reproduces #7612's crossing, and runs 12 rejecting controls +(ADD kept at 618 or at 101, coefficient changed, ADD dropped, the 902 MOVE +after the ADD, dropped or reversed or non-nested MOVEs, 1091 still moving from +618, ownership flag flipped) plus a tampered invoice. `price.py` runs the two +repository tools above. + +The strictification gate was run offline by us and is not part of this package: +γ 0.941030, δ 0.908151, both below 31/32 (#7612: γ 0.941017, δ 0.908150). +An independent read-only audit found the word sound relative to #7612. + +## Conditional premises and what is not rerun + +On top of the inherited CLEAR #44 premise, the claim carries the framework +assumptions of #7605 (`native_all_columns`, `owned_erasure`, `compiler`, +`precision_tape`, `analytic_recovery`), the signed #7113 caller, and the BIT +premise of the base. This package does not rerun the signed caller, outer +predicates, precision/tape counts or ordinary bill (header, rows, grid and +owned data are unchanged). No upstream maintainer has reviewed the package. + +## Method + +For every public ADD (both registers public) and every chart, the contact was +retagged and each register's stay moved or split where legal, keeping every +path a strict ascent. On #7612's word exactly one of 1,356 valid single moves +has positive gain, this one; a rescan of the new word finds none. + +## Open next questions + +**The premise.** A ruling on `owned_erasure` (clear-form-gap Q1) decides #7608, #7612 and this word together. See [TASK.json](TASK.json). + +## Credit + +The move pattern and the base word are Clear1nsight's #7612; the lineage below +it is in [NOTICE](NOTICE) (#7611, #7608, #7605 and the authors credited there). +DreamingOfClouds with Claude Opus 5.5 (Anthropic), via Claude Code. Apache-2.0. diff --git a/research/p104-large-step-audit/retained/7613/invoice-new.json b/research/p104-large-step-audit/retained/7613/invoice-new.json new file mode 100644 index 0000000000..9ef6a1ff95 --- /dev/null +++ b/research/p104-large-step-audit/retained/7613/invoice-new.json @@ -0,0 +1 @@ +{"schema":"integer-mult-recursive-invoice/v1","contract":{"model":"mixed-target-unnormalized-power-v1","rank_semantics":"H_r costs r^(1-C); debit surrendered productive fields","ambient_rank":145,"boundary":"complete signed #7113 caller application with 17 native calls"},"paid":{"1":68129,"2":14450,"3":14059,"4":3757,"5":5899,"6":289,"7":187,"8":741,"9":32,"16":416,"24":416,"32":416,"40":416,"48":416,"56":416,"64":208},"targets":{"1":306,"2":357,"3":799,"4":3825,"5":1360,"6":731,"7":323,"8":544,"9":10888,"17":416,"25":416,"33":416,"41":416,"49":416,"57":416,"65":416,"73":208,"137":208}} \ No newline at end of file diff --git a/research/p104-large-step-audit/retained/7613/word.json.gz b/research/p104-large-step-audit/retained/7613/word.json.gz new file mode 100644 index 0000000000..244f817a22 Binary files /dev/null and b/research/p104-large-step-audit/retained/7613/word.json.gz differ diff --git a/research/p104-large-step-audit/retained/independent_interval.py b/research/p104-large-step-audit/retained/independent_interval.py new file mode 100644 index 0000000000..30ae586ea0 --- /dev/null +++ b/research/p104-large-step-audit/retained/independent_interval.py @@ -0,0 +1,155 @@ +#!/usr/bin/env python3 +"""Independent rational arithmetic for the complete exchanged-forest invoice. + +The interval implementation below is new and imports no proposer arithmetic. +Logarithms use an atanh series after binary range reduction; exponentials use +a positive Taylor series with a geometric bound on the full remainder. +""" +from pathlib import Path +from fractions import Fraction as Q +from functools import lru_cache +from collections import Counter +import hashlib, json, time + +HERE=Path(__file__).resolve().parent + +def need(ok,message): + if not ok:raise ValueError(message) + +def add(a,b):return a[0]+b[0],a[1]+b[1] +def mul(a,b): + z=[x*y for x in a for y in b] + return min(z),max(z) +def div(a,b): + need(b[0]>0,'positive interval divisor') + return mul(a,(1/b[1],1/b[0])) + +def small_log(z): + # log((1+z)/(1-z)), 0<=z<=1/3. + need(0<=z<=Q(1,3),'range-reduced logarithm') + acc=Q(0);term=z;N=40 + for k in range(N): + acc+=term/Q(2*k+1);term*=z*z + lo=2*acc;tail=2*term/(Q(2*N+1)*(1-z*z)) + return lo,lo+tail + +@lru_cache(None) +def logarithm(r): + need(r>=1,'positive integer rank') + k=r.bit_length()-1;z=Q(r-(1<0,'lower crossing endpoint') + if k==Q(cert['raw_crossing_bracket'][1]):need(g[1]<0,'upper crossing endpoint') + if k==C:need(g[0]>0,'strict selected raw saving') + tt=moment(T,t);pt=moment(P,t) + u=Q(a['paid_tail_offset']);z=Q(a['target_tail_offset']) + c=a['cutoff_base'];b=a['floor_base'];v=a['tensor_power'] + alpha=div(pt,tt) + gamma=div(moment(P,t+u),mul(power(c,u),tt)) + lam=div(mul(power(b,z),moment(T,t-z)),tt) + claimed=list(map(Q,a['rational_upper_limits'])) + for interval,limit in zip((alpha,gamma,lam),claimed): + need(0exact>new and atom<1-exact, + 'complete ordinary bootstrap envelope') + previous=new + need(previous==Q(cert['ordinary_admitted']),'final ordinary claim') + result['branches'][branch]={'controller_sha256':hashlib.sha256(raw).hexdigest(), + 'targets':dict(sorted(T.items())),'paid':dict(sorted(P.items())), + 'moment_intervals':margins,'alpha':bounds_text(alpha),'gamma':bounds_text(gamma), + 'lambda':bounds_text(lam),'normalized_upper':bounds_text((norm,norm)), + 'strict_raw_saving':str(C),'uniform_saving':uniform['uniform_saving'], + 'ordinary_saving':cert.get('ordinary_admitted'), + 'effective_uniform_rank_encoding':uniform['N']} + result['seconds']=time.monotonic()-started + result['scope']='Independent invoice, exact interval and finite-tail arithmetic; retained all-column native, physical realization and outer transfer premises are separate.' + return result + +if __name__=='__main__': + import sys + version07='--functional07'in sys.argv;version06='--functional06'in sys.argv;version05='--functional05'in sys.argv;version04='--functional04'in sys.argv;version02='--functional02'in sys.argv;functional='--functional'in sys.argv or version02 or version04 or version05 or version06 or version07 + r=audit(functional,version02,version04,version05,version06,version07);(HERE/('FUNCTIONAL-KERNEL-07-ADMISSION-INDEPENDENT.json'if version07 else'FUNCTIONAL-KERNEL-06-ADMISSION-INDEPENDENT.json'if version06 else'FUNCTIONAL-KERNEL-05-ADMISSION-INDEPENDENT.json'if version05 else'FUNCTIONAL-KERNEL-04-ADMISSION-INDEPENDENT.json'if version04 else'FUNCTIONAL-KERNEL-02-ADMISSION-INDEPENDENT.json'if version02 else'FUNCTIONAL-KERNEL-ADMISSION-INDEPENDENT.json'if functional else'EXCHANGE-ADMISSION-INDEPENDENT.json')).write_text(json.dumps(r,indent=2)+'\n') + print(json.dumps({'status':r['status'],'seconds':r['seconds'], + 'savings':{k:v['uniform_saving'] for k,v in r['branches'].items()}},indent=2)) diff --git a/research/p104-large-step-audit/retained/interval_gate.py b/research/p104-large-step-audit/retained/interval_gate.py new file mode 100644 index 0000000000..e24dc46079 --- /dev/null +++ b/research/p104-large-step-audit/retained/interval_gate.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 +"""Independent certified fixed-grid intervals (80 decimal places). +ln via 2 atanh after binary range reduction; exp(-x) via alternating +Taylor brackets. Uses only integer floor/ceiling, not Decimal transcendents. +""" +from fractions import Fraction as F +from functools import lru_cache +from pathlib import Path +import json,argparse +if not __debug__: raise RuntimeError('Run without -O; assertions are proof checks.') +B=10**80 + +def ceildiv(a,b):return -((-a)//b) +def exact(q): + q=F(q);return q.numerator*B//q.denominator,ceildiv(q.numerator*B,q.denominator) +def add(a,b):return a[0]+b[0],a[1]+b[1] +def sub(a,b):return a[0]-b[1],a[1]-b[0] +def mul(a,b): + p=[a[i]*b[j] for i in (0,1) for j in (0,1)];return min(p)//B,ceildiv(max(p),B) +def div(a,b): + assert b[0]>0 + p=[F(a[i]*B,b[j]) for i in (0,1) for j in (0,1)] + return min(p).__floor__(),max(p).__ceil__() +def smul(a,q):return mul(a,exact(q)) +def atanh_log(y): + yi=exact(y);yy=mul(yi,yi);p=yi;s=(0,0) + for j in range(100):s=add(s,smul(p,F(2,2*j+1)));p=mul(p,yy) + # 0 <= tail <= 2 y^201/[201(1-y^2)] < 3*(1/3)^201. + return s[0],s[1]+ceildiv(3*B,3**201) +@lru_cache(None) +def log(r): + assert r>=1 + k=r.bit_length()-1;y=F(r-2**k,r+2**k) + a=atanh_log(y);b=atanh_log(F(1,3));return add(a,smul(b,k)) +def expminus(x): + assert 0<=x[0]<=x[1]0 and margins[str(hi)][1]<0 and margins[str(tested)][0]>0 + target=moment(T,tested);paid=moment(P,tested) + alpha=div(paid,target) + # Tail exponent = 1-tested+1/7; argument exp may not be negative. + # r^(1-tested+1/7)=r^(1-tested)* exp(log(r)/7). + def exppos(x): + assert 0<=x[0]<=x[1]0 and gap.numerator==1;step=gap.denominator + wins=lambda j:(step*j+1)**written<2**j + l,h=1,2 + while not wins(h):l,h=h,2*h + while h-l>1: + m=(l+h)//2 + if wins(m):h=m + else:l=m + assert wins(h) and not wins(h-1) + # Monotonicity: upper derivative bound on [0, cap]. + derivative=(0,0) + for rr in T.keys()|P.keys(): + c=T.get(rr,0)-P.get(rr,0);r=int(rr) + term=mul(power(r,cap if c>=0 else 0),log(r));derivative=add(derivative,smul(term,-c)) + assert derivative[1]<0 + result=dict(claim=str(claim),tested=str(tested),raw_bracket=[str(lo),str(hi)],moment_margins={k:show(v) for k,v in margins.items()},moment_margin_float={k:value(v) for k,v in margins.items()},derivative_upper=float(F(derivative[1],B)),alpha=value(alpha),gamma=value(gamma),delta=value(delta),minimum_log_power=lp,written_log_power=written,compiler_gap=str(gap),H=str(step*h),BIT_pin=str(cap),BIT_margin=str(cap-tested)) + # Outer formulas evaluated independently after algebraically substituting + # b=k+5g,a=k+4g,q=k+3g,epsilon=1-g,beta=1-3g. + k=claim;g=gap;b=k+5*g;a=k+4*g;q=k+3*g;ep=1-g;be=1-3*g;r0=g/10;stop=layout=g + sig=1-b;tau=1-a;internal=tau+(1-stop)*max(sig-tau,0);leaf=sig+stop*(1-sig);lam=1-(q+a)/2;xi=ep*(1+q)-F(3,32)+layout;key=be+1-ep + M=[ep*q,a,1-ep+q*be,1-ep+a*be,1-ep+be,F(3,32)+xi-ep,xi+F(1,2)-ep,ep,1-(ep+be+48-128+2)] + checks=[cap-a,b-a,q,b-q,a-q,stop,1-stop,(1-stop)*b-a,1-internal-q,1-leaf-q,lam-tau,lam-sig,lam-internal,1-q-lam,1-q-leaf,ep,1-ep,xi-F(1,2),ep-xi,be,ep-be,1-be,1-(2*xi-2)-r0-be,1-(2*xi-2)-be,1-ep-r0,1-ep,r0,1-key,1-be-2*(1-ep),128-48-be,layout,ep-a,F(1,32)-b,F(2**45-7**16),F(2),2-xi,F(5),1-be,1-be,1-ep,M[2]-M[0],g,k-F('.001730970419199163702738'),1-ep,F(11,2)]+[x-k for x in M] + functional=[1-be,be*(1-F(3,1000)),128-48-ep-be-1,be*(1-F(1,250))] + assert len(checks)==54 and len(functional)==4 and min(checks+functional)>0 + result['outer']=dict(strict_count=54,functional_count=4,minimum_margin=str(min(checks+functional)),BIT_just_below_effective_rejected=(a-F(1,10**12))-a<0) + # Input-lift is only needed on [1-tested_complex,1]. A stronger BIT + # pin is irrelevant to this interval; the source's crude BIT-wide bound + # is not imported beyond its valid range. + pos={7:1,3:1,5:1};neg={9:1,4:1,1:2};d1=(0,0);curvature=(0,0) + for hist,sign in ((pos,1),(neg,-1)): + for r,c in hist.items(): + d1=add(d1,smul(log(r),sign*c*r)) + curvature=add(curvature,smul(mul(log(r),log(r)),c*r)) + lift_cap=cap if cap<=F('.00376669') else tested + assert tested<=lift_cap and F(d1[1],B)+lift_cap*F(curvature[1],B)<0 + lifts={} + for price in (claim,tested): + lift=sub(moment(pos,price),moment(neg,price));assert lift[0]>0 + assert price*(-F(d1[1],B))-price*price*F(curvature[1],B)/2>0 + lifts[str(price)]=show(lift) + result['input_lift']=dict(margins=lifts,interval_kappa_cap=str(lift_cap),derivative_upper_on_required_interval=str(F(d1[1],B)+lift_cap*F(curvature[1],B)),source_BIT_wide_crude_bound_would_be=str(F(d1[1],B)+cap*F(curvature[1],B))) + return result +if __name__=='__main__': + p=argparse.ArgumentParser();p.add_argument('audit');p.add_argument('--claim',default='.00362852408');p.add_argument('--tested',default='.00362852408007');p.add_argument('--lower',default='.00362852408398727978896072723289');p.add_argument('--upper',default='.00362852408398727978896072723290');p.add_argument('--out',required=True);p.add_argument('--bit-pin',default='.00376669');a=p.parse_args() + r=gate(json.loads(Path(a.audit).read_text())['invoice'],a.claim,a.tested,a.lower,a.upper,a.bit_pin);Path(a.out).write_text(json.dumps(r,indent=2)+'\n');print(json.dumps(r,indent=2)) diff --git a/research/p104-large-step-audit/retained/paired-bit-NOTICE b/research/p104-large-step-audit/retained/paired-bit-NOTICE new file mode 100644 index 0000000000..32c2936ea0 --- /dev/null +++ b/research/p104-large-step-audit/retained/paired-bit-NOTICE @@ -0,0 +1,26 @@ +Paired E-free BIT specialization and complete accounting, with substantial +OpenAI Codex assistance, for the integer-multiplication research project. +Apache-2.0; LICENSE is retained from the source project. + +DreamingOfClouds (Claude Opus assistance) receives credit for #6834's chain-root +BIT caller, #6937's E-free roots and the underlying two-chain construction. +@CubeJerry (OpenAI assistance) receives credit for #6980's four-input three-query +identity, separated interval replacement and QUERY-only caller. The complete +#6980 proof is retained byte-for-byte in data/6980_PROOF.md. + +The new contribution specializes that existing caller to the actual #6726 BIT +native, supplies the parity-driven pairing of two real 111-port invocations, +and checks the complete E-free finite/compiler/ordinary budget from the selected +ordinary backend. No general QUERY-only mechanism, chain root or new raw kappa +is claimed as new here. + +independent/bit_review.py and independent/interval_gate.py were written by a +separate OpenAI Codex research worker for an implementation-independent scalar +and arithmetic audit. This is model-run checking, not external human review. + +zxv and retained predecessor authors receive credit for #6726's source-native +export, integer-before-mod2 transfer, complete source checking and admission +framework. Ali Romman and Cinna Davis retain the root/native lineage credit. +The copied arithmetic and native checker retain their original headers; see +retained/NOTICE. The selected .0034 backend retains the source and contributor +credits in data/selected_record.json and data/selected_review.md. diff --git a/research/p104-large-step-audit/retained/paired-retained-NOTICE b/research/p104-large-step-audit/retained/paired-retained-NOTICE new file mode 100644 index 0000000000..16c9afd68e --- /dev/null +++ b/research/p104-large-step-audit/retained/paired-retained-NOTICE @@ -0,0 +1,25 @@ +This research package contains and adapts Apache-2.0 material from +CrocSwap/integer-mult-bounds. The repository's Apache-2.0 license is +provided as LICENSE. + +The six-field mixed-projector architecture and binary-child recursion +are adapted from research/mixed-projector-query-root and its PR6348/PR6398 +lineage, credited there to Ali Romman and Cinna Davis with substantial +OpenAI Codex assistance. The public complex normalization, dyadic bases +and proof by two central characters are not imported as a binary proof. + +The binary projectors, direct characteristic-two operator verification, +complete binary staged callers, exact incidence enumeration and target +economic relaxation in this directory were constructed and checked in +this research session. No novelty or priority assertion is made. + +inputs/interval_engine.py is an unchanged copy of +research/higher-moment-strictification/verify.py, credited to zxv with +substantial OpenAI Codex assistance; its own source notices remain intact. +The broader finite/compiler/ordinary admission in the sibling root +package retains the credit and assumptions of its pinned predecessors. + +The unchanged native source and baseline construction retain all their +original attribution, including their functional kernel, receiver +compensation, temporal retiming, helper exchange and ordinary admission +lineages. No new source-word saving is claimed by this caller package. diff --git a/research/p104-large-step-audit/retained/role315-NOTICE b/research/p104-large-step-audit/retained/role315-NOTICE new file mode 100644 index 0000000000..60bbd9f3f8 --- /dev/null +++ b/research/p104-large-step-audit/retained/role315-NOTICE @@ -0,0 +1,15 @@ +Hao Yan (@FanPUYen), with substantial OpenAI Codex assistance. Apache-2.0. + +This contribution adds only the productive-helper315 direct lift to the exact +published PR7603 word. SYLforge's PR7603 supplies the two preceding contractions +and removed helper315 observations. DreamingOfClouds' PR7601 supplies token +settlement; ToikY's PR7546 supplies the complete predecessor application. +The signed caller and application retain Rohan Arun's PR7113 and the credited +PR7334/PR7314/PR7481 lineage, Clear1nsight's and dillona's source contributions, +and every author and source-specific license/notice in the immutable archives. +The directed invoice tools retain aliromman's and their predecessors' credit. + +All retained source bytes are unchanged. SOURCE-VERSIONS.json records exact +origin commits, paths, archive members where applicable, and SHA256 digests. +Retained historical README files describe their own historical scope and are +not claims that those predecessors are the current selected frontier. diff --git a/research/p104-large-step-audit/verify.py b/research/p104-large-step-audit/verify.py new file mode 100644 index 0000000000..c0280ecb3e --- /dev/null +++ b/research/p104-large-step-audit/verify.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +"""Authenticate self-contained source exports, with a corrupt-byte control.""" +from pathlib import Path +import hashlib +import json +HERE = Path(__file__).resolve().parent + +def check(raw, digest): + if hashlib.sha256(raw).hexdigest() != digest: + raise ValueError('immutable source SHA256') + +def main(): + count = 0 + for row in json.loads((HERE / 'SOURCE-VERSIONS.json').read_text())['files']: + check((HERE / row['path']).read_bytes(), row['sha256']) + count += 1 + bit = json.loads((HERE / 'bit/SOURCES.json').read_text()) + for row in [bit['scientific_input']] + bit['retained_notices']: + check((HERE / 'bit' / row['local']).read_bytes(), row['sha256']) + count += 1 + row = bit['scientific_input'] + raw = (HERE / 'bit' / row['local']).read_bytes() + try: + check(bytes([raw[0] ^ 1]) + raw[1:], row['sha256']) + except ValueError: + pass + else: + raise ValueError('source corruption was accepted') + print(f'PASS_SELF_CONTAINED_SOURCE_CUSTODY: {count} immutable exports; corrupt-byte rejected') + +if __name__ == '__main__': + main()