Skip to content

Sleep gains a depth: the wake threshold rides FLP-11 and the unspent pressure - #207

Merged
YesterdaysLemon merged 1 commit into
mainfrom
claude/repo-overview-directions-t7gut2
Aug 26, 2026
Merged

YesterdaysLemon merged 1 commit into
mainfrom
claude/repo-overview-directions-t7gut2

Conversation

@YesterdaysLemon

Copy link
Copy Markdown
Owner

Closes #204.

What

Arousability across a real sleep bout is graded, not flat — thresholds rise as the bout deepens and fall again near its natural end (Nichols et al. 2017, graded arousability across sleep in C. elegans). The model's arousal was a hard constant: measured before this change, a poke at any strength ≥ 1.0 woke the animal at every instant of a bout, identically.

The mechanism (no new state)

Both halves of the depth curve were already in the homeostat's state:

  • FLP-11 is slow to accumulate (flp11_tau), so the bout's start is shallow — the depth on the way in;
  • undischarged pressure is spent by the bout's end, so its close is shallow again — the depth on the way out.

depth = flp11 × clip((pressure − threshold_off)/(threshold_on − threshold_off)), and the wake threshold is arousal_touch + arousal_depth·depth. Nothing new is integrated, and depth is exactly zero in an animal that has never slept — the never-slept trajectory stays bit-identical.

Measured

On the shipped clock the threshold runs 0.74 → 1.13 → 0.86 at 2/20/35 s into a bout. The new behaviour test pins the curve and the inversion it buys:

  • a gentle prod (1.0, delivering ~0.95 summed touch) wakes the dozing ends of a bout and rolls off its deep middle;
  • the canonical hard prod (3.0, delivering ~1.7 within 0.3 s) always wakes — a depth that defended sleep against emergencies would be paralysis. The compressed-clock fixture's operating point was checked too (threshold 1.35 there, crossed at ~0.2 s), so the existing arousal tests keep their margins.

Runtime parity

The depth term is ported into the WASM sleep cascade and arousal_depth rides the payload. The conformance sleep scenario still sleeps and still wakes, and the port reproduces Python to 5e-13 mm / 6e-11 mV, multi-animal included.

On the site: a deeply-asleep worm is now genuinely harder to wake than a dozing one. 💤

🤖 Generated with Claude Code

https://claude.ai/code/session_01CBroMXcYdfkyb5buJPcKvL


Generated by Claude Code

…pressure

Arousability across a real bout is graded, not flat -- thresholds rise as
sleep deepens and fall again near its natural end (Nichols et al. 2017).
Both halves of that curve were already in the homeostat's state: FLP-11 is
slow to accumulate, so the bout's start is shallow, and the discharged
pressure is spent by the bout's end, so its close is shallow again. Depth
is their product, and the wake threshold is arousal_touch plus
arousal_depth times that -- no new state integrated, and exactly zero in an
animal that has never slept, which keeps the never-slept trajectory
bit-identical.

Measured on the shipped clock the threshold runs 0.74 -> 1.13 -> 0.86 at
2/20/35 s into a bout. The new behaviour test pins the curve and the
inversion it buys: a gentle prod (delivering ~0.95 summed touch) wakes the
dozing ends of a bout and rolls off its deep middle, while the canonical
hard prod (3.0, delivering ~1.7 within 0.3 s) always wakes -- a depth that
defended sleep against emergencies would be paralysis, and the margin is
checked at the compressed-clock fixture's operating point too (threshold
1.35 there). The flat baseline this replaces woke at every instant of a
bout at any strength >= 1.0, measured before the change.

Ported to the WASM runtime in the same change (the depth term in the sleep
cascade, arousal_depth in the payload); the conformance sleep scenario
still sleeps and still wakes, and the port reproduces Python to 5e-13 mm /
6e-11 mV.

Closes #204.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CBroMXcYdfkyb5buJPcKvL
@YesterdaysLemon
YesterdaysLemon marked this pull request as ready for review August 26, 2026 20:28
@YesterdaysLemon
YesterdaysLemon merged commit 5757c2d into main Aug 26, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sleep depth: arousal threshold should ride the standing FLP-11

2 participants