Skip to content
View source

entelechy-conformanceGenerated

Layer: backends · Lines of code: 2,316 · Integration test files: 0

The conformance matrix: every language feature under every execution mode, as Kernels with their inputs, for the backends’ parity tests

The feature matrix: every Kernel language feature under every execution mode, as complete Kernels with inputs, params and context, so a backend is held to the interpreter across the cross product.

Feature rows hold a backend to the interpreter on the words it computes. Semantic rows (untaken work, edges, truncation, float edges) carry work that fails if it runs, so a finished run is the proof; the interpreter and the JIT report the failure, and the GPU agrees on the words.

A feature is a snippet computing an Out from the environment every mode’s wrapper provides: i: Int, x: Float, the inputs rows, ints and cells, sampled (the element’s own sample of an input of the output’s shape), the params k, n, flag and v, and three functions. The modes are a map over rows, a map over a grid, a reduction, a scan with a memory, a scatter, an emitting scatter, a prefix, a map writing four named outputs, and a group whose lanes exchange their results, into one output and into four.

Internal dependencies entelechy-abi, entelechy-ir, entelechy-rules
External dependencies —
Source crates/backends/conformance
Name Brief
random Random Kernels for differential testing: typed expressions over the matrix’s environment, wrapped in every execution mode. The same seed gives the same programs.
Name Brief
random::Rng A deterministic generator (SplitMix64): the same numbers on every machine.
Case One Kernel of the matrix and everything it runs with.
Name Brief
Summed What an integer sum case must come to on every backend: the output’s words, or an overflow at the element named, (x, y).
Function Brief
fn cases(seed: u64, count: usize) -> Vec<Case> count random programs from seed: a few lets and their Out, wrapped in a picked mode as the matrix wraps its features.
fn exact_cases(seed: u64, count: usize) -> Vec<Case> Programs whose integers and booleans come only from integers and booleans, so i and b match exactly on a device whose floats match to rounding.
fn features() -> Vec<(&'static str, &'static str, &'static str)> The features: a name, lets that may use the environment, and the Out they yield.
fn modes() -> Vec<(&'static str, Wrapper)> The modes: a name and a wrapper taking the snippet’s lets and Out.
fn context() -> Context The context every case runs under: time, rate, window, pointer with two buttons held, wheel, three keys down, two pads connected, and two characters typed.
fn cases() -> Vec<Case> Every feature under every mode.
fn wide_features() -> Vec<(&'static str, &'static str, &'static str)> The 64-bit features: a name, lets over the wide environment, and the Wide they yield. The environment is i: Int, x: Double and n: Long from the element, the inputs rows: Rows<Double> and ids: Rows&lt;Long&gt;, the params big, origin, scale, frame and steps, and two functions. The JIT is held to the interpreter; the GPU refuses these rows.
fn wide_cases() -> Vec<Case> Every 64-bit feature under every mode it runs in.
fn long_features() -> Vec<(&'static str, &'static str, &'static str)> The Long-only features, which a device with 64-bit integers runs in a map and a reduction: a name, lets over the environment (i: Int, n: Long, the input ids: Rows<Long>, the params big, origin and steps), and the Lng they yield.
fn long_cases() -> Vec<Case> Every Long feature in a map over rows, a map over a grid, and a reduction.
fn long_scalar_features() -> Vec<(&'static str, &'static str, &'static str)> Every Long feature with scalar Longs only (no LVec2 or LVec3): what a device without 64-bit integers computes as pairs of words. Each as (feature, lets, result) over i, n = long(i), the big and steps params and the ids input, into an Ls.
fn long_scalar_cases() -> Vec<Case> Every scalar Long feature in a map over rows, a map over a grid, and a reduction.
fn compare(scalars: &[Scalar], reference: &[u32], candidate: &[u32], relative: f32, absolute: f32) -> Option<String> Compares two outputs word by word under a layout: an Int or Bool word must match exactly, a Float word within relative of the larger magnitude plus absolute (NaN matches NaN). Returns the first mismatch as text.
fn narrow_cases() -> Vec<Case> Every narrow encoding read by sample, at over rows and a grid, a part of an element and (floats) at_linear, and written by a map and by a scan’s steps into a memory. Inputs are Kernel words narrowed by the Host’s rule.
fn shape_cases() -> Vec<Case> Every element shape a scatter’s target may hold, under every rule, into rows and into a volume, returning its pairs and emitting more where the rule lets it. The one input is a row of Ints, so every pair is wider than anything the Kernel reads.
fn sum_cases() -> Vec<(Case, Summed)> Integer sums under a scatter and a prefix: each element’s whole total, in any adding order. Overflow is reported at the first element whose total leaves the range; a total that wraps and returns fits.
fn large_cases() -> Vec<Case> Extents past 2^24, which a 32-bit float cannot hold whole, under every mode: each element, count, size and domain exact, as the interpreter gives them. Each case reads a Field of ones as long as its domain.
fn repeat_cases() -> Vec<Case> Every case of the matrix whose words a run computes: features, wide, narrow and shaped ones, and integer sums, for unrepeated.
fn unrepeated(backend: &dyn Backend, cases: &[(Case, Validated)]) -> Vec<String> Where backend writes other words, or fails otherwise, on a second run of a case with the same inputs than on the first: a backend that says it repeats exactly (entelechy_rules::Backend::repeats_exactly) answers none. Each case comes with its module; a case the backend declines or cannot prepare is left to the matrix.
Name Type Value Brief
COUNT u32 48 The count of elements the map, reduce, scan and scatter run over.
SHAPE_COUNT u32 20_000 The elements a shape case runs over: enough for the interpreter and the JIT to split them among threads and the JIT to part the target.
Name Type Brief
Wrapper fn(&str, &str) -> String A mode’s wrapper: the snippet’s lets and Out to a whole Kernel.

crates/backends/conformance/src/random.rs#L14

A deterministic generator (SplitMix64): the same numbers on every machine.

Methods

Function Description
fn new(seed: u64) -> Self A generator from a seed.
fn bits(&mut self) -> u64 The next 64 random bits.
fn below(&mut self, n: u64) -> u64 A number below n.
fn pick<'a, T>(&mut self, items: &'a [T]) -> &'a T One of items.

crates/backends/conformance/src/lib.rs#L27

One Kernel of the matrix and everything it runs with.

Properties

Name Type Description
name String <feature> in <mode>.
source String The Kernel’s source.
inputs Vec<(Schema, Domain, Vec<u32>)> The inputs, in port order: layout, extent, words.
params Vec<Value> The params, in declaration order.
domain Domain The invocation’s domain.
context Context The context every case evaluates under.

Methods

Function Description
fn room(&self) -> usize The words a Host needs to run this case on the interpreter and a backend beside it: its inputs and outputs, twice over, and never less than the matrix’s usual room.

Implemented traits: Clone, Debug


crates/backends/conformance/src/lib.rs#L1581

What an integer sum case must come to on every backend: the output’s words, or an overflow at the element named, (x, y).

Variants

Name Description
Words(Vec<u32>) The output’s words.
OverflowAt(u32, u32) An overflow at this element.

Methods

Function Description
fn judge(&self, outcome: &Result<Vec<u32>, ExecutionError>) -> Option<String> Where outcome differs from what the case must come to, as text.

Implemented traits: Clone, Debug, Eq, PartialEq, StructuralPartialEq