Skip to content

Add declarative DSL for authoring numba-compiled neuronumba models#116

Draft
neich wants to merge 48 commits into
mainfrom
add-dsl
Draft

Add declarative DSL for authoring numba-compiled neuronumba models#116
neich wants to merge 48 commits into
mainfrom
add-dsl

Conversation

@neich
Copy link
Copy Markdown
Owner

@neich neich commented May 7, 2026

Summary

Introduces a new DSL layer under src/neuronumba/simulator/models/dsl/ that lets users declare models as plain Python dataclasses and generates equivalent numba-compiled dfun and coupling functions at runtime. All five existing models (Hopf, Deco2014, Montbrio, Naskar2021, Zerlaut) are ported to DSL specs in examples/dsl_models/ and validated against their hand-written counterparts by a full test suite covering spec validation, DAG-based dependent parameters, helper functions, matrix params, delayed coupling, and end-to-end trajectory equivalence.

Commits

  • 47f6477 feat(models): update exports to include dsl submodule
  • 6991462 docs(dsl_models): add readme for dsl model specs and usage
  • c6deab6 feat(dsl_models): add package init with dsl model exports
  • c539bf2 feat(dsl_models): add deco2014 dsl spec with dfun and coupling
  • 666e369 feat(dsl_models): add hopf dsl spec with diffusive coupling
  • e7bf02c feat(dsl_models): add montbrio dsl spec with six state variables
  • 6798263 feat(dsl_models): add naskar2021 dsl spec with inhibitory plasticity
  • 2a7f3a6 docs(dsl): add readme for dsl declarative model system
  • 420dfe4 feat(dsl): add public api init for declarative model dsl
  • 413e917 feat(dsl): add builder module to generate model from spec
  • e2d31cc feat(dsl): add dependent parameter dag analysis and topo sort
  • e757c63 feat(dsl): add on-disk module materialization for numba cache
  • a7bbdbc feat(dsl): add ast rewriter to transform equations to numba form
  • e83ecd1 feat(dsl): add spec dataclasses for model declaration
  • ca7dc90 test(tests): add shared fixtures for dsl test suite
  • cda71e9 test(tests): add spec and equation validation unit tests
  • 4b4ac1a test(tests): add dependent parameter dag and evaluation tests
  • ae65e4a test(tests): add dfun and coupling equivalence tests for dsl models
  • 0bf4043 test(tests): add ux polish and cache dir configuration tests
  • 986c43c test(tests): add end-to-end simulator trajectory equivalence tests
  • e3ba89d test(tests): add subclass recursion regression tests for dsl models
  • 81eaa82 feat(dsl_models): add paired simulation comparison script
  • 84b5aa6 feat(simulator): rename HistoryDense to HistoryDelays and fix buffer init
  • 86c8101 docs(dsl): update readme with parameter and coupling clarifications
  • 2234dc6 feat(dsl): update dfun builder to use closure-based param capture
  • a9ef80b feat(dsl): update dependents to allow model context names in formulas
  • 6e9b7c6 feat(dsl): update rewriter to support helper functions in dfun bodies
  • e6dbc71 feat(dsl): update spec to support matrix params and delayed coupling
  • c2f312f feat(simulator): update configure to wire HistoryDelays with tract delays
  • 5b286e0 test(tests): update dependents tests to verify dfun closure capture
  • a5ba031 test(tests): add delayed coupling spec and equivalence tests
  • 35cc534 test(tests): add helper function callable from dfun tests
  • 0c243d9 test(tests): add numerical jacobian shape and correctness tests
  • 8d691a6 test(tests): add matrix-shaped dependent parameter closure tests
  • 92b8cca test(tests): add on_configure escape hatch and fic use case tests
  • a9c6a71 docs(dsl_models): update readme with loc counts and builder api docs
  • 7f7a450 feat(dsl): update public api to export modelbuilder class
  • c29ab68 feat(dsl): add fluent incremental builder for modelspec assembly
  • 0a8a471 test(tests): add modelbuilder chaining and imperative style tests
  • 04f4c1c docs(dsl_models): update readme with zerlaut port and feature coverage
  • 4688a8c feat(dsl_models): update exports to include zerlaut dsl models
  • fee5dfa feat(dsl): update rewriter to support tuple-unpacking assignments
  • 668667b feat(models): update zerlaut dfun to hoist m_aux out of jit closure
  • 55276b0 test(tests): update conftest to add zerlaut spec and class fixtures
  • 8041113 test(tests): update equivalence tests to cover zerlaut models
  • 54bab4b test(tests): update helpers tests to cover tuple-unpacking cases
  • 4fba908 feat(dsl_models): add zerlaut dsl spec with first and second order
  • 9da14e3 docs(dsl_models): update readme with per-spec usage guide

@neich neich marked this pull request as draft May 7, 2026 15:41
@neich neich changed the title Add declarative DSL for defining neuronumba models from equation specs Add declarative DSL for authoring neuronumba models without boilerplate May 7, 2026
@neich neich changed the title Add declarative DSL for authoring neuronumba models without boilerplate Add declarative DSL for defining neural mass models from equations May 7, 2026
@neich neich changed the title Add declarative DSL for defining neural mass models from equations Add declarative DSL for specifying numba-compiled neural mass models May 7, 2026
@neich neich changed the title Add declarative DSL for specifying numba-compiled neural mass models Add declarative DSL for defining neuronumba neural mass models May 7, 2026
@neich neich changed the title Add declarative DSL for defining neuronumba neural mass models Add declarative DSL for authoring numba-compiled neuronumba models May 7, 2026
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