Jos De Roo

arclight

This repository contains eleven small, fast Rust ARC programs.

ARC stands for Answer • Reason • Check. An ARC program does more than emit a result. It gives:

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 handwritten and specialized for speed, but they still follow the same ARC discipline: answer the question, explain the answer, and verify the answer. 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.

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.

For CLI compatibility, the case name remains collatz-1000, while this version exhaustively verifies all starts from 1 through 10000.

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 the browser-side 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:

polynomial

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

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

path-discovery

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

It models:

Files

Run

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

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 -- path-discovery
cargo run --release -- polynomial

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

Stable output and snapshots

Arclight 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 root pilot.sh script is the main driver for this:

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 ./pilot.sh refresh, review the snapshot diff, and commit it together with the code change.

./pilot.sh refresh
./pilot.sh 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.