Skip to content

Revise input and output ports in NESTML - #1299

Draft
clinssen wants to merge 229 commits into
nest:mainfrom
clinssen:inhibitory_excitatory_remove
Draft

Revise input and output ports in NESTML#1299
clinssen wants to merge 229 commits into
nest:mainfrom
clinssen:inhibitory_excitatory_remove

Conversation

@clinssen

@clinssen clinssen commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

Introduces the NESTML predefined sift() function to process spike events in event handlers. See here for documentation on sift(): https://github.com/nest/nestml/pull/1299/files#diff-22c1d3766680291b0aed3cd548fc0980ecc6511ebb5532a8ed2607105e1775e3R1198

Remove the excitatory and inhibitory spiking input port qualifiers. Instead, spikes should be routed (a) on the basis of having multiple spiking input ports (like one for excitatory and one for inhibitory input); or (b) on the basis of a condition like

if weight < 0: 
    # treat as an inhibitory spike
else:
    # treat as an excitatory spike

A consequence of this is that spike ports can no longer be assumed to be linear and time-invariant in the general case (as in this case, a spike from the buffer will be processed differently depending on the sign of its weight). On the C++ side, this means that each spiking input port now uses the VectorRingBuffer class (https://github.com/nest/nestml/pull/1299/files#diff-ee49404cf3290ce0e9ee40e25068b6d123da357aee83794ab89745a7e2aaf988R1) rather than the RingBuffer. The performance penalty of this is approximately 12.5% in a small balanced network example. An extra code generation option, linear_time_invariant_spiking_input_ports, is provided to instruct the NEST code generator that a set of given ports can be considered LTI. With this option enabled, performance is indistinguishable from the current main branch performance.

Should be merged after #1288. Done.
Should be merged after #1349. Done.
Should be merged after #1358. Done.
Should be merged after #1291.

Replaces #1137.

Fixes #944.

C.A.P. Linssen added 30 commits October 17, 2024 11:08

The statements in the event handler will be executed when the event occurs and integrate the state of the system from "just before" the event (at :math:`t-\epsilon`, for :math:`\epsilon\rightarrow 0`) to "just after" the event (at :math:`t=t+\epsilon`). Analogous to the ``update`` block, the predefined variable ``t`` indicates the time :math:`t` at the start of the interval (the function ``timestep()`` may not be used inside an ``onReceive`` block to prevent confusion).

Typically, the statements in the ``onReceive`` block integrate the delta function across time, yielding the surface area under the curve, the value of which corresponds to the weight of the spike. To perform this integration in a concise way, we use the sifting proprty of the delta function. The sifting property states that for any continuous function :math:`f(t)`:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Typically, the statements in the ``onReceive`` block integrate the delta function across time, yielding the surface area under the curve, the value of which corresponds to the weight of the spike. To perform this integration in a concise way, we use the sifting proprty of the delta function. The sifting property states that for any continuous function :math:`f(t)`:
Typically, the statements in the ``onReceive`` block integrate the delta function across time, yielding the surface area under the curve, the value of which corresponds to the weight of the spike. To perform this integration in a concise way, we use the sifting property of the delta function. The sifting property states that for any continuous function :math:`f(t)`:

@tomtetzlaff tomtetzlaff left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Apart from the small typo, this looks very good to me. Thanks a lot for this nice solution.

@clinssen

Copy link
Copy Markdown
Contributor Author

Thank you very much for the review and the kind thumbs up!

@clinssen
clinssen marked this pull request as ready for review May 31, 2026 14:31
@clinssen
clinssen marked this pull request as draft June 1, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove "inhibitory" and "excitatory" spiking input port specifiers

2 participants