This commit is contained in:
2026-06-09 12:00:20 +02:00
4 changed files with 69 additions and 859 deletions
@@ -1,400 +0,0 @@
---
include_toc: true
---
# Intro
Description of the pseudocode.
## Global state: what each compartment tracks
The three compartments maintain distinct but coupled state variables across three time horizons.
At the fast scale:
- the presynapse tracks residual calcium and its readily-releasable vesicle pool — both of which encode the very recent history of firing.
- the postsynapse tracks membrane voltage and the amplitude and speed of its calcium rise, which together encode the instruction for future change.
- the astrocyte tracks glutamate concentration both inside and outside the cleft, its own local and global calcium state, and its fuel output.
At the intermediate scale, the shared signal layer tracks whether the mGluR overflow sensors have fired, and whether the neuromodulatory context gate has been set — specifically whether PKA has primed the AMPA insertion machinery, silenced the forgetting phosphatase, and enabled gene expression in the nucleus.
At the slow scale, all three compartments track their own physical architecture:
- the postsynapse its receptor count and spine size
- the presynapse its docking slot count and vesicle channel clustering
- the astrocyte its wall distance from the synapse, its matrix density, and its baseline co-agonist supply.
## Fast scale: what happens spike by spike
Every action potential sets off a precise sequence across all three compartments simultaneously.
The presynapse converts the electrical event into a chemical wavefront: calcium floods in, drives probabilistic vesicle release from the readily-releasable pool, and leaves a residual trace that biases the next release upward if spikes keep arriving and downward if they stop. The amount of glutamate released fills the cleft and begins diffusing outward.
The astrocyte responds in two parallel arms the moment glutamate spills beyond the cleft boundary. The first arm activates astrocytic mGluR5 receptors via a Gq cascade, triggering an internal calcium rise that is directly proportional to how much glutamate has escaped — this calcium rise drives D-serine release, widening the postsynaptic NMDA detection window. The second arm simultaneously activates presynaptic mGluR2/3 receptors via Gi, suppressing adenylyl cyclase and reducing vesicle release probability — a direct autoinhibitory brake on the very source of the overflow. These two arms run in opposite directions from the same trigger: the astrocyte brakes the presynapse while amplifying the postsynaptic learning window at the same time. The functional logic of this arrangement is also worth noting. At the moment of spillover, the synapse is already releasing at high volume — the presynapse does not need to be told to release more, it needs to be prevented from exhausting itself. Simultaneously, the postsynapse is receiving a large wavefront and is exactly the right moment to maximize its coincidence detection sensitivity. The push-pull architecture serves both needs with a single signal, without requiring any separate coordination mechanism.
The postsynapse responds to the glutamate wavefront through its AMPA receptors, depolarizing the membrane. But full calcium entry through NMDA receptors only occurs if two conditions are met simultaneously: the membrane must be sufficiently depolarized to eject the magnesium block, and D-serine released by the astrocyte must be present as a co-agonist. This is the coincidence detection step — both conditions are required, and the astrocyte's D-serine supply is what makes it a three-party coincidence rather than a two-party one.
Once the spike is complete, the astrocyte vacuums up residual glutamate via its transporter proteins, and the harder it works at this clearance the faster it runs its glycolysis engine, converting blood glucose into lactate and pumping it into the extracellular space. Both the presynapse and postsynapse absorb this lactate to power their reset pumps — refilling the vesicle pool and restoring the resting membrane potential respectively. The energy supply is therefore coupled to activity: busier synapses generate more demand on the astrocyte, which in turn fuels faster recovery.
## Intermediate scale: temporary tuning between spikes
If firing is sustained rather than isolated, the system begins temporary adjustments that do not yet commit to structural change. In the presynapse, sustained high-frequency firing keeps residual calcium elevated, progressively increasing release probability and mobilizing vesicles from deep reserve storage into the readily-releasable pool — a priming of the launchpad without permanently expanding it. If frequency is low and sparse, the reverse happens: the pool depletes faster than it refills and release probability falls.
In the postsynapse, sustained high-frequency input keeps the membrane depolarized long enough to hold the magnesium block off continuously, allowing calcium to accumulate gradually rather than in isolated pulses. This accumulation is the early signal for plasticity, but it is not yet sufficient on its own to commit a structural change.
In the astrocyte, sustained activity keeps mGluR5 activated and D-serine release elevated above its baseline pulse level, maintaining a wider NMDA detection window for as long as the high-frequency drive continues.
The neuromodulatory broadcast then sets the critical context gate. If dopamine or norepinephrine levels cross their respective thresholds — signaling that the current activity pattern is behaviorally significant — PKA activity rises and phosphorylates three targets in sequence. It lowers the threshold for AMPA receptor insertion by priming the GluA1 subunit at Ser845. It silences the LTD phosphatase PP1 by phosphorylating DARPP-32, effectively blocking the forgetting machinery from running while the save signal is present. And it translocates to the nucleus to phosphorylate CREB, enabling the gene expression needed to build new structural proteins. Acetylcholine from the basal forebrain acts in parallel, lowering the global LTP threshold — making the entire system more sensitive to incoming patterns during periods of high attention.
## Slow scale: the commit decision and structural rewriting
Once the fast and intermediate dynamics have run, the system evaluates a three-layer filter to decide whether to permanently rewrite its architecture. The first layer asks whether a genuine event occurred — specifically whether postsynaptic calcium rose above the high threshold at sufficient speed to activate the LTP kinase pathway. The second layer asks whether that event was excessive enough to saturate the cleft and trigger mGluR5 on the astrocyte. The third layer asks whether the neuromodulatory context validated the event as worth saving — whether PKA has primed the insertion machinery and silenced the forgetting machinery.
Only when all three conditions align does structural rewriting proceed, and when it does, all three compartments are rewritten simultaneously and in the same direction.
In the potentiation branch, the postsynapse anchors new AMPA receptors into the membrane via CaMKII — a process made easier because PKA has already lowered the insertion threshold — and the spine itself physically enlarges. The presynapse expands its active zone, clusters more calcium channels directly beneath the docking area to tighten the coupling between electrical events and vesicle release, and increases its baseline release probability. The astrocyte retracts its process walls inward toward the synapse, secretes structural matrix proteins to seal and stabilize the channel, upregulates its baseline D-serine synthesis for chronic NMDA priming, and reduces its glutamate clearance rate — meaning future signals will linger longer in the cleft rather than being vacuumed away immediately.
In the depression branch, the phosphatase PP1 wins instead of CaMKII, and all three changes run in reverse simultaneously. The postsynapse internalizes receptors and the spine shrinks. The presynapse removes docking slots, scatters its calcium channels away from the active zone, and pulls vesicles back into deep reserve storage. The astrocyte secretes matrix metalloproteinases to dissolve the structural scaffold, cuts its D-serine supply to starve the NMDA gate chronically, and extends its process walls outward away from the synapse, loosening the diffusion barrier so that future glutamate bleeds away faster rather than concentrating at the cleft.
If the calcium event occurred but the neuromodulatory save signal did not arrive, only transient changes happen — early receptor insertion and brief facilitation — both of which reverse within minutes without trace. If no threshold was crossed at all, nothing changes and the current structural state is simply held.
## The critical asymmetry
The astrocyte's perisynaptic wall distance is the variable that makes both outcomes self-reinforcing rather than merely additive. When it moves inward during potentiation, it concentrates glutamate at the cleft, maintains D-serine near the postsynapse, and tightens the presynaptic feedback loop — making future high-frequency events even more likely to cross the threshold. When it moves outward during depression, it dilutes the signal, starves the NMDA gate, and loosens the presynaptic feedback — making future events even less likely to reach threshold. The astrocyte therefore does not simply mirror what the neurons decide: it actively deepens the valley the synapse has already rolled into, in whichever direction that happens to be.
# Pseudocode
[pseudocode](tripartite_synapse_full_pseudocode.html)
```Gen
## global state variables
// ── Fast (mss): wave propagation ─────────────────────────────
// Presynapse
pre_Ca_residual // leftover Ca²⁺ between spikes — short-term trace
vesicle_release_prob // P(0.11.0) per docking slot
RRP_pool // readily-releasable vesicle pool
reserve_pool // chained vesicles in deep storage
// Postsynapse
membrane_potential // Vm — depolarization state
NMDA_Mg_block // bool — mechanical clamp on/off
post_Ca_amplitude // peak [Ca²⁺] rise in spine
post_Ca_rise_speed // d(Ca)/dt — fast=LTP signal, slow=LTD signal
// Astrocyte
glutamate_cleft // [glu] in synaptic cleft
glutamate_spillover // extrasynaptic [glu] — saturates mGluRs
astro_Ca_local // IP3-triggered local rise near synapse
astro_Ca_global // soma-wide wave — network overload flag
D_serine_release // gliotransmitter — NMDA co-agonist pulse
lactate_output // fuel export rate to pre and post
// ── Intermediate (smin): temporary tuning ────────────────────
mGluR2_3_activation // presynaptic Gi — autoinhibitory brake
mGluR5_activation // astrocytic Gq — IP3→Ca²⁺→D-serine cascade
cAMP_level // set by dopamine/NE via Gs → adenylyl cyclase
PKA_activity // downstream of cAMP
GluA1_Ser845_primed // bool — AMPA insertion threshold lowered by PKA
DARPP32_phospho // bool — PP1 (LTD phosphatase) silenced by PKA
CREB_active // bool — structural gene expression enabled
// ── Slow (hweeks): structural architecture ───────────────────
AMPA_count // surface receptors — postsynaptic sensitivity
spine_volume // physical size of dendritic spine
active_zone_size // docking slot count
RRP_pool_capacity // max readily-releasable pool
VGCC_clustering // Ca²⁺ channels beneath active zone
perisynaptic_distance // how close astrocyte walls are to synapse
ECM_integrity // extracellular matrix density
D_serine_tonic_level // baseline co-agonist supply (sustained)
glutamate_clearance_rate // EAAT transporter density
## fast time scale — wave propagation (ms → s)
function fire_action_potential(input_freq):
// Presynapse: launch wavefront
pre_Ca_residual += spike_influx(input_freq)
pre_Ca_residual *= decay(τ ≈ 100ms) // fades unless spikes keep arriving
vesicle_release_prob *= facilitation(pre_Ca_residual)
released_vesicles = binomial(RRP_pool, vesicle_release_prob)
glutamate_cleft = released_vesicles × quantal_content
RRP_pool -= released_vesicles
// Astrocyte: overflow sensing and co-agonist release
glutamate_spillover = extrasynaptic_diffusion(glutamate_cleft)
if glutamate_spillover > spillover_threshold:
mGluR5_activation = True // Gq arm → IP3 → Ca²⁺ → D-serine
astro_Ca_local += IP3_cascade(PLC)
D_serine_release += proportional_to(astro_Ca_local)
mGluR2_3_activation = True // Gi arm → brake presynapse
cAMP_level -= Gi_inhibition(adenylyl_cyclase)
vesicle_release_prob -= VGCC_suppression() // autoinhibitory brake
// Astrocyte: check for network overload
astro_Ca_global = soma_wave(astro_Ca_local > OVERLOAD_threshold)
if astro_Ca_global: trigger(shockwave_lockdown)
// Postsynapse: wavefront strikes resonator
AMPA_current = glutamate_cleft × AMPA_count
membrane_potential += AMPA_current
// NMDA gate: coincidence check
if membrane_potential > -40mV and D_serine_release > threshold:
NMDA_Mg_block = False // Mg²⁺ ejected
post_Ca_amplitude += NMDA_influx(glutamate_cleft)
post_Ca_rise_speed = d(post_Ca_amplitude) / dt
// Astrocyte: vacuum trailing echoes + fuel pipeline
glutamate_cleft -= glutamate_clearance_rate × Δt
lactate_output += glycolysis_rate(glutamate_clearance_rate)
membrane_potential restored by NaK_ATPase(lactate_output)
RRP_pool refilled by VATPase(lactate_output)
## intermediate time scale — temporary tuning (s → min)
function short_term_plasticity(input_freq, duration):
// Presynapse: facilitate or depress based on Ca²⁺ history
if input_freq > 20Hz:
vesicle_release_prob *= 1.3 // residual Ca²⁺ primes launchpad
mobilize(reserve_pool → RRP_pool) // break storage chains
elif input_freq < 5Hz:
vesicle_release_prob *= 0.7 // RRP depleted faster than refill
// Postsynapse: NMDA gate primed if frequency sustained
if input_freq >= 50Hz and duration > 1s:
NMDA_Mg_block = False // sustained depolarization
post_Ca_amplitude accumulates // early-LTP signal rises
// Astrocyte: sustained volume → escalate co-agonist
if astro_Ca_local > local_threshold:
D_serine_release += gliotransmitter_pulse() // widens NMDA window
// Neuromodulators: set context gate via Gs protein
if dopamine_level > D1_threshold or NE_level > β_threshold:
cAMP_level += Gs_activation(adenylyl_cyclase)
PKA_activity = proportional_to(cAMP_level)
phosphorylate(GluA1, site=Ser845)
GluA1_Ser845_primed = True // lowers CaMKII threshold
phosphorylate(DARPP32)
DARPP32_phospho = True // silences PP1 — blocks LTD
translocate(PKA → nucleus) → phosphorylate(CREB)
CREB_active = True // enables structural gene expression
// Acetylcholine: lower LTP threshold globally
LTP_threshold *= (1 / (1 + ACh_level × mAChR_gain))
## slow time scale — structural commit (h → weeks)
function commit_to_structural_change():
// Hierarchical filter: three conditions must align
event_detected = post_Ca_amplitude > Ca_HIGH // layer 1: did something happen?
overflow_sensed = mGluR5_activation == True // layer 2: was it excessive?
context_validated = DARPP32_phospho and GluA1_Ser845_primed // layer 3: worth saving?
// ── Branch 1: LTP — potentiation ──────────────────────────────
if event_detected and overflow_sensed and context_validated:
// Postsynapse: anchor receptors, enlarge spine
activate(CaMKII)
AMPA_count += receptor_insertion(CaMKII, GluA1_Ser845_primed)
spine_volume *= 1.5
// Presynapse: expand launchpad, increase output reliability
active_zone_size *= 1.4 // more docking slots
RRP_pool_capacity += pool_expansion(active_zone_size)
VGCC_clustering += cluster_beneath_AZ() // tighter Ca²⁺ coupling
vesicle_release_prob += 0.1 // driven by VGCC clustering
// Astrocyte: seal and insulate the channel
perisynaptic_distance -= process_retraction() // walls move IN → tighter wrap
ECM_integrity += secrete(Glypicans, Thrombospondins)
D_serine_tonic_level += upregulate_synthesis() // sustained NMDA priming
glutamate_clearance_rate *= 0.85 // tighter wrap → slower diffusion away
return "potentiated"
// ── Branch 2: temporary only — Ca²⁺ rose, no save signal ─────
elif event_detected and not context_validated:
AMPA_count += transient_insertion() // early-LTP only — reverses in minutes
vesicle_release_prob += transient_facilitation()
// No astrocyte structural change
return "temporary facilitation only"
// ── Branch 3: LTD — active forgetting ─────────────────────────
elif event_detected and not overflow_sensed and not context_validated:
// Postsynapse: internalize receptors, shrink spine
activate(PP1)
AMPA_count -= receptor_internalization(PP1)
spine_volume *= 0.7
// Presynapse: dismantle launchpad
active_zone_size -= docking_slot_removal()
RRP_pool_capacity -= pool_contraction()
VGCC_clustering -= scatter_VGCCs() // decouple Ca²⁺ from AZ
vesicle_release_prob *= 0.6
// Astrocyte: dissolve matrix, pull away, cut support
ECM_integrity -= secrete(MMPs) // molecular scissors
D_serine_tonic_level = 0 // co-agonist supply cut
perisynaptic_distance += process_extension() // walls move OUT → loose wrap
glutamate_clearance_rate *= 1.2 // looser wrap → faster spillover
return "depressed"
// ── Branch 4: baseline ────────────────────────────────────────
else:
// All structural variables unchanged — system holds current state
return "baseline — no change"
## special case — shockwave lockdown (>100Hz uncoordinated)
function shockwave_lockdown():
astro_Ca_global = GLOBAL_WAVE // soma-level flood
release(GABA, ATP) // gel floods postsynapse
AMPA_count -= mass_internalization()
membrane_potential = HYPERPOLARIZED
cluster(VGCC → beneath_active_zone) // ensures signal survives chaos
## energy supply chain — metabolic gating (continuous)
function metabolic_loop(Δt):
// Astrocyte: glucose → lactate pipeline
glucose_uptake = blood_capillary_supply()
lactate_output = glycolysis(glucose_uptake, glutamate_clearance_rate)
lactate_output *= load_factor(glutamate_clearance_rate)
// Pre + post absorb lactate → power their pumps
RRP_pool refill rate ∝ VATPase(lactate_output)
membrane_potential reset ∝ NaK_ATPase(lactate_output)
## key asymmetry — perisynaptic distance is bidirectional
// LTP: astrocyte moves IN → tighter diffusion barrier
// → glutamate_clearance_rate ↓ (signal contained, not diluted)
// → D_serine_tonic_level ↑ (NMDA gate chronically primed)
// LTD: astrocyte moves OUT → looser diffusion barrier
// → glutamate_clearance_rate ↑ (signal bleeds away faster)
// → D_serine_tonic_level = 0 (NMDA gate chronically starved)
// Result: astrocyte amplifies both directions simultaneously
// potentiation becomes self-reinforcing; depression becomes self-reinforcing
```
# Neuromodulators
These are produced by small, anatomically concentrated nuclei that broadcast widely across the brain:
dopamine_level // "save button" — validates LTP
norepinephrine_level // arousal / signal-to-noise gain
acetylcholine_level // attention — lowers LTP threshold
## Dopamine
Dopamine is produced primarily by neurons in the Substantia Nigra pars compacta (projecting to the striatum, relevant for motor learning and habit formation) and the Ventral Tegmental Area (VTA) (projecting to the prefrontal cortex and limbic system via the mesolimbic and mesocortical pathways, relevant for reward, motivation, and the "save button" function in your model).
## Norepinephrine
Norepinephrine is produced almost exclusively by the Locus Coeruleus, a tiny nucleus in the brainstem pons. Despite its small size it projects diffusely across virtually the entire brain — cortex, hippocampus, cerebellum, spinal cord. It's essentially the brain's arousal and signal-to-noise broadcaster, firing tonically at low rates during calm wakefulness and phasically during novel or stressful events.
## Acetylcholine
Acetylcholine has two main sources: the basal forebrain nuclei (including the nucleus basalis of Meynert) projecting to the cortex and hippocampus — relevant for attention and learning gating — and the medial septum projecting specifically to the hippocampus, where it strongly modulates theta rhythms and memory encoding.
What's striking in the context of your model is that all three systems share the same architectural logic: a tiny, localized cell population broadcasts a global contextual signal that shifts the operational threshold of millions of synapses simultaneously — none of them carrying specific content, all of them modulating how content gets written.
# Timescales
Great question, and the answer is that the three scales are not strictly sequential in clock time — they overlap and nest inside each other, and their timing depends on the specific process involved.
**The intermediate scale (seconds to minutes)** happens largely *during* and *immediately after* a burst of activity, not between spike trains. Short-term facilitation and depression are running continuously within a spike train — each spike modifies the probability of the next one within the same train. The mGluR overflow sensing and D-serine escalation happen within seconds of sustained firing. The PKA/cAMP cascade triggered by dopamine or norepinephrine also runs within minutes of the neuromodulatory broadcast. So the intermediate scale is essentially the tail of the fast scale — it starts during the event and decays over the following minutes if no structural commitment is made.
**The slow scale is more complex and splits into at least two sub-phases:**
Early LTP consolidation — the initial receptor insertion and active zone expansion — begins within minutes to an hour of the triggering event, overlapping with the late intermediate scale. This phase requires protein synthesis from existing mRNAs already present at the synapse, so it can happen locally at the dendritic spine without waiting for the nucleus.
Late LTP consolidation — the full structural rewriting involving new gene expression via CREB, synthesis of new scaffold proteins, ECM secretion by the astrocyte, and permanent architectural changes — requires hours and depends on signals reaching the nucleus and new proteins being shipped back out. This is where sleep becomes genuinely important.
**Sleep plays a specific and active role** at the slow scale for two distinct reasons. First, during slow-wave sleep, the hippocampus replays compressed versions of the day's activity patterns — spike sequences that occurred during waking are reactivated at higher speed during sleep, which is thought to re-trigger the intermediate-scale cascades in a quieter, lower-noise environment where the signal-to-noise ratio is high and competing inputs are absent. This replay is believed to drive the late consolidation phase that could not complete during waking because the system was too busy processing new inputs.
Second, slow-wave sleep is also when the opposite process — synaptic downscaling — runs most aggressively. The synaptic homeostasis hypothesis proposes that waking potentiates synapses broadly and indiscriminately due to the high volume of incoming experience, and that sleep is when the LTD branch of the commit function runs systematically across the cortex, pruning weak or unvalidated potentiations back toward baseline. The astrocyte's MMP secretion and matrix dissolution likely peak during this period. This is the biological basis for the observation that sleep deprivation impairs both memory consolidation and the ability to form new memories the following day — the slow-scale commit function simply did not run.
**Active forgetting at the slow scale** has a slightly different timing. The LTD branch requires not an acute event but a chronic condition — persistent low-frequency or mistimed activity over hours to days. A synapse that simply stops being used does not immediately dissolve; it requires sustained disuse combined with the astrocyte detecting the absence of meaningful signal over an extended period before MMP secretion begins and the structural dismantling proceeds. This is why skills and memories are not lost overnight but degrade over weeks to months of disuse.
So to summarize the timing picture: the intermediate scale runs during and immediately after activity. Early structural changes begin within the hour following a validated event. The full slow-scale commit — both potentiation and pruning — runs primarily during sleep, using replay to complete the potentiation side and homeostatic downscaling to clean up the depression side. The organism's rest period is therefore not passive recovery but the primary execution window for the slow-scale branch of the commit function.Great question, and the answer is that the three scales are not strictly sequential in clock time — they overlap and nest inside each other, and their timing depends on the specific process involved.
**The intermediate scale (seconds to minutes)** happens largely *during* and *immediately after* a burst of activity, not between spike trains. Short-term facilitation and depression are running continuously within a spike train — each spike modifies the probability of the next one within the same train. The mGluR overflow sensing and D-serine escalation happen within seconds of sustained firing. The PKA/cAMP cascade triggered by dopamine or norepinephrine also runs within minutes of the neuromodulatory broadcast. So the intermediate scale is essentially the tail of the fast scale — it starts during the event and decays over the following minutes if no structural commitment is made.
**The slow scale is more complex and splits into at least two sub-phases:**
Early LTP consolidation — the initial receptor insertion and active zone expansion — begins within minutes to an hour of the triggering event, overlapping with the late intermediate scale. This phase requires protein synthesis from existing mRNAs already present at the synapse, so it can happen locally at the dendritic spine without waiting for the nucleus.
Late LTP consolidation — the full structural rewriting involving new gene expression via CREB, synthesis of new scaffold proteins, ECM secretion by the astrocyte, and permanent architectural changes — requires hours and depends on signals reaching the nucleus and new proteins being shipped back out. This is where sleep becomes genuinely important.
**Sleep plays a specific and active role** at the slow scale for two distinct reasons. First, during slow-wave sleep, the hippocampus replays compressed versions of the day's activity patterns — spike sequences that occurred during waking are reactivated at higher speed during sleep, which is thought to re-trigger the intermediate-scale cascades in a quieter, lower-noise environment where the signal-to-noise ratio is high and competing inputs are absent. This replay is believed to drive the late consolidation phase that could not complete during waking because the system was too busy processing new inputs.
Second, slow-wave sleep is also when the opposite process — synaptic downscaling — runs most aggressively. The synaptic homeostasis hypothesis proposes that waking potentiates synapses broadly and indiscriminately due to the high volume of incoming experience, and that sleep is when the LTD branch of the commit function runs systematically across the cortex, pruning weak or unvalidated potentiations back toward baseline. The astrocyte's MMP secretion and matrix dissolution likely peak during this period. This is the biological basis for the observation that sleep deprivation impairs both memory consolidation and the ability to form new memories the following day — the slow-scale commit function simply did not run.
**Active forgetting at the slow scale** has a slightly different timing. The LTD branch requires not an acute event but a chronic condition — persistent low-frequency or mistimed activity over hours to days. A synapse that simply stops being used does not immediately dissolve; it requires sustained disuse combined with the astrocyte detecting the absence of meaningful signal over an extended period before MMP secretion begins and the structural dismantling proceeds. This is why skills and memories are not lost overnight but degrade over weeks to months of disuse.
So to summarize the timing picture: the intermediate scale runs during and immediately after activity. Early structural changes begin within the hour following a validated event. The full slow-scale commit — both potentiation and pruning — runs primarily during sleep, using replay to complete the potentiation side and homeostatic downscaling to clean up the depression side. The organism's rest period is therefore not passive recovery but the primary execution window for the slow-scale branch of the commit function.
# Simple organisms
Excellent point. The hippocampal replay model is a vertebrate solution to a specific problem — how to consolidate many parallel experiences quickly without catastrophic interference. But the underlying molecular logic of the commit function is far more ancient and appears in organisms that have no hippocampus, no sleep architecture in the vertebrate sense, and sometimes no centralized nervous system at all.
**In invertebrates with simple ganglia***Aplysia*, *C. elegans*, *Drosophila* — the slow-scale consolidation still requires protein synthesis and still uses CREB as the nuclear transcription factor. The same PKA→CREB axis that validates LTP in the mammalian hippocampus was actually first characterized in *Aplysia* gill-withdrawal reflex studies by Kandel. What differs is the trigger and the timing. Without a hippocampus to compress and replay experiences during a rest phase, consolidation in these organisms appears to depend simply on **repetition and spacing of the stimulus itself**. A single strong shock to the siphon produces short-term sensitization lasting minutes — the intermediate scale running without commitment. Four or five spaced shocks over hours produce long-term sensitization lasting days — the slow-scale commit running because repeated PKA activation eventually crosses the threshold needed to drive CREB-dependent gene expression. The spacing matters because cAMP degrades between stimuli, and spaced repetition keeps re-elevating it above the threshold for nuclear translocation, whereas massed repetition saturates and desensitizes the cascade.
**In *C. elegans***, which has exactly 302 neurons and no sleep in any recognizable sense, consolidation-like phenomena still occur through the same molecular logic. What substitutes for the validation signal is less clear, but there is evidence that **neuromodulatory interneurons releasing serotonin and dopamine** gate whether a repeated experience gets written into long-term behavioral change — functionally identical to the save button role, just implemented in a three-neuron circuit rather than a diffuse broadcast system.
**In organisms without a nervous system at all***Physarum polycephalum*, the slime mould — something that looks functionally like consolidation occurs through purely biochemical means. Repeated exposure to a stimulus that causes contraction leaves a persistent change in the cytoskeletal and biochemical state of the organism that biases future responses. There is no synapse, no calcium influx through NMDA receptors, no PKA — but the logic of the three-layer filter is still present in a stripped-down form: the organism detects that something happened, detects that it was significant enough to exceed a threshold, and commits a physical change to its internal architecture that persists. The molecular substrate is different but the computational structure is the same.
**What this suggests about consolidation in general** is that the slow-scale commit function does not require sleep or replay — those are vertebrate optimizations on top of a more primitive mechanism. The core requirements appear to be just three things that evolution has solved repeatedly with different molecular tools:
The first is a **threshold mechanism** that prevents every transient event from being written permanently — in neurons this is the calcium amplitude and rise-speed filter, in slime moulds it is a chemical concentration threshold, but the logic is the same.
The second is a **context validation signal** that asks whether the event was behaviorally meaningful — in vertebrates this is the neuromodulatory broadcast from VTA and locus coeruleus, in *Aplysia* it is facilitatory interneurons releasing serotonin, in slime moulds it may simply be the magnitude of the perturbation itself serving as its own validation.
The third is a **protein synthesis requirement** that enforces a time cost on permanent storage — in all organisms where long-term behavioral change has been studied, blocking protein synthesis blocks consolidation, suggesting that the metabolic cost of building new structural proteins is a universal gate that prevents trivial events from consuming permanent resources.
Sleep and hippocampal replay are therefore best understood not as the mechanism of consolidation but as a **vertebrate solution to the scaling problem** — how to consolidate thousands of experiences per day across billions of synapses without running the protein synthesis machinery continuously at full cost during waking. Simpler organisms consolidate fewer experiences, face less interference, and can afford to let repetition and spacing do the work that sleep does in more complex nervous systems.
# Calcium in pre, post, astro
**In the postsynapse**, the calcium amplitude and rise-speed filter works because CaMKII and the phosphatases PP1/PP2B have different sensitivities to calcium-bound calmodulin, and calmodulin itself has different binding kinetics depending on how fast calcium rises.
Calmodulin has four calcium binding sites and its activation is highly cooperative — it does not activate linearly with calcium concentration but switches sharply above a threshold. When calcium rises fast and high, as during a strong high-frequency burst, calmodulin saturates quickly and activates CaMKII. CaMKII then autophosphorylates at Thr286, which is the critical step — once autophosphorylated it remains active even after calcium falls back to baseline, effectively converting a transient calcium event into a sustained kinase signal that outlasts the trigger. This persistence is what gives CaMKII its memory-like property and is what drives AMPA receptor insertion.
When calcium rises slowly and to a lower amplitude, as during weak low-frequency input, calmodulin activates preferentially the phosphatases PP2B (calcineurin) and downstream PP1 instead, because these enzymes have higher affinity for calcium-calmodulin complexes at lower occupancy. PP1 then dephosphorylates AMPA receptors, triggering their internalization and driving LTD.
So the filter is not a simple threshold — it is a **kinetic competition** between two enzyme systems with different calcium-calmodulin affinities. Fast large rise activates the low-affinity high-gain system (CaMKII). Slow small rise activates the high-affinity low-gain system (PP2B/PP1). The same calcium messenger routes to opposite outcomes depending purely on its dynamics.
**In the presynapse**, the calcium filter is structurally simpler but operates on a different principle — **proximity and timing** rather than kinetic competition. Calcium enters through VGCCs clustered directly beneath the active zone, and the vesicles docked at that zone sit within nanometers of the channel mouth. The local calcium concentration at the release site reaches extremely high values — estimated at hundreds of micromolar — for a very brief window of microseconds before diffusing away. Synaptotagmin, the calcium sensor on the vesicle membrane, has a low affinity but fast on-rate, meaning it only fires in response to this extremely high local transient, not to the diffuse residual calcium that lingers afterward.
The residual calcium that accumulates with repeated spikes — the pre_Ca_residual in the pseudocode — acts on a completely different target: Munc13 and RIM proteins at the active zone, which have higher affinity for calcium but slower kinetics. These proteins respond to the sustained low-level residual and increase the size of the readily-releasable pool and the probability of release — this is facilitation. So the presynaptic filter distinguishes between the sharp local transient (triggers release via synaptotagmin) and the slow diffuse residual (modulates future release probability via Munc13/RIM). Two calcium signals, two sensors, two time scales, within the same compartment.
**In the astrocyte**, the calcium filter is the least understood of the three but operates through IP3 receptor gating. IP3 receptors on the endoplasmic reticulum have a bell-shaped calcium dependence — they open in response to rising calcium but are inhibited at very high calcium concentrations. This means the astrocyte's internal calcium release is self-limiting: a moderate IP3 signal produces a local calcium rise that drives D-serine release, but an excessive signal triggers the global soma wave that activates the circuit-breaker response instead.
The key filter here is therefore the **spatial containment of the IP3 signal**. Under normal high-frequency activity, IP3 production is local to the perisynaptic process and the calcium rise stays local — driving D-serine release proportionally. Only when multiple neighboring synapses fire simultaneously does IP3 accumulate enough to propagate as a regenerative wave across the entire astrocyte via gap junctions to adjacent astrocytes, triggering the global alarm. The astrocyte is therefore filtering not just amplitude but **spatial coherence** — a single strong synapse produces a local response, but coordinated overactivity across a territory produces a qualitatively different global response.
The common thread across all three compartments is that none of them use a simple concentration threshold. Each uses a molecular mechanism that is sensitive to the **dynamics** of the calcium signal — its speed, its spatial spread, its duration, or its subcellular location — rather than just its peak value. This is what allows the same ion to encode fundamentally different instructions depending on the context in which it arrives.
# Resource budget
Exactly right. This is a resource allocation problem, and it is one of the most important constraints the system operates under. Each compartment has a finite physical budget, and potentiation at one synapse necessarily draws from a shared pool that serves many others.
**In the presynapse**, the axon has many en passant boutons — synaptic release sites distributed along its length, sometimes hundreds of them. The total vesicle pool, the mitochondrial capacity to run the VATPase pumps that refill vesicles, and the cytoskeletal machinery that mobilizes reserve pools are all shared across the entire axonal arbor. When one bouton undergoes LTP and expands its active zone and increases its RRP capacity, it is drawing on the same pool of synaptic proteins — RIM, Munc13, VGCC subunits — that all other boutons on that axon compete for. There is evidence for a **synaptic tagging and capture** mechanism here: a potentiated bouton plants a molecular tag that allows it to capture plasticity-related proteins drifting along the axon, effectively pulling resources away from untagged boutons. This means strong potentiation at one site can passively deplete neighboring sites — a form of competitive resource allocation baked into the axonal architecture.
**In the postsynapse**, the dendrite hosts thousands of spines, and the situation is even more constrained. The soma produces plasticity-related proteins — new AMPA receptor subunits, CaMKII, scaffolding proteins like PSD-95 — at a rate determined by CREB-driven gene expression, and these proteins must be shipped out along the dendritic arbor to wherever they are needed. The same synaptic tagging logic applies on the postsynaptic side: a spine that has been tagged by early LTP can capture these drifting proteins when they pass, but the total production rate is finite. There is also a **spine morphology budget** — actin polymerization drives spine head enlargement, but the actin machinery and the small GTPases (Rac1, RhoA) that regulate it are shared across the dendritic segment. Potentiating many spines simultaneously on the same dendritic branch would require more actin remodeling machinery than is locally available, meaning strong potentiation at a cluster of nearby spines may physically constrain how much each individual spine can grow.
Additionally, the postsynapse has a **receptor recycling pool** — a finite intracellular reserve of AMPA receptors held in endosomes near the spine that can be rapidly inserted during early LTP. This pool is local to a dendritic segment and is not immediately replenished. If multiple nearby spines are potentiated in rapid succession, they compete for the same local receptor reserve before new receptors synthesized in the soma can arrive.
**In the astrocyte**, the budget constraint is the most spatially explicit of the three because a single astrocyte wraps somewhere between 100,000 and 2,000,000 synapses in humans — an enormous territory. Its finite resources include the total EAAT transporter protein available for glutamate clearance, the D-serine synthesis capacity which depends on serine racemase enzyme levels, the ECM protein production capacity for Glypicans and Thrombospondins, and critically the ATP budget for running all of these simultaneously. When many synapses in its territory are active simultaneously, the astrocyte faces a genuine allocation problem: it cannot maximally support all of them at once. There is evidence that the perisynaptic process — the fine astrocytic extension that wraps individual synapses — is itself a dynamic structure that the astrocyte extends and retracts selectively, suggesting it physically prioritizes which synapses receive close wrapping and therefore which ones benefit from tighter D-serine delivery and glutamate containment.
**The deeper implication** is that potentiation is not just a local bilateral negotiation between one presynapse and one postsynapse. It is a **network-level resource competition** in which:
A strongly potentiated synapse draws proteins and structural resources away from its neighbors on the same axon and dendrite. The astrocyte must allocate its clearance, co-agonist, and structural support capacity across its entire territory. The metabolic pipeline — glucose from blood vessels, lactate to neurons — has a ceiling determined by capillary supply, meaning a highly active region of the astrocyte territory can become fuel-limited if demand outpaces vascular supply.
This is probably why **heterosynaptic LTD** exists — the observation that strong LTP at one synapse is often accompanied by spontaneous depression at neighboring synapses on the same dendrite even without those synapses being directly stimulated. It may be less a deliberate regulatory mechanism and more a direct consequence of resource depletion: the potentiated synapse captured the available receptors, actin machinery, and astrocytic support, leaving neighboring synapses passively impoverished.
The pseudocode should therefore include a budget layer that sits above the individual synapse functions — something like a shared resource pool per axonal arbor, per dendritic segment, and per astrocyte territory, from which each commit function draws and against which each structural expansion is checked. Potentiation that would exceed the available budget either fails to consolidate fully, triggers compensatory depression at neighboring synapses, or waits for new protein synthesis to replenish the pool before completing.
@@ -1,422 +0,0 @@
---
include_toc: true
---
# Trypartite synapse
Here is the descriptive synthesis, structured around the three closures: context, energy budget, and traces.
---
## The Fundamental Pattern
Every behavior in this system — whether a single vesicle release or a permanent architectural rewrite — obeys the same three-part closure: it occurs only within a **context** that permits it, consumes from an **energy budget** that constrains it, and deposits **traces** that bias what happens next. Nothing is free, nothing is contextless, and nothing is without consequence for the future.
---
## The Fast Scale: Every Spike is Contextual, Budgeted, and Traced
When an action potential arrives, the presynapse does not simply release glutamate. It first checks whether its local ATP budget — the mitochondrial capacity of that specific bouton — can afford the release cost. If the budget is exhausted, the bouton goes silent regardless of the electrical input. Context here is the current state of the readily-releasable pool and the residual calcium left over from recent firing. A bouton that has been firing frequently carries elevated residual calcium, which biases the release probability upward — this is not a new decision but the consequence of past behavior already written into the calcium trace. The release itself then deposits a new trace: the residual calcium rises slightly higher, the pool shrinks by exactly the number of vesicles released, and the mitochondrial budget decrements. Each of these three changes will influence the next spike.
The astrocyte responds to the glutamate that escapes the cleft, but only if the spillover crosses its low-affinity threshold — meaning the astrocyte's response is itself gated by context: it does not react to normal sparse firing, only to genuine overflow. When it does respond, it draws from its own D-serine synthesis budget, which is rate-limited by how much serine racemase enzyme is currently available across its entire territory. The D-serine it releases is a trace deposited into the extracellular space: it temporarily widens the NMDA detection window for the postsynapse, making it easier for the next wavefront to unlock calcium entry. Simultaneously the astrocyte's local calcium rises — a trace of the overflow event that will itself gate whether D-serine escalates further or whether a global alarm fires.
The postsynapse responds to glutamate proportionally to how many AMPA receptors are currently on its surface — a slow-scale structural trace left by past potentiation or depression events. Whether NMDA receptors open depends on two simultaneous conditions: the membrane must be sufficiently depolarized, and D-serine must be present. Both are traces of context — the voltage reflects recent AMPA current history, the D-serine reflects recent astrocyte activation history. When NMDA opens, it deposits the most important fast-scale trace: a calcium rise whose amplitude and speed are recorded by the competing enzyme systems CaMKII and PP1/PP2B, priming the system to evaluate whether structural change is warranted.
At the end of each cycle, the astrocyte clears residual glutamate and converts glucose into lactate, refueling both pre and post. But the lactate output is capped by the vascular glucose supply — a hard ceiling that cannot be exceeded regardless of demand. A heavily active synapse therefore progressively depletes the local energy budget, and if the ceiling is hit, refill rates slow and the presynapse begins to depress — not because of any signaling decision, but because the energy trace of recent activity has accumulated to the point of exhaustion.
---
## The Intermediate Scale: Context Gates Determine Whether Traces Persist
At sustained high frequencies, the intermediate scale kicks in as an amplification and gating layer on top of the fast scale. The presynapse mobilizes its reserve vesicle pool into the readily-releasable pool — but only if the reserve is non-empty, meaning this mobilization is budgeted by whatever deep storage was accumulated during prior rest periods. The mobilization leaves a trace: the readily-releasable pool is now larger, and subsequent spikes will release more, which in turn accelerates budget depletion.
The postsynapse plants a synaptic tag when sustained depolarization occurs. This tag is not a signal — it is a molecular marker that puts this spine into a competitive queue for plasticity proteins drifting along the dendritic segment from the soma. The tag is a trace of the intermediate-scale event that persists until either the proteins are captured and the tag is consumed, or the save signal never arrives and the tag expires, leaving no structural consequence.
The neuromodulatory broadcast — dopamine or norepinephrine — is the most important contextual signal at this scale. It does not carry information about what happened at the synapse. It carries information about whether the broader organism considers the current moment behaviorally significant. When it arrives above threshold, it activates PKA, which phosphorylates three targets in sequence. Each phosphorylation is itself a trace: GluA1-Ser845 priming lowers the threshold for AMPA insertion in the future; DARPP-32 phosphorylation silences the LTD phosphatase, temporarily erasing the competing forgetting signal; CREB activation enables gene expression that will produce structural proteins hours later. None of these traces do anything by themselves — they are permissions and blockades that will only matter if the slow-scale commit function runs before they decay.
Acetylcholine from the basal forebrain provides a parallel context signal that shifts the global LTP threshold downward — not for any one synapse but for the entire dendritic segment and axonal arbor simultaneously. It is a broadcast that says the organism is in an attentive state where incoming patterns are worth encoding, making the whole system more likely to cross the thresholds that trigger structural change.
---
## The Slow Scale: Structural Commits are Budgeted Negotiations Across Three Compartments
When the slow-scale commit function runs, it first evaluates whether three independently generated traces are simultaneously present: the calcium event trace in the postsynapse, the overflow trace registered by the astrocyte's mGluR5 receptors, and the neuromodulatory context trace stored in the PKA phosphorylation state. All three must be true. The calcium event alone is insufficient — without overflow confirmation, the system cannot be sure the activity was genuinely strong. The overflow alone is insufficient — without the neuromodulatory save signal, the activity may have been strong but not worth permanently encoding. Only the conjunction of all three triggers the structural rewrite.
When it does trigger, the structural rewrite is not a binary event but a **budgeted negotiation** across three territories simultaneously. The presynapse requests axonal proteins from the shared pool — but this pool is competed for by every tagged bouton on the same axon, and priority is given to tagged boutons in proportion to when they were tagged. What is granted determines how much the active zone actually expands, how many new vesicle docking slots are installed, and how much the release probability increases — all of which become structural traces that will bias every future spike from that bouton. The postsynapse requests AMPA receptors from the local dendritic endosomal reserve and actin machinery from the segment-level pool — both finite, both competed for by neighboring tagged spines. What is granted determines how many receptors are anchored and how large the spine head grows — structural traces that will amplify or dampen every future wavefront. The astrocyte requests from its own territory-level pools of D-serine synthesis capacity, ECM proteins, and perisynaptic process extensions — all capped ultimately by the astrocyte's ATP budget, which is itself capped by the vascular glucose ceiling.
If any of the three requests is only partially granted because the budget is insufficient, the deficit is queued and the structural change is partial. The remainder waits for the replenishment cycle — which peaks during sleep, when somatic protein synthesis runs at maximum rate driven by CREB, pools refill across all three territories, and queued deficits are resolved. This is why a memory that feels consolidated after waking may not be fully structurally committed until after sleep: the budgets were not available in the moment, and the physical rewrite was deferred.
Critically, every resource consumed in LTP potentiation comes at the direct expense of neighboring synapses on the same axon and dendrite. When the pool is exhausted, untagged neighbors passively lose resources — their AMPA counts and release probabilities fall not because any signal told them to depress, but because the shared budget was captured by the tagged synapse. This heterosynaptic depression is not a separate mechanism but the automatic consequence of resource accounting: the budget is closed, and what one synapse gains, its neighbors lose.
In the depression branch the same logic runs in reverse, but with a crucial difference: dismantled resources are returned to the shared pools rather than consumed. Internalized AMPA receptors go back to the dendritic reserve. Removed active zone proteins go back to the axonal pool. Freed astrocyte process extensions become available for reallocation to other synapses. Depression is therefore not just a weakening of one synapse — it is a redistribution of resources that makes neighboring potentiation more affordable. The system is globally conservative: it does not generate new resources through activity, it only reallocates existing ones.
---
## The Astrocyte as the Budget Authority
Throughout all three scales, the astrocyte occupies a unique role: it is simultaneously a participant in the signaling (depositing D-serine traces, sensing overflow), the manager of the environmental context (controlling diffusion geometry through perisynaptic distance), and the gatekeeper of the energy supply (converting glucose to lactate and distributing it to pre and post). Its perisynaptic distance variable is the one structural trace that amplifies rather than merely reflects the direction of change — when it moves inward during LTP, it makes every future event at that synapse more likely to cross every threshold in the system; when it moves outward during LTD, it makes every future event less likely. The astrocyte does not decide the direction of change, but once the direction is determined, it deepens it — spending its own process extension budget to do so, and being therefore constrained by the same resource logic as everything else.
The entire system is therefore best understood not as a collection of signaling pathways but as a **closed resource economy** operating across three nested spatial scales — the synapse, the dendritic or axonal segment, and the astrocyte territory — in which every behavior is a withdrawal from a budget accumulated by prior rest, every trace is a deposit that shifts the probability of future withdrawals, and the direction of structural change is determined by whether the contextual traces of event, overflow, and neuromodulatory validation happen to coincide before any of them decays.
# Tripartite Synapse — Full Budget-Aware Pseudocode
Color key: PRE = presynapse · POST = postsynapse · ASTRO = astrocyte · SIG = signal/neuromodulator · BUD = budget/resource pool
---
## Shared Resource Pools — one per territory
```
// ── Axonal arbor: shared across all boutons on one axon ───────────────
BUD axon_vesicle_protein_pool // RIM, Munc13, VGCC subunits for AZ expansion
BUD axon_mitochondria_capacity // ATP ceiling for vesicle release and refill
BUD axon_tagged_boutons // set of boutons competing for drifting proteins
// ── Dendritic segment: shared across all spines on one branch ─────────
BUD dendrite_receptor_reserve // local endosomal AMPA pool — not instantly replenished
BUD dendrite_actin_machinery // Rac1/RhoA + actin monomers for spine enlargement
BUD dendrite_protein_flux // plasticity proteins arriving from soma via CREB
BUD dendrite_tagged_spines // set of spines competing for protein flux
// ── Astrocyte territory: shared across all wrapped synapses ───────────
BUD astro_serine_racemase_cap // enzyme ceiling for D-serine synthesis rate
BUD astro_EAAT_pool // transporter protein for glutamate clearance
BUD astro_ECM_protein_pool // Glypicans, Thrombospondins for sealing
BUD astro_process_extensions // finite perisynaptic processes — selectively allocated
BUD astro_ATP_budget // total ATP — drives clearance, synthesis, motility
BUD astro_lactate_ceiling // hard cap set by capillary glucose supply
// ── Soma: shared across the entire neuron ─────────────────────────────
BUD soma_protein_synthesis_rate // CREB-driven — peaks during sleep
BUD soma_receptor_synthesis_rate // new AMPA subunits per hour
```
---
## Global State Variables
```
// ── Fast (mss): wave propagation ─────────────────────────────────────
// Presynapse
PRE pre_Ca_residual // leftover Ca²⁺ between spikes — short-term trace
PRE vesicle_release_prob // P(0.11.0) per docking slot
PRE RRP_pool // readily-releasable vesicle pool
PRE reserve_pool // chained vesicles in deep storage
// Postsynapse
POST membrane_potential // Vm — depolarization state
POST NMDA_Mg_block // bool — mechanical clamp on/off
POST post_Ca_amplitude // peak [Ca²⁺] rise in spine
POST post_Ca_rise_speed // d(Ca)/dt — fast=LTP signal, slow=LTD signal
// Astrocyte
ASTRO glutamate_cleft // [glu] in synaptic cleft
ASTRO glutamate_spillover // extrasynaptic [glu] — saturates mGluRs
ASTRO astro_Ca_local // IP3-triggered local rise near synapse
ASTRO astro_Ca_global // soma-wide wave — network overload flag
ASTRO D_serine_release // gliotransmitter — NMDA co-agonist pulse
ASTRO lactate_out // fuel export rate to pre and post
// ── Intermediate (smin): temporary tuning ────────────────────────────
SIG mGluR2_3_activation // presynaptic Gi — autoinhibitory brake
SIG mGluR5_activation // astrocytic Gq — IP3→Ca²⁺→D-serine cascade
SIG cAMP_level // set by dopamine/NE via Gs → adenylyl cyclase
SIG PKA_activity // downstream of cAMP
SIG GluA1_Ser845_primed // bool — AMPA insertion threshold lowered by PKA
SIG DARPP32_phospho // bool — PP1 (LTD phosphatase) silenced by PKA
SIG CREB_active // bool — structural gene expression enabled
// ── Slow (hweeks): structural architecture ───────────────────────────
POST AMPA_count // surface receptors — postsynaptic sensitivity
POST spine_volume // physical size of dendritic spine
PRE active_zone_size // docking slot count
PRE RRP_pool_capacity // max readily-releasable pool
PRE VGCC_clustering // Ca²⁺ channels beneath active zone
ASTRO perisynaptic_distance // how close astrocyte walls are to synapse
ASTRO ECM_integrity // extracellular matrix density
ASTRO D_serine_tonic_level // baseline co-agonist supply (sustained)
ASTRO glutamate_clearance_rate // EAAT transporter density
```
---
## Budget Allocation Functions
```
function request_axon_resources(bouton_id, req_AZ):
available = axon_vesicle_protein_pool × tag_priority(bouton_id, axon_tagged_boutons)
granted = min(req_AZ, available)
axon_vesicle_protein_pool -= granted
if granted < req_AZ:
trigger(heterosynaptic_depression, neighbors(bouton_id)) // passive depletion
return granted
function request_dendrite_resources(spine_id, req_AMPA, req_actin):
priority = tag_priority(spine_id, dendrite_tagged_spines)
g_AMPA = min(req_AMPA, dendrite_receptor_reserve × priority)
g_actin = min(req_actin, dendrite_actin_machinery × priority)
dendrite_receptor_reserve -= g_AMPA
dendrite_actin_machinery -= g_actin
if g_AMPA < req_AMPA:
queue(spine_id, deficit, dendrite_protein_flux) // wait for soma delivery
trigger(heterosynaptic_depression, neighbors(spine_id))
return (g_AMPA, g_actin)
function request_astro_resources(syn_id, req_Ds, req_ECM, req_proc):
g_Ds = min(req_Ds, astro_serine_racemase_cap)
g_ECM = min(req_ECM, astro_ECM_protein_pool)
g_proc = min(req_proc, astro_process_extensions)
ATP_cost = compute_ATP(g_Ds, g_ECM, g_proc)
if ATP_cost > astro_ATP_budget:
scale_down(g_Ds, g_ECM, g_proc) // proportional rationing
astro_serine_racemase_cap -= g_Ds
astro_ECM_protein_pool -= g_ECM
astro_process_extensions -= g_proc
astro_ATP_budget -= ATP_cost
return (g_Ds, g_ECM, g_proc)
function replenish_budgets(Δt):
// Pools recover over time — rates set by metabolic and synthetic capacity
axon_vesicle_protein_pool += protein_transport_rate(axon) × Δt
dendrite_receptor_reserve += soma_receptor_synthesis_rate × delivery_fraction() × Δt
dendrite_actin_machinery += actin_recovery_rate() × Δt
dendrite_protein_flux = soma_protein_synthesis_rate // set by CREB, peaks during sleep
astro_serine_racemase_cap += enzyme_synthesis_rate() × Δt
astro_ECM_protein_pool += ECM_synthesis_rate() × Δt
astro_process_extensions += process_recovery_rate() × Δt // slow — hours timescale
astro_ATP_budget += glycolysis(astro_lactate_ceiling) × Δt
astro_lactate_ceiling = capillary_glucose_supply() // vascular hard ceiling
soma_protein_synthesis_rate = CREB_driven_expression() // elevated during sleep replay
```
---
## Fast Time Scale — Wave Propagation (ms → s)
```
function fire_action_potential(input_freq):
// Presynapse: release gated by ATP budget
if axon_mitochondria_capacity > release_ATP_cost:
pre_Ca_residual += spike_influx(input_freq)
pre_Ca_residual *= decay(τ ≈ 100ms)
vesicle_release_prob *= facilitation(pre_Ca_residual)
released = binomial(RRP_pool, vesicle_release_prob)
glutamate_cleft = released × quantal_content
RRP_pool -= released
axon_mitochondria_capacity -= release_ATP_cost
else:
suppress(release) // ATP-depleted bouton goes silent
// Astrocyte: overflow sensing — D-serine draw budget-checked
glutamate_spillover = extrasynaptic_diffusion(glutamate_cleft)
if glutamate_spillover > spillover_threshold:
mGluR5_activation = True
astro_Ca_local += IP3_cascade(PLC)
(g_Ds, _, _) = request_astro_resources(syn_id, proportional_to(astro_Ca_local), 0, 0)
D_serine_release += g_Ds // may be less than ideal if budget low
mGluR2_3_activation = True // Gi arm: brake presynapse regardless
cAMP_level -= Gi_inhibition(adenylyl_cyclase)
vesicle_release_prob -= VGCC_suppression()
// Astrocyte: global overload check
astro_Ca_global = soma_wave(astro_Ca_local > OVERLOAD_threshold)
if astro_Ca_global: trigger(shockwave_lockdown)
// Postsynapse: AMPA current + NMDA coincidence gate
membrane_potential += glutamate_cleft × AMPA_count
if membrane_potential > -40mV and D_serine_release > threshold:
NMDA_Mg_block = False
post_Ca_amplitude += NMDA_influx(glutamate_cleft)
post_Ca_rise_speed = d(post_Ca_amplitude) / dt
// Astrocyte: clearance + fuel — capped at vascular ceiling
glutamate_cleft -= glutamate_clearance_rate × Δt
lactate_out = min(glycolysis_rate(glutamate_clearance_rate), astro_lactate_ceiling)
membrane_potential restored by NaK_ATPase(lactate_out)
RRP_pool refilled by VATPase(lactate_out)
astro_ATP_budget -= clearance_ATP_cost(glutamate_clearance_rate)
```
---
## Intermediate Time Scale — Temporary Tuning (s → min)
```
function short_term_plasticity(input_freq, duration):
// Presynapse: facilitate or depress — pool-limited
if input_freq > 20Hz:
vesicle_release_prob *= 1.3
mobilize(reserve_pool → RRP_pool) // only if reserve_pool > 0
elif input_freq < 5Hz:
vesicle_release_prob *= 0.7 // pool depletes faster than refill
// Postsynapse: NMDA priming + plant synaptic tag
if input_freq >= 50Hz and duration > 1s:
NMDA_Mg_block = False
post_Ca_amplitude accumulates
dendrite_tagged_spines.add(spine_id) // enters competition for drifting proteins
// Astrocyte: escalate D-serine — budget-checked
if astro_Ca_local > local_threshold:
(g_Ds, _, _) = request_astro_resources(syn_id, gliotransmitter_pulse(), 0, 0)
D_serine_release += g_Ds
// Neuromodulators: set context gate + plant axonal tag
if dopamine_level > D1_threshold or NE_level > β_threshold:
cAMP_level += Gs_activation(adenylyl_cyclase)
PKA_activity = proportional_to(cAMP_level)
phosphorylate(GluA1, Ser845) → GluA1_Ser845_primed = True
phosphorylate(DARPP32) → DARPP32_phospho = True
translocate(PKA → nucleus) → CREB_active = True
axon_tagged_boutons.add(bouton_id) // captures drifting axonal proteins
LTP_threshold *= (1 / (1 + ACh_level × mAChR_gain))
```
---
## Slow Time Scale — Structural Commit (h → weeks)
```
function commit_to_structural_change(bouton_id, spine_id, syn_id):
// Three-layer hierarchical filter
event_detected = post_Ca_amplitude > Ca_HIGH
overflow_sensed = mGluR5_activation == True
context_validated = DARPP32_phospho and GluA1_Ser845_primed
// ── Branch 1: LTP — all budgets requested simultaneously ──────────
if event_detected and overflow_sensed and context_validated:
g_AZ = request_axon_resources(bouton_id, AZ_expansion_cost)
(g_AMPA, g_actin) = request_dendrite_resources(spine_id, AMPA_cost, actin_cost)
(g_Ds, g_ECM, g_pr) = request_astro_resources(syn_id, Ds_cost, ECM_cost, proc_cost)
// Postsynapse: commit proportional to granted resources
activate(CaMKII)
AMPA_count += receptor_insertion(CaMKII, g_AMPA)
spine_volume *= (1 + spine_scale(g_actin))
// Presynapse: commit proportional to granted resources
active_zone_size += g_AZ
RRP_pool_capacity += pool_expansion(active_zone_size)
VGCC_clustering += cluster_beneath_AZ(g_AZ)
vesicle_release_prob += scale_with(g_AZ)
// Astrocyte: commit proportional to granted resources
perisynaptic_distance -= g_pr // walls IN → tighter wrap
ECM_integrity += g_ECM
D_serine_tonic_level += g_Ds
glutamate_clearance_rate *= (1 - clearance_scale(g_pr))
// Partial grants: queue deficit — fulfilled when soma replenishes pools
if g_AMPA < AMPA_cost or g_AZ < AZ_expansion_cost:
queue(bouton_id, spine_id, deficit, dendrite_protein_flux)
axon_tagged_boutons.remove(bouton_id)
dendrite_tagged_spines.remove(spine_id)
return "potentiated" // may be partial if budgets constrained
// ── Branch 2: temporary only — no structural budget drawn ─────────
elif event_detected and not context_validated:
AMPA_count += transient_insertion() // reverses — reserve not permanently drawn
vesicle_release_prob += transient_facilitation()
dendrite_tagged_spines.remove(spine_id) // tag expires without save signal
axon_tagged_boutons.remove(bouton_id)
return "temporary facilitation only"
// ── Branch 3: LTD — resources returned to pool ────────────────────
elif event_detected and not overflow_sensed and not context_validated:
// Postsynapse: internalize receptors — returned to reserve
activate(PP1)
rec_AMPA = receptor_internalization(PP1)
AMPA_count -= rec_AMPA
dendrite_receptor_reserve += rec_AMPA // returned to local pool
spine_volume *= 0.7
dendrite_actin_machinery += actin_depolymerization() // freed actin returned
// Presynapse: dismantle launchpad — proteins returned to axonal pool
rec_AZ = docking_slot_removal()
active_zone_size -= rec_AZ
axon_vesicle_protein_pool += rec_AZ // returned for reuse elsewhere
RRP_pool_capacity -= pool_contraction()
VGCC_clustering -= scatter_VGCCs()
vesicle_release_prob *= 0.6
// Astrocyte: dissolve matrix — resources partially recycled
rec_ECM = secrete(MMPs)
ECM_integrity -= rec_ECM
astro_ECM_protein_pool += rec_ECM × recycling_fraction // partial recovery
D_serine_tonic_level = 0
perisynaptic_distance += process_extension()
astro_process_extensions += freed_process // process freed for reallocation
glutamate_clearance_rate *= 1.2
return "depressed"
// ── Branch 4: baseline ────────────────────────────────────────────
else:
return "baseline — no change"
```
---
## Heterosynaptic Depression — Passive Resource Depletion
```
function heterosynaptic_depression(neighbor_ids):
// Triggered when a tagged synapse exhausts the shared pool
// No active signal required — purely a consequence of budget depletion
for n in neighbor_ids:
if n not in dendrite_tagged_spines and n not in axon_tagged_boutons:
AMPA_count[n] -= passive_depletion_rate()
vesicle_release_prob[n] -= passive_depletion_rate()
```
---
## Special Case — Shockwave Lockdown (>100Hz uncoordinated)
```
function shockwave_lockdown():
astro_Ca_global = GLOBAL_WAVE
release(GABA, ATP) // emergency flood — bypasses normal budget gate
rec_AMPA = mass_internalization()
AMPA_count -= rec_AMPA
dendrite_receptor_reserve += rec_AMPA // receptors returned to reserve
membrane_potential = HYPERPOLARIZED
cluster(VGCC → beneath_active_zone) // overdrive — bypasses normal budget gate
astro_ATP_budget -= emergency_response_cost() // rapid budget depletion
```
---
## Energy Supply Chain — Metabolic Gating (continuous)
```
function metabolic_loop(Δt):
glucose_uptake = blood_capillary_supply() // hard vascular ceiling
lactate_out = min(glycolysis(glucose_uptake, glutamate_clearance_rate),
astro_lactate_ceiling)
lactate_out *= load_factor(glutamate_clearance_rate)
RRP_pool refill rate ∝ VATPase(lactate_out)
membrane_potential reset ∝ NaK_ATPase(lactate_out)
astro_ATP_budget += glycolysis(lactate_out) × Δt
replenish_budgets(Δt)
```
---
## Key Asymmetry — Perisynaptic Distance Amplifies Both Directions
```
// LTP: walls IN → clearance_rate ↓, D_serine_tonic ↑ — self-reinforcing
// LTD: walls OUT → clearance_rate ↑, D_serine_tonic = 0 — self-reinforcing
// Both directions cost astro_process_extensions budget.
// A budget-depleted astrocyte delivers partial changes only — until replenish_budgets runs.
// This is why sleep matters: soma_protein_synthesis_rate peaks during slow-wave sleep,
// replenishing all pools and completing deferred structural commits held in the queue.
```
+1 -1
View File
@@ -31,7 +31,7 @@ PRE_VGCC
instantiation:
# Behaviour
@: BEHAVIOUR [ behaviour: VGCC_PRE_BEH ]
@: BEHAVIOUR [ behaviour: MAIN_VGCC_PRE ]
```
### MAIN_VGCC_PRE: !DAY
+68 -36
View File
@@ -8,16 +8,14 @@ include_toc: true
Expansions and modulations:
- is expanded by: [NEURON](neuron.md)
- expands: SOMA_VGSC
- expands: VGCC_SOMA
```Gen
SOMA
type: comprehension
expansion:
_@SOMA_VGSC-H: TUB [ comprehension: SOMA_VGSC, full: 50x, active: 20x, empty: 10x ]
_@SOMA_VGSC-M: TUB [ comprehension: SOMA_VGSC, full: 50x, active: 20x, empty: 10x ]
_@SOMA_VGSC-L: TUB [ comprehension: SOMA_VGSC, full: 50x, active: 20x, empty: 10x ]
_@VGCC_SOMA: TUB [ comprehension: VGCC_SOMA, full: 50x, active: 20x, empty: 10x ]
intrication:
@@ -46,10 +44,7 @@ instantiation:
# Behaviour
$: BEHAVIOUR [ behaviour: MAIN-SOMA ]
$: BEHAVIOUR [ behaviour: SOMA_VGSC_H_TUN ]
SOMA_VGSC_M_TUN [pass: &SOMA_VGSC_M]
SOMA_VGSC_L_TUN [pass: &SOMA_VGSC_L]
$: BEHAVIOUR [ behaviour: VGCC_SOMA_TUN ]
```
**Tubs:**
@@ -80,7 +75,7 @@ MAIN-SOMA
##### SOMA-Status: ( active: 60x ) contextor
As dendrites deliver current (VDB), the soma acts like a capacitor. It "stores" this charge in the form of membrane potential. This contextualizes SOMA_VGSC to open ion channels that let Na+ ions in.
As dendrites deliver current (VDB), the soma acts like a capacitor. It "stores" this charge in the form of membrane potential. This contextualizes VGCC_SOMA to open ion channels that let Na+ ions in.
This only applies if not ApCtx, or in other words, SOMA is not in refractory period.
@@ -170,24 +165,60 @@ ActiveAP
```
## SOMA_VGSC: Comprehension
## VGCC_SOMA
Voltage Gated Sodium Channel: difficult to open (High)
```Gen
container: SOMA_VGSC-H
VGCC_SOMA
type: comprehension
tub_local:
VGSCRefractoryH ( full: 60x, active: 30x, empty: 0x )
expansion:
tub_intricated:
Na ( contained_in: SOMA)
intrication:
context_intricated:
VDBMaxCtx ( contained_by: SOMA )
# Scope
!DAY: INTRICATION [ ref: &ORGANISM.!DAY ]
!NIGHT: INTRICATION [ ref: &ORGANISM.!NIGHT ]
# Context
# Tub
_Na: INTRICATION [ ref: &SOMA._Na ]
instantiation:
# Context
*VDBMaxCtx: CONTEXT []
*VDBMediumCtx: CONTEXT []
*VDBMLowCtx: CONTEXT []
# Tub
_VGSCRefractoryH: TUB [ full: 60x, active: 30x, empty: 0x )
_VGSCRefractoryM: TUB [ full: 60x, active: 30x, empty: 0x )
_VGSCRefractoryL: TUB [ full: 60x, active: 30x, empty: 0x )
# Behaviour
$: BEHAVIOUR [ behaviour: VGCC_SOMA_BEH_H]
$: BEHAVIOUR [ behaviour: VGCC_SOMA_BEH_M]
$: BEHAVIOUR [ behaviour: VGCC_SOMA_BEH_L]
```
### VGCC_SOMA_BEH_H: !DAY
```Gen
VGCC_SOMA_BEH_H
type: behaviour
within_scope: !DAY
snippets:
@: CONTEXTOR [ snippet: VGSC-H_Status, rf: active 60x ]
@: ACCUMULATOR [ snippet: NaEnterH, rf: active 1x ]
@: ACCUMULATOR [ snippet: VGSCRefractoryHSpill, rf: active 1x ]
```
### sec: SOMA_VGSC-H
### sec: VGCC_SOMA-H
#### VGSC-H_Status: ( active: 60x ) contextor
@@ -196,7 +227,6 @@ Il check su refractory deve essere fatto ad un RF maggiore della eliminazione di
```Gen
VGSC-H_Status: ( active: 60x )
type: contextor
contained_by: SOMA_VGSC-H
in_context: any
condition: VDBMaxCtx AND ( VGSCRefractoryH emptiness )
@@ -214,7 +244,7 @@ Questo sopra è il commmento della versione precedente, ora la quantità di NA i
```Gen
NaEnterH: ( active: 1x )
type: accumulator
contained_by: SOMA_VGSC-H
contained_by: VGCC_SOMA-H
in_context: NaEnterH_ctx
hypothesis: ( NOT Na full )
@@ -233,7 +263,7 @@ Lo Spill deve avere un rf maggiore dell'interacting che incrementa VGSCRefractor
```Gen
VGSCRefractoryHSpill: ( active: 1x )
type: accumulator
contained_by: SOMA_VGSC-H
contained_by: VGCC_SOMA-H
in_context: VGSCRefractoryHSpill_ctx
hypothesis: NOT ( VGSCRefractoryH empty )
@@ -241,12 +271,14 @@ VGSCRefractoryHSpill: ( active: 1x )
trace: None
```
## SOMA_VGSC-M: container
## VGCC_SOMA-M: container
Voltage Gated Sodium Channel: less difficult to open (Medium)
```Gen
container: SOMA_VGSC-M
container: VGCC_SOMA-M
tub_local:
VGSCRefractoryM ( full: 60x, active: 30x, empty: 0x )
@@ -258,7 +290,7 @@ container: SOMA_VGSC-M
VDBMedCtx ( contained_by: SOMA )
```
### sec: SOMA_VGSC-M
### sec: VGCC_SOMA-M
#### VGSC-M_TPC: ( active: 60x ) contextor
@@ -267,7 +299,7 @@ Il check su refractory deve essere fatto ad un RF maggiore della eliminazione di
```Gen
VGSC-M_Status: ( active: 60x )
type: contextor
contained_by: SOMA_VGSC-M
contained_by: VGCC_SOMA-M
in_context: VDBMediumCtx OR VDBMaxCtx
condition: ( VGSCRefractoryH emptiness )
@@ -282,7 +314,7 @@ Questo sopra è il commmento della versione precedente, ora la quantità di NA i
```Gen
NaEnterM: ( active: 1x )
type: accumulator
contained_by: SOMA_VGSC-M
contained_by: VGCC_SOMA-M
in_context: NaEnterM_ctx
hypothesis: ( NOT Na full )
@@ -301,7 +333,7 @@ Lo Spill deve avere un rf maggiore dell'interacting che incrementa VGSCRefractor
```Gen
VGSCRefractoryMSpill: ( active: 1x )
type: accumulator
contained_by: SOMA_VGSC-M
contained_by: VGCC_SOMA-M
in_context: any
hypothesis: NOT ( VGSCRefractoryM empty )
@@ -309,12 +341,12 @@ VGSCRefractoryMSpill: ( active: 1x )
trace: None
```
## SOMA_VGSC_L: container
## VGCC_SOMA_L: container
Voltage Gated Sodium Channel: easy to open (Low)
```Gen
container: SOMA_VGSC_L
container: VGCC_SOMA_L
tub_local:
VGSCRefractoryL ( full: 60x, active: 30x, empty: 0x )
@@ -326,7 +358,7 @@ container: SOMA_VGSC_L
VDBLowCtx ( contained_by: SOMA )
```
### sec: SOMA_VGSC_L
### sec: VGCC_SOMA_L
#### VGSC-L_TPC: ( active: 60x ) contextor
@@ -335,7 +367,7 @@ Il check su refractory deve essere fatto ad un RF maggiore della eliminazione di
```Gen
VGSC-L_Status: ( active: 60x )
type: contextor
contained_by: SOMA_VGSC_L
contained_by: VGCC_SOMA_L
in_context: VDBLowCtx OR VDBMediumCtx OR VDBMaxCtx
condition: ( VGSCRefractoryH emptiness )
@@ -350,7 +382,7 @@ Questo sopra è il commmento della versione precedente, ora la quantità di NA i
```Gen
NaEnterL: ( active: 1x )
type: accumulator
contained_by: SOMA_VGSC_L
contained_by: VGCC_SOMA_L
in_context: NaEnterL_ctx
hypothesis: ( NOT Na full )
@@ -379,14 +411,14 @@ VGSCRefractoryLSpill: ( active: 1x )
```
## SOMA_VGSC_TUN: Tuner
## VGCC_SOMA_TUN: Tuner
```Gen
SOMA_VGSC_TUN
VGCC_SOMA_TUN
type: tuner
contained_by: SOMA
tunes: SOMA/expansion/SOMA_VGSC
tunes: SOMA/expansion/VGCC_SOMA
context_intricated:
- TunPossible ( contained_by: DAY-N )
@@ -401,7 +433,7 @@ SOMA_VGSC_TUN
```Gen
check_tpc: ( active: 60x )
type: contextor
contained_by: SOMA_VGSC-TUN
contained_by: VGCC_SOMA-TUN
in_context: TunPossible
condition: ??