Repository navigation
Reduce complete R2 replay time by 54.25% (no new κ) - #6300
Merged
Mister-Meeseeks merged 1 commit intoOct 31, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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
BENCHMARK.jsonbinds all ten complete executions to their source, implementation and harness hashes. Its medians, ranges and percentage are recomputed by verification.Base canonical main:
2485805a6d47f36ea83ddde6327d453ac82d44dc, priority revision 8. The selected source-binding orientation passes at kappa781451/250000000. Every live read is declared inVERIFY.json; no predecessor file is modified.Exact reproduction from the repository root:
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=371802andPASS_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.
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,
planandreplay (research/r2-frame-span-cache), passed at head83e59e9218f7fb1e926a9af0ec5e70f5391a8721in 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.