Conversation
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.
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
47f6477feat(models): update exports to include dsl submodule6991462docs(dsl_models): add readme for dsl model specs and usagec6deab6feat(dsl_models): add package init with dsl model exportsc539bf2feat(dsl_models): add deco2014 dsl spec with dfun and coupling666e369feat(dsl_models): add hopf dsl spec with diffusive couplinge7bf02cfeat(dsl_models): add montbrio dsl spec with six state variables6798263feat(dsl_models): add naskar2021 dsl spec with inhibitory plasticity2a7f3a6docs(dsl): add readme for dsl declarative model system420dfe4feat(dsl): add public api init for declarative model dsl413e917feat(dsl): add builder module to generate model from spece2d31ccfeat(dsl): add dependent parameter dag analysis and topo sorte757c63feat(dsl): add on-disk module materialization for numba cachea7bbdbcfeat(dsl): add ast rewriter to transform equations to numba forme83ecd1feat(dsl): add spec dataclasses for model declarationca7dc90test(tests): add shared fixtures for dsl test suitecda71e9test(tests): add spec and equation validation unit tests4b4ac1atest(tests): add dependent parameter dag and evaluation testsae65e4atest(tests): add dfun and coupling equivalence tests for dsl models0bf4043test(tests): add ux polish and cache dir configuration tests986c43ctest(tests): add end-to-end simulator trajectory equivalence testse3ba89dtest(tests): add subclass recursion regression tests for dsl models81eaa82feat(dsl_models): add paired simulation comparison script84b5aa6feat(simulator): rename HistoryDense to HistoryDelays and fix buffer init86c8101docs(dsl): update readme with parameter and coupling clarifications2234dc6feat(dsl): update dfun builder to use closure-based param capturea9ef80bfeat(dsl): update dependents to allow model context names in formulas6e9b7c6feat(dsl): update rewriter to support helper functions in dfun bodiese6dbc71feat(dsl): update spec to support matrix params and delayed couplingc2f312ffeat(simulator): update configure to wire HistoryDelays with tract delays5b286e0test(tests): update dependents tests to verify dfun closure capturea5ba031test(tests): add delayed coupling spec and equivalence tests35cc534test(tests): add helper function callable from dfun tests0c243d9test(tests): add numerical jacobian shape and correctness tests8d691a6test(tests): add matrix-shaped dependent parameter closure tests92b8ccatest(tests): add on_configure escape hatch and fic use case testsa9c6a71docs(dsl_models): update readme with loc counts and builder api docs7f7a450feat(dsl): update public api to export modelbuilder classc29ab68feat(dsl): add fluent incremental builder for modelspec assembly0a8a471test(tests): add modelbuilder chaining and imperative style tests04f4c1cdocs(dsl_models): update readme with zerlaut port and feature coverage4688a8cfeat(dsl_models): update exports to include zerlaut dsl modelsfee5dfafeat(dsl): update rewriter to support tuple-unpacking assignments668667bfeat(models): update zerlaut dfun to hoist m_aux out of jit closure55276b0test(tests): update conftest to add zerlaut spec and class fixtures8041113test(tests): update equivalence tests to cover zerlaut models54bab4btest(tests): update helpers tests to cover tuple-unpacking cases4fba908feat(dsl_models): add zerlaut dsl spec with first and second order9da14e3docs(dsl_models): update readme with per-spec usage guide