Wheeler

WIP-0010: Executable application portfolio

FieldValue
StatusDraft
OwnersWheeler language, compiler, runtime, quantum, proof, package, and documentation maintainers
Created2026-07-17
Updated2026-07-17
AreaExamples, conformance, applications, teaching
Depends onWIP-0001, WIP-0002, WIP-0003, WIP-0004, WIP-0005, WIP-0006
SupersedesNone
Superseded byNone

Summary

Wheeler's application portfolio is an executable conformance suite, not a collection of syntax samples. It must show reversible systems programming, coherent classical and quantum reuse, current hardware workflows, durable hybrid work, self-hosting, package management, native execution, and checkable claims.

Each application has one stated purpose and a clear implementation gate. A .w file enters the repository only after every construct it uses works across the compiler, typed IR, verifier, runtime or target planner, Tree-sitter grammar, tests, and docs. Fixtures label each transition as an inverse, logged rewind, barrier, coherent permutation, unitary or adjoint, measurement, replay, or retry. Success in one category does not prove another.

Designs that need future syntax stay in this WIP until their full vertical slice exists.

The portfolio goes beyond textbook quantum algorithms. Wheeler must also handle compilers, codecs, package resolution, transactional state, simulation, optimization, error correction, target planning, and long-running recovery. Each quantum example states whether it needs static circuits, batches, expectations, dynamic control, logical qubits, sessions, networking, or proof support.

Goals

Non-goals

Fixture contract

Every executable fixture provides:

  1. Wheeler source using the accepted profile.
  2. canonical .wbc round-trip coverage.
  3. Tree-sitter parsing without unexpected ERROR or MISSING nodes.
  4. deterministic expected state or a declared statistical test with fixed confidence and seed policy.
  5. target capability requirements and a negative planning test for missing requirements.
  6. replay and retry expectations when observations occur.
  7. explicit qubit, shot, event, memory, stack, and step ceilings.
  8. a concise reference entry explaining what the fixture proves and what it does not prove.

A formal fixture also identifies its trusted checker, claim schema, assumptions, and certificate bounds. A native or bootstrap fixture identifies its compiler, runtime, platform ABI, package lock, and reproducibility inputs.

No authored fixture file exceeds 1,000 lines. Larger applications are packages composed of smaller modules.

Current executable base

The repository currently executes these bounded fixtures:

These files are starting points. Their names remain stable when richer implementations preserve the same teaching role. Otherwise a new fixture gets a distinct name and contract.

Reversible systems applications

Reversible packet codec

ReversiblePacketCodec.w parses a bounded binary frame into a typed record and emits the identical bytes through its generated inverse. It covers byte slices, tagged variants, checked lengths, checksums, malformed-input results, and region cleanup.

Acceptance requires:

This fixture drives bootstrap strings, bytes, records, variants, and Result values.

Transactional persistent index

PersistentIndex.w implements a bounded ordered tree or B-tree page with insert, lookup, delete, transaction abort, commit horizon, and snapshot serialization. It replaces the fixed-slot BinaryTree.w role once owned allocation and aggregates exist.

Acceptance requires deterministic shape, no leaked nodes after abort, exact recovery from a persisted checkpoint, and stable encoding independent of allocation address.

Incremental dependency graph

DependencyGraph.w maintains module edges, detects cycles, invalidates affected nodes, and reverses a tentative graph update. It exercises deterministic maps, sets, work queues, tagged diagnostics, and transaction phases needed by the compiler and package manager.

Reversible image transform

ReversibleWavelet.w implements a bounded integer lifting transform and exact inverse over a small image tile. It demonstrates useful reversible arithmetic beyond control-flow examples. Property tests cover extremes, checked overflow, and byte-identical reconstruction.

Symplectic simulation

ReversibleOrbit.w advances a fixed-point symplectic integrator for a bounded two-body system and applies the exact discrete inverse to return to the initial state. It distinguishes reversible numerical integration from floating-point claims that do not survive rounding.

Event-sourced state machine

ReplicatedCounter.w reduces reordered and duplicated content-identified events, rejects conflicting sequence occupants, persists a checkpoint, and resumes without double application. It is a Wheeler implementation of the core event laws used by hybrid runs.

Compiler and toolchain applications

Wheeler lexer

compiler/lex.w decodes UTF-8, emits source-located tokens, and produces stable malformed-input diagnostics. Stage-0 and Wheeler token streams must match for the accepted corpus and generated whitespace/comment variants.

Wheeler parser

compiler/parse.w builds records and tagged syntax variants with bounded recovery. It compiles every portfolio source and matches the stable negative corpus. Tree-sitter remains a differential concrete-syntax implementation, not a linked parser dependency.

Bytecode codec and verifier

bytecode/codec.w reads and writes canonical .wbc. bytecode/verify.w rejects malformed control, type, resource, workflow, and quantum records. Stage output and diagnostics match the independent conformance corpus byte for byte where specified.

Self-hosting compiler

compiler/driver.w resolves, checks, lowers, verifies, and emits the compiler itself. The stage-1 and stage-2 artifacts reach the WIP-0007 byte-identical fixed point and compile every portfolio fixture supported by their declared profile.

Wheeler package resolver

package/resolve.w resolves workspace manifests against an identified registry snapshot. Randomized input and registry enumeration order produce one canonical lockfile and build plan. Conflict diagnostics carry a deterministic explanation chain.

Native runtime trace

runtime/transition.w executes the classical transition corpus and emits normalized semantic traces. Interpreted, native, and migration-oracle traces must match for forward execution, inverse calls, rewind, traps, and commit horizons.

Coherent algorithm applications

Width-explicit arithmetic oracle

ArithmeticOracle.w implements fixed-width modular add, compare, and controlled mark operations. The same functions run over classical values and lift to exact finite permutations. Exhaustive small-width tests compare every basis state and generated inverse.

This fixture is the gate for broadening coherent eligibility beyond XOR. Checked signed arithmetic is never substituted for modular arithmetic.

Reversible lookup oracle

LookupOracle.w marks keys in a small immutable table and uncomputes all workspace. It exercises coherent table access, ancilla ownership, clean-value checks, and resource estimates.

GroverSearch.w composes LookupOracle.w with diffusion and returns the marked key distribution. The ideal target test checks exact amplitudes for small instances and a seeded shot test checks a declared success threshold. The generated oracle inverse must clean every ancilla.

Quantum walk

QuantumWalk.w implements a bounded coined walk over a cycle or small graph. It exercises controlled reversible movement, coherent graph indexing, repeated unitary composition, and distribution comparison.

Phase estimation

PhaseEstimation.w estimates a phase for a unitary with known eigenstate. A static implementation covers controlled powers and inverse QFT. An adaptive implementation is a separate dynamic-target fixture with measurement-conditioned rotations.

Amplitude estimation

AmplitudeEstimation.w estimates a known prepared amplitude and records estimator uncertainty. It covers controlled coherent calls, repeated applications, result schemas beyond one basis outcome, and resource accounting.

Variational and sampled applications

Molecular energy

VqeHydrogen.w estimates a small molecular Hamiltonian with parameterized circuit batches and expectation results. The fixture pins the Hamiltonian, ansatz, optimizer policy, seeds, shot allocation, and confidence criterion.

Acceptance requires:

Graph optimization

QaoaMaxCut.w solves a small fixed graph. It exercises graph aggregates, parameter binding, commuting gate scheduling, expectation evaluation, and target-depth planning. The result contract compares objective value and observed cut distribution instead of one lucky sample.

Quantum kernel classifier

QuantumKernelClassifier.w builds a deterministic toy feature map, submits a symmetric kernel batch, and trains a bounded classical classifier. It checks batch identity, matrix symmetry, replay, and absence of quantum handles between jobs.

Parameter-shift gradient

ParameterShift.w submits paired parameter bindings, reduces results in canonical parameter order independent of completion order, and compares the sampled gradient with the exact simulator derivative.

Monte Carlo risk estimate

AmplitudeRisk.w encodes a small discrete loss distribution and estimates a tail probability. It states all approximation, fixed-point, qubit, shot, and confidence bounds. It doesn't claim an advantage from a fixture-sized instance.

Unified I/O application

I/O lifecycle conformance

IoFabricConformance.w will exercise WIP-0032 positional independence, structured operation ownership, bounded backpressure, cancellation races, deterministic replay, graph dependencies, and receipt separation over deterministic and bounded threaded backends. A companion negative fixture will reject operation leaks, early buffer reuse, hidden fallback, and receipt upgrades.

WIP-0032 owns every I/O type and method used by these fixtures. This portfolio WIP owns only the executable acceptance story. No .w file lands until the generic, ownership, effect, parser, bytecode, runtime, Tree-sitter, and package slices execute end to end.

Dynamic and fault-tolerant applications

Teleportation

Teleportation.w performs Bell preparation, mid-circuit measurement, classical conditions, and corrections inside one dynamic target region. Static targets must reject it with the complete missing-capability set. An ideal dynamic target checks all basis inputs and selected superpositions.

Repeated error correction

ErrorCorrectionCycle.w performs syndrome preparation, measurement, reset, bounded decoding, correction, and cycle reporting as a target-resident workflow. It upgrades the static SurfaceCode.w role when dynamic control exists.

Acceptance requires target-resident feedback capability, bounded decoder latency metadata, replayable host-visible cycle results, and explicit separation between logical correction and physical rollback.

Logical lattice operation

LogicalCnot.w expresses a logical operation and resource request without physical coupling-map assumptions. A mock logical target plans code distance, logical qubits, cycles, and failure budget. A physical static target rejects the semantic operation unless an explicit verified lowering is available.

Magic-state resource plan

MagicStateFactory.w composes logical resources, factory throughput, distillation error, and consumption schedule into a bounded target plan. It is primarily a type, unit, planning, and proof-certificate fixture. Ordinary CI uses a deterministic planner, not hardware.

Distributed Bell pair

DistributedBell.w requests networked entanglement between two target endpoints, persists session identities, handles delayed heralding, and discards a timed-out branch without treating cancellation as destroyed entanglement. It requires an explicit network/session capability and a mock target.

Blind delegated computation

DelegatedComputation.w separates client-owned secret preparation from provider execution and validates a bounded verification result. The fixture must state its protocol and threat model. Ordinary target metadata or redaction is not presented as cryptographic privacy.

Durable hybrid applications

Recoverable optimizer

QuantumOptimizer.w grows into a bounded iterative optimizer with typed parameters, parameterized batches, persisted continuation after each iteration, queued-job recovery, replay, fresh retry, and commit horizons.

The test suite stops and restores the run in queued, running, succeeded, failed, cancelled, and unknown states. Duplicate result delivery cannot apply an update twice.

Calibration-aware circuit compiler

CalibrationCompiler.w compiles a semantic circuit against an immutable target descriptor and calibration epoch, submits bounded calibration experiments, and rejects stale results unless policy explicitly accepts them. Provider data remains bounded target input. Credentials and provider objects never enter compiler state.

Adaptive experiment

AdaptivePhaseEstimation.w selects each next circuit from recorded prior observations. Replay follows the identical decision tree without target calls. Fresh mode may follow another valid branch. Completion arrival order cannot change batch reduction.

Hybrid workflow compensation

CompensatedExperiment.w combines a target submission with a mock external reservation or accounting effect. Abort before and after observation demonstrates cancellation, branch discard, declared compensation, compensation failure, and commit without claiming distributed physical rollback.

Long-running scientific campaign

ExperimentCampaign.w executes a bounded set of experiments over target descriptor epochs, persists after every result, applies budget limits, quarantines stale jobs, and emits a reproducible report from recorded observations. It exercises event cleanup while retaining live continuation references.

Certified adversarial schedule debugger

Murphy.w is the future WIP-0015 capstone. It searches finite distributed-protocol schedules in increasing length, reverses modeled event transitions through explicit witnesses, replays proposed failures deterministically, proves the violation and absence of shorter failures, and packages the reproducer. Empty samples, target timeout, and failed proof search return Inconclusive. They never establish safety. The future-system design remains documentation syntax until structured concurrency, finite protocol artifacts, replay packages, and general certificates execute.

Proof and certificate applications

QFT unitary certificate

QFTProof.w grows from an executable inverse law into a checked claim that its gate composition is unitary and its generated adjoint is exact. The trusted checker validates a bounded certificate over canonical circuit identity.

Circuit equivalence

CircuitEquivalence.w proves or exhaustively certifies that source and normalized circuits in QuantumCompiler.w have the same small-width unitary up to declared global phase. Larger claims require a specified proof method instead of simulator sampling.

Resource-bound certificate

ResourceBound.w checks symbolic and concrete upper bounds for qubits, ancillas, gates, depth, measurements, target cycles, event bytes, and retries. Target planning may rely on the checked certificate only when semantic region and compiler identities match.

Reversible function law

InverseLaw.w generates bounded inputs for a rev function and checks inverse(forward(x)) == x, clean ancillas, and unchanged borrowed state. Testing supports a claim but does not become a universal proof without a trusted exhaustive or symbolic certificate.

Package provenance

PackageProvenance.w verifies a package archive's member hashes, manifest identity, dependency lock, compiler identity, and build-plan provenance. Signature verification establishes namespace authorization. It does not establish semantic correctness of package code.

Bounded algorithm foundry

Foundry.w is the fault-tolerant-era capstone from WIP-0014. It searches a canonical finite grammar for the smallest reversible sorting network over eight 4-bit values. Each candidate execution is uncomputed, and the full 2^32-value input domain is checked. The run also checks certificates showing that no shorter candidate works, then publishes the winner as a proof-bearing package. Search samples are evidence only. Exact checking and the trusted kernel authorize the result. The future-system design remains documentation syntax until every dependency runs end to end.

Native and package applications

Hermetic workspace build

The Wheeler workspace builds compiler, runtime, package manager, tools, examples, and documentation inputs through wheeler with network disabled. Two clean builds produce identical canonical artifacts, lockfile, package archives, and plans.

Capability-denied build tool

CapabilityProbe.w is a negative tool fixture that attempts undeclared file, environment, clock, random, network, process, credential, and target access. Every attempt fails before the host effect and leaves no output.

Registry mirror

RegistryMirror.w verifies and mirrors immutable package objects by content identity. Random transfer order, interruption, duplicate delivery, and mirror path changes do not alter the resulting index snapshot.

Cross-target native execution

NativeMatrix.w is a package of small semantic kernels compiled for every tier-1 target triple. Native and interpreted normalized traces match. Native image identities remain derived from the same .wbc artifacts.

Teaching applications

The teaching track uses small fixtures with one primary law each:

A teaching example may share implementation modules with a portfolio application but keeps its entry point and expected result small enough to inspect manually.

Implementation policy

Portfolio work follows these rules:

Progress

Executable base

Reversible systems

Toolchain

Quantum algorithms

Dynamic and fault-tolerant

Unified I/O and durable hybrid

Proof, native, and packages

Testing and acceptance

Alternatives

Keep only minimal language examples

Rejected. Minimal fixtures do not force the aggregate values, effects, persistence, target planning, diagnostics, packages, and native execution needed by real programs.

Check in aspirational source files

Rejected. Unsupported .w files create a second fictional language. Planned programs stay in this WIP until executable.

Use benchmark kernels without expected semantics

Rejected. Performance data is useful only after a fixture defines correct output, traps, bounds, and effects.

Depend on live hardware for realism

Rejected. Deterministic simulators and lifecycle mocks establish semantics. Opt-in hardware runs provide operational evidence under explicit target and budget identities.

Open questions

Integration with reversible concurrency

Reversible concurrency fixtures

BakeryMutex.w implements one-shot bounded Lamport bakery with WIP-0039 tasks and SC atomics. It covers canonical scheduling, replay, exploration, deadlock, overflow, and exact rewind.

ReversibleBakery.w adds a WIP-0040 TaskScheduleWitness. Forward then source inverse restores application, task, atomic, ownership, control-witness, and schedule-witness state.

BakeryScheduleModel.w interprets a tiny finite schedule as reversible model data, marks a violation bit, and uncomputes cleanly. Direct coherent lifting of live bakery rejects.

A later BlackWhiteBakery.w covers repeated bounded entry after generic atomics and reversible control exist.

References