1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! The fugue trace encoding of genomes (`ppl` feature).
//!
//! This module is the boundary between the classic evolutionary-computation
//! layer and the PPL-native inference layer: a genome that implements
//! [`TraceGenome`] can be round-tripped through a [`fugue::Trace`] and
//! therefore driven by the trace-space machinery in
//! [`crate::inference`] (MH rejuvenation, tempered SMC, block regeneration).
//!
//! The encoding produced by [`TraceGenome::to_trace`] is *canonical* — an
//! address→value map at the genome's site addresses (`gene#i`, `bit#i`,
//! `perm#i`, …) with zero stored log-probabilities. Probability mass is never
//! carried by this encoding; it is recovered by scoring the trace under a
//! genuine prior model (see [`crate::inference::prior::GenomePrior`]), which is also
//! how the inference layer decodes a genome from a particle
//! (`decode`-by-replay).
use ;
// Re-export ChoiceValue for use in genome trace implementations (relocated
// from `genome::traits` when the trait was split).
pub use ChoiceValue;
use crateGenomeError;
use crateEvolutionaryGenome;
/// Extension trait: genomes that can be encoded as fugue traces.
///
/// Implementing this trait is what admits a genome to the `ppl` inference
/// layer. The classic algorithms never require it.
/// Helper function to create a gene address for trace storage