From d8d6244df98271c91f57de1e95d0599226839837 Mon Sep 17 00:00:00 2001 From: Aaron Wang <50366676+navinor@users.noreply.github.com> Date: Wed, 14 Oct 2026 16:49:34 -0400 Subject: [PATCH] test(research): exclude cross-call rank-8 cycles --- .../selected-crosscall-rank8-cycle/README.md | 185 +++++ .../RESULT.json | 719 ++++++++++++++++++ .../SOURCES.json | 96 +++ .../selected-crosscall-rank8-cycle/TASK.json | 71 ++ .../VERIFY.json | 39 + .../test_verify.py | 74 ++ .../selected-crosscall-rank8-cycle/verify.py | 387 ++++++++++ 7 files changed, 1571 insertions(+) create mode 100644 research/selected-crosscall-rank8-cycle/README.md create mode 100644 research/selected-crosscall-rank8-cycle/RESULT.json create mode 100644 research/selected-crosscall-rank8-cycle/SOURCES.json create mode 100644 research/selected-crosscall-rank8-cycle/TASK.json create mode 100644 research/selected-crosscall-rank8-cycle/VERIFY.json create mode 100644 research/selected-crosscall-rank8-cycle/test_verify.py create mode 100644 research/selected-crosscall-rank8-cycle/verify.py diff --git a/research/selected-crosscall-rank8-cycle/README.md b/research/selected-crosscall-rank8-cycle/README.md new file mode 100644 index 0000000000..bea9afc36f --- /dev/null +++ b/research/selected-crosscall-rank8-cycle/README.md @@ -0,0 +1,185 @@ +# Selected cross-call cycles cannot coalesce idle ranks 0,1,7 into 0,0,8 + +**Complete exclusion for one fixed-map rank transition; no new supplier or κ.** + +On the selected PR1094 owner map, 21,886 simultaneous directed three-role +cycles have the proposed remainder change. Every one violates a strict +source-event window. This remains true if active-pair and per-call family +restrictions are relaxed. It does not exclude other remainder changes, +longer paths, changed call orders, or a global packing improvement. + +## Domain and exact obstruction + +Keep the selected scalar word, all helper widths, 144 calls, call order, +actual source-event windows and occupied-prefix hosting model fixed. Three +existing whole-helper roles rotate among three distinct occupied bins +A→B→C→A. At least two invocation times must be represented. The old free-rank +multiset is `{0,1,7}` and the new one must be `{0,0,8}`. Anchor A at the unique +old-slack-7 bin; both directed orientations are included, cyclic rotations +counted once. “Slack 7” means seven unused coordinates, not an empty bin. + +For old slacks `(a,b,c)` and outgoing widths `(x,y,z)`, the new slacks are +`(a+x-z, b+y-x, c+z-y)`. The source map supports exactly two type patterns +with the required target, where a type is `(own-bin slack, outgoing width)`: + +| A,B,C types | Cycles | Constant forbidden landing | +|---|---:|---| +| `(7,8), (0,8), (1,7)` | 17,567 | C→A: event 181 is outside `(255,430)` | +| `(7,8), (1,7), (0,7)` | 4,319 | A→B: event 417 is outside `(-1,208)` | + +There is exactly one role of type `(7,8)`: `(stage,replica,helper)=(7,14,296)`, +owner bin `(13,15,14)`, event position 417. There is exactly one role of +type `(1,7)`: `(1,15,226)`, bin `(11,8,103)`, event position 181. The other +members are the 17,567 type `(0,8)` or 4,319 type `(0,7)` roles. The fixed +forbidden landing therefore rejects each entire row independently of the +third role. The two fixed roles belong to different calls, so none of these +arithmetic candidates is removed by the same-call scope restriction. + +The unused coordinates could reduce cost if the change were legal: +with `p=1-a` in `(0,1)`, strict concavity gives `8^p < 1^p+7^p`. +All local charges stay fixed, so the complete modeled moment delta would be +`(8^p-1^p-7^p)/(14336*73^p)`. This census realizes none of that potential +gain because the landings are illegal. It is not a new general 3-cycle method. + +## Evidence, independence and controls + +[RESULT.json](RESULT.json) includes the two supported class rows, the +constant-leg proof objects, baseline owner recount, source hashes and complete +supplier pricing. Two enumeration methods agree: + +- The primary implementation exhausts actual width/slack types, counts all + role multiplicities, then performs an indexed strict-window join. A + simultaneous family update removes all vacated families at each call + before inserting the incoming roles; it never substitutes sequential + relocation legality for a cycle. +- A separately written role-first enumeration tries all three possible + placements of the target rank 8. It solves the incoming-width equation, + materializes every supported triple, and compares each literal event + position directly to its destination window. It calls neither the primary + transfer/classification helper nor its landing predicate. Its complete + candidate-ID list has SHA256 + `65b6437819f57f90f1d2d076bc96638b1d44302ef431462056fc136d497cf1dd`. + All three windows pass on zero candidates. The digest is a compact receipt; + acceptance depends on the regenerated exact census and inequalities. + +Both methods share source decoding and Josie Elliston's PR1091 geometry and +baseline audit. This is algorithmically different enumeration, not a +code-disjoint reimplementation of the entire source geometry or independent +human review. Windows are rebuilt from actual source events and checked +against PLAN by the unchanged inherited auditor. All eleven inherited owner +mutation controls run. + +Six local synthetic controls cover an admitted `{7,1,0}->{8,0,0}` toy cycle, +a same-call vacated family, an unvacated-family collision, the same-call scope +restriction, a blocked last-leg window, and an indexed/direct toy-triple +comparison with two possible third roles. The toy gain is not a physical +source witness. CLI tests also reject an omitted-candidate receipt and an +integer/float count alias. Receipts use type-preserving canonical JSON. +Deadline regressions reject an over-budget census even when every first +landing is blocked or the role set is empty. The deadline covers setup, +skipped branches and final return; timeout is never recorded as an exclusion. + +## Both supplier budgets and the packing cap + +The complete source profiles are unchanged. The pinned exact rational +calculator checks strict moment acceptance at both retained endpoints and +strict rejection at the next `10^-24` tick: + +| Supplier | Endpoint | Rank mass / deficit | +|---|---|---| +| Complex | `67018507072324140917/40000000000000000000000` | 1,041,408 / 5,120 | +| Bit | `1733427039589844234749/10^24` | 1,808,352 / 10,272 | + +Bit pricing includes the inherited `10^-16` bad-residue envelope of +`32*m^2` rank-one fallback calls per paid child. Neither this surcharge nor +any physical bill is reduced. Complex remains the binding side. These are +pricing checks of the pinned profile model, not supplier or full cold replays. + +The required `ceiling(local,73,896,9,64)` call on local profile +`{1:2412,2:418,3:432,4:142,5:82,8:8}` gives +`a < 0.001690054109089`, balanced planning cap `κ < 0.001687202646`. +The fraction of remaining packing headroom realized by this domain is **0**. +The newer [fixed-route indivisibility bound](../fixed-route-indivisible-idle-mass/README.md) +is stronger for this unchanged-route model (`a < 0.001681977435447`, +planning κ about 0.00167915314); it is credited, not newly replayed or claimed +sharp here. Zero gain also realizes zero of that tighter headroom. + +## Reproduce and assignment + +Python 3.12, standard library, repository root: + +```sh +python3 -I -O -B research/selected-crosscall-rank8-cycle/verify.py +python3 -I -O -B research/selected-crosscall-rank8-cycle/test_verify.py +python3.12 -B scripts/research_package.py --package research/selected-crosscall-rank8-cycle --check-only +python3.12 -B scripts/research_package.py --package research/selected-crosscall-rank8-cycle +``` + +Expected primary status: + +```text +PASS_SELECTED_CROSSCALL_RANK8_CYCLE_OBSTRUCTION candidates=21886 all_window_blocked direct_crosscheck=PASS owner_controls=11 new_kappa=NO +``` + +Default replay is read-only. `--write NEW_PATH` refuses an existing path; +`--probe` runs the primary census without pricing, the direct cross-check or +receipt validation. Test scratch directories are scoped to the package and +removed automatically. No dependencies or native builds are needed. + +Track `incumbent-optimization`, card `selected-packing`, nonce +`3474c3e21150f5db2b291dfc2989aac6`, catalogue key `2eb6f6918b10e182033b`, +priority revision4, base `0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2`. +Scope was refined to this precise cross-call transition, approved before +implementation, recorded locally before computation, and claimed at +https://github.com/CrocSwap/integer-mult-bounds/discussions/1332#discussioncomment-18933588. +The prescribed baseline binding check passed. Source Git blobs and SHA256 +pins are in [SOURCES.json](SOURCES.json); detailed scope/overlap is in +[TASK.json](TASK.json). The five-minute first-probe budget was not exhausted; +there was no scope pivot or randomized optimizer search. + +## Overlap and limits + +This takes the cross-call handoff of +https://github.com/CrocSwap/integer-mult-bounds/pull/1873 (same-call 3-cycles), +closing only one rank-transition slice. It is distinct from +https://github.com/CrocSwap/integer-mult-bounds/pull/1790 (2-swaps), +https://github.com/CrocSwap/integer-mult-bounds/pull/1617 (complete +neutral-then-strict 2-relocations), and +https://github.com/CrocSwap/integer-mult-bounds/pull/1407 (longer sequential +paths). https://github.com/CrocSwap/integer-mult-bounds/pull/1154 has a positive +3-cycle on a different word and owner map. Fresh text-based overlap plus +live owning heads found no matching cross-call census; no-match does not +prove novelty. + +## Open next questions + +Can a different supported rank transition admit a +legal cross-call 3-cycle on the original map? Enumerate the remaining +capacity-feasible type patterns touching a slack-7 bin (for example old +slacks involving rank3), classify exact moment differences, and only then +join windows/families. The blocker is that 3-component transitions need not +be ordered by majorization; the simple two-component concavity sign rule +does not decide every case. This package supplies no such larger census. + +There is no global optimum claim, modified source map, native/controller +rebuild, physical invoice, supplier adoption, full selected cold replay, +outer assembly, Lean proof or κ change. All inherited all-size/compiler, +realization, hosting, precision/tape, analytic and bit H1–H5 obligations remain. +No attaining source witness exists in this domain, so no modified-map +admission is claimed. Frozen inputs and the selected record are untouched. + +## Credit + +Rohan Arun's PR1094 supplies the selected packing, retaining Jeremy Kothe's +mutable-leaver and Hao Yan's controller lineage. Josie Elliston's PR1091 +supplies the unchanged independent owner/event audit. The PR1790 swap +fixture and PR1873 same-call census supply the immediate extension context; +Arham Tahir's one-relocation work, PR1617, PR1819, PR1407 and the other cited +predecessors keep their separate contributions. Douglas Colkitt's PR1240 +supplies the ceiling engine; PR1012 supplies the coverage law; PR1847 +supplies the stronger fixed-route context. The bit source retains the +PR589/PR555 and earlier attribution. No predecessor files are copied or edited. + +Prepared by **Aaron Wang / navinor, with help from chatgpt**, including +research, code, writing and separate read-only AI review. New work Apache-2.0; +no independent human or formal-kernel review claimed. diff --git a/research/selected-crosscall-rank8-cycle/RESULT.json b/research/selected-crosscall-rank8-cycle/RESULT.json new file mode 100644 index 0000000000..9b4a686cea --- /dev/null +++ b/research/selected-crosscall-rank8-cycle/RESULT.json @@ -0,0 +1,719 @@ +{ + "baseline_owner_audit": { + "calls": 144, + "cross_replica_roles": 57480, + "deficit": 5120, + "idle": { + "1": 2276, + "3": 377, + "7": 7, + "48": 4866 + }, + "profile": { + "1": 349604, + "2": 60192, + "3": 62585, + "4": 20448, + "5": 11808, + "7": 7, + "8": 1152, + "48": 4866 + }, + "rank_mass": 1041408, + "roles": 69120, + "windows": 288 + }, + "canonicalization": "unique old-slack7 pivot; A->B->C->A; rotations counted once", + "census": { + "class_rows": [ + { + "arithmetic_triples": 17567, + "cross_call_triples": 17567, + "family_rejected": 0, + "legal": 0, + "new": [ + 8, + 0, + 0 + ], + "old": [ + 7, + 0, + 1 + ], + "same_call_excluded": 0, + "types": [ + [ + 7, + 8 + ], + [ + 0, + 8 + ], + [ + 1, + 7 + ] + ], + "widths": [ + 8, + 8, + 7 + ], + "window_joined": 0 + }, + { + "arithmetic_triples": 4319, + "cross_call_triples": 4319, + "family_rejected": 0, + "legal": 0, + "new": [ + 8, + 0, + 0 + ], + "old": [ + 7, + 1, + 0 + ], + "same_call_excluded": 0, + "types": [ + [ + 7, + 8 + ], + [ + 1, + 7 + ], + [ + 0, + 7 + ] + ], + "widths": [ + 8, + 7, + 7 + ], + "window_joined": 0 + } + ], + "cross_call_arithmetic_candidates": 21886, + "family_rejected": 0, + "joined_candidates": [], + "legal_cycles": 0, + "window_joined": 0, + "window_rejected": 21886 + }, + "constant_window_blocks": [ + { + "types": [[7,8],[0,8],[1,7]], + "blocked_leg": "C->A", + "blocked_role": [1,15,226], + "destination": [13,15,14], + "position": 181, + "window": [255,430], + "rejected_cycles": 17567 + }, + { + "types": [[7,8],[1,7],[0,7]], + "blocked_leg": "A->B", + "blocked_role": [7,14,296], + "destination": [11,8,103], + "position": 417, + "window": [-1,208], + "rejected_cycles": 4319 + } + ], + "domain": "fixed_selected_PR1094; distinct occupied bins; at least two calls; old slack multiset0,1,7; new0,0,8; both directed orientations", + "fraction_of_packing_headroom_realized": "0", + "independent_direct": { + "all_windows_pass": 0, + "candidate_ids_sha256": "65b6437819f57f90f1d2d076bc96638b1d44302ef431462056fc136d497cf1dd", + "candidates": 21886, + "eligible_pivots": [ + { + "bin": [ + 1, + 0, + 1 + ], + "index": 824, + "role": [ + 0, + 8, + 344 + ], + "width": 9 + }, + { + "bin": [ + 1, + 0, + 0 + ], + "index": 826, + "role": [ + 0, + 8, + 346 + ], + "width": 9 + }, + { + "bin": [ + 1, + 0, + 3 + ], + "index": 1170, + "role": [ + 0, + 1, + 210 + ], + "width": 9 + }, + { + "bin": [ + 1, + 0, + 2 + ], + "index": 1171, + "role": [ + 0, + 1, + 211 + ], + "width": 9 + }, + { + "bin": [ + 1, + 0, + 5 + ], + "index": 1697, + "role": [ + 0, + 9, + 257 + ], + "width": 9 + }, + { + "bin": [ + 1, + 0, + 4 + ], + "index": 1698, + "role": [ + 0, + 9, + 258 + ], + "width": 9 + }, + { + "bin": [ + 13, + 15, + 14 + ], + "index": 62008, + "role": [ + 7, + 13, + 88 + ], + "width": 9 + }, + { + "bin": [ + 13, + 15, + 14 + ], + "index": 59589, + "role": [ + 5, + 7, + 69 + ], + "width": 4 + }, + { + "bin": [ + 13, + 15, + 14 + ], + "index": 62515, + "role": [ + 8, + 4, + 115 + ], + "width": 4 + }, + { + "bin": [ + 13, + 15, + 14 + ], + "index": 65096, + "role": [ + 7, + 14, + 296 + ], + "width": 8 + } + ], + "representative_per_window_mask": { + "000": { + "indices": [ + 65096, + 39447, + 34306 + ], + "landings": [ + { + "destination": [ + 11, + 13, + 30 + ], + "position": 417, + "role": [ + 7, + 14, + 296 + ], + "window": [ + 83, + 367 + ] + }, + { + "destination": [ + 11, + 8, + 103 + ], + "position": 210, + "role": [ + 6, + 2, + 87 + ], + "window": [ + -1, + 208 + ] + }, + { + "destination": [ + 13, + 15, + 14 + ], + "position": 181, + "role": [ + 1, + 15, + 226 + ], + "window": [ + 255, + 430 + ] + } + ] + }, + "001": { + "indices": [ + 65096, + 34306, + 45344 + ], + "landings": [ + { + "destination": [ + 11, + 8, + 103 + ], + "position": 417, + "role": [ + 7, + 14, + 296 + ], + "window": [ + -1, + 208 + ] + }, + { + "destination": [ + 5, + 14, + 12 + ], + "position": 181, + "role": [ + 1, + 15, + 226 + ], + "window": [ + 252, + 420 + ] + }, + { + "destination": [ + 13, + 15, + 14 + ], + "position": 256, + "role": [ + 5, + 4, + 224 + ], + "window": [ + 255, + 430 + ] + } + ] + }, + "010": { + "indices": [ + 65096, + 87, + 34306 + ], + "landings": [ + { + "destination": [ + 8, + 2, + 5 + ], + "position": 417, + "role": [ + 7, + 14, + 296 + ], + "window": [ + -1, + 8 + ] + }, + { + "destination": [ + 11, + 8, + 103 + ], + "position": 0, + "role": [ + 0, + 0, + 87 + ], + "window": [ + -1, + 208 + ] + }, + { + "destination": [ + 13, + 15, + 14 + ], + "position": 181, + "role": [ + 1, + 15, + 226 + ], + "window": [ + 255, + 430 + ] + } + ] + }, + "011": { + "indices": [ + 65096, + 34306, + 46308 + ], + "landings": [ + { + "destination": [ + 11, + 8, + 103 + ], + "position": 417, + "role": [ + 7, + 14, + 296 + ], + "window": [ + -1, + 208 + ] + }, + { + "destination": [ + 1, + 15, + 86 + ], + "position": 181, + "role": [ + 1, + 15, + 226 + ], + "window": [ + 92, + 272 + ] + }, + { + "destination": [ + 13, + 15, + 14 + ], + "position": 262, + "role": [ + 6, + 3, + 228 + ], + "window": [ + 255, + 430 + ] + } + ] + }, + "100": { + "indices": [ + 65096, + 43287, + 34306 + ], + "landings": [ + { + "destination": [ + 7, + 13, + 5 + ], + "position": 417, + "role": [ + 7, + 14, + 296 + ], + "window": [ + 220, + 461 + ] + }, + { + "destination": [ + 11, + 8, + 103 + ], + "position": 244, + "role": [ + 3, + 6, + 87 + ], + "window": [ + -1, + 208 + ] + }, + { + "destination": [ + 13, + 15, + 14 + ], + "position": 181, + "role": [ + 1, + 15, + 226 + ], + "window": [ + 255, + 430 + ] + } + ] + } + }, + "source_role_counts": { + "0": 59250, + "1": 9106, + "7": 10 + }, + "window_masks": { + "000": 7651, + "001": 1241, + "010": 10874, + "011": 79, + "100": 2041 + } + }, + "inherited_owner_mutations": [ + { + "name": "drop_role", + "rejected_by": "R1" + }, + { + "name": "narrow_width", + "rejected_by": "R2" + }, + { + "name": "duplicate_helper", + "rejected_by": "R2" + }, + { + "name": "private_family", + "rejected_by": "R3" + }, + { + "name": "active_pair", + "rejected_by": "R3" + }, + { + "name": "family_collision", + "rejected_by": "R4" + }, + { + "name": "past_idle_sweep", + "rejected_by": "R5" + }, + { + "name": "overlap", + "rejected_by": "R6" + }, + { + "name": "prefix_gap", + "rejected_by": "R6" + }, + { + "name": "claimed_idle_tampered", + "rejected_by": "R7" + }, + { + "name": "plan_window_truncated", + "rejected_by": "X1" + } + ], + "input_sha256": { + "research/community-frontier1094-audit/ASSEMBLY.json": "1122cb3a575f8c788345fc1bf4c108ac7c3250fb81a5988671f5eb04b3ab3045", + "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/work/complex-nine-native/DATA-PHASES.json": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa", + "research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor535/inputs/ROUND20-PARENT-TEMPLATE.json.gz": "025448abdf2012d327e50a009084e1501690d05e650300d2982836aa0350ae00", + "research/complex-local-word-ceiling/ceiling.py": "86a1432870b3b21d8454106ec9162fddc0471472d9214c590a1420f2426cedfc", + "research/complex-t16-rare-pattern-exchanges/PROFILE.json": "cf539f314584ee0b6d7102d2344be96a63defa88b9d9ab6ffe05cddd6c13a874", + "research/complex-t16-rare-pattern-exchanges/data/OWNERS.json.gz": "87902c528dfab7d503dcf8a784260e3ab6fb7424c418a1820f7261f25be7b6bc", + "research/complex-t16-rare-pattern-exchanges/data/PLAN.json": "7bd786ba8e66408f02aa9ef446eaf20c1bfe981ea2e4dd1e5a929f0aa7767bc0", + "research/complex-t16-rare-pattern-exchanges/data/SPEC.json": "8cb51f25a5da4a29d3783853025b73ff1f452429d4fdb30c599e598bcab0e71d", + "research/e8-bit-p111-tuned/tune/EXPECTED.json": "b9f0e5ca038abe837b0007c8fe006f366a6f02009244ac57705a8a200e2301f4", + "research/frontier1094-swap-census/SOURCES.json": "0fba72babb9a8f6a839ee402b3ba5c73969e830c9ec9d89b353b3376acad4300", + "research/frontier1094-swap-census/verify.py": "d63a3e0c24a72c4db53a2f14e870bcb2b6733d9b2125419607b73da160095c27", + "research/t16-owner-audit-seed67/inputs/k8-seven-slot-word.json.gz": "49596aa4ed4fd36cd4582fd0e8ddeb09fd80370a7d8aea1ede52a135b536d289", + "research/t16-owner-audit-seed67/verify.py": "f6e27f76c9ccb87b3ce6c5e673588338a09847d22771da7b3f28579661c9404b" + }, + "packing_ceiling": { + "a_ceiling_bracket": [ + "52814190909/31250000000000", + "1690054109089/1000000000000000" + ], + "a_ceiling_decimal": 0.001690054109089, + "kappa_cap_decimal": 0.001687202645325402, + "local_profile": { + "1": 2412, + "2": 418, + "3": 432, + "4": 142, + "5": 82, + "8": 8 + }, + "parameters": { + "centre": 64, + "families": 896, + "m": 73, + "stages": 9 + }, + "source": "research/complex-local-word-ceiling/ceiling.py" + }, + "scope": "finite rank-transition exclusion, not all cross-call cycles or a global packing optimum; no supplier/controller/invoice/outer/Lean/cold replay or new kappa", + "status": "PASS_SELECTED_CROSSCALL_RANK8_CYCLE_OBSTRUCTION", + "supplier_prices": { + "binding": "complex", + "bit": { + "bad_residue_surcharge_included": true, + "deficit": 10272, + "endpoint": "1733427039589844234749/1000000000000000000000000", + "moment": [ + "57896044618658097711785399946509524623162949395396788096595060808937653792593/57896044618658097711785492504343953926634992332820282019728792003956564819968", + "115792089237316195423570799893019049246325898790793576193190121617875307585219/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "next_tick_moment": [ + "57896044618658097711785589153713437821080778741738686119045079227763434352023/57896044618658097711785492504343953926634992332820282019728792003956564819968", + "115792089237316195423571178307426875642161557483477372238090158455526868704079/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "rank_mass": 1808352 + }, + "complex": { + "bad_residue_surcharge_included": false, + "deficit": 5120, + "endpoint": "67018507072324140917/40000000000000000000000", + "moment": [ + "14474011154664524427946354248858774884717714476391889615079910765391404842465/14474011154664524427946373126085988481658748083205070504932198000989141204992", + "115792089237316195423570833990870199077741715811135116920639286123131238739757/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "next_tick_moment": [ + "115792089237316195423571173138846292859912091049481197042886236649506151757987/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "57896044618658097711785586569423146429956045524740598521443118324753075879013/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "rank_mass": 1041408 + } + }, + "synthetic_controls": [ + "toy_gain", + "same_call_vacancy", + "unvacated_family", + "same_call_scope", + "closed_window", + "direct_triple_crosscheck" + ] +} diff --git a/research/selected-crosscall-rank8-cycle/SOURCES.json b/research/selected-crosscall-rank8-cycle/SOURCES.json new file mode 100644 index 0000000000..29b10c7394 --- /dev/null +++ b/research/selected-crosscall-rank8-cycle/SOURCES.json @@ -0,0 +1,96 @@ +{ + "schema_version": 1, + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "e8870e5917057d59b730eb14721a778639eca050", + "sha256": "d46eb6d5b3e279428753d770653663fbdf1063e55c255ea073d768f344927ef7" + }, + { + "path": "research/community-frontier1094-audit/ASSEMBLY.json", + "usage": "input", + "git_blob": "5fd676df060f3b450782fdf5ff5f6beb63a5eeb0", + "sha256": "1122cb3a575f8c788345fc1bf4c108ac7c3250fb81a5988671f5eb04b3ab3045" + }, + { + "path": "research/community-k492-audit/pr622/replay/baseline558/complex-global/base/work/complex-nine-native/DATA-PHASES.json", + "usage": "input", + "git_blob": "d9a4f84211182ca200c081ea061d724c8a2cfb70", + "sha256": "c5916ff312678f12aba403847643fbbc29f643acec60bdf836fa56cd3e8251fa" + }, + { + "path": "research/complex-k492-owner-repair/vendor/multicold/vendor/pr558/vendor/pr552/complex-global/vendor535/inputs/ROUND20-PARENT-TEMPLATE.json.gz", + "usage": "input", + "git_blob": "3e28a9b59f8fde608e59ebd5fbdbc22ca54558d4", + "sha256": "025448abdf2012d327e50a009084e1501690d05e650300d2982836aa0350ae00" + }, + { + "path": "research/complex-local-word-ceiling/ceiling.py", + "usage": "input", + "git_blob": "6c0f54527d879396f689523bfde19928a9b6157c", + "sha256": "86a1432870b3b21d8454106ec9162fddc0471472d9214c590a1420f2426cedfc" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/PROFILE.json", + "usage": "input", + "git_blob": "7acbdeb81015d4681b5773489369a2a8b0d46d79", + "sha256": "cf539f314584ee0b6d7102d2344be96a63defa88b9d9ab6ffe05cddd6c13a874" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/data/OWNERS.json.gz", + "usage": "input", + "git_blob": "d3ba33d7e703a3229d9fb8a360f69d2f318bbb70", + "sha256": "87902c528dfab7d503dcf8a784260e3ab6fb7424c418a1820f7261f25be7b6bc" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/data/PLAN.json", + "usage": "input", + "git_blob": "f1bec76e8e9b7a1f09c1e05cb6cce973b6e59f1b", + "sha256": "7bd786ba8e66408f02aa9ef446eaf20c1bfe981ea2e4dd1e5a929f0aa7767bc0" + }, + { + "path": "research/complex-t16-rare-pattern-exchanges/data/SPEC.json", + "usage": "input", + "git_blob": "af013ccc2975d9d575d116f8a463cc947f220c8d", + "sha256": "8cb51f25a5da4a29d3783853025b73ff1f452429d4fdb30c599e598bcab0e71d" + }, + { + "path": "research/e8-bit-p111-tuned/tune/EXPECTED.json", + "usage": "input", + "git_blob": "e293ddc557742637f9f679f083a1a282d87b1b13", + "sha256": "b9f0e5ca038abe837b0007c8fe006f366a6f02009244ac57705a8a200e2301f4" + }, + { + "path": "research/frontier1094-swap-census/SOURCES.json", + "usage": "input", + "git_blob": "d498366298945e14736ea612b7b8c2334a27a0e4", + "sha256": "0fba72babb9a8f6a839ee402b3ba5c73969e830c9ec9d89b353b3376acad4300" + }, + { + "path": "research/frontier1094-swap-census/verify.py", + "usage": "input", + "git_blob": "e05162d0af8f853c3f4d1f9fa509db172e4a8a7e", + "sha256": "d63a3e0c24a72c4db53a2f14e870bcb2b6733d9b2125419607b73da160095c27" + }, + { + "path": "research/t16-owner-audit-seed67/inputs/k8-seven-slot-word.json.gz", + "usage": "input", + "git_blob": "723decbca8995e916d6f4b783aa3e1ddd4eb47fe", + "sha256": "49596aa4ed4fd36cd4582fd0e8ddeb09fd80370a7d8aea1ede52a135b536d289" + }, + { + "path": "research/t16-owner-audit-seed67/verify.py", + "usage": "input", + "git_blob": "3ff276c3040ec4a52db932e0bcdd31df5a3cf0a4", + "sha256": "f6e27f76c9ccb87b3ce6c5e673588338a09847d22771da7b3f28579661c9404b" + } + ] +} diff --git a/research/selected-crosscall-rank8-cycle/TASK.json b/research/selected-crosscall-rank8-cycle/TASK.json new file mode 100644 index 0000000000..02adbb754f --- /dev/null +++ b/research/selected-crosscall-rank8-cycle/TASK.json @@ -0,0 +1,71 @@ +{ + "schema_version": 1, + "task_id": "selected-packing", + "priority_revision": 4, + "base_commit": "0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2", + "original_card": { + "id": "selected-packing", + "question": "Is there a genuinely unsearched, explicitly bounded improvement to the selected packing?", + "starting_points": [ + "certificates/selected-result.json", + "research/heterogeneous-owner-assembly/README.md", + "research/complex-local-word-ceiling/README.md" + ], + "methods": [ + "Search a named unclaimed canonical candidate domain with a reproducible partition.", + "Prove a stronger scoped relaxation or exact optimum for one named residual subproblem." + ], + "acceptance_gate": "Check live PR overlap first, price both suppliers and distinguish a search best from an optimum. Report the word's packing cap from ceiling.ceiling() and the fraction of it realized; label packing gains as such.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Locate the selected packing source in the review and check live PRs for the same residual problem.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Define an unclaimed canonical domain and a favorable bound before starting a new search.", + "bottleneck_link": "An actual paid-profile gain can improve the frontier up to the other supplier cap.", + "allowed_variations": [ + "One bounded residual packing instance or exact relaxation.", + "If the coverage law, template or guard changes, derive an applicable fully charged replacement bound instead of applying the incumbent ceiling outside its scope." + ], + "scope_change_triggers": [ + "Rerunning an existing search with only a different seed as a separate mathematical contribution." + ], + "overlap_terms": [ + "T16", + "owner exchange", + "packing" + ] + }, + "scope_status": "refined", + "actual_scope": "Complete simultaneous directed cross-call 3-role cycle census on original selected PR1094 owner map, restricted to distinct occupied bins with old slack multiset0,1,7 and new0,0,8. Unique slack7 source anchors a cycle; both directions, rotations once. Scalar word, all widths/calls/order, real source-event windows, active-pair/family and prefix rules fixed.", + "scope_change_reason": "The same-call census PR1873 explicitly leaves a cross-call window/family join touching the seven rank7 groups open. Its one -H1-H7+H8 coalescing slice is a named bounded domain not covered by two-swaps or the complete sequential two-relocation census. The user approved this narrowed probe; no reroll or seed-only search.", + "bottleneck_link": "The idle delta -H1-H7+H8 would strictly lower the complete fixed-word moment for every0 {0,0,8}. + +Aaron Wang / navinor, with help from chatgpt. PR1091 supplies the unchanged +owner admission audit; PR1790 supplies its pinned fixture and map conventions. +No new supplier or kappa is claimed. +""" +import argparse +from collections import Counter, defaultdict +from fractions import Fraction as Q +import hashlib +from itertools import product +import json +from pathlib import Path +import time +import types + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +SWAP = 'research/frontier1094-swap-census/verify.py' + + +def require(ok, why): + if not ok: + raise ValueError(why) + + +def canonical(value): + # JSON stringifies rank keys; normalize them before sorting on both sides. + normalized=json.loads(json.dumps(value)) + return (json.dumps(normalized, sort_keys=True, indent=2)+'\n').encode() + + +def bin_key(role): + return role['owner_replica'], role['child'], role['port'] + + +def cycle_slacks(old, widths): + a,b,c = old + x,y,z = widths + return a+x-z, b+y-x, c+z-y + + +def family_rejection(model, indices): + """Remove every outgoing family at each call before inserting any landing.""" + removed, added = defaultdict(set), defaultdict(list) + for p,i in enumerate(indices): + source = model.roles[i] + destination = bin_key(model.roles[indices[(p+1) % 3]]) + removed[source['time']].add(model.bins[bin_key(source)].family) + added[source['time']].append(model.bins[destination].family) + for t,families in added.items(): + if len(set(families)) != len(families): + return 'same_call_duplicate_landings' + if set(families) & (model.families[t] - removed[t]): + return 'same_call_unvacated_family' + return None + + +def enumerate_cycles(model, limit=1_000_000, seconds=300): + """Complete class prefilter plus exact window join; fail on any budget limit. + + The unique slack-7 source anchors each directed cycle; B and C have + slacks 0/1 in either order. Thus rotations are not counted twice. + """ + started = time.monotonic() + def check_deadline(): + require(time.monotonic()-started <= seconds, + 'time budget exceeded; census incomplete') + members = defaultdict(list) + by_call = defaultdict(Counter) + for i,r in enumerate(model.roles): + typ = model.bins[bin_key(r)].remainder, r['width'] + if typ[0] in (0,1,7): + members[typ].append(i) + by_call[typ][r['time']] += 1 + check_deadline() + a_types = [t for t in members if t[0] == 7] + rows, joined = [], [] + cached = {} + for a_type in sorted(a_types): + for b_slack,c_slack in ((0,1),(1,0)): + b_types = sorted(t for t in members if t[0] == b_slack) + c_types = sorted(t for t in members if t[0] == c_slack) + for b_type,c_type in product(b_types,c_types): + check_deadline() + typs = a_type,b_type,c_type + old = tuple(t[0] for t in typs) + widths = tuple(t[1] for t in typs) + new = cycle_slacks(old,widths) + if sorted(new) != [0,0,8]: + continue + total = len(members[a_type])*len(members[b_type])*len(members[c_type]) + same_call = sum(n*by_call[b_type][t]*by_call[c_type][t] + for t,n in by_call[a_type].items()) + row = dict(types=typs, old=old, widths=widths, new=new, + arithmetic_triples=total, same_call_excluded=same_call, + cross_call_triples=total-same_call, window_joined=0, + legal=0, family_rejected=0) + for i in members[a_type]: + a = model.roles[i] + ba = bin_key(a) + for j in members[b_type]: + check_deadline() + b = model.roles[j] + if model.window_active_rejection(a,bin_key(b)) is not None: + continue + # Last leg C->A and middle leg B->C depend on this key. + key = c_type,b['time'],ba + if key not in cached: + cached[key] = [k for k in members[c_type] + if model.window_active_rejection(model.roles[k],ba) is None + and model.window_active_rejection(b,bin_key(model.roles[k])) is None] + for k in cached[key]: + check_deadline() + c = model.roles[k] + if a['time'] == b['time'] == c['time']: + continue + require(len({ba,bin_key(b),bin_key(c)}) == 3, + 'non-distinct cycle bins') + reason = family_rejection(model,(i,j,k)) + row['window_joined'] += 1 + row['family_rejected' if reason else 'legal'] += 1 + joined.append(dict(indices=[i,j,k],rejection=reason)) + require(len(joined) <= limit, 'candidate budget exceeded; census incomplete') + rows.append(row) + check_deadline() + require(len(joined) == sum(r['window_joined'] for r in rows), 'join accounting') + require(sum(r['legal']+r['family_rejected'] for r in rows) == len(joined), + 'family accounting') + return dict(class_rows=rows, + cross_call_arithmetic_candidates=sum(r['cross_call_triples'] for r in rows), + window_rejected=sum(r['cross_call_triples']-r['window_joined'] for r in rows), + window_joined=len(joined), family_rejected=sum(r['family_rejected'] for r in rows), + legal_cycles=sum(r['legal'] for r in rows), joined_candidates=joined) + + +def toy(times=(0,1,2)): + roles = [dict(owner_replica=i,child=0,port=0,width=w,time=t,stage=t,replica=0) + for i,(w,t) in enumerate(zip((8,7,7),times))] + bins = {bin_key(r): types.SimpleNamespace(remainder=s,family=i) + for i,(r,s) in enumerate(zip(roles,(7,1,0)))} + families = defaultdict(set) + for r in roles: + families[r['time']].add(bins[bin_key(r)].family) + return types.SimpleNamespace(roles=roles,bins=bins,families=families, + window_active_rejection=lambda r,b: None) + + +def controls(): + require(cycle_slacks((7,1,0),(8,7,7)) == (8,0,0), 'wrong transfer direction') + m = toy() + result = enumerate_cycles(m) + require(result['cross_call_arithmetic_candidates'] == 1 + and result['legal_cycles'] == 1 + and result['joined_candidates'] == [dict(indices=[0,1,2],rejection=None)], + 'toy gain missed') + m = toy((0,0,1)) + require(enumerate_cycles(m)['legal_cycles'] == 1, + 'same-call vacated family incorrectly treated as occupied') + m.families[1].add(0) + require(enumerate_cycles(m)['family_rejected'] == 1, 'unvacated family control accepted') + m = toy((0,0,0)) + require(enumerate_cycles(m)['cross_call_arithmetic_candidates'] == 0, + 'same-call scope control accepted') + m = toy() + m.window_active_rejection = lambda r,b: 'outside_strict_source_event_window' if r['time']==2 else None + require(enumerate_cycles(m)['window_rejected'] == 1, 'closed-window control accepted') + # Independent direct triple loop, including an extra same-type C role. + m = toy() + extra = dict(m.roles[2],owner_replica=3,time=3,stage=3) + m.roles.append(extra) + m.bins[bin_key(extra)] = types.SimpleNamespace(remainder=0,family=3) + m.families[3].add(3) + expected = [] + for i,j,k in product(range(len(m.roles)),repeat=3): + old = [m.bins[bin_key(m.roles[h])].remainder for h in (i,j,k)] + if old[0] != 7 or sorted(old) != [0,1,7]: + continue + w = [m.roles[h]['width'] for h in (i,j,k)] + if sorted((old[0]+w[0]-w[2],old[1]+w[1]-w[0],old[2]+w[2]-w[1])) == [0,0,8]: + expected.append([i,j,k]) + require(expected == [[0,1,2],[0,1,3]], 'direct toy fixture changed') + require([c['indices'] for c in enumerate_cycles(m)['joined_candidates']] == expected, + 'indexed join disagrees with direct triples') + return ['toy_gain','same_call_vacancy','unvacated_family','same_call_scope', + 'closed_window','direct_triple_crosscheck'] + + +def fixture(): + manifest = json.loads((HERE/'SOURCES.json').read_bytes()) + raw = {} + for pin in manifest['files']: + if pin['usage'] == 'input': + data = (ROOT/pin['path']).read_bytes() + require(hashlib.sha256(data).hexdigest() == pin['sha256'], 'source drift: '+pin['path']) + raw[pin['path']] = data + module = types.ModuleType('pinned_swap_fixture') + module.__file__ = str(ROOT/SWAP) + # dataclass resolves the defining module through sys.modules. + import sys + sys.modules[module.__name__] = module + exec(compile(raw[SWAP],module.__file__,'exec'),module.__dict__) + return module,module.fixture(),raw + + +def direct_census(model): + """Separate role-first enumeration via the three possible target placements. + + No primary class rows, transfer helper, window predicate or family + predicate is reused. Geometry/role decoding remains the shared PR1091 input. + """ + roles = model.roles + buckets = defaultdict(list) + for i,r in enumerate(roles): + buckets[model.bins[bin_key(r)].remainder,r['width']].append(i) + pivots = [i for (slack,w),indices in buckets.items() if slack==7 for i in indices] + candidates, masks, samples = [], Counter(), {} + for i in pivots: + a = roles[i] + x = a['width'] + for rb,rc in ((0,1),(1,0)): + middle = [j for (slack,w),indices in buckets.items() if slack==rb for j in indices] + for j in middle: + b = roles[j] + y = b['width'] + for target in ((8,0,0),(0,8,0),(0,0,8)): + if rb+y-x != target[1]: + continue + incoming_to_a = 7+x-target[0] + if rc+incoming_to_a-y != target[2]: + continue + for k in buckets.get((rc,incoming_to_a),()): + c = roles[k] + if a['time']==b['time']==c['time']: + continue + triple = i,j,k + sources = a,b,c + destinations = bin_key(b),bin_key(c),bin_key(a) + require(len(set(destinations))==3,'direct non-distinct bins') + lands = [] + detail = [] + for r,dest in zip(sources,destinations): + position = model.positions[r['stage'],r['replica']] + lo,hi = model.windows[dest[:2]] + lands.append('1' if lo1,name+' source endpoint/next-tick signs') + receipts[name] = dict(endpoint=str(a),moment=[str(v) for v in now], + next_tick_moment=[str(v) for v in following], + bad_residue_surcharge_included=bad, + rank_mass=sum(r*n for r,n in profile.items()), + deficit=m*live-sum(r*n for r,n in profile.items())) + require(Q(receipts['complex']['endpoint'])A',early,bin_key(late)),('A->B',late,bin_key(early))] + blocks=[] + require([r['types'] for r in result['class_rows']] + == [((7,8),(0,8),(1,7)),((7,8),(1,7),(0,7))], + 'constant blocks do not cover every supported type') + for row,(leg,role,dest) in zip(result['class_rows'],block_specs): + position=model.positions[role['stage'],role['replica']] + lo,hi=model.windows[dest[:2]] + require(not lo