Skip to content

Window grants share the surplus in proportion to each mind's growth: the largest demand is no longer reached last (card 20b830fb) - #5816

Merged
joelteply merged 1 commit into
canaryfrom
20b830fb/grants-share-surplus-proportionally
Nov 7, 2026
Merged

joelteply merged 1 commit into
canaryfrom
20b830fb/grants-share-surplus-proportionally

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The M5, 2026-11-07 08:46-09:46Z on a947e4e (#5813's merge): Atlas granted 14,353 against a 111,165-token
view (18 acts at 42% reuse, history broken in 14 of 19), Benchy alike, while the pool stayed with whoever
was filled first. #5813's fill order was "smallest growth to target first" (the fair publisher passes
in_flight false for every mind), so the largest demand was reached last on every publish; whatever she
did not get stayed with its holders (want = holds). Starvation, which goal 9 forbids (Fable on eebaade4).

Now, when every want fits but not every target: the surplus above every need is shared in proportion to
each mind's remaining growth (target - need, targets capped at one sequence), flexbox's grow, the
principle the act allocation searches by. A settled mind (she has served on her grant since it last
changed, read off her receipts by the fair publisher) holding more than one headroom (SENT_HEADROOM)
above her share gives back down to her share; every other mind keeps her want and grows toward her share
when there is room. A mind below her share is never shrunk to feed another, and one who has not served
on her grant is never shrunk at all. Steady demand is a steady grant (asserted).

Demand gains settled; FairGrantState records the receipt revision at each mind's last grant change.

Tests: continuum-engine capacity:: 233 pass; continuum-serving --tests checks clean (IntelMac, -j 2).
New: the_largest_demand_gets_the_largest_share_and_only_a_settled_holder_gives_back (Atlas's case; an
unserved holder keeps her grant and nothing moves until she serves). Rewritten with independently
computed proportional values: surplus_above_every_need... (06:50Z numbers) and needs_are_granted...

Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…the largest demand is no longer reached last (card 20b830fb)

The M5, 2026-11-07 08:46-09:46Z on a947e4e (#5813's merge): Atlas granted 14,353 against a 111,165-token
view (18 acts at 42% reuse, history broken in 14 of 19), Benchy alike, while the pool stayed with whoever
was filled first. #5813's fill order was "smallest growth to target first" (the fair publisher passes
in_flight false for every mind), so the largest demand was reached last on every publish; whatever she
did not get stayed with its holders (want = holds). Starvation, which goal 9 forbids (Fable on eebaade4).

Now, when every want fits but not every target: the surplus above every need is shared in proportion to
each mind's remaining growth (target - need, targets capped at one sequence), flexbox's grow, the
principle the act allocation searches by. A settled mind (she has served on her grant since it last
changed, read off her receipts by the fair publisher) holding more than one headroom (SENT_HEADROOM)
above her share gives back down to her share; every other mind keeps her want and grows toward her share
when there is room. A mind below her share is never shrunk to feed another, and one who has not served
on her grant is never shrunk at all. Steady demand is a steady grant (asserted).

Demand gains `settled`; FairGrantState records the receipt revision at each mind's last grant change.

Tests: continuum-engine capacity:: 233 pass; continuum-serving --tests checks clean (IntelMac, -j 2).
New: the_largest_demand_gets_the_largest_share_and_only_a_settled_holder_gives_back (Atlas's case; an
unserved holder keeps her grant and nothing moves until she serves). Rewritten with independently
computed proportional values: surplus_above_every_need... (06:50Z numbers) and needs_are_granted...

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply merged commit 6bfedd8 into canary Nov 7, 2026
32 checks passed
@joelteply
joelteply deleted the 20b830fb/grants-share-surplus-proportionally branch November 7, 2026 11:00
joelteply added a commit that referenced this pull request Nov 7, 2026
…ver untrimmed demand, and a settled holder above it is released (card 7b7a696a, step 1) (#5823)

The M5, 2026-11-07, 19426f4 + fork 46c664457 (Fable's first-hour read): 71 acts vs 158 the hour
before, median 104 s vs 50 s, decode 7-10 t/s vs 15-22, Benchy 392 s, 1 write. The cold-boot plan
regrew the pool from 152,832 to 755,456 and #5816 grew minds toward targets of 150-557k (her untrimmed
wish with headroom), so grants reached 197k and prompts grew from ~30k to 35-75k; every held token
slows every act (Fable measured 3.54 +/- 0.30 s per act per 1k held tokens on 1,124 acts).

Step 1, the stopgap, within the hour of the read:
- grants.rs: a mind's target is her held need x SENT_HEADROOM (the existing named sent headroom),
  never her untrimmed demand. Growing past it is a priced decision (step 2).
- window_grant.rs: a settled mind (served on her grant since it last changed) with no turn in flight
  holds no more than her target as the policy reads it, so what she holds above it is released at her
  next view start in every stage. A mind not yet served on her grant, or mid-turn, keeps all of it.

Step 2 (this card, after #5822 lands): the target reads continuum-context price.rs, the window her
priced plan holds, and SENT_HEADROOM leaves the grant path; 68ffe0f0 (requirements record what the
priced plan holds, so the pool stops growing for unheld demand) rides with it.

Tests: continuum-engine capacity:: 234 pass; continuum-serving --tests check clean; ratchets vs
origin/canary 87/87. New: a_settled_holder_above_her_target_is_released_to_it (197k held, 30k need:
released to 37,500; unserved or mid-turn keeps it). Updated with reasons: the drift test now uses
production-shaped targets (a drift inside the headroom keeps the grant; that headroom is what makes
drift free), and the roomy case asserts release instead of "keeps her surplus". Mutation: without the
holds cap, the release test fails.


Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
joelteply added a commit that referenced this pull request Nov 7, 2026
…5709)

* Flow plan §6e: a mind's window follows what she reads, as demand events up or down, granted from one shared pool (Joel, 2026-11-02)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* Flow plan §6e amended per Codex's review: untrimmed demand plus reserve with revisions, versioned grants that never shrink under an in-flight turn, the fork's per-slot capability proven first, validator before engine work

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* FLOW §6e: the allocator already grants unevenly (DemandFollowing, #5813/#5816/#5823); only the surplus's price remains (Cormac on #5709)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant