Skip to content

Tooling: make the complete R2 audit 5.37x faster with mutation-path copies - #3240

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
tekuuu:research/round69-r2-mutation-copy
Oct 17, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
tekuuu:research/round69-r2-mutation-copy

Conversation

@tekuuu

@tekuuu tekuuu commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

After PR3218's comparator improvement, the retained R2 audit spends most of its time deep-copying entire fixtures for mutations that change one narrow part. This opt-in adapter isolates those write paths while executing every original mutation, nonvacuity check, predicate and exact rejection-message check.

Complete-audit median: 32.643 → 6.084 seconds, a 5.37x speedup. Against jackmgaller/#1939's existing checked-marshal copier on the identical workload, the improvement is 10.289 → 6.084 seconds, or 1.69x.

Copy mode Copy interval Complete audit Peak RSS
Original deepcopy 25.603 s 32.643 s 138.57 MiB
Credited checked marshal 2.908 s 10.289 s 142.12 MiB
Mutation paths 0.061 s 6.084 s 135.16 MiB

BENCHMARK.json records nine fresh serial CPython 3.12.14 processes in alternating order, exact sources, raw timings and memory. All modes use the same complete fixture, comparator, source bindings and added original-fixture guards. Every run retains all 32 semantic mutants and the same 253 operator decisions (244 accepted, 9 rejected). These are one-host measurements; native artifact generation is excluded. The copy-interval improvement is not a whole-audit speedup.

The adapter copies the ancestors of the selected event, gate or recipe and its writable subtree. Untouched cells remain shared and read-only. PROOF.md gives the tree-copy argument and all sixteen literal write footprints. Path copying is established programming practice; no method-priority claim is made. This is source-specific integration, not a general deepcopy replacement for aliased object graphs.

Validation:

  • Every one of the 32 actual optimized mutant payloads is compared in full against the original mutation applied to complete deepcopy. Original named rejection checks still execute.
  • Complete original fixtures are compared by exact serialized bytes before/after their tests. This guard compares bytes directly, and no predicate-result cache is introduced.
  • 100 generated equivalence cases plus controls reject nested-write leakage, out-of-footprint writes, incorrect complete payloads, unknown mutations and altered source hooks.
  • Registered Python 3.12 commands, three source-corruption controls, optimized Git-free exports, and Python 3.14 optimized full differential verification pass.
  • Metadata/pins, whitespace, all 27 retained-file origin comparisons and all 56 package/input publication-byte comparisons pass. Hosted CI is separate.
python3.12 -B scripts/research_package.py --package research/r2-mutation-path-copy

Expected: PASS_R2_PATH_COPY, PASS_R2_PATH_COPY_EXPORT, and PASS_REGISTERED_RESEARCH_PACKAGE ... outcome=completed. Normal fast use is python3 -I -B research/r2-mutation-path-copy/replay.py; the registered command deliberately pays for full differential copying.

Only research/r2-mutation-path-copy/ is added. Base: 463113d675af7410ac91d53a4fed51ec6494eb9a. Pending PR3218 is retained verbatim at a93c4f0bfcac21bf9c62c79728c8936e35ebbc3b, including PR3202 at 259043321323717b7e816d6be38ad5e1f0b69b4c. All 40 retained/live inputs are authenticated before execution; no pending Git objects are needed for direct replay. Published head: 9f32d16ea188cfba57f6c0d570377be9becb857f.

This is verification tooling, with no new kappa, supplier admission or recursive multiplication implementation. Selected/frozen sources and default commands are unchanged. PR3208 cleanup, PR3209 reader-cache/host-replication work and PR3219 Fano tables are complementary. Final overlap coverage and concrete next questions are in TASK/README: source/frame/event reconstruction now dominates this caller, while another caller needs its own proven mutation footprint.

Credit 24kHandsome1201/#3202, Tekalign/#3218, jackmgaller/#1939, Sagar Thakrar/#1781, ywz65/#2638, Charles Bethin/#662 and the full native/construction lineage preserved in NOTICE.md and retained notices. New work by Tekalign (@tekuuu), with substantial OpenAI Codex assistance in profiling, implementation, proof, testing, measurements and writing. Apache-2.0; no independent human or proof-kernel review claimed.

Canonical investigation.

@Mister-Meeseeks
Mister-Meeseeks merged commit 87866a0 into CrocSwap:main Oct 17, 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