// diploid genome :: nine loci :: monte carlo evolution _


> population field 10,000 individuals

[ idle ]

> specimen inspector click any cell above

[ no specimen selected ]

> allele frequency spectra

// BADGE-TYPE COMPOSITION
// HUE_BASE (phenotype)
gap 21-31 highlighted red
// SATURATION (phenotype)
additive-dominant, drifts toward 255
// CHASER (phenotype "lin")
shooting-star variant < 88 highlighted
// HUE_RATEDIR (phenotype)
hue cycle rate + direction
// HUE_BOUND (phenotype)
hue interval upper bound
// CD_RATE (phenotype)
chaser rate
// CD_DIR (phenotype)
chaser direction
// CD_PERIOD (phenotype)
chaser period (0-6)
// NONLIN (phenotype)
gamma rolloff > 127

> control

[ ready ]

> console

> notes

// see synthetic-population-genetics.md for background.

> specimen preview

[ specimen ready ]

> vim gene diploid editor :: 2 x 9 bytes

[ ready ]

> QR gene exchange dc34-gamete wire format :: k-parameterised

> k shared badge secret
[ not loaded ]
> phase 1 generate nonce
[ paste the string above and press the button ]
> phase 2 seal a gamete for your badge
gamete (hex)
byte 15
[ do phase 1 first ]
scan the QR above with your badge's camera
> phase 3 round-trip sanity check (optional)
self-check: opens the phase-2 seal under the phase-1 nonce.
[ do phase 1 and phase 2 first ]

> skeet slot parent diploid :: single-organism gamete enumeration

[ no organism loaded ]
[ send one from popsim / borg / vim gene ]

> eggstraction slot

[ no exchanges recorded yet ]
[ mint a nonce below, scan into badge, paste the returned QR ]

> export / import

export copies the current accumulator (nonces + observed gametes + label) as JSON. import replaces it. useful for pausing a physical scan and resuming later.
[ press export to fill this box ]

> gamete accumulator observed gametes :: 5 linkage-group coupon collector

[ 0 exchanges :: 0/5 linkage groups locked :: P(diploid known) ≈ 0.000 ]
haplo0   haplo1   matches hom value   HOM = homozygous locus   uncolored = mutation or unresolved
reconstructed diploid so far :: gold tile = allele known, dashed [??] = group not yet resolved
observed gametes (append-only, in observation order)
coin-pattern coverage histogram :: 32 bins, one per 5-bit gamete pattern (meiosis fairness audit)

> QR gene exchange we are all receiver :: badge are all responder

we mint the phase-1 nonce; the badge scans it, meioses a gamete under its own diploid, and hands back a sealed phase-2 QR. each opened seal lands in the accumulator above.
> k shared badge secret
[ not loaded ]
> phase 1 mint a nonce for the badge to scan
[ press mint to generate a nonce QR for your badge ]
> phase 2 paste sealed gamete(s) from the badge
[ mint at least one nonce first ]

> ROOT frozen diploid :: assimilated into every mating

[ ROOT not initialized ]

> population field 10,000 individuals

[ idle ]

> specimen inspector click any cell above

[ no specimen selected ]

> allele frequency spectra

// BADGE-TYPE COMPOSITION
// HUE_BASE (phenotype)
gap 21-31 highlighted red
// SATURATION (phenotype)
additive-dominant, drifts toward 255
// CHASER (phenotype "lin")
shooting-star variant < 88 highlighted
// HUE_RATEDIR (phenotype)
hue cycle rate + direction
// HUE_BOUND (phenotype)
hue interval upper bound
// CD_RATE (phenotype)
chaser rate
// CD_DIR (phenotype)
chaser direction
// CD_PERIOD (phenotype)
chaser period (0-6)
// NONLIN (phenotype)
gamma rolloff > 127

> control

[ ready ]

> notes

> load from gamete No Camera

  1. press "generate nonce" and scan that QR with your badge
  2. the badge seals its gamete under that nonce and shows a second QR
  3. scan the second QR and paste its text into the box

Press + for another gamete. Leave the box empty to use the provided genome.

[ using provided gametes ]

> specimen preview

[ no diploid loaded ]

// see badgecestry.md for the design and the patent transcription. The `None` badge type is excluded from ancestry decoding because zero None-typed badges existed at DC34; Human/None ties resolve to Human by construction.

> badgecestry two-stage Hidden Markov Model ancestry composition

Ancestry composition for one badge, decoded from a two-stage hidden Markov model (U.S. Pat. 12,626,778) the way Ancestry.com does it for humans, but with the model's homework shown.
Drag the generation slider to watch ancestry signal decay under mutation.

How many generations of drift and mutation the loaded diploid is assumed to sit downstream of generation 0 (the founder priors from Haploid::from_type). t=0 = fresh founder, no mutation history. Larger t = ancestry signal smears; the HMM's emission distributions blur and confident calls collapse toward the prior.

> ancestry composition

[ waiting for diploid ]

> per-window best-guess lineage what stage-2 thinks each window came from

A window is a linkage group: alleles that co-segregate and are inherited as one block, so the HMM tallies lineage by window, not gene by gene.

> how the model got here every panel below recomputes live on slider drag

Not a black-box oracle: every widget below carries a data-source attribute naming the decoder module it came from.

// panel 1 :: emission distributions ET,ℓ,t

Rows are (type, locus); each cell's mint fill = P(allele | type, ℓ, t) over 0..255 (bright mint = higher probability, black = zero probability). Vertical ticks mark this diploid's observed alleles at each locus: magenta = haplo0, gold = haplo1. Watch rows smear as t grows; that's ancestry signal decaying under mutation.

// panel 2 :: stage-1 per-window posteriors γw(T)

Two heatmaps, one per haplotype. Rows = windows, cols = 7 active types. Contrast across a row = window informativeness.

Windows map to linkage groups (genes that are grouped together during meiosis):

// panel 3 :: stage-1 → stage-2 handoff (C0, C1)

The top-3 types kept per haplotype (bright) vs the four that got pruned (grey). Stage 2's state space is 3·3·2 = 18 instead of the full 7·7·2 = 98, the patent's speedup, in one glance.

// panel 4 :: stage-2 joint posteriors γw(T0, T1, switch)

Per window, two 3×3 heatmaps (switch=0 left, switch=1 right). Rows = C0, cols = C1. This is where the composition percentages come from. W_DE typically decides more sharply than the other three because the shipped-bug phenotype δ-factor tends to zero out one switch slice, meaning one of the two switch=0 / switch=1 heatmaps.

// panel 5 :: α / β message trace

Two message vectors per window, per haplotype, from the stage-1 forward-backward pass. α (forward) walks left→right: αw(T) is the likelihood of the emissions through window w, given that window w's founder lineage is type T. β (backward) walks right→left: βw(T) is the likelihood of the emissions after window w, given T. Their normalized product αw(T)·βw(T) is the posterior γw(T) from panel 2: α asks "what did we already see?", β asks "what's left to explain?", and the posterior is where they meet.