THE PLATFORM

Specifications

A kernel, as a name, cannot be answered. A specification is a version of its statement precise enough that something can be implemented against it and the answer can be judged.

spec polymult 2.0.0 "RLWE representation" {
    kernel polymult<type T = i64, N: u32, L: u32, q: u32>(
        %a: tensor<N x L x T>,
        %b: tensor<N x L x T>,
    ) -> %c: tensor<N x L x T>
}

What a specification settles

The signature. Every type parameter the kernel left open is bound — type T = i64 — and representation parameters and dimensions may be added. What a specification may and may not do to the kernel's interface is the refinement relation; in short, it narrows and never widens.

The representation. How a coefficient is laid out across words, in which byte order, which representative of a class is canonical — stated in prose, because the signature deliberately does not carry it.

Correctness. What a right answer is: exact equality, a stated tolerance, a required accuracy, or a property check where more than one answer is right. The rule belongs to the specification and to nothing else — otherwise one problem would be judged by two standards and comparison would stop meaning anything.

Points. The parameter settings anything measured against it is measured at — see Measurement.

Beside these, a specification carries its testing bundle — the components submissions are evaluated with.

How one is addressed

polynomial-multiplication/negacyclic@0.8.12

kernel/spec@version is the whole address. It is what fherma testing init and fherma implementation init are given, what a scaffolded bundle records as its own origin, and what keys the deterministic stream test data is drawn from — so two specifications never draw the same data from the same seed.

Versions

A kernel has many specifications, and they do not supersede each other: polynomial multiplication over coefficients and over evaluations are both version 1.0, and both are right. They differ in what they say, not in when they were written.

A published version is immutable. A fix is a new version, and a revision never rewrites past executions: results stay attached to the version they were measured under.

A test for what belongs in a specification

An implementation may legitimately say "I do not support size 65536" — so N is a parameter, and belongs to the point. It may never say "I do not support seed 8471" — so the seed is not a parameter, and belongs to the generator.