Conformance corpus

The executable contract for the scripting language (see ../SPEC.md). An implementation of the language is conforming iff it reproduces every fixture in this directory. The Rust core at rust/theta-script is the engine every shipped runtime wraps; the pure-JS interpreter in js/src/ is a retained independent implementation and the generator of these fixtures — two implementations agreeing bit-for-bit is what keeps the corpus honest.

Known conforming implementations: the Rust core (cargo test runs this corpus; its wasm build is exercised by js/test-wasm/), and the JS interpreter (jest conformance in js/).

Layout

Wire encoding

JSON cannot represent IEEE-754 specials, so encoded outputs map:

runtime valueencoded
NaNnull
Infinity / -Infinity"Infinity" / "-Infinity"
-00

Comparison happens in encoded space: a port encodes its own result the same way and diffs the two trees. No decoder exists, which is what keeps null-vs-NaN and string-vs-"Infinity" unambiguous.

Port runner contract

For each expected/*.json:

  1. Load tapes.json[fixture.tape] as the bar input.
  2. Run the script with fixture.opts (defaulting timezone/session per spec).
  3. Encode the result and compare to fixture.expected.

- Numbers: exact equality is the target. A port MAY apply a relative tolerance of 1e-9 to values produced through the transcendental builtins (log, exp, pow, sqrt, rsi's divisions, stdev's square root) where libm implementations legitimately differ in the last ulp; everything else (arithmetic, comparisons, rolling sums) must match bit-for-bit. - err-* cases: the port must produce a non-null error and empty draw collections. The error message text is informative, not normative — compare only that an error occurred (and its collections match).

  1. All other fields (colors, spans, titles, input metadata) compare exactly.

Regenerating

npm run conformance:update

Only regenerate when the language deliberately changes, and bump LANG_VERSION in ../interpreter.js (mirrored in each fixture's lang field) in the same commit. A diff in regenerated fixtures is a language behavior change and should be reviewed as one.