Machine-legible test vectors for validating Nock 4K runtime implementations. Each test is a triple of subject, formula, and expected result covering all twelve opcodes (0–11) and auto-cons.
tests.json— Canonical test data. Each entry has fields:opcode— integer 0–11 or"autocons"description— human-readable explanationsubject— Nock noun (as a string in standard notation)formula— Nock formula (as a string)result— expected product (as a string), ornullfor crashhoon— equivalent Hoon expression (optional, may benull)
REFERENCE.md— Generated Markdown table (do not edit by hand).generate.py— RegeneratesREFERENCE.mdfromtests.json.validate.py— Validates every test against a live Nock runtime.
python3 norm/generate.py
python3 norm/validate.py --urbit ~/bin/urbit --verbose
The validator runs each test as .*(subject formula) via urbit eval and compares the output. Tests with result: null expect the runtime to bail (crash).
By default the script looks for ~/bin/urbit or urbit on $PATH.
A null result means the expression is undefined per the Nock 4K spec. The reduction rules have no matching pattern, so a conforming runtime must crash (not produce a value). Common examples:
*[a 0 0]— axis 0 is undefined+[a b]— increment of a cell*[a 6 b c d]where*[a b]is not 0 or 1
Results use right-associative flattening: [a [b c]] is printed as [a b c]. This matches Urbit's canonical noun printer.
These tests target Nock 4K.