Skip to content

Add duplicate-gene and delete-gene mutations#752

Open
chrxh wants to merge 1 commit into
developfrom
claude/add-gene-mutations
Open

Add duplicate-gene and delete-gene mutations#752
chrxh wants to merge 1 commit into
developfrom
claude/add-gene-mutations

Conversation

@chrxh

@chrxh chrxh commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

Adds two new structural mutation types operating at gene granularity, each controlled by a geneProbability field (single instance in the mutation rates, like the cell-type-mode mutation):

  • DuplicateGeneMutation: picks a random gene; if it is referenced by more than one constructor, an independent copy is appended as the last gene and one randomly chosen referencing constructor is repointed to the copy (no existing gene index shifts, so other references stay valid).
  • DeleteGeneMutation: deletes a random non-root gene; constructors referencing it are turned off, injectors referencing it are redirected to the root gene, and all references to genes behind the deleted one are decremented.

Changes

  • Structs: Duplicate/DeleteGeneMutation added to MutationRates, MutationRatesTO, MutationRatesDesc.
  • Data transfer: DescConverterService, SerializerService, EntityFactory, DataAccessKernels, DescTestDataFactory, plus GenomeDescHash and DescValidationService.
  • GUI: MutationRatesDialog (settings + UI) and MutationRatesWidget (active-mutation list).
  • Simulation parameters: duplicateGeneMetaMutationsSigma and deleteGeneMetaMutationsSigma (meta mutations).
  • Engine: MutationProcessor::applyMutations_duplicateGene / applyMutations_deleteGene (multi-threaded: lane 0 decides + allocates, all lanes copy in parallel), wired into the dispatch, and applyMutations_meta extended with the two new sigmas.
  • Tests: new DuplicateGeneMutationTests and DeleteGeneMutationTests.

Notes

  • Gene 0 (root) is never deleted, consistent with its special role elsewhere in the engine.
  • "Reference" is modeled as a constructor reference per the design; on delete, injector indices are additionally kept valid.

Testing

  • Full EngineTests: 3055 passed, 0 failed (3 pre-existing unrelated skips).
  • EngineInterfaceTests (155), PersisterTests (64), NetworkTests (4): all pass.
  • Builds clean via build-windows-ninja.bat (Release).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant