Skip to content

RFC 0002 part 2: rest and load (opt-in blocks) - #46

Merged
BitmapAsset merged 2 commits into
mainfrom
feat/rfc2-wave2-rest-load
Oct 21, 2026
Merged

BitmapAsset merged 2 commits into
mainfrom
feat/rfc2-wave2-rest-load

Conversation

@BitmapAsset

Copy link
Copy Markdown
Owner

RFC 0002 part 2 (docs/rfcs/0002-neuromodulators-and-body.md, "Part 2 (follow-on): rest and load"): two opt-in blocks. Mechanism (the downscale) and simulation (the pressure, the load). A persona without the blocks gives byte-identical documents.

What it does

  • rest: a pressure S (state pressure: {s, pending}) rises over active hours, S ← 1 − (1 − S) e^(−rise_per_hour h), and falls over idle gaps, S ← S e^(−fall_per_hour h). An idle gap (h ≥ gap_hours) at S ≥ threshold brings a rest line, its own strand line chained before its event, that sets every learned weight to round(ρΔ, 6), 0 below prune. It never shares an event with feedback: an event with feedback sets pressure.pending, and the line comes before the next event without feedback. Surprise gate: each learned trait's v, r̂, g and counts are left unchanged, and the line says so per trait. The credit and open decisions are not touched either. live verify recomputes rest lines and refuses one that is missing, extra, changed or trailing (exit 1). Refusal W-R1.
  • load: L = round(clip(L × 0.5^(h/hl) + κ max(a_t − θ, 0) + κ_h h [held mood > θ_m], 0, L_cap), 6). a_t sums the weights of the learning flags that are on, the declared senses' readings (sense_<id>) and the credit expiries at this event (the credit half-life, which the patience gene scales). L is lowered as the engine-owned number input load_level (box [0, L_cap]), the same way pace_up/pace_down are: refused when the host sends it, left out of the stance's inputs, boxed by prove. The stance adds load: {l} and the state stores load: {l}. The load step runs right after the pace step. Refusal L-R1.
  • The RFC text records what the implementation decided where the RFC was open (feedback = a learning flag on, or any goal signal with drives; the line's fields; the gate left unchanged; a_t's evidence; the hold reads the mood accumulator's last level before the event). CHANGELOG ## 0.10.1 - unreleased Added entry.
  • Test fixtures next-load.strand and next-rest.strand used load and a rest line as names no engine knew, but these now exist. They are renamed next-block.strand (sleep block) and next-line.strand (nap line), with the same bytes otherwise, re-chained.

Numbers (the bars pre-registered in bench/body/README.md P6/P7, measured by this engine for the first time)

PROBBIT_BIN=target/release/probbit python3 bench/body/run.py --only rest,load,replay,habits,p0: 14/14 gated bars pass, exit 0. nulls.py: 0 of 51 null rows pass a v2 bar.

bar pass line (README) measured
r0 contraction within 1e-6, 0 inversions, top unchanged, 0 lost distinctions; 20 short controls: no line, no change max error 0.0; inversions 0; top changed 0; lives without a line 0/200; lost 0; control lines 0, change 0
r1 median re-learning with rest ≤ 0.5 × without; lesson kept ≥ 90 % 5 vs 11 turns = 0.4545; kept 200/200 (with lock turns, reported: 6 vs 11 = 0.5455)
r2 without ≥ 0.1 after gen 1; with ≤ 0.8 × without after 1, 2; with ≤ without after 10 gen 1: 0.242783 vs 0.453652 (0.535); gen 2: 0.453652 vs 0.63133 (0.719); gen 10: 0.659996 vs 0.665918
r3 0 differing bytes, rest lines included 200 strands, verify_fail 0, third/split differ 0; planted changed/removed/swapped refused
r4 0 breaks, ≥ 50 bound, ≥ 50 conflicts, twin breaks ≥ 1 breaks 0; bound 2520; conflicts 2459; twin breaks 2459
r5 byte-identical without the block pass (p0 part)
l1 3 distinct; criticism closed form ≤ 1e-5; hold increments 0 or κ_h h, 40-50, last < 56; failure > 0; P(careful) peak > start distinct; error 0.0; hold 47 on, last at 48, others 0; failure min increment 0.038323; careful 0.5 → 0.681296 (hold), 0.622459 → 0.999665 (failure)
l2 induction 1.0 ± 1e-6; recovery ≤ 1e-5 L0 1; max diff 4.15e-7
l3 ≤ cap; closed form to hit 40; pinned; recovery ≤ 1e-5 max 4; first cap at hit 40; final 4; recovery error 1e-6
l4 0 differing bytes 7 strands, verify_fail 0; planted refused
l5 byte-identical without the block pass

Also measured: replay.py's reported r3_null_rest_line_removed_refused reads false, because it removes lines that start with {"rest" and a chained canonical line never starts that way (prev sorts first). replay.py is MANIFEST-frozen, so it is not edited here. A hand check on reversal seed 0 (rest line at line 122) found: line removed → verify exit 1 (prev); removed and re-chained → exit 1 ("a rest line is due before this event and missing"); edited → exit 1. The unit test verify_recomputes_rest_lines covers the same cases.

Gate

  • cargo test --locked: 418 passed, 0 failed, 1 ignored (macOS, load 16-21).
  • P0: bench/individuality/p0.py check with this build gives 653 outputs, 0 differ (629 identical, 24 stderr warnings only, 8 strands verified).
  • Twins: 4 archived real strands (engines 0.7.0 ×2, 0.8.1, 0.8.2) and 7 strands written by the base build (a5d9c26: tutor demo week, pace, gate, optimism, valence, load-noload, rest-norest). live verify output from the base build and from this build: 0 bytes differ for 11/11, exit 0. The 6 fixture strands written again by this build are byte-identical to the base build's.
  • prove on a load persona boxes load_level at 2 ± 2 = [0, L_cap 4].

Draft for review. Do not merge before CI on the three operating systems is green and the numbers above have been read.

rest: pressure S over stamped hours; an idle gap at S >= threshold brings a rest
line (its own strand line, chained before its event, never with feedback:
pressure.pending) that scales learned weights by downscale, prune below prune;
each learned trait's surprise gate (v, r, g, counts) is left unchanged.
load: L from learning flags, declared senses and credit expiries plus a held
mood; lowered as the engine-owned number input load_level (box [0, cap]),
refused when sent, left out of the stance's inputs. Refusals W-R1, L-R1.
live verify recomputes rest lines. The next-version test fixtures that used
load and rest as unknown names now use sleep and nap.
CHANGELOG conflict resolved by keeping both: 0.10.1 lists ### Added (rest and load)
then ### Changed (the two 0.10.1 fixes) and ### Other.
@BitmapAsset
BitmapAsset marked this pull request as ready for review October 21, 2026 12:58
@BitmapAsset
BitmapAsset merged commit 2d9cb5e into main Oct 21, 2026
15 checks passed
@BitmapAsset
BitmapAsset deleted the feat/rfc2-wave2-rest-load branch October 21, 2026 12:58
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.

1 participant