Traits and Mutations

Traits and Mutations

This page connects ByteBiota’s mutation mechanics with the behavioral traits and taxonomy branches defined in src/bytebiota/taxonomy.py. Use it when tuning mutation parameters or interpreting how opcode flips reshape evolutionary lineages.

Mutation Pathways (source: src/bytebiota/mutation.py) {#mutation-pathways}

Mechanism Trigger Default Rate (see MutationConfig) Effect
Copy-time bit flips Applied during replication when copying each byte. copy_bit_flip_rate = 0.005 (~1 in 200 bits) Flips a random bit in the outgoing byte, often mutating an opcode or register immediate. Primary driver of opcode family mix changes.
Background mutations Checked after every instruction; fires when global_instruction_count hits multiples of background_flip_interval. background_flip_interval = 2_000_000 Injects cosmic-ray style single-bit flips into live genomes without replication. Can toggle traits mid-life, causing reclassification on next sampling.
Insertions / Deletions During replication, with probability insertion_deletion_rate. insertion_deletion_rate = 0.20; insertion bias indel_insertion_bias = 0.5 (boosted toward insertions when genome < min_viable_genome). Duplicates (1–3 bytes) or skips (1–3 bytes), altering genome length and opcode density. Supports large structural shifts between families or enables entirely new traits.

Additional parameters influencing outcomes:
- max_mal_mult = 5 allows offspring up to 5Γ— parent size (see MutationConfig).
- EvolutionConfig.small_genome_insert_bias = 0.8 increases insertion likelihood for shrunken genomes (<48 bytes).

Trait Triggers Recap {#trait-triggers}

Traits are defined in TaxonomyClassifier.detect_behavioral_traits. The table below lists the opcodes that directly toggle traits, how mutations can create/remove them, and downstream taxonomic effects.

Trait Trigger Condition Mutation Impact Taxonomy Impact
Exhibits replication capability Presence of opcode DIVIDE (24 or alias 61). Bit flips that create/destroy DIVIDE toggle core replication status; insertions can introduce a new replicate call. Required for Digitalis Minimalis, Animata, Parasitica, Replicatus genus species; absence can demote organisms to Standardus.
Capable of memory allocation Presence of opcode MAL (23 or alias 60). Enables allocator-heavy behaviors via bit flips. Raises likelihood of Parasitica kingdom and SelfModidae family classifications.
Interacts with environment Any of {SENSE_ENV, EMIT_SIGNAL, HARVEST_ENERGY, READ_STORAGE, WRITE_STORAGE, SUBMIT_TASK} (41–43, 64–66). Copy-time flips often diversify environment usage; insertions can add sensing loops; deletions can sever environment access. Drives migrations toward Symbiota, Plantae, Explorata, Interactus genus.
Task-solving behavior Presence of SUBMIT_TASK (66). Hard gate for Plantae kingdom and species Interactus industrius; losing it reclassifies to Explorata or Interactus socialis.
Energy harvesting capability Presence of HARVEST_ENERGY (43). Supports Plantae/Symbiota viability; removal may drop energy balance and alter survival.
Complex control flow patterns Control-flow family share > 15%. Accumulates through mutations that add jumps/templates (usually via insertions). Required for Digitalis Architecta kingdom; fosters family Forkidae and order Threadalis.
Moderate branching behavior Control-flow share between 5% and 15%. Transitional state; likely when mutations add occasional jumps without full subroutine structures. Influences class selection (often Intrusiva).
Heavy computational behavior Arithmetic/logic share > 20%. Occurs when mutations bias toward ALU opcodes; insertions duplicating arithmetic loops can push genomes into Computus maximus. Drives Digitalis Animata classification and Obfuscidae family.
Data-intensive operations Data-movement share > 40%. Copy-loop insertions or register adjustments shift genomes toward Copyloopus genus, potentially Digitalis Explorata scouts.
Uses subroutine structure Presence of both SHL (12) and SHR (13) (proxy for templated CALL/RET scaffolding). Insertions creating matched templates or deletions removing them flip this trait. Prerequisite for Architecta kingdom, Threadalis order, Forkidae family.
Stack-based memory management Stack family share > 5% (PUSH/POP). Mutations that cluster stack usage can move genomes into Forkidae or register them as complex planners.

From Mutation to Kingdom: Typical Pathways {#mutation-to-kingdom}

  1. Minimalis β†’ Animata

    • Copy-time flips introduce arithmetic opcodes (ADD/SUB) while retaining DIVIDE.
    • Arithmetic share surpasses 22%, triggering Digitalis Animata.
  2. Minimalis β†’ Symbiota β†’ Plantae

    • Insertions add SENSE_ENV/READ_STORAGE, pushing environment share above 12%.
    • Subsequent mutation adds SUBMIT_TASK, crossing the Plantae threshold (β‰₯18% environment + task trait).
  3. Mutata β†’ Chimera

    • Background flips diversify opcodes across β‰₯5 families, while environment or system calls grow past 8%.
    • New arithmetic loops or copy bursts serve as the "power axis," satisfying Digitalis Chimera heuristics.
  4. Explorata β†’ Architecta

    • Structural insertions add CALL/RET templates plus stack usage; control-flow share climbs above 18%.
    • Trait Uses subroutine structure activates, graduating the lineage into Digitalis Architecta.

Monitoring Mutation Outcomes {#monitoring-mutations}

  • Use MutationEngine.get_mutation_stats() to correlate observed classification shifts with mutation events.
  • Pair taxonomy outputs with opcode profiles to detect when trait thresholds are nearly met; targeted environment tweaks or mutation rate adjustments can push lineages across boundaries.
  • When tuning mutation parameters in env.example / .env, mirror changes in this document to keep rationale traceable.
  • wiki/taxonomy-overview.md – Definitive classification rules.
  • wiki/opcode-reference.md – Opcode semantics and families referenced above.
  • docs/taxonomy-detailed.md & docs/split_anomalica.md – Historical context for kingdom thresholds.
  • src/bytebiota/mutation.py, src/bytebiota/config.py – Source of truth for mutation behavior and defaults.