Skip to content

Reduce complete R2 replay time by 54.25% (no new κ) - #6300

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/w7-1030c-frontier-step
Oct 31, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
petalas:research/w7-1030c-frontier-step

Conversation

@petalas

@petalas petalas commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The complete PR3240 R2 caller repeatedly reconstructs identical binary frame spans. This adds one bounded cache and preserves the complete caller, including all semantic failures and operator comparisons.

 complete R2 path-copy caller
-  reconstruct each frame span
+  key the complete ordered integer basis by contents
+  reuse its immutable span within this invocation
   execute every event, mutant and exact operator comparison

Claim type: scoped implementation-preservation proof with a local performance measurement. Five alternating fresh-process pairs measure 54.25% less complete-command median wall time, from 1.961916 to 0.897650 seconds. Source ranges are 1.954481 to 2.083084 seconds; cached ranges are 0.883717 to 0.986586 seconds. All ten executions succeed with identical complete scientific payloads and zero failures. Native artifact generation is excluded. These are CPython 3.12.15 measurements on one shared macOS arm64 machine, not a portable speed guarantee.

The caller records 372,952 span calls, with 371,802 hits and 1,150 misses. The cache holds at most 4,096 immutable results. Changed contents, invalid frames, bool/float aliases, capacity exhaustion and separate invocations retain their proper behavior. The written proof is in research/r2-frame-span-cache/README.md; no generic mutable-object cache or acceptance-result cache is introduced.

This contribution was produced by Nick Petalas. Credit Tekalign / PR3240 for the complete path-copy caller and remaining reconstruction handoff, PR3218 for comparator integration, 24kHandsome1201 / PR3202 for the source/event audit, jackmgaller / PR1939 for the stronger copy baseline, Sagar Thakrar / PR1781, ywz65 / PR2638, Charles Bethin / PR662 and the retained native/construction lineage. Memoization is classical. The new contribution is the bounded implementation, preservation argument, integration and complete-caller measurement.

Evidence

  • Before: the unchanged PR3240 path-copy caller is the source arm, including its fastest shipped comparator and mutation-copy implementation.
  • After: the cached arm retains all 32 original semantic mutants, exact rejection messages, fixture-immutability checks and all 253 operator decisions, 244 accepted and nine rejected. All complete result payloads agree.
  • 4,689 exact frame-input cases compare with the pinned original function. Mutable-content, warmed-invalid-key, cache-lifetime and capacity controls pass. Three source-byte corruptions and a missing-hook corruption reject.
  • The complete cached verifier compares every original mutation payload with the original mutation applied to full deepcopy. Both registered normal and optimized commands pass locally. Each is about eleven seconds, below its 120-second timeout.
  • The generated BENCHMARK.json binds all ten complete executions to their source, implementation and harness hashes. Its medians, ranges and percentage are recomputed by verification.
  • Metadata/pins, warning-strict execution and compilation, committed bytes and source-history preflight pass. The official export contains 54 files and passes integrity checking. A read-only Git-free export passes optimized direct verification.

Base canonical main: 2485805a6d47f36ea83ddde6327d453ac82d44dc, priority revision 8. The selected source-binding orientation passes at kappa 781451/250000000. Every live read is declared in VERIFY.json; no predecessor file is modified.

Exact reproduction from the repository root:

/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/research_package.py --package research/r2-frame-span-cache
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -W error -B research/r2-frame-span-cache/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -I -O -W error -B research/r2-frame-span-cache/verify.py
/Users/nick/git/integer-mult-bounds/.venv/bin/python3.12 -B scripts/check_research_commit.py --package research/r2-frame-span-cache --check-source-history

Substitute another CPython 3.12 executable on another machine. Expected markers include PASS_R2_FRAME_SPAN_CACHE conformance=4689 controls=4 mutants=32 decisions=253 hits=371802 and PASS_REGISTERED_RESEARCH_PACKAGE.

Limitations and unrun obligations

This establishes the new implementation's preservation on the retained finite caller. It does not independently audit the predecessor mathematical result. No selected cold replay, native regeneration, current supplier admission or full multiplication theorem is claimed. Native realization, physical ownership, compiler, precision/tape and analytic recovery remain separate obligations. The selected frontier and all five framework assumptions are unchanged. The cache retains additional immutable sets; no memory improvement is claimed. Independent human and formal proof-kernel review are unclaimed.

Open next questions

Does another complete native caller repeat enough long frame bases to benefit? Start by profiling one named caller against its fastest existing implementation and specifying its input types and mutation boundaries. Its source lifetime and invalidation obligations must be resolved separately. No further optimization is reserved.

Related open work

The completion refresh inspected all 16 open account PRs created since the advance CLAIM. None studies this exact R2 caller or its frame-span workload; no shared-instance numerical disagreement was identified and no additional computations checked other submissions.

  • PR6301 reuses native-map setup in the different PR5447 full-history caller. It is related cache-method work, with different cached objects and a different complete timing workload; no numerical timing comparison is made here.

PR3240 and PR3218 are merged predecessors. Searches cover metadata and targeted main README terms; sparse local notes and unpublished work limit coverage. The advance claim records the reserved scope.

CI notes

Both hosted checks, plan and replay (research/r2-frame-span-cache), passed at head 83e59e9218f7fb1e926a9af0ec5e70f5391a8721 in run 41106463337. The completed checks were read once; run metadata separately confirms completed status, successful conclusion and the matching head. Hosted replay executes both registered normal and optimized verifier commands. All registered commands also passed locally. CI verifies the committed replay, not the local timing percentage or independent human/proof-kernel acceptance. No hosted check failed.

Merge Danger

Door: two-way.

Blast Radius: isolated. Only the new research/r2-frame-span-cache/ package is added. Default callers, frozen source inputs and the selected frontier are unchanged.

@Mister-Meeseeks
Mister-Meeseeks merged commit 94ad794 into CrocSwap:main Oct 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants