Repository navigation
Reset and resize CSRM connection spike history - #815
Open
AHMETHAKANBEZIR1 wants to merge 2 commits into
Open
AHMETHAKANBEZIR1 wants to merge 2 commits into
AHMETHAKANBEZIR1 wants to merge 2 commits into
Conversation
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
This was referenced Oct 23, 2026
This branch has not been deployed
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.
CSRM simulation history is not following the state transitions already provided by Network. Network.reset_state_variables resets the neurons but leaves Connection.s_w intact, so spikes from one trial drive the next supposedly independent trial. When an input batch changes size, Network.run resizes the neuron state but the old connection window instead crashes torch.cat.
Clear the dense connection's CSRM spike window on explicit reset, and lazily recreate it when the input batch size changes. A run boundary without either transition continues to preserve the simulation history. Learned weights and bias remain intact.
In a constructed one-neuron CPU example, a spike-containing trial followed by reset and an all-zero trial produces voltage 0.3679 on master instead of the fresh network's 0. A size-one input batch followed by size two raises a tensor-size mismatch on master. Both work with this change.
Validation on Windows, Python3.12, Torch2.14.0+cpu:
Seven new cases against exact unmodified master 78ec02b: six failures and one passing continuity control. With the patch all seven pass.
Four reset cases compare every step of a reused network with a fresh one (two window lengths, bias and no bias), including spike outputs and unchanged learned weights. Two batch-resize cases check size1->2 and2->1 against fresh networks. The control checks that a split run without reset still matches an unsplit run and retains nonzero history.
Complete local suite: 262 passed, 1 skipped. The module import path was explicitly verified for this checkout in the Poetry environment.
Both configured all-file pre-commit hooks (isort, black), normal commit hooks and staged diff check pass. Changelog updated. No CUDA or task-accuracy benchmark is claimed.
This was found by source analysis and constructed simulations, not a claimed production incident. No open CSRM/window-reset fix or claimed issue was found. AI disclosure: the account owner requested OSS work; OpenAI Codex performed the diagnosis, implementation, tests and description. No independent human code review has occurred.
Local compatibility check: the updated heads of #813 and #815 were applied together in a private checkout based on master78ec02b. The complete combined suite passed (289 passed, 1 skipped; Torch2.14 CPU; import path verified). This is local integration evidence, not an upstream merge or CUDA result.
Local compatibility check: the updated heads of #813, #815 and #816 were applied together in a private checkout based on master78ec02b. The complete combined suite passed (297 passed, 1 skipped; Torch2.14 CPU; import path verified). Only the changelog additions needed a conflict resolution, which retained all entries; the implementation changes applied cleanly. This is local integration evidence, not an upstream merge or CUDA result.