From d670babe7b5a6b8f2da967e8cdbc96abbcf3d9f1 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Tue, 17 Nov 2026 15:37:59 +0800 Subject: [PATCH 1/6] research(trm): freeze ROC-TRM-01 source and measurement registration --- mechinterp/trm_roc01/CONFIG.json | 142 +++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 mechinterp/trm_roc01/CONFIG.json diff --git a/mechinterp/trm_roc01/CONFIG.json b/mechinterp/trm_roc01/CONFIG.json new file mode 100644 index 000000000..62a837afb --- /dev/null +++ b/mechinterp/trm_roc01/CONFIG.json @@ -0,0 +1,142 @@ +{ + "study_id": "ROC-TRM-01", + "title": "6-8 GB Sudoku TRM recurrent observer and causal closure sprint", + "registered_utc_date": "2026-11-17", + "status": "frozen_source_registration_no_new_model_data", + "home": "mechinterp/trm_roc01", + "source_pins": { + "mathcan_roc01": "37bbac210c175ccb98e0ff0d4aa8bdd2be0764e6", + "evalmath_roc01": "4351c15966c45ac09a0613da3531d4914344715a", + "preexisting_sudoku_runner": "mechinterp/loopscope02/scripts/trm_sudoku.py", + "preexisting_sudoku_reference": "mechinterp/loopscope03/docs/report.md" + }, + "pretrained_checkpoints": { + "primary": { + "repo_id": "gaoxin492/TinyRecursiveModels-Sudoku-Extreme-att", + "filename": "step_21700", + "sha256": "932b5e0df4e90021c21a064d4e716154086c46fda7afa676ea294484a30e38c3" + }, + "replication": { + "repo_id": "yagizdevre/trm-sudoku-extreme-att", + "filename": "model.pt", + "sha256": "d67723394a7fe439f1fa498b58196399ee89cd82a794c7da9ce0a8cc3df7fa39" + } + }, + "source_derived_architecture": { + "board_cells": 81, + "prefix_tokens": 16, + "state_width": 512, + "state_buffers": 2, + "full_state_dimensions": 99328, + "head_vocab_rows": 11, + "native_digit_rows": 9, + "native_digit_logits_upper_rank": 729, + "full_vocab_logits_upper_rank": 891, + "outer_h_cycles": 3, + "l_updates_per_h_cycle": 6, + "core_calls_per_outer_step": 21 + }, + "measurement": { + "clock": "complete_outer_ACT_step_including_both_buffers", + "transition_horizons": [1, 2, 4], + "state_steps": [2, 4, 8], + "outcome_steps": [6, 12, 16], + "future_readout_for_H": "native_nine_digit_logits_at_declared_output_step", + "closure_readout": "current_state_native_nine_digit_logits; eleven_vocab_rows_separate", + "operator": "T=D(F_x^n)(S_t); D=T-I", + "blocks": ["A=U^T D U", "B=U^T D Q", "C=Q^T D U"], + "causal_capture": "s=trace(U^T G_future^T G_future U)/trace(G_future^T G_future)", + "report": ["A_norm_over_D", "B_norm_over_D", "C_norm_over_D", "A_per_sqrt_k", "B_per_sqrt_k", "C_per_sqrt_k", "task_mse", "s", "native_solve", "flip_count", "lock_step", "NeverLock"], + "row_space_condition": "G_current P = G_current for exact readout-constrained closure", + "native_full_state_rank_grid": { + "base": "measured_native_full_board_readout_rank", + "additional_dimensions": [0, 1, 2, 3, 4, 7, 8, 12, 16, 32] + }, + "local_cell_diagnostic_rank_grid": [1, 2, 3, 4, 7, 8, 9, 10, 11, 12, 13, 16, 32], + "local_cell_diagnostic_only": true, + "hutchinson_probe_seeds": [2026111721, 2026111722, 2026111723], + "rank_null_seed_first": 941001, + "rank_null_seed_last": 941128, + "rank_null_distinct_min": 100, + "one_sided_tests": ["a_down", "b_down", "c_down", "b_up", "s_up", "s_down"], + "holm_alpha": 0.05, + "null_effect_thresholds": { + "near_zero_ratio_max": 0.20, + "large_B_ratio_min": 1.20, + "high_s_excess_ratio_min": 0.80, + "low_s_ratio_max": 0.20 + }, + "lambda_reference": 1.0, + "lambda_exploratory": [0.0, 0.05, 0.2, 1.0, 2.0], + "finite_perturbation_l2_primary": 0.2, + "finite_perturbation_l2_exploratory": [0.05, 0.5], + "intervention_arms": ["dark_to_observed", "observed_to_dark", "observed_to_observed", "ablate_readout"], + "required_controls": ["physical_l2_matched_random", "equal_budget_task_only_observer", "native_unmodified", "symbolic_baselines"] + }, + "bpd_gate_prior_to_any_real_TRM": { + "toy_name": "StationaryRoutedLooper", + "planted_active_set": "2_of_8", + "null_type": "permute_component_activations_across_batch_and_token_preserving_empirical_marginal", + "null_seeds_first": 280001, + "null_seeds_last": 280199, + "density_grid": [0.125, 0.0625, 0.03125], + "scale_grid": [0.5, 1.0, 2.0, 4.0], + "gate_precision_min": 0.8, + "gate_recall_min": 0.8, + "positive_control_significant_min_of_12": 8, + "positive_control_one_sided_p_max": 0.05, + "mean_ablation_control_required": true, + "if_fail": "stop_before_pretrained_TRM" + }, + "toy": { + "board_shape": [6, 6], + "box_shape": [2, 3], + "tokens": 36, + "prefix_tokens": 0, + "hidden_width": 96, + "state_buffers": 2, + "h_cycles": 2, + "l_cycles": 2, + "model_seeds": [173, 179, 181], + "generator_seed": 2026111701, + "split_seed": 2026111702, + "board_family_split": "canonical_solved_grid_orbits_hash_disjoint", + "target_train_count": 4096, + "target_calibration_count": 512, + "target_heldout_count": 512, + "minimum_nontrivial_heldout": 64, + "max_optimizer_updates_per_seed": 2000, + "max_batch_size": 8, + "outer_step_eval_grid": [1, 2, 4, 8, 16, 32], + "criterion": "at_least_2_of_3_seeds_solve_10pct_of_nontrivial_heldout_above_propagation_and_gain_5pp_from_step4_to_step16", + "if_fail": "publish_negative_result_and_stop_real_checkpoint_promotion" + }, + "real_pilot": { + "dataset": "existing_items256", + "cohort_selection": "sort_each_WB_Prop_or_WB_Stall_subcohort_by_sha256(board_id|2026111703)_ascending", + "per_checkpoint_WB_Prop": 8, + "per_checkpoint_WB_Stall": 8, + "batch_size": 1, + "checkpoint_retraining": false, + "larger_confirmation_set": "items256_only_after_original_pilot_report" + }, + "hardware": { + "default": "CPU_only_single_process", + "optional_toy_device": "RTX_3050_4GB", + "process_rss_stop_gib": 6.0, + "process_commit_stop_gib": 8.0, + "one_training_or_measurement_process_at_a_time": true, + "existing_B4_process_must_finish_or_be_checked_for_host_headroom": true, + "autograd_trajectory_caching": false, + "dense_full_model_jacobian": false + }, + "evidence": { + "preregistration_before_new_data": true, + "per_state_rows_required": true, + "per_seed_paired_reporting_required": true, + "hash_verified_checkpoint_loader_required": true, + "null_undefined_means_unclassified": true, + "local_cell_results_are_not_global_closure": true, + "partial_spectrum_is_not_certified_global_Lstar": true + } +} From a734f7d13fd7c9085004db25b248e660defe17b5 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Tue, 17 Nov 2026 15:39:14 +0800 Subject: [PATCH 2/6] research(trm): preregister observer math, toy gates and 6-8 GB protocol --- mechinterp/trm_roc01/PROTOCOL.md | 101 +++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 mechinterp/trm_roc01/PROTOCOL.md diff --git a/mechinterp/trm_roc01/PROTOCOL.md b/mechinterp/trm_roc01/PROTOCOL.md new file mode 100644 index 000000000..b6c561103 --- /dev/null +++ b/mechinterp/trm_roc01/PROTOCOL.md @@ -0,0 +1,101 @@ +# ROC-TRM-01 | Source-locked Sudoku TRM observer sprint + +**Registration date:** 2026-11-17. **Status:** source and prospective measurement choices frozen before any new ROC-TRM-01 puzzle generation, fitting, Jacobian measurement or pretrained-checkpoint rollout. `CONFIG.json` is the machine-readable specification. Changes to seeds, hypotheses, endpoints, or gates require a dated amendment committed before their affected measurements. + +**Target:** `MoralityLabAI/LoopedTransformers/mechinterp/trm_roc01/`. This is a distinct experiment from ROC-02 prospective delayed-rule binding/release and retrospective ROC-02A rank-eight ToyLoop. + +## Scientific target and existing evidence + +Explain how a small tied recurrent Sudoku model turns successive updates into durable solutions. Distinguish a stable solve basin, a solved-then-lost trajectory and a stall by finite-time dynamical response, head-visible state, latent-to-visible coupling, and work beyond hand-coded propagation. + +Use the two original 7M checkpoints only as *frozen diagnostic targets*. LOOPSCOPE-02 reports 226/256 exact solves for `gaoxin492` and 184/256 for `yagizdevre` on `items256`; LOOPSCOPE-03 gives separate visible/cache/residual counterfactuals and path dependence. These are preexisting results, not ROC-TRM-01 outcomes. Large LLM zero-shot comparisons are descriptive; the fair learning baselines are supervised tied/untied toy models and transparent symbolic solvers. + +The attached handoff from November 17 and the predecessor MathCan/EvalMath work supply the research rationale. This registration does not import unmeasured BPD-v2 gate claims as evidence of decomposition. + +### Source pins + +- MathCan ROC-01 observer math / amendment C: `patrickdugan/MathCan@37bbac210c175ccb98e0ff0d4aa8bdd2be0764e6`, [Part 2](https://github.com/patrickdugan/MathCan/blob/research/roc01-unified-observer-card-20261116/research/observer_calculus/PART2_THEORY.md) and [Amendment C](https://github.com/patrickdugan/MathCan/blob/research/roc01-unified-observer-card-20261116/research/observer_calculus/ROC01_AMENDMENT_2026-11-16C.md). +- EvalMath evaluator / BPD-01 intervention scorer: `MoralityLabAI/EvalMath@4351c15966c45ac09a0613da3531d4914344715a`, [PR #36](https://github.com/MoralityLabAI/EvalMath/pull/36). +- Existing [LOOPSCOPE-02 runner](../loopscope02/scripts/trm_sudoku.py), [LOOPSCOPE-03 report](../loopscope03/docs/report.md), and [ROC-02A retrospective report](../../experiments/observer_calculus_roc02a_v1/ROC02A_FROZEN_NRF_RANK_CAUSAL.md). +- Original model downloads via existing `load_trm_checkpoint`, SHA256 verified *before inference*: primary `gaoxin492/step_21700` = `932b5e0df4e90021c21a064d4e716154086c46fda7afa676ea294484a30e38c3`; replication `yagizdevre/model.pt` = `d67723394a7fe439f1fa498b58196399ee89cd82a794c7da9ce0a8cc3df7fa39`. + +## Architecture and state definition + +The pinned pretrained runner has 81 Sudoku cells, 16 prefix tokens, width 512, and *two* carried buffers `z_H,z_L`, each `97×512`. Hence the complete state is `S=(z_H,z_L)∈R^99328`. One **outer ACT step** is 3 H cycles, each with six L updates and one H update, totaling 21 tied core calls. All state-space measurements must use the complete paired transition `F_x(S)` with fixed board input `x`, including intercell and interbuffer effects. A state-local output projection is not a complete recurrent state. + +The model has an 11×512 `lm_head`, while `digit_logits` selects vocabulary rows 2:11 (nine digits) on 81 board cells of `z_H`. The *native Sudoku readout* therefore has rank **at most** 81×9=729 over the full state. The complete 11-row vocabulary observation has rank at most 81×11=891. Both ranks are measured from actual checkpoint matrices before defining the exact readout-containing rank floors. Prefix and L buffer coordinates may influence future digits despite having no direct digit-logit output. Treat `q_head`/halt output as a separately named exploratory readout. + +Define three explicitly different observers: + +1. **Global readout observer:** the direct-sum rowspace of the 81 digit heads embedded in the full paired state. This is the primary native observable subspace. Its constrained rank sweep uses measured global readout rank plus `{0,1,2,3,4,7,8,12,16,32}` added dimensions. The 11-row vocabulary version is a separate secondary sweep. +2. **Local-cell diagnostic:** the head rowspace of one 512D `z_H` cell and local ranks `{1,2,3,4,7,8,9,10,11,12,13,16,32}`. Here all other state coordinates are conditioned upon / held fixed for the partial derivative. Results quantify a local conditional sensitivity, **not** a full-state closed quotient. Ranks below actual digit readout rank are unconstrained diagnostics only. +3. **Learned task observer:** low-rank train-only subspaces with task-only, leakage-regularized, and PCA comparators, using identical optimization budgets and split discipline. Report a basis rank `k` and its containment constraint explicitly. + +## Mathematical operators and reporting + +At a declared captured state `S_t`, outer horizon `n∈{1,2,4}`, compute matrix-free `T=D(F_x^n)(S_t)` and `D=T-I`. For orthonormal observer basis `U`, `P=UU^T`, `Q=I-P` interpreted as a projector or orthonormal complement: + +- `A=U^T D U` (observed → observed), `B=U^T D Q` (dark → observed), `C=Q D U` (observed → dark). +- `a,b,c=||A||F,||B||F,||C||F` divided by `||D||F`; also retain raw norms per `sqrt(k)`. +- `G_0=Dg(S_t)` is the *current-state* declared readout Jacobian. An exact readout-containing closed observer must satisfy `G_0P=G_0`. +- `G_f=D(g∘F_x^n)(S_t)` is the *future-output* Jacobian. Its Gram is `H=G_f^T G_f`, yielding `s(U)=tr(U^T H U)/tr(H)`, with `s` undefined when `tr(H)=0`. +- `E(U)` is a train-only fitted observer's held-out task MSE. Exact puzzle solve, native output margins, first lock step, later flip count and `NeverLock` are distinct endpoints. + +Use JVP/VJP with randomized trace/Frobenius estimators and report probe variance and convergence. For nonlinear / nonnormal dynamics, top singular growth of `T`, spectral radius, and finite-kick contraction are distinct quantities. A single eigenvalue estimate does not establish contraction. Compare local behavior at early, pre-lock, locked, lost-lock and stalled states. Report board and checkpoint variance. + +### Exact closure and limits + +With `G_0P=G_0`, define `L*(k)=min_U ||U^T(T-I)Q||F` over exact rank-k readout-containing subspaces. The smallest closed readout-containing space is the `T^T`-invariant span of `G_0^T,(T^T)G_0^T,...`. Exact-rank closure may be non-monotone: `T=1⊕R90`, `G_0=e1^T` gives `L*(1)=0,L*(2)=1,L*(3)=0`; the `1⊕R90⊕R90` witness produces interior even-rank obstructions. + +Use the MathCan finite-horizon **lower bound**, with `O_N=[G_0;G_0T;...;G_0T^(N-1)]`: + +`L*(k) >= sqrt(sum_{i>k}sigma_i(O_N)^2) / (||G_0||F sqrt(sum_{j=1}^{N-1}j²||T||op^(2(j-1))))`. + +The denominator must be positive; the numerator can be zero. A sampled readout-containing completion yields a feasible **upper** bound. A partial numerical SVD cannot certify the entire tail without an explicit residual/error certificate. Label neural bounds as estimated if matrix-free numerical error has not been certified. Keep full-model `L*(k)` separate from local-cell and empirical task-error knees. + +## ROC-01 null calibration and interventions + +Use **128 SHA256-keyed rank-matched Gaussian/QR subspaces**, seed IDs 941001..941128, conditional on exact checkpoint, state, rank and horizon. Require 100 distinct projectors with fingerprints and per-state numeric rows. For raw `a,b,c,s` compute same-state rank-null medians and predeclare six tests `a↓,b↓,c↓,b↑,s↑,s↓`; tie-inclusive add-one empirical p and six-direction Holm-adjusted q≤0.05. A null-relative near-zero A/B/C needs ratio ≤0.20, large B ≥1.20, high s excess above median ≥0.80 of remaining range, low s ≤0.20 of null median. Undefined denominators, too few distinct bases, or estimated norm errors too large to resolve thresholds yield **unclassified**. Tags `closed quotient`, `invariant subspace`, `latched memory`, `output register`, `irrelevant` may overlap. Retain continuous scores in every case. + +Train leakage-aware U under task MSE + `λ·mean_i[(b_i/m_{b,i}(k))²]`, primary λ=1 and exploratory `{0,.05,.2,1,2}`. Use the same null medians for every candidate with the same state/rank/clock; preserve task-only equal-budget comparator. + +The active physical intervention arms are `dark→observed`, `observed→dark` and `observed→observed`, injected at declared steps on clean captured states. All need a matched physical-L2 isotropic and rank-matched control. Primary physical radius is 0.2; exploratory 0.05 and 0.5. `ablate_readout` is a mandatory separately reported control. Freeze-U acts on A and B together and is exploratory only. Record native logits, exact solve, time to lock, flips, and outcome at steps `{6,12,16}` for intervention steps `{2,4,8}`; only applicable forward horizon pairs are evaluated. Evaluate stable versus stalled strata separately. + +### Separate BPD mechanism gate + +The failed BPD-v2 Haar *component read-rotation* null is **not** repaired by applying more of those rotations. ROC's rank-matched random **subspace observer** null serves a different test; keep the two procedures and their claims distinct. + +Before *either pretrained 7M checkpoint* is instrumented, rerun a cheap `StationaryRoutedLooper` planted 2-of-8 routing toy with **activation-permutation nulls**: permute each component's own activation coefficients across batch/token to preserve its exact empirical distribution. Record matched mean ablation, as an important uniform bias can otherwise look non-specific. Freeze support-density settings `{1/8,1/16,1/32}`, scale `{0.5,1,2,4}`, and 199 permutation draws per condition, seed IDs 280001..280199. Require planted active-gate precision and recall ≥0.80 and one-sided planted-effect p≤0.05 in at least 8/12 density×scale conditions. A failed gate stops pretrained promotion; report the full 12-condition table and planted-factor maximum-versus-selected cosine. These thresholds are new prospective ROC-TRM-01 gates, **not** claims about the historical BPD-v2 results. + +## Experimental sequence + +### S0: registration, static tests and memory preflight + +- Commit this protocol and `CONFIG.json` before drawing any new puzzles, training weights or building new intervention data. Pin original hashes and preserve source manifest. Test registration consistency and tiny exact linear-algebra witnesses, requiring zero model compute. +- Check host available physical memory and Windows committed bytes before starting any later process. Earlier B4 v2 PID 275016 had ~21.7 GB committed at the time of its report; its current status is **unknown here**. Do not assume suspension releases committed memory. +- After this registration, implement and test a 6×6 exact uniqueness oracle, hidden/naked singles, pairs, triples, bounded-guess tiers, and exact solver reference. + +### S1: train miniature TRMs on disjoint 6×6 families + +- Use 2×3 boxes on a 6×6 board; 36 tokens, two recurrent 96D buffers, tied attention-based updates, 2H cycles × (2L+1H) calls per outer step; model seeds 173/179/181, generator seed 2026111701, split seed 2026111702. Deduplicate by canonical completed-board symmetry orbit across train/calibration/heldout before assigning folds. Cap at 4096 training, 512 calibration and 512 held-out boards; zero overlapping canonical solution orbits. +- Cap 2000 optimizer updates per model, batch≤8 and one process. Implement truncated gradient with detached previous outer state, using a single declared update clock. Freeze evaluation at ACT steps `{1,2,4,8,16,32}`; include an equal-parameter/compute untied task model, identical task-only observer and exact symbolic oracle. +- Hold at least 64 held-out puzzles unresolved by singles/pairs/triples propagation; if the generator cannot supply them under the frozen family definition, **fail the data gate** and publish the generator audit. Separate hard-to-solve-from-propagation and truly guess-dependent boards with the exact solver. +- Advance if at least 2/3 seeds solve ≥10% of the nontrivial held-out subset above deterministic propagation and improve exact solve by ≥5 percentage points from ACT step 4 to 16 on that subset. Report untied model performance as a comparator whether it wins or loses. Never substitute easy-board reconstruction for the gate. + +### S2: matched Jacobian / observer studies on frozen toy checkpoints + +- Freeze checkpoints at their preregistered update ceiling regardless of evaluation outcome. Choose states early, prior to first stable lock, durably locked, lost-lock, and stalled; use the same board IDs across observers and seeds. Compute T and finite-kick growth at outer horizons 1/2/4. +- Measure the native global and per-cell observer cards, plus learned task-only/leakage/PCA bases. Run 128 matched basis nulls and the physical interventions. Report per-seed paired errors, rank-normalized B and future-output capture with raw rows, plus exact symbolic-tier baseline. +- Only for small toy states with adequate RAM, use dense Jacobians as a cross-check against JVP/VJP for selected states; this is never the default route. + +### S3: frozen pretrained pilot, conditional on S1/S2 and BPD gates + +- Use original SHA-locked loaders, *batch one*, no training, no full 99,328² matrix. Select eight WB-Prop and eight WB-Stall items from `items256` per checkpoint by ascending SHA256 of `board_id|2026111703` within each stratum; publish actual IDs and hashes before measurement. +- Start with streaming JVP/VJP estimates of the global digit-head and 11-row head block metrics and finite-output changes. Run state/rank-matched nulls sequentially. Use realistic error bars: if 128-null/full-card completion would break the memory or time budget, explicitly label the inference incomplete. +- Link ROC outcomes to prior LOOPSCOPE-03 cache/residual and path-independence observations, conditioned on exact board IDs. Full `items256` can serve as later confirmation only under a separately dated registration. + +## Stopping, system memory and evidence + +Single-process CPU by default; optional RTX 3050 4GB toy acceleration. Abort safely if **process RSS reaches 6 GiB** or **committed/private bytes reach 8 GiB**; review host-wide headroom before any launch. Batch 1 on pretrained checkpoints; stream input batches, nulls and JVPs; do not retain long autograd trajectories or perform a full-rank `C=512` BPD fit. Logs need peak RSS, peak committed bytes, process and source hash, exact training/observer seed, board ID, step, clock, floating-point dtype and whether gradient checkpointing is used. + +Publish failed gates and abstentions. No claim of real pretrained mechanism, global optimum `L*(k)`, or statistical causal classification is authorized by this registration alone. The experiment's principal falsifier is a model that solves well while displaying no systematic native dark-to-visible effect, no stable finite-time contraction signature, or no nontrivial gain beyond symbolic propagation. From d6901af4fb627784540a8bd359c7eec2db68a768 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Tue, 17 Nov 2026 15:39:59 +0800 Subject: [PATCH 3/6] test(trm): audit source-lock dimensions, protocol gates and rotation witnesses --- mechinterp/trm_roc01/test_registration.py | 150 ++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 mechinterp/trm_roc01/test_registration.py diff --git a/mechinterp/trm_roc01/test_registration.py b/mechinterp/trm_roc01/test_registration.py new file mode 100644 index 000000000..91eac862f --- /dev/null +++ b/mechinterp/trm_roc01/test_registration.py @@ -0,0 +1,150 @@ +"""ROC-TRM-01 preregistration checks. Pure stdlib, zero model compute. + +Run: python -m unittest discover -s mechinterp/trm_roc01 -p 'test_registration.py' -v +""" +from __future__ import annotations + +import hashlib +import json +import math +from pathlib import Path +import unittest + +ROOT = Path(__file__).resolve().parent +CONFIG = json.loads((ROOT / "CONFIG.json").read_text(encoding="utf-8")) +PROTOCOL = (ROOT / "PROTOCOL.md").read_text(encoding="utf-8") + + +def b_block_coord_norm(T: list[list[int]], observed: tuple[int, ...]) -> float: + """Frobenius norm of U^T(T-I)Q for *coordinate* observers only.""" + d = len(T) + assert all(len(row) == d for row in T) + unseen = [j for j in range(d) if j not in observed] + return math.sqrt(sum(float(T[i][j]) ** 2 for i in observed for j in unseen)) + + +def make_rotations(n: int) -> list[list[int]]: + """Exact integer matrix T=1 direct-sum n copies of R_90.""" + d = 1 + 2 * n + T = [[0 for _ in range(d)] for _ in range(d)] + T[0][0] = 1 + for a in range(n): + i = 1 + 2 * a + T[i][i + 1] = -1 + T[i + 1][i] = 1 + return T + + +class TestRegistration(unittest.TestCase): + def test_metadata_and_pins(self): + self.assertEqual(CONFIG["study_id"], "ROC-TRM-01") + self.assertEqual(CONFIG["registered_utc_date"], "2026-11-17") + self.assertEqual(CONFIG["status"], "frozen_source_registration_no_new_model_data") + for key in ("mathcan_roc01", "evalmath_roc01"): + val = CONFIG["source_pins"][key] + self.assertEqual(len(val), 40) + int(val, 16) + for ck in CONFIG["pretrained_checkpoints"].values(): + self.assertEqual(len(ck["sha256"]), 64) + int(ck["sha256"], 16) + for x in ("No claim", "before any new ROC-TRM-01 puzzle generation"): + self.assertIn(x, PROTOCOL) + + def test_full_state_and_native_readout(self): + a = CONFIG["source_derived_architecture"] + self.assertEqual(a["full_state_dimensions"], + a["state_buffers"] * (a["board_cells"] + a["prefix_tokens"]) * a["state_width"]) + self.assertEqual(a["full_state_dimensions"], 99328) + self.assertEqual(a["native_digit_logits_upper_rank"], + a["board_cells"] * a["native_digit_rows"]) + self.assertEqual(a["full_vocab_logits_upper_rank"], + a["board_cells"] * a["head_vocab_rows"]) + self.assertEqual(a["core_calls_per_outer_step"], + a["outer_h_cycles"] * (a["l_updates_per_h_cycle"] + 1)) + self.assertEqual(a["native_digit_rows"], 9) + + def test_closure_clock_and_observer_definitions(self): + m = CONFIG["measurement"] + self.assertEqual(m["clock"], "complete_outer_ACT_step_including_both_buffers") + self.assertEqual(m["transition_horizons"], [1, 2, 4]) + self.assertEqual(m["native_full_state_rank_grid"]["base"], + "measured_native_full_board_readout_rank") + self.assertIn(7, m["native_full_state_rank_grid"]["additional_dimensions"]) + self.assertIn(9, m["local_cell_diagnostic_rank_grid"]) + self.assertTrue(m["local_cell_diagnostic_only"]) + self.assertIn("G_current P = G_current", m["row_space_condition"]) + + def test_null_and_physical_arms(self): + m = CONFIG["measurement"] + self.assertEqual(m["rank_null_seed_last"] - m["rank_null_seed_first"] + 1, 128) + self.assertGreaterEqual(m["rank_null_distinct_min"], 100) + self.assertEqual(len(m["one_sided_tests"]), 6) + self.assertEqual(len(set(m["one_sided_tests"])), 6) + self.assertEqual(m["holm_alpha"], 0.05) + self.assertEqual(m["lambda_reference"], 1.0) + self.assertIn("observed_to_observed", m["intervention_arms"]) + self.assertNotIn("freeze_U", m["intervention_arms"]) + self.assertIn("ablate_readout", m["intervention_arms"]) + self.assertEqual(m["finite_perturbation_l2_primary"], 0.2) + self.assertIn("physical_l2_matched_random", m["required_controls"]) + + def test_bpd_null_is_distinct_from_roc_null(self): + b = CONFIG["bpd_gate_prior_to_any_real_TRM"] + self.assertIn("permute_component_activations", b["null_type"]) + self.assertEqual(b["null_seeds_last"] - b["null_seeds_first"] + 1, 199) + self.assertEqual(b["planted_active_set"], "2_of_8") + self.assertEqual(len(b["density_grid"]) * len(b["scale_grid"]), 12) + self.assertTrue(b["mean_ablation_control_required"]) + self.assertGreaterEqual(b["gate_precision_min"], 0.8) + self.assertGreaterEqual(b["gate_recall_min"], 0.8) + self.assertEqual(b["if_fail"], "stop_before_pretrained_TRM") + self.assertIn("different test", PROTOCOL) + + def test_toy_folds_and_budget(self): + t = CONFIG["toy"] + self.assertEqual(t["box_shape"][0] * t["box_shape"][1], t["board_shape"][0]) + self.assertEqual(t["board_shape"][0] * t["board_shape"][1], t["tokens"]) + self.assertEqual(t["model_seeds"], sorted(set(t["model_seeds"]))) + self.assertEqual(len(t["model_seeds"]), 3) + self.assertLessEqual(t["max_batch_size"], 8) + self.assertGreater(t["target_heldout_count"], t["minimum_nontrivial_heldout"]) + self.assertNotEqual(t["generator_seed"], t["split_seed"]) + self.assertIn("hash_disjoint", t["board_family_split"]) + + def test_real_pilot_hash_selection_and_memory(self): + r = CONFIG["real_pilot"] + self.assertEqual(r["per_checkpoint_WB_Prop"], 8) + self.assertEqual(r["per_checkpoint_WB_Stall"], 8) + self.assertEqual(r["batch_size"], 1) + self.assertIn("sha256", r["cohort_selection"]) + self.assertFalse(r["checkpoint_retraining"]) + h = CONFIG["hardware"] + self.assertLessEqual(h["process_rss_stop_gib"], 6.0) + self.assertLessEqual(h["process_commit_stop_gib"], 8.0) + self.assertFalse(h["dense_full_model_jacobian"]) + + def test_rotation_exact_rank_parity_witnesses(self): + # Coordinate witnesses for MathCan's all-subspaces R90 proof. + t3 = make_rotations(1) + self.assertEqual(b_block_coord_norm(t3, (0,)), 0.0) + self.assertEqual(b_block_coord_norm(t3, (0, 1)), 1.0) + self.assertEqual(b_block_coord_norm(t3, (0, 1, 2)), 0.0) + t5 = make_rotations(2) + self.assertEqual(b_block_coord_norm(t5, (0, 1)), 1.0) + self.assertEqual(b_block_coord_norm(t5, (0, 1, 2)), 0.0) + self.assertEqual(b_block_coord_norm(t5, (0, 1, 2, 3)), 1.0) + # These tests verify explicit exact-rational/integer witnesses. + # The general lower-bound theorem is established in pinned MathCan. + + def test_bpd_selection_ids_and_explicit_abstention(self): + b = CONFIG["bpd_gate_prior_to_any_real_TRM"] + ids = [f"{b['toy_name']}|{i}".encode("utf-8") + for i in range(b["null_seeds_first"], b["null_seeds_last"] + 1)] + self.assertEqual(len({hashlib.sha256(s).hexdigest() for s in ids}), 199) + self.assertTrue(CONFIG["evidence"]["null_undefined_means_unclassified"]) + self.assertTrue(CONFIG["evidence"]["local_cell_results_are_not_global_closure"]) + self.assertTrue(CONFIG["evidence"]["partial_spectrum_is_not_certified_global_Lstar"]) + + +if __name__ == "__main__": + unittest.main() From 495e4d94c86ec6e5cd81a23ccabc7c90f1a04509 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Tue, 17 Nov 2026 15:40:25 +0800 Subject: [PATCH 4/6] docs(trm): add ROC-TRM-01 entrypoint and evidence boundaries --- mechinterp/trm_roc01/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 mechinterp/trm_roc01/README.md diff --git a/mechinterp/trm_roc01/README.md b/mechinterp/trm_roc01/README.md new file mode 100644 index 000000000..07230977d --- /dev/null +++ b/mechinterp/trm_roc01/README.md @@ -0,0 +1,22 @@ +# ROC-TRM-01: Sudoku loop-convergence within 6–8 GiB + +**Registered 2026-11-17.** This directory begins with a source-locked experiment protocol. It contains **no new trained checkpoint, generated Sudoku examples, Jacobian traces or causal result**. + +- [PROTOCOL.md](PROTOCOL.md) defines the complete recurrent state, ROC-01 nulls, exact-rank closure constraints, BPD toy gate, causal interventions, stopping criteria and provenance. +- [CONFIG.json](CONFIG.json) freezes the new seeds, clocks, output heads, threshold family, difficulty strata, process limits and original model SHA256s. +- [test_registration.py](test_registration.py) checks invariant dimensions, seed counts, nonconflation of ROC and BPD nulls, real-checkpoint safeguards, and exact rotation coordinate witnesses. + +Source-only checks from repository root: + +```bash +python -m json.tool mechinterp/trm_roc01/CONFIG.json > /dev/null +python -m unittest discover -s mechinterp/trm_roc01 -p 'test_registration.py' -v +``` + +**Stages:** S0 frozen sources and tiny static tests; S1 miniature 6×6 Sudoku training and a complete symbolic baseline; S2 task/rank-matched observer cards, conditional closure and finite causal effects; S3 frozen pretrained 7M checkpoint pilot if the preregistered toy gates pass. The BPD routed toy activation-permutation and gate-precision tests must also pass before S3. + +The actual full TRM carries 2×97×512 = **99,328** coordinates. Each 512D cell head has up to 9 native digit directions and 11 whole-vocabulary directions; the full Sudoku output has up to 81×9 = **729** direct dimensions. A rank-9/11 per-cell projection is a *local diagnostic*. The global observer, its 729-row rank ceiling, full recurrent clock and cross-buffer effects are documented in the protocol. + +For historical context, see [LOOPSCOPE-02](../loopscope02/README.md), [LOOPSCOPE-03](../loopscope03/README.md) and the [ROC-02A retrospective note](../../experiments/observer_calculus_roc02a_v1/ROC02A_FROZEN_NRF_RANK_CAUSAL.md). + +**Capacity rule:** one process; CPU by default with optional 4GB 3050 for miniature models; stop at 6 GiB RSS or 8 GiB process committed/private bytes, whichever comes first. Inspect host memory before launch. This registration does not resume, suspend or stop any Windows process. From 1716ea4ccfaf4e283b5b4287856f443e04d485f5 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Tue, 17 Nov 2026 15:40:28 +0800 Subject: [PATCH 5/6] ci(trm): verify prospective ROC-TRM-01 source lock without model compute --- .github/workflows/roc-trm01-registration.yml | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/roc-trm01-registration.yml diff --git a/.github/workflows/roc-trm01-registration.yml b/.github/workflows/roc-trm01-registration.yml new file mode 100644 index 000000000..3a7ffc14e --- /dev/null +++ b/.github/workflows/roc-trm01-registration.yml @@ -0,0 +1,33 @@ +name: ROC-TRM-01 source-only preregistration + +on: + push: + paths: + - 'mechinterp/trm_roc01/**' + - '.github/workflows/roc-trm01-registration.yml' + pull_request: + paths: + - 'mechinterp/trm_roc01/**' + - '.github/workflows/roc-trm01-registration.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + registration: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364b101e932e283 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Validate frozen JSON registration + run: python -m json.tool mechinterp/trm_roc01/CONFIG.json > /dev/null + - name: Verify source-only and exact witness assertions + run: python -m unittest discover -s mechinterp/trm_roc01 -p 'test_registration.py' -v + - name: Declare no model-compute evidence + run: | + echo 'This job verifies source registration only.' + echo 'It does not train any Sudoku model or validate pretrained causal claims.' From 6d572a1fa4c62407470fcad4764b79b350fd27d4 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Tue, 17 Nov 2026 15:41:58 +0800 Subject: [PATCH 6/6] ci(trm): correct pinned actions/checkout commit SHA --- .github/workflows/roc-trm01-registration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/roc-trm01-registration.yml b/.github/workflows/roc-trm01-registration.yml index 3a7ffc14e..1851f0d38 100644 --- a/.github/workflows/roc-trm01-registration.yml +++ b/.github/workflows/roc-trm01-registration.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364b101e932e283 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: actions/setup-python@v5 with: python-version: '3.12'