Skip to content

Reset and resize CSRM connection spike history - #815

Open
AHMETHAKANBEZIR1 wants to merge 2 commits into
BindsNET:masterfrom
AHMETHAKANBEZIR1:fix/csrm-window-reset
Open

AHMETHAKANBEZIR1 wants to merge 2 commits into
BindsNET:masterfrom
AHMETHAKANBEZIR1:fix/csrm-window-reset

Conversation

@AHMETHAKANBEZIR1

@AHMETHAKANBEZIR1 AHMETHAKANBEZIR1 commented Oct 23, 2026 •

Copy link
Copy Markdown

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.

AHMETHAKANBEZIR1 and others added 2 commits October 23, 2026 04:38
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
@AHMETHAKANBEZIR1 AHMETHAKANBEZIR1 changed the title Reset CSRM connection spike history between trials Reset and resize CSRM connection spike history Oct 23, 2026

This branch has not been deployed

No deployments
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