feat(v4): the expert history lives in route_trace.h now — #700 completed - #969
Open
terrizoaguimor wants to merge 1 commit into
Open
feat(v4): the expert history lives in route_trace.h now — #700 completed#969terrizoaguimor wants to merge 1 commit into
terrizoaguimor wants to merge 1 commit into
Conversation
…completed V4 kept a private .coli_usage reader/writer after the JustVugg#700 unification: same file format hand-duplicated (header records, FNV-1a identity, tmp+rename), but the engine was never registered in rt_engine_names, so a V4-written history announced itself as "an unknown engine" to every sibling, and its copy had already drifted (no COLI_USAGE_DECAY, no legacy-layout acceptance, a stricter dims record that silently dropped headerless files). Move V4 onto the shared header, which is also where this fix class is guaranteed to reach every sibling next time: - rt_init("deepseek_v4", ...) at hot-store creation; store lookups feed the shared counters next to policy->usage (rt_count), which the next save now persists via rt_save — cumulative across sessions, byte- identical header records to the private writer, decay knob included; - the reader is rt_read with a callback into policy->usage: same bounds admission as the private reader, the standard dimension/identity refusals and PIN= override semantics, and inkling's IKU1 refused by name. Deliberate widening: legacy headerless histories are accepted now, matching the siblings; - hot_engine_id and the hand-rolled parse/serialize/delete loops go away (-91 LOC); - rt_engine_names gains "deepseek_v4", and test_route_trace section 6 now proves the id resolves to the name; - Makefile.deepseek-v4 objects depend on route_trace.h. Not wired, on purpose: per-row ROUTE_TRACE for V4. The amalgam builds one object per COLI_V4_UNIT_*, so the header's statics have exactly one owner (the hot-store unit) and the router lives in other units; rt_init opens the stream, so when ROUTE_TRACE is set a one-line note says the stream will hold no rows instead of silently suggesting it will. Placement only: policy->usage, the pin ranking, the repin cadence and every forward output are untouched; the private and shared formats agree byte for byte, so existing V4 histories carry over.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#700 left one engine out
V4 kept a private
.coli_usagereader/writer after the telemetry unification: same file format hand-duplicated (header records, FNV-1a identity, tmp+rename), but:"deepseek_v4"was never registered inrt_engine_names, so a V4-written history announced itself as "an unknown engine" to every sibling's refusal message;COLI_USAGE_DECAYon save, no legacy-layout path (a stricter dims-record requirement silently dropped headerless histories the siblings accept), and the duplicated loops were one more place for the recurring "landed in one engine, never reached the siblings" defect to live.The change
V4 adopts
route_trace.h, which is also where the next fix in this class reaches V4 automatically:rt_init("deepseek_v4", layers, experts)at hot-store creation;rt_countfeeds the shared counters at each store lookup, next topolicy->usage(same site, same semantics: store lookup == selection);rt_save— cumulative across sessions, same header records byte-for-byte (-1 dims,-2 1 fnv("deepseek_v4")), the standard[STATS]line, andCOLI_USAGE_DECAYnow applies to V4 like everyone else. TheCOLI_V4_SAVE_USAGE=0opt-out is preserved;rt_readwith a callback intopolicy->usage— same bounds admission as the private reader, plus the standard dimension/identity refusals and thePIN=<path>trusted-override semantics its private copy lacked. Existing V4 histories carry over unchanged (formats agree byte for byte);hot_engine_id()and the hand-rolled parse/serialize loops go away (−91 LOC);test_route_tracesection 6 now proves thedeepseek_v4id resolves to its name;Makefile.deepseek-v4objects depend onroute_trace.h.One thing deliberately NOT wired
Per-row
ROUTE_TRACErouting lines stay GLM/K3/Inkling/OLMoE-only. The amalgam builds one object perCOLI_V4_UNIT_*, so the header's statics get a single owner — the hot-store unit — while the router runs in other units.rt_initopens the stream, so whenROUTE_TRACEis set, V4 prints one explicit note that the stream will hold no rows rather than silently suggesting otherwise. Wiring the router units is a clean follow-up for whoever wants V4 in the route-pairs pipeline.