You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Edit population wiring and per-depth signal travel delays in Studio - #404
Studio 0.2.0 lets users choose both endpoints of a projection, its E/I pathway, its receiving depths and its timing. Selecting a population opens controls to add an incoming source or draw an outgoing connection. A feedforward population can receive same-step excitation from multiple earlier populations. The source table shows how they share the receiver’s contact budget. The graph uses arrowheads for excitation, bars for inhibition and dashes for delayed connections.
Core 0.6.0 adds optional delay_steps and delay_steps_by_level on delayed population projections. Users can give each projection a uniform delay or a separate delay at each receiving depth. Same-step connections use the current signal. A delayed connection uses the preceding update by default. The network retains older activities when a configured delay needs them, including across sequence chunks and in the state used for differentiation.
The connection inspector shows travel steps beside the receiving compartment’s response time constant (τ). The receiving population editor also exposes the initial τ at each depth and the option to learn it. Studio exports native DendriNet YAML and requires the matching 0.6.x core. The current PyPI releases are core 0.5.0 and Studio 0.1.0.
Try it
Open a personal Studio session. Each visitor gets a temporary CPU workspace. YAML → Export saves a design and Runs → Curves (CSV) downloads its training and validation losses.
For GPU training, start Studio on an allocated compute node. The cluster GPU guide includes Open OnDemand, Cursor and SSH instructions.
Open Recurrent decision population network. Select the pyr → pyr connection and choose Edit connection → Travel delay → Set delay by depth. Enter 1, 2 and 3 at the soma, primary and distal levels. The connection now shows when a signal arrives alongside the receiving response times of 10, 20 and 40.
In Two-class population network, add a second excitatory population to layer0 and a feedforward layer. Select layer1.e, choose Add input source, and add layer0.e2. The receiver now lists both upstream E populations on the same pathway.
The recurrent decision circuit can also take inhibitory feedback from a later feedforward readout layer. The illustrated Studio guide walks through this example.
Contextual remapping on EMNIST
Under Model → Start from, choose Contextual remapping on EMNIST. A character and one of 32 cues enter the first of two feedforward E/I layers. The output is the character class shifted by the cue, modulo 47. The CPU tutorial has 48 excitatory and 18 inhibitory neurons per layer and runs three short epochs. The first run downloads EMNIST (about 536 MiB). The full Figure 7 shunting and additive configurations and their gate calibration are in the empirical project.
With the published Studio 0.1.0 and core 0.5.0, save the template YAML and choose YAML → Import. A browser session with the PyPI wheels built the imported model and completed all three epochs.
Review fixes
Removing a layer now respects an implicit final-layer readout, preserving compatible population selections. A confirmed deletion can repair an invalid population or layer. The connection editor can repair uncovered contacts from the current draft. Studio validates the entire revision before committing a repair and refuses stale confirmations. Undo safely updates the inspector when a selected item disappears.
A connection can repair an uncovered depth when a contact edit leaves the draft invalid. The repaired design goes through validation before it is saved. Disabled and zero-probability routes preserve the contact budget shared by other sources.
Per-depth response times follow the current design after reset, Undo or Redo. Successive layer and population renames update their source, target and readout references.
Check model, Train, YAML Export and Copy wait for pending connection edits and report a rejected edit before submitting or exporting a design.
Copied layers add local I → E wiring when the receiving population has eligible inhibitory contacts. Studio checks the native gradient-credit rule before saving a layer that steps through time, including inherited settings.
Morphology edits preserve pending changes to time constants and contact counts. Independent inspector edits apply in order. An open dialog detects a replaced design and a cancelled edit leaves the document intact.
A depth-restricted route retimed onto an empty pathway receives contacts at the selected depths. A zero-probability projection keeps its source-column positions and needs no additional history.
A seeded branched receiver with differently sized E and I source populations has independent checks of synaptic currents at every depth and of full-sequence versus chunked outputs and gradients.
Resetting contact counts to uniform and then editing one receiving depth preserves the two actions in order, including through Undo.
A depth-restricted pathway must have a source for each receiving depth with contacts. Both imported YAML and the connection editor identify the population, pathway and missing depth. An enabled source with positive probability can supply that depth even when the edited route targets a different one.
After Undo or Redo, while a preview is pending, Export and Copy use the current design. Unapplied editor text is preserved verbatim.
Verification
At 5c199a394, 14 browser cases cover readout selection, repairing invalid drafts, Undo and stale confirmations. The CPU suite passed 181 tests across Studio, installed examples, contextual remapping and core population delays. The wheel installs passed 26 checks and Sphinx built with warnings treated as errors. The README and Studio manual link to the release tag for the published version. A fresh public Binder session opened the contextual template, exported its eight routes and passed the readout, removal and connection repairs.
Studio editor fixes at 156b6ee0b: all 16 browser regressions fail on the previous PR head and pass with the fix. The CPU run passed 146 tests across Studio, installed examples and contextual remapping. The candidate wheels passed the 16 regressions and the contextual gallery/export check. A fresh public Binder session also repaired an uncovered depth, renamed a population twice and exported the eight-route contextual example. GitHub CI passed on Python 3.10, 3.11 and 3.12 at 1397a297a.
Contextual template checks at 94ee48da0: a CPU browser session showed all eight routes, exported the source configuration, built the model and completed three epochs on EMNIST Balanced. The local test suite covered installed examples, the presentation stream and Studio. Both candidate wheels install and expose the template.
Public contextual preview verified in a fresh Binder session: the gallery opened the four-population model and the exported YAML matched the packaged example.
GitHub release-candidate checks at 055022f19: 7 passed, 4 skipped.
At 9d1500ec5, all 103 Studio tests and 20 native delay tests passed on CPU. Six of the first seven new cases failed against 4a40bff7a. Two further cases exposed stale YAML during Export and Copy after Undo on d650fa635.
All six new browser cases passed against the installed wheels. The core and Studio wheels and both source archives passed strict packaging checks. Sphinx and both generated references passed.
The public preview built both two-source designs, trained the delayed example for one CPU epoch, and reproduced all three previously verified YAML exports byte for byte.
A second visitor session exercised all six new browser cases through Binder's public proxy.
All seven GitHub checks passed at 38652fcc4.
At d5f543ec0, 94 Studio tests and 212 related core tests passed on CPU. Thirteen regression cases failed against the preceding PR head. GitHub CI passed on Python 3.10, 3.11 and 3.12. Codecov reports full patch coverage. A separate run also exercised every changed branch in the four files flagged in the earlier report.
The feedforward and recurrent default examples produced 212 bit-identical tensors against core 0.5.0, covering model state, outputs and gradients.
Both wheels and both source distributions passed the strict packaging check. Eleven browser tests passed against the installed wheels. A CPU browser session built a receiver supplied by two excitatory populations, restricted one source to its distal branches, and trained the delayed decision network for one epoch.
The authenticated Jupyter session test passed. Documentation and installed examples passed 136 checks, with six abbreviated sweep snippets skipped. Sphinx builds with warnings treated as errors and the CLI and configuration references are current.
A public Binder session for d5f543ec0 opened the editor, built the two-source network and its distal-only variant, trained the delayed decision network for one CPU epoch, and downloaded the loss CSV. The three YAML exports matched the installed-wheel exports byte for byte.
Release preparation
The README, Studio’s PyPI description and installation guide distinguish the two compatible pairs. Studio 0.2.0 uses core 0.6.x. The empirical paper's public examples remain pinned to core 0.5.0 and the optional Studio 0.1.0. With the candidate core, all eight example configs loaded and the two analyses reproduced their archived summaries and software-guide plot byte for byte.
Both candidate wheels and source distributions built successfully. Twine accepted all four archives, the wheel descriptions matched their source READMEs, and Sphinx built with warnings treated as errors. The release, installation and documentation checks passed 138 tests with six documented sweep-excerpt skips.
After this PR merges, tag the reviewed commit as v0.6.0 and studio-v0.2.0. Stage the packages on TestPyPI, check the installation, then promote core followed by Studio using their respective staging run IDs. Release instructions
houman1359
changed the title
Design mixed feedforward and recurrent population networks in Studio
Edit population wiring and per-depth signal travel delays in Studio
Nov 20, 2026
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved Studio edit races and configuration defects can discard user changes or generate invalid models, while branched-delay execution still lacks regression coverage.
This PR adds population wiring and travel-delay editing to Studio 0.2.0, backed by core 0.6.0. It extends the existing population-network and native YAML workflow while retaining one-step delays as the default.
Changes:
Add uniform and per-depth projection delays, preserving signal history across sequence chunks and state reconstruction.
Expand Studio’s connection editor, mixed feedforward/recurrent layers, and timing inspectors.
Add personal Binder sessions, regression coverage, documentation, and package compatibility updates.
File
Description
tests/test_population_delays.py
Tests arrivals, history, gradients, and default compatibility.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved editor-state and wiring defects can overwrite or misapply user edits, let actions use stale designs, and produce configurations rejected by validation or the model builder.
This key changes which compartment it identifies when a depth is added or removed. If a user types an uncommitted τ value while a morphology request is pending, rebuildKeepingFocus() restores that value and focus to the wrong row: adding a third depth moves a pending primary-depth edit to depth 2, so Enter updates the wrong compartment. Use the soma-relative depth as the UI key, while keeping the YAML list in distal-to-soma order.
Clear readout overrides when removing the effective readout layer
When the last layer is removed and readout_layer is omitted, the network-level readout_population is left attached to the new last layer. If that population is missing or conflicts with the layer's readout, validation rejects the removal. Resolve the effective readout layer before splicing, and clear both overrides when that layer is removed.
Wait for pending topology edits before model actions
While a non-dialog topology edit is being validated, Train, Check model and YAML export can still use the previous design, and the header continues to show Valid. Track queued topology work as pending and make these actions wait for it to settle before reading the design.
Editing a disabled connection with a zero contact budget still enables this field, so saving even an unchanged route writes a positive budget to the receiving population. If another enabled route shares that pathway, this silently activates contacts that were intentionally set to zero. Skip the budget prompt and mutation for disabled routes.
Wait for YAML imports before interacting with the design
apps/studio/tests/test_browser.py:400
Applying YAML is asynchronous, and the next population controls already exist in the default design, so these clicks can edit the old document before the import replaces it. Use open_design(page, raw) to wait until the imported design is active. Apply the same change at lines 699, 746 and 799.
Avoid copying the full delay history on every update
Each update copies the entire retained history with torch.cat, so memory traffic grows with sequence length × delay × batch size × source width. A 1,000-step delay for 32 × 1,024 float32 activities copies roughly 125 MiB per update, even though only one new frame is added. Keep differentiable frame references in a bounded queue and materialize the history tensor at state or chunk boundaries instead of copying it each step.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved editing bugs can restore discarded values, break references, block repairs, and use stale configurations, while saving a disabled connection can unintentionally activate another route’s synapses.
Resetting explicit time constants and then editing a depth before the preview refreshes can restore the discarded values at the other depths. The same stale context can reintroduce values after Undo or Redo. Resolve the settings from the current configuration, layer defaults and schema defaults, as the contact-count editor does.
Renaming a population twice while validation is pending leaves its connections and readouts pointing to the intermediate name, because the second edit reads the old preview. Read the name from the current draft, falling back to the preview only when it is omitted. Same issue in design.js:1200 for layer names and qualified sources.
While a topology preview is pending, the edited values exist only in a private draft and state.config still holds the previous design. Committing a connection probability and immediately using Check model, Train, Export or Copy can therefore use the old probability. Make these actions wait for the topology queue and report rejected edits before reading the design.
Require contact budgets only for enabled connections
Editing a disabled connection with a zero contact budget still enables this field and writes its default value of 1 on save. If another enabled route shares that pathway and its zero budget is an intentional lesion, merely editing the disabled route activates the other route's synapses. Only require and write a contact budget for an enabled connection.
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
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.
Population wiring and timing
Studio 0.2.0 lets users choose both endpoints of a projection, its E/I pathway, its receiving depths and its timing. Selecting a population opens controls to add an incoming source or draw an outgoing connection. A feedforward population can receive same-step excitation from multiple earlier populations. The source table shows how they share the receiver’s contact budget. The graph uses arrowheads for excitation, bars for inhibition and dashes for delayed connections.
Core 0.6.0 adds optional
delay_stepsanddelay_steps_by_levelon delayed population projections. Users can give each projection a uniform delay or a separate delay at each receiving depth. Same-step connections use the current signal. A delayed connection uses the preceding update by default. The network retains older activities when a configured delay needs them, including across sequence chunks and in the state used for differentiation.The connection inspector shows travel steps beside the receiving compartment’s response time constant (τ). The receiving population editor also exposes the initial τ at each depth and the option to learn it. Studio exports native DendriNet YAML and requires the matching 0.6.x core. The current PyPI releases are core 0.5.0 and Studio 0.1.0.
Try it
Open a personal Studio session. Each visitor gets a temporary CPU workspace. YAML → Export saves a design and Runs → Curves (CSV) downloads its training and validation losses.
For GPU training, start Studio on an allocated compute node. The cluster GPU guide includes Open OnDemand, Cursor and SSH instructions.
pyr → pyrconnection and choose Edit connection → Travel delay → Set delay by depth. Enter 1, 2 and 3 at the soma, primary and distal levels. The connection now shows when a signal arrives alongside the receiving response times of 10, 20 and 40.layer0and a feedforward layer. Selectlayer1.e, choose Add input source, and addlayer0.e2. The receiver now lists both upstream E populations on the same pathway.Contextual remapping on EMNIST
Under Model → Start from, choose Contextual remapping on EMNIST. A character and one of 32 cues enter the first of two feedforward E/I layers. The output is the character class shifted by the cue, modulo 47. The CPU tutorial has 48 excitatory and 18 inhibitory neurons per layer and runs three short epochs. The first run downloads EMNIST (about 536 MiB). The full Figure 7 shunting and additive configurations and their gate calibration are in the empirical project.
With the published Studio 0.1.0 and core 0.5.0, save the template YAML and choose YAML → Import. A browser session with the PyPI wheels built the imported model and completed all three epochs.
Review fixes
Removing a layer now respects an implicit final-layer readout, preserving compatible population selections. A confirmed deletion can repair an invalid population or layer. The connection editor can repair uncovered contacts from the current draft. Studio validates the entire revision before committing a repair and refuses stale confirmations. Undo safely updates the inspector when a selected item disappears.
A connection can repair an uncovered depth when a contact edit leaves the draft invalid. The repaired design goes through validation before it is saved. Disabled and zero-probability routes preserve the contact budget shared by other sources.
Per-depth response times follow the current design after reset, Undo or Redo. Successive layer and population renames update their source, target and readout references.
Check model, Train, YAML Export and Copy wait for pending connection edits and report a rejected edit before submitting or exporting a design.
Copied layers add local I → E wiring when the receiving population has eligible inhibitory contacts. Studio checks the native gradient-credit rule before saving a layer that steps through time, including inherited settings.
Morphology edits preserve pending changes to time constants and contact counts. Independent inspector edits apply in order. An open dialog detects a replaced design and a cancelled edit leaves the document intact.
A depth-restricted route retimed onto an empty pathway receives contacts at the selected depths. A zero-probability projection keeps its source-column positions and needs no additional history.
A seeded branched receiver with differently sized E and I source populations has independent checks of synaptic currents at every depth and of full-sequence versus chunked outputs and gradients.
Resetting contact counts to uniform and then editing one receiving depth preserves the two actions in order, including through Undo.
A depth-restricted pathway must have a source for each receiving depth with contacts. Both imported YAML and the connection editor identify the population, pathway and missing depth. An enabled source with positive probability can supply that depth even when the edited route targets a different one.
After Undo or Redo, while a preview is pending, Export and Copy use the current design. Unapplied editor text is preserved verbatim.
Verification
At
5c199a394, 14 browser cases cover readout selection, repairing invalid drafts, Undo and stale confirmations. The CPU suite passed 181 tests across Studio, installed examples, contextual remapping and core population delays. The wheel installs passed 26 checks and Sphinx built with warnings treated as errors. The README and Studio manual link to the release tag for the published version. A fresh public Binder session opened the contextual template, exported its eight routes and passed the readout, removal and connection repairs.Studio editor fixes at
156b6ee0b: all 16 browser regressions fail on the previous PR head and pass with the fix. The CPU run passed 146 tests across Studio, installed examples and contextual remapping. The candidate wheels passed the 16 regressions and the contextual gallery/export check. A fresh public Binder session also repaired an uncovered depth, renamed a population twice and exported the eight-route contextual example. GitHub CI passed on Python 3.10, 3.11 and 3.12 at1397a297a.Contextual template checks at
94ee48da0: a CPU browser session showed all eight routes, exported the source configuration, built the model and completed three epochs on EMNIST Balanced. The local test suite covered installed examples, the presentation stream and Studio. Both candidate wheels install and expose the template.Public contextual preview verified in a fresh Binder session: the gallery opened the four-population model and the exported YAML matched the packaged example.
GitHub release-candidate checks at
055022f19: 7 passed, 4 skipped.At
9d1500ec5, all 103 Studio tests and 20 native delay tests passed on CPU. Six of the first seven new cases failed against4a40bff7a. Two further cases exposed stale YAML during Export and Copy after Undo ond650fa635.All six new browser cases passed against the installed wheels. The core and Studio wheels and both source archives passed strict packaging checks. Sphinx and both generated references passed.
The public preview built both two-source designs, trained the delayed example for one CPU epoch, and reproduced all three previously verified YAML exports byte for byte.
A second visitor session exercised all six new browser cases through Binder's public proxy.
All seven GitHub checks passed at
38652fcc4.At
d5f543ec0, 94 Studio tests and 212 related core tests passed on CPU. Thirteen regression cases failed against the preceding PR head. GitHub CI passed on Python 3.10, 3.11 and 3.12. Codecov reports full patch coverage. A separate run also exercised every changed branch in the four files flagged in the earlier report.The feedforward and recurrent default examples produced 212 bit-identical tensors against core 0.5.0, covering model state, outputs and gradients.
Both wheels and both source distributions passed the strict packaging check. Eleven browser tests passed against the installed wheels. A CPU browser session built a receiver supplied by two excitatory populations, restricted one source to its distal branches, and trained the delayed decision network for one epoch.
The authenticated Jupyter session test passed. Documentation and installed examples passed 136 checks, with six abbreviated sweep snippets skipped. Sphinx builds with warnings treated as errors and the CLI and configuration references are current.
A public Binder session for
d5f543ec0opened the editor, built the two-source network and its distal-only variant, trained the delayed decision network for one CPU epoch, and downloaded the loss CSV. The three YAML exports matched the installed-wheel exports byte for byte.Release preparation
The README, Studio’s PyPI description and installation guide distinguish the two compatible pairs. Studio 0.2.0 uses core 0.6.x. The empirical paper's public examples remain pinned to core 0.5.0 and the optional Studio 0.1.0. With the candidate core, all eight example configs loaded and the two analyses reproduced their archived summaries and software-guide plot byte for byte.
Both candidate wheels and source distributions built successfully. Twine accepted all four archives, the wheel descriptions matched their source READMEs, and Sphinx built with warnings treated as errors. The release, installation and documentation checks passed 138 tests with six documented sweep-excerpt skips.
After this PR merges, tag the reviewed commit as
v0.6.0andstudio-v0.2.0. Stage the packages on TestPyPI, check the installation, then promote core followed by Studio using their respective staging run IDs. Release instructions