Commit 8709083
authored
Codex fixes (#7)
* fix: prevent duplicate connections in pruneAndExpress recursion
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.
* fix: close file handles in config loaders and experiment result writers
- 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.
* fix: correct ESIterations loop boundary for lastHidden index
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.
* fix: eliminate deadlock and data race in experiment runner
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.1 parent 6a3fb07 commit 8709083
4 files changed
Lines changed: 40 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
116 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 121 | + | |
125 | 122 | | |
126 | 123 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | 124 | | |
144 | 125 | | |
145 | 126 | | |
146 | 127 | | |
147 | | - | |
148 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
149 | 133 | | |
150 | 134 | | |
151 | 135 | | |
| |||
157 | 141 | | |
158 | 142 | | |
159 | 143 | | |
160 | | - | |
161 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
162 | 152 | | |
163 | 153 | | |
164 | 154 | | |
165 | 155 | | |
166 | 156 | | |
167 | 157 | | |
168 | 158 | | |
169 | | - | |
170 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
171 | 167 | | |
172 | 168 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
0 commit comments