arcmix

Arcmix is a collection of generated Rust cases built around ARC — Answer, Reason, Check — producing answers, explaining them, and verifying them with explicit checks.

An ARC program does three things:

A useful way to read this repository is as teaching material for an LLM acting as a student programmer. The target is not a mysterious giant system that emits polished text. The target is a small program that can be written, inspected, rerun, criticized, and improved. In that teaching setup, the student should learn to produce code that answers a precise question, explains its reasoning in a compact witness, and then verifies the result with explicit checks instead of asking for trust.

That teaching angle matters because it pushes toward the right habits: keep the data explicit, keep the logic local, keep the question precise, and make correctness visible in the running artifact. The goal is not just to compute, but to compute in a way that stays easy to inspect, explain, and challenge. That is the practical value of the ARC approach: each run leaves an auditable trail instead of a black box. This follows the core ARC idea that trustworthy computation should be self-contained, repeatable, and verifiable at runtime.

ARC principles used here

These examples are organized around a few simple ARC principles:

In this repository, the programs are generated with GPT and iteratively refined under human guidance. They are specialized for speed, but they still follow the same ARC discipline: answer the question, explain the answer, and verify the answer. Rather than using a generic logical reasoner, arcmix uses generated, task-specific Rust cases that follow an Answer–Reason–Check discipline. That also makes them good exemplars for teaching or evaluating an LLM as a student programmer: the deliverable is not merely source code, but a runnable artifact whose reasoning and checks are visible at the interface.

Relation to Ershov’s mixed computation

There is a useful family resemblance between the ARC style used here and Andrei Ershov’s idea of mixed computation. In Ershov’s formulation, a computation can be split into a part that is carried out now, using the information already available, and a residual program that is left to run later on the still-unknown part of the input. In modern terms, that is closely related to partial evaluation and program specialization.

Arcmix is not a classical mixed-computation system, but it often follows a similar engineering instinct. Instead of shipping a large generic reasoner, it generates a smaller task-specific Rust artifact that has already absorbed much of the problem structure: the rules, the data layout, the query shape, and the expected checks. What remains is a compact executable that can run fast, expose its reasoning in a local form, and validate its own output.

The main difference is emphasis. Classic mixed computation is usually introduced as a way to specialize programs and obtain efficient residual code. ARC adds a stronger interface discipline around that specialized artifact: the program should not only compute the answer, but also present a short reason and perform explicit checks that can fail loudly. In that sense, arcmix can be read as borrowing part of the spirit of mixed computation while redirecting it toward auditable, benchmarkable, student-readable proof artifacts.

For readers who want the historical connection, see Andrei P. Ershov, Mixed computation: Potential applications and problems for study (1982), and the later literature on partial evaluation and mixed computation.

Why this style is useful

That structure has practical benefits:

What counts as a good Check

A good ARC check is not a decorative success message. It should be a concrete test that can actually fail.

In this repository, good checks try to have one or more of these properties:

That means the Check section is meant to resist self-certification. The best cases do not merely restate the main computation path; they challenge it.

Included cases

collatz-1000

A computational check of the Collatz conjecture in src/collatz_1000.rs.

It models:

control-system

A small rule-based control example in src/control_system.rs.

It models:

deep-taxonomy-100000

A specialized forward-chaining taxonomy benchmark in src/deep_taxonomy_100000.rs.

It models:

This version is specialized for speed and does not use a slower generic triple engine.

delfour

A Rust translation of Ruben Verborgh’s Delfour Insight Economy phone/scanner demo in src/delfour.rs.

It models:

euler-identity

An exact arithmetic version of Euler’s identity in src/euler_identity.rs.

This version uses direct integer arithmetic over a small ExactComplex type.

It mirrors the mathematical structure:

fibonacci

A direct Fibonacci computation in src/fibonacci.rs.

This version computes the requested values with iterative Rust and BigUint.

It prints:

goldbach-1000

A computational check of Goldbach’s conjecture in src/goldbach_1000.rs.

It models:

gps

A route-planning example in src/gps.rs.

It models:

The translation uses Rust concepts like City, Action, Stage, Description, and Route.

kaprekar-6174

A computational proof of Kaprekar’s constant in src/kaprekar_6174.rs.

It models:

matrix-mechanics

A toy matrix-mechanics example inspired by Werner Heisenberg’s matrix formulation in src/matrix_mechanics.rs.

It models:

pn-junction-tunneling

A toy PN-junction tunneling example inspired by tunnel-diode / Esaki-diode behavior in src/pn_junction_tunneling.rs.

It models:

transistor-switch

A toy transistor-switch example inspired by a BJT used as an ON/OFF switch in src/transistor_switch.rs.

It models:

polynomial

A quartic polynomial consistency check in src/polynomial.rs.

It models the two quartic outputs shown in the original example material and verifies:

odrl-dpv-ehds-risk-ranked

An ODRL + DPV + EHDS risk-ranking example in src/odrl_dpv_ehds_risk_ranked.rs.

It models:

path-discovery

A path-finding example in src/path_discovery.rs.

It models:

sudoku

A generic Sudoku solver in src/sudoku.rs.

It models:

Files

Run

The package name is arcmix, so a release build produces target/release/arcmix.

Default case:

cargo run --release

Explicit cases:

cargo run --release -- collatz-1000
cargo run --release -- control-system
cargo run --release -- deep-taxonomy-100000
cargo run --release -- delfour
cargo run --release -- euler-identity
cargo run --release -- fibonacci
cargo run --release -- goldbach-1000
cargo run --release -- gps
cargo run --release -- kaprekar-6174
cargo run --release -- matrix-mechanics
cargo run --release -- path-discovery
cargo run --release -- pn-junction-tunneling
cargo run --release -- polynomial
cargo run --release -- transistor-switch
cargo run --release -- sudoku

Structured JSON output for one case:

cargo run --release -- collatz-1000 --format json

Structured JSON output for the whole suite:

cargo run --release -- --all --format json

Snapshot management from the repository root:

cargo run --release -- show sudoku
cargo run --release -- show sudoku json
cargo run --release -- refresh
cargo run --release -- check

Stable output and snapshots

arcmix supports two stable output forms:

The recommended workflow is:

  1. keep the human-readable text output for people
  2. keep JSON as the canonical machine-checkable form
  3. store checked-in snapshots for both
  4. refresh snapshots only when a case intentionally changes

The arcmix binary handles this directly when you run it from the repository root. Because snapshots are regular files in the repository, intentional output changes show up as normal diffs in version control. If you add or grow a case, run cargo run --release -- refresh, review the snapshot diff, and commit it together with the code change.

cargo run --release -- refresh
cargo run --release -- check

What it does:

That gives a practical separation between:

This is especially useful for ARC programs because the output is part of the artifact: the answer, the reason why, and the executable checks are all meant to stay auditable and reproducible.

Snapshot layout

snapshots/
  text/
    <case>.txt
    all.txt
    list.txt
  json/
    <case>.json
    all.json

List available cases:

cargo run --release -- --list

Run all cases in sequence:

cargo run --release -- --all

ARC output style

Each case prints a short three-part story:

Where possible, the check section uses more than one line of evidence, so the program does not rely on a single computation path to certify its own output.

Each case run also reports elapsed time in milliseconds on stderr, with ANSI color for the timing line.