diff --git a/research/complex-cartesian-grid-screen-seed506af/README.md b/research/complex-cartesian-grid-screen-seed506af/README.md new file mode 100644 index 0000000000..f16b0bc77b --- /dev/null +++ b/research/complex-cartesian-grid-screen-seed506af/README.md @@ -0,0 +1,104 @@ +# Cartesian source-destination grid blocks: a scoped cost obstruction + +**Exact block identity and negative cost screen. No selected-word change or new κ.** + +Assignment: seed 506af17109f2b8945b6b47236c53520b, track +complex-mechanisms, task complex-rank-shape-decoder, priority revision 3, +scope key cad3ba853d7f324f16fa. Exact base: +0b1cccf86e2f5132ed286a26ef0a681a495740ea. Selected-record SHA-256: +10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32. +The coordination claim is +[Discussion #1167 comment 18924220](https://github.com/CrocSwap/integer-mult-bounds/discussions/1167#discussioncomment-18924220). + +## Result + +Let X₁, …, Xᵣ and Y₁, …, Yᵣ be n × n block operands. Place them in the +first block column and first block row: + +- A(i,1) = Xᵢ +- B(1,j) = Yⱼ +- all other blocks are zero. + +Then the ordinary block product satisfies C(i,j) = XᵢYⱼ for every ordered +source-destination pair (i,j). This is a Cartesian-grid mechanism. It differs +from diagonal batching, one-source fanout, and one-destination gather. + +The cost model charges a generic width-r matrix-product child by r^(2−a) +size-n child units. Computing the r² products separately costs r². The +recursive-work ratio is + + r^(2−a) / r² = r^(−a). + +The selected outer guard permits r ≤ 51. Throughout the target range +0 ≤ a ≤ 1/99, the largest saving occurs at r = 51 and a = 1/99. The exact +integer inequality + + 51 · 19^99 < 20^99 + +implies 51^(−1/99) > 19/20. Even this most favorable grid therefore saves +less than **5%** of its own recursive work. An integer 99th-root certificate +bounds the maximum saving near **3.8937091284%**. The first integer width +reaching 5% at a = 1/99 is r = 161, outside the guard. + +This is a scoped obstruction for one generic width-r block-child contract. +Input gathering, source access, copies, helper use, frame changes, output +storage, dirty-state restoration, hosting, precision, and interface +transitions are all assigned zero cost. The screen gives the proposed block +every advantage. It does not establish a replacement ceiling for the selected +word, prove that its exact provider contains Cartesian grids, exclude a +different bilinear algorithm for a grid, or change κ. The selected profile +still needs a separate admissible per-call interface before this mechanism +can be used. + +## Evidence and reproduction + +The verifier checks the block identity as formal polynomials for 15 width and +block-size pairs. It rejects two mutated block placements, proves the 5% +boundary with integer powers, and certifies the decimal interval with an +integer 99th-root computation. + +From the repository root: + + python3 -I -B research/complex-cartesian-grid-screen-seed506af/verify.py + python3 scripts/research_package.py --package research/complex-cartesian-grid-screen-seed506af --check-only + +Expected verifier prefix: + + PASS_CARTESIAN_GRID_COST_SCREEN identity_fixtures=15 rank_domain=2..51 exponent_domain=0..1/99 + +Exact base, selected record, catalogue, and live explanatory sources are +pinned in SOURCES.json. The changed-scope declaration and evidence are in +TASK.json. + +## Related constructions and limits + +- PR #1779 studies diagonal batches of rank-one climbs across distinct + destinations. +- PR #1814 studies three sources feeding one destination. +- PR #1865 studies one source feeding three destinations. +- PR #1764 and PR #1836 study joint boundary children at one or two lanes. + +Those mechanisms have different output patterns. The recent dependency-DAG +claim on Discussion #1596 was released after applying the PR #679 support +obstruction to the diagonal-batch family; this package does not replay or +extend that audit. + +## Open next questions + +Could a changed child contract exploit a Cartesian grid through a bilinear +algorithm cheaper than the generic width-r product while still admitting the +selected provider's arbitrary dirty state and frame endpoints? This matters +because only a changed recursive interface could evade the cost ratio above. +The first step is an exact small-width tensor decomposition with source and +output supports and a complete copy, frame, and restoration invoice. The +blocker is that no such native interface or admissible selected-word window +is supplied here. + +## Credit + +Credit the selected #1094/#1042 complex supplier lineage and the distinct +fanout, gather, diagonal-batch, and joint-boundary predecessors above. +Prepared by Cinna Davis with substantial OpenAI Codex assistance in choosing +the construction, deriving its cost screen, writing the verifier, and +packaging the result. New work is Apache-2.0. + diff --git a/research/complex-cartesian-grid-screen-seed506af/SOURCES.json b/research/complex-cartesian-grid-screen-seed506af/SOURCES.json new file mode 100644 index 0000000000..f71ee15a78 --- /dev/null +++ b/research/complex-cartesian-grid-screen-seed506af/SOURCES.json @@ -0,0 +1,30 @@ +{ + "schema_version": 1, + "base_commit": "0b1cccf86e2f5132ed286a26ef0a681a495740ea", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "ae6a99f28aa468649eb66a361e764d769363bf11", + "sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "06c96f5579bb67ed1b86d334e78fbed7da6945f1", + "sha256": "6686ad58f1fbdbc87134a78901b60fd53a20d3984355e91defbbebc9e9fa8075" + }, + { + "path": "docs/research/bottleneck-brief.md", + "usage": "input", + "git_blob": "9a2c01f65bdb5c6816685bf00c8510ea8db43856", + "sha256": "a5e316569672dc88276647d1a7ae91df150b944e1376a975c67af246d94d67c8" + }, + { + "path": "research/complex-local-word-ceiling/README.md", + "usage": "input", + "git_blob": "f5f742f8196da29d2c3f4dffb3c27685ca9401f6", + "sha256": "b60be039cb0e03e064a27407d0bce9e58908d793da5ee405c876de5aebfa5f81" + } + ] +} diff --git a/research/complex-cartesian-grid-screen-seed506af/TASK.json b/research/complex-cartesian-grid-screen-seed506af/TASK.json new file mode 100644 index 0000000000..2dcbcda1cf --- /dev/null +++ b/research/complex-cartesian-grid-screen-seed506af/TASK.json @@ -0,0 +1,79 @@ +{ + "schema_version": 1, + "track": "complex-mechanisms", + "seed": "506af17109f2b8945b6b47236c53520b", + "scope_key": "cad3ba853d7f324f16fa", + "selected_record_sha256": "10b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32", + "claim_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1167#discussioncomment-18924220", + "overlap_snapshot": { + "searched_at": "2026-10-14T12:50:35Z", + "open_prs": 532, + "discussions": 512, + "complete_pagination": true, + "warnings": [], + "exact_grid_matches": 0 + }, + "task_id": "complex-rank-shape-decoder", + "priority_revision": 3, + "base_commit": "0b1cccf86e2f5132ed286a26ef0a681a495740ea", + "original_card": { + "id": "complex-rank-shape-decoder", + "question": "Can a decoder deliver the local paid mass in fewer, larger-rank children (block frame climbs instead of rank-1 to rank-3 steps)?", + "starting_points": [ + "research/complex-local-word-ceiling/README.md", + "research/complex-decoder-field-extension-seed44/README.md", + "research/complex-frame-pair-decoders/README.md" + ], + "methods": [ + "Find one exact small decoding identity whose frame path climbs in blocks, and price its complete per-call profile.", + "Bound the best effective child rank achievable for one fixed support alphabet, including copies, frames and restoration." + ], + "acceptance_gate": "A per-call local profile, with all copied information, frames and restoration counted, whose ceiling exceeds the selected word's by at least 5%; masked or overcomplete supports must change an assumption of the eight-term all-pairs bound.", + "first_step": { + "command": [ + "python3", + "-B", + "research/complex-local-word-ceiling/verify.py" + ], + "expected": "PASS_COMPLEX_LOCAL_WORD_CEILING", + "inspect": "Read the selected word's per-call local profile, its packing ceiling and the lever table; run levers.py for the ideal budget of the lever you target.", + "scope": "Positive control and planning budget only; this is not a new construction or full cold replay." + }, + "first_experiment": "Before any synthesis, write the candidate per-call local profile (and centre charge / unpaid coordinates if changed) and screen it with ceiling.ceiling(); reject it if even the ideal ceiling does not beat the selected word's by your stated margin. Ideal budget: rank-16 delivery is 2.31x (levers.py).", + "bottleneck_link": "Rank-1 children are about half of recursive cost; the selected word's effective child rank is about 3.9. Larger-rank delivery lowers recursive cost per unit of paid mass.", + "allowed_variations": [ + "One masked, overcomplete or block decoder family with exact labels and supports.", + "A scoped lower bound on effective rank for one alphabet.", + "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": [ + "Repacking idle remainders of an unchanged word (covered by the packing ceiling).", + "Repeating the eight-term all-pairs search inside its proved scope." + ], + "overlap_terms": [ + "rank shape", + "block climb", + "masked decoder", + "overcomplete", + "effective rank" + ] + }, + "scope_status": "changed", + "actual_scope": "Test the Cartesian source-destination grid identity A_(i,1)=X_i, B_(1,j)=Y_j, which produces r^2 block products from one generic width-r matrix-product child. Bound its recursive-work saving for every 2<=r<=51 and 0<=a<=1/99, granting all data movement and interface expenses for free.", + "scope_change_reason": "The catalogue card starts from one-dimensional block frame climbs. This experiment changes the output geometry to a full Cartesian grid and derives a separate quadratic matrix-product cost model, so the incumbent linear paid-mass ceiling is not applied outside its hypotheses.", + "bottleneck_link": "A larger-rank child can reduce recursive work only if its larger block output offsets the full r^(2-a) matrix-product charge. The exact best-case grid ratio is at least 19/20 throughout the target exponent range under the rank-51 guard, below the task's 5% screening threshold even before interface costs.", + "budget_minutes": 60, + "stop_rule": "Bound every width r=2..51 at 0<=a<=1/99. Stop before selected-word synthesis if the free-interface generic block's exact best-case saving is below 5%; restart only for a changed child contract or cost law.", + "outcome": "negative-result", + "evidence": "verify.py passes 15 exact formal-polynomial identity fixtures, two block-placement mutation controls, exact integer-power tests for the 5% threshold, and an integer 99th-root decimal bracket. Maximum saving is <5%; first width reaching 5% is 161.", + "author": "Cinna Davis", + "ai_assistance": "Substantial OpenAI Codex assistance in selecting the mechanism, deriving the cost bound, implementing exact controls, and writing the package.", + "open_questions": [ + { + "question": "Can a changed child contract use a cheaper bilinear algorithm for a Cartesian grid while preserving the selected provider's arbitrary dirty state and frame endpoints?", + "why_it_matters": "A different admitted interface is the only route from this grid geometry to a recursive-work improvement beyond the generic width-r cost bound.", + "first_step": "Check an exact small-width tensor decomposition and compute its full source, copy, frame, output, and restoration invoice.", + "blocked_by": "No such native child contract or admissible selected-word window is supplied in this result." + } + ] +} diff --git a/research/complex-cartesian-grid-screen-seed506af/VERIFY.json b/research/complex-cartesian-grid-screen-seed506af/VERIFY.json new file mode 100644 index 0000000000..c945aa3460 --- /dev/null +++ b/research/complex-cartesian-grid-screen-seed506af/VERIFY.json @@ -0,0 +1,22 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "docs/research/bottleneck-brief.md", + "research/complex-local-word-ceiling/README.md" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "15 exact formal-polynomial grid identities; two wrong-placement rejections; exact 51-versus-5-percent and 160/161 threshold inequalities; certified integer 99th-root decimal bracket" + } + ] +} diff --git a/research/complex-cartesian-grid-screen-seed506af/verify.py b/research/complex-cartesian-grid-screen-seed506af/verify.py new file mode 100644 index 0000000000..cfb52e88e8 --- /dev/null +++ b/research/complex-cartesian-grid-screen-seed506af/verify.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python3 +"""Exact source-destination grid identity and optimistic recursive-cost screen.""" + +from decimal import Decimal, getcontext +from fractions import Fraction + + +def add_poly(dst, src): + for monomial, coefficient in src.items(): + dst[monomial] = dst.get(monomial, 0) + coefficient + if dst[monomial] == 0: + del dst[monomial] + + +def mul_poly(left, right): + out = {} + for a, ca in left.items(): + for b, cb in right.items(): + monomial = tuple(sorted(a + b)) + out[monomial] = out.get(monomial, 0) + ca * cb + return out + + +def formal_grid(r, n, bad_b_row=False, permute_y=False): + """Return the exact scalar-polynomial product of the sparse block inputs.""" + size = r * n + left = [[{} for _ in range(size)] for _ in range(size)] + right = [[{} for _ in range(size)] for _ in range(size)] + + for i in range(r): + for p in range(n): + for q in range(n): + left[i * n + p][q] = {(('x', i, p, q),): 1} + + row_offset = n if bad_b_row else 0 + for j in range(r): + y_index = (j + 1) % r if permute_y else j + for p in range(n): + for q in range(n): + right[row_offset + p][j * n + q] = {(('y', y_index, p, q),): 1} + + product = [[{} for _ in range(size)] for _ in range(size)] + for i in range(size): + for k in range(size): + if not left[i][k]: + continue + for j in range(size): + if right[k][j]: + add_poly(product[i][j], mul_poly(left[i][k], right[k][j])) + return product + + +def expected_grid(r, n): + size = r * n + expected = [[{} for _ in range(size)] for _ in range(size)] + for i in range(r): + for j in range(r): + for p in range(n): + for q in range(n): + out = expected[i * n + p][j * n + q] + for k in range(n): + monomial = tuple(sorted((('x', i, p, k), ('y', j, k, q)))) + out[monomial] = 1 + return expected + + +def integer_nth_root_floor(value, degree): + lo, hi = 0, 1 + while hi**degree <= value: + hi *= 2 + while hi - lo > 1: + mid = (lo + hi) // 2 + if mid**degree <= value: + lo = mid + else: + hi = mid + return lo + + +def decimal_fraction(value, digits=32): + getcontext().prec = digits + 8 + return format(Decimal(value.numerator) / Decimal(value.denominator), f'.{digits}f') + + +def main(): + identity_fixtures = 0 + for r in range(2, 7): + for n in range(1, 4): + want = expected_grid(r, n) + got = formal_grid(r, n) + assert got == want, (r, n, 'Cartesian block identity') + identity_fixtures += 1 + + want = expected_grid(3, 2) + assert formal_grid(3, 2, bad_b_row=True) != want + assert formal_grid(3, 2, permute_y=True) != want + + # A generic width-r product at exponent 2-a costs r^(2-a) child units; + # the r^2 separate products cost r^2. The best ratio in the bounded domain + # occurs at r=51 and a=1/99. + numerator = 20**99 + denominator = 19**99 + assert 51 * denominator < numerator + assert 160 * denominator < numerator <= 161 * denominator + + # Certify a decimal bracket for 51^(-1/99) using only integer arithmetic. + digits = 30 + scale = 10**digits + power_scale = scale**99 + root_floor = integer_nth_root_floor(power_scale // 51, 99) + assert 51 * root_floor**99 <= power_scale + assert power_scale < 51 * (root_floor + 1) ** 99 + ratio_lo = Fraction(root_floor, scale) + ratio_hi = Fraction(root_floor + 1, scale) + saving_lo = 100 * (1 - ratio_hi) + saving_hi = 100 * (1 - ratio_lo) + assert saving_hi < 5 + + print( + 'PASS_CARTESIAN_GRID_COST_SCREEN', + f'identity_fixtures={identity_fixtures}', + 'rank_domain=2..51', + 'exponent_domain=0..1/99', + 'max_saving_percent=(' + decimal_fraction(saving_lo) + ',' + decimal_fraction(saving_hi) + ')', + 'first_width_at_5_percent=161', + 'controls=4', + ) + + +if __name__ == '__main__': + main()