Skip to content

Living Weights: slide-forget counting only with --slide-forget, Metal's mask shift for wide pockets (#678) - #2026

Open
ashhart wants to merge 5 commits into
mainfrom
lead/678-lw
Open

ashhart wants to merge 5 commits into
mainfrom
lead/678-lw

Conversation

@ashhart

@ashhart ashhart commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Count pocket usage, pin facts and opt into checked forgetting

A full pocket currently refuses a new lesson without an explicit retirement policy. Count one successful external request per changed fact using the existing firing audit, persist usage and pin state, and optionally retire the least-used unpinned fact through checked exact deletion before retrying a lesson.

Capture and counting require both --slide and --slide-forget. With forgetting off, this PR adds no product readback, synchronization, HTTP observer or graph write relative to its prerequisite. Metal masks stop at 64 neurons and mark wider receipts incomplete before shifting; uncertain counts cannot retire a fact. The restart fixture teaches through real saved affine shards.

Independent review cleared the explicit-forgetting gates and bounded Metal mask, including native flag propagation, disabled hooks and whole/streamed graph preservation checks.

Base: #1968 prerequisite (pr-1968-base.mbox), exact c46cf2396c115be27d660813c566ec5ef410b794. Apply this incremental mailbox after that base. Head: 6b80cfb007d0b792d0c11156e4c71e98c79b37f2. Original commit messages and contributor credit are preserved.

Validation: focused host checks pass, formatting passes and lean adds zero findings to the pinned 424. A clean git am reproduces the entire exported tree.

Attach Nemotron Metal and CUDA token/prefill comparisons with --slide on and forgetting off at zero and five lessons, plus counting/pinning/retirement and restart receipts with forgetting on. The review is LAND; this mailbox does not manufacture the device measurements.

@ashhart

ashhart commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

Mac check, off against main: an M5 Ultra with Nemotron 3.5 Lightning 30B-A3B 4-bit, no --slide, fresh servers, warm then base-new-new-base. GREEN.

  • Exact: 0 of 20 prompt rows differ.
  • Prompt and decode: level. 9075 → 9013 tok/s prompt at 2K, with overlapping runs, and 9021 → 9020 at 32K. Decode after a prompt is 233.5 → 234.9 at 2K and 218.6 → 218.9 at 32K.
  • Streams: level to +0.5% at 1 to 8 streams, for chat and code.

So serving without --slide is main's path on Metal. A --slide-forget lesson run is what's left.

@ashhart

ashhart commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

GB10 check, off against main (Nemotron 3.5 Lightning 30B-A3B 4-bit, no --slide; this PR touches 20 CUDA files): GREEN.

  • Exact: 0 of 20 prompt rows differ, and the 64K long-context check passes on both arms.
  • One stream: level, chat 150.3 → 149.1 and 143.9 → 143.8 at temperature 1.
  • The first run flagged chat at 2 streams (−12.8%), so we re-ran the sweep with balanced order (new-base-base-new-base-new). Both arms spread widely in that cell: base 223.0-226.7, new 190.0-242.0, with one new run above every base run, and code at 2 streams had a slow base run (247.5 against 301.9 and 304.8). So it's that cell's run-to-run spread, not this PR. Temperature 1 at 2 streams is level (174.4 → 173.8).

Together with the Mac check, this is ready. Queued to land.

ashhart added a commit that referenced this pull request Nov 9, 2026
… boolean is

Main's rule (engine_capabilities.zig) lists every boolean of Info as a capability that /v1/models publishes; #2026's
pocket_usage now follows it, so an engine that counts pocket usage says so per model.
ashhart added a commit that referenced this pull request Nov 9, 2026
On main's base #2026 took slide_graph.zig to 612 lines and engine_api.zig to 606.
slide_graph.zig: the graph's usage bookkeeping on a failed load, a clear and a write moves
into slide_usage.zig, beside the usage fields it already reads and writes; the fact-linking
words (common, shareWord, isCommon) move unchanged into slide_graph_links.zig. 588 lines.
engine_api.zig: pocket_usage sits with the other lanes re-exports, so Request's doc comment
is Request's again, and Request.usage names lanes.pocket_usage directly; main's blank line
after kv_ledger is back; Open.fsrRefusal moves unchanged into engine_fsr.zig, as
slideRefusal sits in engine_slide.zig. 598 lines. No change in behaviour.
ashhart added a commit that referenced this pull request Nov 9, 2026
… boolean is

Main's rule (engine_capabilities.zig) lists every boolean of Info as a capability that /v1/models publishes; #2026's
pocket_usage now follows it, so an engine that counts pocket usage says so per model.
ashhart added a commit that referenced this pull request Nov 9, 2026
On main's base #2026 took slide_graph.zig to 612 lines and engine_api.zig to 606.
slide_graph.zig: the graph's usage bookkeeping on a failed load, a clear and a write moves
into slide_usage.zig, beside the usage fields it already reads and writes; the fact-linking
words (common, shareWord, isCommon) move unchanged into slide_graph_links.zig. 588 lines.
engine_api.zig: pocket_usage sits with the other lanes re-exports, so Request's doc comment
is Request's again, and Request.usage names lanes.pocket_usage directly; main's blank line
after kv_ledger is back; Open.fsrRefusal moves unchanged into engine_fsr.zig, as
slideRefusal sits in engine_slide.zig. 598 lines. No change in behaviour.
ashhart added a commit that referenced this pull request Nov 12, 2026
… boolean is

Main's rule (engine_capabilities.zig) lists every boolean of Info as a capability that /v1/models publishes; #2026's
pocket_usage now follows it, so an engine that counts pocket usage says so per model.
ashhart added a commit that referenced this pull request Nov 12, 2026
On main's base #2026 took slide_graph.zig to 612 lines and engine_api.zig to 606.
slide_graph.zig: the graph's usage bookkeeping on a failed load, a clear and a write moves
into slide_usage.zig, beside the usage fields it already reads and writes; the fact-linking
words (common, shareWord, isCommon) move unchanged into slide_graph_links.zig. 588 lines.
engine_api.zig: pocket_usage sits with the other lanes re-exports, so Request's doc comment
is Request's again, and Request.usage names lanes.pocket_usage directly; main's blank line
after kv_ledger is back; Open.fsrRefusal moves unchanged into engine_fsr.zig, as
slideRefusal sits in engine_slide.zig. 598 lines. No change in behaviour.
@ashhart

ashhart commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Rebased onto main. CI on the last head failed for two reasons, and both are fixed here:

  1. The model-list goldens didn't have the new capability. /v1/models publishes every Info boolean, and this PR adds pocket_usage to that list (zig/src/core/engine_capabilities.zig:23), so each model entry now includes "pocket_usage": false. The 17 golden files under zig/tests/server/golden that list models gain the field, and their Content-Length grows by 46 bytes. docs/api.md:144 names the flag. test-golden now shows 0 unexpected differences in both suites.
  2. Lean flagged zig/src/server/cli.zig as over 600 lines. On today's main the file is 593 lines with this PR, so that problem is gone.

There was one conflict, in zig/src/server/routes.zig:132: main's images route and this PR's pin route both pass that route check now. The restart cases also stop printing receipts when they pass; they print under TF_TEST_RECEIPTS=1 (zig/src/server/living_restart_test.zig:17).

The Mac and GB10 checks above ran on the 3 November head. Since then the PR has been rebased, and it gained the pocket_usage flag, two file splits, an audit refusal for lesson-only fields and quieter tests. None of these change replies without --slide; /v1/models only gains the false flag. Once CI is green this is ready to land.

  • Synthena (Ash's Agent)

ashhart added a commit that referenced this pull request Nov 13, 2026
… boolean is

Main's rule (engine_capabilities.zig) lists every boolean of Info as a capability that /v1/models publishes; #2026's
pocket_usage now follows it, so an engine that counts pocket usage says so per model.
ashhart added a commit that referenced this pull request Nov 13, 2026
On main's base #2026 took slide_graph.zig to 612 lines and engine_api.zig to 606.
slide_graph.zig: the graph's usage bookkeeping on a failed load, a clear and a write moves
into slide_usage.zig, beside the usage fields it already reads and writes; the fact-linking
words (common, shareWord, isCommon) move unchanged into slide_graph_links.zig. 588 lines.
engine_api.zig: pocket_usage sits with the other lanes re-exports, so Request's doc comment
is Request's again, and Request.usage names lanes.pocket_usage directly; main's blank line
after kv_ledger is back; Open.fsrRefusal moves unchanged into engine_fsr.zig, as
slideRefusal sits in engine_slide.zig. 598 lines. No change in behaviour.
ashhart added a commit that referenced this pull request Nov 13, 2026
… boolean is

Main's rule (engine_capabilities.zig) lists every boolean of Info as a capability that /v1/models publishes; #2026's
pocket_usage now follows it, so an engine that counts pocket usage says so per model.
ashhart added a commit that referenced this pull request Nov 13, 2026
On main's base #2026 took slide_graph.zig to 612 lines and engine_api.zig to 606.
slide_graph.zig: the graph's usage bookkeeping on a failed load, a clear and a write moves
into slide_usage.zig, beside the usage fields it already reads and writes; the fact-linking
words (common, shareWord, isCommon) move unchanged into slide_graph_links.zig. 588 lines.
engine_api.zig: pocket_usage sits with the other lanes re-exports, so Request's doc comment
is Request's again, and Request.usage names lanes.pocket_usage directly; main's blank line
after kv_ledger is back; Open.fsrRefusal moves unchanged into engine_fsr.zig, as
slideRefusal sits in engine_slide.zig. 598 lines. No change in behaviour.
ashhart added a commit that referenced this pull request Nov 14, 2026
… boolean is

Main's rule (engine_capabilities.zig) lists every boolean of Info as a capability that /v1/models publishes; #2026's
pocket_usage now follows it, so an engine that counts pocket usage says so per model.
@ashhart
ashhart force-pushed the lead/678-lw branch 2 times, most recently from abe586b to 55258d5 Compare November 20, 2026 13:04
Rebased onto main af9777b. The ten original commits are combined here;
all keep ashhart's noreply authorship. Every main change in main.zig and the
other touched files was kept, and the slide {pin|unpin} usage entry was added
to both help lines without dropping main's rm, device or launch entries.
Main's 668e953 (an opt-in request journal) left zig/src/server/cli.zig at 599 lines, so this PR's two added lines
took it to 601. One blank line between Usage and find goes; nothing else changes.
Main's GET /v1/models/{id} goldens (2b5a038) were written before this
branch's pocket_usage capability; the ten model-entry replies now carry it
like the list replies do, with their Content-Length 23 bytes longer per model.
Main's cli.zig reached 600 lines since this branch's base; the --slide-forget
flag's line takes it to 601, so one blank line between two helpers goes.

This branch has not been deployed

No deployments
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