<!-- description: Review a proposed e-means clustering pilot and the arithmetic, reproducibility, and resource guarantees required before it can qualify in HoldFast. -->

# Deferred numerical workload candidates

> Candidate outside the [first-release subset](../../language/first-release/#release-boundary).
> [Selection criteria](../../plan/#deferred-numerical-workload-selection)

<a id="e-means-research-disposition"></a>

## e-means

e-means trains cluster centroids using mini-batch exponential moving averages
of counts and sums, scheduled decay, revival of unused clusters and a final
centroid update. Bessa et al. report matching the test mean squared error of
25 Flash-KMeans iterations in 1.4–2.6 dataset passes. At that threshold they
measure 9.5–45.5× wall-clock speedups on their H100 configurations for cluster
training. [e-means paper, §4.3](https://arxiv.org/html/2611.09501v1#S4.SS3)

A search-index or quantization-codebook client could exercise explicit storage,
dimension and index invariants, finite iteration, mutable reductions and
numerical refinement. HoldFast qualification covers the language and lowering the
client needs. [VerifiedOS consumer and target assessment](https://github.com/symbiogenesis/VerifiedOS/blob/main/docs/performance/e-means-assessment.md#consumer-selection-and-acceptance)

## Selection and prerequisites

Runtime floating point is outside the first release. A floating-point pilot
needs a reviewed numeric format and operation contract, agreement between
static and runtime evaluation, and target correspondence.
[Primitive semantics](../../language/first-release/#primitive-semantics) ·
[Required compiler route](../../assurance/verification-strategy/#compiler-route-decision)

A fixed-point pilot specifies scales, ranges, rounding and overflow behavior
and measures its accuracy on the selected workload.

Select a pilot only after a named application needs clustering, its input and
output contract is independently frozen, and the needed represented arithmetic,
sequence libraries and compiler joins are qualified. Compare the supported
subset and existing qualified implementation before adding language machinery.
The [selection plan](../../plan/#deferred-numerical-workload-selection) owns
the pilot budget and prerequisites.

## Portability and numerical guarantees

Select an arithmetic contract independently of the execution profile and the
[assurance preset](../assurance-profiles/#scope-and-the-governing-rule).
Every implementation fixes its formats, conversions, rounding mode,
subnormal and exceptional values, and any floating-point environment it reads
or changes. For fixed-point semantics, include scale and saturation, wrapping
or failure behavior. Required-static computations and runtime execution use the
same contract for the same target and flags.

A reproducible result fixes the evaluation order and allowed operation set,
including whether a multiply and add are fused. A SIMD or GPU reduction that
changes grouping needs evidence for that result contract. An error-bounded
variant states its admitted input domain, reference computation, error metric
and bound. Each enabled dispatch path establishes that bound under its actual
operations. Qualify NaNs, infinities, signed zero, subnormals and near-boundary
inputs where the selected format admits them. Encode the effective rounding,
contraction and reassociation choices in the artifact evidence. Compiler options
and host settings cannot silently weaken the public result guarantee.

Kuiper illustrates GPU kernel verification with dependent types and separation
logic in F*/Pulse. Exo 2 illustrates cursor-based scheduling for numerical
kernels. A HoldFast pilot must qualify its own arithmetic and target.
[Kuiper](https://doi.org/10.1145/3808280) · [Exo 2](https://doi.org/10.1145/3669940.3707218)

## Bounded pilot acceptance

Start with one assignment-and-update kernel and an independently authored oracle.
Freeze the following contract before candidate implementation:

| Boundary | Required evidence for a selected pilot |
| --- | --- |
| Shape and storage | Declared dimensions, cluster and batch counts, caller-supplied capacities, initialized extents, aliasing and scratch/stack limits; prove all accesses and writes fit, including refused inputs and unchanged surrounding storage. |
| Finite execution | A fixed batch/epoch budget, bounded revival/finalization work and explicit capacity/exhaustion results; a quality-based stopping condition supplies no execution bound. |
| Reproducibility | Seed and shuffle inputs, tie-breaking, assignment policy, reduction order, decay schedule and finalization choice are part of the contract; repeatability is qualified at the selected arithmetic and target. |
| Numerical behavior | Handle empty/dead clusters, zero or underflowed denominators, overflow and rounding; floating point additionally covers the selected non-finite and exception behavior. Prove the implemented operations refine their declared numerical specification. |
| Independent judgment | Compare with the frozen oracle on tiny exhaustive and representative cases; include equal distances, empty clusters, boundary capacities, invalid shapes and changed-operation controls. Unsupported syntax and compilation failures supply no semantic verdict. |
| Artifact and benefit | Retain checked source correspondence, required resource/security evidence and exact-artifact lowering through the existing route. Measure authoring/proof cost, memory and target execution separately from clustering loss on held-out data at a declared baseline and threshold. |

State the metric and evidence for each claimed result, such as clustering
quality, convergence, search recall, compression or speed on the selected target.
Apply the repository's revision-specific license and dependency review before
incorporating upstream source. [Working rules](https://github.com/symbiogenesis/HoldFast/blob/main/AGENTS.md#before-incorporating-an-upstream)
