Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b3a0ede
RT-BPD-02: register reached-state weighted rank source-only math befo…
patrickdugan Nov 23, 2026
e444f71
RT-BPD-02: implement exact PSD reached-state and fixed-reader rank so…
patrickdugan Nov 23, 2026
6a6a876
RT-BPD-02: test exact singular, reader, gauge and contrast properties…
patrickdugan Nov 23, 2026
8123a10
RT-BPD-02: document exact solver, evidence limits and CAL archive con…
patrickdugan Nov 23, 2026
a434564
RT-BPD-02: normalize Markdown math and code formatting
patrickdugan Nov 23, 2026
e7c8cdb
RT-BPD-02: normalize Markdown math and code formatting
patrickdugan Nov 23, 2026
4837e5e
RT-BPD-02: run locked source-only math on hosted CPU CI
patrickdugan Nov 23, 2026
cacbcf4
RT-BPD-02: record eight passed synthetic CPU checks and native eviden…
patrickdugan Nov 23, 2026
2925a45
RT-BPD-02: normalize result-note code formatting
patrickdugan Nov 23, 2026
c9d0506
RT-BPD-02: run CPU tests without importing Torch-dependent BPD package
patrickdugan Nov 23, 2026
848d6f9
RT-BPD-02: run CPU tests without importing Torch-dependent BPD package
patrickdugan Nov 23, 2026
7842d76
RT-BPD-02: run CPU tests without importing Torch-dependent BPD package
patrickdugan Nov 23, 2026
2a19caf
RT-BPD-02: run CPU tests without importing Torch-dependent BPD package
patrickdugan Nov 23, 2026
96ffc06
Register RT-BPD recurrent gym and CAL archive replay
patrickdugan Nov 23, 2026
06033ca
Prove reach-transport identities and audit rank supports
patrickdugan Nov 23, 2026
17f043b
Verify paired recurrent gym and matched-dose controls on CPU
patrickdugan Nov 23, 2026
caa5877
Freeze and implement read-only Nanbeige CAL archive replay
patrickdugan Nov 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/rtbpd02-source-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: RT-BPD-02 CPU theory and synthetic replay

on:
pull_request:
paths:
- "mechinterp/bpd/theory/rtbpd02/**"
- ".github/workflows/rtbpd02-source-only.yml"
workflow_dispatch:

permissions:
contents: read

jobs:
weighted-rank-cpu:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
OPENBLAS_NUM_THREADS: "1"
OMP_NUM_THREADS: "1"
MKL_NUM_THREADS: "1"
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
mechinterp/bpd/theory/rtbpd02
sparse-checkout-cone-mode: false
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install source-only numerical dependency
run: python -m pip install --disable-pip-version-check "numpy==1.26.4"
- name: Check mathematical fixtures, custody logic and independent root reduction
run: python -m unittest discover -s mechinterp/bpd/theory/rtbpd02 -p 'test_*.py' -v
- name: Reproduce registered synthetic development receipts
run: python mechinterp/bpd/theory/rtbpd02/synthetic_gym.py --out "$RUNNER_TEMP/rtbpd02"
- uses: actions/upload-artifact@v4
with:
name: rtbpd02-synthetic-development
path: ${{ runner.temp }}/rtbpd02/*.json
if-no-files-found: error
retention-days: 14
21 changes: 21 additions & 0 deletions mechinterp/bpd/theory/rtbpd02/ARCHIVE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Nanbeige CAL archive and future extraction contract

The replay reads the eight existing focused CAL roots in both worlds at the initial last-prompt token, passes 1 and 2, physical layer 21. Each of the two backends supplies a 10,752-coordinate down-projection input, a 3,072-coordinate native write, and a 3,072-coordinate raw post-layer carrier for each case and pass. COMP14 captured these values at the first generation step with batch size one. The public roster supplies selection and slot identity. Only selected case and state payloads are opened. The corresponding terminal audit anchors the hashes and completed coverage for the original source. The replay verifies the initial token-list digest from the original tokenizer receipt, the case, and the capture length.

Use the SHA-locked local LoopedTransformers archive tree and the original snapshot directory. The runner checks pinned source and audit hashes, world pairing, backend, target parameter identity, pass, layer, vector shape, checkpoint revision, and separate BF16 and NF4 IO18 fit qualifications. It checks both IO18 trajectories against the common initializer and original all-one full-head and boundary-state bitwise receipts. The eight T2 atoms define the target sum for compression. The source model's physical down-projection is larger and has a separate closure check.

The BF16 replay streams both pinned shards through read-only handles and reads the requested affine and RMSNorm tensors with NumPy. It publishes bitwise match counts and numerical deviations of a specified CPU emulation against the original captured BF16 native writes. The archived all-one native qualification and the CPU emulation are separately identified. The fixed pass-1 K reader is the derivative of the continuous two-RMSNorm map at the train-fold mean carrier followed by the pinned K projection. Heldout worlds in a root stay together, and CAL exposures predate these folds. The K tangent measures a local reader coordinate and is upstream of attention, recurrence, and answer scoring.

Run the optional replay with archive and snapshot paths and a fresh output directory outside both input trees.

python mechinterp/bpd/theory/rtbpd02/replay_archive.py --archive PATH_TO_LOOPEDTRANSFORMERS --snapshot PATH_TO_PINNED_SNAPSHOT --out NEW_OUTPUT_DIRECTORY

Admission requires at least 5 GiB of available physical memory. The single-thread process uses below-normal priority, a 4 GiB system reserve, a 512 MiB process-private limit, and a 420 second wall limit. The runner does not load a decoder runtime. Its output consists of aggregate measurements and public source provenance plus a local EvalMath input with pseudonymous scalar root effects. The BPD report can publish the aggregate and EvalMath decision. Raw vectors, model weights, fitted factors, prompt text, and token IDs stay on the local host.

## Data needed for future native validation

A separately authorized CAL export sufficient to extend this analysis should be immutable, hash-addressed, and documented before any model run. Each record would bind checkpoint and backend build, physical parameter and quantization state, tokenizer revision and input token-list digest, root/world/split, semantic token position, pass, module path, tensor side, dtype, dimensions, physical coordinate-frame identifiers, and capture or patch hook version. Both worlds of one root must appear in the same split. A source whitelist must select CAL independently of any protected test file. A run receipt should account for every selected root and the wire-level tensor digest of every export.

For native NF4 affine and future-reader closure, provision the effective per-occurrence layer-21 down-projection and layer-0 K operator with its quantization specification, stored packed weights, dequantization scales and metadata, operand, accumulation and output dtypes, and the actual kernel or a numerically qualified implementation. Include matching archived module inputs and outputs and original all-one full-head and boundary-state parity. This makes the handling of axes in the NF4 backend checkable and enables a measured error bound. The BF16 checkpoint projection can serve as a separate baseline for a question about precision differences.

For native causal transport, capture recipients' pre-edit states and donors' aligned write contrasts. Lock the outcome direction and independent exposure plan before model execution. Verify exact unmasked full-head parity and the projection-specific all-one and zero-gate controls, measure the physical displacement and state radius at the actual site, and register equal-dose random, source-swap, and sign controls. Capture downstream Q/K/V and residuals as needed for the registered reader and record signed source-specific answer effects and correctness, including recovery and corruption. A delayed or joint rescue claim requires matched single- and joint-path interventions. Use a fresh authorized root population for causal inference and a separately calibrated matched-sham tolerance bound. The eight exposed roots supply compatibility and sizing information for that design.
27 changes: 27 additions & 0 deletions mechinterp/bpd/theory/rtbpd02/EXTENSION_PROTOCOL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# RT-BPD-02 extension registration

This source-only registration extends the [starting protocol](PROTOCOL.md) on BPD draft PR #146. The machine-readable contract is [EXTENSION_REGISTRATION.json](EXTENSION_REGISTRATION.json). Commit it before running the new gym or the Nanbeige archive replay. The [Nanbeige synthesis](https://github.com/MoralityLabAI/LoopedTransformers/blob/c074e354e8bcd4d26c02104fadd289dfdad8a207/reports/nanbeige_bpd_gym/NANBEIGE_RESEARCH_SYNTHESIS_20261123.md) supplies development context. The Nanbeige GPU goal remains paused. No pretrained decoder is run. The original 168 ARG-03-N test cases stay sealed.

## Exact questions

Audit the weighted Eckart–Young lift on singular moments and fixed readers. When numerical support is truncated, apply the cutoff to both the reader target and its inverse, report the loss in the resulting metric and in the original metric, and document the physical information that the lift leaves unidentified. Check orthogonal equivariance, general coordinate covariance of the objective and solution sets, and tied singular-value counterexamples. Extend the reference to thin sample factors so high-width empirical moments can be evaluated without a dense covariance.

Derive the symmetric operator/state disagreement identity and its cross term, fixed future-reader propagation, delayed-visible rank within the presently dark write space, and signed path interference. Establish a sufficient transfer bound using reached-moment and reader-metric domination. Test failures due to missing support, disagreement in direction at equal physical dose, and nonlinear interaction.

## Synthetic development

Use one fixed six-dimensional tied operator with a planted orthogonal basis. Propagate the live state with the fixed background and the shared write on each pass. Store the write in a separate cache slot and move it into delayed memory at the next step. The current readout uses the first two planted axes. The future readout uses the two configured mixtures of axes three and four. Check the fixed-reader predictions against explicit state continuation.

Fit on 24 independently generated source roots, with both counterfactual worlds in each root. A separate 64-root development stream uses the configured initial reach. A distribution-shift stress panel changes only the development reach scale. Compare ordinary SVD, reached-moment SVD, fixed-future-reader SVD, a fixed-bank BPD mask and a fixed seeded random output subspace at the common rank. Enumerate the fixed-bank masks on CAL and minimize the equal-weight mean squared error of the current and delayed linear readouts. This exercises BPD's physical mask law on supplied exact atoms. The archived T1 and T2 banks provide the separate learned-method comparison. Fit no masks on development. Record subspace stability from the two fixed halves of CAL.

The primary prediction is lower pass-2 future-reader error for reader weighting than ordinary SVD on the aligned development panel. The stress prediction is that reached-state weighting can lose its write-error advantage under shifted reach. Record relative errors, physical output-subspace angles, and finite future direction under a matched residual-space L2 dose. Set the dose to one-quarter of the root's true donor-write L2, and give zero or unavailable directions their explicit status. Use independent standard-normal common and half-contrast vectors in the planted coordinates, and scale both by the registered reach. World A subtracts the half-contrast and world B adds it. Fit a separate candidate per occurrence. Reuse the same development draws for the stress panel so the reach scale is the only difference. The evaluation keeps zero observed readout directions explicitly marked and assigns them a directional score of zero for EvalMath. A zero reference makes the directional endpoint unavailable. Report paired root effects and raw development receipts. EvalMath preflight uses the registered bounded directional statistic and matched random arm. Its resolution estimate is development planning with no sealed confirmation readout.

## Nanbeige archive

Read the existing audited COMP14 focused CAL last-token layer-21 MLP inputs, native write outputs and raw residuals in both worlds and passes. Verify the source/token/state hashes and the IO18 target, per-fit identities, and original exact all-one native qualification. Train each empirical basis without the scored root. Compare the shared SVD initializer and the T1 and T2 BPD/VPD factor banks at equal rank alongside ordinary SVD of the T2 sum, reached-moment reapproximation, paired-contrast weighting and matched random. Choose the archive T1/T2 and initializer atom subsets on the seven training roots by squared error to the T2 sum, with lexicographic ties. Use the same fold split for all methods. The archive endpoint measures compression of a frozen fitted physical operator. Verify the pinned BF16 full layer-21 affine map against the archived native module writes as a separate closure check.

Use a fixed BF16 future K reader only on pass 1. Compose the pinned layer-0 K matrix with the two continuous RMSNorm derivatives at the mean raw carrier of the training roots. Measure that linear readout locally; later attention, rounding of modified activations and answer effects remain outside this replay. A corresponding NF4 reader requires the exact quantized physical layer-0 projection and its arithmetic receipt. The rank-2 BF16 pass-1 directional descriptor uses one-quarter of the reference donor-write norm and the fixed output map on that matched physical vector. Apply the same directional-score convention as in the synthetic gym. Use the seeded random output subspace as the matched sham in a separate eight-root descriptive EvalMath run with unsealed and independence gates disabled for confirmation. Report any missing state, layout, support or custody requirement explicitly. Publish only aggregate results and source provenance in BPD.

## Acceptance

CPU CI must verify the algebraic identities and counterexamples, the recorded ranks and matched physical doses, and the full synthetic result from the committed source. Independently reduce the code-generated root receipts. Archive playback runs read-only on the existing local inputs under a bounded single-thread CPU lease. All 8 archive roots are exposed calibration and are never counted as confirmation. Scientific evidence distinguishes theorems, synthetic results, archival affine replay and unresolved native causal hypotheses.
185 changes: 185 additions & 0 deletions mechinterp/bpd/theory/rtbpd02/EXTENSION_REGISTRATION.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
{
"schema": "rtbpd02-extension/v1",
"starting_commit": "2a19cafcd02285a0c9946e0819fc6d8ccbcdc31d",
"nanbeige_synthesis": "c074e354e8bcd4d26c02104fadd289dfdad8a207",
"boundary": {
"cpu_only": true,
"pretrained_decoder_forwards": 0,
"gpu_jobs": 0,
"protected_ARG03_access": false,
"formal_tests": 0,
"readout": "development and finite synthetic only"
},
"weighted_solver": {
"support_relative_cutoff": 1e-12,
"default_baseline": "existing exact weighted Eckart–Young problem",
"reported_losses": [
"effective",
"full"
]
},
"synthetic": {
"geometry_seed": 14602,
"root_seed": 20261123146,
"train_roots": 24,
"development_roots": 64,
"rank": 2,
"physical_dose": 0.25,
"occurrence_passes": [
1,
2
],
"same_root_worlds": [
"A",
"B"
],
"branches": [
"aligned",
"shifted"
],
"spectrum": [
8,
6,
4,
3,
2,
1
],
"background_diagonal": [
0.25,
0.35,
1.45,
1.8,
0.7,
0.8
],
"recurrent_write_scale": 0.08,
"initial_reach_scale": [
0.25,
0.35,
1.15,
1.5,
0.6,
0.3
],
"shifted_development_scale": [
7,
5,
0.07,
0.055,
0.25,
0.2
],
"delayed_reader_mix": [
[
1,
0.2
],
[
-0.125,
0.75
]
],
"methods": [
"svd",
"reach",
"reader",
"bpd_static",
"random"
],
"primary": "aligned pass-2 held-out root mean squared fixed future-reader error",
"stress": "shifted pass-2 held-out root mean squared write error",
"numerical_closure_atol": 1e-11,
"directional_score": {
"zero_observed": 0,
"zero_reference": "unavailable",
"zero_atol": 1e-11
},
"root_generation": {
"distribution": "independent standard-normal common and half-contrast planted coordinates",
"world_A": "common-minus-half-contrast",
"world_B": "common-plus-half-contrast",
"scale": "multiply each coordinate of common and half-contrast by registered reach scales",
"split_seeds": [
0,
1
],
"shift": "reuse development standard-normal roots with shifted scale",
"rank_comparison": "separate per-pass fits",
"random_seed_derivation": "geometry RNG after basis, fixed for both passes and splits"
}
},
"archive": {
"expected_roots": 8,
"fit_split": "calibration",
"arm": "focused",
"token": "initial last semantic token",
"layer_zero_based": 21,
"site": "mlp.down_proj",
"backends": [
"nf4",
"bf16"
],
"passes": [
1,
2
],
"ranks": [
1,
2,
4
],
"target": "the sum of the frozen IO18 T2 rank-eight component operators in each backend",
"unmasked_native_qualification": "verify original all-one full-head bit-exact receipt on both fits per backend",
"native_affine_check": "BF16 only, independently replay layer-21 down-projection on sealed archive vectors",
"evaluation": "leave one complete CAL root out per fold, with both worlds in the same fold",
"moments": [
"root-balanced reached-state second moment",
"paired counterfactual contrast second moment"
],
"fixed_reader": "BF16 pass 1 only, K projection composed with continuous Jacobian of both RMS norms at the mean training-fold raw carrier; range restricted to the target write span",
"snapshot_revision": "451ed48c3273ecef7ea8faaa43c31ce529763bb1",
"max_private_bytes": 536870912,
"max_seconds": 420,
"minimum_start_available_bytes": 5368709120,
"minimum_reserve_bytes": 4294967296,
"local_archives": "never upload raw states, fitted arrays, token IDs, prompts or pretrained weights",
"source_file_sha256": {
"experiments/nan_comp14/SOURCE_MANIFEST.json": "b9a62f0eedaedc3eca4667412873d5c7151b6a4fb1f98b41bf1bc6978649043f",
"experiments/nan_comp14/fixtures/public.jsonl": "f6e714cb36b8cdc433eb75ff2bcbde8c1c1f7ebb4d5e6573ea1fdf97f43e5504",
"experiments/nan_comp14/fixtures/tokenizer_receipt.json": "a5ebf1eea257928c8e5579e05f1c4fe8698cbc6b0767e50c8511a75dea4f32bf",
"experiments/nan_readpath37/registration.json": "45f0f8f145ad28ea9334f27a96825b362238e4bea7aa3650f3f6d33e067cd09a",
"experiments/nan_fit16_io18/SOURCE_MANIFEST.json": "7bb76c5c895848cf12643312609a584ca0797bc87e9a05e320b8cfa2d04f4830",
"reports/nanbeige_bpd_gym/nan_fit16_io18_progress.json": "67129eba2f7d995638e9a43d35fd1cbcd3eab0a00e6b93274147be18affe321c",
"experiments/nan_bpd01/receipts/checkpoint_verification.json": "cd3f3223efe8ecf94155ee5e42ee093ddbf20d91b5d19a1decab30ea39e07fdd",
"runs/nan_comp14/audits/bf16.json": "75718b1d3764883f5960794587c0ecf3c6ca3d39a858246812cf971967d3f207",
"runs/nan_comp14/audits/nf4.json": "5c579d64d88f18c3feccb58f0e910b6a5022c5ae55693e4f1036cd29aa57b981",
"runs/nan_fit16_io18/audits/bf16.json": "539a74689a1942173fbad6ce55f53cac08133149167ba48f8a4af222e63ff93e",
"runs/nan_fit16_io18/audits/nf4.json": "d9885205c28fe5fa1ecf6b727ef8ca8580f963ee0b8a909c7eeb4f0f92d17536"
},
"bf16_affine_coordinates": "float64 affine product, then float32-to-BF16 round-to-nearest ties-to-even. Report elemental equality and numerical residual, without extending the archived all-one parity label",
"support_relative_cutoff": 1e-12,
"archive_random_seed": 37035,
"archive_direction_dose_fraction": 0.25,
"direction_zero_atol": 1e-11,
"archive_direction_planner": {
"scope": "BF16 pass 1, rank 2, exposed CAL only",
"paired": "half of fixed-reader cosine minus ordinary-SVD cosine",
"sham": "half of seeded random cosine minus ordinary-SVD cosine",
"independent_confirmation_units": false
}
},
"evalmath": {
"commit": "accf4d9040bee8daeabc6b07003bb484708996c0",
"root_metric": "(reader cosine minus SVD cosine)/2 at matched physical dose",
"scientific_min_effect": "0.10",
"target_effect": "0.25",
"measurement_resolution": "0.000001",
"quantile": "0.95",
"confidence": "0.95",
"alpha": "0.05",
"planned_comparisons": 1,
"nominal_planning_roots": 64,
"heldout_sealed": false
}
}
Loading
Loading