Commit Graph
995 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 Magly a8cf648d58 Merge pull request #451 from elder-plinius/feat/obs-identity-lifecycle
Weight fingerprint, capture retention and attempt pruning
2026-11-13 16:42:24 -05:00
Joseph MaglyandClaude Opus 5.5 1cb2a7356b test(experiments): assert fingerprint work instead of recording junit properties
record_property warns under the xunit2 junit family CI uses, and the
suite treats warnings as errors. Assert that sampled mode hashes far
fewer elements than full mode, which hashes every element.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 16:38:55 -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 Magly 0ab3b5fb9e Merge pull request #446 from elder-plinius/fix/443-geometry-audit-2
Exact Gaussian W2 and honest labels for transfer and projection search
2026-11-13 15:30:15 -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 Magly 99040d510f Merge pull request #444 from elder-plinius/fix/435-geometry-audit
Label geometry measurements and null unsupported values
2026-11-13 11:26:05 -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 Magly a127dea318 Merge pull request #441 from elder-plinius/feat/437-profile-counters
Fill baseline profile work counters
2026-11-13 11:12:39 -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 Magly a70f484251 Merge pull request #438 from elder-plinius/feat/434-activation-capture
Versioned activation capture with identity-checked reuse
2026-11-12 15:15:15 -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 Magly 2bdfa52cd0 Merge pull request #432 from elder-plinius/feat/concept-pack-schema-2
Require concept pack schema 2.0 for dataset declarations
2026-11-11 21:01:28 -05:00
Joseph MaglyandClaude Opus 5.5 ae9d774609 feat(concepts): require pack schema 2.0 for dataset declarations
Releases that read only 1.x manifests ignore the dataset declaration and
each row's role, so they extract from select, calibrate and locked test
rows. Gating dataset packs on a new major version makes those releases
reject the pack ("Unsupported schema_version") instead.

- Accept schema majors 1 and 2; 2.x keeps every 1.x field.
- manifest.dataset now requires schema_version 2.0+ (was 1.3+, never
  released). 1.x packs without a dataset are unchanged.
- Compare versions as (major, minor) tuples. The selector gate in
  pack.py compared only the minor number and would have rejected 2.0.
- Unknown-major tests now use 3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 20:46:10 -05:00
Joseph Magly 42b0c2abbe Merge pull request #426 from elder-plinius/feat/f02-dataset-contract-20261104
Version concept datasets and isolate independent partitions
2026-11-11 14:59:08 -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 Magly 5e718b1cb6 Merge pull request #428 from ariannamethod/astra/steering-combine-weights
fix(steering): reject mismatched combination weight counts
2026-11-11 14:49:58 -05:00
Joseph Magly 3a0c250448 Merge pull request #425 from elder-plinius/test/gemma2b-history-20261104
Record Gemma 2B historical observation on RTX 4090
2026-11-11 14:46:46 -05:00
Joseph Magly af56181ae9 Merge pull request #424 from elder-plinius/test/analysis-first-4090-proof-20261104
Add local RTX 4090 proof for analysis-first changes
2026-11-11 14:43:10 -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 MaglyandClaude Opus 5.5 9a9175253a fix(concepts): restore version-gate messages and require fit rows in every set
The new if/not schema support made the generic schema pass reject
version-gated fields first, so authors got "forbidden field or value"
instead of the schema_version the field needs, and three existing
token-policy tests failed. Check entry_point, special_token_policy and
dataset against schema_version before the schema pass.

A neighbour or battery set whose rows were all assigned to non-fit roles
was passed to extraction and gating empty. Require fit rows in every
declared set.

Document that older releases ignore the dataset declaration and extract
from every row. Hoist the similarity normalizer out of the pair loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:38:54 -05:00
Joseph MaglyandClaude Opus 5.5 9e14b01e77 docs(gemma2b): keep the frozen worker as a record and drop internal references
The historical-observation worker only runs inside the recorded sandbox
(it writes to a fixed /tmp/work and needs an unshipped launcher), so
shipping it under examples/ invited unsafe direct runs. Move it next to
its report, byte-for-byte, so it still matches the benchmark_worker.py
hash in the evidence.

Remove the private tracker link, the .aiwg paths that do not exist in
this repository, internal orchestration terms and the host name. Note
that the model snapshot is a third-party copy. Measurements are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:35:31 -05:00
Joseph MaglyandClaude Opus 5.5 3a8b101645 docs(analysis): drop internal references from the 4090 proof
Remove the private tracker link, the .aiwg report paths that do not
exist in this repository, internal orchestration terms and the host
name. The measurements, isolation description and limits are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 11:34:49 -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
0xreconlionandClaude Opus 5 2520dc5818 fix(numerics): bound norm-capture scratch to a chunk budget
Capturing and restoring layer weight norms called ``data.float().norm()``,
which allocates a float32 copy of the entire weight to produce one scalar.
The copy is unconditional, so no offload plan, device map, or allocator
setting avoids it, and for a large-vocabulary LM head it is gigabytes.

Add ``frobenius_norm_bounded`` beside the module's other bounded-scratch
contracts and route the four norm reductions in ``_capture_layer_weight_norms``
and ``_restore_layer_weight_norms`` through it. It splits the largest axis
until a chunk's float32 scratch fits the budget, accumulates sums of squares
in float64, and takes one square root. Storage already at least as wide as
float32 reduces in place, so widening never allocates for it.

Measured on a [152064, 5120] float16 weight, reducing scratch from a
multiple of the weight to a multiple of the budget:

  budget    4 MB   16 MB   64 MB
  scratch  12 MB   38 MB   96 MB

The whole-weight promotion cost 2971 MB for the same reduction. Scratch is
now a function of the budget, not of the weight.

The folded post-norm branch is left alone: folding materializes a full
writer copy by construction, so bounding its norm would require changing
the fold itself.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-09 17:08:40 -05:00
Arianna Method 5bed843b66 test(steering): cover combination weight counts and valid mixtures 2026-11-06 00:56:43 +00:00
Arianna Method a8d588f37a fix(steering): require one combination weight per vector 2026-11-06 00:54:38 +00:00
Joseph Magly acae9d3a01 feat(concepts): version datasets and isolate independent partitions 2026-11-04 21:59:43 -05:00
Joseph Magly 246801dfa8 test: record gemma2b historical GPU observations 2026-11-04 13:59:05 -05:00
Joseph Magly ba2329dd35 docs(analysis): clarify local GPU measurements 2026-11-04 11:48:09 -05:00
Joseph Magly da21816610 test(analysis): record local RTX 4090 proof 2026-11-04 11:41:43 -05:00
Joseph Magly b2e65a7723 Merge pull request #423 from elder-plinius/feat/analysis-first-package-20261103
Correct geometry evidence and profile observational baselines
2026-11-04 10:40:50 -05:00
Joseph Magly 6f1d745dbb docs(analysis): record reproducible CPU baseline 2026-11-04 03:49:02 -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 18bbb8e2c0 Merge pull request #421 from elder-plinius/fix/419-memory-receipt
fix: report actual campaign GPU memory sampling
2026-10-30 18:03:48 -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 d7d9972473 Give Neuron Lab direct, human copy and clearer result labels 2026-10-30 13:39:48 -04:00
Pliny the Younger 1252cd57e6 Bind Ask the Lab reset replay to its own study receipt 2026-10-30 13:25:01 -04:00
Pliny the Younger 95d2825db1 Add conversational neuron studies with controlled trials and verified resets 2026-10-30 13:19:10 -04:00