Commit Graph
1174 Commits
Author SHA1 Message Date
Joseph MaglyandClaude Opus 5.5 52f4597589 Close the remaining symlinked-input gaps from review r2
- Re-check input identities inside every loadpath and pain-axis probe
  child before it imports torch or loads a model.
- Require the allowed inputs directory and every directory above it to be
  real directories, so a same-device link cannot replace the root.
- Walk each input path component by component as written, applying '..'
  only after the directory before it is checked, so a symlinked directory
  followed by '..' cannot be collapsed away; relative Hugging Face
  snapshot links still work.
- Capture identities before hashing at fetch and resume and require them
  unchanged afterwards, so the stored snapshot describes the hashed bytes.
- Narrow the documentation to exactly what is checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 19:46:42 -04:00
Joseph MaglyandClaude Opus 5.5 337df82298 Pin symlinked campaign inputs to one device and re-check them in workers
Address review r1 of the symlinked-inputs option:
- Lock the allowed directory's device and require every input component
  to sit on it, so a mount under the directory cannot stand in for it.
- Walk each input path with lstat and reject any symlinked directory,
  even one inside the allowed directory; only the final snapshot-to-blob
  link is followed.
- Record each validated input's path, device, inode, size and mtime, and
  have every model-loading worker re-check them before it starts. The
  window between that check and the load is documented as accepted for a
  single-owner input cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 19:00:37 -04:00
Joseph MaglyandClaude Opus 5.5 13e3982f9a Test symlinked-ancestor escapes and the reverse manifest lock
Cover a cached input reached through a symlinked parent directory that
leaves the allowed inputs directory, both at fetch and after fetch, and
refuse adding --symlink-inputs on resume of a root created without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:16:51 -04:00
Joseph MaglyandClaude Opus 5.5 7e23830236 Confine symlinked campaign inputs to one allowed directory
--symlink-inputs now takes the directory the cached inputs must live in.
Fetch refuses a cached file that resolves outside it and refuses a cache
miss rather than downloading. Fetch and every resume fail closed when an
input link is broken, leaves the allowed directory, has been replaced by a
regular file, or no longer matches its recorded hash. validate_fetch reads
the policy from the run manifest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:15:21 -04:00
Joseph MaglyandClaude Opus 5.5 be28ff900e Let the Qwen3.8 campaign symlink cached inputs from another filesystem
Add an opt-in --symlink-inputs option. Fetch then links each cached pinned
snapshot file into the run root with a symlink to its resolved cache path,
instead of a hard link, so the inputs can sit on a different filesystem from
the root without a full copy. Fetch still records every file's hash through
the link and each resume re-verifies them. The option is locked in the
manifest only when set, so existing roots resume unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:08:49 -04:00
Joseph Magly 4c3527f2ba Merge pull request #382 from jmagly/feat/pain-axis-qwen-32b-72b
Register Qwen2.5-32B/72B-Instruct in the Pain Axis replication harness
2026-10-23 10:43:01 -04:00
Joseph MaglyandClaude Opus 5.5 add78ba0b7 Register Qwen2.5-32B/72B-Instruct in the Pain Axis replication harness
The harness only knew the small models, so the Gitea #116 Phase B runs
at 32B/72B could not select their official S1/S2 ablation layers. Add
both from appC_ablation/02_ablation_large_models.py at the pinned
4d75cd90: Qwen_2.5_32B_instruct ("chat", 32, 38) and
Qwen_2.5_72B_instruct ("chat", 48, 60). The S2 layers match the shipped
4.2 steering references (L38, L60). The appendix-D and recovery scripts
take --name from this table, so they gain the same choices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:04:50 -04:00
Joseph Magly b9252dce78 Merge pull request #381 from jmagly/feat/campaign-min-free-disk
Add a locked --min-free-disk-gb admission for cached campaign inputs
2026-10-23 08:51:43 -04:00
Joseph Magly 9723421818 Merge pull request #380 from jmagly/fix/model-identity-iterator-errors
Map source-iterator and descriptor-close failures to ContractError
2026-10-23 08:19:40 -04:00
Joseph MaglyandClaude Opus 5.5 fee11f5dab Fail closed on cache misses and link failures under a lowered disk floor
Codex r1 on #381: a lowered --min-free-disk-gb did not enforce its
cached-input premise. A cache miss still downloaded and a failed hard
link silently fell back to a full copy, so a root admitted at 70-140 GB
could pull or copy ~108 GB. Below the 250 GB default, fetch now refuses
a snapshot that is not completely cached or cannot be hard-linked; the
same guard applies when an incomplete fetch is resumed. The default and
unlowered floors keep the download and copy fallbacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 07:55:29 -04:00
Joseph MaglyandClaude Opus 5.5 cce21520e8 Add a locked --min-free-disk-gb admission for cached campaign inputs
The Qwen3.8 campaign refuses a new root below 250 GB free. That floor
assumes both pinned snapshots (~108 GB) are downloaded; when they are
already in the local Hugging Face cache on the root's filesystem, fetch
hard-links them and that share is not needed. An operator can now lower
the initial admission explicitly (at least the 70 GB resume reserve).
The value is locked in the manifest only when set, so existing roots
resume unchanged, and must be repeated on resume.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 07:48:21 -04:00
Joseph MaglyandClaude Opus 5.5 d242b3f725 Map iterator-initialization failures to ContractError
Codex r1 on #380: iter(source) only mapped TypeError, so an __iter__
raising OSError, csv.Error or StopIteration (directly or as a PEP 479
RuntimeError) still leaked. Apply the same narrow provider-error and
cause-checked RuntimeError mapping at initialization; normal exhaustion
in next() is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 07:41:04 -04:00
Joseph MaglyandClaude Opus 5.5 83946b36dc Map source-iterator and descriptor-close failures to ContractError
Follow-ups from the #379 review:
- A StopIteration raised inside the live discovery generator (for
  example from distribution.metadata["Name"]) became a RuntimeError under
  PEP 479 and escaped the contract mapping. Only the converted form is
  mapped; unrelated RuntimeErrors still surface.
- OSError and other provider errors raised while iterating a caller
  supplied distribution source now map to ContractError.
- An OSError from os.close in _regular_file_digest no longer escapes the
  finally block raw; a failed close never reports a digest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 07:36:14 -04:00
Joseph Magly 6a6b6c3ad4 Merge pull request #379 from jmagly/fix/package-digest-oserror
Map OSError and StopIteration from distribution metadata to ContractError
2026-10-22 23:11:17 -04:00
Joseph MaglyandClaude Opus 5.5 03da4985f9 Map OSError and StopIteration from distribution metadata to ContractError
installed_package_set_digest() normalized csv/Key/Type/Unicode errors from a
distribution's metadata, version and METADATA/RECORD reads, but an unreadable
metadata file (OSError, e.g. PermissionError) or a provider whose lookup
exhausts an iterator (StopIteration) escaped the contract instead of
surfacing as LMS_DEPENDENCY_DRIFT. Catch both.

Tests: a provider raising PermissionError/OSError from METADATA/RECORD reads
and StopIteration from .version and .metadata maps to ContractError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 22:35:36 -04:00
Joseph Magly 5e685a5d8b Merge pull request #377 from jmagly/fix/egg-info-shadowing
Bind the package digest to the installed wheel, not source-tree egg-info
2026-10-22 22:24:32 -04:00
Joseph MaglyandClaude Opus 5.5 fa4aa5a905 Refuse a symlinked checkout egg-info; normalize csv.Error from RECORD
Review r2:
- The exempt checkout egg-info path was fully resolved, so a symlink to
  another checkout's or a user-site egg-info resolved to that install and
  exempted it. Canonicalize only the checkout root and append
  obliteratus.egg-info unresolved; a symlinked egg-info, or one resolving
  outside the checkout, raises ContractError.
- A RECORD field over csv.field_size_limit made distribution.files raise
  csv.Error outside the normalization. Catch it wherever RECORDs are
  parsed, so it maps to LMS_DEPENDENCY_DRIFT.

Tests: a symlinked checkout egg-info pointing at an external install that
is also visible (and one pointing back inside the checkout); an oversized
RECORD field for obliteratus and a third-party distribution, directly and
through both GPU candidate tiers; the site-containment guard on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:48:53 -04:00
Joseph MaglyandClaude Opus 5.5 6886d5596a Exempt only this checkout's egg-info; normalize malformed RECORD
Review r1: the exemption dropped any obliteratus.egg-info outside the
prefix sites, so a user-site, system-site or other-checkout install could
hide behind an approved digest. Exempt only the canonical
<checkout>/obliteratus.egg-info of the source tree this module runs from
(model_identity.py parents[2]); from an installed wheel that path is
inside a site dir and nothing is exempt. Every other visible obliteratus
distribution fails closed again.

A malformed RECORD made distribution.files raise ValueError outside the
normalization; it is now ContractError, so model_session reports
LMS_DEPENDENCY_DRIFT.

Tests: conflicting external egg-info (dir and file, before and after the
wheel on sys.path), symlinked checkout paths, prefix egg-info from a wheel,
malformed RECORD -> LMS_DEPENDENCY_DRIFT on both GPU candidate tiers, and
PEP 660 / .egg-link editable layouts failing closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:37:55 -04:00
Joseph MaglyandClaude Opus 5.5 9129e765d1 Bind the package digest to the installed wheel, not source-tree egg-info
A non-editable install from a checkout leaves an untracked, gitignored
obliteratus.egg-info in the source root. The llama-tp gate and its TP
workers run with the checkout on sys.path, so importlib.metadata also
discovered that egg-info. installed_package_set_digest() enumerates every
visible distribution, so the stale build artifact broke the live package
identity (LMS_DEPENDENCY_DRIFT) before any hardware evidence was written.

model_identity now locates exactly one .dist-info for obliteratus under
the active prefix's purelib/platlib, requires its RECORD to own the
package that PathFinder finds there, and fails closed otherwise (no
wheel, egg-only, duplicate or disagreeing installs, ownership mismatch).
A setuptools source-tree obliteratus.egg-info outside the site dirs is
excluded from the inventory only after that wheel is found. All other
metadata/RECORD and duplicate checks are unchanged; a clean install keeps
the same digest.

run_conditional_gate.py refuses llama-tp-local-gpu up front (not_run,
exit 2, actionable message) when the checkout root holds an
obliteratus.egg-info, before any probe or GPU time; --allow-missing does
not bypass it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 21:22:41 -04:00
Joseph Magly 3d178f3379 Merge pull request #375 from jmagly/fix/gate-summary-git-sha
Record the real git SHA and dirty flag in conditional gate reports
2026-10-22 21:09:42 -04:00
Joseph Magly aade685d6a Merge pull request #376 from jmagly/fix/gloo-verify-load-tolerant-timeouts
Give live gloo tests load-tolerant stage budgets
2026-10-22 20:59:20 -04:00
Joseph MaglyandClaude Opus 5.5 ce9f7efd9b Allowlist the git environment instead of denylisting overrides
Review r4: inherited GIT_TRACE* survived sanitization, and a trace aimed at
/dev/stdout corrupted the captured SHA and status ("local", dirty). This
was the third surviving-GIT_* finding, so close the class: drop every
inherited GIT_* variable and set only GIT_OPTIONAL_LOCKS=0,
GIT_TERMINAL_PROMPT=0 and GIT_NO_LAZY_FETCH=1.

The sanitizer test now requires exactly those three GIT_* names (including
when an unknown GIT_* control is inherited). A real-git regression test
aims each of GIT_TRACE, GIT_TRACE_SETUP, GIT_TRACE2, GIT_TRACE2_EVENT and
GIT_TRACE2_PERF at /dev/stdout and requires the checkout's clean HEAD.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 20:32:16 -04:00
Joseph MaglyandClaude Opus 5.5 0a6bb0de89 Also drop git stdio redirection and config selection; never prompt
Review r3: GIT_REDIRECT_STDIN/STDOUT/STDERR survived sanitization. On Git
for Windows, GIT_REDIRECT_STDOUT sends output past the capture pipe, so a
dirty tree would read as clean and HEAD could fall back to "local".
Drop them, and GIT_CONFIG_NOSYSTEM, which the documented list already
claimed. Set GIT_TERMINAL_PROMPT=0 and GIT_NO_LAZY_FETCH=1 and run git
with stdin closed. The sanitizer test asserts all of these.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 20:27:58 -04:00
Joseph MaglyandClaude Opus 5.5 cdde845a99 Restore original collective limits; size reapers for unchecked intervals
Review r2: "stage budgets + one stalled collective" only holds where a
cooperative deadline is checked. PROBE's DISTILL tail, surgery's
post-EXCISE restoration and VERIFY's rollback run unchecked.

Restore the pre-PR process-group timeouts (VERIFY 4 s; PROBE, surgery and
model 5 s). The observed flake was the 5 s EXCISE stage budget, and the
original collective limits held under the same load. Each reaper is now
checked stage budgets + (collectives outside stage clocks + each unchecked
interval + each stage's longest overshoot interval) x collective timeout +
one stalled collective + exit. Counts are named constants with production
source pointers: model 45 s, PROBE 520 s, surgery 695 s, VERIFY 914 s,
VERIFY rank-exit setup 638 s. The short oracles are unchanged from r2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 20:21:19 -04:00
Joseph MaglyandClaude Opus 5.5 e0646aa35c Run git metadata commands with a sanitized environment
Review r2: inherited GIT_DIR / GIT_WORK_TREE / GIT_INDEX_FILE and similar
variables override git -C, so the resolver could report another
repository's HEAD or dirty state. Drop every repository-, index-,
object-store-, namespace- and config-selecting variable before running
git, and set GIT_OPTIONAL_LOCKS=0 so status never writes the index.

The real-repository test fixture builds its git environment from the same
helper (plus stripping any other GIT_* variable) so the two cannot drift.
A new test redirects GIT_DIR/GIT_WORK_TREE/GIT_INDEX_FILE to a second
repository, with and without an invalid GITHUB_SHA, and requires the
checkout's own HEAD and dirty state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 20:21:17 -04:00
Joseph MaglyandClaude Opus 5.5 0e63f44532 Restore the short rank-loss oracle and fix the model reaper
Review r1:
- The model gloo ordinary worker runs three sequential gathers, so its
  reaper is now 3 x collective + exit (120 s) instead of 60 s.
- VERIFY rank_exit had inherited the 30 s ordinary collective limit and
  the 240 s reaper, so a hung survivor could still pass. It gets back its
  own 4 s group limit, an 18 s failure reaper that starts after setup,
  and an in-rank assertion that the survivor fails within 12 s of the
  verify_before boundary. A reaper-killed survivor now fails the test.

State the reaper policy at each file's constants: a collective timeout
bounds one stalled wait, so each reaper covers the stage budgets in its
window plus one stalled collective plus cleanup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 20:08:49 -04:00
Joseph MaglyandClaude Opus 5.5 79914ca4fa Validate GITHUB_SHA and git HEAD independently; align the summary producer
Review r1: a non-empty but invalid GITHUB_SHA short-circuited the
resolver to "local" even when the repository HEAD was valid. Validate
each source on its own and fall back to "local" only if both fail.

Move the git helpers to scripts/conditional_gate_metadata.py and use them
from conditional_gate_summary.py too, so the workflow summary records the
same git_sha and git_dirty. Add summary-producer cases and a real
temporary-repository test for clean, tracked-dirty and untracked states.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 20:08:47 -04:00
Joseph MaglyandClaude Opus 5.5 f4bc236351 Give live gloo tests load-tolerant stage budgets
On a contended host (load ~16, nice 10) three live VERIFY tests failed
with LMS_EXCISE_TIMEOUT: the 5 s EXCISE setup budget, which those tests
do not exercise, ran out during spawn, torch import and rendezvous. The
same file passed 71/71 alone.

Name the budgets, raise only the ones that are not under test (ordinary
EXCISE/VERIFY/PROBE stages and collectives), and derive each outer
reaper from the stage budgets it must outlast. Timeout, rank-loss and
hang oracles keep their short limits and unchanged assertions. Healthy
runs do not wait longer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:50:15 -04:00
Joseph MaglyandClaude Opus 5.5 5fe701e064 Record the real git SHA and dirty flag in conditional gate reports
Gate runs on lab hosts have no GITHUB_SHA, so every report said
git_sha "local" and the evidence could not be tied to a commit from the
summary alone. Resolve GITHUB_SHA, then git rev-parse HEAD of the
script's repository, then "local"; accept only 40/64-char lowercase hex.
Add git_dirty (tracked changes at report time; null when git is
unavailable). schema_version stays 1; the field is additive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:50:12 -04:00
Joseph Magly 54e6066099 Merge pull request #369 from jmagly/fix/phase-admission-multigpu-input
fix(admission): resolve attention execution device nearest-first on split models
2026-10-22 18:31:08 -04:00
Joseph MaglyandClaude Opus 5.5 10b397cc7b fix(admission): require alias agreement for ancestor hooks; resolve inputs upward
Review of 54f600e (both regressions from r6):
- The direct-chain shortcut returned an ancestor hook from one direct
  registration while a hooked container alias disagreed (FP32 -> BF16
  flip). Only the projection's own hook still short-circuits; ancestor
  hooks require agreement across all indexed paths, including container
  aliases, or resolution raises.
- Automatic input-device resolution still enumerated the whole graph
  downward and exhausted the budget on an alias-free 48 x 128 expert model,
  so resolve_input_execution_device raised before its CPU-storage
  fallback. It now uses the budgeted parent index and walks upward from the
  target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 17:56:57 -04:00
Joseph Magly d2d52bd92c Merge pull request #374 from jmagly/fix/verify-logit-vocab-contract
fix(verify): accept padded model vocabularies and report forward failures precisely
2026-10-22 17:50:40 -04:00
Joseph MaglyandClaude Opus 5.5 5da7ec7bb4 fix(verify): require a corroborated global extent for sharded heads
Review of 5a4835e: with no manifest global shape, a sharded head fell back
to mutable config.vocab_size, so 16-row shards with config vocab 16 passed
on both ranks. A vocab-sharded head now needs the manifest global row
extent corroborated by the live local weight shape and a complete even
shard layout (local rows x world size, per-rank start/end and rank
shards); config alone never establishes it, and anything else fails closed
with LMS_VERIFY_FORWARD_CONTRACT in baseline and post-edit revalidation.
Docs state the exact rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 17:11:28 -04:00
Joseph MaglyandClaude Opus 5.5 54f600e013 fix(admission): charge traversal work before allocating; index parents once
Review of f962934:
- The traversal budget was checked per pop, after materializing all
  children and queueing copied path sets, so wide or deep trees could
  exhaust memory first. The walk is now a lazy DFS with one mutable path;
  every edge read (including pruned edges) and every generated state is
  charged before it happens.
- Admission scanned the whole model per layer, rejecting large alias-free
  models (48 layers x 128 experts). A decisive own or direct-chain hook now
  skips alias enumeration, and one reusable parent index per admission call
  derives ancestry upward from the target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 17:11:27 -04:00
Joseph Magly 3b65d7336d Merge pull request #371 from jmagly/fix/llama-tp-local-rendezvous-host
fix(tests): static rendezvous for local TP2 and torchrun 2.13 worker env
2026-10-22 15:53:43 -04:00
Joseph MaglyandClaude Opus 5.5 5a4835eb96 fix(verify): trust only the global head extent and keep decisions tokenizer-valid
Review of 579125a:
- For a vocab-sharded head the observed logits width was accepted as the
  vocabulary, so identical shard-width outputs passed. The width must now
  match the manifest global row extent (config as fallback); without a
  trusted extent VERIFY fails closed with LMS_VERIFY_FORWARD_CONTRACT.
- Refusal decisions took argmax over the full padded width, so a model-only
  column could win and hide a refusal. Selection is restricted to tokenizer
  ids; full-width log_softmax and finiteness checks are unchanged.
- Adds real 2-process gloo cases (padded vocab, shard-width mismatch, rank
  width disagreement) asserting identical exact codes and rollback, and
  tightens the gloo code-agreement test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:50:17 -04:00
Joseph MaglyandClaude Opus 5.5 f962934b07 fix(admission): reject composed ancestry cycles and bound resolution work
Review of ced0acb:
- Per-segment paths could compose into a cycle (attention.parent = layer
  gave projection -> layer -> attention -> layer -> root and picked the
  layer CPU hook over attention CUDA hook). Composed routes must now be
  acyclic and segment walks may not cross other ancestry anchors; proven
  direct edges are kept.
- Resolution work was unbounded (shared-subgraph re-expansion, 64^3
  products). Alias walks now fail closed past 10,000 node visits and
  composition past 256 paths, with deterministic budget tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:50:16 -04:00
Joseph Magly 1d37d1f7bb Merge pull request #372 from jmagly/fix/distributed-containment-teardown
fix(distributed): keep diagnostic containment from hanging or tripping
2026-10-22 15:42:03 -04:00
Joseph Magly 7181e677d8 Merge pull request #370 from jmagly/fix/qualification-ansi-topology
fix(qualification): parse nvidia-smi topology through ANSI escapes
2026-10-22 15:41:54 -04:00
Joseph MaglyandClaude Opus 5.5 579125aaa8 fix(verify): accept padded model vocabularies and report forward failures precisely
VERIFY's batch forward vote required logits.shape[2] == plan.vocab_size,
where plan.vocab_size is the tokenizer vocabulary. Models commonly pad
their output vocabulary beyond the tokenizer (the TP2 fixture: 32 vs 9;
also Llama-3, Qwen), so VERIFY rejected them, and any contract or
forward failure was reported as LMS_VERIFY_NONFINITE. Found on 2x A100
(llama-tp-local-gpu baseline: logits (2,2,32), tokenizer vocab 9, all
finite).

- New closed codes LMS_VERIFY_FORWARD_FAILED (forward raised) and
  LMS_VERIFY_FORWARD_CONTRACT (logits type/layout/shape/vocab/device/
  dtype or rank disagreement); NONFINITE is finiteness-only. Votes run in a
  fixed order so every rank raises the same code.
- Output width must equal the model's own vocabulary (replicated head
  weight, out_features or config; observed and rank-agreed width for a
  sharded head), be >= the tokenizer vocabulary, and match between the
  pristine and post-edit evaluations. Token ids stay tokenizer-bounded.
  Memory admission accounts for the full output width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:12:31 -04:00
Joseph MaglyandClaude Opus 5.5 1bc7bbad49 fix(tests): open the worker log directory without following any symlink
Review of 9eabacc: lstat/O_NOFOLLOW only protected the final path
component, so a symlinked ancestor (e.g. /var/run) was accepted and
mkdir(parents=True) followed ancestors before validation. The opt-in log
directory is now walked from "/" one component at a time with
O_DIRECTORY|O_NOFOLLOW relative to the parent fd, missing components are
created 0700 relative to that fd, relative paths and ".." are rejected,
and ownership/permissions are checked on the final opened fd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:12:02 -04:00
Joseph MaglyandClaude Opus 5.5 ced0acb79c fix(admission): compose attention ancestry per segment and fail closed on gaps
Review of 6496f18:
- An unregistered projection fell back to [projection, attention, layer,
  model] and skipped the layer's known registered path (e.g. a hooked
  model.model), so a CPU root could win over a CUDA backbone.
- The projection path was taken relative to the layer, so an alias
  registered before self_attn could bypass the attention module's hook.
Ancestry is now composed from independent segments (projection ->
attention, attention -> layer, layer -> root), each with all registered
alias paths. A direct unregistered attribute proves only its own edge.
Every composed path must agree; a gap without a decisive nearer hook
raises "unresolved attention ancestry" (fail closed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:11:08 -04:00
Joseph Magly d2303e0610 Merge pull request #373 from jmagly/fix/distributed-manifest-digest
fix(distributed): use one canonical digest for manifest parameter values
2026-10-22 15:08:11 -04:00
Joseph MaglyandClaude Opus 5.5 ee9b3ac1bc fix(distributed): restore progress-bar state exactly and on entry failure
Review of 91227c3: toggling Transformers progress bars also flips
huggingface_hub global and per-group progress state, and the disable ran
outside the restore boundary. The guard now captures the Transformers
flag and the Hub global and group state, disables inside try/finally, and
restores each piece exactly (best effort per piece, never masking the
original exception). Only the resource tracker is pre-started; forkserver
is not claimed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:32:54 -04:00
Joseph MaglyandClaude Opus 5.5 9eabacc911 fix(tests): validate opt-in worker log directory; fix fd test
Review of e3ab98d: OBLITERATUS_TP_WORKER_LOG_DIR accepted existing
world-writable or symlinked directories. It must now be a private
(owner-only, no group/other write) non-symlink directory owned by the
current user, and log files are created relative to an O_NOFOLLOW
directory fd with O_EXCL and mode 0600; anything else fails closed. The
launch/wait fd test now tracks each launch's descriptors separately so it
no longer depends on fd number reuse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:32:52 -04:00
Joseph MaglyandClaude Opus 5.5 5f99489b80 fix(qualification): reject malformed topology matrices
Review of f28d02a: rows were accepted by minimum length, so a row missing
its diagonal X could map GPU0->GPU1 as NV12 and satisfy --require-link
nvlink while the reciprocal row said PHB. parse_topology now requires
exactly one complete row per header GPU, an X diagonal, known link tokens
(NV#, PIX, PXB, PHB, NODE, SYS) and symmetric links, and raises
otherwise so diagnostics record an error instead of a false pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:32:50 -04:00
Joseph MaglyandClaude Opus 5.5 62acc92034 fix(distributed): use one canonical digest for manifest parameter values
Native TP load set ParameterManifestEntry.local_value_digest and
replicated_value_digest with model._tensor_digest (sha256 of raw bytes),
while EXCISE (_build_operation_plan) and VERIFY (_logical_state_roots with
require_manifest_values) compare probe_contracts.tensor_digest (dtype +
shape + bytes). The pristine-digest check could therefore never pass on
the native TP path: both ranks of llama-tp-local-gpu on 2x A100 failed
EXCISE with "mutable parameter storage or pristine digest changed".

Load now uses probe_contracts.tensor_digest and the raw-bytes helper is
deleted; hashing failures keep LMS_RUNTIME_PROFILE_MISMATCH. A CPU
contract test builds the manifest through the real load-validation path
and feeds it to the real EXCISE admission and VERIFY value checks
(accept unchanged, reject one-element mutation), plus BF16/FP32 digest
identity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:18:36 -04:00
Joseph MaglyandClaude Opus 5.5 6496f18a43 fix(admission): resolve through the full registered path; guard alias cycles
Review of 4acb271:
- Explicit [projection, attention, layer, model] ancestry skipped real
  hook owners such as Llama's model.model and any container between layer,
  attention and projection. Attention admission now builds the complete
  registered path through THIS layer (projection -> layer -> root) and only
  falls back to the explicit list for unregistered wrappers.
- Alias enumeration via named_modules(remove_duplicate=False) recursed
  through registered back-references. It is now an iterative walk with a
  path-local ancestor guard and a 64-path bound.
- The target's own hook decides before any alias scan, and the
  unsupported-hook message no longer mentions the input embedding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:14:36 -04:00
Joseph MaglyandClaude Opus 5.5 91227c3133 test(distributed): write canaries to real fds in containment tests
pytest replaces sys.stdout/sys.stderr with capture objects, so print()
never reached fd 1/2 and the fail-closed tests could not trip. Write the
canaries with os.write on the real descriptors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:07:06 -04:00
Joseph MaglyandClaude Opus 5.5 ca761eff09 fix(distributed): keep diagnostic containment from hanging or tripping
On 2x A100 the native TP2 session failed in two ways inside the fd
redirect containment:
- a multiprocessing.resource_tracker started lazily during the redirect
  inherited the sink pipe as stdout, so the reader never saw EOF and
  teardown hard-exited 70;
- transformers' "Loading weights" progress bar wrote to stderr and
  tripped LMS_DIAGNOSTIC_REDACTION_FAILED.
Start the resource tracker before redirecting, and disable transformers
progress bars while either guard is active (restored afterwards). Real
output still fails closed; a hung reader still exits 70.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:05:33 -04:00