Skip to content

Move lineage fields from genome to creature#749

Merged
chrxh merged 9 commits into
developfrom
claude/move-lineage-to-creature
Jun 20, 2026
Merged

Move lineage fields from genome to creature#749
chrxh merged 9 commits into
developfrom
claude/move-lineage-to-creature

Conversation

@chrxh

@chrxh chrxh commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Summary

Move lineageId, prevLineageId and accumulatedMutations from the genome to the creature, where they conceptually belong. The fields become editable in the inspection window and are removed from the genome editor.

Changes

Engine (CUDA)

  • Creature/CreatureTO gain the 3 fields (+ isRelatedLineage moved off Genome); Genome/GenomeTO lose them.
  • EntityFactory, DataAccessKernels (TO↔entity, maxIds.lineageId now from creatures), MutationProcessor (accumulation + new-lineage now on creature), isRelatedLineage callers (Attacker/Communicator/Reconnector/Sensor), GeometryKernels lineage coloring, TestKernels.
  • EditKernels::cudaChangeObject applies creature lineage from the TO so inspection edits reach the live simulation.

Host

  • CreatureDesc gains the 3 members, GenomeDesc loses them.
  • Updated DescConverterService, SerializerService (new creature ids, dropped genome ids), DescValidationService, DescEditService::randomizeLineageIds, GenomeDescEditService preview, GenomeDescHash.

GUI

  • GenomeEditorWidget: removed lineage + accumulated-mutations widgets.
  • InspectionWindow: 3 fields now editable on the creature; creature-change detection triggers changeCell.

Tests

  • Test data factory + affected EngineTests migrated to set/read lineage on the creature; added getMutatedCreature helper.

Testing

  • Build: 470/470, alien.exe linked (Ninja Release).
  • EngineInterfaceTests 155 ✓, PersisterTests 64 ✓, EngineTests 3048 ✓ / 3 pre-existing skips / 0 fail.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
genome._frontAngle = Math::getNormalizedAngle(genome._frontAngle, -180.0f);

// Validate mutation rate fields
genome._lineageId = std::max(genome._lineageId, 0);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method void validateAndCorrect(ObjectDesc& object); should be void validateAndCorrect(ExtendedObjectDesc& object);. Then the removed validations here can be move to this place.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 8023cc3: validateAndCorrect now takes ExtendedObjectDesc& and the creature lineage validation lives there.

entityFactory.init(&data);
entityFactory.changeObjectFromTO(changeTO, objectTO, object);
if (objectTO.type == ObjectType_Cell) {
auto const& creatureTO = changeTO.creatures[objectTO.typeData.cell.creatureIndex];

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use a new method changeCreateFromTO (to be created in entityFactory)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 8023cc3: added EntityFactory::changeCreatureFromTO and call it from cudaChangeObject.

…eatureFromTO

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread source/EngineKernels/EntityFactory.cuh Outdated
creature->generation = creatureTO.generation;
creature->numCells = creatureTO.numCells;
creature->mutationState = creatureTO.mutationState;
creature->lineageId = creatureTO.lineageId;

@chrxh chrxh Jun 19, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use changeCreatureFromTO here. and extend changeCreatureFromTO to set the other attributes (numCells, generation, etc.) too.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in c5483f3: createCreatureFromTO now sets only id + genome pointer and delegates the rest to changeCreatureFromTO, which was extended to set ancestorId, generation, numCells, mutationState, headUpdateId and the lineage fields.

chrxh and others added 4 commits June 19, 2026 23:15
…e lineage

Migrate old-model genome lineage attributes to the creature on load; save
writes them to the creature only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Creature-mode inspection returned early without calling changeCell, so
edited creature attributes were never transferred and got reset on the
next refresh. Add a regression test for the creature change transfer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread source/Gui/InspectionWindow.cpp Outdated
@@ -308,7 +308,12 @@ void _InspectionWindow::processObject(ExtendedObjectDesc& extendedObject)
{
if (_creatureMode) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactor: rename _InspectionWindow::processObject to processExtendedObject
then create 2 methods for processObject and processCreature

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 02ae162: renamed the dispatcher to processExtendedObject (delegates by _creatureMode) and split the body into processObject and processCreature.

chrxh and others added 3 commits June 20, 2026 12:04
…reature

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Distinguishes an unset optional prevLineageId from a real value of 0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chrxh chrxh merged commit ff29dfe into develop Jun 20, 2026
@chrxh chrxh deleted the claude/move-lineage-to-creature branch June 20, 2026 10:23
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