Commit Graph
77 Commits
Author SHA1 Message Date
Joseph MaglyandClaude Opus 5.5 a559c7fd6c Merge main into feat/obs-execution and unify device-aware model identity
Integrate the weight fingerprint from #451 with CUDA execution:

- model_identity is now device-aware (require_dense_device) and always
  includes the weight fingerprint, so CUDA runs carry it too;
  execution_identity simply delegates. The fingerprint is
  device-independent: the same weights give the same digest on CPU and
  CUDA.
- New optional spec setting model.fingerprint ("sampled" default,
  "full"), dropped from the filled spec at its default so existing
  digests are unchanged. It applies to the run's model identity and
  therefore every step's reuse check; capture manifests keep a sampled
  fingerprint.
- Resolve additive conflicts in capture_identity.py, inputs.py, the risk
  map and OBSERVATION_RUNS.md by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 16:47:38 -05:00
Joseph MaglyandClaude Opus 5.5 2539cdb2b7 feat(experiments): chat templates, seeded sampling, batching and CUDA observation
Remove the observation runner's execution limits.

- Chat templates: an optional prompt section renders each prompt
  through the tokenizer's chat template (optional system message,
  generation prompt), tokenized without extra special tokens. The
  rendered-prompt digest joins the generation step identity and each
  record; capture uses the same rendered prompts.
- Decoding: seeded sampling (temperature, top-p, top-k) alongside
  greedy, with a per-example seed derived from the spec seed and example
  id. Comparison treats sampled outcomes as exact only when strategy,
  device, dtype and seed match, and says why otherwise.
- Batching: optional left-padded greedy batches with an explicit,
  recorded pad token; rows are cut at their first eos so batched and
  unbatched outcomes agree. Sampling with batches is refused because
  per-example seeds cannot hold.
- Devices: dense CUDA for the runner and capture, with shards written
  from CPU copies and device/dtype recorded. Quantized, offloaded,
  dispatched, meta, split-device and MPS models are refused with
  explicit reasons.

The schema stays additive within version 1; options at their defaults
are dropped from the filled spec, so existing spec digests are
unchanged (pinned in tests).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 16:33:51 -05:00
Joseph MaglyandClaude Opus 5.5 bbb0177915 feat(analysis): fill baseline profile work counters
Baseline profiles reported unique examples, token presentations,
forwards, generated tokens and tensor bytes as null. Count them from
load completion through cleanup with pass-through observers: a forward
pre-hook on the loaded model and instance-level wrappers on generate and
activation collection, all removed on exit and after failures.

Counters are recorded per stage and totalled. A counter that cannot be
observed stays null with a reason (stages before load, calls without an
attention mask or input ids, batched generation, forwards outside
activation collection, or embedding calls that bypass the watched
model). Changes are additive within profile schema version 1; default
baseline artifacts are unchanged, profiled or not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:35:46 -05:00
Joseph Magly 362acdb87b Merge pull request #430 from 0xreconlion/fix/bounded-norm-reduction
Bound norm-capture scratch to a chunk budget instead of promoting a whole weight
2026-11-11 14:52:58 -05:00
Joseph MaglyandClaude Opus 5.5 5b4291eebe fix(numerics): accumulate bounded norms on the host
frobenius_norm_bounded added each chunk's CUDA result into a CPU
float64 tensor, which raises a device-mismatch RuntimeError for any
weight not on the CPU. Norm capture and restoration run whenever
norm_preserve is on, so every GPU run would have failed.

Accumulate into a Python float instead. That keeps float64
accumulation and works on CUDA and MPS (which has no float64). Widen
chunks straight to contiguous memory so a transposed chunk is not
copied a second time by reshape, and run the reduction under no_grad.

Add a CUDA conditional test that fails on the previous head and covers
the helper and the real capture/restore path on a CUDA layer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:32:46 -05:00
Joseph Magly da21816610 test(analysis): record local RTX 4090 proof 2026-11-04 11:41:43 -05:00
Pliny the Younger 95d2825db1 Add conversational neuron studies with controlled trials and verified resets 2026-10-30 13:19:10 -04:00
Joseph Magly d2f6676882 build: prepare Python 3.11 and pinned Gradio security backport 2026-10-29 11:14:50 -04:00
Pliny the Younger 92775708f0 Preserve Neuron Lab evidence through a verified reset 2026-10-28 19:10:55 -04:00
Joseph Magly b88177b9a1 fix: expire neuron downloads with their browser session 2026-10-27 20:33:43 -04:00
Pliny the Younger a7846cb682 feat(ui): unify research workspace, paired neuron experiments and live surgery observatory
Add bounded contrast candidate screening, explicit prompt provenance, atomic paired conversations and redacted evidence exports. Unify the application shell and task navigation, add an opt-in per-run surgery event observatory, preserve public generator compatibility, and wire cooperative stream-close cancellation. Verify numerical invariants, lifecycle isolation and real Gradio paths.
2026-10-27 18:23:50 -04:00
Pliny the Younger 05f83d4e73 feat(ui): turn Neuron Lab into an interactive latent observatory
Add browser-local spatial activation replay with orbit, zoom, token travel, paused/reduced motion, and model-layer destinations. Render measured signed values faithfully with illustrative depth, and clean up retained-node listeners and detached scenes. Add runtime lifecycle, navigation, payload, and real Gradio regression coverage.
2026-10-27 17:28:07 -04:00
Pliny the Younger a2324b572f feat: turn Neuron Lab into an interactive activation workbench
Add a responsive amber control rack, signed activity chart and token map, ordered intervention cards, and measured comparison outputs. Preserve editor selection and one-sided clamp bounds across recipe changes; cover display escaping and callback flows.
2026-10-27 17:06:14 -04:00
Pliny the Younger 3873d0b2ba feat: add reversible Neuron Lab to Concept Lab
Add scoped native MLP channel controls, strict versioned recipes, and isolated Neuron Lab sessions with inspection, ordered editing, comparison, cancellation, and immutable exports. Cover arithmetic, lifecycle, real offline model forwards and Gradio callbacks; document the CPU reference boundary.
2026-10-27 16:11:54 -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 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 e3ab98da38 fix(tests): use static rendezvous for local TP2 and allow torchrun keys
On torch 2.13 the c10d backend gives workers MASTER_ADDR=getfqdn() and a
fresh MASTER_PORT from the shared TCPStore (launcher.api returns no
master endpoint for non-static backends), which the launcher contract
rejects. local_tp2 now uses --rdzv-backend=static with the profiled
--master-addr/--master-port and --node-rank=0; the is_host approach is
dropped. two_host_tp2 keeps c10d. Allow ROLE_NAME and
TORCHELASTIC_SIGNALS_TO_HANDLE (set by torchrun 2.13) and LC_CTYPE (PEP
538 locale coercion) in the worker environment. Verified on 2x A100.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:05:31 -04:00
Joseph MaglyandClaude Opus 5.5 eaca7f9177 fix(tests): host the c10d store for local TP2 and prefer physical NICs
The llama-tp-local-gpu gate failed on a 2x A100 host with
"DistNetworkError: The client socket has timed out ... connect to
(172.27.0.1, ...)". torch's c10d rendezvous only hosts the TCPStore when
_matches_machine_hostname(host) is true; on hosts whose hostname resolves
only to 127.0.1.1 no private IP matches, so every agent acts as a client.
The harness also picked a Docker bridge (br-*) because it took the first
RFC1918 address in sorted interface order.

- local_tp2 passes --rdzv-conf=is_host=1 (two-host shape unchanged).
- Interface ranking prefers non-virtual interfaces (docker, br-, veth,
  virbr, cni, flannel, tailscale, lo deprioritized) with the old rule as
  fallback; optional OBLITERATUS_TP_INTERFACE exact override.
- Opt-in worker log capture via OBLITERATUS_TP_WORKER_LOG_DIR (0600,
  O_EXCL); default stays DEVNULL.
Helpers move to tests/conditional/_llama_tp_harness.py with CPU tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 13:22:35 -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 593c4359cb fix: address review findings (gpu-driver)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 15:15:36 -04:00
Joseph MaglyandClaude Opus 5.5 7ef799b7ab fix: address review findings (gpu-driver)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 15:01:11 -04:00
Joseph MaglyandClaude Opus 5.5 85ffaf40fd feat(gpu): multi-GPU qualification driver and per-device admission
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 14:48:34 -04:00
Joseph MaglyandClaude Opus 5.5 7b164c1a98 fix: keep base arithmetic on ordinary inputs (core review B1/B2)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 03:00:23 -04:00
Joseph MaglyandClaude Opus 5.5 6e8352f5ca fix: address review findings (audit-core)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 00:33:43 -04:00
Joseph MaglyandClaude Opus 5.5 3b8eb06ddb fix: address review findings (audit-core)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 21:59:18 -04:00
Joseph MaglyandClaude Opus 5.5 a4a2eb4961 Merge upstream/main into feat/310-moe-expert-concepts
Resolve the risk-map conflict with #133 by keeping both new contract
surfaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 16:05:27 -04:00
Joseph MaglyandClaude Opus 5.5 6db06724f6 fix: address review findings for #133
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:44:13 -04:00
Joseph MaglyandClaude Opus 5.5 44a629297d fix: address review findings for #133
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:30:06 -04:00
Joseph MaglyandClaude Opus 5.5 b612c54acc fix: address review findings for #310
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:22:03 -04:00
Joseph MaglyandClaude Opus 5.5 0567ef6574 test(ui): report the actual operator-UI result when the concept-pack guard assertion fails
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 12:50:00 -04:00
Joseph MaglyandClaude Opus 5.5 d0f14f77d9 fix(ci): restore the hosted model and operator-UI conditional gates
Scheduled Conditional tests have failed since late August on two hosted
gates, which also blocks release certification:

- model-download-runtime: the operator-only Qwen3.8-27B BF16 regression
  lived in the gate file and always skips on hosted runners; the gate
  runner rejects any skip. Move it to tests/conditional/test_qwen38_runtime.py,
  outside every hosted gate.
- operator-ui: `uv sync --all-extras` now pulls the qwen-hybrid extra,
  whose causal-conv1d sdist builds only against a CUDA toolkit. Exclude
  qwen-hybrid there and in the tag-only supply-chain job, which runs the
  same sync and would fail the next release.

Policy tests pin both invariants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 11:39:27 -04:00
Joseph Magly 3d653241ae Merge remote-tracking branch 'upstream/main' into feat/246-ui-load-admission 2026-10-08 20:22:44 -04:00
Joseph Magly 84f5a508b8 Merge remote-tracking branch 'upstream/main' into feat/246-ui-load-admission 2026-10-08 19:39:53 -04:00
Joseph MaglyandClaude Opus 5.5 c925908f21 fix(ui): preserve resident model on pre-unload failures; hand off timeout cleanup (#246)
Failures before the previous model is unloaded restore metadata and status
without touching the resident model or lifecycle. Timeout and unstarted
worker paths transfer cleanup before the terminal yield so the slot is
never retained by a suspended generator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 19:28:59 -04:00
Joseph MaglyandClaude Opus 5.5 6d1e5d664f fix(ui): finish load-failure cleanup before releasing the model slot (#246)
Release lifecycle, drop references and free allocator memory before a
failed attempt's claim is rolled back, and roll back before obliterate's
terminal error yields when no worker remains.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 19:13:49 -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 5f7bd87774 fix(ui): guarded UI loads with shared load admission (#246)
Route every direct UI load/reload (chat lazy reload, session switch,
A/B comparison, post-run chat reload) through one guarded attempt in the
new gradio-free obliteratus/ui_model_load.py. The attempt calls the same
phase_admission.admit_model_load the CLI loader uses, with the same
confidence-tiered semantics and no UI-specific bound, and on any failure
drops partially loaded models, clears traceback-held tensors, frees
allocator memory and releases the lifecycle once.

Model-slot ownership is exclusive and transactional: a failed switch
restores the previous session metadata (previous model cleanly unloaded,
lazily recoverable from a validated checkpoint) and never publishes
partial state. Fixes the same-model deadlock in load_bench_into_chat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:42:20 -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 Magly 7fb9ea186d Merge remote-tracking branch 'upstream/main' into feat/244-tp2-export 2026-10-08 17:59:18 -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 Magly 57b4a2e808 Merge remote-tracking branch 'upstream/main' into fix/245-phase-admission
# Conflicts:
#	ci/test-risk-map.json
#	tests/test_conditional_gate_scripts.py
2026-10-08 16:47:14 -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 Magly 2ed95176a9 Merge remote-tracking branch 'upstream/main' into feat/248-portable-gsq 2026-10-08 16:27:45 -04:00
Joseph Magly 3f17ad49e6 Merge remote-tracking branch 'upstream/main' into fix/245-phase-admission 2026-10-08 16:04:12 -04:00
Joseph Magly 94c8a8974e Merge remote-tracking branch 'upstream/main' into feat/248-portable-gsq 2026-10-08 14:11:32 -04:00
Joseph MaglyandClaude Opus 5.5 2b33c2ec9b test(gpu): check native REBIRTH against its CPU-only demand
Native export streams tensors to host buffers, so the REBIRTH report has
no CUDA entry. Check the CPU bound and that CUDA growth stays within the
allocator allowance instead of requiring a CUDA demand.

Refs #245

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 14:05:59 -04:00
Joseph MaglyandClaude Opus 5.5 aa9ec452cd fix(gsq): derive run dtype from base weights, keep file modes, isolate e2e download
- Render model.dtype and quantization.logits_dtype from the base
  checkpoint's unanimous float weight dtype (safetensors headers), with a
  validated --dtype override; run, validate, and assemble refuse a config
  whose dtype disagrees with the base. A bf16 base renders exactly as
  before.
- Preserve original permission bits across atomic prepare, backups, and
  rollback; new files honor the umask.
- Download the e2e snapshot in a GSQ-interpreter subprocess so no HF
  client sockets outlive the call inside pytest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 12:54:05 -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 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 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