Commit Graph
7 Commits
Author SHA1 Message Date
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 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