Learn

Contents

Conformance: what "eLucid8-compatible" means

eLucid8 promises that a program means the same thing wherever it runs: the same answers, to the last bit, in the playground, the elucid8 command and any other implementation. The conformance suite is how that promise is checked. An implementation that passes it for a version of the language may call itself compatible with eLucid8 at that version (trademark policy).

Two levels

An implementation of eLucid8 can be one of two things, or both:

The suite checks each separately, so an engine can be checked with the official compiler's plans, and a compiler with the official engine.

What a case holds

Each case is one JSON file:

fieldwhat it is
labelthe case's name
programthe eLucid8 program, for the compiler level; present when the official compiler, given this text (and files), gives exactly plan
filesa program over several files only: the text of each file it reads with in, by its path from the program's folder ("lib/num.el8"); the compiler is given them beside program.el8
planthe plan the official compiler gives for it
sourcesthe data each source reads, with timestamps where it has them
jobthe questions: values at points or over boxes, in order, with any versions pinned, data services bound, and options set
expectedeach answer: its data, eod or error, and its timestamp; each error's origin; each program error's message; each data service's calls
expectNoValuestrue in a case whose every answer is eod or an error, which is what it tests (an error's chain, a late data service, eod meeting an error); left out otherwise

An implementation passes a case when every answer equals expected exactly: numbers bit for bit (−0 and 0 differ), the same kind (value, eod, error), the same timestamps, errors naming the same origin with the same cause, the same program errors, the same warnings, and, where the case calls data services, the same calls (each attempt, its start, completion and result).

A case checks values. A case whose every answer is eod or an error compares no data: an engine that answered eod everywhere would pass it. So such a case says "expectNoValues": true, and the repository's tests fail a case that gives no value without it (program errors compared count as checks of their own). The runner passes or fails an engine by its answers alone; the field is for whoever makes cases. Eight cases of conformance/v26/ say it (long-chain, recursive-7, and six documentation examples whose stated answers are all errors or eod).

An error's origin is the point where it arose: the last point of its chain of upstream links, or the point asked for when it has none. Its cause is the error there (for example {"kind": "failed", "message": "sensor fault"}). The links between the point asked for and the origin are not compared, unless the runner is given --strict.

A job may also set runtime options (pointCache, sourceCache, groups, boxKernels); they never change an answer, and an engine may ignore them. A job's limits (maxDepth, maxAggregate) are resource limits: they decide where a query stops with a program error, so an engine must apply them as the official engine does to pass the cases that reach them.

What the cases cover

The cases are the ones the official engine is tested with on every change (runtime/tests/eduction/), from the same generator, those whose plans are plan version 26 (the official engine's golden files also keep a few cases in version 18's forms, which are not part of the suite); the suite has 323 cases and about 39,300 answers:

313 of the 323 cases carry their program. The other 10 have none: their plans were compiled with options that change the plan (recursive functions compiled with place codes rather than as loops).

Running it

Without the repository: download the suite from the Download page (signed in while downloads need a sign-in): one zip, elucid8-conformance-<version>.zip, for the release you downloaded elucid8 from, holding the runner, run, the cases of the plan version that release reads (a folder named v and the version), and a README. You need Node.js 24 and nothing else. Unzip it, put the elucid8 command for your computer in the folder it makes (on macOS and Linux, chmod +x elucid8), and in that folder run:

node run --engine "./elucid8 query"

On Windows, node run --engine ".\elucid8.exe query". It runs every case and ends with the summary line below; it exits 0 when every case passes. The options and the forms an engine or a compiler must follow are those below, with node run in place of conformance/run.

With the repository:

The suite is in conformance/, one folder of cases named after the newest plan version the release reads (conformance/v26/, which holds the cases of that version), with a runner, conformance/run, which needs only Node.js 24:

conformance/run --engine "my-engine query" conformance/v26/
conformance/run --compiler "my-compiler" conformance/v26/
conformance/run --engine "my-engine query" --compiler "my-compiler" conformance/v26/streams.json

Without a path, the runner runs every case in conformance/v26/. For the official implementation, from the repository:

conformance/run --engine "target/release/elucid8 query" --compiler "node packages/evaluator/bin/elucid8-compile.ts"

The engine is a command the runner gives three files, in a folder of their own, with their absolute paths appended to it:

my-engine query /tmp/…/plan.json /tmp/…/sources.json /tmp/…/job.json

This is the form the official engine's internal elucid8 query command prints. An engine that exits with another code, or prints anything that is not one JSON document, fails the case.

The compiler is a command the runner gives program.el8 (the case's program), with its absolute path appended; it prints the plan on standard output and exits 0. A compiler passes a case when its plan, run on the engine given with --engine (normally the official one), gives the case's expected answers. Its plan need not equal the case's: plans carry hashes that only the official compiler produces. A plan identical to the case's (its engineVersion aside) passes without being run. Without --engine, a plan that differs fails, since it cannot be judged by its answers. --identical-plans asks for identical plans instead (the check the official compiler is held to). Cases without a program are skipped at this level.

Options: --identical-plans (above); --strict compares each outcome whole, the upstream links of an error included; --timeout SECONDS (600 by default) is how long one command may take; --max-differences N (10 by default) is how many differences are printed for a case.

What it prints: a line for each case that fails, with its differences, each naming the query and the point, then a summary:

FAIL streams (engine): 1 difference
  query 1 (running) at running[t = 0]: value 3.0000000000000004, expected 3
engine: 203 cases, 202 passed, 1 failed (33,788 answers and program errors compared)

It exits 0 when every case passes, 1 when one fails, and 2 for a usage error.

The cases are made by packages/evaluator/demo/rust/conformance-cases.ts (npm run conformance-cases -w @elucid8/evaluator), from the same generator as the golden files cargo test checks the official engine against; the repository's tests check that the two agree.

Versions

Each language version has its own suite. A case's answers never change within a version; a change to what programs mean is a new version, with its changed answers listed in the release notes.