From 821204fa55bb686d76152a9d9564203a4c981876 Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Fri, 23 Oct 2026 17:31:53 -0500 Subject: [PATCH 1/2] Remove redundant native maps after scalar gauge normalization --- research/native-gauge-cancellation/PROOF.md | 105 ++++ research/native-gauge-cancellation/README.md | 95 +++ .../native-gauge-cancellation/RESULT.json | 568 ++++++++++++++++++ .../native-gauge-cancellation/SOURCES.json | 78 +++ research/native-gauge-cancellation/TASK.json | 100 +++ .../native-gauge-cancellation/VALIDATION.md | 28 + .../native-gauge-cancellation/VERIFY.json | 29 + .../native-gauge-cancellation/construct.py | 121 ++++ research/native-gauge-cancellation/verify.py | 149 +++++ 9 files changed, 1273 insertions(+) create mode 100644 research/native-gauge-cancellation/PROOF.md create mode 100644 research/native-gauge-cancellation/README.md create mode 100644 research/native-gauge-cancellation/RESULT.json create mode 100644 research/native-gauge-cancellation/SOURCES.json create mode 100644 research/native-gauge-cancellation/TASK.json create mode 100644 research/native-gauge-cancellation/VALIDATION.md create mode 100644 research/native-gauge-cancellation/VERIFY.json create mode 100644 research/native-gauge-cancellation/construct.py create mode 100644 research/native-gauge-cancellation/verify.py diff --git a/research/native-gauge-cancellation/PROOF.md b/research/native-gauge-cancellation/PROOF.md new file mode 100644 index 0000000000..d4f84bb36c --- /dev/null +++ b/research/native-gauge-cancellation/PROOF.md @@ -0,0 +1,105 @@ +# Exact native-map cancellation on the fixed source word + +## 1. Scope + +The input is the final PR4610 word after the credited PR5350 constructor. +All 632 persistent inputs are arbitrary. C0 is owned and returns zero. +The output is a new scalar/native word with the same physical endpoints, +frame contacts and recursive invoice. This proof does not establish a higher +kappa, a practical speedup, or an optimum among linear circuits. + +## 2. Normalize each field before comparing ADDs + +Write the current value in field r as + + y_r = c_r G_r z_r, + +where c_r is a nonzero rational scalar and G_r is a word in native maps and +their inverses. Initially c_r=1 and G_r is empty. A SCALE changes c_r. A warp +W changes G_r to W G_r. Adjacent inverse letters reduce in the free group. +Only this exact inverse rule is used; no finite-column coincidence is assumed. + +An ADD y_r += a y_s acts on the normalized values as + + z_r += (a c_s/c_r) G_r^-1 G_s z_s. + +For r distinct from s, two such ADDs on the same ordered pair commute and +combine by coefficient addition when their normalized native words agree. +Two ADDs on pairs (r,s) and (u,v) commute if r differs from v and u differs +from s. This follows by multiplying their elementary block matrices: both +cross terms vanish. It holds for noncommuting operator coefficients. + +The constructor scans back only across this commuting relation. A source +write or target read stops the scan. A CLEAR or COPY stops it on each of its +operands. Thus it does not move an ADD through an overwrite or a dependent +operation. When it combines two coefficients at the later contact, it converts +the sum back to that contact's actual scalar factor. A zero sum deletes both +ADDs. A nonzero sum replaces the later scalar coefficient. Every intermediate +native map and SCALE remains in place at this step. + +Consequently the changed logical word is an exact identity in the free +operator algebra. It holds for any representation of the native maps, +including their actual absolute phases and every allowed column multiplicity. +This algebraic statement does not discharge the inherited all-size native +implementation assumption. + +## 3. Remove native maps with no remaining contact + +For each field, the second pass tracks native maps between scalar contacts. +A scalar read, write, COPY or CLEAR ends that interval. SCALE commutes with a +native linear map. Within one interval, adjacent inverse letters cancel. +This includes letters separated by operations on other fields. + +Climbs are coordinate changes in the logical frame representation. The +constructor keeps every paid climb record. After the logical simplification, +both retained native interpreters check the actual input frame of every +warp, the common frame of every scalar contact, each paid transition, every +persistent output, and the owned return. This is necessary: logical equality +alone would not prove that the changed record list has legal physical frames. + +For a legal framed word, substitute the frame map at each contact. Each +internal frame map cancels its inverse at the next operation. The physical +endpoint is therefore the final frame map, followed by the logical word, +followed by the inverse initial frame map. Since the initial and final maps +and the logical operator are unchanged, the physical endpoint is unchanged. +All paid edges and all surviving warps have the original exact phase recipes. +No new edge or monomial operator is introduced. The historical recipe proofs +are reused; this replay does not run their full phase-lowering suite again. + +## 4. Exact effect on the complete bill + +The pass follows the PR5350 compressor. Per orientation, it removes 42 scalar +ADD records and 60 of its 240 warp records. The source scalar allowance uses +coefficient size; it is not a flat price per ADD. The extra allowance saving +is exactly 236. Including PR5350, the reduction from PR4610 is 193 scalar +records, 60 warps and 1452 scalar allowance units per call. + +Both orientations retain every PR5350 paid record in its chronological order. +They also retain the original PR4610 role/frame/rank transition census. The +paid profile is + + {1:2201, 2:412, 3:510, 4:127, 5:40, 8:8}. + +The main and helper endpoints and all helper inputs are unchanged. Hence all +productive jobs are unchanged. For every exponent t, both sums of r^t in the +complete controller invoice are identical to their previous values. The +recursive moment and kappa do not improve. If the same word is used in all +18 full calls of the retained p16 controller, the local count differences +multiply by 18; that statement is arithmetic, not a new whole-controller run. + +## 5. Evidence and limits + +The deterministic receipt contains both retained all-column interpreter +results, the generated program hashes and source-event patch. Dense rational +controls check dependency barriers and scalar normalization. An actual scalar +sign mutation fails both native interpreters in both orientations. The source +files are pinned by bytes and Git blob. + +There is no new independent native interpreter, cold selected replay, uniform +compiler, BIT supplier, precision/tape implementation, analytic recovery, +formal-kernel proof or end-to-end integer-multiplication check. The five +selected framework assumptions remain. Independent human review is open. + +Credit Cao Yifan, Cinna Davis, ahrazzle, Chrisbryan17, Dugongue, zxv, Jacob +Alan Sussman, and all retained source authors. Ali Romman with substantial +OpenAI Codex assistance. Apache-2.0. diff --git a/research/native-gauge-cancellation/README.md b/research/native-gauge-cancellation/README.md new file mode 100644 index 0000000000..476ca36f8b --- /dev/null +++ b/research/native-gauge-cancellation/README.md @@ -0,0 +1,95 @@ +# Remove 60 native maps after the final Cao scalar compressor + +This exact circuit change removes **60 native-map records and 42 more scalar +ADD records per native call**, after the 151-ADD reduction in +[PR #5350](https://github.com/CrocSwap/integer-mult-bounds/pull/5350). +The new scalar allowance saving is 236 per call. The total reduction from +Cao Yifan's final PR4610 word is 193 scalar records, 60 native maps, and 1452 +scalar allowance units per call. The native-map count falls from 240 to 180. +These are circuit counts, not measured running times. + +**Kappa does not change. This is not the requested bottleneck breakthrough.** +The complete paid Gaussian profile and all 408 productive helper boundaries +are unchanged. Thus the complete recursive moment is identical for every +exponent. The selected conditional kappa at the base is 0.0030217758. The +binding main-transform cost is unchanged. No selected record is edited. + +| Orientation | PR4610 scalar allowance | PR5350 allowance | New allowance | +| --- | ---: | ---: | ---: | +| Forward | 158120 | 156904 | 156668 | +| Backward | 158168 | 156952 | 156716 | + +The new pass tracks each field's scalar factor and formal native-map word. +It combines exact equal ADD operators across commuting instructions. It then +removes native maps that have become an unused inverse pair. It preserves +noncommuting dependencies and reset barriers. [PROOF.md](PROOF.md) states the +algebra and the physical-frame argument. [RESULT.json](RESULT.json) gives the +source-event patch, generated word hashes, both native receipts, complete +local invoices, and failure controls. + +The base is canonical main `1ec1119972c9aefe42525172d07b332fcff81cb4`. +[SOURCES.json](SOURCES.json) pins all ten consumed files by SHA256 and Git +blob. The original native payload has decompressed SHA256 +`cfcd36b40326d7a5815e1db5313444379b3fb756b27d5201c561574c085cc0dd`. +The source constructor, archives, receipts and selected supplier are not edited. + +## Verification + +Use Python 3.12 and the standard library. From the repository root: + +```sh +python3 -B scripts/research_package.py --package research/native-gauge-cancellation +``` + +The scientific command ends with: + +```text +PASS_NATIVE_GAUGE_CANCELLATION_NO_KAPPA_CHANGE +``` + +The verifier rebuilds both orientations. Two retained source interpreters +check all 632 arbitrary persistent columns, arbitrary owned entry state, +exact scalar frames, native-map words, and zero return of the owned field. +Every paid record from PR5350 is retained. Every original role/frame/rank +transition is retained. The complete paid profile remains +`{1:2201,2:412,3:510,4:127,5:40,8:8}` with 3298 jobs and rank mass 5327. +The formal prefix bounds remain 457 forward and 169 backward. + +Exact dense controls check source writes, target reads, scalar-weight changes +and resets. A distinct native-map word cannot be cancelled. Both native +interpreters reject a changed scalar sign in the actual emitted word. +The default replay compares the deterministic receipt without writing it; +`--write` is the explicit receipt-generation command. + +[VALIDATION.md](VALIDATION.md) records executed checks. No new phase recipe is +needed: the paid records are unchanged and each retained warp is an original +frame-bound warp. Their existing absolute-phase lowering is reused, not +rerun. No complete controller, compiler, BIT, outer-ledger, cold-supplier, +formal-kernel or end-to-end integer-multiplication replay is claimed. Native +all-column, ownership, uniform compiler, precision/tape and analytic-recovery +assumptions remain inherited. Independent human review remains open. + +## Open next questions + +This result does not justify another search with the same recursive bill. +A kappa claim needs a changed paid or productive profile and full admission. +The present package makes no claim about the best possible scalar circuit. + +## Credit + +Cao Yifan supplies the final native word in +[PR #4610](https://github.com/CrocSwap/integer-mult-bounds/pull/4610). +Cinna Davis supplies the commuting and triangle rewrites in +[PR #4692](https://github.com/CrocSwap/integer-mult-bounds/pull/4692). +ahrazzle supplies their paid-profile-safe final-word composition in +[PR #5350](https://github.com/CrocSwap/integer-mult-bounds/pull/5350). +Chrisbryan17 supplies the earlier bounded inverse-pair check in +[PR #5265](https://github.com/CrocSwap/integer-mult-bounds/pull/5265). +This package imports the prior constructor and both retained interpreters; +they are not new independent implementations. It adds scalar/native-map +normalization and the resulting cancellations. + +Credit Cinna Davis's controller/helper lineage, Dugongue's native maps, zxv, +Jacob Alan Sussman, and all retained scalar, Clifford, geometry, compiler, +precision and analytic authors. Source notices remain unchanged. New work by +Ali Romman with substantial OpenAI Codex assistance; no subagents. Apache-2.0. diff --git a/research/native-gauge-cancellation/RESULT.json b/research/native-gauge-cancellation/RESULT.json new file mode 100644 index 0000000000..e706000f90 --- /dev/null +++ b/research/native-gauge-cancellation/RESULT.json @@ -0,0 +1,568 @@ +{ + "status": "PASS_NATIVE_GAUGE_CANCELLATION_NO_KAPPA_CHANGE", + "new_kappa": null, + "controls": [ + "reset_barrier", + "scale_weight", + "source_write", + "target_read", + "unequal_native_word", + "false_unweighted_cancellation" + ], + "directions": { + "backward": { + "original_counts": { + "adapter": 448, + "center": 8, + "climb": 3290, + "phase": 10, + "scalar": 17453, + "warp": 240 + }, + "prior_counts": { + "adapter": 448, + "center": 8, + "climb": 3290, + "phase": 10, + "scalar": 17302, + "warp": 240 + }, + "new_counts": { + "adapter": 448, + "center": 8, + "climb": 3290, + "phase": 10, + "scalar": 17260, + "warp": 180 + }, + "program_sha256": "90e1207752158afc564a4d9a8d20553edf2cec477d21cbcc627dc24e6eba231c", + "first_interpreter": { + "independent_persistent_columns": 632, + "independent_owned_entry_columns": 1, + "scalar_frames_checked": true, + "arbitrary_owned_C0_cleared": true, + "paid_profile": { + "1": 2201, + "2": 412, + "3": 510, + "4": 127, + "5": 40, + "8": 8 + }, + "paid_rank_mass": 5327, + "real_scalar_allowance": 156716, + "max_formal_prefix_l1": "169", + "max_denominator": 64, + "l1_witness": { + "event": 6331, + "role": [ + "L", + 225 + ] + } + }, + "second_interpreter": { + "direction": "backward", + "clean_J": false, + "independent_borrowed_input_fields": 632, + "original_data_fields": 224, + "expected_restored_helpers": 408, + "expected_restored_arbitrary_cleanup_buffers": 0, + "explicitly_owned_C_fields_cleared": 1, + "event_counts": { + "phase": 10, + "warp": 180, + "scalar": 17260, + "adapter": 448, + "climb": 3290, + "center": 8 + }, + "paid_profile": { + "1": 2201, + "2": 412, + "3": 510, + "4": 127, + "5": 40, + "8": 8 + }, + "paid_rank_mass": 5327, + "conservative_real_scalar_primitive_allowance": 156716, + "all_scalar_frames_checked": true, + "dyadic_coefficients_and_unit_scales_checked": true, + "free_warp_operator_endpoint_matches": true, + "negative_control_omitted_last_cleanup_scalar": false, + "mismatch_examples": [] + }, + "mutation_rejections": [ + "literal_endpoint", + "second_endpoint" + ], + "new_scalar_allowance_saving": 236, + "total_scalar_allowance_saving_from_4610": 1452 + }, + "forward": { + "original_counts": { + "adapter": 448, + "center": 8, + "climb": 3290, + "phase": 10, + "scalar": 17453, + "warp": 240 + }, + "prior_counts": { + "adapter": 448, + "center": 8, + "climb": 3290, + "phase": 10, + "scalar": 17302, + "warp": 240 + }, + "new_counts": { + "adapter": 448, + "center": 8, + "climb": 3290, + "phase": 10, + "scalar": 17260, + "warp": 180 + }, + "program_sha256": "dd841c2fcd8745ca68714b0a00bbaaf45b987dc3cc4af36bf822f9d95f0b2cc1", + "first_interpreter": { + "independent_persistent_columns": 632, + "independent_owned_entry_columns": 1, + "scalar_frames_checked": true, + "arbitrary_owned_C0_cleared": true, + "paid_profile": { + "1": 2201, + "2": 412, + "3": 510, + "4": 127, + "5": 40, + "8": 8 + }, + "paid_rank_mass": 5327, + "real_scalar_allowance": 156668, + "max_formal_prefix_l1": "457", + "max_denominator": 32, + "l1_witness": { + "event": 18803, + "role": [ + "L", + 224 + ] + } + }, + "second_interpreter": { + "direction": "forward", + "clean_J": false, + "independent_borrowed_input_fields": 632, + "original_data_fields": 224, + "expected_restored_helpers": 408, + "expected_restored_arbitrary_cleanup_buffers": 0, + "explicitly_owned_C_fields_cleared": 1, + "event_counts": { + "phase": 10, + "warp": 180, + "scalar": 17260, + "adapter": 448, + "climb": 3290, + "center": 8 + }, + "paid_profile": { + "1": 2201, + "2": 412, + "3": 510, + "4": 127, + "5": 40, + "8": 8 + }, + "paid_rank_mass": 5327, + "conservative_real_scalar_primitive_allowance": 156668, + "all_scalar_frames_checked": true, + "dyadic_coefficients_and_unit_scales_checked": true, + "free_warp_operator_endpoint_matches": true, + "negative_control_omitted_last_cleanup_scalar": false, + "mismatch_examples": [] + }, + "mutation_rejections": [ + "literal_endpoint", + "second_endpoint" + ], + "new_scalar_allowance_saving": 236, + "total_scalar_allowance_saving_from_4610": 1452 + } + }, + "patches": { + "backward": { + "combined_event_pairs": [ + [ + 6724, + 7059 + ], + [ + 6743, + 7335 + ], + [ + 15466, + 15472 + ], + [ + 15481, + 15483 + ], + [ + 15493, + 15497 + ], + [ + 15505, + 15507 + ], + [ + 15516, + 15518 + ], + [ + 15552, + 15554 + ], + [ + 15560, + 15562 + ], + [ + 15566, + 15794 + ], + [ + 15557, + 15796 + ], + [ + 15539, + 15798 + ], + [ + 15538, + 15799 + ], + [ + 15537, + 15800 + ], + [ + 15536, + 15801 + ], + [ + 16678, + 16680 + ], + [ + 16720, + 16722 + ], + [ + 16731, + 16734 + ], + [ + 16779, + 16781 + ], + [ + 16787, + 16789 + ], + [ + 17113, + 18694 + ], + [ + 17112, + 18695 + ], + [ + 17111, + 18696 + ], + [ + 17110, + 18697 + ], + [ + 17115, + 18700 + ], + [ + 17114, + 18701 + ], + [ + 18747, + 18749 + ], + [ + 18757, + 18761 + ], + [ + 19434, + 20163 + ], + [ + 20031, + 20197 + ] + ], + "removed_warp_events": [ + 3, + 4, + 6, + 7, + 9, + 10, + 12, + 13, + 15, + 16, + 21, + 22, + 24, + 25, + 27, + 28, + 30, + 31, + 33, + 34, + 39, + 40, + 42, + 43, + 45, + 46, + 48, + 49, + 51, + 52, + 57, + 58, + 60, + 61, + 63, + 64, + 66, + 67, + 69, + 70, + 75, + 76, + 78, + 79, + 81, + 82, + 84, + 85, + 87, + 88, + 93, + 94, + 96, + 97, + 99, + 100, + 102, + 103, + 105, + 106 + ] + }, + "forward": { + "combined_event_pairs": [ + [ + 6724, + 7059 + ], + [ + 6743, + 7335 + ], + [ + 15466, + 15472 + ], + [ + 15481, + 15483 + ], + [ + 15493, + 15497 + ], + [ + 15505, + 15507 + ], + [ + 15516, + 15518 + ], + [ + 15552, + 15554 + ], + [ + 15560, + 15562 + ], + [ + 15566, + 15794 + ], + [ + 15557, + 15796 + ], + [ + 15539, + 15798 + ], + [ + 15538, + 15799 + ], + [ + 15537, + 15800 + ], + [ + 15536, + 15801 + ], + [ + 16678, + 16680 + ], + [ + 16720, + 16722 + ], + [ + 16731, + 16734 + ], + [ + 16779, + 16781 + ], + [ + 16787, + 16789 + ], + [ + 17113, + 18694 + ], + [ + 17112, + 18695 + ], + [ + 17111, + 18696 + ], + [ + 17110, + 18697 + ], + [ + 17115, + 18700 + ], + [ + 17114, + 18701 + ], + [ + 18747, + 18749 + ], + [ + 18757, + 18761 + ], + [ + 19434, + 20163 + ], + [ + 20031, + 20197 + ] + ], + "removed_warp_events": [ + 3, + 4, + 6, + 7, + 9, + 10, + 12, + 13, + 15, + 16, + 21, + 22, + 24, + 25, + 27, + 28, + 30, + 31, + 33, + 34, + 39, + 40, + 42, + 43, + 45, + 46, + 48, + 49, + 51, + 52, + 57, + 58, + 60, + 61, + 63, + 64, + 66, + 67, + 69, + 70, + 75, + 76, + 78, + 79, + 81, + 82, + 84, + 85, + 87, + 88, + 93, + 94, + 96, + 97, + 99, + 100, + 102, + 103, + 105, + 106 + ] + } + } +} diff --git a/research/native-gauge-cancellation/SOURCES.json b/research/native-gauge-cancellation/SOURCES.json new file mode 100644 index 0000000000..c88e24aef7 --- /dev/null +++ b/research/native-gauge-cancellation/SOURCES.json @@ -0,0 +1,78 @@ +{ + "schema_version": 1, + "base_commit": "1ec1119972c9aefe42525172d07b332fcff81cb4", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b288ae44032fd84dd5564243422836cbcd29835e", + "sha256": "f9ed52bb642cd1e1486cf2743557ac5fa23cf1514a3277d786a644e39a565038" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "f126dd2e2dad2b669e75d1d0d0bd05c600725602", + "sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72" + }, + { + "path": "research/cao-trace-retiming-20261023/README.md", + "usage": "input", + "git_blob": "ea1c3ea016471dca0e24052717e9514cef47efcc", + "sha256": "b951da4069b5e450eefa05ac3275198c1a6c3cbc377cf86183f897a134c56293" + }, + { + "path": "research/cao-trace-retiming-20261023/construct.py", + "usage": "input", + "git_blob": "94d8c4ad395cf20ed6e2ef0fc613afbfb3a5e7c5", + "sha256": "09e8d6ed13da0546d1ac46402aae05e5f2710374048855ed7f53e28472361001" + }, + { + "path": "research/kappa-causal-continuation/buffer-borrowing/verify_buffers.py", + "usage": "input", + "git_blob": "5a55034ec9e6185d981e16c28e1e2e455069e2cb", + "sha256": "106b4d5e052427230df452f0c901d5390a0583782960b80a8af94d9a984022c7" + }, + { + "path": "research/kappa-rebuild/complex/native_extensions.py", + "usage": "input", + "git_blob": "7f84894efc309546a903d314c7ac1473e7f594a8", + "sha256": "50ad007d9c386393657e86c99a96ae0a63a8fbc52872579b185002cc626e88e3" + }, + { + "path": "research/kappa-rebuild/complex/power_two_balance.py", + "usage": "input", + "git_blob": "a55ae0ce78a1861965f899a82604b276260f636c", + "sha256": "76929bb3887911ccf100c4593574b8a1c82ee64e96f939a8aca196869438b424" + }, + { + "path": "research/kappa-rebuild/complex/rebuild_native.py", + "usage": "input", + "git_blob": "78a7b1b0e6e43a1347fb361f45c6e0eaff8dd27b", + "sha256": "f94c527cc02215de49350d477618188c4c0da48bc8fb05b4e37b24c482cad7d5" + }, + { + "path": "research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz", + "usage": "input", + "git_blob": "46d929df83817b85a5387bcdb9745e0627d6366e", + "sha256": "7679daa4ec6a40f56fc7f0202379a6f454310e94945aba4f48beaaaafb838d05" + }, + { + "path": "research/p16-cao-scalar-dag/README.md", + "usage": "input", + "git_blob": "1d1635976f496a8fba940df6a38cd3bba55000bb", + "sha256": "299f38405b4aa535596c45accfb0751ecc5512ba5b0d93a374d29977850311a6" + }, + { + "path": "research/scalar-trace-compression/README.md", + "usage": "input", + "git_blob": "c85993d7048b287cdf2b4a1852dfb2dc18eb320f", + "sha256": "5ccdab3e70502840fabcb4b234db88c024ee3f28ff9ca7e2e7e4dc3c3115a794" + }, + { + "path": "research/scalar-trace-compression/verify.py", + "usage": "input", + "git_blob": "59d292131bef552c2823bf068a70bd095f90f680", + "sha256": "b41d69aca44852b4b7b880b74b3b482c2274f7b093573ca663a8f5419c8858be" + } + ] +} diff --git a/research/native-gauge-cancellation/TASK.json b/research/native-gauge-cancellation/TASK.json new file mode 100644 index 0000000000..90cfd4af1b --- /dev/null +++ b/research/native-gauge-cancellation/TASK.json @@ -0,0 +1,100 @@ +{ + "schema_version": 1, + "task_id": "scalar-to-moment", + "priority_revision": 7, + "base_commit": "1ec1119972c9aefe42525172d07b332fcff81cb4", + "original_card": { + "id": "scalar-to-moment", + "question": "Can a changed frame itinerary remove a paid transition beyond the already covered scalar A2 contractions?", + "starting_points": [ + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "research/staged544-a2-graph-rewrite/README.md", + "research/staged544-separated-a2/README.md", + "research/staged544-a2-composition-audit/README.md", + "research/staged544-a1858-contraction-audit/README.md" + ], + "methods": [ + "Derive the changed legal frame itinerary and exact child histogram.", + "Prove a scoped obstruction showing why that scalar gain cannot change the paid contract." + ], + "acceptance_gate": "An unchanged histogram is not a kappa gain; record any separate runtime or proof benefit explicitly.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the A2 and separated-A2 constructions and their composition/contraction audits. Scalar contractions can preserve the complete recursive histogram; fewer ADDs alone do not justify further scans.", + "scope": "Source-binding orientation only; no scientific replay, theorem acceptance or supplier admission. Budget any heavy replay separately." + }, + "first_experiment": "Identify an actual paid transition to remove and construct a legal replacement frame itinerary, charging restoration, source windows and changed helpers. Compare complete before/after histograms. Stop if only scalar count changes; report that benefit honestly, without expanding the same scalar-only census.", + "bottleneck_link": "A legal change to the histogram, not addition count alone, is the bridge to an exponent gain.", + "allowed_variations": [ + "One existing scalar simplification and one proposed frame-path change." + ], + "scope_change_triggers": [ + "Submitting only another scalar count as completion of a paid-profile task." + ], + "overlap_terms": [ + "scalar simplification", + "paid profile", + "R439", + "3998", + "4019", + "4112", + "4152", + "staged544-a2-graph-rewrite", + "staged544-separated-a2", + "staged544-a2-composition-audit", + "staged544-a1858-contraction-audit" + ], + "existing_checks": [ + { + "scope": "PR #3998: consecutive A2 scalar contraction", + "evidence": "research/staged544-a2-graph-rewrite/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "389268a6b5e0373a3125d5c6fcd6995f4ea324f5", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4019: separated A2 sites with unchanged recursive histogram", + "evidence": "research/staged544-separated-a2/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "f408e09df300b575235f7f77f81948071397e16d", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4112: composition audit", + "evidence": "research/staged544-a2-composition-audit/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "205b7380656ba4b6316a8a493b1a3c679b8f7a0e", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4152: A1858 contraction audit", + "evidence": "research/staged544-a1858-contraction-audit/README.md", + "remaining": "A genuinely changed paid itinerary or a distinct independent audit; no default scalar-only expansion.", + "status": "author-checked", + "source_commit": "caaa14cde5962adc372fdca71f63d0f29e73c8b2", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Remove exact native-map and scalar work after the credited final-PR4610 scalar compressor, with the full paid profile unchanged.", + "scope_change_reason": "The donor asks for useful improvements and focused PRs. The kappa search found this separate circuit improvement. It does not satisfy the requested breakthrough.", + "bottleneck_link": "Side result only. The Gaussian recursive moment and the binding main_transform row do not change.", + "budget_minutes": 60, + "stop_rule": "Stop if a native endpoint, owned return, existing physical frame or complete paid path changes.", + "outcome": "completed", + "evidence": "Two retained exact interpreters, full 632-column endpoints in both orientations, complete local invoices and semantic failure controls.", + "author": "Ali Romman", + "ai_assistance": "Substantial OpenAI Codex assistance for research, code, proof and verification; no subagents.", + "open_questions": [], + "no_open_questions_reason": "This package does not justify another fixed-invoice search. A kappa claim requires a changed paid or productive profile." +} diff --git a/research/native-gauge-cancellation/VALIDATION.md b/research/native-gauge-cancellation/VALIDATION.md new file mode 100644 index 0000000000..3fbd2964a3 --- /dev/null +++ b/research/native-gauge-cancellation/VALIDATION.md @@ -0,0 +1,28 @@ +# Validation + +Source base: `1ec1119972c9aefe42525172d07b332fcff81cb4`. +Scientific interpreter: CPython 3.12.13, macOS arm64, standard library. + +Completed during construction: + +```sh +python3.12 -B research/native-gauge-cancellation/verify.py --write +``` + +Result: `PASS_NATIVE_GAUGE_CANCELLATION_NO_KAPPA_CHANGE`. +This authoring run generated RESULT.json and ran both retained interpreters, +full local invoice checks and semantic controls. Further publication checks +are recorded below after execution. Hosted CI is not yet claimed. + +Publication checks completed before the first commit: + +```sh +python3.12 -B scripts/research_package.py --package research/native-gauge-cancellation +python3.12 -I -O -B research/native-gauge-cancellation/verify.py +``` + +Both pass. The registered command reports +`PASS_REGISTERED_RESEARCH_PACKAGE research/native-gauge-cancellation outcome=completed`. +The initial isolated run could not import the local constructor. The verifier +now loads it by its explicit file path; the isolated and registered commands +above both passed after that correction. No scientific receipt changed. diff --git a/research/native-gauge-cancellation/VERIFY.json b/research/native-gauge-cancellation/VERIFY.json new file mode 100644 index 0000000000..bd08601fbe --- /dev/null +++ b/research/native-gauge-cancellation/VERIFY.json @@ -0,0 +1,29 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/cao-trace-retiming-20261023/README.md", + "research/cao-trace-retiming-20261023/construct.py", + "research/kappa-causal-continuation/buffer-borrowing/verify_buffers.py", + "research/kappa-rebuild/complex/native_extensions.py", + "research/kappa-rebuild/complex/power_two_balance.py", + "research/kappa-rebuild/complex/rebuild_native.py", + "research/kappa-round3-warp-20261022/ACTUAL-WORD.json.gz", + "research/p16-cao-scalar-dag/README.md", + "research/scalar-trace-compression/README.md", + "research/scalar-trace-compression/verify.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 300, + "checks": "Source hashes, exact native-gauge cancellation, both retained 632-column interpreters, unchanged paid paths, scalar/native counts and semantic failure controls." + } + ] +} diff --git a/research/native-gauge-cancellation/construct.py b/research/native-gauge-cancellation/construct.py new file mode 100644 index 0000000000..22cdf982b8 --- /dev/null +++ b/research/native-gauge-cancellation/construct.py @@ -0,0 +1,121 @@ +"""Cancel exact updates after scalar and native-map normalization. + +This constructor extends the source compressor for the fixed PR4610 word. +Ali Romman, with substantial OpenAI Codex assistance. Apache-2.0. +Credit Cao Yifan, Cinna Davis, ahrazzle, Chrisbryan17, and retained authors. +""" +from fractions import Fraction as Q +from pathlib import Path +import importlib.util +import sys + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] + + +def load(path, name): + spec = importlib.util.spec_from_file_location(name, path) + module = importlib.util.module_from_spec(spec) + sys.modules[name] = module + spec.loader.exec_module(module) + return module + + +def rid(r): + return r[1] if r[0] == 'L' else 632 + r[1] + + +def product(a, b): + out = list(a) + for x in b: + if out and out[-1] == -x: + out.pop() + else: + out.append(x) + return tuple(out) + + +def inverse(w): + return tuple(-x for x in reversed(w)) + + +def simplify(program): + gauges = [()] * 633 + scales = [Q(1)] * 633 + gates = [] + changes = {} + pairs = [] + for i, e in enumerate(program): + if e[0] == 'warp': + r = rid(e[1]) + gauges[r] = product((e[2],), gauges[r]) + elif e[0] == 'scalar': + g = e[1] + r = rid(g[1]) + if g[0] == 'scale': + scales[r] *= Q(*g[2:4]) + elif g[0] == 'add': + s = rid(g[2]) + w = product(inverse(gauges[r]), gauges[s]) + factor = scales[s] / scales[r] + c = Q(*g[3:5]) * factor + for j in range(len(gates) - 1, -1, -1): + old = gates[j] + if old is None: + continue + if old[0] == 'barrier': + if r in old[1] or s in old[1]: + break + continue + _, old_i, a, b, old_w, old_c = old + if a == s or b == r: + break + if (a, b, old_w) == (r, s, w): + c += old_c + changes[old_i] = None + gates[j] = None + pairs.append([old_i, i]) + break + if c: + v = c / factor + if v != Q(*g[3:5]): + changes[i] = ['scalar', [*g[:3], v.numerator, v.denominator], e[2]] + gates.append(('add', i, r, s, w, c)) + else: + changes[i] = None + elif g[0] in ('clear', 'copy'): + touched = {r} + if g[0] == 'copy': + touched.add(rid(g[2])) + gates.append(('barrier', touched)) + else: + raise ValueError(g) + kept = [(i, changes.get(i, e)) for i, e in enumerate(program) if changes.get(i, e) is not None] + # A warp and its inverse can be removed if no remaining scalar contact + # reads or writes that field between them. Scales commute with warps. + stack = [[] for _ in range(633)] + remove = set() + for i, e in kept: + if e[0] == 'warp': + r = rid(e[1]) + if stack[r] and stack[r][-1][1] == -e[2]: + old, _ = stack[r].pop() + remove.update((old, i)) + else: + stack[r].append((i, e[2])) + elif e[0] == 'scalar' and e[1][0] != 'scale': + for a in e[1][1:]: + if isinstance(a, list): + stack[rid(a)] = [] + return [(i, e) for i, e in kept if i not in remove], pairs, sorted(remove) + + +def construct(): + predecessor = load(ROOT / 'research/cao-trace-retiming-20261023/construct.py', 'gauge_source_compressor') + original, prior, _ = predecessor.construct() + programs, patches = {}, {} + for direction, program in prior['programs'].items(): + indexed, pairs, warps = simplify(program) + programs[direction] = [event for _, event in indexed] + patches[direction] = {'combined_event_pairs': pairs, 'removed_warp_events': warps} + return original, prior, {'canonical': prior['canonical'], 'programs': programs}, patches diff --git a/research/native-gauge-cancellation/verify.py b/research/native-gauge-cancellation/verify.py new file mode 100644 index 0000000000..7e3b7be0f6 --- /dev/null +++ b/research/native-gauge-cancellation/verify.py @@ -0,0 +1,149 @@ +"""Verify the fixed native simplification and its complete local bill. + +Ali Romman with substantial OpenAI Codex assistance. Apache-2.0. +Both native interpreters and the prior scalar constructor are reused. +""" +from collections import Counter +from copy import deepcopy +from fractions import Fraction as Q +from hashlib import sha1, sha256 +from pathlib import Path +import argparse +import json +import importlib.util +import sys +sys.dont_write_bytecode = True +HERE = Path(__file__).resolve().parent +spec = importlib.util.spec_from_file_location('native_gauge_constructor', HERE / 'construct.py') +C = importlib.util.module_from_spec(spec) +spec.loader.exec_module(C) +ROOT = C.ROOT + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def digest(value): + return sha256(json.dumps(value, sort_keys=True, separators=(',', ':')).encode()).hexdigest() + + +def authenticate(): + for row in json.loads((HERE / 'SOURCES.json').read_text())['files']: + if row['usage'] != 'input': + continue + path = ROOT / row['path'] + need(not path.is_symlink(), 'Source alias') + data = path.read_bytes() + need(sha256(data).hexdigest() == row['sha256'], 'Changed source: ' + row['path']) + need(sha1(b'blob ' + str(len(data)).encode() + b'\0' + data).hexdigest() == row['git_blob'], 'Changed Git blob') + + +def small_controls(): + def add(d, s, c): + return ['scalar', ['add', ['L', d], ['L', s], c, 1], 0] + def dense(program): + rows = [[Q(i == j) for j in range(3)] for i in range(3)] + for e in program: + g = e[1] + r = g[1][1] + if g[0] == 'add': + rows[r] = [a + Q(*g[3:5]) * b for a, b in zip(rows[r], rows[g[2][1]])] + elif g[0] == 'scale': + rows[r] = [Q(*g[2:4]) * a for a in rows[r]] + elif g[0] == 'clear': + rows[r] = [Q(0)] * 3 + else: + raise ValueError(g) + return rows + fixtures = { + 'source_write': [add(0, 1, 1), add(1, 2, 1), add(0, 1, -1)], + 'target_read': [add(0, 1, 1), add(2, 0, 1), add(0, 1, -1)], + 'scale_weight': [add(0, 1, 1), ['scalar', ['scale', ['L', 1], 2, 1], 0], add(0, 1, -1)], + 'reset_barrier': [add(0, 1, 1), ['scalar', ['clear', ['L', 1]], 0], add(0, 1, -1)], + } + for name, program in fixtures.items(): + indexed, _, _ = C.simplify(program) + changed = [e for _, e in indexed] + need(dense(changed) == dense(program), 'Dense control: ' + name) + if name != 'scale_weight': + need(changed == program, 'Required dependency barrier: ' + name) + scaled = fixtures['scale_weight'] + need(dense([scaled[1]]) != dense(scaled), 'Unweighted scale cancellation is false') + warp = ['warp', ['L', 1], 1, 0, 0] + unequal = [add(0, 1, 1), warp, add(0, 1, -1)] + indexed, _, _ = C.simplify(unequal) + need([e for _, e in indexed] == unequal, 'Distinct native words cannot cancel') + return sorted(fixtures) + ['unequal_native_word', 'false_unweighted_cancellation'] + + +def run(): + authenticate() + controls = small_controls() + original, prior, new, patches = C.construct() + V = C.load(ROOT / 'research/kappa-causal-continuation/buffer-borrowing/verify_buffers.py', 'gauge_rows') + X = C.load(ROOT / 'research/kappa-rebuild/complex/native_extensions.py', 'gauge_literal') + c = deepcopy(new['canonical']) + c['R'] = len(c['start']) - 2*c['v'] + c['local_profile'] = {int(k): v for k, v in c['local_profile'].items()} + result = {'status': 'PASS_NATIVE_GAUGE_CANCELLATION_NO_KAPPA_CHANGE', 'new_kappa': None, + 'controls': controls, 'directions': {}, 'patches': patches} + def replay(program, direction): + rows, receipt = X.literal_replay(V, c, program, direction == 'backward') + need(all(rows['L', r] == V.expected(('L', r), [], direction == 'backward', False) for r in range(632)), 'Every persistent endpoint') + second = V.replay(program, c, [], direction == 'backward', False) + return receipt, second + for direction, program in new['programs'].items(): + before, previous = original['programs'][direction], prior['programs'][direction] + first, second = replay(program, direction) + prior_first, _ = replay(previous, direction) + def paid_path(word): + return [e for e in word if e[0] in ('climb', 'center')] + need(paid_path(program) == paid_path(previous), 'Every prior paid record is unchanged') + need(Counter(tuple(e[2:]) for e in program if e[0] == 'climb') == Counter(tuple(e[2:]) for e in before if e[0] == 'climb'), 'Original role/frame/rank census') + need([e for e in program if e[0] in ('phase', 'adapter', 'center')] == [e for e in previous if e[0] in ('phase', 'adapter', 'center')], 'Phase, adapter and center records') + counts = lambda word: dict(sorted(Counter(e[0] for e in word).items())) + need(len(before) - len(program) == 253, '193 scalar and 60 native-map deletions') + need(counts(previous)['scalar'] - counts(program)['scalar'] == 42, '42 new scalar deletions') + need(counts(previous)['warp'] - counts(program)['warp'] == 60, '60 new native-map deletions') + need(prior_first['real_scalar_allowance'] - first['real_scalar_allowance'] == 236, 'New scalar allowance saving') + need(first['real_scalar_allowance'] == (156716 if direction == 'backward' else 156668), 'Complete scalar allowance') + need(first['max_formal_prefix_l1'] == ('169' if direction == 'backward' else '457'), 'Retained prefix envelope') + mutation = deepcopy(program) + pos = next(i for i, e in reversed(list(enumerate(mutation))) if e[0] == 'scalar' and e[1][0] == 'add') + mutation[pos][1][3] *= -1 + rejected = [] + try: + rows, _ = X.literal_replay(V, c, mutation, direction == 'backward') + need(all(rows['L', r] == V.expected(('L', r), [], direction == 'backward', False) for r in range(632)), 'Corrupt scalar endpoint') + except ValueError: + rejected.append('literal_endpoint') + try: + V.replay(mutation, c, [], direction == 'backward', False) + except ValueError: + rejected.append('second_endpoint') + need(len(rejected) == 2, 'Both interpreters reject the actual scalar mutation') + result['directions'][direction] = { + 'original_counts': counts(before), 'prior_counts': counts(previous), 'new_counts': counts(program), + 'program_sha256': digest(program), 'first_interpreter': first, 'second_interpreter': second, + 'mutation_rejections': rejected, 'new_scalar_allowance_saving': 236, + 'total_scalar_allowance_saving_from_4610': 1452} + return result + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--write', action='store_true') + args = parser.parse_args() + result = json.loads(json.dumps(run())) + path = HERE / 'RESULT.json' + if args.write: + path.write_text(json.dumps(result, indent=2) + '\n') + else: + need(json.loads(path.read_text()) == result, 'Deterministic complete receipt') + print(result['status']) + + +if __name__ == '__main__': + main() From ff78b33a8c5327199af63325b0d4ee80c65b429d Mon Sep 17 00:00:00 2001 From: Ali Romman <226877337+aliromman@users.noreply.github.com> Date: Fri, 23 Oct 2026 17:33:17 -0500 Subject: [PATCH 2/2] Record portable replay for native gauge cancellation --- .../native-gauge-cancellation/VALIDATION.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/research/native-gauge-cancellation/VALIDATION.md b/research/native-gauge-cancellation/VALIDATION.md index 3fbd2964a3..0d6671ea6b 100644 --- a/research/native-gauge-cancellation/VALIDATION.md +++ b/research/native-gauge-cancellation/VALIDATION.md @@ -26,3 +26,20 @@ Both pass. The registered command reports The initial isolated run could not import the local constructor. The verifier now loads it by its explicit file path; the isolated and registered commands above both passed after that correction. No scientific receipt changed. + +The committed scientific package at +`821204fa55bb686d76152a9d9564203a4c981876` passed: + +```sh +python3 scripts/check_research_commit.py --package research/native-gauge-cancellation +python3 scripts/export_research_package.py export --package research/native-gauge-cancellation --output /tmp/native-gauge-cancellation-publication.tar.gz +python3 scripts/export_research_package.py check /tmp/native-gauge-cancellation-publication.tar.gz +PATH=/nonexistent python3.12 -I -O -B /tmp/native-gauge-cancellation-replay-20261023/research/native-gauge-cancellation/verify.py +``` + +The last command used the absolute interpreter path because PATH was empty. +The export contained 19 files. A fresh extraction had no Git directory. The +optimized scientific replay passed there. The whitespace check also passed. +The later validation-only commit changes this report, not the scientific code +or RESULT.json. The full-history ancestry check was not run in this shallow +checkout. Hosted CI and independent human review remain unclaimed here.