diff --git a/research/p104-integer-linux-validation/BENCHMARK.json b/research/p104-integer-linux-validation/BENCHMARK.json new file mode 100644 index 0000000000..cab5617551 --- /dev/null +++ b/research/p104-integer-linux-validation/BENCHMARK.json @@ -0,0 +1,156 @@ +{ + "complete_scientific_receipts_equal": true, + "fraction_saved": { + "cpu_seconds": 0.772791519434629, + "wall_seconds": 0.7729588951780773 + }, + "gate_passed": true, + "limitations": "Fresh processes on an unreserved Linux host, unflushed OS caches, three samples per arm at most; no universal speed claim. Qualification is separate.", + "limits": { + "automatic_retries": 0, + "cumulative_seconds": 900, + "per_command_seconds": 180, + "sampled_group_rss_bytes": 1073741824 + }, + "medians": { + "baseline": { + "cpu_seconds": 28.299999999999997, + "wall_seconds": 28.363380322989542 + }, + "candidate": { + "cpu_seconds": 6.43, + "wall_seconds": 6.439653205015929 + } + }, + "order": [ + "baseline", + "candidate", + "candidate", + "baseline", + "baseline", + "candidate" + ], + "runs": [ + { + "cpu_seconds": 28.669999999999998, + "internal_seconds": 28.448774, + "kernel_max_rss_kib": 101508, + "label": "sample-1-baseline", + "mode": "baseline", + "receipt": { + "coordinates": 799, + "events": 25984, + "guards": { + "owned": 22, + "prefix": 26, + "public": 23 + }, + "source_controls": 6, + "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98" + }, + "sampled_group_rss_bytes": 105431040, + "wall_seconds": 28.715565735998098 + }, + { + "cpu_seconds": 6.35, + "internal_seconds": 6.11869, + "kernel_max_rss_kib": 100548, + "label": "sample-2-candidate", + "mode": "candidate", + "receipt": { + "coordinates": 799, + "events": 25984, + "guards": { + "owned": 22, + "prefix": 26, + "public": 23 + }, + "source_controls": 6, + "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98" + }, + "sampled_group_rss_bytes": 104448000, + "wall_seconds": 6.385658305982361 + }, + { + "cpu_seconds": 6.4399999999999995, + "internal_seconds": 6.231335, + "kernel_max_rss_kib": 100472, + "label": "sample-3-candidate", + "mode": "candidate", + "receipt": { + "coordinates": 799, + "events": 25984, + "guards": { + "owned": 22, + "prefix": 26, + "public": 23 + }, + "source_controls": 6, + "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98" + }, + "sampled_group_rss_bytes": 104370176, + "wall_seconds": 6.488194212986855 + }, + { + "cpu_seconds": 28.299999999999997, + "internal_seconds": 28.102562, + "kernel_max_rss_kib": 101760, + "label": "sample-4-baseline", + "mode": "baseline", + "receipt": { + "coordinates": 799, + "events": 25984, + "guards": { + "owned": 22, + "prefix": 26, + "public": 23 + }, + "source_controls": 6, + "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98" + }, + "sampled_group_rss_bytes": 105689088, + "wall_seconds": 28.363380322989542 + }, + { + "cpu_seconds": 28.16, + "internal_seconds": 27.952935, + "kernel_max_rss_kib": 101736, + "label": "sample-5-baseline", + "mode": "baseline", + "receipt": { + "coordinates": 799, + "events": 25984, + "guards": { + "owned": 22, + "prefix": 26, + "public": 23 + }, + "source_controls": 6, + "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98" + }, + "sampled_group_rss_bytes": 105664512, + "wall_seconds": 28.216742029995658 + }, + { + "cpu_seconds": 6.43, + "internal_seconds": 6.203333, + "kernel_max_rss_kib": 101104, + "label": "sample-6-candidate", + "mode": "candidate", + "receipt": { + "coordinates": 799, + "events": 25984, + "guards": { + "owned": 22, + "prefix": 26, + "public": 23 + }, + "source_controls": 6, + "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98" + }, + "sampled_group_rss_bytes": 105017344, + "wall_seconds": 6.439653205015929 + } + ], + "speedup_wall": 4.40448878534281 +} diff --git a/research/p104-integer-linux-validation/COVERAGE.json b/research/p104-integer-linux-validation/COVERAGE.json new file mode 100644 index 0000000000..22135c6c1e --- /dev/null +++ b/research/p104-integer-linux-validation/COVERAGE.json @@ -0,0 +1,29 @@ +{ + "source_head": "7c5eb98e7439d778141d63e801e53d4cd7e1d587", + "events": 25984, + "coordinates": 799, + "all_actual_signed_witness_rows_equal": true, + "coefficient_scale_bits": 55, + "guards": { + "prefix": 26, + "public": 23, + "owned": 22 + }, + "original_rejections": 6, + "extra_dyadic_cases": 120, + "extra_dyadic_events": 4240, + "integer_rejections": [ + "nondyadic scalar", + "inexact scale division", + "nondyadic weight" + ], + "scope": "Unchanged complete original default or full --qualify, with exact authenticated export. Timing uses default baseline/candidate; full --qualify additionally compares reference, witnesses and finite corpus. No reduced source or sampled coverage.", + "new_custody_controls": [ + "official export byte", + "inner source archive", + "contract bytes", + "declared seam" + ], + "modes": "Normal, optimized and sealed qualification checked separately.", + "physical_limits": "Native gauges, reset implementation/fees, exact owned return and inherited five assumptions are not discharged." +} diff --git a/research/p104-integer-linux-validation/NOTICE b/research/p104-integer-linux-validation/NOTICE new file mode 100644 index 0000000000..d34635dcf6 --- /dev/null +++ b/research/p104-integer-linux-validation/NOTICE @@ -0,0 +1,24 @@ +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-integer-linux-validation/PROOF-REVIEW.md b/research/p104-integer-linux-validation/PROOF-REVIEW.md new file mode 100644 index 0000000000..d36e7a56b3 --- /dev/null +++ b/research/p104-integer-linux-validation/PROOF-REVIEW.md @@ -0,0 +1,35 @@ +# Source-bound coverage and arithmetic review + +This review concerns Ali Romman's PR #5831 at `7c5eb98e7439d778141d63e801e53d4cd7e1d587`, package `research/p104-integer-error-replay`, consuming PR #5826 at `58f93cf41751920f3d6766a39caccc2974ce18b0`. It checks verification computations and Linux portability. It changes no precision theorem, native word, reset allowance, physical implementation, selected record or kappa. + +## Exact arithmetic mechanism + +For each row maintain a conservative denominator exponent. INIT/CLEAR reset it to zero, MOVE preserves it, SCALE by `a/2^k` adds k, and ADD/COPY take the maximum of the destination exponent and source exponent plus k. The corresponding reversed rule updates the transposed source from the destination. The maximum encountered in both traversals supplies a single positive power-of-two scale S. Unit defect injection needs exponent zero and is covered. Ignoring cancellation and numerator powers of two enlarges the bound safely. On this actual word the qualification reports 55 scale bits; this is a coefficient representation bound, not an implemented physical precision allowance. + +Induction over each traversal shows every stored coefficient lies in `(1/S) Z`. The integer backend multiplies before shifting and explicitly checks divisibility; Python's right shift of a negative exactly divisible integer therefore returns the exact quotient too. Nondyadic values and insufficient divisibility reject. There is no rounding or modular acceptance. Ideal rows, error rows and transposed columns keep their signed values. Original Fraction conversion and canonical reduced encodings remain at result/hash boundaries. + +Separate positive global dyadic scales for local operand and feedback weights give common positive units for the three score coordinates. At each ADD/COPY the update is `abs(new_signed_coefficient)-abs(old_signed_coefficient)`, including negative score changes from cancellation. It is not absolute-value propagation. Global positive rescaling preserves comparisons, ties, peak choices and Pareto ordering; each coordinate retains its own fixed unit. The original literal execution and reverse-cut oracles are supplied unchanged to the integer Engine. + +The explicit adapted contract is reconstructed from the original text using all four uniquely matching declared edits, then the obsolete original CLI is removed. The exact reconstructed bytes must equal `contract.py` before the original scientific modules load. The changes parameterize the source directory and backend; the original calculate body, complete comparisons, guards, attained fixtures and six semantic controls remain. No arithmetic implementation, import hook or mutable global is patched by this Linux validation. + +## What complete qualification checks + +Every normal fast baseline/candidate replay executes the complete 25,984-event, 799-coordinate contract and compares its entire result to the frozen original RESULT, not just the short printed summary. This includes ideal endpoint/frame/owner metadata, original local-weight hash, all final scores and signed coefficient hashes, prefix and final guards, original attaining fixtures and six rejection controls. The independent literal scalar and reverse-cut oracles remain active. + +The unchanged `--qualify` additionally executes the full Fraction baseline and compares the complete candidate result directly; compares the actual ideal metadata and every exact local weight; compares all actual signed witness dictionaries used by the source; and checks 120 varied dyadic words / 4,240 events in both directions. It retains nondyadic-scalar, nondyadic-weight and inexact-division rejection controls. Its expected qualification receipt is also compared in full. Normal and optimized execution use explicit `need`/`require` failures, not disabled assertions. + +Our wrapper authenticates the entire official 13-file PR5831 export before imports: whole tar hash, unique regular member inventory, exact source head, each file's size/hash and declared regular mode. It materializes the 14-member export privately, read-only and Git-free, checks bytes/modes and absence of links after success, then removes the temporary copy. The frozen verifier separately authenticates its unchanged nested source archive and exact declared adaptations. That nested archive is extracted into the original verifier's writable temporary scratch; this contribution does not add or claim immutable enforcement for that private scratch. The immutable archive and outer export remain fixed. + +Four small custody controls reject corruption of the official bundle, nested source archive, adapted contract and declared seam before any scientific module import. They run normally and under optimization. These complement the original six semantic and three integer controls; they are not substituted for a full replay. + +## Measurement and admission boundaries + +Linux measurements run complete baseline/candidate commands in the original B,C,C,B,B,C order, each in a fresh process. The same authenticated-export materialization is charged to both arms. Full qualification is a separate measured cost. Every raw output and resource receipt is retained; only the volatile runtime field differs between complete baseline/candidate outputs. The complete scientific receipt must match exactly. No persistent state/PASS cache, sampling, omitted event or changed expected result is used. + +The source's 180-second command limit is preserved. The local round also applies 900 seconds cumulative full scientific wall time, 1 GiB sampled process-group RSS, bounded output and no retries, with full runs serialized under one lock. Sampling can miss short peaks; kernel peak RSS is reported separately. The host is not reserved, OS caches are not flushed, and three observations per arm do not establish a universal performance factor. Original macOS timings and our Linux timings are distinct observations. + +The five framework assumptions, native unitary gauges, physical reset implementation/fees, exact owned zero return, compiler and analytic admission retain their status. The frozen sufficient guards are prefix 26 / public 23 / owned 22; they are not optimal physical precision claims. Same-agent assisted review and different-host replay do not constitute independent human or proof-kernel acceptance. Source custody, local qualification, hosted CI, publication, merging and mathematical admission remain separate. + +## Attribution + +Ali Romman supplied the exact integer backend, dyadic scale proof, explicit parameter adaptation, original qualification and macOS measurements. Preserve PR5826/5819, Adam Gall, ywz65, PR2878, Mason Hale/PR5811 and the entire retained P104/native/compiler/precision lineage and original notices. New Linux review, custody controls, guard adaptation, measurements and reporting: Chris R / Clear1nsight, with substantial OpenAI Codex assistance; no subagents. Guard/custody mechanics follow PR5816/5818/5832. Apache-2.0. diff --git a/research/p104-integer-linux-validation/README.md b/research/p104-integer-linux-validation/README.md new file mode 100644 index 0000000000..12d93be167 --- /dev/null +++ b/research/p104-integer-linux-validation/README.md @@ -0,0 +1,70 @@ +# Linux validation of the complete PR #5831 precision replay + +This focused audit independently reproduces Ali Romman's [PR #5831](https://github.com/CrocSwap/integer-mult-bounds/pull/5831) exact-integer precision replay on Linux, retaining the complete original package and nested source archive unchanged. It supplies a source/coverage review, bounded wall/CPU/memory measurements, corruption controls and portable full qualification. It adds no backend optimization or new kappa. + +The predeclared success and stop criteria require exact complete results and witness coverage, all original controls, normal/optimized and sealed read-only Git-free qualification, and at least 15% lower median wall **and CPU** time for a useful Linux speed claim. A failing source, receipt, control, stderr or resource condition stops without retry. The 180-second source command limit is preserved, with an additional 900-second cumulative local scientific budget, 1 GiB sampled process-group RSS and bounded output. All full runs are serialized. + +## Linux measurements + +One unreserved Ubuntu 24.04.5 LTS / Linux x86_64 host, CPython 3.12.3, Intel Core i7-4790. Six serial fresh processes in the original B,C,C,B,B,C order; all samples retained: + +| Complete original precision replay | Wall median | CPU median | Wall range | +| --- | ---: | ---: | ---: | +| Fraction reference | 28.363 s | 28.300 s | 28.217–28.716 s | +| Exact integer candidate | 6.440 s | 6.430 s | 6.386–6.488 s | +| Reduction | **77.30%** | **77.28%** | **4.40x wall speedup** | + +Kernel peak RSS maxima are 99.38 MiB for the reference and 98.73 MiB for the candidate; sampled process-group peaks are recorded separately. Each fast replay executes every original event/coordinate, complete expected result and all six original controls. Full reference/witness/finite qualification is a separate cost: the first Linux normal run takes **60.47 seconds**, about 101.14 MiB kernel peak RSS. Its extra cost is not folded into the 4.40x production-replay claim. The author's 5.60x macOS observation and this 4.40x Linux observation are distinct; no universal factor follows. + +## Coverage before measurement + +The original qualification passes first: all 25,984 events / 799 coordinates, complete original/candidate result, actual signed witness dictionaries, ideal metadata and local weights, final signed coefficient and score checks, guards, literal attaining fixtures, six original controls, 120 extra dyadic programs / 4,240 events and three integer rejection controls. It reports scale exponent 55 and the unchanged sufficient guards 26/23/22 (prefix/public/owned). Four additional custody controls reject whole-export, nested-archive, contract and declared-seam corruption before scientific imports, normally and under optimization. + +[PROOF-REVIEW.md](PROOF-REVIEW.md) maps the exact arithmetic and every retained check. [COVERAGE.json](COVERAGE.json) records the source-bound scope. Measurement and qualification receipts are reported separately in BENCHMARK.json, VALIDATION.json and evidence/; a fast candidate replay is not mislabeled as full reference qualification. + +## Reproduce a fresh complete qualification + +Python 3.12, standard library: + +```sh +python3 -B scripts/research_package.py --package research/p104-integer-linux-validation +``` + +This runs source-custody controls and then the **unchanged full `--qualify` scientific computation**, including the Fraction reference and all extra witness/finite checks. It is not a recorded-evidence-only check. Expect `PASS_PRECISION_LINUX_SOURCE_CONTROLS` and `PASS_P104_INTEGER_ERROR_REPLAY` with the complete qualification receipt. The original 180-second timeout is retained. Original normal Linux qualification took about one minute here; timings depend on host/load. + +The official complete 13-file export of PR #5831 at `7c5eb98e7439d778141d63e801e53d4cd7e1d587` is retained as `inputs/PR5831.tar`, SHA256 `6ad8d8e0463e8e6ea8d503610c3f9ec38108f16092bc479bc1cb6f48683f6ab6`. Its nested PR #5826 source `58f93cf41751920f3d6766a39caccc2974ce18b0` remains unchanged. No network, Git, third-party dependency, unmerged provenance-object cache or edited frozen input is required at runtime. All outer export bytes/modes are checked after success. The original verifier's nested temporary scratch retains its original writable behavior; this audit does not claim otherwise. + +To repeat the complete six-process comparison on Linux with `/usr/bin/python3.12`, GNU `/usr/bin/time` and `/proc`, first pass full qualification at the same source, then choose a fresh work directory: + +```sh +python3 -B research/p104-integer-linux-validation/benchmark.py pair --workdir /tmp/precision-linux-fresh +python3 -B research/p104-integer-linux-validation/benchmark.py remaining --workdir /tmp/precision-linux-fresh +``` + +The first pair must preserve the complete scientific receipt and save at least 15% wall and CPU before the remaining four original-order runs are allowed. Existing run directories are never overwritten; every sample is kept. These commands measure complete baseline/candidate production replays, with identical outer authentication/extraction charged to both arms. They do not time the extra full-reference qualification as the fast path. The Linux development round's qualification and all six samples share the same cumulative guard; reproduction's standalone qualification and new benchmark directory have separately stated costs. + +## Mode and export qualification + +Full normal, optimized and read-only Git-free isolated optimized qualification pass in **60.47 / 63.86 / 60.26 seconds**. The scientific receipts agree exactly; raw output retains its varying runtime field. The sealed implementation `48479b602545f27e9a35742938be2d5f2bd8459e` runs with `-I -O -B`, empty PATH and an explicit authenticated import root; all **53 exported files** stay unchanged. + +One relative-path launcher invocation failed before target entry. Its zero-output exit-2 receipt and exact diagnosis are retained. The absolute-path correction is separately labelled, manually justified and uses unchanged source/expected records/limits; it is not an automatic retry, scientific repair or discarded timing sample. Nine full scientific commands pass; the additional pre-target launch failure is charged. All ten local attempts total **289.30 seconds**, below 900 seconds cumulative. Qualification and export costs are outside the fast-path speed claim. + +Public receipts remove only local absolute script paths; the one failed stderr replaces the local workspace prefix, retaining original receipt/stderr hashes and public redaction details. Scientific stdout is unfiltered. Final committed bytes/modes, immediate input ancestry, official export/input integrity and hosted CI are reported separately; later additions change evidence/reporting only. + +## Source and overlap scope + +Canonical main is `de5ec2e7a6074068452f45b1a191b5c72832df4a`, priority revision 8. The donor assigned Linux validation directly; the task card is refined accordingly. [The source claim](https://github.com/CrocSwap/integer-mult-bounds/pull/5831#issuecomment-6433618407) precedes execution. Targeted PR/body and source-comment checks found no competing Linux follow-up. The author's [released handoff](https://github.com/CrocSwap/integer-mult-bounds/discussions/2750#discussioncomment-19209571) explicitly requests Linux reproduction; the neighbouring rounded-gauge transport claim is a different word and scope. Coverage is bounded and does not establish exhaustive novelty or unpublished-work availability. + +The initial shallow checkout lacked several declared provenance objects; exact commits/blobs were fetched and all seven declared source hashes and unchanged original metadata checks passed before execution. No frozen manifest was weakened. Full-history preflight remains unavailable; final committed bytes/modes, own-input immediate ancestry and official export/input integrity are checked separately. + +The branch retains the same exact [PR #5761](https://github.com/CrocSwap/integer-mult-bounds/pull/5761) test-only dependency used by the source, preserving Ali Romman's authorship and cherry-pick reference. It changes no scientific artifact. This package does not transfer the integer backend to a new word or silently broaden the source operation/scale contract. + +## Open next questions + +- Does the complete-check gain hold on another Linux host? Authenticate the same source and repeat full qualification plus all six bounded samples. Three samples per arm on an unreserved host are not a universal factor. +- Does a changed word satisfy the dyadic representation contract? Prove its complete source-specific scale and operations before finite feasibility or any full implementation. This validation does not admit successors. +- Does the physical caller meet the retained gauge/reset/owned-return allowances? That is separate research, outside this verification-only task. No kappa work, peer thread, feed, worker or automation is resumed here. + +## Credit and limits + +Ali Romman supplied the integer backend, exact-scale proof, original adaptation, qualification and macOS measurements. Preserve [PR #5826](https://github.com/CrocSwap/integer-mult-bounds/pull/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 all native/compiler/precision notices in the unchanged archive and NOTICE. New Linux validation for Chris R / Clear1nsight with substantial OpenAI Codex assistance; no subagents. Guard/custody mechanics follow PR5816/5818/5832. Apache-2.0. Same-agent assisted review and hosted CI are not independent human/kernel acceptance. Five framework assumptions, physical reset/owned-return and selected status remain unchanged; kappa research stays paused. diff --git a/research/p104-integer-linux-validation/SOURCES.json b/research/p104-integer-linux-validation/SOURCES.json new file mode 100644 index 0000000000..163a69d203 --- /dev/null +++ b/research/p104-integer-linux-validation/SOURCES.json @@ -0,0 +1,34 @@ +{ + "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-integer-linux-validation/inputs/PR5831.tar", + "usage": "input", + "git_blob": "eddee1f6a956d1c4d0008bf75fc66a0a36ad56a2", + "sha256": "6ad8d8e0463e8e6ea8d503610c3f9ec38108f16092bc479bc1cb6f48683f6ab6", + "pin": "head:61f76fd9b3772b1b38981ea1d5b332d73a80e73b:research/p104-integer-linux-validation/inputs/PR5831.tar" + } + ], + "external_origin": { + "pr": 5831, + "head": "7c5eb98e7439d778141d63e801e53d4cd7e1d587", + "package": "research/p104-integer-error-replay", + "files": 13, + "source_pr": 5826, + "source_head": "58f93cf41751920f3d6766a39caccc2974ce18b0", + "note": "Complete official package export retained unchanged. Original pending provenance objects are authenticated at intake but not runtime dependencies." + } +} diff --git a/research/p104-integer-linux-validation/TASK.json b/research/p104-integer-linux-validation/TASK.json new file mode 100644 index 0000000000..dee35408cc --- /dev/null +++ b/research/p104-integer-linux-validation/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 independently reproduce the existing exact-integer precision backend on Linux, preserving every original check and reporting qualification cost separately; no backend or mathematical construction change.", + "actual_scope": "PR5831/frozen-7c5eb98/Linux-complete-precision-qualification-and-six-process-runtime", + "bottleneck_link": "Faster trustworthy replays increase review throughput and let mechanism candidates be checked sooner.", + "stop_rule": "Stop without retry on source/inventory/mode drift, receipt/witness/control mismatch, stderr or resource failure. Original 180-second per-command limit, 1 GiB sampled process-group RSS, 900 seconds cumulative full local science. Require >=15% lower first-pair wall and CPU before timing expansion; report medians of all original-order six runs. No original timeout/source/expected result repair.", + "time_budget_minutes": 90, + "outcome": "completed", + "evidence": "PROOF-REVIEW.md, COVERAGE.json, BENCHMARK.json, VALIDATION.json and evidence/ retain exact sources, all Linux measurements, full scientific receipts, custody controls and bounded normal/optimized/export qualification.", + "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 a second Linux host reproduce the same complete-check gain?", + "why_it_matters": "One unreserved host and three observations per arm do not establish a universal speedup.", + "first_step": "Authenticate the same head, run full qualification and retain all six B,C,C,B,B,C samples under bounded caps.", + "blocked_by": "A separately authorized host measurement, not a kappa experiment." + }, + { + "question": "Can a changed word use this dyadic backend?", + "why_it_matters": "Coverage and common-scale hypotheses are source-specific.", + "first_step": "Authenticate the changed word and prove the scale/operation contract before a bounded finite qualification.", + "blocked_by": "New source, ownership and coverage gates; no automatic transfer from this audit." + } + ], + "base_commit": "de5ec2e7a6074068452f45b1a191b5c72832df4a" +} diff --git a/research/p104-integer-linux-validation/VALIDATION.json b/research/p104-integer-linux-validation/VALIDATION.json new file mode 100644 index 0000000000..c02b42eb2d --- /dev/null +++ b/research/p104-integer-linux-validation/VALIDATION.json @@ -0,0 +1,41 @@ +{ + "status": "PASS_EXACT_FROZEN_LINUX_QUALIFICATION_ONLY", + "source_pr": 5831, + "source_head": "7c5eb98e7439d778141d63e801e53d4cd7e1d587", + "source_pr5826_head": "58f93cf41751920f3d6766a39caccc2974ce18b0", + "implementation_commit": "48479b602545f27e9a35742938be2d5f2bd8459e", + "retention_commit": "61f76fd9b3772b1b38981ea1d5b332d73a80e73b", + "main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "production_wall_speedup": 4.40448878534281, + "production_wall_fraction_saved": 0.7729588951780773, + "production_cpu_fraction_saved": 0.772791519434629, + "baseline_wall_median": 28.363380322989542, + "candidate_wall_median": 6.439653205015929, + "qualification_normal_seconds": 60.46646667202003, + "qualification_optimized_seconds": 63.859208991983905, + "qualification_sealed_seconds": 60.26154273899738, + "science_commands_passed": 9, + "pre_target_launch_failures_preserved": 1, + "all_local_attempts_wall_seconds": 289.2987882719608, + "aggregate_cap_seconds": 900, + "command_cap_seconds": 180, + "sampled_process_group_rss_cap_bytes": 1073741824, + "automatic_retries": 0, + "diagnosed_manual_launcher_correction": "One separate absolute-path launch after proving the relative-path error prevented target entry; full failed receipt retained and time charged.", + "full_qualified_scientific_receipts_equal": true, + "timing_field_not_part_of_scientific_receipt": true, + "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98", + "mode": "Normal, -O, sealed -I -O -B with explicit authenticated import root and empty PATH", + "sealed_export_files_unchanged": 53, + "outer_official_source_export": "13 files plus transport receipt authenticated/read-only/unchanged for each successful command", + "nested_scratch": "Original verifier extracts nested source into writable private scratch; no new enforcement claimed.", + "custody_controls": 4, + "custody_modes": "Normal and optimized pass before science imports", + "coverage": "25984 events; 799 coordinates; complete original/candidate result; actual signed witnesses; ideal metadata/weights; final signed coefficients and scores; guards and attaining fixtures; six original controls; 120 programs/4240 events; three integer controls.", + "performance_limitations": "Three observations per arm on one unreserved host; fresh processes, unflushed OS caches, no universal or statistical guarantee. Full qualification cost is separate.", + "source_transport": "Initial shallow provenance objects unavailable; exact declared commits/blobs fetched and all seven bindings + unchanged metadata passed before execution.", + "history": "Full-history preflight unavailable; immediate own-input pin ancestry checked separately.", + "hosted_ci": "Separate exact-head check recorded in public handoff", + "kappa_research": "PAUSED", + "subagents": 0 +} diff --git a/research/p104-integer-linux-validation/VERIFY.json b/research/p104-integer-linux-validation/VERIFY.json new file mode 100644 index 0000000000..aa067771e1 --- /dev/null +++ b/research/p104-integer-linux-validation/VERIFY.json @@ -0,0 +1,29 @@ +{ + "schema_version": 1, + "status": "ready", + "python": "3.12", + "requirements": [], + "inputs": [ + "research/p104-integer-linux-validation/inputs/PR5831.tar" + ], + "commands": [ + { + "argv": [ + "{python}", + "-B", + "{package}/custody.py" + ], + "timeout_seconds": 30, + "checks": "Four source-bound actual corruptions reject before scientific imports: whole official bundle, nested source archive, adapted contract, declared seam." + }, + { + "argv": [ + "{python}", + "-B", + "{package}/verify.py" + ], + "timeout_seconds": 180, + "checks": "Fresh complete unchanged PR5831 qualification: all 25984 events/799 coordinates, full reference/candidate results and signed witnesses/weights, 120 dyadic words/4240 events, all six original plus three integer controls; immutable outer export checked." + } + ] +} diff --git a/research/p104-integer-linux-validation/baseline.py b/research/p104-integer-linux-validation/baseline.py new file mode 100644 index 0000000000..a647f0e669 --- /dev/null +++ b/research/p104-integer-linux-validation/baseline.py @@ -0,0 +1,9 @@ +"""Complete unchanged PR5831 baseline command.""" +import sys +from replay import main +from source import require + +if __name__ == '__main__': + require(len(sys.argv) == 1, 'No wrapper arguments') + sys.argv = [sys.argv[0], '--baseline'] + main() diff --git a/research/p104-integer-linux-validation/benchmark.py b/research/p104-integer-linux-validation/benchmark.py new file mode 100644 index 0000000000..b876f096f2 --- /dev/null +++ b/research/p104-integer-linux-validation/benchmark.py @@ -0,0 +1,82 @@ +"""Bounded original B,C,C,B,B,C order, retaining every Linux sample.""" +import argparse +import fcntl +from hashlib import sha256 +import json +from pathlib import Path +import statistics + +import guard +from replay import EXPECTED +from source import require + +PACKAGE = Path(__file__).resolve().parent +ORDER = ('baseline', 'candidate', 'candidate', 'baseline', 'baseline', 'candidate') + + +def scientific(folder, label, mode): + raw = (folder / 'runs' / label / 'stdout.txt').read_bytes() + lines = raw.decode().splitlines() + require(len(lines) == 2 and lines[0] == 'PASS_P104_INTEGER_ERROR_REPLAY', 'Complete original output') + data = json.loads(lines[1]) + require(set(data) == {'mode', 'receipt', 'seconds'} and data['mode'] == mode, + 'Complete original output schema and mode') + require(data['receipt'] == EXPECTED, 'Every original scientific receipt field') + return data + + +def summary(folder, labels, threshold=True): + rows = [] + for number, mode in labels: + label = f'sample-{number}-{mode}' + receipt = json.loads((folder / 'runs' / label / 'receipt.json').read_bytes()) + require(receipt['status'] == 'PASS', 'Every measurement passed') + data = scientific(folder, label, mode) + rows.append({'label': label, 'mode': mode, 'wall_seconds': receipt['wall_seconds'], + 'cpu_seconds': receipt['usage']['user_seconds'] + receipt['usage']['system_seconds'], + 'kernel_max_rss_kib': receipt['usage']['kernel_max_rss_kib'], + 'sampled_group_rss_bytes': receipt['sampled_process_group_rss_bytes'], + 'internal_seconds': data['seconds'], 'receipt': data['receipt']}) + medians = {mode: {kind: statistics.median(r[kind] for r in rows if r['mode'] == mode) + for kind in ('wall_seconds', 'cpu_seconds')} for mode in ('baseline', 'candidate')} + saving = {kind: 1 - medians['candidate'][kind] / medians['baseline'][kind] + for kind in ('wall_seconds', 'cpu_seconds')} + result = {'order': [r['mode'] for r in rows], 'runs': rows, 'medians': medians, + 'fraction_saved': saving, 'speedup_wall': medians['baseline']['wall_seconds'] / + medians['candidate']['wall_seconds'], 'complete_scientific_receipts_equal': True, + 'gate_passed': min(saving.values()) >= .15, + 'limits': {'per_command_seconds': 180, 'cumulative_seconds': 900, + 'sampled_group_rss_bytes': 1073741824, 'automatic_retries': 0}, + 'limitations': 'Fresh processes on an unreserved Linux host, unflushed OS caches, three samples per arm at most; no universal speed claim. Qualification is separate.'} + target = 'FIRST-PAIR.json' if len(rows) == 2 else 'BENCHMARK.json' + (folder / target).write_text(json.dumps(result, indent=2, sort_keys=True) + '\n') + if threshold: + require(result['gate_passed'], 'At least 15 percent wall and CPU saving before expansion') + print('PASS_PRECISION_LINUX_COMPARISON', json.dumps(result, sort_keys=True), flush=True) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('phase', choices=('pair', 'remaining')) + parser.add_argument('--workdir', type=Path, required=True) + args = parser.parse_args() + folder = args.workdir.resolve() + if args.phase == 'pair': + folder.mkdir(parents=True) + require(folder.is_dir(), 'Existing comparison directory') + with (folder / 'execution.lock').open('a') as lock: + fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB) + guard.HERE = folder + if args.phase == 'remaining': + first = json.loads((folder / 'FIRST-PAIR.json').read_bytes()) + require(first['gate_passed'] and first['complete_scientific_receipts_equal'], 'First pair gate') + selected = list(enumerate(ORDER, 1))[:2] if args.phase == 'pair' else list(enumerate(ORDER, 1))[2:] + for number, mode in selected: + label = f'sample-{number}-{mode}' + guard.run(label, mode + '.py') + scientific(folder, label, mode) + summary(folder, list(enumerate(ORDER, 1))[:2] if args.phase == 'pair' else list(enumerate(ORDER, 1))) + + +if __name__ == '__main__': + main() diff --git a/research/p104-integer-linux-validation/candidate.py b/research/p104-integer-linux-validation/candidate.py new file mode 100644 index 0000000000..c0c1376610 --- /dev/null +++ b/research/p104-integer-linux-validation/candidate.py @@ -0,0 +1,9 @@ +"""Complete unchanged PR5831 candidate command.""" +import sys +from replay import main +from source import require + +if __name__ == '__main__': + require(len(sys.argv) == 1, 'No wrapper arguments') + sys.argv = [sys.argv[0], '--candidate'] + main() diff --git a/research/p104-integer-linux-validation/custody.py b/research/p104-integer-linux-validation/custody.py new file mode 100644 index 0000000000..f1fd37b644 --- /dev/null +++ b/research/p104-integer-linux-validation/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-integer-linux-validation/evidence/CLAIM.md b/research/p104-integer-linux-validation/evidence/CLAIM.md new file mode 100644 index 0000000000..1465ac8f22 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/CLAIM.md @@ -0,0 +1 @@ +CLAIM — bounded Linux validation of [PR #5831](https://github.com/CrocSwap/integer-mult-bounds/pull/5831), frozen head `7c5eb98e7439d778141d63e801e53d4cd7e1d587`, following its explicit Linux reproduction request. Scope: source/proof and complete-coverage review; full baseline/candidate precision qualification; original six-process B,C,C,B,B,C timing order with wall, CPU and memory; normal/optimized and sealed read-only Git-free checks. Preserve all 25,984 events, 799 coordinates, complete signed results/witnesses/weights/guards and original six plus three arithmetic controls; qualification cost reported separately. Success for a Linux speed claim requires at least 15% lower wall and CPU median, after a passing first pair. Stop without retry on mismatch, source drift, stderr or resource failure: original 180-second command limit, 1 GiB sampled process-group RSS, 900 seconds cumulative full scientific work, serial execution. No original source, expected result or timeout is changed. Canonical main `de5ec2e7a6074068452f45b1a191b5c72832df4a`; targeted PR/body and source-comment overlap found no competing Linux follow-up, with non-exhaustive coverage. Claim expires 27 October 2026 at 17:00 AEDT. Kappa research, Work 1/2, feeds and automations remain paused. Credit Ali Romman and all PR5826/5819/5811/2878/native/compiler/precision predecessors; validation for Chris R / Clear1nsight with substantial OpenAI Codex assistance, no subagents. diff --git a/research/p104-integer-linux-validation/evidence/CUSTODY-NORMAL.txt b/research/p104-integer-linux-validation/evidence/CUSTODY-NORMAL.txt new file mode 100644 index 0000000000..97e935f817 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/CUSTODY-NORMAL.txt @@ -0,0 +1 @@ +PASS_PRECISION_LINUX_SOURCE_CONTROLS {"contract": "declared contract edits", "declared_edit": "unique backend seam", "inner_archive": "source hash", "official_export_byte": "Exact PR5831 bundle"} diff --git a/research/p104-integer-linux-validation/evidence/CUSTODY-OPTIMIZED.txt b/research/p104-integer-linux-validation/evidence/CUSTODY-OPTIMIZED.txt new file mode 100644 index 0000000000..97e935f817 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/CUSTODY-OPTIMIZED.txt @@ -0,0 +1 @@ +PASS_PRECISION_LINUX_SOURCE_CONTROLS {"contract": "declared contract edits", "declared_edit": "unique backend seam", "inner_archive": "source hash", "official_export_byte": "Exact PR5831 bundle"} diff --git a/research/p104-integer-linux-validation/evidence/LAUNCHER-DIAGNOSIS.json b/research/p104-integer-linux-validation/evidence/LAUNCHER-DIAGNOSIS.json new file mode 100644 index 0000000000..e4f3a2cf77 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/LAUNCHER-DIAGNOSIS.json @@ -0,0 +1,10 @@ +{ + "failed_label": "qualification-sealed", + "status": "PRE_TARGET_LAUNCH_FAILURE_PRESERVED", + "cause": "Relative driver argument was resolved under the package directory; Python could not open that nonexistent path.", + "evidence": "exit 2, empty stdout, explicit cannot-open-file stderr before target script entry", + "scientific_execution_started": false, + "wall_seconds_charged": 0.10237605599104427, + "response": "One manually diagnosed corrected-absolute-path qualification, distinct new label; no automatic retry, source or expected-result edit, timeout/cap change.", + "corrected_driver": "[workspace]/outputs/precision-linux-validation-20261027/sealed-driver.py" +} diff --git a/research/p104-integer-linux-validation/evidence/LAUNCHER-PROGRESS.md b/research/p104-integer-linux-validation/evidence/LAUNCHER-PROGRESS.md new file mode 100644 index 0000000000..40a3576536 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/LAUNCHER-PROGRESS.md @@ -0,0 +1 @@ +PROGRESS — complete Linux qualification of frozen PR #5831 passes normally (60.47 s) and under optimization (63.86 s). All six original-order measurements pass with 4.40x wall speedup and 77.30% wall / 77.28% CPU reduction, preserving complete scientific receipts. A sealed-export launcher invocation failed before target entry because its relative path resolved under the package directory; its exit-2/empty-output/error receipt is retained. This is a pre-execution harness diagnosis, not a scientific or coverage failure. I will make one bounded corrected-absolute-path export qualification, preserving the failed receipt and charging its time to the same 900-second cumulative cap. No source, expected result or 180-second timeout changes; no automatic retries or kappa research. diff --git a/research/p104-integer-linux-validation/evidence/PLAN.json b/research/p104-integer-linux-validation/evidence/PLAN.json new file mode 100644 index 0000000000..349f1bb266 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/PLAN.json @@ -0,0 +1,33 @@ +{ + "task": "Linux validation of exact PR5831, preserving full precision qualification", + "source_head": "7c5eb98e7439d778141d63e801e53d4cd7e1d587", + "source_package": "research/p104-integer-error-replay", + "source_export_sha256": "6ad8d8e0463e8e6ea8d503610c3f9ec38108f16092bc479bc1cb6f48683f6ab6", + "main": "de5ec2e7a6074068452f45b1a191b5c72832df4a", + "kappa_research": "PAUSED", + "workers": 0, + "success": [ + "All 25984 original events and 799 coordinates, complete source result, final signed coefficients, guards, attaining fixtures, six original rejection controls preserved.", + "Full qualification compares all actual signed witness rows, ideal metadata/local weights, original reference result, 120 dyadic programs / 4240 events, three integer rejection controls.", + "Normal, optimized and sealed read-only Git-free full qualification agree on complete scientific receipt; exported bytes/modes and immutable sources unchanged.", + "A useful Linux performance reproduction requires >=15% lower median wall AND CPU time over three baseline and three candidate fresh processes in the original B,C,C,B,B,C order. Report raw runs and RSS. Qualification is a separate cost.", + "Publish useful exact scoped evidence, including a non-speed result if correct coverage survives but performance does not. No kappa claim." + ], + "stages": [ + "Authenticate head, all declared pins, official export, source proof/edits and bounded overlap; post public claim.", + "Run source-custody controls then one complete guarded normal qualification before performance expansion.", + "One first pair; stop measurement expansion if either wall or CPU saving <15%, retaining the result.", + "If first pair passes, complete remaining four original-order measurements with no retries; report all samples and medians.", + "Run full optimized qualification and sealed export qualification once, preserving complete coverage; publish focused package and seven-field handoffs; exact-head hosted CI last." + ], + "stop": [ + "Any source/head/hash/inventory/mode drift, output/receipt/witness/control discrepancy, unexpected stderr or guard termination: stop without automatic retry.", + "Source --qualify must finish within its original 180-second manifest limit. Each measured command capped at 180 seconds, 1 GiB sampled aggregate process-group RSS, 2 MiB output; all local full scientific runs cumulative <=900 seconds; serialize full runs with one lock.", + "No timeout increase, sampling, omitted events or skipped reference checks, source/expected-result repair, source/backend optimization, new kappa research or automatic successor task." + ], + "limitations": [ + "Same-agent assisted code review and different-host replay are not independent human or formal-kernel acceptance.", + "Local host not reserved, OS caches unflushed; fresh processes do not mean cold OS cache.", + "Original source extracts nested scratch writable; frozen archive and outer official package export are independently authenticated and unchanged, without claiming new immutable nested scratch enforcement." + ] +} diff --git a/research/p104-integer-linux-validation/evidence/SOURCE-BINDINGS.json b/research/p104-integer-linux-validation/evidence/SOURCE-BINDINGS.json new file mode 100644 index 0000000000..d4067107f7 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/SOURCE-BINDINGS.json @@ -0,0 +1,47 @@ +{ + "files": [ + { + "path": "certificates/selected-result.json", + "pin": "de5ec2e7a6074068452f45b1a191b5c72832df4a:certificates/selected-result.json", + "sha256": "2a0220e866417774606e0f991e41b9c1d26b1f43b97857238cf478dbc7d330b5", + "bytes": 6419 + }, + { + "path": "docs/research/agent-task-catalog.json", + "pin": "de5ec2e7a6074068452f45b1a191b5c72832df4a:docs/research/agent-task-catalog.json", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81", + "bytes": 82822 + }, + { + "path": "research/p104-integer-error-replay/inputs/source.tar", + "pin": "55394bd623bc9db68ac5d49999481185ba9b82dd:research/p104-integer-error-replay/inputs/source.tar", + "sha256": "f8252a90dc504ce8a77d781e558691fe8d21014b0f3f720d8dfd5274b5e8aadc", + "bytes": 327680 + }, + { + "path": "research/p104-noisy-copy-reset/SOURCES.json", + "pin": "58f93cf41751920f3d6766a39caccc2974ce18b0:research/p104-noisy-copy-reset/SOURCES.json", + "sha256": "da233c5ea2b28a58d6026cebbd266ea373716afd11b2013f655265d536b8b787", + "bytes": 5023 + }, + { + "path": "research/p104-noisy-copy-reset/VERIFY.json", + "pin": "58f93cf41751920f3d6766a39caccc2974ce18b0:research/p104-noisy-copy-reset/VERIFY.json", + "sha256": "b84a00c78d77b82e87050516ef19199fc30a5bae50846f588e09dd5f2a5ed52d", + "bytes": 720 + }, + { + "path": "research/p104-noisy-copy-reset/RESULT.json", + "pin": "58f93cf41751920f3d6766a39caccc2974ce18b0:research/p104-noisy-copy-reset/RESULT.json", + "sha256": "ac7f1922f777667f51bf666538eb36bdca97f55cb0313210c60ffe29fef77cd2", + "bytes": 121740 + }, + { + "path": "research/p104-noisy-copy-reset/verify.py", + "pin": "58f93cf41751920f3d6766a39caccc2974ce18b0:research/p104-noisy-copy-reset/verify.py", + "sha256": "4896c85513f0e15e96fdcb9df9245055bf252dc6be99be5e2a037420a795bb34", + "bytes": 7047 + } + ], + "initial_sparse_check": "Unavailable provenance commit/blob objects were fetched before claiming metadata success; no scientific execution or source repair occurred." +} diff --git a/research/p104-integer-linux-validation/evidence/SOURCE-METADATA.txt b/research/p104-integer-linux-validation/evidence/SOURCE-METADATA.txt new file mode 100644 index 0000000000..a6c9fb298a --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/SOURCE-METADATA.txt @@ -0,0 +1 @@ +PASS_PACKAGE_METADATA_AND_PINS (not a mathematical acceptance check) diff --git a/research/p104-integer-linux-validation/evidence/SOURCE-SPARSE-NOTE.txt b/research/p104-integer-linux-validation/evidence/SOURCE-SPARSE-NOTE.txt new file mode 100644 index 0000000000..e76ab3847d --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/SOURCE-SPARSE-NOTE.txt @@ -0,0 +1 @@ +Initial metadata checks could not resolve frozen original provenance commits/blobs in the shallow checkout. Both declared commits and exact source blobs were fetched, all seven hashes verified, and unchanged source metadata then passed. No scientific command ran on an incomplete source closure and no manifest/source/timeout was weakened. Full-history preflight remains unavailable; only exact bindings and later immediate own-input ancestry are claimed. diff --git a/research/p104-integer-linux-validation/evidence/qualification-normal/SCIENTIFIC.json b/research/p104-integer-linux-validation/evidence/qualification-normal/SCIENTIFIC.json new file mode 100644 index 0000000000..1952424ccc --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-normal/SCIENTIFIC.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-integer-linux-validation/evidence/qualification-normal/receipt.json b/research/p104-integer-linux-validation/evidence/qualification-normal/receipt.json new file mode 100644 index 0000000000..f76f7ebd7c --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-normal/receipt.json @@ -0,0 +1,27 @@ +{ + "exit": 0, + "label": "qualification-normal", + "optimized": false, + "original_local_receipt_sha256": "3c122b660710e878ec3f03127b5fba114671ced6a1ef64d3c3f9893ecaa1577e", + "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": "0d31f04f500a81de8fb8653ddb5eda8a6b9d37dec9a0b6e666a1fe648d8d3e78", + "runtime_policy_sha256": "b1e0a2d26463f44264166e993d69b334687eb9277142f7640c6891912befed25", + "sampled_process_group_rss_bytes": 107540480, + "script": "verify.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "88379652129d6c954032c0db309899c6d871f92215222e2c6ee3eb3dce5118a5", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 490, + "stdout_sha256": "d31b2d05aade4a7df0abaf0b51f78c9ff3b4c742b8a5e31f8e77a1c4db39d8ba", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 103568, + "system_seconds": 0.1, + "user_seconds": 60.27 + }, + "wall_seconds": 60.46646667202003 +} diff --git a/research/p104-integer-linux-validation/evidence/qualification-normal/stderr.txt b/research/p104-integer-linux-validation/evidence/qualification-normal/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-integer-linux-validation/evidence/qualification-normal/stdout.txt b/research/p104-integer-linux-validation/evidence/qualification-normal/stdout.txt new file mode 100644 index 0000000000..e9737d582f --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-normal/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.186138} diff --git a/research/p104-integer-linux-validation/evidence/qualification-normal/usage.json b/research/p104-integer-linux-validation/evidence/qualification-normal/usage.json new file mode 100644 index 0000000000..fba458f6bd --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-normal/usage.json @@ -0,0 +1 @@ +{"user_seconds":60.27,"system_seconds":0.10,"kernel_max_rss_kib":103568,"exit":0} diff --git a/research/p104-integer-linux-validation/evidence/qualification-optimized/SCIENTIFIC.json b/research/p104-integer-linux-validation/evidence/qualification-optimized/SCIENTIFIC.json new file mode 100644 index 0000000000..1952424ccc --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-optimized/SCIENTIFIC.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-integer-linux-validation/evidence/qualification-optimized/receipt.json b/research/p104-integer-linux-validation/evidence/qualification-optimized/receipt.json new file mode 100644 index 0000000000..747e848e9b --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-optimized/receipt.json @@ -0,0 +1,27 @@ +{ + "exit": 0, + "label": "qualification-optimized", + "optimized": true, + "original_local_receipt_sha256": "509dade22ef8726f2e4655fbe88473c1e3dda0bb85d8b85b9f3298e53b21f011", + "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": "0d31f04f500a81de8fb8653ddb5eda8a6b9d37dec9a0b6e666a1fe648d8d3e78", + "runtime_policy_sha256": "b1e0a2d26463f44264166e993d69b334687eb9277142f7640c6891912befed25", + "sampled_process_group_rss_bytes": 107126784, + "script": "verify.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "88379652129d6c954032c0db309899c6d871f92215222e2c6ee3eb3dce5118a5", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 490, + "stdout_sha256": "86225d1b4b1667db1b8dbb356e601583ea8b6270304d0a3fc88f967ed5fb29b4", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 103164, + "system_seconds": 0.11, + "user_seconds": 63.35 + }, + "wall_seconds": 63.859208991983905 +} diff --git a/research/p104-integer-linux-validation/evidence/qualification-optimized/stderr.txt b/research/p104-integer-linux-validation/evidence/qualification-optimized/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-integer-linux-validation/evidence/qualification-optimized/stdout.txt b/research/p104-integer-linux-validation/evidence/qualification-optimized/stdout.txt new file mode 100644 index 0000000000..d9bed0332d --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-optimized/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": 63.604694} diff --git a/research/p104-integer-linux-validation/evidence/qualification-optimized/usage.json b/research/p104-integer-linux-validation/evidence/qualification-optimized/usage.json new file mode 100644 index 0000000000..727a2197d4 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-optimized/usage.json @@ -0,0 +1 @@ +{"user_seconds":63.35,"system_seconds":0.11,"kernel_max_rss_kib":103164,"exit":0} diff --git a/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/SCIENTIFIC.json b/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/SCIENTIFIC.json new file mode 100644 index 0000000000..1952424ccc --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/SCIENTIFIC.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-integer-linux-validation/evidence/qualification-sealed-absolute/receipt.json b/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/receipt.json new file mode 100644 index 0000000000..309e03bff0 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/receipt.json @@ -0,0 +1,27 @@ +{ + "exit": 0, + "label": "qualification-sealed-absolute", + "optimized": true, + "original_local_receipt_sha256": "ec3e6f6eb331f1c8c285115371dbb34105b2ca47167c78ea2bfa81589b139ae9", + "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": "0d31f04f500a81de8fb8653ddb5eda8a6b9d37dec9a0b6e666a1fe648d8d3e78", + "runtime_policy_sha256": "b1e0a2d26463f44264166e993d69b334687eb9277142f7640c6891912befed25", + "sampled_process_group_rss_bytes": 107384832, + "script": "[local absolute script path removed]/sealed-driver.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "88379652129d6c954032c0db309899c6d871f92215222e2c6ee3eb3dce5118a5", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 490, + "stdout_sha256": "514623e3263ee41457e9ba4c323500a46ef4a3d38685ad5950b8ab602f498790", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 103416, + "system_seconds": 0.12, + "user_seconds": 60.08 + }, + "wall_seconds": 60.26154273899738 +} diff --git a/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/stderr.txt b/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/stdout.txt b/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/stdout.txt new file mode 100644 index 0000000000..51891f665f --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/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": 59.879463} diff --git a/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/usage.json b/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/usage.json new file mode 100644 index 0000000000..02f02efd23 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-sealed-absolute/usage.json @@ -0,0 +1 @@ +{"user_seconds":60.08,"system_seconds":0.12,"kernel_max_rss_kib":103416,"exit":0} diff --git a/research/p104-integer-linux-validation/evidence/qualification-sealed/receipt.json b/research/p104-integer-linux-validation/evidence/qualification-sealed/receipt.json new file mode 100644 index 0000000000..9509b95b36 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-sealed/receipt.json @@ -0,0 +1,27 @@ +{ + "exit": 2, + "label": "qualification-sealed", + "optimized": true, + "original_local_receipt_sha256": "3230a6e576a9261b4be12ab165d16c3dc67097a904b4d8f8412e1c3b087650c4", + "original_local_stderr_sha256": "d33f3653c05ac225e23ac36e6b4974db94906dce6158fe5ab8e4944edd7a8994", + "platform": "Linux-7.0.0-38-generic-x86_64-with-glibc2.39", + "public_stderr_sha256": "d208b8eaa320565d28a6f7565aa4f72ee9b3dff1a04ebd8af6bee9cbab795836", + "python": "3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]", + "runner_sha256": "0d31f04f500a81de8fb8653ddb5eda8a6b9d37dec9a0b6e666a1fe648d8d3e78", + "runtime_policy_sha256": "b1e0a2d26463f44264166e993d69b334687eb9277142f7640c6891912befed25", + "sampled_process_group_rss_bytes": 15642624, + "script": "outputs/precision-linux-validation-20261027/sealed-driver.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "88379652129d6c954032c0db309899c6d871f92215222e2c6ee3eb3dce5118a5", + "status": "STOP", + "stderr_bytes": 302, + "stderr_redaction": "Only local absolute workspace prefix replaced; scientific stdout unchanged.", + "stderr_sha256": "d33f3653c05ac225e23ac36e6b4974db94906dce6158fe5ab8e4944edd7a8994", + "stdout_bytes": 0, + "stdout_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "termination": null, + "usage": { + "raw": "Command exited with non-zero status 2\n{\"user_seconds\":0.04,\"system_seconds\":0.00,\"kernel_max_rss_kib\":14272,\"exit\":2}\n" + }, + "wall_seconds": 0.10237605599104427 +} diff --git a/research/p104-integer-linux-validation/evidence/qualification-sealed/stderr.txt b/research/p104-integer-linux-validation/evidence/qualification-sealed/stderr.txt new file mode 100644 index 0000000000..d2ed4f8e0f --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-sealed/stderr.txt @@ -0,0 +1 @@ +/usr/bin/python3.12: can't open file '[workspace]/outputs/precision-linux-validation-20261027/repo/research/p104-integer-linux-validation/outputs/precision-linux-validation-20261027/sealed-driver.py': [Errno 2] No such file or directory diff --git a/research/p104-integer-linux-validation/evidence/qualification-sealed/stdout.txt b/research/p104-integer-linux-validation/evidence/qualification-sealed/stdout.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-integer-linux-validation/evidence/qualification-sealed/usage.json b/research/p104-integer-linux-validation/evidence/qualification-sealed/usage.json new file mode 100644 index 0000000000..b00633344e --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/qualification-sealed/usage.json @@ -0,0 +1,2 @@ +Command exited with non-zero status 2 +{"user_seconds":0.04,"system_seconds":0.00,"kernel_max_rss_kib":14272,"exit":2} diff --git a/research/p104-integer-linux-validation/evidence/sample-1-baseline/receipt.json b/research/p104-integer-linux-validation/evidence/sample-1-baseline/receipt.json new file mode 100644 index 0000000000..f63613aed4 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-1-baseline/receipt.json @@ -0,0 +1,27 @@ +{ + "exit": 0, + "label": "sample-1-baseline", + "optimized": false, + "original_local_receipt_sha256": "001a11db4c0c8691087d2d74d0f3155543fe2def25416ddb89d5d341d6367b1d", + "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": "0d31f04f500a81de8fb8653ddb5eda8a6b9d37dec9a0b6e666a1fe648d8d3e78", + "runtime_policy_sha256": "b1e0a2d26463f44264166e993d69b334687eb9277142f7640c6891912befed25", + "sampled_process_group_rss_bytes": 105431040, + "script": "baseline.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "88379652129d6c954032c0db309899c6d871f92215222e2c6ee3eb3dce5118a5", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 291, + "stdout_sha256": "ee8600c5a6cfa56d0ae1490fcf6b4baa867279f44111193223918b1030e6e19f", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 101508, + "system_seconds": 0.09, + "user_seconds": 28.58 + }, + "wall_seconds": 28.715565735998098 +} diff --git a/research/p104-integer-linux-validation/evidence/sample-1-baseline/stderr.txt b/research/p104-integer-linux-validation/evidence/sample-1-baseline/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-integer-linux-validation/evidence/sample-1-baseline/stdout.txt b/research/p104-integer-linux-validation/evidence/sample-1-baseline/stdout.txt new file mode 100644 index 0000000000..ce75c99b18 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-1-baseline/stdout.txt @@ -0,0 +1,2 @@ +PASS_P104_INTEGER_ERROR_REPLAY +{"mode": "baseline", "receipt": {"coordinates": 799, "events": 25984, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 28.448774} diff --git a/research/p104-integer-linux-validation/evidence/sample-1-baseline/usage.json b/research/p104-integer-linux-validation/evidence/sample-1-baseline/usage.json new file mode 100644 index 0000000000..e88640cf4a --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-1-baseline/usage.json @@ -0,0 +1 @@ +{"user_seconds":28.58,"system_seconds":0.09,"kernel_max_rss_kib":101508,"exit":0} diff --git a/research/p104-integer-linux-validation/evidence/sample-2-candidate/receipt.json b/research/p104-integer-linux-validation/evidence/sample-2-candidate/receipt.json new file mode 100644 index 0000000000..7e0451db69 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-2-candidate/receipt.json @@ -0,0 +1,27 @@ +{ + "exit": 0, + "label": "sample-2-candidate", + "optimized": false, + "original_local_receipt_sha256": "fe38d8d911b830a2b86c4cd0ee28271d9a7395ead58f487b67bc8a654da10d2b", + "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": "0d31f04f500a81de8fb8653ddb5eda8a6b9d37dec9a0b6e666a1fe648d8d3e78", + "runtime_policy_sha256": "b1e0a2d26463f44264166e993d69b334687eb9277142f7640c6891912befed25", + "sampled_process_group_rss_bytes": 104448000, + "script": "candidate.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "88379652129d6c954032c0db309899c6d871f92215222e2c6ee3eb3dce5118a5", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 290, + "stdout_sha256": "578668cb78b54bea58f5db8b162909d0d6ebd348c8ad1c444c3df39521294194", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 100548, + "system_seconds": 0.05, + "user_seconds": 6.3 + }, + "wall_seconds": 6.385658305982361 +} diff --git a/research/p104-integer-linux-validation/evidence/sample-2-candidate/stderr.txt b/research/p104-integer-linux-validation/evidence/sample-2-candidate/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-integer-linux-validation/evidence/sample-2-candidate/stdout.txt b/research/p104-integer-linux-validation/evidence/sample-2-candidate/stdout.txt new file mode 100644 index 0000000000..f15dbc443e --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-2-candidate/stdout.txt @@ -0,0 +1,2 @@ +PASS_P104_INTEGER_ERROR_REPLAY +{"mode": "candidate", "receipt": {"coordinates": 799, "events": 25984, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 6.11869} diff --git a/research/p104-integer-linux-validation/evidence/sample-2-candidate/usage.json b/research/p104-integer-linux-validation/evidence/sample-2-candidate/usage.json new file mode 100644 index 0000000000..77b267528c --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-2-candidate/usage.json @@ -0,0 +1 @@ +{"user_seconds":6.30,"system_seconds":0.05,"kernel_max_rss_kib":100548,"exit":0} diff --git a/research/p104-integer-linux-validation/evidence/sample-3-candidate/receipt.json b/research/p104-integer-linux-validation/evidence/sample-3-candidate/receipt.json new file mode 100644 index 0000000000..ed2650a73b --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-3-candidate/receipt.json @@ -0,0 +1,27 @@ +{ + "exit": 0, + "label": "sample-3-candidate", + "optimized": false, + "original_local_receipt_sha256": "bf2978ced2b6cfba05a39c0d4ca0566fc70eba5c2f68a4ca690185c8c59461ce", + "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": "0d31f04f500a81de8fb8653ddb5eda8a6b9d37dec9a0b6e666a1fe648d8d3e78", + "runtime_policy_sha256": "b1e0a2d26463f44264166e993d69b334687eb9277142f7640c6891912befed25", + "sampled_process_group_rss_bytes": 104370176, + "script": "candidate.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "88379652129d6c954032c0db309899c6d871f92215222e2c6ee3eb3dce5118a5", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 291, + "stdout_sha256": "1bdd62b27a510ca1effd49a0dc623d296bb2cff20baf65bb51f5b6df74d06973", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 100472, + "system_seconds": 0.05, + "user_seconds": 6.39 + }, + "wall_seconds": 6.488194212986855 +} diff --git a/research/p104-integer-linux-validation/evidence/sample-3-candidate/stderr.txt b/research/p104-integer-linux-validation/evidence/sample-3-candidate/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-integer-linux-validation/evidence/sample-3-candidate/stdout.txt b/research/p104-integer-linux-validation/evidence/sample-3-candidate/stdout.txt new file mode 100644 index 0000000000..1d38769321 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-3-candidate/stdout.txt @@ -0,0 +1,2 @@ +PASS_P104_INTEGER_ERROR_REPLAY +{"mode": "candidate", "receipt": {"coordinates": 799, "events": 25984, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 6.231335} diff --git a/research/p104-integer-linux-validation/evidence/sample-3-candidate/usage.json b/research/p104-integer-linux-validation/evidence/sample-3-candidate/usage.json new file mode 100644 index 0000000000..e306605e10 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-3-candidate/usage.json @@ -0,0 +1 @@ +{"user_seconds":6.39,"system_seconds":0.05,"kernel_max_rss_kib":100472,"exit":0} diff --git a/research/p104-integer-linux-validation/evidence/sample-4-baseline/receipt.json b/research/p104-integer-linux-validation/evidence/sample-4-baseline/receipt.json new file mode 100644 index 0000000000..389a1c47ed --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-4-baseline/receipt.json @@ -0,0 +1,27 @@ +{ + "exit": 0, + "label": "sample-4-baseline", + "optimized": false, + "original_local_receipt_sha256": "ca45ffa4d3acb1d44424b03b1e0771a8fda91fbe3885cb483d4e32bfea3d039e", + "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": "0d31f04f500a81de8fb8653ddb5eda8a6b9d37dec9a0b6e666a1fe648d8d3e78", + "runtime_policy_sha256": "b1e0a2d26463f44264166e993d69b334687eb9277142f7640c6891912befed25", + "sampled_process_group_rss_bytes": 105689088, + "script": "baseline.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "88379652129d6c954032c0db309899c6d871f92215222e2c6ee3eb3dce5118a5", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 291, + "stdout_sha256": "717569a5d82349bf0035efc59c72f8cdb18e3dc4617cb54944e86c9cd3e9e22c", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 101760, + "system_seconds": 0.06, + "user_seconds": 28.24 + }, + "wall_seconds": 28.363380322989542 +} diff --git a/research/p104-integer-linux-validation/evidence/sample-4-baseline/stderr.txt b/research/p104-integer-linux-validation/evidence/sample-4-baseline/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-integer-linux-validation/evidence/sample-4-baseline/stdout.txt b/research/p104-integer-linux-validation/evidence/sample-4-baseline/stdout.txt new file mode 100644 index 0000000000..34e3a2a0f1 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-4-baseline/stdout.txt @@ -0,0 +1,2 @@ +PASS_P104_INTEGER_ERROR_REPLAY +{"mode": "baseline", "receipt": {"coordinates": 799, "events": 25984, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 28.102562} diff --git a/research/p104-integer-linux-validation/evidence/sample-4-baseline/usage.json b/research/p104-integer-linux-validation/evidence/sample-4-baseline/usage.json new file mode 100644 index 0000000000..0a399b17db --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-4-baseline/usage.json @@ -0,0 +1 @@ +{"user_seconds":28.24,"system_seconds":0.06,"kernel_max_rss_kib":101760,"exit":0} diff --git a/research/p104-integer-linux-validation/evidence/sample-5-baseline/receipt.json b/research/p104-integer-linux-validation/evidence/sample-5-baseline/receipt.json new file mode 100644 index 0000000000..dd9c064c77 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-5-baseline/receipt.json @@ -0,0 +1,27 @@ +{ + "exit": 0, + "label": "sample-5-baseline", + "optimized": false, + "original_local_receipt_sha256": "41aff901651d5f838630b85625b8454881923a4e4cf218aedf6b2ed5eca53945", + "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": "0d31f04f500a81de8fb8653ddb5eda8a6b9d37dec9a0b6e666a1fe648d8d3e78", + "runtime_policy_sha256": "b1e0a2d26463f44264166e993d69b334687eb9277142f7640c6891912befed25", + "sampled_process_group_rss_bytes": 105664512, + "script": "baseline.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "88379652129d6c954032c0db309899c6d871f92215222e2c6ee3eb3dce5118a5", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 291, + "stdout_sha256": "cafce08314e828b645e6ed5c24806de3c78bcf42057b90c38c35802e57772746", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 101736, + "system_seconds": 0.06, + "user_seconds": 28.1 + }, + "wall_seconds": 28.216742029995658 +} diff --git a/research/p104-integer-linux-validation/evidence/sample-5-baseline/stderr.txt b/research/p104-integer-linux-validation/evidence/sample-5-baseline/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-integer-linux-validation/evidence/sample-5-baseline/stdout.txt b/research/p104-integer-linux-validation/evidence/sample-5-baseline/stdout.txt new file mode 100644 index 0000000000..4416d27a3c --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-5-baseline/stdout.txt @@ -0,0 +1,2 @@ +PASS_P104_INTEGER_ERROR_REPLAY +{"mode": "baseline", "receipt": {"coordinates": 799, "events": 25984, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 27.952935} diff --git a/research/p104-integer-linux-validation/evidence/sample-5-baseline/usage.json b/research/p104-integer-linux-validation/evidence/sample-5-baseline/usage.json new file mode 100644 index 0000000000..1f648cffb7 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-5-baseline/usage.json @@ -0,0 +1 @@ +{"user_seconds":28.10,"system_seconds":0.06,"kernel_max_rss_kib":101736,"exit":0} diff --git a/research/p104-integer-linux-validation/evidence/sample-6-candidate/receipt.json b/research/p104-integer-linux-validation/evidence/sample-6-candidate/receipt.json new file mode 100644 index 0000000000..a6ff1ee97a --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-6-candidate/receipt.json @@ -0,0 +1,27 @@ +{ + "exit": 0, + "label": "sample-6-candidate", + "optimized": false, + "original_local_receipt_sha256": "82fd7fa16a9cb04a04ec29f00be74c1798c88f2fa7d1541b101f77701f7f7d5a", + "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": "0d31f04f500a81de8fb8653ddb5eda8a6b9d37dec9a0b6e666a1fe648d8d3e78", + "runtime_policy_sha256": "b1e0a2d26463f44264166e993d69b334687eb9277142f7640c6891912befed25", + "sampled_process_group_rss_bytes": 105017344, + "script": "candidate.py", + "source_bytes_and_modes_unchanged": true, + "source_inventory_sha256": "88379652129d6c954032c0db309899c6d871f92215222e2c6ee3eb3dce5118a5", + "status": "PASS", + "stderr_bytes": 0, + "stderr_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "stdout_bytes": 291, + "stdout_sha256": "bb2852ed9fcddcabcb256ad493dba49b192aa2cdf957a17c2a92f2b83409a0f6", + "termination": null, + "usage": { + "exit": 0, + "kernel_max_rss_kib": 101104, + "system_seconds": 0.05, + "user_seconds": 6.38 + }, + "wall_seconds": 6.439653205015929 +} diff --git a/research/p104-integer-linux-validation/evidence/sample-6-candidate/stderr.txt b/research/p104-integer-linux-validation/evidence/sample-6-candidate/stderr.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/research/p104-integer-linux-validation/evidence/sample-6-candidate/stdout.txt b/research/p104-integer-linux-validation/evidence/sample-6-candidate/stdout.txt new file mode 100644 index 0000000000..87ddd6b402 --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-6-candidate/stdout.txt @@ -0,0 +1,2 @@ +PASS_P104_INTEGER_ERROR_REPLAY +{"mode": "candidate", "receipt": {"coordinates": 799, "events": 25984, "guards": {"owned": 22, "prefix": 26, "public": 23}, "source_controls": 6, "source_result_sha256": "cc7739703ed23532d187949c8507d09c13ac4c152e07a930f0087cde0d7a3d98"}, "seconds": 6.203333} diff --git a/research/p104-integer-linux-validation/evidence/sample-6-candidate/usage.json b/research/p104-integer-linux-validation/evidence/sample-6-candidate/usage.json new file mode 100644 index 0000000000..0a919d3e4d --- /dev/null +++ b/research/p104-integer-linux-validation/evidence/sample-6-candidate/usage.json @@ -0,0 +1 @@ +{"user_seconds":6.38,"system_seconds":0.05,"kernel_max_rss_kib":101104,"exit":0} diff --git a/research/p104-integer-linux-validation/guard.py b/research/p104-integer-linux-validation/guard.py new file mode 100644 index 0000000000..3d40e2237d --- /dev/null +++ b/research/p104-integer-linux-validation/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','replay.py','baseline.py','candidate.py','verify.py','guard.py','benchmark.py','inputs/PR5831.tar') +TIMEOUT = 180 +RSS_CAP = 1024**3 +OUTPUT_CAP = 2*1024**2 +AGGREGATE = 900 + +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-integer-linux-validation/inputs/PR5831.tar b/research/p104-integer-linux-validation/inputs/PR5831.tar new file mode 100644 index 0000000000..eddee1f6a9 Binary files /dev/null and b/research/p104-integer-linux-validation/inputs/PR5831.tar differ diff --git a/research/p104-integer-linux-validation/replay.py b/research/p104-integer-linux-validation/replay.py new file mode 100644 index 0000000000..aeb9296816 --- /dev/null +++ b/research/p104-integer-linux-validation/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-integer-linux-validation/source.py b/research/p104-integer-linux-validation/source.py new file mode 100644 index 0000000000..6e1f036ed0 --- /dev/null +++ b/research/p104-integer-linux-validation/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-integer-linux-validation/verify.py b/research/p104-integer-linux-validation/verify.py new file mode 100644 index 0000000000..e9a585e279 --- /dev/null +++ b/research/p104-integer-linux-validation/verify.py @@ -0,0 +1,9 @@ +"""Complete unchanged PR5831 qualify command.""" +import sys +from replay import main +from source import require + +if __name__ == '__main__': + require(len(sys.argv) == 1, 'No wrapper arguments') + sys.argv = [sys.argv[0], '--qualify'] + 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)