# Geometry measurement validity `RiemannianManifoldAnalyzer` reports activation-coordinate diagnostics. It does not compute a model Jacobian, pullback metric, intrinsic sectional curvature, intrinsic geodesics, or behavioral intervention efficacy. The historical class and field names remain importable; their names alone are not evidence. The numerical statements here are established by [the analytic tests](../tests/test_geometry_measurement_validity.py) and [the legacy Riemannian tests](../tests/test_breakthrough_modules.py). They establish software and measurement contracts on synthetic CPU tensors, not scientific efficacy on a pretrained model. ## Evidence and availability contract Analyzer-produced results append `measurement_evidence`, mapping each metric field to its definition, units, assumptions, scope, status and `unavailable_reason`. Status means: - `diagnostic`: a descriptive coordinate calculation, with no intrinsic geometry or behavioral interpretation established. - `unsupported`: the named scientific quantity is not implemented or validated. - `unavailable`: a diagnostic lacks sufficient samples, valid pairs/triangles, or a successful numerical decomposition. Unsupported/unavailable scalar values are `None` (JSON `null`), never a neutral number such as zero or one. A diagnostic can measure zero: constant clouds have PCA rank zero; parallel unsigned direction axes have angle zero; orthogonal projection can have an exactly zero dot-product remainder. Those zeros do not supply evidence of intrinsic flatness or intervention efficacy. Per-layer dictionaries preserve supplied layer keys. A `None` entry denotes an unavailable per-layer diagnostic or unsupported curvature. Aggregate diagnostic status indicates at least one available entry; inspect each entry for partial availability. PCA aggregation excludes unavailable layers. Empty inputs have no measured dimension; `ambient_dimension=0` is a structural empty-input marker with `unavailable` evidence. Invalid shapes, nonfinite inputs, incompatible widths and a missing harmless reference when estimating directions raise `ValueError`; they cannot produce a recommendation. `measurement_parameters` records the PCA threshold, sample count, interpolation steps and fixed row/component caps. Sampling takes combinations in input row order, using at most the first 20 rows for triangles and 15 rows for pairs; `n_sample_points` caps valid triangles/pairs. This is deterministic for the same ordered inputs and numerical environment and consumes no random state. It is not a random or permutation-invariant population estimate. Feature units are caller-defined; this interface has no physical unit calibration. ## Metric catalog All quantities assume finite tensors with compatible coordinate widths. Comparisons across layers additionally assume aligned coordinate systems; matching widths alone do not establish alignment. | Result field | Actual definition and units | Status, assumptions and unavailability | | --- | --- | --- | | `ambient_dimension` | Activation feature width, components | Diagnostic when layers are supplied; empty-input marker otherwise. | | `layer_intrinsic_dims` | Global centered covariance effective rank per layer: count eigenvalues at least `intrinsic_dim_threshold * largest`, limited to `min(n-1, width, 64)`, components | Diagnostic PCA summary, not validated manifold dimension. Requires at least two samples and eigendecomposition. Constant data have rank 0. | | `intrinsic_dimension` | Rounded arithmetic mean of available per-layer PCA ranks, components | Diagnostic; unavailable when no ranks exist. A sampled circle has rank 2 despite intrinsic dimension 1. | | `dimension_ratio` | Aggregated PCA rank / feature width, dimensionless | Diagnostic when the PCA aggregate exists. | | `layer_chord_angle_excess_per_area` | Mean `(sum of ambient chord angles - pi) / ambient triangle area`, inverse squared activation units | Diagnostic numerical remainder. Repeated vertices and collinear/nearly collinear triangles are unavailable (squared sine at first vertex at most `1e-12`). No valid triangles means `None`. | | `mean_sectional_curvature`, `max_sectional_curvature`, `curvature_std`, `layer_curvatures` | Intended intrinsic curvature statistics, inverse squared activation units | Unsupported; all scalar values and supplied per-layer curvature entries are `None`. No intrinsic metric or geodesic triangles are available. | | `is_approximately_flat` | Intended intrinsic flatness decision, boolean | Unsupported and `None`, even on an analytically flat fixture. The retained `curvature_flatness_threshold` option has no decision effect. | | `geodesic_diameter` | Maximum `acos(abs(u dot v))` between normalized layer directions, radians, in `[0, pi/2]` | Diagnostic unsigned-axis angular separation. Antipodal directions have distance 0. This is neither activation-manifold diameter nor oriented sphere diameter. Requires two nonzero directions; otherwise `None`. | | `mean_geodesic_distance` | Intended mean intrinsic activation-manifold distance, activation units | Unsupported and `None`; half a direction-angle diameter is not a distance measurement. | | `geodesic_vs_euclidean_ratio` | Mean local-PCA-projected interpolation polyline length / ambient endpoint chord length, dimensionless | Diagnostic only. Uses up to five nearest rows at each interpolation step and PCA singular values above 0.1 of the largest. Stable input-order tie handling; zero chords skipped. No valid pair or failed/zero-rank local SVD gives `None`. Endpoints need not be preserved, the path need not stay on a manifold, and the ratio can be below 1. No connectivity/density or geodesic guarantee. | | `linear_projection_residual` | Historical intended nonlinear residual estimate, units unspecified without a behavioral endpoint | Unsupported and `None` on `analyze()`. The old `K * norm² / 8` expression has been removed. See the separate projection result below. | | `curvature_correction_gain`, `estimated_residual_reduction` | Intended nonlinear improvement factor / fractional residual reduction, dimensionless | Unsupported and `None`. Neither chord roundoff nor a coordinate dot product establishes either quantity. | | `recommendation` | Method sufficiency decision, categorical | Always `unsupported`, including empty/sparse inputs. No automatic `linear_sufficient` or `geodesic_recommended` decision is justified by these metrics. | `compute_geodesic_projection()` retains its signature but computes only linear projection diagnostics. The harmful-activation argument remains accepted and is unused; there is no nonlinear correction algorithm. | Projection result field | Definition and units | Status | | --- | --- | --- | | `layer_idx` | Caller-supplied layer identifier | Structural identifier. | | `original_refusal_component` | `abs(x dot r)` for normalized direction `r`, activation units | Diagnostic coordinate component; no behavioral validation. `None` for a direction norm below `1e-8`. | | `linear_residual` | `abs((x - (x dot r) r) dot r)`, activation units, evaluated in float64 | Diagnostic floating-point remainder of an algebraic zero. `None` without a nonzero direction. | | `geodesic_residual` | Intended residual after a validated geodesic projection, units unspecified | Unsupported and `None`. | | `improvement_factor` | Intended nonlinear/geodesic efficacy ratio, dimensionless | Unsupported and `None`; a ratio of roundoff remainders is not efficacy. | | `effective_curvature` | Intended local intrinsic sectional curvature, inverse squared activation units | Unsupported and `None`. | | `correction_vector` | Zero tensor matching the activation shape, dtype and device, activation units | Unsupported no-op fallback. It must not be presented as a computed geodesic correction. | ## Why the previous interpretations fail Three nondegenerate ambient points define a Euclidean triangle whose chord angles sum to pi. For octant vertices `radius * torch.eye(3)`, each *intrinsic* spherical angle is pi/2 and the octant area is `pi * radius² / 2`, giving intrinsic curvature `1 / radius²`. The ambient chord triangle has angles pi/3 and angle excess approximately zero. Smaller chords do not repair this identification failure. The private legacy `_triangle_curvature` name now explicitly denotes only the chord diagnostic; `_estimate_sectional_curvature` returns `None`. For unit `r`, `(x - (x dot r) r) dot r = 0` exactly in real arithmetic. A correction orthogonal to `r` leaves this identity unchanged. That scalar therefore cannot demonstrate nonlinear refusal reduction, even if finite precision makes two remainders differ. The unsupported `/6` correction, `/8` residual estimate and derived gain have been removed. The private legacy `_compute_curvature_correction` helper also returns a zero no-op fallback. ## Compatibility and intentional changes Public class names, lazy analyzer export, constructor options, method argument order and the original dataclass field order are preserved. New evidence, chord-diagnostic and parameter fields have default factories, so legacy positional and keyword dataclass construction remains possible. `ManifoldPoint` remains a caller-supplied container; this analyzer does not populate its `local_metric` or `principal_curvatures`. Scientific interpretation takes priority over old numeric defaults: unsupported fields are now nullable, empty input no longer implies flatness, `recommendation` is always `unsupported`, and nonlinear correction is a no-op. Callers must handle `None` and consult evidence before arithmetic, formatting or choosing a method. PCA rank zero and angular zero remain measured diagnostic values when their preconditions hold. Legacy caller-constructed results have empty evidence dictionaries and must be treated as unreviewed, even if their old values contain `linear_sufficient` or a positive gain. No new geodesic algorithm, model intervention or claim of scientific improvement is included. Synthetic tests cannot validate either intervention strategy. ## Claim-to-test registry and F01 acceptance Names below are in `tests/test_geometry_measurement_validity.py` unless stated otherwise. | Acceptance claim | Executable oracle | | --- | --- | | Sphere chord counterexample cannot be presented as intrinsic curvature | `test_sphere_octant_chords_cannot_establish_intrinsic_curvature` at three radii, with independent intrinsic tangent-angle and octant-area oracle. | | Plane/circle diagnostics have explicit scope | `test_plane_oracle_and_rigid_coordinate_changes`, `test_circle_pca_rank_is_not_intrinsic_dimension`. | | Degenerate/sparse/unavailable inputs never silently become measured zero | `test_degenerate_triangles_are_unavailable`, `test_sparse_samples_do_not_become_measured_zero`, `test_measured_zero_rank_and_angle_are_distinct_from_unavailable`, `test_decomposition_failure_does_not_fabricate_measurements`, invalid-input tests. | | Projection identity does not validate improvement | `test_projection_zero_is_a_coordinate_identity_not_an_improvement`; legacy Riemannian correction/projection tests. | | Every metric produced by this interface has definition, units, assumptions, scope and status | `test_every_reported_metric_has_definition_units_status_and_scope`. This covers this interface; no workbench UI is wired here. | | Neither diagnostic values nor flatness thresholds recommend an intervention | `test_diagnostics_and_flatness_threshold_cannot_recommend_a_method`, including injected negative, zero and positive chord diagnostics. | | Reports are deterministic and legacy contracts remain available | `test_reporting_is_deterministic_and_does_not_consume_rng`, `test_legacy_public_constructors_and_lazy_export_remain_available`, `TestRiemannianManifold` in `tests/test_breakthrough_modules.py`. | This establishes the measurement-labeling portion of the preliminary Muse F01 criteria, with the catalog and executable claim registry above. It does not establish validation of intrinsic geometry, behavioral gains, pretrained-model experiments, or metric linkage in every broader workbench surface. O01 cost profiling is outside this worker's scope. ## Read-only caller audit and follow-up A repository search found the lazy analyzer export and tests, with no live pipeline/UI consumer of these result fields or recommendation strings. The worker audit identified two presentation surfaces. The integrated package corrects both: - `app.py` describes coordinate diagnostics and links to this catalog; it no longer advertises computed pullback or geodesic metrics. - `obliteratus/architecture_profiles.py` disables unsupported Riemannian recommendations and labels the available coordinate diagnostics. Architecture alone does not establish flatness, curvature or intervention efficacy. The separate `cross_layer.py` direction-drift implementation does not call this analyzer; its angular quantities are catalogued in the sibling audit below. Near the degeneracy cutoff, dividing chord angle roundoff by a small area can amplify it substantially. The chord diagnostic has no intrinsic-curvature interpretation, including for thin triangles that pass the cutoff. ## Sibling module audit The analyzers below use the same evidence vocabulary. Their result dataclasses carry `measurement_evidence` (a default-factory field appended after the legacy fields, so positional construction still works), mapping each reported field to its definition, units, assumptions, scope, status and `unavailable_reason`. Caller-constructed results have empty evidence and are unreviewed. Each first-column name below is checked against the code by [the catalog registry test](../tests/test_geometry_metric_catalog.py); a reported field without a row fails that test. Analytic fixtures are in [the audit oracles](../tests/test_geometry_audit_oracles.py) and [the LEACE erasure oracles](../tests/test_leace_erasure_oracles.py); the transfer and projection-search fixtures are in `tests/test_transfer_projection_oracles.py`. "Diagnostic" below means the stated formula is what the code computes, and the analytic fixtures check it. It never implies a behavioral effect. A row whose status starts with "Heuristic" is a threshold rule, product or frequency chosen by the module. Its arithmetic is tested; its interpretation is not validated. Its evidence definition also starts with "Heuristic". ### ConeConeResult (concept_geometry.py) `ConceptConeAnalyzer.analyze_layer` groups harmful rows by category and pairs each with the harmless row at the same prompt index. Harmless prompts carry no category, so a category direction is not a category-matched contrast. Category directions with strength at most `1e-8` have no direction and are excluded from all axis geometry. Cosines, specificity and effective rank ignore sign. They describe axes, not a cone in a shared half-space. | Field | Definition and units | Status and unavailability | | --- | --- | --- | | `category_directions` | Per category: unit `mean(harmful) - mean(index-paired harmless)`, `strength` (norm of that difference, activation units), `specificity` = `1 - mean |cos|` to other valid axes, `n_prompts` | Diagnostic. `specificity` is `None` without another valid axis (previously a fabricated 1.0). Empty list when no category reaches `min_category_size`. | | `pairwise_cosines` | `|cos|` between valid category axes, dimensionless | Diagnostic; empty with fewer than two valid axes. | | `cone_solid_angle` | `2*pi*(1 - min_i |d_i . m|)` with `m` the normalized mean category direction: the S^2 cap around the mean axis, steradians on S^2 only | Diagnostic proxy. Not the minimal enclosing cone and not a d-dimensional solid angle, as the earlier docstring claimed. On an octant (true solid angle `pi/2`) it reports `2*pi*(1 - 1/sqrt(3))`. `None` with fewer than two axes or a vanishing mean axis (previously 0.0, or about `2*pi` for antipodal axes). | | `cone_dimensionality` | `exp(entropy(s / sum(s)))` for singular values `s` of the unit-axis matrix, dimensionless | Diagnostic effective rank. One axis gives 1; antipodal axes give 1. `None` without a valid axis. | | `mean_pairwise_cosine` | Mean of `pairwise_cosines`, dimensionless | Diagnostic; `None` with fewer than two axes (previously a fabricated 1.0). | | `is_linear` | Flag: mean `|cos|` > 0.9 and effective rank < 1.5 | Diagnostic threshold flag; `None` when either input is unavailable (previously `True`). | | `is_polyhedral` | Flag: mean `|cos|` < 0.8 or effective rank > 2 | Diagnostic threshold flag. It does not establish a polyhedral cone. `None` when either input is unavailable. | | `general_direction` | Normalized mean of category unit directions | Diagnostic; unavailable (`zeros(1)` placeholder or near-zero vector) without valid axes or when axes cancel. | | `category_count` | Categories with at least `min_category_size` prompts, count | Diagnostic; includes zero-strength categories. | ### MultiLayerConeResult (concept_geometry.py) | Field | Definition and units | Status and unavailability | | --- | --- | --- | | `per_layer` | Per-layer `ConeConeResult` | Structural mapping; unavailable when empty. | | `most_polyhedral_layer` | Layer with the largest available effective rank | Diagnostic; `None` when no rank is available (previously 0). | | `most_linear_layer` | Layer with the smallest available effective rank | Diagnostic; `None` when no rank is available (previously 0). | | `cone_complexity_by_layer` | Per-layer effective rank | Diagnostic; `None` entries are unavailable layers. | | `mean_cone_dimensionality` | Mean of available effective ranks | Diagnostic; `None` when none (previously 0.0). | The informed pipeline counts only layers with an available flag in its majority vote and averages. With none, it keeps its default linear setting. It never records a fabricated flag. Category specificity entries that are `None` are omitted from the pipeline insights. ### CrossLayerResult (cross_layer.py) Directions must be finite and nonzero; a zero or nonfinite direction now raises `ValueError` instead of producing cosine 0. Layers are assumed to share one coordinate system. Skipped layers are not normalized for. | Field | Definition and units | Status and unavailability | | --- | --- | --- | | `cosine_matrix` | `|d_i . d_j|` for normalized directions, dimensionless | Diagnostic; `0 x 0` when empty. | | `layer_indices` | Sorted analyzed layers | Structural. | | `clusters` | Connected components of `|cos| >= cluster_threshold` (single linkage) | Diagnostic. | | `angular_drift` | Cumulative `acos(|cos|)` between consecutive analyzed layers, radians, starting at 0 | Diagnostic. | | `total_geodesic_distance` | Sum of `acos(|cos|)` between consecutive analyzed layers, radians | Diagnostic path length between axes in projective space. It is not a model-internal or causal drift. `None` for fewer than two layers (previously 0.0). | | `mean_adjacent_cosine` | Mean consecutive `|cos|`, dimensionless | Diagnostic; `None` for fewer than two layers (previously 0.0). | | `direction_persistence_score` | Mean off-diagonal `|cos|`, dimensionless | Diagnostic; no random-direction baseline (about `sqrt(2/(pi*d))`) is subtracted. `None` for fewer than two layers (previously 0.0 empty, 1.0 single). | | `cluster_count` | Number of clusters, count | Diagnostic. | ### LEACEResult (leace.py) The legacy `leace` method is Fisher's linear discriminant. Orthogonal projection along its direction does not equalize class means unless the direction is parallel to the mean difference. The fixture with anisotropic within-class covariance leaves a nonzero residual. | Field | Definition and units | Status and unavailability | | --- | --- | --- | | `direction` | Unit `(S_w + eps I [+ shrinkage])^-1 delta` | Diagnostic; zero vector when delta is about 0 (measured: no mean difference). | | `generalized_eigenvalue` | `delta^T (S_w + eps I [+ shrinkage])^-1 delta`, Mahalanobis squared | Diagnostic; 0 for equal class means is a measurement. | | `within_class_condition` | Max/min eigenvalue of regularized `S_w` above `1e-10 * max` | Diagnostic; `inf` is a legacy marker for a failed decomposition and is labelled unavailable. | | `mean_diff_norm` | `||mean(harmful) - mean(harmless)||`, activation units | Diagnostic. | | `erasure_loss` | `v^T S_total v` (n-1 normalization), squared activation units | Diagnostic. It is the mean squared change of orthogonal projection on mean-centered rows. Uncentered projection also moves the mean by `(v . mu)^2`. It is not a LEACE erasure loss. | `LEACEExtractor.compare_with_diff_of_means` returns: | Key | Definition | Status | | --- | --- | --- | | `cosine_similarity` | `|cos|` between the Fisher direction and the normalized mean difference | Diagnostic. When the mean difference is about 0 the cosine is undefined; the legacy 0 is kept because an existing contract pins it, and `cosine_similarity_available` is `False`. | | `cosine_similarity_available` | Whether the cosine was defined | Structural flag added by this audit. | | `leace_eigenvalue` | `generalized_eigenvalue` above (Fisher, not exact LEACE) | Diagnostic. | | `leace_erasure_loss` | `erasure_loss` above (Fisher, not exact LEACE) | Diagnostic. | | `within_class_condition` | As above | As above. | | `mean_diff_norm` | As above | Diagnostic. | ### ExactLEACEResult (leace_exact.py) | Field | Definition and units | Status and unavailability | | --- | --- | --- | | `direction` | Unit removed component of delta under the fitted eraser | Diagnostic; zero when nothing is removed. | | `generalized_eigenvalue` | `||removed delta||^2 / erasure_loss = delta^T Sigma_XX^+ delta` on the retained support, Mahalanobis squared | Diagnostic, checked against the closed form; 0 when nothing is removed. | | `erasure_loss` | Mean of `||x - eraser(x)||^2`, population normalization, squared activation units | Diagnostic. | | `eraser` | Affine LEACE eraser | Diagnostic. On the fitted sample the fixtures check zero cross-covariance with the labels, equal class means, a zero least-squares probe, unchanged projections orthogonal to delta, and a loss no larger than orthogonal projection along delta. The tolerance is `1e-9` in float64. The pipeline's orthogonal projection along `direction` has no such guarantee. | ### LayerExtraction (concepts/extraction.py, LEACE paths) | Field | Definition and units | Status | | --- | --- | --- | | `subspace` | Orthonormal rows spanning the removed directions (binary: retained-support mean difference; rank-k: whitened named-class contrasts) | Diagnostic. | | `mean_difference_norm` | `||mean(positive) - pooled control mean||` after nuisance-PC removal, activation units | Diagnostic. | | `removed_pcs` | Control principal components removed before fitting | Structural. | | `reference_mean` | Pooled control mean used as the affine origin | Structural. | | `projector_left` | Left factor `L` of the oblique eraser `x - (x - ref) (L R^T)^T` | Diagnostic. With weighted class priors (positive 1/2, controls share 1/2), the fixtures check equal weighted class means, a zero least-squares probe, and unchanged projections orthogonal to every class contrast. | | `projector_right` | Right factor `R` of that eraser | As above. | ### Wasserstein-optimal results (wasserstein_optimal.py) For `P = I - r r^T` and any unit `r`, the closed form is `W_2^2(N(m, S), N(P m, P S P)) = (r^T m)^2 + r^T S r`. The term `r^T S r` is the exact squared Bures distance, because `S^{1/2} P S^{1/2}` is its own positive semidefinite square root. The earlier field comment said this held only for eigenvectors and was a lower bound otherwise; the fixtures refute that. The projection coupling attains the closed form, so it is also the empirical `W_2^2` between harmless rows and their projections. The code uses `S = Sigma_(n-1) + eps I`, so reported values carry an `(n-1)/n` factor and an `eps` offset relative to that empirical value. The direction exactly minimizes this cost per unit `(r^T d)^2`. It does not use harmful covariance or measure KL or behavior, and `n_candidates` is unused. | Field | Definition and units | Status and unavailability | | --- | --- | --- | | `direction` | Unit `C^-1 d`, `C = m m^T + Sigma + eps I` | Diagnostic exact minimizer of `cost_effectiveness_ratio`. | | `wasserstein_cost` | `(r^T m)^2 + r^T (Sigma + eps I) r`, squared activation units | Diagnostic; equals the closed-form Gaussian `W_2^2` above. | | `mean_shift_component` | `(r^T m)^2` | Diagnostic mean term. | | `bures_component` | `r^T (Sigma + eps I) r` | Diagnostic; exact squared Bures term for every unit `r`. | | `refusal_projection` | `(r^T d)^2`, `d = mean(harmful) - mean(harmless)` | Diagnostic. | | `cost_effectiveness_ratio` | `wasserstein_cost / refusal_projection` | Diagnostic; `None` when `refusal_projection <= 1e-12`. Previously this divided by `1e-12`. A layer without signal (zero direction, zero cost) then reported ratio 0 and was selected as `best_layer`. | | `wasserstein_direction` | Direction from `extract()` | Structural. | | `fisher_direction` | Caller-supplied direction | Structural; unavailable when not supplied. | | `dim_direction` | Caller-supplied direction | Structural; unavailable when not supplied. | | `wasserstein_cost_ratio` | Ratio from `extract()` | As `cost_effectiveness_ratio`. | | `fisher_cost_ratio` | Ratio for the supplied Fisher direction | `None` if not supplied or no mean shift along it. | | `dim_cost_ratio` | Ratio for the supplied difference-in-means direction | `None` if not supplied or no mean shift along it. | | `cosine_wasserstein_fisher` | `|cos|` between the two directions | Diagnostic. | | `cosine_wasserstein_dim` | `|cos|` between the two directions | Diagnostic. | | `improvement_over_fisher` | `100 * (fisher ratio - wasserstein ratio) / fisher ratio`, percent | Diagnostic ratio comparison, not a behavioral improvement; `None` when either ratio is. | | `improvement_over_dim` | Same against difference-in-means, percent | As above. | | `per_layer` | Per-layer results | Structural. | | `best_layer` | Layer with the lowest available ratio | Diagnostic; `None` when none (previously 0). | | `mean_cost_ratio` | Mean of available ratios | Diagnostic; `None` when none (previously 0.0). | | `comparison` | Not populated by `extract_all_layers()` | Unavailable. | ### Transfer results (wasserstein_transfer.py) `WassersteinRefusalTransfer` maps each source layer to a target layer by relative depth, unless the caller supplies a mapping. Rows are paired by index, so source and target rows must come from the same prompts in the same order. The map, the fidelity and the transferred direction use the first `min(n_s, n_t)` rows. No refusal, KL or behavioral effect of a transfer is measured. The historical "optimal transport" naming is not evidence: the map is a least-squares regression, not a Monge map. Activations must be 2-D and finite, and each source direction must have the source width; otherwise `ValueError` is raised. Previously such directions were silently truncated. Source and target widths may differ, since cross-architecture transfer is the purpose of the module. The Gaussian W_2 is then undefined and is `None`; the direction is still transferred. A failed calculation gives `None` with a reason, never 0. The Gaussian W_2 is now the exact closed form `W_2^2 = |m_s - m_t|^2 + tr(S_s + S_t - 2 (S_s^{1/2} S_t S_s^{1/2})^{1/2})`. It is evaluated in float64 with an `eigh` square root and negative roundoff eigenvalues clamped to zero. Each side uses its own mean and `n-1` covariance over all its rows. The earlier code paired sorted eigenvalues and ignored eigenvectors. For noncommuting covariances this underestimates the distance. For `diag(100, 1)` and the same spectrum rotated by 45 degrees, the old value was 0 and the closed form is 7.509. Commuting covariances with swapped axes (`diag(100, 1)` and `diag(1, 100)`) gave 0 instead of `sqrt(162)`. It also built covariances from the index-paired subset. #### TransportPlan | Field | Definition and units | Status and unavailability | | --- | --- | --- | | `source_model` | Caller-supplied name | Structural. | | `target_model` | Caller-supplied name | Structural. | | `transport_matrix` | Ridge least-squares map `T = Sigma_ts (Sigma_ss + 1e-4 I)^-1` from centered, index-paired rows; `(d_t, d_s)` | Diagnostic linear regression. It is not the Gaussian Monge map, which needs one width and no pairing. The ridge is absolute, so its effect depends on activation scale. The former fallback to the raw cross-covariance has been removed. | | `wasserstein_distance` | Exact Gaussian W_2 above, activation units | Diagnostic. `None` for differing widths, fewer than two rows on a side, or a failed eigendecomposition (previously truncation, or a Bures term of 0). | | `condition_number` | Largest / smallest singular value of `T`, censored at `1e6` (also when the smallest is at most `1e-10`) | Diagnostic. For non-square `T` only `min(d_s, d_t)` singular values exist. `None` for a zero map or failed SVD (previously 1.0 on failure). | | `transport_cost` | `W_2 * condition_number`, activation units | Heuristic product; not the cost of any coupling. `None` without both inputs. | | `is_viable` | `W_2 < viability_threshold` and `condition_number < max_condition_number` | Heuristic threshold rule; the W_2 threshold is in activation units and is scale dependent. `None` without both inputs. | #### TransferredDirection | Field | Definition and units | Status and unavailability | | --- | --- | --- | | `source_layer` | Source layer of the mapped pair | Structural. | | `target_layer` | Target layer of the mapped pair | Structural. | | `source_direction` | Caller-supplied direction | Structural. | | `transferred_direction` | `T s` scaled to unit norm; left unscaled when `|T s| <= 1e-8` | Diagnostic. | | `transfer_fidelity` | Pearson correlation of `|x_i . s|` and `|y_i . t|` over index-paired rows, clamped to `[0, 1]` | Heuristic. Negative correlation reports 0. It does not measure harmful/harmless separation, as the old docstring claimed. The old formula divided by `n` with an `n-1` standard deviation, shrinking it by `(n-1)/n`. `None` with fewer than two pairs or a constant projection (previously 0.0). | | `estimated_refusal_removal` | Intended expected refusal removal, fraction | Unsupported and `None`. The former `max(0, 1 - W_2 * kappa)` subtracted activation units from a fraction and measured no refusal. | | `wasserstein_bound` | `W_2 * condition_number` for this pair, activation units | Heuristic product. It is not a proven bound on residual refusal. `None` without both inputs. | #### WassersteinTransferResult Aggregates use available per-pair values only; inspect each direction for partial availability. | Field | Definition and units | Status and unavailability | | --- | --- | --- | | `source_model` | Caller-supplied name | Structural. | | `target_model` | Caller-supplied name | Structural. | | `n_layers_transferred` | Mapped pairs with activations on both sides and a source direction, count | Diagnostic; 0 is a measured count. | | `wasserstein_distance` | Mean available per-pair W_2, activation units | Diagnostic; `None` when none (previously `inf` for empty input). | | `condition_number` | Mean available per-pair condition number | Diagnostic; `None` when none (previously `inf`). | | `transfer_viability` | `excellent` (mean fidelity > 0.8, mean W_2 < t), `good` (> 0.6, < 2t), `marginal` (> 0.4), else `poor`; `t = viability_threshold` | Heuristic threshold rule. `None` unless both mean fidelity and mean W_2 exist (previously `poor` for empty input, and `marginal`/`poor` were reachable without W_2). | | `transferred_directions` | Per-pair `TransferredDirection` records | Structural; each carries its own evidence. | | `mean_transfer_fidelity` | Mean available fidelity | Diagnostic summary of a heuristic; `None` when none (previously 0.0). | | `min_transfer_fidelity` | Minimum available fidelity | As above. | | `estimated_excess_refusal` | Mean W_2 * mean condition number, activation units | Heuristic product, not a bound on residual refusal. `None` without both (previously 1.0 for empty input). | | `estimated_vs_native_ratio` | Intended transferred/native performance ratio | Unsupported and `None`. The former `max(0.1, 1 - excess)` measured no performance. | | `layer_mapping` | Caller mapping, or nearest relative depth | Structural. Matching depth does not establish functional correspondence. | | `unmapped_layers` | Target layers that no source layer maps to | Structural. | | `recommendation` | Text derived only from `transfer_viability`, prefixed "Heuristic" | Heuristic. `None` whenever `transfer_viability` is `None`, so no recommendation is made from an unavailable measurement. | | `needs_refinement` | Mean fidelity < 0.7 or viability `marginal`/`poor` | Heuristic rule; `None` when viability is (previously `True` for empty input). | The constructor option `n_sinkhorn_iterations` is retained and unused. The module has no live pipeline or UI consumer; `app.py` lists it in a module overview table only. ### Projection search results (bayesian_kernel_projection.py) `BayesianKernelProjection` is not Bayesian optimization and not a kernel method. It runs seeded random sampling of projection settings, then perturbs a randomly chosen top-quartile trial with Gaussian noise. There is no surrogate model, posterior, density ratio or acquisition function. The edit is a partial linear projection onto supplied basis rows, orthonormalized by QR in supplied order. "Best" and "Pareto-optimal" refer to the sampled trials, not to a global optimum. The report title now says so. Scores are activation proxies: no model refusal, token KL or benchmark is measured. The class name is kept for compatibility. It is exported lazily and has no live pipeline or UI consumer; the separate KL-gated `BayesianTrialPlan` search in `docs/method-execution.md` does not call it. When no layer is usable, or the basis carries no class-mean separation (summed signal at most `1e-6` of the summed class-mean norms), no trial runs. `best_config` and the `best_*` scores are then `None` with a reason. Previously empty input returned a placeholder configuration and score 0.0, and zero separation gave every trial reduction 0.0. #### ProjectionConfig A sampled or caller-supplied configuration, not a measurement; it carries no evidence. | Field | Definition and units | Status | | --- | --- | --- | | `layer_range` | Inclusive `(start, end)` layer indices edited | Configuration. | | `per_layer_weights` | Projection weight per layer in `[0, 1]` | Configuration. | | `n_directions` | Leading orthonormalized basis rows removed | Configuration; at most the supplied rows. | | `regularization` | Shrinks strength to `weight * (1 - regularization)`; it is not an L2 penalty | Configuration. | | `norm_preserve` | Rescale each edited row toward its original norm, by a factor of at most 1.1 | Configuration; norms are only partly restored. | #### TrialResult | Field | Definition and units | Status and unavailability | | --- | --- | --- | | `config` | Evaluated `ProjectionConfig` | Structural. | | `refusal_reduction` | `(sum signal - sum remaining) / sum signal`, clamped to `[0, 1]`. Signal is the norm of the class-mean difference on the full supplied basis per layer, fraction | Diagnostic activation proxy, checked against hand-computed diagonal projections. `None` without class-mean separation (previously 0.0). | | `harmless_distortion` | Sum over edited layers of mean `||x' - x||^2 / mean ||x||^2` on harmless rows | Diagnostic; it scales with the number of edited layers. | | `combined_score` | `refusal_weight * (1 - refusal_reduction) + distortion_weight * harmless_distortion`; lower is better | Diagnostic objective; `None` when `refusal_reduction` is. | | `trial_idx` | Zero-based evaluation order | Structural. | #### BayesianOptimizationResult | Field | Definition and units | Status and unavailability | | --- | --- | --- | | `best_config` | Sampled configuration with the lowest `combined_score` | Diagnostic argmin over samples; not a Bayesian or global optimum. `None` when no trial runs (previously a placeholder configuration). | | `best_score` | `combined_score` of `best_config` | Diagnostic; `None` when no trial runs (previously 0.0). | | `best_refusal_reduction` | `refusal_reduction` of `best_config` | As above. | | `best_harmless_distortion` | `harmless_distortion` of `best_config` | As above. | | `n_trials` | Evaluated trials, count | Diagnostic; 0 when no trial runs. | | `all_trials` | Every `TrialResult`, in order | Structural. | | `pareto_configs` | Sampled trials not dominated in (higher reduction, lower distortion), by decreasing reduction | Diagnostic. Ties in reduction now sort by distortion. Previously a tied, dominated trial could be kept, which is common when reductions clamp to 0 or 1. | | `layer_importance` | Fraction of the lowest-score `max(10, n // 10)` trials (all when fewer) with weight > 0.3 on the layer | Heuristic search frequency; it depends on the sampler and is not causal importance. | ### Sibling claim-to-test registry | Acceptance claim | Executable oracle | | --- | --- | | Every audited field has evidence and a catalog row | `test_every_reported_field_has_complete_evidence`, `test_every_reported_field_has_a_catalog_row`, `test_comparison_dictionary_keys_have_catalog_rows` in the catalog registry test. | | Known cones: closed-form cap, rank and cosines; the cap proxy is not a polyhedral solid angle | `test_circular_cone_has_closed_form_cap_rank_and_cosines`, `test_octant_cap_proxy_is_not_the_polyhedral_solid_angle`, `test_antipodal_axes_are_unsigned_and_have_no_mean_axis`. | | Degenerate, constant and too-few-sample inputs never become measurements or flags | `test_single_axis_and_zero_strength_categories_never_become_measurements`, `test_constant_or_too_few_samples_have_no_geometry`, `test_multi_layer_aggregates_only_available_ranks`, `test_pipeline_vote_ignores_unavailable_flags`, `test_cross_layer_without_pairs_reports_no_measurement`, `test_cross_layer_rejects_directions_without_an_angle`, `test_layers_without_mean_shift_cannot_be_selected_as_best`. | | Cross-layer quantities match hand-computed angles | `test_cross_layer_angles_match_hand_computed_values_and_ignore_sign`. | | LEACE erases a planted linear concept within `1e-9` and preserves the complement | `test_exact_leace_erases_planted_binary_concept_and_preserves_the_complement`, `test_multiclass_leace_has_zero_weighted_cross_covariance_and_preserves_complement`, `test_rank_deficient_and_minimal_samples_still_equalize_class_means`. | | Fisher projection is not linear erasure | `test_fisher_projection_is_not_linear_erasure_and_loss_is_centered_variance`, `test_fisher_unavailable_markers_are_labelled`. | | Wasserstein cost equals closed-form Gaussian `W_2^2` | `test_gaussian_oracle_matches_commuting_closed_form`, `test_projection_cost_equals_closed_form_gaussian_w2_for_every_direction`. | | Transfer W_2 equals the closed form within relative `1e-9` (float64), including noncommuting covariances; the sorted-eigenvalue underestimate is a regression test | `test_commuting_covariances_match_closed_form`, `test_noncommuting_2d_matches_trace_determinant_closed_form`, `test_noncommuting_high_dimension_matches_monge_identity`, `test_known_value_and_psd_sqrt`, `test_regression_sorted_eigenvalue_pairing_underestimated_w2`, `test_transport_plan_w2_uses_full_sample_moments`. | | Mismatched widths are refused or null, never truncated; failures are null with reasons | `test_gaussian_w2_refuses_mismatched_or_nonfinite_inputs`, `test_cross_width_transfer_keeps_direction_but_no_w2_or_recommendation`, `test_direction_width_mismatch_and_bad_evidence_are_refused`, `test_numerical_failures_become_null_with_reasons`, `test_zero_transport_map_has_no_condition_number`. | | Transfer heuristics are labelled; no recommendation from unavailable inputs | `test_heuristics_are_labelled_and_unsupported_estimates_are_null`, `test_unavailable_fidelity_is_none_and_blocks_the_recommendation`, `test_empty_transfer_reports_no_values_and_no_recommendation`, `test_viability_rule_and_text_follow_their_inputs`, `test_fidelity_is_exact_clamped_pearson`, `test_catalog_marks_the_same_fields_heuristic_as_the_code`. | | Projection search selects nothing without signal; best, Pareto front and frequencies match independent recomputation | `test_basis_without_class_mean_separation_selects_nothing`, `test_empty_projection_search_has_no_placeholder_config`, `test_pareto_front_drops_trials_dominated_at_tied_reduction`, `test_search_outputs_match_independent_recomputation`, with the hand-computed projection in `tests/test_bayesian_activation_contracts.py`. | ## Full-subspace report `obliteratus.analysis.subspace_report.build_subspace_report` validates a rank-k basis at one site as a whole, rather than only its primary direction. It is a standalone analysis: the concept gate does not call it and its behaviour is unchanged. The report is versioned (`schema`, `schema_version`), JSON serializable and deterministic for a given `seed`. Every entry of its `measurement_evidence` uses `status` as defined above (`diagnostic` or `unavailable` with `unavailable_reason`) plus an `evidence` refinement: - `descriptive`: a summary of the supplied data with no validity claim. - `synthetic-tested`: the behaviour stated below is asserted by synthetic CPU fixtures in `tests/test_subspace_report.py`. This is a software and measurement contract, not validation on a pretrained model, and never a causal or intervention-efficacy claim. Scores are held-out balanced accuracy of a shrinkage linear discriminant readout (equal class priors, standardized training-fold features) under stratified K-fold, or group-disjoint folds when `groups` is supplied. Chance is `1 / n_classes`. A linear readout of `C` classes uses at most `C - 1` directions, so binary labels support at most rank 1 (`max_linear_rank`). | Result field | Definition and units | Evidence and assumptions | | --- | --- | --- | | `spectrum`, `explained_variance_ratio`, `condition_number` | Singular values of span-projected centered activations divided by `sqrt(n-1)` (activation units), their variance shares, and largest/smallest ratio | Descriptive. Condition number is `None` and `unavailable` when the projected data are rank deficient. | | `basis_singular_values`, `basis_condition_number` | Singular values of the supplied basis rows and their ratio | Descriptive conditioning of the stored basis; linearly dependent rows raise `ValueError`. | | `pca_threshold_rank` | Smallest rank whose cumulative explained variance reaches `variance_threshold` (default 0.95), components | Descriptive. Explained variance cannot select informative directions: a low-variance direction can carry the label signal. | | `entropy_effective_rank` | `exp` of the Shannon entropy of L1-normalized singular values ("RankMe" style), dimensionless | Descriptive; comparable only across runs of the same method and data. It does not establish dimensional collapse or its absence ("Understanding Dimensional Collapse"). | | `per_rank` | For rank r: held-out score of the top-r discriminant coordinates of the span, refitted inside each training fold; increment over rank r-1; null threshold; pass flag | Synthetic-tested. Refitting within the span makes span-level results invariant to row order and in-span rotation. The null adds a random direction orthogonal to the span to the same rank r-1 coordinates (`n_null`). | | `subspace_null` | Held-out scores of Haar-random rank-k subspaces and the observed mid-rank quantile | Synthetic-tested. A whole-span score above this null does not show that every rank contributes. | | `verdict` | `supported_rank` = number of consecutive ranks whose increment exceeds both the `null_quantile` (0.95) quantile of its null and `min_increment` (0.02); `status` is `pass` (all k), `partial`, `none` or `unavailable`; `summary` reads `supported_rank: s of k`; `qualifiers` list label-rank caps, detected interactions and undeclared basis/evaluation data overlap | Synthetic-tested. Predictive validity of a linear readout only. Unavailable when the basis spans the full width (no out-of-span null). | | `direction_scores`, `pairs`, `units`, `independence` | Held-out scores of each supplied direction and each pair; a pair is `joint` when it beats its best single direction beyond a pair null; `interaction` when adding the product term to an additive quadratic readout beats a null product; `units` are connected joint/interacting directions | Synthetic-tested on circular (twelve classes on a circle) and XOR-like fixtures. Direction-level, so not rotation invariant. Orthogonal directions can still interact ("The Geometry of Refusal in LLMs: Concept Cones"); joint units follow "Not All Language Model Features Are One-Dimensionally Linear". `no_interaction_detected` is not proof of independence. Assessed for `2 <= k <= max_pair_rank` (default 6). | | `stability` | Principal angles (degrees) of bootstrap refits against the full-data refit (median and 95th percentile per angle), refit-versus-supplied angles, failure count | Descriptive. The default refit is a Fisher class-contrast basis with at most `C - 1` rows; a custom `refit` can wrap a recipe. Bootstrap resamples whole groups when given. | | `refit_cv_score` | Held-out score of a basis refitted on each training fold | Descriptive; contrast with `per_rank`, which uses the supplied basis and is optimistic if that basis was fitted on the evaluation rows. | | `arms` | Three-arm comparison: gate-equivalent primary-direction separability (held-out score; in-sample and held-out oriented AUC for binary labels), PCA-threshold rank with the held-out score of those components, entropy effective rank, beside the prediction verdict | The primary arm says nothing about the remaining rows; the PCA and entropy arms are descriptive and are not rank-selection rules. | Defaults and caps: `folds` 5 (2 to 10), `n_bootstrap` 50 (0 to 500), `n_null` 50 (1 to 500), pair nulls `min(n_null, 20)`, rank at most 32 and at most the width, `max_pair_rank` at most 8. Readout fits scale with `folds * n_null * k`; the default refit costs one width-by-width eigendecomposition per bootstrap replicate and fold, so wide sites should supply a cheaper `refit` or fewer replicates. ## Geometry laboratory `obliteratus.analysis.geometry_lab.run_geometry_lab` measures local structure of one point cloud: synthetic benchmark rows, a stored `(n, D)` tensor, or one site of a verified labeled activation set (`lab_on_selection`). It is a research branch: it compares candidate local measurements before any curvature-guided edit is attempted, and it changes no other analyzer. Entry point: `obliteratus experiments geometry-lab benchmark|sweep|points`. The report (`schema` `obliteratus.geometry_lab`, `schema_version` 1) is JSON serializable and deterministic for the same ordered input, options and `seed`. It records every parameter, an input digest, the PCA view's fit rows, seed and fit-data digest, `flags` with explanations, and `measurement_evidence` using `status` as defined above and `evidence` (`descriptive`, `synthetic-tested` or `unsupported`). Synthetic-tested means asserted by `tests/test_geometry_lab_metrics.py` and `tests/test_geometry_lab.py` on synthetic CPU fixtures; it is not validation on a pretrained model and never a concept-structure or causal claim. Each nonlinear section carries `linear_baseline` with the global PCA rank and, where defined, a linear counterpart (kNN agreement with the PCA-rank projection; tangent angles to the global PCA subspace; PCA rank on each subsample). A nonlinear measure that does not beat its baseline offers no benefit over the linear analyses. The LID estimators assume locally uniform sampling of one fixed dimension at the k scale. That assumption is weakly supported for learned representations: "Token Embeddings Violate the Manifold Hypothesis" rejects it in several models, and no link between such estimates and model behaviour is assumed. The `local_regularity` test therefore runs first; when it rejects, `lid.dimension` is `null` with a reason and the raw estimates are kept for inspection only. `not_rejected` is not confirmation. ### Geometry laboratory report | Result field | Definition and units | Evidence and assumptions | | --- | --- | --- | | `linear_baseline` | Global centered PCA rank at `rank_threshold` (default 0.9) and leading variance ratios, components | Descriptive. Threshold rank need not equal the affine rank (a torus has affine rank 3 and threshold rank 2). | | `connectivity` | Components of the symmetrized kNN graph at k and 2k, component sizes, rows with a zero-distance neighbour | Synthetic-tested. A graph property at the chosen k; flagged `graph_disconnected` / `connectivity_depends_on_k`, never evidence of separate concepts. | | `neighbourhood_stability` | Mean fraction of k neighbours kept after isotropic Gaussian noise whose expected norm is `level` times the median kNN distance; chance overlap `k/(n-1)` | Synthetic-tested: exactly 1 at zero noise, rigid-motion invariant, decreasing toward chance. | | `local_rank` | PCA rank of each row plus its k neighbours at `rank_threshold`; histogram, median, mode, fraction at the cap `min(k, D)`, components | Synthetic-tested on plane, sphere, circle and torus. Requires a nearly flat yet spanning neighbourhood; `local_rank_at_cap` flags too small a k. | | `tangent_variation` | Largest principal angle between top-`dim` local PCA bases over unique kNN edges (quantiles, maximum, fraction above 45 degrees), degrees | Synthetic-tested: zero on a plane, the angular step on an evenly sampled circle, large across a union of subspaces. First-order only; not a curvature estimate. | | `lid` | Pooled Levina-Bickel MLE at k (MacKay-Ghahramani pooling) and TwoNN without tail discard, dimensions | Synthetic-tested within tolerance at n = 2000 on all single-dimension benchmarks; similarity invariant; noise inflates it. `dimension` is withheld unless the regularity test does not reject. | | `local_regularity` | Dispersion of per-row MLE log-ratio sums against a seeded uniform-cube null (0.99 quantile, and at least 1.15 times the Gamma value) and MLE scale consistency between k/2 and k (relative tolerance 0.25); verdict | Synthetic-tested: rejects a variable-dimension union of subspaces and a noisy circle at a scale where noise dominates; does not reject the homogeneous benchmarks. Limited power at low density. | | `resample_stability` | LID, median local rank and PCA rank on seeded row subsamples (`subsample_fraction`, `n_resamples`) | Synthetic-tested as part of the report. Subsampling only lowers density. | | `projection_distortion` | Spearman correlation of pair distances, ratio quantiles `d_view / d_raw`, stress-1 after optimal scaling, kNN preservation and false-neighbour fraction (view neighbours beyond raw rank 5k) | Synthetic-tested: zero distortion for an exact plane projection; sphere and swiss-roll views are flagged `projection_artifacts`. Pairs are sampled beyond `max_pairs`. | | `view_comparison` | PCA rank, LID, regularity verdict, local rank and component count in raw coordinates and in the view | Descriptive; differing components are flagged `view_connectivity_differs`. | | `curvature` | Intended intrinsic curvature | Unsupported and `null`: no validated estimator is implemented. | Synthetic benchmarks (`geometry_benchmarks.make_benchmark`) have known answers: plane, sphere, circle, torus and swiss roll (area- or length-uniform), and a union of orthogonal subspace cubes (variable dimension, optionally disconnected), embedded with a seeded rotation and optional per-coordinate noise. `run_sweep` reports density or noise sensitivity against the known dimension. Only PCA views are offered; UMAP is not a declared dependency. Input is capped at `max_points` (default 4000) by a recorded seeded subsample, since distances are computed exactly. ### Limits of the local-regularity test The dispersion floor (1.15) and the scale tolerance (0.25) were set on the synthetic benchmarks above after an initial run, not fixed in advance; their power on real activations is unknown. The test does not catch data whose apparent dimension is driven by noise at the chosen scale: a plane with heavy noise reads near the ambient dimension without being rejected, which the noise sweep shows. Treat an accepted LID as "not rejected on this data", never as evidence of a manifold or of a link to model behaviour.