Extract GeneGraphProcessor and void nodes unreachable from the last node - #819
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits on top of
develop:1. Extract gene graph passes from MutationProcessor into GeneGraphProcessor
removeUnreachableGenesFromRootandremoveCyclesNotThroughRootmoved into their own class.2. Void gene nodes unreachable from the last node
A construction stays attached to its constructor at the last constructed node, so every node of a gene that is not connected to that node is lost after the construction. The new pass
GeneGraphProcessor::voidNodesUnreachableFromLastNodedetects these nodes and sets them to void (withconstructorAvailable = false). It runs inConstructorProcessor::mutateGenomeafter the mutations and before the two existing gene graph passes.Per gene (the genes are distributed over the lanes, since the nodes of a gene have to be examined in construction order):
ShapeGenerator: an edge to the predecessor plus therequiredNodeIdedges. The generator is advanced for void nodes as well, because they occupy a position of the shape during the real construction. An edge only holds if none of its two nodes is void, since a void cell dies right after its construction.intper node), so no edges have to be stored.homogeneousCellType, with less than two nodes or without any void node are skipped.Special case: if the first node of a gene is voided this way, the whole gene is removed from the genome, references to it are dropped (constructor turned off, injector falls back to gene 0) and the remaining references are remapped. The gene compaction previously living in
removeUnreachableGenesFromRootwas extracted into the shared helperremoveMarkedGenesfor that. As inMutationProcessor::applyMutations_deleteGene, at least one gene always survives so the genome never becomes empty.Tests: new test kernel
cudaTestVoidUnreachableNodesplusUnreachableNodeVoidingTests(6 tests: no change without void nodes, voiding a node reachable only via void nodes in a triangle, loss of the constructor, gene removal including reference adjustment, keeping the last gene,homogeneousCellType).Full
EngineTestssuite passes (3096 passed, 3 pre-existing skips), as doEngineInterfaceTests,NetworkTestsandPersisterTests.Note on the effect: with shape
Segment, any void node in the interior separates all preceding nodes from the last node, so the first node becomes void as well and the gene is always deleted. That follows directly from the specified rule (and is what the special case is for), but it makes the void mutation rather destructive for segment genes.🤖 Generated with Claude Code