diff --git a/docs/ci-verification.md b/docs/ci-verification.md index 63ba3e9aa8..52b62d0481 100644 --- a/docs/ci-verification.md +++ b/docs/ci-verification.md @@ -1,8 +1,25 @@ # CI verification -## Current selected-family replay: #6030 +## Current selected-family replay: #7000 with #7001 The [selected record](../certificates/selected-result.json) binds conditional +κ = 0.00363005817 to the [application review](research/pr-intake-evidence/pr7000-application/PROOF-REVIEW.md), +[validation receipts](research/pr-intake-evidence/pr7000-application/VALIDATION.json), +and [explicit source closure](../certificates/frontier7000-source.json). +`make frontier7000-verify` follows that exact-source selected replay. The review +reuses eleven authenticated preceding executions and records seven fresh serial +application, scalar and complete native-catalogue executions. The earlier +monolithic timeout is retained separately and is not completed coverage. +Consult the receipts for exact commands, source heads and limits. + +The five inherited framework assumptions remain. No complete uniform word, +literal multiplier execution, independent human proof or formal-kernel proof +is asserted. Routine research submissions do not need to rerun this +selected-family replay. The sections below preserve historical checkpoints. + +## Historical selected-family replay: #6030 + +The [historical checkpoint](../certificates/checkpoints/frontier6030.json) binds conditional κ = 0.003125804 to the [proof review](research/pr-intake-evidence/pr6030-audit/PROOF-REVIEW.md), [validation receipts](research/pr-intake-evidence/pr6030-audit/VALIDATION.json), and [explicit source closure](../certificates/frontier6030-source.json). diff --git a/research/bit-local-query-rank-bound/PROOF.md b/research/bit-local-query-rank-bound/PROOF.md new file mode 100644 index 0000000000..cc097587fe --- /dev/null +++ b/research/bit-local-query-rank-bound/PROOF.md @@ -0,0 +1,107 @@ +# Four QUERYs with retained BIT LOCAL stage incidence + +The pinned selected paired #7001 caller has 38 scalar roles per +port pair, 111 replicated port pairs, 18 independent body +variables and two real LOCAL calls per stage. Its exact target is +diagonal with head factor $q$ on every role. Keep those 36 +LOCAL occurrences and that target. Allow arbitrary placement +and constant conjugation of the LOCAL, QUERY and IDLE factors, +including a fixed ambient space of auxiliary roles initialized and +returned to zero. Constant gates are invertible. The scope retains each LOCAL's original stage assignment and its +literal two-dimensional body contribution and rank-one head +transvection. [Pinned #7001 source](https://github.com/CrocSwap/integer-mult-bounds/tree/e54523517d0f03e58352e647c403a5af3e525a57/research/paired-query-only-bit) + +## Independent stage derivatives + +Work over F₂ and write $q=1+\epsilon$ with $\epsilon^2=0$. +Differentiate each body variable $z_s$ independently at all +$z_s=1,q=1$. Normalize every event by its value at this base +and conjugate by the accumulated constant prefix. The resulting +normalized factors all have constant term the identity. + +At stage s each normalized LOCAL gives a rank-two projector P +in the body derivative and a rank-one square-zero map N in the +head derivative. Its original two local coordinates imply +$PN=NP=N$, and conjugation preserves that identity. An IDLE +serving s gives a rank-one projector. The sum of serving +projectors equals the exact diagonal target projector E_s on the +public input space A. The retained serving ranks sum to +$\operatorname{rank} E_s$ for every stage, as checked on the +actual word. + +This saturation holds with clean helpers too. The full body +derivative has rank at least $\operatorname{rank} E_s$ from +its restriction to A and at most the sum of serving ranks. +Thus the images of the serving projectors are a direct sum +whose sum is exactly $\operatorname{im} E_s\subseteq A$. +On each serving image E_s acts as the identity. Uniqueness in +the direct sum implies that all other serving projectors kill +that image. In particular the two normalized same-stage LOCAL +defects annihilate each other. This argument allows the LOCALs +to be separated by arbitrary constant operations, other stages +or QUERYs. + +## Head rank + +On A the normalized head derivative is the identity of rank +38. Write its rank-one decomposition as UV, using the 36 LOCAL +defects and r QUERY slots. For clean auxiliary roles, compress +each QUERY defect to input and output A. Its rank is at most +one. The LOCAL terms have image in A, and their reciprocal +pairings and self-pairings stay zero under compression. The +base whole word is the identity on A, so removing its constant +factor does not change these public derivatives. + +From $UV=I_{38}$, the matrix $I-VU$ has rank +$36+r-38$. On the two same-stage LOCAL indices it has a +principal $2\times2$ identity minor. Thus its rank is at +least two, so $r\ge4$. This does not require a trace or +diagonal condition on compressed QUERYs. The argument extends +the dual-number method from a fixed central cut to independent +body stages and arbitrary placement. +[Related dual-number scopes](https://github.com/CrocSwap/integer-mult-bounds/pull/6825), +[Related rank method](https://github.com/CrocSwap/integer-mult-bounds/pull/6800) + +## Arbitrary idle masks with extra incidence + +Retain the same 36 LOCALs and target. At each stage the IDLE +incidence cannot fall below the original required value, because +the rank of the stage derivative is at most the sum of serving +ranks. If every incidence stays equal, the rank argument above +applies. Otherwise at least one stage has an extra incidence. + +For a required incidence vector $a_s$, form nested masks +$S_j=\{s:a_s\ge j\}$. The sum of the k largest mask lengths +in any realization is at most $\sum_s\min(k,a_s)$, which +the nested masks attain for every k. Thus their sizes majorize +every realization. Concavity of $r^{1-\kappa}$ makes the +nested assignment cheapest even when granting unrestricted +cross-stage mask grouping. The minimum is nondecreasing in +each required incidence. + +At $\kappa=.0040075385047236$, all 18 directed profiles +with one extra incidence cost more than four paid units per +port above the original IDLE bill. The least is about +4.08432343047. Deleting every QUERY would rebate only four +per port. Thus an extra body incidence cannot make this +lower-QUERY proposal price-positive, even with all packing +and realization barriers waived. This concerns the retained +LOCAL count and stage assignment, and the original rank-one QUERY and body-only IDLE charging rules. +An IDLE mask contains distinct stages and pays rank seven per stage. +Combined higher-rank QUERYs, altered IDLE operators and interfaces +that erase live auxiliary data are outside this scope. + +The independent replay checks 1,444 original polynomial +coefficients, all 18 stage derivatives, and the head rank. +Changing one QUERY to a constant ADD keeps the base and body +derivatives but changes the head derivative by rank one. +Omitting one IDLE stage changes just that stage derivative by +rank one. A two-helper padding control uses the added lanes +inside a LOCAL and a QUERY and preserves all ranks. No caller +with a smaller paid bill was built. + +Run with CPython 3.12 and assertions enabled from the repository root. + +```sh +python3.12 -I -B research/bit-local-query-rank-bound/verify.py +``` diff --git a/research/bit-local-query-rank-bound/README.md b/research/bit-local-query-rank-bound/README.md new file mode 100644 index 0000000000..8a80cabf0e --- /dev/null +++ b/research/bit-local-query-rank-bound/README.md @@ -0,0 +1,50 @@ +# BIT QUERY rank with 36 LOCAL calls + +**NO VERIFIED GAIN.** Retaining the selected #7001 paired caller's 36 +LOCAL stage assignments and exact 38-role endpoint requires at least four +paid rank-one QUERY terms at the original stage incidence. The proof +allows arbitrary constant bases and chronology, including initialized-clean +helpers returned to zero. Granting arbitrary IDLE masks with extra +incidence still cannot pay for reducing QUERY rank at the moonshot target. +[Proof](PROOF.md) · [Exact receipt](RECEIPT.json) + +## Replay + +From a clean checkout, run with CPython 3.12 and assertions enabled. + +```sh +python3.12 -B scripts/research_package.py --package research/bit-local-query-rank-bound +``` + +The replay authenticates three canonical paths, checks 1,444 original +polynomial coefficients and 18 independent stage derivatives, and prices +the 18 possible added stage incidences. It verifies a clean-helper padding +control and detects dropped QUERY and body terms. + +## Scope and credit + +This proof concerns the existing LOCAL and IDLE tariff on the paired caller. +It leaves changed LOCAL counts, native body rank, endpoint contracts and +complete BIT/complex composition open. The strongest comparable κ remains +0.003644407895539 on [#7156](https://github.com/CrocSwap/integer-mult-bounds/pull/7156). + +DreamingOfClouds supplied the chain-root BIT and empty-root-free lineage, +CubeJerry the #6980 QUERY-only replacement, and zxv and the retained +authors the #6726 native BIT lineage. The #7001 paired specialization +supplies the literal controller. Credit Nick Petalas's +[#6800](https://github.com/CrocSwap/integer-mult-bounds/pull/6800) rank method +and [#6825](https://github.com/CrocSwap/integer-mult-bounds/pull/6825) for +dual-number clean-column analysis of a different endpoint. The fixed-window +[#6984](https://github.com/CrocSwap/integer-mult-bounds/pull/6984) +audit specializes the body variable, while this result uses all 18 +independent body derivatives. Codex and subagents materially assisted the +proof and replay. Apache-2.0. + +## Open next questions + +Retire one actual LOCAL and replace its head action by a QUERY and its body +action by two stage incidences. The direct replacement adds paid moment. +Can the two new incidences be paid for by changing the existing IDLE slots +and preserving the complete polynomial endpoint? Start by determining +which slots' normalized rank-one projectors can serve each stage. Reprice +every new slot and incidence before building a caller. diff --git a/research/bit-local-query-rank-bound/RECEIPT.json b/research/bit-local-query-rank-bound/RECEIPT.json new file mode 100644 index 0000000000..08d2718401 --- /dev/null +++ b/research/bit-local-query-rank-bound/RECEIPT.json @@ -0,0 +1,678 @@ +{ + "baseline": { + "compressed_q_defect_rank": 2, + "dimension": 38, + "q_target_delta_rank": 0, + "q_terms": 40, + "stage_controls": [ + { + "body_incidence": 4, + "local_defect_minor_rank": 2, + "local_events": [ + 4, + 5 + ], + "rank": 4, + "stage": 1 + }, + { + "body_incidence": 6, + "local_defect_minor_rank": 2, + "local_events": [ + 16, + 17 + ], + "rank": 6, + "stage": 2 + }, + { + "body_incidence": 8, + "local_defect_minor_rank": 2, + "local_events": [ + 28, + 29 + ], + "rank": 8, + "stage": 3 + }, + { + "body_incidence": 10, + "local_defect_minor_rank": 2, + "local_events": [ + 40, + 41 + ], + "rank": 10, + "stage": 4 + }, + { + "body_incidence": 12, + "local_defect_minor_rank": 2, + "local_events": [ + 52, + 53 + ], + "rank": 12, + "stage": 5 + }, + { + "body_incidence": 14, + "local_defect_minor_rank": 2, + "local_events": [ + 64, + 65 + ], + "rank": 14, + "stage": 6 + }, + { + "body_incidence": 16, + "local_defect_minor_rank": 2, + "local_events": [ + 76, + 77 + ], + "rank": 16, + "stage": 7 + }, + { + "body_incidence": 18, + "local_defect_minor_rank": 2, + "local_events": [ + 88, + 89 + ], + "rank": 18, + "stage": 8 + }, + { + "body_incidence": 20, + "local_defect_minor_rank": 2, + "local_events": [ + 100, + 101 + ], + "rank": 20, + "stage": 9 + }, + { + "body_incidence": 20, + "local_defect_minor_rank": 2, + "local_events": [ + 394, + 395 + ], + "rank": 20, + "stage": 10 + }, + { + "body_incidence": 18, + "local_defect_minor_rank": 2, + "local_events": [ + 452, + 453 + ], + "rank": 18, + "stage": 11 + }, + { + "body_incidence": 16, + "local_defect_minor_rank": 2, + "local_events": [ + 496, + 497 + ], + "rank": 16, + "stage": 12 + }, + { + "body_incidence": 14, + "local_defect_minor_rank": 2, + "local_events": [ + 540, + 541 + ], + "rank": 14, + "stage": 13 + }, + { + "body_incidence": 12, + "local_defect_minor_rank": 2, + "local_events": [ + 584, + 585 + ], + "rank": 12, + "stage": 14 + }, + { + "body_incidence": 10, + "local_defect_minor_rank": 2, + "local_events": [ + 628, + 629 + ], + "rank": 10, + "stage": 15 + }, + { + "body_incidence": 8, + "local_defect_minor_rank": 2, + "local_events": [ + 672, + 673 + ], + "rank": 8, + "stage": 16 + }, + { + "body_incidence": 6, + "local_defect_minor_rank": 2, + "local_events": [ + 716, + 717 + ], + "rank": 6, + "stage": 17 + }, + { + "body_incidence": 4, + "local_defect_minor_rank": 2, + "local_events": [ + 760, + 761 + ], + "rank": 4, + "stage": 18 + } + ], + "stage_failures": [] + }, + "body_incidence_control": [ + [ + 2, + 1 + ] + ], + "dependencies": { + "EFREE-CALLER.json.gz": "757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b", + "check.py": "460ed9a77d66264b00c31d0a7f8dab1db9aab21ec4cc0eaf0452bd4be4ef585e", + "retained/inputs/independent_interval.py": "9293f567aa4afd9b4e618f1cddd3cf66eea51c5e194e3c578e7a8f4db6e04a57" + }, + "exact_original_polynomial_coefficients": 1444, + "helper_padding_control": { + "dimension": 40, + "q_defect_rank": 2, + "stage_checks": 18 + }, + "price": { + "maximum_query_rebate_per_port": 4, + "minimum_extra_incidence_profiles": [ + { + "added_paid_per_port": { + "lower": "4.0843234304737608871435", + "upper": "4.0843234304737608871436" + }, + "nested_ranks": [ + 119, + 112, + 98, + 98, + 84, + 84, + 70, + 70, + 56, + 56, + 42, + 42, + 28, + 28, + 14, + 14 + ], + "stage": 1 + }, + { + "added_paid_per_port": { + "lower": "4.0878677509869016352115", + "upper": "4.0878677509869016352116" + }, + "nested_ranks": [ + 112, + 112, + 105, + 98, + 84, + 84, + 70, + 70, + 56, + 56, + 42, + 42, + 28, + 28, + 14, + 14 + ], + "stage": 2 + }, + { + "added_paid_per_port": { + "lower": "4.0919416865354714725684", + "upper": "4.0919416865354714725685" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 91, + 84, + 70, + 70, + 56, + 56, + 42, + 42, + 28, + 28, + 14, + 14 + ], + "stage": 3 + }, + { + "added_paid_per_port": { + "lower": "4.0967314084347724612675", + "upper": "4.0967314084347724612676" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 84, + 84, + 77, + 70, + 56, + 56, + 42, + 42, + 28, + 28, + 14, + 14 + ], + "stage": 4 + }, + { + "added_paid_per_port": { + "lower": "4.1025426131848247868338", + "upper": "4.1025426131848247868339" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 84, + 84, + 70, + 70, + 63, + 56, + 42, + 42, + 28, + 28, + 14, + 14 + ], + "stage": 5 + }, + { + "added_paid_per_port": { + "lower": "4.1099315936787320561196", + "upper": "4.1099315936787320561197" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 84, + 84, + 70, + 70, + 56, + 56, + 49, + 42, + 28, + 28, + 14, + 14 + ], + "stage": 6 + }, + { + "added_paid_per_port": { + "lower": "4.1200872608316637776275", + "upper": "4.1200872608316637776276" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 84, + 84, + 70, + 70, + 56, + 56, + 42, + 42, + 35, + 28, + 14, + 14 + ], + "stage": 7 + }, + { + "added_paid_per_port": { + "lower": "4.1364338266581621010751", + "upper": "4.1364338266581621010752" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 84, + 84, + 70, + 70, + 56, + 56, + 42, + 42, + 28, + 28, + 21, + 14 + ], + "stage": 8 + }, + { + "added_paid_per_port": { + "lower": "4.1894375567981535724383", + "upper": "4.1894375567981535724384" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 84, + 84, + 70, + 70, + 56, + 56, + 42, + 42, + 28, + 28, + 14, + 14, + 7 + ], + "stage": 9 + }, + { + "added_paid_per_port": { + "lower": "4.1894375567981535724383", + "upper": "4.1894375567981535724384" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 84, + 84, + 70, + 70, + 56, + 56, + 42, + 42, + 28, + 28, + 14, + 14, + 7 + ], + "stage": 10 + }, + { + "added_paid_per_port": { + "lower": "4.1364338266581621010751", + "upper": "4.1364338266581621010752" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 84, + 84, + 70, + 70, + 56, + 56, + 42, + 42, + 28, + 28, + 21, + 14 + ], + "stage": 11 + }, + { + "added_paid_per_port": { + "lower": "4.1200872608316637776275", + "upper": "4.1200872608316637776276" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 84, + 84, + 70, + 70, + 56, + 56, + 42, + 42, + 35, + 28, + 14, + 14 + ], + "stage": 12 + }, + { + "added_paid_per_port": { + "lower": "4.1099315936787320561196", + "upper": "4.1099315936787320561197" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 84, + 84, + 70, + 70, + 56, + 56, + 49, + 42, + 28, + 28, + 14, + 14 + ], + "stage": 13 + }, + { + "added_paid_per_port": { + "lower": "4.1025426131848247868338", + "upper": "4.1025426131848247868339" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 84, + 84, + 70, + 70, + 63, + 56, + 42, + 42, + 28, + 28, + 14, + 14 + ], + "stage": 14 + }, + { + "added_paid_per_port": { + "lower": "4.0967314084347724612675", + "upper": "4.0967314084347724612676" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 84, + 84, + 77, + 70, + 56, + 56, + 42, + 42, + 28, + 28, + 14, + 14 + ], + "stage": 15 + }, + { + "added_paid_per_port": { + "lower": "4.0919416865354714725684", + "upper": "4.0919416865354714725685" + }, + "nested_ranks": [ + 112, + 112, + 98, + 98, + 91, + 84, + 70, + 70, + 56, + 56, + 42, + 42, + 28, + 28, + 14, + 14 + ], + "stage": 16 + }, + { + "added_paid_per_port": { + "lower": "4.0878677509869016352115", + "upper": "4.0878677509869016352116" + }, + "nested_ranks": [ + 112, + 112, + 105, + 98, + 84, + 84, + 70, + 70, + 56, + 56, + 42, + 42, + 28, + 28, + 14, + 14 + ], + "stage": 17 + }, + { + "added_paid_per_port": { + "lower": "4.0843234304737608871435", + "upper": "4.0843234304737608871436" + }, + "nested_ranks": [ + 119, + 112, + 98, + 98, + 84, + 84, + 70, + 70, + 56, + 56, + 42, + 42, + 28, + 28, + 14, + 14 + ], + "stage": 18 + } + ], + "original_idle_histogram": { + "7": 4, + "14": 4, + "21": 4, + "28": 4, + "35": 4, + "42": 4, + "49": 4, + "56": 4 + } + }, + "query_phase_control_rank": 1, + "status": "EXACT_BIT_STAGE_QUERY_AND_MASK_PRICE", + "target": "10018846261809/2500000000000000" +} diff --git a/research/bit-local-query-rank-bound/SOURCES.json b/research/bit-local-query-rank-bound/SOURCES.json new file mode 100644 index 0000000000..1fe02a833c --- /dev/null +++ b/research/bit-local-query-rank-bound/SOURCES.json @@ -0,0 +1,36 @@ +{ + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "files": [ + { + "git_blob": "75d77b328ea02ded535e7f23aee5b1e55d0bb1a8", + "path": "certificates/selected-result.json", + "sha256": "154c3d30455d778fd3343b6b4851f0fa4665f0f7625b0adb3675e2bafbbf6bf1", + "usage": "provenance" + }, + { + "git_blob": "3404fbdd5e7529a0674eef26114b5071e4586cec", + "path": "docs/research/agent-task-catalog.json", + "sha256": "ead6cdc9d0af6d58e8a49744d8ec8c7c15e13d2ba93c276c434bcf9b51b93a81", + "usage": "provenance" + }, + { + "git_blob": "f022272a8d51ede841778dec76e2bfb24b614d04", + "path": "research/paired-query-only-bit/EFREE-CALLER.json.gz", + "sha256": "757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b", + "usage": "input" + }, + { + "git_blob": "0f27d6b90c94466756096911dc02786f60cf5039", + "path": "research/paired-query-only-bit/check.py", + "sha256": "460ed9a77d66264b00c31d0a7f8dab1db9aab21ec4cc0eaf0452bd4be4ef585e", + "usage": "input" + }, + { + "git_blob": "30ae586ea0714513802930561b6223065f377573", + "path": "research/paired-query-only-bit/retained/inputs/independent_interval.py", + "sha256": "9293f567aa4afd9b4e618f1cddd3cf66eea51c5e194e3c578e7a8f4db6e04a57", + "usage": "input" + } + ], + "schema_version": 1 +} diff --git a/research/bit-local-query-rank-bound/TASK.json b/research/bit-local-query-rank-bound/TASK.json new file mode 100644 index 0000000000..a4362b922d --- /dev/null +++ b/research/bit-local-query-rank-bound/TASK.json @@ -0,0 +1,64 @@ +{ + "actual_scope": "Exact #7001 38-role paired endpoint with 36 retained LOCAL occurrences at their original stage assignments and arbitrary constant chronology or restored clean helpers. Directed extra-incidence bound at the campaign target.", + "ai_assistance": "Substantial OpenAI Codex and subagent assistance with theorem development, independent checking, and reproducible package.", + "author": "ToikY", + "base_commit": "e54523517d0f03e58352e647c403a5af3e525a57", + "bottleneck_link": "Each retired paid rank-one QUERY would rebate 111 jobs, enough to matter to the target raw BIT moment. A strict operator and price obstruction distinguishes this route from an open native or caller model change.", + "budget_minutes": 30, + "evidence": "1,444 formal coefficients, 18 exact stage derivatives, two clean-helper pads, two dropped-term controls, and 18 directed paid-mask lower bounds.", + "open_questions": [ + { + "blocked_by": "Full polynomial endpoint, native admissibility, restoration, and complete paid tariff.", + "first_step": "Classify candidate paid idle slots by exact conjugated body-stage projectors and price any surviving support assignment.", + "question": "Can a 35-LOCAL word absorb the two extra body incidences under the same exact paired endpoint?", + "why_it_matters": "A different native count changes the saturation and paid rank accounting." + } + ], + "original_card": { + "acceptance_gate": "Name the changed hypothesis, all counted roles and a uniform identity; finite column tests alone do not certify it. 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.", + "allowed_variations": [ + "Choose a fixed larger register count or a specified nonabelian operation family." + ], + "bottleneck_link": "A small-width completed saving changes the bit primitive; a finite-address identity alone is insufficient.", + "first_experiment": "First compare the alphabet, role count and length with the fully replayed #1974 census and #2027 mixed-root tariff. Identify a changed premise and a legal native implementation; then price one smallest completed instance before searching larger words.", + "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." + }, + "id": "bit-new-register-model", + "methods": [ + "Construct the smallest exact identity in a newly specified legal operation alphabet.", + "Derive a target-specific relaxation bound for that same explicit alphabet." + ], + "overlap_terms": [ + "three-register", + "nonabelian", + "group algebra" + ], + "question": "Can an explicitly larger or nonabelian register model escape the scoped three-register obstruction?", + "scope_change_triggers": [ + "Remaining inside the already-excluded three-register abelian model.", + "Repeating the two-register GL3 census or a covered three-register length without changing a hypothesis; a formal group-algebra word without native conversion is a partial result." + ], + "starting_points": [ + "docs/research/research-family-status.md", + "research/bit-three-register-lower-bound/README.md", + "certificates/selected-result.json", + "research/bit-gl3-mixed-targets-length10/README.md", + "docs/research/community-efficient1000-review.md" + ] + }, + "outcome": "negative-result", + "priority_revision": 8, + "schema_version": 1, + "scope_change_reason": "Test whether the actual selected paired BIT caller admits fewer QUERY ranks even with free constant bases and restored clean auxiliary roles.", + "scope_status": "changed", + "stop_rule": "Prove the saturated rank lower bound or charge the first excess idle incidence at each stage. Stop without building when both branches preclude the proposed QUERY saving.", + "task_id": "bit-new-register-model" +} diff --git a/research/bit-local-query-rank-bound/VERIFY.json b/research/bit-local-query-rank-bound/VERIFY.json new file mode 100644 index 0000000000..85d3e3aee5 --- /dev/null +++ b/research/bit-local-query-rank-bound/VERIFY.json @@ -0,0 +1,23 @@ +{ + "commands": [ + { + "argv": [ + "{python}", + "-I", + "-B", + "{package}/verify.py" + ], + "checks": "Reconstruct the 38-role polynomial and independent stage derivatives, check clean helper and missing-term controls, and certify directed added-incidence prices.", + "timeout_seconds": 60 + } + ], + "inputs": [ + "research/paired-query-only-bit/EFREE-CALLER.json.gz", + "research/paired-query-only-bit/check.py", + "research/paired-query-only-bit/retained/inputs/independent_interval.py" + ], + "python": "3.12", + "requirements": [], + "schema_version": 1, + "status": "ready" +} diff --git a/research/bit-local-query-rank-bound/verify.py b/research/bit-local-query-rank-bound/verify.py new file mode 100644 index 0000000000..bd17498ef7 --- /dev/null +++ b/research/bit-local-query-rank-bound/verify.py @@ -0,0 +1,188 @@ +"""Exact independent-stage QUERY rank and paid-mask obstruction.""" +from collections import Counter, defaultdict +from fractions import Fraction +from hashlib import sha256 +from importlib.util import module_from_spec, spec_from_file_location +from itertools import combinations +from pathlib import Path +import gzip +import json +import sys + +PINS = { + 'EFREE-CALLER.json.gz': '757b3523798f840bdb02028b23708c3416627a99ea09e7a3c4bcdc5cd0c7ce4b', + 'check.py': '460ed9a77d66264b00c31d0a7f8dab1db9aab21ec4cc0eaf0452bd4be4ef585e', + 'retained/inputs/independent_interval.py': '9293f567aa4afd9b4e618f1cddd3cf66eea51c5e194e3c578e7a8f4db6e04a57', +} +KAPPA = Fraction('.0040075385047236') + + +def checked(package, relpath): + raw = (package/relpath).read_bytes() + assert sha256(raw).hexdigest() == PINS[relpath] + return raw + + +def load(package, relpath): + checked(package,relpath) + path = package/relpath + spec = spec_from_file_location(path.stem,path) + module = module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def dot(a,b): + return (a & b).bit_count() % 2 + + +def rank(rows): + pivots = {} + for row in rows: + while row and row.bit_length()-1 in pivots: + row ^= pivots[row.bit_length()-1] + if row: + pivots[row.bit_length()-1] = row + return len(pivots) + + +def outer_sum(terms, n, mask): + result = [0]*n + for u,v in terms: + while u: + bit = u & -u + result[bit.bit_length()-1] ^= v & mask + u ^= bit + return result + + +def audit(events, diagonal, dimension): + n = len(diagonal) + mask = (1<=j for c in needed.values()) for j in range(1,max(needed.values())+1)] + delta = subtract(interval.moment(Counter(packed),1-KAPPA),base) + assert delta[0] > 4 + profiles.append(dict(stage=s,nested_ranks=packed,added_paid_per_port=interval.bounds_text(delta))) + return dict(original_idle_histogram=original,minimum_extra_incidence_profiles=profiles, + maximum_query_rebate_per_port=4) + + +def run(package): + caller = json.loads(gzip.decompress(checked(package,'EFREE-CALLER.json.gz'))) + forward = load(package,'check.py') + interval = load(package,'retained/inputs/independent_interval.py') + events,diagonal = caller['events'],caller['diagonal'] + assert (caller['roles'],caller['ports'],caller['stages']) == (38,111,18) + base = audit(events,diagonal,38) + assert base['q_terms']==40 and base['q_target_delta_rank']==0 and base['compressed_q_defect_rank']==2 + assert len(base['stage_controls'])==18 and not base['stage_failures'] + literal = forward.forward(caller) + assert literal == 38**2 + + mutated = [e[:] for e in events] + query = next(i for i,e in enumerate(events) if e[0]=='QUERY') + mutated[query][0] = 'ADD' + q_control = audit(mutated,diagonal,38) + assert q_control['q_target_delta_rank']==1 and not q_control['stage_failures'] + + mutated = [e[:] for e in events] + idle = next(e for e in mutated if e[0]=='IDLE_ONE') + omitted = idle[2][0] + idle[2] = idle[2][1:] + body_control = audit(mutated,diagonal,38) + assert body_control['q_target_delta_rank']==0 and body_control['stage_failures']==[[omitted,1]] + + local = next(i for i,e in enumerate(events) if e[0]=='LOCAL') + _,s,a,b = events[local] + padded = [*events[:local],['SWAP',a,38],['LOCAL',s,38,b],['SWAP',a,38],*events[local+1:]] + _,d,c = events[query] + padded[query+2:query+3] = [['SWAP',d,39],['QUERY',39,c],['SWAP',d,39]] + h = audit(padded,diagonal,40) + assert h['q_target_delta_rank']==0 and h['compressed_q_defect_rank']==2 and not h['stage_failures'] + return dict(status='EXACT_BIT_STAGE_QUERY_AND_MASK_PRICE',dependencies=PINS,target=str(KAPPA), + exact_original_polynomial_coefficients=literal,baseline=base, + query_phase_control_rank=q_control['q_target_delta_rank'], + body_incidence_control=body_control['stage_failures'], + helper_padding_control=dict(dimension=40,stage_checks=len(h['stage_controls']),q_defect_rank=2), + price=price(events,interval)) + + +if __name__ == '__main__': + if not __debug__ or sys.implementation.name != 'cpython' or sys.version_info[:2] != (3,12): + raise RuntimeError('Use CPython 3.12 with assertions enabled') + package = Path(__file__).resolve().parent + source = Path(sys.argv[1]) if len(sys.argv) == 2 else package.parent / 'paired-query-only-bit' + receipt = json.dumps(run(source), indent=2, sort_keys=True) + '\n' + if receipt.encode() != (package / 'RECEIPT.json').read_bytes(): + raise ValueError('exact stage/query receipt mismatch') + print('PASS_BIT_LOCAL_QUERY_RANK_BOUND') diff --git a/research/historical-selected-replay-gap/README.md b/research/historical-selected-replay-gap/README.md index 55d8cc3b49..36d9a873ca 100644 --- a/research/historical-selected-replay-gap/README.md +++ b/research/historical-selected-replay-gap/README.md @@ -69,7 +69,11 @@ python3 -B scripts/research_package.py --package research/historical-selected-re The direct command prints `PASS_HISTORICAL_SELECTED_REPLAY_GAP`. A registered replay prints `PASS_REGISTERED_RESEARCH_PACKAGE`. Both require Git history -containing the two inspected commits. +containing the two inspected commits and the source and manifest objects at +`2485805a6d47f36ea83ddde6327d453ac82d44dc`. The verifier uses a temporary +sparse checkout of that commit, checks the declared source digests there, and +uses its planner and manifest inventory. The recorded rejections and selection +therefore remain reproducible after later changes to the live Makefile or CI guide. ## Open next questions diff --git a/research/historical-selected-replay-gap/SOURCES.json b/research/historical-selected-replay-gap/SOURCES.json index c1010eec95..62bb8b3950 100644 --- a/research/historical-selected-replay-gap/SOURCES.json +++ b/research/historical-selected-replay-gap/SOURCES.json @@ -4,13 +4,13 @@ "files": [ { "path": "Makefile", - "usage": "input", + "usage": "provenance", "git_blob": "0d683a06b9e7ee162496108ce9a7c5d2ee94fccf", "sha256": "4f2d4f2dcd15139ec82658a975f85ed300897385f85799218539f4c8d60567da" }, { "path": "certificates/partial-swap-network.json", - "usage": "input", + "usage": "provenance", "git_blob": "eccafa830c16170c36faf93045ddf1f638f7bcd4", "sha256": "4c0b9d37e1034b2076e30a70f8e514416298c462d9ee98bc87fe6556b14df786" }, @@ -22,7 +22,7 @@ }, { "path": "docs/ci-verification.md", - "usage": "input", + "usage": "provenance", "git_blob": "63ba3e9aa8bdc5e942b56e34244b92b16f854085", "sha256": "c7d3027e9ad8bcbff68f07aa9576b30fb2f3c76c44d876d40c7fdbf4a3e2228a" }, @@ -34,163 +34,163 @@ }, { "path": "research/clifford-state-performance/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "6f98a0061a5104dfab82c9e806f819b41811f684", "sha256": "396d0f08df24952248140d5c65c51b8c902ef1c580892ff7ea182890530f67ee" }, { "path": "research/community-batch1047-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "5e0f92af463ec12c5e1dcc3effd44081a88af647", "sha256": "07a9daeaf2bda308a92e9a4684f13d5fc766c7772d74801fceb7f4599fdab226" }, { "path": "research/community-batch1099-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "9e13266bf85e627f1b7dc225e9530ea69fd2c7f0", "sha256": "421e1211fb1897c45621dc6801c276e53f2e6f335583c9c9049e535f87c0a3b1" }, { "path": "research/community-batch932-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "cc4d03eb59b9ab3f952735f7e88ff18c2d15d7af", "sha256": "184629cac91a5cfaca50330a88596008b824221433867dcf8117539c913c284a" }, { "path": "research/community-batch970-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "8b9f4111badf7de5d97684799560b55110e9da79", "sha256": "23188ed920e38a54006cb883e181585620821c63bf7e8b5e05d32719417cc37e" }, { "path": "research/community-frontier741-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "a5300d4e7a5381a3f443fc54c768ca6f0f236d68", "sha256": "3c820fb30e1b4d9bcfc6a7ab524375e5b2abd66b940af2c509146104f0bcd79c" }, { "path": "research/community-frontier890-audit/CONTENT-COVERAGE.json", - "usage": "input", + "usage": "provenance", "git_blob": "d7ff6d777b01d69b6ce84caf25d3b7e4a4d2f211", "sha256": "6b185a9902652f893f3ebd8ada92d2f11b6de6533a9a4d11718a8a4496101128" }, { "path": "research/community-hyperplane599-audit/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "546f37d326d10a99910ae8f908e71ef768524d98", "sha256": "65099d764bfcc39bda5e4d9966783611b094c3522dbdd1435cd498d657a8ef8e" }, { "path": "research/community-k492-audit/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "e538481e4cb16ed936d3195f2dfb5b5a9ca0a76b", "sha256": "2c0f4fa5bc150d05658af2e7c54c4d2c337dd52b7efd3d69530ae73bcbdf452a" }, { "path": "research/community-reconciliation92-audit/MANIFEST.json", - "usage": "input", + "usage": "provenance", "git_blob": "2a2e93685173d5f13cbb5abe740f5d90352e0228", "sha256": "5f501f3c118131e7d069f30ad77186eb2ad6961f9680a0ef105f4514ed41808a" }, { "path": "research/partial-swap-digest/baseline.py", - "usage": "input", + "usage": "provenance", "git_blob": "a2f0190704db83bd8ef48e46e723c49b925804fe", "sha256": "81e9af92cdf38243a540cdcff2062778e449467848d444da37a9553c12ca4c34" }, { "path": "research/r420-two-sided-basis/SOURCES.json", - "usage": "input", + "usage": "provenance", "git_blob": "5d718e11e62f4bcadecf1e02d6b61f87dbe190b0", "sha256": "d9810b0d139c5a1211fd2c1f0d142187cc1fca30026e1e7bc4f9ecfacf1596d1" }, { "path": "research/skip-clones/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "8d1bb3b9c8189e35e5d8bfdfa632d7473e8be0d5", "sha256": "0b68e63e35a97ce6b0cdb6e291b88ebaa8f2dd4afb70b2498f10ee89428258dc" }, { "path": "research/split-skip/SOURCE.json", - "usage": "input", + "usage": "provenance", "git_blob": "2ab610b6ea2edd2865fda793ef2168b0c76afb4f", "sha256": "7c2b4646a3ecfef6f881da5c43e4bd0fa9a4d1b00548b8ab458d897e16735134" }, { "path": "scripts/historical-ci-inputs/Makefile", - "usage": "input", + "usage": "provenance", "git_blob": "aff68409021c9d401a6f8013b9dfd7dbcc30f2a8", "sha256": "ea8830dd79da493e2d75baf753d733ff7efbcf2b4794afe41fae0ac8f3055646" }, { "path": "scripts/historical-ci-inputs/ledger-batch932-run_isolated_tests.py", - "usage": "input", + "usage": "provenance", "git_blob": "65db599ab0b1dea0312c4ca048e0bd0f44c3736f", "sha256": "96ea543e6c707424afe247e77bd86c82152f90fc76a0773c4232145da5cdf8d1" }, { "path": "scripts/historical-ci-inputs/ledger-batch932-test_isolated_test_runner.py", - "usage": "input", + "usage": "provenance", "git_blob": "34820a8f24678f918f4d0e7a35380d8013fc3495", "sha256": "628391b6abfbc8674ceec1751867a4392f2cc0b5b66886243e139af86cf355ac" }, { "path": "scripts/historical-ci-inputs/ledger-batch970-verify_selected_result.py", - "usage": "input", + "usage": "provenance", "git_blob": "c755b76e0d44ba4917aa94440ebe54daefce5b2a", "sha256": "d7fd929726b326aeeaf0a3996475adec88eee9aac09ae0bebeeaa0bc1fc8f199" }, { "path": "scripts/historical-ci-inputs/ledger-frontier741-ci-verification.md", - "usage": "input", + "usage": "provenance", "git_blob": "7f3c012504187917a728b9fe87043f0fc8cd006a", "sha256": "a854022e0e1d5d4db4d60e586be3ea56005013ef14a1fc06d02bc06e8529c4b0" }, { "path": "scripts/historical-ci-inputs/partial-swap-context.json", - "usage": "input", + "usage": "provenance", "git_blob": "ad65114886bf34a4fd27e79f3be502389e689faa", "sha256": "833a9642f33aeab2ffea17ec9c6b82e0a953f90192b2c82e10bef21538dccba9" }, { "path": "scripts/historical-ci-inputs/partial-swap-network.json", - "usage": "input", + "usage": "provenance", "git_blob": "52075f2463f60af5e16571347f24274fce73a1ea", "sha256": "f3c4be597b2f2136da4ae2cc80c7454f63c90aa01f84e5b8131cee4dd55de815" }, { "path": "scripts/partial_swap/shared.py", - "usage": "input", + "usage": "provenance", "git_blob": "44a0e454c70f9c4b98e258b8443612e6a119904b", "sha256": "5a0646a50b9f3e8ea55168620a78e8853b0ab810517cefc8cfb8696aedee278a" }, { "path": "scripts/replay_historical_check.py", - "usage": "input", + "usage": "provenance", "git_blob": "1e92fff2782970ef71378f594f2350d245a4db26", "sha256": "5467619c78183d3adc82b0cb55af28e5c1a01fca2b0588677816244b53e2bafd" }, { "path": "scripts/research_package.py", - "usage": "input", + "usage": "provenance", "git_blob": "091b4c8f58bac9a9580d76025b887dc5c873d05f", "sha256": "e1256016e7f51827d04fa2179255989f639ae1d97afaa9c16265f85a0c6abd70" }, { "path": "scripts/run_isolated_tests.py", - "usage": "input", + "usage": "provenance", "git_blob": "a96ab35b315ce492e7fbbfd6c5ae211aa066b541", "sha256": "49eb56dd0fc0d8d8ffdb209970a7adf2176223580646f575d5c22e59543b381c" }, { "path": "scripts/verify_selected_result.py", - "usage": "input", + "usage": "provenance", "git_blob": "6882a4700e410dec569b51ae2eaf1a19cc019195", "sha256": "d6b305eac5b9bdb8172c469ad30a1655a60fa0aceac8b1bf610e1b73f51babd8" }, { "path": "tests/test_isolated_test_runner.py", - "usage": "input", + "usage": "provenance", "git_blob": "343b24abf6719b81805eba5a84c74e57634c8288", "sha256": "3a5470d0b139828b90e19bf9583ddeafcd69f8e34f2824664eb3a2958a52e34d" } diff --git a/research/historical-selected-replay-gap/VERIFY.json b/research/historical-selected-replay-gap/VERIFY.json index 98553e72ed..ab7efa3471 100644 --- a/research/historical-selected-replay-gap/VERIFY.json +++ b/research/historical-selected-replay-gap/VERIFY.json @@ -4,36 +4,7 @@ "python": "3.12", "requirements": [], "inputs": [ - "Makefile", - "certificates/partial-swap-network.json", - "docs/ci-verification.md", - "research/clifford-state-performance/SOURCE.json", - "research/community-batch1047-audit/CONTENT-COVERAGE.json", - "research/community-batch1099-audit/CONTENT-COVERAGE.json", - "research/community-batch932-audit/CONTENT-COVERAGE.json", - "research/community-batch970-audit/CONTENT-COVERAGE.json", - "research/community-frontier741-audit/CONTENT-COVERAGE.json", - "research/community-frontier890-audit/CONTENT-COVERAGE.json", - "research/community-hyperplane599-audit/SOURCE.json", - "research/community-k492-audit/SOURCE.json", - "research/community-reconciliation92-audit/MANIFEST.json", - "research/partial-swap-digest/baseline.py", - "research/r420-two-sided-basis/SOURCES.json", - "research/skip-clones/SOURCE.json", - "research/split-skip/SOURCE.json", - "scripts/historical-ci-inputs/Makefile", - "scripts/historical-ci-inputs/ledger-batch932-run_isolated_tests.py", - "scripts/historical-ci-inputs/ledger-batch932-test_isolated_test_runner.py", - "scripts/historical-ci-inputs/ledger-batch970-verify_selected_result.py", - "scripts/historical-ci-inputs/ledger-frontier741-ci-verification.md", - "scripts/historical-ci-inputs/partial-swap-context.json", - "scripts/historical-ci-inputs/partial-swap-network.json", - "scripts/partial_swap/shared.py", - "scripts/replay_historical_check.py", - "scripts/research_package.py", - "scripts/run_isolated_tests.py", - "scripts/verify_selected_result.py", - "tests/test_isolated_test_runner.py" + "scripts/research_package.py" ], "commands": [ { diff --git a/research/historical-selected-replay-gap/verify.py b/research/historical-selected-replay-gap/verify.py index 83b995941a..9d266c5a4e 100644 --- a/research/historical-selected-replay-gap/verify.py +++ b/research/historical-selected-replay-gap/verify.py @@ -6,8 +6,10 @@ """ import hashlib import importlib.util +import json import subprocess import sys +import tempfile from pathlib import Path ROOT = Path(__file__).resolve().parents[2] @@ -61,31 +63,47 @@ def require(ok, message): raise SystemExit(message) -def load_checker(): - path = ROOT / "scripts/replay_historical_check.py" - spec = importlib.util.spec_from_file_location("historical_selected_replay_gap_checker", path) +def load_module(path): + spec = importlib.util.spec_from_file_location(path.stem, path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) return module +def checkout_snapshot(snapshot, sources, runner, env): + paths = [runner.canonical_relative_path(row["path"]) for row in sources["files"]] + git = ["git", "-c", "maintenance.auto=false", "-c", "gc.auto=0", + "-c", "core.autocrlf=false"] + subprocess.run([*git, "clone", "--quiet", "--shared", "--no-tags", "--no-checkout", + "--", str(ROOT), str(snapshot)], cwd=ROOT, env=env, check=True) + subprocess.run([*git, "update-ref", "--no-deref", "HEAD", INSPECTED], + cwd=snapshot, env=env, check=True) + # The pinned planner reads omitted manifests from the sparse HEAD/index. + patterns = "".join(f"/{path.as_posix()}\n" for path in paths) + subprocess.run([*git, "sparse-checkout", "set", "--no-cone", "--stdin"], + cwd=snapshot, env=env, input=patterns.encode("utf-8"), check=True) + subprocess.run([*git, "read-tree", "-mu", "HEAD"], cwd=snapshot, env=env, check=True) + for path, row in zip(paths, sources["files"], strict=True): + require(hashlib.sha256((snapshot / path).read_bytes()).hexdigest() == row["sha256"], + "historical checkout source digest changed: " + path.as_posix()) + + def entries(checker): for name, config in checker.CONFIG.items(): for entry in [config, *config.get("additional_inputs", [])]: yield name, entry -def reject(checker, entry): +def reject(root, checker, entry): try: - checker.authenticated_input(ROOT, entry) + checker.authenticated_input(root, entry) except ValueError as exc: return str(exc) raise SystemExit("historical input was admitted: " + entry["path"]) -def main(): - require(not sys.flags.optimize, "assertions must stay enabled") - checker = load_checker() +def check_snapshot(root, env): + checker = load_module(root / "scripts/replay_historical_check.py") selected = [entry for name, entry in entries(checker) if name == "tooling-ledger" and entry["path"] == SELECTED_PATH] require(len(selected) == 1, "selected-result checker overlay is not unique") @@ -94,7 +112,7 @@ def main(): require(entry["accepted_live_sha256"] == [SELECTED_ACCEPTED], "accepted selected-checker successors changed") frozen = (checker.INPUTS / entry["input"]).read_bytes() - live = (ROOT / SELECTED_PATH).read_bytes() + live = (root / SELECTED_PATH).read_bytes() require(hashlib.sha256(frozen).hexdigest() == SELECTED_PIN, "frozen selected checker bytes changed") require(hashlib.sha256(live).hexdigest() == SELECTED_LIVE, "live selected checker digest changed") require(SELECTED_LIVE not in (SELECTED_PIN, SELECTED_ACCEPTED), "live checker was already admitted") @@ -102,7 +120,7 @@ def main(): # live successor, not a broken comparison. require(SELECTED_PIN in (SELECTED_PIN, *entry["accepted_live_sha256"]), "pin membership control failed") - require(reject(checker, entry) == REJECTIONS[SELECTED_PATH][1], + require(reject(root, checker, entry) == REJECTIONS[SELECTED_PATH][1], "selected checker rejection text changed") counts = {path: 0 for path in REJECTIONS} @@ -110,7 +128,7 @@ def main(): for _name, item in entries(checker): if item["path"] not in REJECTIONS: continue - message = reject(checker, item) + message = reject(root, checker, item) counts[item["path"]] += 1 messages.setdefault(item["path"], message) for path, (count, message) in REJECTIONS.items(): @@ -118,20 +136,31 @@ def main(): require(messages[path] == message, "rejection text changed for " + path) require(sum(counts.values()) == 19, "rejection total changed") ci = [item for _name, item in entries(checker) if item["path"] == CI_PATH] - require(len(ci) == 1 and hashlib.sha256((ROOT / CI_PATH).read_bytes()).hexdigest() == CI_LIVE, + require(len(ci) == 1 and hashlib.sha256((root / CI_PATH).read_bytes()).hexdigest() == CI_LIVE, "selected CI note digest changed") diff = subprocess.check_output( - ["git", "diff", "--name-only", PARENT, INSPECTED], cwd=ROOT, text=True) + ["git", "diff", "--name-only", PARENT, INSPECTED], cwd=root, env=env, text=True) changed = sorted(name for name in diff.splitlines() if name) require(changed == CHANGED, "inspected commit diff changed") - sys.path.insert(0, str(ROOT / "scripts")) - from research_package import plan_details - details = plan_details(ROOT, set(changed)) + planner = load_module(root / "scripts/research_package.py") + details = planner.plan_details(root, set(changed)) require([row["package"] for row in details] == PLAN_PACKAGES, "helper plan selection changed") matched = {name for row in details for names in row["causes"].values() for name in names} require(sorted(set(changed) - matched) == UNMATCHED, "unmatched plan paths changed") - require(plan_details(ROOT, set()) == [], "empty change set selected a package") + require(planner.plan_details(root, set()) == [], "empty change set selected a package") + + +def main(): + require(not sys.flags.optimize, "assertions must stay enabled") + sources = json.loads(Path(__file__).with_name("SOURCES.json").read_bytes()) + require(sources["base_commit"] == INSPECTED, "historical checkout base changed") + runner = load_module(ROOT / "scripts/research_package.py") + env = runner.git_source_env() + with tempfile.TemporaryDirectory(prefix="historical-selected-replay-") as temporary: + snapshot = Path(temporary) / "snapshot" + checkout_snapshot(snapshot, sources, runner, env) + check_snapshot(snapshot, env) print("PASS_HISTORICAL_SELECTED_REPLAY_GAP") print("selected_checker_live=" + SELECTED_LIVE) print("rejections=19 distinct_paths=7 plan_packages=9")