Conformance test catalogue#

The format of the fixtures in specs/conformance/, the suite every DS runtime is judged by, so that every runtime's harness reads a fixture the same way; how the catalogue is versioned; and when a fixture is added.

Paired with:

  • [LCON] — the categories the fixtures test.

  • [RTIM] — the harness that runs them.

  • [LDET] — the determinism guarantee they verify.

What this is not#

  • Not the test-harness spec (see [RTIM]).

  • Not a list of tests. The fixtures are the list.


Fixture format [RCTS.1]#

The conformance suite is the set of fixtures at specs/conformance/ ([LTES.8.3.1]); a runtime conforms by passing it ([LCON.1.1]). This section specifies what a fixture is, so that every runtime's harness reads the same fixture the same way. The obligations the fixtures test are the conformance categories ([LCON.2], [LCON.3], [LCON.4]).

see also: LCON.1.1, LCON.2, LCON.3, LCON.4, LTES.8.3.1

Fixture ids [RCTS.1.1]#

[RCTS.1.1.1] Fixture ids are spec citations. A fixture's id begins with the citation of the clause it pins ([LTES.8.2.2]). There is no parallel sequence numbering: the id says what the fixture covers.

see also: LTES.8.2.2

[RCTS.1.1.2] Form. A new fixture's id must be the clause citation, with dots, optionally followed by a suffix ([RCTS.1.1.3]): LCDB.7.8, LGRA.6.6.2, LFAC.2.5.1_tolerance_bound_inclusive. The fixture's file is <id>.json.

see also: LCDB.7.8, LFAC.2.5.1, LGRA.6.6.2, RCTS.1.1.3

[RCTS.1.1.3] Several fixtures for one clause. When one fixture cannot exercise a clause fully (a positive and a negative case, two code paths), each further fixture appends a suffix to the citation: a lowercase letter (LCDB.7.8a), or _ and a lowercase name saying what it pins (LFAC.2.5.1_tolerance_bound_inclusive). Prefer one citation, one fixture.

see also: LFAC.2.5.1

[RCTS.1.1.4] Category routing is by directory, not prefix. Fixtures live in specs/conformance/<category>/, where <category> is one of compiler, runtime, temporal, logical, adapter and cross-tier ([LTES.8.3.1]). One clause may be pinned in several categories from different angles; the directory disambiguates.

see also: LTES.8.3.1

Fixture fields [RCTS.1.2]#

[RCTS.1.2.1] A fixture is one JSON object, and no object in it, at any depth, repeats a member name; a harness must refuse a fixture that does ([RCTS.1.2.15]). It must carry id, category, scenario, rules_ds and expect. Of its optional fields, deprecated, platform_dependent, libraries, files, clauses, dead_rules_expected and witnesses have the meaning given below; a stdlib member makes it malformed ([RCTS.1.2.14]); any other is advisory to a harness and does not decide whether the fixture passes:

ratified — see also: RCTS.1.2.14, RCTS.1.2.15

  • [RCTS.1.2.2] id — the fixture's id ([RCTS.1.1]), equal to its file name without .json. Where the two disagree the file name is authoritative, because every citation of a fixture names its path ([STYL.5.2.8]). A harness must fail a fixture whose id disagrees with its file name.

see also: RCTS.1.1

  • [RCTS.1.2.3] category — the name of the directory the fixture is in ([RCTS.1.1.4]). A harness must fail a fixture whose category is any other string ([RCTS.1.2.15]), and every fixture in a directory under specs/conformance/ that is not a category of [RCTS.1.1.4], the harness's own directory excepted. It must not report either as skipped.

see also: RCTS.1.1.4, RCTS.1.2.15

  • [RCTS.1.2.4] scenario — what the fixture exercises, in a paragraph, naming the code path it drives and, where it cannot pin what its id suggests, saying so ([STYL.5.10.8]).

  • [RCTS.1.2.5] rules_ds — the DS program under test, as source. The inputs the harness feeds it (facts, clock steps, mocked responses) are fields of expect.

  • [RCTS.1.2.6] expect — an object whose kind is one of the names in [RCTS.1.2.10]; the kind decides which of its other fields are read.

see also: RCTS.1.2.10

  • [RCTS.1.2.7] Passing. A runtime passes a fixture when what it observes satisfies expect, as its kind defines. A harness must fail a fixture whose expect.kind it does not evaluate, not skip it.

  • [RCTS.1.2.12] deprecated (optional) — a string giving why the fixture does not apply. A deprecated fixture is not run ([LTES.8.2.3]).

see also: LTES.8.2.3

  • [RCTS.1.2.13] libraries (optional) — an object mapping a library's dotted name to its DS source. A harness must make each entry the module that [LIMP.3.1.4] resolves its name to. The program's imports resolve against these modules, then against the standard library ([RCTS.1.2.14]), and against nothing else, as a compiler's search path holds the bundle after every entry an invocation names ([LIMP.3.3.1]).

ratified — see also: LIMP.3.1.4, LIMP.3.3.1, RCTS.1.2.14

  • [RCTS.1.2.14] The standard library is always there. Every compiler finds its bundled library on every invocation ([LIMP.3.3.1]), so a harness must resolve every fixture's imports against the standard library the repository under test ships under stdlib/, after libraries ([RCTS.1.2.13]), and units.core is preloaded for every fixture as for every program ([LUNI.4.1.2]). It must read those modules where they ship, never from a copy, and must fail its run, not the fixture, when it cannot read them.

    A library name that both libraries and the standard library supply makes the fixture malformed, and a harness must fail it rather than choose between them. A fixture that carries a stdlib member, whatever its value, is malformed too ([RCTS.1.2.15]).

ratified — see also: LIMP.3.3.1, LUNI.4.1.2, RCTS.1.2.13, RCTS.1.2.15

  • [RCTS.1.2.16] clauses (optional) — an array of clause ids, each a string: the clauses the fixture tests besides the one its id leads with. It is the fixture's linking comment ([STYL.5.3.6.3]). A harness does not read it, and it does not decide whether the fixture passes.

  • [RCTS.1.2.17] dead_rules_expected (optional) — an array of rule names, each a string: the rules of rules_ds the fixture requires never to fire. A harness must fail a fixture whose array names a string that is no rule of rules_ds. Its firings are judged when its expect.kind is runtime_fact_count, temporal_sequence, adapter_calls, adapter_cache_sets, adapter_cache_deletes, adapter_mock, or a kind whose category in [RCTS.1.2.10] is logical: these kinds observe every rule that fires. For such a fixture, with or without the field, a harness must fail it when a rule the array names fires, and when a rule of rules_ds the array does not name never fires. A harness must fail a fixture of any other kind whose array is not empty, because nothing it observes can check the array.

ratified — see also: RCTS.1.2.10

  • [RCTS.1.2.20] expect.splice_field (optional, rfcs_roundtrip only) — an integer: the field number of the unknown atom a harness splices into the recording after its StreamHeader. Absent, it is 2000. A harness must fail a fixture whose splice_field is outside the skip band, 256 through 2047 ([RFCS.16.2]), or is a field of Atom's oneof body, because the spliced atom would then be read as one the reader knows and not skipped ([RFCS.16.3]). A number proto/atom.proto lists as reserved is admitted: a retired or deferred atom's number is what the field is for. A harness must fail a fixture of any other expect.kind that carries the field.

ratified — see also: RCTS.1.2.10, RFCS.16.2, RFCS.16.3

  • [RCTS.1.2.21] expect.tamper (optional, runtime_error, replay_determinism and runtime_fact_count only) — an edit a harness must make to the compiled artefact before the runtime loads it. It is a string, an object of exactly one member from a closed set, or a list of such objects.

    A string names one byte, whose lowest bit a harness must flip, leaving the stored dsc_sha256 as the compiler wrote it ([RDSC.3.6]):

    • dsc_sha256: the first byte of the header's dsc_sha256;

    • last_byte: the artefact's last byte.

    An object names one structural edit. A harness must make it and then recompute dsc_sha256 over the edited artefact as [RDSC.3.6] states, so that a refusal at load is the edit's and not the hash's. The hash it recomputes is the 32-byte field 7 of the first DscHeader atom that a walk of the artefact's frames ([RFCS.19.1]) reaches from its first byte. Where the walk reaches none, or that atom's body does not walk to such a field, there is no hash to recompute, and a harness must hand the runtime the artefact as the edit left it:

    • truncate_tail, an integer N greater than 0 and less than the artefact's length: its last N bytes are removed ([RDSC.9.7]);

    • truncate_to, an integer N of at least 0 and less than the artefact's length: it keeps its first N bytes, so N = 0 leaves it empty ([RDSC.11.1]);

    • bad_wire_type, an atom's field number F: the first byte of the body of the first atom numbered F, which begins a field's key, gets wire type 7 ([RDSC.9.5]);

    • drop_schema_group, a schema name S: the atoms of S's schema group, from its lifecycle atom through its SchemaDef, are removed ([RDSC.8.1], [RDSC.8.7]);

    • drop_terminal_parent, a rule name R: the BetaNode whose id the TerminalNode realizing R carries as parent_beta_id is removed ([RDSC.11.1]);

    • drop_call_operand, a rule name R: in the one TerminalNode realizing R, the first action that is an ACTION_CALL whose expr is a call loses the last of that call's args ([RDSC.4a.9.3]). The artefact is not refused at load for it, so the fault a fixture names comes from one of its steps.

    Four more each make one of [RDSC.11.3]'s load refusals, in the one TerminalNode realizing a rule R:

    • drop_action_expr, a rule name R: the first action of kind ACTION_CALL loses its expr;

    • clear_action_expr, a rule name R: that action's expr is replaced by an Expr with no field, so no member of its kind is set;

    • drop_assign_expr, a rule name R: the first SlotAssign of the first action of kind ACTION_ASSERT or ACTION_LOGICAL_ASSERT loses its expr;

    • nest_action_expr, an object of exactly two members, rule, a rule name R, and levels, an integer N of at least 1: the expr E of the first action of kind ACTION_CALL is replaced by an Expr whose unop is a not of operand E, N times over, so every Expr in E sits N deeper.

    Two more each set the op of one CallExpr to N, in the one TerminalNode realizing a rule R, so that the op stands at one of [RDSC.4a.9.3]'s two sites. Each is an object of exactly two members, rule, a rule name R, and op, an integer N of at least 0. A harness must write N as the call's op, its field 3, after the call's other fields, and drop the one it had:

    • set_action_op: the call that is the expr of the first action of kind ACTION_CALL whose expr is a call, so N stands as an action's expr;

    • set_assign_op: the call that is the expr of the first SlotAssign of the first action of kind ACTION_ASSERT or ACTION_LOGICAL_ASSERT, so N stands inside an expression.

    For these two, an expr that is no call, or a call with no op written, is no site.

    Two more each make the DscHeader's capabilities list one [RBND.1.3] refuses at load. A harness must edit the list in place, written packed and every entry one varint byte, so no length moves:

    • duplicate_capability, an integer I of at least 0: entry I + 1 takes entry I's value, so one capability appears twice;

    • swap_capabilities, an integer I of at least 0: entries I and I + 1 swap, so the list is not ascending.

    For these two, a list with no entry I + 1, with an entry wider than one byte, or not written packed is no site.

    One more sets one field of one atom, as no compiler writes it, so that a body refusal of [RDSC.4a.3], [RDSC.4a.6], [RDSC.4a.6.1], [RDSC.4a.9.1] or [RDSC.9.10] can be a fixture:

    • set_field, an object of exactly three members: either node, an integer N of at least 1, or atom, an array of two integers, an atom number F of at least 1 and an occurrence index I of at least 0; path, an array of integers, a field number of at least 1 and then any number of pairs of an occurrence index of at least 0 and a field number; and value, an integer of at least 0, a string, an object of exactly one member, f64, whose value is a string of 16 lowercase hexadecimal digits, or null. With node, the atom is the one AlphaNode, BetaNode or TerminalNode whose node_id is N; with atom, it is occurrence I, counted from 0, of the atoms numbered F, in the artefact's order. In that atom, each pair of a field number and an index selects that occurrence, counted from 0, of that length-delimited field of the message reached so far, and the path's last field number names a field of the last message reached. A harness must remove every occurrence of that field and then, unless value is null, write it once after that message's other fields: an integer as a varint; an f64 as the 64 bits its digits spell, most significant first, with wire type 1 and the eight octets least significant first, as a double is written; and a string as its UTF-8 octets, length-delimited, so "" also writes an empty message. A harness must re-frame every message on the path, and the atom.

    For set_field, no node or two nodes with the id N, fewer than I + 1 atoms numbered F, an occurrence the message does not carry, a selected field that is not length-delimited, or null for a field the message does not carry is no site.

    Two more remove or add whole frames, so that [RDSC.11.1]'s rows for an artefact that is not an atom container, and its framing rows, can be fixtures. Each counts the artefact's atoms from 0, by a walk of its frames from its first byte:

    • drop_atom, an integer K of at least 0: atom K's frame is removed, so K = 0 removes the DscHeader;

    • insert_bytes, an object of exactly two members: at, an integer K of at least 0, and hex, a string of an even number, at least two, of lowercase hexadecimal digits. The octets hex spells, two digits to an octet, most significant digit first, are inserted before atom K, or after the last atom when K is the number of atoms. They need not make a frame, and a fixture's scenario says what they are.

    For drop_atom, a K that is not less than the number of atoms the walk reaches is no site. For insert_bytes, a K greater than that number is no site, and so is a walk that stops before the artefact's end.

    A list names two or more of the objects above, none of them drop_call_operand, so that one artefact can carry two defects and a fixture can pin which of them a loader refuses first ([RDSC.9.5], [RDSC.8.7]). A harness must make the edits in the list's order, each to the artefact the ones before it left, and then recompute dsc_sha256 once, over the result, as [RDSC.3.6] states. Each edit must have a site in the artefact it is made to.

    On a replay_determinism fixture, tamper must be drop_call_operand, and a harness must give the edited artefact to both the engine that records and the engine that replays. The run must halt the engine ([NCBK.2.9]), and a harness must fail a fixture whose run does not; the step during which it halts is the run's outcome ([RCTS.1.2.28]). The replay must reach the end of the recording ([RFCS.6.7]) and leave the replaying engine halted by the fault that halted the recording one. A harness must not read the replaying engine's working memory: on a halted engine it is undefined ([LERR.1.4.7]) and the read is refused ([NCBK.2.9]).

    On a runtime_fact_count fixture, tamper must be an object other than drop_call_operand, or a list, so that a run on an edited artefact that must raise nothing can be a fixture ([RCTS.1.2.31]). A string's artefact is refused at load for its hash, and drop_call_operand's fault is a step's, which that kind does not observe. A harness must make the edit before add_compiled_code's, and must fail the fixture when the runtime refuses the edited artefact at load.

    A harness must fail a fixture whose tamper names no member of the set, gives a member an argument of another type, or has no site in the artefact. It must fail a list of fewer than two members, or one holding a string, a list or drop_call_operand. It must fail a replay_determinism fixture whose tamper is anything but drop_call_operand, a runtime_fact_count fixture whose tamper is a string or drop_call_operand, and a fixture of any other expect.kind that carries the field. The set grows only by a change to this clause.

ratified — see also: LERR.1.4.7, NCBK.2.9, RBND.1.3, RCTS.1.2.28, RCTS.1.2.31, RDSC.11.1, RDSC.11.3, RDSC.3.6, RDSC.4a.3, RDSC.4a.6, RDSC.4a.6.1, RDSC.4a.9.1, RDSC.4a.9.3, RDSC.8.1, RDSC.8.7, RDSC.9.10, RDSC.9.5, RDSC.9.7, RFCS.19.1, RFCS.6.7

  • [RCTS.1.2.22] witnesses (optional) — an array of strings, each <path>#<name>: a checks entry with role witness, on a clause the fixture links, whose scenario the fixture's steps and expectation are ([STYL.5.3.6.4]). A harness does not read it, and it does not decide whether the fixture passes.

  • [RCTS.1.2.23] The recording fields (each optional, rfcs_roundtrip only) — what a harness gives the engine before it records, and what it reads back from the recording, beside expected_atoms. A harness must fail a fixture whose value for one is not of the type stated here, and a fixture of any other expect.kind that carries one of them. late_start is the one exception: a replay_refused fixture carries it too ([RCTS.1.2.18]).

    • run_id and tier_id, strings: a harness must give them to the engine through the runtime's own interface before it records anything. "" is the same as absent ([NLFC.1.2]). A harness that cannot give the runtime under test an id the fixture names must fail the fixture, and must not run it without the id.

    • late_start, an integer N: a harness must attach the recorder after the first N steps, so the recording holds only what the steps after them produce. The field's range, and the refusal of first N steps that put no event on the stream, are [RCTS.1.2.18]'s.

    • expected_event_ids, an array of strings: the event_id of every FactAssert in the recording, in stream order ([LFST.5.6], [RFCS.6.8]). A harness must read each from the decoded recording, and must fail the fixture if the counts differ or any entry differs.

    • expected_fact_ids, an array of objects {"atom": A, "fact_id": N}, A one of FactAssert, FactEmit and FactWithdraw and N a non-negative integer: every atom of those three in the recording, in stream order, as its message's name and its fact_id ([RFCS.6.9]). A harness must read each from the recording, and must fail the fixture if the counts differ or any entry differs.

    • expected_emits, an array of objects {"rule_name": R}, R a string: every FactEmit in the recording, in stream order, as its rule_name ([RFCS.6a.2]), an absent field read as its protobuf default. A harness must read each from the recording, and must fail the fixture if the counts differ or any entry differs.

    • expected_publishes, an array of objects {"schema_name": S, "rule_name": R}, S and R strings: every FactPublish in the recording, in stream order, as its schema_name and its rule_name ([RFCS.27.1]), an absent field read as its protobuf default. A harness must read each from the recording, and must fail the fixture if the counts differ or any entry differs.

    • expected_cache_seeds, an array of objects {"key": K, "value_json": V, "deadline_ns": N}, K and V strings and N an integer from 0 to 2^63 − 1: every CacheSeed in the recording, in stream order, as its three fields ([RFCS.26.1]), an absent field read as its protobuf default. A harness must read each from the recording, and must fail the fixture if the counts differ or any entry differs.

    • expected_stream_kinds, an array of event kind names, as event_sequence's expected_kinds names them ([RCTS.1.2.10]): the events the stream callback receives while the steps run, cut down to the kinds the array names, must be the array, in order. Events of other kinds may come between them. With expected_atoms, it holds the recording to the events of the same run ([RFCS.3.6]).

    • expected_slots, an array of objects: every Slot atom of the schemas the objects name in schema_name, in stream order, each as the fields present on it, by their proto/slot.proto names, an enum by its number ([RFCS.5.1]).

    • expected_withdraw_causes, an array of strings: the cause of every FactWithdraw in the recording, in stream order, by its name in FactWithdraw.Cause, or CAUSE_<n> for a number the enum does not name ([RFCS.7a.2]).

    • rewrite_withdraw_cause, an object {"index": I, "cause": N} of two non-negative integers: before anything decodes the recording, a harness must re-encode its I-th FactWithdraw, counting from 0 in stream order, with cause N, and keep every other field and atom. A harness must fail a fixture whose run records no I-th FactWithdraw.

ratified — see also: LFST.5.6, NLFC.1.2, RCTS.1.2.10, RCTS.1.2.18, RFCS.26.1, RFCS.27.1, RFCS.3.6, RFCS.5.1, RFCS.6.8, RFCS.6.9, RFCS.6a.2, RFCS.7a.2

  • [RCTS.1.2.9] platform_dependent (optional) — true marks a boundary scenario excluded from cross-platform comparison ([LCON.3]).

see also: LCON.3

[RCTS.1.2.10]

expect.kind

Category

A runtime passes when

compile_ok

compiler

the program compiles with no diagnostic

compile_error

compiler

compilation fails with the stated code, and with no other error code but those expect.also_raises lists ([RCTS.1.2.36])

dsc_dialect_binding

compiler

SHA-256 of expect.expected_serialization is expect.expected_dialect_def_sha256, and the compiler's .dsc for the program carries that digest as its DscHeader's dialect_def_sha256 ([RBND.4.2]). A fixture lacking either string is malformed

dsc_dnam_templates

compiler

for each rule expect.expected_dnam maps to a string, the compiler's .dsc for the program holds a RuleDebugName for that rule whose name_template contains the string, and no rule expect.absent_rules lists has a RuleDebugName ([RDSC.6.8]). A fixture carrying neither field, or either in another shape, is malformed

dsc_equivalent

compiler

the program and expect.equivalent_ds both compile, the program's .dsc holds a TerminalNode, and the two .dsc are byte-identical once every DsSource, LineSpan, DocString and DscHeader atom is removed. A fixture with no equivalent_ds string is malformed

dsc_field_order

compiler

the compiler's .dsc for the program writes every message's fields in ascending field-number order, a field that is not repeated at most once ([RCTS.1.2.19])

dsc_sdef_roundtrip

compiler

the compiler's .dsc for the program holds, for each schema expect.schemas names, a SchemaDef carrying a proto_source; and every SchemaDef carrying one declares one message, whose Nth field is numbered N and stands for its schema's Nth Slot, with no field or Slot left over ([LFST.8.10]). A field is optional exactly when its Slot is nullable, and of the proto3 type [RDSC.5.8.7] gives its Slot's kind ([RDSC.5.8.3], [RDSC.5.8.6]). A fixture whose schemas is absent, empty or not a list of strings is malformed

dsc_term_order

compiler

the compiler's .dsc for the program holds a TerminalNode; the TerminalNodes' rule names, in emission order, are expect.expected_terminal_order, and none carries a field whose number expect.forbidden_term_fields lists ([RLOW.14.3]). A fixture carrying neither field, or either in another shape, is malformed

dsc_test_cases

compiler

the program, compiled from files ([RCTS.1.2.35]), compiles, and its .dsc holds a TestCase for each entry of expect.test_cases and for nothing else, in the entries' order. Each entry is an object of exactly test_id, a positive integer, name, a string, and module, a string: the TestCase's test_id and name, and the dotted name of the library whose module it belongs to, or "" for the program's, read through its module_id and that module's DsSource ([RDSC.4.7]). A fixture whose test_cases is absent or not such a list is malformed

malformed_fixture

compiler

the harness refuses the fixture as malformed under the clause expect.reason names, and drives no runtime ([RCTS.1.2.15])

runtime_fact_count

runtime

after the stated asserts and optional pump, working memory holds the stated number of facts

runtime_error

runtime

the load, a cache seed or an input is refused with the stated status code, and the refusal satisfies the fixture's other fields ([RCTS.1.2.25])

replay_determinism

runtime

a recorded session replayed into a fresh engine reproduces the recorded stream byte for byte

replay_refused

runtime

a recorded session altered by the stated mutation is refused by the runtime's replayer with the stated status code, and the unaltered session is not ([RCTS.1.2.18])

field_order

runtime

the runtime's recording of the stated session writes every message's fields in ascending field-number order, a field that is not repeated at most once ([RCTS.1.2.19])

clone_determinism

runtime

an engine cloned mid-run and driven identically to its source produces the same stream, and either survives the other being freed

pbf_framing

runtime

the framing vectors encode and decode to the stated bytes

rfcs_roundtrip

runtime

a recorded session encodes to a fact stream and decodes back unchanged; where expect.expected_first_seq is given, the seq of the stream's first event atom is that value; where expect.expected_call_correlations is given, the correlation of each recorded CallIssued, in stream order, is that list. The unknown atom spliced in is numbered as [RCTS.1.2.20] says

rfcs_artefact_strip

runtime

a stream decodes with and without the rule artefact, differing only where typed slots need it

hash_order_independence

runtime

rule-fire order and fact count are the same for every stated insertion order

temporal_sequence

temporal

after a sequence of asserts, pumps and clock steps, working memory holds the stated number of facts

event_sequence

logical

the stream's events of the stated kinds are exactly the stated kinds, in order; events of other kinds may come between them

event_sequence_strict

logical

the stream is exactly the stated event kinds

event_seq_monotonic

logical

stream seq strictly increases, by the stated step and with the stated clocks where given

event_kinds_forbidden

logical

none of the stated event kinds appears

rule_fire_order

logical

rules begin firing in exactly the stated order

log_message_sequence

logical

log actions produce exactly the stated messages, in order

header_field_eq

logical

the session header's fields have the stated values

introspection_assert

logical

every stated check holds on the introspection surface it names ([RCTS.1.2.26])

cross_tier_fact_counts

cross-tier

each labelled engine holds the stated number of facts

cross_tier_per_engine_event_counts

cross-tier

each labelled engine's stream carries the stated count of each event kind

adapter_calls

adapter

the call callback receives exactly the stated calls, in order; where expect.expected_pump_statuses is given, each pump reports the stated status ([RCTS.1.2.30])

adapter_cache_sets

adapter

the cache-set callback receives exactly the stated sets, in order

adapter_cache_deletes

adapter

the cache-delete callback receives exactly the stated deletes, in order

adapter_mock

adapter

with the stated call responses mocked, the stated outcome follows

hydration_runtime

adapter

with a mock integrator answering hydration requests, the stated outcome follows

adapter_essential_null_cb_error

adapter

with an essential callback unregistered, the pump fails with the stated message

adapter_cache_volatile_no_cb

adapter

with no cache persistence callback, the cache verb succeeds and still emits its action

ratified

[RCTS.1.2.11] The set of kinds is closed. A fixture's expect.kind must be a name in [RCTS.1.2.10], and adding a kind is a change to that table. A deprecated fixture ([RCTS.1.2.12]) is not run, and keeps the kind it was written with, whether or not the table still names it. Each kind's fields — what it reads besides kind, and how it compares them to what the runtime observes — are to be specified here, one kind at a time. These kinds' fields are specified whole: malformed_fixture ([RCTS.1.2.15]), replay_refused ([RCTS.1.2.18]), field_order and dsc_field_order ([RCTS.1.2.19]), runtime_error ([RCTS.1.2.25]), introspection_assert ([RCTS.1.2.26]), runtime_fact_count and temporal_sequence ([RCTS.1.2.31]), rule_fire_order, log_message_sequence, event_sequence, event_sequence_strict and event_kinds_forbidden ([RCTS.1.2.32]), and event_seq_monotonic and header_field_eq ([RCTS.1.2.33]). Every other kind's fields are unspecified, but for those a clause here names, and this clause records the gap.

see also: RCTS.1.2.10, RCTS.1.2.12, RCTS.1.2.15, RCTS.1.2.18, RCTS.1.2.19, RCTS.1.2.25, RCTS.1.2.26, RCTS.1.2.31, RCTS.1.2.32, RCTS.1.2.33

[RCTS.1.2.15] malformed_fixture: a vector the harness must refuse. A fixture whose expect.kind is malformed_fixture carries one more field, expect.reason: the id of the clause of this document under which the fixture is malformed, as a string (for example "RCTS.1.2.14"). Its subject is the harness, not a runtime: it pins that a harness refuses what the format makes malformed.

A harness must check every fixture against the format before it compiles the program or drives a runtime, and must name, in each such refusal, the clause the fixture breaks. It passes a malformed_fixture fixture only when it refuses it under the clause expect.reason names. It must fail the fixture if it accepts it, or if it refuses it under any other clause. It drives no runtime for it.

ratified — see also: RCTS.1.2.14

[RCTS.1.2.18] replay_refused: a recording the replayer must refuse. A fixture whose expect.kind is replay_refused carries steps, the session's inputs; code, the status the refusal must carry, as the negative integer in a string; and exactly one of mutation, an object; late_start, an integer; and replay_cache_cap, an object. A harness must record the session with the runtime's own recorder, alter the recording as mutation or late_start says, and replay it into a fresh engine with the runtime's own replayer, bounded as replay_cache_cap says. The runtime passes only when the unaltered recording replays with no refusal into a fresh engine with no cache bound, and the altered one is refused with code. A harness must fail a fixture with more or fewer than one of the three, and a fixture of any other expect.kind that carries replay_cache_cap.

replay_cache_cap alters the engine the recording is replayed into, not the recording. It is an object as [RCTS.1.2.25]'s cache_cap is, and a harness must set its bounds on that engine before the load, and on no other. The recording engine has none, so a CacheSeed it recorded can be one the replaying engine refuses ([RFCS.26.2]).

late_start: N alters when the recording begins, not what it holds. A harness must run the first N steps on the writer before its recorder is attached and record only the steps after them, so the recording begins part-way through the run and its first event's seq is not 0 ([LTIM.2.8.5], [LFST.5.3]). The unaltered recording is the same session recorded from its first step. A harness must fail a fixture with a late_start that is not an integer from 1 to one less than the number of steps, or first N steps that put no event on the stream, after which the recording would begin at seq 0.

mutation's op is one of a closed set, each member tied to the reader clause the altered recording breaks. Every member but drop_schema_def, drop_fault and append_engine_error keeps every length in the recording; those three remove or add whole atoms and change no byte of any other atom:

  • rename_schema, with from and to, two schema names of one length in UTF-8: every occurrence of from's bytes in the recording is replaced by to's, so the recording asserts a schema the program does not hold ([RFCS.5.4]);

  • retract_unknown_fact_id: the fact_id of the recording's first FactRetract, one varint byte, is replaced by 127, an id no FactAssert or FactEmit in the recording carries ([RFCS.7.3]);

  • merge_timetags, with firings, two integers i < j: the i-th and j-th RuleFireAnnotations of the recording, counting from 0 in stream order; every occurrence of the j-th's timetag, in a RuleFireAnnotation, CallIssued, ComputationError or BoundsError, is replaced by the i-th's, so two firings the engine keeps apart share one timetag and the pairing breaks ([LFST.9.3.6]);

  • split_timetag, with atom, an integer from 0: the timetag of the atom-th CallIssued of the recording, counting from 0 in stream order, is replaced by the least nonzero value of the same varint width that no RuleFireAnnotation, CallIssued, ComputationError or BoundsError in the recording carries, so one firing's atoms carry two recorded timetags and its one re-derived timetag meets a second recorded one: [LFST.9.3.6]'s second direction, which merge_timetags does not reach;

  • unknown_capability: the first entry of the recording's StreamHeader capabilities is replaced by 127, a number Capability does not allocate, so the header lists something that is no member ([RBND.1.3]);

  • withdraw_cause, with index, an integer from 0, and cause, an integer from 1 to 127: the index-th FactWithdraw of the recording, counting from 0 in stream order, has its cause, one varint byte, replaced by cause, so the recorded withdrawal differs from the one the replayer re-derives. A reader carries a cause the enum does not hold ([RFCS.7a.2]), and the atom is compare class ([RFCS.7a.3]), so the refusal is the comparison's, not the decoder's;

  • publish_name, with index, an integer from 0; field, schema_name or rule_name; and to, a string: that field of the index-th FactPublish of the recording, counting from 0 in stream order, is replaced by to's UTF-8 octets, so the recorded publish differs from the one the replayer re-derives ([RFCS.27.2]);

  • seed_after_event: the recording's first CacheSeed is moved, its frame whole, to just after the first atom that is neither the StreamHeader, a SchemaDef, a Slot nor a CacheSeed, so a seed follows an event atom, which no recorder writes ([RFCS.26.2]);

  • fault_node, with atom, TypeError or ComputationError: the node_id of the recording's first such atom, one varint byte, is raised by one, so the recorded fault differs from the one the replayer re-derives ([LFST.9.3.1]);

  • drop_fault, with atom, as fault_node's: the recording's first such atom is removed, its frame whole, so the replayer re-derives a fault the recording lacks ([LFST.9.3.1]);

  • append_engine_error: an EngineError with fault 1, seq 999 and rule_name r is added after the recording's last atom, so the recording holds a fault the replayer does not raise ([RFCS.6.7]);

  • drop_schema_def, with schema, a schema name S: every SchemaDef atom whose schema_name is S, and every Slot atom whose schema_name is S, is removed, and every FactAssert naming S is kept, so the recording asserts a schema it never announced ([RFCS.5.3], [RFCS.5.4]).

A harness must fail a fixture whose mutation names no member of the set, or has no site in the recording: no from to rename, no FactRetract, a fact_id wider than one byte, an id 127 the recording carries, an ExternalAssert, whose fact_ids the second member does not read, no i-th or j-th RuleFireAnnotation, two that already share a timetag, two timetags whose varints differ in width, no atom-th CallIssued, one whose timetag is not written, no free value of its width, a StreamHeader whose capabilities are not written packed or begin with an entry wider than one byte, no index-th FactWithdraw, one whose cause is not written (proto3 writes no default) or is wider than one byte, a cause equal to the one it would replace, no index-th FactPublish, one whose field is not written, a to of another length in UTF-8 than the value it would replace or equal to it, no CacheSeed, no such event atom after the first, no SchemaDef for S, no FactAssert naming S, no such fault atom, an atom of another name, a node_id not written, wider than one byte or of 127, a recording that does not walk to its end for the last two members, or one that already holds an EngineError for the last. The set grows only by a change to this clause.

ratified — see also: LFST.5.3, LFST.9.3.1, LFST.9.3.6, LTIM.2.8.5, RBND.1.3, RCTS.1.2.25, RFCS.26.2, RFCS.27.2, RFCS.5.3, RFCS.5.4, RFCS.6.7, RFCS.7.3, RFCS.7a.2, RFCS.7a.3

[RCTS.1.2.19] field_order: a recording's fields in the order its writer must write them. A fixture whose expect.kind is field_order carries two more fields: steps, the session's inputs as [RCTS.1.2.28] states them; and atoms, a list of names of messages the Atom oneof holds. A harness must fail the fixture when its recording holds no atom of a name atoms lists, so that each is shown to be walked. A harness must record the session with the runtime's own recorder and walk the recording from its Stream message by the field types proto/ declares: each length-delimited field whose type is a message is walked as that message, and each fact body (FactAssert.fact, FactEmit.fact) is walked as a message of one scalar field per slot ([RDSC.5.8.3]). The runtime passes only when, in every message the walk reaches, each field's number is at least the number of the field before it, and a field that is not repeated appears at most once ([RFCS.19.5]).

Before it judges the recording, a harness must alter a copy of it: in the first atom body whose first two fields have different numbers, those two fields swap places, which keeps every length. A harness must fail the fixture when its walk does not refuse that copy, or when no atom body has two such fields.

A fixture whose expect.kind is dsc_field_order binds the other container ([RFCS.19.1]) and the compiler: it carries atoms and no steps. A harness must compile rules_ds with the compiler under test and judge the .dsc it writes as this clause judges a recording, walked from its Dsc message in place of Stream, and with the same altered copy refused first. The compiler passes only when every message the walk reaches keeps both rules above.

see also: RCTS.1.2.28, RDSC.5.8.3, RFCS.19.1, RFCS.19.5

Expected results [RCTS.1.3]#

[RCTS.1.3.1] A fixture's expected result is its expect, written from the clause it pins. Where a category compares runs rather than checking a stated result — a replay against its recording ([LCON.2]), or one platform against another ([LCON.1.3]) — expect names that comparison, as replay_determinism does.


see also: LCON.1.3, LCON.2

  • [RCTS.1.2.24] expect.timetag_offset (optional, replay_determinism only) — a positive integer N. Before the replay, a harness must add N to every nonzero timetag the recording's RuleFireAnnotation, CallIssued, ComputationError and BoundsError atoms carry, re-frame each atom it changes, and replay the result with the runtime's own replayer. A timetag is stream-local and compared by its pairing ([RFCS.11.2], [LFST.9.3.6]), so the fixture passes as a replay_determinism fixture without the field does. A harness must fail a fixture whose timetag_offset is not a positive integer, or whose recording carries no nonzero timetag, and must fail a fixture of any other expect.kind that carries the field.

ratified — see also: LFST.9.3.6, RFCS.11.2

  • [RCTS.1.2.25] runtime_error's fields — a fixture whose expect.kind is runtime_error pins a refusal. A harness must load the compiled artefact, edited as tamper says ([RCTS.1.2.21]), into a fresh engine, seed its cache as cache_seeds says, and give it the inputs in order until one is refused. The runtime passes only when the load, a seed or an input is refused, and the refusal satisfies every field below that the fixture carries.

    • code (required), a string: the status the refusal carries, as the negative integer in a string.

    • message_contains, a string or a non-empty array of strings: the refusal's text contains it, or each of them. A harness for a runtime that reports a refusal's reason as a value, not as text, must map each reason it can report onto one text, and must fail a fixture whose refusal has a reason it does not map.

    • steps, an array of objects, the session's inputs as [RCTS.1.2.28] has them, run on the harness's mock clocks; or asserts, an array of objects, each one assert, and pump, a boolean: those asserts in order, then one pump when pump is true. A fixture with none of the three has the load as its only input.

    • cache_seeds, an array of objects, each {"key": K, "value": V}, {"key": K, "text": T} or {"key": K, "text_bytes": H}, K and T strings, V any JSON value and H octets as two hex digits each, none of them 00: after the load and before the first input, each is seeded under K, in order ([NLFC.9.1]). T is given to the runtime as the seed's JSON text exactly as written, which states a text no JSON value is read back as, such as an integer literal outside int64 ([LGRA.5.8.9]). H is given as the seed's JSON text, its octets unchanged, which need not be well-formed UTF-8: it states a text [LSTR.8.5] refuses, which no JSON string can. H holds no 00 octet: a U+0000 is [LSTR.1.5]'s refusal, which a binding makes before the call, so no harness could hand it over unchanged. V is given as JSON text with its members in the fixture's order, , between items, : after a key, and every character outside U+0020 to U+007E escaped: \", \\, \b, \f, \n, \r and \t for those seven, and \u with four lower-case hex digits for the rest, as a surrogate pair above U+FFFF. So a limit on the text's length ([LGRA.5.8.6]) is met or broken alike in every harness. runtime_fact_count takes the field too.

    • cache_cap, an object whose members are among keys and bytes, each a non-negative integer: the engine's cache bounds, set before the load. A member that is absent or 0 sets no bound ([LSTO.4.7.5]).

    • fault_at, a non-negative integer: the input that must be refused, counted from 0, in steps, or in asserts with the pump after the last of them. Every input before it must be accepted. A refusal at the load or at a seed is at no input.

    • no_fault_events, a boolean: when true, the stream carries no TypeError, BoundsError, ComputationError or EngineError event once the refusal has happened ([NCBK.2.8]).

    • fault_events, an array of the names type_error, bounds_error, computation_error and engine_error: the stream's events of those four kinds, in stream order, are exactly the array.

    • fact_count_after, a non-negative integer: the facts live in working memory once the refusal has happened ([LERR.1.5]). Working memory is neither defined nor readable on a halted engine ([LERR.1.4.7], [NCBK.2.9]), so a harness must fail a fixture that carries it and whose refusal leaves the engine halted.

    • halted_fault, the name of a member of EngineFault (proto/engine_fault.proto): once the refusal has happened the engine has halted ([NCBK.2.9]), and its halt latch reports that fault ([NCBK.2.11]).

    • last_event, one of the names fault_events takes: the last event on the stream once the refusal has happened is of that kind. With engine_error it pins that the EngineError is the tier's last record ([LERR.1.4.7]).

    A harness must fail a fixture with no code, one whose value for any of these fields is not of the type stated here, one with steps and either of asserts and pump, one whose halted_fault names no member of EngineFault, and one that carries both halted_fault and fact_count_after. It must fail a fixture of any other expect.kind that carries fault_at, no_fault_events, fault_events, cache_cap, halted_fault or last_event.

ratified — see also: LERR.1.4.7, LERR.1.5, LGRA.5.8.6, LGRA.5.8.9, LSTO.4.7.5, LSTR.1.5, LSTR.8.5, NCBK.2.11, NCBK.2.8, NCBK.2.9, NLFC.9.1, RCTS.1.2.21, RCTS.1.2.28

  • [RCTS.1.2.26] introspection_assert's fields — a fixture whose expect.kind is introspection_assert carries steps, the session's inputs as [RCTS.1.2.28] has them, and checks, a non-empty array of checks. A harness must run the steps, then read each check through the runtime's introspection surface ([LCON.4.5.1]). The runtime passes only when every check holds.

    A check is an object whose surface names one member of a closed set, and which carries exactly the members that surface takes:

    • fact_count, with equals, a non-negative integer: working memory holds that many live facts.

    • justifiers, with fact_id, a positive integer, and expect_rules, an array of rule names: the rules justifying that fact, by name and counted with repeats, are the array's.

    • justifier_count, with fact_id and count, a non-negative integer: that fact has that many justifications.

    • rete_network, with min_nodes and min_edges, non-negative integers: the network has at least that many nodes and at least that many edges.

    • slot_schema_ref, with schema and slot, strings, and equals, a string or null: the loaded schema schema's slot slot names the schema equals as its reference, or none when equals is null ([RDSC.5.5.5]). The check fails when no such slot is loaded.

    A fact_id names a fact by the id the runtime gave it ([RFCS.6.9]).

    add_schema_ref (optional, introspection_assert only) is an object of exactly three strings, schema, slot and ref. Before the load, a harness must give the compiled artefact's one Slot atom for schema's slot slot a schema_ref of ref, written in ascending field order ([RFCS.19.5]), re-frame the atom, and recompute dsc_sha256 as [RDSC.3.6] states. No compiler writes a schema_ref on a slot that is not a schema slot ([RDSC.5.5.5]), so this is how a fixture gives a runtime one to ignore. A harness must fail a fixture whose artefact holds no such Slot, more than one, or one that already carries a schema_ref.

    A harness must fail a fixture whose checks is not a non-empty array of objects; a check whose surface names no member of the set, or that lacks a member its surface takes, carries one it does not take, or gives one a value of another type; and an add_schema_ref of another shape. It must fail a fixture of any other expect.kind that carries add_schema_ref. The set grows only by a change to this clause.

ratified — see also: LCON.4.5.1, RCTS.1.2.28, RDSC.3.6, RDSC.5.5.5, RFCS.19.5, RFCS.6.9

  • [RCTS.1.2.27] A refused assert (optional, rfcs_roundtrip only) — an assert step of an rfcs_roundtrip fixture's steps may carry refused, the status the runtime must refuse that assert with, as the negative integer in a string, as runtime_error's code is ([RCTS.1.2.25]). A harness must give the runtime the assert, must fail the fixture unless the runtime refuses it with that status, and must then go on to the next step. A bounds refusal of a host assert is recorded ([RFCS.6.7]), so this is how a fixture holds the recording of one to what follows it. An assert step without refused that the runtime refuses fails the fixture.

    A harness must fail a fixture whose refused is not a string, one that carries refused on a step that is not an assert, and one of any other expect.kind that carries refused on a step.

see also: RCTS.1.2.25, RFCS.6.7

  • [RCTS.1.2.28] The session's inputs — wherever a fixture's expect carries an array of steps (steps, and clone_determinism's after_clone and after_free), each step is an object whose op names one member of a closed set, and which carries exactly the members that op takes. A harness must give the runtime under test each step in order, through the runtime's own interface, on the harness's mock clocks:

    • assert, with schema, a string, and optionally slots, an object; as, a string; corr_from_call, a non-negative integer; and refused ([RCTS.1.2.27]). It is a host assert of a fact of schema whose slots have slots' values. A Bytes value is written {"$bytes": H}, H its octets as two hex digits each, and nothing else. A String value may be written {"$text_bytes": H}, H its text's octets as two hex digits each, none of them 00 ([LSTR.1.5]), which need not be well-formed UTF-8: a harness must give the runtime those octets as the slot's text, unchanged, which is how a fixture hands the engine text [LSTR.8.5] refuses, and must fail a fixture that gives the form to a slot of another kind. With as, the fact the assert answers with is kept under that label. With corr_from_call N, the corr slot takes the correlation the N-th call issued so far carried, counting from 0 in the order the calls were issued ([LCCO.3.4]); a harness must fail the fixture when fewer than N + 1 calls have been issued.

    • retract, with label, a string: a host retract of the fact kept under that label. A harness must fail the fixture when no earlier assert kept one under it.

    • pump, with nothing else: one pump.

    • advance, with delta_ns, a non-negative integer: the mock clock is advanced by that many nanoseconds ([NTST.3.1]).

    • set, with now_ns, a non-negative integer: the mock clock is set to that instant ([NTST.3.1]).

    • wall_set, with utc_ns, an integer: the wall clock alone is set to that instant ([NTST.3.1]).

    • cache_seed, with key, a string, and value, any JSON value, and optionally ttl_ns, an integer from 0 to 2^63 − 1: value is seeded under key ([NLFC.9.1]), given as [RCTS.1.2.25] gives a cache_seeds entry's, with ttl_ns as the seed's TTL in engine-clock nanoseconds, which counts from the engine's first sample ([NLFC.9.4]). An absent ttl_ns, or 0, is a seed with no expiry.

    A harness must fail a fixture when the runtime refuses one of its steps (a set below the current instant, [NTST.3.1]; a cache_seed after the engine's first stream event, [NLFC.9.2]; an assert past a bound), except a refusal the fixture pins: a runtime_error fixture's ([RCTS.1.2.25]), an assert's that carries refused ([RCTS.1.2.27]), a pump's under an adapter kind whose row states the pump's outcome ([RCTS.1.2.10]), a pump's in a fixture that carries expected_pump_statuses ([RCTS.1.2.30]), and, in a replay_determinism fixture that carries tamper, the step during which the engine halts, which must be the fixture's last ([RCTS.1.2.21]).

    A cross-tier fixture's steps take more ([RCTS.1.2.29]). A harness must fail a fixture whose array of steps is not an array of objects, and one with a step whose op names no member of the set, or that lacks a member its op requires, carries one it does not take, or gives one a value of another type, or gives a slot an object with a $bytes or a $text_bytes member that is not its form above. A deprecated fixture is not run ([RCTS.1.2.12]), so its steps are not judged. The set grows only by a change to this clause.

ratified — see also: LCCO.3.4, LSTR.1.5, LSTR.8.5, NLFC.9.1, NLFC.9.2, NLFC.9.4, NTST.3.1, RCTS.1.2.10, RCTS.1.2.12, RCTS.1.2.21, RCTS.1.2.25, RCTS.1.2.27, RCTS.1.2.29, RCTS.1.2.30

  • [RCTS.1.2.29] A cross-tier fixture — a fixture in the cross-tier category ([RCTS.1.1.4]) carries expect.engines, an object of at least one member: each member's name is an engine's label, and its value an object of rules_ds, a string, that engine's program, and optionally wall_clock, the string "unset". A harness must compile and load each program into an engine of its own, on mock clocks of its own and with a stream callback of its own, and must run each step on the engine its engine member, a label, names. A harness must leave the mock wall clock of an engine whose entry carries wall_clock unset, as [RCTS.1.2.32] has it for a logical fixture, until a wall_set step on that engine gives it a value ([LTIM.2.8.3]). Besides [RCTS.1.2.28]'s ops, a step of a cross-tier fixture may be:

    • forward, with from, a label: every fact the from engine published since the last forward from it to this engine ([NCBK.10.1]) is asserted into this engine, under its schema's name and with its slot values, in publication order. A harness must read the name and the values from the publish event while its callback runs ([NCBK.2.5]): the fact is in no working memory of the from engine ([LTIE.4.3]). Nothing else crosses ([NCBK.10.3]).

    • forward_external, with from, a label: every FactExternal the from engine's publications carried ([RFCS.23.1]), since the last forward_external from it to this engine, is given to this engine's own receiving interface ([NCBK.10.4]), in publication order.

    A cross-tier fixture's expect may carry expected_published_asserted_at, an object: each member's name is an engine's label, and its value an array with one entry for each fact that engine published while the steps ran, in publication order. The entry is the asserted_at of the FactExternal the publication carried ([RFCS.23.1], [RFCS.23.5]), an integer, or null where its has_asserted_at is false. A harness must read each from the record the publish event carried, and must fail the fixture when one of those publications carried no record, when the counts differ, or when an entry differs.

    A harness must fail a cross-tier fixture whose engines is not such an object, one whose expected_published_asserted_at is not such an object or names a label engines does not, and one with a step that carries no engine, or whose engine or from names no label. It must fail a fixture of any other category that carries engines or expected_published_asserted_at, or a step that carries engine or takes either op.

see also: LTIE.4.3, LTIM.2.8.3, NCBK.10.1, NCBK.10.3, NCBK.10.4, NCBK.2.5, RCTS.1.1.4, RCTS.1.2.28, RCTS.1.2.32, RFCS.23.1, RFCS.23.5

  • [RCTS.1.2.30] expect.expected_pump_statuses (optional, adapter_calls, replay_determinism, cross_tier_fact_counts and cross_tier_per_engine_event_counts only) — an array of integers, one for each pump step of steps, in order: 0 for a pump the runtime completes with no error, and otherwise the status the pump reports: the negative integer a runtime_error fixture's code carries for it, as a number and not a string ([RCTS.1.2.25]). In a cross-tier fixture ([RCTS.1.2.29]) the pump steps are every engine's, in the order of steps, and each entry is the status of the engine its step names. With the field, a pump the runtime refuses is not a refused step ([RCTS.1.2.28]): a harness must compare its status with its entry and go on to the next step. A harness must fail the fixture when the array's length is not the number of pump steps, or when a pump's status is not its entry. Without the field, a pump the runtime refuses fails the fixture ([RCTS.1.2.28]).

    On a replay_determinism fixture the field states the recorded run's pumps, a status a replay continues past ([RFCS.6.7]). The replay is judged as without the field. Such a fixture carries no tamper, whose run ends at the step that halts it ([RCTS.1.2.21]).

    A harness must fail a fixture whose expected_pump_statuses is not an array of integers each 0 or less, a replay_determinism fixture that carries both it and tamper, and a fixture of any other expect.kind that carries the field.

ratified — see also: RCTS.1.2.21, RCTS.1.2.25, RCTS.1.2.28, RCTS.1.2.29, RFCS.6.7

  • [RCTS.1.2.31] runtime_fact_count's and temporal_sequence's fields — a fixture of either kind pins how many facts working memory holds after its inputs. A harness must load the compiled artefact into a fresh engine on the harness's mock clocks and give it the inputs below, in order, through the runtime's own interface. The runtime passes only when working memory then holds fact_count_after live facts.

    • fact_count_after (required), a non-negative integer.

    • runtime_fact_count's inputs, each optional, in this order: cache_seeds, as [RCTS.1.2.25] has it; asserts, an array of objects, each a host assert carrying schema, a string, and optionally slots, an object, as an assert step carries them ([RCTS.1.2.28]); generate_asserts, an array of objects of schema and slot_name, strings, count, a non-negative integer, and optionally start, an integer, 0 when absent, each standing for count host asserts of schema, whose slot slot_name holds start, start + 1, and so on, in that order; and one pump, when pump, a boolean, is true. A fixture with none of them has the load as its only input.

    • temporal_sequence's inputs: steps, the session's inputs as [RCTS.1.2.28] has them.

    • tamper (optional, runtime_fact_count only), an edit a harness must make to the compiled artefact before the load, as [RCTS.1.2.21] has it for this kind.

    • add_compiled_code (optional, runtime_fact_count only), an object of exactly one member, node, an integer N of at least 1. Before the load, and after tamper's edit, a harness must append to the compiled artefact, after its last atom, one CompiledCode atom for each of the arch values amd64, arm64, rv64g and rv64gc, in that order, each with node_id N, kind CODE_KIND_RHS and a body of 64 octets of 0, its fields in ascending order ([RFCS.19.5]), and then recompute dsc_sha256 as [RDSC.3.6] states. No compiler of this edition writes the atom ([RDSC.4c.3]), so this is how a fixture gives a runtime one for the architecture it runs on. A harness must fail a fixture whose artefact holds no TerminalNode whose node_id is N, or more than one.

    A harness must fail a fixture of either kind with no fact_count_after, and one whose value for any of these fields is not of the type stated here. It must fail a fixture of any other expect.kind that carries add_compiled_code.

ratified — see also: RCTS.1.2.21, RCTS.1.2.25, RCTS.1.2.28, RDSC.3.6, RDSC.4c.3, RFCS.19.5

  • [RCTS.1.2.32] The event-list kinds' fields, and wall_clock — a fixture whose expect.kind is rule_fire_order, log_message_sequence, event_sequence, event_sequence_strict or event_kinds_forbidden carries, optionally, steps, the session's inputs as [RCTS.1.2.28] has them, and one required array of strings, which its row in [RCTS.1.2.10] compares with the run: expected_rule_names for rule_fire_order, the names of the rules in the order they begin firing; expected_messages for log_message_sequence, the messages of the log actions in the order they run; expected_kinds for event_sequence and event_sequence_strict, and forbidden_kinds for event_kinds_forbidden, each a list of stream event kinds by name. A harness must give the steps to a fresh engine on the harness's mock clocks, then make that comparison. It must fail a fixture of these kinds that lacks its array, or whose array is not an array of strings.

    A fixture of a kind whose category in [RCTS.1.2.10] is logical may carry wall_clock, the string "unset". A harness must then leave the mock wall clock unset, where it otherwise sets it to the Unix epoch, because the unset wall clock is the fixture's subject ([LTIM.2.8.3]). A harness must fail a fixture whose wall_clock is any other value, and a fixture of a kind of another category that carries it.

ratified — see also: LTIM.2.8.3, RCTS.1.2.10, RCTS.1.2.28

  • [RCTS.1.2.33] event_seq_monotonic's and header_field_eq's fields — a fixture of either kind carries, optionally, steps, the session's inputs as [RCTS.1.2.28] has them. A harness must give them to a fresh engine on the harness's mock clocks, then judge what follows.

    event_seq_monotonic judges the stream's events, or, when filter_kind, a string, is given, only the events of that kind. The runtime passes only when their seq strictly increases; there are at least min_events, a non-negative integer, 1 when absent; with expected_seq_step, a positive integer, each seq is the one before it plus that step; and with expected_clocks, an array of non-negative integers, the first events' clock_ns, as many as the array has, are the array.

    header_field_eq judges the session header ([RFCS.4.1]) through checks, a required, non-empty array of checks. A check is an object of field, one of ds_version, session_id, tier_id and dsc_hash, and exactly one assertion: equals, a string, on a field other than dsc_hash, which holds when the field is that string; present, a boolean, which holds when the field's being non-empty is that boolean; or byte_len, a non-negative integer, on dsc_hash alone, which holds when the hash has that many bytes. The runtime passes only when every check holds.

    A harness must fail a fixture of either kind whose value for any of these fields is not of the type stated here, and a header_field_eq fixture with no checks, an empty one, or a check of another shape.

ratified — see also: RCTS.1.2.28, RFCS.4.1

  • [RCTS.1.2.34] compile_error's expected_line ([RCTS.1.2.10]) — a positive integer: the line of rules_ds, counting from 1, at which the refusal carrying the fixture's code begins. A code names a class of refusal, and DS_PARSE_GENERIC names nearly every parse refusal, so the code alone holds only that the program is refused. The line holds where. The field is optional, but a fixture whose code is DS_PARSE_GENERIC must carry it. A harness must fail the fixture unless the compiler, refusing the program with code, reports that refusal, or one of its refusals with code, as beginning on that line. It must fail a fixture of any other expect.kind that carries the field, one whose value is not a positive integer, and a DS_PARSE_GENERIC fixture without it.

ratified — see also: RCTS.1.2.10

  • [RCTS.1.2.35] files (optional, compiler fixtures only) — an object mapping a path to the text of a .dstest file, which a harness must place beside the program or a library, so that a fixture can give a module its companion, or put a file beside it that is no module's companion ([LTSL.2.4]). A path is one or more segments joined by /, each one or more ASCII letters, digits and _, not beginning with a digit; the last is followed by .dstest.

    A harness must compile a fixture that carries files, and every dsc_test_cases fixture ([RCTS.1.2.10]), from files on disk, with the compiler's own compile ([RCLI.1.2]), so that which .dstest files the compile reads is the compiler's choice and not the harness's. In an empty directory D it must write the program as D/main.ds, each libraries entry as the file [LIMP.3.1.4] resolves its name to under D/lib ([RCTS.1.2.13]), and each files entry at its path under D. It must then compile D/main.ds with D/lib on the search path, the standard library after it ([RCTS.1.2.14]), and its dialects registered ([NDLC.2.1]). The program is compiled as written, with no use line supplied, so its use line is its own ([LDIA.2.10.1]).

    A harness must fail a fixture that carries files and whose category is not compiler, or whose expect.kind is not compile_ok, compile_error or dsc_test_cases. It must fail one whose files is not an object whose every value is a string, or names a path in another form, and a fixture it compiles from files whose program has no use line.

ratified — see also: LDIA.2.10.1, LIMP.3.1.4, LTSL.2.4, NDLC.2.1, RCLI.1.2, RCTS.1.2.10, RCTS.1.2.13, RCTS.1.2.14

  • [RCTS.1.2.36] compile_error's also_raises ([RCTS.1.2.10]) — a non-empty list of codes, none repeated and none the fixture's code: what the program's one fault raises besides code. A compile_error fixture's program differs from a legal one by that one fault, so the codes it is refused with are exactly code and also_raises. A harness must fail the fixture if the compiler raises an error code the two do not name, or does not raise one they name. Warnings are not error codes. A harness must fail a fixture of any other expect.kind that carries the field, and one whose value is not such a list.

ratified — see also: RCTS.1.2.10

Versioning [RCTS.5]#

Catalogue versions [RCTS.5.1]#

[RCTS.5.1.1] The catalogue's version is the DS version. The fixtures in specs/conformance/ at a DS release's tag are that release's catalogue. The suite carries no version of its own, as nothing in DS does but the DS version ([LDET.1.10]). A change to the suite between releases lands in the next release's catalogue.

see also: LDET.1.10

Runtime conformance claim format [RCTS.5.2]#

[RCTS.5.2.1] A runtime claims conformance as DS-Conformance/v<DS version>/<platform-signature>, naming the release whose catalogue it passes ([RCTS.5.1.1]). Example: DS-Conformance/v1.0.0/linux-x86_64-glibc-2.41.

see also: RCTS.5.1.1

[RCTS.5.2.2] Multiple claims from one runtime are allowed (one per platform signature it's tested on).


When a test is added [RCTS.6]#

[RCTS.6.1] Tests get added to the catalogue when:

  • [RCTS.6.2] A real runtime incident reveals a bug the catalogue didn't catch.

  • [RCTS.6.3] A new language feature lands and needs coverage.

  • [RCTS.6.4] An ambiguity in the spec is resolved and the resolution warrants a test pinning it down.