diff --git a/.github/workflows/algernon-circuit-mirror.yml b/.github/workflows/algernon-circuit-mirror.yml new file mode 100644 index 000000000..7cc215326 --- /dev/null +++ b/.github/workflows/algernon-circuit-mirror.yml @@ -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 diff --git a/.github/workflows/algernon-cpu.yml b/.github/workflows/algernon-cpu.yml new file mode 100644 index 000000000..841833b1d --- /dev/null +++ b/.github/workflows/algernon-cpu.yml @@ -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 diff --git a/README.md b/README.md index 382ba98d3..7efca4db5 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/research/algernon/AGENT_WORKORDER.md b/research/algernon/AGENT_WORKORDER.md new file mode 100644 index 000000000..4b45bbd85 --- /dev/null +++ b/research/algernon/AGENT_WORKORDER.md @@ -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. diff --git a/research/algernon/ARCHITECTURE.md b/research/algernon/ARCHITECTURE.md new file mode 100644 index 000000000..0d18a5ea5 --- /dev/null +++ b/research/algernon/ARCHITECTURE.md @@ -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":"","input_sha256":"","state_before_sha256":"","state_after_sha256":"","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. diff --git a/research/algernon/CONTINUAL_LEARNING.md b/research/algernon/CONTINUAL_LEARNING.md new file mode 100644 index 000000000..93dc9d29b --- /dev/null +++ b/research/algernon/CONTINUAL_LEARNING.md @@ -0,0 +1,69 @@ +# Continual learning and epistemic control for Algernon + +**Status: design cross-reference, 2026-11-03.** This document extends the research questions in [ARCHITECTURE.md](ARCHITECTURE.md) and [PROTOCOL.md](PROTOCOL.md). It records an *unrun candidate* experiment. The existing H-C, H-R, H-W, H-J registry and their gates remain unchanged. + +## Origin and scientific scope + +A user-supplied continual-learning video transcript (timecodes 0:00–25:15) motivates four practical requirements: selective retention (0:00–7:28), reconsideration of assumptions (9:43–12:23), choosing research directions under limited compute (14:50–18:21), and learning priorities from experience (18:30–22:44). The video is a conceptual prompt, not evidence that any proposed controller works or that a particular brain mechanism is necessary for AGI. + +Algernon's current experiments establish separate machinery for exact state transitions (H-C), recurrent latent refinement (H-R), sparse receiver correction (H-W), and their possible interaction (H-J). Their gates can succeed without producing a system that chooses what to learn next. That capability needs its own falsifiable evaluation. + +## Fourth clock: experiment time + +The architecture already distinguishes token-time DeltaNet memory S_t, recurrent algorithm-time state z_k, and persistent sparse parameter edits. Add an *experiment-time* state (b_e, M_e, B_e): a set of beliefs with provenance and uncertainty, bounded episodic/replay memory, and remaining resource budget. + +Candidate controller actions include selecting a probe or hypothesis, allocating refinement steps K, invoking an exact kernel, retrieving/replaying an experience, applying a separately approved parameter update, or halting an unproductive investigation. Keep exact-machine state, latent reasoning state, episodic memory, and model weights separately measurable. + +~~~text +a_e ~ pi_psi(a | b_e, M_e, B_e, task_e) +o_e = run_probe(a_e) # observed evidence and measured resource use +b_(e+1) = update(b_e, o_e, provenance(o_e)) +M_(e+1) = retain_or_replay(M_e, o_e, capacity) +B_(e+1) = B_e - measured_cost(a_e) +~~~ + +For a known simulator, a Bayesian filter can provide an *oracle comparator*. The controller need not assume oracle likelihoods are available in real tasks. Evidence from copies of one source must be treated as correlated; source-independent confirmations provide a different likelihood update. Quantify calibration and unwarranted updates. + +Suggested evaluation objective (pre-register coefficients and budgets before fitting): + +~~~text +J = held_out_task_utility + - lambda_cost * total_measured_probe_and_inference_cost + - lambda_forget * retained_skill_regression + - lambda_error * unsupported_belief_or_weight_updates +~~~ + +Log predicted value of information, realized information gain (where simulator truth permits), decision cost, source dependency, and the final held-out result. A high predicted gain alone is insufficient. + +## Candidate off-registry hypothesis H-M0: learned research pruning + +**Claim to test:** Within a fixed evidence and compute budget, a trained compact controller chooses probes that yield better held-out generalization and lower cumulative regret than simple scheduling and prompt-only controls. Its choices should adapt when previously promising hypotheses lose support. + +**First substrate:** [Pluto-Gym](../pluto_gym/README.md) already has a tiny CPU trainable student, bounded DRAM replay, explicit curriculum designer, deterministic synthetic environment, held-out rule combinations, and logged designer decisions. Reuse its manifest/receipt pattern and provider-neutral designer interface. Keep a new epistemic-control task module isolated from current Pluto-Gym training baselines. + +**Proposed evaluation families:** + +1. **Selective consolidation:** stable versus rapidly changing synthetic facts, noisy measurements, and clusters of copied testimony. Score posterior calibration, incorrect overwrite rate, retention accuracy, and adaptation lag. +2. **Budgeted experimental choice:** seeded hypothesis families with probes of unequal cost and variable informativeness. Give each arm the same observation and spend cap. Score held-out decision regret, realized information per total compute, and the ability to stop low-value probes. +3. **Framework revision:** hide some causal rule families from the initial hypothesis menu, then permit structured hypothesis proposals. Score genuinely new held-out predictions, independent falsification experiments, and subsequent transfer. Record whether an apparent proposal was available verbatim in the initial menu. + +**Controls:** random probe schedule; fixed heuristic/greedy uncertainty schedule; Bayesian oracle with access to the simulator's true likelihoods (upper bound); prompt-only frontier or local-model selector with matched information access and metered inference; learned controller with shuffled feedback; learned controller with frozen policy; replay-only student. Separate the cost of gathering oracle evidence from cost of choosing an action. + +**Metrics:** held-out accuracy/regret after each fixed spend interval, calibration (Brier/log loss where applicable), false-update rate, cumulative probe cost, wall time, tokens/FLOPs, replay bytes, retained prior-task accuracy, and run-to-run dispersion. Train/calibration/test must be split by generator family and seed, including independent final rule families. Confidence intervals cluster on task generator. + +**Strong-claim failure:** learned selection provides no repeatable held-out gain over a cost-matched simple policy; its gains vanish with shuffled-feedback control; or improvement comes exclusively from unmetered external inference or test leakage. Report partial results under their narrower labels. + +## Integration sequence + +- **Now, CPU-first:** complete Algernon Phase A/B and run an isolated small H-M0 simulator on Pluto-Gym-style receipts. Register a new protocol/version before first evaluation, preserving the four original unrun hypotheses. +- **After H-R passes:** let a tiny controller choose K and receiver mode from calibration-derived uncertainty. Compare adaptive K against a fixed-K policy at equal *measured* compute; test with the gate disabled and the decision policy shuffled. +- **After H-J passes:** choose between a compiled exact operation, recurrent heuristic refinement, and another evidence probe, using typed receipts. Score tool accessibility parity, exact fidelity, and total processor cost. +- **Only after memory and adaptation checks:** evaluate persistent changes in replay state or low-rank adapters across task episodes. Distinguish updates to weights, bounded external memory, transient activations, and purely in-context reasoning. + +## Related project boundaries + +- [HybridTRMLDT recurrence taxonomy](https://github.com/MoralityLabAI/HybridTRMLDT/blob/master/docs/looped_transformer_trm_ldt_taxonomy.md) identifies the learned mode/schedule and projection operator as potential control points. Its current VPD role is instrumentation. +- [HybridTRMLDT fixed-edit replication PR #5](https://github.com/MoralityLabAI/HybridTRMLDT/pull/5) remains an independently measured H-W prerequisite. A frozen human- or agent-discovered patch is evidence for a repair method, with no implied on-device continual learning. +- The published Qwenputer construction is an exact execution substrate. Continued training, uncertainty updates, and autonomous experimental selection require their own receipts and intervention controls. + +**Next coding-agent instruction:** keep the original Phase A/B handoff intact. As a separate CPU-only branch or follow-on PR, propose the smallest H-M0 simulator and scoring script using Pluto-Gym-compatible manifests. Report simulated observations with provenance, and leave all capability claims unrun until measured. diff --git a/research/algernon/INTERFACES.md b/research/algernon/INTERFACES.md new file mode 100644 index 000000000..385a3a83e --- /dev/null +++ b/research/algernon/INTERFACES.md @@ -0,0 +1,43 @@ +# Phase A interface matrix: LoopedTransformers → Algernon + +**Status: metadata-derived design constraints.** The checkpoint inventory contains tensor shapes and byte hashes. No local training logs, model outputs or Qwen residual activations were available to certify a graft. + +| Family found in inventory | Total files | Tensor layout | Parameters per checkpoint | Possible interface | +| --- | ---: | --- | ---: | --- | +| Weight-tied | 45 | one `blocks.0` pair of 128×128 linear maps plus two 128-biases | 33,024 | 128-dim state bridge, recurrence schedule to recover | +| Untied, 16 blocks | 12 | 16 sets of in/out projections | 528,384 | step-specific 128-dim stack; do not treat as tied recurrence | +| Untied, 32 blocks | 12 | 32 sets | 1,056,768 | step-specific 128-dim stack | +| Untied, 64 blocks | 8 | 64 sets | 2,113,536 | step-specific 128-dim stack | + +All 77 inventory entries collapse to **59 distinct SHA-256 hashes**. Recovery folders contain 18 redundant aliases. These counts are based on the committed inventory JSON, and do not establish accuracy or compatibility. + +The checkpoint schema lists `cell_id`, `exposure`, `optimizer`, `state_dict`, and `step` as top-level keys. Current metadata extraction only retained the names and tensor shapes. The actual optimizer *configuration*, training dataset, recurrence timing, target/task identity, latent semantics, and verified held-out performance must come from source receipts. Names such as `R64` and `E4096` are filename clues rather than certified schedules or training steps. + +## Proposed bridges and constraints + +| Receiving substrate | Known feature width / role | Proposed bridge | Required gate | +| --- | --- | --- | --- | +| Qwen3.5-0.8B | 1,024-dimensional residual in 15/19 MLP down-projections | `P:1024→128`, `Q:128→1024` | trained reversible receiver, zero-gate parity, ablation at equal FLOPs | +| LoopedTransformers tied checkpoint | 128-dim in/out projections, 33,024 saved model parameters | repeat one 128-dim block according to *logged* schedule | reproduce its standalone held-out result first | +| LoopedTransformers untied checkpoint | 16/32/64 sequential 128-dim blocks | choose explicit pass schedule; count all weights and compute | step semantics must be recorded before calling it recurrent | +| Qwenputer RV32 on Qwen3.5-4B | 11 compiled layers in front of pretrained model; DeltaNet CPU memory | compiled exact circuit / token bridge | upstream RISC-V reference suite and trace hash parity | +| Joint Algernon | separate token-clock RAM and algorithm-clock recurrence | typed exact-output record to latent state; gated residual write | independent causal ablations and retained skills | + +**Architecture boundary:** Qwenputer's published RV32 core assumes two value heads per key head, while Qwen3.5-0.8B's layout gives one. Compiled 4B and sparse-edit 0.8B experiments remain separate until a new head map is constructed and tested. + +Qwenputer reports an approximately **18.7 GB** merged BF16 text checkpoint and roughly 31 GB host RAM for its merge; a 16 GB RTX 5080 must use a specifically tested offload/quantization route. + +## Candidate selection rule + +A checkpoint becomes a *source-verified candidate* only when a receipt references its exact 64-digit checkpoint SHA-256 and a local experiment log whose SHA-256 is independently recalculated, with: + +- optimizer recipe and code commit; +- dataset ID and SHA-256; +- recurrence schedule; +- a held-out evaluation, sample count and split hash. + +Run `python -m research.algernon.inventory.audit_inventory --inventory research/algernon/inventory/checkpoint_inventory.json --out runs/algernon/checkpoint_audit.json` from the repository root. Add `--receipts /path/to/receipts.json --logs-root /path/to/LoopedTransformers/experiments` after the old logs have been inspected. Qualifying receipt status measures provenance completeness, **not model performance replicated here**. + +## First microtask + +`research/algernon/exact_kernel.py` solves tiny directed-graph reachability through repeated bitset closure and verifies it against an independently implemented BFS. It supplies step-indexed states and group-disjoint graph families for learning/recurrent ablations. It is **ordinary CPU code**, serving as a future reference for a compiled circuit, not a Qwenputer layer. diff --git a/research/algernon/PHASE_AB_STATUS.md b/research/algernon/PHASE_AB_STATUS.md new file mode 100644 index 000000000..3cc7b1815 --- /dev/null +++ b/research/algernon/PHASE_AB_STATUS.md @@ -0,0 +1,43 @@ +# Algernon Phase A/B status, 2026-11-03 + +## Completed and independently inspected + +- Main commit `319ce426ddb30b16a07ff4e5dae31590b95e2206` introduced the user's checkpoint inventory and script. It was merged into the draft PR branch by merge commit `dfd22bc38d37407d42d9cc9606a6bcd3216d6a87`. +- The JSON contains 77 checkpoint entries grouped into 9 experiment/recovery directories and 59 unique byte-level SHA-256 hashes; 18 entries are duplicates. 45 describe a tied 33,024-parameter module. The remaining 32 describe untied 16/32/64-block stacks. +- All original inventory entries have `performance_recorded=false`. Log-backed qualified graft candidates: **zero**. +- `inventory/audit_inventory.py` groups aliases by SHA, validates shape metadata, and requires a locally hash-verified experiment log plus optimizer/dataset/schedule/held-out evaluation evidence before a candidate becomes source-verified. +- The Qwenputer upstream source ref and the Weight-Space Programming logs are pinned in `source_lock.json`. These are source-revision observations, not evidence of a new run. + +## Executed CPU microkernel (independent preliminary Phase B) + +On Python 3.13.5 CPU, the local script `exact_kernel.py` was tested against an independent BFS oracle. Five unit tests tested exact-parity logic and another five tested inventory/provenance rules: **10/10 passing**. The graph fuzz test includes 1,000 generated examples. A further fixed-roster suite generated 250 cases, 50 per graph family, with zero bitset/BFS mismatches. The immutable receipt containing exact hashes is `cpu_reference_receipt.json`. + +The result tests deterministic lattice refinement. **Qwenputer RV32 in-weight execution was not run.** + +## Remaining gates + +1. Run the committed inventory audit against the original local experiment directory, and provide/verify source-log-backed performance receipts. Never guess schedule from `Rxx` filename fragments. +2. Recover at least one prior independently evaluated recurrent checkpoint and its original train/test splits before selecting a graft. +3. Execute upstream RV32 reference tests at pinned commit `bec1a0c9654ac8151b6f36ed0154a19c53141384`: + ```bash + git clone https://github.com/divagr18/qwenputer.git + cd qwenputer + git checkout bec1a0c9654ac8151b6f36ed0154a19c53141384 + cd experimental/riscv + uv sync --extra hf + uv run pytest tests/test_rv_ref.py -q + ``` + For the full circuit tests use `uv run pytest tests -q`. Record skip counts, wall time, installed lockfile and raw stdout. GPU execution is a separate step. +4. Reproduce its reference outputs on the same graph microtask. A Python reference pass cannot substitute for a compiled neural circuit trace. +5. Freeze final train/cal/test splits and compute budgets for the 0.8B residual-receiver experiment. + +## Commands on a clone of Compactification-Theory + +```bash +python -m unittest discover -s research/algernon/tests -v +python -m research.algernon.validate_register +python -m research.algernon.inventory.audit_inventory --inventory research/algernon/inventory/checkpoint_inventory.json --out runs/algernon/checkpoint_audit.json +python -m research.algernon.exact_kernel --output runs/algernon/cpu_reference.json +``` + +The current environment could inspect GitHub source through a connected account but could not resolve github.com for cloning and had CPU-only PyTorch. The upstream Qwenputer suite and the local LoopedTransformers checkpoint files thus remain unavailable for direct execution here. diff --git a/research/algernon/PIVOT_EXTERNAL_BASELINES.md b/research/algernon/PIVOT_EXTERNAL_BASELINES.md new file mode 100644 index 000000000..14a4afe97 --- /dev/null +++ b/research/algernon/PIVOT_EXTERNAL_BASELINES.md @@ -0,0 +1,52 @@ +# Algernon pivot: build on reproducible external successes + +**Decision 2026-11-03.** The 77 legacy LoopedTransformers checkpoint files (59 distinct SHA-256 hashes) and their unresolved training logs are **archival material**. Recovering the D-drive experiment logs is optional and explicitly **not a Phase A or B prerequisite**. Do not spend additional agent/GPU time searching for those checkpoints unless a future audit specifically asks for them. + +## New critical path + +Start with a working external reference, preserve its behavior on a fixed test roster, then make one independently measurable change. + +| Priority | Implementation | Established reference | Our concrete first test | +| --- | --- | --- | --- | +| **P0: frozen loop** | [Training-Free Looped Transformers](https://github.com/L-z-Chen/Training-Free-Looped-Transformer), [paper](https://arxiv.org/abs/2605.23872) | Authors show damped middle-block recurrence on pretrained Qwen3 with reproducible code; reported Qwen3-4B-Instruct MMLU-Pro +2.64 percentage points | First reproduce baseline vs anchored damped K=6 wrapper on the author's supported Qwen3 architecture. Only after verification explore Qwen3.5, as its DeltaNet/attention internals differ | +| **P1: trained latent core** | [ReLIT](https://arxiv.org/abs/2608.08113) | Published lightweight recursive latent block on a frozen TinyLlama-1.1B, with reported logical reasoning gains | Locate verified code/weights and reproduce reported task accuracy. If unavailable, use [Retrofitted Recurrence](https://github.com/mcleish7/retrofitting-recurrence), which supplies public training/conversion/evaluation code | +| **P1: deterministic processor** | [Qwenputer](https://github.com/divagr18/qwenputer) | Compiled RV32 computer and DeltaNet RAM in Qwen3.5-4B; published reference checks | Repeat CPU reference suite and one minimal compiled arithmetic/state task, preserving exact trace receipts | +| **P1: sparse repair** | [Weight-Space Programming logs](https://github.com/RikiyaT/lm_understand-logs/tree/main/exp8_math) | Published reversible sparse p50c patch in Qwen3.5-0.8B | Finish independent frozen-patch evaluation from [HybridTRMLDT PR #5](https://github.com/MoralityLabAI/HybridTRMLDT/pull/5), compare support/norm-matched random control | +| **P2: joint learning computer** | Algernon | Speculative integration | Combine only after the first two components show causal benefit independently, with complete compute accounting | + +## P0 proof of concept: preserve a working external Qwen3 model + +**Replication protocol:** +1. Pin upstream Git commit and all environment/model revisions before inference. Inspect upstream licensing, versions and its test set, then run its exact baseline/recurrent settings. +2. Run a dry model-load and one prompt with K=0. On a supported Qwen3 model, validate that K=0 reproduces original logits/outputs to a recorded tolerance. +3. Evaluate the upstream's anchored damped recurrence with K=6, beta=0.5 and its documented cache handling; keep sample roster and prompt template identical. +4. Compare K=0, K=1, K=2, K=4, K=6 and K=8, pre-registering a single primary task and a total GPU/token limit. Distinguish loglikelihood prefill-only scores from generative decoding tests. +5. Check held-out gains, regression on base skills, KL to original model, latency, GPU-seconds and peak VRAM. Test naive unscaled block replay as a negative control. +6. Only after a positive reproduction, attempt a **small Qwen3.5-specific** recurrence adaptation, measuring DeltaNet-state/cache correctness explicitly. + +**Causal extension:** freeze the successful loop operator; replace its contribution with a constant state, a shuffled state and a same-compute one-pass residual transform. If only the looped arm improves, investigate the responsible layer circuit with VPD. + +## Recurrent graft follow-up + +A trained ReLIT-style bridge, when verified, is the candidate to join Qwen with an iterative latent core. Train a zero-initialized, reversible bridge while the pretrained base stays frozen. Compare recurrent depths against an equally sized feedforward block. Evaluate new tasks by generator-disjoint split and lock candidate layer selection to calibration data. Keep the compiled exact kernel separate until training/recurrent gains are independently measured. + +## Hard boundaries + +- **Model-family boundary:** The Qwen3 training-free wrapper cannot simply be assumed correct on Qwen3.5 Gated DeltaNet. Reuse its research method, then write and validate a model-specific adapter. +- **Hardware boundary:** Published Qwenputer RV32 Qwen3.5-4B BF16 checkpoint (~18.7 GB) exceeds a 16 GB RTX 5080 in all-VRAM form. Plan offload/quantization and repeat exactness tests before deployment. +- **Scientific boundary:** A weight-space repair that rescues existing reasoning does not demonstrate algorithm grafting, while exact compiled arithmetic does not demonstrate learned reasoning. +- **Compute boundary:** Start with small frozen-roster smoke tests, an explicit spending cap, and preserved raw receipts. Avoid large exploratory training until a reference baseline is independently reproduced. + +## What to archive + +Keep `research/algernon/inventory/` and its hashes as historical provenance. The optional legacy retrospective may later recover training recipes and results from D drive. No present experiment depends on doing so. + +## Exit conditions + +**P0 pass:** pinned external source + model; same-device base/loop comparisons; recorded actual inference costs; primary accuracy result with paired uncertainty; absence of severe regression; reproducible command and retained records. + +**P1 pass:** independently measured causal depth benefit from a trained latent module, or a documented negative result; exact computation validated separately. + +**P2 pass:** a combined processor improving a held-out task over its best component at matched information and metered compute, with a state/weight ablation that removes the improvement. + +Keep the original H-C, H-R, H-W and H-J hypothesis identifiers. This document updates execution priority without rewriting the registered scientific questions. diff --git a/research/algernon/PROTOCOL.md b/research/algernon/PROTOCOL.md new file mode 100644 index 000000000..673b925e9 --- /dev/null +++ b/research/algernon/PROTOCOL.md @@ -0,0 +1,84 @@ +# Algernon-01 protocol: evidence gates and falsification + +**Draft registry date:** 2026-11-03. The hypotheses below are registered as directions for subsequent experiments. A specific numerical threshold, model candidate, dataset roster and execution hash must be frozen *before* the corresponding experiment is run. The scaffold is not itself a published preregistration of an executed trial. + +## Separation of evidence + +- **External evidence:** Qwenputer's published RV32 programs and trace checks; Takehi et al.'s published p50c edit and benchmark results. Quote these as externally reported. +- **This repository's evidence:** only commands that we execute, paired with command logs, versions and retained raw outputs. +- **Hypotheses:** trainable grafts, latent direct execution, structural reuse of compiled DeltaNet RAM, 27B transfer and precision-layer repairs. Keep labelled as untested until tested. + +## Staged experiment + +### Gate 0: CPU-only source and contract +- Verify source and checkpoint revisions and their licenses. +- Inventory actual old CoT-looped/TRM/LDT weights, separated from architecture sketches. +- Freeze one group-disjoint task set with training, calibration and test splits; record SHA256 for each. +- Test register schema and record manifest. Refuse missing/changed revisions. +- Record reference-model CPU exact outputs for small state-transition and arithmetic tests. + +### Gate 1: compiled correctness +**H-C:** A compiled exact kernel retains the independent interpreter's input-to-state-to-output transition. + +Precommit cases: arithmetic signs, overflow, boundary indexing, reset, branch, invalid input, full trace length, memory read/write. Compare state bytes and output bytes. Match both isolated and batched execution where available. Include a deliberately corrupted instruction as a negative control. Missing or skipped cases are reported separately. + +Reference parity of the circuit demonstrates correct execution; it does not demonstrate reasoning or learned adaptation. + +### Gate 2: recurrent graft causality +**H-R:** A learned recurrent graft improves group-disjoint reasoning task accuracy at some K > 1, beyond matched-parameter feedforward and extra-token baselines, while preserving the Qwen base skills within a pre-set tolerance. + +Candidate sites: Qwen3.5-0.8B layers 8,12,15,19,21. Candidate depths K=0,1,2,4,8. Freeze the site/depth selection using calibration data; evaluate the chosen configuration once on test. + +Controls: base model, zero-gate identity, constant-state recurrence, shuffled latent trajectory, random recurrent weights, equal-parameter feedforward bridge and a token-budget matched text-CoT baseline. + +Primary report: group-level paired outcome differences with uncertainty, absolute accuracy and total inference-time cost. Report p50/p95 latency, peak GPU memory, per-sample generated tokens, internal refinement steps, model forward operations, KL to base, retention set accuracy and invalid-state rate. Correct for multiple comparisons or quarantine site-search results as exploratory. + +**Falsifies the strong graft claim:** equal-compute feedforward performs as well; added steps give no held-out lift; ablations leave accuracy intact; or retention/compute penalties exceed frozen limits. + +### Gate 3: sparse editing +**H-W:** A supported receiver repair improves a working graft, relative to support- and norm-matched random edits, with a fixed edit budget and out-of-sample gain. + +First independently reproduce the *published fixed* 0.8B patch with the [HybridTRMLDT replication package](https://github.com/MoralityLabAI/HybridTRMLDT/pull/5). Freeze model hashes, roster, prompt and decoding settings. For graft-specific edits, disallow editor access to test questions and evaluate all candidates on an independent untouched test split. Compare random edits at matched BF16 effective support; record rank/norm differences separately. + +Primary report: accuracy, token-cut rate, looping, rescue/regression pairs, patch sparsity, per-layer relative Frobenius norm and base-skill drift. Hold out a final set for claims. + +### Gate 4: joint processor +**H-J:** Exact in-weight circuit plus learned recurrent graft improves problems requiring both deterministic state manipulation and heuristic search, beyond either component and a host-tool oracle subject to clearly stated interface constraints. + +Controls: compiled-only, graft-only, joint, disabled bridge, falsified exact output, shuffled latent and ordinary Qwen plus externally computed answers. Preserve tool accessibility parity and count CPU/host work in each arm. + +Primary report: exact execution fidelity, joint task performance, added wall-clock time, GPU-seconds, trace tokens and any extra trainable or nonzero compiled weights. + +**Falsifies the strong synergy claim:** the joint arm has no reliable improvement over the better single component at matched compute and information access. + +## Evaluation hygiene + +1. Train, calibration and test are separated by underlying problem generator / state seed, not just text. +2. Every subject/task group carries a stable identifier; paired bootstrap clusters by group. +3. The evaluator checks format-independent correctness where tasks permit it, and separately tracks format failures and timeouts. +4. Classify each run as simulated, reference-executed, on-device, or published external. Keep metrics for each category distinct. +5. Record interventions as reversible weight/state deltas with SHA256, model and revision; never overwrite original checkpoints. +6. Do not call future inference-time recurrent state updates weight training. If local gradient training is used, register trainable parameter count and training tokens. +7. Keep budget limits, stop criteria and maximum trials in the manifest before launching. No automatic rented GPU sessions. + +## Stop conditions + +- Nonfinite residual, invalid projection or incorrect exact-machine state: disable graft and preserve a failure receipt. +- Off-by-one trace failure, rounding-induced mismatch or missing checkpoint hash: invalidate that benchmark arm. +- Unresolved rights to training data or unknown retained checkpoint source: exclude the model from the candidate list. +- Evidence limited to calibration: publish as exploratory only. + +## Output layout + +Each real experiment writes to an ignored run directory, not to this registration: + +~~~ +runs/algernon// + manifest.json + records.jsonl + metrics.json + report.md + source_hashes.json +~~~ + +The report must explicitly state **what ran**, where it ran, and which claims were learned from the measured results. diff --git a/research/algernon/README.md b/research/algernon/README.md new file mode 100644 index 000000000..b82cb186d --- /dev/null +++ b/research/algernon/README.md @@ -0,0 +1,67 @@ +# Algernon: a neural-net processor, a learning computer + +**Algernon-02 executable experiment:** [Circuit Mirror](circuit_mirror/README.md) combines a typed pointer-machine transition, an exact BN254 R1CS-style checker, generated Circom source, a tiny trained recurrent readout, and retained CPU-only experiment receipts. [Experimental falsification criteria](circuit_mirror/EXPERIMENT.md). + +> **2026-11-03 execution pivot:** Start from reproducible external implementations. Legacy LoopedTransformers checkpoint recovery is archived and optional. See [PIVOT_EXTERNAL_BASELINES.md](PIVOT_EXTERNAL_BASELINES.md) for the active priorities: training-free Qwen3 recurrence, independently tested latent recurrence, Qwenputer and sparse repair. + +**Status: research scaffold, 2026-11-03.** This folder specifies a proposed experiment. It does not claim a working Qwen graft, a trained recurrent processor, or an independently reproduced weight edit. + +## Goal + +Build and evaluate a compact model in which exact computation and trained recurrent reasoning cooperate *inside the model*. Work from three established ingredients and ask a falsifiable question: + +1. **Qwenputer** has compiled an RV32 computer into 11 added transformer layers ahead of Qwen3.5-4B. Its DeltaNet state holds program and data memory; compiled weights execute arithmetic and instructions. The released driver initializes firmware and checks execution against a reference. +2. **HybridTRMLDT** has recurrent latent proposers and explicit projection/verification machinery. Earlier CoT-embedding and looped-transformer checkpoints are **candidates to inventory**, not presumed successful components. +3. **Weight-Space Programming** has shown a sparse intervention in Qwen3.5-0.8B that reduces pathological generation loops. The published fixed edit changes 64 MLP down-projection columns at each of layers 15 and 19; it does **not** demonstrate insertion of a new algorithm. + +**Algernon's first question:** Can we graft a verifiable recurrent algorithm into a pretrained Qwen representation, preserve its previous competence, and increase performance with additional internal refinement steps at a measured compute cost? + +The phrase "learning computer" here means an operationally tested adaptive neural system, with independently measured learning or transfer. An exact compiled CPU alone implements computation, not learning. + +## Distinct tracks + +| Track | Starting model | First milestone | Evidence required | +| --- | --- | --- | --- | +| **C: compiled computer** | Qwen3.5-4B / Qwenputer | Replay one exact circuit on a frozen workload | CPU reference match, exact trace receipts, bytes and latency | +| **R: recurrent graft** | Frozen Qwen3.5-0.8B initially | Insert a tiny trained recurrent refinement operator through a reversible bridge | 0/1/2/4/8-step ablations, matched-parameter feedforward control, held-out success | +| **W: sparse receiver repair** | Qwen3.5-0.8B edited/base pair | Reproduce authors' fixed patch, then analyze recipient layers | Checkpoint hashes, fixed roster, matched random edit, loop/cut and accuracy metrics | +| **J: joint processor** | Model chosen after the other gates pass | Route exact operations through a compiled kernel and heuristic tasks through a recurrent latent operator | Causal ablations of each component, retained base skills, total token and GPU cost | + +**Important incompatibility:** Qwenputer's current RV32 construction targets the 4B architecture; its implementation notes say Qwen3.5-0.8B was skipped because its key/value-head layout provides only one value head per key head where the construction requires two. The successful sparse edit was demonstrated in the **0.8B** model. Treat these as distinct substrates until a new compiler/memory mapping has been verified. + +Qwenputer's RV32 text-only BF16 merge is reported at 18.7 GB and requires about 31 GB host RAM to build. A 16 GB RTX 5080 cannot hold that full checkpoint entirely in its VRAM at BF16. Use its reference machine for CPU-first verification and budget any GPU deployment separately. Quantization changes require their own exactness checks. + +## Why this belongs in Compactification Theory + +The repository's adapter-depth experiments found that intervention **placement** and the **rank** of available features can dominate adapter parameter count. Algernon tests whether the same effect determines where a computational graft becomes accessible to Qwen. Measure representation rank, Jacobian sensitivity, effective bits per weight, and gradient conditioning at candidate receiver sites. Those measurements are hypotheses and diagnostics, not evidence that the old Qwen3-0.6B layer indices transfer to Qwen3.5. + +## Files + +- [ARCHITECTURE.md](ARCHITECTURE.md): mathematical state model, integration interfaces and controls. +- [CONTINUAL_LEARNING.md](CONTINUAL_LEARNING.md): proposed epistemic controller, research pruning and Pluto-Gym cross-reference (unrun). +- [PROTOCOL.md](PROTOCOL.md): pre-registered tests, leakage constraints, metrics and decision gates. +- [AGENT_WORKORDER.md](AGENT_WORKORDER.md): concrete build sequence for the next coding agent. +- [experiment_register.json](experiment_register.json): machine-checkable hypotheses and source status. +- [validate_register.py](validate_register.py): offline check of that registration file. +- [tests/test_register.py](tests/test_register.py): CPU-only schema and anti-overclaiming tests. + +## Start here + +From the root of Compactification-Theory: + +~~~bash +python -m research.algernon.validate_register +python -m unittest discover -s research/algernon/tests -v +~~~ + +This first stage is deliberately **CPU-only**, without downloads or token expenditure. + +## Upstream evidence and code + +- [Qwenputer original implementation](https://github.com/divagr18/qwenputer) and [RV32 notes](https://github.com/divagr18/qwenputer/blob/main/experimental/riscv/docs/rv32.md) +- [Takehi et al. experiment logs](https://github.com/RikiyaT/lm_understand-logs/tree/main/exp8_math) +- [Frozen weight-edit reproduction draft](https://github.com/MoralityLabAI/HybridTRMLDT/pull/5) +- [Hybrid LDT/TRM architecture taxonomy](https://github.com/MoralityLabAI/HybridTRMLDT/blob/master/docs/looped_transformer_trm_ldt_taxonomy.md) +- [Compactification adapter experiments](../../README.md) + +Source revisions must be resolved to full Git SHAs and hashes written into execution receipts before running model benchmarks. The registration is a planning artifact only. diff --git a/research/algernon/circuit_mirror/EXPERIMENT.md b/research/algernon/circuit_mirror/EXPERIMENT.md new file mode 100644 index 000000000..aa66b033a --- /dev/null +++ b/research/algernon/circuit_mirror/EXPERIMENT.md @@ -0,0 +1,24 @@ +# Algernon-02 hypothesis and evidence gates + +Registered as a follow-up architecture proposal on 2026-11-03, after the already-run CPU smoke. The exact CPU and toy neural pilot are **exploratory development**, with their results stored as receipts. Any later experiment requiring independent confirmation must freeze a *new* test roster, code and model revision before computing its scores. + +## Exact statement + +For a finite state space \(S\) and deterministic transition \(T:S\to S\), a neural latent operator \(F\) and decoder \(\pi:H\to S\) define the defect \(e(h)=\mathbf 1[\pi(F(h))\ne T(\pi(h))]\). If \(e\) vanishes on all states reachable from \(h\), induction yields agreement at every loop depth. Holding only on finite training traces has no such guarantee. + +## H-A2 (proposed) + +A trained, pretrained-LOTUS-based recurrent reasoning state achieves lower **held-out, depth-conditioned commuting defect** at steps 9–16 than a no-constraint-feedback LOTUS baseline at matched total inference compute and access to task information. Required baselines: same checkpoint and token budget, input-equivalent feedforward readout, shuffled feedback, exact solver upper bound, and randomly initialized adapter. + +Primary metric: average per-step exact transition correctness across *independently generated* held-out graph families; secondary: whole-trace valid fraction, final-state accuracy, base-task regression and GPU-seconds. Use pairwise comparisons clustered by graph generator seed. A separate unconstrained exact solver is an upper bound, since the test specification contains the full deterministic transition. + +## Compiler mirror requirements + +1. The CIRCOM2 source and Python constraint builder must accept identical public graph/start inputs, and both must reject a witness when *any intermediate state* violates the transition, even if the final output happens to match. +2. Public inputs must be bound to user-supplied state and successor mapping. Booleanity and one-hot constraints must rule out out-of-range field representations. +3. The Circom compiler output, actual witness generator, and a tool such as `snarkjs wtns check` must be exercised before claiming a compiled R1CS or zk proof. Python JSON from the local builder is a reference constraint list with its own wire order. +4. Any neural inference-time use of constraint residuals must account for information revealed. On deterministic pointer chasing, the full residual can reveal the successor state, making an exact solver a mandatory comparator. + +## Hardware and training boundaries + +The CPU toy does not require models or GPU. LOTUS's own Llama-3.2-3B model is the first larger neural reference. Qwenputer is a separate 4B compiled-execution baseline and does not yet expose a LOTUS-compatible hidden-state bus. The proposed common IR has explicit inputs, state variables, transition relation, output, and a witness encoding; bridge/decoder training and Qwen deployment are separate future experiments. diff --git a/research/algernon/circuit_mirror/README.md b/research/algernon/circuit_mirror/README.md new file mode 100644 index 000000000..413690513 --- /dev/null +++ b/research/algernon/circuit_mirror/README.md @@ -0,0 +1,63 @@ +# Algernon-02: Circuit Mirror + +**Status (2026-11-03): CPU prototype executed. No Qwenputer, LOTUS, Circom binary or SNARK proof was executed here.** + +## Hypothesis + +A trained recurrent latent processor may implement the same state transition as a formally specified computational machine. For a decoder \(\pi\), learned transition \(F\), and exact machine step \(T\), the target equation is + +\[\pi(F(h))=T(\pi(h)).\] + +If it holds on every reachable latent state, then induction gives \(\pi(F^k(h))=T^k(\pi(h))\). Experiments test approximate commutation on finite, held-out states; they do not establish the universal premise. The R1CS-style backend is a relation checker over a finite field, while the latent network lives in a real vector space. Decoding to discrete states and public-input binding form the interface. + +## Concrete machine + +One-hot pointer chasing on N nodes. A public row-onehot transition matrix \(A\) encodes a total deterministic successor function. A trace consists of one-hot vectors \(s_0,\ldots,s_K\) and quadratic intermediate wires \(p_{tij}\): + +\[p_{tij}=s_{ti}A_{ij},\quad s_{t+1,j}=\sum_i p_{tij}.\] + +The exact checker enforces Boolean values, row sums of 1, initial-state binding, every intermediate product and next state, and a final-state output binding. It also checks the witness's public inputs against the requested problem. Signals use the default BN254 scalar field modulus specified by Circom. The JSON triples follow Circom's R1CS constraint shape, with *our own signal indices*; compiler-optimized constraint counts and indices will differ. + +The included Python emitter also generates a Circom 2 source file with equivalent intended semantics. **Compilation/parity against the actual Circom compiler is an open gate.** A valid R1CS witness is not itself a zk proof. The `circom` source must be compiled and run using a supported binary and the generated witness checked before claiming compatibility. + +## Run from the Compactification-Theory repository root + +No Python dependencies are needed for exactness tests: + +```bash +python -m unittest discover -s research/algernon/circuit_mirror/tests -v +python -m research.algernon.circuit_mirror.run --out runs/algernon/circuit_mirror +``` + +Optional tiny neural CPU pilot (PyTorch, no GPU): + +```bash +python -m research.algernon.circuit_mirror.pilot --updates 300 --cases 40 \ + --out runs/algernon/circuit_mirror/pilot.json +``` + +The toy recurrent readout has `n^3 + n` trainable parameters. It receives explicitly constructed multiplicative features `state_i * edge_ij`. It learns how to assemble a next-state prediction from those features by one-step cross-entropy training; the same readout is reused for 1, 2, 4, 8, 12 and 16 steps. Training uses random-function graphs, calibration uses permutations and held-out tests use single long cycles and sinks. The random-weight readout is a control, and the exact R1CS trace checker audits the discrete trajectories. + +This setup is **strongly biased toward the correct algorithm**: the supplied quadratic features already represent the circuit products and graph size stays constant. A perfect score is an interface sanity check, not evidence of emergent general reasoning, a neural compiler, or better scaling than classical pointer chasing. + +## Reference execution receipts + +The current CPU run with N=4, steps=8, seed=20261103 and 48 cases per generator family exports a full receipt. The optional pilot used N=6, 300 updates with batch 128, and 40 cases per family per evaluated recurrence depth. Both are local CPU runs. Exact reference and neural pilot results remain separately labelled. + +## Next experiments, frozen before GPU spending + +1. **LOTUS replication:** Pin `yingfan-bot/lotus` source and the published pretrained 3B model. Run its existing evaluation against the upstream instructions and retain a clean reference score, question roster, intermediate-state readouts and profiling. All source locks must include licenses and full resolved model revision. The 3B checkpoint is not claimed to fit within the 5080 VRAM until measured. +2. **Learn a decoder \(\pi\):** Train a small readout from actual LOTUS post-loop latent blocks to structured pointer states, using generator-disjoint data. Compare a one-step, multi-step and unstructured readout. Keep test labels and exact verifier outputs away from the readout during evaluation. +3. **Depth and structure:** Evaluate trained depths 1–8 and held-out 9–16. Record the commuting-square error per state, exact trace validity, last-state accuracy, text-CoT baseline and measured compute. A constant-state, shuffled-state, extra-token, matched-parameter feedforward and random-direction control are required for a strong causal claim. +4. **Constraint feedback:** Use constraint violations at *inference*, but account for their information content. A detailed residual can reveal the correct next state in deterministic pointer chasing. An oracle-assisted correction must be explicitly labelled and benchmarked against an oracle/control with equal access. +5. **Compiled backend:** Port the same typed transition into Qwenputer's arithmetic/IR primitives at its pinned revision. Check trace parity against this Python reference, including corrupted state and public input cases. Memory footprint, trace tokens, latency and exact precision are mandatory. +6. **Sparse repair:** Only after a working neural receiver is established, test local weight edits with fixed support/norm budgets and held-out data. + +## Pinned primary sources + +- [LOTUS](https://github.com/yingfan-bot/lotus/tree/eb77e2f7909c5006f58ff0ad7cd6629b942caa9e) code (paper [arXiv:2606.31779](https://arxiv.org/abs/2606.31779)). Checkpoint/model revision still needs an explicit resolved commit. +- [Qwenputer](https://github.com/divagr18/qwenputer/tree/bec1a0c9654ac8151b6f36ed0154a19c53141384), published RV32 implementation. +- [Circom docs](https://docs.circom.io/circom-language/formats/constraints-json/) for the constraint triplet shape and [BN254 Fr](https://docs.circom.io/background/background/) field. +- [LoopedTransformers xbench](https://github.com/MoralityLabAI/jev-qwen/blob/898781fd3c11ca5dc93f5efd9d85f1ae744afc22/reports/xbench/summary.md), historical OOD-depth reference. + +The reference experiment is small enough to run without external services. It is deliberately independent of the missing D-drive files. diff --git a/research/algernon/circuit_mirror/__init__.py b/research/algernon/circuit_mirror/__init__.py new file mode 100644 index 000000000..66a4366d7 --- /dev/null +++ b/research/algernon/circuit_mirror/__init__.py @@ -0,0 +1 @@ +"""Algernon-02 exact neural-circuit interface experiment.""" diff --git a/research/algernon/circuit_mirror/pilot.py b/research/algernon/circuit_mirror/pilot.py new file mode 100644 index 000000000..610eb39ef --- /dev/null +++ b/research/algernon/circuit_mirror/pilot.py @@ -0,0 +1,164 @@ +"""Small CPU training pilot for a learned recurrent pointer-machine readout. + +Toy PyTorch model, with explicit multiplicative features state_i * edge_ij. +It does NOT use LOTUS, Qwen, Qwenputer, Circom compiler, or a gradient from R1CS. +Uses one-step supervised labels; evaluates longer shared-weight recurrence. +""" +from __future__ import annotations + +import argparse +import json +import random +import time +from pathlib import Path + +from .spec import build, case, digest, witness_for, witness_for_trace + + +def train_and_evaluate(seed: int = 20261103, n: int = 6, + updates: int = 250, batch: int = 128, cases_per_family: int = 32): + import torch + import torch.nn as nn + import torch.nn.functional as F + if n < 2 or n > 12 or updates < 1 or batch < 1 or cases_per_family < 1: + raise ValueError("invalid training configuration") + torch.set_num_threads(1) + torch.manual_seed(seed) + rng = random.Random(seed) + device = "cpu" + + class Readout(nn.Module): + def __init__(self, n): + super().__init__() + # The feature plane is the same quadratic term as the circuit's prod[i,j]. + self.weight = nn.Parameter(torch.randn(n * n, n) * 0.01) + self.bias = nn.Parameter(torch.zeros(n)) + + def forward(self, state, edges): + features = (state.unsqueeze(-1) * edges).flatten(1) + return features @ self.weight + self.bias + + model = Readout(n).to(device) + # Frozen randomly initialized readout; same bilinear inputs and parameter count. + random_model = Readout(n).to(device) + random_model.load_state_dict({k:v.detach().clone() for k,v in model.state_dict().items()}) + random_model.eval() + optim = torch.optim.AdamW(model.parameters(), lr=0.07, weight_decay=0.0) + t0 = time.perf_counter() + for step in range(updates): + # Training ONLY from random_function family, and one transition at a time. + maps = torch.tensor([[rng.randrange(n) for _ in range(n)] for _ in range(batch)], + dtype=torch.long) + state_ids = torch.tensor([rng.randrange(n) for _ in range(batch)], dtype=torch.long) + edges = F.one_hot(maps, num_classes=n).float() + state = F.one_hot(state_ids, num_classes=n).float() + target = maps.gather(1, state_ids[:, None]).flatten() + logits = model(state, edges) + loss = F.cross_entropy(logits, target) + optim.zero_grad(set_to_none=True) + loss.backward() + optim.step() + train_seconds = time.perf_counter() - t0 + + results = [] + circuit_cache = {} + model.eval() + with torch.inference_mode(): + for family, split in (("permutation", "calibration"), + ("long_cycle", "heldout"), ("sink", "heldout")): + for depth in (1, 2, 4, 8, 12, 16): + correct_soft = correct_hard = exact_valid = random_correct = 0 + total_defect = 0.0 + violations_soft = 0 + for idx in range(cases_per_family): + task = case(family, seed + 1000, idx, n=n, steps=depth) + edges = F.one_hot(torch.tensor(task.successors, dtype=torch.long), n).float()[None] + state_soft = F.one_hot(torch.tensor([task.initial]), n).float() + state_hard = state_soft.clone() + state_random = state_soft.clone() + trajectory = [task.initial] + for _ in range(depth): + previous_soft = int(state_soft.argmax(-1).item()) + logits_soft = model(state_soft, edges) + logits_hard = model(state_hard, edges) + state_soft = F.softmax(logits_soft, -1) + next_idx = logits_hard.argmax(-1) + state_hard = F.one_hot(next_idx, n).float() + random_idx = random_model(state_random,edges).argmax(-1) + state_random = F.one_hot(random_idx, n).float() + trajectory.append(int(next_idx.item())) + # Diagnostic uses reference; never fed to neural model. + target_step = int(task.successors[previous_soft]) + total_defect += float((state_soft - F.one_hot( + torch.tensor([target_step]), n).float()).square().sum().item()) + gold = task.trace()[-1] + correct_soft += int(int(state_soft.argmax(-1).item()) == gold) + correct_hard += int(trajectory[-1] == gold) + random_correct += int(int(state_random.argmax(-1).item()) == gold) + ck = (task.n, task.steps) + if ck not in circuit_cache: + circuit_cache[ck] = build(task) + checked_circuit = circuit_cache[ck] + candidate_witness, candidate_public = witness_for_trace(task, checked_circuit, trajectory) + is_verified = checked_circuit.check(candidate_witness, candidate_public)["valid"] + if is_verified != (trajectory == task.trace()): + raise AssertionError("constraint verifier disagrees with trace oracle") + exact_valid += int(is_verified) + # Exact circuit verifier should reject an erroneous *claimed* trace. + # Keeping the circuit in the audit path, rather than runtime, is intentional. + if trajectory != task.trace(): + violations_soft += 1 + results.append({"split": split, "family": family, "depth": depth, + "n": cases_per_family, + "soft_accuracy": correct_soft / cases_per_family, + "hard_accuracy": correct_hard / cases_per_family, + "random_untrained_accuracy":random_correct / cases_per_family, + "whole_trace_valid_rate": exact_valid / cases_per_family, + "invalid_claimed_traces": violations_soft, + "mean_relaxed_defect_sum": total_defect / cases_per_family}) + # Verify one full witness with the actual R1CS checker on a test-family example. + audit_task = case("long_cycle", seed + 1000, 0, n=n, steps=8) + circuit = build(audit_task) + witness, public = witness_for(audit_task, circuit) + checked = circuit.check(witness, public) + if not checked["valid"]: + raise RuntimeError(f"independent R1CS oracle fails: {checked}") + return { + "class": "toy_cpu_torch_supervised_proxy", + "seed": seed, "n_nodes": n, "updates": updates, + "batch": batch, "n_train_examples": updates * batch, + "train_family": "random_function", "train_depth": 1, + "calibration_family": "permutation", "heldout_families": ["long_cycle", "sink"], + "train_seconds": round(train_seconds, 3), + "parameter_count": sum(p.numel() for p in model.parameters()), + "model_weight_sha256": digest({k: v.detach().cpu().tolist() for k,v in model.state_dict().items()}), + "notes": "Heldout families differ from train, yet N=constant and quadratic product features are explicitly provided; this tests trained readout and iteration, not autonomous algorithm discovery.", + "r1cs_oracle_example": {"n_signals": len(circuit.names), + "n_constraints": len(circuit.constraints), + "verification": checked}, + "results": results, + } + + +def main(): + p = argparse.ArgumentParser() + p.add_argument("--seed", type=int, default=20261103) + p.add_argument("--n", type=int, default=6) + p.add_argument("--updates", type=int, default=250) + p.add_argument("--batch", type=int, default=128) + p.add_argument("--cases", type=int, default=32) + p.add_argument("--out", type=Path, default=Path("runs/algernon/circuit_mirror/pilot.json")) + a = p.parse_args() + record = train_and_evaluate(a.seed, a.n, a.updates, a.batch, a.cases) + a.out.parent.mkdir(parents=True,exist_ok=True) + a.out.write_text(json.dumps(record,indent=2,sort_keys=True)+"\n") + print(f"TRAINED toy CPU readout; {record['parameter_count']} parameters; " + f"{len(record['results'])} evaluation cells -> {a.out}") + for r in record["results"]: + if r["depth"] in (1, 8, 16): + print(f"{r['family']} depth={r['depth']}: soft={r['soft_accuracy']:.3f}, " + f"hard={r['hard_accuracy']:.3f}, valid_trace={r['whole_trace_valid_rate']:.3f}") + + +if __name__ == "__main__": + main() diff --git a/research/algernon/circuit_mirror/results/README.md b/research/algernon/circuit_mirror/results/README.md new file mode 100644 index 000000000..9f862948b --- /dev/null +++ b/research/algernon/circuit_mirror/results/README.md @@ -0,0 +1,7 @@ +# Algernon-02 receipts (CPU-only) + +- `cpu_reference_4x8.json`: 192 independently checked task traces, 48 each from random-function, permutation, long-cycle, and sink families. Python R1CS checker with BN254 Fr, full trace and public inputs bound, no circuit/compiler execution. A deliberately corrupted intermediate state failed verification. +- `pointer_4x8.circom`: generated source that describes the same transition relation. This was **not compiled or witness-tested by Circom** in this environment; its syntactic/semantic compatibility is an open follow-up. +- `pilot_6_300.json`: one-seed CPU PyTorch toy (6 nodes, 222 parameters, 300*128 one-step training examples) with 18 evaluation cells, 40 tasks per cell. The network receives explicit input products and thus has strong architectural prior; held-out families test recurrence and readout, not discovering arbitrary programs. + +All receipts have explicit execution class labels and fixed seeds. Scripts write subsequent runs outside Git to `runs/algernon/circuit_mirror/` by default. Do not train on or adjust thresholds using these held-out samples and then report an independent holdout score. diff --git a/research/algernon/circuit_mirror/results/cpu_reference_4x8.json b/research/algernon/circuit_mirror/results/cpu_reference_4x8.json new file mode 100644 index 000000000..3c6bab312 --- /dev/null +++ b/research/algernon/circuit_mirror/results/cpu_reference_4x8.json @@ -0,0 +1,1369 @@ +{ + "cases_per_family": 48, + "circom_compile_status": "binary_not_found", + "constraints": 238, + "exact_checks": 192, + "exact_failures": 0, + "execution_class": "python_r1cs_reference_only", + "field": "BN254 Fr", + "modulus": "21888242871839275222246405745257275088548364400416034343698204186575808495617", + "n_nodes": 4, + "negative_corrupt_trace_violations": 4, + "rows": [ + { + "case": 0, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "b9ae136a2bc043c527c6992ea603880361a399336576f324bbb7f0b13b06fa24", + "trace_sha256": "2049aa1b366fa883a23a423b7993235b1aebbdbb8cb3fd7e2d10c1d5ea27ab4b" + }, + { + "case": 1, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "a95bd57a280bec81e2bb9a9d12046e87c97b7f17f361c7470156aab6816df920", + "trace_sha256": "96d5bcd2f545aa965d16df6ee56b8c42ab2d0951a1b02e4bd8cf992957574e7e" + }, + { + "case": 2, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "3e9bd8984b62cd5aafc88a9cae547317052e2b686577d4f687eac050c731d3e3", + "trace_sha256": "b035c03f4194b92d3f56cf7b1d75d9afba83d3d48bcf9dfe9a0e97303ee6aebb" + }, + { + "case": 3, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "dfa0d9f00af3a342d1c4e2e19df21787805aa542f8d67de8f72d09ac9c0772fe", + "trace_sha256": "2c31138a2fb30570b5c710d1768c5aa04d9af0fc7c5e2e17ead5fd4543b7aa51" + }, + { + "case": 4, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "71a79267a0860d0557d93c90567292800199ae1f744762ed107ff99b79c20c8e", + "trace_sha256": "06018be0917e880825538d4b1054caa8a40d3f312b7f532542a472d90ddd3247" + }, + { + "case": 5, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "629923215e4228ac9fcb92f1a945c9e66b58a1f4f1cbf5af761b0399734fe2c6", + "trace_sha256": "99ecf96d6fbf0fda360dca53521d8777f0c682c1c4a68f131aec499d95a464c6" + }, + { + "case": 6, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "a4b16d2133c0e2baa5d96c235d3af4c1e0a28c5f15f2a236b303af2e476e3bb4", + "trace_sha256": "7a89938249926d914392763fbe1f84a601fb2ef344309a68f568105b83064f72" + }, + { + "case": 7, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "562bbce6bc4b94152320e8e5f3278a15a8b3d822d5827c4c88934d064ab77fe6", + "trace_sha256": "1de171c4cee453663cd43332527065fefd1d26d3e0cd48179ff680a4ff83cba8" + }, + { + "case": 8, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "3359cb70c92cb84e8f28ca3db9e3d17b21cb8c22472d1862939c43fd01db043f", + "trace_sha256": "9bd22599f01b64923587ab98f1218950dd4b81dbfce6795849f00fff6ed90e19" + }, + { + "case": 9, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "abaa934ead45474c26c1afd2822161900a1f1ba0a0b4e55d6fc96b837d07d089", + "trace_sha256": "2ec39b8e5281419b8e38ee0825032600b5f9708a1c3289347a7e3507991facae" + }, + { + "case": 10, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "cd4db8fb2bd52feedff0e9fee3aaf0824d0f136680ee4a99eaac4434d355505e", + "trace_sha256": "d0ae8977e30c33a1100b695349c5dcfc5af75651cda2e458bdf613aa94261bd0" + }, + { + "case": 11, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "85ca1b740a29df5047c4ebf87e4bcdea57c09b7283ff461ace574c59b1c424c1", + "trace_sha256": "6fc45c49d173a71b10a54815d5c24a3c28973e04f933c39ed1a9e7b5c59e4882" + }, + { + "case": 12, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "2989064079190ac1d3dbee2f9bff6014c4534850b20eb6fdd97c9b70e9569d83", + "trace_sha256": "d635946d8439c1902503706c4bbcf1e1cb924db7de299f82976909dc0d756b2c" + }, + { + "case": 13, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "b211e0aa0ad1b58f0196b1a04482112415d8d3a9ae8ea98afcc99a5597b2a61e", + "trace_sha256": "12f74cf5111934347dc8d6314060943b39817ade56ea37ef75e8fa0f78306f8a" + }, + { + "case": 14, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "f12e565cfc354d5d9e4e8e606d85e6e3b756e3005600c212cc3657a6c118d0df", + "trace_sha256": "9bd22599f01b64923587ab98f1218950dd4b81dbfce6795849f00fff6ed90e19" + }, + { + "case": 15, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "d8525e44cc4578d11313987648a747c6f912a0d911d2e1e6794843c176d47117", + "trace_sha256": "c47dbb7401275c951dfff6ac044536bce2aae84deff69c8864ccc0f9614efb9f" + }, + { + "case": 16, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "74499f23c88ad896539506c11b5940230fee0688a40ec5dc65485822e72e2bd4", + "trace_sha256": "06018be0917e880825538d4b1054caa8a40d3f312b7f532542a472d90ddd3247" + }, + { + "case": 17, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "6cabce3365f5a433dcaf3292713fd0f05e9a8dd5997bf31b0e4597aa477d23ae", + "trace_sha256": "bad6f5c3c8b1d9b7fdcb42aa6709e6c1ae0efcbc636bc8c94ac83feaa5afc6b4" + }, + { + "case": 18, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "30521e3679ed9d90f195f8ac70c128c8872d4a9b02233fe1857b0663431ee1af", + "trace_sha256": "ac9f1c34631bc2823e99801354cf882c477d6e8228e3a92ec1a1b22dc1edf7e1" + }, + { + "case": 19, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "64a8ff1e0bc7f22388623df04695c345cb6db72ae1f356d83fac3df07d51698e", + "trace_sha256": "2f06fffd6021473f6a48921eed8fc474aa6230411694cd7e57c73fd68cca1cf2" + }, + { + "case": 20, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "415be86aaee037f8c55c34790bc48e110d9225d5fc7c335209155b99ad334550", + "trace_sha256": "b71b3e130aed9c7fa1f2f695bcf203106ae503aa04b3610322f038da1149600d" + }, + { + "case": 21, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "c3aff8559cb2ac8a91cdd47532985f58760c0a9d9bed875c98354200aa73facb", + "trace_sha256": "698cda27f4383ea2cf357198fae8b424ab3da76ef0bed5dde78897ecc9e009c2" + }, + { + "case": 22, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "b7997f99870875646ceaa711d3d5193afd1f896b95fa4b737728c08265d839ef", + "trace_sha256": "1de36ce52a1da540989c89f1c1a7fddeeabeaaf386eb0ffde54894198cfda2c5" + }, + { + "case": 23, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "90de5bd537875dad429eb175be8a046311eb538f07636996d48a76aabef6a5db", + "trace_sha256": "2ec39b8e5281419b8e38ee0825032600b5f9708a1c3289347a7e3507991facae" + }, + { + "case": 24, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "63a94322bdceb183833b36b6e4d397ff500da2c18ed6b1682d502d6fe2077b1b", + "trace_sha256": "f1a20664011894395c458e5b51a0ec3114ea4d544204eb2177d368878a889625" + }, + { + "case": 25, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "db2eea9860f9e3892a013405c6381651f46ca5b56016feb98a98fb1d7d5709a7", + "trace_sha256": "62f1ae72e4c72261e07d65baa2cfd48b2eb67e585af1d6ade6e1bd24f094f905" + }, + { + "case": 26, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "b62ee3b00c60c3dd9e1309e172714436d82080cdf7dc06b38e2b99df71866d2c", + "trace_sha256": "9bd22599f01b64923587ab98f1218950dd4b81dbfce6795849f00fff6ed90e19" + }, + { + "case": 27, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "4a988d807d36b4956d620f71abf4910f330fec9b5494933d338109fbdb830c0d", + "trace_sha256": "96d5bcd2f545aa965d16df6ee56b8c42ab2d0951a1b02e4bd8cf992957574e7e" + }, + { + "case": 28, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "38caf5707025670657725b9c9dcc41b1aae22e3742c6f95bc9910446efad654b", + "trace_sha256": "6fc45c49d173a71b10a54815d5c24a3c28973e04f933c39ed1a9e7b5c59e4882" + }, + { + "case": 29, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "9c973b429b8e45ff748846036e24f5a8575e3b1be0d3c15227689342128ec46d", + "trace_sha256": "ce1983f0e77ccd2419c47893d5590aa0d076de64136f6bb362b1b9d85d90c2af" + }, + { + "case": 30, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "a3600a7116c48d626b7ede2cb263356ec39524049fbc18a3659a1abc724a4bc8", + "trace_sha256": "79c91cd6374a65273ccf3a3ccd6b2dc3327846a06ee80ef71ffc2b8ddeb13849" + }, + { + "case": 31, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "f3e87afd0ae872cbdb3dba45aacbc5b267638fb457f0776bc4820ca2e4a365d0", + "trace_sha256": "2ec39b8e5281419b8e38ee0825032600b5f9708a1c3289347a7e3507991facae" + }, + { + "case": 32, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "2ba35da0f72c05ac1c53020bdf0d0d6e8ff0555a8a5a06c8f817004844542622", + "trace_sha256": "9516e798d12e8c8499af9ab646aa318124c9ac6b870dc047d9d0a956eccc60a6" + }, + { + "case": 33, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "2b02a301af003be018185d8a60a466cecf1574152fb7d92a69c76fb4770d15f5", + "trace_sha256": "b545438f0ed42ead0bf1f6032d23d30e7564b59e9dfc156f235a7b206c71dc33" + }, + { + "case": 34, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "98f50dcb481360e79911f291087bfca4e8fa51f0eda5e6b9ef01fb1a4b30fff9", + "trace_sha256": "945e73bbb2fbc2f7ab6be201bd6beaf92b1edf6864b0e8c293e21eb819b0c544" + }, + { + "case": 35, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "f469e83ca527e0bd59cb1b2950c55debceca5c690ec5abcdfbc9cd985ae3a430", + "trace_sha256": "8cf6b43caa12445f435621524eeacda8466453230859b1d648fe130a9df46af9" + }, + { + "case": 36, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "ab2cf029b654673ade534d01459899a38ccab5588660630eb72cb28b2966c331", + "trace_sha256": "b71b3e130aed9c7fa1f2f695bcf203106ae503aa04b3610322f038da1149600d" + }, + { + "case": 37, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "d0e45787e8d6cc0bc01a34b42ee9c76908deefafd5904daf81e357860377051e", + "trace_sha256": "cd607877c860491183de2743286161a4b4fe40e077896384b6f986b3871e0370" + }, + { + "case": 38, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "525b5c1f4929e2577725bbfe903626a5d0b61c478877b3acf135dc216396c6a1", + "trace_sha256": "044504dd1afa131a9f566d4ce0df56ab69db2737a5ba67d344f78d3ce6266892" + }, + { + "case": 39, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "b8d779e608487ce19bda4fa8bc896cb5893dcde6403b1d0d8fe048f90005fca0", + "trace_sha256": "7a89938249926d914392763fbe1f84a601fb2ef344309a68f568105b83064f72" + }, + { + "case": 40, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "745f0a8158f961ec60d34d80933e3a3b8b21f7b9e440e69534f2bab840a1a685", + "trace_sha256": "ce1983f0e77ccd2419c47893d5590aa0d076de64136f6bb362b1b9d85d90c2af" + }, + { + "case": 41, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "8424534e8dfd3d3d5fc1cd3469bc8dd62a306494efb695323260981c1e69b062", + "trace_sha256": "a0f229fc3427eda8dc94d37e4229a2eaabd1782931344c33789f2d1fbbe46201" + }, + { + "case": 42, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "f02a41fef01407cb277ac767c3ceacd57fa91dff8aef0d0270911e26170236e1", + "trace_sha256": "7a89938249926d914392763fbe1f84a601fb2ef344309a68f568105b83064f72" + }, + { + "case": 43, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "fdc60531de0355f757888b027f1ed989ef3fb6cf0123cac95511b901bb757d7b", + "trace_sha256": "6fc45c49d173a71b10a54815d5c24a3c28973e04f933c39ed1a9e7b5c59e4882" + }, + { + "case": 44, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "0cfcf8517cf4a2b73c49e8424d20e1a6a9d6ab3679e3c14b1b712320120c0908", + "trace_sha256": "b9ec25b8a0c685ac536ac78fda2a0c2b9a283549f4f304d29f4be362ed9c3ea6" + }, + { + "case": 45, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "a6b786332f0963976171cc40d06d7d0014661e6798b56c48e01de8ae405e8669", + "trace_sha256": "0f8cc204bbcbcc1bc6d96f813af1c0aec00bc099f66e9ad9e2c61c211aae0d15" + }, + { + "case": 46, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "35dd6f8e4cbe6875894ac13b2d42e7e8f95334a9bfc272803cba8ec299f9f4a1", + "trace_sha256": "304a1c741b165ef11eff94a848dedee343b65dbfeec508e89f3cab9bf6193427" + }, + { + "case": 47, + "family": "random_function", + "r1cs_pass": true, + "task_sha256": "7bde4b89523a0769dd40a713c5e8ce260648f21f512db21d32683a7fabc9caa2", + "trace_sha256": "6fc45c49d173a71b10a54815d5c24a3c28973e04f933c39ed1a9e7b5c59e4882" + }, + { + "case": 0, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "e22bd5fdad05c3f7515f463e568d51fcb08071359a131cc98beccefc2af490bc", + "trace_sha256": "10e41893de8dc24b68d01388cf58b39dd4d80b2c11a6f34ae7bb54186df5eaab" + }, + { + "case": 1, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "60468aea8043bf3bbc41cad40770a7528c2dd9a1c01779f609be36b0978a3bb8", + "trace_sha256": "2ec39b8e5281419b8e38ee0825032600b5f9708a1c3289347a7e3507991facae" + }, + { + "case": 2, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "41c398a694fd9f25e7a833f74c9c9f0135e7dce8f5f2d3f615afe6a4dca7df31", + "trace_sha256": "96d5bcd2f545aa965d16df6ee56b8c42ab2d0951a1b02e4bd8cf992957574e7e" + }, + { + "case": 3, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "6f355128f5265711be354cd636c4e9e1f0a747b60dfd989ce561867d8b961d0c", + "trace_sha256": "3e26691cf1ede2b691dfe6dde43298b052cc654d977ffd7ff406fc3e7e5ad532" + }, + { + "case": 4, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "364d56743f2e2587e4f30cb1fdb6cd2400f97e5cad3453cc868bfa5baef0c6aa", + "trace_sha256": "79c91cd6374a65273ccf3a3ccd6b2dc3327846a06ee80ef71ffc2b8ddeb13849" + }, + { + "case": 5, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "4f0e7f9d753063dbbb72129e7b3496a573d9fc4aafa233be9d879ac9a527b6ab", + "trace_sha256": "7216358b09facdebf0b904307c956b76701d1471578c945b78beebca4647ff1f" + }, + { + "case": 6, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "7eeca883ec2f4710bbcdf0a0c56e1046a791ae3fec91ee703527efb7f7b3911e", + "trace_sha256": "79c91cd6374a65273ccf3a3ccd6b2dc3327846a06ee80ef71ffc2b8ddeb13849" + }, + { + "case": 7, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "a2c815c02fd824bb6535bcc40f9121b9cfb4fb109bdd60ec306f560b685440ca", + "trace_sha256": "1e89b962b1e72843778d9b07b50104a82ae8e091495693f94ec5d1e6b2908a4c" + }, + { + "case": 8, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "41c398a694fd9f25e7a833f74c9c9f0135e7dce8f5f2d3f615afe6a4dca7df31", + "trace_sha256": "96d5bcd2f545aa965d16df6ee56b8c42ab2d0951a1b02e4bd8cf992957574e7e" + }, + { + "case": 9, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "54ddc89c2b965c94a9a05dd8b8a311d153832a716df23534331249e6658ac1c3", + "trace_sha256": "f580c9518ae52faab44ab620c1ae14ea34a43d8f5915f0fe2edf8ad4a28e8253" + }, + { + "case": 10, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "74ad56cf360c6f232a14788d7eccc8c0e9d1669fb669afa32aa7f405d9472c5e", + "trace_sha256": "4de8af509ebc02111eff58fc729a9efc49857e2b9e6709a73b0d5cb48f1964b8" + }, + { + "case": 11, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "0ffeb747593fa1de9b236cd9ed9e4fc26d68f9f08387dbb65d40126f22751ac4", + "trace_sha256": "2d5c837ceec74272cd344aaf3bad7d0b72e26c3fe3b8e9edfe47850af3e6344e" + }, + { + "case": 12, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "74ad56cf360c6f232a14788d7eccc8c0e9d1669fb669afa32aa7f405d9472c5e", + "trace_sha256": "4de8af509ebc02111eff58fc729a9efc49857e2b9e6709a73b0d5cb48f1964b8" + }, + { + "case": 13, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "c3aff8559cb2ac8a91cdd47532985f58760c0a9d9bed875c98354200aa73facb", + "trace_sha256": "698cda27f4383ea2cf357198fae8b424ab3da76ef0bed5dde78897ecc9e009c2" + }, + { + "case": 14, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "408533963a15033c77700f994142335e3cada250e294ed933f2a28f00a675565", + "trace_sha256": "439f14d6113c949d73a82ac006e451203e17a681ddefb536285d962932971838" + }, + { + "case": 15, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "258d86e527f6f33399eacbb55deb71ade236030cca8ad97e23b0ac0d9738eef7", + "trace_sha256": "6fc45c49d173a71b10a54815d5c24a3c28973e04f933c39ed1a9e7b5c59e4882" + }, + { + "case": 16, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "c05d72b49fe0442f741f10b8827169a7a70f7f9df9c8739f4a96cd634c80ff6f", + "trace_sha256": "f8e1fa5d5370ad6beaa60d7e3587bc074aa768a51518066c3d1efae092078655" + }, + { + "case": 17, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "d9135dbb74aae9a43f4e25cbc0a67957ac2ccfad5af80796db3bb76071f0f145", + "trace_sha256": "1de36ce52a1da540989c89f1c1a7fddeeabeaaf386eb0ffde54894198cfda2c5" + }, + { + "case": 18, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "8d5928b1d80fbc2c3f37fcd85af36dd1b709ef6dc15b3644aea843d9e345a4b8", + "trace_sha256": "f8e1fa5d5370ad6beaa60d7e3587bc074aa768a51518066c3d1efae092078655" + }, + { + "case": 19, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "eb9269168981965b5b3ae973c164d644488c6d5dc3843c56aad4239e28969457", + "trace_sha256": "96d5bcd2f545aa965d16df6ee56b8c42ab2d0951a1b02e4bd8cf992957574e7e" + }, + { + "case": 20, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "904144e5f27da8dd1acc8ea4a34f7bb409495d3fa2e04e491c310926092f4e79", + "trace_sha256": "b035c03f4194b92d3f56cf7b1d75d9afba83d3d48bcf9dfe9a0e97303ee6aebb" + }, + { + "case": 21, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "904144e5f27da8dd1acc8ea4a34f7bb409495d3fa2e04e491c310926092f4e79", + "trace_sha256": "b035c03f4194b92d3f56cf7b1d75d9afba83d3d48bcf9dfe9a0e97303ee6aebb" + }, + { + "case": 22, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "4cf33b45319d316883b0a0278ed2cdb9b37280d4091df3ade3e199a68956784a", + "trace_sha256": "96d5bcd2f545aa965d16df6ee56b8c42ab2d0951a1b02e4bd8cf992957574e7e" + }, + { + "case": 23, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "74ad56cf360c6f232a14788d7eccc8c0e9d1669fb669afa32aa7f405d9472c5e", + "trace_sha256": "4de8af509ebc02111eff58fc729a9efc49857e2b9e6709a73b0d5cb48f1964b8" + }, + { + "case": 24, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "2887bede3c982ca801c90ea5c3e12a2d62501f68795d5f8dcee28bd0fa3eb533", + "trace_sha256": "f780d9612635fcf035fc7fd58d718f1ce96cdd516ab61549eeef3bedca233f55" + }, + { + "case": 25, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "1f71ea24b93f7ad2e2ce4452d9cb6744ddaa47edf305d447250e50378a03ddd9", + "trace_sha256": "b54dcfbac875dd23d1955711d8faed911725a7a2c91e9ac785e0b688a73f6413" + }, + { + "case": 26, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "dfd7f11f5fc1bec4519bb991ba4fab1bd7d63b73dbe2e41a6bfd63a465d2e264", + "trace_sha256": "d85ee7b7277258596cdec3bb1196ae124f2d93300c361fa3989d78243ef84396" + }, + { + "case": 27, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "0bea8bd2c6f11d317528592dda840a5dc384a304b851072b489ecfc3751602ca", + "trace_sha256": "37aabed715e5382c899b996cde2448c02be0d7a02abb81ad082129a47af479fd" + }, + { + "case": 28, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "a558982231df4c074b9ce8700782883cd2d1c7d6485eb4af3d0a5a3b37bb7209", + "trace_sha256": "79c91cd6374a65273ccf3a3ccd6b2dc3327846a06ee80ef71ffc2b8ddeb13849" + }, + { + "case": 29, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "364d56743f2e2587e4f30cb1fdb6cd2400f97e5cad3453cc868bfa5baef0c6aa", + "trace_sha256": "79c91cd6374a65273ccf3a3ccd6b2dc3327846a06ee80ef71ffc2b8ddeb13849" + }, + { + "case": 30, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "c23b29672c21aa7f7a5bd798837dcc53433b68b1732c0908941d2a7a2c6f9d0d", + "trace_sha256": "a0f229fc3427eda8dc94d37e4229a2eaabd1782931344c33789f2d1fbbe46201" + }, + { + "case": 31, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "d9135dbb74aae9a43f4e25cbc0a67957ac2ccfad5af80796db3bb76071f0f145", + "trace_sha256": "1de36ce52a1da540989c89f1c1a7fddeeabeaaf386eb0ffde54894198cfda2c5" + }, + { + "case": 32, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "2ec316abcefe2ddc5a8480c4f3cab73e79b3e420930a824afe91e47f0f117270", + "trace_sha256": "67ffa4e67ae64caac6966c538d092518037dc7bf2f48f84b4ac67a56e9c5d703" + }, + { + "case": 33, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "beb29e50216d084abb3b3e2e589ebc473469c86344b963dcb7975c2da5ddc8b3", + "trace_sha256": "02ef7e2760652d8c887fa022a974f4c5655c5b1fb67c3d6ab7d981723c75805b" + }, + { + "case": 34, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "4cf33b45319d316883b0a0278ed2cdb9b37280d4091df3ade3e199a68956784a", + "trace_sha256": "96d5bcd2f545aa965d16df6ee56b8c42ab2d0951a1b02e4bd8cf992957574e7e" + }, + { + "case": 35, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "dc4ed74f594fa93ae9e151524cf1add76be0fed3cc0d08c088e89e6838646c06", + "trace_sha256": "96d5bcd2f545aa965d16df6ee56b8c42ab2d0951a1b02e4bd8cf992957574e7e" + }, + { + "case": 36, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "cfc68f73477abdb20b72515cc425523f9d10915cbe0759c8c1937e83a4df6b4b", + "trace_sha256": "2077e3932cbfc01c6e445956df6e27d5a3173a4f0e2243e7685a42ee56abefe8" + }, + { + "case": 37, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "995bbac553771d203628370d9faf921004bed76b02a66ddda6deb98c7effba64", + "trace_sha256": "b54dcfbac875dd23d1955711d8faed911725a7a2c91e9ac785e0b688a73f6413" + }, + { + "case": 38, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "4cf33b45319d316883b0a0278ed2cdb9b37280d4091df3ade3e199a68956784a", + "trace_sha256": "96d5bcd2f545aa965d16df6ee56b8c42ab2d0951a1b02e4bd8cf992957574e7e" + }, + { + "case": 39, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "15ee6dbc5456dc0d8813b8371d5828d41cf58dccd31990993a8e7b4ee5cfb787", + "trace_sha256": "68ab3cfb747d3f92c4a74b8fb0d75e37be302eafdd6eb2c9f863965c4abacdae" + }, + { + "case": 40, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "903325fefdbf0f15ad46a3be69f6acf988a9e0787dddb8e8e912c9be25ee6a3c", + "trace_sha256": "e6e548f7d2d12539660ead7178692842e23014a715d10d89b49dba86b4da1771" + }, + { + "case": 41, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "c89796301eb92e5088d9c8caa28cb511e087b23340a39da8dd477e8739cf5a28", + "trace_sha256": "ce1983f0e77ccd2419c47893d5590aa0d076de64136f6bb362b1b9d85d90c2af" + }, + { + "case": 42, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "24a9f0f35d2e2c4b1c3a645fa50aa4464bcb1c9cb33e461821294d625301c50b", + "trace_sha256": "c47dbb7401275c951dfff6ac044536bce2aae84deff69c8864ccc0f9614efb9f" + }, + { + "case": 43, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "60468aea8043bf3bbc41cad40770a7528c2dd9a1c01779f609be36b0978a3bb8", + "trace_sha256": "2ec39b8e5281419b8e38ee0825032600b5f9708a1c3289347a7e3507991facae" + }, + { + "case": 44, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "41c398a694fd9f25e7a833f74c9c9f0135e7dce8f5f2d3f615afe6a4dca7df31", + "trace_sha256": "96d5bcd2f545aa965d16df6ee56b8c42ab2d0951a1b02e4bd8cf992957574e7e" + }, + { + "case": 45, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "5ffff7ac122021d470f9961c7222c864026b5ea52d529fa4e0506d15daacf5b5", + "trace_sha256": "b035c03f4194b92d3f56cf7b1d75d9afba83d3d48bcf9dfe9a0e97303ee6aebb" + }, + { + "case": 46, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "fc0d90cf0695f323a39bbc8782ca1206f85c980c587de715a4f2f401917c26dc", + "trace_sha256": "1de36ce52a1da540989c89f1c1a7fddeeabeaaf386eb0ffde54894198cfda2c5" + }, + { + "case": 47, + "family": "permutation", + "r1cs_pass": true, + "task_sha256": "ce2cc08ba17c4158a86c8b8ffe7ad7be6a136c2be69cd8919a5f6ac537e57eb4", + "trace_sha256": "2ec39b8e5281419b8e38ee0825032600b5f9708a1c3289347a7e3507991facae" + }, + { + "case": 0, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "890dfd07c223918973ed6656991f5badf7131333c06477d29829084d02bf9518", + "trace_sha256": "21d5bab94f087faf973d4a6c3523a72b4c969fe62df3bf4be58fb0470a4dffef" + }, + { + "case": 1, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "890dfd07c223918973ed6656991f5badf7131333c06477d29829084d02bf9518", + "trace_sha256": "21d5bab94f087faf973d4a6c3523a72b4c969fe62df3bf4be58fb0470a4dffef" + }, + { + "case": 2, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "5d8b7178b17b42e1eb16aac14a0eca3c675f6af492f73ba019845919677f3e8c", + "trace_sha256": "4e1336c3cd4ee42b072f5164283161efffc3d2d9cebbcccecb33fb9d6696e4aa" + }, + { + "case": 3, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "48a8e671f75a7e776f580913a46e10d20d8252bf68d288893e7f164652e138d2", + "trace_sha256": "c1c342191b102d07c7f8bbc221c07300b9fd873ba342c0edc30da6d1e4665907" + }, + { + "case": 4, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "15ee6dbc5456dc0d8813b8371d5828d41cf58dccd31990993a8e7b4ee5cfb787", + "trace_sha256": "68ab3cfb747d3f92c4a74b8fb0d75e37be302eafdd6eb2c9f863965c4abacdae" + }, + { + "case": 5, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "beb29e50216d084abb3b3e2e589ebc473469c86344b963dcb7975c2da5ddc8b3", + "trace_sha256": "02ef7e2760652d8c887fa022a974f4c5655c5b1fb67c3d6ab7d981723c75805b" + }, + { + "case": 6, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "890dfd07c223918973ed6656991f5badf7131333c06477d29829084d02bf9518", + "trace_sha256": "21d5bab94f087faf973d4a6c3523a72b4c969fe62df3bf4be58fb0470a4dffef" + }, + { + "case": 7, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "6f355128f5265711be354cd636c4e9e1f0a747b60dfd989ce561867d8b961d0c", + "trace_sha256": "3e26691cf1ede2b691dfe6dde43298b052cc654d977ffd7ff406fc3e7e5ad532" + }, + { + "case": 8, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "408533963a15033c77700f994142335e3cada250e294ed933f2a28f00a675565", + "trace_sha256": "439f14d6113c949d73a82ac006e451203e17a681ddefb536285d962932971838" + }, + { + "case": 9, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "beb29e50216d084abb3b3e2e589ebc473469c86344b963dcb7975c2da5ddc8b3", + "trace_sha256": "02ef7e2760652d8c887fa022a974f4c5655c5b1fb67c3d6ab7d981723c75805b" + }, + { + "case": 10, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "6f355128f5265711be354cd636c4e9e1f0a747b60dfd989ce561867d8b961d0c", + "trace_sha256": "3e26691cf1ede2b691dfe6dde43298b052cc654d977ffd7ff406fc3e7e5ad532" + }, + { + "case": 11, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "6f355128f5265711be354cd636c4e9e1f0a747b60dfd989ce561867d8b961d0c", + "trace_sha256": "3e26691cf1ede2b691dfe6dde43298b052cc654d977ffd7ff406fc3e7e5ad532" + }, + { + "case": 12, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "6f355128f5265711be354cd636c4e9e1f0a747b60dfd989ce561867d8b961d0c", + "trace_sha256": "3e26691cf1ede2b691dfe6dde43298b052cc654d977ffd7ff406fc3e7e5ad532" + }, + { + "case": 13, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "4f0e7f9d753063dbbb72129e7b3496a573d9fc4aafa233be9d879ac9a527b6ab", + "trace_sha256": "7216358b09facdebf0b904307c956b76701d1471578c945b78beebca4647ff1f" + }, + { + "case": 14, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "6de5b6951f7b291884ba27bb0a6f152d7f446a8f841e27e080950a5407f8f5c3", + "trace_sha256": "c2da590e469a2734ecb8b4f6d3b680c4cc643fe7731fa5b4b4c3f55faf9ccea0" + }, + { + "case": 15, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "0bea8bd2c6f11d317528592dda840a5dc384a304b851072b489ecfc3751602ca", + "trace_sha256": "37aabed715e5382c899b996cde2448c02be0d7a02abb81ad082129a47af479fd" + }, + { + "case": 16, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "790ff35c576f2351245a5bd7231b3db085d1c5c3cd4ea2cd2b9bb34113d724c0", + "trace_sha256": "fd0470a4caeb16ecdcd64956c407b1579dd05db5be258e995d1bf1eef0f5335d" + }, + { + "case": 17, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "790ff35c576f2351245a5bd7231b3db085d1c5c3cd4ea2cd2b9bb34113d724c0", + "trace_sha256": "fd0470a4caeb16ecdcd64956c407b1579dd05db5be258e995d1bf1eef0f5335d" + }, + { + "case": 18, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "cb5bf6188a3bf2416a4d704fe23b0aff11b6d15a22430f2de177aa671d13b961", + "trace_sha256": "c4fc33c0f2b7af25ca4e815afb228f6e57dd758c172097e189540fdd10b3527f" + }, + { + "case": 19, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "15ee6dbc5456dc0d8813b8371d5828d41cf58dccd31990993a8e7b4ee5cfb787", + "trace_sha256": "68ab3cfb747d3f92c4a74b8fb0d75e37be302eafdd6eb2c9f863965c4abacdae" + }, + { + "case": 20, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "93ef939d26e191b3e3affc44412f49feceed14e16b5e7b65fdc58c6e441fb094", + "trace_sha256": "6ae47ad6cf035cc0bc0585c8087aa0ca2faba1d8ea09974785aa244a9b335781" + }, + { + "case": 21, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "5d8b7178b17b42e1eb16aac14a0eca3c675f6af492f73ba019845919677f3e8c", + "trace_sha256": "4e1336c3cd4ee42b072f5164283161efffc3d2d9cebbcccecb33fb9d6696e4aa" + }, + { + "case": 22, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "5d8b7178b17b42e1eb16aac14a0eca3c675f6af492f73ba019845919677f3e8c", + "trace_sha256": "4e1336c3cd4ee42b072f5164283161efffc3d2d9cebbcccecb33fb9d6696e4aa" + }, + { + "case": 23, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "ca3630101197b69f2d69eb6c22ba0fedea29f873f3905666cfed0cb0ece98f95", + "trace_sha256": "07649574c2502a6a9642743f3fcf40876d3bb75f422a1876d95e944a9c9f2896" + }, + { + "case": 24, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "147bda10a50fb5ceb01c2962d5748acc76b21369c41960ba80e8aec061d57d95", + "trace_sha256": "c9b7d971efdaac716e77155251ca30e8a4cac74d364dc674b7d2dcc53270af70" + }, + { + "case": 25, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "790ff35c576f2351245a5bd7231b3db085d1c5c3cd4ea2cd2b9bb34113d724c0", + "trace_sha256": "fd0470a4caeb16ecdcd64956c407b1579dd05db5be258e995d1bf1eef0f5335d" + }, + { + "case": 26, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "2ec316abcefe2ddc5a8480c4f3cab73e79b3e420930a824afe91e47f0f117270", + "trace_sha256": "67ffa4e67ae64caac6966c538d092518037dc7bf2f48f84b4ac67a56e9c5d703" + }, + { + "case": 27, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "ae36f8f9282b715e12c3a12f02c8640910aa1cb050c64276b5144c20e1699297", + "trace_sha256": "48e9cdb746194961d6687b56d21204a91233bc692a2d15670a7e87d2517dbe9f" + }, + { + "case": 28, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "beb29e50216d084abb3b3e2e589ebc473469c86344b963dcb7975c2da5ddc8b3", + "trace_sha256": "02ef7e2760652d8c887fa022a974f4c5655c5b1fb67c3d6ab7d981723c75805b" + }, + { + "case": 29, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "4ebcd5d9eb5a9ba91d6769a08e0a0e9ebf105249197d39b23308eb24e0075708", + "trace_sha256": "02fdec59581b807be97db1c93a7188edd74343fcd2017732c732a9c3f8f2423a" + }, + { + "case": 30, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "beb29e50216d084abb3b3e2e589ebc473469c86344b963dcb7975c2da5ddc8b3", + "trace_sha256": "02ef7e2760652d8c887fa022a974f4c5655c5b1fb67c3d6ab7d981723c75805b" + }, + { + "case": 31, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "890dfd07c223918973ed6656991f5badf7131333c06477d29829084d02bf9518", + "trace_sha256": "21d5bab94f087faf973d4a6c3523a72b4c969fe62df3bf4be58fb0470a4dffef" + }, + { + "case": 32, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "ca3630101197b69f2d69eb6c22ba0fedea29f873f3905666cfed0cb0ece98f95", + "trace_sha256": "07649574c2502a6a9642743f3fcf40876d3bb75f422a1876d95e944a9c9f2896" + }, + { + "case": 33, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "48a8e671f75a7e776f580913a46e10d20d8252bf68d288893e7f164652e138d2", + "trace_sha256": "c1c342191b102d07c7f8bbc221c07300b9fd873ba342c0edc30da6d1e4665907" + }, + { + "case": 34, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "2ec316abcefe2ddc5a8480c4f3cab73e79b3e420930a824afe91e47f0f117270", + "trace_sha256": "67ffa4e67ae64caac6966c538d092518037dc7bf2f48f84b4ac67a56e9c5d703" + }, + { + "case": 35, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "a2c815c02fd824bb6535bcc40f9121b9cfb4fb109bdd60ec306f560b685440ca", + "trace_sha256": "1e89b962b1e72843778d9b07b50104a82ae8e091495693f94ec5d1e6b2908a4c" + }, + { + "case": 36, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "cb5bf6188a3bf2416a4d704fe23b0aff11b6d15a22430f2de177aa671d13b961", + "trace_sha256": "c4fc33c0f2b7af25ca4e815afb228f6e57dd758c172097e189540fdd10b3527f" + }, + { + "case": 37, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "408533963a15033c77700f994142335e3cada250e294ed933f2a28f00a675565", + "trace_sha256": "439f14d6113c949d73a82ac006e451203e17a681ddefb536285d962932971838" + }, + { + "case": 38, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "790ff35c576f2351245a5bd7231b3db085d1c5c3cd4ea2cd2b9bb34113d724c0", + "trace_sha256": "fd0470a4caeb16ecdcd64956c407b1579dd05db5be258e995d1bf1eef0f5335d" + }, + { + "case": 39, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "790ff35c576f2351245a5bd7231b3db085d1c5c3cd4ea2cd2b9bb34113d724c0", + "trace_sha256": "fd0470a4caeb16ecdcd64956c407b1579dd05db5be258e995d1bf1eef0f5335d" + }, + { + "case": 40, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "ca3630101197b69f2d69eb6c22ba0fedea29f873f3905666cfed0cb0ece98f95", + "trace_sha256": "07649574c2502a6a9642743f3fcf40876d3bb75f422a1876d95e944a9c9f2896" + }, + { + "case": 41, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "4f0e7f9d753063dbbb72129e7b3496a573d9fc4aafa233be9d879ac9a527b6ab", + "trace_sha256": "7216358b09facdebf0b904307c956b76701d1471578c945b78beebca4647ff1f" + }, + { + "case": 42, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "408533963a15033c77700f994142335e3cada250e294ed933f2a28f00a675565", + "trace_sha256": "439f14d6113c949d73a82ac006e451203e17a681ddefb536285d962932971838" + }, + { + "case": 43, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "a2c815c02fd824bb6535bcc40f9121b9cfb4fb109bdd60ec306f560b685440ca", + "trace_sha256": "1e89b962b1e72843778d9b07b50104a82ae8e091495693f94ec5d1e6b2908a4c" + }, + { + "case": 44, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "93ef939d26e191b3e3affc44412f49feceed14e16b5e7b65fdc58c6e441fb094", + "trace_sha256": "6ae47ad6cf035cc0bc0585c8087aa0ca2faba1d8ea09974785aa244a9b335781" + }, + { + "case": 45, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "6f355128f5265711be354cd636c4e9e1f0a747b60dfd989ce561867d8b961d0c", + "trace_sha256": "3e26691cf1ede2b691dfe6dde43298b052cc654d977ffd7ff406fc3e7e5ad532" + }, + { + "case": 46, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "6f355128f5265711be354cd636c4e9e1f0a747b60dfd989ce561867d8b961d0c", + "trace_sha256": "3e26691cf1ede2b691dfe6dde43298b052cc654d977ffd7ff406fc3e7e5ad532" + }, + { + "case": 47, + "family": "long_cycle", + "r1cs_pass": true, + "task_sha256": "ae36f8f9282b715e12c3a12f02c8640910aa1cb050c64276b5144c20e1699297", + "trace_sha256": "48e9cdb746194961d6687b56d21204a91233bc692a2d15670a7e87d2517dbe9f" + }, + { + "case": 0, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "de6f76ad92ede585962d403aed48f57c0be7568aff50568c8780edc3e568951e", + "trace_sha256": "6fc45c49d173a71b10a54815d5c24a3c28973e04f933c39ed1a9e7b5c59e4882" + }, + { + "case": 1, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "30af4667af98ad91a7fda73b77a6e50793459a2f0d72448f52b0367ba2c60673", + "trace_sha256": "2c31138a2fb30570b5c710d1768c5aa04d9af0fc7c5e2e17ead5fd4543b7aa51" + }, + { + "case": 2, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "db2eea9860f9e3892a013405c6381651f46ca5b56016feb98a98fb1d7d5709a7", + "trace_sha256": "62f1ae72e4c72261e07d65baa2cfd48b2eb67e585af1d6ade6e1bd24f094f905" + }, + { + "case": 3, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "de6f76ad92ede585962d403aed48f57c0be7568aff50568c8780edc3e568951e", + "trace_sha256": "6fc45c49d173a71b10a54815d5c24a3c28973e04f933c39ed1a9e7b5c59e4882" + }, + { + "case": 4, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "f6c13138f0621f741c9ac5a9e363272c69e3b20d86e76a8f66b9ec6479538705", + "trace_sha256": "c6ad7f0ca379a1ab50eefcd84c4b75317415d96cdc5413090a342d785263829e" + }, + { + "case": 5, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "f6c13138f0621f741c9ac5a9e363272c69e3b20d86e76a8f66b9ec6479538705", + "trace_sha256": "c6ad7f0ca379a1ab50eefcd84c4b75317415d96cdc5413090a342d785263829e" + }, + { + "case": 6, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "88fe0389fe97334a351d6861775d111501bda3b59f8b236be54bfaab5fb6064f", + "trace_sha256": "9bd22599f01b64923587ab98f1218950dd4b81dbfce6795849f00fff6ed90e19" + }, + { + "case": 7, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "8719c3b3c6219bf5499b68a583e2a0645abac8f567d95d7e4c596d2015eacfd9", + "trace_sha256": "ec0a3f1d94f0fabf5030d04ba5edd2c002635e6f594a45df142a85c5038eb2da" + }, + { + "case": 8, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "108321a5da5dcb186ab0fd393c8997a5a608a620e251bc83166ca581c4113872", + "trace_sha256": "0a75ac8c98deb9df715358a28d845291219ccd7c681da79e3089b93f46eb5fa2" + }, + { + "case": 9, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "db2eea9860f9e3892a013405c6381651f46ca5b56016feb98a98fb1d7d5709a7", + "trace_sha256": "62f1ae72e4c72261e07d65baa2cfd48b2eb67e585af1d6ade6e1bd24f094f905" + }, + { + "case": 10, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "8719c3b3c6219bf5499b68a583e2a0645abac8f567d95d7e4c596d2015eacfd9", + "trace_sha256": "ec0a3f1d94f0fabf5030d04ba5edd2c002635e6f594a45df142a85c5038eb2da" + }, + { + "case": 11, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "6a809f0cf500a2431f8731c15e8c4b3e804e746487f1563555139aa0dd25c922", + "trace_sha256": "2049aa1b366fa883a23a423b7993235b1aebbdbb8cb3fd7e2d10c1d5ea27ab4b" + }, + { + "case": 12, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "0f8c361458450a611476a2eeb9782b2d9191cefbb8ca1734d4ba11c4fafb66ab", + "trace_sha256": "06018be0917e880825538d4b1054caa8a40d3f312b7f532542a472d90ddd3247" + }, + { + "case": 13, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "6a809f0cf500a2431f8731c15e8c4b3e804e746487f1563555139aa0dd25c922", + "trace_sha256": "2049aa1b366fa883a23a423b7993235b1aebbdbb8cb3fd7e2d10c1d5ea27ab4b" + }, + { + "case": 14, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "7d4ed6be90f9623b6489f48a165bc3c4f4f05d7dcb308c7066d36c889360c1b8", + "trace_sha256": "9ede5d2b486c18d3c09930430e0436dbddf847c5685a43e45a374ef3fcb57986" + }, + { + "case": 15, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "db2eea9860f9e3892a013405c6381651f46ca5b56016feb98a98fb1d7d5709a7", + "trace_sha256": "62f1ae72e4c72261e07d65baa2cfd48b2eb67e585af1d6ade6e1bd24f094f905" + }, + { + "case": 16, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "8719c3b3c6219bf5499b68a583e2a0645abac8f567d95d7e4c596d2015eacfd9", + "trace_sha256": "ec0a3f1d94f0fabf5030d04ba5edd2c002635e6f594a45df142a85c5038eb2da" + }, + { + "case": 17, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "0f8c361458450a611476a2eeb9782b2d9191cefbb8ca1734d4ba11c4fafb66ab", + "trace_sha256": "06018be0917e880825538d4b1054caa8a40d3f312b7f532542a472d90ddd3247" + }, + { + "case": 18, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "6a809f0cf500a2431f8731c15e8c4b3e804e746487f1563555139aa0dd25c922", + "trace_sha256": "2049aa1b366fa883a23a423b7993235b1aebbdbb8cb3fd7e2d10c1d5ea27ab4b" + }, + { + "case": 19, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "88fe0389fe97334a351d6861775d111501bda3b59f8b236be54bfaab5fb6064f", + "trace_sha256": "9bd22599f01b64923587ab98f1218950dd4b81dbfce6795849f00fff6ed90e19" + }, + { + "case": 20, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "de6f76ad92ede585962d403aed48f57c0be7568aff50568c8780edc3e568951e", + "trace_sha256": "6fc45c49d173a71b10a54815d5c24a3c28973e04f933c39ed1a9e7b5c59e4882" + }, + { + "case": 21, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "7d4ed6be90f9623b6489f48a165bc3c4f4f05d7dcb308c7066d36c889360c1b8", + "trace_sha256": "9ede5d2b486c18d3c09930430e0436dbddf847c5685a43e45a374ef3fcb57986" + }, + { + "case": 22, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "f02a41fef01407cb277ac767c3ceacd57fa91dff8aef0d0270911e26170236e1", + "trace_sha256": "7a89938249926d914392763fbe1f84a601fb2ef344309a68f568105b83064f72" + }, + { + "case": 23, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "de6f76ad92ede585962d403aed48f57c0be7568aff50568c8780edc3e568951e", + "trace_sha256": "6fc45c49d173a71b10a54815d5c24a3c28973e04f933c39ed1a9e7b5c59e4882" + }, + { + "case": 24, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "db2eea9860f9e3892a013405c6381651f46ca5b56016feb98a98fb1d7d5709a7", + "trace_sha256": "62f1ae72e4c72261e07d65baa2cfd48b2eb67e585af1d6ade6e1bd24f094f905" + }, + { + "case": 25, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "b95995e5f7ce5ac9ca9ec87c446f67eebbbd22531fdc7bc1d4651a3e829466fc", + "trace_sha256": "12f74cf5111934347dc8d6314060943b39817ade56ea37ef75e8fa0f78306f8a" + }, + { + "case": 26, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "f02a41fef01407cb277ac767c3ceacd57fa91dff8aef0d0270911e26170236e1", + "trace_sha256": "7a89938249926d914392763fbe1f84a601fb2ef344309a68f568105b83064f72" + }, + { + "case": 27, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "f6c13138f0621f741c9ac5a9e363272c69e3b20d86e76a8f66b9ec6479538705", + "trace_sha256": "c6ad7f0ca379a1ab50eefcd84c4b75317415d96cdc5413090a342d785263829e" + }, + { + "case": 28, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "8719c3b3c6219bf5499b68a583e2a0645abac8f567d95d7e4c596d2015eacfd9", + "trace_sha256": "ec0a3f1d94f0fabf5030d04ba5edd2c002635e6f594a45df142a85c5038eb2da" + }, + { + "case": 29, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "f02a41fef01407cb277ac767c3ceacd57fa91dff8aef0d0270911e26170236e1", + "trace_sha256": "7a89938249926d914392763fbe1f84a601fb2ef344309a68f568105b83064f72" + }, + { + "case": 30, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "6a809f0cf500a2431f8731c15e8c4b3e804e746487f1563555139aa0dd25c922", + "trace_sha256": "2049aa1b366fa883a23a423b7993235b1aebbdbb8cb3fd7e2d10c1d5ea27ab4b" + }, + { + "case": 31, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "6a809f0cf500a2431f8731c15e8c4b3e804e746487f1563555139aa0dd25c922", + "trace_sha256": "2049aa1b366fa883a23a423b7993235b1aebbdbb8cb3fd7e2d10c1d5ea27ab4b" + }, + { + "case": 32, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "7d4ed6be90f9623b6489f48a165bc3c4f4f05d7dcb308c7066d36c889360c1b8", + "trace_sha256": "9ede5d2b486c18d3c09930430e0436dbddf847c5685a43e45a374ef3fcb57986" + }, + { + "case": 33, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "8719c3b3c6219bf5499b68a583e2a0645abac8f567d95d7e4c596d2015eacfd9", + "trace_sha256": "ec0a3f1d94f0fabf5030d04ba5edd2c002635e6f594a45df142a85c5038eb2da" + }, + { + "case": 34, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "f6c13138f0621f741c9ac5a9e363272c69e3b20d86e76a8f66b9ec6479538705", + "trace_sha256": "c6ad7f0ca379a1ab50eefcd84c4b75317415d96cdc5413090a342d785263829e" + }, + { + "case": 35, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "03a32e8c120630507f8feb62c4c8f510cd347fe56301519b632b9185d432d215", + "trace_sha256": "bad6f5c3c8b1d9b7fdcb42aa6709e6c1ae0efcbc636bc8c94ac83feaa5afc6b4" + }, + { + "case": 36, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "447ff53a0efa08837706214b2dfe40a3a9b2e40cb9861ea8f7454cf8dc8b6465", + "trace_sha256": "2ec39b8e5281419b8e38ee0825032600b5f9708a1c3289347a7e3507991facae" + }, + { + "case": 37, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "b95995e5f7ce5ac9ca9ec87c446f67eebbbd22531fdc7bc1d4651a3e829466fc", + "trace_sha256": "12f74cf5111934347dc8d6314060943b39817ade56ea37ef75e8fa0f78306f8a" + }, + { + "case": 38, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "447ff53a0efa08837706214b2dfe40a3a9b2e40cb9861ea8f7454cf8dc8b6465", + "trace_sha256": "2ec39b8e5281419b8e38ee0825032600b5f9708a1c3289347a7e3507991facae" + }, + { + "case": 39, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "8719c3b3c6219bf5499b68a583e2a0645abac8f567d95d7e4c596d2015eacfd9", + "trace_sha256": "ec0a3f1d94f0fabf5030d04ba5edd2c002635e6f594a45df142a85c5038eb2da" + }, + { + "case": 40, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "8719c3b3c6219bf5499b68a583e2a0645abac8f567d95d7e4c596d2015eacfd9", + "trace_sha256": "ec0a3f1d94f0fabf5030d04ba5edd2c002635e6f594a45df142a85c5038eb2da" + }, + { + "case": 41, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "aa68b93f283847b784a0e2730f489fa204bc4314a89f84f8b67caf85f2b91cbe", + "trace_sha256": "96d5bcd2f545aa965d16df6ee56b8c42ab2d0951a1b02e4bd8cf992957574e7e" + }, + { + "case": 42, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "b95995e5f7ce5ac9ca9ec87c446f67eebbbd22531fdc7bc1d4651a3e829466fc", + "trace_sha256": "12f74cf5111934347dc8d6314060943b39817ade56ea37ef75e8fa0f78306f8a" + }, + { + "case": 43, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "0f8c361458450a611476a2eeb9782b2d9191cefbb8ca1734d4ba11c4fafb66ab", + "trace_sha256": "06018be0917e880825538d4b1054caa8a40d3f312b7f532542a472d90ddd3247" + }, + { + "case": 44, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "b15684b69887358aef382c746c5971679a1273a84334e9db2a487dc8b199e33d", + "trace_sha256": "79c91cd6374a65273ccf3a3ccd6b2dc3327846a06ee80ef71ffc2b8ddeb13849" + }, + { + "case": 45, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "b15684b69887358aef382c746c5971679a1273a84334e9db2a487dc8b199e33d", + "trace_sha256": "79c91cd6374a65273ccf3a3ccd6b2dc3327846a06ee80ef71ffc2b8ddeb13849" + }, + { + "case": 46, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "b95995e5f7ce5ac9ca9ec87c446f67eebbbd22531fdc7bc1d4651a3e829466fc", + "trace_sha256": "12f74cf5111934347dc8d6314060943b39817ade56ea37ef75e8fa0f78306f8a" + }, + { + "case": 47, + "family": "sink", + "r1cs_pass": true, + "task_sha256": "447ff53a0efa08837706214b2dfe40a3a9b2e40cb9861ea8f7454cf8dc8b6465", + "trace_sha256": "2ec39b8e5281419b8e38ee0825032600b5f9708a1c3289347a7e3507991facae" + } + ], + "rows_sha256": "d8fce103ad9b4759cc857e66c6d313a7ebf8c0e987c1511fe1e9b2931fdb0e32", + "schema": "algernon-02-cpu-reference-v1", + "seed": 20261103, + "signals": 189, + "source_hashes_sha256": { + "pointer_4x8.circom": "c0f43d87bf32dfc2e96e1463a86910b721ce11e331d3f7480f9f8646a9334974", + "r1cs_reference_constraints.json": "dc5738886bef2e10599e61cd5b1d93be7de232fa039548d4e948bd1ab1e27f88", + "r1cs_reference_signals.json": "760ded6af28bddc01ce9ac842396a70b9e1b39e9f8a2f21bc9bdb0bd4e2c268f" + }, + "source_role": "independent CPU reference for future neural/compiled backends", + "steps": 8 +} diff --git a/research/algernon/circuit_mirror/results/pilot_6_300.json b/research/algernon/circuit_mirror/results/pilot_6_300.json new file mode 100644 index 000000000..3392bf653 --- /dev/null +++ b/research/algernon/circuit_mirror/results/pilot_6_300.json @@ -0,0 +1,246 @@ +{ + "batch": 128, + "calibration_family": "permutation", + "class": "toy_cpu_torch_supervised_proxy", + "heldout_families": [ + "long_cycle", + "sink" + ], + "model_weight_sha256": "e53b2f2309ed83fb07cdbd3190f4e8375a787a1de49a392882ac0f090c635d13", + "n_nodes": 6, + "n_train_examples": 38400, + "notes": "Heldout families differ from train, yet N=constant and quadratic product features are explicitly provided; this tests trained readout and iteration, not autonomous algorithm discovery.", + "parameter_count": 222, + "r1cs_oracle_example": { + "n_constraints": 460, + "n_signals": 391, + "verification": { + "bad": [], + "valid": true, + "violations": 0 + } + }, + "results": [ + { + "depth": 1, + "family": "permutation", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 4.094050609637634e-05, + "n": 40, + "random_untrained_accuracy": 0.325, + "soft_accuracy": 1.0, + "split": "calibration", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 2, + "family": "permutation", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 8.116244607663248e-05, + "n": 40, + "random_untrained_accuracy": 0.175, + "soft_accuracy": 1.0, + "split": "calibration", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 4, + "family": "permutation", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 0.0001711116610749741, + "n": 40, + "random_untrained_accuracy": 0.3, + "soft_accuracy": 1.0, + "split": "calibration", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 8, + "family": "permutation", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 0.0003472964991942717, + "n": 40, + "random_untrained_accuracy": 0.275, + "soft_accuracy": 1.0, + "split": "calibration", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 12, + "family": "permutation", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 0.000509522124320938, + "n": 40, + "random_untrained_accuracy": 0.4, + "soft_accuracy": 1.0, + "split": "calibration", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 16, + "family": "permutation", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 0.0007126067505851097, + "n": 40, + "random_untrained_accuracy": 0.275, + "soft_accuracy": 1.0, + "split": "calibration", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 1, + "family": "long_cycle", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 4.055798563058488e-05, + "n": 40, + "random_untrained_accuracy": 0.175, + "soft_accuracy": 1.0, + "split": "heldout", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 2, + "family": "long_cycle", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 8.005929425962677e-05, + "n": 40, + "random_untrained_accuracy": 0.075, + "soft_accuracy": 1.0, + "split": "heldout", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 4, + "family": "long_cycle", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 0.00016641087981952296, + "n": 40, + "random_untrained_accuracy": 0.125, + "soft_accuracy": 1.0, + "split": "heldout", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 8, + "family": "long_cycle", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 0.00033624720363150117, + "n": 40, + "random_untrained_accuracy": 0.075, + "soft_accuracy": 1.0, + "split": "heldout", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 12, + "family": "long_cycle", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 0.0005026724908930192, + "n": 40, + "random_untrained_accuracy": 0.55, + "soft_accuracy": 1.0, + "split": "heldout", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 16, + "family": "long_cycle", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 0.0006813142008468276, + "n": 40, + "random_untrained_accuracy": 0.075, + "soft_accuracy": 1.0, + "split": "heldout", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 1, + "family": "sink", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 3.965140999753203e-05, + "n": 40, + "random_untrained_accuracy": 0.275, + "soft_accuracy": 1.0, + "split": "heldout", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 2, + "family": "sink", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 8.237577858380974e-05, + "n": 40, + "random_untrained_accuracy": 0.25, + "soft_accuracy": 1.0, + "split": "heldout", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 4, + "family": "sink", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 0.00016117230702548114, + "n": 40, + "random_untrained_accuracy": 0.4, + "soft_accuracy": 1.0, + "split": "heldout", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 8, + "family": "sink", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 0.00031562678532282007, + "n": 40, + "random_untrained_accuracy": 0.45, + "soft_accuracy": 1.0, + "split": "heldout", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 12, + "family": "sink", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 0.0004922696113226266, + "n": 40, + "random_untrained_accuracy": 0.4, + "soft_accuracy": 1.0, + "split": "heldout", + "whole_trace_valid_rate": 1.0 + }, + { + "depth": 16, + "family": "sink", + "hard_accuracy": 1.0, + "invalid_claimed_traces": 0, + "mean_relaxed_defect_sum": 0.0006479846550519142, + "n": 40, + "random_untrained_accuracy": 0.4, + "soft_accuracy": 1.0, + "split": "heldout", + "whole_trace_valid_rate": 1.0 + } + ], + "seed": 20261103, + "train_depth": 1, + "train_family": "random_function", + "train_seconds": 0.394, + "updates": 300 +} diff --git a/research/algernon/circuit_mirror/results/pointer_4x8.circom b/research/algernon/circuit_mirror/results/pointer_4x8.circom new file mode 100644 index 000000000..9001d899f --- /dev/null +++ b/research/algernon/circuit_mirror/results/pointer_4x8.circom @@ -0,0 +1,51 @@ +pragma circom 2.1.6; +// Generated from Algernon-02 pointer-machine semantics, N=4, STEPS=8. +// Signal arrays are public only through main's public annotation. +template PointerTrace(N, STEPS) { + signal input edge[N][N]; + signal input start[N]; + signal state[STEPS + 1][N]; + signal product[STEPS][N][N]; + signal output final[N]; + + var startSum = 0; + for (var i = 0; i < N; i++) { + start[i] * (start[i] - 1) === 0; + state[0][i] <== start[i]; + startSum += start[i]; + var edgeSum = 0; + for (var j = 0; j < N; j++) { + edge[i][j] * (edge[i][j] - 1) === 0; + edgeSum += edge[i][j]; + } + edgeSum === 1; + } + startSum === 1; + + for (var t = 0; t < STEPS; t++) { + for (var i = 0; i < N; i++) { + for (var j = 0; j < N; j++) { + product[t][i][j] <== state[t][i] * edge[i][j]; + } + } + for (var j = 0; j < N; j++) { + var nextSum = 0; + for (var i = 0; i < N; i++) { + nextSum += product[t][i][j]; + } + state[t + 1][j] <== nextSum; + } + } + for (var t = 0; t <= STEPS; t++) { + var stateSum = 0; + for (var i = 0; i < N; i++) { + state[t][i] * (state[t][i] - 1) === 0; + stateSum += state[t][i]; + } + stateSum === 1; + } + for (var i = 0; i < N; i++) { + final[i] <== state[STEPS][i]; + } +} +component main {public [edge, start]} = PointerTrace(4, 8); diff --git a/research/algernon/circuit_mirror/run.py b/research/algernon/circuit_mirror/run.py new file mode 100644 index 000000000..fa31a9680 --- /dev/null +++ b/research/algernon/circuit_mirror/run.py @@ -0,0 +1,94 @@ +"""Export Algernon-02 semantics and a deterministic CPU exactness receipt. + +Invoke from the repo root: +python -m research.algernon.circuit_mirror.run --out runs/algernon/circuit_mirror +""" +from __future__ import annotations + +import argparse +import hashlib +import itertools +import json +import shutil +from pathlib import Path + +from .spec import PointerTask, build, canonical, case, digest, emit_circom, witness_for, witness_for_trace + + +def run_experiment(n: int = 4, steps: int = 8, cases_per_family: int = 48, + seed: int = 20261103): + if cases_per_family < 1: + raise ValueError("cases_per_family must be >=1") + template=PointerTask(tuple(range(n)),0,steps) + circuit=build(template) + rows=[] + for family in ("random_function", "permutation", "long_cycle", "sink"): + for idx in range(cases_per_family): + task=case(family,seed,idx,n=n,steps=steps) + witness,public=witness_for(task,circuit) + check=circuit.check(witness,public) + # Independent direct-state oracle in PointerTask.trace; valid only if every step matches. + if not check["valid"] or task.trace()[-1] != next(i for i in range(n) if witness[circuit.indices[f"final[{i}]"]] == 1): + raise AssertionError("exact circuit and direct oracle disagree") + rows.append({"family": family, "case":idx, "task_sha256":digest(task.description()), + "trace_sha256":digest(task.trace()), "r1cs_pass":check["valid"]}) + # A negative example that ends at the correct final state but lies on a false path. + task=PointerTask(tuple((i+1)%n for i in range(n)),0,steps) + path=task.trace() + if steps > 1: + broken=path.copy() + broken[1]=(broken[1]+1)%n + bad_w,bad_pub=witness_for_trace(task,circuit,broken) + bad=circuit.check(bad_w,bad_pub) + if bad["valid"]: + raise AssertionError("incorrect internal trace accepted") + bad_count=bad["violations"] + else: + bad_count=None + return { + "schema":"algernon-02-cpu-reference-v1", + "execution_class":"python_r1cs_reference_only", + "circom_compile_status":"not_run", + "source_role":"independent CPU reference for future neural/compiled backends", + "n_nodes":n,"steps":steps,"seed":seed,"cases_per_family":cases_per_family, + "field":"BN254 Fr","modulus":str(21888242871839275222246405745257275088548364400416034343698204186575808495617), + "signals":len(circuit.names),"constraints":len(circuit.constraints), + "exact_checks":len(rows),"exact_failures":sum(not z["r1cs_pass"] for z in rows), + "negative_corrupt_trace_violations":bad_count, + "rows_sha256":digest(rows),"rows":rows, + }, circuit + + +def main(): + parser=argparse.ArgumentParser() + parser.add_argument("--n",type=int,default=4) + parser.add_argument("--steps",type=int,default=8) + parser.add_argument("--cases",type=int,default=48) + parser.add_argument("--seed",type=int,default=20261103) + parser.add_argument("--out",type=Path,default=Path("runs/algernon/circuit_mirror")) + parser.add_argument("--require-circom",action="store_true",help="fail when compiler is unavailable") + args=parser.parse_args() + result,circuit=run_experiment(args.n,args.steps,args.cases,args.seed) + args.out.mkdir(parents=True,exist_ok=True) + src=emit_circom(args.n,args.steps) + constrained=circuit.export_circom_constraints() + files={ + f"pointer_{args.n}x{args.steps}.circom":src, + "r1cs_reference_constraints.json":json.dumps(constrained,sort_keys=True,indent=2)+"\n", + "r1cs_reference_signals.json":json.dumps({"signals":circuit.names,"public_names":circuit.public_names},indent=2)+"\n", + } + result["source_hashes_sha256"]={k:hashlib.sha256(v.encode()).hexdigest() for k,v in files.items()} + # No compiler or proof tool assumed installed: this is an explicit unexecuted gate. + result["circom_compile_status"]="available_unexecuted" if shutil.which("circom") else "binary_not_found" + if args.require_circom and not shutil.which("circom"): + raise RuntimeError("circom binary unavailable") + for name,body in files.items(): + (args.out/name).write_text(body,encoding="utf-8") + (args.out/"cpu_reference.json").write_text(json.dumps(result,sort_keys=True,indent=2)+"\n",encoding="utf-8") + print(f"{result['exact_checks']} exact reference cases, {result['exact_failures']} failures, " + f"{result['constraints']} R1CS-like constraints, circom={result['circom_compile_status']}") + print(args.out) + + +if __name__ == '__main__': + main() diff --git a/research/algernon/circuit_mirror/spec.py b/research/algernon/circuit_mirror/spec.py new file mode 100644 index 000000000..a1574fb05 --- /dev/null +++ b/research/algernon/circuit_mirror/spec.py @@ -0,0 +1,273 @@ +"""Algernon-02: semantic pointer-machine IR with an exact BN254 R1CS mirror. + +Python R1CS evaluator and Circom source emitter are *distinct backends*. The +Circom source has not been compiled by Circom in this environment. This package +produces no zk proof and contains no Qwen/LOTUS inference. +""" +from __future__ import annotations + +import hashlib +import json +import random +from dataclasses import dataclass +from typing import Any + +# Circom default BN254 *scalar* field; see https://docs.circom.io/background/background/ +P = 21888242871839275222246405745257275088548364400416034343698204186575808495617 + + +def canonical(obj: Any) -> bytes: + return json.dumps(obj, sort_keys=True, separators=(",", ":")).encode("utf-8") + + +def digest(obj: Any) -> str: + return hashlib.sha256(canonical(obj)).hexdigest() + + +@dataclass(frozen=True) +class PointerTask: + """Total deterministic machine T: state -> successor(state); fixed step count.""" + + successors: tuple[int, ...] + initial: int + steps: int + + def __post_init__(self): + n = len(self.successors) + if not 2 <= n <= 16 or any(type(s) is not int or not 0 <= s < n for s in self.successors): + raise ValueError("successors must form a total function on 2..16 states") + if type(self.initial) is not int or not 0 <= self.initial < n: + raise ValueError("invalid initial state") + if type(self.steps) is not int or not 0 <= self.steps <= 64: + raise ValueError("steps must be in 0..64") + + @property + def n(self): + return len(self.successors) + + def public(self): + return {"edge": [[int(self.successors[i] == j) for j in range(self.n)] + for i in range(self.n)], + "start": [int(self.initial == i) for i in range(self.n)]} + + def trace(self): + out = [self.initial] + for _ in range(self.steps): + out.append(self.successors[out[-1]]) + return out + + def description(self): + return {"successors": list(self.successors), "initial": self.initial, + "steps": self.steps, "trace": self.trace()} + + +def case(family: str, seed: int, ident: int, n: int = 4, steps: int = 8) -> PointerTask: + """Distinct generator families for training, calibration, and depth testing.""" + if not isinstance(ident, int) or ident < 0: + raise ValueError("ident must be nonnegative") + rng = random.Random(f"{family}:{seed}:{ident}:{n}:{steps}") + if family == "random_function": + f = tuple(rng.randrange(n) for _ in range(n)) + elif family == "permutation": + a = list(range(n)); rng.shuffle(a); f = tuple(a) + elif family == "long_cycle": + a = list(range(n)); rng.shuffle(a) + f_list = [0] * n + for i in range(n): + f_list[a[i]] = a[(i + 1) % n] + f = tuple(f_list) + elif family == "sink": + end = rng.randrange(n) + f = tuple(end if i != end else end for i in range(n)) + else: + raise ValueError(f"unknown generator family {family}") + return PointerTask(f, rng.randrange(n), steps) + + +def onehot(index: int, n: int) -> list[int]: + return [int(index == i) for i in range(n)] + + +class R1CS: + """Constraint triples (A·w)(B·w) - C·w == 0 mod p. + + Wire 0 is constant 1. `public_values` are checked *separately*: an exported + constraint list is insufficient to bind a statement to specific public data. + """ + + def __init__(self): + self.names = ["ONE"] + self.indices = {"ONE": 0} + self.constraints: list[tuple[dict[int, int], dict[int, int], dict[int, int]]] = [] + self.public_names: list[str] = [] + + def wire(self, name: str, public: bool = False) -> int: + if name in self.indices: + raise ValueError(f"duplicate signal {name}") + idx = len(self.names) + self.names.append(name) + self.indices[name] = idx + if public: + self.public_names.append(name) + return idx + + def add(self, a: dict[int, int], b: dict[int, int], c: dict[int, int]): + self.constraints.append((a, b, c)) + + def boolean(self, x: int): + self.add({x: 1}, {x: 1, 0: -1}, {}) + + def eqzero(self, terms: dict[int, int]): + self.add(terms, {0: 1}, {}) + + def eval_linear(self, expr: dict[int, int], w: list[int]) -> int: + return sum(coeff * w[idx] for idx, coeff in expr.items()) % P + + def check(self, witness: list[int], public_values: dict[str, int], *, collect: int = 8): + if len(witness) != len(self.names) or witness[0] != 1 or any( + type(v) is not int or not 0 <= v < P for v in witness + ): + return {"valid": False, "error": "invalid witness length or field element", "bad": []} + for name in self.public_names: + if name not in public_values or witness[self.indices[name]] != public_values[name]: + return {"valid": False, "error": "public input mismatch", "bad": [name]} + bad = [] + count = 0 + for i, (a, b, c) in enumerate(self.constraints): + residual = (self.eval_linear(a, witness) * self.eval_linear(b, witness) + - self.eval_linear(c, witness)) % P + if residual: + count += 1 + if len(bad) < collect: + bad.append({"constraint_index": i, "residual": str(residual)}) + return {"valid": count == 0, "violations": count, "bad": bad} + + def export_circom_constraints(self): + """Circom-like JSON constraint shape; wire numbering is THIS emitter's own.""" + def terms(obj): + return {str(k): str(v % P) for k, v in sorted(obj.items()) if v % P} + return {"constraints": [[terms(a), terms(b), terms(c)] + for a, b, c in self.constraints]} + + +def build(task: PointerTask): + """Fully constrained onehot machine trace and all intermediate mul wires.""" + n, steps = task.n, task.steps + r = R1CS() + edge = [[r.wire(f"edge[{i}][{j}]", public=True) for j in range(n)] for i in range(n)] + start = [r.wire(f"start[{i}]", public=True) for i in range(n)] + state = [[r.wire(f"state[{t}][{i}]") for i in range(n)] for t in range(steps + 1)] + prod = [[[r.wire(f"prod[{t}][{i}][{j}]") for j in range(n)] + for i in range(n)] for t in range(steps)] + final = [r.wire(f"final[{i}]") for i in range(n)] + for i in range(n): + r.boolean(start[i]) + r.eqzero({state[0][i]: 1, start[i]: -1}) + for j in range(n): + r.boolean(edge[i][j]) + r.eqzero({**{edge[i][j]: 1 for j in range(n)}, 0: -1}) + r.eqzero({**{start[i]: 1 for i in range(n)}, 0: -1}) + for t in range(steps + 1): + for i in range(n): + r.boolean(state[t][i]) + r.eqzero({**{state[t][i]: 1 for i in range(n)}, 0: -1}) + for t in range(steps): + for i in range(n): + for j in range(n): + r.add({state[t][i]: 1}, {edge[i][j]: 1}, {prod[t][i][j]: 1}) + for j in range(n): + r.eqzero({state[t + 1][j]: 1, + **{prod[t][i][j]: -1 for i in range(n)}}) + for i in range(n): + r.eqzero({final[i]: 1, state[steps][i]: -1}) + return r + + +def witness_for_trace(task: PointerTask, circuit: R1CS, history: list[int]): + """Construct a candidate trace witness; may be invalid under the public machine. + + Product wires follow the *claimed* predecessor, so the checker catches + incorrect successor states instead of silently replacing them with oracle. + """ + n, steps = task.n, task.steps + if len(history) != steps + 1 or any(type(v) is not int or v < 0 or v >= n for v in history): + raise ValueError("candidate history must have a valid state per step") + w = [0] * len(circuit.names) + w[0] = 1 + for i in range(n): + w[circuit.indices[f"start[{i}]"]] = int(task.initial == i) + for j in range(n): + w[circuit.indices[f"edge[{i}][{j}]"]] = int(task.successors[i] == j) + for t, index in enumerate(history): + for i in range(n): + w[circuit.indices[f"state[{t}][{i}]"]] = int(i == index) + for t in range(steps): + for i in range(n): + for j in range(n): + w[circuit.indices[f"prod[{t}][{i}][{j}]"]] = int( + i == history[t] and j == task.successors[i]) + for i in range(n): + w[circuit.indices[f"final[{i}]"]] = int(i == history[-1]) + public = {name: w[circuit.indices[name]] for name in circuit.public_names} + return w, public + + +def witness_for(task: PointerTask, circuit: R1CS): + return witness_for_trace(task, circuit, task.trace()) + + +def emit_circom(n: int, steps: int): + """One-port explicit Circom source; compilation requires external circom binary.""" + PointerTask(tuple(range(n)), 0, steps) # validates parameters + return f'''pragma circom 2.1.6; +// Generated from Algernon-02 pointer-machine semantics, N={n}, STEPS={steps}. +// Signal arrays are public only through main's public annotation. +template PointerTrace(N, STEPS) {{ + signal input edge[N][N]; + signal input start[N]; + signal state[STEPS + 1][N]; + signal product[STEPS][N][N]; + signal output final[N]; + + var startSum = 0; + for (var i = 0; i < N; i++) {{ + start[i] * (start[i] - 1) === 0; + state[0][i] <== start[i]; + startSum += start[i]; + var edgeSum = 0; + for (var j = 0; j < N; j++) {{ + edge[i][j] * (edge[i][j] - 1) === 0; + edgeSum += edge[i][j]; + }} + edgeSum === 1; + }} + startSum === 1; + + for (var t = 0; t < STEPS; t++) {{ + for (var i = 0; i < N; i++) {{ + for (var j = 0; j < N; j++) {{ + product[t][i][j] <== state[t][i] * edge[i][j]; + }} + }} + for (var j = 0; j < N; j++) {{ + var nextSum = 0; + for (var i = 0; i < N; i++) {{ + nextSum += product[t][i][j]; + }} + state[t + 1][j] <== nextSum; + }} + }} + for (var t = 0; t <= STEPS; t++) {{ + var stateSum = 0; + for (var i = 0; i < N; i++) {{ + state[t][i] * (state[t][i] - 1) === 0; + stateSum += state[t][i]; + }} + stateSum === 1; + }} + for (var i = 0; i < N; i++) {{ + final[i] <== state[STEPS][i]; + }} +}} +component main {{public [edge, start]}} = PointerTrace({n}, {steps}); +''' diff --git a/research/algernon/circuit_mirror/tests/test_run.py b/research/algernon/circuit_mirror/tests/test_run.py new file mode 100644 index 000000000..7eb3cc47e --- /dev/null +++ b/research/algernon/circuit_mirror/tests/test_run.py @@ -0,0 +1,25 @@ +import importlib.util +import unittest + +from research.algernon.circuit_mirror.run import run_experiment + + +class TestSuite(unittest.TestCase): + def test_reference_receipt(self): + receipt, circuit = run_experiment(n=4, steps=5, cases_per_family=8, seed=10) + self.assertEqual(receipt['exact_checks'], 32) + self.assertEqual(receipt['exact_failures'], 0) + self.assertGreater(receipt['negative_corrupt_trace_violations'],0) + self.assertGreater(len(circuit.constraints),0) + + @unittest.skipUnless(importlib.util.find_spec('torch') is not None, 'optional CPU torch') + def test_learned_readout_pipeline_smoke(self): + from research.algernon.circuit_mirror.pilot import train_and_evaluate + report = train_and_evaluate(seed=7, n=4, updates=12, batch=16, cases_per_family=2) + self.assertEqual(report['class'], 'toy_cpu_torch_supervised_proxy') + self.assertEqual(report['parameter_count'], 4*4*4+4) + self.assertEqual(len(report['results']),18) + self.assertTrue(report['r1cs_oracle_example']['verification']['valid']) + + +if __name__ == '__main__': unittest.main() diff --git a/research/algernon/circuit_mirror/tests/test_spec.py b/research/algernon/circuit_mirror/tests/test_spec.py new file mode 100644 index 000000000..b485c05fe --- /dev/null +++ b/research/algernon/circuit_mirror/tests/test_spec.py @@ -0,0 +1,65 @@ +import itertools +import unittest +from research.algernon.circuit_mirror.spec import ( + P, PointerTask, build, case, emit_circom, witness_for, witness_for_trace, +) + + +class TestR1CS(unittest.TestCase): + def test_exhaustive_small_machines(self): + count = 0 + for f in itertools.product(range(3), repeat=3): + for initial in range(3): + for steps in (0, 1, 2, 3, 4, 8, 12): + task = PointerTask(f, initial, steps) + c = build(task) + w, public = witness_for(task, c) + self.assertTrue(c.check(w, public)["valid"]) + self.assertEqual(w[c.indices[f"final[{task.trace()[-1]}]"]], 1) + count += 1 + self.assertEqual(count, 567) + + def test_corrupted_product_and_state_fail(self): + task = PointerTask((1, 2, 0, 0), 0, 4) + c = build(task) + w, public = witness_for(task, c) + for name in ("prod[0][0][1]", "state[2][1]", "final[0]", "edge[0][1]", "start[0]"): + damaged = w[:] + damaged[c.indices[name]] ^= 1 + self.assertFalse(c.check(damaged, public)["valid"], name) + + def test_bad_claimed_trace_rejected_even_if_final_correct(self): + t = PointerTask((1,2,0), 0, 3) + c = build(t) + # The false trace starts correctly and ends at the oracle's final state, + # but violates intermediate transitions. Final-answer-only checking misses it. + w,public=witness_for_trace(t,c,[0,2,2,0]) + self.assertFalse(c.check(w,public)["valid"]) + + def test_invalid_public_mismatch(self): + t = PointerTask((0, 0, 0), 1, 2) + c = build(t); w, public = witness_for(t, c) + bad = dict(public); bad["start[1]"] = 0 + self.assertEqual(c.check(w, bad)["error"], "public input mismatch") + self.assertFalse(c.check(w[:-1], public)["valid"]) + + def test_invalid_graph_and_signal(self): + with self.assertRaises(ValueError): PointerTask((0, 9), 0, 1) + with self.assertRaises(ValueError): PointerTask((0, 1), 2, 1) + with self.assertRaises(ValueError): PointerTask((0, 1), 0, -1) + with self.assertRaises(ValueError): case("unknown", 1, 1) + + def test_circom_json_semantics(self): + t=case("permutation", 34, 4, n=4, steps=3) + c=build(t) + j=c.export_circom_constraints() + self.assertEqual(len(j["constraints"]), len(c.constraints)) + self.assertTrue(all(len(triple)==3 for triple in j["constraints"])) + self.assertEqual(c.check(*witness_for(t,c))["violations"], 0) + source=emit_circom(4,3) + self.assertIn("component main {public [edge, start]}", source) + self.assertIn("product[t][i][j] <==", source) + self.assertTrue(P>2**200) + + +if __name__=='__main__': unittest.main() diff --git a/research/algernon/cpu_reference_receipt.json b/research/algernon/cpu_reference_receipt.json new file mode 100644 index 000000000..fb3b3f451 --- /dev/null +++ b/research/algernon/cpu_reference_receipt.json @@ -0,0 +1,30 @@ +{ + "schema_version": "0.1.0", + "experiment": "Algernon LDT exact reachability microkernel", + "execution_class": "cpu_python_reference_only", + "source": "research/algernon/exact_kernel.py", + "command": "python -m research.algernon.exact_kernel --cases-per-family 50 --output runs/algernon/cpu_reference.json", + "date": "2026-11-03", + "python": "3.13.5", + "platform": "linux-x86_64", + "seed": 20261103, + "cases_per_family": 50, + "graph_families": [ + "path", + "branch", + "cycle", + "random", + "disconnected" + ], + "cases": 250, + "reference_mismatches": 0, + "unit_tests_passed": 10, + "graph_fuzz_cases_in_tests": 1000, + "record_file_sha256": "2866a67f293fe859e8496612566d4a14d41969dc50641b93d10eda3ff2fd9482", + "split_sha256": { + "train": "ab141325eaaaa1cedb257c7ab49b4806718d4798db658662791ec93c66428c73", + "calibration": "01e1274d575af1b5812bf6b1f2a9b5449e822fe856e27fca017b9d3c7428c5d2", + "test": "fa0e093f5d892893d9b8f089a6b36d2361d73ee121878e0702a9292c7dc22030" + }, + "notes": "Generated from CPU-only Python code. No in-weight circuit was executed; no model checkpoint was loaded." +} diff --git a/research/algernon/exact_kernel.py b/research/algernon/exact_kernel.py new file mode 100644 index 000000000..b106b6d71 --- /dev/null +++ b/research/algernon/exact_kernel.py @@ -0,0 +1,175 @@ +"""CPU-only exact lattice-reachability microkernel for Algernon Phase B. + +This is a reference bitset processor, NOT an in-weight Qwenputer/RV32 execution. +It has a separately implemented graph-search oracle and a seeded, disjoint-family +workload, so a future compiled neural circuit can be tested against the same cases. + +Run from the repository root: +python -m research.algernon.exact_kernel --output runs/algernon/cpu_reference.json +""" +from __future__ import annotations + +import argparse +import hashlib +import json +import random +from collections import deque +from dataclasses import dataclass +from pathlib import Path + + +def canonical_bytes(obj): + return json.dumps(obj, sort_keys=True, separators=(",", ":")).encode("utf-8") + + +def sha256(obj): + return hashlib.sha256(canonical_bytes(obj)).hexdigest() + + +@dataclass(frozen=True) +class Task: + n: int + source: int + goal: int + edges: tuple[tuple[int, int], ...] + + def __post_init__(self): + if not 2 <= self.n <= 16: + raise ValueError("node count outside [2, 16]") + if not (0 <= self.source < self.n and 0 <= self.goal < self.n): + raise ValueError("source or goal out of bounds") + if any(len(e) != 2 or min(e) < 0 or max(e) >= self.n for e in self.edges): + raise ValueError("invalid edge") + + def json(self): + return {"n": self.n, "source": self.source, "goal": self.goal, + "edges": [list(edge) for edge in self.edges]} + + +def compile_task(task): + """Compile edges into per-node outgoing bitmasks.""" + rows = [0] * task.n + for src, dst in task.edges: + rows[src] |= 1 << dst + return tuple(rows) + + +def run_compiled(task, rows): + if len(rows) != task.n or any(not isinstance(row, int) or row < 0 or row >= (1 << task.n) + for row in rows): + raise ValueError("invalid compiled rows") + visited = 1 << task.source + history = [] + operations = 0 + for iteration in range(1, task.n + 1): + expanded = visited + for vertex in range(task.n): + operations += 1 + if visited & (1 << vertex): + expanded |= rows[vertex] + history.append([iteration, visited, expanded]) + if expanded == visited: + break + visited = expanded + return { + "reachable": bool(visited & (1 << task.goal)), + "visited_mask": visited, + "iterations": len(history), + "bit_operations": operations, + "trace_sha256": sha256(history), + } + + +def oracle_bfs(task): + """Independent queue-based graph search, using edges rather than bitmasks.""" + adjacency = {i: [] for i in range(task.n)} + for u, v in task.edges: + adjacency[u].append(v) + visited = {task.source} + q = deque([task.source]) + while q: + for nxt in adjacency[q.popleft()]: + if nxt not in visited: + visited.add(nxt) + q.append(nxt) + return bool(task.goal in visited), sum(1 << v for v in visited) + + +SPLIT_FAMILIES = { + "train": ("path", "branch"), + "calibration": ("cycle",), + "test": ("random", "disconnected"), +} + + +def make_case(family, seed, case_index): + rng = random.Random(f"{family}:{seed}:{case_index}") + n = rng.randrange(2, 13) + if family == "path": + edges = [(i, i + 1) for i in range(n - 1)] + elif family == "branch": + edges = [(0, i) for i in range(1, n)] + elif family == "cycle": + edges = [(i, (i + 1) % n) for i in range(n)] + elif family == "random": + edges = [(i, j) for i in range(n) for j in range(n) + if i != j and rng.random() < 0.19] + elif family == "disconnected": + m = max(1, n // 2) + edges = [(i, j) for i in range(n) for j in range(n) + if i != j and (i < m) == (j < m) and rng.random() < 0.3] + else: + raise ValueError(f"unknown family: {family}") + return Task(n, rng.randrange(n), rng.randrange(n), tuple(sorted(set(edges)))) + + +def run_suite(seed=20261103, cases_per_family=50): + if cases_per_family <= 0: + raise ValueError("cases_per_family must be positive") + out = [] + for split, families in SPLIT_FAMILIES.items(): + for family in families: + for i in range(cases_per_family): + task = make_case(family, seed, i) + got = run_compiled(task, compile_task(task)) + expected, expected_mask = oracle_bfs(task) + if (got["reachable"], got["visited_mask"]) != (expected, expected_mask): + raise AssertionError(f"reference mismatch: {split}/{family}/{i}") + out.append({ + "id": f"{split}:{family}:{seed}:{i}", + "split": split, "family": family, "task": task.json(), + "task_sha256": sha256(task.json()), + "reference_reachable": expected, **got, + }) + split_hashes = { + s: sha256([r["task_sha256"] for r in out if r["split"] == s]) + for s in SPLIT_FAMILIES + } + return { + "schema_version": "0.1.0", + "execution_class": "cpu_python_reference_only", + "description": "monotone bitset closure compared with independent BFS", + "seed": seed, + "cases_per_family": cases_per_family, + "n": len(out), + "split_sha256": split_hashes, + "family_assignment": {s: list(v) for s, v in SPLIT_FAMILIES.items()}, + "reference_mismatches": 0, + "records": out, + } + + +def main(): + p = argparse.ArgumentParser() + p.add_argument("--seed", type=int, default=20261103) + p.add_argument("--cases-per-family", type=int, default=50) + p.add_argument("--output", type=Path, default=Path("runs/algernon/cpu_reference.json")) + a = p.parse_args() + r = run_suite(a.seed, a.cases_per_family) + a.output.parent.mkdir(parents=True, exist_ok=True) + a.output.write_text(json.dumps(r, sort_keys=True, indent=2) + "\n") + print(f"CPU-only: {r['n']} checks, {r['reference_mismatches']} mismatches, {a.output}") + + +if __name__ == "__main__": + main() diff --git a/research/algernon/experiment_register.json b/research/algernon/experiment_register.json new file mode 100644 index 000000000..a3b788558 --- /dev/null +++ b/research/algernon/experiment_register.json @@ -0,0 +1,143 @@ +{ + "schema_version": "0.1.0", + "project": "Algernon-01", + "title": "Neural-net processor: a learning computer", + "registered_date": "2026-11-03", + "status": "registered_unrun", + "run_count": 0, + "observed_results": [], + "sources": [ + { + "name": "Qwenputer RV32", + "repo": "https://github.com/divagr18/qwenputer", + "revision": null, + "role": "compiled_exact_kernel", + "status": "external_unpinned" + }, + { + "name": "Qwen3.5-0.8B", + "repo": "https://huggingface.co/Qwen/Qwen3.5-0.8B", + "revision": "2fc06364715b967f1860aea9cf38778875588b17", + "role": "frozen_recurrent_substrate", + "status": "revision_identified_not_downloaded" + }, + { + "name": "Weightspace edit", + "repo": "https://github.com/RikiyaT/lm_understand-logs", + "revision": "4d09ba6d6a7e891dd8063974dfe81b3d78e3494f", + "role": "published_sparse_repair", + "status": "external_published" + }, + { + "name": "HybridTRMLDT", + "repo": "https://github.com/MoralityLabAI/HybridTRMLDT/pull/5", + "revision": null, + "role": "replication_and_old_recurrent_candidates", + "status": "draft_pr" + }, + { + "name": "Compactification Theory", + "repo": "https://github.com/MoralityLabAI/Compactification-Theory", + "revision": null, + "role": "adapter_bits_rank_precision", + "status": "present_repo" + } + ], + "reference_models": [ + { + "id": "qwen35_08b", + "model": "Qwen/Qwen3.5-0.8B", + "revision": "2fc06364715b967f1860aea9cf38778875588b17", + "device_target": "RTX 5080, WSL2", + "precision": "bf16", + "claim": "published base, unverified here" + }, + { + "id": "qwenputer_rv32_4b", + "model": "divagr1925/Qwen3.5-4B-Qwenputer", + "revision": null, + "device_target": "CPU reference first; GPU feasibility required", + "precision": "bf16 published", + "claim": "externally reported; no local execution" + } + ], + "hypotheses": [ + { + "id": "H-C", + "name": "Compiled circuit matches reference", + "status": "unrun", + "primary_metric": "exact_state_and_output_match", + "required_controls": [ + "independent_reference", + "corrupt_instruction" + ], + "decision_gate": "freeze source and trace cases before benchmark" + }, + { + "id": "H-R", + "name": "Recurrence supplies causal held-out gain", + "status": "unrun", + "primary_metric": "paired_group_accuracy_delta_with_compute", + "required_controls": [ + "base", + "zero_gate", + "shuffled_state", + "constant_state", + "equal_parameter_feedforward", + "equal_token_cot" + ], + "decision_gate": "freeze split, trained bridge, K and selected site before final test" + }, + { + "id": "H-W", + "name": "Sparse receiver repair helps a proven graft", + "status": "unrun", + "primary_metric": "paired_accuracy_gain_vs_matched_random", + "required_controls": [ + "base", + "published_fixed_patch", + "matched_random_patch" + ], + "decision_gate": "reproduce original patch first and freeze edit budget" + }, + { + "id": "H-J", + "name": "Compiled+learned processor exhibits joint benefit", + "status": "unrun", + "primary_metric": "joint_gain_vs_best_single_component", + "required_controls": [ + "compiled_only", + "recurrent_only", + "joint", + "shuffled_state", + "host_tool_oracle" + ], + "decision_gate": "pass individual component gates first" + } + ], + "site_candidates_08b": [ + 8, + 12, + 15, + 19, + 21 + ], + "recurrence_depths": [ + 0, + 1, + 2, + 4, + 8 + ], + "seed_for_roster_proposal": 20261103, + "dataset_splits_frozen": false, + "source_shas_frozen": false, + "quantization_validated": false, + "equipment_constraints": { + "gpu": "RTX 5080", + "gpu_vram_gb": 16, + "qwenputer_4b_rv32_bf16_reported_checkpoint_gb": 18.7, + "qwenputer_4b_rv32_reported_host_merge_ram_gb": 31 + }, + "known_architecture_limitation": "Qwenputer RV32 construction expects two value heads per key head; Qwen3.5-0.8B reportedly exposes one, so 4B's compiled core is not a drop-in 0.8B graft." +} diff --git a/research/algernon/inventory/__init__.py b/research/algernon/inventory/__init__.py new file mode 100644 index 000000000..90332ea7f --- /dev/null +++ b/research/algernon/inventory/__init__.py @@ -0,0 +1 @@ +"""Algernon checkpoint provenance tools.""" diff --git a/research/algernon/inventory/audit_inventory.py b/research/algernon/inventory/audit_inventory.py new file mode 100644 index 000000000..c9ad8f430 --- /dev/null +++ b/research/algernon/inventory/audit_inventory.py @@ -0,0 +1,162 @@ +"""Audit LoopedTransformers checkpoint inventory; deduplicate and require source-backed receipts. + +This is metadata validation. No checkpoint is loaded or called a graft candidate. +From the repo root: +python -m research.algernon.inventory.audit_inventory \ + --inventory research/algernon/inventory/checkpoint_inventory.json \ + --out runs/algernon/checkpoint_audit.json + +Optional: --receipts /local/receipts.json --logs-root /local/LoopedTransformers/experiments +A performance receipt qualifies only when its referenced log bytes hash-match. +""" +from __future__ import annotations + +import argparse +import hashlib +import json +from collections import defaultdict +from pathlib import Path + + +def check_sha(value, length=64): + return isinstance(value, str) and len(value) == length and all( + c in "0123456789abcdef" for c in value + ) + + +def tensor_parameters(tensors): + if not isinstance(tensors, dict) or not tensors: + raise ValueError("missing tensor shapes") + total = 0 + for name, shape in tensors.items(): + if not name or not isinstance(shape, list) or not shape or any( + type(d) is not int or d <= 0 for d in shape + ): + raise ValueError(f"bad shape: {name}") + prod = 1 + for d in shape: + prod *= d + total += prod + return total + + +def verified_receipt(receipt, checkpoint_sha, log_root): + """Return (valid, reason); require matching local log bytes, not log claims alone.""" + if receipt is None: + return False, "performance receipt missing" + if receipt.get("checkpoint_sha256") != checkpoint_sha: + return False, "checkpoint hash differs" + required = ("source_log_path", "source_log_sha256", "code_revision", + "dataset_id", "dataset_sha256", "split_sha256", + "optimizer_recipe", "recurrence_schedule", "evaluation") + if any(not receipt.get(k) for k in required): + return False, "performance receipt incomplete" + if not all(check_sha(receipt[k]) for k in + ("source_log_sha256", "dataset_sha256", "split_sha256")): + return False, "invalid 64-digit source hash" + if not check_sha(receipt["code_revision"], 40): + return False, "invalid full code commit SHA" + if not isinstance(receipt["optimizer_recipe"], dict) or not receipt["optimizer_recipe"].get("name"): + return False, "optimizer recipe absent" + if not isinstance(receipt["recurrence_schedule"], dict) or not receipt["recurrence_schedule"].get("steps"): + return False, "recurrence schedule absent" + ev = receipt["evaluation"] + if not isinstance(ev, dict) or ev.get("split") != "held_out" or type(ev.get("n")) is not int or ev["n"] <= 0: + return False, "held-out evaluation not documented" + if not isinstance(ev.get("metric"), str) or not ev["metric"]: + return False, "evaluation metric absent" + if type(ev.get("value")) not in (float, int): + return False, "evaluation score absent" + if log_root is None: + return False, "local log root needed for byte-level verification" + root = Path(log_root).resolve() + relative = Path(receipt["source_log_path"]) + if relative.is_absolute() or ".." in relative.parts: + return False, "log path escapes source root" + log = (root / relative).resolve() + if not log.is_relative_to(root) or not log.is_file(): + return False, "source log inaccessible" + h = hashlib.sha256() + with log.open("rb") as f: + for block in iter(lambda: f.read(1 << 20), b""): + h.update(block) + if h.hexdigest() != receipt["source_log_sha256"]: + return False, "source log hash mismatch" + return True, "source-verified candidate; model behavior still untested here" + + +def audit_inventory(inventory, receipts=None, log_root=None): + records = inventory.get("records") + if not isinstance(records, list) or len(records) != inventory.get("count"): + raise ValueError("inventory count differs from rows") + by_sha = defaultdict(list) + seen_paths = set() + for r in records: + if not isinstance(r, dict) or not check_sha(r.get("sha256")): + raise ValueError("invalid SHA in checkpoint inventory") + if type(r.get("bytes")) is not int or r["bytes"] <= 0: + raise ValueError("invalid checkpoint byte count") + rel = f"{r.get('experiment')}/checkpoints/{r.get('file')}" + if "/" in str(r.get("experiment", "")) or "/" in str(r.get("file", "")): + raise ValueError("invalid relative checkpoint path") + if rel in seen_paths: + raise ValueError("duplicate inventory path") + seen_paths.add(rel) + structure = r.get("structure") or {} + shapes = structure.get("tensors") + param_count = tensor_parameters(shapes) + by_sha[r["sha256"]].append((rel, r["bytes"], shapes, param_count)) + receipt_map = {} + for item in receipts or []: + if not isinstance(item, dict) or not check_sha(item.get("checkpoint_sha256")): + raise ValueError("bad receipt checkpoint hash") + key = item["checkpoint_sha256"] + if key in receipt_map: + raise ValueError("multiple receipts for one unique checkpoint") + receipt_map[key] = item + + grouped = [] + for digest, aliases in sorted(by_sha.items()): + if len({(n, json.dumps(s, sort_keys=True), p) for _, n, s, p in aliases}) != 1: + raise ValueError("same SHA reported with inconsistent shapes/bytes") + valid, reason = verified_receipt(receipt_map.get(digest), digest, log_root) + grouped.append({ + "checkpoint_sha256": digest, + "aliases": [a[0] for a in aliases], + "checkpoint_bytes": aliases[0][1], + "parameter_count": aliases[0][3], + "tensor_count": len(aliases[0][2]), + "performance_receipt_verified": valid, + "evidence_status": reason, + }) + return { + "schema_version": "0.1.0", + "execution_class": "repository_inventory_metadata_only", + "inventory_files": len(records), + "distinct_checkpoints": len(grouped), + "duplicate_aliases": len(records) - len(grouped), + "source_verified_graft_candidates": sum(x["performance_receipt_verified"] for x in grouped), + "checkpoint_groups": grouped, + } + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--inventory", type=Path, required=True) + ap.add_argument("--receipts", type=Path) + ap.add_argument("--logs-root", type=Path) + ap.add_argument("--out", type=Path, required=True) + args = ap.parse_args() + inventory = json.loads(args.inventory.read_text(encoding="utf-8")) + receipts = json.loads(args.receipts.read_text(encoding="utf-8")) if args.receipts else None + if isinstance(receipts, dict): + receipts = receipts.get("receipts") + out = audit_inventory(inventory, receipts, args.logs_root) + args.out.parent.mkdir(parents=True, exist_ok=True) + args.out.write_text(json.dumps(out, indent=2, sort_keys=True) + "\n", encoding="utf-8") + print(f"{out['inventory_files']} files, {out['distinct_checkpoints']} unique, " + f"{out['source_verified_graft_candidates']} evidence-qualified; {args.out}") + + +if __name__ == "__main__": + main() diff --git a/research/algernon/source_lock.json b/research/algernon/source_lock.json new file mode 100644 index 000000000..04fc9db0f --- /dev/null +++ b/research/algernon/source_lock.json @@ -0,0 +1,72 @@ +{ + "schema_version": "0.1.0", + "created_utc": "2026-11-03", + "status": "source_refs_pinned_no_cpu_upstream_run", + "sources": [ + { + "id": "qwenputer", + "repository": "https://github.com/divagr18/qwenputer", + "commit": "bec1a0c9654ac8151b6f36ed0154a19c53141384", + "source": "GitHub refs/heads/main, read 2026-11-03", + "test_entrypoint": "experimental/riscv/tests/test_rv_ref.py", + "status": "source_pin_verified_tests_pending" + }, + { + "id": "weightspace_logs", + "repository": "https://github.com/RikiyaT/lm_understand-logs", + "commit": "4d09ba6d6a7e891dd8063974dfe81b3d78e3494f", + "source": "GitHub refs/heads/main, read 2026-11-03", + "status": "source_pin_verified_edit_gpu_pending" + }, + { + "id": "checkpoint_inventory", + "repository": "https://github.com/MoralityLabAI/Compactification-Theory", + "commit": "319ce426ddb30b16a07ff4e5dae31590b95e2206", + "path": "research/algernon/inventory/checkpoint_inventory.json", + "source": "user-produced local inventory now committed to main", + "status": "metadata_verified_weights_not_loaded_in_this_environment" + }, + { + "id": "lotus", + "repository": "https://github.com/yingfan-bot/lotus", + "commit": "eb77e2f7909c5006f58ff0ad7cd6629b942caa9e", + "source": "GitHub latest visible commit, checked 2026-11-03", + "status": "source_pin_identified_model_reproduction_pending" + } + ], + "models": [ + { + "id": "qwen35_08b", + "hf_repo": "Qwen/Qwen3.5-0.8B", + "revision": "2fc06364715b967f1860aea9cf38778875588b17", + "status": "published_model_revision_unloaded" + }, + { + "id": "qwenputer_rv32_4b", + "hf_repo": "divagr1925/Qwen3.5-4B-Qwenputer", + "revision": null, + "status": "reported_model_not_locally_loaded" + }, + { + "id": "lotus_llama32_3b", + "hf_repo": "yingfanbot/gsm-lotus-llama3b", + "revision": null, + "status": "published_model_revision_unresolved_unloaded" + } + ], + "local_checkpoints": { + "source_directory": "LoopedTransformers experiments", + "git_revision": null, + "files": 77, + "distinct_byte_hashes": 59, + "redundant_aliases": 18, + "performance_receipts_verified": 0, + "status": "source_experiment_logs_and_checkpoint_bytes_not_accessible_in_current_container" + }, + "constraints": { + "qwenputer_rv32_test_command": "cd experimental/riscv && uv sync --extra hf && uv run pytest tests/test_rv_ref.py -q", + "source_available_in_container": false, + "model_gpu_runs_executed": false + }, + "note": "Version/commit pins are verified GitHub ref observations. Source-code and checkpoint SHA checks must be executed on the actual experiment host before model results are claimed." +} diff --git a/research/algernon/tests/test_exact_kernel.py b/research/algernon/tests/test_exact_kernel.py new file mode 100644 index 000000000..dc9b066b0 --- /dev/null +++ b/research/algernon/tests/test_exact_kernel.py @@ -0,0 +1,56 @@ +import unittest + +from research.algernon.exact_kernel import ( + SPLIT_FAMILIES, Task, compile_task, make_case, oracle_bfs, + run_compiled, run_suite, +) + + +class ExactKernelTests(unittest.TestCase): + def test_boundary_and_direction(self): + spec = Task(n=4, source=0, goal=3, edges=((0, 1), (1, 2), (2, 3))) + r = run_compiled(spec, compile_task(spec)) + self.assertTrue(r["reachable"]) + self.assertEqual(r["visited_mask"], 15) + rev = Task(n=4, source=3, goal=0, edges=spec.edges) + self.assertFalse(run_compiled(rev, compile_task(rev))["reachable"]) + + def test_repeated_edges_and_cycles(self): + task = Task(n=3, source=1, goal=0, + edges=((0, 1), (0, 1), (1, 2), (2, 0))) + result = run_compiled(task, compile_task(task)) + self.assertTrue(result["reachable"]) + self.assertEqual(result["visited_mask"], 7) + + def test_invalid_inputs(self): + with self.assertRaises(ValueError): + Task(17, 0, 0, ()) + with self.assertRaises(ValueError): + Task(3, 0, 0, ((2, 3),)) + with self.assertRaises(ValueError): + run_compiled(Task(2, 0, 1, ()), (0, 4)) + + def test_random_oracle_parity(self): + for family in {f for families in SPLIT_FAMILIES.values() for f in families}: + for i in range(200): + task = make_case(family, 209317, i) + a = run_compiled(task, compile_task(task)) + expected, mask = oracle_bfs(task) + self.assertEqual((a["reachable"], a["visited_mask"]), + (expected, mask)) + + def test_family_disjoint_and_determinism(self): + families = list(SPLIT_FAMILIES.values()) + for i, first in enumerate(families): + for second in families[i + 1:]: + self.assertTrue(set(first).isdisjoint(second)) + a = run_suite(seed=7, cases_per_family=3) + b = run_suite(seed=7, cases_per_family=3) + self.assertEqual(a, b) + self.assertEqual(a["n"], 15) + self.assertEqual(a["reference_mismatches"], 0) + self.assertEqual(len({r["id"] for r in a["records"]}), 15) + + +if __name__ == "__main__": + unittest.main() diff --git a/research/algernon/tests/test_inventory_audit.py b/research/algernon/tests/test_inventory_audit.py new file mode 100644 index 000000000..e7d190e4a --- /dev/null +++ b/research/algernon/tests/test_inventory_audit.py @@ -0,0 +1,65 @@ +import hashlib +import json +import tempfile +import unittest +from pathlib import Path + +from research.algernon.inventory.audit_inventory import audit_inventory + + +class InventoryAuditTests(unittest.TestCase): + def setUp(self): + self.digest = "0" * 64 + self.inventory = { + "count": 2, + "records": [ + {"experiment": f"run{i}", "file": "state.pt", "bytes": 100, + "sha256": self.digest, + "structure": {"tensors": {"block.weight": [2, 4]}}} + for i in range(2) + ], + } + + def test_dedup_and_no_unverified_promotion(self): + result = audit_inventory(self.inventory) + self.assertEqual(result["inventory_files"], 2) + self.assertEqual(result["distinct_checkpoints"], 1) + self.assertEqual(result["duplicate_aliases"], 1) + self.assertEqual(result["source_verified_graft_candidates"], 0) + self.assertEqual(result["checkpoint_groups"][0]["parameter_count"], 8) + + def test_bad_shape_fails(self): + self.inventory["records"][0]["structure"]["tensors"]["block.weight"] = [2, 0] + with self.assertRaises(ValueError): + audit_inventory(self.inventory) + + def test_inconsistent_same_sha_fails(self): + self.inventory["records"][1]["bytes"] = 101 + with self.assertRaises(ValueError): + audit_inventory(self.inventory) + + def test_source_verified_receipt(self): + with tempfile.TemporaryDirectory() as p: + root = Path(p) + (root / "experiment.log").write_bytes(b"measured on heldout") + receipt = { + "checkpoint_sha256": self.digest, "source_log_path": "experiment.log", + "source_log_sha256": hashlib.sha256(b"measured on heldout").hexdigest(), + "code_revision": "a" * 40, "dataset_id": "synthetic", + "dataset_sha256": "1" * 64, "split_sha256": "2" * 64, + "optimizer_recipe": {"name": "Adam", "lr": 0.001}, + "recurrence_schedule": {"steps": [1, 2, 4, 8]}, + "evaluation": {"split": "held_out", "n": 100, "metric": "accuracy", "value": 0.5}, + } + result = audit_inventory(self.inventory, [receipt], root) + self.assertEqual(result["source_verified_graft_candidates"], 1) + receipt["source_log_sha256"] = "f" * 64 + self.assertEqual(audit_inventory(self.inventory, [receipt], root)["source_verified_graft_candidates"], 0) + + def test_escape_root_rejected(self): + receipt = {"checkpoint_sha256": self.digest} + self.assertEqual(audit_inventory(self.inventory, [receipt])["source_verified_graft_candidates"], 0) + + +if __name__ == "__main__": + unittest.main() diff --git a/research/algernon/tests/test_register.py b/research/algernon/tests/test_register.py new file mode 100644 index 000000000..11137f7ee --- /dev/null +++ b/research/algernon/tests/test_register.py @@ -0,0 +1,39 @@ +"""Offline registration checks; never access a model or GPU.""" +import copy +import json +import unittest +from pathlib import Path +from research.algernon.validate_register import REGISTER, validate + + +class RegisterTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.data = json.loads(Path(REGISTER).read_text(encoding="utf-8")) + + def test_registration_passes(self): + self.assertEqual(validate(copy.deepcopy(self.data)), []) + + def test_cannot_claim_results_before_execution(self): + d = copy.deepcopy(self.data) + d["observed_results"] = [{"accuracy": 1}] + self.assertTrue(any("cannot claim executed" in s for s in validate(d))) + + def test_sources_require_full_sha_or_unpinned(self): + d = copy.deepcopy(self.data) + d["sources"][0]["revision"] = "not-a-git-sha" + self.assertTrue(any("invalid source SHA" in s for s in validate(d))) + + def test_controls_required(self): + d = copy.deepcopy(self.data) + d["hypotheses"][0]["required_controls"] = ["base"] + self.assertTrue(any("distinct controls" in s for s in validate(d))) + + def test_hypothesis_ids_unique(self): + d = copy.deepcopy(self.data) + d["hypotheses"][3]["id"] = "H-C" + self.assertTrue(any("hypothesis IDs" in s for s in validate(d))) + + +if __name__ == "__main__": + unittest.main() diff --git a/research/algernon/validate_register.py b/research/algernon/validate_register.py new file mode 100644 index 000000000..a7aa1cb4a --- /dev/null +++ b/research/algernon/validate_register.py @@ -0,0 +1,109 @@ +"""Check Algernon's experiment registration without downloading models or using a GPU. + +Run: python -m research.algernon.validate_register +""" +from __future__ import annotations + +import json +import re +from pathlib import Path +from typing import Any + +HERE = Path(__file__).resolve().parent +REGISTER = HERE / "experiment_register.json" +HEX_SHA = re.compile(r"^[0-9a-f]{40}$") + + +def validate(data: dict[str, Any]) -> list[str]: + """Return every registration problem. Incomplete source pins are allowed for planning.""" + problems: list[str] = [] + if data.get("schema_version") != "0.1.0": + problems.append("unsupported schema_version") + if data.get("project") != "Algernon-01": + problems.append("wrong project") + if data.get("status") != "registered_unrun": + problems.append("initial scaffold must be registered_unrun") + if data.get("run_count") != 0 or data.get("observed_results") != []: + problems.append("initial scaffold cannot claim executed experiments") + if data.get("dataset_splits_frozen") is not False: + problems.append("dataset_splits_frozen must be false until split hashes exist") + if data.get("source_shas_frozen") is not False: + problems.append("source_shas_frozen must be false until all source hashes exist") + + sources = data.get("sources") + if not isinstance(sources, list) or not sources: + problems.append("sources must contain a nonempty list") + sources = [] + names: set[str] = set() + for source in sources: + if not isinstance(source, dict): + problems.append("source must be an object") + continue + name = source.get("name") + if not isinstance(name, str) or not name: + problems.append("source name is empty") + elif name in names: + problems.append(f"duplicate source: {name}") + else: + names.add(name) + revision = source.get("revision") + if revision is not None and ( + not isinstance(revision, str) or HEX_SHA.fullmatch(revision) is None + ): + problems.append(f"invalid source SHA for {name}") + if not str(source.get("repo", "")).startswith("https://"): + problems.append(f"missing HTTPS source URL for {name}") + + hypotheses = data.get("hypotheses") + if not isinstance(hypotheses, list) or len(hypotheses) != 4: + problems.append("expected four registered hypotheses") + hypotheses = [] + ids = [] + for h in hypotheses: + if not isinstance(h, dict): + problems.append("hypothesis must be an object") + continue + ids.append(h.get("id")) + if h.get("status") != "unrun": + problems.append(f"hypothesis {h.get('id')} must remain unrun") + controls = h.get("required_controls") + if not isinstance(controls, list) or len(controls) < 2 or len(set(map(str, controls))) != len(controls): + problems.append(f"hypothesis {h.get('id')} needs distinct controls") + for key in ("name", "primary_metric", "decision_gate"): + if not isinstance(h.get(key), str) or not h.get(key).strip(): + problems.append(f"hypothesis {h.get('id')} lacks {key}") + if set(ids) != {"H-C", "H-R", "H-W", "H-J"} or len(ids) != len(set(ids)): + problems.append("hypothesis IDs must be H-C/H-R/H-W/H-J once each") + + sites = data.get("site_candidates_08b") + steps = data.get("recurrence_depths") + if sites != [8, 12, 15, 19, 21]: + problems.append("the registered site sweep changed") + if steps != [0, 1, 2, 4, 8]: + problems.append("the registered recurrence schedule changed") + + equipment = data.get("equipment_constraints", {}) + if equipment.get("gpu_vram_gb") != 16: + problems.append("document the VRAM assumption before changing it") + if equipment.get("qwenputer_4b_rv32_bf16_reported_checkpoint_gb", 0) <= equipment.get("gpu_vram_gb", 0): + problems.append("4B checkpoint VRAM warning lost") + + for required_file in ("README.md", "ARCHITECTURE.md", "PROTOCOL.md", "AGENT_WORKORDER.md"): + if not (HERE / required_file).is_file(): + problems.append(f"missing adjacent document: {required_file}") + return problems + + +def main() -> int: + data = json.loads(REGISTER.read_text(encoding="utf-8")) + problems = validate(data) + if problems: + for p in problems: + print(f"FAIL: {p}") + return 1 + print("PASS: Algernon-01 scaffold registered; no experiment reported executed.") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main())