diff --git a/research/partial-k-face-bypass/CLAIM.json b/research/partial-k-face-bypass/CLAIM.json new file mode 100644 index 0000000000..556d7d532d --- /dev/null +++ b/research/partial-k-face-bypass/CLAIM.json @@ -0,0 +1,58 @@ +{ + "track": "complex supplier", + "assignment_seed": 24, + "seed_source": "Python secrets.randbelow(100), OS randomness", + "base_commit": "66849e1475c930fd7732b1a0067ffee7e1e95f60", + "started_utc": "2026-10-13T03:27:47Z", + "claimed_utc": "2026-10-13T03:34:48.843773+00:00", + "expected_finish_utc": "2026-10-13T04:07:47Z", + "time_budget_minutes": 40, + "orientation_limit_minutes": 8, + "verification_and_handoff_reserved_minutes": 10, + "object": "Partial raw-leaver bypass of face-copy helpers for mixed K/M coordinate pair (0,2) in the accepted K492/RAW504 construction lineage.", + "method": "Exact F2 frame-state scheduling with own reads allowed at arbitrary positions; both signs and nonempty deletion subsets of the two selected-source face copies. Price any feasible schedule including changed source accesses, later face formation, restoration and recursive children before promoting it.", + "seed_diversification": "Lexicographically sorted eight mixed pairs; 24 mod 8 selects (0,2). Start sign -1 from (-1,+1)[24 mod 2].", + "deliverable": "Scoped research note, reproducible exact checker and finite evidence; no new kappa unless a complete admitted construction is produced.", + "candidates_considered": [ + { + "task": "Mixed K/M partial face bypass with movable own reads", + "decision": "selected; distinct from full triangles and first-own face/slot sharing" + }, + { + "task": "Retired-row basis/gauge changes to free cold endpoints", + "decision": "not selected; substantial concurrent overlap with #645/#655/#659/#664" + }, + { + "task": "Sharper fixed-dispatch paid-profile/owner ceiling", + "decision": "not selected; substantial overlap with #619/#639/#644 and later owner PRs" + } + ], + "coordination": "No pinned issues returned by GitHub GraphQL; the sole open issue was #650 (Discussions). Claim recorded locally; no reservation issue opened.", + "overlap_checked": { + "622": "accepted full K-triangle construction", + "626": "accepted owner repair", + "646": "whole signed-root triangle extension", + "651": "target/face sharing under own-read-first interface", + "645": "factory gauge44", + "665": "spectral split recursive interface, distinct" + }, + "status": "completed", + "contributor": "Douglas R. Colkitt (@Mister-Meeseeks)", + "ai_assistance": "Substantial OpenAI Codex assistance in research, implementation, verification and prose.", + "scope_refinement": "The completed obstruction concerns deleting both selected-source face copies simultaneously. Partial one-face deletion masks were not investigated; their mention in the initial method is not a completed-coverage claim. Geometry covers all eight mixed pairs and both signs; bounded scheduling covers both signs of seed-selected (0,2).", + "evidence_driven_pivot": "The first relaxed schedule omitted the ordinary M consumer. Restoring its necessary frame cap changed the minimum remaining-packet carriers from two to four. The fully paid attaining control retains 492 helpers and loses at every 0=744], 'removed_504_helpers':[") +sys.argv = [str(srcpath), str(root/'research/direct-delivery504-global/inputs/hamming'), + str(output), str(root/'research/complex-k492-owner-repair/data/TRI-SCHEDULE.json')] +exec(compile(src, 'partial_k_constructor', 'exec'), {}) diff --git a/research/partial-k-face-bypass/model.py b/research/partial-k-face-bypass/model.py new file mode 100644 index 0000000000..0d55b80c25 --- /dev/null +++ b/research/partial-k-face-bypass/model.py @@ -0,0 +1,221 @@ +"""Exact mixed K/M face geometry and bounded scheduling, Apache-2.0. + +Douglas R. Colkitt, with substantial OpenAI Codex assistance. Geometry and +scalar conventions follow icekylinx's #531 and Kothe/AtomScout's #622. +This implementation reads the packet data; it imports no constructor code. +""" +from collections import defaultdict +from fractions import Fraction as Q +from functools import lru_cache +from itertools import combinations +import gzip +import json + + +def require(ok, message): + if not ok: + raise ValueError(message) + + +@lru_cache(None) +def basis(vectors): + pivots = {} + for value in vectors: + for bit in sorted(pivots, reverse=True): + if value >> bit & 1: + value ^= pivots[bit] + if value: + bit = value.bit_length() - 1 + for other in pivots: + if pivots[other] >> bit & 1: + pivots[other] ^= value + pivots[bit] = value + return tuple(pivots[bit] for bit in sorted(pivots, reverse=True)) + + +@lru_cache(None) +def join(left, right): + return basis(left + right) + + +def contained(frame, labels): + return all((vector & label).bit_count() % 2 == 0 + for vector in frame for label in labels) + + +def load_geometry(directory): + prototype = json.loads((directory / 'PROTOTYPE.json').read_text()) + modules = json.loads(gzip.decompress((directory / 'PACKET-PROGRAMS.json.gz').read_bytes())) + ports, roots = prototype['binary_ports'], prototype['root_lines'] + blocks = {} + requests = defaultdict(list) + own = {} + for module in modules: + block = tuple(module['receipt']['block']) + ids = module['receipt']['source_lines'] + rows = [{source: Q(1)} for source in ids] + [{} for _ in range(16)] + frames = [(ports[source],) for source in ids] + [()] * 16 + for event, vectors in zip(module['events'][:40], module['event_frames'][:40]): + target, source, num, den = event + frame = basis(tuple(vectors)) + for reg in (target, source): + require(join(frames[reg], frame) == frame, 'packet prefix frame descent') + frames[reg] = frame + for key, value in list(rows[source].items()): + rows[target][key] = rows[target].get(key, Q(0)) + Q(num, den) * value + if not rows[target][key]: + del rows[target][key] + blocks[block] = dict(module=module, rows=rows, frames=frames, ids=ids) + p, q = block[:2], block[2:] + tetrads = [[s for s in ids if sum(roots[s][i] < 0 for i in block) % 2 == parity] + for parity in (0, 1)] + for parity, tetrad in enumerate(tetrads): + groups = defaultdict(list) + for target in tetrad: + groups[roots[target][p[0]] * roots[target][p[1]]].append(target) + for eps, group in sorted(groups.items()): + t, u = sorted(group) + zz = -Q(2 * roots[u][p[0]], roots[t][p[0]]) + for target, sign in ((t, -1), (u, 1)): + wanted = {} + for source in tetrads[1 - parity]: + gt = Q(sum(a*b for a, b in zip(roots[t], roots[source])), 2) + gu = Q(sum(a*b for a, b in zip(roots[u], roots[source])), 2) + coefficient = -gt/4 - sign*gu/2/zz + if coefficient: + wanted[source] = coefficient + matches = [] + for reg, row in enumerate(rows): + if set(row) != set(wanted): + continue + first = next(iter(wanted)) + scale = wanted[first] / row[first] + if all(wanted[s] == scale*row[s] for s in wanted): + matches.append(reg) + require(len(matches) == 1, 'own token not unique') + own[target] = (block, matches[0]) + requests[block, p, eps].append(t) + e2 = roots[t][q[0]] * roots[t][q[1]] + requests[block, q, e2].append(u) + return dict(ports=ports, roots=roots, blocks=blocks, requests=requests, own=own) + + +def face(geometry, block, pair, sign): + data = geometry['blocks'][block] + module = data['module'] + keys = [(p, e) for p in combinations(block, 2) for e in (-1, 1)] + output, alpha = module['outputs'][keys.index((pair, sign))] + events = [e for e in module['events'][40:] if e[0] == output] + require(len(events) == 1, 'face not formed by one addition') + a, b, num, den = events[0] + require((num, den) == (1, 1), 'unexpected face coefficients') + return (a, b), join(data['frames'][a], data['frames'][b]) + + +def mixed_pairs(geometry): + return [pair for pair in combinations(range(8), 2) + if sum((block, pair, -1) in geometry['requests'] + for block in geometry['blocks']) == 2] + + +def case(geometry, pair, sign): + blocks, requests, own = (geometry[k] for k in ('blocks', 'requests', 'own')) + incident = sorted(b for b in blocks if set(pair) <= set(b)) + selected = [b for b in incident if (b, pair, sign) in requests] + require(len(incident) == 3 and len(selected) == 2, 'not a mixed pair') + ordinary = next(b for b in incident if b not in selected) + targets = sorted(t for b in selected for t in requests[b, pair, sign]) + leavers = [(b, r) for b in selected for r in face(geometry, b, pair, sign)[0]] + frames = [blocks[b]['frames'][r] for b, r in leavers] + ordinary_targets = [t for t in blocks[ordinary]['ids'] + if geometry['roots'][t][pair[0]] * geometry['roots'][t][pair[1]] == sign] + mlabels = [geometry['ports'][t] for t in ordinary_targets] + labels = [geometry['ports'][t] for t in targets] + packet = face(geometry, ordinary, pair, sign)[1] + operations, pre_packet = [], [] + for index, target in enumerate(targets): + own_index = leavers.index(own[target]) + operations.append((index, 4 + own_index, 'own')) + other = next(b for b in selected if b != own[target][0]) + foreign = [j for j, (b, _) in enumerate(leavers) if b == other] + operations.extend((index, 4 + j, 'raw') for j in foreign) + pre_packet.append(basis(frames[own_index] + tuple(x for j in foreign for x in frames[j]))) + operations.extend((i, -1, 'packet') for i in range(4)) + require(all(contained(f, mlabels) for f in frames), 'raw leaver outside ordinary caps') + obstruction = next((x, t-8, geometry['ports'][t]) for x in packet for t in ordinary_targets + if (x & geometry['ports'][t]).bit_count() % 2) + complete = [join(f, packet) for f in pre_packet] + cross = [[contained(f, [label]) for label in labels] for f in complete] + require(cross == [[i == j for j in range(4)] for i in range(4)], 'packet sharing remains possible') + witnesses = [[i, j, next(x for x in complete[i] if (x & labels[j]).bit_count() % 2)] + for i in range(4) for j in range(4) if i != j] + return dict(pair=list(pair), sign=sign, selected_blocks=selected, ordinary_block=ordinary, + targets=[t-8 for t in targets], ordinary_targets=[t-8 for t in ordinary_targets], + target_labels=labels, ordinary_labels=mlabels, leavers=leavers, + leaver_frames=frames, packet_frame=packet, pre_packet_frames=pre_packet, + complete_frames=complete, packet_outside_ordinary_caps=obstruction, + cross_cap_matrix=cross, cross_cap_witnesses=witnesses, + operations=operations, packet_carrier_lower_bound=4) + + +def search(data, copies, ordinary_guard=True, state_limit=2_000_000): + """Complete memoized state search, or explicitly stop at state_limit. + +Target reads change both operand frames to their join. Each required read is +executed once; every packet read chooses a carrier. Equal adjacent packet +states are interchangeable, so skip only that exact symmetry. + """ + ops, labels = data['operations'], data['target_labels'] + initial = ((),)*4 + tuple(data['leaver_frames']) + (tuple(data['packet_frame']),)*copies + visited = 0 + + @lru_cache(None) + def dfs(done, state): + nonlocal visited + visited += 1 + if visited > state_limit: + raise RuntimeError('state limit exceeded; no exhaustion claim') + if done == (1 << len(ops)) - 1: + return () + for i, (a, source, _) in enumerate(ops): + if done >> i & 1: + continue + for b in ([source] if source >= 0 else range(8, 8 + copies)): + if source < 0 and b > 8 and state[b] == state[b-1]: + continue + frame = join(state[a], state[b]) + if not contained(frame, [labels[a]]): + continue + if ordinary_guard and b < 8 and not contained(frame, data['ordinary_labels']): + continue + if any(ob == b and j != i and not(done >> j & 1) and + not contained(frame, [labels[oa]]) for j, (oa, ob, _) in enumerate(ops)): + continue + updated = list(state) + updated[a] = updated[b] = frame + if any(not(done >> j & 1) and j != i and ob < 0 and + not any(contained(updated[k], [labels[oa]]) for k in range(8, 8+copies)) + for j, (oa, ob, _) in enumerate(ops)): + continue + suffix = dfs(done | 1 << i, tuple(updated)) + if suffix is not None: + return ((i, b),) + suffix + return None + + schedule = dfs(0, initial) + return dict(copies=copies, ordinary_guard=ordinary_guard, states=visited, + status='EXHAUSTED' if schedule is None else 'FOUND', + schedule=schedule, state_limit=state_limit) + + +def recipe(data, schedule): + reads = [] + for event, source in schedule: + target = data['targets'][data['operations'][event][0]] + if source >= 8: + reads.append([target, 'packet', source-8]) + else: + block, local = data['leavers'][source-4] + reads.append([target, 'leaver', list(block), local]) + return dict(pair=data['pair'], sign=data['sign'], blocks=data['selected_blocks'], + targets=data['targets'], ops=reads) diff --git a/research/partial-k-face-bypass/verify.py b/research/partial-k-face-bypass/verify.py new file mode 100644 index 0000000000..9eedfa8e3b --- /dev/null +++ b/research/partial-k-face-bypass/verify.py @@ -0,0 +1,187 @@ +#!/usr/bin/env python3 +"""Reproduce the partial K/M obstruction and its fully paid control circuit. + +Standard library only. No network, optimizer, or selected-frontier regeneration. +Douglas R. Colkitt with substantial OpenAI Codex assistance; Apache-2.0. +""" +import argparse +from collections import Counter +import copy +import gzip +import hashlib +import importlib.util +import json +from pathlib import Path +import subprocess +import sys +import tempfile + +PACKAGE = Path(__file__).resolve().parent +ROOT = PACKAGE.parents[1] +spec = importlib.util.spec_from_file_location('partial_k_model', PACKAGE/'model.py') +model = importlib.util.module_from_spec(spec) +spec.loader.exec_module(model) +require = model.require + + +def read(path): + raw = path.read_bytes() + return json.loads(gzip.decompress(raw) if path.suffix == '.gz' else raw) + + +def sha(path): + return hashlib.sha256(path.read_bytes()).hexdigest() + + +def normalized(value): + return json.loads(json.dumps(value, sort_keys=True)) + + +def check_pins(pins, root=ROOT): + for path, digest in pins['files'].items(): + require(sha(root/path) == digest, 'source pin mismatch: '+path) + + +def run(name, script, arguments, work, expected_failure=False): + # Inherited auditors use assertions. Explicitly start a fresh, non-optimized + # interpreter, even when this orchestration runs under -I -O. + command = [sys.executable, '-I', '-B', str(script), *map(str, arguments)] + result = subprocess.run(command, capture_output=True, text=True) + (work/(name+'.log')).write_text(result.stdout+result.stderr) + if expected_failure: + require(result.returncode != 0, 'negative control accepted: '+name) + require('AssertionError' in result.stderr, 'control failed for an unrelated reason: '+name) + else: + require(result.returncode == 0, name+' failed: '+result.stderr[-2000:]) + return result + + +def audit_receipt(path): + receipt = read(path/'SCALAR-FRAME-AUDIT.json') + receipt.pop('seconds') + widths = receipt.pop('widths') + receipt['residual_width_histogram'] = dict(sorted(Counter(widths).items())) + return receipt + + +def main(): + ap = argparse.ArgumentParser(description=__doc__) + ap.add_argument('--work', type=Path, help='new output directory; default temporary') + ap.add_argument('--write', type=Path, help='write a new result instead of comparing EXPECTED.json') + args = ap.parse_args() + work = args.work.resolve() if args.work else Path(tempfile.mkdtemp(prefix='partial-k-bypass-'))/'replay' + require(not work.exists(), 'use a new work directory') + work.mkdir(parents=True) + pins = read(PACKAGE/'SOURCE-PINS.json') + check_pins(pins) + bad_pins = copy.deepcopy(pins) + bad_pins['files'][next(iter(bad_pins['files']))] = '0'*64 + try: + check_pins(bad_pins) + except ValueError: + pass + else: + raise ValueError('corrupt source pin accepted') + + geometry = model.load_geometry(ROOT/'research/direct-delivery504-global/inputs/hamming') + pairs = model.mixed_pairs(geometry) + require(len(pairs) == 8 and pairs[24 % len(pairs)] == (0, 2), 'assignment object changed') + cases = [model.case(geometry, pair, sign) for pair in pairs for sign in (-1, 1)] + selected = [c for c in cases if c['pair'] == [0, 2]] + searches = [] + for case in selected: + for copies in (2, 3, 4): + answer = model.search(case, copies) + require(answer['status'] == ('FOUND' if copies == 4 else 'EXHAUSTED'), 'unexpected schedule status') + searches.append(dict(sign=case['sign'], **answer)) + rebuilt_recipe = model.recipe(selected[0], searches[2]['schedule']) + require(normalized(rebuilt_recipe) == read(PACKAGE/'RECIPE.json'), 'recipe differs from seeded search') + relaxed = model.search(selected[0], 2, ordinary_guard=False) + require(relaxed['status'] == 'FOUND', 'missing-consumer guard control stopped distinguishing the model') + # Replay that relaxed schedule and record the first violation of the + # actual ordinary-consumer caps; this is a geometric counterexample to + # accepting the relaxed search as a complete circuit. + state = [()]*4 + selected[0]['leaver_frames'] + [selected[0]['packet_frame']]*2 + violation = None + for step, (event, source) in enumerate(relaxed['schedule']): + target = selected[0]['operations'][event][0] + frame = model.join(state[target], state[source]) + state[target] = state[source] = frame + if source < 8 and not model.contained(frame, selected[0]['ordinary_labels']): + violation = dict(step=step, event=event, leaver=source-4, frame=frame) + break + require(violation is not None, 'relaxed schedule unexpectedly satisfies ordinary caps') + + constructor = ROOT/'research/complex-k492-owner-repair/code/construct_k_triangle.py' + auditor = ROOT/'research/complex-k492-owner-repair/code/hpe_audit_and_transport.py' + inputs = ROOT/'research/direct-delivery504-global/inputs/hamming' + triangles = ROOT/'research/complex-k492-owner-repair/data/TRI-SCHEDULE.json' + routing = ROOT/'research/direct-delivery504-global/inputs/data-base/split-centres/CANONICAL-WORD.json.gz' + run('baseline-build', constructor, [inputs, work/'baseline', triangles], work) + run('control-build', PACKAGE/'construct.py', [PACKAGE/'RECIPE.json', work/'control'], work) + for name in ('baseline', 'control'): + run(name+'-native-audit', auditor, + ['--raw', work/name/'FULL-WORD.json.gz', '--routing', routing, '--out', work/(name+'-native')], work) + base = audit_receipt(work/'baseline-native') + control = audit_receipt(work/'control-native') + require(base['helpers'] == control['helpers'] == 492, 'unpaid helper') + require(base['residual_width_histogram'] == control['residual_width_histogram'] == {9: 492}, 'width inventory changed') + delta = Counter({int(k): v for k, v in control['local_profile'].items()}) + delta.subtract({int(k): v for k, v in base['local_profile'].items()}) + delta = {rank: count for rank, count in sorted(delta.items()) if count} + require(delta == {1: 10, 2: -6, 3: 2, 4: 2, 6: -2}, 'profile delta changed') + more_spread = [6, 2, 2, 2, 0, 0, 0] + less_spread = [4, 3, 1, 1, 1, 1, 1] + prefix_pairs = [[sum(more_spread[:i]), sum(less_spread[:i])] for i in range(1, 8)] + require(all(left >= right for left, right in prefix_pairs), 'majorization fails') + require(prefix_pairs[-1][0] == prefix_pairs[-1][1], 'rank mass not conserved') + proof_delta = Counter(less_spread) + proof_delta.subtract(more_spread) + require({k: 2*v for k, v in proof_delta.items() if k and v} == delta, 'majorization does not price the circuit') + + word = read(work/'control/FULL-WORD.json.gz') + mutations = {} + bad = copy.deepcopy(word) + bad['cut'][0][3] *= 2 + mutations['wrong-source-coefficient'] = bad + bad = copy.deepcopy(word) + bad['cleanup'] = bad['cleanup'][1:] + mutations['missing-dirty-restoration'] = bad + bad = copy.deepcopy(word) + bad['report']['local_profile']['1'] -= 1 + mutations['unpaid-source-access'] = bad + bad = copy.deepcopy(word) + bad['B'][0][-1] = [] + mutations['illegal-read-frame'] = bad + controls = [] + for name, bad in mutations.items(): + path = work/(name+'.json') + path.write_text(json.dumps(bad)) + failure = run(name, auditor, ['--raw', path, '--routing', routing, '--out', work/name], work, True) + # Pin the diagnostic category, not Python/version-dependent line numbers. + last = next(line for line in reversed(failure.stderr.splitlines()) if 'AssertionError' in line) + controls.append(dict(name=name, rejected=True, diagnostic=last)) + result = dict( + status='PASS_PARTIAL_K_BYPASS_FLOOR_AND_UNFAVORABLE_PAID_CONTROL', + base_commit=pins['base_commit'], assignment_seed=24, + exact_geometry_cases=cases, bounded_searches=searches, + missing_ordinary_guard_control=dict(**relaxed, first_actual_violation=violation), + baseline=base, paid_control=control, profile_delta=delta, + majorization=dict(more_spread=more_spread, less_spread=less_spread, prefix_pairs=prefix_pairs, + conclusion='control moment strictly larger for every 0 < exponent < 1'), + negative_controls=controls, corrupt_source_pin_rejected=True, + scope='Fixed two-face bypass with unchanged ordinary M consumers and pure remaining packets. No general delivery lower bound, phase/global admission, new kappa, or formal multiplication proof.') + payload = json.dumps(result, indent=2, sort_keys=True)+'\n' + (work/'RESULT.json').write_text(payload) + if args.write: + args.write.write_text(payload) + else: + require(normalized(result) == read(PACKAGE/'EXPECTED.json'), 'receipt differs from EXPECTED.json') + print(result['status']) + print('16 exact geometric cases; 2/3 carriers exhausted for both seed-selected signs; 4 carriers attained.') + print('Both 716-column native orientations pass; 4 circuit mutations rejected; no new kappa.') + print('Evidence:', work) + + +if __name__ == '__main__': + main()