Adds focused tests for the #674/#682 rollback refusals, uncertain-publish
identity checks, held-staging cleanup races and digest manifest validation:
persistence_contracts.py coverage goes from 97.14/96.07 to 99.80/99.44
(line/branch), above the 97.80/96.88 base. The release comparison base for a
synced branch head (a merge commit that is neither main nor a tag) is now its
merge base with main instead of HEAD^, so changes brought in from main are not
counted as the branch's regressions; main and tag pushes still use the first
parent. No production code changes.
Refs #679
Grok review r1 for #685: the concept_pack budget (65 s) came from one sample
of a heap-sensitive test and was already exceeded (83.89 s). Owned budgets
are re-derived from the slowest of all five hosted release samples
(45678651612 both lanes; 45696135376 py3.11 head, py3.12 head and base):
concept_pack 105 s and recipe_application v2 35 s, the rest unchanged.
smaller_change low_variance and failing_collateral are owned at 20 s. The
CONTRIBUTING owned-tests section covers all 24 and states the rule.
Adds focused tests for the lines the release run left uncovered in
evaluation/evaluator.py, recipes/search.py, recipes/search_cli.py and
study_presets.py after #676/#677, so touched-module line and branch coverage
is back at or above the comparison base (run 45690313651). Raises the Quality
depth job timeout from 45 to 60 minutes; the 85% mutation floor and every
other threshold are unchanged.
Refs #679
Grok review r1 for #682: after a hard-link error that may have succeeded,
_publish_file_no_replace compares the destination's (st_dev, st_ino) with the
temp file's before renaming: the same file counts as published by this write,
a different file is a definite FileExistsError, and only an incomparable
identity stays uncertain. The uncertain-link test is platform-correct (on
Windows a rename onto the write's own link publishes normally). Windows
winerror 1/50 (no hard links) is a definite link failure. Adds tests for a
link that took effect despite EIO, a foreign file after EIO, and a definite
link error followed by an existing destination.
Rebaselines the release suite and marker duration budgets to the slowest
measured hosted release time + 25% (run 45678651612; suite 3910 s on py3.11
and 5340 s on py3.12; cpu 2010, integration 700, unmarked 2460) and owns every
test whose time + 25% exceeds 15 s under #679 with a 90-day review (follow-up
#684). Speeds up test_smaller_change rank1 (geometry environments built lazily)
and the recipe-search fake edit step (a light helper module). The PR core gate
now enforces per-test budgets on each shard's JUnit with a new
--testcase-budgets-only mode; suite and marker totals stay release-only.
Refs #679
Grok review r1 for #681: the dataclass scans in _holds_accelerator_tensor and
_validate_cleanup_result used generator expressions that closed over the
scanned value, so an interrupt left it alive on the traceback after
clear_frames on 3.11 and 3.12. They are plain loops now, with retention tests
for both; a set/frozenset transfer success test covers the previously
unexecuted set path.
Refs #679
Section E of #675: both rollback-refusal re-raise paths keep the refusal's
own cause in one chain (a refusal with no cause gets the commit error); a
hard link that errored uncertainly, followed by an EEXIST or unsupported
fallback rename, is reported as possibly published by this write rather than
"Output already exists"; a definite link failure with no rename says nothing
was published. CHANGELOG wrapping and the Windows staging residual note are
fixed. Directory os.open and unknown-~user tests are gated by capability and
platform, and the ArchiveRootError docstring names expanduser/Path.home.
Refs #675
On an interrupt, the comprehension and generator frames in _tensors_to_cpu
stayed on the traceback with their closure (memo), keeping every converted
result alive after clear_frames: lists and tuples on Python 3.11 (no PEP 709
inlining), sets on every version. They are plain loops now, with a regression
test for list, tuple, set and frozenset results. uv.lock moves
opentelemetry-api from 1.45.1 to 1.45.2 (GHSA-mf5v-w3w3-f6cg, via the mcp
extra); no other package changes.
Refs #679
Section D of #675: the neuron lab's load() drops the previous handle and its
state even when its cleanup fails (the failure is raised and nothing new is
loaded); `experiments trace` cleans up its handle on success and failure
without masking the trace error; default_model_factory cleans up the handle
when .to(device) fails, keeping the move error; a snapshot error raised
through a handle names the restore-point path once. Adds tests for the
sequence refusal branch and write_step(changed=False), and registers the
cleanup-site tests for inputs.py and trace_cli.py in the risk map.
Refs #675
The real checkpoint-windows job (run 45674242968) failed one test:
test_zero_inode_identity_is_never_proof_of_ownership (from #664) opened the
staging directory with os.open, which Windows refuses with PermissionError.
The descriptor half of the test now runs only where staging is held by a
descriptor; the handle-less and comparison halves run everywhere.
Section C of #675: default_archive_root() expands ~ and resolves home inside a guard, so an unknown ~user in OBLITERATUS_RUN_ARCHIVE/XDG_STATE_HOME gives the one-line runs error; tests cover the requested-dtype check's exception handlers in _float16_source; the offload_surgery docstring says None wins unless another slice differs and documents the recursive None branch as defensive.
Refs #675
Section B of #675: skip left-padding position_ids for models that number positions from padding_idx+1 (RoBERTa/XLM-R/CamemBERT-style); restore modes via train(mode) for modules that override it; log the position_ids fallback warning once per model; STUDY_PRESETS is a read-only mapping returning copies; README explains metrics null vs omitted with a preset.
Refs #675
Section A of #675: with stderr None, diagnostics are dropped instead of going to stdout; a failed flush never re-prints the line; recipe search/confirm keep exit 4 (no traceback) when stderr is closed or missing; docstrings say never raises an Exception / best effort; the contended-write test requires a failing print and the unencodable case asserts the refusal and CRITICAL lines.
Refs #675
Grok review r1 for #674: the #645 CHANGELOG entry is one coherent paragraph
that says rollback is manual wherever no staging descriptor is held,
including Windows (#667). The 20 rollback tests that assumed a held
descriptor branch on the same capability flag the code checks: without a
descriptor they assert the refusal and that nothing moved. Adds a test for an
EMFILE pin failure followed by a post-promotion refusal.
Failed checkpoint staging that cannot be held open (for example EMFILE) is
kept with a warning instead of being removed by pathname. Discovery publishing
names a file as possibly published unless the failure was a definite refusal
(FileExistsError / NoReplaceRenameUnsupported), and the note can no longer
replace the primary error. Windows rollback no longer trusts an unpinned file
ID: moving the promoted checkpoint aside refuses, matching POSIX. Docstrings
and CHANGELOG describe the Windows/pathname fallback.
Fixes#667
Refs #665
CHANGELOG conflict resolved by keeping both the #666 and #668 entries. Grok
review P3s for #672: dataset-input paths are stat()ed after resolve() so a
symlink loop is rejected on Python 3.13+ too, and the CLI loop tests patch
Popen; expanduser() runs inside the archive-root and dataset-input guards; the
warning-location wording says it points at run()/run_informed();
mcp_worker.worker_matches returns False for a non-dict worker.
_config_tie_flag lets a silent sub-model owner defer to the next enclosing
owner that declares tie_word_embeddings; the top level decides only when all
are silent (any-True across alias paths and fail-closed disagreement kept).
logical_values_identical batches narrow leading-index slices up to the chunk
budget and propagates None from recursion instead of folding it into False.
Docs: apply_all also verifies ID-only operations via a matching embedded
config pin.
Refs #665
Muse BT6 audit of 3c7a6ca for #671: the experiments runner cleans up the
handle even when observers.close() fails after a successful run; the neuron
lab notes a storage cleanup failure on the model-cleanup error and lets
interrupts win; candidate and smaller_change wrap directory removal so handle
cleanup always runs and the primary error stays primary (shutil imported at
module top). A shared run_during_error helper carries the logic, and the
replaced-restore-point warning names the path to remove.
Grok review r4 for #664: the backup-disappeared test compares against the
captured backup path, so it holds on Windows. Refusal messages follow
promotion_attempted, name staging only when something is there, and chain
from the original refusal; the backup restore is described as a no-replace
restore; CheckpointRollbackRefused and the CHANGELOG describe every refusal
case; _names_held_directory requires a directory.