#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:
- A compiler turns a program into a plan (
plan.json, the format in the plan reference). - An engine runs a plan on data and answers questions about it.
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:
| field | what it is |
|---|---|
label | the case's name |
program | the eLucid8 program, for the compiler level; present when the official compiler, given this text (and files), gives exactly plan |
files | a 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 |
plan | the plan the official compiler gives for it |
sources | the data each source reads, with timestamps where it has them |
job | the questions: values at points or over boxes, in order, with any versions pinned, data services bound, and options set |
expected | each answer: its data, eod or error, and its timestamp; each error's origin; each program error's message; each data service's calls |
expectNoValues | true 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:
- the language's constructs: dimensions, bounds and regions,
fby,next,first, shifts, aggregates and filters, recursive functions, texts as coordinates, data services (built-in services, simulated ones, and one answered from its recording,services-recording: its answers, a retry, a failure, a late answer and a call the recording does not hold); - every search by time,
latest,after,asof,holdand windows, with and withoutwithinandskip eod, also beside other region items, underargmaxand as a shift, over an input and a computed value, on data with ties, eod and error candidates, times that fall, a column with no row, NaN and infinite values, and times and widths that are NaN, infinite, before the first candidate and after the last (searches-v17-*); - the rules where implementations most easily differ: eod and errors meeting, timestamps through every operator, exact sums, the maths library's bits, positions below 0 and past a bound;
wvr,asaandupon(plan version 21): gaps, eod and an error in the condition, timestamps, a bound, a dimension with no end and a second dimension (rate-*);- errors with a kind and
iserror(e, "kind")(plan version 21,error-kinds), and lists, records and sets (plan version 22,collections); - programs over several files (
files-*: values, functions and expressions of other files read within, a file read through another and one named twice, inputs shared by name, dimensions shared through an input or carried by a value read from another file) and functions with several dimension parameters (dimension-params); - deep iterations and the demand-depth limit, the aggregate-size limit;
- jobs of several questions over changing data versions;
- the published documentation's examples that state their answers and give their data in the example (
doc-*, 184 cases, each asked at the points it states): the Tutorial, Values and timestamps, Time and real time, Where data comes from and where it goes, Data services, From Lustre, From pLucid and the language reference for AI tools; the examples that state a compile error instead of answers are not cases; - playground examples and randomly generated programs, with their answers recorded.
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
plan.jsonis the case'splan,sources.jsonitssources(formatelucid8-source-data/2: outcomes in the printed triple's form; a source with"clocked": truehas its timestamps from a clock, so its missing data at timestamp 0 has a time, the clock's tick 0, and is a candidate of searches and windows, unlike missing data with no time), andjob.jsonitsjob.- The engine prints one JSON document on standard output and exits 0:
{"results": [ … ]}, one result per query of the job, in order. A result is{"outcomes": [ … ]}, one outcome per point of the query, in order, or{"programError": "message"}when the query stopped. It may add"calls": [ … ](the data service calls the query made) and"warnings": [ … ](the query's warnings); anything else in it is ignored. - An outcome is written in the printed triple's form:
{"kind": "value", "value": 3, "ts": 330},{"kind": "eod", "ts": 0},{"kind": "error", "error": "division", "message": "division by zero", "origin": {"name": "ratio", "context": {"t": 2}}, "ts": 2500}; an error passed on adds"via": {"length": N, "path": [...]}(the chain, nearest first, ending at the origin), and a payload's fields are in"detail"(a late answer'sdeadlineMsandcompletedMs, a service'scode).tsis always written; −0, NaN and the infinities in a value are written{"special": "-0"}and so on. A case compares an error by its kind, message, detail and, when it was passed on, its origin.
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.