Commit Graph
42 Commits
Author SHA1 Message Date
Joseph Magly 46fc677a70 test(distributed): preserve export and preflight failure boundaries 2026-10-29 01:39:44 -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 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 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 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 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 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 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 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 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 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
Joseph Magly 002e6e56e1 feat: complete local readiness across UI, MCP and memory admission
Integrate bounded admission, UI ownership and controls, opt-in durable MCP execution, rank-local TP2 groundwork, regression hardening and operator guides. Physical larger-memory and two-host qualification remain separate.
2026-10-20 17:58:20 -04:00
Joseph MaglyandClaude Opus 5.5 8dd6add995 fix(distributed): TP2 hardening before two-GPU qualification
Fixes eight reported defects in the native tensor-parallel path:

- #278 VERIFY admits host memory in a symmetric vote before allocating
  and broadcasting baseline input tensors.
- #280 require_record_consensus canonicalizes inside the poison-protected
  exchange and compares canonical payloads.
- #282 EXCISE votes on fallible digest preparation before the next
  collective.
- #285 preflight, model session, PROBE and EXCISE vote on rank-local
  preparation failures before the next collective, including the
  evidence-directory preparation that previously allocated before its
  all_reduce.
- #275 postcondition and VERIFY digest sets stream the full declared
  operation range (up to MAX_EXCISE_OPERATIONS) while preserving
  existing identities.
- #281 preflight source identity digests stream inventory records
  instead of using one 64 KiB control record.
- #286 the evidence checker requires an integer schema_version and
  checkout/source inventories are bounded and streamed.
- #276 standalone operation planning uses bounded chunked finite checks.

Each fix has CPU/Gloo regression tests, including one-rank fault cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 20:53:20 -04:00
Joseph MaglyandClaude Opus 5.5 37c2631916 fix(distributed): wait out unsettled preflight record publication (#305)
Private records are published by linking a fully written temporary file to
the target name and then unlinking the temporary name. A peer polling for
terminal evidence (or the coordinator polling receipts/acknowledgements)
can open the target inside that window, see st_nlink == 2, and get a raw
ContractError. _wait_for_evidence only retried FileNotFoundError, so the
non-coordinator rank escaped execute_preflight with an uncoded error (CI
saw {'LMS_RESOURCE_ADMISSION_DENIED', None}); on the success path the same
race made one rank fail while the coordinator published "preflighted".

Readers now raise PrivateRecordPending (a ContractError) for an extra link,
bounded pollers retry it like an absent record until their deadline, and
_wait_for_evidence converts any other read failure to the stable
LMS_EVIDENCE_UNAVAILABLE code so no rank leaves without a code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 16:43:16 -04:00
Joseph MaglyandClaude Opus 5.5 a258c16cd1 fix(distributed): keep failed layout admission storage-free
If the layout gather or record comparison raised, the exception skipped
AgreedTopologyRefusal, and execute_preflight then ran filesystem recovery.
Every layout-admission exception now becomes the terminal
AgreedTopologyRefusal. A local construction failure enters the gather with
an invalid record, so its peer is poisoned in the same exchange. Ordinary
failure evidence still runs only after successful admission. The docs now
place layout admission before lifecycle identity consensus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 20:14:25 -04:00
Joseph MaglyandClaude Opus 5.5 6a9f7dba1d fix(distributed): vote on the actual staging layout before preflight
The two-host refusal used local config fields, but lifecycle consensus binds
only the stored config digest, which a dataclasses.replace does not
recompute. One rank could refuse while its peer entered staging.

Every rank now gathers a fixed-size record of its actual layout (backend,
device kind, world and local sizes, observed launcher geometry) through the
poison-protected record gather before lifecycle consensus and staging. If
any rank refuses or the records differ, every rank raises the terminal
AgreedTopologyRefusal with no storage side effects. run_preflight,
execute_preflight and the live session share this single admission point.
Regressions cover the stale-digest counterexample, two-host refusal, and
unchanged one-host and CPU success and failure paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 19:50:14 -04:00
Joseph MaglyandClaude Opus 5.5 f26530c22c fix(distributed): make the two-host preflight refusal terminal on every path
execute_preflight caught the agreed two-host refusal as an ordinary failure
and then ran its filesystem recovery: the rank-0 attempt directory,
terminal receipts and shared evidence. On independent host storage that
produced asymmetric CLEANUP_INCOMPLETE and EVIDENCE_UNAVAILABLE outcomes.

A dedicated AgreedTopologyRefusal (LMS_TOPOLOGY_UNSUPPORTED) now passes
through execute_preflight, the CLI and the live model session without
touching attempt, receipt, evidence or cleanup storage. One-host and
CPU-protocol failure handling is unchanged. Tests drive both mocked ranks
through every wrapper, forbid the storage helpers, and keep the one-host
receipt and evidence path as a must-not-regress check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 19:16:59 -04:00
Joseph MaglyandClaude Opus 5.5 4eb1a4cd4b fix(distributed): refuse live two-host stages that need shared storage
The archived topology commits predate the merged EXCISE, VERIFY and
EXPORT stages. A cross-stage audit for the one-GPU-per-host layout found:
- Live preflight and LOADED evidence use attempt storage shared by the
  ranks (rank-0 directory, nonce file, file receipts). They now refuse the
  two-host GPU layout after configuration consensus and before any
  staging access (LMS_TOPOLOGY_UNSUPPORTED; the model session reports
  LMS_TP_PLAN_UNSUPPORTED).
- Canonical EXPORT assumes one shared destination tree across writer
  ranks. It now refuses the layout with a voted
  LMS_EXPORT_TOPOLOGY_UNSUPPORTED before any resource or filesystem work.
- PROBE admitted host memory only on rank 0. Each rank now admits its own
  working set through the existing unanimous vote.
- The evidence checker reconstructs each attempt's topology from
  fixed-size redacted records. EXPORT's attempt hash binds the VERIFY
  binding set, and part 5's per-attempt hardware and mount checks are kept.
EXCISE, rank journals, VERIFY and the launcher are code-level compatible
and are covered by new mocked tests. Docs describe the refusals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:51:24 -04:00
Joseph MaglyandClaude Opus 5.5 da1573cb92 fix(distributed): reject malformed TP2 topology identities
(cherry picked from commit 2f164f69b0772db27e878905b26ff3eeb8478f2b)

Ported for #244 (part 6/6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:22:38 -04:00
Joseph MaglyandClaude Opus 5.5 0492ebaa35 feat(distributed): admit closed two-host TP2 topology
(cherry picked from commit 37f407850916ebe76575d73112c4d26fe08bf421)

Ported for #244 (part 6/6). Internal-only content from the archived
commit was dropped: .aiwg records and the internal security-docs test.
Doc and test conflicts keep upstream wording and add only the topology
references; internal tracker numbers were replaced with upstream framing.
Marked experimental in user docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:22:31 -04:00
Joseph MaglyandClaude Opus 5.5 7bd3e96914 fix(distributed): adapt EXPORT to the symmetric-failure VERIFY stack
Brings the ported canonical export up to the rules from parts 3 and 4:
- Every rank-local step that can raise is followed by a unanimous control
  vote before the next collective. This covers reconstruction, file I/O,
  safetensors write and reload, digests, validation, fault hooks and record
  construction. EXPORT votes use [17_000_000, 24_000_000).
- Tensor, file and index aggregates use streamed, domain-separated,
  length-prefixed digests (streamed_contract_digest), so every advertised
  limit works. Oversized HF indexes are refused before any write.
- One combined, voted host admission covers reconstructed tensors, gather
  buffers, serialization and reload copies, chunked digest and finite
  checks, metadata and the still-live VERIFY state.
- VERIFIED revalidation uses the guarded #274 helpers and logical roots, and
  requires the released journal.
- Cancellation and the deadline are rechecked before promotion and before
  return. Files are rehashed at the final gate. Cleanup or confirmation
  failure quarantines as LMS_EXPORT_STATE_UNCERTAIN, and strict backup
  cleanup never restores a partially deleted backup.
- Single-tensor output uses indexed naming. The HF index payload helper
  is shared with checkpoint_writer, with identical output.
- Docs use the upstream #244 framing and are marked EXPERIMENTAL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:48:28 -04:00
Joseph MaglyandClaude Opus 5.5 4c6a5c46f6 feat(distributed): add bounded distributed canonical export
(cherry picked from commit de990f633e151f329ef5e844ed55f60a9a0b247c)

Ported for #244 (part 5/6). Internal-only content from the archived
commit was dropped: .aiwg records and the internal security-docs test.
Doc and policy conflicts keep upstream wording and add only the export
references. The new Gloo test file carries the gloo marker and a
duration entry. Marked experimental in user docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 16:28:40 -04:00
Joseph MaglyandClaude Opus 5.5 db12542b0e fix(distributed): stream VERIFY aggregate identities
The whole-model parameter-root, corpus-metadata, sample-id and snapshot
aggregates were each a single bounded control record, so baseline
preparation failed past about 418 parameters even though larger models
are admitted. They are now streamed SHA-256 aggregates: a versioned
prefix, distinct domains, and length-prefixed canonical per-item records.
Only the 32-byte digest is exchanged through the symmetric consensus
primitives. Every advertised sample and parameter limit now works.
PROBE and EXCISE digests are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 14:18:42 -04:00
Joseph MaglyandClaude Opus 5.5 3969caeefa fix(distributed): bound VERIFY finite checks within the working term
Whole-parameter and snapshot finite checks on VERIFY paths now walk the
same bounded C-order chunks as tensor_digest, staying within the reserved
8 MiB working term. VERIFY's combined admission also counts EXCISE's CPU
projection storage when tensors live on the host. Standalone EXCISE
planning is unchanged. Digest regressions now cover rank-3/4 permuted
views, stepped slices and non-contiguous leading singleton and zero
dimensions, checked against the previous whole-tensor algorithm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 13:56:52 -04:00
Joseph MaglyandClaude Opus 5.5 5c4b9cf9c5 fix(distributed): stream tensor digests and admit combined stage peaks
- tensor_digest streams the canonical bytes through 4 MiB CPU chunks in
  C order. Digests are byte-identical to the previous whole-tensor
  serialization for every dtype (BF16 included), shape and stride, and
  numerical._tensor_digest reuses it. VERIFY reserves the bounded 8 MiB
  digest working set explicitly.
- The live VERIFY wrapper performs one unanimous combined host admission
  before EXCISE starts: retained baseline + EXCISE's own journal and
  restoration working set + VERIFY's peak + margin, against a single
  memory observation. It denies with LMS_EXCISE_RESOURCE_DENIED before
  any mutation. Rollback releases post-edit snapshots before loading the
  journal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 13:34:46 -04:00
Joseph MaglyandClaude Opus 5.5 d0bf5c31f6 fix(distributed): admit VERIFY peak working memory
Quality metrics are reduced in bounded 16-row chunks with float64
accumulators, so the KL intermediates no longer scale with the whole
snapshot. Padded log-probability batches are released inside the existing
voted steps. Host admission now budgets an explicit peak:
inputs + two retained snapshots + max(forward/log-prob batch, metric chunk)
+ margin. Tests cover the analytic peak, live allocation sizes, batch
lifetimes and numerical equivalence with the unchunked metrics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 13:14:48 -04:00
Joseph MaglyandClaude Opus 5.5 79344856c8 fix(distributed): prove whole-model rollback and bound VERIFY memory
- Rollback after a VERIFY failure now proves the whole model against the
  pristine baseline (voted, with consensus) before lifecycle emission or
  journal deletion. EXCISE alone proves only its edited operations. A
  failed proof keeps the journals, quarantines and reports
  LMS_VERIFY_STATE_UNCERTAIN instead of a clean rollback.
- Inference-mode setup moved inside the preparation vote, so nothing
  fallible sits between the vote and the TP forward. Failures inside
  the forward are documented as the bounded timeout / rank-loss boundary
  and tested with a real internal all_reduce.
- Retained logit rows are cloned out of the padded batch, so retained
  storage equals the admitted bytes.
- The hardware evidence checker validates each attempt against its own
  mount attestation while still requiring the same physical host and GPUs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 12:47:50 -04:00
Joseph MaglyandClaude Opus 5.5 e18fd1c219 fix(distributed): keep VERIFY collectives symmetric on local failure
Adapt the ported VERIFY stage to the symmetric-failure consensus model
from part 3. Every rank-local step that can raise outside the consensus
primitives (plan/record preparation, tensor broadcasts and copies, forward
inputs, metrics, digests, evidence, summary and result construction) is
followed by a unanimous control-group vote before the next collective, and
raw records go straight into the symmetric primitives. VERIFY votes use a
dedicated sequence range disjoint from EXCISE.

Rollback now requires unanimous committed eligibility and goes through the
hardened EXCISE restoration. Journal cleanup or lifecycle failure after
acceptance quarantines with LMS_VERIFY_STATE_UNCERTAIN, and cancellation
and the deadline are rechecked before the journal is deleted and before
VERIFIED is returned. Docs use the upstream #244 framing and are marked
EXPERIMENTAL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 12:24:35 -04:00
Joseph MaglyandClaude Opus 5.5 2ef2a76792 feat(distributed): verify collective edits fail closed
(cherry picked from commit 2fbc38cd512f1130b4931ba5a7ffaf2e666d3008)

Ported for #244 (part 4/6). Internal-only content from the archived
commit was dropped: .aiwg records and the internal security-docs test.
Doc conflicts keep upstream wording and add only the VERIFY references.
The new Gloo test file carries the gloo marker and a duration entry.
Marked experimental in user docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:53:55 -04:00
Joseph MaglyandClaude Opus 5.5 5ee711aace fix(distributed): make consensus primitives fail symmetrically
A rank-local preparation failure in gloo_all_gather_records,
require_consensus_digest or unanimous_vote now still joins the same
fixed-shape all_gather with a poison payload; the failing rank re-raises its
own error and every peer raises ContractError, so no rank can leave for a
different collective. The fixed-buffer/identical-bytes boundary is documented
as the process-fault limit handled by the bounded timeout and rank-loss path.

EXCISE now checks cancellation and the deadline after the final operation
before returning COMMITTED, and public rollback's ABORTING/ABORTED lifecycle
emissions are covered by quarantine handling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:45:37 -04:00
Joseph MaglyandClaude Opus 5.5 c23dc9c7e7 fix(distributed): vote on rank-local projection and digest steps
Every rank-local step that can raise inside distributed_project_weight
(validation, FP32 promotion, digests, reduction buffers) and the EXCISE
pre-update, prepared-update and rollback digests is now followed by a
unanimous control-group vote, so a one-rank failure cannot leave its peer
in a different data collective. Callers without a control group keep their
previous exceptions.

RankJournal.create() keeps ownership until both directory descriptors close;
every finalizer is attempted, and close failures surface as
LMS_EXCISE_STATE_UNCERTAIN instead of masking an earlier cleanup failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:21:03 -04:00
Joseph MaglyandClaude Opus 5.5 5d343f0ad3 fix(distributed): keep EXCISE collectives symmetric and journals owned
- Vote after each rank-local preparation step (clone, direction copy,
  finite projection result) so a local failure cannot desynchronize the
  projection collectives.
- Bind directions to the stored DISTILLED summary digests instead of
  re-hashing the current tensors.
- Clean up a journal whose creation failed after entries were written,
  surface cleanup failures as LMS_EXCISE_STATE_UNCERTAIN, close
  descriptors on rejected opens, and fsync the parent directory on
  journal creation and removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 18:16:44 -04:00
Joseph MaglyandClaude Opus 5.5 67dda15683 fix(distributed): harden excise failure evidence
(cherry picked from commit 9dcae3a30aac5c74c0eaa567d9682b1aadba3003)

Ported for #244 (part 3/6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 17:35:39 -04:00
Joseph MaglyandClaude Opus 5.5 52e42cc181 feat(distributed): add transactional excise rollback
(cherry picked from commit ba6e1bb45a964dd0980b2e1440debd93cf94da45)

Ported for #244 (part 3/6). Internal-only content from the archived
commit was dropped: .aiwg records and the internal security-docs test.
The new Gloo test file carries the gloo marker and a duration entry.
Marked experimental in user docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 17:35:33 -04:00
Joseph MaglyandClaude Opus 5.5 1b936c1dfc feat(distributed): add deterministic probe distill stages
(cherry picked from commit f9a289e267889c297cefcdc67eea92c4b8eb8d4d)

Ported for #244 (part 2/6). Internal-only content from the archived
commit was dropped: .aiwg records and the internal security-docs test.
Marked experimental in user docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 14:00:29 -04:00
Joseph MaglyandClaude Opus 5.5 52c906b4a3 fix(distributed): fail evidence setup symmetrically and close API allowlist
Rank 0 evidence-directory creation now feeds a collective vote so a
mkdir failure fails every rank promptly instead of leaving the peer
blocked in a barrier. The public API fingerprint helper accepts only the
reviewed critical-module allowlist. Declare the TP runner labels for
actionlint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 11:57:56 -04:00
Joseph MaglyandClaude Opus 5.5 8066e59c73 feat(distributed): add exact Llama native TP loader
(cherry picked from commit 4caf45b04a8faa55f191b22c069f58714236689b)

Ported for #244 (part 1/6). Internal-only content from the archived
commit was dropped: .aiwg records, internal runner-policy routing, and the
internal security-docs test. Marked experimental in user docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 11:23:27 -04:00
Joseph Magly 985c9e9363 feat: add safe distributed checkpoint intake and preflight 2026-09-04 19:43:53 -04:00