Wheeler

Executable examples

Every checked-in .w file must pass both the compiler and the Tree-sitter grammar. Classical examples run on the VM. Quantum and hybrid examples use asynchronous QuantumTarget jobs on the ideal state-vector target. Before any example runs, its bytecode must complete a canonical round trip.

Each example has a fixed bound. It shows behavior that works today and names any limit it reaches. Rows that name core, compiler, runtime, or package-codec modules link to the canonical wheeler.core, wheeler.compiler, wheeler.runtime, and wheeler.packages sources. The example package uses their locked archives and keeps no duplicate copies. QFTProof.w is also the workspace's selected test target, so wheeler test . follows the normal package build and execution path.

Examples

Counter.w

Source: Counter.w.

Covers: Generated inverse calls, reverse-block order, kernel-checked generated-inverse theorem, and byte-identical compilation by the Wheeler-written bounded compiler.

Expected result: count = 0.

BinaryTree.w

Source: BinaryTree.w.

Covers: Fixed-capacity reversible tree slots.

Expected result: root = left = right = 0.

BootstrapControl.w

Source: BootstrapControl.w.

Covers: Typed signed and Boolean locals, expressions, branch joins, and a bounded counted for.

Expected result: sum = 10, branch = 1.

MinimalCompiler.w

Files: MinimalCompiler.w + compiler/Core.w + compiler/Graphs.w + compiler/GraphFour.w + compiler/GraphFourBranches.w + compiler/GraphFourDag.w + compiler/GraphFourMixed.w + compiler/GraphFourNested.w + compiler/graphs/SmallStructures.w + compiler/graphs/FourStructures.w + compiler/GraphFive.w + compiler/graphs/Plans.w + compiler/graphs/five/FiveFork.w + compiler/graphs/five/FiveBranches.w + compiler/graphs/five/FiveMixed.w + compiler/graphs/five/FiveForkMixed.w + compiler/graphs/five/FivePairs.w + compiler/graphs/five/FiveLongMixed.w + compiler/graphs/five/FiveDeepMixed.w + compiler/graphs/five/FiveNestedMixed.w + compiler/graphs/five/FiveNestedFork.w + compiler/graphs/five/FiveDag.w + compiler/Driver.w + compiler/frontend/Parser.w + compiler/frontend/modules/Headers.w + compiler/backend/StringTable.w + dedicated local-resolution, IR, token, scanner, code-generation, and encoding modules.

Covers: Wheeler compilation of one bounded minimal source grammar to canonical .wbc.

Expected behavior:

NativeModuleCompiler.w

Source: NativeModuleCompiler.w.

Covers: One binary frame containing a canonical little-endian u32 module count, zero through seven length-prefixed imported sources, and the remaining root source. Zero imports call the ordinary bounded compiler directly. One through seven call the matching bounded import API. Every path publishes only the verified artifact range. Zero no longer has to borrow a fake dependency and return it before lunch.

Expected behavior: One through seven signed and Boolean constant modules with private and forward dependencies substitute through unqualified and repeated canonical owner-qualified public uses without adding runtime state and match stage 0 byte for byte. The fixture covers every rooted tree topology over one through four imported modules, including direct stars, chains, balanced and uneven forks, mixed-depth branches, and a shared-dependency diamond. It also covers all 120 input orders of five direct imports, a five-module chain, a four-leaf fork, a three-leaf fork beside a direct import, one chain edge beside three direct imports, a two-leaf fork beside two direct imports, two independent chains beside a direct import, a three-module chain beside two direct imports, a four-module chain beside a direct import, a nested two-leaf fork beside a direct import, two nested fork levels, and a shared diamond with a side leaf. It checks all 720 orders of the six-module direct star, full chain, five-leaf fork, one three-leaf fork beside two direct imports, one nested two-leaf fork beside two direct imports, one uneven two-branch tree beside two direct imports, one fork beside one chain and one direct import, three independent chains, one three-module chain beside one two-module chain and one direct import, one chain edge beside four direct imports, one two-leaf fork beside three direct imports, one three-module chain beside three direct imports, one four-module chain beside two direct imports, and two independent chains beside two direct imports. Fourteen orders of each seven-module graph place every source in every frame position in forward and reverse rings. Closed graph plans select the two-module through seven-module forms before linking. Every two- through seven-module plan records exact edges, roots, topological order, private visibility, and shared-dependency facts before topology dispatch. Two- through seven-module chain and fork executors consume the planned source order instead of probing permutations. Every four- and five-module nested, mixed, paired, and shared form, the six-module root-branch forms, and the seven-module mixed form also consume exact role order. Input order does not affect the artifact. Imported constants also lower through generated reversible helper updates and their inverse bodies. A private name in the root, colliding exports, unsupported four-module DAGs, unsupported five-module graphs, unsupported executable imported members, mismatched module names, another or disconnected six-module graph, another or disconnected seven-module graph, eight imported modules, non-ASCII source, malformed framing, and linked source above 32,768 bytes publish nothing. Seven honest imports now fit as a direct star, a row, one exceptionally well-fed fork, a short chain with five wallflowers, a small fork with four, two chains with three bystanders, three chains and a spectator, one longer chain with four spectators, a nested two-leaf fork with three witnesses, a nested three-leaf fork with two witnesses, a deep nested fork with two witnesses, an uneven nested fork with two witnesses, two paired nested chains with two witnesses, an extended three-branch fork with two witnesses, a long branch fork with two witnesses, an asymmetric nested fork with two witnesses, a shared diamond with three witnesses, a shared diamond and side leaf with two witnesses, two serial shared diamonds, a three-leaf fork with three, a four-leaf fork with two, or a five-leaf fork with one. Pity the witnesses. The pile still needs a general graph planner.

FixedArrays.w

Files: FixedArrays.w + collections/FixedLongs.w.

Covers: Fixed immutable arrays, signed/Boolean scalar arrays embedded in records and variant payloads, nonescaping borrowed slices, locked core reductions, checked indexing, and structural equality.

Expected result: selected = 6, sum = 20, middleSum = 10, equal = 1, recordSelected = 7, variantSelected = 13.

FrozenUtf8.w

Files: FrozenUtf8.w + text/Utf8.w.

Covers: Strict byte-owner freezing plus locked core metrics/scalar inspection over nested nonescaping immutable UTF-8 parameter borrows.

Expected result: byteLength = 6, scalarCount = 3, middleScalar = 8364, valid = 1.

FiniteEnums.w

Source: FiniteEnums.w.

Covers: Compile-time scalar constants and a finite enum elaborated to a payload-free variant.

Expected behavior:

FunctionValues.w

Source: FunctionValues.w.

Covers: Signed/Boolean values, typed calls, right-associative logical negation, a callee loop, and a named compile-time constant used by a kernel-checked straight-line step bound.

Expected result: result = 10.

HostBinaryInput.w

Source: HostBinaryInput.w.

Covers: Explicit immutable byteview host input, arbitrary octet reads, bounded byte output, defensive input copying, and exact rewind.

Expected behavior:

HostInput.w

Source: HostInput.w.

Covers: Explicit bounded UTF-8 input and byte-output borrows with no ambient file/network access.

Expected behavior:

LoopControl.w

Source: LoopControl.w.

Covers: Early typed return plus bounded break and continue edges.

Expected result: sum = 12, selected = 7.

modules/ModuleMain.w

Files: modules/ModuleMain.w + Arithmetic.w + Collections.w + Results.w.

Covers: Exact source set, sorted imports, qualified calls and value types, private helper, and direct public function/record/variant/scalar-array/slice APIs. The exported ArrayBox carries a fixed scalar array across the module boundary.

Expected result: result = 18, decoded = 9, arrayValue = 5, arrayRecordValue = 6, sliceValue = 15, nominalArrayValue = 8, nominalSliceValue = 26, qualifiedVariant = 1.

NativeArtifactSetIdentity.w

Files: NativeArtifactSetIdentity.w + crypto/Sha256.w.

Covers: Exact bounded wheeler.artifact-set/1 JSON, one through eight sorted safe ASCII .wbc paths, canonical positive byte counts, lowercase SHA-256 fields, the domain-separated binary identity contract, embedded-identity verification, fail-closed publication, and exact rewind.

Expected behavior: A two-artifact manifest reproduces the stage-0 set identity. Unsorted paths, uppercase digests, forged identities, unknown profile keys, a ninth artifact, or input beyond 4,096 bytes publish nothing. This fixture validates manifest metadata. The stage-0 closed-tree command still verifies every physical .wbc before emitting those bytes. A manifest is evidence about files only after somebody checks the files. Film at eleven.

NativeBootstrapFeaturesIdentity.w

Files: NativeBootstrapFeaturesIdentity.w + BootstrapSyntax.w + crypto/ContentIdentity.w.

Covers: Exact schema-1 canonical YAML, the complete ordered seventeen-feature bootstrap-1 vocabulary, version 1 for every contract, complete SHA-256 publication, and exact rewind.

Expected behavior: The stage-0 feature manifest reproduces its identity. A renamed feature, changed version, missing final feature, or input beyond 2,048 bytes publishes nothing. A bootstrap feature list is closed evidence, not a buffet where the compiler leaves unsupported vegetables on the plate.

NativeBootstrapManifestIdentity.w

Files: NativeBootstrapManifestIdentity.w + BootstrapSyntax.w + crypto/ContentIdentity.w.

Covers: Exact schema-2 canonical recovery YAML, twenty-one lowercase identities, bounded profile syntax, stage-1/stage-2 equality, diverse-output and diagnostic equality, genuinely distinct toolchain/compiler identities, complete SHA-256 publication, and exact rewind.

Expected behavior: Complete fixed-point and diverse-compilation evidence reproduces the stage-0 manifest identity. A false fixed point, mismatched diverse output, shared alleged-independent toolchain or compiler, reordered field, or input beyond 2,048 bytes publishes nothing. The validator checks evidence relationships. It does not award independence points for wearing a false moustache.

NativeBootstrapModulesIdentity.w

Files: NativeBootstrapModulesIdentity.w + BootstrapSyntax.w + crypto/ContentIdentity.w.

Covers: One through 256 sorted local source modules, zero through sixty-four externals, 768 total imports, unique paths, complete binding, rooted reachability, cycle rejection, bounded names and paths, lowercase source identities, exact schema bytes, SHA-256 publication, and rewind.

Expected behavior: Empty-import one-module, two-external one-module, and three-, five-, nine-, and seventeen-module rooted DAG closures plus a sixty-five-module star and 128- and 256-module chains reproduce stage 0. A sixty-six-module star exceeds the per-module import bound. Nine-, ten-, and thirteen-module DAGs over sixty-four externals pin the 512-, 576-, and 768-import boundaries. Sorted module and external tables use bounded binary lookup. The parser checks a 769th edge before append, and a source guard test pins that check without commissioning a long rejection fixture. A cycle, unreachable module, duplicate path, 257th local module, sixty-fifth external, unsorted external, unbound import, mismatched root, uppercase digest, traversal path, or input beyond 131,072 bytes publishes nothing. The current physical compiler closure has 206 modules, 1,015 imports, and 90,455 canonical bytes. The packaged executable reproduces its stage-0 identity in 31,757,547 transitions. The 256-module native bound is still deliberately smaller than the 10,000-module schema. Pretending otherwise would merely give the graph a fake moustache too.

NativeCompilerLimitsIdentity.w

Files: NativeCompilerLimitsIdentity.w + BootstrapSyntax.w + crypto/ContentIdentity.w.

Covers: Exact schema-1 canonical YAML, all ten required positive compiler ceilings, canonical decimal spelling, the 1,073,741,824 per-field maximum, complete SHA-256 publication, and exact rewind.

Expected behavior: The documented bootstrap limits reproduce the stage-0 identity. Zero, a leading zero, an over-ceiling value, stray whitespace, or input beyond 512 bytes publishes nothing. A missing resource limit is not an exciting opportunity for dynamic defaults.

NativeCompilerOptionsIdentity.w

Files: NativeCompilerOptionsIdentity.w + BootstrapSyntax.w + crypto/ContentIdentity.w.

Covers: Exact schema-1 canonical YAML, bounded canonical profile names, both source-map values, complete SHA-256 publication, malformed-option rejection, and exact rewind.

Expected behavior: bootstrap-1 without source maps and native.test_2 with source maps reproduce stage-0 identities. A leading punctuation profile, unknown Boolean, stray space, or input beyond 256 bytes publishes nothing. Compiler options affect source identity. Treating them as command-line ambiance is how reproducible builds acquire folklore.

NativeToolchainIdentity.w

Files: NativeToolchainIdentity.w + BootstrapSyntax.w + crypto/ContentIdentity.w.

Covers: Exact schema-1 canonical YAML, all three closed toolchain kinds, four lowercase SHA-256 provenance identities, complete publication, and exact rewind.

Expected behavior: Recovery-seed, independent-stage-0, and host-source records reproduce the stage-0 identity of their accepted bytes. An invented kind, uppercase digest, reordered field, missing final LF, or input beyond 512 bytes publishes nothing. Calling a compiler "independent" is evidence only that the typist found the word.

NativeArchive.w

Files: NativeArchive.w + packages/archive/Archive.w.

Covers: Wheeler-native bounded .wpk framing with Wheeler-computed outer and entry-data SHA-256, one frozen and parsed canonical-YAML manifest, one or two sorted checked ASCII paths with exact target-source closure, and exact consumption.

Expected behavior:

NativeArchiveIdentity.w

Files: NativeArchiveIdentity.w + packages/archive/Archive.w + crypto/ContentIdentity.w.

Covers: Complete archive structure, payload and entry-data digests, embedded canonical manifest/source closure, final Wheeler SHA-256, stage-0 differential identity, fail-closed output, and exact rewind.

Expected behavior: A one-file canonical library archive matches the complete stage-0 archive identity. Outer-digest damage and input beyond 4,096 bytes publish nothing. An archive is not valid merely because its last 32 bytes look busy.

NativeLock.w

Files: NativeLock.w + packages/resolution/Lock.w.

Covers: Wheeler-native bounded snapshot-bound wheeler.package.lock.yaml parsing into caller-owned package and edge tables, with lowercase digest/name/version checks, package/dependency ordering, known-target validation, and exact canonical-byte publication.

Expected behavior:

NativeLockIdentity.w

Files: NativeLockIdentity.w + packages/resolution/Lock.w + crypto/ContentIdentity.w.

Covers: Bounded binary input, strict UTF-8 ownership, complete schema-3 lock validation, Wheeler SHA-256, stage-0 differential identity, fail-closed publication, and exact rewind.

Expected behavior: Empty and one-package locks produce the stage-0 identity. Two packages exceed this fixture's table, schema drift is still schema drift after hashing, and 2,049 bytes exceed its input budget. None publishes so much as a consolation nybble.

NativePlan.w

Files: NativePlan.w + packages/resolution/Plan.w + PlanIdentity.w.

Covers: Wheeler-native bounded binary build-plan framing, payload SHA-256, one-node field decoding, name/release/path checks, target kind, execution limits, and Wheeler-rederived node identity.

Expected behavior:

NativePlanIdentity.w

Files: NativePlanIdentity.w + packages/resolution/Plan.w + crypto/ContentIdentity.w.

Covers: Payload digest, node-identity rederivation, structural plan validation, final Wheeler SHA-256, stage-0 differential identity, fail-closed output, and exact rewind.

Expected behavior: One canonical tool plan matches BuildPlanCodec.identity. Payload-digest damage or input beyond 4,096 bytes publishes nothing. Rehashing a forged plan is not validation. It is stationery.

NativeSha256.w

Files: NativeSha256.w + crypto/Sha256.w.

Covers: Wheeler-written bounded SHA-256 over immutable binary input with caller-owned digest output and region scratch.

Expected behavior:

NativeBytecodeCodec.w

Files: NativeBytecodeCodec.w + compiler/verification/Codec.w + the native verifier modules.

Covers: Wheeler-native canonical identity re-encoding after complete typed structural verification. Canonical .wbc has one legal byte representation, so the encoder preserves every verified byte into caller-owned output and publishes only after verification succeeds.

Expected behavior:

NativeBytecodeIdentity.w

Files: NativeBytecodeIdentity.w + compiler/verification/Codec.w + crypto/ContentIdentity.w.

Covers: Complete typed artifact verification, canonical byte-for-byte re-encoding into private storage, final Wheeler SHA-256, stage-0 differential identity, fail-closed publication, and exact rewind.

Expected behavior: A bounded stage-0 artifact produces its exact content identity. Damaged magic and input beyond 4,096 bytes leave all 32 output bytes untouched. Hashing arbitrary bytes first and asking semantic questions later is a checksum utility, not a recovery boundary.

NativeCompilerIdentity.w

Files: NativeCompilerIdentity.w + compiler/Core.w + compiler/Graphs.w + compiler/GraphFour.w + compiler/GraphFourBranches.w + compiler/GraphFourDag.w + compiler/GraphFourMixed.w + compiler/GraphFourNested.w + compiler/graphs/SmallStructures.w + compiler/graphs/FourStructures.w + compiler/GraphFive.w + compiler/graphs/Plans.w + compiler/graphs/five/FiveFork.w + compiler/graphs/five/FiveBranches.w + compiler/graphs/five/FiveMixed.w + compiler/graphs/five/FiveForkMixed.w + compiler/graphs/five/FivePairs.w + compiler/graphs/five/FiveLongMixed.w + compiler/graphs/five/FiveDeepMixed.w + compiler/graphs/five/FiveNestedMixed.w + compiler/graphs/five/FiveNestedFork.w + compiler/graphs/five/FiveDag.w + compiler/Driver.w + crypto/ContentIdentity.w.

Covers: The importable Wheeler compiler driver, private canonical .wbc output, native verification, ranged SHA-256 publication, stage-0 differential compiler output identity, malformed-source rejection, and exact rewind.

Expected behavior: One canonically module-qualified Wheeler source produces the SHA-256 of the byte-identical stage-0 artifact without exposing private artifact storage. An unresolved operand or source beyond 4,096 bytes publishes no identity. The executable compiler wrapper and the importable driver use one implementation. Forks are useful for eating, not for bootstrap logic.

NativeVerifier.w

Files: NativeVerifier.w + compiler/verification/Verifier.w + compiler/verification/FunctionVerifier.w + compiler/verification/InstructionVerifier.w + compiler/verification/ProofVerifier.w.

Covers: Package-selected Wheeler verification of framing/payloads plus split instruction, operand-type, local-window, and branch-target checks over exact immutable binary .wbc input.

Expected behavior:

Compiler IR identities

Files: compiler/ir/Opcodes.w + compiler/ir/OpcodeKinds.w + compiler/ir/ResolvedStatements.w + compiler/ir/StatementKinds.w + compiler/ir/StorageOpcodes.w + compiler/ir/InstructionForms.w + compiler/ir/TypeCodes.w + compiler/ir/TypeKinds.w + compiler/ir/ProofRules.w + compiler/syntax/BooleanDeclarationKinds.w + compiler/syntax/EarlyReturnKinds.w + compiler/syntax/LoopKinds.w + compiler/syntax/calls/CallArgumentSources.w + compiler/syntax/calls/OneArgumentCalls.w + compiler/syntax/calls/TwoArgumentCallKinds.w + compiler/syntax/returns/EarlyReturnSources.w + compiler/syntax/returns/ResolvedEarlyComparisonKinds.w + compiler/syntax/returns/ResolvedEarlyResultKinds.w.

Covers: Public compile-time opcode/type/proof identities, interpreter bounds, and shared bounded opcode-family predicates.

Expected behavior:

NativeVm.w

Files: NativeVm.w + runtime/Interpreter.w + runtime/AggregateInterpreter.w + compiler/verification/AggregateVerifier.w + runtime/StorageInterpreter.w + compiler/verification/StorageVerifier.w + runtime/Utf8Interpreter.w + runtime/MapInterpreter.w.

Covers: Wheeler-written bounded interpreter for the self-hosted compiler artifact profile after Wheeler-native structural verification.

Expected behavior:

NativeDurabilityReceipts.w

Files: NativeDurabilityReceipts.w + runtime/io/Receipts.w + crypto/Sha256.w.

Covers: The fixed 163-byte wheeler-durability-receipt-1 identity, separate subject/profile/evidence digests, exact parent chaining, six monotonic file-publication stages, stage-specific evidence, namespace and quorum requirements, fail-closed output, and Java/Wheeler differential identity checks.

Expected behavior: Six independently bounded runs reproduce stage 0 from WriteCompleted through QuorumStable. The final identity is 1d4fb3a8521eaa451dd37734c7fa0017e44bb7a684c004026c7c1c90c3f4d8b5. A direct jump from write completion to file stability is rejected and leaves all 32 output bytes untouched. The fixture hashes one transition per VM run because a bound is a contract, not a dare.

NativeIoLifecycle.w

Files: NativeIoLifecycle.w + runtime/io/Lifecycle.w.

Covers: Wheeler-native bounded submission, exact work charging, terminal completion, cancellation-before-effect, known partial cancellation, late cancellation, uncertainty, resource release, exact reaping, scope closure, and fail-closed capacity. Caller-owned columns hold at most 64 operations. No provider handle or durability claim sneaks into the table wearing a fake moustache.

Expected result: four operations charge 23 work units, every terminal completion is reaped exactly once, completion-won and uncertain-after-cancellation relations remain distinct, a fifth submission is rejected without publication, and the scope closes. Complete VM rewind restores the empty tables and globals.

NativeSnapshot.w

Files: NativeSnapshot.w + packages/repository/Snapshot.w + Semver.w.

Covers: Strict schema-1 repository snapshot layout, empty snapshots, caller-owned coordinate rows, lowercase content identities, package ordering, full stable and prerelease semantic-version precedence, exact canonical republication, independent stage-0 decoding, and full VM rewind.

Expected behavior: Canonical views through eight rows publish unchanged. 1.2.0 sorts before 1.10.0, numeric prerelease identifiers are numbers rather than decorative strings, and stable releases follow their previews. A ninth fixture row or one extra space fails before publication. The parser loop admits more rows when you bring a larger table and enough history. Positive thinking summons neither resource.

NativeSnapshotIdentity.w

Files: NativeSnapshotIdentity.w + packages/repository/Snapshot.w + crypto/ContentIdentity.w.

Covers: Strict binary-input bounds, owned byte-to-UTF-8 freezing, canonical snapshot validation, Wheeler-native SHA-256 publication, Java/Wheeler differential identities, fail-closed output, and complete VM rewind.

Expected behavior: Empty and three-release snapshots produce the same 32-byte identity as stage 0. A fourth release exceeds this fixture's caller-owned table, malformed spacing is not canonical just because it hashes cleanly, and a 2,049-byte input is over budget. All three failures publish no digest.

NativeWorkspace.w

Files: NativeWorkspace.w + packages/workspace/Workspace.w.

Covers: Wheeler-native bounded wheeler.workspace.yaml parsing into caller-owned member tables, with schema/key checks, checked names and paths, ordering, uniqueness, nonnesting, and exact canonical-byte publication.

Expected behavior:

NativeWorkspaceIdentity.w

Files: NativeWorkspaceIdentity.w + packages/workspace/Workspace.w + crypto/ContentIdentity.w.

Covers: Shared bounded binary-to-UTF-8 ownership, canonical workspace validation, Wheeler SHA-256, stage-0 differential identity, fail-closed publication, and exact rewind.

Expected behavior: A sorted two-member workspace matches the stage-0 identity. A third member exceeds this fixture's table, schema drift fails, and 1,025 bytes exceed its input budget. Bad input gets a diagnostic, not a digest-shaped souvenir.

NativeManifest.w

Files: NativeManifest.w + packages/manifest/Manifest.w + ManifestTokens.w.

Covers: Wheeler-native bounded token parsing of canonical wheeler.package.yaml into caller-owned target/source/dependency/capability row tables, with closed schema/kinds, names, paths, releases, constraints, booleans, ordering, source closure, and exact canonical-byte publication.

Expected behavior:

NativeManifestIdentity.w

Files: NativeManifestIdentity.w + packages/manifest/Manifest.w + crypto/ContentIdentity.w.

Covers: Bounded binary manifest input, strict UTF-8 ownership, complete canonical validation, Wheeler SHA-256, stage-0 differential identity, fail-closed publication, and exact rewind.

Expected behavior: One canonical tool target produces the same manifest identity as stage 0. A second target exceeds this fixture's table, schema 2 remains the wrong schema, and 1,025 bytes exceed the declared input budget. None receives a participation digest.

LongMap.w

Files: LongMap.w + collections/LongMap.w.

Covers: Region-owned signed map using the locked core package's deterministic insert/lookup and membership API, nested exclusive mutable parameter borrows, and drop.

Expected result: selected = 17, zeroKey = 5, present = missing = 1.

OwnedReturns.w

Source: OwnedReturns.w.

Covers: Caller-region factories returning unique word, byte, immutable UTF-8, and signed-map owners through typed calls, followed by final-caller use and one consuming sink over all five owner kinds, stage-0/Wheeler interpreter parity, and exact rewind.

Expected result: wordValue = 17, byteValue = 65, scalarCount = 2, mapValue = 23.

Records.w

Source: Records.w.

Covers: Nested immutable records, typed record calls, fields, and structural equality.

Expected result: width = 5, equal = 1.

RecursiveValue.w

Source: RecursiveValue.w.

Covers: Recursive signed value call under frame and step ceilings.

Expected result: result = 6.

ReversibleResult.w

Source: ReversibleResult.w.

Covers: A checked relation over two preserved signed parameters bound through one exact signed local, the implicit caller-owned result slot, dedicated two-source binary-fill, call, and return instructions, and one generated-inverse certificate. Core conformance also commits VM history between the forward and inverse call. The Wheeler-native compiler emits the same computed helper, adjacent slot locals, generated bodies, computed-local collapse, and proof bytes as stage 0. Differential fixtures also select the first or second independent prelude without emitting discarded local state. The Wheeler-native interpreter executes both call directions and checks restored vacancy against the Java VM. The inverse recomputes both preserved sources for 34 + 8 instead of asking the debugger whether 42 looked familiar.

Expected result: observed = 42.

RegionStorage.w

Source: RegionStorage.w.

Covers: Consumed region-factory results, nested exclusive word/byte loans, one shared byte loan followed by resumed mutation, strict UTF-8 scanning, affine ownership, and explicit drop.

Expected result: first = 7, byteValue = 65, byteLength = 6, validUtf8 = 1, utf8Scalars = decodedScalars = 3, scalarSum = 8591, scratchValue = 19.

Utf8Lexer.w

Files: Utf8Lexer.w + lexer/Parser.w + lexer/Scanner.w.

Covers: An explicit host UTF-8 source scanned and parsed by dependency-first modules. The scanner creates region-owned identifier, number, punctuation, escaped ASCII literal, and line or block comment tokens. It supports digits after the first identifier character, bounded decimal, hexadecimal, and binary parsing, and stable diagnostic codes with byte offset, line, and column. A typed-local-declaration parser consumes those tokens.

Expected behavior:

Variants.w

Source: Variants.w.

Covers: The one-value Done completion type, ordinary done returns, closed tagged variants, compiler-owned Slot<long> presence, typed construction, structural equality, and exhaustive payload selection.

Expected result: selected = 9, equal = 1, presence = 11.

WorkQueue.w

Files: WorkQueue.w + collections/LongQueue.w.

Covers: Bounded FIFO over an exclusive word-buffer borrow with immutable cursor and explicit Full/Empty results.

Expected result: first = 4, second = 9, finalHead = 2, finalTail = 4, emptyObserved = fullObserved = 1.

CoherentOracle.w

Source: CoherentOracle.w.

Covers: One XOR function over classical and coherent data.

Expected result: bit = 0, measured = 1.

QFT.w

Source: QFT.w.

Covers: Quantum Fourier transform whose qreg size is a compile-time constant, with a generated adjoint and kernel-checked adjoint certificate.

Expected result: measured = 5.

QFTProof.w

Source: QFTProof.w.

Covers: Executable two-qubit inverse law.

Expected result: measured = 2.

QuantumOptimizer.w

Source: QuantumOptimizer.w.

Covers: Two target observations, reversible acceptance update, commit, and target-free replay.

Expected result: sample = 1, bestCost = 1, accepted = 1.

QuantumNeuralNetwork.w

Source: QuantumNeuralNetwork.w.

Covers: One-bit coherent activation layer.

Expected result: activation = 1, measured = 0.

QuantumCompiler.w

Source: QuantumCompiler.w.

Covers: Kernel-checked adjacent-inverse normalization plus basis-state execution.

Expected result: sourceResult = normalizedResult = 1.

SurfaceCode.w

Source: SurfaceCode.w.

Covers: Static correction kernel and generated adjoint.

Expected result: measured = 0.

Scope boundaries

No checked-in example uses the planned WIP-0032 unified I/O API. HostInput.w, HostBinaryInput.w, and the current asynchronous quantum jobs cover the smaller host boundaries that exist today. They do not implement IoScope, operation graphs, or durability receipts. The planned conformance fixture remains in WIP-0010 until a full vertical slice can compile, parse, format, and run.

BinaryTree.w uses three fixed state slots. Generic nodes, allocation, ownership, and unbounded traversal are outside its scope. Those features belong to the self-hosting language work.

QFTProof.w is an executable conformance law. The trusted proof kernel does not accept it as a theorem. It checks that the generated adjoint restores one basis state on the semantic simulator.

QuantumOptimizer.w uses deterministic basis candidates so CI can check exact observations. Its event-log test records both jobs, then reproduces the classical result through replay without another target call. Parameter binding, sampled objective estimates, and convergence loops remain separate work.

QuantumNeuralNetwork.w shows that one coherent reversible function can act as a classical activation and a quantum permutation. Training arrays, gradients, and floating-point optimizers are not part of this example.

QuantumCompiler.w checks one small compiler law in two ways. Its exact cancellation rewrite carries a kernel certificate, and execution checks the basis behavior. This fixture is separate from the larger self-hosted compiler effort.

SurfaceCode.w is static. A full syndrome loop needs measurement, reset, bounded decoding, conditional correction, and a target that supports dynamic resident control. Wheeler must reject that workflow on a static target. It cannot hide the cost of host round trips.

Running the suite

The canonical wheeler.package.yaml declares every example as a package target. Use the same commands to check them all:

./bootstrap/gradlew -p bootstrap :tools:wheeler --args='check .'
./bootstrap/gradlew -p bootstrap :tools:wheeler --args='test .'

See the development guide for the full gate. The normal check and treeSitterTest tasks cover every example. None is excluded as future syntax.