pub struct PairReplayRecord {Show 13 fields
pub schema_version: u32,
pub selection_hash: String,
pub root_seed: u64,
pub strategy: String,
pub strategy_version: u32,
pub singleton_policy: String,
pub singleton_policy_version: u32,
pub degenerate_policy_version: u32,
pub budget: u64,
pub default_was_clamped: bool,
pub emitted_kinds: String,
pub affected_singleton_classes: u64,
pub deviation: [String; 3],
}Expand description
The ~200-byte record a pair stream regenerates from.
§Pairs are replayed, not stored (D-09)
Forty benchmark cells times ten seeds times many epochs of pair bytes is gigabytes of
derivable data. Only this record and the manifest hash are persisted; a serverless
consumer carries the record instead of a file. An explicit DUMP path
(dump_pairs) exists for audit and fixture generation, and it is the only thing that
ever writes pair bytes.
Every field is present even when it holds its default, because an absent field is indistinguishable from a field that was never considered.
Fields§
§schema_version: u32Record schema version.
selection_hash: StringHex semantic_hash of the selection the pairs are drawn over.
root_seed: u64The root seed every draw key derives from.
strategy: StringWire name of the sampling strategy.
strategy_version: u32Version tag of that strategy. A change here changes pair IDENTITIES.
singleton_policy: StringWire name of the singleton policy.
singleton_policy_version: u32Version tag of that policy.
degenerate_policy_version: u32Version tag of the degenerate-layout policy.
budget: u64The RESOLVED effective budget — post-clamp, exactly what the stream emitted.
The hard cap itself is deliberately NOT persisted: the resolved budget subsumes it for replay, and the record stays small (D-09).
default_was_clamped: boolWhether the DEFAULT budget was clamped. A clamped run that looked unclamped in the artifact would defeat the point of recording it.
emitted_kinds: Stringboth, positives_only or negatives_only.
affected_singleton_classes: u64How many classes held exactly one selected example (OBLIG-CPP-SINGLETON-EXPLICIT).
deviation: [String; 3]The three declared deviation clauses, verbatim.
Implementations§
Source§impl PairReplayRecord
impl PairReplayRecord
Sourcepub fn from_sampler(sampler: &PairSampler<'_>) -> Self
pub fn from_sampler(sampler: &PairSampler<'_>) -> Self
Describe a live sampler.
§Why this takes ONLY the sampler
The plan’s interface sketch was from_sampler(sampler, selection, cfg). A sampler
already BORROWS its selection and already retains its resolved configuration, so the
extra parameters could only ever disagree with it — and a replay record that
describes a different selection or a different budget than the stream it attests is
precisely the artifact this record exists to make impossible. One argument, one
source of truth.
Sourcepub fn to_canonical_bytes(&self) -> Result<Vec<u8>, ContrastiveDataError>
pub fn to_canonical_bytes(&self) -> Result<Vec<u8>, ContrastiveDataError>
Deterministic canonical serialization — the bytes the manifest hash commits FIRST.
§Errors
ContrastiveDataError::Serialization if the record cannot be serialized.
Sourcepub fn to_config(&self) -> Result<PairConfig, ContrastiveDataError>
pub fn to_config(&self) -> Result<PairConfig, ContrastiveDataError>
Rebuild the configuration that produced the stream, refusing unknown versions.
§Errors
ContrastiveDataError::UnsupportedSchemaVersion,
ContrastiveDataError::UnsupportedAlgorithmVersion,
ContrastiveDataError::UnsupportedPolicyVersion.