diff --git a/research/final233-portable-conditional/CONDITIONS.md b/research/final233-portable-conditional/CONDITIONS.md new file mode 100644 index 0000000000..6e5b38df67 --- /dev/null +++ b/research/final233-portable-conditional/CONDITIONS.md @@ -0,0 +1,101 @@ +# Conditional claim and unresolved applicability + +The finite signed application supports κ ≥ 37/10000 **only within the retained +framework and a supplier satisfying the complete contract below for this exact +candidate**. We do not establish that such a supplier exists. In particular, +this is not a drop-in improvement under an already admitted unchanged entrance +or erasure premise. No selected record, common-U implementation, formal-kernel +acceptance, independent human proof or top-level compiled multiplier is supplied. + +## Five inherited framework assumptions + +- `native_all_columns`: retained native operators, phase conventions, spectators + and whole-job adapters work at every positive column multiplicity. +- `owned_erasure`: owned streams and suspended centers obey allocation, erasure + and ownership contracts. +- `compiler`: mixed-target compilation, chronological product, completion and + splitting satisfy uniform closure. +- `precision_tape`: fixed-tape movement and precision/storage prescriptions + apply to this new finite template. +- `analytic_recovery`: analytic decomposition, fine-prime avoidance and exact + integer recovery follow the retained outer framework. + +These are assumptions, not five new proofs. Their presence does not prohibit a +clearly scoped research archive contribution; it does limit the conclusion. + +## Candidate-specific common-U and entrance contract + +`initial[457]` changes from chart 3 to chart 281. H5B, #7633 bookends, joint E4 +resettlement, permutation and exact-zero join reconstruct the declared word. +An actual caller must furnish this changed entrance and preserve the role242 +cancellation/return interfaces at every admitted recursive width/column count. +Algebraic reconstruction is not physical admission of that changed interface. + +The source #7633 common-U declaration is preserved verbatim in +`custody/7633-COMMON-U.json` (205 source-candidate lifetimes there); its applicability +does not transfer automatically to our 233 lifetimes. For final233, one common +supplier must cover every tagged allocation, complete private coded extent +including represented blanks, arbitrary old private junk at INIT, and every +reachable admitted rounded residual state. INIT resets its entire assigned +extent; CLEAR resets that extent and returns the child atomically, preserving +public fields, spectators, promises and every other live bank, with no aliasing. + +The combined lifetime charge is 4,000 ordinary units per lifetime pair; retained +non-MOVE allowances include 32 scalar services per INIT or CLEAR and coefficient +2^20 per service. These are declared normalized tariffs, not measured physical +steps at arbitrary widths. All width, size, storage, addressing, precision, +reset, movement, return and recursion factors must be paid. No hidden recursive +children, productive credits, free scans or extra uncharged MOVEs are admitted. +Keep 68 labels, 1,156 signed banks and the fresh precision context 2,458 (within +the retained 4,096 cap). The full ordinary bill must remain below 10^9. + +## Concrete failures a provider must avoid + +**Zero scalar rows do not reset physical noise.** The exact-zero lifetime join +removes an ideal CLEAR/INIT boundary. The retained residual fixture injects ε +at field1568 before the removed boundary. Final events 28870 and 29353 carry it +to field440 as -ε before CLEAR29354. Clearing the private field does not erase +the already propagated public error. This is an abstract perturbation response, +not proof that an actual provider reaches that state. The final program's +precision envelope must propagate the error; the removed boundary does not +justify resetting its majorant to zero. + +**Exact scalar service domains differ from rounded MOVE contracts.** Final +events45330/45331 are `MOVE 457,966->218` followed by +`ADD 210,457,-1/2,chart218`. Under the inspected one-unit MOVE defect contract, +a one-tick perturbation may reach the half-tick division. The retained #6968 +exact ADD table fixture accepts 2 ticks and rejects 1 tick at widths3/17/65. +Therefore that exact service is not proved to implement the broader rounded +contract. A provider must guarantee the componentwise divisibility/signed-range +return domain, or supply a total rounded service with suitable error and cost +bounds. Refining a grid alone does not resolve a unit defect on its last tick. + +**The existing generic compact ADD is not a proved same-tariff replacement.** +For equal numerical data volume B per ADD and unchanged other bill items, +the inspected #6998 forced-action calculation requires at least +ρ = 141657821/61035029 ≈ 2.320926578 primitive read/write/moves per tariff unit +per B; ρ=1 yields a replacement ledger of at least1,322,491,168, exceeding10^9. +With the same flat-row-fetch unit the necessary ratio is about2.703351124. +This limited comparison uses upper/model charges for the other items, so it +is not a lower bound on every possible multiplier or all physical runtimes. +Other implementations, widths, volumes, clocks or a finite-cutoff route need +their own complete finite upper bounds. See the retained residual/tariff reports +in `context/`. We do not claim those particular suppliers meet our premise. + +## Verified scope and exclusions + +The optional finite233 replay checks exact conjugated scalar coordinates on +grid1125*2^25; MOVE is scalar identity, INIT creates zero, CLEAR discards an owned +row. All233 recoverability expressions use distinct other currently live public +fields. This is not free physical uncomputation/reset. The pinned output-row +hash matches prior evidence; that audit does not independently derive intended +multiplication from scratch. Inherited `other_rank` metadata is not a new rank +proof. The original CLEAR builder's insufficient local self/live/division +guards are addressed for the actual finite word by the separate scalar replay, +not by rewriting the original builder or imposing our helper on everyone. + +Exact phase/column checks and the finite modular physical replay have different +quantifiers. Rounded/noisy registers, MOVE transport, complete non-J caller IR, +full private-extent services and recursive top-level lowering require the +supplier/framework work above. Archive intake preserves this evidence; it +cannot discharge those obligations or select a new frontier. diff --git a/research/final233-portable-conditional/DATA-MANIFEST.json b/research/final233-portable-conditional/DATA-MANIFEST.json new file mode 100644 index 0000000000..5f21f0ce6f --- /dev/null +++ b/research/final233-portable-conditional/DATA-MANIFEST.json @@ -0,0 +1,423 @@ +{ + "schema": 1, + "scope": "Exact source-bound materialization, not a scientific proof", + "entries": [ + { + "path": "runtime/research/hydrogen-bounded-verification-20261117/word-hydrogen-frames-restored.json.gz", + "bytes": 389070, + "sha256": "93d290ddcfae403414e8196a3bcdba5db8b6e069a55666951c14f1de8bbf40e9", + "storage": "packed", + "stored": "93d290ddcfae403414e8196a3bcdba5db8b6e069a55666951c14f1de8bbf40e9" + }, + { + "path": "runtime/research/h5b-combination-20261117/inputs/7633-candidate.b64", + "bytes": 514764, + "sha256": "e571499d30e7036467440b47ff58907b6c39738f4a959cac233f6bed4f10a902", + "storage": "packed", + "stored": "e571499d30e7036467440b47ff58907b6c39738f4a959cac233f6bed4f10a902" + }, + { + "path": "runtime/research/h5b-combination-20261117/inputs/7633-source.b64", + "bytes": 515812, + "sha256": "8d190801f028b1254cd8cb819f36a3ea4856f18da435dab60c8f46e03dc46dc9", + "storage": "packed", + "stored": "8d190801f028b1254cd8cb819f36a3ea4856f18da435dab60c8f46e03dc46dc9" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/exact-q-report.json", + "bytes": 633159, + "sha256": "e4ba7737009205da3805760cf8865b85c7ab2cd9e006ecb9b586428c3dfe71e4", + "storage": "packed", + "stored": "e4ba7737009205da3805760cf8865b85c7ab2cd9e006ecb9b586428c3dfe71e4" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/generate_and_probe.py", + "bytes": 6828, + "sha256": "4ba8c670f21f2ce403a2a8f15dec143866683dd360b68f35ba3b99c631e5c456", + "storage": "plain", + "stored": "src/runtime/research/h5b-combination-20261117/sol-analysis/generate_and_probe.py" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/NOTICE", + "bytes": 1245, + "sha256": "e8497956a216fce07e38e9ef7abbd21e75c093dc120d7667138c0cbf4a97e9d7", + "storage": "packed", + "stored": "e8497956a216fce07e38e9ef7abbd21e75c093dc120d7667138c0cbf4a97e9d7" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/reschedule-report.json", + "bytes": 855194, + "sha256": "5bfcc2622f928f99454612c36771d662d06047209b5dd1acc77c316accf5535c", + "storage": "packed", + "stored": "5bfcc2622f928f99454612c36771d662d06047209b5dd1acc77c316accf5535c" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/macos_py39_shim.py", + "bytes": 6917, + "sha256": "ba65f1e1b12903a4f9b1312acae3e911a3b57f372d4f55f6a3ca2857af8fe61b", + "storage": "plain", + "stored": "src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/macos_py39_shim.py" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/inherited/validation_native/CHARTS-BATCH-0.json", + "bytes": 16145, + "sha256": "8abdefef307cc1d778069269074c57fd2ea8fb52d55c8bd9281e488d03f272d6", + "storage": "packed", + "stored": "8abdefef307cc1d778069269074c57fd2ea8fb52d55c8bd9281e488d03f272d6" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/inherited/validation_native/CHARTS-BATCH-1.json", + "bytes": 16274, + "sha256": "06c15dde99f7f04fff7a2dca35196a119031265896863baab8bc9157f46ffd45", + "storage": "packed", + "stored": "06c15dde99f7f04fff7a2dca35196a119031265896863baab8bc9157f46ffd45" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/inherited/validation_native/CHARTS-BATCH-2.json", + "bytes": 16486, + "sha256": "c0d25482742e5d0516fb2da3025e4cb410e6214057eecfce3beb06d350280106", + "storage": "packed", + "stored": "c0d25482742e5d0516fb2da3025e4cb410e6214057eecfce3beb06d350280106" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/inherited/validation_native/CHARTS-BATCH-3.json", + "bytes": 16506, + "sha256": "910e1a50e242a5914bf8242413c07b7b54bf7dfbb5694e1c757b60c82e29acde", + "storage": "packed", + "stored": "910e1a50e242a5914bf8242413c07b7b54bf7dfbb5694e1c757b60c82e29acde" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/inherited/validation_native/CHARTS-BATCH-4.json", + "bytes": 16498, + "sha256": "75aabadebe6b7afce42678004fbeb66d46437bd58413de1de61e752a5b53a3df", + "storage": "packed", + "stored": "75aabadebe6b7afce42678004fbeb66d46437bd58413de1de61e752a5b53a3df" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/inherited/validation_native/CHARTS-BATCH-5.json", + "bytes": 16498, + "sha256": "1310786a3ae08e113c237a2d7b61a4f4a50e66b4ff57b7387cc15d8299bc1edd", + "storage": "packed", + "stored": "1310786a3ae08e113c237a2d7b61a4f4a50e66b4ff57b7387cc15d8299bc1edd" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/inherited/validation_native/CHARTS-BATCH-6.json", + "bytes": 16505, + "sha256": "a26822a3bac2f4b21f987f890772e7ea46be43c5dd2ba78cc804afea7f12b8f4", + "storage": "packed", + "stored": "a26822a3bac2f4b21f987f890772e7ea46be43c5dd2ba78cc804afea7f12b8f4" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/inherited/validation_native/CHARTS-BATCH-7.json", + "bytes": 16236, + "sha256": "0fb7aed1f8d0078fe06d45fe98cd34c2764fe3c6c0ed5ffb7f0c9e04a12ddedd", + "storage": "packed", + "stored": "0fb7aed1f8d0078fe06d45fe98cd34c2764fe3c6c0ed5ffb7f0c9e04a12ddedd" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/frozen-composition/7481-WORD.json.gz", + "bytes": 381925, + "sha256": "acee323696b18914bd863d55341f92112b48d3d1dc1443c276efb6c396fcc0a9", + "storage": "packed", + "stored": "acee323696b18914bd863d55341f92112b48d3d1dc1443c276efb6c396fcc0a9" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/frozen-composition/7546-NATIVE.json", + "bytes": 79574, + "sha256": "f2606c4c6b7f3c9ce181d32294ccfb66abb7305ce6b63b83b8118ac073772b21", + "storage": "packed", + "stored": "f2606c4c6b7f3c9ce181d32294ccfb66abb7305ce6b63b83b8118ac073772b21" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/frozen-composition/7546-SIGNED.json", + "bytes": 80636, + "sha256": "e2d722fc0486440e25af25b74f270f1292fcf8eceb116e27fcb48f055c96f6c7", + "storage": "packed", + "stored": "e2d722fc0486440e25af25b74f270f1292fcf8eceb116e27fcb48f055c96f6c7" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/frozen-composition/7546-WORD.json.gz", + "bytes": 381993, + "sha256": "6e03624b173b90356e96f845d05fc93153846b863734dc8163ab6c44c602cd32", + "storage": "packed", + "stored": "6e03624b173b90356e96f845d05fc93153846b863734dc8163ab6c44c602cd32" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/frozen-composition/7604-INVOICE.json", + "bytes": 848, + "sha256": "fb96f912da7203a775cdddd82870823117a27e2a7f54f5f45956a651728aadd6", + "storage": "packed", + "stored": "fb96f912da7203a775cdddd82870823117a27e2a7f54f5f45956a651728aadd6" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/frozen-composition/7604-WORD.json.gz", + "bytes": 382478, + "sha256": "aae5a85746db1abc5145b993e9a9408076f34c53c4bb8040a99b6a39f2685527", + "storage": "packed", + "stored": "aae5a85746db1abc5145b993e9a9408076f34c53c4bb8040a99b6a39f2685527" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/frozen-composition/CANDIDATE-INVOICE.json", + "bytes": 848, + "sha256": "318561aefc60ea58888f84e049b5b67c010f181e293294f840fece058a3383b8", + "storage": "packed", + "stored": "318561aefc60ea58888f84e049b5b67c010f181e293294f840fece058a3383b8" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/frozen-composition/CANDIDATE-WORD.json.gz", + "bytes": 392692, + "sha256": "d7eb204bb24b2e1b5a3e4ebc282d346a4706ddd738004929d1e9ac345085a79a", + "storage": "packed", + "stored": "d7eb204bb24b2e1b5a3e4ebc282d346a4706ddd738004929d1e9ac345085a79a" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/frozen-composition/RES-ON-STEP1-EDITS.json", + "bytes": 1699892, + "sha256": "42851eca7ceaa235113d40ed189e5338614e08e6e31a67659f450f096e53ef9a", + "storage": "packed", + "stored": "42851eca7ceaa235113d40ed189e5338614e08e6e31a67659f450f096e53ef9a" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/frozen-composition/W2-EDITS.json", + "bytes": 36835, + "sha256": "bf0c45f0a1498ba06ced0e217c41fe01fb8a117a3acfbc973c3bc76022d03be7", + "storage": "packed", + "stored": "bf0c45f0a1498ba06ced0e217c41fe01fb8a117a3acfbc973c3bc76022d03be7" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/frozen-composition/W3H-STEP1-ON-7616-EDITS.json", + "bytes": 168004, + "sha256": "bdad5bbb4692ccf651ec7d5f701aaa9e76a7117b1feeddd2d857f136ba8cda96", + "storage": "packed", + "stored": "bdad5bbb4692ccf651ec7d5f701aaa9e76a7117b1feeddd2d857f136ba8cda96" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/construct.py", + "bytes": 4001, + "sha256": "4be79e607cf811db120e309463d63b7ec58cd6a14c1837579f8b59e8d166e0c3", + "storage": "plain", + "stored": "src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/construct.py" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/derive_grid.py", + "bytes": 1510, + "sha256": "ceb7a44ef19d72a16db7b43c65c85910d965499d1715436011de32af5d39dbb0", + "storage": "plain", + "stored": "src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/derive_grid.py" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/INPUTS.json", + "bytes": 6702, + "sha256": "6f3548f0015d2dea38522e47ad707ef305b30baccb79a73c1ec20c2ce84f2bfe", + "storage": "packed", + "stored": "6f3548f0015d2dea38522e47ad707ef305b30baccb79a73c1ec20c2ce84f2bfe" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/NATIVE-RESULT.json", + "bytes": 74878, + "sha256": "8bd9c26c219f7c16d4648458ab527b000a8834cf1f10ceaab3febb9b76644395", + "storage": "packed", + "stored": "8bd9c26c219f7c16d4648458ab527b000a8834cf1f10ceaab3febb9b76644395" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/NOTICE", + "bytes": 1013, + "sha256": "67bc1ec2ecddeb1861010811a94e39bffb01918b73fd2ab1f8fd191b6792850e", + "storage": "packed", + "stored": "67bc1ec2ecddeb1861010811a94e39bffb01918b73fd2ab1f8fd191b6792850e" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/source.py", + "bytes": 2925, + "sha256": "aa434e4c154a6e1e5ac9d13c3627953069da02b4e0f9e977d9a13bfd1e50aa95", + "storage": "plain", + "stored": "src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/source.py" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/verify_native.py", + "bytes": 12454, + "sha256": "18b2a8887e03d1e1636062b051fa5ff0900296f1ad9681e29545f3046dc50bc6", + "storage": "plain", + "stored": "src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/verify_native.py" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/WITNESS.json", + "bytes": 592, + "sha256": "410a553d06491b965d1f24347cbea12b32c01c95b2a78af5be1b807e42649224", + "storage": "packed", + "stored": "410a553d06491b965d1f24347cbea12b32c01c95b2a78af5be1b807e42649224" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/WORD.json.gz", + "bytes": 381902, + "sha256": "50bf196026a78b7f6d3539befc22d78aeb6dd518ddcd9f5950c7844bad4c19b0", + "storage": "packed", + "stored": "50bf196026a78b7f6d3539befc22d78aeb6dd518ddcd9f5950c7844bad4c19b0" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/inputs/pr7334.tar.gz", + "bytes": 28680325, + "sha256": "721f839cc48605cccd3629d11456e1fcbb3810a624803ad27e99a1bfd6246211", + "storage": "external", + "stored": "external", + "git_blob": "e69e784c1edeeffe330a78c579aed210cd8815ff", + "url": "https://raw.githubusercontent.com/rohanarun/integer-mult-bounds/58a9d052143f5d85295ed2d0163591c47f89a331/research/p104-helper-449-fused-return/inputs/pr7334.tar.gz" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/reroute/RESULT.json", + "bytes": 2502, + "sha256": "b556a130f71feb1d02b8a606158ef3243fb6ffbebad56a7eb11ec7d4db9d1bc5", + "storage": "packed", + "stored": "b556a130f71feb1d02b8a606158ef3243fb6ffbebad56a7eb11ec7d4db9d1bc5" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/reroute/WORD.json.gz", + "bytes": 392692, + "sha256": "d7eb204bb24b2e1b5a3e4ebc282d346a4706ddd738004929d1e9ac345085a79a", + "storage": "packed", + "stored": "d7eb204bb24b2e1b5a3e4ebc282d346a4706ddd738004929d1e9ac345085a79a" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_native/NATIVE-RESULT.json", + "bytes": 300429, + "sha256": "7fd815738cfd2d5b66676c9e303995a2462e89fc206156150fe0976453048636", + "storage": "packed", + "stored": "7fd815738cfd2d5b66676c9e303995a2462e89fc206156150fe0976453048636" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_native/reconstruction_preflight.py", + "bytes": 14207, + "sha256": "4534f383b8c6a462ba5cccf73c56fb10906a0510d6cc160492dd0c0ce608bc1c", + "storage": "plain", + "stored": "src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_native/reconstruction_preflight.py" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_native/run.py", + "bytes": 22473, + "sha256": "03298e0c046db0a3ac825c5f95ba0ac3c5e0e6fd434f702e64e012f6b0b9aec6", + "storage": "plain", + "stored": "src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_native/run.py" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_signed/CACHED-SHORT-CATALOGUE-0-1000.log", + "bytes": 965, + "sha256": "890b513525a45c107992fef732944881fb2b0d76061f28ca8eca4819d816994b", + "storage": "packed", + "stored": "890b513525a45c107992fef732944881fb2b0d76061f28ca8eca4819d816994b" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_signed/CACHED-SHORT-CATALOGUE-1000-2000.log", + "bytes": 974, + "sha256": "dbfd1bc0578754302a07f66259703126d8f6aae6040e10a136e126c1c1acf3b8", + "storage": "packed", + "stored": "dbfd1bc0578754302a07f66259703126d8f6aae6040e10a136e126c1c1acf3b8" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_signed/run.py", + "bytes": 10886, + "sha256": "d4807c2618607358e160c84d5b27862840d759ad21e8064f0fd07d4f71d4fb44", + "storage": "plain", + "stored": "src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_signed/run.py" + }, + { + "path": "runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_signed/w2_adapt.py", + "bytes": 3495, + "sha256": "578f844e920fce6707c54d06ae93b6f2284ce2a3725b1cb031008fde2c9f63bd", + "storage": "plain", + "stored": "src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_signed/w2_adapt.py" + }, + { + "path": "evidence/candidate/word-joint-final.json.gz", + "bytes": 392692, + "sha256": "d7eb204bb24b2e1b5a3e4ebc282d346a4706ddd738004929d1e9ac345085a79a", + "storage": "packed", + "stored": "d7eb204bb24b2e1b5a3e4ebc282d346a4706ddd738004929d1e9ac345085a79a" + }, + { + "path": "evidence/candidate/certs-joint-final.json", + "bytes": 651438, + "sha256": "38cb504029199cd33e23ce9b78bb0eb6e274d75c0e5304252090d1e22ed70884", + "storage": "packed", + "stored": "38cb504029199cd33e23ce9b78bb0eb6e274d75c0e5304252090d1e22ed70884" + }, + { + "path": "evidence/candidate/invoice-joint-final.json", + "bytes": 849, + "sha256": "c35c9d04c8b237b9cf384b3e8b759b67b3736d238e1cb695b462a95b7091997b", + "storage": "packed", + "stored": "c35c9d04c8b237b9cf384b3e8b759b67b3736d238e1cb695b462a95b7091997b" + }, + { + "path": "evidence/candidate/lifecycle-binding-final.json", + "bytes": 19239, + "sha256": "f1bc97275dbe7b7320387be7ee076db690dd2ea5d9abdfd8b3b18362ff4ddd04", + "storage": "packed", + "stored": "f1bc97275dbe7b7320387be7ee076db690dd2ea5d9abdfd8b3b18362ff4ddd04" + }, + { + "path": "evidence/candidate/precision-cost-interval-report.json", + "bytes": 40734, + "sha256": "6dc9c74599bf4ca73c551700656d4afc90eb40614a2e062720f1be8fd1dab116", + "storage": "packed", + "stored": "6dc9c74599bf4ca73c551700656d4afc90eb40614a2e062720f1be8fd1dab116" + }, + { + "path": "evidence/candidate/final-core-report.json", + "bytes": 635487, + "sha256": "eb08927c2744a54f40442ce1d94ec2fb03375983590b570b6daed172e48da8a5", + "storage": "packed", + "stored": "eb08927c2744a54f40442ce1d94ec2fb03375983590b570b6daed172e48da8a5" + }, + { + "path": "evidence/independent/verify_finite233.py", + "bytes": 8501, + "sha256": "a94158ddea7f8ab4b2090b72d3736a90badb4d363821ab235df64f57316e7bd2", + "storage": "plain", + "stored": "src/evidence/independent/verify_finite233.py" + }, + { + "path": "evidence/independent/RESULT.json", + "bytes": 936, + "sha256": "9f31966edd760afbc42e25a2b38e2aa6c03555e7086aa98dc4c3725686c7c326", + "storage": "packed", + "stored": "9f31966edd760afbc42e25a2b38e2aa6c03555e7086aa98dc4c3725686c7c326" + }, + { + "path": "evidence/native/NATIVE-RESULT.json", + "bytes": 300429, + "sha256": "7fd815738cfd2d5b66676c9e303995a2462e89fc206156150fe0976453048636", + "storage": "packed", + "stored": "7fd815738cfd2d5b66676c9e303995a2462e89fc206156150fe0976453048636" + }, + { + "path": "evidence/signed/RESULT.json", + "bytes": 87077, + "sha256": "366d0845d5d568e83311ebd2e70fba74620937949009fd92b5c19a2d152c5221", + "storage": "packed", + "stored": "366d0845d5d568e83311ebd2e70fba74620937949009fd92b5c19a2d152c5221" + }, + { + "path": "evidence/lineage/native-execution.json", + "bytes": 262, + "sha256": "e2ac02017294ccd6256cb4f9f038cb18583d2c8e2c0190b0c0501a0e1216b315", + "storage": "packed", + "stored": "e2ac02017294ccd6256cb4f9f038cb18583d2c8e2c0190b0c0501a0e1216b315" + }, + { + "path": "evidence/lineage/cat0-execution.json", + "bytes": 265, + "sha256": "7df7ce390fe88835b82ab1ce7eca014927e968d9676b7d2147ed65b1239a0833", + "storage": "packed", + "stored": "7df7ce390fe88835b82ab1ce7eca014927e968d9676b7d2147ed65b1239a0833" + }, + { + "path": "evidence/lineage/cat1.stdout.log", + "bytes": 1640, + "sha256": "c95e7c21c8b96491cc251a1ea607c30d4fedc4812337a629c66438d49231daa2", + "storage": "packed", + "stored": "c95e7c21c8b96491cc251a1ea607c30d4fedc4812337a629c66438d49231daa2" + } + ], + "pack_sha256": "f9cc18542163ff22c38e4549604e8c8992a5fdf5d681d5e914b9a4827daed03b", + "big_archive_sha256": "721f839cc48605cccd3629d11456e1fcbb3810a624803ad27e99a1bfd6246211" +} diff --git a/research/final233-portable-conditional/LICENSE b/research/final233-portable-conditional/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/final233-portable-conditional/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/final233-portable-conditional/NOTICE b/research/final233-portable-conditional/NOTICE new file mode 100644 index 0000000000..89a74bb47e --- /dev/null +++ b/research/final233-portable-conditional/NOTICE @@ -0,0 +1,12 @@ +Apache-2.0. Local H5B + E1/E4 combination experiment, prepared with OpenAI assistance. + +All earlier contributors and notices in hydrogen-bounded-verification-20261117/NOTICE remain credited. In particular: Ali Romman (#7605), SYLforge, Clear1nsight, DreamingOfClouds, and all upstream contributors listed there. + +Additional source techniques: +- DreamingOfClouds #7630: E1 rebirth/canceller and E4 existing-co-presence reroute. Pinned description at commit 6026e87d1cac03eb5bd2aa8524a8f5891dd9934e, research/p104-reroutes-on7623/data/edits.json. +- Clear1nsight #7631/#7633: efficient E4 integration and E1 prefix/tail settlement. Pinned #7633 source/candidate words at commit 8b885be4a553dea375303808fdfff52ed0d71019, research/p104-e1-role457-on7631/words/. +- H5B literal-frame-restored archive at SYLforge commit 25de8b50bf7ddaad4eebd34c0b01aa11294c9337, canonical ad56c629ac587510aa59ad13fde7db3f38e08d4fc09beb70fbb839a8de17b41d. + +The joint E4 rank-one settlement is re-derived for the actual H5B+E1 program. The dependency-ideal peak restoration and proved-zero lifetime join are local construction steps, not claims that upstream supplied or verified this combined word. + +No external publication, push, PR or upload is part of this artifact. diff --git a/research/final233-portable-conditional/PROVENANCE.md b/research/final233-portable-conditional/PROVENANCE.md new file mode 100644 index 0000000000..c69cb0aa5c --- /dev/null +++ b/research/final233-portable-conditional/PROVENANCE.md @@ -0,0 +1,5 @@ +# Source and packaging + +The retained scientific Python files under src/ are byte-identical copies of the earlier candidate-specific portable package. DATA-MANIFEST.json records every materialized input's original path, byte count and SHA-256. Identical data bytes are stored once. The #7334 archive is sourced externally at its pinned public commit and checked before materialization. + +This package changes the packaging and entry point. It does not change upstream scientific engines or relax their checks. The earlier untrimmed artifact is retained outside this submission. Historical execution receipts remain author evidence; they are not reruns of this compact wrapper. Attribution and inherited license obligations are retained in NOTICE, LICENSE and the materialized source files. diff --git a/research/final233-portable-conditional/README.md b/research/final233-portable-conditional/README.md new file mode 100644 index 0000000000..346e3b86df --- /dev/null +++ b/research/final233-portable-conditional/README.md @@ -0,0 +1,40 @@ +# P104: 233-CLEAR conditional composition + +This research combines the frame-restored H5B construction with the E1/E4 changes from the cited follow-up work. Under the conditions in CONDITIONS.md, the directed interval result supports **κ ≥ 0.0037**. This is not a selected-frontier update or unconditional multiplier theorem. + +The final word contains 78,596 events, 233 nonzero CLEARs, peak live stock 50 and 52 used labels. All 68 reserved labels and 1,156 signed banks remain charged. The canonical JSON SHA-256 is `8ab3d9dbe2e2e24202ac96c6122b010b3e7980912f935cc0cc2db2e9d85f83aa`. The changed entrance `initial[457]: 3 -> 281` is explicit. + +## Layout and reproduction + +Scientific Python sources remain visible under src/. Large immutable inputs and retained evidence are deduplicated by hash inside data/inputs.tar.gz; DATA-MANIFEST.json maps each original path to its exact bytes and SHA-256. It is a data pack, not a new scientific verifier. Operational sample logs and duplicate copies are not included. LICENSE and NOTICE retain attribution. + +The pre-existing #7334 closure archive is deliberately not vendored again. Download the exact public file from: +https://raw.githubusercontent.com/rohanarun/integer-mult-bounds/58a9d052143f5d85295ed2d0163591c47f89a331/research/p104-helper-449-fused-return/inputs/pr7334.tar.gz + +Expected SHA-256: `721f839cc48605cccd3629d11456e1fcbb3810a624803ad27e99a1bfd6246211`; Git blob `e69e784c1edeeffe330a78c579aed210cd8815ff`. This introduces a network/source-availability dependency, or use an existing local copy with the same hash. + +With Python 3.12, from the repository root: + +```sh +python3.12 -I -B research/final233-portable-conditional/replay.py integrity +python3.12 -I -B research/final233-portable-conditional/replay.py materialize --upstream-archive /path/to/pr7334.tar.gz --work /path/to/new-work +python3.12 -I -B research/final233-portable-conditional/replay.py reconstruct --upstream-archive /path/to/pr7334.tar.gz --work /path/to/another-new-work +``` + +Integrity without the external archive explicitly reports EXTERNAL_NOT_CHECKED. The work directory must be new. The original native, signed and optional scalar execution routes are exposed as `native`, `signed`, and `optional-scalar` modes with the same arguments. A timeout does not prove a mathematical failure. Use an appropriate process-tree resource supervisor. Do not use Python -O/-OO. + +## Evidence and limits + +See VALIDATION.md. Earlier candidate-adapted native and signed results are author evidence, not new executions of this repackaging. Signed coverage comprised 3,060 maps, with 2,000 guarded cached results and 1,060 newly executed. The independently authored finite audit checked 233 recoverability identities and 932 targeted mutation predicates. It is not a physical reset proof. + +The inherited five framework assumptions remain, together with the stated common-U supplier and its entrance, extent, reset, residual and cost obligations. An implementation satisfying those obligations has not been established. Different researchers may use their own verifiers; the candidate hash binds this candidate, not a project-wide acceptance gate. + +## Credit and next work + +Credit Ali Romman/#7605, SYLforge/H5B, DreamingOfClouds/#7630, Clear1nsight/#7631/#7633 and #7626, Rohan Arun and all retained upstream contributors. Substantial OpenAI assistance was used. Further review should first test the changed entrance and a concrete supplier's whole-extent/reset/tariff contract as described in CONDITIONS.md; the blocker is the absence of an admitted supplier. + +## Open next questions + +1. Can a concrete common-U supplier satisfy the changed entrance and all 233 lifetime histories? First inspect the whole-private-extent, nonaliasing return and reset obligations in CONDITIONS.md. Blocker: no admitted supplier has been established. +2. Can the scalar service handle the reachable residual domain at the retained tariff? First audit events 45330/45331 and the ADD return-domain comparison. Blocker: actual implementation error, cost and space bounds are missing. +3. Can an independent reviewer replay the combined word and signed application? First materialize the pinned inputs and run the reconstruction route, then review the candidate-specific adapters. Blocker: independent scientific replay has not been completed. diff --git a/research/final233-portable-conditional/SOURCES.json b/research/final233-portable-conditional/SOURCES.json new file mode 100644 index 0000000000..acafa5fee9 --- /dev/null +++ b/research/final233-portable-conditional/SOURCES.json @@ -0,0 +1,19 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + } + ], + "retained_exports": "Runtime data are losslessly packed with per-object SHA256; scientific scripts remain reviewable." +} diff --git a/research/final233-portable-conditional/TASK.json b/research/final233-portable-conditional/TASK.json new file mode 100644 index 0000000000..2eb4e97d9b --- /dev/null +++ b/research/final233-portable-conditional/TASK.json @@ -0,0 +1,129 @@ +{ + "schema_version": 1, + "task_id": "p104-side-correction", + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "priority_revision": 8, + "original_card": { + "id": "p104-side-correction", + "question": "Can joint helper bases and a legal causal split improve the complete P104 productive/paid invoice?", + "starting_points": [ + "docs/research/current-priorities.md", + "docs/research/research-family-status.md", + "certificates/selected-result.json", + "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "research/p104-helper-subspace-splits/README.md", + "research/dyadic-helper-channel-capacity/README.md" + ], + "methods": [ + "Construct and independently check one source-bound instance of the stated first experiment.", + "Seek an exact counterexample or target-specific complete-budget obstruction to that same proposed change." + ], + "acceptance_gate": "An exact arbitrary-input identity, source/target frame availability and restoration at the chosen cut, plus the complete channel+correction+idle/hosting bill or an explicit favorable bound. The native channel alone is not a supplier. A scoped local result may be retained without a complete supplier. Expanding it into further construction rounds requires the family-level budget and obligation gate in research-family-status.md; an optimistic passing relaxation alone is not acceptance.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read revision 8, the selected review and live exact-source handoffs. Then follow this card's bounded first_experiment.", + "scope": "Source-bound orientation only, not a supplier replay or theorem proof." + }, + "first_experiment": "Start with the selected #5599 emitted word and review pending #5718 distinct input/output bases plus #5717/#5719 coverage before claiming work. Pick one uncovered source word, helper group and cut region. Prove the arbitrary-input relation and legal entry/exit corrections, then compare full target and paid profiles. Reject if completion, owned lifetimes or consumer costs repay the gain. A static pairing rank alone is not a physical split.", + "bottleneck_link": "Judge the actual current supplier contract and complete signed target/paid bill; frozen-profile ceilings require an applicability proof.", + "allowed_variations": [ + "One exact source head, helper/cut region or quantified proposition and changed hypothesis; check live handoffs first. Different seeds are not different scopes." + ], + "scope_change_triggers": [ + "Changing source head, helper/cut domain, operation alphabet or caller boundary without recording the new scope.", + "Treating an archived proposal or local numerical pass as complete supplier admission." + ], + "overlap_terms": [ + "P104", + "helper basis", + "helper split", + "5718", + "dyadic capacity" + ], + "existing_checks": [ + { + "scope": "PR #4133: literal-slot defect", + "evidence": "research/p104-literal-slot-defect/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "88666f1dee93fbd85b31fd5d6f91a219e111b5f4", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4136: uniform commutation gap", + "evidence": "research/p104-uniform-commutation-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "281ce601a8be9db470de630759179c23e1dfaa88", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4140: uniform encoding gap", + "evidence": "research/p104-uniform-encoding-gap/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "de25c6525aa866962309df5d107b32d55e6e5628", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4153: source-chart shortcut exhausts its optimistic allowance", + "evidence": "research/p104-source-chart-shortcut/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "9123241fea53df77e51ffe30d9aca1625d4bf3a8", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "PR #4154: fiber-tag seam mismatch", + "evidence": "research/p104-fiber-tag-seam/README.md", + "remaining": "Independently validate the stated scope or change its producer/consumer premise and pay the complete boundary.", + "status": "author-checked", + "source_commit": "4ffcdaee5d6255a9cea1fe53a5424435068089d0", + "selected_record_sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "scope": "Selected PR5599: complete helper-subspace construction and independent caller replay; five framework assumptions remain.", + "evidence": "docs/research/pr-intake-evidence/pr5599-completion/PROOF-REVIEW.md", + "remaining": "The next experiment must identify uncovered source-specific work. Successor archive intake does not transfer this admission.", + "status": "reviewed", + "source_commit": "09dd0965711ca7eeb169057a420abab1c9052137", + "selected_record_sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + } + ] + }, + "scope_status": "changed", + "actual_scope": "Preserve and port the fixed final233 H5B/E1/E4 conditional application for independent review.", + "scope_change_reason": "Explicit owner assignment uses the acquired final233 inputs, not a new task-picker construction.", + "bottleneck_link": "P104 complete signed invoice and unresolved common-U/scalar/provider admission.", + "budget_minutes": 60, + "stop_rule": "Scoped compact reconstruction package; no selected-frontier change.", + "outcome": "partial", + "evidence": "DATA-MANIFEST.json; VALIDATION.md; CONDITIONS.md", + "author": "SYLforge", + "ai_assistance": "Substantial OpenAI Codex assistance. Requested GPT-6.1 Sol xhigh; actual runtime model unverified. Initial candidate model unverified.", + "open_questions": [ + { + "question": "Can one implementation satisfy the changed entrance and common-U contract?", + "why_it_matters": "The conditional scalar result is not provider admission.", + "first_step": "Review initial457=281, whole private extent, residual return and nonaliasing against CONDITIONS.md.", + "blocked_by": "No complete admitted provider or recursive lowering has been supplied." + }, + { + "question": "Can exact-return scalar services or a total rounded alternative meet the retained tariff?", + "why_it_matters": "A one-tick MOVE defect can leave ADD(-1/2) outside an exact scalar service domain.", + "first_step": "Audit events45330/45331 and the conditional tariff comparison in CONDITIONS.md.", + "blocked_by": "Need input-domain, error, finite cost and space bounds for one actual implementation." + }, + { + "question": "Can another researcher independently replay and review the exact combined word?", + "why_it_matters": "Existing mathematical execution receipts are author evidence, not independent acceptance.", + "first_step": "Use the offline commands in README.md; inspect the path diff and source-original rejection.", + "blocked_by": "Independent reviewer time and an appropriate isolated resource envelope." + } + ] +} diff --git a/research/final233-portable-conditional/VALIDATION.md b/research/final233-portable-conditional/VALIDATION.md new file mode 100644 index 0000000000..4001c64ea7 --- /dev/null +++ b/research/final233-portable-conditional/VALIDATION.md @@ -0,0 +1,11 @@ +# Validation scope + +- Candidate-adapted native: prior author execution exit 0, 432.298 s. +- Signed application: prior integrated execution exit 0, 191.156 s; 3,060 maps, of which 2,000 guarded cached maps and 1,060 newly executed. +- Independently authored finite scalar audit: prior exit 0; 233 CLEAR identities and 932 targeted mutation predicates. +- Original portable preflight: separate-location reconstruction exit 0, 53.329 s, 78,596 events and canonical hash match. +- Compact package: local data integrity check passed; 61 inputs materialized with exact SHA-256 before removal of two unrelated supervision receipts; 59 retained inputs are now bound. External #7334 archive identity independently matched its public Git blob. +- This compact wrapper has not yet rerun scientific native or signed stages. Earlier receipts are reused, not represented as fresh runs. +- No independent human or formal-kernel review, physical provider admission, or selected-frontier acceptance is claimed. + +- Compact reconstruction: exit 0 in 66.516 s, 78,596 events and canonical hash matched; no full native or signed scientific rerun. After that run only two unrelated supervision receipts were removed from the pack. diff --git a/research/final233-portable-conditional/VERIFY.json b/research/final233-portable-conditional/VERIFY.json new file mode 100644 index 0000000000..98f53402a8 --- /dev/null +++ b/research/final233-portable-conditional/VERIFY.json @@ -0,0 +1,14 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [], + "commands": [ + { + "argv": ["{python}", "-I", "-B", "{package}/replay.py", "integrity"], + "timeout_seconds": 120, + "checks": "Local compact package custody only; external source and scientific replay are separate." + } + ] +} diff --git a/research/final233-portable-conditional/data/inputs.tar.gz b/research/final233-portable-conditional/data/inputs.tar.gz new file mode 100644 index 0000000000..af9c6bb123 Binary files /dev/null and b/research/final233-portable-conditional/data/inputs.tar.gz differ diff --git a/research/final233-portable-conditional/replay.py b/research/final233-portable-conditional/replay.py new file mode 100644 index 0000000000..5b16681d41 --- /dev/null +++ b/research/final233-portable-conditional/replay.py @@ -0,0 +1,146 @@ +"""Verify and materialize the compact final233 inputs without modifying source.""" +import argparse +import hashlib +import json +import os +import shutil +import subprocess +import sys +import tarfile +import tempfile +from pathlib import Path, PurePosixPath + +HERE = Path(__file__).resolve().parent +FULL = Path("research/h5b-combination-20261117/sol-analysis/full-wrapper") +NATIVE = FULL / "work/producer54/validation_native" +SIGNED = FULL / "work/producer54/validation_signed" + +def need(condition, message): + if not condition: + raise ValueError(message) + +def digest(data): + return hashlib.sha256(data).hexdigest() + +def safe(root, relative): + p = PurePosixPath(relative) + need(relative and not p.is_absolute() and ".." not in p.parts + and "\\" not in relative and ":" not in relative and p.as_posix() == relative, + "unsafe path") + out = root.joinpath(*p.parts) + need(out.resolve().is_relative_to(root.resolve()), "path escapes root") + need(not any(part.is_symlink() for part in (out, *out.parents) if part.exists()), "symlink") + return out + +def check(upstream_archive=None): + manifest = json.loads((HERE / "DATA-MANIFEST.json").read_text(encoding="utf-8")) + pack = (HERE / "data/inputs.tar.gz").read_bytes() + need(digest(pack) == manifest["pack_sha256"], "data pack hash") + if upstream_archive is not None: + need(digest(upstream_archive.read_bytes()) == manifest["big_archive_sha256"], + "upstream archive hash") + objects = {} + with tarfile.open(HERE / "data/inputs.tar.gz", "r:gz") as archive: + for member in archive: + need(member.isfile() and member.name.startswith("objects/"), "unexpected archive member") + key = member.name.removeprefix("objects/") + need(len(key) == 64 and all(c in "0123456789abcdef" for c in key) + and key not in objects, "invalid or duplicate object") + fileobj = archive.extractfile(member) + need(fileobj is not None, "missing data object") + data = fileobj.read() + need(digest(data) == key, "packed object hash") + objects[key] = data + seen = set() + used = set() + missing_external = False + for item in manifest["entries"]: + name = item["path"] + safe(HERE, name) + need(name.casefold() not in seen, "duplicate path") + seen.add(name.casefold()) + if item["storage"] == "packed": + key = item["stored"] + need(key in objects, "missing packed object") + raw = objects[key] + used.add(key) + elif item["storage"] == "external": + if upstream_archive is None: + missing_external = True + continue + raw = upstream_archive.read_bytes() + else: + need(item["storage"] == "plain", "invalid storage") + raw = safe(HERE, item["stored"]).read_bytes() + need(len(raw) == item["bytes"] and digest(raw) == item["sha256"], "input mismatch: " + name) + need(used == set(objects), "unreferenced object") + return manifest, objects, missing_external + +def materialize(work, manifest, objects, upstream_archive): + work = work.resolve() + need(not work.exists() and not work.is_relative_to(HERE) and not HERE.is_relative_to(work), + "work must be new and separate") + work.mkdir(parents=True, exist_ok=False) + for item in manifest["entries"]: + original = item["path"] + if original.startswith("runtime/"): + relative = original.removeprefix("runtime/") + elif original.startswith("evidence/"): + relative = "_evidence/" + original.removeprefix("evidence/") + else: + raise ValueError("unexpected materialization root") + out = safe(work, relative) + out.parent.mkdir(parents=True, exist_ok=True) + if item["storage"] == "packed": + raw = objects[item["stored"]] + elif item["storage"] == "external": + need(upstream_archive is not None, "supply --upstream-archive") + raw = upstream_archive.read_bytes() + else: + raw = safe(HERE, item["stored"]).read_bytes() + with out.open("xb") as stream: + stream.write(raw) + need(digest(out.read_bytes()) == item["sha256"], "materialization mismatch") + return work + +def main(): + need(__debug__, "do not run with -O/-OO") + parser = argparse.ArgumentParser() + parser.add_argument("mode", choices=("integrity", "materialize", "reconstruct", "native", "signed", "optional-scalar")) + parser.add_argument("--work", type=Path) + parser.add_argument("--timeout", type=int, default=570) + parser.add_argument("--upstream-archive", type=Path) + args = parser.parse_args() + manifest, objects, missing_external = check(args.upstream_archive) + if args.mode == "integrity": + print("PASS_LOCAL_PACKAGE_INTEGRITY_ONLY", len(manifest["entries"]), + "EXTERNAL_NOT_CHECKED" if missing_external else "EXTERNAL_VERIFIED") + return + need(not missing_external, "supply the pinned --upstream-archive before materialization") + need(args.work is not None and 1 <= args.timeout <= 570, "new --work and bounded timeout required") + work = materialize(args.work, manifest, objects, args.upstream_archive) + if args.mode == "materialize": + print("PASS_EXACT_BYTE_MATERIALIZATION", len(manifest["entries"])) + return + if args.mode == "optional-scalar": + argv = [sys.executable, "-I", "-B", str(work / "_evidence/independent/verify_finite233.py"), + "--snapshot", str(work / "_evidence/candidate"), "--output", str(work / "FINITE-RESULT.json")] + else: + target = {"reconstruct": NATIVE / "reconstruction_preflight.py", + "native": NATIVE / "run.py", "signed": SIGNED / "run.py"}[args.mode] + argv = [sys.executable, "-I", "-B", str(work / FULL / "macos_py39_shim.py"), str(work / target)] + env = dict(os.environ) + env.pop("PYTHONOPTIMIZE", None) + with tempfile.TemporaryDirectory(prefix="f233-") as temp: + env.update(TMP=temp, TEMP=temp, TMPDIR=temp, PYTHONDONTWRITEBYTECODE="1") + with (work / "REPLAY.stdout.log").open("xb") as out: + result = subprocess.run(argv, cwd=work, env=env, stdout=out, stderr=subprocess.STDOUT, + timeout=args.timeout, check=False) + record = {"mode": args.mode, "returncode": result.returncode, "stdout_sha256": + digest((work / "REPLAY.stdout.log").read_bytes())} + (work / "REPLAY.json").write_text(json.dumps(record, indent=2) + "\n", encoding="utf-8") + need(result.returncode == 0, "replay failed; inspect REPLAY.stdout.log") + print(json.dumps(record, sort_keys=True)) + +if __name__ == "__main__": + main() diff --git a/research/final233-portable-conditional/src/evidence/independent/verify_finite233.py b/research/final233-portable-conditional/src/evidence/independent/verify_finite233.py new file mode 100644 index 0000000000..229da06fb5 --- /dev/null +++ b/research/final233-portable-conditional/src/evidence/independent/verify_finite233.py @@ -0,0 +1,173 @@ +"""Independent finite scalar-model audit. Reads inputs; writes only stdout. + +This is NOT a proof of physical reset, tariff, compiler, common-U, or precision. +MOVE is identity in conjugated scalar coordinates. INIT creates zero; CLEAR +discards the owned row. Certificates must use OTHER currently live fields. +Run without -O: assertions are intentional fail-closed verification checks. +""" +import argparse +import gzip +import hashlib +import json +import math +from fractions import Fraction +from pathlib import Path + +PIN = '8ab3d9dbe2e2e24202ac96c6122b010b3e7980912f935cc0cc2db2e9d85f83aa' +OUTPUT_PIN = '6133019f0d26e96e2afd15e89d69204350126334c1cf9eb895bfb671a3a66135' +GRID = 1125 * 2**25 + +def digest(b): + return hashlib.sha256(b).hexdigest() + +def canonical(x): + return json.dumps(x, sort_keys=True, separators=(',', ':')).encode() + +def require(ok, message): + if not ok: + raise ValueError(message) + +def scaled(row, q): + result = {} + for col, value in row.items(): + value, rem = divmod(value * q.numerator, q.denominator) + require(rem == 0, 'nonintegral intermediate on exact grid') + if value: + result[col] = value + return result + +def certificate_valid(coeffs, target, rows, live, erased): + if not coeffs or erased in coeffs or any(k not in live for k in coeffs): + return False + denominator = 1 + for q in coeffs.values(): + denominator = math.lcm(denominator, q.denominator) + result = {} + for k, q in coeffs.items(): + integer = q.numerator * (denominator // q.denominator) + for col, v in rows[k].items(): + value = result.get(col, 0) + integer * v + if value: + result[col] = value + else: + result.pop(col, None) + return result == {k: denominator*v for k,v in target.items()} + +def metadata_matches(c, index, event, field, chart): + return (c['clear_index'], c['event'], c['field'], c['chart']) == (index, event, field, chart) + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument('--snapshot', type=Path, required=True) + ap.add_argument('--output', type=Path, required=True, help='New receipt file; must not exist') + args = ap.parse_args() + require(not args.output.exists(), 'refusing to overwrite output') + raw_word = (args.snapshot/'word-joint-final.json.gz').read_bytes() + raw_certs = (args.snapshot/'certs-joint-final.json').read_bytes() + word = json.loads(gzip.decompress(raw_word)) + package = json.loads(raw_certs) + require(digest(canonical(word)) == PIN, 'wrong candidate') + require(package['candidate'] == PIN, 'certificate candidate mismatch') + certs = package['clears'] + require(len(certs) == 233, 'certificate count') + n = word['public'] + total = n + word['owned_fields'] + require(len(word['initial']) == n, 'initial charts length') + rows = [{r: GRID} if r < n else {} for r in range(total)] + charts = list(word['initial']) + [None]*word['owned_fields'] + live = set(range(n)) + opened = {} + checked = peak = 0 + checks = {'coefficient_plus_one': 0, 'coefficient_deleted': 0, + 'self_reference': 0, 'cleared_field_metadata': 0} + owned_certificate_terms = 0 + for event, e in enumerate(word['program']): + op, r = e[:2] + require(type(r) is int and 0 <= r < total, 'field out of bounds') + if op == 'INIT': + require(r >= n and r not in live and not rows[r], 'invalid INIT') + live.add(r) + charts[r] = e[2] + opened[r] = (event, e[2], []) + peak = max(peak, len(opened)) + elif op == 'CLEAR': + require(r in opened and r in live and charts[r] == e[2], 'invalid CLEAR') + require(checked < len(certs), 'missing certificate') + c = certs[checked] + require(metadata_matches(c, checked, event, r, e[2]), 'certificate event/field/chart mismatch') + require(c['dim'] == len(word['frames'][e[2]]), 'certificate dimension mismatch') + start, chart, moves = opened[r] + require((c['init_event'], c['init_chart'], c['owned_moves']) == (start, chart, moves), 'certificate lifetime mismatch') + target = rows[r] + require(bool(target), 'unexpected zero CLEAR') + erased = {int(k): Fraction(v) for k,v in c['erased'].items()} + require(erased == {k: Fraction(v, GRID) for k,v in target.items()}, 'erased row mismatch') + require(c['erased_support'] == len(target), 'support mismatch') + coeffs = {int(k): Fraction(v) for k,v in c['certificate'].items()} + require(all(0 <= k < n for k in coeffs), 'final certificate must use public fields only') + require(c['terms'] == len(coeffs), 'terms mismatch') + require(certificate_valid(coeffs, target, rows, live, r), 'certificate identity or live-other-field violation') + owned_certificate_terms += sum(k >= n for k in coeffs) + # Independently exercise every certificate, not just the first one. + k = next(k for k,q in coeffs.items() if q and rows[k]) + bad = dict(coeffs); bad[k] += 1 + require(not certificate_valid(bad, target, rows, live, r), 'coefficient mutation accepted') + checks['coefficient_plus_one'] += 1 + bad = dict(coeffs); del bad[k] + require(not certificate_valid(bad, target, rows, live, r), 'deleted coefficient accepted') + checks['coefficient_deleted'] += 1 + require(not certificate_valid({r: Fraction(1)}, target, rows, live, r), 'self-reference accepted') + checks['self_reference'] += 1 + bad_metadata = dict(c); bad_metadata['field'] = (r + 1) % total + require(not metadata_matches(bad_metadata, checked, event, r, e[2]), 'cleared-field metadata mutation accepted') + checks['cleared_field_metadata'] += 1 + checked += 1 + rows[r] = {} + charts[r] = None + live.remove(r) + del opened[r] + print(json.dumps({'progress_clear': checked, 'event': event}), flush=True) + elif op == 'MOVE': + require(r in live and charts[r] == e[2] and bool(e[4]) == (r >= n), 'invalid MOVE') + charts[r] = e[3] + if r >= n: + opened[r][2].append([event, e[2], e[3]]) + elif op in ('SCALE', 'ADD', 'COPY'): + s = r if op == 'SCALE' else e[2] + require(r in live and s in live and charts[r] == charts[s] == e[-1], 'inactive or chart-mismatched arithmetic') + require(op == 'SCALE' or s != r, 'aliasing arithmetic') + q = Fraction(e[2] if op == 'SCALE' else e[3]) + require(q != 0, 'zero coefficient') + update = scaled(rows[s], q) + if op == 'ADD': + for k,v in update.items(): + value = rows[r].get(k, 0) + v + if value: + rows[r][k] = value + else: + rows[r].pop(k, None) + else: + require(op != 'COPY' or not rows[r], 'COPY to nonzero destination') + rows[r] = update + else: + raise ValueError('unknown opcode ' + str(op)) + require(checked == 233 and not opened and live == set(range(n)), 'final lifetime mismatch') + require(charts[:n] == word['final'], 'final charts mismatch') + require(peak == 50, 'peak mismatch') + final = [{str(k): v for k,v in sorted(row.items())} for row in rows[:n]] + output_hash = digest(canonical(final)) + require(output_hash == OUTPUT_PIN, 'final public linear output mismatch') + receipt = {'status': 'PASS_INDEPENDENT_FINITE233', 'candidate': PIN, + 'word_file_sha256': digest(raw_word), 'cert_file_sha256': digest(raw_certs), + 'script_sha256': digest(Path(__file__).read_bytes()), 'exact_grid': GRID, + 'verified_nonzero_clears': checked, 'owned_peak': peak, + 'negative_controls_rejected': checks, 'owned_certificate_terms': owned_certificate_terms, + 'public_output_scaled_hash': output_hash, + 'scope': 'Exact scalar projection and other-live-field recoverability; no physical reset, pricing, compiler, precision, or common-U proof.'} + with args.output.open('x', encoding='utf-8') as handle: + json.dump(receipt, handle, indent=2, sort_keys=True) + handle.write('\n') + print(json.dumps(receipt, sort_keys=True), flush=True) + +if __name__ == '__main__': + main() diff --git a/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/macos_py39_shim.py b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/macos_py39_shim.py new file mode 100644 index 0000000000..e04d57b4c4 --- /dev/null +++ b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/macos_py39_shim.py @@ -0,0 +1,209 @@ +"""In-memory macOS + Python 3.9 compatibility shim for #7605 clean launcher subprocesses. + +Preserves all on-disk files and SHA-256 pin checks untouched; applies only: + 1. `source.py` Windows path separator fix (`str(arc.relative_to(HERE))` -> `arc.relative_to(HERE).as_posix()`), + 2. Python 3.9 `int.bit_count()` -> `bin(...).count("1")` at `builtins.compile` time, + 3. Propagates itself across child `subprocess.run` / `subprocess.check_output` Python invocations, +logging every in-memory adaptation to `py39-shim-adaptations.jsonl` inside this folder. +""" +from __future__ import annotations + +import builtins +import hashlib +import importlib.machinery +import itertools +import json +from pathlib import Path +import runpy +import subprocess +import sys + +SELF = Path(__file__).resolve() +LOG = SELF.parent / "py39-shim-adaptations.jsonl" +KNOWN_SOURCE_PY = "35a3a38c6fe57cfb703a57a0382ef6f6b738131753b5fb5b97a68185b82994e1" + +_ORIG_COMPILE = builtins.compile +_ORIG_GET_CODE = importlib.machinery.SourceFileLoader.get_code +_ORIG_RUN = subprocess.run +_ORIG_CHECK_OUTPUT = subprocess.check_output +_ORIG_ZIP = builtins.zip +_ZIP_SENTINEL = object() + + +def _py310_zip(*iterables, strict=False): + if not strict: + return _ORIG_ZIP(*iterables) + if not iterables: + return iter(()) + iters = [iter(it) for it in iterables] + + def _strict_gen(): + while True: + row = [next(it, _ZIP_SENTINEL) for it in iters] + n_end = sum(1 for x in row if x is _ZIP_SENTINEL) + if n_end == 0: + yield tuple(row) + elif n_end == len(iters): + return + else: + raise ValueError("zip() argument lengths differ (strict=True)") + + return _strict_gen() + + +builtins.zip = _py310_zip + +if not hasattr(itertools, "pairwise"): + def _pairwise(iterable): + a, b = itertools.tee(iterable) + next(b, None) + return _ORIG_ZIP(a, b) + + itertools.pairwise = _pairwise + + +def _rewrite_bit_count(src: str) -> str: + needle = ".bit_count()" + if needle not in src: + return src + cur = src + while True: + pos = cur.find(needle) + if pos == -1: + break + i = pos - 1 + while i >= 0: + ch = cur[i] + if ch in ")]": + close_ch = ch + open_ch = "(" if ch == ")" else "[" + depth = 1 + i -= 1 + while i >= 0 and depth > 0: + if cur[i] == close_ch: + depth += 1 + elif cur[i] == open_ch: + depth -= 1 + i -= 1 + elif ch.isalnum() or ch in "_.": + i -= 1 + else: + break + start = i + 1 + expr = cur[start:pos] + if not expr: + break + cur = cur[:start] + f'bin({expr}).count("1")' + cur[pos + len(needle):] + return cur + + +def _log_adapt(kind: str, filename: str, before_sha: str, after_sha: str) -> None: + try: + with LOG.open("a", encoding="utf-8") as f: + f.write(json.dumps({ + "kind": kind, + "filename": filename, + "before_sha256": before_sha, + "after_sha256": after_sha, + }) + "\n") + except Exception: + pass + + +def _hooked_compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1, **kw): + if isinstance(source, (str, bytes)): + is_bytes = isinstance(source, bytes) + text = source.decode("utf-8") if is_bytes else source + if ".bit_count()" in text: + adapted = _rewrite_bit_count(text) + if adapted != text: + _log_adapt( + "bit_count_py39", + str(filename), + hashlib.sha256(text.encode("utf-8")).hexdigest(), + hashlib.sha256(adapted.encode("utf-8")).hexdigest(), + ) + source = adapted.encode("utf-8") if is_bytes else adapted + return _ORIG_COMPILE(source, filename, mode, flags=flags, dont_inherit=dont_inherit, optimize=optimize, **kw) + + +builtins.compile = _hooked_compile + + +def _hooked_get_code(self, fullname): + path = Path(self.path) + if path.name == "source.py": + raw = path.read_bytes() + h = hashlib.sha256(raw).hexdigest() + if h == KNOWN_SOURCE_PY: + src = raw.decode("utf-8") + before = "str(arc.relative_to(HERE))" + after = "arc.relative_to(HERE).as_posix()" + assert src.count(before) == 1 + adapted = _rewrite_bit_count(src.replace(before, after)) + _log_adapt("source_py_posix", str(path), h, hashlib.sha256(adapted.encode("utf-8")).hexdigest()) + return _ORIG_COMPILE(adapted, str(path), "exec") + raw_p = Path(self.path) + if raw_p.is_file() and raw_p.suffix == ".py": + raw_b = raw_p.read_bytes() + try: + txt = raw_b.decode("utf-8") + except UnicodeDecodeError: + return _ORIG_GET_CODE(self, fullname) + if ".bit_count()" in txt: + adapted = _rewrite_bit_count(txt) + _log_adapt( + "loader_bit_count_py39", + str(raw_p), + hashlib.sha256(raw_b).hexdigest(), + hashlib.sha256(adapted.encode("utf-8")).hexdigest(), + ) + return _ORIG_COMPILE(adapted, str(raw_p), "exec") + return _ORIG_GET_CODE(self, fullname) + + +importlib.machinery.SourceFileLoader.get_code = _hooked_get_code + + +def _inject_shim(args): + if isinstance(args, (list, tuple)) and len(args) >= 2 and str(args[0]) == sys.executable: + out = list(args) + for i, x in enumerate(out[1:], 1): + sx = str(x) + if sx.endswith(".py"): + if Path(sx).resolve() != SELF: + out.insert(i, str(SELF)) + break + return out + return args + + +def _hooked_run(args, *a, **kw): + return _ORIG_RUN(_inject_shim(args), *a, **kw) + + +def _hooked_check_output(args, *a, **kw): + return _ORIG_CHECK_OUTPUT(_inject_shim(args), *a, **kw) + + +subprocess.run = _hooked_run +subprocess.check_output = _hooked_check_output + + +if __name__ == "__main__": + target = Path(sys.argv[1]).resolve() + sys.argv = sys.argv[1:] + sys.path.insert(0, str(target.parent)) + src_txt = target.read_text(encoding="utf-8") + if ".bit_count()" in src_txt: + adapted_main = _rewrite_bit_count(src_txt) + _log_adapt( + "main_bit_count_py39", + str(target), + hashlib.sha256(src_txt.encode("utf-8")).hexdigest(), + hashlib.sha256(adapted_main.encode("utf-8")).hexdigest(), + ) + globs = {"__name__": "__main__", "__file__": str(target), "__builtins__": builtins} + exec(_ORIG_COMPILE(adapted_main, str(target), "exec"), globs) + else: + runpy.run_path(str(target), run_name="__main__") diff --git a/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/construct.py b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/construct.py new file mode 100644 index 0000000000..76b76b5a06 --- /dev/null +++ b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/construct.py @@ -0,0 +1,86 @@ +"""Materialize an exact local multi-peer bypass nomination.""" +from pathlib import Path +from fractions import Fraction as Q +from copy import deepcopy +from collections import Counter +import json,gzip,sys +from hashlib import sha256 +SOURCE='9aa8d6b054ba7eb2289d052c1079b16be518d2f0fbfb244569fa18e3733acdac' +HERE=Path(__file__).resolve().parent + +def construct(old,h=None): + if h is None:h=json.loads((HERE/"WITNESS.json").read_text()) + assert sha256(json.dumps(old,sort_keys=True,separators=(",",":")).encode()).hexdigest()==SOURCE + p=old['program'];n=old['public'];r=h['role'];a,f,b=h['low'],h['middle'],h['high'];clock=h['clock'];block=h['block'];touched=set(h['touched']);skip=set(block) + v={int(q):Q(x)for q,x in h['ingress'].items()};d={int(q):Q(x)for q,x in h['delta'].items()};inv={int(q):Q(x)for q,x in h['inverse'].items()} + out=deepcopy(old);active=old['initial']+[None]*old['owned_fields'];tape=[] + def span(b): + s={0} + for x in b:s|={x^y for y in tuple(s)} + return s + spaces=list(map(span,old['frames'])) + def append(e): + op,q=e[:2] + if op=='MOVE': + x,y,o=e[2:];assert active[q]==x and o==(q>=n)and(spaces[x]=n and active[q] is None;active[q]=e[2] + elif op=='CLEAR':assert q>=n and active[q]==e[2];active[q]=None + else: + for u in e[1:3]if op in('ADD','COPY')else[e[1]]: + if u in touched and active[u]!=e[-1]:append(['MOVE',u,active[u],e[-1],False]) + assert active[u]==e[-1] + tape.append(e) + for t,e in enumerate(p): + if t==clock: + aux=next(q for q in range(n,len(active))if active[q]is None) + for q,x in v.items():append(['ADD',q,r,str(x),a]) + append(['INIT',aux,f]) + for j in block: + event=p[j].copy() + for k in(1,2)if event[0]=='ADD'else(1,): + if event[k]==r:event[k]=aux + append(event) + append(['CLEAR',aux,f]) + # Correct non-bypassed outputs before using the inverse readout. + for q,x in d.items(): + if q!=r:append(['ADD',q,r,str(-x),b]) + if inv[r]!=1:append(['SCALE',r,str(1/inv[r]),b]) + for q,x in inv.items(): + if q!=r:append(['ADD',r,q,str(-x/inv[r]),b]) + if t in skip or e[0]=='MOVE'and e[1]in touched:continue + append(e) + for q in touched: + if active[q]!=old['final'][q]:append(['MOVE',q,active[q],old['final'][q],False]) + assert active==old['final']+[None]*old['owned_fields'];out['program']=tape;return out + +R,PEER,READOUT=449,1206,1477 +LOW,MIDDLE,HIGH=594,724,904 +AUX=1501 + +def local_certificate(old): + h=json.loads((HERE/'WITNESS.json').read_text());block=h['block'];touched=set(h['touched']);p=old['program'] + assert sha256(json.dumps(old,sort_keys=True,separators=(',',':')).encode()).hexdigest()==SOURCE + assert all(p[i][0]in('ADD','SCALE')and p[i][-1]==MIDDLE for i in block) + bounds={} + for r in touched: + contacts=[i for i,e in enumerate(p)if e[0]!='MOVE'and r in(e[1:3]if e[0]in('ADD','COPY')else e[1:2])] + body=[i for i in block if r in(p[i][1:3]if p[i][0]=='ADD'else p[i][1:2])] + assert [i for i in contacts if body[0]<=i<=body[-1]]==body + bounds[r]=(max((i for i in contacts if ibody[-1]),default=len(p))) + lo=max(a for a,b in bounds.values());hi=min(b for a,b in bounds.values());assert lo<=h['clock']<=hi + # Exact block image of the changed ingress direction. + x={r:Q(0)for r in touched};x[R]=-1 + for r,v in h['ingress'].items():x[int(r)]=Q(v) + for i in block: + e=p[i] + if e[0]=='ADD':x[e[1]]+=Q(e[3])*x[e[2]] + else:x[e[1]]*=Q(e[2]) + assert {r:v for r,v in x.items()if v}=={int(r):Q(v)for r,v in h['delta'].items()} + # The claimed inverse row applied to M recovers exactly the original r input. + y={r:Q(0)for r in touched};y.update({int(r):Q(v)for r,v in h['inverse'].items()}) + for i in reversed(block): + e=p[i] + if e[0]=='ADD':y[e[2]]+=Q(e[3])*y[e[1]] + else:y[e[1]]*=Q(e[2]) + assert {r:v for r,v in y.items()if v}=={R:1} + return {'block':block,'clock_range':[lo,hi],'ingress':h['ingress'],'delta':h['delta'],'inverse':h['inverse'],'charged_high_readout':READOUT} diff --git a/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/derive_grid.py b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/derive_grid.py new file mode 100644 index 0000000000..f8cb37f00b --- /dev/null +++ b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/derive_grid.py @@ -0,0 +1,36 @@ +"""Derive a finite common grid from every exact prefix row and scalar product. +Prepared for dillona with substantial OpenAI Codex assistance. Apache-2.0. +""" +from fractions import Fraction as Q +from math import lcm +from pathlib import Path +import gzip,json,sys + +def derive(word): + n=word['public'];rows=[{r:Q(1)}for r in range(n)]+[{}for _ in range(word['owned_fields'])] + denom=1;peak=Q(1);witness=None;visits=0 + def observe(row,i,kind): + nonlocal denom,peak,witness,visits + for v in row.values():denom=lcm(denom,v.denominator);visits+=1 + mass=sum(map(abs,row.values())) + if mass>peak:peak=mass;witness=[i,kind] + for i,e in enumerate(word['program']): + op,r=e[:2] + if op in('INIT','CLEAR'):rows[r]={} + elif op=='SCALE': + rows[r]={k:Q(e[2])*v for k,v in rows[r].items()};observe(rows[r],i,'scale') + elif op in('ADD','COPY'): + if op=='COPY':assert not rows[r] + product={k:Q(e[3])*v for k,v in rows[e[2]].items()};observe(product,i,'product') + row=rows[r].copy() + for k,v in product.items(): + value=row.get(k,Q(0))+v + if value:row[k]=value + else:row.pop(k,None) + rows[r]=row;observe(row,i,'stored') + odd=denom;frac=0 + while odd%2==0:odd//=2;frac+=1 + return dict(odd_scale=odd,fractional_bits=frac,unscaled_maximum_mass=str(peak),scaled_maximum_mass=str(peak*odd),mass_witness=witness,coefficient_visits=visits),rows +if __name__=='__main__': + w=json.load(gzip.open(sys.argv[1],'rt'));result,rows=derive(w) + Path(sys.argv[2]).write_text(json.dumps(result,indent=2)+'\n');print(result) diff --git a/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/source.py b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/source.py new file mode 100644 index 0000000000..6ee812aca3 --- /dev/null +++ b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/source.py @@ -0,0 +1,54 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Authenticate complete source archives and rebuild the immediate predecessor. +Source archive validation follows Clear1nsight's retained predecessor loader. +""" +from contextlib import contextmanager +from hashlib import sha1,sha256 +from pathlib import Path +from tempfile import TemporaryDirectory +import gzip,importlib.util,json,sys,tarfile +HERE=Path(__file__).resolve().parent + +def need(ok,msg): + if not ok:raise ValueError(msg) +def read(path): + raw=Path(path).read_bytes();return json.loads(gzip.decompress(raw)if raw[:2]==b'\x1f\x8b' else raw) +def canonical(x):return json.dumps(x,sort_keys=True,separators=(',',':')).encode() +def load(name,path): + s=importlib.util.spec_from_file_location(name,path);m=importlib.util.module_from_spec(s);sys.modules[name]=m;s.loader.exec_module(m);return m +@contextmanager +def archive(package): + pin=read(package/'INPUTS.json');a=package/pin['archive'] + need(sha256(a.read_bytes()).hexdigest()==pin['archive_sha256'],'Exact archive bytes') + files={r['path']:r for r in pin['files']};need(len(files)==len(pin['files']),'Unique source inventory') + with TemporaryDirectory(prefix='terminal-cut-source-') as tmp,tarfile.open(a) as tf: + root=Path(tmp);seen=set() + for member in tf: + if member.isdir():continue + name=member.name;dst=root/name + need(member.isfile() and name in files and name not in seen and dst.resolve().is_relative_to(root),'Regular in-root inventoried member') + raw=tf.extractfile(member).read();r=files[name] + need((len(raw),sha256(raw).hexdigest(),sha1(b'blob '+str(len(raw)).encode()+b'\0'+raw).hexdigest())==(r['size'],r['sha256'],r['git_blob']),'Exact source member '+name) + dst.parent.mkdir(parents=True,exist_ok=True);dst.write_bytes(raw);seen.add(name) + need(seen==set(files),'Complete source closure') + yield root/pin['prefix'] +@contextmanager +def sources(): + need(read(HERE / "INPUTS.json")["source_head"] == 'aaeec8c0acf01e99a5f331ef363a698d9c084ace', "Exact #7334 head") + with archive(HERE) as parent: + prior = load("parent_7334_source", parent / "source.py") + emit = load("parent_7334_construct", parent / "construct.py") + with prior.sources() as (vendor, audit, rank9, bundle, _, older): + word = emit.construct(older) + raw = gzip.decompress((parent / "WORD.json.gz").read_bytes()) + need(canonical(word) == raw and sha256(raw).hexdigest() == '9aa8d6b054ba7eb2289d052c1079b16be518d2f0fbfb244569fa18e3733acdac', + "Regenerate the exact #7334 word") + yield vendor, audit, rank9, bundle, parent, word + + +@contextmanager +def bundles(): + with archive(HERE) as parent: + prior = load("parent_7334_composition", parent / "source.py") + with prior.bundles() as (parts, _, temp): + yield parts, parent, temp diff --git a/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/verify_native.py b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/verify_native.py new file mode 100644 index 0000000000..e396dfec29 --- /dev/null +++ b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/inputs/pr7480/verify_native.py @@ -0,0 +1,158 @@ +"""Full changed-native operator, grid, price, envelope and physical checks. + +Retains authenticated predecessor engines and all source notices. Source-aware +verification is distinct from independent human/formal acceptance. +Rohan Arun with OpenAI Codex assistance. Apache-2.0. +Adapted to the exact causal-history two-buffer split by dillona/OpenAI Codex. +""" +from pathlib import Path +from collections import Counter +from copy import deepcopy +from fractions import Fraction as Q +from hashlib import sha256 +import sys,json,gzip,argparse,subprocess,tempfile,io,contextlib +sys.path.insert(0,str(Path(__file__).resolve().parent)) +from source import HERE,read,load,sources,canonical,need +from construct import construct +from derive_grid import derive +def normalized(x):return json.loads(json.dumps(x,default=str)) +def delta(a,b): + d=Counter(a);d.subtract(b);return {r:v for r,v in d.items() if v} +def rejects(fn): + try:fn() + except (AssertionError,ValueError):return True + raise ValueError('Corruption control accepted') +def chart_check(vendor,source,word): + C=load('step_chart_compiler',vendor/'frozen/clifford_exact.py') + V=load('step_chart_interpreter',vendor/'frozen/native_verify.py') + def pairs(w): + main=set(w['live'])|{r+112 for r in w['live']}|set(w['hosted']['X2'])|set(w['hosted']['Y2']) + return {(e[2],e[3])for e in w['program']if e[0]=='MOVE'}|{(w['initial'][r],w['final'][r])for r in range(w['public'])if r not in main} + changed=pairs(word)-pairs(source) + needed=changed|(pairs(source)-pairs(word))|{(594,724),(724,904),(594,904)} + out=[] + for a,b in sorted(needed): + ca,cb=[C.canonical_frame(9,tuple(word['frames'][f]))for f in(a,b)] + recipe,_=C.lower_child(ca.adjoint().then(cb)) + expected=V.adjoint(V.frame(word['frames'][a],9))+V.frame(word['frames'][b],9) + actual=V.recipe(recipe);V.equal(actual,expected,'Signed Pauli action and absolute phase') + need(recipe['rank']==abs(len(word['frames'][a])-len(word['frames'][b])),'Exact chart rank') + for column in range(512):need(V.state(actual,column)==V.state(expected,column),'All Gaussian columns') + bad=deepcopy(recipe);bad['left']['phase']=(bad['left']['phase']+1)%4 + need(rejects(lambda:V.equal(V.recipe(bad),expected,'wrong phase')),'Wrong phase rejected') + out.append({'pair':[a,b],'rank':recipe['rank'],'columns':512}) + return {'new_pairs':sorted(changed),'rechecked_pairs':out,'wrong_phase_rejected':True} + +def forward_endpoint(word,rows): + n=word['public'];unit=1125*2**25 + target=[{r:Q(1)}if r0,'Ordinary allowance') + gate,price=G.exact_price(vendor,archive,before,invoice,previous) + manifest=read(vendor/'INDEPENDENT-SOURCES.json');P=load('rechart_bit_binding',archive/'verify.py');P.bit_binding(I,manifest) + precision=base.precision(vendor,new,C,gate,manifest) + need(precision['word']['odd_scale_lcm']==1125 and precision['word']['dyadic_height']==25,'Fresh ingredient precision') + print('PASS full ingredient invoice, ordinary, precision, both prices and outer gates',flush=True) + charts=chart_check(vendor,old,new) + from construct import AUX, HIGH, LOW, MIDDLE, PEER, R, READOUT, local_certificate + timed_certificate = local_certificate(old) + controls = {} + for name, event in ( + ("omitted_entrance_basis", ["ADD", PEER, R, "1", LOW]), + ("omitted_exit_readout", ["ADD", R, READOUT, "-1", HIGH]), + ): + need(new["program"].count(event) == 1, "Unique new correction") + controls[name] = bool(I.native(new, mutant=new["program"].index(event))["bad_inputs"]) + bad = deepcopy(new) + i = bad["program"].index(["MOVE", R, LOW, HIGH, False]) + bad["program"][i][2] = MIDDLE + controls["wrong_move_source"] = rejects(lambda: I.native(bad)) + bad = deepcopy(new) + bad["final"][R] = MIDDLE + controls["wrong_output_frame"] = rejects(lambda: I.native(bad)) + bad = deepcopy(new) + bad["program"].remove(["INIT", AUX, MIDDLE]) + controls["omitted_chart_local_init"] = rejects(lambda: I.native(bad)) + bad = deepcopy(new) + i = bad["program"].index(["CLEAR", AUX, MIDDLE]) + bad["program"][i][1] = R + controls["public_erasure_rejected"] = rejects(lambda: I.native(bad)) + owned_check=G.module('temporal_owned_census',vendor/'retained/query-only-precision-envelope/envelopes.py',(('(life, peak, owned_count) == (54, 43, 51)','(life, peak, owned_count) == (74, 50, 68)'),)) + need(owned_check.validate_word(new)['lifetimes']==74,'Fresh exact owned census in envelope validator') + bad=deepcopy(new);bad['program']=[['INIT',AUX,MIDDLE],['CLEAR',AUX,MIDDLE]]+bad['program'] + controls['extra_uncharged_owned_lifetime']=rejects(lambda:owned_check.validate_word(bad)) + grid_engine=G.module('rechart_grid_controls',vendor/'retained/odd-native-common-grid/independent_bounds.py') + controls['insufficient_odd_grid']=rejects(lambda:grid_engine.word_run(new,375,25)) + controls['insufficient_fractional_grid']=rejects(lambda:grid_engine.word_run(new,1125,24)) + need(all(controls.values()),'All native corruption controls') + physical_checks=[] + with tempfile.TemporaryDirectory(prefix='rechart-physical-') as tmp: + path=Path(tmp)/'word.json.gz';path.write_bytes(gzip.compress(canonical(new),mtime=0)) + for command,args in [(vendor/'frozen/verify_host3_odd.py',[path,'1125']),(vendor/'frozen/physical.py',[path,vendor/'frozen/clifford_exact.py','1000000009','11'])]: + subprocess.run([sys.executable,'-I','-B',str(command),*map(str,args)],check=True);physical_checks.append(command.name) + digest=sha256(canonical(new)).hexdigest() + engine=G.module('rechart_signed_routes',rank9/'physical_child.py',(('cca66a7ec924bab47ccd1410968d16e071a01dc6110b5c08040bd207f753d066',digest),)) + capture=io.StringIO() + with contextlib.redirect_stdout(capture):engine.main(path,vendor/'data/caller.json',caller_path) + signed_routes=json.loads(capture.getvalue()) + need(signed_routes['status']=='PASS_PHYSICAL_RANK9_ALGEBRA' and signed_routes['paid_calls']==32,'Signed physical fields') + need(1000*sum(len(row['caller_fields'])*row['ordinary_elementary_units'] for row in signed_routes['bindings'])==routes,'Actual signed-route charge') + print('PASS affected Gaussian chart columns, phase, corruption controls and finite physical replay',flush=True) + return normalized(dict(status='PASS_HELPER_449_FUSED_NATIVE',source_head=read(HERE/'REFERENCE.json')['source_head'],word_canonical_sha256=digest,native=N,forward=forward_receipt,grid=grid,derived_grid=derived,caller=symbolic,invoice=invoice,ordinary=ordinary,gate=gate,price=price,precision=precision,charts=charts,timed_certificate=timed_certificate,controls=controls,physical_checks=physical_checks,signed_routes=signed_routes,limitations=['Five inherited framework assumptions remain.','Source-aware retained engines are not independent human/formal acceptance.','The complete 17-stage application is checked separately.'])) +if __name__=='__main__': + p=argparse.ArgumentParser();p.add_argument('--out',type=Path);a=p.parse_args();r=run() + if a.out: + with a.out.open('x') as f:json.dump(r,f,sort_keys=True,indent=2);f.write('\n') + else:need(r==read(HERE/'NATIVE-RESULT.json'),'Every frozen native receipt field') + print(r['status'],r['gate']['claim'],flush=True) diff --git a/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_native/reconstruction_preflight.py b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_native/reconstruction_preflight.py new file mode 100644 index 0000000000..e8cb1fca3b --- /dev/null +++ b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_native/reconstruction_preflight.py @@ -0,0 +1,186 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Full authenticated native validation for the changed 485/1455 producer. + +Based on retained #7480 verify_native.py, attributed there to Rohan Arun, +dillona, and OpenAI Codex assistance. Source closure is authenticated through +its unmodified source.py. Every engine adaptation is counted and logged. +All inventories, prices, grids, envelopes, and physical checks are freshly +computed for the literal candidate. This does not select a public frontier. +""" +from pathlib import Path +from collections import Counter +from copy import deepcopy +from fractions import Fraction as Q +from hashlib import sha256 +from types import ModuleType +import sys,json,gzip,subprocess,tempfile,io,contextlib,time +HERE=Path(__file__).resolve().parent +ROOT=HERE.parents[1] +SOURCE=ROOT/'inputs/pr7480' +CANDIDATE=ROOT/'producer54/reroute' +sys.path.insert(0,str(SOURCE)) +from source import read,load,sources,canonical,need +from construct import construct +from derive_grid import derive +from verify_native import normalized,delta,rejects,forward_endpoint + +EXPECTED='8ab3d9dbe2e2e24202ac96c6122b010b3e7980912f935cc0cc2db2e9d85f83aa' +BASELINE='5044adee019f073f286789ccb688ffca76d42b60518242bb4daea818d33d337a' +PATCHES=[] +TIMINGS=[] +def module(name,path,edits=()): + raw=path.read_text();record={'module':name,'source_name':path.name,'source_sha256':sha256(raw.encode()).hexdigest(),'edits':[]} + for before,after in edits: + count=raw.count(before);need(count==1,'Unique adaptation '+repr(before)) + raw=raw.replace(before,after) + record['edits'].append({'before':before,'after':after,'occurrences':count}) + record['adapted_sha256']=sha256(raw.encode()).hexdigest();PATCHES.append(record) + obj=ModuleType(name);obj.__file__=str(path);sys.modules[name]=obj + exec(compile(raw,str(path),'exec'),obj.__dict__) + return obj + +def checkpoint(stage,data=None): + now=time.time();TIMINGS.append({'stage':stage,'elapsed_seconds':now-STARTED}) + (HERE/'CHECKPOINT.json').write_text(json.dumps(normalized({'stage':stage,'word_canonical_sha256':EXPECTED,'data':data,'timings':TIMINGS}),indent=2)+'\n') + print('PASS',stage,flush=True) + +def charts(vendor,word): + before=read(ROOT/'frozen-composition/7481-WORD.json.gz') + need(word['frames']==before['frames'],'All 1096 literal frames retained') + routes=lambda w:{i:[tuple(e[2:4])for e in w['program']if e[0]=='MOVE'and e[1]==i]for i in range(w['public'])} + r0,r1=routes(before),routes(word) + changed=[i for i in r0 if r0[i]!=r1[i]] + affected={pair for i in changed for pair in r0[i]+r1[i]} + prior={} + evidence=ROOT.parent/'inherited/validation_native' + for name,pin in {'CHARTS-BATCH-1.json': '06c15dde99f7f04fff7a2dca35196a119031265896863baab8bc9157f46ffd45', 'CHARTS-BATCH-0.json': '8abdefef307cc1d778069269074c57fd2ea8fb52d55c8bd9281e488d03f272d6', 'CHARTS-BATCH-7.json': '0fb7aed1f8d0078fe06d45fe98cd34c2764fe3c6c0ed5ffb7f0c9e04a12ddedd', 'CHARTS-BATCH-6.json': 'a26822a3bac2f4b21f987f890772e7ea46be43c5dd2ba78cc804afea7f12b8f4', 'CHARTS-BATCH-5.json': '1310786a3ae08e113c237a2d7b61a4f4a50e66b4ff57b7387cc15d8299bc1edd', 'CHARTS-BATCH-4.json': '75aabadebe6b7afce42678004fbeb66d46437bd58413de1de61e752a5b53a3df', 'CHARTS-BATCH-3.json': '910e1a50e242a5914bf8242413c07b7b54bf7dfbb5694e1c757b60c82e29acde', 'CHARTS-BATCH-2.json': 'c0d25482742e5d0516fb2da3025e4cb410e6214057eecfce3beb06d350280106'}.items(): + p=evidence/name;need(sha256(p.read_bytes()).hexdigest()==pin,'Pinned inherited strict chart evidence') + rec=read(p);need(rec['word_sha256']=='ad56c629ac587510aa59ad13fde7db3f38e08d4fc09beb70fbb839a8de17b41d','Evidence belongs to H5B') + for item in rec['pairs']:prior[tuple(item['pair'])]=item + compiler=load('combo_chart_compiler',vendor/'frozen/clifford_exact.py') + interpreter=load('combo_chart_interpreter',vendor/'frozen/native_verify.py') + fresh=[] + for a,b in sorted((affected-set(prior))|{(281,127),(594,883)}): + ca,cb=(compiler.canonical_frame(9,tuple(word['frames'][f]))for f in(a,b)) + recipe,_=compiler.lower_child(ca.adjoint().then(cb)) + expected=interpreter.adjoint(interpreter.frame(word['frames'][a],9))+interpreter.frame(word['frames'][b],9) + actual=interpreter.recipe(recipe);interpreter.equal(actual,expected,'Signed Pauli action and absolute phase') + need(recipe['rank']==len(word['frames'][b])-len(word['frames'][a]),'Exact public ascent rank') + for x,y in ((actual,expected),(interpreter.adjoint(actual),interpreter.adjoint(expected))): + for column in range(512):need(interpreter.state(x,column)==interpreter.state(y,column),'Exact forward/adjoint column') + bad=deepcopy(recipe);bad['left']['phase']=(bad['left']['phase']+1)%4 + need(rejects(lambda:interpreter.equal(interpreter.recipe(bad),expected,'Wrong phase')),'Wrong phase rejected') + item={'pair':[a,b],'rank':recipe['rank'],'columns':512,'adjoint_columns':512,'absolute_phase_verified':True} + fresh.append(item);prior[(a,b)]=item + need(affected<=set(prior),'Every current affected pair certified') + return {'all_affected_pairs':[prior[p]for p in sorted(affected)],'fresh_pairs':fresh,'changed_public_fields':changed,'inherited_evidence_pins':{'CHARTS-BATCH-1.json': '06c15dde99f7f04fff7a2dca35196a119031265896863baab8bc9157f46ffd45', 'CHARTS-BATCH-0.json': '8abdefef307cc1d778069269074c57fd2ea8fb52d55c8bd9281e488d03f272d6', 'CHARTS-BATCH-7.json': '0fb7aed1f8d0078fe06d45fe98cd34c2764fe3c6c0ed5ffb7f0c9e04a12ddedd', 'CHARTS-BATCH-6.json': 'a26822a3bac2f4b21f987f890772e7ea46be43c5dd2ba78cc804afea7f12b8f4', 'CHARTS-BATCH-5.json': '1310786a3ae08e113c237a2d7b61a4f4a50e66b4ff57b7387cc15d8299bc1edd', 'CHARTS-BATCH-4.json': '75aabadebe6b7afce42678004fbeb66d46437bd58413de1de61e752a5b53a3df', 'CHARTS-BATCH-3.json': '910e1a50e242a5914bf8242413c07b7b54bf7dfbb5694e1c757b60c82e29acde', 'CHARTS-BATCH-2.json': 'c0d25482742e5d0516fb2da3025e4cb410e6214057eecfce3beb06d350280106'},'literal_frames_match':True,'wrong_phase_rejected':True} + +def run(): + need(__debug__,'Assertions are proof obligations') + new=read(CANDIDATE/'WORD.json.gz');need(sha256(canonical(new)).hexdigest()==EXPECTED,'Only final short candidate') + previous=read(SOURCE/'NATIVE-RESULT.json') + proposal=read(CANDIDATE/'RESULT.json') + with sources()as(vendor,archive,rank9,bundle,parent,parent_word): + old=construct(parent_word) + need(canonical(old)==gzip.decompress((SOURCE/'WORD.json.gz').read_bytes()),'Regenerate frozen #7480 from authenticated #7334 closure') + need(sha256(canonical(old)).hexdigest()==BASELINE,'Exact source word') + emitted=[];skip=set(proposal['removed_old_indices']) + for i,e in enumerate(old['program']): + if i==proposal['insert_before_old_index']:emitted.extend(proposal['splice']) + if i not in skip:emitted.append(e) + incumbent=read(ROOT/'frozen-composition/7481-WORD.json.gz') + need(incumbent==dict(old,program=emitted),'Rebuild exact #7481 from its predecessor') + peer=read(ROOT/'frozen-composition/7604-WORD.json.gz') + need(sha256((ROOT/'frozen-composition/7604-WORD.json.gz').read_bytes()).hexdigest()=='aae5a85746db1abc5145b993e9a9408076f34c53c4bb8040a99b6a39f2685527','Exact open #7604 comparator') + program=peer['program'] + required={33517:['ADD',1143,757,'-1',3],38584:['MOVE',757,3,595,False],38585:['ADD',757,902,'-1',595],42714:['ADD',757,1557,'-2/3',595],42716:['MOVE',757,595,603,False],42717:['ADD',1255,757,'-1',603]} + need(all(program[i]==e for i,e in required.items()),'Exact helper757 contacts') + touches=[i for i in range(33518,42716)if 757 in(program[i][1:3]if program[i][0]in('ADD','COPY')else program[i][1:2])] + need(touches==[38584,38585,42714],'No intervening read of helper757') + emitted=[] + for i,event in enumerate(program): + if i==33518:emitted.append(['ADD',757,1255,'-1',3]) + if i==42716:emitted.extend([['MOVE',757,3,603,False],['ADD',757,1255,'1',603]]) + elif i not in(38584,38585,42714):emitted.append(event) + helper_word=dict(peer,program=emitted) + edits_path=ROOT/'frozen-composition/W2-EDITS.json' + need(sha256(edits_path.read_bytes()).hexdigest()=='bf0c45f0a1498ba06ced0e217c41fe01fb8a117a3acfbc973c3bc76022d03be7','Pinned literal W2 edits') + edits=read(edits_path) + need(sha256(canonical(helper_word)).hexdigest()==edits['base_canonical_sha256'],'Exact reconstructed helper757 base') + rebuilt=list(emitted) + for edit in reversed(edits['replacements']): + need(rebuilt[edit['start']:edit['end']]==edit['old'],'Exact old slice') + rebuilt[edit['start']:edit['end']]=edit['new'] + import hashlib as _hl + step1_edits_raw=(ROOT/'frozen-composition/W3H-STEP1-ON-7616-EDITS.json').read_bytes() + need(_hl.sha256(step1_edits_raw).hexdigest()=='bdad5bbb4692ccf651ec7d5f701aaa9e76a7117b1feeddd2d857f136ba8cda96','Pinned W3H-STEP1-ON-7616-EDITS hash') + step1_edits=json.loads(step1_edits_raw) + rebuilt_step1=list(rebuilt) + for _h in reversed(step1_edits['replacements']): + need(rebuilt_step1[_h['start']:_h['end']]==_h['old'],'Exact W3H-step1 old slice match') + rebuilt_step1[_h['start']:_h['end']]=_h['new'] + r_raw=(ROOT/'frozen-composition/RES-ON-STEP1-EDITS.json').read_bytes() + need(_hl.sha256(r_raw).hexdigest()=='42851eca7ceaa235113d40ed189e5338614e08e6e31a67659f450f096e53ef9a','Pinned RES-ON-STEP1-EDITS hash') + r_ed=json.loads(r_raw) + rebuilt_r=list(rebuilt_step1) + for _hr in reversed(r_ed['replacements']): + need(rebuilt_r[_hr['start']:_hr['end']]==_hr['old'],'Exact slice') + rebuilt_r[_hr['start']:_hr['end']]=_hr['new'] + restored=dict(helper_word,program=rebuilt_r) + need(sha256(canonical(restored)).hexdigest()=='ad56c629ac587510aa59ad13fde7db3f38e08d4fc09beb70fbb839a8de17b41d','Pinned H5B reconstruction') + generator=ROOT.parents[1]/'generate_and_probe.py'; permutation=ROOT.parents[1]/'reschedule-report.json' + need(sha256(generator.read_bytes()).hexdigest()=='4ba8c670f21f2ce403a2a8f15dec143866683dd360b68f35ba3b99c631e5c456','Pinned combination generator') + need(sha256(permutation.read_bytes()).hexdigest()=='5bfcc2622f928f99454612c36771d662d06047209b5dd1acc77c316accf5535c','Pinned dependency permutation') + import importlib.util as _iu + cg=ModuleType('combo_generator');cg.__file__=str(generator) + generator_functions=generator.read_text().split('def main():')[0] + exec(compile(generator_functions,str(generator),'exec'),cg.__dict__) + base_h,source_e1,candidate_e1=cg.load_inputs() + need(base_h==restored,'Exact H5B source for generator') + built1,_=cg.e1(restored,candidate_e1);built,_=cg.e4(built1) + order=read(permutation)['event_permutation'];need(sorted(order)==list(range(len(built['program']))),'Permutation bijection') + built['program']=[built['program'][i] for i in order] + zero_receipt=ROOT.parents[1]/'exact-q-report.json' + need(sha256(zero_receipt.read_bytes()).hexdigest()=='e4ba7737009205da3805760cf8865b85c7ab2cd9e006ecb9b586428c3dfe71e4','Pinned exact zero row certificate') + zero_doc=read(zero_receipt);need(zero_doc['candidate']==sha256(canonical(built)).hexdigest(),'Exact zero proof candidate') + zeros=[e for e in zero_doc['scaled_exact_q']['clears_exact'] if not e['q_row']] + need(len(zeros)==1 and zeros[0]['field']==1568 and zeros[0]['clear_event']==28267,'Unique exact zero CLEAR') + bp=built['program'];need(bp[28267]==['CLEAR',1568,3] and bp[28871]==['INIT',1502,3] and bp[29356]==['CLEAR',1502,3],'Exact zero lifetime splice endpoints') + need(not any(e[1]==1568 or (e[0]in('ADD','COPY')and e[2]==1568)for e in bp[28268:28872]),'No intervening scratch access') + bp2=[] + for i,e in enumerate(bp): + if i in(28267,28871):continue + e=list(e) + if 288710,'Full ordinary allowance') + gate,price=G.exact_price(vendor,archive,before,invoice,previous) + (HERE/'INGREDIENT-PRICE.json').write_text(json.dumps(normalized({'before':before,'after':invoice,'gate':gate,'price':price,'ordinary':ordinary}),indent=2)+'\n') + manifest=read(vendor/'INDEPENDENT-SOURCES.json');P=load('producer_bit_binding',archive/'verify.py');P.bit_binding(I,manifest) + precision=base.precision(vendor,new,C,gate,manifest) + need(precision['word']['odd_scale_lcm']==1125 and precision['word']['dyadic_height']==25,'Fresh ingredient precision') + checkpoint('complete ingredient invoices, both directed prices, all outer gates and precision',{'gate_claim':gate['claim'],'ordinary':ordinary['conservative_total'],'context_c':precision['context_c']}) + chart_receipt=charts(vendor,new) + controls={} + for name,event in( + ('doubled_early_encoding',['ADD',1455,485,'2/3',3]), + ('doubled_late_decoding',['ADD',1455,485,'-2/3',724]), + ('doubled_824_compensation',['ADD',824,54,'-1',721]), + ('doubled_1438_restoration',['ADD',1438,1439,'1',127])): + need(new['program'].count(event)==1,'Unique producer correction') + controls[name]=bool(I.native(new,mutant=new['program'].index(event))['bad_inputs']) + bad=deepcopy(new);i=bad['program'].index(['MOVE',757,3,603,False]);bad['program'][i][2]=595 + controls['wrong_helper757_source']=rejects(lambda:I.native(bad)) + bad=deepcopy(new);bad['program'].remove(['MOVE',757,3,603,False]) + controls['missing_helper757_paid_move']=rejects(lambda:I.native(bad)) + bad=deepcopy(new);i=bad['program'].index(['MOVE',485,3,724,False]);bad['program'][i][2]=721 + controls['wrong_move_source']=rejects(lambda:I.native(bad)) + bad=deepcopy(new);bad['final'][485]=721 + controls['wrong_output_frame']=rejects(lambda:I.native(bad)) + owned=module('producer_owned_census',vendor/'retained/query-only-precision-envelope/envelopes.py',(('(life, peak, owned_count) == (54, 43, 51)','(life, peak, owned_count) == (233, 50, 68)'),)) + need(owned.validate_word(new)['lifetimes']==233,'Fresh owned census from envelope validator') + bad=deepcopy(new);bad['program']=[['INIT',1501,724],['CLEAR',1501,724]]+bad['program'] + controls['extra_uncharged_owned_lifetime']=rejects(lambda:owned.validate_word(bad)) + grid_engine=module('producer_grid_controls',vendor/'retained/odd-native-common-grid/independent_bounds.py') + controls['insufficient_odd_grid']=rejects(lambda:grid_engine.word_run(new,375,25)) + controls['insufficient_fractional_grid']=rejects(lambda:grid_engine.word_run(new,1125,24)) + need(all(controls.values()),'Every corruption control rejected') + physical_checks=[] + with tempfile.TemporaryDirectory(prefix='producer-physical-')as tmp: + path=Path(tmp)/'word.json.gz';path.write_bytes(gzip.compress(canonical(new),mtime=0)) + for command,args in[(vendor/'frozen/verify_host3_odd.py',[path,'1125']),(vendor/'frozen/physical.py',[path,vendor/'frozen/clifford_exact.py','1000000009','11'])]: + with(HERE/(command.name+'.log')).open('w')as stream: + subprocess.run([sys.executable,'-I','-B','-X','pycache_prefix='+str(ROOT/'isolated/pycache'),str(command),*map(str,args)],stdout=stream,stderr=subprocess.STDOUT,check=True) + physical_checks.append(command.name) + print((HERE/(command.name+'.log')).read_text(),end='',flush=True) + engine=module('producer_signed_routes',rank9/'physical_child.py',(('cca66a7ec924bab47ccd1410968d16e071a01dc6110b5c08040bd207f753d066',EXPECTED),)) + capture=io.StringIO() + with contextlib.redirect_stdout(capture):engine.main(path,vendor/'data/caller.json',caller_path) + signed_routes=json.loads(capture.getvalue()) + need(signed_routes['status']=='PASS_PHYSICAL_RANK9_ALGEBRA'and signed_routes['paid_calls']==32,'Signed physical fields') + need(1000*sum(len(row['caller_fields'])*row['ordinary_elementary_units']for row in signed_routes['bindings'])==routes,'Actual signed-route elementary charge') + checkpoint('all affected Gaussian columns and absolute phase, finite physical replay and signed routes') + return normalized(dict(status='PASS_COMBINED_CANDIDATE_ADAPTED_NATIVE',source_head='58a9d052143f5d85295ed2d0163591c47f89a331',source_word_canonical_sha256=BASELINE,word_canonical_sha256=EXPECTED,native=N,forward=forward_receipt,grid=grid,derived_grid=derived,caller=symbolic,invoice=invoice,ordinary=ordinary,gate=gate,price=price,precision=precision,charts=chart_receipt,controls=controls,physical_checks=physical_checks,signed_routes=signed_routes,adapter=PATCHES,timings=TIMINGS,limitations=['Five inherited framework assumptions remain.','Source-aware retained engines are not independent human/formal acceptance.','The complete 17-stage signed application is checked separately.'])) + +if __name__=='__main__': + STARTED=time.time();result=run() + (HERE/'NATIVE-RESULT.json').write_text(json.dumps(result,sort_keys=True,indent=2)+'\n') + print(result['status'],result['price']['claim_decimal'],flush=True) diff --git a/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_signed/run.py b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_signed/run.py new file mode 100644 index 0000000000..fc6ec51552 --- /dev/null +++ b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_signed/run.py @@ -0,0 +1,144 @@ +"""Fresh exact17-stage application of the changed485/1455 producer. + +Retained source checks and attribution come from the authenticated #7480 +closure. All adaptations are counted and recorded. No selected frontier is +modified. Apache-2.0, following the retained source notices. +""" +from pathlib import Path +from fractions import Fraction as Q +from hashlib import sha256 +import importlib.util,json,gzip,shutil,subprocess,sys,time + +HERE=Path(__file__).resolve().parent +ROOT=HERE.parents[1] +SOURCE=ROOT/'inputs/pr7480' +CANDIDATE=ROOT/'producer54/reroute' +NATIVE=ROOT/'producer54/validation_native/NATIVE-RESULT.json' +OUT=HERE/'RESULT.json' +def load(name,path): + spec=importlib.util.spec_from_file_location(name,path);obj=importlib.util.module_from_spec(spec);sys.modules[name]=obj;spec.loader.exec_module(obj);return obj +def read(path): + raw=Path(path).read_bytes();return json.loads(gzip.decompress(raw)if raw[:2]==b'\x1f\x8b'else raw) +def normal(x):return json.loads(json.dumps(x,default=str)) +def canonical(x):return json.dumps(x,sort_keys=True,separators=(',',':')).encode() +assert __debug__ +src=load('producer_source',SOURCE/'source.py') +adapter=load('producer_adapter',HERE/'w2_adapt.py') +FROZEN=ROOT/'frozen-composition' +old_word=read(FROZEN/'7546-WORD.json.gz');new_word=read(CANDIDATE/'WORD.json.gz') +assert new_word==read(FROZEN/'CANDIDATE-WORD.json.gz'),'Pinned literal helper757 word' +assert sha256(canonical(new_word)).hexdigest()=='8ab3d9dbe2e2e24202ac96c6122b010b3e7980912f935cc0cc2db2e9d85f83aa' +adjusted=read(FROZEN/'7546-WORD.json.gz');assert adjusted['initial'][457]==3;adjusted['initial'][457]=281 +assert {k:v for k,v in adjusted.items()if k!='program'}=={k:v for k,v in new_word.items()if k!='program'},'Only declared initial457 delta; exact other metadata' +old_result=read(FROZEN/'7546-NATIVE.json');new_result=read(NATIVE) +assert new_result['status']=='PASS_COMBINED_CANDIDATE_ADAPTED_NATIVE' +assert old_result['word_canonical_sha256']=='bdecd5cc1cb9f164dc695ce07a07d5d44e9961996fcdfa4d77b4092fecbda745' +assert sha256(canonical(new_word)).hexdigest()==new_result['word_canonical_sha256'] +commands=('emit_odd_type_b.py','emit_odd_type_ab.py','check_odd_caller_exact_grid.py', + 'check_odd_physical_binding.py','check_odd_precision.py','check_odd_partial_admission.py', + 'check_odd_fixed_tape_counts.py') +log=[];started=time.time() +with src.sources()as(vendor,archive,rank9,bundle,parent,unused_old): + with src.bundles()as(parts,unused_previous,temp): + working=temp/'producer54-signed-working';shutil.copytree(parts[7113]/'replay',working) + folder=working/'supplier7112/short-caller' + (folder.parent/'WORD.json.gz').write_bytes((CANDIDATE/'WORD.json.gz').read_bytes()) + (folder.parent/'RESULT.json').write_bytes(NATIVE.read_bytes()) + for path in folder.glob('SHORT-CATALOGUE-*-*.log'):path.unlink() + sys.path.insert(0,str(folder)) + model=load('producer_signed_model',folder/'signed_model.py');ind=model.signed_model() + code=(folder/'independent.py').read_text();part=code[code.index('def invoices('):code.index('def ordinary(')] + assert part.count('assert calls==18')==1 + part=part.replace('assert calls==18',"assert calls==C['stages']") + old="elif e[1]=='IDLE_ONE':P[8*len(e[3])]+=ports";assert part.count(old)==1 + part=part.replace(old,"elif e[1] in ('IDLE_ONE','IDLE_ODD'):P[8*len(e[3])+(e[1]=='IDLE_ODD')]+=ports") + exec(compile(part,str(folder/'independent.py'),'exec'),ind.__dict__) + C=read(parts[7113]/'expected/ODD-TYPE-AB-CALLER.json') + assert sha256((parts[7113]/'expected/ODD-TYPE-AB-CALLER.json').read_bytes()).hexdigest()=='255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc' + inventories=[ind.native(w)for w in(old_word,new_word)] + for n,r,w in zip(inventories,(old_result,new_result),(old_word,new_word)): + assert normal(n)==r['native']and not n['bad_inputs'] + assert sha256(canonical(w)).hexdigest()==r['word_canonical_sha256'] + before,after=[ind.invoices(w,C,n)for w,n in zip((old_word,new_word),inventories)] + previous=read(FROZEN/'7546-SIGNED.json')['price'] + assert Q(previous['gate']['claim'])==Q('0.003648411294790') + ranks=set(before['P'])|set(after['P']) + delta={r:after['P'].get(r,0)-before['P'].get(r,0)for r in ranks if after['P'].get(r,0)!=before['P'].get(r,0)} + assert delta=={1:-561,2:918,3:-3689,4:697,5:255,6:901,8:34} and {r:after['T'].get(r,0)-before['T'].get(r,0) for r in set(after['T'])|set(before['T']) if after['T'].get(r,0)!=before['T'].get(r,0)}=={6:17,9:-17} + assert before['S']==after['S']==1424 and not before['empty_root_credits'] and not after['empty_root_credits'] + assert sum(after['P'].values())==109023 and sum(after['T'].values())==22461 + assert normal(before)==previous['after'],'Whole reconstructed #7546 invoice' + peer_word=read(FROZEN/'7604-WORD.json.gz') + peer_native=ind.native(peer_word);assert not peer_native['bad_inputs'] + peer_invoice=ind.invoices(peer_word,C,peer_native) + frozen_peer=read(FROZEN/'7604-INVOICE.json') + assert normal(peer_invoice['P'])==frozen_peer['paid'] and normal(peer_invoice['T'])==frozen_peer['targets'] + assert peer_invoice['S']==1424 and not peer_invoice['empty_root_credits'] + ranks=set(peer_invoice['P'])|set(after['P']) + assert {r:after['P'].get(r,0)-peer_invoice['P'].get(r,0)for r in ranks if after['P'].get(r,0)!=peer_invoice['P'].get(r,0)}=={1:-493,2:986,3:-3706,4:680,5:238,6:901,8:34} + candidate_invoice=read(FROZEN/'CANDIDATE-INVOICE.json') + assert normal(after['P'])==candidate_invoice['paid'] and normal(after['T'])==candidate_invoice['targets'] + G=load('producer_signed_price_engine',bundle/'gate.py') + gate,price=G.exact_price(vendor,archive,before,after,{'gate':previous['gate']}) + assert Q(gate['claim'])>Q(previous['gate']['raw_bracket'][1]),'Strictly higher than #7546 raw crossing' + assert Q(gate['claim'])>Q('0.0036475398278'),'Strictly higher than upper endpoint of #7542 price enclosure' + assert Q(gate['claim'])>Q(new_result['gate']['claim']) + native_invoice={k:({int(r):v for r,v in value.items()}if k in('T','P')else value)for k,value in new_result['invoice'].items()} + directed=G.module('producer_native_comparator',vendor/'interval_gate.py') + assert directed.moment(G.signed(before),Q(gate['claim']))[1]<0,'Exact #7546 invoice rejects the new signed claim' + assert directed.moment(G.signed(native_invoice),Q(gate['claim']))[1]<0 + assert directed.moment(G.signed(peer_invoice),Q(gate['claim']))[1]<0,'Exact open #7604 invoice rejects the new signed claim' + assert Q(gate['claim'])>Q('0.0036502223358273'),'Strict improvement over latest #7604 crossing' + assert Q(gate['claim'])>=Q('0.0037'),'Conservative public claim is within the proved application' + public_claim=Q('0.0037') + public_gate=directed.gate(after,public_claim,public_claim+Q(7,10**17),*map(Q,gate['raw_bracket']),Q(gate['BIT_pin'])) + price_record=normal(dict(public_claim_gate=public_gate,before=before,after=after,gate=gate,price=price, + native_baseline_rejects_new_claim=True,signed_incumbent_rejects_new_claim=True, + old_native=old_result['word_canonical_sha256'],new_native=new_result['word_canonical_sha256'])) + (folder/'CURRENT-PRICE.json').write_text(json.dumps(price_record,indent=2)+'\n') + (folder/'COHORT-PRICE.json').write_text(json.dumps(normal(dict(target=after['T'],paid=after['P'],bracket=gate['raw_bracket'])),indent=2)+'\n') + (HERE/'PRICE.json').write_text(json.dumps(price_record,indent=2)+'\n') + print('PASS two complete literal invoices and both directed prices',price['claim_decimal'],flush=True) + changes=adapter.adapt(folder,price['claim_decimal'],new_result['derived_grid']['fractional_bits']) + for name in commands: + print('RUN',name,flush=True);tick=time.time() + with (HERE/(name+'.log')).open('w')as stream: + subprocess.run([sys.executable,'-B',str(folder/name)],cwd=folder,stdout=stream,stderr=subprocess.STDOUT,check=True) + log.append({'check':name,'seconds':time.time()-tick}) + print((HERE/(name+'.log')).read_text(),end='',flush=True) + assert(folder/'ODD-TYPE-AB-CALLER.json').read_bytes()==(parts[7113]/'expected/ODD-TYPE-AB-CALLER.json').read_bytes() + fresh_price=read(folder/'CURRENT-PRICE.json');partial=read(folder/'ODD-ADMISSION-PARTIAL.json') + assert fresh_price['after']==partial['invoice'] + assert fresh_price['gate']==partial['compiler_outer'] + catalogue=[] + size=int(subprocess.check_output([sys.executable,'-B',str(folder/'short_native_catalogue.py'),'--size'],cwd=folder,text=True)) + for start in range(0,size,1000): + stop=min(start+1000,size);print('RUN complete catalogue',start,stop,flush=True) + path=folder/f'SHORT-CATALOGUE-{start}-{stop}.log' + cached=HERE/f'CACHED-SHORT-CATALOGUE-{start}-{stop}.log' + if cached.exists(): + raw_cached=cached.read_text();cached_rec=json.loads(raw_cached[raw_cached.index('\n{'):]) + assert cached_rec['word_sha256']=='d7eb204bb24b2e1b5a3e4ebc282d346a4706ddd738004929d1e9ac345085a79a' + assert cached_rec['slice_start']==start and cached_rec['slice_stop']==stop + shutil.copy2(cached,path) + else: + with path.open('x')as stream:subprocess.run([sys.executable,'-B',str(folder/'short_native_catalogue.py'),'--start',str(start),'--stop',str(stop)],cwd=folder,stdout=stream,check=True) + text=path.read_text();catalogue.append(json.loads(text[text.index('\n{'):])) + shutil.copy2(path,HERE/path.name) + with(HERE/'assemble_odd_application.py.log').open('w')as stream: + subprocess.run([sys.executable,'-B',str(folder/'assemble_odd_application.py')],cwd=folder,stdout=stream,stderr=subprocess.STDOUT,check=True) + print((HERE/'assemble_odd_application.py.log').read_text(),end='',flush=True) + files=('ODD-TYPE-AB-REPLAY.json','ODD-CALLER-EXACT-GRID.json','ODD-PHYSICAL-BINDING.json', + 'ODD-PRECISION.json','ODD-ADMISSION-PARTIAL.json','ODD-FIXED-TAPE-COUNTS.json','ODD-8X9-APPLICATION-CHECKS.json') + result=normal(dict(status='PASS_COMBINED_CANDIDATE_ADAPTED_SIGNED_APPLICATION', + claim=fresh_price['gate']['claim'],price=fresh_price,caller_sha256=sha256((folder/'ODD-TYPE-AB-CALLER.json').read_bytes()).hexdigest(), + adapter=changes,catalogue=catalogue,checks={name:read(folder/name)for name in files}, + source_head='99438c43df7aac1e5dbcc43c1578fcd886c119ec',peer_head='ba2638c5a6e2b9a1c0c559a41811e5d41a591f41', + component_head='71f5acb0409daf208a865482f3349049dbd3251c',timings=log,elapsed_seconds=time.time()-started, + assumptions=['native_all_columns','owned_erasure','compiler','precision_tape','analytic_recovery'])) + OUT.write_text(json.dumps(result,indent=2,sort_keys=True)+'\n') + # Retain the precisely adapted checker text and its generated essential inputs. + keep=HERE/'adapted';keep.mkdir(exist_ok=True) + for name in set(commands)|{'short_native_catalogue.py','assemble_odd_application.py','CURRENT-PRICE.json','COHORT-PRICE.json'}: + shutil.copy2(folder/name,keep/name) + print(result['status'],price['claim_decimal'],flush=True) diff --git a/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_signed/w2_adapt.py b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_signed/w2_adapt.py new file mode 100644 index 0000000000..2863116600 --- /dev/null +++ b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/full-wrapper/work/producer54/validation_signed/w2_adapt.py @@ -0,0 +1,41 @@ +# Successor: Rohan Arun/OpenAI Codex global output rechart; predecessor attribution retained. +"""Counted adapters invalidate same-native reuse in Rohan Arun's #7113 checks. +All edits apply only to temporary copies of authenticated source. Apache-2.0. +Prepared for dillona with substantial OpenAI Codex assistance. +""" +from hashlib import sha256 + +def adapt(folder,claim,frac): + changes=[] + def patch(name,old,new): + path=folder/name;raw=path.read_text() + if raw.count(old)!=1:raise ValueError('Exact one-occurrence adapter: '+name+' '+old) + path.write_text(raw.replace(old,new));changes.append(dict(file=name,old=old,new=new)) + patch('emit_odd_type_ab.py', + 'invoice=next(x for x in json.loads((root/"SHORT-CALLER-RAW-PRICE.json").read_text())["rows"] if tuple(x["shape"])==shape)', + 'invoice=json.loads((root/"COHORT-PRICE.json").read_text())') + patch('check_odd_partial_admission.py', + 'previous=json.loads((root/"SHORT-ADMISSION-PARTIAL.json").read_text())\nassert previous["native_sha256"]==digest and not N["bad_inputs"]', + 'actual_native=ind.native(w)\nassert actual_native==N and not N["bad_inputs"], "Fresh complete native inventory and arbitrary-input adjoint"') + patch('check_odd_partial_admission.py','claim=Q(".00363797977")','claim=Q('+repr(claim)+')') + # ToikY's frozen exact_price() already shrinks this probe below the + # certified crossing. Recompute that rule in the caller's separate gate. + patch('check_odd_partial_admission.py', + 'tested=claim+Q(7,10**17)', + 'tested=claim+Q(7,10**17)\nwhile tested>=Q(reference["raw_bracket"][0]):\n tested=claim+(tested-claim)/10') + patch('check_odd_partial_admission.py', + 'g=gate(invoice,claim,tested,*bracket,r["gate"]["BIT_pin"])', + 'g=gate(invoice,claim,tested,*bracket,r["gate"]["BIT_pin"])\ntry:\n gate(invoice,claim,Q(bracket[0]),*bracket,r["gate"]["BIT_pin"])\nexcept AssertionError:\n crossing_probe_rejected=True\nelse:\n raise AssertionError("Probe at lower crossing unexpectedly accepted")') + patch('check_odd_partial_admission.py', + '"scope":"Reuse exact same native word all-column adjoint;', + '"crossing_probe_rejected":crossing_probe_rejected,"scope":"Fresh complete changed-native arbitrary-input adjoint;') + patch('check_odd_precision.py', 'env=ModuleType("short_envelope")', + 'patch(\'(life, peak, owned_count) == (54, 43, 51)\',\'(life, peak, owned_count) == (233, 50, 68)\')\nenv=ModuleType("short_envelope")') + patch('check_odd_precision.py','previous=json.loads((root/"SHORT-PRECISION.json").read_text())','') + patch('check_odd_precision.py', + 'assert previous["native_sha256"]==sha and grid_receipt["caller_sha256"]==sha256(cpath.read_bytes()).hexdigest()', + 'assert grid_receipt["caller_sha256"]==sha256(cpath.read_bytes()).hexdigest()') + patch('check_odd_precision.py', + 'wg=previous["native_grid"]\nwr=previous["rounded_native"]\nwp={key:(Q(v["exact"]),v["witness"]) for key,v in wr["bounds"].items()}', + f'wg=grid.word_run(w, frac={frac})\nwp,wr=env.native_envelope(w)\nwg=json.loads(json.dumps(wg,default=str));wr=json.loads(json.dumps(wr,default=str))\nassert wg==r["precision"]["word"] and wr==r["precision"]["rounded_native"], "Fresh changed-native grid and envelope"') + return dict(edits=changes,adapted_sha256={x['file']:sha256((folder/x['file']).read_bytes()).hexdigest() for x in changes}) diff --git a/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/generate_and_probe.py b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/generate_and_probe.py new file mode 100644 index 0000000000..0e95bd7a08 --- /dev/null +++ b/research/final233-portable-conditional/src/runtime/research/h5b-combination-20261117/sol-analysis/generate_and_probe.py @@ -0,0 +1,119 @@ +"""Isolated H5B + E1/E4 experiment. No baseline file is modified. +E1 interior and bookends are imported from pinned #7633 words. +E4 interior is #7630 E4; its exact rank-one full-chart resettlement is derived afresh. +This is candidate construction, not a proof of the inherited recursive framework. +""" +import base64,copy,gzip,hashlib,json,os,signal,sys,time +from collections import Counter +from decimal import Decimal,localcontext +from fractions import Fraction as F +from pathlib import Path +HERE=Path(__file__).resolve().parent +BASE=HERE.parents[2] +H5B=BASE/"research/hydrogen-bounded-verification-20261117" +ROOT=BASE/"macbook_handoff_pr7624/unpacked/K_handoff" +def canonical(w):return hashlib.sha256(json.dumps(w,sort_keys=True,separators=(",",":")).encode()).hexdigest() +def load_inputs(): + h=json.loads(gzip.decompress((H5B/"word-hydrogen-frames-restored.json.gz").read_bytes())) + s,c=[json.loads(gzip.decompress(base64.b64decode((HERE.parent/f"inputs/7633-{x}.b64").read_bytes()))) for x in ("source","candidate")] + assert canonical(h)=="ad56c629ac587510aa59ad13fde7db3f38e08d4fc09beb70fbb839a8de17b41d" + assert canonical(s)=="1ea66c263faa51da704d7aae944f3371400afaf5df8a56904ab96319f6554e0e" + assert canonical(c)=="4961e5e9351fa532a51eb8ff2b534bab6acd50cfd35972027cc483810cf635c3" + return h,s,c +def e1(w,c,shadow=1568): + w=copy.deepcopy(w);p=w["program"] + assert all(e[1]!=shadow and (e[0] not in ("ADD","COPY") or e[2]!=shadow) for e in p) + pre=copy.deepcopy(c["program"][:12]) + for e in pre: + if e[1]==1501:e[1]=shadow + if e[0]=="ADD" and e[2]==1501:e[2]=shadow + last=max(i for i,e in enumerate(p) if e[0] in ("ADD","COPY","SCALE") and e[-1]==3 and (e[1]==457 or (e[0]!="SCALE" and e[2]==457))) + out=pre;replaced=0;moves=0 + for i,e in enumerate(p): + e=list(e) + if e==["MOVE",457,3,281,False]: + e=["ADD",242,457,"-1",281];moves+=1 + elif e[0] in ("ADD","COPY","SCALE") and e[-1]==3: + if e[1]==457:e[1]=shadow;replaced+=1 + if e[0]!="SCALE" and e[2]==457:e[2]=shadow;replaced+=1 + out.append(e) + if i==last:out.append(["CLEAR",shadow,3]) + assert moves==1 and replaced==36 + out+=copy.deepcopy(c["program"][-192:]) + w["program"]=out;w["initial"][457]=281 + return w,{"shadow":shadow,"chart3_accesses":replaced,"shadow_clear_after_base_event":last,"bookends":"7633 candidate first12/last192"} +def inverse_target_covector(w,q): + z=q[:];D=set(w["hosted"]["Dports"]) + for i,x in enumerate(w["live"]): + y=x+112 + if i in D:z[x],z[y]=q[x]-q[y],q[y] + else:z[x],z[y]=(q[x]-q[y])/2,q[x]+q[y] + for x,y in zip(w["hosted"]["X2"],w["hosted"]["Y2"]):z[x],z[y]=q[x],q[x]+q[y] + return z +def e4(w,shadow=1567): + w=copy.deepcopy(w);out=[];counts=Counter() + for e in w["program"]: + if e==["MOVE",490,594,725,False]:e=["MOVE",490,594,883,False];counts["route1"]+=1 + elif e==["ADD",490,296,"1",725]:injection=len(out);e=["ADD",1427,296,"-1",725];counts["add"]+=1 + elif e==["MOVE",490,725,883,False]:counts["route2"]+=1;continue + out.append(e) + assert counts=={"route1":1,"route2":1,"add":1} + n=w["public"];N=n+w["owned_fields"] + q=[F(0)]*N;q[296]=F(1) + for e in reversed(out[:injection]): + op,r=e[:2] + if op in ("INIT","CLEAR"):q[r]=F(0) + elif op=="SCALE":q[r]*=F(e[2]) + elif op in ("ADD","COPY"): + q[e[2]]+=F(e[3])*q[r] + if op=="COPY":q[r]=F(0) + v=[F(0)]*N;v[490]=v[1427]=F(-1) + for e in out[injection+1:]: + op,r=e[:2] + if op in ("INIT","CLEAR"):v[r]=F(0) + elif op=="SCALE":v[r]*=F(e[2]) + elif op in ("ADD","COPY"): + if op=="COPY":v[r]=F(e[3])*v[e[2]] + else:v[r]+=F(e[3])*v[e[2]] + q=inverse_target_covector(w,q) + assert all(not x or (i0:lo=mid + else:hi=mid + return {"P":P,"T":T,"crossing_decimal_estimate":str((lo+hi)/2),"moment_at_0037_decimal_estimate":str(m(Decimal(".0037"))),"not_interval_certified":True} +def main(): + os.nice(10);signal.alarm(550);sys.path.insert(0,str(BASE/"research/carbon-structural-20261116")) + import verify_lib as vl + h,s,c=load_inputs();w1,m1=e1(h,c);w4,m4=e4(h);wj,mj=e4(w1) + vs={"e1":(w1,m1),"e4":(w4,m4),"joint":(wj,{"e1":m1,"e4":mj})} + shim=[] + ind=vl.load_py_in_memory("combo_ind",ROOT/"reference_vendor/independent.py",[("(v&q).bit_count()","bin(v&q).count(\"1\")",1),("a.bit_count()","bin(a).count(\"1\")",1)],shim) + old=ind.native(h);assert old["bad_inputs"]==[] + call=json.loads((vl.RET902_DIR/"bench/inputs/7113-CALLER.json").read_text());inv=json.loads((H5B/"invoice-restored.json").read_text()) + report={"baseline_hash":canonical(h),"source_original_native":"reference_vendor/independent.py semantic native engine, only two Python 3.9 popcount normalizations","platform_adapter":shim,"variants":{}} + for tag,(w,meta) in vs.items(): + raw=gzip.compress(json.dumps(w,separators=(",",":")).encode(),mtime=0);path=HERE/f"word-{tag}.json.gz" + with path.open("xb") as f:f.write(raw) + t=time.monotonic();n=ind.native(w) + item={"canonical_sha256":canonical(w),"gzip_sha256":hashlib.sha256(raw).hexdigest(),"native":n,"ordinary":vl.compute_ordinary_17call(w,call,675),"moment":moment_report(inv,n,old),"counts":dict(Counter(e[0] for e in w["program"])),"construction":meta,"seconds":time.monotonic()-t} + report["variants"][tag]=item + print(tag,canonical(w),"native_bad",n["bad_inputs"],"lifetime",n["lifetimes"],"peak",n["owned_peak"],"ordinary",item["ordinary"]["conservative_total"],"crossing",item["moment"]["crossing_decimal_estimate"],"moment.0037",item["moment"]["moment_at_0037_decimal_estimate"],flush=True) + with (HERE/"quick-report.json").open("x") as f:json.dump(report,f,indent=2);f.write("\n") +if __name__=="__main__":main() diff --git a/research/final233-portable-conditional/test_replay.py b/research/final233-portable-conditional/test_replay.py new file mode 100644 index 0000000000..481770c40c --- /dev/null +++ b/research/final233-portable-conditional/test_replay.py @@ -0,0 +1,35 @@ +import importlib.util +import tempfile +import unittest +from pathlib import Path + +HERE = Path(__file__).resolve().parent +spec = importlib.util.spec_from_file_location("compact_replay", HERE / "replay.py") +mod = importlib.util.module_from_spec(spec) +spec.loader.exec_module(mod) + +class CompactTests(unittest.TestCase): + def test_local_integrity_reports_external_missing(self): + manifest, objects, missing = mod.check() + self.assertTrue(missing) + self.assertEqual(len(manifest["entries"]), 59) + self.assertTrue(objects) + + def test_reject_path_traversal_and_absolute_paths(self): + for path in ("../escape", "/absolute", "C:/absolute", "a\\b"): + with self.assertRaises(ValueError): + mod.safe(HERE, path) + + def test_existing_work_is_not_overwritten(self): + manifest, objects, _ = mod.check() + with tempfile.TemporaryDirectory() as work: + with self.assertRaises(ValueError): + mod.materialize(Path(work), manifest, objects, None) + + def test_missing_external_does_not_start_materialization(self): + manifest, objects, missing = mod.check() + self.assertTrue(missing) + self.assertTrue(any(e["storage"] == "external" for e in manifest["entries"])) + +if __name__ == "__main__": + unittest.main()