diff --git a/research/p104-single-pass-qualification/.gitignore b/research/p104-single-pass-qualification/.gitignore new file mode 100644 index 0000000000..85ac65a5e8 --- /dev/null +++ b/research/p104-single-pass-qualification/.gitignore @@ -0,0 +1,3 @@ +__pycache__/ +runs/ +execution.lock diff --git a/research/p104-single-pass-qualification/BENCHMARK-pair.json b/research/p104-single-pass-qualification/BENCHMARK-pair.json new file mode 100644 index 0000000000..25f2530375 --- /dev/null +++ b/research/p104-single-pass-qualification/BENCHMARK-pair.json @@ -0,0 +1,21 @@ +{ + "complete_receipts_equal": true, + "medians": { + "B": { + "cpu": 60.949999999999996, + "wall": 61.007068632985465 + }, + "C": { + "cpu": 38.879999999999995, + "wall": 38.93709892901825 + } + }, + "order": [ + "B1", + "C1" + ], + "saving": { + "cpu": 0.36210008203445454, + "wall": 0.36176086146244313 + } +} diff --git a/research/p104-single-pass-qualification/BENCHMARK-remaining.json b/research/p104-single-pass-qualification/BENCHMARK-remaining.json new file mode 100644 index 0000000000..ec511c4d28 --- /dev/null +++ b/research/p104-single-pass-qualification/BENCHMARK-remaining.json @@ -0,0 +1,25 @@ +{ + "complete_receipts_equal": true, + "medians": { + "B": { + "cpu": 60.949999999999996, + "wall": 61.007068632985465 + }, + "C": { + "cpu": 38.879999999999995, + "wall": 39.01491572102532 + } + }, + "order": [ + "B1", + "C1", + "C2", + "B2", + "B3", + "C3" + ], + "saving": { + "cpu": 0.36210008203445454, + "wall": 0.3604853241558532 + } +} diff --git a/research/p104-single-pass-qualification/BENCHMARK.json b/research/p104-single-pass-qualification/BENCHMARK.json new file mode 100644 index 0000000000..d72676197d --- /dev/null +++ b/research/p104-single-pass-qualification/BENCHMARK.json @@ -0,0 +1,31 @@ +{ + "complete_receipts_equal": true, + "medians": { + "B": { + "cpu": 60.949999999999996, + "wall": 61.007068632985465 + }, + "C": { + "cpu": 38.879999999999995, + "wall": 39.01491572102532 + } + }, + "order": [ + "B1", + "C1", + "C2", + "B2", + "B3", + "C3" + ], + "saving": { + "cpu": 0.36210008203445454, + "wall": 0.3604853241558532 + }, + "limits": { + "per_command_seconds": 180, + "cumulative_seconds": 1500, + "group_rss_bytes": 1073741824 + }, + "scope": "Complete frozen qualification incl 27 new finite controls; four inherited custody controls are outside the benchmark stage and inside registered verification." +} diff --git a/research/p104-single-pass-qualification/COVERAGE.md b/research/p104-single-pass-qualification/COVERAGE.md new file mode 100644 index 0000000000..64c324c5aa --- /dev/null +++ b/research/p104-single-pass-qualification/COVERAGE.md @@ -0,0 +1,33 @@ +# Coverage preservation + +The source is the complete official PR #5831 export at `7c5eb98e7439d778141d63e801e53d4cd7e1d587`, containing the unchanged PR #5826 source at `58f93cf41751920f3d6766a39caccc2974ce18b0`. `source.py` authenticates every outer file/mode and the entire archive before importing; the original source context authenticates the nested archive and checks every declared contract edit. Frozen files and the arithmetic backend are not edited. + +| Obligation | Frozen full qualification | Proposed qualification | +|---|---|---| +| Integer complete contract | Exact `contract.calculate(p, Engine(reference))` | Same calculation, with an observational proxy that forwards every call | +| Fraction complete contract | Unchanged `original.calculate()` | Same function and newly loaded original module, observed via a scoped module-factory seam; restored in `finally` | +| Actual dimensions | 25,984 events, 799 coordinates, every arbitrary-input/native/ownership check | Same word in both complete calculations | +| Source result | Both complete encoded outputs equal original RESULT | Same two checks plus full output equality | +| Ideal metadata and local weights | Extra full reference and integer ideal passes, compared | Compare complete deep-copied first-pass outputs from the two independent calculations | +| Actual error trace and all signed witness dictionaries | Extra reference/integer error passes, compared | Compare complete deep-copied first-pass outputs from the two independent calculations | +| Final transpose scores and signed coefficients | Each full calculation calls unchanged `reverse_all` and checks all values/hashes | Unchanged in both calculations | +| Attaining prefix/input fixtures | Each complete contract uses unchanged `reverse_cut` and literal `execute` | All retained; no sampled rows | +| Additive COPY/reset semantics | Both complete contracts run every original residual fixture and six rejections | All retained; malformed-word calls still reach the backend and cannot replace the actual observation | +| Dyadic finite differential | Original seeded 120 programs/4,240 events, complete trace/witness and reverse equality | Call original `fixtures` unchanged with raw independent reference and integer backend | +| Integer validity failures | Nondyadic scalar, inexact division, nondyadic weight | All three retained | +| Precision guards and scale | Prefix/public/owned 26/23/22, coefficient scale 55 | Exact same receipt, not a weaker subset | +| Source isolation | Distinct Fraction module and explicit contract/backend under authenticated source context | Same source authentication and distinct modules; no cross-backend value sharing | +| Timeout | Original full qualification 180 seconds | 180 seconds; unchanged numerical or proof limits | +| Shared tooling tests | Full CI plan has 513 tests and 22 platform skips | No shared script, test, wait, fixture or skip changes; nominated group all ten pass in profile | + +The omitted repeated calculations are deterministic calls of byte-identical functions with identical complete inputs inside one successful invocation. The replacement observations retain their complete output values. This is intra-invocation common-work elimination; it is not an independent extra scientific oracle. The two arithmetic representations and all original literal/transpose oracles still execute independently. Cold process/source authentication occurs on every qualification. Nested source scratch keeps the predecessor's private writable semantics; this contribution adds no claim that it is sealed. + +## Observation lifetime and failure rules + +A context binds the canonical complete word. Only the actual successful ideal and trace calls can be recorded, once each. The trace must use the observed ideal's exact weights and operation set. Arguments are checked before/after invocation, outputs are deep-copied, and snapshots are hashed again at consumption. Each backend has a separate context. Outputs cannot be consumed until the full enclosing contract has succeeded, and can be consumed only once. A backend exception on the actual word aborts its observations. Any exception in the complete candidate/parallel Fraction calculation aborts both contexts. The source module factory is restored even on failure. Nothing is persisted between commands. + +The finite feasibility gate uses the real frozen backends, a valid five-event COPY/SCALE/CLEAR word, complete fresh reruns, and 27 explicit failure/isolation controls. It runs both normally and under `-O`; checks use explicit exceptions. The original finite corpus and original scientific rejections are additional coverage. + +## Limits + +This covers the frozen contract only. Different source bytes, word, weights, operations, ownership semantics, backend or oracle require a fresh binding and feasibility gate. Assisted local review and CI do not prove the multiplication theorem, supplier admission, exact physical reset, a funded kappa gain or independent human review. diff --git a/research/p104-single-pass-qualification/NOTICE b/research/p104-single-pass-qualification/NOTICE new file mode 100644 index 0000000000..f33dd1539a --- /dev/null +++ b/research/p104-single-pass-qualification/NOTICE @@ -0,0 +1,30 @@ +Complete single-pass qualification +================================== +New source-bound observation, finite controls, profiling and complete Linux benchmark: Chris R / Clear1nsight, with substantial OpenAI Codex assistance; no subagents or independent human/kernel acceptance. Apache-2.0. Original arithmetic, source contract, expected records and mathematical claims are unchanged. No kappa gain. + +Retained PR5839 NOTICE, verbatim: + +Linux validation of PR5831 +========================== +Exact integer engine, proof, explicit contract adaptation and original qualification: Ali Romman, with substantial OpenAI Codex assistance. Source PR5826/5819, Adam Gall, ywz65, PR2878, Mason Hale/PR5811 and all retained P104/native/compiler lineage keep their attribution and Apache-2.0 terms. Full source archives remain unchanged. + +New Linux source/coverage review, guarded measurements, custody controls, portable reproduction and reporting: Chris R / Clear1nsight, with substantial OpenAI Codex assistance; no subagents or independent human/kernel acceptance. The guard and export-custody pattern follow PR5816/5818/5832. Apache-2.0. No new kappa or supplier admission. + +Retained research/p104-noisy-copy-reset/inputs/caller-NOTICE +Composition of accumulated native updates and two released P104 blocks. +New integration, compatibility checks and complete price: Mason Hale with substantial OpenAI Codex assistance, including separate agent checks. Apache-2.0. No independent human acceptance is claimed. + +The accumulation and retained-source lineage is credited verbatim in vendor/accumulated/NOTICE. The block constructions and composition lineage are credited verbatim in vendor/blocks/NOTICE. These notices and every retained source byte are unchanged. Ali Romman supplied PR5802 and PR5795; Joel Pulikkan/GamingPuzzled supplied the R22 mechanism; Ali Romman supplied the second block PR5796 and the provisional role92 plan. All native/helper/controller/compiler/BIT/analytic credit remains in the retained notices. + +Dugongue (@Dugongue), PR5806 at 20e7289b63d240715aa96006571ae38a46291d97, supplied a concurrent informal proof of the same three-accumulation/two-block baseline join. The fourth role92 realization is additional to that shared composition. + + +Retained research/p104-noisy-copy-reset/inputs/prior-NOTICE +Copyright 2026 Ali Romman. +Prepared with substantial OpenAI Codex assistance in research, proof, code and checks. +Licensed under Apache-2.0. + +Source files are unchanged. See source/NOTICE and ORIGINS.json. +The completed-error method credits Adam Gall, ywz65 and PR2878. +PR5802 and its retained predecessors supply the native word and compiler premises. +No independent scientific acceptance is claimed. diff --git a/research/p104-single-pass-qualification/PROFILE.md b/research/p104-single-pass-qualification/PROFILE.md new file mode 100644 index 0000000000..a1e2768990 --- /dev/null +++ b/research/p104-single-pass-qualification/PROFILE.md @@ -0,0 +1,35 @@ +# Measured nomination and rejected alternative + +Both profiles run the full unchanged entry points, serially, with fresh processes and private bytecode prefixes. Whole-call wall timers are observational and inclusive: nested totals overlap. They are excluded from speed statistics. Raw outputs and Linux resource receipts are retained in `evidence/`. The canonical base and fixture census appear in `evidence/HELPER-CLOSURE.json`. + +## Shared-helper group + +Existing hosted verbose-test timestamps suggested the descendant-source-role group. These were only screening proxies; buffered output is not an exact per-test profile. Before collection, all seven manifest inputs, six package files and exact original/historical Git rows were materialized/authenticated. No incomplete discovery or missing fixture was accepted as a pass. + +The complete group then passes **10 tests, zero errors/failures/skips** in 51.317 seconds wall /48.85 CPU. Fresh per-test fixture setup is 0.287 seconds across ten setups; 100 inclusive Git calls total0.305 seconds. The complete historical-source-substitution guard takes37.290 seconds, and the broken live cache-isolation regression12.125 seconds. These execute real historical/negative CLI behaviour; they are not removable setup. + +Even eliminating every fixture setup would save at most **0.56% of this group** on the observed run, far below15%. This rejects only this fixture-only nomination, not all shared-tooling optimization. No helper/test/skip/wait/source change is made. Required stale-import, historical-source, descendant and lifetime rejection coverage remains in CI. + +## Complete precision qualification + +The complete frozen PR5831 profile passes in61.609 seconds wall /61.55 CPU with the exact original scientific receipt. It includes: + +| Inclusive operation | Calls | Seconds | +|---|---:|---:| +| Full Fraction contract |1|28.038| +| Fraction contract error trace |1|19.828| +| Fraction contract ideal (actual+rejections) |4|4.077| +| Fraction contract reverse-all |1|2.785| +| Extra Fraction ideal |1|2.163| +| Extra Fraction error trace (actual+120 finite cases) |121|21.102| +| Full integer contract |1|6.052| +| Integer error trace (two actual+120 finite) |122|6.104| +| Integer ideal (two actual+rejections) |5|1.408| + +The full contract already computes the actual ideal/weights and trace/witness values later recomputed by qualification. The nomination retains both independent first-pass output pairs, then compares their complete values. Every original actual and finite oracle stays active. The profile justifies finite feasibility; it is not itself an optimization benchmark. + +## Gate history + +The preconstruction five-event fixture uses the actual authenticated Fraction and integer modules and complete fresh comparisons.27 explicit controls cover one-use/readiness, closed/duplicate calls, changed word/weights/rounding, caller-return alias isolation, original malformed-input exceptions, failed/aborted lifetimes, input mutation and no transfer from a previous context. Both normal and `-O` pass. An initial prototype normalized rounded arguments to a list; before construction it was hardened to preserve the original set object type while normalizing only its fingerprint. Both earlier and final receipts are retained, without claiming they are distinct backend implementations. + +No scientific failures occurred in these profiles/finite runs. A draft metadata outcome string was rejected before the registered entry point; its message and enum-only correction are retained separately. All later full measurements remain separately labelled and are never silently rerun. diff --git a/research/p104-single-pass-qualification/PROOF.md b/research/p104-single-pass-qualification/PROOF.md new file mode 100644 index 0000000000..b7bc789413 --- /dev/null +++ b/research/p104-single-pass-qualification/PROOF.md @@ -0,0 +1,13 @@ +# Source-bound elimination of duplicate qualification passes + +This is a verification-engineering argument about exact deterministic computations on one frozen word, not a proof of the multiplication theorem. + +Let I_B(w) return the complete ideal metadata and local weights and E_B(w,a,R) the complete error trace and signed witness dictionaries for backend B. In the authenticated source, Fraction `ideal`/`error_trace` and integer `Engine.ideal`/`Engine.error_trace` allocate their state locally, use exact arithmetic, and do not read random, time, file or caller-global state. They do not mutate w,a,R. The complete source contract calls I_B(w), defines R from all operation counts and then calls E_B(w,a,R). Qualification subsequently calls the byte-identical functions on the same complete word, weights and rounded operation set to obtain values for cross-backend comparison. These repeated calls are not additional independent scientific implementations. + +The replacement retains a deep copy of the full outputs of the first actual I_B and E_B calls in each separately executed complete contract. It does not replace either backend computation with the other's output. Canonical input fingerprints bind the whole word; the trace binding also requires the precise independently computed weights and full rounded operation set. Arguments are fingerprinted before and after each invocation. Only actual successful calls are recorded, exactly once each, and only a successful complete enclosing contract permits consumption. Corrupt source, missing calls, duplicate actual calls, input changes, failed complete contracts or output drift prevent admission. Deep copies isolate the retained values from later mutation of returned values. Output fingerprints are rechecked at one-use consumption. + +Consequently the complete ideal/weight and trace/witness equality predicates receive the same exact values as the unchanged qualifier's second calls. Full original RESULT equality is checked separately against each independent complete contract and between them. Every literal input/defect attaining fixture, signed final transpose check and original semantic rejection remains inside those untouched calculations. The original seeded 120-program differential is called unchanged with raw backends, including full trace/witness and reverse equality, plus all three integer failures. The coefficient scale and complete scientific receipt are still computed/compared to the original source record. + +The Fraction calculation retains its own newly loaded original precision module. Its factory is wrapped only to observe the first-pass returns; the factory is restored in `finally`. The raw reference module, integer arithmetic and literal/reverse oracle code stay unchanged and authenticated. A context has no cross-command storage or reuse. The argument assumes the normal deterministic interpreter model; this does not claim hardware-fault independence from two repetitions of the same computation. + +The finite gate precedes construction. The complete actual-word comparisons, six-process measurements, normal/optimized full commands and sealed export checks are additional implementation evidence. A source or word successor requires fresh purity/input/coverage review and finite feasibility. Physical native correctness, reset implementation, exact owned zero return, tapes, compiler/outer admission and the five framework assumptions remain predecessor obligations. No kappa change follows from this optimization. diff --git a/research/p104-single-pass-qualification/README.md b/research/p104-single-pass-qualification/README.md new file mode 100644 index 0000000000..af48357694 --- /dev/null +++ b/research/p104-single-pass-qualification/README.md @@ -0,0 +1,54 @@ +# Complete single-pass precision qualification + +This opt-in verification package builds on Ali Romman's [PR #5831](https://github.com/CrocSwap/integer-mult-bounds/pull/5831) and its [Linux validation in PR #5839](https://github.com/CrocSwap/integer-mult-bounds/pull/5839). Both complete arithmetic implementations still execute. It retains the actual ideal metadata, local weights, complete error traces and every signed witness from those executions, instead of recomputing the same values solely to compare them. All literal and transpose oracles, actual source controls and original finite differential remain. + +See [COVERAGE.md](COVERAGE.md) for the obligation-by-obligation preservation argument and observation lifetime. This changes verification cost only; it does not change the precision theorem, physical construction, five framework assumptions, kappa or selected result. Frozen archives and expected results are unchanged. + +## Reproduce + +Python 3.12, standard library only: + +```sh +python3 -B scripts/research_package.py --package research/p104-single-pass-qualification +``` + +The registered command performs the four inherited pre-import source-custody controls, 27 new finite observation controls, and **fresh full qualification**. It authenticates the complete official source export, runs both complete Fraction and exact-integer contracts on all 25,984 events/799 coordinates, compares all observed actual ideal/weight/trace/witness values and executes the original 120-program/4,240-event finite differential and three integer rejections. Both full contracts still run the six original semantic rejections, signed final transpose and literal attaining fixtures. The source's 180-second timeout is unchanged. Expected time on this Linux host is about 40 seconds, subject to host load. + +For deliberate optimized validation use the same source-isolated registered runner or the README export procedure. All new guards raise explicit exceptions; they remain effective under `-O`. + +## Bounded performance comparison + +Run only with separately available local budget in a fresh complete checkout/export. `runs/` must not already contain these labels; an existing or failed measurement is never overwritten or retried automatically. + +```sh +python3 -B research/p104-single-pass-qualification/benchmark.py pair +python3 -B research/p104-single-pass-qualification/benchmark.py remaining +``` + +The first command measures one fresh complete frozen qualification and one fresh candidate, including its 27 new finite controls. It requires **at least 15% less wall AND CPU time** before the second command can run. The second retains the original serial B,C,C,B,B,C order and applies the same threshold to all six medians. Every run has the original 180-second limit, 1 GiB sampled process-group RSS, bounded output, complete scientific-receipt equality, clean private bytecode prefix and before/after source-byte/mode inventory. The cumulative 1,500-second cap includes the fixed prior profiling/finite development cost declared in `guard.py`. OS caches are not flushed. The host is unreserved. Three observations per arm establish a local measurement, not universal or statistical performance. + +The inherited four custody controls are a separate small prequalification stage in `verify.py`; their cost is included in registered normal/optimized/export validation, while the B/C comparison concerns the complete scientific qualification. The profile is excluded from benchmark statistics. Full finite actual-corpus comparisons are never replaced with a stored receipt. + +## Profiling and feasibility before construction + +The unchanged nominated shared-helper group passes all ten tests after exact historical fixture closure. Its 0.287-second fixture setup is only 0.56% of the 51.317-second group bill. Eliminating it could not meet the requested threshold, so shared scripts/tests/fixtures/waits/skips are unchanged. Most cost is required actual historical/negative CLI execution. + +Full precision qualification profiles at 61.609 seconds. Extra same-input ideal/error calls account for over 23 seconds in the Fraction reference alone. Before constructing the full candidate, a five-event valid COPY/SCALE/CLEAR fixture passes with both real frozen backends, full fresh output comparisons and 27 input/lifetime/exception/alias controls, normally and under `-O`. A small hardening preserves the original set argument type; both earlier and final finite receipts are retained. These are finite feasibility checks, followed by complete actual qualification. + +## Source and independence boundaries + +`inputs/PR5831.tar` is the complete official 13-file export at `7c5eb98e7439d778141d63e801e53d4cd7e1d587`, SHA256 `6ad8d8e0463e8e6ea8d503610c3f9ec38108f16092bc479bc1cb6f48683f6ab6`, retained at this branch's own ancestor. It contains the unchanged PR #5826 source at `58f93cf41751920f3d6766a39caccc2974ce18b0`. Original notices and source licenses remain inside the archives. No pending contributor Git objects are runtime dependencies. + +No persisted cache, source-result substitution, cross-backend weight reuse, changed arithmetic or sampled witness is introduced. Each observation context is scoped to one successful complete contract, holds full deep copies, binds all exact inputs and is consumed once. The independent Fraction module still loads afresh; only its factory return is observationally wrapped and the factory is restored on success or failure. The original private nested scratch remains writable; the outer authenticated export is read-only and checked. The coverage statement concerns this deterministic frozen source, not fault-injection independence from repeating an identical call. + +## Credit + +Ali Romman supplied the integer backend, exact dyadic scale proof, explicit contract seam, original qualification and macOS measurements. Retain PR #5826, [PR #5819](https://github.com/CrocSwap/integer-mult-bounds/pull/5819), Adam Gall, ywz65, [PR #2878](https://github.com/CrocSwap/integer-mult-bounds/pull/2878), Mason Hale/[PR #5811](https://github.com/CrocSwap/integer-mult-bounds/pull/5811) and every retained native/compiler/precision notice. The test-only [PR #5761](https://github.com/CrocSwap/integer-mult-bounds/pull/5761) dependency retains Ali Romman's authorship and exact cherry-pick credit. roger-sato/Arham Tahir supplied the historical-source-role test lineage. Guard/custody mechanics follow [PR #5816](https://github.com/CrocSwap/integer-mult-bounds/pull/5816), [PR #5818](https://github.com/CrocSwap/integer-mult-bounds/pull/5818), [PR #5832](https://github.com/CrocSwap/integer-mult-bounds/pull/5832) and PR #5839. New profiling, one-use observation, controls and Linux measurements: Chris R / Clear1nsight, with substantial OpenAI Codex assistance; no subagents or independent human/kernel acceptance. Apache-2.0. + +## Open next questions + +1. Does another Linux host reproduce the complete-qualification saving? Authenticate the same export and repeat the bounded six-process comparison; retain every observation. +2. Should the source qualifier expose explicit first-pass outputs? A source-owned return interface could simplify the scoped module-factory wrapper. Review the coverage and lifetime rules before any source change, and coordinate with the source author. +3. Can the optimization transfer to a changed word/backend? Only after new source binding, input/operation/ownership mapping and finite feasibility. This package gives no automatic transfer. + +Kappa research, Work 1/2, feeds, workers and automations remain paused. The bounded engineering scope ends after this submission/handoff and starts no successor experiment. diff --git a/research/p104-single-pass-qualification/RESULT.json b/research/p104-single-pass-qualification/RESULT.json new file mode 100644 index 0000000000..1952424ccc --- /dev/null +++ b/research/p104-single-pass-qualification/RESULT.json @@ -0,0 +1,22 @@ +{ + "all_actual_witness_rows_equal": true, + "coefficient_scale_bits": 55, + "coordinates": 799, + "events": 25984, + "finite_fixtures": { + "cases": 120, + "controls": [ + "nondyadic scalar", + "inexact scale division", + "nondyadic weight" + ], + "events": 4240 + }, + "guards": { + "owned": 22, + "prefix": 26, + "public": 23 + }, + "source_controls": 6, + "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98" +} diff --git a/research/p104-single-pass-qualification/SOURCES.json b/research/p104-single-pass-qualification/SOURCES.json new file mode 100644 index 0000000000..6c75dd971b --- /dev/null +++ b/research/p104-single-pass-qualification/SOURCES.json @@ -0,0 +1,32 @@ +{ + "schema_version": 1, + "base_commit": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "files": [ + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81" + }, + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "581f8d87008354eb5b869f7ed9de1317ad837ce8", + "sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5" + }, + { + "path": "research/p104-single-pass-qualification/inputs/PR5831.tar", + "usage": "input", + "git_blob": "eddee1f6a956d1c4d0008bf75fc66a0a36ad56a2", + "sha256": "6ad8d8e0463e8e6ea8d503610c3f9ec38108f16092bc479bc1cb6f48683f6ab6", + "pin": "head:b41545693de902b2b3b1ffd0218090de0cbcc062:research/p104-single-pass-qualification/inputs/PR5831.tar" + } + ], + "external_origin": { + "pr": 5831, + "head": "7c5eb98e7439d778141d63e801e53d4cd7e1d587", + "source_pr": 5826, + "source_head": "58f93cf41751920f3d6766a39caccc2974ce18b0", + "files": 13 + } +} diff --git a/research/p104-single-pass-qualification/TASK.json b/research/p104-single-pass-qualification/TASK.json new file mode 100644 index 0000000000..a6824f635a --- /dev/null +++ b/research/p104-single-pass-qualification/TASK.json @@ -0,0 +1,66 @@ +{ + "schema_version": 1, + "task_id": "replay-runtime", + "original_card": { + "id": "replay-runtime", + "question": "Can one measured replay bottleneck be sped up without dropping coverage?", + "starting_points": [ + "scripts/run_isolated_tests.py", + "scripts/verify_replay_coverage.py", + "certificates/selected-result.json" + ], + "methods": [ + "Profile one isolated replay and optimize the measured bottleneck.", + "Design source-bound reuse with explicit dependency invalidation and negative controls." + ], + "acceptance_gate": "Report before/after wall time on the same fixture, retained checks and invalidation behavior.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_selected_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Resolve the current selected review, separate complex/ordinary BIT/admitted BIT/outer budgets, and compare the card against live handoffs before starting. Historical ceilings require exact source/model equivalence.", + "scope": "Source-binding orientation only; not a scientific replay or all-size proof. Materialize selected inputs if this checkout is sparse." + }, + "first_experiment": "Measure one unchanged fixture, preserve check coverage, and test one optimization with invalidation controls.", + "bottleneck_link": "Faster trustworthy replays increase review throughput and let mechanism candidates be checked sooner.", + "allowed_variations": [ + "Profile one stage or design one source-bound cache boundary." + ], + "scope_change_triggers": [ + "Skipping coverage or comparing different fixtures to claim speedup." + ], + "overlap_terms": [ + "replay runtime", + "cache invalidation", + "isolated tests" + ] + }, + "scope_status": "refined", + "scope_change_reason": "Explicit donor request to profile shared helper tests/full qualification, gate finite feasibility before construction, retain every check and require at least15% wall and CPU saving. Shared fixture setup screened out; only repeated same-input qualification passes removed.", + "actual_scope": "PR5831/frozen-7c5eb98/complete-single-pass-qualification", + "bottleneck_link": "Faster trustworthy replays increase review throughput and let mechanism candidates be checked sooner.", + "stop_rule": "Source, observation, complete receipt, stderr or resource failure stops. No automatic retries. 180 seconds/command,1GiB sampled group RSS,1500 seconds shared cumulative; first pair then all six in B,C,C,B,B,C order must save15% wall and CPU.", + "time_budget_minutes": 90, + "outcome": "completed", + "evidence": "PROOF.md, COVERAGE.md, PROFILE.md, BENCHMARK.json, VALIDATION.json and evidence/ preserve 15 bounded passing commands, full raw scientific receipts and the metadata preflight rejection. Normal/O/sealed coverage agrees; exact-head hosted CI remains separate.", + "author": "Chris R / Clear1nsight", + "ai_assistance": "Substantial OpenAI Codex assistance for source review, execution, tooling and report; no subagents, independent human or proof-kernel acceptance.", + "open_questions": [ + { + "question": "Does another host reproduce the complete-qualification gain?", + "why_it_matters": "Three samples per arm on one unreserved host are not universal performance.", + "first_step": "Authenticate exact export; run full normal and optimized qualification, then the six fresh bounded measurements.", + "blocked_by": "Separately authorized host time." + }, + { + "question": "Should the source qualifier expose explicit observation outputs?", + "why_it_matters": "A source-owned return interface could remove the scoped factory wrapper while retaining every oracle.", + "first_step": "Review this coverage map and source-bound observation lifetime; preserve failures before changing the source.", + "blocked_by": "Source-author coordination and a new source pin; no automatic transfer." + } + ], + "base_commit": "de5ec2e7a6074068452f45b1a191b5c72832df4a" +} diff --git a/research/p104-single-pass-qualification/VALIDATION.json b/research/p104-single-pass-qualification/VALIDATION.json new file mode 100644 index 0000000000..6cca25b79b --- /dev/null +++ b/research/p104-single-pass-qualification/VALIDATION.json @@ -0,0 +1,51 @@ +{ + "all_benchmark_runs": 6, + "all_guarded_commands_pass": true, + "benchmark_kernel_max_rss_kib": { + "B": 103912, + "C": 118004 + }, + "complete_receipt": { + "all_actual_witness_rows_equal": true, + "coefficient_scale_bits": 55, + "coordinates": 799, + "events": 25984, + "finite_fixtures": { + "cases": 120, + "controls": [ + "nondyadic scalar", + "inexact scale division", + "nondyadic weight" + ], + "events": 4240 + }, + "guards": { + "owned": 22, + "prefix": 26, + "public": 23 + }, + "source_controls": 6, + "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98" + }, + "export": { + "archive_sha256": "7601159a7d13797e89efa94499cb0c9b1ce8aa340de2f88207b67b43e46ea03d", + "files_unchanged": 91, + "implementation": "9b8cffa57c09eefba39dc6a4efdc34a15dfc1ebd", + "receipt_equal": true, + "status": "PASS_SEALED_GIT_FREE_QUALIFICATION", + "wall_seconds": 39.24383878399385 + }, + "guarded_commands": 15, + "hosted_ci": "pending exact final publication head", + "implementation_commit": "9b8cffa57c09eefba39dc6a4efdc34a15dfc1ebd", + "inherited_custody_controls": 4, + "kappa_research": "PAUSED", + "metadata_preflight": "One invalid draft outcome enum rejected and corrected before registered execution; evidence retained. No scientific source/expected result/limit change.", + "new_controls": 27, + "normal_seconds": 39.24033334100386, + "optimized_seconds": 39.1790381349856, + "same_scientific_receipt_everywhere": true, + "shared_tests_changed": false, + "total_local_guarded_wall_seconds": 533.4091301979788, + "unchanged_scientific_runtime_since_benchmark": true +} diff --git a/research/p104-single-pass-qualification/VERIFY.json b/research/p104-single-pass-qualification/VERIFY.json new file mode 100644 index 0000000000..875ee459e5 --- /dev/null +++ b/research/p104-single-pass-qualification/VERIFY.json @@ -0,0 +1,20 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/p104-single-pass-qualification/inputs/PR5831.tar" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Fresh full source-pinned Fraction and integer qualification with all 25984 events/799 coordinates, complete first-pass ideal/weights and actual trace/witness equality, unchanged 120-program/4240-event finite differential, six original plus three integer rejections, four inherited custody and 27 new finite observation controls. No coverage sampling or cross-run cache." + } + ] +} diff --git a/research/p104-single-pass-qualification/baseline.py b/research/p104-single-pass-qualification/baseline.py new file mode 100644 index 0000000000..783543c2ca --- /dev/null +++ b/research/p104-single-pass-qualification/baseline.py @@ -0,0 +1,2 @@ +from replay import main +if __name__=='__main__':main() diff --git a/research/p104-single-pass-qualification/benchmark.py b/research/p104-single-pass-qualification/benchmark.py new file mode 100644 index 0000000000..174d2761ec --- /dev/null +++ b/research/p104-single-pass-qualification/benchmark.py @@ -0,0 +1,50 @@ +"""Fresh serial full-qualification B,C,C,B,B,C; fail closed at the first pair.""" +import json +import statistics +import sys +from pathlib import Path +import guard +from source import payload, require + +EXPECTED = json.loads(payload()['research/p104-integer-error-replay/RESULT.json']) +ORDER = [('B1','baseline.py'),('C1','candidate.py'),('C2','candidate.py'), + ('B2','baseline.py'),('B3','baseline.py'),('C3','candidate.py')] + + +def receipt(label): + folder=guard.HERE/'runs'/label + measurement=json.loads((folder/'receipt.json').read_bytes()) + require(measurement['status']=='PASS','bounded command pass '+label) + result=json.loads((folder/'stdout.txt').read_text().splitlines()[-1]) + require(result['mode']=='qualify' and result['receipt']==EXPECTED,'complete scientific receipt '+label) + return measurement + + +def gate(labels): + groups={arm:[receipt(label) for label in labels if label.startswith(arm)] for arm in 'BC'} + rows={arm:dict(wall=statistics.median(x['wall_seconds'] for x in group), + cpu=statistics.median(x['usage']['user_seconds']+x['usage']['system_seconds'] for x in group)) + for arm,group in groups.items()} + saving={key:1-rows['C'][key]/rows['B'][key] for key in ('wall','cpu')} + require(min(saving.values())>=0.15,'15% complete-stage wall AND CPU gate') + return dict(medians=rows,saving=saving,order=labels,complete_receipts_equal=True) + + +def main(): + require(len(sys.argv)==2 and sys.argv[1] in ('pair','remaining'),'pair or remaining') + with (guard.HERE/'execution.lock').open('a') as lock: + guard.fcntl.flock(lock,guard.fcntl.LOCK_EX|guard.fcntl.LOCK_NB) + if sys.argv[1]=='pair': + for label,script in ORDER[:2]: + guard.run(label,script) + receipt(label) + summary=gate(['B1','C1']) + else: + gate(['B1','C1']) + for label,script in ORDER[2:]: + guard.run(label,script) + receipt(label) + summary=gate([label for label,_ in ORDER]) + (guard.HERE/('BENCHMARK-'+sys.argv[1]+'.json')).write_text(json.dumps(summary,indent=2,sort_keys=True)+'\n') + print(json.dumps(summary,sort_keys=True)) +if __name__=='__main__':main() diff --git a/research/p104-single-pass-qualification/candidate.py b/research/p104-single-pass-qualification/candidate.py new file mode 100644 index 0000000000..b2464cccfe --- /dev/null +++ b/research/p104-single-pass-qualification/candidate.py @@ -0,0 +1,79 @@ +"""Qualify each frozen arithmetic backend once; compare all retained outputs. + +Chris R / Clear1nsight with substantial OpenAI Codex assistance. Apache-2.0. +Arithmetic and every scientific oracle remain Ali Romman's unchanged sources. +""" +import gzip +import importlib.util +import json +import time + +from source import baseline, require, sha256 +from observe import Observation + + +def qualify(): + started = time.perf_counter() + with baseline() as package: + spec = importlib.util.spec_from_file_location('single_pass_source', package/'verify.py') + v = importlib.util.module_from_spec(spec) + spec.loader.exec_module(v) + with v.source() as (p, original, reference): + word = json.loads(gzip.decompress((p/'inputs/WORD.json.gz').read_bytes())) + expected = json.loads((p/'RESULT.json').read_bytes()) + contract = v.load('explicit_contract', package/'contract.py') + integer = v.load('integer_backend', package/'integer.py') + engine = integer.Engine(reference) + candidate = Observation(engine, reference.digest, word) + captures = [] + factory = original.module + + def observed_module(name, path): + value = factory(name, path) + if name == 'noisy_precision': + require(path == p/'precision.py' and not captures, 'one authenticated Fraction module') + value = Observation(value, reference.digest, word) + captures.append(value) + return value + + try: + result = contract.calculate(p, candidate) + require(result == expected, 'complete candidate source result and controls') + candidate.finish() + original.module = observed_module + fraction = original.calculate() + require(fraction == expected and result == fraction, 'complete independent Fraction/candidate result') + require(len(captures) == 1, 'one complete independent Fraction observation') + captures[0].finish() + except BaseException: + candidate.abort() + for capture in captures: + capture.abort() + raise + finally: + original.module = factory + a, b = captures[0].take(word), candidate.take(word) + require(a['ideal'] == b['ideal'], 'full independent ideal metadata and local weights') + require(a['error_trace'] == b['error_trace'], 'all actual trace and signed witness rows') + ideal, weights = a['ideal'] + receipt = dict(source_result_sha256=sha256(json.dumps(result,sort_keys=True,separators=(',',':')).encode()).hexdigest(), + events=result['ideal']['events'],coordinates=result['ideal']['n'], + source_controls=len(result['rejected_controls']),guards=result['sufficient_guard_bits']) + receipt['finite_fixtures'] = v.fixtures(reference, engine, integer) + receipt['coefficient_scale_bits'] = integer.setup(word, weights)[2].bit_length()-1 + receipt['all_actual_witness_rows_equal'] = True + require(receipt == json.loads((package/'RESULT.json').read_bytes()), 'complete frozen qualification receipt') + return receipt, time.perf_counter()-started + + +def main(): + # Qualification entry point includes the new finite observation controls. + import runpy + runpy.run_path(str(__import__('pathlib').Path(__file__).with_name('finite.py')),run_name='__main__') + receipt, seconds = qualify() + print('PASS_P104_SINGLE_PASS_QUALIFICATION') + print(json.dumps({'mode':'qualify','receipt':receipt,'seconds':round(seconds,6)},sort_keys=True)) + + +if __name__ == '__main__': + main() diff --git a/research/p104-single-pass-qualification/custody.py b/research/p104-single-pass-qualification/custody.py new file mode 100644 index 0000000000..f1fd37b644 --- /dev/null +++ b/research/p104-single-pass-qualification/custody.py @@ -0,0 +1,67 @@ +"""Reject corrupt source boundaries before scientific imports or execution.""" +import importlib.util +import json +from pathlib import Path +import shutil +import sys +import tempfile + +from source import baseline, payload, require, HERE + + +def reject(action, expected): + try: + action() + except ValueError as error: + require(str(error) == expected, 'Exact custody rejection predicate') + else: + raise ValueError('Corrupt source accepted') + + +def main(): + require(not sys.argv[1:], 'No custody arguments') + science = {'frozen_contract', 'frozen_precision', 'explicit_contract', 'integer_backend'} + before = set(sys.modules) & science + results = {} + with tempfile.TemporaryDirectory(prefix='precision-custody-') as temporary: + temporary = Path(temporary) + raw = bytearray((HERE / 'inputs/PR5831.tar').read_bytes()) + raw[len(raw) // 2] ^= 1 + damaged = temporary / 'damaged.tar' + damaged.write_bytes(raw) + reject(lambda: payload(damaged), 'Exact PR5831 bundle') + results['official_export_byte'] = 'Exact PR5831 bundle' + with baseline() as package: + for label in ('inner_archive', 'contract', 'declared_edit'): + root = temporary / label + copy = root / 'research/p104-integer-error-replay' + shutil.copytree(package, copy) + for path in [root, *root.rglob('*')]: + path.chmod(0o755 if path.is_dir() else 0o644) + if label == 'inner_archive': + file = copy / 'inputs/source.tar' + raw = bytearray(file.read_bytes()); raw[len(raw) // 2] ^= 1 + file.write_bytes(raw) + expected = 'source hash' + elif label == 'contract': + file = copy / 'contract.py' + file.write_bytes(file.read_bytes() + b'\n# changed contract\n') + expected = 'declared contract edits' + else: + file = copy / 'CONTRACT-EDITS.json' + edits = json.loads(file.read_bytes()); edits[0][0] = 'missing_backend_seam' + file.write_text(json.dumps(edits)) + expected = 'unique backend seam' + spec = importlib.util.spec_from_file_location('custody_entry_' + label, copy / 'verify.py') + module = importlib.util.module_from_spec(spec); spec.loader.exec_module(module) + def enter(): + with module.source(): + raise ValueError('Unexpected scientific admission') + reject(enter, expected) + require(set(sys.modules) & science == before, 'No scientific imports before rejection') + results[label] = expected + print('PASS_PRECISION_LINUX_SOURCE_CONTROLS', json.dumps(results, sort_keys=True)) + + +if __name__ == '__main__': + main() diff --git a/research/p104-single-pass-qualification/evidence/B1/receipt.json b/research/p104-single-pass-qualification/evidence/B1/receipt.json new file mode 100644 index 0000000000..bb9a0bda4c --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/B1/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "B1", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "523aca683d41dd67cc08e6d7e3cff7bbd5ae5f43f22b4a446cb6b8c964703680", + "runtime_policy_sha256": "9e3b359ae35f943747fef22749632cb137606606c934da66bb83c75e22209900", + "sampled_process_group_rss_bytes": 107347968, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "f1b9cd629a8b82fbbbfe8bfcfa255a5976c8379cc2e8ecc48a6f34c6ce521e81", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 490, + "stdout_sha256": "d835d0c9eecd0f1ea8ece765700ef3f8e51601f45533a1d5b4c5680fb5e5671a", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 103380, + "system_seconds": 0.12, + "user_seconds": 60.83 + }, + "wall_seconds": 61.007068632985465 +} diff --git a/research/p104-single-pass-qualification/evidence/B1/stderr.txt b/research/p104-single-pass-qualification/evidence/B1/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/B1/stdout.txt b/research/p104-single-pass-qualification/evidence/B1/stdout.txt new file mode 100644 index 0000000000..803479bcd5 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/B1/stdout.txt @@ -0,0 +1,2 @@ +PASS_P104_INTEGER_ERROR_REPLAY +{"mode": "qualify", "receipt": {"all_actual_witness_rows_equal": true, "coefficient_scale_bits": 55, "coordinates": 799, "events": 25984, "finite_fixtures": {"cases": 120, "controls": ["nondyadic scalar", "inexact scale division", "nondyadic weight"], "events": 4240}, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 60.734479} diff --git a/research/p104-single-pass-qualification/evidence/B1/usage.json b/research/p104-single-pass-qualification/evidence/B1/usage.json new file mode 100644 index 0000000000..21949d369d --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/B1/usage.json @@ -0,0 +1 @@ +{"user_seconds":60.83,"system_seconds":0.12,"kernel_max_rss_kib":103380,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/B2/receipt.json b/research/p104-single-pass-qualification/evidence/B2/receipt.json new file mode 100644 index 0000000000..f68e27f7c6 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/B2/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "B2", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "523aca683d41dd67cc08e6d7e3cff7bbd5ae5f43f22b4a446cb6b8c964703680", + "runtime_policy_sha256": "9e3b359ae35f943747fef22749632cb137606606c934da66bb83c75e22209900", + "sampled_process_group_rss_bytes": 107671552, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "f1b9cd629a8b82fbbbfe8bfcfa255a5976c8379cc2e8ecc48a6f34c6ce521e81", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 490, + "stdout_sha256": "5364ed37f332b0dc413139f7b247ad7167f05376ddfed0db163d412444c54e8c", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 103696, + "system_seconds": 0.09, + "user_seconds": 62.82 + }, + "wall_seconds": 63.0594787329901 +} diff --git a/research/p104-single-pass-qualification/evidence/B2/stderr.txt b/research/p104-single-pass-qualification/evidence/B2/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/B2/stdout.txt b/research/p104-single-pass-qualification/evidence/B2/stdout.txt new file mode 100644 index 0000000000..968afd624a --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/B2/stdout.txt @@ -0,0 +1,2 @@ +PASS_P104_INTEGER_ERROR_REPLAY +{"mode": "qualify", "receipt": {"all_actual_witness_rows_equal": true, "coefficient_scale_bits": 55, "coordinates": 799, "events": 25984, "finite_fixtures": {"cases": 120, "controls": ["nondyadic scalar", "inexact scale division", "nondyadic weight"], "events": 4240}, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 62.802535} diff --git a/research/p104-single-pass-qualification/evidence/B2/usage.json b/research/p104-single-pass-qualification/evidence/B2/usage.json new file mode 100644 index 0000000000..6355236221 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/B2/usage.json @@ -0,0 +1 @@ +{"user_seconds":62.82,"system_seconds":0.09,"kernel_max_rss_kib":103696,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/B3/receipt.json b/research/p104-single-pass-qualification/evidence/B3/receipt.json new file mode 100644 index 0000000000..d3da142604 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/B3/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "B3", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "523aca683d41dd67cc08e6d7e3cff7bbd5ae5f43f22b4a446cb6b8c964703680", + "runtime_policy_sha256": "9e3b359ae35f943747fef22749632cb137606606c934da66bb83c75e22209900", + "sampled_process_group_rss_bytes": 107892736, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "f1b9cd629a8b82fbbbfe8bfcfa255a5976c8379cc2e8ecc48a6f34c6ce521e81", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 490, + "stdout_sha256": "0a4fadf5e8f111853df912f005bafa35bf150f40be39af16e0dde7bb0c6f6de6", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 103912, + "system_seconds": 0.09, + "user_seconds": 60.54 + }, + "wall_seconds": 60.716181925992714 +} diff --git a/research/p104-single-pass-qualification/evidence/B3/stderr.txt b/research/p104-single-pass-qualification/evidence/B3/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/B3/stdout.txt b/research/p104-single-pass-qualification/evidence/B3/stdout.txt new file mode 100644 index 0000000000..d1edb1e57c --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/B3/stdout.txt @@ -0,0 +1,2 @@ +PASS_P104_INTEGER_ERROR_REPLAY +{"mode": "qualify", "receipt": {"all_actual_witness_rows_equal": true, "coefficient_scale_bits": 55, "coordinates": 799, "events": 25984, "finite_fixtures": {"cases": 120, "controls": ["nondyadic scalar", "inexact scale division", "nondyadic weight"], "events": 4240}, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 60.397112} diff --git a/research/p104-single-pass-qualification/evidence/B3/usage.json b/research/p104-single-pass-qualification/evidence/B3/usage.json new file mode 100644 index 0000000000..078be6f9cf --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/B3/usage.json @@ -0,0 +1 @@ +{"user_seconds":60.54,"system_seconds":0.09,"kernel_max_rss_kib":103912,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/C1/receipt.json b/research/p104-single-pass-qualification/evidence/C1/receipt.json new file mode 100644 index 0000000000..38705c7ed2 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/C1/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "C1", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "523aca683d41dd67cc08e6d7e3cff7bbd5ae5f43f22b4a446cb6b8c964703680", + "runtime_policy_sha256": "9e3b359ae35f943747fef22749632cb137606606c934da66bb83c75e22209900", + "sampled_process_group_rss_bytes": 122322944, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "f1b9cd629a8b82fbbbfe8bfcfa255a5976c8379cc2e8ecc48a6f34c6ce521e81", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1086, + "stdout_sha256": "597f01e3e708ab5513242e1867c15d8a33c7c2ebf0d1ed60ae97301e118931fc", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 118004, + "system_seconds": 0.08, + "user_seconds": 38.8 + }, + "wall_seconds": 38.93709892901825 +} diff --git a/research/p104-single-pass-qualification/evidence/C1/stderr.txt b/research/p104-single-pass-qualification/evidence/C1/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/C1/stdout.txt b/research/p104-single-pass-qualification/evidence/C1/stdout.txt new file mode 100644 index 0000000000..624c66aca2 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/C1/stdout.txt @@ -0,0 +1,3 @@ +{"backends": 2, "controls": ["one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "input-mutation"], "events": 5, "status": "PASS_FINITE_FEASIBILITY_ONLY"} +PASS_P104_SINGLE_PASS_QUALIFICATION +{"mode": "qualify", "receipt": {"all_actual_witness_rows_equal": true, "coefficient_scale_bits": 55, "coordinates": 799, "events": 25984, "finite_fixtures": {"cases": 120, "controls": ["nondyadic scalar", "inexact scale division", "nondyadic weight"], "events": 4240}, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 38.617363} diff --git a/research/p104-single-pass-qualification/evidence/C1/usage.json b/research/p104-single-pass-qualification/evidence/C1/usage.json new file mode 100644 index 0000000000..07a215b257 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/C1/usage.json @@ -0,0 +1 @@ +{"user_seconds":38.80,"system_seconds":0.08,"kernel_max_rss_kib":118004,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/C2/receipt.json b/research/p104-single-pass-qualification/evidence/C2/receipt.json new file mode 100644 index 0000000000..22ddc3b79d --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/C2/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "C2", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "523aca683d41dd67cc08e6d7e3cff7bbd5ae5f43f22b4a446cb6b8c964703680", + "runtime_policy_sha256": "9e3b359ae35f943747fef22749632cb137606606c934da66bb83c75e22209900", + "sampled_process_group_rss_bytes": 122236928, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "f1b9cd629a8b82fbbbfe8bfcfa255a5976c8379cc2e8ecc48a6f34c6ce521e81", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1086, + "stdout_sha256": "20c06368a4b7b79a23c1b60ecb9662e6fe453c5361aae975f7ca0cbe37cb4655", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 117920, + "system_seconds": 0.08, + "user_seconds": 38.8 + }, + "wall_seconds": 39.01679050299572 +} diff --git a/research/p104-single-pass-qualification/evidence/C2/stderr.txt b/research/p104-single-pass-qualification/evidence/C2/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/C2/stdout.txt b/research/p104-single-pass-qualification/evidence/C2/stdout.txt new file mode 100644 index 0000000000..5ce55f33c1 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/C2/stdout.txt @@ -0,0 +1,3 @@ +{"backends": 2, "controls": ["one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "input-mutation"], "events": 5, "status": "PASS_FINITE_FEASIBILITY_ONLY"} +PASS_P104_SINGLE_PASS_QUALIFICATION +{"mode": "qualify", "receipt": {"all_actual_witness_rows_equal": true, "coefficient_scale_bits": 55, "coordinates": 799, "events": 25984, "finite_fixtures": {"cases": 120, "controls": ["nondyadic scalar", "inexact scale division", "nondyadic weight"], "events": 4240}, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 38.679268} diff --git a/research/p104-single-pass-qualification/evidence/C2/usage.json b/research/p104-single-pass-qualification/evidence/C2/usage.json new file mode 100644 index 0000000000..71a2ccbdfe --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/C2/usage.json @@ -0,0 +1 @@ +{"user_seconds":38.80,"system_seconds":0.08,"kernel_max_rss_kib":117920,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/C3/receipt.json b/research/p104-single-pass-qualification/evidence/C3/receipt.json new file mode 100644 index 0000000000..30a135acaa --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/C3/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "C3", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "523aca683d41dd67cc08e6d7e3cff7bbd5ae5f43f22b4a446cb6b8c964703680", + "runtime_policy_sha256": "9e3b359ae35f943747fef22749632cb137606606c934da66bb83c75e22209900", + "sampled_process_group_rss_bytes": 121622528, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "f1b9cd629a8b82fbbbfe8bfcfa255a5976c8379cc2e8ecc48a6f34c6ce521e81", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1085, + "stdout_sha256": "516780c2b8645a2536280c20ec8885e60b96b0debff5005f91a2ba327fdc0a95", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 117320, + "system_seconds": 0.1, + "user_seconds": 38.83 + }, + "wall_seconds": 39.01491572102532 +} diff --git a/research/p104-single-pass-qualification/evidence/C3/stderr.txt b/research/p104-single-pass-qualification/evidence/C3/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/C3/stdout.txt b/research/p104-single-pass-qualification/evidence/C3/stdout.txt new file mode 100644 index 0000000000..f022a48359 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/C3/stdout.txt @@ -0,0 +1,3 @@ +{"backends": 2, "controls": ["one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "input-mutation"], "events": 5, "status": "PASS_FINITE_FEASIBILITY_ONLY"} +PASS_P104_SINGLE_PASS_QUALIFICATION +{"mode": "qualify", "receipt": {"all_actual_witness_rows_equal": true, "coefficient_scale_bits": 55, "coordinates": 799, "events": 25984, "finite_fixtures": {"cases": 120, "controls": ["nondyadic scalar", "inexact scale division", "nondyadic weight"], "events": 4240}, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 38.68864} diff --git a/research/p104-single-pass-qualification/evidence/C3/usage.json b/research/p104-single-pass-qualification/evidence/C3/usage.json new file mode 100644 index 0000000000..f18c8053dd --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/C3/usage.json @@ -0,0 +1 @@ +{"user_seconds":38.83,"system_seconds":0.10,"kernel_max_rss_kib":117320,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/CLAIM.md b/research/p104-single-pass-qualification/evidence/CLAIM.md new file mode 100644 index 0000000000..3953de4f1e --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/CLAIM.md @@ -0,0 +1 @@ +CLAIM — bounded verification-engineering follow-up to [PR #5839](https://github.com/CrocSwap/integer-mult-bounds/pull/5839). Profile shared helper tests (first the complete descendant-source-role group flagged by existing CI timestamps) and full frozen [PR #5831](https://github.com/CrocSwap/integer-mult-bounds/pull/5831) qualification at `7c5eb98e7439d778141d63e801e53d4cd7e1d587`. Authenticate fixtures/history first; profile before nomination; test finite coverage/isolation feasibility before construction. Keep all affected tests and failure behaviour, or all 25,984 events/799 coordinates, independent Fraction/integer backends, actual witnesses and 120-program/4,240-event controls. At most one candidate; a performance PR requires >=15% complete-stage wall AND CPU savings. Serial, no automatic retries; source precision command remains 180 s, helper group capped at 300 s (below its 10-minute CI job), 1 GiB sampled group RSS, 600 s profile stage and 1,500 s later cumulative cap. Stop on missing closure, source/receipt/control drift, stderr/resource failure or insufficient complete-stage saving; preserve failures. Canonical main `de5ec2e7a6074068452f45b1a191b5c72832df4a`; targeted PR/source searches show no matching successor but do not establish exhaustive/unpublished coverage. Expiry 27 October 2026 at 18:00 AEDT. Kappa research, Work 1/2, feeds, workers and automations remain paused. Preserve Ali Romman, roger-sato/Arham Tahir, PR5761/5816/5818/5831/5832/5839 and all retained precision/tooling provenance. Chris R / Clear1nsight with substantial OpenAI Codex assistance; no subagents. diff --git a/research/p104-single-pass-qualification/evidence/FEASIBILITY-PLAN.md b/research/p104-single-pass-qualification/evidence/FEASIBILITY-PLAN.md new file mode 100644 index 0000000000..a2ed933e42 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/FEASIBILITY-PLAN.md @@ -0,0 +1,9 @@ +# Pre-construction feasibility gate + +Profile result: complete frozen PR5831 qualification costs 61.609 s wall /61.55 s CPU. Extra Fraction ideal/error calls account for about 23 s inclusive; integer actual calls add more. No full-stage saving is claimed from this instrumented run. + +Nomination: scoped capture of the successful actual ideal and error-trace outputs inside each independently executed complete contract. Keep the full Fraction and integer calculations, every transpose/literal oracle and rejection, all actual witness/weight comparisons and all 120 finite programs. No sharing between backends or runs, no persisted cache, and no removal of full-source authentication. Captures are one-use observations rather than arithmetic results reused to skip a backend. + +Before construction, use a valid five-event native-frame fixture through the real frozen Fraction and integer modules. Compare both full captured ideal/weights and trace/witness results to fresh independent reruns. Require missing capture, duplicate actual calls, wrong word, changed weights/rounding, mutable-return aliasing, exception, cross-context reuse and use after close to be detected or isolated as specified. Original source exceptions must propagate; unrelated malformed-word rejection calls cannot overwrite actual observations. Capture succeeds only after a successful complete enclosing calculation. Fail closed on changed input during execution. No scientific construction or source edit before this test passes. + +A positive finite result only permits one complete candidate. First fresh complete B/C pair must save >=15% wall and CPU, followed by the retained B,C,C,B,B,C order, normal/optimized/sealed qualification and receipt/control equality. Coverage includes every 25,984 event,799-coordinate pass and independent oracle from PR5831; no shared-helper test change is authorized by this nomination. diff --git a/research/p104-single-pass-qualification/evidence/HELPER-CLOSURE.json b/research/p104-single-pass-qualification/evidence/HELPER-CLOSURE.json new file mode 100644 index 0000000000..431852011c --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/HELPER-CLOSURE.json @@ -0,0 +1,58 @@ +{ + "status": "PASS_PREFLIGHT", + "original": "20ecf2891d80b5acf18d980b2164fb44ea7faa90", + "base": "6f100d4bb5083f8c35d96fd95a539811c62f245c", + "files": { + "research/isolated-descendant-bytecode/README.md": "30ade86e2681f2e81f63deef3abf0b0e57f8af63118bd0333d8011695f24e67d", + "research/isolated-descendant-bytecode/RESULT.json": "f427603d45345ebc2ccaee556e8e400e4440634eec14d6ae81df0fb581df1b63", + "research/isolated-descendant-bytecode/SOURCES.json": "5f0801637836f610178e969b14225e14d6dfc945f8c4b674130facf6a3003b11", + "research/isolated-descendant-bytecode/TASK.json": "a7839edce8a021efc250887a69bf1d12fa4b838ced52d2e8b275df5442b182ba", + "research/isolated-descendant-bytecode/VERIFY.json": "44f95793d568c302d9256395560c45bed3254f1c8c6850a4e12c62ab8544263f", + "research/isolated-descendant-bytecode/verify.py": "788ec6375dff8c519a96801aca78d5c3c3724de80458db48606e68fda9091b31", + "scripts/check_research_commit.py": "63026ec3805f2a3236cc071fc78cf1c54bc6528c43e2f3d82548dc68bf346bce", + "scripts/replay_historical_check.py": "5467619c78183d3adc82b0cb55af28e5c1a01fca2b0588677816244b53e2bafd", + "scripts/research_package.py": "84a45190a6a96c20993a0d4a1045fbf24de660d2e6fef8f8a447bb3d1aa78db6", + "scripts/run_isolated_tests.py": "f52f3df082b55f19a39db1d7874a29a7797ffa9ae2bac34f9a97789657e03948", + "tests/test_isolated_test_bytecode.py": "c0aa83b63b982a3a7283a28b86c4ddf2edc6060f53be7d206a90a147b7676004", + "tests/test_research_bytecode_isolation.py": "799244198e2e673cab05537d5a4b36ceed3dacc3e4e6677d25467103edd65270", + "tests/test_research_source_history.py": "0175206fa52dff514fea4d625a072bb66735eb5214be9396dc42b874f0918454" + }, + "pinned_historical_rows": [ + { + "path": "certificates/selected-result.json", + "usage": "provenance", + "git_blob": "b1fea0c94436b236cc2b7d41a7be032811b94c81", + "sha256": "bb2eaa58647b353f88d0aec2eafb9d30df1be53589231b23e12ceef3e4bad129" + }, + { + "path": "docs/research/agent-task-catalog.json", + "usage": "provenance", + "git_blob": "67f085acd86acd7d4e03922d9cf4b26bca66fed5", + "sha256": "47b42433f5a85809a3aadd29c2c339da2c6ed728e4f7762df6b88bccb7874cf0" + }, + { + "path": "scripts/check_research_commit.py", + "usage": "input", + "git_blob": "08a956131b578fe947c20148871dc1c34fba9b12", + "sha256": "ecf206a82bf1f4e748efb6cc639919582050d173b3537ec12f7265a4f7b55ead" + }, + { + "path": "scripts/research_package.py", + "usage": "provenance", + "git_blob": "404823640a4506cc363d5e999b724553a41a39a2", + "sha256": "8e1fe8bebe7f045c82a672a103ed87a35cd9dfdbab5848b97969350449d0c8b4" + }, + { + "path": "scripts/run_isolated_tests.py", + "usage": "provenance", + "git_blob": "50a2d5d2af4ea8f61b6c1d93924febea4f32f439", + "sha256": "88d738d3c1e8eb9bd580d9dc2f40b0421975e46013ce09bd6833d97a8600789d" + }, + { + "path": "tests/test_research_source_history.py", + "usage": "provenance", + "git_blob": "9c52884a4663c089e2331b769b50d14da4575d9f", + "sha256": "2b974b7c1f5fcb1994c2b76be32554378cec91871224fca0af011d0640dc5514" + } + ] +} diff --git a/research/p104-single-pass-qualification/evidence/METADATA-DRAFT-REJECTION.txt b/research/p104-single-pass-qualification/evidence/METADATA-DRAFT-REJECTION.txt new file mode 100644 index 0000000000..e34101fd1a --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/METADATA-DRAFT-REJECTION.txt @@ -0,0 +1 @@ +Before execution of the registered entry point, metadata --check-only rejected the draft outcome string: TASK.json.outcome must be partial, completed, blocked or negative-result; found "in validation". Corrected the draft enum to partial; no source, expected output, scientific code or resource limit changed. This is a metadata preflight rejection, not a scientific run. diff --git a/research/p104-single-pass-qualification/evidence/PLAN.json b/research/p104-single-pass-qualification/evidence/PLAN.json new file mode 100644 index 0000000000..724dda740c --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/PLAN.json @@ -0,0 +1,51 @@ +{ + "scope": "Profile a nominated shared-helper group and full frozen PR5831 qualification, then choose at most one optimisation after feasibility.", + "main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "base_with_exact_PR5761_test_dependency": "01014cbe772ea5a59ccbc55266222433944c7368", + "precision_head": "7c5eb98e7439d778141d63e801e53d4cd7e1d587", + "helper_group": "test_research_descendant_source_roles (screened from existing CI timestamps; not yet profiled)", + "gates": [ + "Authenticate full helper fixture/history closure before collecting tests; preserve incomplete preflight as unavailable, never as a pass.", + "One serial per-test/function profile of the nominated helper group and one full precision qualification. Profiling excluded from performance comparison.", + "Require source-bound coverage map and tiny actual feasibility with mutation/stale/missing/exception controls before optimisation construction.", + "Require >=15% less wall and CPU across the complete affected stage, first pair before expanded measurements. Retain all samples and failures.", + "If shared tests change, preserve all 513 collected test IDs and platform-skip conditions with fresh mutable state; if precision changes, preserve all original 25984 events/799 coordinates, both independent arithmetic backends, full witnesses, all 120/4240 finite checks and all controls.", + "Normal/optimized/read-only Git-free relevant checks, exact committed head and hosted CI before final PR handoff." + ], + "limits": { + "profile_stage_seconds": 600, + "later_cumulative_seconds": 1500, + "precision_command_seconds": 180, + "helper_group_seconds": 300, + "sampled_process_group_rss_bytes": 1073741824, + "serial_full_runs": true, + "automatic_retries": 0 + }, + "stop": [ + "Source/fixture/head/byte/mode drift or incomplete required closure.", + "Scientific/test assertion/receipt/control mismatch, unexpected stderr or resource stop. Preserve a diagnosed pre-target launcher error separately before any manual correction.", + "No credible complete-stage 15% opportunity, coverage/isolation loss or existing overlapping implementation: retain scoped finding and reassess before expansion." + ], + "kappa_research": "PAUSED", + "agents_dispatched": 0, + "nomination": "Independent one-use first-pass observation for frozen PR5831 complete qualification; no shared helper edits", + "profile_gate": { + "status": "PASS", + "helper_wall_seconds": 51.317216966999695, + "helper_setup_seconds": 0.2867602859332692, + "helper_fixture_only_max_fraction": 0.005587993715981805, + "helper_tests": 10, + "helper_fixture_reuse": "STOP: even zero setup is below15%", + "precision_wall_seconds": 61.608995726011926, + "full_receipt_equal": true + }, + "feasibility_gate": { + "status": "PASS", + "controls": 27, + "backends": 2, + "events": 5, + "normal_and_O": true, + "native_argument_types_preserved": true + }, + "construction_gate": "OPEN: one candidate; first complete B/C pair gates expanded runs" +} diff --git a/research/p104-single-pass-qualification/evidence/SEALED-BEFORE.json b/research/p104-single-pass-qualification/evidence/SEALED-BEFORE.json new file mode 100644 index 0000000000..4acfb9f342 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/SEALED-BEFORE.json @@ -0,0 +1,366 @@ +{ + ".research-export.json": [ + "4116e194d81f58071f419ad04fbdf5b04ec659fe4388882a17130166638fa8fa", + 292 + ], + "research/p104-single-pass-qualification/replay.py": [ + "2224b9d5ca0f3e30e672806a3e7c4f18f3c8623995973c9a9608fe5315dbcd39", + 292 + ], + "research/p104-single-pass-qualification/PROFILE.md": [ + "075940156243941b536585d49052580c74a241fa866898eca25d62e2e97db5e0", + 292 + ], + "research/p104-single-pass-qualification/observe.py": [ + "31d39571176d8d690b8f35f0953d4e36c0e26648a63dfc0f2b0713048caa63fd", + 292 + ], + "research/p104-single-pass-qualification/verify.py": [ + "14c458516445e1a27a9c6236f589cb34e214c061f53fd56285d01bc2b47cb852", + 292 + ], + "research/p104-single-pass-qualification/COVERAGE.md": [ + "1aff44f235b4b576165223dc311621e38e8ffcdcbcf3491a9cc7d47805b57141", + 292 + ], + "research/p104-single-pass-qualification/custody.py": [ + "307021ce3b7c5d36f792544657ced02d47ac933ce4bc7c0a34e149ee019b929f", + 292 + ], + "research/p104-single-pass-qualification/guard.py": [ + "523aca683d41dd67cc08e6d7e3cff7bbd5ae5f43f22b4a446cb6b8c964703680", + 292 + ], + "research/p104-single-pass-qualification/BENCHMARK-pair.json": [ + "4dd8d441e9621b6be633b91447c6bf690a99f71b74ca8e65d1baccc342d50856", + 292 + ], + "research/p104-single-pass-qualification/PROOF.md": [ + "2c2230d32f7f922ef0c3e27fd67c0efc59a852e8e661a4b1737efa7b82a1670d", + 292 + ], + "research/p104-single-pass-qualification/RESULT.json": [ + "0e637f19fdbb784af69ef1a42fc6abf1f25eb9805954c394145b6be72827b1f9", + 292 + ], + "research/p104-single-pass-qualification/VALIDATION.json": [ + "a256f761179cdeff0117002fe0c12b15ea6636f7f962f5af4e88f6a7deac9593", + 292 + ], + "research/p104-single-pass-qualification/candidate.py": [ + "00cb0b03c618ddd9ff7ca77764e6c3076ab52125f2b2c09dd71218e8cb037e69", + 292 + ], + "research/p104-single-pass-qualification/SOURCES.json": [ + "9542e777cedf38b50af03b3241c4af225ed6fc84fc49d72c4dd15f72d059d732", + 292 + ], + "research/p104-single-pass-qualification/benchmark.py": [ + "4f9f3f3b22f5926cdb2678ad3654a638dc5b36f11af34c79e8c3ee7cc133f660", + 292 + ], + "research/p104-single-pass-qualification/README.md": [ + "cfa4c677b5f30b1d8ed4db6b8c35057548df71eb533a23007fa588f670b5505b", + 292 + ], + "research/p104-single-pass-qualification/baseline.py": [ + "3683142dfe57c7621fdd38a659145ad3431787bab5ec5f82758a7ffa634b8885", + 292 + ], + "research/p104-single-pass-qualification/.gitignore": [ + "f810730044c8012b0364fd1e80bbbe53b40867d8e2bdf22e6278c3c354fcd011", + 292 + ], + "research/p104-single-pass-qualification/source.py": [ + "573a24349bd2976cde3a7699bcfe4fcc9af26270285403b8e1f53b75a884176c", + 292 + ], + "research/p104-single-pass-qualification/finite.py": [ + "93b6582994b904c486e69c140e1195c551291afd014f2ae240a51fecdc14bbaf", + 292 + ], + "research/p104-single-pass-qualification/BENCHMARK-remaining.json": [ + "a44264a3e24d209f44b888436b6134a99cd4935c81af6dc4b1457201d4a47dbb", + 292 + ], + "research/p104-single-pass-qualification/BENCHMARK.json": [ + "b5cda1660077d6b22b70fdd9ee343deeece974469e704d06741d9361d3e9d088", + 292 + ], + "research/p104-single-pass-qualification/TASK.json": [ + "59de989e4720537da5a96ee997c7a23e5affc0f7eedf91a1f678475207f67a0c", + 292 + ], + "research/p104-single-pass-qualification/VERIFY.json": [ + "2ba6a1bb114599d37b1098d831d55db7575528107ebc19813daf8547ededa61f", + 292 + ], + "research/p104-single-pass-qualification/inputs/PR5831.tar": [ + "6ad8d8e0463e8e6ea8d503610c3f9ec38108f16092bc479bc1cb6f48683f6ab6", + 292 + ], + "research/p104-single-pass-qualification/evidence/HELPER-CLOSURE.json": [ + "b9dd945a09c70cbf78279120478e7e86ce1133ff92281577612972a9ef3fe14f", + 292 + ], + "research/p104-single-pass-qualification/evidence/PLAN.json": [ + "49992b77ca779f56073c44e111f68bb7637b5502ff0fbfc2abadf46c2a2f83c4", + 292 + ], + "research/p104-single-pass-qualification/evidence/METADATA-DRAFT-REJECTION.txt": [ + "8513d5c70659ea47ed73265911a05f2ce308ff0f70ad44adcc028e8f4659ce45", + 292 + ], + "research/p104-single-pass-qualification/evidence/CLAIM.md": [ + "96e20e92bf86110e6bc1cb402b889980bc6bee050042dce0abe08f75904f44b9", + 292 + ], + "research/p104-single-pass-qualification/evidence/FEASIBILITY-PLAN.md": [ + "0ca77208c38f85e12b492bab2a8fd75ad9c197385c9db3dba00b0a859574920b", + 292 + ], + "research/p104-single-pass-qualification/evidence/C1/stdout.txt": [ + "597f01e3e708ab5513242e1867c15d8a33c7c2ebf0d1ed60ae97301e118931fc", + 292 + ], + "research/p104-single-pass-qualification/evidence/C1/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/C1/usage.json": [ + "9b6379165f83959edf6e28c5c94585d03571a847312b55308c454271e42c72af", + 292 + ], + "research/p104-single-pass-qualification/evidence/C1/receipt.json": [ + "31ff4f65ef5e3ee6b963e767d833ca232186961e12653f416a9472d13f2216ea", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite/stdout.txt": [ + "a572476833d446e9ea4197aa8550854997bdd344fa9fd6e5dc916cb236a46f42", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite/receipt.json": [ + "097d61f8f1a8e8ad4bd73c8929d197050a36f64eb1587ee4d189fac64567f779", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite/usage.json": [ + "0b78a3631487d6c0a9a60befc32ae372a646a4f847c8f53b462e3b7ef7118163", + 292 + ], + "research/p104-single-pass-qualification/evidence/B2/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/B2/stdout.txt": [ + "5364ed37f332b0dc413139f7b247ad7167f05376ddfed0db163d412444c54e8c", + 292 + ], + "research/p104-single-pass-qualification/evidence/B2/usage.json": [ + "366c89becae08fbf4e15419e888304febe34e9a46fc5f9a3076795140d01465c", + 292 + ], + "research/p104-single-pass-qualification/evidence/B2/receipt.json": [ + "9ccd3ce315716b00e11e2842b0b209feff90700a7ab5075a876d0e1d8c4f065e", + 292 + ], + "research/p104-single-pass-qualification/evidence/registered-O/usage.json": [ + "de7ef20f181b7783f2e3158c0dab96a9022be8ee4e84267e433422950c55b762", + 292 + ], + "research/p104-single-pass-qualification/evidence/registered-O/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/registered-O/receipt.json": [ + "665bfc1caae8f57b435d2e8ced9ee9e8675b420082df1de56b99ea853dc2c28a", + 292 + ], + "research/p104-single-pass-qualification/evidence/registered-O/stdout.txt": [ + "09f7638198857fea399a36e7bd4dd3345314d1880459de7ad7ed75ada62ac526", + 292 + ], + "research/p104-single-pass-qualification/evidence/registered-normal/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/registered-normal/stdout.txt": [ + "213dca818fadca954452dec68866d3f36d3ba85017a847bffb731da14190bc5c", + 292 + ], + "research/p104-single-pass-qualification/evidence/registered-normal/usage.json": [ + "bbc6d0af9b6156cdec526a8de6cc121146d4e2f56708d9a35fbfb059f093996d", + 292 + ], + "research/p104-single-pass-qualification/evidence/registered-normal/receipt.json": [ + "414a5c483343ddf3f14e242f5bc34022a89d39aef958621edf9ff68b025d57a7", + 292 + ], + "research/p104-single-pass-qualification/evidence/C2/usage.json": [ + "5bdec9f9cc25870c1aefb2fff6676c320ad6025f84273ce02361b48562e4c091", + 292 + ], + "research/p104-single-pass-qualification/evidence/C2/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/C2/stdout.txt": [ + "20c06368a4b7b79a23c1b60ecb9662e6fe453c5361aae975f7ca0cbe37cb4655", + 292 + ], + "research/p104-single-pass-qualification/evidence/C2/receipt.json": [ + "3b8ce5e7ab494659d22eb5afae25f6038b30fa385ca8ef5a7f1e35a806588fa6", + 292 + ], + "research/p104-single-pass-qualification/evidence/B1/usage.json": [ + "6727cbc9b32649bf98586ee06ce9558c28ec1e48c6e1ae7ebbb673d9115a54a1", + 292 + ], + "research/p104-single-pass-qualification/evidence/B1/stdout.txt": [ + "d835d0c9eecd0f1ea8ece765700ef3f8e51601f45533a1d5b4c5680fb5e5671a", + 292 + ], + "research/p104-single-pass-qualification/evidence/B1/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/B1/receipt.json": [ + "2bf7ad6e705de43df4447135602afa98531deabaff4005871a42de32155d8a12", + 292 + ], + "research/p104-single-pass-qualification/evidence/profile-runtime/dispatch.py": [ + "0c728ab8c5e6263a12d73aef6b245a3af1c71c1c7d2fe8ad3638296429f88213", + 292 + ], + "research/p104-single-pass-qualification/evidence/profile-runtime/source.py": [ + "573a24349bd2976cde3a7699bcfe4fcc9af26270285403b8e1f53b75a884176c", + 292 + ], + "research/p104-single-pass-qualification/evidence/profile-runtime/profile_helper.py": [ + "19d831fd8ff5f39934608d7d92ea5dfa070d56c341d3ddb7d79f229de29f4f44", + 292 + ], + "research/p104-single-pass-qualification/evidence/profile-runtime/guard.py": [ + "269fbaf3439c35813a6b979d1f270c43ffc1eee887687683931f28a1906d8a85", + 292 + ], + "research/p104-single-pass-qualification/evidence/profile-runtime/profile_precision.py": [ + "21cacd8212583150c2099f2b2c5e2ec900f884613eb750bfd2fdd083c81bc82b", + 292 + ], + "research/p104-single-pass-qualification/evidence/precision/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/precision/stdout.txt": [ + "123308d716a5e12b464b1110c719174f8e290d6a890022ea1382cd92ad32e49f", + 292 + ], + "research/p104-single-pass-qualification/evidence/precision/receipt.json": [ + "5e91433748c045b557f9d84df825d70a9ddb08281d18cd0120a8b06324506d47", + 292 + ], + "research/p104-single-pass-qualification/evidence/precision/usage.json": [ + "4ed74072e71318a70cc921d9efcfb418ba32310a40655252ceee73b6adf4bcc0", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite-O/usage.json": [ + "d349c636e8d81e9b2a91117b0610f1840448c0a8bee06eab77f5703a3e078e61", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite-O/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite-O/receipt.json": [ + "5b850742a3c8dd676b34d6294421fa4a9d8bede16c7a005066aedf629ce90383", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite-O/stdout.txt": [ + "a572476833d446e9ea4197aa8550854997bdd344fa9fd6e5dc916cb236a46f42", + 292 + ], + "research/p104-single-pass-qualification/evidence/B3/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/B3/stdout.txt": [ + "0a4fadf5e8f111853df912f005bafa35bf150f40be39af16e0dde7bb0c6f6de6", + 292 + ], + "research/p104-single-pass-qualification/evidence/B3/usage.json": [ + "4480c3eb194cfed74ac94df6a0677a48aef9598c7cde0a3044c0b185fde4780c", + 292 + ], + "research/p104-single-pass-qualification/evidence/B3/receipt.json": [ + "4f509382012196bfcdfd181c2cd8cdcbceab84ac45e43f591d13972fa7478077", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite-native-set-O/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite-native-set-O/stdout.txt": [ + "a572476833d446e9ea4197aa8550854997bdd344fa9fd6e5dc916cb236a46f42", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite-native-set-O/receipt.json": [ + "e0b41c31b8f53e5d5fb2437d738314c38d5bece206e7f08d563ed9bb6bc66752", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite-native-set-O/usage.json": [ + "f998110a2847a371de08a75d4c7bfecd0002a593125dc8a54b6b89ade12abb12", + 292 + ], + "research/p104-single-pass-qualification/evidence/helper/usage.json": [ + "786aa31a99717fc877dfa4c4f5a6139f5b7dde01cc6636898fd458e87069ebd1", + 292 + ], + "research/p104-single-pass-qualification/evidence/helper/receipt.json": [ + "c1493930e93d996699e8f3543a97dfc2e50fe9c39523882a52c47a27e1ac1eae", + 292 + ], + "research/p104-single-pass-qualification/evidence/helper/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/helper/stdout.txt": [ + "e25c68dc48c5155b81a9c4097c3c462bd30053276b811f2389f0c8f327fff6bd", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite-native-set/stdout.txt": [ + "a572476833d446e9ea4197aa8550854997bdd344fa9fd6e5dc916cb236a46f42", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite-native-set/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite-native-set/receipt.json": [ + "113399065e79a5c91e9f8cb9f90b864a8fd0d5b058832a271132d104cf43aca8", + 292 + ], + "research/p104-single-pass-qualification/evidence/finite-native-set/usage.json": [ + "515f359cb3fa57f0f854328975f106cf485884fb2a8d1374f1d83cea26ec6640", + 292 + ], + "research/p104-single-pass-qualification/evidence/C3/receipt.json": [ + "a2490ff12b013727f51a7b5e25088f488b011e9806d554d0fa096886d9f59fe0", + 292 + ], + "research/p104-single-pass-qualification/evidence/C3/usage.json": [ + "a1dd1b10d06da58978564be288c2eba6a894a57df0345758f7d8c1dd36006989", + 292 + ], + "research/p104-single-pass-qualification/evidence/C3/stderr.txt": [ + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + 292 + ], + "research/p104-single-pass-qualification/evidence/C3/stdout.txt": [ + "516780c2b8645a2536280c20ec8885e60b96b0debff5005f91a2ba327fdc0a95", + 292 + ] +} diff --git a/research/p104-single-pass-qualification/evidence/SEALED-RESULT.json b/research/p104-single-pass-qualification/evidence/SEALED-RESULT.json new file mode 100644 index 0000000000..d791243041 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/SEALED-RESULT.json @@ -0,0 +1,8 @@ +{ + "status": "PASS_SEALED_GIT_FREE_QUALIFICATION", + "files_unchanged": 91, + "receipt_equal": true, + "wall_seconds": 39.24383878399385, + "implementation": "9b8cffa57c09eefba39dc6a4efdc34a15dfc1ebd", + "archive_sha256": "7601159a7d13797e89efa94499cb0c9b1ce8aa340de2f88207b67b43e46ea03d" +} diff --git a/research/p104-single-pass-qualification/evidence/finite-O/receipt.json b/research/p104-single-pass-qualification/evidence/finite-O/receipt.json new file mode 100644 index 0000000000..19a6b2a4cb --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/finite-O/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "finite-O", + "optimized": true, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "269fbaf3439c35813a6b979d1f270c43ffc1eee887687683931f28a1906d8a85", + "runtime_policy_sha256": "1841981e12a6f7ab70e17fdbedb913b15fc365aa28292f0c5fc3cb7e4ec2ba86", + "sampled_process_group_rss_bytes": 26308608, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "c4928c1ce12e50e4b3a28e4a415f28aabc8cd26eccb2e4ad7f33925fc90edf1f", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 591, + "stdout_sha256": "a572476833d446e9ea4197aa8550854997bdd344fa9fd6e5dc916cb236a46f42", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 24424, + "system_seconds": 0.01, + "user_seconds": 0.21 + }, + "wall_seconds": 0.2544275099935476 +} diff --git a/research/p104-single-pass-qualification/evidence/finite-O/stderr.txt b/research/p104-single-pass-qualification/evidence/finite-O/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/finite-O/stdout.txt b/research/p104-single-pass-qualification/evidence/finite-O/stdout.txt new file mode 100644 index 0000000000..a9fca8aeef --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/finite-O/stdout.txt @@ -0,0 +1 @@ +{"backends": 2, "controls": ["one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "input-mutation"], "events": 5, "status": "PASS_FINITE_FEASIBILITY_ONLY"} diff --git a/research/p104-single-pass-qualification/evidence/finite-O/usage.json b/research/p104-single-pass-qualification/evidence/finite-O/usage.json new file mode 100644 index 0000000000..7ad12dbfe8 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/finite-O/usage.json @@ -0,0 +1 @@ +{"user_seconds":0.21,"system_seconds":0.01,"kernel_max_rss_kib":24424,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/finite-native-set-O/receipt.json b/research/p104-single-pass-qualification/evidence/finite-native-set-O/receipt.json new file mode 100644 index 0000000000..7344ac3e7f --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/finite-native-set-O/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "finite-native-set-O", + "optimized": true, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "269fbaf3439c35813a6b979d1f270c43ffc1eee887687683931f28a1906d8a85", + "runtime_policy_sha256": "1841981e12a6f7ab70e17fdbedb913b15fc365aa28292f0c5fc3cb7e4ec2ba86", + "sampled_process_group_rss_bytes": 25640960, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "3acf6e190c978a1b736896cceea89423b9190063b9111cc160414d0879df2444", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 591, + "stdout_sha256": "a572476833d446e9ea4197aa8550854997bdd344fa9fd6e5dc916cb236a46f42", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 24376, + "system_seconds": 0.01, + "user_seconds": 0.2 + }, + "wall_seconds": 0.2536778039939236 +} diff --git a/research/p104-single-pass-qualification/evidence/finite-native-set-O/stderr.txt b/research/p104-single-pass-qualification/evidence/finite-native-set-O/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/finite-native-set-O/stdout.txt b/research/p104-single-pass-qualification/evidence/finite-native-set-O/stdout.txt new file mode 100644 index 0000000000..a9fca8aeef --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/finite-native-set-O/stdout.txt @@ -0,0 +1 @@ +{"backends": 2, "controls": ["one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "input-mutation"], "events": 5, "status": "PASS_FINITE_FEASIBILITY_ONLY"} diff --git a/research/p104-single-pass-qualification/evidence/finite-native-set-O/usage.json b/research/p104-single-pass-qualification/evidence/finite-native-set-O/usage.json new file mode 100644 index 0000000000..1eaaa8ca23 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/finite-native-set-O/usage.json @@ -0,0 +1 @@ +{"user_seconds":0.20,"system_seconds":0.01,"kernel_max_rss_kib":24376,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/finite-native-set/receipt.json b/research/p104-single-pass-qualification/evidence/finite-native-set/receipt.json new file mode 100644 index 0000000000..4049d117ba --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/finite-native-set/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "finite-native-set", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "269fbaf3439c35813a6b979d1f270c43ffc1eee887687683931f28a1906d8a85", + "runtime_policy_sha256": "1841981e12a6f7ab70e17fdbedb913b15fc365aa28292f0c5fc3cb7e4ec2ba86", + "sampled_process_group_rss_bytes": 26578944, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "3acf6e190c978a1b736896cceea89423b9190063b9111cc160414d0879df2444", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 591, + "stdout_sha256": "a572476833d446e9ea4197aa8550854997bdd344fa9fd6e5dc916cb236a46f42", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 24832, + "system_seconds": 0.01, + "user_seconds": 0.24 + }, + "wall_seconds": 0.3065952259930782 +} diff --git a/research/p104-single-pass-qualification/evidence/finite-native-set/stderr.txt b/research/p104-single-pass-qualification/evidence/finite-native-set/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/finite-native-set/stdout.txt b/research/p104-single-pass-qualification/evidence/finite-native-set/stdout.txt new file mode 100644 index 0000000000..a9fca8aeef --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/finite-native-set/stdout.txt @@ -0,0 +1 @@ +{"backends": 2, "controls": ["one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "input-mutation"], "events": 5, "status": "PASS_FINITE_FEASIBILITY_ONLY"} diff --git a/research/p104-single-pass-qualification/evidence/finite-native-set/usage.json b/research/p104-single-pass-qualification/evidence/finite-native-set/usage.json new file mode 100644 index 0000000000..c84cfe9707 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/finite-native-set/usage.json @@ -0,0 +1 @@ +{"user_seconds":0.24,"system_seconds":0.01,"kernel_max_rss_kib":24832,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/finite/receipt.json b/research/p104-single-pass-qualification/evidence/finite/receipt.json new file mode 100644 index 0000000000..576220ae3d --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/finite/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "finite", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "269fbaf3439c35813a6b979d1f270c43ffc1eee887687683931f28a1906d8a85", + "runtime_policy_sha256": "1841981e12a6f7ab70e17fdbedb913b15fc365aa28292f0c5fc3cb7e4ec2ba86", + "sampled_process_group_rss_bytes": 26574848, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "c4928c1ce12e50e4b3a28e4a415f28aabc8cd26eccb2e4ad7f33925fc90edf1f", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 591, + "stdout_sha256": "a572476833d446e9ea4197aa8550854997bdd344fa9fd6e5dc916cb236a46f42", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 24828, + "system_seconds": 0.01, + "user_seconds": 0.22 + }, + "wall_seconds": 0.2534722599957604 +} diff --git a/research/p104-single-pass-qualification/evidence/finite/stderr.txt b/research/p104-single-pass-qualification/evidence/finite/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/finite/stdout.txt b/research/p104-single-pass-qualification/evidence/finite/stdout.txt new file mode 100644 index 0000000000..a9fca8aeef --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/finite/stdout.txt @@ -0,0 +1 @@ +{"backends": 2, "controls": ["one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "input-mutation"], "events": 5, "status": "PASS_FINITE_FEASIBILITY_ONLY"} diff --git a/research/p104-single-pass-qualification/evidence/finite/usage.json b/research/p104-single-pass-qualification/evidence/finite/usage.json new file mode 100644 index 0000000000..94cfebd24c --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/finite/usage.json @@ -0,0 +1 @@ +{"user_seconds":0.22,"system_seconds":0.01,"kernel_max_rss_kib":24828,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/helper/receipt.json b/research/p104-single-pass-qualification/evidence/helper/receipt.json new file mode 100644 index 0000000000..e7abdb37ce --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/helper/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "helper", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "6cd355f162aa5be9ee1f6a59a74612983b3a97aee4d3e30630dffe22d25bcc6e", + "runtime_policy_sha256": "8429a601d0e78b4e0e41b440a0db5202ca1dad6606d02d0a6f550d859f53a03b", + "sampled_process_group_rss_bytes": 94314496, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "8238a336e92c6d530518a6db63ae76681d3b3e986655661a1c97ce3bfd0e7383", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 3393, + "stdout_sha256": "e25c68dc48c5155b81a9c4097c3c462bd30053276b811f2389f0c8f327fff6bd", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 37324, + "system_seconds": 3.12, + "user_seconds": 45.73 + }, + "wall_seconds": 51.317216966999695 +} diff --git a/research/p104-single-pass-qualification/evidence/helper/stderr.txt b/research/p104-single-pass-qualification/evidence/helper/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/helper/stdout.txt b/research/p104-single-pass-qualification/evidence/helper/stdout.txt new file mode 100644 index 0000000000..9b368ad885 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/helper/stdout.txt @@ -0,0 +1,16 @@ +test_broken_live_cache_isolation_fails_the_unchanged_registered_command (profile_helper_group.DescendantSourceRoleTests.test_broken_live_cache_isolation_fails_the_unchanged_registered_command) ... ok +test_current_helper_remains_a_planner_and_publication_input (profile_helper_group.DescendantSourceRoleTests.test_current_helper_remains_a_planner_and_publication_input) ... ok +test_historical_blob_and_hash_corruption_still_rejects (profile_helper_group.DescendantSourceRoleTests.test_historical_blob_and_hash_corruption_still_rejects) ... ok +test_historical_history_test_pin_corruption_rejects (profile_helper_group.DescendantSourceRoleTests.test_historical_history_test_pin_corruption_rejects) ... ok +test_live_history_guard_is_not_a_historical_source_substitution (profile_helper_group.DescendantSourceRoleTests.test_live_history_guard_is_not_a_historical_source_substitution) ... ok +test_live_history_test_remains_a_planner_and_publication_input (profile_helper_group.DescendantSourceRoleTests.test_live_history_test_remains_a_planner_and_publication_input) ... ok +test_only_source_role_changes_and_frozen_evidence_is_retained (profile_helper_group.DescendantSourceRoleTests.test_only_source_role_changes_and_frozen_evidence_is_retained) ... ok +test_original_gate_rejects_but_correct_role_accepts_current_helper (profile_helper_group.DescendantSourceRoleTests.test_original_gate_rejects_but_correct_role_accepts_current_helper) ... ok +test_original_history_input_role_rejects_live_guard_successor (profile_helper_group.DescendantSourceRoleTests.test_original_history_input_role_rejects_live_guard_successor) ... ok +test_unrelated_live_input_drift_still_rejects (profile_helper_group.DescendantSourceRoleTests.test_unrelated_live_input_drift_still_rejects) ... ok + +---------------------------------------------------------------------- +Ran 10 tests in 50.948s + +OK +{"errors": 0, "failures": 0, "inclusive_profiles": {"cli": [14, 38.50282166697434], "git": [100, 0.30546388085349463], "setUp": [10, 0.2867602859332692]}, "skips": [], "tests": [["profile_helper_group.DescendantSourceRoleTests.test_broken_live_cache_isolation_fails_the_unchanged_registered_command", 12.125240368011873], ["profile_helper_group.DescendantSourceRoleTests.test_current_helper_remains_a_planner_and_publication_input", 0.23834448101115413], ["profile_helper_group.DescendantSourceRoleTests.test_historical_blob_and_hash_corruption_still_rejects", 0.21692941398941912], ["profile_helper_group.DescendantSourceRoleTests.test_historical_history_test_pin_corruption_rejects", 0.21818014400196262], ["profile_helper_group.DescendantSourceRoleTests.test_live_history_guard_is_not_a_historical_source_substitution", 37.28955376299564], ["profile_helper_group.DescendantSourceRoleTests.test_live_history_test_remains_a_planner_and_publication_input", 0.23631637301878072], ["profile_helper_group.DescendantSourceRoleTests.test_only_source_role_changes_and_frozen_evidence_is_retained", 0.047184900991851464], ["profile_helper_group.DescendantSourceRoleTests.test_original_gate_rejects_but_correct_role_accepts_current_helper", 0.22216980601660907], ["profile_helper_group.DescendantSourceRoleTests.test_original_history_input_role_rejects_live_guard_successor", 0.21904245699988678], ["profile_helper_group.DescendantSourceRoleTests.test_unrelated_live_input_drift_still_rejects", 0.13501371600432321]], "tests_run": 10} diff --git a/research/p104-single-pass-qualification/evidence/helper/usage.json b/research/p104-single-pass-qualification/evidence/helper/usage.json new file mode 100644 index 0000000000..44eac8fb4c --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/helper/usage.json @@ -0,0 +1 @@ +{"user_seconds":45.73,"system_seconds":3.12,"kernel_max_rss_kib":37324,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/precision/receipt.json b/research/p104-single-pass-qualification/evidence/precision/receipt.json new file mode 100644 index 0000000000..87a0f8f7b2 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/precision/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "precision", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "6cd355f162aa5be9ee1f6a59a74612983b3a97aee4d3e30630dffe22d25bcc6e", + "runtime_policy_sha256": "8429a601d0e78b4e0e41b440a0db5202ca1dad6606d02d0a6f550d859f53a03b", + "sampled_process_group_rss_bytes": 107343872, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "8238a336e92c6d530518a6db63ae76681d3b3e986655661a1c97ce3bfd0e7383", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1156, + "stdout_sha256": "123308d716a5e12b464b1110c719174f8e290d6a890022ea1382cd92ad32e49f", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 103380, + "system_seconds": 0.12, + "user_seconds": 61.43 + }, + "wall_seconds": 61.608995726011926 +} diff --git a/research/p104-single-pass-qualification/evidence/precision/stderr.txt b/research/p104-single-pass-qualification/evidence/precision/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/precision/stdout.txt b/research/p104-single-pass-qualification/evidence/precision/stdout.txt new file mode 100644 index 0000000000..72366727bc --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/precision/stdout.txt @@ -0,0 +1 @@ +{"inclusive_function_profiles": {"Fraction.calculate": [1, 28.037889314990025], "Fraction.contract.error_trace": [1, 19.827579191012774], "Fraction.contract.execute": [6, 0.7518134470446967], "Fraction.contract.ideal": [4, 4.077143681031885], "Fraction.contract.reverse_all": [1, 2.7852682619995903], "Fraction.contract.reverse_cut": [4, 0.08186139797908254], "Fraction.extra.error_trace": [121, 21.10238755188766], "Fraction.extra.ideal": [1, 2.163068828987889], "Fraction.extra.reverse_all": [120, 0.024764867150224745], "integer.calculate": [1, 6.051532823999878], "integer.error_trace": [122, 6.10431206409703], "integer.ideal": [5, 1.4079569660243578], "integer.reverse_all": [121, 1.0686794288340025]}, "receipt": {"all_actual_witness_rows_equal": true, "coefficient_scale_bits": 55, "coordinates": 799, "events": 25984, "finite_fixtures": {"cases": 120, "controls": ["nondyadic scalar", "inexact scale division", "nondyadic weight"], "events": 4240}, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 61.35474420999526} diff --git a/research/p104-single-pass-qualification/evidence/precision/usage.json b/research/p104-single-pass-qualification/evidence/precision/usage.json new file mode 100644 index 0000000000..1ffda11658 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/precision/usage.json @@ -0,0 +1 @@ +{"user_seconds":61.43,"system_seconds":0.12,"kernel_max_rss_kib":103380,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/profile-runtime/dispatch.py b/research/p104-single-pass-qualification/evidence/profile-runtime/dispatch.py new file mode 100644 index 0000000000..499d56210a --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/profile-runtime/dispatch.py @@ -0,0 +1,6 @@ +import guard,sys +if sys.argv[1]=='helper':guard.TIMEOUT=300 +script='../feasibility/test_finite.py' if sys.argv[1].startswith('finite') else 'profile_'+sys.argv[1]+'.py' +with (guard.HERE/'execution.lock').open('a') as lock: + guard.fcntl.flock(lock,guard.fcntl.LOCK_EX|guard.fcntl.LOCK_NB) + print(guard.run(sys.argv[1],script,optimized=sys.argv[1].endswith('-O'))) diff --git a/research/p104-single-pass-qualification/evidence/profile-runtime/guard.py b/research/p104-single-pass-qualification/evidence/profile-runtime/guard.py new file mode 100644 index 0000000000..209af2bc2b --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/profile-runtime/guard.py @@ -0,0 +1,119 @@ +"""Serial bounded Linux measurements; preserve the complete frozen precision contract.""" +import argparse +import fcntl +import hashlib +import json +import os +from pathlib import Path +import platform +import signal +import statistics +import subprocess +import sys +import tempfile +import time + +HERE = Path(__file__).resolve().parent +SOURCE = HERE +CLOSURE = ('source.py','profile_helper.py','profile_precision.py','guard.py','dispatch.py','inputs/PR5831.tar','../feasibility/observe.py','../feasibility/test_finite.py') +TIMEOUT = 180 +RSS_CAP = 1024**3 +OUTPUT_CAP = 2*1024**2 +AGGREGATE = 600 + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + +def inventory(): + result = {} + for name in CLOSURE: + path = SOURCE / name + if path.is_symlink() or not path.is_file(): + raise ValueError('Regular complete runtime file: ' + name) + result[name] = [sha(path.read_bytes()), path.stat().st_mode & 0o777] + return result + +def group_rss(group): + total = 0 + count = 0 + for p in Path('/proc').iterdir(): + if not p.name.isdigit(): + continue + try: + raw = (p/'stat').read_text() + fields = raw[raw.rfind(')')+2:].split() + if int(fields[2]) == group: + total += int(fields[21])*os.sysconf('SC_PAGE_SIZE') + count += 1 + except (FileNotFoundError, ProcessLookupError, PermissionError): + pass + return total, count + +def run(label, script, optimized=False): + records = HERE/'runs' + records.mkdir(exist_ok=True) + prior = list(records.glob('*/receipt.json')) + spent = sum(json.loads(p.read_bytes())['wall_seconds'] for p in prior) + if spent >= AGGREGATE: + raise ValueError('Aggregate budget consumed') + folder = records/label + folder.mkdir() + before = inventory() + env = os.environ.copy() + for key in ('PYTHONPATH','PYTHONOPTIMIZE','PYTHONINSPECT','PYTHONSTARTUP','PYTHONPYCACHEPREFIX'): + env.pop(key,None) + env.update(PYTHONHASHSEED='0', LC_ALL='C.UTF-8', TZ='UTC') + usage = folder/'usage.json' + with tempfile.TemporaryDirectory(prefix='linux5757-bytecode-') as cache: + command = ['/usr/bin/python3.12', '-B', '-X', 'pycache_prefix='+cache] + if optimized: + command.append('-O') + command.append(str(SOURCE/script)) + timed = ['/usr/bin/time','-f','{"user_seconds":%U,"system_seconds":%S,"kernel_max_rss_kib":%M,"exit":%x}', '-o', str(usage),'--',*command] + start = time.monotonic() + peak = 0 + stop = None + with (folder/'stdout.txt').open('wb') as out, (folder/'stderr.txt').open('wb') as err: + p = subprocess.Popen(timed, cwd=SOURCE, env=env, stdout=out, stderr=err, start_new_session=True) + try: + while p.poll() is None: + rss, _ = group_rss(p.pid) + peak = max(peak,rss) + elapsed = time.monotonic()-start + if rss > RSS_CAP: + stop='sampled_group_rss_cap' + elif elapsed > min(TIMEOUT,AGGREGATE-spent): + stop='wall_or_aggregate_cap' + elif max((folder/'stdout.txt').stat().st_size,(folder/'stderr.txt').stat().st_size)>OUTPUT_CAP: + stop='output_cap' + if stop: + os.killpg(p.pid,signal.SIGKILL) + break + time.sleep(0.05) + code=p.wait() + finally: + try: os.killpg(p.pid,signal.SIGKILL) + except ProcessLookupError: pass + p.wait() + elapsed = time.monotonic()-start + stdout=(folder/'stdout.txt').read_bytes() + stderr=(folder/'stderr.txt').read_bytes() + after=inventory() + measurement=None + if usage.exists(): + try: measurement=json.loads(usage.read_bytes()) + except json.JSONDecodeError: measurement={'raw':usage.read_text()} + receipt={'label':label,'script':script,'optimized':optimized,'wall_seconds':elapsed, + 'exit':code,'termination':stop,'sampled_process_group_rss_bytes':peak, + 'usage':measurement,'stdout_sha256':sha(stdout),'stdout_bytes':len(stdout), + 'stderr_sha256':sha(stderr),'stderr_bytes':len(stderr), + 'source_inventory_sha256':sha(json.dumps(before,sort_keys=True,separators=(',',':')).encode()), + 'source_bytes_and_modes_unchanged':before==after, + 'python':sys.version,'platform':platform.platform(), + 'runner_sha256':sha(Path(__file__).read_bytes()),'runtime_policy_sha256':sha(json.dumps(CLOSURE).encode())} + receipt['status']='PASS' if code==0 and stop is None and not stderr and before==after else 'STOP' + (folder/'receipt.json').write_text(json.dumps(receipt,indent=2,sort_keys=True)+'\n') + print(json.dumps(receipt,sort_keys=True),flush=True) + if receipt['status']!='PASS': + raise SystemExit(1) + return receipt diff --git a/research/p104-single-pass-qualification/evidence/profile-runtime/profile_helper.py b/research/p104-single-pass-qualification/evidence/profile-runtime/profile_helper.py new file mode 100644 index 0000000000..a808e5b2db --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/profile-runtime/profile_helper.py @@ -0,0 +1,23 @@ +"""Run all ten nominated tests; record inclusive setup, Git and CLI times.""" +import importlib.util,json,sys,time,unittest,hashlib +from collections import defaultdict +from pathlib import Path +repo=Path(__file__).resolve().parents[1]/'repo';path=repo/'tests/test_research_descendant_source_roles.py' +spec=importlib.util.spec_from_file_location('profile_helper_group',path);m=importlib.util.module_from_spec(spec);spec.loader.exec_module(m) +rows=defaultdict(lambda:[0,0.0]);tests=[] +def observe(obj,name,label): + original=getattr(obj,name) + def wrapped(*a,**kw): + start=time.perf_counter() + try:return original(*a,**kw) + finally: + row=rows[label];row[0]+=1;row[1]+=time.perf_counter()-start + setattr(obj,name,wrapped) +observe(m,'git','git');observe(m.DescendantSourceRoleTests,'setUp','setUp');observe(m.DescendantSourceRoleTests,'cli','cli') +class Result(unittest.TextTestResult): + def startTest(self,t):self.start=time.perf_counter();super().startTest(t) + def stopTest(self,t):tests.append([t.id(),time.perf_counter()-self.start]);super().stopTest(t) +suite=unittest.defaultTestLoader.loadTestsFromModule(m) +r=unittest.TextTestRunner(stream=sys.stdout,verbosity=2,resultclass=Result).run(suite) +print(json.dumps({'tests':tests,'inclusive_profiles':dict(rows),'failures':len(r.failures),'errors':len(r.errors),'skips':r.skipped,'tests_run':r.testsRun},sort_keys=True)) +if not r.wasSuccessful() or r.testsRun!=10:raise SystemExit(1) diff --git a/research/p104-single-pass-qualification/evidence/profile-runtime/profile_precision.py b/research/p104-single-pass-qualification/evidence/profile-runtime/profile_precision.py new file mode 100644 index 0000000000..9bbde5e14f --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/profile-runtime/profile_precision.py @@ -0,0 +1,35 @@ +"""Observe only complete function calls; run the frozen qualification unchanged.""" +from source import baseline,require +import importlib.util,json,sys,time +from collections import defaultdict +rows=defaultdict(lambda:[0,0.0]) +def observe(obj,name,label): + original=getattr(obj,name) + def wrapped(*args,**kwargs): + start=time.perf_counter() + try:return original(*args,**kwargs) + finally: + row=rows[label];row[0]+=1;row[1]+=time.perf_counter()-start + setattr(obj,name,wrapped) +with baseline() as p: + spec=importlib.util.spec_from_file_location('precision_profile',p/'verify.py');v=importlib.util.module_from_spec(spec);spec.loader.exec_module(v) + load=v.load + def observed_load(name,path): + m=load(name,path) + if name=='frozen_contract': + module=m.module + def observed_module(n,q): + a=module(n,q) + if n=='noisy_precision': + for f in ('ideal','error_trace','reverse_all','reverse_cut','execute'):observe(a,f,'Fraction.contract.'+f) + return a + m.module=observed_module;observe(m,'calculate','Fraction.calculate') + elif name=='frozen_precision': + for f in ('ideal','error_trace','reverse_all'):observe(m,f,'Fraction.extra.'+f) + elif name=='integer_backend': + for f in ('ideal','error_trace','reverse_all'):observe(m.Engine,f,'integer.'+f) + elif name=='explicit_contract':observe(m,'calculate','integer.calculate') + return m + v.load=observed_load + receipt,seconds=v.run('qualify');require(receipt==json.loads((p/'RESULT.json').read_bytes()),'complete frozen profile receipt') + print(json.dumps({'receipt':receipt,'seconds':seconds,'inclusive_function_profiles':dict(rows)},sort_keys=True)) diff --git a/research/p104-single-pass-qualification/evidence/profile-runtime/source.py b/research/p104-single-pass-qualification/evidence/profile-runtime/source.py new file mode 100644 index 0000000000..6e1f036ed0 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/profile-runtime/source.py @@ -0,0 +1,67 @@ +"""Authenticate the unchanged complete PR5831 export before importing it.""" +from contextlib import contextmanager +from hashlib import sha256 +import json +from pathlib import Path +import tarfile +import tempfile + +HERE = Path(__file__).resolve().parent +BUNDLE_SHA256 = '6ad8d8e0463e8e6ea8d503610c3f9ec38108f16092bc479bc1cb6f48683f6ab6' +SOURCE_HEAD = '7c5eb98e7439d778141d63e801e53d4cd7e1d587' + + +def require(ok, why): + if not ok: + raise ValueError(why) + + +def payload(archive=None): + archive = HERE / 'inputs/PR5831.tar' if archive is None else archive + require(sha256(archive.read_bytes()).hexdigest() == BUNDLE_SHA256, 'Exact PR5831 bundle') + with tarfile.open(archive, 'r:') as stream: + members = stream.getmembers() + require(len(members) == 14 and len({m.name for m in members}) == 14, 'Complete unique baseline bundle') + require(all(m.isfile() and 0 <= m.size <= 8 * 1024**2 for m in members), 'Regular bounded baseline members') + receipt = json.loads(stream.extractfile('.research-export.json').read()) + require(receipt['commit'] == SOURCE_HEAD, 'Exact baseline export head') + rows = {r['path']: r for r in receipt['files']} + require(len(rows) == len(receipt['files']) == 13, 'Complete baseline file census') + require({m.name for m in members} == set(rows) | {'.research-export.json'}, 'Exact baseline member set') + contents = {} + for member in members: + path = Path(member.name) + require(not path.is_absolute() and '..' not in path.parts and path.parts, 'Safe baseline path') + raw = stream.extractfile(member).read() + if member.name in rows: + row = rows[member.name] + require(len(raw) == row['size'] and sha256(raw).hexdigest() == row['sha256'], 'Exact baseline file bytes') + require(row['mode'] in (0o644, 0o755), 'Regular baseline file mode') + contents[member.name] = raw + return contents + + +@contextmanager +def baseline(): + contents = payload() + with tempfile.TemporaryDirectory(prefix='precision-linux-source-') as temporary: + root = Path(temporary) + try: + for name, raw in contents.items(): + path = root / name + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(raw) + path.chmod(0o444) + for path in root.rglob('*'): + if path.is_dir(): + path.chmod(0o555) + before = {str(p.relative_to(root)): [sha256(p.read_bytes()).hexdigest(), p.stat().st_mode & 0o777] + for p in root.rglob('*') if p.is_file()} + yield root / 'research/p104-integer-error-replay' + after = {str(p.relative_to(root)): [sha256(p.read_bytes()).hexdigest(), p.stat().st_mode & 0o777] + for p in root.rglob('*') if p.is_file() and not p.is_symlink()} + require(after == before and not any(p.is_symlink() for p in root.rglob('*')), 'Baseline export unchanged') + finally: + for path in [root, *root.rglob('*')]: + if path.is_dir(): + path.chmod(0o755) diff --git a/research/p104-single-pass-qualification/evidence/registered-O/receipt.json b/research/p104-single-pass-qualification/evidence/registered-O/receipt.json new file mode 100644 index 0000000000..98203ea3d8 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/registered-O/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "registered-O", + "optimized": true, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "523aca683d41dd67cc08e6d7e3cff7bbd5ae5f43f22b4a446cb6b8c964703680", + "runtime_policy_sha256": "82d21549ee61f2fbb5e4df40d7a2612237040ba607a0a42c3aba9f4c67accdab", + "sampled_process_group_rss_bytes": 121856000, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "f51d48e42c67a9133e295b1849c576e20c9f0c870881bd79e438626bf4c49f97", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1282, + "stdout_sha256": "09f7638198857fea399a36e7bd4dd3345314d1880459de7ad7ed75ada62ac526", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 117548, + "system_seconds": 0.11, + "user_seconds": 38.99 + }, + "wall_seconds": 39.1790381349856 +} diff --git a/research/p104-single-pass-qualification/evidence/registered-O/stderr.txt b/research/p104-single-pass-qualification/evidence/registered-O/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/registered-O/stdout.txt b/research/p104-single-pass-qualification/evidence/registered-O/stdout.txt new file mode 100644 index 0000000000..3c2a1f47e8 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/registered-O/stdout.txt @@ -0,0 +1,4 @@ +PASS_PRECISION_LINUX_SOURCE_CONTROLS {"contract": "declared contract edits", "declared_edit": "unique backend seam", "inner_archive": "source hash", "official_export_byte": "Exact PR5831 bundle"} +{"backends": 2, "controls": ["one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "input-mutation"], "events": 5, "status": "PASS_FINITE_FEASIBILITY_ONLY"} +PASS_P104_SINGLE_PASS_QUALIFICATION +{"mode": "qualify", "receipt": {"all_actual_witness_rows_equal": true, "coefficient_scale_bits": 55, "coordinates": 799, "events": 25984, "finite_fixtures": {"cases": 120, "controls": ["nondyadic scalar", "inexact scale division", "nondyadic weight"], "events": 4240}, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 38.819481} diff --git a/research/p104-single-pass-qualification/evidence/registered-O/usage.json b/research/p104-single-pass-qualification/evidence/registered-O/usage.json new file mode 100644 index 0000000000..ce35f59a6e --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/registered-O/usage.json @@ -0,0 +1 @@ +{"user_seconds":38.99,"system_seconds":0.11,"kernel_max_rss_kib":117548,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/registered-normal/receipt.json b/research/p104-single-pass-qualification/evidence/registered-normal/receipt.json new file mode 100644 index 0000000000..26e907c0d6 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/registered-normal/receipt.json @@ -0,0 +1,25 @@ +{ + "exit": 0, + "label": "registered-normal", + "optimized": false, + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "523aca683d41dd67cc08e6d7e3cff7bbd5ae5f43f22b4a446cb6b8c964703680", + "runtime_policy_sha256": "82d21549ee61f2fbb5e4df40d7a2612237040ba607a0a42c3aba9f4c67accdab", + "sampled_process_group_rss_bytes": 121618432, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "f51d48e42c67a9133e295b1849c576e20c9f0c870881bd79e438626bf4c49f97", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1282, + "stdout_sha256": "213dca818fadca954452dec68866d3f36d3ba85017a847bffb731da14190bc5c", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 117316, + "system_seconds": 0.09, + "user_seconds": 39.08 + }, + "wall_seconds": 39.24033334100386 +} diff --git a/research/p104-single-pass-qualification/evidence/registered-normal/stderr.txt b/research/p104-single-pass-qualification/evidence/registered-normal/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/registered-normal/stdout.txt b/research/p104-single-pass-qualification/evidence/registered-normal/stdout.txt new file mode 100644 index 0000000000..708ed05525 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/registered-normal/stdout.txt @@ -0,0 +1,4 @@ +PASS_PRECISION_LINUX_SOURCE_CONTROLS {"contract": "declared contract edits", "declared_edit": "unique backend seam", "inner_archive": "source hash", "official_export_byte": "Exact PR5831 bundle"} +{"backends": 2, "controls": ["one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "input-mutation"], "events": 5, "status": "PASS_FINITE_FEASIBILITY_ONLY"} +PASS_P104_SINGLE_PASS_QUALIFICATION +{"mode": "qualify", "receipt": {"all_actual_witness_rows_equal": true, "coefficient_scale_bits": 55, "coordinates": 799, "events": 25984, "finite_fixtures": {"cases": 120, "controls": ["nondyadic scalar", "inexact scale division", "nondyadic weight"], "events": 4240}, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 38.898771} diff --git a/research/p104-single-pass-qualification/evidence/registered-normal/usage.json b/research/p104-single-pass-qualification/evidence/registered-normal/usage.json new file mode 100644 index 0000000000..aee0ae9974 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/registered-normal/usage.json @@ -0,0 +1 @@ +{"user_seconds":39.08,"system_seconds":0.09,"kernel_max_rss_kib":117316,"exit":0} diff --git a/research/p104-single-pass-qualification/evidence/sealed-I-O/receipt.json b/research/p104-single-pass-qualification/evidence/sealed-I-O/receipt.json new file mode 100644 index 0000000000..3fa2b3910a --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/sealed-I-O/receipt.json @@ -0,0 +1,26 @@ +{ + "exit": 0, + "label": "sealed-I-O", + "optimized": true, + "original_local_receipt_sha256": "fcb2e3d79606d445be9778b8113a40b7c045711da8ba0e5f363c3fd798d78c7a", + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "523aca683d41dd67cc08e6d7e3cff7bbd5ae5f43f22b4a446cb6b8c964703680", + "runtime_policy_sha256": "4422a5d258935439d2317429b2298af0d069a47149778c3becdc294d125f5031", + "sampled_process_group_rss_bytes": 121741312, + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "efed43ddf44408346d8953ede8f0c98835820c67c19c4ad79daa633e00fb85b2", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 1281, + "stdout_sha256": "0af9f2bc019d23c38e7b0a599a4e717955cb99faac22752da836258610ba081c", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 117436, + "system_seconds": 0.1, + "user_seconds": 39.09 + }, + "wall_seconds": 39.24383878399385 +} diff --git a/research/p104-single-pass-qualification/evidence/sealed-I-O/stderr.txt b/research/p104-single-pass-qualification/evidence/sealed-I-O/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-single-pass-qualification/evidence/sealed-I-O/stdout.txt b/research/p104-single-pass-qualification/evidence/sealed-I-O/stdout.txt new file mode 100644 index 0000000000..3810fa5b05 --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/sealed-I-O/stdout.txt @@ -0,0 +1,4 @@ +PASS_PRECISION_LINUX_SOURCE_CONTROLS {"contract": "declared contract edits", "declared_edit": "unique backend seam", "inner_archive": "source hash", "official_export_byte": "Exact PR5831 bundle"} +{"backends": 2, "controls": ["one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "one-use", "closed-call", "missing", "duplicate", "changed-weights", "changed-rounding", "changed-word", "original-malformed-rejection", "propagated-exception", "failed-finish", "failed-take", "fresh-context-not-previous-pass", "aborted-take", "input-mutation"], "events": 5, "status": "PASS_FINITE_FEASIBILITY_ONLY"} +PASS_P104_SINGLE_PASS_QUALIFICATION +{"mode": "qualify", "receipt": {"all_actual_witness_rows_equal": true, "coefficient_scale_bits": 55, "coordinates": 799, "events": 25984, "finite_fixtures": {"cases": 120, "controls": ["nondyadic scalar", "inexact scale division", "nondyadic weight"], "events": 4240}, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 38.83663} diff --git a/research/p104-single-pass-qualification/evidence/sealed-I-O/usage.json b/research/p104-single-pass-qualification/evidence/sealed-I-O/usage.json new file mode 100644 index 0000000000..577b2318ec --- /dev/null +++ b/research/p104-single-pass-qualification/evidence/sealed-I-O/usage.json @@ -0,0 +1 @@ +{"user_seconds":39.09,"system_seconds":0.10,"kernel_max_rss_kib":117436,"exit":0} diff --git a/research/p104-single-pass-qualification/finite.py b/research/p104-single-pass-qualification/finite.py new file mode 100644 index 0000000000..2e2addc45b --- /dev/null +++ b/research/p104-single-pass-qualification/finite.py @@ -0,0 +1,49 @@ +"""Pre-construction real-backend feasibility; all checks survive python -O.""" +from copy import deepcopy +import importlib.util +import json +from pathlib import Path +import sys +from source import baseline,require +from observe import Observation +controls=[] +def rejects(label, fn): + try:fn() + except ValueError:controls.append(label) + else:raise ValueError('accepted '+label) +with baseline() as p: + spec=importlib.util.spec_from_file_location('finite_source',p/'verify.py');v=importlib.util.module_from_spec(spec);spec.loader.exec_module(v) + with v.source() as (_,original,ref): + integer=v.load('finite_integer',p/'integer.py') + word=dict(public=1,owned_fields=1,initial=[0],final=[0],frames=[[]],live=[],program=[['INIT',1,0],['COPY',1,0,1,0],['SCALE',1,'1/2',0],['SCALE',1,2,0],['CLEAR',1,0]]) + for backend in (ref,integer.Engine(ref)): + o=Observation(backend,ref.digest,word) + ideal,weights=o.ideal(word);trace,witness=o.error_trace(word,weights,set(ideal['counts'])) + o.finish();got=o.take(word) + require(got['ideal']==backend.ideal(word),'fresh finite ideal') + require(got['error_trace']==backend.error_trace(word,weights,set(ideal['counts'])),'fresh finite trace/witness') + rejects('one-use',lambda:o.take(word));rejects('closed-call',lambda:o.ideal(word)) + o=Observation(backend,ref.digest,word);rejects('missing',o.finish) + ideal,weights=o.ideal(word) + rejects('duplicate',lambda:o.ideal(word)) + changed=deepcopy(weights);changed[0]=(99,1) + rejects('changed-weights',lambda:o.error_trace(word,changed,set(ideal['counts']))) + rejects('changed-rounding',lambda:o.error_trace(word,weights,{'ADD'})) + value=o.error_trace(word,weights,set(ideal['counts']));value[0]['sites']=-1 + o.finish();mutated=deepcopy(word);mutated['program'][2][-2]='1/4' + rejects('changed-word',lambda:o.take(mutated)) + require(o.take(word)['error_trace'][0]['sites']>=0,'snapshot alias isolation') + bad=deepcopy(word);bad['program'][1][2]=1 + o=Observation(backend,ref.digest,word);o.ideal(word) + rejects('original-malformed-rejection',lambda:o.ideal(bad)) + o.error_trace(word,weights,set(ideal['counts']));o.finish();o.take(word) + failed=Observation(backend,ref.digest,bad) + rejects('propagated-exception',lambda:failed.ideal(bad));rejects('failed-finish',failed.finish);rejects('failed-take',lambda:failed.take(bad)) + fresh=Observation(backend,ref.digest,word);rejects('fresh-context-not-previous-pass',lambda:fresh.take(word)) + fresh.abort();rejects('aborted-take',lambda:fresh.take(word)) + class Mutating: + def ideal(self,w):w['public']=9;return ({},[]) + changing=deepcopy(word);o=Observation(Mutating(),ref.digest,changing) + rejects('input-mutation',lambda:o.ideal(changing)) + require(len(controls)==27,'complete finite control census') +print(json.dumps({'status':'PASS_FINITE_FEASIBILITY_ONLY','events':5,'backends':2,'controls':controls},sort_keys=True)) diff --git a/research/p104-single-pass-qualification/guard.py b/research/p104-single-pass-qualification/guard.py new file mode 100644 index 0000000000..33d11befce --- /dev/null +++ b/research/p104-single-pass-qualification/guard.py @@ -0,0 +1,120 @@ +"""Serial bounded Linux measurements; preserve the complete frozen precision contract.""" +import argparse +import fcntl +import hashlib +import json +import os +from pathlib import Path +import platform +import signal +import statistics +import subprocess +import sys +import tempfile +import time + +HERE = Path(__file__).resolve().parent +SOURCE = HERE +CLOSURE = ('source.py','observe.py','finite.py','candidate.py','baseline.py','replay.py','guard.py','benchmark.py','inputs/PR5831.tar') +TIMEOUT = 180 +RSS_CAP = 1024**3 +OUTPUT_CAP = 2*1024**2 +AGGREGATE = 1500 +PREVIOUS_WALL_SECONDS = 113.99438549298793 + +def sha(raw): + return hashlib.sha256(raw).hexdigest() + +def inventory(): + result = {} + for name in CLOSURE: + path = SOURCE / name + if path.is_symlink() or not path.is_file(): + raise ValueError('Regular complete runtime file: ' + name) + result[name] = [sha(path.read_bytes()), path.stat().st_mode & 0o777] + return result + +def group_rss(group): + total = 0 + count = 0 + for p in Path('/proc').iterdir(): + if not p.name.isdigit(): + continue + try: + raw = (p/'stat').read_text() + fields = raw[raw.rfind(')')+2:].split() + if int(fields[2]) == group: + total += int(fields[21])*os.sysconf('SC_PAGE_SIZE') + count += 1 + except (FileNotFoundError, ProcessLookupError, PermissionError): + pass + return total, count + +def run(label, script, optimized=False): + records = HERE/'runs' + records.mkdir(exist_ok=True) + prior = list(records.glob('*/receipt.json')) + spent = PREVIOUS_WALL_SECONDS + sum(json.loads(p.read_bytes())['wall_seconds'] for p in prior) + if spent >= AGGREGATE: + raise ValueError('Aggregate budget consumed') + folder = records/label + folder.mkdir() + before = inventory() + env = os.environ.copy() + for key in ('PYTHONPATH','PYTHONOPTIMIZE','PYTHONINSPECT','PYTHONSTARTUP','PYTHONPYCACHEPREFIX'): + env.pop(key,None) + env.update(PYTHONHASHSEED='0', LC_ALL='C.UTF-8', TZ='UTC') + usage = folder/'usage.json' + with tempfile.TemporaryDirectory(prefix='linux5757-bytecode-') as cache: + command = ['/usr/bin/python3.12', '-B', '-X', 'pycache_prefix='+cache] + if optimized: + command.append('-O') + command.append(str(SOURCE/script)) + timed = ['/usr/bin/time','-f','{"user_seconds":%U,"system_seconds":%S,"kernel_max_rss_kib":%M,"exit":%x}', '-o', str(usage),'--',*command] + start = time.monotonic() + peak = 0 + stop = None + with (folder/'stdout.txt').open('wb') as out, (folder/'stderr.txt').open('wb') as err: + p = subprocess.Popen(timed, cwd=SOURCE, env=env, stdout=out, stderr=err, start_new_session=True) + try: + while p.poll() is None: + rss, _ = group_rss(p.pid) + peak = max(peak,rss) + elapsed = time.monotonic()-start + if rss > RSS_CAP: + stop='sampled_group_rss_cap' + elif elapsed > min(TIMEOUT,AGGREGATE-spent): + stop='wall_or_aggregate_cap' + elif max((folder/'stdout.txt').stat().st_size,(folder/'stderr.txt').stat().st_size)>OUTPUT_CAP: + stop='output_cap' + if stop: + os.killpg(p.pid,signal.SIGKILL) + break + time.sleep(0.05) + code=p.wait() + finally: + try: os.killpg(p.pid,signal.SIGKILL) + except ProcessLookupError: pass + p.wait() + elapsed = time.monotonic()-start + stdout=(folder/'stdout.txt').read_bytes() + stderr=(folder/'stderr.txt').read_bytes() + after=inventory() + measurement=None + if usage.exists(): + try: measurement=json.loads(usage.read_bytes()) + except json.JSONDecodeError: measurement={'raw':usage.read_text()} + receipt={'label':label,'script':script,'optimized':optimized,'wall_seconds':elapsed, + 'exit':code,'termination':stop,'sampled_process_group_rss_bytes':peak, + 'usage':measurement,'stdout_sha256':sha(stdout),'stdout_bytes':len(stdout), + 'stderr_sha256':sha(stderr),'stderr_bytes':len(stderr), + 'source_inventory_sha256':sha(json.dumps(before,sort_keys=True,separators=(',',':')).encode()), + 'source_bytes_and_modes_unchanged':before==after, + 'python':sys.version,'platform':platform.platform(), + 'runner_sha256':sha(Path(__file__).read_bytes()),'runtime_policy_sha256':sha(json.dumps(CLOSURE).encode())} + receipt['status']='PASS' if code==0 and stop is None and not stderr and before==after else 'STOP' + (folder/'receipt.json').write_text(json.dumps(receipt,indent=2,sort_keys=True)+'\n') + print(json.dumps(receipt,sort_keys=True),flush=True) + if receipt['status']!='PASS': + raise SystemExit(1) + return receipt diff --git a/research/p104-single-pass-qualification/inputs/PR5831.tar b/research/p104-single-pass-qualification/inputs/PR5831.tar new file mode 100644 index 0000000000..eddee1f6a9 Binary files /dev/null and b/research/p104-single-pass-qualification/inputs/PR5831.tar differ diff --git a/research/p104-single-pass-qualification/observe.py b/research/p104-single-pass-qualification/observe.py new file mode 100644 index 0000000000..d59146ae5a --- /dev/null +++ b/research/p104-single-pass-qualification/observe.py @@ -0,0 +1,72 @@ +"""Single-use observations of two complete, independently computed passes. + +Chris R / Clear1nsight with substantial OpenAI Codex assistance. Apache-2.0. +""" +from copy import deepcopy + + +def need(ok, why): + if not ok: + raise ValueError(why) + + +class Observation: + def __init__(self, backend, digest, word): + self.backend, self.digest = backend, digest + self.word_key = digest(word) + self.values = {} + self.closed = self.failed = self.used = False + + def __getattr__(self, name): + return getattr(self.backend, name) + + def _call(self, name, word, *args): + need(not self.closed and not self.failed, 'observation closed') + actual = self.digest(word) == self.word_key + def input_key(): + normalized = (args[0], sorted(args[1])) if name == 'error_trace' else args + return self.digest((word, normalized)) + before = input_key() + if actual: + need(name not in self.values, 'duplicate actual observation') + if name == 'error_trace': + need('ideal' in self.values, 'missing ideal observation') + ideal, weights = self.values['ideal'][0] + need(self.digest(args[0]) == self.digest(weights), 'changed observation weights') + need(set(args[1]) == set(ideal['counts']), 'changed observation rounding') + try: + value = getattr(self.backend, name)(word, *args) + need(before == input_key(), 'input changed during observation') + except BaseException: + if actual: + self.failed = True + self.values.clear() + raise + if actual: + saved = deepcopy(value) + self.values[name] = (saved, self.digest(saved)) + return value + + def ideal(self, word): + return self._call('ideal', word) + + def error_trace(self, word, weights, rounded): + return self._call('error_trace', word, weights, rounded) + + def finish(self): + need(not self.closed and not self.failed, 'observation closed') + need(set(self.values) == {'ideal', 'error_trace'}, 'missing complete observation') + self.closed = True + + def abort(self): + self.failed = self.closed = True + self.values.clear() + + def take(self, word): + need(self.closed and not self.failed and not self.used, 'observation unavailable') + need(self.digest(word) == self.word_key, 'changed observation word') + need(all(self.digest(value) == key for value, key in self.values.values()), 'observation output drift') + self.used = True + result = {name: value for name, (value, key) in self.values.items()} + self.values.clear() + return result diff --git a/research/p104-single-pass-qualification/replay.py b/research/p104-single-pass-qualification/replay.py new file mode 100644 index 0000000000..aeb9296816 --- /dev/null +++ b/research/p104-single-pass-qualification/replay.py @@ -0,0 +1,31 @@ +"""Run an unchanged complete PR5831 entry point from its authenticated export.""" +import json +import runpy +import sys + +from source import baseline, require + +EXPECTED = { + 'source_result_sha256': 'cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98', + 'events': 25984, 'coordinates': 799, 'source_controls': 6, + 'guards': {'owned': 22, 'prefix': 26, 'public': 23}, +} + + +def main(): + mode = 'qualify' if not sys.argv[1:] else sys.argv[1].removeprefix('--') + require(len(sys.argv) <= 2 and mode in ('baseline', 'candidate', 'qualify'), 'Exact replay mode') + with baseline() as package: + expected = json.loads((package / 'RESULT.json').read_bytes()) if mode == 'qualify' else EXPECTED + previous = sys.argv + try: + sys.argv = [str(package / 'verify.py'), '--' + mode] + result = runpy.run_path(sys.argv[0], run_name='__main__') + finally: + sys.argv = previous + require(result['mode'] == mode and result['receipt'] == expected, + 'Complete frozen scientific receipt') + + +if __name__ == '__main__': + main() diff --git a/research/p104-single-pass-qualification/source.py b/research/p104-single-pass-qualification/source.py new file mode 100644 index 0000000000..6e1f036ed0 --- /dev/null +++ b/research/p104-single-pass-qualification/source.py @@ -0,0 +1,67 @@ +"""Authenticate the unchanged complete PR5831 export before importing it.""" +from contextlib import contextmanager +from hashlib import sha256 +import json +from pathlib import Path +import tarfile +import tempfile + +HERE = Path(__file__).resolve().parent +BUNDLE_SHA256 = '6ad8d8e0463e8e6ea8d503610c3f9ec38108f16092bc479bc1cb6f48683f6ab6' +SOURCE_HEAD = '7c5eb98e7439d778141d63e801e53d4cd7e1d587' + + +def require(ok, why): + if not ok: + raise ValueError(why) + + +def payload(archive=None): + archive = HERE / 'inputs/PR5831.tar' if archive is None else archive + require(sha256(archive.read_bytes()).hexdigest() == BUNDLE_SHA256, 'Exact PR5831 bundle') + with tarfile.open(archive, 'r:') as stream: + members = stream.getmembers() + require(len(members) == 14 and len({m.name for m in members}) == 14, 'Complete unique baseline bundle') + require(all(m.isfile() and 0 <= m.size <= 8 * 1024**2 for m in members), 'Regular bounded baseline members') + receipt = json.loads(stream.extractfile('.research-export.json').read()) + require(receipt['commit'] == SOURCE_HEAD, 'Exact baseline export head') + rows = {r['path']: r for r in receipt['files']} + require(len(rows) == len(receipt['files']) == 13, 'Complete baseline file census') + require({m.name for m in members} == set(rows) | {'.research-export.json'}, 'Exact baseline member set') + contents = {} + for member in members: + path = Path(member.name) + require(not path.is_absolute() and '..' not in path.parts and path.parts, 'Safe baseline path') + raw = stream.extractfile(member).read() + if member.name in rows: + row = rows[member.name] + require(len(raw) == row['size'] and sha256(raw).hexdigest() == row['sha256'], 'Exact baseline file bytes') + require(row['mode'] in (0o644, 0o755), 'Regular baseline file mode') + contents[member.name] = raw + return contents + + +@contextmanager +def baseline(): + contents = payload() + with tempfile.TemporaryDirectory(prefix='precision-linux-source-') as temporary: + root = Path(temporary) + try: + for name, raw in contents.items(): + path = root / name + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(raw) + path.chmod(0o444) + for path in root.rglob('*'): + if path.is_dir(): + path.chmod(0o555) + before = {str(p.relative_to(root)): [sha256(p.read_bytes()).hexdigest(), p.stat().st_mode & 0o777] + for p in root.rglob('*') if p.is_file()} + yield root / 'research/p104-integer-error-replay' + after = {str(p.relative_to(root)): [sha256(p.read_bytes()).hexdigest(), p.stat().st_mode & 0o777] + for p in root.rglob('*') if p.is_file() and not p.is_symlink()} + require(after == before and not any(p.is_symlink() for p in root.rglob('*')), 'Baseline export unchanged') + finally: + for path in [root, *root.rglob('*')]: + if path.is_dir(): + path.chmod(0o755) diff --git a/research/p104-single-pass-qualification/verify.py b/research/p104-single-pass-qualification/verify.py new file mode 100644 index 0000000000..486c050c25 --- /dev/null +++ b/research/p104-single-pass-qualification/verify.py @@ -0,0 +1,9 @@ +"""Full qualification plus inherited source-custody and new observation controls.""" +import sys +import custody +from candidate import main +from source import require +if __name__=='__main__': + require(len(sys.argv)==1,'No wrapper arguments') + custody.main() + main() diff --git a/tests/fixtures/README.md b/tests/fixtures/README.md new file mode 100644 index 0000000000..472a6a502f --- /dev/null +++ b/tests/fixtures/README.md @@ -0,0 +1,41 @@ +# Frozen research routing fixture + +`research-routing-v7.json` retains two exact task cards from priority revision 7: +`portable-replay` and `centre-path-sharing`. They exercise the generic-baseline +and historical-ceiling routes in `choose_current_research_task.py`. The fixture +records the source commit, path and SHA256. The card objects are unchanged. + +The source is commit `553d26d796fde9871ff2661a49ac7732e945410f`, file +`docs/research/agent-task-catalog.json`. The test places these cards in a small +catalogue with one track of weight 100. This carrier is test data, not a change +to research priorities. Current cards are checked separately from the live +catalogue. Every live card must preserve its other fields; each distinct direct +command also passes through both real CLIs. + +The CLI fixture copies the two real scripts. It creates inert reference files +for path validation and copies the current selected record for receipt fields. +It does not execute those references or verify a mathematical claim. Missing +references, sparse omissions, deleted files and staged replacements have separate +negative tests. No Git history, network request or change to the live catalogue +is needed to run the fixture. + +```sh +python3 -B -m unittest discover -s tests -p test_research_current_assignment.py -v +python3 -B -m unittest discover -s tests -p test_research_assignment.py -v +``` + +This fixture repairs the CI handoff in +[Discussion 5722](https://github.com/CrocSwap/integer-mult-bounds/discussions/5722). +The [investigation](https://github.com/CrocSwap/integer-mult-bounds/discussions/5758) +records the failure, checks and publication status. The original scripts, task +catalogue and selected frontier are unchanged. + +On base `de5ec2e7a6074068452f45b1a191b5c72832df4a`, the old suite has eight +failures and two errors. After the repair, all 12 current-assignment tests pass +under Python 3.14.7 and Python 3.12.14, including an isolated optimized run. +All 16 related assignment tests pass under Python 3.12.14. This is test coverage, +not a mathematical replay. See the investigation for hosted-plan status. + +Retain the original catalogue, routing and test authors, including Douglas +Colkitt, Ali Romman and Mihir Srivastava. New fixture and test repair: Ali Romman +with substantial OpenAI Codex assistance. No subagents. Apache-2.0. diff --git a/tests/fixtures/research-routing-v7.json b/tests/fixtures/research-routing-v7.json new file mode 100644 index 0000000000..f5d52ac21d --- /dev/null +++ b/tests/fixtures/research-routing-v7.json @@ -0,0 +1,87 @@ +{ + "source_commit": "553d26d796fde9871ff2661a49ac7732e945410f", + "source_path": "docs/research/agent-task-catalog.json", + "source_sha256": "f7a48bfa2659b88378282a8eee7d9fe52cdf505594124c4d1686b58510fffd72", + "scope": "Two exact revision-7 cards. The test carrier is not a research allocation.", + "cards": [ + { + "id": "centre-path-sharing", + "question": "Can the 64-per-call centre path (eight rank-8 COPY/ERASE totals through the private temporary) be shared across calls or shrunk?", + "starting_points": [ + "docs/research/research-family-status.md", + "research/complex-local-word-ceiling/README.md", + "research/split-centres-global/proofs/PR386-BIT-GEOMETRY.txt", + "certificates/selected-result.json" + ], + "methods": [ + "Derive a fully charged favorable relaxation for sharing one centre path across k calls, including restoration, hosting and precision.", + "Prove a lower bound on copied information per call for the selected decoder contract." + ], + "acceptance_gate": "Show the changed centre charge and copy profile per call with every added restoration or hosting cost charged, and its ceiling via ceiling.ceiling(centre=...). 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", + "research/complex-local-word-ceiling/verify.py" + ], + "expected": "PASS_COMPLEX_LOCAL_WORD_CEILING", + "inspect": "Read the selected word's per-call local profile, its packing ceiling and the lever table; run levers.py for the ideal budget of the lever you target.", + "scope": "Positive control and planning budget only; this is not a new construction or full cold replay." + }, + "first_experiment": "Write the per-call centre charge and copy children for sharing across k = 2 calls, charge the sharing overhead, and screen it; stop this route if even the ideal sharing gains under 10%. Ideal budgets: free 2.80x, shared by two 1.90x (levers.py).", + "bottleneck_link": "The centre path consumes 64 of about 99.6 unpaid coordinates per call, i.e. about 64% of the raw deficit.", + "allowed_variations": [ + "One sharing pattern across a fixed number of calls.", + "One reduced copied-total contract for the existing decoder.", + "If the coverage law, template or guard changes, derive an applicable fully charged replacement bound instead of applying the incumbent ceiling outside its scope." + ], + "scope_change_triggers": [ + "Removing copies without a replacement contract for the decoder's copied totals.", + "Continuing a partial cost improvement while leaving the same unpriced consumer, restoration or central-readout obligation unresolved; refresh the family expansion decision first. Local product-retiming evidence has a narrow scope and is not a ban on changed graphs or contracts." + ], + "overlap_terms": [ + "centre path", + "copied totals", + "private temporary", + "shared centre", + "batching" + ] + }, + { + "id": "portable-replay", + "question": "Can one reproducible environment or artifact-comparison failure be repaired?", + "starting_points": [ + "research/gzip-container-reproducibility/README.md", + "docs/ci-verification.md" + ], + "methods": [ + "Reproduce one portability failure and add a minimal cross-environment fix.", + "Audit one canonical-payload comparison for omitted proof-relevant fields." + ], + "acceptance_gate": "Preserve immutable source hashes and proof-relevant content; a different compressed byte stream alone is not a mathematical mismatch.", + "first_step": { + "command": [ + "python3", + "-B", + "scripts/research_baseline.py" + ], + "expected": "PASS_RESEARCH_BASELINE_BINDINGS_ONLY", + "inspect": "Read the gzip-container reproducibility examples and distinguish frozen source bytes from regenerated payloads.", + "scope": "Positive control / source-bound orientation only; this is not a new construction or full cold replay." + }, + "first_experiment": "Reproduce one specific mismatch or audit one canonical comparison for omitted proof-relevant fields.", + "bottleneck_link": "Portable exact checks prevent environment failures from blocking valid contributions.", + "allowed_variations": [ + "One interpreter/version mismatch or one payload field comparison." + ], + "scope_change_triggers": [ + "Removing immutable-source pins because generated compressed bytes differ." + ], + "overlap_terms": [ + "gzip container", + "reproducibility", + "canonical payload" + ] + } + ] +} diff --git a/tests/test_research_current_assignment.py b/tests/test_research_current_assignment.py index 860f6b9b9e..c524c0037f 100644 --- a/tests/test_research_current_assignment.py +++ b/tests/test_research_current_assignment.py @@ -1,9 +1,15 @@ -"""Current orientation must preserve frozen task-selection evidence.""" +"""Current orientation must preserve frozen task-selection evidence. + +Frozen fixtures and live-catalog coverage: Ali Romman with OpenAI Codex +assistance. Retain the original routing and test authors. Apache-2.0. +""" import copy +from contextlib import contextmanager import importlib.util import json from pathlib import Path import subprocess +import shutil import sys import tempfile import unittest @@ -15,16 +21,49 @@ LEGACY = current.LEGACY legacy = current.runpy.run_path(str(LEGACY)) CATALOG = json.loads((ROOT / legacy["CATALOG"]).read_text(encoding="utf-8")) +FROZEN = json.loads((ROOT / "tests/fixtures/research-routing-v7.json").read_text()) +FROZEN_CATALOG = { + "schema_version": 1, "priority_revision": 7, + "priority_log": "docs/research/routing-fixture.md", + "tracks": [{"id": "routing-fixtures", "weight": 100, "tasks": FROZEN["cards"]}], +} + + +@contextmanager +def frozen_cli_tree(): + """Run the real scripts with exact old cards and inert reference files.""" + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + required = {FROZEN_CATALOG["priority_log"], + "scripts/research_selected_baseline.py", "scripts/research_package.py", + "research/historical-complex-ceiling-replay/VERIFY.json", + "research/historical-complex-ceiling-replay/verify.py"} + for card in FROZEN["cards"]: + required.update(card["starting_points"]) + required.add(card["first_step"]["command"][-1]) + for name in required: + path = root / name + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text("Inert reference for CLI validation only.\n") + for name in ("choose_research_task.py", "choose_current_research_task.py"): + shutil.copyfile(ROOT / "scripts" / name, root / "scripts" / name) + path = root / legacy["CATALOG"] + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(json.dumps(FROZEN_CATALOG)) + path = root / "certificates/selected-result.json" + path.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(ROOT / "certificates/selected-result.json", path) + yield root class CurrentResearchAssignmentTests(unittest.TestCase): - def test_every_frozen_card_and_other_fields_stay_exact(self): - before = copy.deepcopy(CATALOG) + def check_card_round_trips(self, catalog): + before = copy.deepcopy(catalog) resolved = 0 historical = 0 - for track in CATALOG["tracks"]: + for track in catalog["tracks"]: for task in track["tasks"]: - result = legacy["select"](CATALOG, "a1" * 16, task_id=task["id"]) + result = legacy["select"](catalog, "a1" * 16, task_id=task["id"]) original = copy.deepcopy(result) current.resolve_current_first_steps(result, ROOT) card = result["suggestions"][0] @@ -55,19 +94,25 @@ def test_every_frozen_card_and_other_fields_stay_exact(self): self.assertTrue(card.pop("first_step_resolution")) card["first_step"] = card.pop("catalog_first_step") self.assertEqual(result, original) - self.assertEqual(resolved, 16) - self.assertEqual(historical, 4) - self.assertEqual(CATALOG, before) + self.assertEqual(catalog, before) + return resolved, historical + + def test_frozen_routes_and_other_fields_stay_exact(self): + self.assertEqual(self.check_card_round_trips(FROZEN_CATALOG), (1, 1)) + + def test_every_live_card_and_other_fields_stay_exact(self): + self.assertTrue(CATALOG["tracks"]) + self.check_card_round_trips(CATALOG) def test_only_exact_generic_command_is_resolved(self): - result = copy.deepcopy(legacy["select"](CATALOG, "0" * 32, task_id="portable-replay")) + result = copy.deepcopy(legacy["select"](FROZEN_CATALOG, "0" * 32, task_id="portable-replay")) result["suggestions"][0]["first_step"]["command"].append("--historical-fixture") original = copy.deepcopy(result) self.assertEqual(current.resolve_current_first_steps(result, ROOT), []) self.assertEqual(result, original) def test_missing_current_helper_does_not_change_receipt(self): - result = legacy["select"](CATALOG, "0" * 32, task_id="portable-replay") + result = legacy["select"](FROZEN_CATALOG, "0" * 32, task_id="portable-replay") original = copy.deepcopy(result) with tempfile.TemporaryDirectory() as directory: with self.assertRaisesRegex(ValueError, "missing current first-step script"): @@ -82,7 +127,7 @@ def test_nonexact_scientific_commands_are_not_reinterpreted(self): ): with self.subTest(command=command): result = copy.deepcopy(legacy["select"]( - CATALOG, "0" * 32, task_id="centre-path-sharing")) + FROZEN_CATALOG, "0" * 32, task_id="centre-path-sharing")) result["suggestions"][0]["first_step"]["command"] = command original = copy.deepcopy(result) self.assertEqual(current.resolve_current_first_steps(result, ROOT), []) @@ -102,34 +147,52 @@ def test_missing_historical_reference_leaves_all_cards_unchanged(self): path = root / name path.parent.mkdir(parents=True, exist_ok=True) path.write_text("fixture\n") - result = legacy["select"](CATALOG, "0" * 32, task_id="portable-replay") + result = legacy["select"](FROZEN_CATALOG, "0" * 32, task_id="portable-replay") result["suggestions"] += legacy["select"]( - CATALOG, "0" * 32, task_id="centre-path-sharing")["suggestions"] + FROZEN_CATALOG, "0" * 32, task_id="centre-path-sharing")["suggestions"] original = copy.deepcopy(result) with self.assertRaises(ValueError) as raised: current.resolve_current_first_steps(result, root) self.assertIn(absent, str(raised.exception)) self.assertEqual(result, original) - def cli(self, script, args): - return subprocess.run([sys.executable, "-B", str(script), *args], cwd=ROOT, + def cli(self, script, args, root=ROOT): + return subprocess.run([sys.executable, "-B", str(root / "scripts" / Path(script).name), *args], cwd=root, capture_output=True, text=True, encoding="utf-8") def test_cli_preserves_legacy_output_and_emits_both_commands(self): - args = ["--seed", "0" * 32, "--task", "portable-replay"] - original = self.cli(LEGACY, args) - output = self.cli(ROOT / "scripts/choose_current_research_task.py", args) - self.assertEqual(original.returncode, 0) - self.assertEqual(output.returncode, 0) - old, new = json.loads(original.stdout), json.loads(output.stdout) - card = new["suggestions"][0] - self.assertEqual(card["first_step"]["command"], - ["python3", "-B", "scripts/research_selected_baseline.py"]) - self.assertEqual(card.pop("catalog_first_step"), old["suggestions"][0]["first_step"]) - self.assertTrue(card.pop("first_step_resolution")) - card["first_step"] = old["suggestions"][0]["first_step"] - self.assertEqual(new, old) - self.assertEqual(self.cli(LEGACY, args).stdout, original.stdout) + with frozen_cli_tree() as root: + args = ["--seed", "0" * 32, "--task", "portable-replay"] + original = self.cli(LEGACY, args, root) + output = self.cli(ROOT / "scripts/choose_current_research_task.py", args, root) + self.assertEqual(original.returncode, 0) + self.assertEqual(output.returncode, 0) + old, new = json.loads(original.stdout), json.loads(output.stdout) + card = new["suggestions"][0] + self.assertEqual(card["first_step"]["command"], + ["python3", "-B", "scripts/research_selected_baseline.py"]) + self.assertEqual(card.pop("catalog_first_step"), old["suggestions"][0]["first_step"]) + self.assertTrue(card.pop("first_step_resolution")) + card["first_step"] = old["suggestions"][0]["first_step"] + self.assertEqual(new, old) + self.assertEqual(self.cli(LEGACY, args, root).stdout, original.stdout) + + def test_live_cli_preserves_each_unmapped_command(self): + checked = {tuple(card["first_step"]["command"]) for card in FROZEN["cards"]} + for track in CATALOG["tracks"]: + for task in track["tasks"]: + command = tuple(task["first_step"]["command"]) + if command in checked: + continue + checked.add(command) + with self.subTest(task=task["id"]): + args = ["--seed", "0" * 32, "--task", task["id"]] + original = self.cli(LEGACY, args) + output = self.cli(ROOT / "scripts/choose_current_research_task.py", args) + self.assertEqual(original.returncode, 0, original.stderr) + self.assertEqual(output.returncode, 0, output.stderr) + self.assertEqual(json.loads(output.stdout), json.loads(original.stdout)) + self.assertEqual(self.cli(LEGACY, args).stdout, original.stdout) def test_help_and_error_preserve_child_status_and_output(self): for args, code in ((["--help"], 0), (["--unknown-option"], 2), (["--seed", "bad"], 2)): @@ -139,23 +202,24 @@ def test_help_and_error_preserve_child_status_and_output(self): self.assertEqual((output.stdout, output.stderr), (original.stdout, original.stderr)) def test_cli_distinguishes_current_orientation_from_historical_control(self): - args = ["--seed", "0" * 32, "--task", "complex-new-helper-inventory"] - original = self.cli(LEGACY, args) - output = self.cli(ROOT / "scripts/choose_current_research_task.py", args) - self.assertEqual(original.returncode, 0, original.stderr) - self.assertEqual(output.returncode, 0, output.stderr) - old, new = json.loads(original.stdout), json.loads(output.stdout) - card = new["suggestions"][0] - self.assertEqual(card["first_step"]["command"][2], "scripts/research_selected_baseline.py") - self.assertEqual(card["first_step"]["expected"], "PASS_RESEARCH_BASELINE_BINDINGS_ONLY") - follow_up, = card.pop("follow_up_steps") - self.assertEqual(follow_up["command"][-1], "research/historical-complex-ceiling-replay") - self.assertIn("historical", follow_up["scope"].lower()) - self.assertIn("cost law", follow_up["inspect"]) - self.assertTrue(card.pop("first_step_resolution")) - card["first_step"] = card.pop("catalog_first_step") - self.assertEqual(new, old) - self.assertEqual(self.cli(LEGACY, args).stdout, original.stdout) + with frozen_cli_tree() as root: + args = ["--seed", "0" * 32, "--task", "centre-path-sharing"] + original = self.cli(LEGACY, args, root) + output = self.cli(ROOT / "scripts/choose_current_research_task.py", args, root) + self.assertEqual(original.returncode, 0, original.stderr) + self.assertEqual(output.returncode, 0, output.stderr) + old, new = json.loads(original.stdout), json.loads(output.stdout) + card = new["suggestions"][0] + self.assertEqual(card["first_step"]["command"][2], "scripts/research_selected_baseline.py") + self.assertEqual(card["first_step"]["expected"], "PASS_RESEARCH_BASELINE_BINDINGS_ONLY") + follow_up, = card.pop("follow_up_steps") + self.assertEqual(follow_up["command"][-1], "research/historical-complex-ceiling-replay") + self.assertIn("historical", follow_up["scope"].lower()) + self.assertIn("cost law", follow_up["inspect"]) + self.assertTrue(card.pop("first_step_resolution")) + card["first_step"] = card.pop("catalog_first_step") + self.assertEqual(new, old) + self.assertEqual(self.cli(LEGACY, args, root).stdout, original.stdout) def test_sparse_historical_references_require_unchanged_head_entries(self): with tempfile.TemporaryDirectory() as directory: @@ -178,12 +242,12 @@ def git(*args): git("update-index", "--skip-worktree", *omitted) for name in omitted: (root / name).unlink() - result = legacy["select"](CATALOG, "0" * 32, task_id="coverage-law-change") + result = legacy["select"](FROZEN_CATALOG, "0" * 32, task_id="centre-path-sharing") self.assertEqual(current.resolve_current_first_steps(result, root), sorted(omitted)) # Ordinary deletion must not acquire the deliberate-sparse exemption. changed = omitted[-1] git("update-index", "--no-skip-worktree", changed) - result = legacy["select"](CATALOG, "0" * 32, task_id="coverage-law-change") + result = legacy["select"](FROZEN_CATALOG, "0" * 32, task_id="centre-path-sharing") original = copy.deepcopy(result) with self.assertRaises(ValueError): current.resolve_current_first_steps(result, root) @@ -208,9 +272,9 @@ def git(*args): git("-c", "user.name=Fixture", "-c", "user.email=fixture@example.invalid", "-c", "core.hooksPath=/dev/null", "commit", "-qm", "helper") git("update-index", "--skip-worktree", name); path.unlink() - result = legacy["select"](CATALOG, "0" * 32, task_id="portable-replay") + result = legacy["select"](FROZEN_CATALOG, "0" * 32, task_id="portable-replay") self.assertEqual(current.resolve_current_first_steps(result, root), [name]) git("update-index", "--no-skip-worktree", name) - result = legacy["select"](CATALOG, "0" * 32, task_id="portable-replay") + result = legacy["select"](FROZEN_CATALOG, "0" * 32, task_id="portable-replay") with self.assertRaisesRegex(ValueError, "missing current first-step script"): current.resolve_current_first_steps(result, root)