Skip to content

Keep void-node constructor in homogeneous gene during validation#813

Merged
chrxh merged 1 commit into
developfrom
claude/genome-editor-keep-void-constructor-homogeneous
Jul 14, 2026
Merged

Keep void-node constructor in homogeneous gene during validation#813
chrxh merged 1 commit into
developfrom
claude/genome-editor-keep-void-constructor-homogeneous

Conversation

@chrxh

@chrxh chrxh commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Problem

In the genome editor, genes reachable only through a homogeneous gene's void nodes were shown as unreachable (e.g. the whole graph collapsing to just gene 0 + gene 4), even though the engine keeps and builds them.

Root cause: the editor runs DescValidationService::validateAndCorrect when a genome is set (GenomeTabWidget), and that function stripped the constructor from every void node:

if (nodeType == CellType_Void) {
    node._constructor = std::nullopt;
}

But in a homogeneous gene the effective cell type is taken from the first node, so a void node is actually expressed as that type and legitimately keeps its constructor — exactly as ConstructorProcessor::createConstructionData (uses result.node->constructor) and MutationProcessor::applyMutations (MutationProcessor.cuh:823 only clears constructorAvailable when !homogeneousCellType) do. So the display dropped live references the engine relies on.

Reproduction (References.sim, one timestep)

Genome reachable genes gene 4 refs
Engine (raw) 12 [0,5]
After validateAndCorrect (before fix) 2 []
After validateAndCorrect (after fix) 12 [0,5]

The reachable=2 case exactly matches the reported "only gene 0 and gene 4 reachable" symptom.

Fix

Strip the constructor from a void node only in non-homogeneous genes, mirroring the engine.

Tests

  • New regression test genome_keepsConstructorOnVoidCellInHomogeneousGene.
  • Existing genome_removesConstructorFromVoidCell (non-homogeneous) still passes.
  • All 171 EngineInterfaceTests pass.

🤖 Generated with Claude Code

In a homogeneous gene the effective cell type comes from the first node,
so a void node is expressed as that type and legitimately keeps its
constructor (matching ConstructorProcessor/MutationProcessor). The genome
editor's validateAndCorrect stripped it unconditionally, making such genes
appear unreachable in the editor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chrxh
chrxh force-pushed the claude/genome-editor-keep-void-constructor-homogeneous branch from 0768771 to 439dc17 Compare July 14, 2026 16:56
@chrxh
chrxh marked this pull request as ready for review July 14, 2026 16:59
@chrxh
chrxh merged commit b8a5653 into develop Jul 14, 2026
1 check passed
@chrxh
chrxh deleted the claude/genome-editor-keep-void-constructor-homogeneous branch July 14, 2026 17:01
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