Landin the fixtures discuss source

Shared fixtures

Fixtures live here rather than under compiler/ada/ because they describe Landin, not the Ada implementation that currently checks them. When a stage is eventually rewritten, these must still be the tests it has to pass.

A few words have a fixed meaning in this guide and the documents that cite it. An oracle is the expected result a check compares with, written down before the run: an exit status, a trap, a byte stream or a debugger value; reader-facing documents call it the expected output. A lane is one runner configuration of the harness, one target's corpus on one kind of runner, as Lanes says; a CI job is a job of .github/workflows/gate.yml, which may run a lane, one --shard of it, one of the Cortex-M harness's three parts, or a board leg, one port on the rig. Evidence is what a run records that a result held, its transcript, verdicts and kept artifacts, and never an approval of a revision. A run narrower than the complete suite says so at the head of its transcript: FILTERED for exact selectors, HOST-ONLY for the Mac's --host, SHARD I of N for one shard, and NOT APPLICABLE for a selected fixture this lane does not run. D257 names a decision recorded in spec.md, and [1760] a numbered paragraph of tour.md or spec.md; refine explain D257 prints either's title.

Layout

compiler/tests/
  fixtures/<class>/<name>/fixture.meta   the fixture and its metadata
  harness-cases/malformed/               trees that must be rejected; see
                                         harness-cases/README.md
  fuzz/                                  a seeded corpus mutator that drives the
                                         server, and what it found; see fuzz/README.md
  server/<name>/session.lsp              a scripted language-server session, and its
                                         workspace; see "Language-server sessions"
  fixture_meta.py                        the fixture format's reader for every Python consumer
  fixture-meta.cases                     source: what a metadata text means, which both readers are held to
  registers.md                           source: the four evidence registers the matrices are generated from
  constructs.matrix                      generated: every [NNNN], its evidence and inventory
  diagnostics.catalogue                  generated: every code and its rule
  diagnostics.matrix                     generated: code contracts, emitters and owners
  guarantees.matrix                      generated: classified semantic boundaries
  conformances.matrix                    generated: conformance/evidence mechanisms
  prototypes.matrix                      generated: derivations, their oracles and target results
  targets.matrix                         generated: applicability of every fixture
  lexical.tokens                         generated: the scanned corpus
  layout.targets                         recorded: what each target measures
  lowering.ir                            recorded: every positive fixture, lowered

A fixture directory named r420-... or r630-... carries the number, without its dot, of the first roadmap's item that added it; that roadmap is closed, and a new fixture takes a descriptive name alone.

Generated and recorded are not the same word here. check.py writes the generated files and refuses each when it is stale; the last two are written by ./scripts/test.sh --record, because producing them means running compiler stages and asking the target model, which check.py cannot do. It will not tell you those two are stale — the harness and the gate will, and lowering/the recorded corpus is current names each fixture whose recorded IR differs.

Each recorded artefact is re-recorded on its own, so changing one does not rewrite the others; read the difference before keeping it, because a recording is not a verdict:

command rewrites
./scripts/test.sh --record lowering.ir, layout.targets and every server session
./scripts/test.sh --record=lowering lowering.ir alone
./scripts/test.sh --record=layout layout.targets alone
./scripts/test.sh --record=server/NAME the one session server/NAME/session.lsp
./scripts/test.sh --record=CLASS/NAME one recorded fixture's expect file, with what refine reports for it now
./scripts/test.sh --record-code=LNNNN the expect file of every recorded fixture whose report carries that diagnostic code, [LNNNN] as a report writes it: the reports a change to the diagnostic's text changes

--fixture-code=LNNNN selects the same fixtures as --fixture does, so after a diagnostic's text changes one run shows which recorded reports no longer hold and one records them. Either repeats, and may accompany its plain form; a code no report carries is refused rather than selecting nothing.

A fixture's report is rewritten only while refine still exits with its status and, for a positive, negative, runtime or ABI fixture, still reports its ordered codes, an empty list included when none are pinned; an end-to-end fixture carries no codes. Otherwise the command says which no longer holds and writes nothing, because those are the fixture's verdict and a recording replaces only bytes. ./scripts/dev-test.sh takes the same options.

constructs.matrix is the construct inventory: every construct either document defines, against what the corpus says about it. Each row also gives the strongest claim per product target, read from fixture metadata together with darwin/parity.json, cortex-m/corpus.json and driver/fixture.json; every named refusal with whether its note says the form is a recorded boundary, withdrawn or transferred to a named successor; and the state, applicable targets, gaps and open owner that the construct inventory records, whose disposition there explains the row. A full check.py refuses a missing, stale, unowned or unexplained row, and scripts/tests/test_construct_inventory.py proves each refusal fires. Regenerate it with python3 check.py --matrix.

Fixture classes, and the directory each uses:

class directory what it covers
unit unit a note of one behaviour an implementation-side case covers
positive positive a program that must be accepted
negative negative a program that must be rejected, with the codes it must produce and, where a code alone could hide a wrong refusal, the exact report
runtime runtime a program whose behaviour when run is the assertion
ABI abi emitted Landin assembly compiled with ordered C11 companions, then executed
end-to-end end-to-end the toolchain from source to result

The scripted source-debugger programs live in debugging/ and run through scripts/debug.sh, independently of the Ada fixture harness. The debugger metadata class has no directory; these sessions use debugger assertions rather than the harness's process-output fixture contract.

Focused developer runs

The harness can select suites, cases and fixtures by exact name. The developer wrapper combines that with checksum-based minimum recompilation:

./scripts/dev-test.sh --suite='fixture execution'
./scripts/dev-test.sh --case='harness/filters select exact cases'
./scripts/dev-test.sh --fixture=positive/variant-match-exhaustive
./scripts/dev-test.sh --fixture=negative/variant-match-duplicate
./scripts/dev-test.sh --fixture=runtime/variant-match-selects-tag
./scripts/dev-test.sh --fixture=abi/r440-smoke

--suite and --case repeat, so one run, with one build check, answers a change that reaches several suites; each case any of them names runs once, in the order a complete run sorts them, and the transcript begins with a FILTERED line for each selector:

./scripts/dev-test.sh --suite=fixtures --suite=harness \
    --case='parser/reports carry the pinned codes'

--fixture repeats too, and joins --suite and --case: the fixtures run in the order named, in the one case fixture execution/selected fixtures execute, and the transcript begins with a FILTERED fixture= line for each. A fixture another lane runs is not run, and the run ends with the command of each lane that does. --record=CLASS/NAME, and each other --record=, repeat likewise, so a change that adds ten fixtures records their reports in one run:

./scripts/dev-test.sh --fixture=negative/variant-match-duplicate \
    --fixture=runtime/variant-match-selects-tag --suite=fixtures
./scripts/dev-test.sh --record=negative/variant-match-duplicate \
    --record=negative/module-not-found

A case is named SUITE/NAME, its suite's name and its own as the transcript lists them. A suite or case nothing is registered under is refused before anything runs, with the rule and the three registered names nearest it, so a --case naming only core and the examples are formatted is answered with formatting/core and the examples are formatted. --cases=SUITE lists a suite's cases and runs none, one SUITE/NAME to a line as --case= takes it; it repeats, and --cases alone lists every suite's. With --host it lists what a host-only run registers.

./scripts/dev-test.sh --cases='fixture execution'

A fixture selector names one fixture as CLASS/NAME, its directory under compiler/tests/fixtures, of class positive, negative, runtime, abi, or any other discovered class whose fixture has a recorded expect. A class alone, or a name no fixture has, is refused before anything runs, with that form; --suite='fixture execution' runs every class's fixtures on the lane. A selected fixture runs the real scanner-through-backend path appropriate to its class, including assembling, linking and executing a runtime or ABI fixture. Every selected transcript begins with FILTERED, and an unknown selection fails: focused feedback cannot look like the complete suite by accident. A fixture this run's lane does not run, one whose targets: do not name the lane and whose args select no target of their own, is not a failure: the run says NOT APPLICABLE, names each of its targets with the command of the lane that runs it, and exits 0 having run nothing. On macOS use --host, optionally with one --suite or --case; native workload cases remain excluded and cannot be selected through that combination. --fixture and recording cannot combine with --host. Run Linux workloads on a native Linux host and Darwin workloads natively; a filtered run is never a verdict on the complete suite.

--shard=I/N, alone or with --host, runs shard I of N of the complete suite, so the gate can run one program on N hosted runners at once. Each ordinary case runs in exactly one shard. The few cases that loop over the corpus (fixture emission, runtime and ABI execution, the truncation sweep) run in every shard over that shard's share of their fixtures, and still count the whole corpus, so a fixture missing from the collection fails every shard. The transcript begins SHARD I of N; only all N together are the complete run, which the harness's shards partition the inventory holds them to.

Every run, filtered or not, writes one line to standard error as each suite ends, progress: lexer: 42 cases, 0 failed, 3.2s, so a complete run of half an hour says where it is while it runs and a stuck one is told from a slow one by the suite that stopped reporting; LANDIN_TEST_TIMINGS=1 adds the table of suites and slowest cases at the end. Neither is in the transcript on standard output, which is the same on every host.

fixture execution's two corpus-wide cases, which are most of a complete run, also write one line as each fixture ends: fixture: runtime fixtures execute: runtime/hello: pass (12 of 403), with FAIL for a fixture that failed a check. A fixture a cross-lanes row lists as failing on the host, and that failed only so, is pass here and has its own expected host failure line. These lines are the run's per-fixture verdicts, which the transcript's one row for the case is not, so a log shows that a given fixture ran on its lane; and they are its progress, so a stalled run is told from a slow one by the lines that stopped coming. They come in the order the workers finished and count them, so they stay out of the transcript, and scripts/parallel-equivalence.sh compares them sorted and without their counts while keeping the raw stream, whose path it prints before each run, as one-job.stderr and many-jobs.stderr.

./scripts/dev-test.sh --host runs every compiler case except the two native target-workload emission/execution cases. Its HOST-ONLY banner identifies the scope; compiler units, diagnostics and the complete IR golden remain included.

Lanes

A run executes one product target's corpus, its lane: the fixtures whose targets: name it are emitted, compiled, linked and run, and every other is left to its own lane. The lane is the compiler's own host (D257) unless --target=NAME names another, with refine's own name for it, so the same command is the Linux x86-64 lane on an x86-64 runner and the Linux arm64 lane on an arm64 one, and nothing in the harness asks the machine which. Either option may accompany any selection, and the counts a lane is held to are its own fixtures'. A recorded fixture whose args: name a target is that target's verdict whatever the host, and every lane runs it.

A lane that is not the host's is a cross run. Its transcript begins LANE CROSS NAME, every compilation names the target, and an executable runs through --runner=PROGRAM and links with --toolchain=DRIVER:

./scripts/dev-test.sh --target=linux-arm64 --runner=qemu-aarch64 \
    --suite='fixture execution'
QEMU_CPU=max,xtheadba=true ./scripts/dev-test.sh --target=linux-rv64 \
    --runner=qemu-riscv64 --suite='fixture execution'

That is QEMU's user emulation with a cross driver, which is evidence that the emitted code is right and none about the pinned toolchain on its own host. The gate does not emulate arm64: its arm64 jobs run the lane natively on ubuntu-24.04-arm, so the first command is the emulated stand-in for them. Its rv64-qemu jobs run the second command's lane under the flake's pinned QEMU with Ubuntu's cross packages. nix develop provides the whole cross lane, pinned by environments/pins.sh to the versions flake.lock's nixpkgs has: qemu-aarch64 and qemu-riscv64, the cross drivers and binutils under the triplet names refine asks for, aarch64-linux-gnu-gcc and riscv64-linux-gnu-gcc, each finding glibc's static libm.a, and a multi-target gdb-multiarch; so no --toolchain is needed there, and none of those tools has to be found by hand. On Ubuntu, QEMU needs QEMU_LD_PREFIX=/usr/riscv64-linux-gnu to find the cross loader. A level above the default runs only once the runner's own /proc/cpuinfo, read by a program the lane's driver links, confirms it: Features on arm64, and on RV64 the isa line, whose ISA string names each extension. QEMU's max RV64 CPU lacks T-Head's xtheadba, which QEMU_CPU adds. QEMU's user emulation also performs a misaligned RV64 load or store silently, so the lane cannot show that D410's packed fields move a byte at a time; --case='backend/RV64 packed fields move by byte' holds the emitted sequence to it instead, at none and at size.

Before a cross lane runs any program, the harness asks its runner to run a probe the lane's driver links, which asks Linux for a signal's action with a guard word after the record. An emulator that writes past Linux's record, as Ubuntu 24.04's QEMU 8.2.2 does for riscv64, would break every program that sets a signal disposition before it wrote anything, so it is refused by its name, the version it reports and that reason, and no fixture runs; fixture execution/a known-bad runner is refused holds the refusal.

An emulator is not the lane's own Linux, and a few fixtures fail under it for the host's reasons on every run. cross-lanes.json lists each one: the fixture, the runners it fails under, every failure line it may fail with, and why. Today those are a program that starts itself again by its own name, which QEMU runs only through a binfmt_misc handler (such a row does not apply where one is registered), and QEMU answering getsockopt(SO_RCVTIMEO) with a zero-length record. A listed fixture that fails only with its lines is reported on standard error as an expected host failure and not counted; one that fails any other way fails the run as a regression, and one that passes fails too, naming the row to remove. The listed failures are therefore told apart from a regression without building an unchanged compiler to compare with. A fixture selected with --fixture on the lane is held to its row the same way.

The gate runs the complete suite in both compiler modes: its Linux release job runs ./scripts/test.sh unfiltered, and compiler runs it with the debug compiler as three required --shard jobs, which together are the complete run. See the gate reference.

D213's r490-distinct-* fixtures cover exact base construction/extraction, opaque identity, no inherited operators or conformances, ordinary identifiers, generic/fixed identity keys, erased dispatch, origins and module image cycles. The two generic runtime fixtures run all six profiles; the module-image fixture checks scalar/float/atom images, arrays, nested records, slices, text and callback relocations. abi/r490-distinct-c-roundtrip crosses the native C boundary in both directions for integer, float, pointer and mixed C-record bases. The IR atom-image unit case accepts a member identity and rejects a stored identity absent from the field's set.

The construction regressions distinguish runtime field/payload/fill arguments from static type arguments. negative/r491-construction-type-arguments pins value diagnostics in module and local contexts. negative/r491-construction-type-fills pins expression diagnostics for type-only trailing fills and preserves recovery through later declarations. negative/r491-construction-static-address preserves the existing static-image address exclusion. positive/r491-construction-static-arguments retains generic type arguments, local addresses, value fills and a callback body that takes a local address. runtime/r491-variant-array-construction exercises small root, nested and wrapped arrays, repetition and later variant replacement. The checker and lowering seam cases separately assert case identities and verified storage paths; driver cases assert that refused source writes no output and invokes no tool.

The checker case nested calls retain flow effects uses paired small sources to pin labelled-call assignment checks, nested sink and try effects, descriptor reads and assignment-destination order. Slice descriptor reads preserve independent element liveness. It preserves unevaluated fixed-array measurements and separately checked anonymous bodies. The driver refusal case requires the corresponding invalid sources to produce one L0302 before any output or tool invocation, for both assembly and executable requests.

The checker case joined destinations keep escape obligations covers body-local joins of frame, parameter, module and untracked destinations, with accepted same-origin and escaping controls. Two driver refusal sources require one L0314 and no output or tool effects. assigned children cover element descendants checks whole-child initialization and branch containment in both orders, preserving independent siblings, indices and consumed leaves. These are small compiler checks; they neither assemble nor execute Landin programs.

try failures check reference cleanups checks origins on propagated failure after call arguments run. Its 14 small sources preserve escaping/static arguments, recovered calls, early transfers and success-path isolation while refusing frame/non-escaping references retained by failure cleanups. The driver refusal case also requires L0314 before any output or tool call.

negative/r491-operand-diagnostic-cascades pins one type diagnostic for each invalid float remainder or shift while retaining an independent integer division-by-zero diagnostic inside a refused operator.

runtime/r491-function-final-values covers statement prefixes followed by scalar, aggregate, array, pointer, slice, function and multiple-result values. It includes generic and anonymous functions, fallible calls, named assignments followed by none-returning calls or controls, and cleanup ordering. negative/r491-function-final-value-refusals preserves assignment, origin and complete-value checks. negative/r491-function-final-value-prefix preserves the grammar's exclusion of unconditional exits and unchecked regions from a final expression's statement prefix.

The platform cases native timeout stops descendants and native arguments and capture are preserved exercise the real host process adapter. The timeout witness in tool_process_probe.py forks one short-lived child and checks that it cannot write a delayed marker after the runner stops the group. These tests invoke no compiler, assembler or linker. Existing native cases retain ordinary exit, signal and default-capture coverage.

The readiness regressions cover static concept labels in both instantiation orders and a separately renamed receiver; computed callees retain unhandled/undeclared error diagnostics, inference, propagation and recovery. The driver exercises those refusals and over-limit binary chains with writes and tools disabled. The parser checks the binary-chain boundary and following-declaration recovery. A 4,000-link ordinary alias chain checks iterative settlement, and runtime/r491-cleanup-verifier-storage preserves pop-before-run behavior for 12 guarded cleanups across the standard profiles. Those fixed controls do not claim unlimited compilation size or linear cleanup expansion.

Optimization profiles and object quality

Every runtime and ABI fixture runs separately under none/off, size/off, size/auto and speed/auto (objective/specialization). Every runtime and ABI fixture explicitly records profiles: standard for those four, or profiles: specialization to add none/all and speed/all. The latter covers the generic, erased-dispatch and complete hosted workloads that need forced-specialization evidence. Policy travels with the metadata when a fixture is renamed; no part of its directory name selects coverage. Missing, duplicate, unknown or misplaced profile policy is a metadata error. A selected runtime/ABI fixture uses the same matrix. Artifact names and assertion labels include the profile. Each profile independently checks the original exact status, trap and output oracle; agreement with another profile alone is never success. Timeout never satisfies traps: yes.

The harness adds compiler controls directly, not through a fixture's args or run_args; profiles selects the harness matrix separately from the program's original request and oracle. --build-mode is a separate source-configuration axis, and building the Ada compiler in debug/release does not select an emitted-code objective either.

After the compiler build, ./scripts/quality.sh runs the Linux x86-64 numeric acceptance in quality/check.py. It requires LANDIN_GNAT_HOME and takes gcc, objdump and size from that checksum-pinned installation, not an arbitrary host PATH. It compiles and repeats each request, parses factual JSON, assembles the same output to ELF objects, measures sections, function bytes, prologue frames and disassembled instruction sites, and executes that same assembly against exact exit/stdout/stderr oracles. Its probes cover scalar chains and loops, a tiny leaf, compact large-array arithmetic with real stack-page touches, source-order layout, single-instance evidence specialization, a source-level two-instance size/speed threshold and final private-body folding. The specialization and folding probes also run none/all and speed/all. The complete derived-parser client runs all six quality profiles with its original input path, three ordered diagnostics and status 42. Repeated requests must produce byte-identical assembly and build reports, and the measured object must execute that original oracle. Its source inventory reaches the real parser and lexer; object measurements add no size or timing threshold. The complete derived-containers client runs all six profiles, preserving its status-42 and empty-output oracle. Its reports must identify real core container instances and factual specialization actions with retained evidence ABIs; forced specialization must actually select a container entry. Its object measurements are observations, not a new size budget or timing claim. The complete derived-hosted-memory application also runs all six quality profiles with its status-42 and empty-output oracle. Source inventories must reach its real application module; factual specialization reports and emitted indirect machine calls must preserve runtime provider dispatch even with forced specialization. Measurements remain object observations without a new size or timing threshold. The quality and debugger runners give these large rooted workloads a separate 900-second compiler-subprocess limit: its full-debug compilation already exceeds the ordinary 120-second limit on a native development host. Executable and debugger timeouts remain 120 seconds; slow compilation does not excuse a hung program or debugger. Existing insertion-sort and sieve-of-eratosthenes sources retain their original status-42 oracles; the other probes return zero. Scalar acceptance requires substantial stack-site, frame and instruction reductions, with no tiny-leaf growth or gratuitous callee-save overhead; existing workload text has a bounded regression allowance. Source threshold decisions are checked against both measured cost inputs and actual direct/indirect machine sites, including shared fallback bodies. The runner retains disassembly, symbol and size output and compiler/assembly/object hashes in JSON after all acceptance checks pass. The numeric bounds live in quality/check.py itself. The script writes actual observations to the selected build tree's quality/measurements.json; it never updates an acceptance bound or recorded fixture. Acceptance is the current command's zero exit, not the presence of this file: a failed rerun leaves an earlier successful observation untouched. This is structural/object smoke evidence, not timing or competitive benchmark evidence. A non-Linux host fails rather than claiming a skip as a pass.

Source debugger acceptance

After building the compiler, ./scripts/debug.sh runs the Linux source-debugger acceptance in debugging/check.py for this host's own Linux target, x86-64 or arm64; --target= naming the other runs it under QEMU's GDB stub, as cross evidence, with that triplet's readelf and strip and gdb-multiarch from PATH, which the nix shell provides, so ./scripts/debug.sh --target=linux-arm64 needs nothing more there. --qemu, --driver and --gdb name other tools.

debugging/workload-sources.json records every source each complete debugger workload is built from, and the GDB and LLDB sessions hold each build to it. A library file added to or removed from a module the workloads import changes it, so the test program's debugger workload inventories are their closures compares it on every run, from the build report the sessions read, and names each file added or removed and the command that rewrites the record, python3 compiler/tests/debugging/workload_sources.py --refine REFINE --write; without --write it only reports. debugging/workload-frames.json holds the routines each workload's stack holds at each stop, which the GDB sessions in debugging/check.py and the LLDB sessions in debugging/darwin_workloads.py both read, and the file that declares each one; the test program's debugger session frames are declared reads every routine there on every run, so renaming or removing one fails where the library changes and names the session, the stop and python3 compiler/tests/debugging/workload_frames.py --write, which finds a moved routine again. A renamed one is renamed in that file's stops. It uses GDB to test the emitted program's line information, breakpoints, stepping, stack frames and selected parameters and locals. At speed it debugs debugging/registers.ldn alone, stopping past the last use of variables speed may keep in registers, and reads them there, and inside a routine D339 copied into its caller, where the stop is the copy's own inlined frame above its caller's; REGISTER_STOPS in check.py names the ones each stop requires to be in a register. Routine debugger risk runs the full release matrix; milestones run it with both debug and release Ada compilers. The script fails if its tools or debugger operations are unavailable; missing debugger evidence is not a pass.

On native macOS arm64, use ./scripts/debug.sh --target=darwin-arm64 --output DIR with a fresh output directory. debugging/darwin.py checks the shared selected Linux source-debugging fixture under none/off, size/auto and size/all, plus all thirteen scalar types in darwin-scalars.ldn and, under speed/auto and speed/off, the register and inlined-frame stops in registers.ldn that the Linux lane makes. LLDB's SB API asserts source lines, stepping, nested caller values, represented aggregate/variant members, generic instances, source aliases and unavailable locals. It requires the packaged dSYM and a normal status-42 inferior exit; missing assertions or transport is a failure. --profile selects development feedback and cannot satisfy acceptance.

The runner retains source bytes, compiler/tool hashes, commands and exits, assembly, objects, executables, dSYMs, maps, DWARF verification/unwind dumps, UUIDs and LLDB transcripts. It checks mismatch refusal, comment-only identity changes, default/explicit none equivalence and stripped deployment without filenames or source breakpoint locations. Malformed identity controls run without a native debugger in scripts/tests/test_macho_identity.py. When debugging is selected, committed Mac acceptance requires all profiles and verifies their artifact identities; routine uses release and milestones use both compiler modes. --parity also runs the complete P2/P3/P4 LLDB workloads before these selected checks; see the native parity guide.

The complete derived-parser program runs in the same runner using none/off, size/auto and size/all. It receives the fixture's original input path and must produce its exact ordered diagnostics and status 42, including after stripping. GDB inspects initialized parser state, recursive source frames, recovery, nesting depth and the final success/failure flags. Its whole reached source inventory receives the same source-map, line-table and build-identity checks. check.py holds the complete P2/P3/P4 workload schedule to all three profiles.

The complete derived-containers program is another workload in that same runner, using none/off, size/auto and size/all. Source markers in its real containers_run path locate the sorted list and completed composition. Two concrete evidence_less calls use the same high-bit operand as signed and unsigned values, requiring opposite comparison results. GDB must identify each selected provider's frame and source line, verify the two unwind steps back to evidence_less and containers_run, and inspect the caller's completed result binding. The stack includes the application and entry point; acceptance does not depend on GDB automatically printing return values. The runner retains source maps, build reports and transcripts; it checks source hashes, line tables, stripping and exact executable identity for the whole reached library closure, not a fixture-only copy of it. The complete derived-hosted-memory application is another workload, using none/off, size/auto and size/all. GDB stops inside the runtime-selected sample_keep and text_emit providers, identifies their actual source lines, inspects the sampling state before and after its increment and the destination delivery cursor, and requires the caller stack to include process, run_logged, run and the fixture entry point. The whole memory-world application then completes its status-42 oracle. The same full source inventory, assembly hashes, executable identity, line-table, stripping and source-map checks apply to this application and its reached library closure. These sessions exercise ordinary any dispatch in the application; the real hosted I/O fixtures separately assert native process behavior. python3 compiler/tests/debugging/test_check.py exercises transcript refusals without GDB; scripts/debug.sh runs those regressions before the real sessions.

GDB ends a backtrace at the frame named main unless told otherwise, so a hosted Linux program's stack shows nothing below its main even though platform/linux's _landin_start and _landin_start_main called it. To see those frames in your own session, give GDB set backtrace past-main on before bt; the panic sessions in debugging/panic.py do, and assert _landin_start_main and _landin_start below main. The workload sessions leave the default, because the frames they hold are the program's own. LLDB shows every frame without a setting.

The stack switch has one debugger workload on every target: runtime/stack-switch-frames, which imports nothing, so firmware runs it too. Its stops are workload-frames.json's switch entry, which also names the two routines the compiler writes for a switch, landin.stack_switch and landin.stack_start (D469), and debugging/switch_frames.py makes each lane's commands and holds what the debugger showed: in the second fibre, after two switches, the backtrace is deepest, second_fibre and the start routine with nothing beneath it; and stepping each of two switches an instruction at a time, from the switch routine's first instruction past its return, the frames above it are the leaving context's until the instruction that loads the resumed stack pointer has run and the resumed context's from the next one on. debugging/check.py runs it with GDB at the three workload profiles on this host's own Linux target, or under QEMU's stub on the other (--workload=switch alone is a filtered run); rv64/check.py --kind=debugger on RV64, physically or with --qemu=qemu-riscv64; darwin.py through LLDB's SB API in debugging/lldb_switch.py; freebsd/check.py --kind=debugger with plain LLDB commands, which step a switch by the count of its instructions in the image, since FreeBSD's LLDB has no Python; and the Cortex-M lane's evidence, switch among its controls. debugging/test_check.py holds the verdict to refusals without a debugger.

Debug information and source maps record a library file as /landin-library/ and its module path (D422). The GDB sessions map that prefix to this checkout with set substitute-path, the Cortex-M sessions to the library copy they build from, and the source-map checks expect a library file under the prefix however its path was spelled when it was read. The parser workload's token kind is an atom set, which D423 describes as an enumeration, so the GDB and LLDB sessions read it by name, number and newline, not by its code.

The current Linux transport is native GDB on the native runner. The historical translated troubleshooting path uses --runner=qemu; --qemu=PATH selects the emulator explicitly. It stayed outside the development and acceptance loop of the macOS and Cortex-M work. This uses QEMU's GDB remote stub with the same assertions and reports its transport. It never turns a failed native session into a pass by automatically falling back to emulation.

Native report identity and build inventory

Cortex source debugging is a separate mandatory embedded lane under environments/cortex-m/evidence.py, invoked by run.py on native Linux. It uses --debug=lines, source/function/ordinary-frame assertions and fail-closed artifact selection, with no advertised variable/type interface. Complete-driver device execution, QEMU CPU/startup and independent exception/stack controls stay distinct. See the embedded evidence guide and target contract.

python3 compiler/tests/test_native_report_identity.py --refine ABSOLUTE_PATH checks real destination identities without substituting the fake filesystem. It retains the original collision/refusal and successful-output oracles for source and artifact links, absent leaves, actual symlink parents, case rules, dangling links and indeterminate identities. --directory optionally chooses another filesystem for the temporary cases. The gate runs it with both compiler build modes on Linux and on macOS. python3 scripts/tests/test_build_inventory.py exercises the production developer-build inventory decision, including C/header addition, removal and renaming, without invoking a builder; the gate's scripts job runs it with every other scripts/tests module.

On an unknown filesystem, two absent ASCII names that still differ after ASCII case folding are distinct, because no filesystem equates them; the platform suite holds that rule at the C boundary. Other absent names there remain conservatively indeterminate: a case-folded match, a non-ASCII byte, a ~ or :, or a trailing dot or space. In particular, a Linux container cannot infer the host volume's case rules from its virtiofs mount. For local object-quality measurements, put the runner's --output on the container's own filesystem (for example /tmp), then retain its measurements.json in the host build tree. This changes no source, profile, execution oracle or acceptance threshold; the native gate's ordinary scripts/quality.sh output already resides on its Linux filesystem.

Language-server sessions

Each directory under server/ is one scripted session of refine lsp: a session.lsp transcript and, if the session reads files the editor has not opened, a workspace/ tree, served under file:///workspace. The transcript is lines: -> and one JSON message the editor sends, <- and one message the server must send, byte for byte, pause where the editor waits and the server catches up, chunk: N to feed the input N bytes at a time, raw: and bytes for a frame that is wrong on purpose, # for a comment, and exit: N last, the status the session must end with. After a pause, disk: URI | BYTES writes a file, with the directories above it, and gone: URI removes a file, or a directory with what it holds, before the input resumes. link: URI | URI makes the first a symbolic link to the second before the session starts, with the directories above it; the link may be a file, a directory or a root, and the test program's fake host follows it as a path's last component and in the directories above that. Every message the server sends must be in the transcript, in order.

The server suite's every session runs as written case runs each transcript in the test program against the fake channel and filesystem. python3 compiler/tests/server/native_session.py --refine ABSOLUTE_PATH runs the same transcripts through the executable over pipes, with each workspace copied into a temporary directory and its URI written in place of file:///workspace; the gate runs it beside the native report identity, with both build modes on Linux and on macOS. Both runners take every directory under server/ as a session, apart from one whose name begins with . or _, and fail on a directory that holds no session.lsp: a transcript misnamed by a merge or a rename is a session nobody runs. A session whose workspace/ or library/ tree cannot be read whole fails too, and so does one whose tree holds an empty directory: Git keeps none, so a session that needs a directory with nothing in it would pass where it was written and fail in every clone. The refusal names the file to add, the one the transcript opens there; a session that needs the directory to be missing simply has none.

./scripts/test.sh --record rewrites every <- line with what the server sends now, as it does lowering.ir, and ./scripts/test.sh --record=server/NAME rewrites only the session named; read the difference before keeping it, because a recording is not a verdict. It replaces the messages of a session that ran and nothing else. A transcript that cannot be run yet, one with no exit: line, no final line end or a line that is none of its forms, is left as it is and the command says why and exits 1; so is a session that ended with another status than its exit: line names, since the status is the transcript's verdict and is changed by hand. A new session is therefore written with its -> lines and its exit: line, and recorded to fill in the <- lines.

Complete programs to try

The runtime fixtures include small, complete programs rather than only single-construct probes. Twenty-four of them are collected in examples.md, which a reader copies from, so each prints what it computes and returns 0, and its run_expect holds that output. check.py's RUNNING_EXAMPLES names them, and the page's listings are held to their sources byte for byte. Each example's section has exactly one landin fence, its program, and the page has no other, so check.py and the formatting test refuse a shorter snippet beside it; a c-shared source the program loads appears byte for byte in a c fence of the same section.

One more program on the page is firmware, which no host runs, so it is not a runtime fixture: end-to-end/example-firmware-serial, which check.py's FIRMWARE_EXAMPLES names. The fixture builds the program for cortex-m0 with its entry named, as a dry run that every host's test program compares; the Cortex-M lane's firmware suite builds it with the page's command in its example case, runs it under QEMU's microbit machine and holds what the serial port carried to the fixture's serial.txt. check.py holds the page's listing to the source, its text fence to serial.txt, and the lane to naming the fixture.

group fixtures
everyday tools line-count, example-sum-arguments, word-count, line-numbers, plugin-loading, directory-listing, run-shell, tree-copy, network-echo
printing and failures example-formatted-output, example-failure-words
classic exercises example-fizzbuzz, example-greatest-common-divisor, example-insertion-sort, example-binary-search, example-sieve-of-eratosthenes, example-run-length-encoding, example-merge-sort, example-sensors
Benchmark Game ports benchmark-game-fannkuch-redux, benchmark-game-mandelbrot, benchmark-game-fasta, benchmark-game-reverse-complement, benchmark-game-binary-trees

The example-* fixtures print, so they are hosted only. Each classic exercise also has a test of the same algorithm without the example- prefix, such as insertion sort: it prints nothing, checks its own result and returns 42, so it runs on every target, Cortex-M included, and the construct inventory counts it. FizzBuzz is the hosted exception, which prints and checks its tally.

The Benchmark Game ports use its published algorithms and run any input, but their fixtures run only the small correctness inputs; they are correctness and compiler-pressure workloads, not competitive benchmark targets. Their oracles are byte for byte the official fannkuch-redux, Mandelbrot, FASTA, reverse-complement and binary-trees outputs, and check.py holds each to its official digest.

On Linux x86-64, compile one of the status-42 tests from the repository root with:

refine compile --root=. --target=linux-x86-64 \
  -o /tmp/landin-insertion-sort \
  compiler/tests/fixtures/runtime/insertion-sort
/tmp/landin-insertion-sort
test $? -eq 42

.github/workflows/gate.yml compiles, runs and checks all twenty-three examples on each full gate run. The gate reference describes the verified explanatory-only reuse exception.

The test program validates its complete suite-name inventory before any selected or complete run. It rejects missing and unlisted suites separately from individual case selection. check.py also compares every suite source with its registration call and expected name, so dropping both a call and its expected name cannot silently omit a source package.

The metadata-only fixtures/repository fixtures are clean case compares Ada discovery with every fixture identity and target list in targets.matrix, which check.py generates independently. Missing, additional and duplicate rows fail, and the failure names the fixture and the row: a fixture with no row, a row with no fixture, a repeated row, or a row whose targets the fixture's targets: no longer says, beside what it says. Corpus runners separately compare their attempted programs, recorded outputs and runtime/ABI profiles with metadata-derived obligations, and require the positive, negative, runtime, ABI and recorded-output coverage categories they own to remain present. Malformed metadata stops those runners before they invoke a compiler. These are inventory and selection checks; individual verdicts and output oracles still decide success. Intentionally removing a fixture and regenerating the inventory still needs review of the semantic coverage that fixture provided.

Live Landin fences in the tour and prototypes also pass the independent lexical scanner, including the lowercase identifier rule. Historical findings and the tour's dropped-design section retain their original bytes and are excluded. This does not make the prototypes standalone programs: their documented omissions and future constructs remain. The tour's initialized-object and three-buffer acquisition examples are copied into positive/r491-tour-allocator-examples; check.py holds those two excerpts to the compiled witness. Its count is two bytes per buffer and validation only emits assembly text.

Metadata

fixture.meta is key: value lines, with # comments and blank lines.

key required meaning
class yes must match the directory the fixture sits in
summary yes one line, what the fixture proves
profiles yes for runtime and ABI only standard for the four baseline compiler profiles, or specialization for all six; independent of fixture name
levels no, and runtime only comma-separated CPU feature levels (D255), each some product target's, at which the program is also built and executed under every profile, the default level always as well; the paragraph after this table says which lane runs which and how a level is confirmed
level_status no, and only with levels comma-separated LEVEL=STATUS entries, each a level levels names: the status the program returns when built at that level, where its result is the level's feature fact; status otherwise
program yes for runtime, ABI, and a rooted positive or negative the .ldn program the fixture runs or uses as its compile-only corpus file
with no the rest of the Landin module, when one file is not enough; never a C source
root no a positive, negative, runtime or ABI fixture's import root, relative to its directory; the directory itself becomes the entry module
c-sources yes for ABI comma-separated, ordered C companion sources relative to the fixture directory
c-args no whitespace-separated C compiler and linker arguments for an ABI fixture
c-inputs no, ABI only, and only on a fixture whose targets name cortex-m0 alone comma-separated pinned input directories, each the first part of a devices/inputs.json name such as rp2040-cmsis, no two alike; the Cortex-M corpus fetches every .h pinned under each, verified by hash (scripts/fetch_inputs.py), and gives its C compiler -I for each cached directory (D985). The hosted harness reads no inputs, hence the target rule
c-shared no, and runtime or ABI only comma-separated, ordered C sources relative to the fixture directory, each built into a shared object of its own that the program loads; their paths are its first arguments, before run_args. A runtime fixture that names it says link: libc
c-archives no, and runtime only comma-separated, ordered C sources relative to the fixture directory, each compiled alone with the lane's C driver (-std=c11 -Wall -Wextra -Werror -fPIC -O2 -c) and archived alone as lib<stem>.a in its own directory of the fixture's work copy, a fresh directory holding the program and its with files, which refine compiles, so the program's linker.directory finds them; entries follow c-sources' path rules and no two may build one archive. A fixture that names it says link: libc and has no root
library-directories no, runtime only and only with c-archives comma-separated directories of the work copy, each relative and below it, no two alike, given to refine in order as -L <work copy>/<dir>, absolute, before the program
link no, and runtime only static or libc: how a hosted lane links the executable, passed as --link=; absent means the target's default, static on Linux. A program that calls the C library names libc. An ABI fixture is always emitted with --link=libc, because the C driver links its assembly with the C runtime
layout no, and positive, runtime or ABI only evidence: the fixture's layout is what it shows, so formatting/the corpus is formatted does not hold its sources to refine fmt's layout and scripts/add_fixture.py does not reformat them. A fixture whose constructs name [1750], the layout rule, is exempt without it
expect no the file holding the expected bytes, which fixture execution/recorded expectations hold compares and ./scripts/test.sh --record=CLASS/NAME rewrites
args no the arguments refine check is run with, or refine's own when the first word is a command, --version or --identify (D1464); for a rooted fixture, only the options before the module its root gives, such as --target=darwin-arm64
run_args no words handed to a compiled runtime or ABI program as written, before its run_files; it names no file of the fixture's
run_files no, and runtime or ABI only comma-separated files below the fixture directory, each handed to the program after run_args as a path to it wherever the lane put the fixture
stdin no a file below the fixture directory whose bytes a compiled runtime or ABI program reads as its standard input; without it the program's standard input is empty
run_expect no the file holding a runtime or ABI program's expected bytes on the selected stream
status no the exit status refine or a compiled program must produce (default 1 for a negative, 0 otherwise)
traps no yes if a runtime or ABI program must end without returning a status
trap_report no, and only with traps: yes D361's line the trap writes before it ends, main.ldn:4:9: trap: out_of_range, its file named relative to its module's root: some line of the program's output must be exactly it, wherever the lane put the fixture
stream no output (the bytes must be on standard output, and standard error must be empty) or merged (default)
lex no the exact complaint the scanner must produce, for a fixture whose fault is lexical
codes yes for a negative with a program the diagnostic codes the report must carry, in order, errors and warnings alike; on a positive, runtime or ABI fixture, the warnings its accepted program reports
constructs yes for a fixture with a program the [NNNN] ids, without brackets, this fixture is evidence about
targets yes comma-separated targets the fixture applies to
not_yet_emitted no, and runtime only comma-separated TARGET=CODE entries, each a target the compiler describes that does not emit what the program needs yet, which targets therefore leaves out, and the code it refuses the program with; the second paragraph after this table says how it lapses
fixed no for a negative with a program and codes: golden results after the first fix of every diagnostic that offers one is applied; a bare name is the program's result and source -> result another source's

A lane runs the levels of its own family: Linux x86-64 the x86-64 ones, Linux arm64 and Darwin the arm64 ones, the Cortex-M corpus the M-profile ones. A level runs only once the processor that runs the lane confirms every feature of it: a Linux lane reads /proc/cpuinfo, a native one its host's and a cross one as its runner presents it, through a C program the lane's driver links; Darwin asks sysctl. An unconfirmed level fails as UNVERIFIED rather than being skipped or inferred from another lane. On Linux arm64, which has no ISA note, the image built at a level is held to its LSE instructions and to no exclusive-monitor loop, and the default's image of the same fixture to no LSE instruction; on Linux RV64, which has none either, it is held to its Tag_RISCV_arch attribute naming each of the level's extensions, and the processor's isa line to naming them too.

A feature that lands one backend at a time leaves a runtime fixture off the targets that do not emit it yet, and not_yet_emitted says so instead of standing a counterpart in: not_yet_emitted: linux-arm64=L0500 on a fixture whose targets name Linux x86-64 and not arm64 says arm64 refuses the program with L0500 (D1308). fixture execution/targets not emitting yet still refuse compiles every such program for each target it names, to assembly from whatever host runs it, and requires a refusal carrying that code and no other, so the entry fails the day the target emits the program, naming the change that ends it: remove the entry and name the target in targets. Linux arm64's parity rule takes an entry for it in place of a linux-arm64/parity.json record, and refuses both at once; targets.matrix gives the entries after the targets; check.py holds each code to the catalogue; and fixture execution/a target not emitting yet lapses when it emits holds the check to holding, to a wrong code and to a target that emits. No fixture needs one today.

codes also says which stage refused the fixture, and that is what decides whether the grammar must derive its program. The frontend refuses what the grammar cannot derive, so a fixture whose first code the scan or the parse can raise must not derive; a later stage refuses source that parsed, so a fixture whose first code belongs to one of those must derive exactly as a positive fixture does. One parser rule is not the grammar's: end may repeat only the name it closes, which a context-free "end" identifier? cannot say, so a fixture refused for nothing but L0109 is derivable and must derive. check.py reads which codes the frontend raises out of Landin.Diagnostics.Lexical's fault map and the failures the parser names through Landin.Diagnostics.Syntactic, rather than out of the number, because the catalogue's own header forbids reading a stage off a code — L0010 began in lexical refusal and is now raised only by the parser.

A warning is pinned exactly as an error is. An accepted program's report is held to its codes: a positive fixture's emission, and a runtime or ABI fixture's compilation, must report exactly those codes in that order, and without the key must report nothing, so a warning nobody pinned fails there. A negative fixture whose report is only warnings says status: 0, since a warning never refuses a program; negative/mut-never-written and negative/unused-pure-local both exercise this case.

codes is an ordered list and not a set. Two refused constructs in one file are two reports, and a regression that doubles a count is invisible to a set, so a fixture that contains two refused uses names its code twice in source order. Spaces around comma boundaries are insignificant; the harness canonicalizes them without sorting the codes or removing duplicates. Both source-only and recorded negative executions compare that ordered list and the declared or default exit status. Recorded negatives also compare their exact report bytes, including those with args but no program.

Two cases check a report, and neither is in the fixtures suite, which holds metadata alone and passes while a recorded report is stale. --case='fixture execution/recorded expectations hold' compares every recorded fixture's exact expect bytes and status, and --case='parser/reports carry the pinned codes' every negative's ordered codes; --fixture=negative/NAME runs the first for one fixture. The first runs every recorded fixture whatever the ones before it did, and after their reports it names each fixture that failed together, with the one --record= command that re-records them. After a change that moves a report, run those two. check.py holds this paragraph to naming them, and every --suite or --case a document writes to being one the test program registers. float-literal-not-enabled names one L0301: its one literal is a float in an integer context, refused by the checker, so the grammar must derive it. check.py holds every name in codes to the catalogue, and refuses a negative fixture with a program that names none; the parser suite scans and parses the program and holds the report to the exact sequence.

A recording is refine's report with one difference. A location in a file outside the fixture's own directory, a library source the report cites, is recorded with * for its line number, in the location and in the gutter of the line it quotes, whose width is then the marker's:

  --> ../../core/text/text.ldn:*:1
  |
* | position_value: type = struct
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ declared without `public` here

The file, the column, the quoted line, its carets and every other byte stay exact, and a location in the fixture's own files keeps its number. So a library edit above the line, which only moves it, leaves every recording as it was, and one that changes the line's text, or what its carets mark, fails the fixtures that quote it. Both --record= forms write this form, and the test program (Landin.Testing.Reports) and Darwin's diagnostics lane (fixture_meta.recorded_report) compare it; a full check.py refuses a recording that still gives a library line its number, and fixture execution/a moved library line keeps its recording holds the rule to the driver's own reports.

with is how a fixture is more than one file. [1840] says the module scope is "every file compiled together", so a claim about it cannot be made by a fixture that can only name one; program stays the file the fixture is named for and with is handed to refine after it, in the order written. Naming the rest of a module with no program to be the rest of is a reported fault, and check.py holds every file either key names to being there — a name pointing at nothing would compile one file while claiming to have compiled two. Every .ldn in a fixture directory is held to the grammar already, so the extra files are derived like any other. C companions never belong in with; an ABI fixture names them only with c-sources.

fixed records the golden bytes for the first-fix pass. The fixes suite compiles the fixture as the parser suite does, requires its report to carry the ordered codes and at least one diagnostic to offer a fix, then applies the first fix from every diagnostic that offers one. Every edited source must have a recorded result, and its bytes must match; the resulting module must compile with an empty report.

The suite separately tries every later fix. For each alternative it keeps the first fixes of the other diagnostics, requires every edit of the selected fix to name a loaded source, applies its edits to all sources they name, and requires the resulting module to compile with an empty report. An alternative has no separate fixed golden. Multi-source edits are checked across the whole loaded module: no selected edit may be dropped, edits may not clash, and all affected sources are compiled together. A one-file or with fixture runs on a fake filesystem holding its sources; a rooted one reads its module closure from the repository, as its negative case does, with only the edited sources replaced. check.py holds every file fixed names to being there and every result to the grammar, however the original was refused, and the diagnostic matrix holds every code whose catalogue row admits a fix to at least one fixture that applies one. A result is named *.fixed rather than *.ldn, because an entry module is every .ldn in its directory and a rooted fixture's result would otherwise be compiled beside the program it replaces.

root is the directory-module counterpart for a positive, negative, runtime or ABI program. It is relative to the fixture directory; when present, the fixture directory is passed to refine as the entry module and the root is passed first with --root. It cannot be combined with with, because rooted discovery owns the source membership. A rooted positive or negative fixture must also name a nonempty program: that is the corpus file whose compile-only acceptance or refusal is counted. This is how compile-only fixtures and executable fixtures alike import repository-owned modules such as core/* without keeping fixture-only copies. The parser's exact-code case retains its fake filesystem for ordinary negative fixtures, but reads the real module closure for a rooted negative because its pinned report depends on those imports resolving. A negative whose recorded args name a --root= rather than a root key is rooted too: that case runs it with exactly those args, from compiler/ada as the recorded invocation runs, whether or not it also names a program, so nothing has to be left out of its metadata to keep it off the fake filesystem.

root names one root. A fixture that needs several, in order, writes them and its entry module in args instead, each a path from compiler/ada, as negative/empty-first-directory-hides-a-later-root does: --root=../tests/fixtures/negative/NAME/first --root=../tests/fixtures/negative/NAME/second ../tests/fixtures/negative/NAME/entry.

A rooted fixture's args never name its module: the harness passes them first and then --root and the fixture's directory, and refuses an args word that does not begin with - or that is a --root=, the first word excepted when it names a command. So args is how a rooted negative selects its target, and with --target= in it the fixture is that target's verdict on every lane, as a recorded one is; such a negative needs no expect, since its ordered codes are compared at that target, and expect beside root needs no args. negative/rooted-negative-selects-its-target pins a refusal particular to Darwin through a module that imports platform/linux. A root of . is passed as the fixture's directory as it is spelled.

An ABI fixture requires program, c-sources, constructs, and targets. c-sources is a comma-separated ordered list. Every entry must be a portable, slash-separated relative path ending in .c, must contain no backslash or colon, must remain below the fixture directory (no absolute, empty, . or .. component), and must name a file that exists. The list is passed to the target driver in the order written. c-args, when present, is a whitespace-separated argument-vector suffix; no shell interprets it. Both keys belong only to ABI fixtures, duplicate keys or C source paths are faults, and C source files in with are faults.

c-args are written once, as GCC and GNU ld read them, and LLVM's lld reads the same. A target whose linker spells an argument another way says so in c-args.targets, one line per spelling: the target, the argument as written ending in NAME, which stands for the symbol it names, and the argument that target's lane passes, with NAME replaced by that symbol. Today it has one line, for Darwin, whose ld64 has no --wrap: -Wl,--wrap=open is passed as -Wl,-alias,___wrap_open,_open, which makes _open the wrapper as --wrap would. An argument no line names is passed as written. The test program reads the file through Landin.Testing.Fixtures.C_Args_For and every Python lane, Darwin's parity run among them, through fixture_meta's c_args_for, so a fixture's Darwin verdict does not depend on which runner gives it. fixture-meta.cases' c-args@TARGET fields hold both readers to the same spelling.

c-shared names C sources the harness builds into shared objects for the program to load while it runs, as platform/posix.open_library does. Its entries follow c-sources' path rules, and no two may share a stem, which names the object. Each lane builds every one with its own C driver, the one it links the program with, before the program runs, with -std=c11 -Wall -Wextra -Werror -fPIC and the optimization its C peers get, and -shared on Linux and FreeBSD or -dynamiclib -Wl,-undefined,dynamic_lookup on Darwin, so that an object may leave a symbol for the loader to find in another, as an ELF shared object may. c-args does not reach them. The object is named for its source's stem and the executable it serves, beside it: <executable>-<stem>.so, or .dylib on Darwin. The program is given their paths as its first arguments, in metadata order, before run_args: an absolute or harness-relative path on the Linux and Darwin hosts, and the guest's or the RISC-V machine's own path where a lane carries the objects there with the executable. A runtime fixture that names c-shared must link with the C library, link: libc, because a static Linux program has no loader (D280). runtime/posix-libraries is the first.

The ABI harness runs refine for Linux x86-64 with the Landin inputs followed by --target=linux-x86-64 --emit=asm --link=libc -o <assembly>, because the driver links that assembly with the C runtime and its C peers. It then selects Driver_For (Linux_X86_64, "") and invokes that driver once with arguments in this exact order:

<assembly> <c-sources in metadata order>
-std=c11 -Wall -Wextra -Werror -no-pie
<c-args in metadata order, spelled for the target> -o <executable>

The resulting executable may get main from Landin or from a C companion. The harness passes run_args and the stdin file, compares run_expect with the selected stream when it is present, and then compares either the exit status or the non-returning traps: yes verdict. Thus a C main can drive exported Landin routines, and a Landin main can drive imported C routines, without adding C inputs to the product compiler. Runtime and ABI fixtures honor stream: output by capturing stdout and stderr separately: stdout must match run_expect when present, and stderr must be empty even without an output file. The default merged policy preserves combined bytes. Recorded compiler expectations use the same stream contract.

The Cortex-M corpus runs an ABI fixture its inventory row says executes (D985): it compiles the program to assembly as a runtime fixture's, and each c-sources entry with the pinned arm-eabi-gcc at the level's processor and float flags, -ffreestanding -nostdlib -std=c11 -nostdinc -fno-short-enums -Wall -Wextra -Werror, GCC's own freestanding headers, the fixture directory and each c-inputs directory, then the c-args. The harness links them with the program and the four routines GCC requires of a freestanding environment, and the exit status or traps verdict is read by its debugger session. No C library is linked, so a fixture whose C names one is a restriction row that says so (the corpus inventory).

constructs is what the construct matrix indexes the corpus by, and it is a written list rather than a reading of the summary. A citation in prose is prose: it is there to explain the fixture to a person, it may name a paragraph the fixture merely mentions, and a heuristic over English is how a check ends up believing 114 lines of it were code. check.py holds every id to a paragraph tour.md or spec.md actually defines, and the harness holds it to being four digits — the two halves of the question, asked by the side that can answer each.

The decision register's Pinned by paragraphs are different: those paths are the current evidence they promise a reader, so check.py holds every named fixture directory to existing. Historical prose may still name a retired fixture when the retirement is the point; a live evidence list may not.

Name a construct when the fixture's passing would change if that construct were implemented wrong, and not when the construct merely appears in the text. Every runtime program contains literals, so naming [1770] everywhere would make that row read "covered" while saying nothing; a fixture whose asserted values come from literals earns it. The failure this rule prevents is the one a matrix is most prone to: a full column that means nothing. When a claim turns out not to be earned, the honest repairs are to drop it or to make it true — runtime/statements-run-as-they-read claimed [1840] before it declared anything inside an arm, and grew a function that does. The construct audit dropped [1550] from four fixtures whose passing another backend would not change, and [1730] from two that could not observe an elided check, and added [1570] to the firmware driver, whose interrupt handlers execute on Cortex-M. A claim that would fit every fixture discriminates none.

A fixture with a program must name at least one, because a .ldn program is written in the language and is therefore evidence about some construct of it. A fixture without one is about the tool rather than the language — an unknown option, the identity text, an implementation-side note — and names none for the same reason. A construct the kernel does not enable yet is perfectly good: negative/convention-not-enabled names [1830] for the refusal and [0900] for the thing being refused, and [0900] is a paragraph about a construct no fixture can yet use.

targets is required, and check.py holds each name to the targets the target applicability register allows: the product targets linux-x86-64, linux-arm64, darwin-arm64, freebsd-x86-64, freebsd-arm64, linux-rv64, windows-x86-64, windows-arm64 and cortex-m0; xtensa, the Xtensa firmware target; rv32, the RV32 firmware target, which is no product target (D840); and synthetic-32, the 32-bit model that preceded the Cortex-M backend. A name outside that list is refused, because that is how a fixture quietly stops applying to anything. A fixture naming rv32 is held to a run there: a compile-time one's args select --target=rv32, and a runtime or ABI one has a row in cortex-m/corpus.json that one of the firmware corpus's RV32 lanes, esp32c3 and sifive-e, executes, since those lanes are the only runs of a program on RV32 and the lane a --fixture= run's NOT APPLICABLE note names for it.

Each target is spelled exactly as refine --target= spells it, so a fixture's targets: can be handed to the compiler one name at a time. The metadata once said macos-arm64 and cortex-m, the lanes' names, and every reader that emitted a fixture for the targets it listed had to translate two of them; they were renamed when three agents in a row met the refusal. A lane keeps its own name — the cortex-m gate job, compiler/tests/cortex-m/, the darwin-* jobs — and cortex-m survives in the construct inventory only as a scope, the Cortex-M family a construct is accounted for on, which holds cortex-m0 alone today and will hold each Cortex-M target added later.

linux-arm64 is the Linux arm64 lane's own name and its driver name alike, so a fixture whose args: select --target=linux-arm64 names it, and one that names it is run by that lane with the target its args choose, or the lane's own when they choose none. A runtime or ABI fixture the Linux x86-64 lane runs names linux-arm64 too, or has a record in linux-arm64/parity.json giving the reason it cannot and the counterpart that runs on arm64 instead; a record for a fixture the lane runs, or a counterpart it does not run, is refused. The hand-ordered file is edited by hand, as darwin/parity.json and cortex-m/corpus.json are.

expect and args come as a pair. An expectation with no way to produce it is dead data that looks like coverage, and arguments with nothing to compare against are a command nobody checks, so either one alone is a reported fault. The test program runs refine from compiler/ada, so a recorded fixture with one program names it from there, args: ../tests/fixtures/CLASS/NAME/main.ldn, with any options after it; scripts/add_fixture.py gives that line when it meets expect alone.

A fixture carrying both is executed: the harness runs refine with those arguments through the real tool adapter, and compares the captured bytes and the exit status with what the fixture claims. Standard output and standard error are captured together, in the order the process wrote them.

Two programs read this format, and they are held to one meaning. The test program reads it with Landin.Testing.Fixtures; every Python consumer (the Darwin, FreeBSD, RV64 and Cortex-M lanes, the quality and outside-user lanes, the driver and emission manifests, the site and check.py) reads it with fixture_meta.py, which says what refine is run with for a fixture (source_arguments), what its program is run with (program_arguments) and which of its levels: a lane builds (levels_for). fixture-meta.cases is a table of metadata texts with the faults and values each must give, which fixtures/the metadata readers agree reads through the Ada reader and scripts/tests/test_fixture_meta.py through the Python one. A change to the format is a change to both readers and the table, and a reader that was missed fails by name.

Adding a fixture

Write the fixture directory and its fixture.meta, then run

python3 scripts/add_fixture.py CLASS/NAME [CLASS/NAME...]

Name several new fixtures in one run: each is read and given its row in turn, the generated files are regenerated once, and the steps left are one recording run and one test run for them all. --refuse, --reason and --stops describe one fixture's row, so a fixture that needs them is added in a run of its own.

It reads the metadata as the test program does and stops on any fault. It gives a runtime or ABI fixture its row in cortex-m/corpus.json. It puts a positive, runtime or ABI fixture's sources in the layout refine fmt gives, which formatting/the corpus is formatted holds the corpus to, unless the fixture says layout: evidence or names [1750] and its layout is its evidence. It regenerates every file a fixture is read into (check.py --generate: targets.matrix, constructs.matrix, the diagnostic matrix and lexical.tokens among them). Last, it says what only a person can decide: that a Linux x86-64 runtime or ABI fixture that does not run on arm64 needs its record in linux-arm64/parity.json. A runtime fixture's row is what Cortex-M0 compilation does with it: the script compiles it with refine, the newest this checkout built or the one --refine=PATH names, and writes execute when it compiles and refuse with the distinct codes it refused with, sorted as the corpus compares them, when it does not. A refusal other than L0015 alone takes the --reason it is given, and an L0015 one needs none, since the corpus reads its refused modules from the refusal. An ABI fixture, whose C peer is hosted, is a restriction with the --reason it is given.

A fixture that asks which descriptors a child process holds makes the child the fixture's own program, started again, and asks poll. The parent passes the word check and the decimal numbers of the descriptors it holds as arguments to io.spawn(host, posix.program_name(), ...); the copy, which knows itself by those arguments, asks posix.poll about each number with no wait and reads posix.happened: poll_invalid answers a closed descriptor and never an open one, and the question opens nothing. runtime/run-no-descriptor-leak and runtime/thread-spawn-leaks-no-descriptor both ask this way. A shell cannot be the check, because a shell's own descriptors look like inherited ones: Darwin's /bin/sh, bash 3.2, keeps a descriptor of its own at the lowest free number from 10 up while it works and finds that one open, in a subshell's redirection and after an exec alike, and dash, Linux's sh, takes no descriptor number above 9 in a redirection.

It ends by naming, for the fixture's class, each step only the test program or another tool can take, as then run: lines in the order to take them: ./scripts/dev-test.sh --record=lowering for a positive fixture, whose lowering lowering.ir records, with --record=CLASS/NAME in the same run for a fixture whose expect file is not written yet; one ./scripts/dev-test.sh run of the fixture and of every corpus case that reads it (the lexer's and parser's agrees with the corpus for a positive or negative fixture, lowering/the recorded corpus is current for a positive one and formatting/the corpus is formatted for a positive, runtime or ABI one); ./highlight/test.sh --integration, inside nix develop, for a source the editor grammar parses; and python3 check.py, which names a runtime or ABI fixture that has no row and the command that writes it. A fixture edited later is held to the same cases, the formatter's among them.

The host gate also runs test_compile_publication.py --refine PATH against actual compiler input/output collisions, test_publication_native.py against the production C adapters, test_runtime_owned.py against capture and private-directory replacement, test_native_registry_threads.py against concurrent resource creation and cross-thread handoff, and test_tool_cancellation.py --refine PATH against both the production process adapter and actual compile, run and bindings commands. Their controls use owned scratch roots and readiness barriers for the formatter's open window, publication conflicts and tool cancellation. The cancellation helper checks delivery to the process group and reaping of the direct child; it also checks refusal before spawning under automatic child reaping, unchanged OS-observed signal policy and complete advice with long tool paths, and that a signal ends a process holding nothing at once, is recorded while something is held, and ends it after the grace period when never answered. test_compile_publication.py's host- controls hold the native adapter's own rules: published modes, entries of other users, refusals in the rule's words, descriptor and file-size limits, a tool that writes beside itself, a removed working directory, and compiles of different outputs into one directory started together. It does not claim to reap arbitrary descendants. --native-only runs just the process adapter controls. The FreeBSD runtime guests compile and run the same C controls with their own compiler, without claiming a native FreeBSD Ada compiler. Logs and JSON results retain their selected scope.

Discovery is strict. An unknown key, a repeated key, a missing required key, a class that disagrees with its directory, a line that is not a pair, a fixture directory without metadata, and a plain file where a fixture belongs are all reported, and the fixture is not accepted. A fixture that is half-accepted is a fixture whose fault stops being visible.

Names beginning with . are skipped: host clutter is not a fixture and not a fault.

Ordering is by class, then by name, so a run reports the same sequence everywhere.

What the harness does with them

class today
unit a note of what an implementation-side case covers; the case itself lives in compiler/ada/tests
negative, end-to-end executed: recorded cases compare refine output/status with expect/status; program-only negative cases require the expected failure status and ordered codes: sequence
runtime executed: refine compiles and links program, the result is run, and its own exit status is compared with status — or, with traps: yes, it is held to having ended without returning one
ABI executed in the existing runtime fixtures execute case: refine emits assembly, the selected target's C driver compiles it with c-sources, and the result's output/status/trap verdict is checked
positive checked and emitted, never run: the grammar must derive the program, refine must accept it through checking, lowering and verification, and the selected target's backend must emit assembly for it
debugger sessions in debugging/ run separately through scripts/debug.sh

Each producing attempt first removes its expected output through the platform filesystem interface. An output that cannot be removed stops that attempt; a zero exit status then requires a newly created file. This applies to positive assembly, runtime executables and both ABI production steps. Fake-command cases pin missing, stale, repeated, failed, timed-out and unavailable producers without invoking a compiler or toolchain. A positive fixture may legitimately contain only types or external declarations and emit no function body: emission is stage coverage, while instruction semantics need IR or runtime oracles.

A class with no fixtures is the normal state early in the roadmap, and an empty class directory is not a fault. A fixture that records an expectation nobody runs is.

That last sentence decides what a runtime or ABI fixture does on a host that cannot finish the target, and the answer is that the run fails. A macOS host asked for a Linux cross-run without the ELF toolchain it needs reports the existing runtime fixtures execute case as one failing case: runtime fixtures carry refine's own L0500 report, and ABI fixtures name the triplet-selected C driver that could not be run. Skipping would be the quiet non-run the sentence refuses, and it would also hide the gate losing its toolchain. This is the same rule scripts/env.sh already applies one level up: a machine without the pinned GNAT is told so and stops, rather than quietly building nothing.

A runtime or ABI fixture carries program and either an exit status (zero by default) or traps: yes, and neither expect nor args, because nothing compares refine's own output — what is asserted is what the compiled program did. One without a program is a reported fault, for the same reason expect without args is: a status nobody produces is dead data. ABI additionally requires c-sources; c-args, run_args, stdin and run_expect remain optional.

stdin names a file the way run_expect does, relative to the fixture directory, and it must stay below it: a slash-separated path with no empty, . or .. component, no backslash and no colon, so every lane opens the same file whatever its working directory. run_files names the files a program is given as arguments the same way, so every path to a fixture's own file has one base, the fixture directory. run_args holds the rest of the command line, words handed over as written; a word that is a path is one a program writes, relative to the directory it runs in, which is compiler/ada on every lane and whose build/ is there to write into, as the output file runtime/r480-hosted-text names with its --out does. The program's arguments are its c-shared objects, then run_args, then run_files. Every lane that runs a compiled program honours stdin: the Ada harness on the Linux and Darwin hosts and under an emulator runner, the FreeBSD guests, the RV64 machines, the quality measurements and the outside-user lane. A fixture without the key gives its program an empty standard input, /dev/null, on every lane, and never the harness's own, which may be a terminal the program would wait on until its time limit; runtime/word-count-no-input holds every lane to that. Firmware has no standard input, so the Cortex-M corpus refuses to execute a fixture that names stdin: such a fixture is hosted and is recorded there by its source refusal, as runtime/word-count is.

Accepted, emitted and executed are three claims and not one, which is why three classes make them. A positive fixture is a program the compiler must accept, and asking only that was how four of [1810]'s statement forms reached the first Linux backend's audit without ever having been handed to it: every stage accepted them and no case asked for a byte of assembly. So the positive class now emits as well, and a construct that reaches a compiler defect on the way to .s fails there rather than waiting for a runtime fixture to happen to use it. It is still not executed — most of the corpus is a fragment with no entry point to run, and a claim about a machine belongs to the runtime class.

traps: yes replaces status rather than joining it. spec.md [1960] says a trap is synchronous and non-returning and that its operating-system signal or status is not stable program behaviour, so a fixture may assert that the program ended without returning a status and may not assert which signal ended it. Naming both is a reported fault: a program that trapped has no status, and a fixture claiming one is claiming an answer nobody can observe. Nothing in the fixture format carries a signal number, deliberately. With no panic_handler, a hosted program writes D361's line, FILE:LINE:COLUMN: trap: KIND, to standard error before its terminal instruction; trap_report: holds a fixture to that exact line on every lane, the file named relative to its module's root so that no lane's directory reaches it, and Darwin's lane does not count the line as unexpected standard error.

What that can and cannot tell apart is worth knowing before writing one. runtime/checked-overflow-traps adds one to a 255u8 the compiler cannot read: without the backend's own check the instruction keeps the low byte and the program returns 42, so the fixture fails when the trap edge is removed — which is measured, not assumed. runtime/a-zero-divisor-traps cannot make that distinction, because x86-64 faults on a zero divisor whether or not the compiler guarded it; it proves [1950]'s obligation is met and not which of the two stopped the program. D11 is where the choice to emit a deliberate ud2 rather than inherit the incidental fault is recorded, and deterministic assembly is what pins it.

The defer and undo no-unwind fixtures register exit(99) as cleanup. Reaching that observer, whether before or after the fault, produces an ordinary exit and fails traps: yes. Merely changing the divisor in cleanup would not expose cleanup reached after the fault. A fake-outcome control pins the distinction; the fixture still cannot identify which instruction generated a signal.

A selected panic_handler that ends the program has no status to give either: firmware has no exit, and platform/posix.exit is hosted only. So a fixture that pins what its handler received reports it the way that runs on every target with a native backend, firmware included (D462, D1293): main runs the computation whose check fails on a prepared stack, the handler records its verdict in a module value and resumes the context main saved when it switched there, and main returns the verdict as its status. runtime/compiler-unreachable-dispatches returns 42 only for the kind and site it expects, and a distinct code for anything else; a missing dispatch reaches the terminal default trap, which fails the status where traps: yes would have held. A check that fails on main's own stack, before it has switched, cannot report this way, and a fixture of one keeps traps: yes.

The grammar corpus

A .ldn file under positive/ must be derivable from the enabled grammar in spec.md. A negative program a later stage refuses must derive too; one whose first diagnostic comes from the scanner or parser must not. check.py enforces those stage-sensitive verdicts on every full run, and it enforces that every construct in the grammar section is named by at least one fixture, so a production nothing pins is a reported fault rather than a quiet one.

The corpus made the specification and its examples check each other before a compiler existed. The parser now has to agree with the same corpus, and a disagreement between the parser and the grammar is a defect in one of them rather than a matter of opinion.

Two rounds of reading the grammar by hand found sixty-eight defects between them and still missed that a lone _ parsed as a name. The corpus found that in a second.

A negative fixture may add lex: <complaint> to pin the independent Python grammar scanner's refusal wording. check.py compares that field; the Ada fixture reader accepts the metadata but does not use it as an Ada diagnostic oracle. Ada diagnostics are pinned by the ordered codes: list and, when present, the exact expect report. Lexer unit cases separately inspect tokens, spans and complaints. Neither a Python lex: match nor codes alone proves the Ada report's wording or span is correct.

Programs are read as bytes. Text mode would turn CR LF and a lone CR into LF, so the terminator rule [1750] states could not be tested however many fixtures were written for it; positive/line-ends-crlf carries a CR byte and the checker asserts it is still there when read.

What the corpus cannot see, recorded so nobody assumes otherwise: it cannot tell CR LF read as one terminator from CR and LF read as two, because both produce the same tokens. The distinction belongs to the line map, and Landin.Source's own case for it is what holds that.

lexical.tokens

compiler/tests/lexical.tokens is generated: python3 check.py --tokens writes it from check.py's tokeniser, one line per token as first last spelling. The Ada harness reads it and compares every token with what Landin.Tokens.Lexer produced, and every full check.py run compares the committed copy with a fresh dump and fails if it is stale.

Kinds are deliberately not in it. The two implementations have different kind vocabularies, and what a disagreement actually looks like is a boundary in a different place.

That is two independent implementations of one grammar, held to each other over every program in the corpus. The first thing it caught was real: the Ada scanner appended each file's tokens to the previous file's, because a limited out parameter is passed by reference and Lex had not cleared it.

Diagnostic and semantic coverage registers

python3 check.py --generate regenerates every generated file at once: the token dump, the catalogue and its matrix and explanations, the citations refine explain reads at run time (citations.txt, D1240), the coverage and construct matrices and the editor files. Each flag below writes its own share, and one run may name several flags.

python3 check.py --catalogue writes both diagnostics.catalogue and diagnostics.matrix. The compact catalogue comes from Landin.Diagnostics.Catalogue, which is the only place in the compiler where a code is written. The matrix crosses every row's source/span/label/note contract with its emitters, the source directories that name the code, and its fixture or fake-host test owner. A live code with no emitter or owner and a retired code still emitted are gate failures, and so is a code without the evidence its row's Shown_By names: a negative program for Negative_Fixture, a driver, command or end-to-end case for Invocation, and for Implementation_Limit — L0111's parser nesting limit and L0325's routine and struct size limits — an implementation-side unit owner, because a program that meets either is too large to keep in the corpus.

A test program source is an owner of each code it writes in quotes, as "L0100". A case that only hands a code about as data, a selector's argument or a fake report's code, is not evidence that the diagnostic is reported, so it ends the line holding the code with the comment -- not evidence, and the matrix leaves that line out:

Carried : constant String := "L0100";  --  not evidence

python3 check.py --coverage writes guarantees.matrix, conformances.matrix, prototypes.matrix and targets.matrix. Their source registers are D148 in spec.md and the prototype registers in registers.md. The checker closes the guarantee rows over every construct the independent construct matrix says is accepted or emitted, validates every fixture, diagnostic, decision and prototype finding they cite, requires every fixture to name applicable targets, and recovers prototype finding line numbers from the prototype sources. The copies are generated for reading; editing one cannot change its source.

prototypes.matrix carries three derived columns: inputs, outputs and results, never asserted beside the row. inputs and outputs come from the fixture's own record — its program, root, arguments, C peer, status, ordered codes and a digest of every golden it cites — so an edited expected output or a changed code list moves the column and a stale matrix fails check.py, and so the gate's documents job. results is the verdict each product target's retained record reaches for that one derivation, read through the same per-fixture reader the construct inventory folds over constructs: executed, compiled or refused, strongest first. targets stays the applicability claim it always was, and the two are deliberately separate — the Cortex corpus records verdicts for fixtures whose metadata names only the hosted targets, and a recorded Cortex refusal of a hosted derivative is a result rather than a silence. synthetic-32 never appears under results: it is the model that preceded the Cortex-M backend and applies to no construct, so a verdict under it would be a verdict about nothing. compiler/tests/driver/fixture.json carries the firmware driver's oracle, the assertion groups its runner defines; scripts/tests/test_prototype_coverage.py proves each of those refusals fires, including a renamed oracle, an absent golden and a target a row claims that no record places.

Every full check.py run fails if any generated copy is stale, and it refuses a code literal written anywhere else under compiler/ada/src.

The catalogue check earned itself immediately: the driver had held L0001 to L0004 as literals since it was first written, and moving them into the catalogue was the first thing it demanded.

lowering.ir and layout.targets

compiler/tests/lowering.ir is generated: ./scripts/test.sh --record writes it by lowering every positive fixture and rendering the Unit with Landin.IR.Dump, at linux-x86-64, or, for a fixture whose targets: leaves that out, at the target and level its args name, which a target line after its file line records (D659). The recording reads only what a fixture imports: it does not add the Cortex-M0 reference description refine gives a firmware program that imports no description (D543), so a fixture with a link(vector:) handler imports platform/cortex_m/reference itself, or the recording fails with L0518. compiler/tests/layout.targets is written by the same command, and records what Landin.Targets says scalar and aggregate shapes measure, align to and offset their fields by on each described target. Its D74 rows also work the tag-first variant part and one containing aggregate on each description. Both are recorded artefacts check.py does not touch, and that difference matters enough to state. check.py generates the other two because it owns their sources — its own tokeniser, and the catalogue's Ada text. It owns nothing here: producing these files means running compiler stages and asking the target model, so the Ada harness is what can produce them and python3 check.py will not tell you either is stale. ./scripts/test.sh will, and so will the gate; lowering/the recorded corpus is current names each fixture whose section changed, is not recorded or is no longer lowered, and ./scripts/test.sh --record=lowering or --record=layout rewrites one file without the other.

layout.targets exists for an ordering reason: target-parametric layout came before any 32-bit backend, a description is the only thing a compiler with no such machine can be held to, and the synthetic 32-bit target has no backend. The Cortex-M0 target separately instantiates its layout and preserves these original goldens. Recording both targets rather than that one is deliberate — what a reader needs is not "the 32-bit model says four" but the two columns beside each other, because the defect being guarded against is a description quietly inheriting the development host's answers. A usize that read eight in both would be exactly that, and it is a one-line change away at any time.

Recording runs no case, and no case ever writes. Two disjoint modes in one binary, chosen only by an argument a human typed: there is no environment variable, nothing writes the file when it is missing, and nothing rewrites it when it does not match. A golden that repairs itself on a mismatch records the defect instead of reporting it. The loop is closed by hand — record, then run the suite again with no argument — or by ./scripts/test.sh --record-and-run, whose shell wrapper makes both explicit binary invocations after one build.

What the file is for is narrow, and landin-ir-dump.ads says it: it proves the lowering has not changed its mind. That the corpus derives from the grammar is check.py's, and what the instructions mean is Landin.IR.Verifier's. No origin is printed, deliberately, so a comment edit above an instruction does not rewrite the artefact.

Derived programs

The five prototype text files in the repository root remain design-stress sketches, including their omissions and historical findings. Complete derived .ldn programs are separate artefacts and arrive with the roadmap work that can compile them.

runtime/derived-parser hosts the complete prototype-2-derived lexer and recovering configuration parser in examples/config_parser. Its DERIVATION.md maps the executable behavior and negative controls to the prototype.

runtime/derived-containers hosts examples/derived_containers/workload as the complete prototype-3-derived workload. Its DERIVATION.md maps every prototype section and Z finding to the ordinary core modules, executable paths and negative corpus. The runtime entry requires every path to succeed before returning 42, with no stdout or stderr: list growth and sorting, direct fixed array mutation, nested-array field ranges, initialized raw storage, vector and small-vector failure/retry, map collisions/reuse/enumeration, each of the three map acquisition failures, tree traversal and heterogeneous dispatch. Providers remain explicit capabilities and cleanup is observable; no fixture-private replacement container library or implicit resource ownership stands in for the prototype. This same workload is mandatory in the six-profile runtime matrix, object-quality measurements and source-debugger acceptance above.

runtime/derived-hosted-memory hosts the complete prototype-4-derived application in examples/derived_hosted/app. The runnable hosted entry and its derivation map live in examples/derived_hosted. Runtime configuration constructs heterogeneous filters and either a counting or text destination; the processing loop calls their ordinary any evidence entries. The reader retains partial lines across chunks and emits a final unterminated line. Copied arguments and message storage survive helper returns, and delivery retains its committed byte cursor across an explicit retry. The memory world makes input fragmentation, output contents and failure cleanup deterministic; the hosted fixtures use the same application with actual native Linux I/O. The memory composition is also mandatory in all six quality profiles and the three debugger workload profiles described above.

runtime/r480-generic-provider-entry pins the bound entry required when a concept provider itself has constrained generic parameters. Two nested providers execute through direct evidence and any calls, forwarding a by-value aggregate, an aggregate result, an inout array and a declared failure. The table entry supplies the provider's concrete evidence arguments to the ordinary generic body; its source calling convention and the two-word any representation remain unchanged.

Hosted parity asks for more than a populated construct column. Every hosted row must cite a Linux runtime or ABI program, except the explicitly registered compile-time rules whose exact acceptance/refusal is the oracle. check.py enforces this boundary; it does not infer semantic adequacy from metadata. The audit adds distinct and inline nominal types, exact once-evaluated field fills, atom comparisons across structural sets, atom-bearing arrays/fields/payloads, parameterized union aliases, conformance-key controls and recovered-error generic deduction. Review probes include static distinct Boolean/pointer images, type-name misuse, exact union application diagnostics and unused symbolic pointer obligations. Original refusal sources promoted to enabled grammar remain byte-for-byte positive fixtures, and all unchanged derived-application recovery and provider oracles remain required. D212's ordinary allocator authority and all existing workload profiles remain required.

Native Darwin lowering

compiler/tests/darwin/cases.json selects the first Darwin lowering and ABI corpus, run by compiler/tests/darwin/check.py with none/off, size/auto and speed/all profiles. It reuses shared source/verdicts and has separate Apple varargs, packed-stack/HFA/indirect-result and errno probes. Each run retains command arguments, outputs, hashes, assembly and native artifacts. Every emitted routine's frame record and reserved-register exclusion are checked; a C peer also checks a live Landin parent frame. --case/--profile are visibly filtered development feedback. The binding runner regenerates and executes the complete adapter-category corpus with the pinned Apple target and tests exact archives.

In the gate, darwin-parity alone gives a runtime or ABI fixture its Darwin verdict. The darwin-host and darwin-host-release jobs run the test program as --host --target=linux-x86-64, so its own fixture execution, which on a Mac's default lane assembles, links and runs the darwin-arm64 fixtures, runs in no gate job. What the test program does with a fixture on that lane is seen only by running it on a Mac.

These scripts require native arm64 macOS. check.py --parity selects every shared runtime/ABI fixture and its four/six profiles; diagnostics.py checks every applicable Darwin source verdict. Explicit native differences and replacements are recorded in darwin/parity.json, with strict executable evidence. Linux golden records remain unchanged. The complete derived parser now also uses all six runtime profiles. The parity guide describes full coverage, debugger oracles and retained platform limitations. The retired native acceptance and matching-revision approval are documented in the Mac guide.

The cortex ABI compiler-host suite compares scalar, nested/variant, evidence/any and call-plan results with cortex-m.contract; it also checks real lowered source and target/budget/refusal boundaries. The independent Cortex-M probes compare every original synthetic-32 golden with GCC measurements and run C/assembly ABI controls in QEMU on the supported native Linux host. The retired native acceptance's documents job retained their evidence. These are executable ABI contract controls. Generated M0 execution is separately identified; these earlier controls retain their independent role.

r630-memory-scalars runs all supported widths, old-value and compare-exchange outcomes, wrapping addition, volatile access and barriers. abi/r630-native-memory runs Landin-generated operations under independent pthread scheduling and compares increments with a C atomic control; publication and mixed-width aliases have exact value assertions. Alignment fixtures require traps even inside unchecked regions. Negative fixtures pin ordered diagnostic codes for illegal types, permissions, orderings, arity and target operations. The ir opt/memory events case checks event preservation under every policy and malformed memory metadata refusals. Embedded controls and abstract cache models are separate evidence described in the Cortex-M guide.

The memory-model ABI counter passes through a concept provider and inferred generic call, so specialization profiles exercise real evidence dispatch. Its bounded SC-fence store-buffer litmus rejects 0/0, but the absence of that observation is not proof of a memory model. Every new negative pins exact diagnostic text; M0 RMW and eight-byte load requests retain their explicit target selection.

The development case targets/packed image algebra and access plans checks the compiler library with an independent bit-by-bit reference over 257024 combinations, enum holes, 64-bit boundaries, indexed fields and the complete bounded access-mode table. It also compares four target descriptions. That case is compiler-host evidence. Source fixtures named r640-* separately cover packed geometry, enum maps, raw copies, validated extraction, fit/index traps, exact diagnostics, register access modes, reserved policies, and generic and erased evidence paths across the six specialization profiles. Independent C ABI controls enumerate all byte images and observe backing storage after pre-store traps. The ordinary-slice DMA control retains D227's barrier contract. The native debugger source checks the raw carrier and its size; named packed bitfield/array display is not claimed.

packed.py executes independent M0 C firmware. packed_native.py executes compiler-generated hosted instructions against the encoding model through a C line transport, with literal independent image/trace assertions. Both are mandatory in the embedded probe/export path, alongside the profile, layout/ABI and memory controls. The Cortex-M guide records their results, assumptions and limits.

cortex-m/corpus.json inventories every shared runtime/ABI fixture. The mandatory embedded runner executes every selected optimization/specialization profile, checks precise source refusals, and retains physical limits separately. cortex-m/counterparts.json pins exact 32-bit/architecture differences without editing the hosted originals. Independent numeric layout expectations stay literal, including pointer/slice carriers and nested variant placement. The embedded guide describes generated execution, independent ABI/instruction controls, peripheral traces, helper provenance and the external startup/linker boundary. GDB observes machine instructions and frame records; this is not Landin source debugging.

D229's positive/r660-machine-directives pins target-fixed parsing of typed machine functions and placement without enabling hosted machine semantics. negative/r660-materialization pins the L0505 pre-GC budget. The cortex ABI suite exercises firmware request failures, conventions/conversions, naked body restrictions, placement conflicts and unsupported hosted assembly. Actual compiler-generated firmware and independent machine controls live in the embedded execution lane; those QEMU results are not hosted fixture passes or source-debugging acceptance. Existing runtime/ABI fixtures and their Cortex dispositions remain unchanged.

positive/r670-scalar-assembly pins target-fixed assembly without enabling hosted assembly. cortex ABI/assembly IR lowers an inout operand at r0 and the named general form to one instruction and independently corrupts an input, an output slot, a register and a width, including a register Cortex-M0's table never answers for. The machine-directive cases check source operands, registers, arity, naked restrictions and hosted refusals. The freestanding library lane executes CPU, allocation, pool, vector and ordinary-slice DMA consumers through compiler-owned firmware. It retains the original shared fixture oracles and the reviewed raw-storage 32-bit counterpart. This is additional target evidence; it neither removes a shared verdict nor claims a complete freestanding core.

D232 adds abi/r670-panic on both native hosts, with independently pinned kinds and source-byte sites, no later actions/cleanup, recursion and hosted-root controls across specialization profiles. negative/r670-panic-handler pins L0506 and the driver suite checks malformed hooks on all targets. Cortex uses core-panic.ldn and its default-handler derivative in the mandatory freestanding lane, including real interrupt delivery and separately labelled debugger fault injection. Optional map mismatch tests run under full check.py. These remain additional evidence and preserve the inherited fixture verdicts and lane boundaries.

Generated-device source fixtures live under devices/, outside the shared runtime corpus. devices/test.py verifies offline provenance and fresh regeneration; devices/check_sources.py records seven exact diagnostic-code refusals. The mandatory Cortex device lane compiles all six generated modules and executes five consumers at six profiles, with its own retained independent oracles. No shared fixture is removed or reclassified by this addition.

The complete Cortex driver lives in driver/, outside the hosted fixture runner. Its fixture.json supplies the explicitly named firmware/derived-driver prototype-matrix row; check.py checks the source/ mapping paths and mandatory runner connection. Native Linux documents/tooling acceptance runs its QEMU evidence through compiler-owned firmware. Prototype 5's firmware counterpart lives in counterpart/ the same way, as the firmware/derived-counterpart row. Both are entries of check.py's FIRMWARE_DERIVATIONS, which names each record, its input and file fields and the environments/cortex-m/run.py call that makes its lane mandatory; a new firmware derivation is registered there. Its mapping, like every derivation's, is a file named DERIVATION.md under compiler/tests: check.py reads each file of that name as a live document, held to the checks the other documents are, so a map needs no entry in a list. The shared runtime/r690-recovery-loop-context fixture separately checks inferred recovery break/continue and cleanup on both hosted targets and Cortex.

The FreeBSD lanes execute their metadata-selected runtime and C ABI fixtures in separate x86-64 and arm64 VMs, after Linux emission. Their runtime lanes also check every applicable positive and negative source verdict with the FreeBSD target selected. Their LLDB sessions run natively in the guests; a local Mac-hosted VM is developer feedback, and the recurring Linux-runner VM jobs supply the gate evidence.

The physical RV64 lanes cross-emit checked payloads on Linux and report native runtime, GDB, independent nonempty C ABI and ISA-extension verdicts separately. The payload is tied to the source revision, complete fixture/profile selection and source and binary checksums. ISA execution confirms the actual instruction on hardware before running extended code; source checks and emission alone do not establish any execution verdict.