Codex fixes - #7
Merged
Merged
Conversation
yaricom
commented
Apr 2, 2026
Owner
- The important fixes to evolvable substrate creation
- File handle proper close
- Elimination of possible deadlock in executor script
Pass nil accumulator to recursive pruneAndExpress calls instead of the growing connections slice. Previously, passing the populated slice caused already-accumulated entries to be appended again on each recursive return, producing duplicate connections in the substrate. Identified by Codex code review.
- Add defer configFile.Close() in hyperneat.LoadYAMLConfigFile - Add defer configFile.Close() in eshyperneat.LoadYAMLConfigFile - Add explicit Close() with error handling for both output files in executor.go (experiment .dat and .npz result files) Identified by Codex code review.
The previous update collapsed lastHidden to just HiddenCount() (a local count) by computing lastHidden + (HiddenCount() - lastHidden). This broke multi-iteration runs by preventing subsequent passes from seeing the correct hidden node window. Fix: compute lastHidden = firstHidden + es.Layout.HiddenCount() to keep the boundary consistently in global index space. Identified by Codex code review.
Replace the competing dual-receiver errChan pattern with signal.NotifyContext: - Only main now reads from errChan (single receiver, no deadlock) - Removed signal handler goroutine that competed with main for errChan - Removed shared outer 'err' variable written from multiple goroutines (data race) - Print 'Press Ctrl+C to stop' synchronously before launching experiment - Distinguish user interrupt (ctx.Err() != nil) from real errors - Remove now-unused 'context' import Identified by Codex code review.
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.