Commit Graph
1424 Commits
Author SHA1 Message Date
Joseph Magly 157045f8be Merge main e82235b into fix/675-e-persistence-notes 2026-11-25 15:35:26 -05:00
Joseph Magly 4a285a0484 fix(persistence): settle uncertain hard-link publishes by file identity
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.
2026-11-25 15:35:23 -05:00
Joseph Magly e82235b1f2 Merge pull request #680 from elder-plinius/fix/675-d-modelhandle-sites
fix(handles): clean up remaining ModelHandle sites and name the snapshot path once
2026-11-25 14:45:21 -05:00
Joseph Magly 5cebcf19c2 Merge main b7113e6 into fix/675-e-persistence-notes 2026-11-25 14:44:12 -05:00
Joseph Magly 285618db15 fix(persistence): keep refusal causes and report uncertain hard-link publishes
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
2026-11-25 14:44:10 -05:00
Joseph Magly b7113e6db7 Merge pull request #676 from elder-plinius/fix/675-a-recipe-diagnostics
fix(recipes): make cleanup diagnostics best effort without stdout fallback or duplicates
2026-11-25 14:38:02 -05:00
Joseph Magly 3f748ae5f2 Merge pull request #678 from elder-plinius/fix/675-c-archive-offload-coverage
fix(runs): report an unknown ~user in the environment archive root as ArchiveRootError
2026-11-25 14:31:06 -05:00
Joseph Magly 6426528d75 Merge pull request #674 from elder-plinius/fix/665-667-persistence-followups
fix(persistence): keep unpinnable staging, report uncertain publishes, refuse unpinned Windows rollback
2026-11-25 14:23:53 -05:00
Joseph Magly 6182b524ba Merge pull request #677 from elder-plinius/fix/675-b-evaluator-presets
fix(evaluation): keep padding-offset positions, train() restore, warn once, read-only presets
2026-11-25 14:19:06 -05:00
Joseph Magly 8bdd844e09 fix(handles): clean up remaining ModelHandle sites and name the snapshot path once
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
2026-11-25 13:45:14 -05:00
Joseph Magly c2e06ae155 Merge main e4ac974 into fix/665-667-persistence-followups 2026-11-25 13:36:04 -05:00
Joseph Magly ee71ce608f test(persistence): open a directory descriptor only where the code holds one
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.
2026-11-25 13:36:01 -05:00
Joseph Magly 7660e505ae Merge main e4ac974 into fix/675-c-archive-offload-coverage
# Conflicts:
#	CHANGELOG.md
2026-11-25 13:33:24 -05:00
Joseph Magly 269dd371c4 fix(runs): report an unknown ~user in the environment archive root as ArchiveRootError
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
2026-11-25 13:33:22 -05:00
Joseph Magly 878b2ba30e Merge main e4ac974 into fix/675-b-evaluator-presets 2026-11-25 13:33:15 -05:00
Joseph Magly 76bb612871 fix(evaluation): keep padding-offset positions, train() restore, warn once, read-only presets
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
2026-11-25 13:33:13 -05:00
Joseph Magly 820af1426d Merge main e4ac974 into fix/675-a-recipe-diagnostics 2026-11-25 13:33:06 -05:00
Joseph Magly e2e7e30799 fix(recipes): make cleanup diagnostics best effort without stdout fallback or duplicates
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
2026-11-25 13:33:04 -05:00
Joseph Magly e4ac974090 Merge pull request #671 from elder-plinius/fix/669-modelhandle-cleanup-followups
fix(models): harden ModelHandle cleanup sites and messages
2026-11-25 13:22:47 -05:00
Joseph Magly 4e1209e61e Merge main 11b2247 into fix/669-modelhandle-cleanup-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 12:53:38 -05:00
Joseph Magly 5d9ef4fa1c Merge main 11b2247 into fix/665-667-persistence-followups 2026-11-25 12:52:37 -05:00
Joseph Magly c271afa7d6 fix(persistence): repair the #645 changelog entry; make rollback tests platform-correct
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.
2026-11-25 12:52:35 -05:00
Joseph Magly 11b2247896 Merge pull request #672 from elder-plinius/fix/668-cleanup-gemma3-runs-followups
fix: close #668 cleanup-record, Gemma 3 and runs-archive follow-ups
2026-11-25 12:39:43 -05:00
Joseph Magly b1b1ec1e11 Merge pull request #673 from elder-plinius/fix/665-vocab-offload-followups
fix(vocab,offload): walk to the nearest flag-carrying tie owner; coalesce and propagate unavailable compares
2026-11-25 12:34:23 -05:00
Joseph Magly a1959fd163 Merge main 38d3792 into fix/669-modelhandle-cleanup-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 12:23:02 -05:00
Joseph Magly b45cd77155 Merge main 38d3792 into fix/665-vocab-offload-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 12:03:55 -05:00
Joseph Magly 7e75120cc0 Merge main 38d3792 into fix/665-667-persistence-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 11:58:37 -05:00
Joseph Magly 4cddb62b6a fix(persistence): keep unpinnable staging, report uncertain publishes, refuse unpinned Windows rollback
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
2026-11-25 11:58:23 -05:00
Joseph Magly 1e1b995ff7 Merge main 38d3792 into fix/668-cleanup-gemma3-runs-followups 2026-11-25 11:58:16 -05:00
Joseph Magly 06b2a3c779 Merge main 4898d06 into fix/668-cleanup-gemma3-runs-followups; address grok P3s
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.
2026-11-25 11:58:12 -05:00
Joseph Magly 38d37923a3 Merge pull request #664 from elder-plinius/fix/644-645-checkpoint-rollback-capacity
fix(persistence,snapshot): prove ownership before checkpoint rollback; bound exact-check scratch in snapshot plans
2026-11-25 11:52:04 -05:00
Joseph Magly 5c9042c807 Merge main 4898d06 into fix/665-vocab-offload-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 11:21:58 -05:00
Joseph Magly 4793e96f34 fix(vocab,offload): walk to the nearest flag-carrying tie owner; coalesce and propagate unavailable compares
_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
2026-11-25 11:21:56 -05:00
Joseph Magly 312a5ae329 Merge main 4898d06 into fix/669-modelhandle-cleanup-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 11:21:48 -05:00
Joseph Magly 55aad5525b fix(models): keep handle cleanup running through observer, storage and rmtree failures
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.
2026-11-25 11:21:46 -05:00
Joseph Magly 0030a32ccc Merge main 4898d06 into fix/644-645-checkpoint-rollback-capacity
# Conflicts:
#	CHANGELOG.md
2026-11-25 11:21:02 -05:00
Joseph Magly 0085617a3a fix(persistence): platform-neutral rollback test paths and accurate refusal messages
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.
2026-11-25 11:21:00 -05:00
Joseph Magly 4898d068d9 Merge pull request #670 from elder-plinius/fix/666-viewer-evaluator-preset-followups
fix(viewer,evaluator,presets): close #661/#663 review follow-ups
2026-11-25 11:15:54 -05:00
Joseph Magly 4ad55a64d1 Merge pull request #660 from elder-plinius/fix/652-654-recipe-cleanup-followups
fix(recipes): bound the cleanup-lock wait and keep cleanup failures primary over any close error
2026-11-25 11:11:05 -05:00
Joseph Magly 0070d28a59 fix: close #668 cleanup-record, Gemma 3 and runs-archive follow-ups
Failed-run cleanup stores the cleanup error whenever its note was not
attached, warns once (stacklevel 4, at run()/run_informed()) only when WARNING
was not emitted, and both entry points reset the record first. Gemma 3: drop
the gemma3_text->gemma3 remap in concept intervention/repair, add a bare
Gemma3Model language_model.layers fallback, and make _float16_source re-raise
only interrupts. runs archive: RecursionError, archive-root and dataset-path
failures become RunArchiveError (dataset paths checked before the run dir
exists); read_snapshot/read_ids raise InvalidArchiveRequest; a non-dict
manifest worker fails closed.

Fixes #668
2026-11-25 10:08:36 -05:00
Joseph Magly 3c7a6ca920 fix(models): harden ModelHandle cleanup sites and messages
Moves cleanup_on_exit/cleanup_during_error to the light
obliteratus.handle_cleanup module (re-exported from the loader) and imports
them at module top, so no import runs after a handle exists. Stores the closed
policy before detaching the restore point, names the path to remove in
handle-surfaced SnapshotErrors, guards post-load work in candidate,
smaller_change and the sequence loaders, keeps observer-close and neuron-lab
cleanup failures from replacing the primary error or skipping state reset, and
adds failure-plus-failing-close tests for every listed site.

Fixes #669
2026-11-25 10:06:29 -05:00
Joseph Magly ad14e8602d fix(persistence): end every rollback state in a verified restore or a refusal
Muse BT6 audit of 1418c51 for #664: _rollback_checkpoint_commit documents its
full state table and ends every state in a verified restore, a state proven to
need nothing, or CheckpointRollbackRefused naming the paths, including staging
recreated over a new destination and a backup that vanished after promotion
(a promotion_attempted flag, conservative by default, separates the two).
Without a held staging handle, staging is never pathname-deleted after any
rollback failure; the destination-and-staging branch raises
CheckpointRollbackRefused; identity checks require a directory.
2026-11-25 10:01:33 -05:00
Joseph Magly 2a0abae1f8 fix(viewer,evaluator,presets): close #661/#663 review follow-ups
The results viewer formats -0 and non-finite values like Python, survives
engines without toFixed(100), and shows an error when readAsText throws. CSV
export writes an empty metric name as `metric:` and orders columns by name
across all rows. StudyConfig rejects `metrics: []` at parse. The evaluator logs
the position_ids fallback and matches more rejection wordings, runs in eval
mode (restoring module modes afterwards), and handles left padding in
classification. Preset getters return deep copies.

Fixes #666
2026-11-25 09:59:06 -05:00
Joseph Magly 1418c5109c Merge main dd7cef9 into fix/644-645-checkpoint-rollback-capacity
Keep both sides: #659's snapshot close tests and this branch's snapshot plan
tests in tests/test_model_snapshot.py, and both CHANGELOG entries.
2026-11-25 07:51:30 -05:00
Joseph Magly b8de31cd5a Merge main 2e31f24 into fix/644-645-checkpoint-rollback-capacity; address Muse audit
Muse BT6 audit of 3500f9d for #664: an identity with st_ino == 0 counts as no
identity (rollback refuses, and held-staging cleanup leaves the path) on
volumes without file IDs; the move-aside is a no-replace rename and a foreign
entry found after the move is moved straight back; on filesystems without
no-replace rename nothing moves, so the promoted checkpoint and the backup are
both kept. Review r2 P3s: accurate notes when the move-aside fails, the
staging path named when kept, and a CHANGELOG entry referencing #667.
2026-11-25 07:50:35 -05:00
Joseph Magly dd7cef9332 Merge pull request #659 from elder-plinius/fix/639-640-651-modelhandle-followups
fix(models): report DiskSnapshot removal failures and close ModelHandle cleanup gaps
2026-11-25 07:42:55 -05:00
Joseph Magly d56ab8eb2d Merge main 2e31f24 into fix/652-654-recipe-cleanup-followups; make lock diagnostics best-effort
Muse BT6 audit of f95dc6b for #660: every stderr diagnostic in the recipe
cleanup lock paths goes through _diagnostic(), which retries with non-ASCII
escaped and otherwise drops the line, so a closed or strict-encoding stderr
can no longer stop a lock wait or replace the ProcessCleanupFailed / exit 4
conversion.
2026-11-25 07:30:53 -05:00
Joseph Magly 0eaee59905 Merge main 2e31f24 into fix/639-640-651-modelhandle-followups
# Conflicts:
#	CHANGELOG.md
2026-11-25 07:19:04 -05:00
Joseph Magly 2e31f24d92 Merge pull request #657 from elder-plinius/fix/643-gemma3-multimodal-layers
fix(strategies): resolve Gemma 3 multimodal decoder layers and hint bfloat16 on fp16 baseline overflow
2026-11-25 07:11:03 -05:00
Joseph Magly dd1c81dc9b Merge pull request #656 from elder-plinius/fix/647-653-failed-run-record-followups
fix(cleanup): keep unrecorded cleanup errors and report slot failures once
2026-11-25 07:05:59 -05:00