pub struct Candidate {
pub id: u64,
pub tree: PatchTree,
pub features: Features,
pub phi_std: Vec<f64>,
pub key: String,
pub render: Option<Arc<Audition>>,
pub origin: Origin,
pub name: Option<String>,
pub pinned: bool,
}Expand description
A vetted pool member.
Fields§
§id: u64Stable id (unique for the lifetime of the engine; survives pool reordering and eviction of other members).
tree: PatchTreeThe term.
features: FeaturesIts extracted features.
phi_std: Vec<f64>Standardized feature vector (empty until the standardizer exists).
key: StringContent address of this candidate’s (term, spec) featurization.
Carried rather than recomputed because hashing the term is the one
thing every cache path needs and the term never changes.
render: Option<Arc<Audition>>The audition buffer, when resident. Governed by
SessionConfig::render_policy — under RenderPolicy::Lazy this is
None until Engine::render_of materializes it, and may go back to
None when a newer audition evicts it. Never a signal that the
candidate is unplayable; ask Engine::render_of for that.
Shared with the memo (and with whoever last asked for it) through an
Arc — one allocation per audition, however many holders it has.
origin: OriginProvenance.
name: Option<String>User-given name (frontends fall back to tree.signature()).
pinned: boolThe user asked to keep this one: Engine::insert_candidate will never
evict it.
Deliberately not derived from the star rating. A star is an observation that enters the log and moves θ; if a rating also decided what survives, users would rate strategically to protect patches, and every protective over-rating is a preference they never held — under exactly the pressure where they care most. So the two channels stay separate: stars are what you think, pins are what you keep.
Capped by Engine::pin_cap; see there for why the pool cannot be
pinned solid.