Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Lamina drive onto the medulla

Goal

The stage-localization run found the lamina firing (L1 ~38 Hz, L2/L3 ~21 Hz) and the medulla silent on the real v1.0 imago, and left one question: why does activity stop between L1–L3 and Mi1, Tm3, Mi4, Mi9, Tm1, Tm2, Tm4? This entry answers it by accounting, not simulation. For each medulla type it records the summed signed effective weight arriving from each lamina type, its sign, how many cells it reaches, and whether the mean-field input at the measured lamina rates crosses threshold. The shuffled-connectome control gets the same accounting.

Setup

  • git describe: 4a8e1b4; the shuffled lamina-relay run (the fourth stage-drive command below) was added after the branch review, at ca33f29, on the same machine and imagos. The accounting and the figure script did not change between the two; ca33f29 adds only a docstring and the CLI’s exit 2 on an unreadable --rates-from file.
  • machine: straylight (AMD Ryzen AI Max host, Radeon 8060S, Linux), device cpu. The accounting is CPU-only by design: it reads the imago’s effective weights and does arithmetic on them; nothing is simulated.
  • imago: data/imagos/male-cns-v1.0.imago, built_at 2026-09-16T02:29:04+00:00, git_describe 4428500-dirty; control data/imagos/male-cns-v1.0-shuffled-1.imago, built_at 2026-09-16T02:30:12+00:00, git_describe 4428500-dirty, shuffle_seed 1
  • constants (LIFParams() defaults): \(\tau_s = 5\) ms, \(\tau_m = 20\) ms, \(W_{\mathrm{syn}} = 0.275\) mV, threshold gap \(v_{\mathrm{th}} - v_{\mathrm{rest}} = 7.0\) mV, single-spike PSP peak factor 0.1575
  • per target cell, \(W_{\mathrm{in}}\) is the summed signed effective weight (mV per presynaptic spike) from one source type; the mean-field input from that source is \(g = r \cdot \tau_s \cdot W_{\mathrm{in}}\); net lamina \(g\) sums L1, L2 and L3 per cell; the rate at which one source alone puts the median cell at threshold is \(7 / (\tau_s \cdot W_{\mathrm{in}})\), defined only for positive \(W_{\mathrm{in}}\). Medians and quartiles are over the cells the source reaches; net \(g\) is over all cells of the type.
  • source rates: mean of the four directions in the continuous-frame stage reports, produced on 2026-09-16 on the Mac (mps) and copied to straylight from titan. Real (data/runs/probe/2026-09-16-stages-continuous.json): L1 37.7756, L2 20.4635, L3 21.7939 Hz. Shuffled (data/runs/probe/2026-09-16-stages-shuffled.json): L1 37.1140, L2 36.1349, L3 33.4320 Hz.
  • commands:
    uv run flatline stage-drive --imago data/imagos/male-cns-v1.0.imago \
      --rates-from data/runs/probe/2026-09-16-stages-continuous.json \
      --out data/runs/stage-drive/2026-10-30-real.json
    uv run flatline stage-drive --imago data/imagos/male-cns-v1.0.imago \
      --rates-from data/runs/probe/2026-09-16-stages-continuous.json \
      --to L4 L5 C2 C3 \
      --out data/runs/stage-drive/2026-10-30-lamina-relays.json
    uv run flatline stage-drive --imago data/imagos/male-cns-v1.0-shuffled-1.imago \
      --rates-from data/runs/probe/2026-09-16-stages-shuffled.json \
      --out data/runs/stage-drive/2026-10-30-shuffled.json
    uv run flatline stage-drive --imago data/imagos/male-cns-v1.0-shuffled-1.imago \
      --rates-from data/runs/probe/2026-09-16-stages-shuffled.json \
      --to L4 L5 C2 C3 \
      --out data/runs/stage-drive/2026-10-30-lamina-relays-shuffled.json
    uv run python scripts/figures/stage_drive.py data/runs/stage-drive/2026-10-30-real.json book/src/figures/stage-drive-real.svg
    uv run python scripts/figures/stage_drive.py data/runs/stage-drive/2026-10-30-lamina-relays.json book/src/figures/stage-drive-lamina-relays.svg
    uv run python scripts/figures/stage_drive.py data/runs/stage-drive/2026-10-30-shuffled.json book/src/figures/stage-drive-shuffled.svg
    uv run python scripts/figures/stage_drive.py data/runs/stage-drive/2026-10-30-lamina-relays-shuffled.json book/src/figures/stage-drive-lamina-relays-shuffled.svg
    

What happened

All four accounting runs completed with no exceptions and exit 0. Wall time, including uv run start-up and loading the 25.5 M-edge imago, was 2.3 s (real), 1.8 s (lamina relays), 2.2 s (shuffled), and 2.2 s (shuffled lamina relays, run later). The four figures took 0.3–0.4 s each.

Results

Source transmitters, as labelled in the imago. Every cell of each type carries the same label; the shuffled imago has the same labels.

typecellstransmittersignuniform
L11776glutamate−1yes
L21779acetylcholine+1yes
L31772acetylcholine+1yes

Real imago, per medulla type, the dominant lamina source (largest mean-field \(g\) in magnitude). \(W_{\mathrm{in}}\) and \(g\) in mV; “net g > 7” is the fraction of all cells whose net lamina \(g\) exceeds the threshold gap; “rate to cross” is the source rate in Hz.

targetnsourcereachedsynapses (median)\(W_{\mathrm{in}}\) median [q1, q3]\(g\) from sourcenet lamina \(g\) mediannet g > 7rate to cross
Mi11773L199.9%83−22.83 [−25.30, −19.52]−4.31−3.630.0%none
Tm32054L1100.0%73−20.07 [−23.38, −16.77]−3.79−3.740.0%none
Mi41772L283.5%2+0.55 [+0.28, +1.10]+0.06+0.060.0%2545.5
Mi91775L399.9%54+14.85 [+12.38, +17.33]+1.62+1.650.0%94.3
Tm11777L299.8%120+33.00 [+27.23, +37.67]+3.38+3.380.0%42.4
Tm21766L299.9%131+36.03 [+29.98, +40.42]+3.69+3.710.0%38.9
Tm41670L2100.0%96+26.40 [+20.90, +32.72]+2.70+2.700.0%53.0

The one other substantial lamina input is L3 onto Mi1: +5.50 mV per spike (99.7% reached, 20 synapses), \(g = +0.60\) mV. Every other non-dominant lamina source is a median of one or two synapses (±0.28 to ±0.55 mV) reaching 1.6–56% of cells. The single-spike PSP peak of the median L2 input is 5.20 mV on Tm1, 5.67 mV on Tm2, and 4.16 mV on Tm4, each under the 7 mV gap.

All inputs onto the same cells (every presynaptic type, mV per spike per cell; medians of the excitatory sum, inhibitory sum and net, then the four largest presynaptic types by summed signed weight):

targetexcitatoryinhibitorynetlargest presynaptic types
Mi1+33.3−77.3−43.5L1 −22.1, L5 +11.9, Pm2b −10.0, Mi13 −6.0
Tm3+49.2−51.2−1.9L1 −20.3, Mi1 +16.9, L5 +13.7, Tm3 +7.6
Mi4+42.1−42.6+0.8L5 +11.1, TmY16 −6.7, Dm4 −6.1, Mi9 −5.6
Mi9+39.6−36.8+2.8L3 +14.8, Mi4 −13.0, Tm2 +5.6, Dm12 −4.3
Tm1+39.1−67.4−27.8L2 +31.8, Pm2b −10.2, Pm2a −8.7, Mi13 −6.1
Tm2+49.2−56.7−7.2L2 +34.4, Dm13 −6.9, L4 +6.7, Mi13 −6.0
Tm4+55.4−63.3−7.7L2 +26.8, C3 −10.7, Tm1 +7.8, Mi13 −6.7

Lamina relays on the real imago, same rates. Each cell is \(W_{\mathrm{in}}\) median (reached, median synapses).

targetntransmitterfrom L1from L2from L3net lamina \(g\) mediannet g > 7
L41770acetylcholine−0.28 (12.6%, 1 syn)+4.68 (82.4%, 17 syn)+0.28 (54.1%, 1 syn)+0.390.0%
L51787acetylcholine−21.45 (100.0%, 78 syn)+14.03 (99.6%, 51 syn)+0.28 (13.4%, 1 syn)−2.580.0%
C21745gaba−8.53 (100.0%, 31 syn)+0.28 (18.7%, 1 syn)+0.28 (22.5%, 1 syn)−1.580.0%
C31779gaba−14.85 (99.9%, 54 syn)+1.10 (96.9%, 4 syn)+2.20 (99.3%, 8 syn)−2.460.0%

Shuffled control, per medulla type, at the shuffled lamina rates. “Reached” is the fraction of cells with any input from L1 / L2 / L3, then from any of the three. All-input medians are mV per spike per cell. The last column is the largest presynaptic type by summed signed weight, over all inputs.

targetreached L1 / L2 / L3any laminanet lamina \(g\) median [q1, q3]net g > 7all inputs: exc / inh / netlargest presynaptic type
Mi110% / 20% / 30%49.4%0.00 [0.00, +0.15]0.0%+64.6 / −40.7 / +23.4Mi1 +2.05
Tm37% / 21% / 32%49.3%0.00 [0.00, +0.18]0.0%+62.7 / −36.3 / +26.1Mi1 +1.89
Mi47% / 17% / 30%45.8%0.00 [0.00, +0.14]0.0%+50.9 / −33.0 / +16.8Mi1 +1.41
Mi96% / 14% / 24%37.7%0.00 [0.00, +0.05]0.0%+45.7 / −27.8 / +16.2Mi1 +1.43
Tm15% / 23% / 28%47.0%0.00 [0.00, +0.23]3.2%+63.8 / −32.5 / +35.5L2 +3.23
Tm25% / 24% / 27%47.6%0.00 [0.00, +0.20]3.5%+62.7 / −30.7 / +35.8L2 +3.15
Tm410% / 26% / 45%63.8%+0.05 [0.00, +0.23]0.0%+73.7 / −43.7 / +28.9Mi1 +2.05

Lamina relays on the shuffled control, at the shuffled lamina rates, same columns as the real relay table.

targetntransmitterfrom L1from L2from L3net lamina \(g\) mediannet g > 7
L41770acetylcholine−0.28 (1.2%, 1 syn)+0.55 (3.4%, 2 syn)+0.55 (7.7%, 2 syn)0.000.0%
L51787acetylcholine−15.68 (8.8%, 57 syn)+3.58 (11.0%, 13 syn)+0.83 (14.5%, 3 syn)0.000.1%
C21745gaba−1.38 (2.0%, 5 syn)+1.38 (6.4%, 5 syn)+0.83 (9.0%, 3 syn)0.000.0%
C31779gaba−2.89 (3.0%, 10.5 syn)+1.38 (9.1%, 5 syn)+0.55 (16.6%, 2 syn)0.000.0%

Any lamina source reaches 11.9% of L4, 30.8% of L5, 16.4% of C2 and 26.8% of C3 in the control, against 92.1% of L4 and 100% of L5, C2 and C3 on the real wiring. The 0.1% of L5 above the gap is one cell. All-input net medians are +16.5 (L5), +7.7 (C2) and +14.3 (C3) mV per spike, against −12.4, +4.4 and +9.6 on the real wiring; the largest presynaptic type onto each is Mi1 (+1.95, +0.67, +0.86), where on the real wiring it is L1 (−20.96, −8.43, −14.61).

Per-source \(W_{\mathrm{in}}\) medians in the control, over the cells reached, are 0.55–3.58 mV in magnitude. Tm1 and Tm2 have a long tail from L2 (q3 +33.48 and +33.96 mV); that tail is the 3.2% and 3.5% of cells above the gap. Tm4’s +0.05 mV median is one L3 synapse (\(0.275 \times 33.43 \times 0.005 = 0.046\) mV): Tm4 is the one type the shuffled lamina reaches in more than half its cells.

In the two shuffled figures each coloured segment is the median \(g\) over the cells that source reaches (5–45% of a medulla type, 1–17% of a lamina relay), while the black tick is the net median over all cells, so the segments do not sum to the tick and overstate the drive a typical cell gets: L1’s segment on L5 is −2.91 mV over the 8.8% of cells it reaches, and the net tick is 0.00.

Conclusions

The medulla is silent for two different reasons, one per pathway. Neither is a missing connection: on the real wiring every medulla type except Mi4 gets its dominant lamina input in 99.8–100% of its cells, from 54 to 131 synapses.

The ON pathway is silent because of a sign. L1 is glutamatergic in the dataset’s labels, so under the Shiu et al. sign table (spec section 6.3) its output is inhibitory. L1 is the dominant lamina input to Mi1 (−22.83 mV per spike, 83 synapses), Tm3 (−20.07), L5 (−21.45), C2 (−8.53) and C3 (−14.85). With L1 biased to fire at 38 Hz, the lamina holds the first ON-pathway medulla stage 3.6–3.7 mV below rest (net \(g\) −3.63 on Mi1, −3.74 on Tm3). There is no L1 rate that brings them to threshold. In the fly this synapse is in fact sign-inverting (L1 → Mi1 through glutamate-gated chloride channels). The ON pathway works there because Mi1 is a graded cell that is disinhibited when L1’s tonic glutamate release falls in the light. A spiking Mi1 at rest has no inhibition to lose. This is the spec 8.6 problem one synapse further on. A graded lamina alone, the 8.6 fallback, would not fix it: a graded L1 that hyperpolarizes to light still only reduces inhibition on a Mi1 that has nothing to reduce from.

The OFF pathway is silent because of an operating point. L2 is cholinergic and excites Tm1, Tm2 and Tm4 with +26.40 to +36.03 mV per spike from 96–131 synapses per cell, reaching 99.8–100% of cells. At the 20.46 Hz L2 rate measured under the grating, that is a mean-field input of 2.70–3.69 mV, under the 7 mV gap, and no cell of the three types crosses it. L2 would need roughly 40–53 Hz: 38.9 Hz for Tm2, 42.4 Hz for Tm1, 53.0 Hz for Tm4. The lamina bias was set for a 50 Hz rate at the 10 Hz dark photoreceptor baseline. Under the probe grating the photoreceptors average 31 Hz because the encoder rectifies, \(r = \mathrm{clamp}(10 + 100 \cdot \mathrm{contrast}, 0, 300)\): the negative half of the contrast cycle is clipped at zero, so the mean rises and histaminergic inhibition onto the lamina roughly triples. The working hypothesis here was that this excess is what holds L2 at 20 Hz instead of its 50 Hz target: an encoder operating-point effect, testable with existing flags. This entry measured only the L2 → medulla weights; the photoreceptor → L2 step was not tested. Tested in the operating-point sweep: raising --r-base wakes Tm1, Tm2 and Tm4 and T5 stays silent, but at r_base 100, where the photoreceptors average 98.64 Hz and the bias rule’s assumption holds, it still misses L1 (65.17 Hz) and L3 (33.37 Hz) against the 50 Hz target. The encoder mean also does not explain the L1/L2 split at r_base 10 (37.78 against 20.49 Hz), and the shuffled imago, whose lamina gets the same bias, runs L2 15.7–17.9 Hz hotter at every r_base in the sweep’s cpu runs. Part of the L2 shortfall is per-type, from the wiring or the LIF nonlinearity, and is not measured. The median single L2 spike is a 4.16–5.67 mV PSP, also under the gap, which is why Tm1/Tm2/Tm4 leak at 0.007–0.37 Hz in the stage-localization run (two L2 spikes close together) instead of being exactly silent.

Mi4 and Mi9 are second-order on the lamina. Mi4 has almost no direct lamina input (+0.55 mV per spike from two L2 synapses, net \(g\) +0.06 mV); from that 0.55 mV median input, L2 would need 2545.5 Hz to put the median cell at threshold, which is effectively unreachable. Its lamina driver is L5 (+11.1 mV per spike), and L5 is itself held below rest by L1 (net lamina \(g\) −2.58 mV). Mi9 is driven by L3 (+14.85 mV per spike, 54 synapses), but at 21.79 Hz that is +1.62 mV; L3 would need 94.3 Hz. Mi9 is also inhibited by Mi4 (−13.0 mV per spike), which is silent, so that term is currently zero.

The shuffled control’s medulla activity is recurrent, not lamina-driven. In the control the lamina reaches only 38–64% of each medulla type through any source, with per-source medians of a few millivolts, and the net lamina \(g\) median is 0.00 mV for six of the seven types and +0.05 mV (one synapse) for Tm4. The largest presynaptic type onto any of them is under 3.3 mV per spike. What the control does have is positive all-input net medians, +16.2 to +35.8 mV per spike, against negative or near-zero ones on the real wiring (−43.5 to +2.8). The medulla rates the control shows (Mi1 6.7 Hz, Tm1/Tm2 11 Hz) come from recurrent excitation in the randomized brain. They say these cells can spike under these weight magnitudes. They do not say the lamina drives them there. The shuffled lamina relays show the same: L1 reaches 2.0–8.8% of L5, C2 and C3 instead of 99.9–100%, and their net lamina \(g\) median is 0.00 mV against −1.58 to −2.58 mV on the real wiring, so the L1 hold below rest is a property of the real L1 wiring, not of the sign table or the lamina rates.

The question was whether the accounting says the medulla should fire. It does not: on the real wiring, at these lamina rates, no medulla cell has a net lamina input above the gap. The silence is predicted by the weights and the operating point, not an engine failure.

Next steps

A decision for Kyle, among three options:

  • (a) Extend the tonic operating-point policy from the lamina to the graded types whose dominant drive is inhibitory (Mi1, Tm3, L5, C2, C3, and by the same rule Mi4 and Mi9), with the rule stated mechanically from the wiring rather than chosen per type.
  • (b) A graded-rate model of the columnar optic lobe, as in Lappalainen et al. 2024.
  • (c) First test the OFF pathway and T5 alone, which needs only the photoreceptor operating-point fix: raise --r-base so the bias rule sees the stimulus-mean photoreceptor rate and L2 lands near its target.

The recommendation at the time was (c) first, because it is a parameter run with existing flags, then (a) as the smallest code change that can wake the ON pathway. (c) ran next as the operating-point sweep: --r-base at 10, 50 and 100 Hz on the real imago and 50 and 100 Hz on the shuffled control.