Home/Packages/Prism

Prism · machine learning

A fact about what happened, stamped once — never re-derived from now.

Prism is the AlgFormer/HoloFormer production standard: a stamped, append-only lineage journal that answers "what was true when this happened" without ever re-deriving history from current state, plus the canonical confidence-gated decode policy a real HoloFormer/AlgFormer host runs in production. It exists to stop one class of bug that has hit a real training hot path three times — a value recomputed from a live constant or field instead of read from a fact stamped at the time it happened.

net8.0+ no feature gated on NuGet
dotnet add package EvaluatedApplications.Prism

Depends on EvaluatedApplications.AlgFormer only (resolved automatically). Namespaces: Prism.Lineage, Prism.Inference, Prism.Growth.

Quick start

install, then this

dotnet add package EvaluatedApplications.Prism
using Prism.Lineage; using Prism.Growth; using Prism.Inference; using PrismFormer; // A model and a lineage journal to go with it (JSONL on disk, or MemoryLineageStore for no filesystem). var model = new HoloFormer(vocab: 10, shifts: 3, layers: 1, maxContext: 6, dModel: 8, frozenPrefix: 0); var journal = new LineageJournal(new MemoryLineageStore()); var inForce = new InForce(IterWarm: 8, StackK: 2, CtxCeiling: 64, LayerCeiling: 8); journal.AppendGenesis(round: 0, layers: model.Layers, inForce); // Grow it through Prism.Growth so the journal is stamped automatically. var grown = Grow.AddLayers(model, extra: 1, atRound: 10, journal, inForce); double rampedAlpha = journal.AlphaAt(round: 12, layerIndex: grown.Model.Layers - 1); // Decode with the canonical confidence gate instead of hand-rolling softmax + a threshold. double[] logits = grown.Model.LogitsFor(new[] { 1, 2, 3 }); var decision = Gate.Evaluate(logits, vocab: model.Vocab, DecodePolicy.Holographic); int picked = Gate.Pick(logits, vocab: model.Vocab, DecodePolicy.Holographic, new Random(1));

Three separate jobs in one package: a stamped history of every structural change to a growing model, a growth surface that stamps that history automatically, and the confidence-gated decode a real host samples from.

Why it's useful

three real bugs, one root cause

Alpha computed live from a constant

A per-layer ramp read the current warm-up constant instead of the constant that was in force when that layer was added — hand-bumping the constant as a stopgap, then reverting it, made every already-ramped layer's alpha jump discontinuously.

A regrow-ramp boundary invented from a schedule

A formula guess kept recomputing a "boundary" after growth had already stopped, crushing the learning rate forever.

Serving depth read live from the wrong knob

A diagnostic hardcoded an old depth value after the live value had moved on, silently evaluating a checkpoint at the wrong depth.

A layer index is also state that moves

Once front-insert growth exists, index i names a different layer after every later front grow. LineageJournal resolves indices by replaying stamped events, never by looking an index up against a range frozen at grow time.

Key features

what you get

Prism.Lineage

An idempotent append-only journal (LineageJournal) with derivations — AlphaAt, DepthAt, LastGrowthRound, AddRoundOf — that always resolve against stamped history, including front-insert layer growth.

Prism.Growth

Grow.AddLayers / Grow.ToShifts / Grow.ToContext / Grow.ToVocab wrap HoloFormer's own growth axes and stamp the journal automatically — growing a model and forgetting to record it is no longer possible.

Prism.Inference

Gate/DecodePolicy/GateDecision — commit greedily when confident, otherwise sample over a resonance-filtered subset (the holographic core) or the whole vocabulary (the plain-softmax core), with an explicit FloorMode for each.

DegenGuard

Fires on either of two independent triggers — a run of repeated tokens, or a run of non-greedy picks — the two triggers a production host's own probe uses together. Known blind spot, carried forward honestly: misses period>1 cycles.

Status

where this runs today

Consumed in production by two real hosts: an internal training studio routes decode through Gate (30,400 parity checks against the pre-migration hand-rolled logic, zero mismatches), and the lineage + growth journal runs there behind a boot-time equivalence gate against a legacy sidecar. This site's own browser-side tools consume Prism.Inference by NuGet — never a source reference — and have retired their own hand-rolled decode port entirely.

Depends on: AlgFormer only — resolved automatically when you install this package. License: proprietary — evaluation and non-commercial use are permitted, commercial use requires a commercial licence; no feature on this page is gated behind a tier or a licence key.