Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8d1b875
Bootstrap Algernon learning-computer research design
patrickdugan Nov 3, 2026
3ab4155
Bootstrap Algernon learning-computer research design
patrickdugan Nov 3, 2026
5907914
Bootstrap Algernon learning-computer research design
patrickdugan Nov 3, 2026
a5ecefb
Register falsifiable Algernon experiment tracks and evidence gates
patrickdugan Nov 3, 2026
3fc817e
Register falsifiable Algernon experiment tracks and evidence gates
patrickdugan Nov 3, 2026
48f6e99
Add offline Algernon registration validator and tests
patrickdugan Nov 3, 2026
9230f87
Add offline Algernon registration validator and tests
patrickdugan Nov 3, 2026
076adfb
Link Algernon learning computer research from repository overview
patrickdugan Nov 3, 2026
2b5b08f
docs(algernon): cross-reference continual learning and epistemic control
patrickdugan Nov 3, 2026
03a0135
docs(algernon): link epistemic-control cross-reference from README
patrickdugan Nov 3, 2026
dfd22bc
Merge Phase A checkpoint inventory from main into Algernon draft
patrickdugan Nov 3, 2026
602fe89
Add CPU-only compiled bitset LDT reference and split-grouped cases
patrickdugan Nov 3, 2026
f7e9434
Add CPU exact-kernel parity and graph split tests
patrickdugan Nov 3, 2026
ddcd6e5
Audit LoopedTransformers checkpoint deduplication and source-backed p…
patrickdugan Nov 3, 2026
a8d495b
Add strict checkpoint-audit unit tests
patrickdugan Nov 3, 2026
ba9d356
Add strict checkpoint-audit unit tests
patrickdugan Nov 3, 2026
a01cc8b
Document Phase A/B evidence, source locks and exact CPU reference
patrickdugan Nov 3, 2026
86a75b4
Document Phase A/B evidence, source locks and exact CPU reference
patrickdugan Nov 3, 2026
118d2f4
Document Phase A/B evidence, source locks and exact CPU reference
patrickdugan Nov 3, 2026
eb8c915
Document Phase A/B evidence, source locks and exact CPU reference
patrickdugan Nov 3, 2026
3bfa422
CI: verify Algernon CPU reference, registry, and checkpoint provenance
patrickdugan Nov 3, 2026
56846d8
Pivot Algernon to published looped-Qwen and latent-recurrence baselines
patrickdugan Nov 3, 2026
e88a300
Mark external-baseline pivot as active Algernon workorder
patrickdugan Nov 3, 2026
8634e9e
Mark external-baseline pivot as active Algernon workorder
patrickdugan Nov 3, 2026
2e17aae
Implement Algernon-02 exact circuit mirror and CPU pilot
patrickdugan Nov 3, 2026
3558424
Implement Algernon-02 exact circuit mirror and CPU pilot
patrickdugan Nov 3, 2026
77d20d9
Implement Algernon-02 exact circuit mirror and CPU pilot
patrickdugan Nov 3, 2026
89a5d61
Implement Algernon-02 exact circuit mirror and CPU pilot
patrickdugan Nov 3, 2026
a86f049
Implement Algernon-02 exact circuit mirror and CPU pilot
patrickdugan Nov 3, 2026
7ee7905
Implement Algernon-02 exact circuit mirror and CPU pilot
patrickdugan Nov 3, 2026
3c4d030
Document Algernon-02 circuit semantics and retain CPU experiment rece…
patrickdugan Nov 3, 2026
358ca23
Document Algernon-02 circuit semantics and retain CPU experiment rece…
patrickdugan Nov 3, 2026
f972ec1
Document Algernon-02 circuit semantics and retain CPU experiment rece…
patrickdugan Nov 3, 2026
7b63b6c
Document Algernon-02 circuit semantics and retain CPU experiment rece…
patrickdugan Nov 3, 2026
efc34e0
Document Algernon-02 circuit semantics and retain CPU experiment rece…
patrickdugan Nov 3, 2026
40784f6
Document Algernon-02 circuit semantics and retain CPU experiment rece…
patrickdugan Nov 3, 2026
700b330
Document Algernon-02 circuit semantics and retain CPU experiment rece…
patrickdugan Nov 3, 2026
d97befb
Link runnable Algernon-02 circuit-mirror experiment
patrickdugan Nov 3, 2026
eebdc6f
Record LOTUS external-source pin and unresolved checkpoint revision
patrickdugan Nov 3, 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
32 changes: 32 additions & 0 deletions .github/workflows/algernon-circuit-mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Algernon-02 circuit mirror
on:
pull_request:
paths:
- 'research/algernon/circuit_mirror/**'
- '.github/workflows/algernon-circuit-mirror.yml'
push:
paths:
- 'research/algernon/circuit_mirror/**'
- '.github/workflows/algernon-circuit-mirror.yml'

jobs:
exact-cpu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Unit tests (torch tests skip if torch absent)
run: python -m unittest discover -s research/algernon/circuit_mirror/tests -v
- name: Reproducible exact reference receipt
run: |
python -m research.algernon.circuit_mirror.run --out /tmp/algernon02
python - <<'PY'
import json
from pathlib import Path
reference = json.loads(Path('research/algernon/circuit_mirror/results/cpu_reference_4x8.json').read_text())
observed = json.loads(Path('/tmp/algernon02/cpu_reference.json').read_text())
assert reference == observed, 'CPU exactness receipt changed'
print('Verified frozen exact reference receipt')
PY
Comment on lines +14 to +32
54 changes: 54 additions & 0 deletions .github/workflows/algernon-cpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Algernon CPU provenance and exact-reference checks

on:
pull_request:
paths:
- "research/algernon/**"
- ".github/workflows/algernon-cpu.yml"
workflow_dispatch:

permissions:
contents: read

jobs:
algebraic-reference:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Compile Python
run: python -m compileall -q research/algernon
- name: Check registered unrun hypotheses
run: python -m research.algernon.validate_register
- name: Run CPU unit tests
run: python -m unittest discover -s research/algernon/tests -v
- name: Audit 77 checkpoint metadata records
run: |
python -m research.algernon.inventory.audit_inventory \
--inventory research/algernon/inventory/checkpoint_inventory.json \
--out runs/algernon/checkpoint_audit.json
- name: Run 250-case exact-reference workload
run: python -m research.algernon.exact_kernel --output runs/algernon/cpu_reference.json
- name: Check immutable reference and inventory receipts
run: |
python - <<'PY'
import hashlib
import json
from pathlib import Path
path = Path("runs/algernon/cpu_reference.json")
result = json.loads(path.read_text())
receipt = json.loads(Path("research/algernon/cpu_reference_receipt.json").read_text())
inventory = json.loads(Path("runs/algernon/checkpoint_audit.json").read_text())
assert result["n"] == receipt["cases"] == 250
assert result["reference_mismatches"] == receipt["reference_mismatches"] == 0
assert result["split_sha256"] == receipt["split_sha256"]
assert hashlib.sha256(path.read_bytes()).hexdigest() == receipt["record_file_sha256"]
assert (inventory["inventory_files"], inventory["distinct_checkpoints"],
inventory["duplicate_aliases"], inventory["source_verified_graft_candidates"]) == (77, 59, 18, 0)
print("Algernon CPU reference and provenance receipts confirmed")
PY
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Compactification Theory

**New research track:** [Algernon: a neural-net processor, a learning computer](research/algernon/README.md), joining compiled Qwenputer-style exact computation, recurrent CoT/LDT grafts, and sparse weight-space repair. [Experimental protocol](research/algernon/PROTOCOL.md) and [agent workorder](research/algernon/AGENT_WORKORDER.md).

The new [Pluto-Gym research package](research/pluto_gym/README.md) adds a runnable
interface-relative gym, a compact CPU student with bounded DRAM replay, and
curriculum experiments with a configurable designer webhook. Its pinned
Expand Down
55 changes: 55 additions & 0 deletions research/algernon/AGENT_WORKORDER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Agent workorder: Algernon-01

> **2026-11-03 supersession:** [PIVOT_EXTERNAL_BASELINES.md](PIVOT_EXTERNAL_BASELINES.md) is now the active execution order. Checkpoint inventory and legacy training-log recovery below are optional retrospective work, not exit conditions for Phase A/B. Begin with pinned Training-Free Looped Transformers on supported Qwen3, independently replicate a baseline, then investigate ReLIT/retrofitted recurrence. Preserve original tasks as an archival workorder.

**Mission:** turn the research scaffold into a minimal, independently tested graft experiment. Work in this folder, preserve upstream code ownership, and leave machine-readable receipts for every measurement.

## Phase A: inventory and freeze (CPU; first PR)

1. Resolve the current full commit SHA of divagr18/qwenputer and the published experiment log revision. Lock model revision, architecture config, tokenizer and licenses; preserve their source notices.
2. Search the accessible HybridTRMLDT, CoT-embedding and looped-transformer repos for real trained checkpoints. Record path, optimizer recipe, dataset, recurrence schedule, tensor shapes, measured performance and hash. An unverified anecdotal run is not a candidate.
3. Produce an interface matrix: Qwen3.5-0.8B, Qwen3.5-4B, former recurrent modules, delta-head topology, projection widths and memory footprints. Specifically check Qwenputer's two-value-head dependence.
4. Freeze train, calibration, and evaluation rosters. Assign problem-group IDs and ensure train/test group disjointness.
5. Add a lockfile, a provenance script, and executable unit tests. Keep all model weights out of Git.

**Exit A:** a reviewer can enumerate exact model revisions, validate no evaluation leakage, and decide which checkpoints are usable.

## Phase B: reference compiled processor (CPU first)

6. Run Qwenputer's upstream RV32 reference tests under its pinned environment. Record the exact command, pass/fail, instruction count and full revision. Do not attribute upstream's published results to our own run.
7. Implement a small fixed arithmetic/constraint kernel suitable for an LDT task and prove parity against an independently written Python evaluator on seeded test cases. Vary signs, boundaries, invalid inputs and long traces.
8. Measure code bytes, reference execution time and trace-token estimate as separate quantities.

**Exit B:** exact correctness on held-out cases in reference execution, with raw receipts.

## Phase C: 0.8B recurrent receiver (GPU optional, controlled)

9. Use a frozen Qwen3.5-0.8B checkpoint. Implement a reversible hook at candidate receiver layers and log the pre/post residual. Confirm K=0, zero gate exactly recovers the base.
10. Train only P/Q and a tiny recurrent F at first, using group-disjoint calibration and a fixed budget. Sweep K=0,1,2,4,8 and matched-parameter feedforward control. Record all seeds, tokens and GPU-seconds.
11. Compare site, effective rank, random direction and shuffled recurrence; calculate clustered intervals over problem groups. Report KL, semantic regressions, invalid projected states and accuracy.
12. Use the released weightspace p50c fixed edit only as a separate replicated arm. Apply sparse receiver edits to the graft only after it proves helpful; every edit needs a hash, support mask, matched random control and independent evaluation.

**Exit C:** a graft-specific causal gain at a justified resource cost; otherwise publish a negative result.

## Phase D: joint compiled + learned kernel

13. Design an explicit circuit-to-latent interface. Implement deterministic output receipts and ensure the learned component never rewrites the exact reference assertion.
14. Compare compiled only, recurrent only, combined, disabled component, shuffled state and host CPU-tool oracle on identical tasks.
15. Measure effective bits per modified weight, activation/gradient rank, long-horizon memory fidelity, quantization sensitivity and latency.
16. Make a separate GPU feasibility plan for Qwenputer-4B: reported text-only BF16 checkpoint is 18.7 GB, above 16 GB VRAM. Preserve exactness through any offload/precision change or report loss of bit-exactness.

**Exit D:** independent gains that require both components, with transparent compute cost and unchanged frozen-base skills.

## Reporting format

For each executed experiment add one immutable timestamped results folder containing:
- manifest.json: source SHAs, model revisions, task split hashes, evaluator version, execution device, precision, seed, limits;
- records.jsonl: per-item answer, reference, stop reason, token count, exact-state receipt, intervention arm;
- metrics.json: accuracy, paired delta and CI, number of invalid states, base-skill drift, VRAM, wall time, GPU-seconds;
- report.md: preregistered hypothesis, deviations and interpretation, with explicit separation of observations and ideas.

**Rules:** no automatic large GPU spend; respect existing experiment owners, preserve test/eval boundaries, mark untested paths, reject hash mismatches and do not merge on the strength of a synthetic proxy score.

## Requested handoff

Start by completing Phase A and Phase B. Open a PR with an audited checkpoint inventory, a bit-exact CPU reference test and a proposed choice of first LDT microtask. Schedule 0.8B training only once the retained model and test harness have passed those gates.
74 changes: 74 additions & 0 deletions research/algernon/ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Algernon architecture: compiled exact kernel + recurrent learned kernel

## Four distinct computational objects

1. **Token-time state:** for a DeltaNet head, a matrix S_t changes as token t is processed. One-hot keys and controlled gates support addressed reads and writes. Qwenputer uses this to store CPU memory.
2. **Algorithm-time recurrence:** a reused operator F updates a latent reasoning state z_k across k internal refinement iterations. This is the TRM/LDT target.
3. **Layer-depth propagation:** the frozen Qwen transform maps h_l to h_(l+1) with distinct pretrained layer weights. A graft at layer l changes downstream computation.
4. **Weight edit:** a permanent sparse delta to selected matrices, which may help Qwen consume a verified graft output but does not by itself establish algorithm insertion.

These operate on different clocks and state spaces. The experiment must explicitly define the conversion between them.

## Proposed joint model

Given prompt x, a frozen Qwen residual h_l(x), optional exact-machine state m_t, and a learned recurrent kernel:

~~~text
m_(t+1), c_t = C(m_t, instruction_t) exact compiled transition
z_0 = P(h_l, c_t, mask) state encoder
z_(k+1) = F_phi(z_k, h_l, c_t) shared recurrent refinement
r = Verify(Project(z_K), c_t) typed/semantic check
h'_l = h_l + gate(h_l,r) * Q(z_K, r) bounded, reversible residual write
y = Qwen_frozen_tail(h'_l) continue language processing
~~~

The first R-track prototype omits C and passes a zero-valued exact-state input. The C-track can be tested with its reference machine independently. Integrate only after each component passes its own gate.

The gate starts at zero. Record per-token and per-layer gated-write norms and clamp them relative to the original residual norm. Fail closed on nonfinite values or invalid typed projections. Weight-space edits later have a separate edit budget and baseline.

### Proposed objective (empirical)

L = L_task + lambda_KL * KL(p_graft || p_base) + lambda_cost * measured_compute
+ lambda_regress * existing_skill_regression + lambda_state * invalid_state_rate

Measure the terms separately. Gradient training is permitted **only** for the bridge/recurrent track with declared data. The released Qwen weight-edit reproduction is a distinct no-gradient intervention. Do not mix gradient and no-gradient evidence under the same label.

## Starting placements

Use Qwen3.5-0.8B to sweep layers 8, 12, 15, 19, 21 (zero indexed), as candidates rather than causal truths. The published sparse repair acted in 15 and 19. Compare a single receiver with distributed low-rank receivers at equal total trainable parameters.

For each candidate site:
- estimate effective residual-feature rank on calibration-only examples;
- record normalized Jacobian/sensitivity of the output to the injected state;
- check that P and Q are trained without exposure to test labels;
- compare K=0,1,2,4,8 (optional 16) recurrence;
- add a no-recurrence feedforward control with matched trainable parameters and wall-clock FLOP/time receipts;
- add shuffled-trajectory, zero-state, random-direction and frozen-random-kernel controls;
- report both learning gains and base-model retained skills.

**Failure mode to watch:** an added recurrence can merely increase the opportunity to loop or inject an answer label. Held-out, disjoint tasks and no-answer-leakage checks are mandatory.

## Exact kernel interface (proposed)

The compiled kernel should export a strict record:

~~~json
{"program_sha256":"<sha>","input_sha256":"<sha>","state_before_sha256":"<sha>","state_after_sha256":"<sha>","output_bytes_hex":"...","instruction_count":0,"trace_tokens":0,"exact_reference_match":true}
~~~

The joint processor consumes the *meaning* of this record through an explicitly learned interface; it never treats the reference comparison as user-visible reasoning. The reference machine remains outside the model for evaluation only.

Qwenputer's existing call bridge is token-mediated. Direct latent-state execution, without Qwenputer trace tokens, is a **new design to test**; the current implementation cannot be treated as demonstrating it.

## Position relative to the prior projects

- Compactification Theory supplies adapter capacity and precision tests, including multi-site receiver comparisons.
- HybridTRMLDT supplies explicit recurrence, typed membrane/projections and VPD diagnostics.
- Qwenputer supplies a compiled circuit construction and exact execution control.
- Takehi et al. supply the frozen sparse-repair example and bit-exact checkpoint reconstruction.

A valid Algernon result requires that the new capability survives counterfactual intervention on the added component. Promotion to a 27B Bonsai/1-bit target requires a separate quantization and throughput study.

## Learning criterion

A learning computer passes when an adaptive neural component demonstrably improves on *new held-out problems*, under an experiment that distinguishes learning in its parameters from computation with a fixed program. Report whether adaptation occurred by gradient update, residual memory write, inference-time recurrence, or sparse model edit, because these mechanisms represent different kinds of learning.
Loading
Loading