ModelManifest

dicechess.engine.model.ModelManifest
See theModelManifest companion object
final case class ModelManifest(manifestVersion: String, modelId: String, modelSha256: String, modelRole: String, featureSchema: String, featureCount: Int, inputName: String, outputName: String, perspective: String, engineCompatibility: String, evaluationProfile: Option[String] = ..., calibration: ModelCalibration = ..., provenance: Map[String, String] = ...)

The versioned description of one trained ONNX artifact: what it is for, what it consumes, what it emits, which engines may serve it, and which bytes it describes.

Every field is here because its absence has a silent failure mode. A model in the wrong ModelRole answers a different question; a model on the wrong featureSchema receives a vector in which every column means something else; a model whose tensors are named or shaped differently either fails deep inside a JNI call or — worse — is fed by index and scored anyway; a model served by an engine whose feature extractors have moved on is scored on out-of-distribution inputs; and a model whose bytes no longer match the manifest is simply a different model. None of those show up as a crash. They show up as a bot that plays worse than it measured, which is the most expensive defect this project can ship.

Validation is therefore fail-closed and happens before a session is created (ModelManifest.validate, ModelManifest.verifyDigest) and before any row reaches the model (OnnxModelContract.validate).

Versions

  • 1.0.0 — the manifest the evaluation service and the training repository's kcp-13 serving contract already produce. It has no role, perspective or tensor-name fields; this engine reads such a manifest as ModelRole.PositionValue on the mover-perspective convention with the contract's input/output tensor names, which is exactly what those artifacts are.
  • 1.1.0 — adds modelRole and perspective as required fields and inputName/outputName as optional ones. A model for the search's chance-collapse or pre-ranking hooks can only be described by this version, since 1.0.0 cannot say which of them it is.

Unknown fields are ignored on purpose: a newer producer may add metadata this engine has no use for, and refusing to load over it would make every manifest addition a breaking change. A field a declared version does not define is the opposite case and is refused: a 1.0.0 manifest carrying modelRole would mean one thing here and another to every reader that only knows 1.0.0.

Value parameters

engineCompatibility

space-separated MAJOR.MINOR.PATCH comparators (=, >, >=, =0.12.0 <1.0.0. The syntax is the deployed evaluator's, deliberately not re-invented

modelSha256

64 hex characters over the ONNX file's bytes — the manifest describes exactly one file and can be pinned in a preregistered experiment record

perspective

whose point of view the feature row and the output take; see ModelManifest.MoverPerspective

provenance

free-form producer metadata (training run, dataset digest, commit); never interpreted here

Attributes

Companion
object
Source
ModelManifest.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product