Skip to content

feat(serving): daemon-integrated pin actuator — trace tail → bandit → pins on the GOVERNED plan (#281) - #2119

Merged
joelteply merged 1 commit into
canaryfrom
feat/281-pin-actuator-daemon-wire
Aug 2, 2026
Merged

feat(serving): daemon-integrated pin actuator — trace tail → bandit → pins on the GOVERNED plan (#281)#2119
joelteply merged 1 commit into
canaryfrom
feat/281-pin-actuator-daemon-wire

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The rung-3 actuator leaves the standalone moe-pager-driver bin and becomes autonomic: the serving daemon tails the fork's routed-expert trace and carries the bandit's hot pin list on the SAME governed plan file the host-cache lease publishes. One writer, one plan — policy and budget on one document, consumed by her ResidencyCache's per-token mtime poll.

What

  • Zero-config observation: spawn now sets GGML_MOE_TRACE_FILE per port beside capture/plan (moe_glass_box_paths), and TkeyTable::for_layers(n_layers) SYNTHESIZES the tkey→layer map from geometry via the fork's exact FNV-1a — no operator JSON step. Hash parity pinned against a key from her REAL tkey-to-layer-matrix.json (blk.5.ffn_up_exps.weight16542725649459479844, independently recomputed).
  • capacity/trace_tail.rs (new): MoeTraceTail — offset-resumed, truncation-reset (fork reopens "wb" per serve), bounded 4 MiB drains with record-aligned skip-ahead on backlog, prefill→decode boundary detection → immediate warm-start publish (prefill's tail predicts ~47–66% of decode experts), and last-published-pins memory.
  • Two-axis write decision in publish_moe_host_cache_lease: the sticky band governs the BUDGET value; pins roll independently. A write happens when either axis moves (or at the boundary), never otherwise — the no-mtime-churn property moved from the band to the write decision.
  • Retention-derived pin budget: pin_ceiling = at most HALF the lease's worth of experts (the recency window keeps the rest); an under-retention lease publishes budget-only — exactly the v1 wire shape her parse was validated against.
  • Probe: serving.moe_host_cache_lease now carries pins / trace_tokens / warm_start.

Anti-fossil by construction

Pins re-derive from the decay bandit every publish — a static pin set cannot fossilize (the RUN-1 lesson: routed-expert hotness is prompt-dependent; static pins hurt).

Tests

4 new in trace_tail + 1 hash-parity in segment.rs, each with // what this catches:. expert-pager-policy 18/18; serving_daemon + host_cache_lease + llama_server suites 56/56.

Note: the ts-rs drift guard is red on canary (pre-existing) — fix is PR #2118; this branch will go green once that merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

@joelteply
joelteply force-pushed the feat/281-pin-actuator-daemon-wire branch from ca1b259 to 327bd1c Compare August 2, 2026 19:29
… pins on the GOVERNED plan (#281)

The rung-3 actuator leaves the standalone driver and becomes autonomic:
the serving daemon now tails the fork's routed-expert trace
(GGML_MOE_TRACE_FILE, spawned per-port beside capture/plan — system-owned,
zero operator env) and carries the bandit's hot pin list on the SAME
governed plan file the host-cache lease publishes. One writer, one plan,
policy and budget on one document.

- expert-pager-policy: TkeyTable::for_layers(n_layers) SYNTHESIZES the
  tkey→layer map from geometry via the fork's exact FNV-1a
  (canonical_name_key) — no operator JSON step. Hash parity pinned
  against a key from her REAL table (blk.5.ffn_up_exps.weight →
  16542725649459479844, independently recomputed).
- capacity/trace_tail.rs (NEW): MoeTraceTail — offset-resumed,
  truncation-reset (new serve = fresh state), bounded 4 MiB drains with
  record-aligned skip-ahead on backlog (recency is the signal),
  prefill→decode boundary → immediate warm-start publish, and the
  last-published-pins memory that gates write churn.
- serving_daemon: publish_moe_host_cache_lease reworked to two axes —
  sticky band governs the BUDGET value; pins roll independently. Writes
  happen when either axis moves (or at the boundary), never otherwise:
  the no-mtime-churn property moved from the band to the write decision.
  Pin count is retention-derived (pin_ceiling: at most HALF the lease's
  worth of experts — the recency window keeps the rest), so an
  under-retention lease publishes budget-only (v1 wire shape, her
  validated parse). Probe now carries pins/trace_tokens/warm_start.

Anti-fossil by construction: pins re-derive from the decay bandit every
publish — a static pin set cannot fossilize (the RUN-1 lesson measured
in [[routed-expert-hotness-is-prompt-dependent-static-pins-hurt]]).

Tests: 4 new in trace_tail (each pinning a named invariant), 1 new hash
parity in segment.rs; expert-pager-policy 18/18; serving_daemon +
host_cache_lease + llama_server suites 56/56.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply force-pushed the feat/281-pin-actuator-daemon-wire branch from 327bd1c to ebdd917 Compare August 2, 2026 19:45
@joelteply
joelteply merged commit 8659d28 into canary Aug 2, 2026
4 checks passed
@joelteply
joelteply deleted the feat/281-pin-actuator-daemon-wire branch August 2, 2026 19:54
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