Skip to main content

Crate feagi_evolutionary

Crate feagi_evolutionary 

Source
Expand description

§FEAGI Evolution & Genome Management

Handles all genotype operations for FEAGI:

  • Genome I/O (JSON ↔ Rust structs)
  • Genome validation
  • Evolution operators (mutation, crossover)
  • Fitness evaluation
  • Population management

§Architecture

This crate manages the genetic blueprint (genotype) of FEAGI brains. The actual instantiated brain structure (phenotype) is handled by feagi-bdu.

§Separation of Concerns

feagi-evo (Genotype)        feagi-bdu (Phenotype)
─────────────────────       ─────────────────────
│ Genome JSON I/O    │  →   │ Neuroembryogenesis │
│ Genome Validation  │      │ Connectome I/O      │
│ Evolution Ops      │      │ Synaptogenesis      │
│ Fitness Eval       │      │ NPU Integration     │
└────────────────────┘      └─────────────────────┘

§Modules

  • genome - Genome I/O and validation
  • evaluation - GenomeEvaluation records: fitness + genome-only lineage (ADR-016)
  • circuit - CircuitObjectiveSpec: circuit-level objectives and boundary resolution
  • evolution - Evolution operators (future)
  • fitness - Fitness evaluation (future)
  • population - Population management (future)

Copyright 2025 Neuraville Inc. Licensed under the Apache License, Version 2.0

Re-exports§

pub use converter_flat::convert_flat_to_hierarchical;
pub use converter_flat_full::convert_flat_to_hierarchical_full;
pub use converter_hierarchical_to_flat::convert_hierarchical_to_flat;
pub use cortical_type_parser::parse_cortical_type;
pub use cortical_type_parser::validate_cortical_type;
pub use evaluation::ComparabilityKey;
pub use evaluation::ConfidenceInterval;
pub use evaluation::EvaluationError;
pub use evaluation::EvaluationId;
pub use evaluation::ExperimentId;
pub use evaluation::FitnessEstimate;
pub use evaluation::FitnessObjective;
pub use evaluation::FitnessOutcome;
pub use evaluation::FitnessSpec;
pub use evaluation::GenomeEvaluation;
pub use evaluation::GenomeOrigin;
pub use evaluation::Lineage;
pub use genome::parser::string_to_cortical_id;
pub use genome::apply_genome_title_to_unique_top_circuit;
pub use genome::decode_genome_artifact;
pub use genome::encode_genome_artifact;
pub use genome::load_genome_artifact_with_report;
pub use genome::load_genome_from_artifact;
pub use genome::load_genome_from_file;
pub use genome::load_genome_from_json;
pub use genome::load_genome_value_with_report;
pub use genome::load_genome_with_report;
pub use genome::load_genome_with_report_from_file;
pub use genome::migrate_genome;
pub use genome::migrate_genome_json_to_current;
pub use genome::migrate_genome_value_to_current;
pub use genome::peek_quantization_precision;
pub use genome::save_genome_to_file;
pub use genome::save_genome_to_json;
pub use genome::subset_runtime_genome_for_region_branch;
pub use genome::validate_genome_artifact_file_name;
pub use genome::wrap_parentless_regions_under_named_root;
pub use genome::ChainResult;
pub use genome::GenomeArtifactCodec;
pub use genome::GenomeArtifactEncoding;
pub use genome::GenomeParser;
pub use genome::GenomeSaver;
pub use genome::JsonGenomeArtifactCodec;
pub use genome::MigrationResult;
pub use genome::ParsedGenome;
pub use genome::GENOME_ARTIFACT_EXTENSION;
pub use genome::GENOME_ARTIFACT_MEDIA_TYPE;
pub use modulators::driver_locked_properties;
pub use modulators::driver_locked_property_names;
pub use modulators::parse_modulator_registry;
pub use modulators::ModulatorInstance;
pub use modulators::ModulatorRegistry;
pub use modulators::ModulatorWrite;
pub use plasticity_detector::extract_memory_properties;
pub use plasticity_detector::genome_has_plasticity;
pub use plasticity_detector::validate_memory_mp_properties;
pub use plasticity_detector::LtmEvictionMode;
pub use plasticity_detector::MemoryAreaProperties;
pub use plasticity_detector::MpChangeMode;
pub use plasticity_detector::ReplayTrigger;
pub use plasticity_detector::CAPTURE_MAX_BURSTS_KEY;
pub use plasticity_detector::DEFAULT_MEMORY_FIRING_THRESHOLD;
pub use plasticity_detector::LTM_EVICTION_KEY;
pub use plasticity_detector::MEMORY_NEURON_CAP_KEY;
pub use plasticity_detector::MP_CHANGE_MODE_KEY;
pub use plasticity_detector::MP_DELTA_QUANTIZATION_KEY;
pub use plasticity_detector::MP_LEARNING_ENABLED_KEY;
pub use plasticity_detector::MP_RATIO_QUANTIZATION_KEY;
pub use plasticity_detector::REPLAY_TRIGGER_KEY;
pub use runtime::GenomeMetadata;
pub use runtime::GenomeSignatures;
pub use runtime::GenomeStats;
pub use runtime::Morphology;
pub use runtime::MorphologyParameters;
pub use runtime::MorphologyRegistry;
pub use runtime::MorphologyType;
pub use runtime::PatternElement;
pub use runtime::PhysiologyConfig;
pub use runtime::RuntimeGenome;
pub use storage::GenomeStorage;
pub use storage::StorageError;
pub use templates::add_core_morphologies;
pub use templates::create_death_area;
pub use templates::create_fatigue_area;
pub use templates::create_fear_area;
pub use templates::create_genome_with_core_areas;
pub use templates::create_genome_with_core_morphologies;
pub use templates::create_hope_area;
pub use templates::create_minimal_genome;
pub use templates::create_pain_area;
pub use templates::create_pleasure_area;
pub use templates::create_power_area;
pub use templates::ensure_core_components;
pub use templates::get_default_neural_properties;
pub use templates::load_barebones_genome;
pub use templates::load_essential_genome;
pub use templates::load_test_genome;
pub use templates::load_vision_genome;
pub use templates::BAREBONES_GENOME_JSON;
pub use templates::ESSENTIAL_GENOME_JSON;
pub use templates::TEST_GENOME_JSON;
pub use templates::VISION_GENOME_JSON;
pub use types::EvoError;
pub use types::EvoResult;
pub use validator::validate_genome;
pub use validator::ValidationResult;

Modules§

circuit
CircuitObjectiveSpec v1 — a measurable, circuit-level objective for one brain region.
converter_flat
Convert flat genome format (2.0) to hierarchical format.
converter_flat_full
COMPLETE flat genome format (2.0) to hierarchical format converter.
converter_hierarchical_to_flat
Convert hierarchical genome format (RuntimeGenome) to flat genome format (3.0).
cortical_type_parser
Cortical Type Parser - Parse CorticalAreaType from genome properties
evaluation
GenomeEvaluation v1 — one evaluated individual: a genome, its fitness, and its lineage.
genome
Genome I/O and manipulation for FEAGI Evolution.
modulators
Genome modulator instances.
plasticity_detector
Plasticity detection for genome analysis
random
Cross-platform random number generation for FEAGI evolution.
runtime
Runtime genome representation for FEAGI.
storage
Genome Storage Abstraction
templates
Genome templates for FEAGI.
types
Core types and error handling for FEAGI Evolution.
units
Units of stored genome values.
validator
Genome validation for FEAGI.

Structs§

AdapterArea
One new plain area of the adapter region.
AdapterPlan
New areas created in a new brain region, between the block and the host’s IO areas.
AmalgamationModulatorPlan
Modulator work for one amalgamation.
AmalgamationRegionPlan
Region tree to build for an amalgamated guest genome.
AmalgamationRegionSpec
One sub-region to create under the amalgamation host region.
AreaFit
One fitted area: the guest cortical id (base64, as in the guest genome) and its dimensions.
FitPlan
What the guest’s areas must look like on the host, and the wiring to add around them. Every field but areas is optional; an absent field changes nothing.
HostModulator
A modulator already in the host.
PatternBounds
A patterns row that falls outside the area at one of its ends.
PlanContext
Everything outside the plan that its validation reads.
PlanMapping
One mapping to create. src and dst are a guest area id (as published, before the import remaps it), an adapter area id, or an existing host area id. rules are mapping rules in the shape update_cortical_mapping takes; each names a morphology_id.
PlanMorphology
A patterns morphology with exact coordinates: each row is [[sx,sy,sz],[dx,dy,dz]], the same JSON as the existing patterns type minus wildcards.
PlannedAdoptedModulator
One guest modulator that adopts an existing area as its driver.
PlannedOwnedModulator
One guest-owned modulator to create (the service allocates its driver area).

Enums§

FitPlanError
Why a plan was refused. Nothing is changed when one is returned.
ModulatorCollisionPolicy
What to do when a guest modulator name already exists in the host.

Constants§

VERSION
Crate version from Cargo.toml

Functions§

apply_driver_remap
Re-key guest modulator driver areas after their instances were created in the host (old base64 -> new base64, including drivers of reused host modulators), and rewrite every reference to them (mapping destinations, classifier fields, region membership).
apply_modulator_name_map
Rewrite every modulator name a guest area refers to: the area’s modulators list and each mapping rule’s modulators list. Classifier reward lists are handled by plan_amalgamation_classifiers.
designated_io_lists_for_cloned_circuit
Declared region IO on the circuit that region-export wrapped under Root Brain Region.
fit_areas
Return areas with the plan’s dimensions applied. Validates the whole plan first; on any error nothing is returned. An empty plan returns an unchanged copy.
plan_amalgamation_classifiers
Plan the guest classifiers: fresh classifier_id, area fields through area_remap, reward modulators through name_map, and parent_region_id through region_map (the host region when the guest parent was not planned). Fails when a classifier’s sample or class memory is not among guest areas, so a half-imported assembly is never created.
plan_amalgamation_modulators
Plan the guest modulators. Call after the guest area ids were remapped (remap_guest_custom_memory_cortical_ids_for_amalgamation), so adopted drivers carry their final ids.
plan_amalgamation_regions
Plan the guest region tree for amalgamation. Pure: no I/O, no host state.
plan_host_lookup_ids
Ids the caller must look up on the host before validating: adapter ids (they must not exist) and mapping ends that are neither guest nor adapter areas (they must exist). Sorted, unique.
remap_classifier_area_fields
Remap every area id a classifier record holds.
remap_guest_custom_memory_cortical_ids_for_amalgamation
Remap guest Custom and Memory cortical IDs to fresh values not present in host_reserved_base64_ids or elsewhere in this guest genome. Updates cortical area keys, cortical_mapping_dst destination keys, brain region membership, and region IO lists.
remap_region_io_lists
Rewrite the base64 area ids in a region’s inputs, outputs, designated_inputs and designated_outputs property lists, and the keys of its port_encoding map.
rename_runtime_genome_areas
Rename areas in a genome in place: area keys, cortical_id fields, region membership and region IO lists, and every id-bearing property (see rewrite_area_properties), classifier fields and modulator drivers. renames is a set of simultaneous (old, new) pairs, so a swap of two ids is allowed. Neuron data is not touched.
rewrite_area_properties
Rewrite every area id held inside one area’s properties (old base64 -> new base64): cortical_mapping_dst destination keys and the *_source_area fields of their rules, classifier assembly links, and the memory-twin properties (memory_twin_areas keys and values, memory_twin_of, memory_twin_for).
validate_plan
Validate the adapter, morphologies and mappings of plan (not its areas; fit_areas does those). Pure: reads only ctx. Run it when the plan is queued and again at confirmation with freshly read host data.