Repository navigation
Tooling: checked marshal copies make the selected final stage's audit sub-stage 2.47x faster (no new kappa) - #1939
Conversation
… sub-stage 2.47x faster (no new kappa) Opt-in launcher for the pinned audit_allcold.py (sha 1467a2ac, used by the selected PR1094 final stage and the cold baseline1042 t16 stage): replaces only copy.deepcopy with a type- and equality-checked marshal round trip. Pinned run_portable.py and audit_allcold.py bytes, all checks and all 15 mutation controls are unchanged; every audit output and the merged stage log are byte-identical. Registered CPython 3.12 replay included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Cross-reference from session work on the same audit sub-stage: #1959 runs the pinned |
PR1959 uses this package's checked marshal copy and shares open question 2 (the nine other audit_allcold.py hashes). README only; no code change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @JosieElliston. The cross-reference is useful, and the two packages fit together. Commit
One connection between the results, in case it helps your line attribution: this package's identity-copier control shows that the 15 shipped controls depend on |
|
Review follow-up for frozen head The frozen review covered The current head is Recorded scope, attribution and execution evidence. We are leaving this open with the outstanding work recorded; previously completed checks remain credited. Thank you for the contribution. |
Tooling (verifier engineering). No κ, certificate, supplier, frontier or pinned-source change.
Card
replay-runtime, scope refined to one profiled sub-stage. Chooser OS nonce343b846376b457288e1b5a2336a887c0, priority revision 3. Base0b1cccf86e2f5132ed286a26ef0a681a495740ea; selected-record SHA-25610b9e340fd8e354a37a0c4813c90e5de1dd42044b5f6aca4a3fc5a42b685fa32. Claim: #1166 (comment)Bottleneck
The selected record has one stage after #1042:
complex-t16-rare-pattern-exchanges/verify.py, which runs the frozen PR1087verify_t16.py. Its slowest sub-stage isaudit: 32.6 s of 57.6 s in the maintainer receipt. The script isaudit_allcold.py, SHA-2561467a2ac…. The cold baseline1042t16stage runs the same bytes fromresearch/gauge44-slots-t16/code/.cProfile puts about 80% of this sub-stage in
copy.deepcopy. Each of the 15 mutation controls copies the whole hosted T16 template, and each of the 16 audits copies every source event: 4,838 top-level calls in total.Change
New package
research/audit-allcold-fast-copy/. Itsfast_copy.pyis an opt-in drop-in forpython3 -B run_portable.py SCRIPT ARGS…:run_portable.pyand the script against a SHA-256 allow-list, then runs the pinnedrun_portable.pyunchanged.copy.deepcopy. For a top-level dict or list, the copy ismarshal.loads(marshal.dumps(x)). That copy is kept only if marshal accepts the value (core builtin types only), the copy has the same type, and it compares equal. Otherwise, and for any call with a memo, the originaldeepcopyruns.Evidence (
verify.py, registered replay)selected-replay.tar.gzand runs the unchanged selected final stage on them. The stage must printPASS_T16_RARE_PATTERN_EXCHANGES 0.001672660197076918, and itsASYNC-AUDIT.jsonmust equal the archived selected receipt byte for byte.ASYNC-AUDIT.json,OWNERS-AND-PROFILE.json,IDLE-REMAINDER-FRAMES.json, the regeneratedIDLE-REMAINDER-FRAMES.json.gz(same environment) and the merged stdout/stderr log. All 4,838 calls must take the marshal path.Measured on macOS (Apple silicon), same host and fixture, 3 alternating rounds, with identical outputs every round:
Commands run:
python3.12 scripts/research_package.py --package research/audit-allcold-fast-copy:PASS_REGISTERED_RESEARCH_PACKAGE, about 80 s.--check-only: pass.python3 -B -m unittest discover -s tests -p 'test_research_*.py': 42 tests OK, 2 skips.git diff --check: clean.Limitations / not checked
make frontier1094-verify, because the frozenverify_t16.pycallsrun_portable.pydirectly. Wiring it in needs an opt-in driver or a maintainer decision (open question 1).audit_allcold.pyvariants were not checked.--localinput comes from the archived selected replay. It is bound by the archivedASYNC-AUDIT.jsonequality, not by a fresh cold baseline1042 run. A full coldmake frontier1094-verifywas not rerun.UPSTREAM-PINS.jsondependencies are enforced by the stage itself, but they are not declared as this package's CI inputs.Credit
The audited code is from the retained gauge44 / PR1087 lineage:
audit_allcold.pycontroller audit and its mutation controls (OpenAI Codex in the original packages);run_portable.pywrapper fromcomplex-k492-owner-repair;The opt-in, byte-identical adapter pattern follows #1880, #1874, #1646 and
frontier1042-lec-parallel.Prepared by jackmgaller with substantial Claude Code (Claude Opus 5.5) assistance. Apache-2.0.
Workflow feedback (optional). The task chooser and overlap helper worked well. The biggest friction was getting the final stage's
--localinput without a 20-minute cold baseline. The archivedselected-replay.tar.gzprovider files solved it. Suggestion: document that fixture route in the bottleneck brief for replay-runtime work.🤖 Generated with Claude Code