diff --git a/research/current-half-add-service/PROOF.md b/research/current-half-add-service/PROOF.md new file mode 100644 index 0000000000..d24ca7e946 --- /dev/null +++ b/research/current-half-add-service/PROOF.md @@ -0,0 +1,101 @@ +# The terminal half-ADD bridge + +## Exact source and local domain + +Fix the candidate bytes in VENDORED.json. The source is the 150009-event +native word from PR7660 at d12b854d4825e9edfa3a3466909e1abf3525e929. +The verifier replays chart metadata through clock 100503. Both public +roles 210 and 457 are then in chart 218. Clock 100504 is the literal +half-coefficient ADD recorded in RESULT.json. The registry key includes +that clock and the complete event tuple. + +Assume canonical finite signed fields on physically distinct tapes, with +the same shape and grid. Public and borrowed context heads start at their +origins. Each private work body is contiguous, has a blank historical +tail, and its head lies in that body or at its frontier. These are the +retained primitive's input premises. They are not inferred from the +local scalar values. + +## Specialize the retained literal service + +For coefficient -1/2, the retained rounded-ADD compiler forms +`2x-y+1`, takes mathematical floor after division by two, and checks the +final signed range. Since x is an integer, + +```text +floor((2x-y+1)/2) = x - floor(y/2). +``` + +This includes negative odd y and the smallest signed inputs. The retained +carry proof and staged-installation proof apply to every positive width +and every nonempty complete complex field. The finite graph has 669 rows +and 210 states. Its only runtime instructions are the six existing tape +opcodes. The compiler's integer construction is not a runtime callback. + +Let L=-2^(W-1) and U=2^(W-1)-1. For each fixed source y, the exact success +domain for x is the intersection of [L,U] with +[L+floor(y/2), U+floor(y/2)]. This interval describes final range only; +there is no divisibility restriction. On success the source stays fixed, +all heads return and private work is retired. Staging all components +before installation protects the whole public target on a late failure. +Failure does not promise clean work or returned heads. + +The general retained cost theorem, with denominator two-adic exponent +one, gives 512(S+1)+64R+7(A_0+A_1)+16Q_c in physical/control units. +It includes source reads, carry work, staging, copying, rewind, head return +and both retirements. Its private backing bound is +max(H_0,3S)+max(H_1,3(S+1)). Positive setup, public, context and ancestor +charges are separate. These bounds do not use a conversion to the source's +815804876 ordinary-model units. + +## Exact error transport through the current suffix + +Write y=2k+b, where b is zero or one, including for negative y. The rounded +output x-k differs from x-y/2 by b/2. For grid step Delta the real error is +Delta*b/2. With N complex entries, there are 2N real components, so +squared field error is at most N*Delta^2/2. Equality holds when all real +components have odd source numerators and the rounded outputs fit. +For the 512-entry fixture, the squared error is exactly 256*Delta^2. + +Now compare executions that differ only by this local error. Inspect every +one of the 49504 later events. No event reads role 210 as a source. The +only event that writes it is clock 100527: + +```text +ADD 210,292,-1/2,218 +``` + +The source of that update is unchanged between the two executions. All +other roles evolve from identical inputs under identical local operations. +The update adds the same value to role 210 in both executions. Its existing +difference is therefore preserved exactly. The same statement holds if +that later ADD uses a source-only rounded increment, when both executions +are in the service's range domain. It does not assert that the later +exact-halving service has already been replaced or is defined off-grid. + +Role 210 returns in chart 218. Its error multiplier is exactly one. No +other public field and no owned observation or erasure receives this +one-site error. This follows from the literal dependency graph; it needs +no unitary bound for a later MOVE because no later MOVE acts on the changed +field. It still assumes the stated local operation semantics and distinct +logical fields. It does not prove those physical interfaces globally. + +A separate positive forward-envelope pass gives peak and terminal gain +one, public squared gain sum one, and zero gain at all 75 later CLEARs. +An independently ordered backward pass returns the same coefficient at +the injection site. The exact dependency certificate is stronger than +this norm corroboration. A legal reversed ADD at 100527 would export the +error, and a legal SCALE there would change its gain; both controls reject. + +## What this does not compose + +The isolated arithmetic is a rounded alternative to the exact-child +service. It changes that service's numerical semantics. The later +half-ADD, all other scalar services and the complete caller remain open. +The local fixtures are admitted primitive inputs, not full-prefix traces. +The local native-return error is not a complete signed-caller error. + +The word's operator, owned erasure, compiler, precision/tape and analytic +recovery assumptions remain. A full contribution to the multiplication +exponent needs all 17 local bindings, complete error transport, the common +physical tariff and rounded outer recovery. No such admission is claimed. diff --git a/research/current-half-add-service/README.md b/research/current-half-add-service/README.md new file mode 100644 index 0000000000..5a66fcb9f6 --- /dev/null +++ b/research/current-half-add-service/README.md @@ -0,0 +1,129 @@ +# A rounded service at the current half-ADD boundary + +This source-bound construction joins an existing literal rounded ADD to +one exposed boundary in [PR 7660](https://github.com/CrocSwap/integer-mult-bounds/pull/7660). +It also proves an exact terminal-error property of the current native word. +No new kappa or complete caller admission is claimed. + +At head `d12b854d4825e9edfa3a3466909e1abf3525e929`, the candidate word has +SHA256 `f0753b6614b2d351723dddc307a39b6ecd748a43008c6fdb9335b01feeec9669`. +Its zero-based clock 100504 is `ADD 210,457,-1/2` in chart 218, after the +role-457 MOVE from chart 966. Exact same-grid arithmetic requires an even +source numerator. The retained nearest-up service computes +`x - floor(y/2)` on every canonical signed field whose rounded output fits. +No evenness condition is needed on that domain. + +The source-specific result is stronger than a norm estimate. Among all +49504 later native events, only clock 100527 touches role 210, with +`ADD 210,292,-1/2`. No later event reads role 210 as a source. Therefore +the difference from this single rounded site reaches native return only +in public role 210, with multiplier one. It affects no owned erasure. + +Read [PROOF.md](PROOF.md), [RESULT.json](RESULT.json), +[VENDORED.json](VENDORED.json), and the retained input pins in +[SOURCES.json](SOURCES.json). + +## Literal execution and charge + +The unchanged compiler and primitive executor from +[PR 6988](https://github.com/CrocSwap/integer-mult-bounds/pull/6988) +produce a 669-row, 210-state table with three reachable carry values. +The table uses only branch, write, unit move, goto, halt and reject. +Runtime tape payloads are not read by a numerical callback. +The exact local source token selects the table in the primitive fixture. + +The service uses two distinct private work banks. For R real components, +S=sum(w_i+1), old dirty physical lengths A_0,A_1, and Q_c borrowed contexts, +the retained all-size bound is: + +```text +512(S+1) + 64R + 7(A_0+A_1) + 16Q_c +``` + +The units include physical reads, writes, unit moves and executed control +rows. Private resident backing is +`max(H_0,3S) + max(H_1,3(S+1))`, with prior capacities H_0,H_1. +Source/table setup, public fields, metadata and protected ancestors remain +separate positive charges. No exchange rate to the old supplier tariff is +assumed. + +At widths 1 through 5, the literal interpreter checks all 1364 signed +input pairs: 1193 succeed and 171 correctly reject on final range. +Further checks cover both odd signs, late whole-field overflow, reuse of +87 dirty work cells after failure, and a 512-complex-value field. +That field uses 985272 measured physical/control actions including a +64-step wrapper allowance, below the bound 2687504. +These are operation counts, not wall-time performance measurements. + +On success, the source and context stay unchanged, all heads return and +both work bodies are erased. On failure, the complete public target stays +unchanged; work and heads can remain dirty. Six controls cover a wrong +clock, wrong coefficient token, wrong-sign table, late overflow, a legal +outbound read of role 210, and a legal SCALE that changes the error gain. + +## Error and range + +For each real component, the error relative to exact halving is +`Delta*(y mod 2)/2`, where Delta is the grid step. It lies in +`{0, Delta/2}`. For N complex coordinates the field error is at most +`Delta*sqrt(N/2)` in Euclidean norm. The odd-pair fixture attains this +bound. The exact native-return multiplier is one; all other field and +owned-observation differences from this one site are zero. + +For a W-bit signed target with endpoints L and U, success holds exactly +when every component satisfies `L <= x-floor(y/2) <= U`. +This is a range contract, not a proof that every full-word trajectory +stays in range. The other half-ADD at 100527 remains a separate scalar +obligation. The comparison holds the other operations fixed and uses +their stated local semantics and nonaliasing. + +## Limits + +The result reuses CubeJerry's all-size scalar/lifecycle theorem. It does +not claim a new rounding algorithm or an independent replacement proof +of the retained compiler. The new work is the current source binding, +literal consumer fixture, precise charge specialization and terminal +error theorem. The fixture invokes the unchanged primitive method on +its required state. It does not run the complete recursive Controller. + +No full native prefix is executed on these local odd fixtures. No complete +17-call rounded caller, all-coefficient installation, common physical +tariff, private backing schedule, native provider or outer recovery is +established. The five inherited assumptions remain: `native_all_columns`, +`owned_erasure`, `compiler`, `precision_tape`, `analytic_recovery`. +The source's conditional bound and the selected record are unchanged. + +## Reproduce + +Use Python 3.12 and the standard library: + +```sh +python3.12 -B scripts/research_package.py --package research/current-half-add-service +``` + +Both commands must print `PASS_CURRENT_HALF_ADD_SERVICE`. The runner must +print `PASS_REGISTERED_RESEARCH_PACKAGE`. The normal and optimized isolated +commands read only the declared inputs. They write no files and use no Git +or network. The official export includes the retained source closure. + +## Open next questions + +Check whether the two half-ADDs can share a rounded-domain guarantee or a +joint rounding rule without changing the input epochs. Then bind all +17 occurrences to the signed caller and charge the physical work. +[TASK.json](TASK.json) records these questions and their open obligations. + +## Credit + +Clear1nsight supplied the exact PR7660 candidate and requested this scalar +review. Its retained NOTICE credits DreamingOfClouds, SYLforge, Ali Romman, +Rohan Arun and the source lineage. CubeJerry supplied the unchanged literal +rounded scalar compiler, lifecycle executor, physical fixtures and all-size +cost proof. [PR 6990](https://github.com/CrocSwap/integer-mult-bounds/pull/6990) and +Nick Petalas's [PR 7268](https://github.com/CrocSwap/integer-mult-bounds/pull/7268) +are related general compiler work; neither is imported here. The scalar source headers and the declared +source closure retain their licenses and attribution. + +Ali Romman directed the new source-bound proof and verification with +substantial OpenAI Codex assistance. New work is Apache-2.0. The base is +`e54523517d0f03e58352e647c403a5af3e525a57`. diff --git a/research/current-half-add-service/RESULT.json b/research/current-half-add-service/RESULT.json new file mode 100644 index 0000000000..7d7cc5d6a1 --- /dev/null +++ b/research/current-half-add-service/RESULT.json @@ -0,0 +1,118 @@ +{ + "word_sha256": "f0753b6614b2d351723dddc307a39b6ecd748a43008c6fdb9335b01feeec9669", + "clock": 100504, + "raw": [ + "ADD", + 210, + 457, + "-1/2", + 218 + ], + "physical": { + "construction": { + "operation": "ADD", + "coefficient": "-1/2", + "denominator_twos": 1, + "odd_denominator": 1, + "rounding_offset": 1, + "carry_bound": 5, + "carry_states": 3, + "residue_states": 0, + "rows": 669, + "states": 210, + "public_ports": 2, + "work_ports": 2, + "residue_prepass": false + }, + "table_sha256": "fc45cabd70bd9b2ea4c35b8f46a87a13c5e96127e036b630ea46cf9f28a4a152", + "exhaustive_pairs": 1364, + "successful_pairs": 1193, + "range_rejections": 171, + "maximum_observed_charge": 2542, + "minimum_bound_slack": 1754, + "odd_boundary": { + "fits": true, + "output": [ + 0, + 1 + ], + "charged": 2158, + "bound": 5832, + "table_steps": 251, + "old_dirty": 8 + }, + "late_overflow": { + "fits": false, + "output": null, + "charged": 1010, + "bound": 11024, + "table_steps": 141, + "old_dirty": 0 + }, + "reuse_after_failure": { + "fits": true, + "output": [ + 0, + 1 + ], + "charged": 1949, + "bound": 4337, + "table_steps": 159, + "old_dirty": 87 + }, + "native_512_field": { + "fits": true, + "charged": 985272, + "bound": 2687504, + "table_steps": 119825, + "old_dirty": 0 + }, + "controls": [ + "wrong clock", + "wrong coefficient token", + "wrong-sign table", + "late whole-field overflow" + ] + }, + "suffix_error": { + "suffix_events": 49504, + "maximum_field_gain": "1", + "maximum_field_gain_witness": [ + 100505, + 210 + ], + "strict_peak_power_of_two": 1, + "maximum_public_gain": "1", + "maximum_public_role": 210, + "public_sum_squared_gains": "1", + "nonzero_public_upper_bounds": 1, + "suffix_clear_count": 75, + "nonzero_clear_upper_bounds": 0, + "clear_bounds_sha256": "2ab471dcd110ff6a8dedce2aec26f4cf9e29ac2171ef61501f2291b135296069", + "public_gains_sha256": "202c0b98e5187c2dbb6233dd51ca806d086b5fac7b1006be773a2f402adb0ea6", + "backward_witness_gain": "1" + }, + "terminal_dependency": { + "later_target_updates": [ + [ + 100527, + [ + "ADD", + 210, + 292, + "-1/2", + 218 + ] + ] + ], + "later_source_reads": 0, + "returned_public_role": 210, + "returned_chart": 218, + "other_public_and_owned_differences": 0, + "exact_difference_multiplier": 1 + }, + "dependency_controls": [ + "legal reversed ADD exports the error", + "legal SCALE changes the error gain" + ] +} diff --git a/research/current-half-add-service/SOURCES.json b/research/current-half-add-service/SOURCES.json new file mode 100644 index 0000000000..ab8b2e06d8 --- /dev/null +++ b/research/current-half-add-service/SOURCES.json @@ -0,0 +1,90 @@ +{ + "schema_version": 1, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "research/current-rounded-scalar-tables/DEPENDENCIES.json", + "usage": "input", + "git_blob": "f9f579cf50b0d4ecb3488764a27a8b696af364c0", + "sha256": "4bc8727be61a12f65dd6c46efcd6ecb7025c88897b547218d457c7282224137a" + }, + { + "path": "research/current-rounded-scalar-tables/PROOF.md", + "usage": "input", + "git_blob": "498145c6ac72b3c2ef7a0adf166570f4073b68ca", + "sha256": "ebf8634a004ef9371831171ae5ed1bcbe55e9c2931b56d8113556f27f8ded830" + }, + { + "path": "research/current-rounded-scalar-tables/README.md", + "usage": "input", + "git_blob": "06f74137fa17e34bebbd66d588eb6d514affdb0e", + "sha256": "9f3b3674f43dc16c3487412cf2be36f20c8772c12624419b7f484803fb1312c1" + }, + { + "path": "research/current-rounded-scalar-tables/data/word.json.gz", + "usage": "input", + "git_blob": "d93e67ca7628bf5531ae6e369da4dd7b7907b88f", + "sha256": "273e81f176f001684b1fa3eb857992bf58b54748004fcfe806b83adb48d2cc00" + }, + { + "path": "research/current-rounded-scalar-tables/physical.py", + "usage": "input", + "git_blob": "027b563887fd748438d0d0dc7a75f356b29986bd", + "sha256": "b0eb6f2db2deff9104cdf786a8ae84b0d4864b09a1f9b99178cb08c1666d014e" + }, + { + "path": "research/current-rounded-scalar-tables/reference/PRECISION-PROOF.md", + "usage": "input", + "git_blob": "465a5dddd83bdea5db09f1030f99dffe698fe600", + "sha256": "8ddafd9a4c5b51d4c0e3f9b4a9eba27712335a16de1868ba156557344af86e63" + }, + { + "path": "research/current-rounded-scalar-tables/reference/ROUNDED-DIVISION-6937.md", + "usage": "input", + "git_blob": "ed609f6a0e26dd00d6c55f876b667e15051507ca", + "sha256": "9ecff5835fae5fcdbf416711a5ef0e69d51afb535c55570ab3e1fef6f920f146" + }, + { + "path": "research/current-rounded-scalar-tables/reference/check_6937.py", + "usage": "input", + "git_blob": "cebc2062a3939e5b2e415fe5aa6d3d8ce1d6cdac", + "sha256": "f25a9960396561e166264f8b695a3012b2d062b46744e39d073d57ecbc43f163" + }, + { + "path": "research/current-rounded-scalar-tables/source_binding.py", + "usage": "input", + "git_blob": "34968a492e29e1f88d0d6ee0f4adf07327de4e6e", + "sha256": "1ff54c898d8cbc4ff556740ab3fb58490ae308b296853276fec1aa6d728a58a2" + }, + { + "path": "research/current-rounded-scalar-tables/tables.py", + "usage": "input", + "git_blob": "0978b84271ec46e568481be75fce2c5ecb9493ea", + "sha256": "502e7a88ef704d79a09e62deef93a98db7626254d67133253baa7284baa47bca" + }, + { + "path": "research/current-rounded-scalar-tables/vendor/exact_scalar_tables.py", + "usage": "input", + "git_blob": "1cc22f75fbe53d48b84be42782e581c04820cd49", + "sha256": "654e9734ef80a9394807ca508543b1bc164afb5768d23d0e5a88c790d2f13bac" + }, + { + "path": "research/current-rounded-scalar-tables/vendor/machine.py", + "usage": "input", + "git_blob": "acf475e4fccaff2fb64bd5b0b3f3fc0d246dc592", + "sha256": "ec597bce13275003ff30e4be481c936401826c1d4af642b55eec0c410774d1df" + } + ] +} diff --git a/research/current-half-add-service/TASK.json b/research/current-half-add-service/TASK.json new file mode 100644 index 0000000000..90baecd721 --- /dev/null +++ b/research/current-half-add-service/TASK.json @@ -0,0 +1,91 @@ +{ + "schema_version": 1, + "task_id": "uniform-transfer-audit", + "priority_revision": 8, + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "original_card": { + "id": "uniform-transfer-audit", + "question": "Can one of the selected record's five inherited assumptions be proved at its actual caller?", + "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" + ], + "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": "Identify the proposition and what would change downstream; do not equate a finite replay with a universal proof.", + "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": "Choose one assumption ID (native_all_columns, owned_erasure, compiler, precision_tape, analytic_recovery), one quantified implication and exact dependency closure. Check current handoffs, including #5625 row reentry and #5707 root-prefix lowering, without treating their partial scope as the whole theorem. Prove or falsify that implication with a caller-bound argument; stop at the chosen obligation. Finite tests or root digits do not discharge an all-size statement.", + "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": [ + "native_all_columns", + "owned_erasure", + "compiler", + "precision_tape", + "analytic_recovery" + ], + "existing_checks": [ + { + "scope": "PR #4100: proposed unconditional construction and finite checks, without independent acceptance.", + "evidence": "research/unconditional-batched-crt/README.md", + "remaining": "Independent proof audit of one caller-bound all-size implication; all other premises remain explicit.", + "status": "author-checked", + "source_commit": "337d04939571a637aeab54a0f58f54fde811663a", + "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": "refined", + "actual_scope": "Bind the retained literal rounded half-ADD service to PR7660 clock 100504, with complete primitive cost, exact signed range and exact terminal error transport.", + "scope_change_reason": "The live PR7660 review requests a total rounded alternative at this exact scalar boundary. This is one precision/tape implication on a changed candidate, not a proof of the whole selected assumption.", + "bottleneck_link": "The exact service needs even source numerators. The retained rounded service removes that parity condition on its stated final-range domain. The new suffix certificate proves that its one-site error reaches only public role 210 with gain one.", + "budget_minutes": 100, + "stop_rule": "Stop after the source-bound primitive, range/cost proof, terminal-dependency certificate and finite controls. Do not install it in the full caller or exchange its physical charge for the old tariff.", + "outcome": "completed", + "evidence": "RESULT.json binds the 669-row table, 1364 exhaustive signed pairs, 512-complex-value field, dirty failure reuse, six controls and all 49504 suffix events. Only the later ADD at 100527 touches the changed field, as a target.", + "author": "Ali Romman", + "ai_assistance": "Ali Romman directed the work. OpenAI Codex wrote the new binding, source-specific proof, verifier and documentation. The scalar compiler and lifecycle executor are unchanged CubeJerry predecessors.", + "open_questions": [ + { + "question": "Can the next half-ADD at clock 100527 share a rounded-domain guarantee or a joint rounding rule?", + "why_it_matters": "The local result at 100504 does not discharge the second exact division or the complete rounded word.", + "first_step": "Check the intervening source reads and writes before proposing a source-bound combined service.", + "blocked_by": "A combined service must preserve the actual input epochs, public range and complete private cost." + }, + { + "question": "Does the full signed caller admit the new arithmetic and its physical charge?", + "why_it_matters": "An isolated primitive and native-return error do not establish caller precision, recursive billing or multiplication recovery.", + "first_step": "Bind all 17 local occurrences, propagate each returned error through the exact caller and add the new cost in one physical tariff.", + "blocked_by": "All other rounded scalar/native interfaces, complete owned backing and outer recovery remain open." + } + ], + "coordination_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19698611", + "handoff_url": "https://github.com/CrocSwap/integer-mult-bounds/discussions/1166#discussioncomment-19697081" +} diff --git a/research/current-half-add-service/VENDORED.json b/research/current-half-add-service/VENDORED.json new file mode 100644 index 0000000000..e5cb93bc1f --- /dev/null +++ b/research/current-half-add-service/VENDORED.json @@ -0,0 +1,41 @@ +{ + "schema_version": 1, + "files": [ + { + "path": "source/WORD.json.gz", + "repository": "Clear1nsight/integer-mult-bounds", + "commit": "d12b854d4825e9edfa3a3466909e1abf3525e929", + "source_path": "research/p104-role379-idle-stop/application-evidence/signed-replay/data/WORD.json.gz", + "git_blob": "e05407f54fc3534781ae0af989a973bd165d162b", + "sha256": "4e9cd9cc70a5423db44f870b35d8d6da9ac5746aa352f3af1420443f6dda350e", + "url": "https://github.com/Clear1nsight/integer-mult-bounds/blob/d12b854d4825e9edfa3a3466909e1abf3525e929/research/p104-role379-idle-stop/application-evidence/signed-replay/data/WORD.json.gz" + }, + { + "path": "source/GRID.json", + "repository": "Clear1nsight/integer-mult-bounds", + "commit": "d12b854d4825e9edfa3a3466909e1abf3525e929", + "source_path": "research/p104-role379-idle-stop/application-evidence/receipts/candidate/GRID.json", + "git_blob": "8d75f3629961bb7c1fd2aac7fb604c629c7132c8", + "sha256": "bc5a54b8975e01be3f37c54f8b3b1f0ecfb82167794b2fea06da60423753e017", + "url": "https://github.com/Clear1nsight/integer-mult-bounds/blob/d12b854d4825e9edfa3a3466909e1abf3525e929/research/p104-role379-idle-stop/application-evidence/receipts/candidate/GRID.json" + }, + { + "path": "source/NOTICE", + "repository": "Clear1nsight/integer-mult-bounds", + "commit": "d12b854d4825e9edfa3a3466909e1abf3525e929", + "source_path": "research/p104-role379-idle-stop/NOTICE", + "git_blob": "cd7d35e2cb65e0945b17650aba43ade6e0676856", + "sha256": "a747270c15ce19ff629dfcf86b959de43cf8bf26e1a01c981f6b22961337030c", + "url": "https://github.com/Clear1nsight/integer-mult-bounds/blob/d12b854d4825e9edfa3a3466909e1abf3525e929/research/p104-role379-idle-stop/NOTICE" + }, + { + "path": "source/LICENSE", + "repository": "Clear1nsight/integer-mult-bounds", + "commit": "d12b854d4825e9edfa3a3466909e1abf3525e929", + "source_path": "research/p104-role379-idle-stop/LICENSE", + "git_blob": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "sha256": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4", + "url": "https://github.com/Clear1nsight/integer-mult-bounds/blob/d12b854d4825e9edfa3a3466909e1abf3525e929/research/p104-role379-idle-stop/LICENSE" + } + ] +} diff --git a/research/current-half-add-service/VERIFY.json b/research/current-half-add-service/VERIFY.json new file mode 100644 index 0000000000..492407c1db --- /dev/null +++ b/research/current-half-add-service/VERIFY.json @@ -0,0 +1,47 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/current-rounded-scalar-tables/DEPENDENCIES.json", + "research/current-rounded-scalar-tables/PROOF.md", + "research/current-rounded-scalar-tables/README.md", + "research/current-rounded-scalar-tables/data/word.json.gz", + "research/current-rounded-scalar-tables/physical.py", + "research/current-rounded-scalar-tables/reference/PRECISION-PROOF.md", + "research/current-rounded-scalar-tables/reference/ROUNDED-DIVISION-6937.md", + "research/current-rounded-scalar-tables/reference/check_6937.py", + "research/current-rounded-scalar-tables/source_binding.py", + "research/current-rounded-scalar-tables/tables.py", + "research/current-rounded-scalar-tables/vendor/exact_scalar_tables.py", + "research/current-rounded-scalar-tables/vendor/machine.py" + ], + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Exact current token, unchanged literal service, all signed pairs at widths 1..5, complete-field lifecycle/cost, exact terminal dependency and six controls." + }, + { + "argv": [ + "{python}", + "-I", + "-W", + "error", + "-B", + "-O", + "{package}/verify.py" + ], + "timeout_seconds": 120, + "checks": "Repeat all checks with assertions disabled and compare the same complete receipt." + } + ] +} diff --git a/research/current-half-add-service/source/GRID.json b/research/current-half-add-service/source/GRID.json new file mode 100644 index 0000000000..8d75f36299 --- /dev/null +++ b/research/current-half-add-service/source/GRID.json @@ -0,0 +1,434 @@ +{ + "status": "FINITE_GRID_AND_ENVELOPE_ONLY", + "compressed_word_sha256": "4e9cd9cc70a5423db44f870b35d8d6da9ac5746aa352f3af1420443f6dda350e", + "decompressed_sha256": "f0753b6614b2d351723dddc307a39b6ecd748a43008c6fdb9335b01feeec9669", + "canonical_word_sha256": "f0753b6614b2d351723dddc307a39b6ecd748a43008c6fdb9335b01feeec9669", + "caller_sha256": "255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc", + "source_pins": { + "derive_grid.py": "ceb7a44ef19d72a16db7b43c65c85910d965499d1715436011de32af5d39dbb0", + "independent_bounds.py": "198521def614fe78fa728f1dde2b7fb820c0c0e0ac3ad0c9224dccbf51eac0d5", + "envelopes.py": "783da6b5b450fc07434946cb9ec86070dfee01df6b5fa1c385cb024def2c9a9f", + "source_binding.py": "624c459311c58f3847b7713b818bfd340153abf42919f02ac9aa8892ed52a2bd", + "ODD-TYPE-AB-CALLER.json": "255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc", + "ODD-CALLER-EXACT-GRID.json": "87d25d9fa3778bf4784e3a9e17f32ce5ba372663c6e97392cc62b87e6719042c" + }, + "engines": { + "rational": { + "source_sha256": "ceb7a44ef19d72a16db7b43c65c85910d965499d1715436011de32af5d39dbb0", + "adapted_sha256": "ceb7a44ef19d72a16db7b43c65c85910d965499d1715436011de32af5d39dbb0", + "edits": [] + }, + "integer": { + "source_sha256": "198521def614fe78fa728f1dde2b7fb820c0c0e0ac3ad0c9224dccbf51eac0d5", + "adapted_sha256": "198521def614fe78fa728f1dde2b7fb820c0c0e0ac3ad0c9224dccbf51eac0d5", + "edits": [] + }, + "binding": { + "source_sha256": "624c459311c58f3847b7713b818bfd340153abf42919f02ac9aa8892ed52a2bd", + "adapted_sha256": "624c459311c58f3847b7713b818bfd340153abf42919f02ac9aa8892ed52a2bd", + "edits": [] + }, + "envelope": { + "source_sha256": "783da6b5b450fc07434946cb9ec86070dfee01df6b5fa1c385cb024def2c9a9f", + "adapted_sha256": "01463d192d08d7cb04979a1c2ac374c594948aa506d3fa2115fa487f79935d75", + "edits": [ + { + "old": "elif op in (\"LAMBDA\", \"IDLE_ONE\"):", + "new": "elif op in (\"LAMBDA\", \"IDLE_ONE\", \"IDLE_ODD\"):", + "count": 2 + }, + { + "old": "all(0 <= r < 38 for r in ar) and all(38 <= r < 76 for r in br[:2])", + "new": "all(caller[\"types\"][\"A\"][\"offset\"] <= r < caller[\"types\"][\"A\"][\"offset\"] + caller[\"types\"][\"A\"][\"roles\"] for r in ar) and all(caller[\"types\"][\"B\"][\"offset\"] <= r < caller[\"types\"][\"B\"][\"offset\"] + caller[\"types\"][\"B\"][\"roles\"] for r in br[:2])", + "count": 1 + }, + { + "old": "all(1 <= k <= 18 for k in e[3])", + "new": "all(1 <= k <= caller[\"stages\"] for k in e[3])", + "count": 1 + }, + { + "old": "need(j_order == list(range(1, 19)), \"exact eighteen native calls\")", + "new": "need(j_order == list(range(1, caller[\"stages\"] + 1)), \"all chronological native calls\")", + "count": 1 + }, + { + "old": "word[\"public\"] - len(mains) == 1061", + "new": "word[\"public\"] - len(mains) == expected_helper_count", + "count": 1 + }, + { + "old": "physical_main_inputs=3952, fresh_arbitrary_helpers=18 * 1061,", + "new": "physical_main_inputs=sum(t[\"roles\"] * len(t[\"ports\"]) for t in caller[\"types\"].values()), fresh_arbitrary_helpers=caller[\"stages\"] * expected_helper_count,", + "count": 1 + }, + { + "old": "need(len(e[3]) == len(set(e[3]))", + "new": "need(op != \"IDLE_ODD\" or (len(e[3]) == 1 and e[4] == -1), \"signed child signature\")\n need(len(e[3]) == len(set(e[3]))", + "count": 1 + }, + { + "old": "(life, peak, owned_count) == (54, 43, 51)", + "new": "(life, peak, owned_count) == (234, 50, 68)", + "count": 1 + } + ] + } + }, + "rational_grid": { + "odd_scale": 225, + "fractional_bits": 14, + "unscaled_maximum_mass": "1291569/10", + "scaled_maximum_mass": "58120605/2", + "mass_witness": [ + 119468, + "stored" + ], + "coefficient_visits": 24277036 + }, + "integer_grid": { + "odd_scale_lcm": 225, + "dyadic_height": 14, + "maximum_scaled_mass": "58120605/2", + "mass_witness": [ + 119468, + "stored add" + ], + "numerator_bits": 18, + "coefficient_visits": 24277036 + }, + "native_envelope": { + "census": { + "events": 150009, + "public": 1501, + "owned_labels": 68, + "lifetimes": 234, + "peak_owned": 50, + "opcodes": { + "SCALE": 4149, + "ADD": 139227, + "INIT": 234, + "MOVE": 6165, + "CLEAR": 234 + }, + "scalars": { + "integer": 60504, + "dyadic": 136669, + "noninteger": 82872, + "odd": 6707 + }, + "max_numerator": 199393, + "numerator_bits": 18, + "max_denominator": 15360, + "denominator_bits": 14 + }, + "bounds": { + "M": { + "exact": "224853608172628518474883117854804320388212148643409443/39137889484800000", + "strict_power_of_two": 123, + "witness": { + "cut": 146206, + "register": 1428, + "factor": "1", + "kind": "stored" + } + }, + "Sigma": { + "exact": "88868123222295382265912417766187724151032108484241/19568944742400000", + "strict_power_of_two": 112, + "witness": { + "cut": 146206, + "register": 1428, + "factor": "1", + "kind": "stored" + } + }, + "Gamma": { + "exact": "88868123222295382265912417766187724151032108484241/19568944742400000", + "strict_power_of_two": 112, + "witness": { + "cut": 150009, + "register": 1428, + "factor": "1", + "kind": "public-return" + } + } + }, + "independent_adjoint": { + "M": { + "entrance_mass": "224853608172628518474883117854804320388212148643409443/39137889484800000", + "residual_mass": "88868123222295382265912417766187724151032108484241/19568944742400000", + "active_residual_sites": 52859 + }, + "Sigma": { + "entrance_mass": "224853608172628518474883117854804320388212148643409443/39137889484800000", + "residual_mass": "88868123222295382265912417766187724151032108484241/19568944742400000", + "active_residual_sites": 52859 + }, + "Gamma": { + "entrance_mass": "224853608172628518474883117854804320388212148643409443/39137889484800000", + "residual_mass": "88868123222295382265912417766187724151032108484241/19568944742400000", + "active_residual_sites": 52859 + } + } + }, + "caller_envelope": { + "bounds": { + "M_caller": { + "exact": "321214676655933560129782836030951119958622429471431692811117505066079252658303325303661828534046786576018850667853596288128047313819788006911616028348392581085050721023636971054851673799947587501432346122953175312809813833001587100311020687804583808767060460431114911369649528995555025426696059541/456139469146728515625000000", + "strict_power_of_two": 897, + "witness": { + "event": 4750, + "register": 37, + "cut": 4751, + "factor": "1", + "kind": "stored" + } + }, + "Sigma_caller": { + "exact": "330760398163091904274517275209669219972015945865458218163734882060695321306451726653037009573081354800444678063559544717421760840994040604790042887364557399083547601282242680052564909509962951504752010259120191359591522788506772808919180865748847577957182898163352134613269341707563134066891785388656117877084183091567768369238016129985497933507/214228033597440000000000000000000000000000000", + "strict_power_of_two": 998, + "witness": { + "event": 4752, + "register": 37, + "cut": 4753, + "factor": "1", + "kind": "stored" + } + }, + "M_joint_entrance": { + "exact": "12446513821466013746992171114880354528234540647439407368041740746722705684890095694539586093101687855496797040728247169012299728404791642365323413178973703529222728715961384485250463009966565309368602073434714550373752128374887698957802006867751735225949803848812917591840288770078529478244705471/608185958862304687500000000", + "strict_power_of_two": 892, + "witness": { + "event": 4691, + "register": 36, + "cut": 4691, + "factor": "1", + "kind": "stored" + } + }, + "E_joint_entrance": { + "exact": "12816394039616740054301428707738206262972920737292416934306677378582252953391659109122294219681298187634891498582629514903927815803255251319901355830097785447995374021759550611999121237104494113109034303943474746005063322533097631605030572291283845821714463350613118907293501490209740336309717504347943306623785346190380992477072794929181180617/285637378129920000000000000000000000000000000", + "strict_power_of_two": 993, + "witness": { + "event": 4691, + "register": 36, + "cut": 4691, + "factor": "1", + "kind": "stored" + } + }, + "M_context": { + "exact": "2798643541927124281565622653405811567254114435814381562954829829904044911025149119256416590944270172033820842434555214201348455495477587726146953089298606236886344310265002192927363173667316792923604772702767535736828157980095365812835163225081225571631868036442186408761492427582224034439095062462622547720346433409678960684512818380768272795162653/23803114844160000000000000000000000000000000", + "strict_power_of_two": 1014, + "witness": { + "event": 4691, + "register": null, + "cut": 4692, + "factor": "1", + "kind": "stored" + } + }, + "Sigma_context": { + "exact": "2881812443569994053657152449243936360004691846231651634961872013947121632155651449114923443392571962658954847320581884752631805214753542056312271519371617361668852262758313642922518451378683072169685262934649726334956074695505708738720277758054959159768087107714460577895841118368288171075782936934446146283002172165157719384716258279487470664369457156933265888072027242393396704339223182866366331/11179244137976837456265216000000000000000000000000000000000000", + "strict_power_of_two": 1115, + "witness": { + "event": 4691, + "register": null, + "cut": 4692, + "factor": "1", + "kind": "stored" + } + }, + "Gamma_context": { + "exact": "330760398163091904274517275209669219972015945865458218163734882060695321306451726653037009573081354800444678063559544717421760840994040604790042887364557399083547601282242680052564909509962951504752010259120191359591522788506772808919180865748847577957182898163352134613269341707563134066891785388656117877084183091567768369238016129985497933507/214228033597440000000000000000000000000000000", + "strict_power_of_two": 998, + "witness": { + "register": 37, + "cut": 4783, + "factor": "1", + "kind": "public-return" + } + } + }, + "sites": { + "ADD": 4126, + "noninteger_scalar": 1752, + "SCALE": 312, + "IDLE_ONE": 90, + "LAMBDA": 178, + "J": 17, + "IDLE_ODD": 4, + "SWAP": 52, + "QUERY": 4 + }, + "joint_entries": [ + { + "event": 43, + "stage": 1, + "entrance_mass": "2067/2", + "entrance_defect": "1435/4" + }, + { + "event": 137, + "stage": 2, + "entrance_mass": "56849465528/5", + "entrance_defect": "152445000652388054806622022823066786597401963145058401087/6115295232000000" + }, + { + "event": 268, + "stage": 3, + "entrance_mass": "899756300051784928313/5", + "entrance_defect": "231623719028921087238185337903798137131038383691130798863630100203967/587068342272000000" + }, + { + "event": 432, + "stage": 4, + "entrance_mass": "2514111326902273689027625979152/15", + "entrance_defect": "215735385072722726983392744991929660030483938415353428881951585786071837538431/587068342272000000" + }, + { + "event": 633, + "stage": 5, + "entrance_mass": "513576167499541081817002847690160861158177/15", + "entrance_defect": "44069867182931405474784010397780283583054513179433220196190933548119103921540282929486201/587068342272000000" + }, + { + "event": 867, + "stage": 6, + "entrance_mass": "49174910102467876864090432969907258581035345395534834/225", + "entrance_defect": "4219689101812318065496804353013134594647242022349188471551403631186223364399726172850297087689751909/8806025134080000000" + }, + { + "event": 1138, + "stage": 7, + "entrance_mass": "47202796791779792903787260464709452698419616298153732189406926691/225", + "entrance_defect": "450051384113231625178216600108342294792918250259791159160757423357718853252014635332357419408908864986988713259/978447237120000000" + }, + { + "event": 1423, + "stage": 8, + "entrance_mass": "1527059719525243651854937925515623170877847518562264265010551055991429949116792541/28125", + "entrance_defect": "131036686043150759588914531707300949777442858451143074046692878249208644168083618286169551437677833712439578351677360281541371261/1100753141760000000000" + }, + { + "event": 3058, + "stage": 9, + "entrance_mass": "45382020709918266925583064268574418985484021788023395083741971786893952543604385214817042722264713249357732585113211736557042182118473445437784492974844696068231496289005681248244219743195326431922663592509646282903/2703048706054687500000000", + "entrance_defect": "46730664351108408440621109049557856787146375271160685350167861349657561892038926537018269482094425089642970843256500859029681099002229882531828524024840116640949518146088806254258465418121091054640780216659463152810781264649427090559528322522771147024254729588081/1269499458355200000000000000000000000000000" + }, + { + "event": 3377, + "stage": 10, + "entrance_mass": "17256576412236653193246225901973714737195067836439327666112948810725372605325768521068989782195051084826433423902219365061463548934152577319772447024097669813834215493691840531234110147024064996639957180865886380686899413865699437/67576217651367187500000000", + "entrance_defect": "17769400030114656297936737956471154159343889109160054297060066950418102417086513998308593454598711220222547901089621758307161980549115005470735651700156194295084928435231962012741786189765280487308699883745500711995873254844179355891984596060009803480632653963546827482512901099/31737486458880000000000000000000000000000000" + }, + { + "event": 3674, + "stage": 11, + "entrance_mass": "8232867642949280967953864719378369729636081542640965177026582834276172086852779069019078166383458700724373015543641299678854718814560615654710102550769670203427726502361438450768012893674227975469242856299447027845030556012745339827937032703/2252540588378906250000000", + "entrance_defect": "8477528511322579391638204101689370700961529244503175519829441746363318824628142782040929472355385836353611118980014671389090956612517570862511435645890613925978793808343058318624481887419040746163434313537168637824668065909753134690571750556935111468682638271080714347095521315512338852681/1057916215296000000000000000000000000000000" + }, + { + "event": 3934, + "stage": 12, + "entrance_mass": "103457615351059805192637231353494210876529187337645013912367786609511281374638184501291799844537790265462481580051228205479278831706979374022592427678836083146990308179368316797029946556942233864286312243671687806427572314354434738422294564686254956597631/304092979431152343750000000", + "entrance_defect": "106532124879133961010122345615400533137015197093534458724215993599048343765866886740376516910012235550866719309166932613891587897163228425819499970388216177292101426939339380943887314486644369691153785520387426184166715092608908210073559420840396800974138677242538066078926329096947646214992794243352937/142818689064960000000000000000000000000000000" + }, + { + "event": 4149, + "stage": 13, + "entrance_mass": "6814687293408352348961376609223100753789665399854180217091951198766673494955017243489117504312576625705862588971333049204842152193259763726092611947454717867967563820647006231530855513792517852570389360287582421241328472893443552787136426885585158158296407747039/76023244857788085937500000", + "entrance_defect": "7017203279721536128573055893157348471869455080700156838636358334720679714539945828043102784105832212657860106869531016262007694474929451090611843945021605816226618144449118208464565849165267721194901177937719196643075390972312596648144243561638043117304079361205618662531932812689582378841823705175662310586153/35704672266240000000000000000000000000000000" + }, + { + "event": 4337, + "stage": 14, + "entrance_mass": "273688564209132230699064882255651065961520374651451250325109091529813162250488973700796593555467744131430272845604649750549608356985710665121874068107850799585492748533787927289567936649257940207702597871193107311090132538524151482351564937285621850171994049078063458209591/608185958862304687500000000", + "entrance_defect": "281821924866350323530868330226315067107552433830868844794151998799016053933313333263147616526717787268902343023488296130694126949144258149718072441264161458417377584443800306444086587400624204403928538970342624982137950738662947278975690488162279687521167196072451026064463427681372246771090470760888860138508317214979857/285637378129920000000000000000000000000000000" + }, + { + "event": 4485, + "stage": 15, + "entrance_mass": "5230780602279043381317572379439763694807653157987526423412516241866438709931406455512285461654380762978554988724296151241130161368896505647624919395909388513302452136334767445346454946237326490486725295589968816639097338790755366202380875008783642473174121062695038054202858248061/304092979431152343750000000", + "entrance_defect": "5386226721411032900907848786311966719779361582529745735826658623768499974487600890482640651142577790842912307711775912024135199955708060620781069132791009866280447690080359914735848906486753759015370823479485596610103374692284277322646118864199647995045238127748879942287465360698906417078803049768506444863781508576485079771547/142818689064960000000000000000000000000000000" + }, + { + "event": 4606, + "stage": 16, + "entrance_mass": "5790424100720951765768300756324298709533962301792798636386692749870979029496708556989270788662796627612885676197810930990877069943243536093513215980405080279750566239442965631097385199413957318608000177913047677092759213914423460784984181631621622445055356552059259436283593839861423838063/608185958862304687500000000", + "entrance_defect": "5962501467948558399546510814853418578926874958292080723018797094633378813990050925034553765744902781049293536498331819037912150602655085854934190064389418037665869007447747787743470586288727112406021644495007835224445957888709082584134123760790323357539470625937613363892008688642118353832347159502504245077750020607068660710721850861401/285637378129920000000000000000000000000000000" + }, + { + "event": 4691, + "stage": 17, + "entrance_mass": "12446513821466013746992171114880354528234540647439407368041740746722705684890095694539586093101687855496797040728247169012299728404791642365323413178973703529222728715961384485250463009966565309368602073434714550373752128374887698957802006867751735225949803848812917591840288770078529478244705471/608185958862304687500000000", + "entrance_defect": "12816394039616740054301428707738206262972920737292416934306677378582252953391659109122294219681298187634891498582629514903927815803255251319901355830097785447995374021759550611999121237104494113109034303943474746005063322533097631605030572291283845821714463350613118907293501490209740336309717504347943306623785346190380992477072794929181180617/285637378129920000000000000000000000000000000" + } + ], + "independent_adjoint": { + "M_caller": { + "entrance_mass": "321214676655933560129782836030951119958622429471431692811117505066079252658303325303661828534046786576018850667853596288128047313819788006911616028348392581085050721023636971054851673799947587501432346122953175312809813833001587100311020687804583808767060460431114911369649528995555025426696059541/456139469146728515625000000", + "residual_mass": "330760398163091904274517275209669219972015945865458218163734882060695321306451726653037009573081354800444678063559544717421760840994040604790042887364557399083547601282242680052564909509962951504752010259120191359591522788506772808919180865748847577957182898163352134613269341707563134066891785388655903649050585651567768369238016129985497933507/214228033597440000000000000000000000000000000", + "joint_coefficient": "3721923971948022264020008386608472289590988528157114268392412469599050143495508978788641788787976594161440706214373829555996384554677122174093932095769106055424540710380314024651007332164525664382203471694821380954416641216321248248752759218861172626274920078125266851782731337714997593665899027/10947347259521484375000000000", + "primitive_coefficient": "31933635363307317503891208167952125518099265598871297188945655447689887409437080424471754322893069036961252717295444311531802702290424391181977246033332095685934810861449534911850277930109610390733877602745069385156892357266512877411313922547610591253415658016844390796247824792255124449682067424881/131368167114257812500000000000" + }, + "Sigma_caller": { + "entrance_mass": "321214676655933560129782836030951119958622429471431692811117505066079252658303325303661828534046786576018850667853596288128047313819788006911616028348392581085050721023636971054851673799947587501432346122953175312809813833001587100311020687804583808767060460431114911369649528995555025426696059541/456139469146728515625000000", + "residual_mass": "330760398163091904274517275209669219972015945865458218163734882060695321306451726653037009573081354800444678063559544717421760840994040604790042887364557399083547601282242680052564909509962951504752010259120191359591522788506772808919180865748847577957182898163352134613269341707563134066891785388656117877084183091567768369238016129985497933507/214228033597440000000000000000000000000000000", + "joint_coefficient": "3721923971948022264020008386608472289590988528157114268392412469599050143495508978788641788787976594161440706214373829555996384554677122174093932095769106055424540710380314024651007332164525664382203471694821380954416641216321248248752759218861172626274920078125266851782731337714997593665899027/10947347259521484375000000000", + "primitive_coefficient": "31933635363307317503891208167952125518099265598871297188945655447689887409437080424471754322893069036961252717295444311531802702290424391181977246033332095685934810861449534911850277930109610390733877602745069385156892357266512877411313922547610591253415658016844390796379192959369382262182067424881/131368167114257812500000000000" + }, + "M_joint_entrance": { + "entrance_mass": "12446513821466013746992171114880354528234540647439407368041740746722705684890095694539586093101687855496797040728247169012299728404791642365323413178973703529222728715961384485250463009966565309368602073434714550373752128374887698957802006867751735225949803848812917591840288770078529478244705471/608185958862304687500000000", + "residual_mass": "12816394039616740054301428707738206262972920737292416934306677378582252953391659109122294219681298187634891498582629514903927815803255251319901355830097785447995374021759550611999121237104494113109034303943474746005063322533097631605030572291283845821714463350613118907293501490209740336309717504347943306623785346190380992477072794929181180617/285637378129920000000000000000000000000000000", + "joint_coefficient": "144218124282401204617230263054514744346632405857442589144991781917530152132889870002846209306787762894150543865356389849084238452276894627352790762454037345126994351979907477144401257368423063007427271766117739822282248246858569624239109891511459830034432108241771054783468611278140179030295737/14596463012695312500000000000", + "primitive_coefficient": "1237373204913668966810008103424843603237049842106979534739539344726881600855129275554334885562896567825503574055929527662143657491595081161117482238618339640110136792453314323518006796600687371906278112102741547626404362403105174332310591538741639237757093806525664195341657589882317257470101709011/175157556152343750000000000000" + }, + "E_joint_entrance": { + "entrance_mass": "12446513821466013746992171114880354528234540647439407368041740746722705684890095694539586093101687855496797040728247169012299728404791642365323413178973703529222728715961384485250463009966565309368602073434714550373752128374887698957802006867751735225949803848812917591840288770078529478244705471/608185958862304687500000000", + "residual_mass": "12816394039616740054301428707738206262972920737292416934306677378582252953391659109122294219681298187634891498582629514903927815803255251319901355830097785447995374021759550611999121237104494113109034303943474746005063322533097631605030572291283845821714463350613118907293501490209740336309717504347943306623785346190380992477072794929181180617/285637378129920000000000000000000000000000000", + "joint_coefficient": "144218124282401204617230263054514744346632405857442589144991781917530152132889870002846209306787762894150543865356389849084238452276894627352790762454037345126994351979907477144401257368423063007427271766117739822282248246858569624239109891511459830034432108241771054783468611278140179030295737/14596463012695312500000000000", + "primitive_coefficient": "1237373204913668966810008103424843603237049842106979534739539344726881600855129275554334885562896567825503574055929527662143657491595081161117482238618339640110136792453314323518006796600687371906278112102741547626404362403105174332310591538741639237757093806525664195341657589882317257470101709011/175157556152343750000000000000" + }, + "Gamma_context": { + "entrance_mass": "321214676655933560129782836030951119958622429471431692811117505066079252658303325303661828534046786576018850667853596288128047313819788006911616028348392581085050721023636971054851673799947587501432346122953175312809813833001587100311020687804583808767060460431114911369649528995555025426696059541/456139469146728515625000000", + "residual_mass": "330760398163091904274517275209669219972015945865458218163734882060695321306451726653037009573081354800444678063559544717421760840994040604790042887364557399083547601282242680052564909509962951504752010259120191359591522788506772808919180865748847577957182898163352134613269341707563134066891785388656117877084183091567768369238016129985497933507/214228033597440000000000000000000000000000000", + "joint_coefficient": "3721923971948022264020008386608472289590988528157114268392412469599050143495508978788641788787976594161440706214373829555996384554677122174093932095769106055424540710380314024651007332164525664382203471694821380954416641216321248248752759218861172626274920078125266851782731337714997593665899027/10947347259521484375000000000", + "primitive_coefficient": "31933635363307317503891208167952125518099265598871297188945655447689887409437080424471754322893069036961252717295444311531802702290424391181977246033332095685934810861449534911850277930109610390733877602745069385156892357266512877411313922547610591253415658016844390796379192959369382262182067424881/131368167114257812500000000000" + } + }, + "physical_main_inputs": 3744, + "fresh_arbitrary_helpers": 18717, + "helper_allocation_premise": "distinct (stage, helper) public inputs as in frozen caller proof" + }, + "caller_grid_carried_from_matching_caller": { + "caller_sha256": "255d89f38cd45e38e5770f559bc43dc217e989032359768cdc7e8cdfd64b47bc", + "prime_order": [ + 2, + 3, + 5 + ], + "safe_valuation_bound": [ + 381, + 69, + 62 + ], + "grid_exponents": [ + 381, + 3, + 2 + ], + "caller_odd_scale": "675", + "caller_odd_scale_bits": 10, + "preproduct_exact_divisions": 176874, + "peak_terms": 3752, + "scope": "Independent integer Laurent caller endpoint and pre-product divisibility. Valuation bound propagates complete field operators whose Gaussian coefficients have only power-of-two denominators, so odd factors are sourced only from the charged scalar operations. Fixed conversion and storage bounds still needed." + }, + "context_height": 395, + "context_mass_bits": 1032, + "context_c": 2064, + "context_le_4096": true, + "elapsed_seconds": 77.32330691200332, + "scope": "Conditional positive rounded envelopes and fixed scalar grid; no physical supplier, full signed application, ordinary or fixed-tape qualification." +} diff --git a/research/current-half-add-service/source/LICENSE b/research/current-half-add-service/source/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/current-half-add-service/source/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/current-half-add-service/source/NOTICE b/research/current-half-add-service/source/NOTICE new file mode 100644 index 0000000000..cd7d35e2cb --- /dev/null +++ b/research/current-half-add-service/source/NOTICE @@ -0,0 +1,15 @@ +Apache-2.0. Clear1nsight, with substantial OpenAI Codex assistance. + +The unchanged data and upstream phase-check implementation for each +published word are under retained/pr7636 and retained/pr7658. Their +original NOTICE files credit DreamingOfClouds, Claude Opus 5.5 and the +full predecessor lineage. #7630 E6 and #7658 E2 are the source of the +silent stop used here. See SOURCE-PINS.json for exact source identities. + +The unmodified compare_recursive_invoices.py and +evaluate_recursive_power.py are from CrocSwap/integer-mult-bounds at +e54523517d0f03e58352e647c403a5af3e525a57. They retain the concave order +and invoice schema credits in their headers. The directed power +evaluator was prepared for aliromman with OpenAI Codex assistance. +The application appendix records the reused native, signed +caller and resource components with their own exact source notices. diff --git a/research/current-half-add-service/source/WORD.json.gz b/research/current-half-add-service/source/WORD.json.gz new file mode 100644 index 0000000000..e05407f54f Binary files /dev/null and b/research/current-half-add-service/source/WORD.json.gz differ diff --git a/research/current-half-add-service/verify.py b/research/current-half-add-service/verify.py new file mode 100644 index 0000000000..df5e0dcc9c --- /dev/null +++ b/research/current-half-add-service/verify.py @@ -0,0 +1,253 @@ +#!/usr/bin/env python3 +"""Bind one literal rounded ADD and bound its error through the native suffix.""" +from fractions import Fraction as Q +from copy import deepcopy +from hashlib import sha1, sha256 +from pathlib import Path +from types import SimpleNamespace +import gzip +import json +import sys + +ROOT = Path(__file__).resolve().parent +REPO = ROOT.parents[1] +CLOCK = 100504 +RAW = ('ADD', 210, 457, '-1/2', 218) +TOKEN = ('local', CLOCK, RAW) + + +def need(ok, message): + if not ok: + raise ValueError(message) + + +def digest(value): + return sha256(json.dumps(value, sort_keys=True, separators=(',', ':')).encode()).hexdigest() + + +def authenticate(): + for row in json.loads((ROOT / 'SOURCES.json').read_text())['files']: + if row['usage'] == 'input': + need(sha256((REPO / row['path']).read_bytes()).hexdigest() == row['sha256'], 'retained input hash') + for row in json.loads((ROOT / 'VENDORED.json').read_text())['files']: + raw = (ROOT / row['path']).read_bytes() + need(sha256(raw).hexdigest() == row['sha256'], 'candidate source hash') + need(sha1(b'blob ' + str(len(raw)).encode() + b'\0' + raw).hexdigest() == row['git_blob'], 'candidate source blob') + raw = gzip.decompress((ROOT / 'source/WORD.json.gz').read_bytes()) + grid = json.loads((ROOT / 'source/GRID.json').read_text()) + need(sha256(raw).hexdigest() == grid['decompressed_sha256'], 'grid receipt word binding') + word = json.loads(raw) + need(tuple(word['program'][CLOCK]) == RAW, 'exact half-ADD token') + need(word['program'][CLOCK - 1] == ['MOVE', 457, 966, 218, False], 'preceding MOVE') + charts = word['initial'] + [None] * word['owned_fields'] + for event in word['program'][:CLOCK]: + op, r = event[:2] + if op == 'INIT': + need(charts[r] is None, 'fresh owned lifetime') + charts[r] = event[2] + elif op == 'CLEAR': + need(charts[r] == event[2], 'owned return chart') + charts[r] = None + elif op == 'MOVE': + need(charts[r] == event[2], 'MOVE source chart') + charts[r] = event[3] + elif op == 'SCALE': + need(charts[r] == event[3], 'scalar chart') + elif op in ('ADD', 'COPY'): + need(charts[r] == charts[event[2]] == event[4], 'matched scalar charts') + else: + raise ValueError('unknown source opcode') + need(charts[210] == charts[457] == 218, 'actual local common chart') + return word + + +def suffix_bound(word): + n = word['public'] + word['owned_fields'] + weights = [Q(0)] * n + weights[210] = Q(1) + peak, peak_at, clear_bounds = Q(1), [CLOCK + 1, 210], [] + for pc in range(CLOCK + 1, len(word['program'])): + event = word['program'][pc] + op, r = event[:2] + if op in ('INIT', 'CLEAR'): + if op == 'CLEAR': + clear_bounds.append([pc, r, str(weights[r])]) + weights[r] = Q(0) + elif op == 'SCALE': + weights[r] *= abs(Q(event[2])) + elif op in ('ADD', 'COPY'): + if op == 'COPY': + need(weights[r] == 0, 'COPY zero target in error model') + weights[r] += abs(Q(event[3])) * weights[event[2]] + elif op != 'MOVE': + raise ValueError('unknown suffix opcode') + if weights[r] > peak: + peak, peak_at = weights[r], [pc + 1, r] + public = weights[:word['public']] + worst = max(range(len(public)), key=public.__getitem__) + backward = [Q(0)] * n + backward[worst] = Q(1) + for event in reversed(word['program'][CLOCK + 1:]): + op, r = event[:2] + if op in ('INIT', 'CLEAR'): + backward[r] = Q(0) + elif op == 'SCALE': + backward[r] *= abs(Q(event[2])) + elif op in ('ADD', 'COPY'): + backward[event[2]] += abs(Q(event[3])) * backward[r] + if op == 'COPY': + backward[r] = Q(0) + need(backward[210] == public[worst], 'independent backward error transport') + strict_power = 0 + while Q(2) ** strict_power <= peak: + strict_power += 1 + return { + 'suffix_events': len(word['program']) - CLOCK - 1, + 'maximum_field_gain': str(peak), 'maximum_field_gain_witness': peak_at, + 'strict_peak_power_of_two': strict_power, + 'maximum_public_gain': str(public[worst]), 'maximum_public_role': worst, + 'public_sum_squared_gains': str(sum(x * x for x in public)), + 'nonzero_public_upper_bounds': sum(bool(x) for x in public), + 'suffix_clear_count': len(clear_bounds), + 'nonzero_clear_upper_bounds': sum(Q(row[2]) != 0 for row in clear_bounds), + 'clear_bounds_sha256': digest(clear_bounds), + 'public_gains_sha256': digest([str(x) for x in public]), + 'backward_witness_gain': str(backward[210]), + } + + +def terminal_dependency(word): + touches = [] + for pc, event in enumerate(word['program'][CLOCK + 1:], CLOCK + 1): + op, dest = event[:2] + if op in ('ADD', 'COPY'): + need(event[2] != 210, 'no later source read of the changed field') + if dest == 210: + need(op == 'ADD' and event[2] != 210, 'only source-independent translations remain') + touches.append([pc, event]) + need(touches == [[100527, ['ADD', 210, 292, '-1/2', 218]]], 'exact terminal update') + need(word['final'][210] == 218, 'returned public field chart') + return {'later_target_updates': touches, 'later_source_reads': 0, + 'returned_public_role': 210, 'returned_chart': 218, + 'other_public_and_owned_differences': 0, 'exact_difference_multiplier': 1} + + +def run_primitive(physical, registry, target, source, width, work=None): + p = physical + target_tape = p.Tape(p.encode_symbols(p.symbols(target, width)), 17) + source_tape = p.Tape(p.encode_symbols(p.symbols(source, width)), 29, True) + if work is None: + work = [p.Tape((1, 0, 1, 1, 0), 41), p.Tape((0, 1, 0), 63)] + work[0].pos += 2 + work[1].pos += 3 + context = p.Tape((1, 0, 1), 83, True) + ports = {210: target_tape, 457: source_tape, 1569: work[0], 1570: work[1], 1571: context} + need(len({id(t) for t in ports.values()}) == 5, 'physically distinct primitive ports') + before = {i: t.body() for i, t in ports.items()} + old_dirty = sum(len(t.body()) for t in work) + start_actions = sum(t.actions for t in ports.values()) + measured = p.RowCounter(registry[TOKEN]) + state = SimpleNamespace(payloads=ports, primitive_work=(1569, 1570), + primitive_context=(1571,), services={TOKEN: measured}) + error = None + try: + p.M.Controller.primitive(state, TOKEN, (210, 457)) + except ValueError as exc: + error = str(exc) + need(source_tape.body() == before[457] and context.body() == before[1571], 'source and context preservation') + need(all(t.protected() for t in ports.values()), 'local markers and ancestors') + expected = tuple(x - y // 2 for x, y in zip(target, source)) + fits = all(-(1 << (width - 1)) <= x < (1 << (width - 1)) for x in expected) + need((error is None) == fits, 'exact final signed range iff') + if error is None: + actual = p.decode(target_tape.body(), width) + need(actual == expected, 'direct integer floor oracle') + need(all(t.pos == t.origin for t in ports.values()), 'successful head return') + need(all(t.blank() for t in work), 'complete successful work retirement') + else: + actual = None + need(error == 'rounded signed output overflow', 'range rejection has the expected cause') + need(target_tape.body() == before[210], 'complete-field failure atomicity') + components = len(target) + extent = components * (width + 1) + actions = sum(t.actions for t in ports.values()) - start_actions + charged = actions + measured.steps + 64 + bound = 512 * (extent + 1) + 64 * components + 7 * old_dirty + 16 + need(charged <= bound, 'physical actions and control rows fit complete bound') + return {'fits': fits, 'output': None if actual is None else list(actual), 'charged': charged, 'bound': bound, + 'table_steps': measured.steps, 'old_dirty': old_dirty}, work + + +def physical_checks(): + sys.path.insert(0, str(REPO / 'research/current-rounded-scalar-tables')) + from tables import compile_rounded + import physical + table, construction = compile_rounded('ADD', Q(-1, 2)) + need(set(row[0] for row in table) <= {'branch', 'write', 'move', 'goto', 'halt', 'reject'}, 'literal instruction alphabet') + registry = {TOKEN: table} + need(('local', CLOCK - 1, RAW) not in registry, 'wrong local clock rejected') + need(('local', CLOCK, ('ADD', 210, 457, '1/2', 218)) not in registry, 'wrong local coefficient rejected') + success, rejected, count, max_charge, min_slack = 0, 0, 0, 0, None + for width in range(1, 6): + bound = 1 << (width - 1) + for x in range(-bound, bound): + for y in range(-bound, bound): + receipt, _ = run_primitive(physical, registry, (x, 0), (y, 0), width) + count += 1 + success += receipt['fits'] + rejected += not receipt['fits'] + max_charge = max(max_charge, receipt['charged']) + slack = receipt['bound'] - receipt['charged'] + min_slack = slack if min_slack is None else min(slack, min_slack) + odd, work = run_primitive(physical, registry, (0, 0), (1, -1), 4) + need(odd['output'] == [0, 1], 'both odd signs at the actual half-ADD') + late, work = run_primitive(physical, registry, (0, 0, 7, 0), (1, 0, -2, 0), 4, work) + need(not late['fits'], 'late overflow rejects the whole field') + reuse, work = run_primitive(physical, registry, (0, 0), (1, -1), 2, work) + need(reuse['output'] == [0, 1] and reuse['old_dirty'] > 0, 'failure work can be retired before reuse') + native_field, work = run_primitive(physical, registry, (0,) * 1024, (1, -1) * 512, 4, work) + need(native_field['output'] == [0, 1] * 512, '512-complex-value field staging') + wrong_table, _ = compile_rounded('ADD', Q(1, 2)) + try: + run_primitive(physical, {TOKEN: wrong_table}, (0, 0), (1, 0), 4) + except ValueError as exc: + need(str(exc) == 'direct integer floor oracle', 'wrong-sign control fails on semantics') + else: + raise ValueError('wrong-sign table accepted') + return {'construction': construction, 'table_sha256': digest(table), + 'exhaustive_pairs': count, 'successful_pairs': success, 'range_rejections': rejected, + 'maximum_observed_charge': max_charge, 'minimum_bound_slack': min_slack, + 'odd_boundary': odd, 'late_overflow': late, 'reuse_after_failure': reuse, + 'native_512_field': {k: v for k, v in native_field.items() if k != 'output'}, + 'controls': ['wrong clock', 'wrong coefficient token', 'wrong-sign table', 'late whole-field overflow']} + + +def calculate(): + word = authenticate() + terminal = terminal_dependency(word) + dependency_controls = [] + for label, replacement in [ + ('legal reversed ADD exports the error', ['ADD', 292, 210, '-1/2', 218]), + ('legal SCALE changes the error gain', ['SCALE', 210, '2', 218]), + ]: + changed = deepcopy(word) + changed['program'][100527] = replacement + try: + terminal_dependency(changed) + except ValueError: + dependency_controls.append(label) + else: + raise ValueError('terminal dependency control accepted') + return {'word_sha256': digest(word), 'clock': CLOCK, 'raw': list(RAW), + 'physical': physical_checks(), 'suffix_error': suffix_bound(word), + 'terminal_dependency': terminal, 'dependency_controls': dependency_controls} + + +def main(): + result = calculate() + need(result == json.loads((ROOT / 'RESULT.json').read_text()), 'complete receipt') + print('PASS_CURRENT_HALF_ADD_SERVICE ' + json.dumps(result, sort_keys=True)) + + +if __name__ == '__main__': + main()