Commit Graph
280 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 434e4a7235 feat(experiments): weight fingerprint, capture retention and attempt pruning
Weights edited in place under the same model id and revision were not
detected, expired captures still loaded, and run stores could not be
pruned because reused steps reference earlier attempts.

- Fingerprint: a deterministic fingerprint of every parameter and
  buffer (names, shapes, dtypes and a fixed strided sample of each
  tensor, with an optional full digest) joins the capture identity and
  the runner's model identity. Captures and steps from before the
  fingerprint are refused or recomputed with a recorded reason. The
  pipeline's entry-point cache identity is unchanged.
- Retention: load_capture refuses captures past expires_at unless
  inspection is requested; comparison inspects stored captures
  regardless of expiry.
- Pruning: `obliteratus experiments prune` (dry run by default) keeps
  the latest complete attempt, the newest N, active attempts and every
  attempt a kept one reuses, records a pruned event before deleting,
  and finishes interrupted removals on the next applied prune.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 16:28:26 -05:00
Joseph Magly d311c9433c Merge pull request #447 from elder-plinius/feat/f05-observation-runner
Baseline observation runner with resumable run records
2026-11-13 15:34:43 -05:00
Joseph MaglyandClaude Opus 5.5 29eab4ac37 feat(experiments): baseline observation runner with resumable run records
Add a shared observation spec, runner, run store and comparison so one
baseline observation can be specified once, run from the CLI or Python,
resumed after interruption and compared across runs.

- Spec: versioned JSON with a single schema file as authority. It
  references a pack, dataset revision and role (locked test only with
  acknowledgement), model id/revision/dtype, greedy decoding, registered
  scorer tasks, optional activation capture and profiling, and a seed.
  The canonical digest of the defaulted spec is the run identity.
- Runner: baseline only. It refuses models with forward/backward hooks,
  global module hooks, an interrupted-surgery marker or active adapters
  before any generation, then scores generation per task (single-arm,
  descriptive scorecards with Wilson intervals) and optionally captures
  activations and profile counters.
- Store: one directory per run identity, append-only attempt events,
  pending/running/complete/failed/cancelled transitions under a lock.
  Abandoned attempts are recorded as failed. A new attempt reuses a step
  only when it is complete, identity-matched and its files still verify.
- Compare: exact equality for identities, counts and per-example
  outcomes; explicit tolerances for rates and activations, reported per
  field.
- CLI: `obliteratus experiments run|compare|history`, sharing one
  Python code path a UI can call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:26:40 -05:00
Joseph MaglyandClaude Opus 5.5 6aaeb813d7 fix(analysis): exact Gaussian W2 and honest labels for transfer and projection search
Finish the measurement-validity audit for the two remaining geometry
modules.

wasserstein_transfer:
- The Gaussian W2 paired sorted eigenvalues and underestimated the
  distance for non-commuting covariances (0 for a 45-degree rotation of
  diag(100, 1)). Compute the exact closed form with a stable PSD square
  root, from each side's own mean and covariance.
- Mismatched widths gave a truncated value and failures gave 0; both are
  now None with a reason. Failed map inversion no longer falls back to
  the raw cross-covariance. Fidelity is exact Pearson correlation.
- The "transport map" is a ridge least-squares map, not a Gaussian Monge
  map. Viability, fidelity and recommendations are labelled heuristics
  and are None unless their inputs exist; refusal-removal estimates that
  measured nothing are unsupported and always None.

bayesian_kernel_projection:
- Relabel as seeded random search with local perturbation over a
  partial linear projection (no surrogate or kernel). The Pareto front
  could keep a dominated trial on reduction ties; fixed. With no signal
  or no input, best results are None with a reason instead of score 0.

Both modules now carry measurement evidence and catalog rows checked by
the registry test, and the app overview no longer claims a Monge map or
TPE optimization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:22:50 -05:00
Joseph MaglyandClaude Opus 5.5 e70674fcb2 Merge main into fix/435-geometry-audit
Resolve additive conflicts with #442 in ci/test-risk-map.json and
docs/geometry-measurement-validity.md by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 11:21:08 -05:00
Joseph Magly bf7b59a786 Merge pull request #442 from elder-plinius/feat/436-subspace-report
Full-subspace spectrum and stability report
2026-11-13 11:17:19 -05:00
Joseph MaglyandClaude Opus 5.5 40744bac67 fix(analysis): label geometry measurements and null unsupported values
Extend the measurement-validity treatment from riemannian_manifold.py
to concept_geometry, the LEACE paths, cross_layer and
wasserstein_optimal. Each audited result carries measurement evidence,
every reported field has a catalog entry, and a registry test fails
when either is missing.

- concept_geometry: the cone "solid angle" is a cap around the mean
  axis, not a minimal enclosing cone; relabelled. Placeholder defaults
  (cosine 1.0, specificity 1.0, linear/polyhedral flags, layer indices 0)
  become None when there is too little data. The informed pipeline skips
  unavailable flags; decisions on valid inputs are unchanged.
- cross_layer: persistence, adjacent cosine and angle path length are
  None with fewer than two layers instead of 0.0/1.0; zero or non-finite
  directions are rejected instead of reported as orthogonal.
- leace: the Fisher "erasure loss" is relabelled as variance along the
  direction; exact and multiclass LEACE gain erasure oracles.
- wasserstein_optimal: a layer with no signal reported a cost ratio of 0
  and could be chosen as best_layer; it is now None and excluded. The
  W2 cost is exact for any direction (closed-form oracle), and the
  comment calling it a bound is corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:45:45 -05:00
Joseph MaglyandClaude Opus 5.5 b040115db8 feat(analysis): full-subspace spectrum and stability report
Rank-k extraction stores a basis, but the gate validates only its
primary direction, so an informative first vector plus unrelated
dimensions could pass as a whole subspace.

Add a standalone, versioned subspace report (not wired into the gate):
spectrum and conditioning, PCA-threshold and entropy effective rank,
bootstrap principal-angle stability, held-out multivariate prediction
per rank, rank-matched random-subspace nulls, and joint/interaction
diagnostics for direction pairs. The verdict reports the supported rank
("supported_rank: s of k"), counting only consecutive ranks whose
held-out increment beats both their null and a minimum increment. The
report compares the primary-vector, PCA-threshold, entropy-rank and
prediction arms side by side.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:37:32 -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 fa045675b3 Merge pull request #439 from elder-plinius/feat/433-task-scorers
Versioned task scorers and paired scorecards
2026-11-12 15:22:14 -05:00
Joseph MaglyandClaude Opus 5.5 6f925caf1d feat(concepts): versioned task scorers and paired scorecards
The behavioural battery treated any greedy-text difference as an effect,
so a punctuation-only edit looked like a change and nothing measured
task success.

Add a local, versioned scorer registry with deterministic exact-answer
and structured-output (JSON + declared schema) scorers. Each completion
yields separate endpoints: task success, invalid output and abstention;
raw text change is reported as descriptive only. Paired summaries use a
one-sided exact McNemar test and Wilson bounds against a declared
per-task margin; min_pairs defaults to the smallest sample that could
pass that margin, and untested or underpowered endpoints never aggregate
to PASS. Every aggregate keeps its per-example records.

EvaluationBattery(scorers=...) writes behavioural["scorecard"]; without
scorers nothing changes. Pipeline admission refuses batteries that carry
scorers until their generation is modelled. Dataset-built examples read
select/calibrate rows; locked test still needs explicit acknowledgement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 21:44:52 -05:00
Joseph MaglyandClaude Opus 5.5 8d3f052c93 feat(analysis): versioned activation capture with identity-checked reuse
Add an on-disk activation capture built on observe_activations. Each run
writes one safetensors shard per batch under raw/ and a manifest binding
model id/revision and loaded dtype, tokenizer and chat template, special
tokens, adapter state, readout, layer sites, input digests and the
dataset revision. The manifest records running/complete/cancelled/failed
state, a labelled byte estimate, measured bytes and wall time, and
retention.

The loader refuses incomplete captures unless asked to inspect them, any
identity difference (naming the first differing field), unknown adapter
state, digest mismatches, and shard paths outside raw/. Capture refuses
meta, offloaded, quantized and non-CPU models, and runs nothing when the
estimate exceeds the budget.

Tokenizer and checkpoint identity move into a shared helper that the
pipeline's entry-point cache identity also uses, with identical keys and
values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 21:42:21 -05:00
Joseph MaglyandClaude Opus 5.5 9caa57d978 ci(risk-map): run token-policy tests when concept validation changes
The concept-packs surface owns validation.py and the pack schema but did
not require tests/test_concept_token_policy.py, so a regression in those
tests passed PR CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:39:17 -05:00
Joseph Magly acae9d3a01 feat(concepts): version datasets and isolate independent partitions 2026-11-04 21:59:43 -05:00
Joseph Magly 28cf09d26e feat(analysis): label evidence and profile baselines 2026-11-04 03:32:00 -05:00
Joseph Magly 0479da2f15 Merge pull request #420 from younger-plinius/feat/ask-the-lab
Add Ask the Lab conversational neuron studies
2026-10-30 18:16:47 -04:00
Joseph Magly a4409c62d1 Merge pull request #422 from elder-plinius/fix/418-cpu-head-overlay
fix: include CPU-backed LM head in capacity overlays
2026-10-30 18:10:49 -04:00
Joseph Magly 2ee7caf5fb fix: reserve CPU-backed LM head surgery overlays 2026-10-30 17:27:55 -04:00
Joseph Magly 5eb4020d98 fix: describe actual campaign GPU memory sampling 2026-10-30 17:26:49 -04: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
Joseph Magly 08a704a4e4 ci: refresh slow-test ownership from hosted evidence 2026-10-29 08:06:20 -04:00
Joseph Magly eb38b1508e ci: precompile verified release dependencies
Prepare only locked dependencies in owned release environments before installing the exact project. Preserve verified wheel-supplied caches outside import paths, require zero caches before compilation, and bind generated cache bytes to source and retained diagnostics.

Keep project caches forbidden, preserve the no-write startup policy, sanitize inherited compilation settings, and retain bootstrap evidence separately without changing test selection or release gates.

Refs #306
2026-10-29 06:44:59 -04:00
Joseph Magly 67e6550c7e Merge remote-tracking branch 'upstream/main' into fix/release-final-boundaries 2026-10-29 02:15:09 -04:00
Joseph Magly c92d2ef2ee test: cover final input boundaries and isolate Bayesian storage 2026-10-29 02:15:00 -04:00
Joseph Magly b800008dcb ci: register measured distributed boundary scheduling weights 2026-10-29 01:49:40 -04:00
Joseph Magly 95046ed0ab Merge remote-tracking branch 'upstream/main' into fix/release-distributed-boundaries 2026-10-29 01:39:45 -04:00
Joseph Magly 46fc677a70 test(distributed): preserve export and preflight failure boundaries 2026-10-29 01:39:44 -04:00
Joseph Magly 6245b2d35d Merge remote-tracking branch 'upstream/main' into fix/release-tourney-boundaries 2026-10-29 01:20:01 -04:00
Joseph Magly 08d2631cc5 Merge remote-tracking branch 'upstream/main' into fix/release-tourney-boundaries 2026-10-29 01:09:54 -04:00
Joseph Magly a382b6b8b7 test(tourney): reject invalid durable evidence 2026-10-29 01:09:53 -04:00
Joseph Magly 7fde052252 Merge remote-tracking branch 'upstream/main' into fix/release-boundary-tests
# Conflicts:
#	ci/test-risk-map.json
2026-10-29 01:08:41 -04:00
Joseph Magly bca9a6186e Merge remote-tracking branch 'upstream/main' into fix/release-boundary-tests 2026-10-29 00:58:12 -04:00
Joseph Magly d34e59387a test(release): verify input and recovery bounds 2026-10-29 00:58:11 -04:00
Joseph Magly de9764a90f Merge remote-tracking branch 'upstream/main' into fix/release-bayesian-boundaries 2026-10-29 00:54:45 -04:00
Joseph Magly ff4c439d31 fix(bayesian): restore policy on format failure 2026-10-29 00:54:44 -04:00
Joseph Magly 10009f78bf Merge remote-tracking branch 'upstream/main' into fix/release-bayesian-admission-contract 2026-10-29 00:42:36 -04:00
Joseph Magly e223399aa1 test(admission): model bounded Bayesian work 2026-10-29 00:37:47 -04:00
Joseph Magly 7ac4830b01 fix(mcp): gate execution on working pidfds 2026-10-29 00:36:34 -04:00
Joseph Magly 3a5d3f716f Merge remote-tracking branch 'upstream/main' into fix/390-reset-hook-identity 2026-10-28 23:28:25 -04:00
Joseph Magly 69696758ba Merge remote-tracking branch 'upstream/main' into fix/389-excise-memory-failure 2026-10-28 23:15:14 -04:00
Joseph Magly 2e9a815d1b fix(excise): propagate nested recipe failures
Keep allocation failures terminal through quantized experts, adapter selection, Bayesian evaluation and refinement helpers. Route folded-writer errors and warnings promoted to errors through public cleanup before verification or export.

Exercise exact exception causes, failed-operation counts, rollback, cleanup and no-export behavior across recipe variants. Fixes #389.
2026-10-28 23:15:14 -04:00
Joseph Magly 5c52a5d2c5 Merge remote-tracking branch 'upstream/main' into fix/390-reset-hook-identity 2026-10-28 23:11:43 -04:00
Joseph Magly 7e460be85f fix(neuron-lab): verify hook callback identities
Include local and global forward/pre-forward hook callbacks, ordering and behavior flags in reset verification. Retain callback references so identity checks cannot be defeated by equality overrides or object ID reuse.

Add 22 regressions including exported mismatch receipts and unchanged-hook controls. Refs #390.
2026-10-28 23:11:42 -04:00
Joseph Magly 1746691d59 Merge remote-tracking branch 'upstream/main' into fix/384-recurrent-workspace 2026-10-28 22:57:01 -04:00
Joseph Magly 63c8300887 fix(admission): inspect all recurrent callsites
Qualify all four Qwen scan and convolution fallbacks and reject Hub replacements on every model submodule. Keep unbounded compiled kernels unknown in strict mode and document the remaining source and hardware qualification gaps.

Refs #384
2026-10-28 22:46:13 -04:00
Joseph Magly 2104e19cd9 feat(campaign): add a matched causal control
Compare the composite concept arm with an explicit CausalLM arm using the same recipe, inputs and seed. Keep checkpoint ownership, receipts, interrupted resumes and raw failed metrics separate.

Refs #383, #333
2026-10-28 22:42:52 -04:00
Joseph Magly e648adf647 fix(excise): reject incomplete projection passes
Propagate memory exhaustion through the public cleanup boundary and fail partial projection passes before verification or export. Exercise attention, FFN, SAE and module lookup failures with real tiny-model projections.

Update the rollback CPU-allocation guard to follow the bounded snapshot helper; the old Tensor.to spy failed on unchanged main.

Fixes #389
2026-10-28 22:39:38 -04:00