Skip to content

Codex fixes - #7

Merged
yaricom merged 4 commits into
masterfrom
codex-fixes
Apr 2, 2026
Merged

Codex fixes#7
yaricom merged 4 commits into
masterfrom
codex-fixes

Conversation

@yaricom

@yaricom yaricom commented Apr 2, 2026

Copy link
Copy Markdown
Owner
  • The important fixes to evolvable substrate creation
  • File handle proper close
  • Elimination of possible deadlock in executor script

yaricom added 4 commits April 1, 2026 19:05
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.
@yaricom
yaricom merged commit 8709083 into master Apr 2, 2026
3 checks passed
@yaricom
yaricom deleted the codex-fixes branch April 2, 2026 12:03
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