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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>