Repository navigation
Keep an inherited PYTHONPATH from hollowing out registered and selected replays - #4973
Conversation
run_command already drops PYTHONOPTIMIZE so a caller's environment cannot disable verifier assertions. PYTHONPATH has the same failure mode: it precedes the standard library on the child's sys.path, so a stray module named like a stdlib import can end a verifier with exit code 0 before any check, and the harness then prints PASS_REGISTERED_RESEARCH_PACKAGE. Drop it from the child environment too, with a regression test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`make frontier4470-verify` (the selected record's reproduce command) passes the caller's environment through verify_frontier4470.py and the pinned run_bounded.py to every job. With a stray PYTHONPATH holding gzip.py/copy.py that exit 0, it printed PASS_FRONTIER4470 while six of eight jobs ran nothing. Unsetting PYTHONPATH at the make target fixes the whole process tree without touching any pinned replay file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The three failing "Selected family 626/741/799 finite composition" replays fail in |
|
Because this PR changes |
Problem
scripts/research_package.py'srun_commandalready dropsPYTHONOPTIMIZE, so that a caller's environment cannot disable verifier assertions (test_inherited_optimization_cannot_disable_child_checks).PYTHONPATHhas the same failure mode and is still inherited.On a child's
sys.path,PYTHONPATHcomes before the standard library. A stray directory holding a module named like a stdlib import can therefore end a verifier with exit code 0 before any check runs. The harness accepts exit code 0. For example, with afractions.pythat only callssys.exit(0), at current main:This is not an adversarial scenario. It is an accidental local-environment hazard for the local replays that donors cite as evidence. A clean CI environment is presumably unaffected.
I found it while reviewing #4964, which fixes the same
PYTHONOPTIMIZEinheritance in one package's own wrapper. The review comment has the package-level reproduction.The selected record's reproduction command has the same gap
certificates/selected-result.jsonnamesmake frontier4470-verifyas its reproduction. That target passes the caller's environment throughscripts/verify_frontier4470.pyand the pinnedrun_bounded.pyto all eight jobs. Acceptance is exit code 0.At current main, with a
PYTHONPATHdirectory holding agzip.pyand acopy.pythat just exit 0 (neither module is imported by the parent), the replay printedin 44 s. Six of the eight jobs ran nothing: each took 0.51 s, and each log holds only the shadow message. Only
pr4470-arithmetic-checkandstage-zero-forced-translationreally ran.scripts/verify_frontier4470.pyandrun_bounded.pyare pinned incertificates/frontier4470-source.json, so they are left unchanged. The second commit instead runs bothselected-record-checkandfrontier4470-verifyunderenv -u PYTHONPATHin the Makefile, which is not pinned. That removes the variable from the whole process tree.With the same shadow
PYTHONPATH, the fixed target runs all eight jobs genuinely (4.6, 37.3, 14.3, 19.4, 3.6, 38.9, 0.5 and 1.0 s). No log contains the shadow message, and the replay passes. No record, manifest or pinned file changes.Other
scripts/verify_frontier*.pytargets and runners such asrun_parallel.pyandrun_isolated_tests.pylikely share the pattern. They are not changed here.Change
run_commandnow also dropsPYTHONPATHfrom the child environment, with a comment explaining why. It still leaves non-PYTHON*variables and explicit manifest options intact, such as deliberate-Ocontrols.test_inherited_pythonpath_cannot_shadow_child_imports. A shadowfractions.pythat exits 0 must not mask a child that exits 5. The test also checks that the parent'sPYTHONPATHis left unchanged.PYTHONHOMEis deliberately left alone: dropping it could break unusual but legitimate installs, and a wrong home fails loudly rather than silently. Requiring a success marker from each verifier, instead of exit code 0, would be a stronger follow-up. It needs a manifest field, so it is not attempted here.Test plan
PASS_SWAP_ROW_ORDER_CUT …and thenPASS_REGISTERED….VERIFY.jsonrelies on passingPYTHONPATHto verifiers.No research result, κ, selected-record or pinned-file change. Not run:
make verifyas a whole.Prepared by James Reed with substantial Anthropic Claude (Claude Code) assistance.
🤖 Generated with Claude Code