Commit Graph
313 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 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 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 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 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 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
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 95d2825db1 Add conversational neuron studies with controlled trials and verified resets 2026-10-30 13:19:10 -04:00
Joseph Magly c200a6343d ci: preserve installed concept packs and propagate import failures 2026-10-29 12:28:56 -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 ccd1cd73f0 docs: synchronize release rehearsal and runtime guidance 2026-10-29 09:50:28 -04:00
Joseph Magly a7f6e612e1 docs: require strict modelling before recurrent GPU measurements 2026-10-29 04:12:00 -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 5c52a5d2c5 Merge remote-tracking branch 'upstream/main' into fix/390-reset-hook-identity 2026-10-28 23:11:43 -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
Pliny the Younger 92775708f0 Preserve Neuron Lab evidence through a verified reset 2026-10-28 19:10:55 -04:00
Pliny the Younger 3a4b5321a6 feat: add activation sonification and reversible Prompt Prism experiments 2026-10-27 20:05:06 -04:00
Pliny the Younger bb4e0e6816 Merge upstream 1263570 into temporary neuron UI integration branch 2026-10-27 18:33:34 -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
LLMsherpa dace6a8817 fix: preserve search state and resume verified exports 2026-10-27 17:45:33 -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
LLMsherpa 263854cb12 fix: count resident load storage once and classify method outcomes 2026-10-26 12:23:30 -04:00
LLMsherpa ac6d92abc7 fix: preserve scored candidates across search, refinement and tournament replay 2026-10-25 21:52:42 -04:00
LLMsherpa f310c573f0 fix: preserve fused norms and correct final candidate quality checks 2026-10-25 20:12:30 -04:00