Skip to content

feat(governor): TierConfig + tier_configs_for — first realization slice (priority #3) - #1618

Merged
joelteply merged 1 commit into
canaryfrom
feat/governor-tier-configs-for
Jun 15, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/governor-tier-configs-for

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

First realization slice on the SubstrateGovernor lane (realization-priority #3, per BIGMAMA's deconflict). GENOME-FOUNDRY-SENTINEL.md Part 2 prescribes a per-hardware-class Vec<TierConfig> — discrete-GPU emits five entries (Fast/Warm/Bench/Cold/Frozen), UMA emits four (no Warm). The Rust code is identical across hardware; only the vec shape varies.

This is the substrate's hardware-portability spine: subsystems address tiers by role, never by ordinal, and the type system makes "Fast→Warm eviction on UMA" structurally impossible because there is no Warm entry on UMA.

Scope

This slice adds the SHAPE with the structural-absence invariant locked at the type/test level. It deliberately does NOT:

  • change GovernorPolicy (keeps the legacy tier_sizes: TierSizes for now — converting GovernorPolicy is a follow-up slice once consumers can read TierConfig);
  • change downstream consumers;
  • bake real capacity numbers (configured_limit = 0 across the board — TOML loading fills this in a follow-up).

Numbers without the shape are premature; the shape without the numbers is correct.

Changes

core/continuum-core/src/genome/tier.rs:

  • New pub struct TierConfig { role, capacity, eviction } with ts-rs export. The backing field is deferred to the next slice (when TierStore handles thread through).
  • New pub fn tier_configs_for(hw: &HardwareClass) -> Vec<TierConfig>. UMA is keyed via hw.vram_mb == 0 — the existing implicit contract from classify_hardware, documented inline so a future PR that promotes uma: bool to a HardwareClass field doesn't silently invert this.
  • 5 regression tests pinning the load-bearing invariants:
    • tier_configs_for_uma_has_no_warm — 4 entries, no Warm, Fast first / Frozen last
    • tier_configs_for_discrete_has_warm — 5 entries in canonical order
    • tier_configs_for_uses_canonical_eviction_policy_per_role — every emitted config carries EvictionPolicy::canonical_for(role)
    • tier_configs_for_emits_zero_capacity_until_policy_file_loads — "shape, not numbers" gate
    • tier_configs_for_addressable_by_role_uniformly_across_hardware — substrate-doctrine smoke: same role lookup works on both hardware classes despite different vec lengths

Verified

cargo test -p continuum-core --lib tier_configs --features metal,accelerate → 5/5 green on rust 1.95 (Mac). cargo fmt clean.

Compose

Lands the "shape" half of realization-priority #3 (SubstrateGovernor). Next slices:

  1. Wire TierConfig into GovernorPolicy (replace / supplement tier_sizes: TierSizes).
  2. policy_file TOML loader fills real configured_limit from the per-hardware anchor numbers in the doc (M2 Air: Fast=2 LoRA layers + 2k KV tokens; 5090: Fast=8+16k; etc.).
  3. Thread TierBackingRef into TierConfig once TierStore handles exist.

Independent of BIGMAMA's slice-3 (PressureBroker::relieve() phase-2 with revoke_leases_for) and the coordinator/lease-revocation reconcile lane. No overlap in touched files.

Test plan

  • CI green on continuum-rust-tests workflow (assumes ci(rust): cargo test -p continuum-core --lib on every PR #1616 has landed; otherwise relies on adversarial review).
  • Follow-up slice can pick up TierConfig and wire it into GovernorPolicy.
  • A future PR that promotes uma: bool to a HardwareClass field updates tier_configs_for to use it directly (the inline comment names this).

🤖 Generated with Claude Code

…ce (priority #3)

GENOME-FOUNDRY-SENTINEL.md Part 2 prescribes a per-hardware-class
`Vec<TierConfig>` — discrete-GPU emits five entries
(Fast/Warm/Bench/Cold/Frozen), UMA emits four (no Warm). The Rust code
is identical across hardware; only the vec shape varies. This is the
substrate's hardware-portability spine: subsystems address tiers by
role, never by ordinal, and the type system makes "Fast→Warm eviction
on UMA" structurally impossible because there is no Warm entry on UMA.

This slice adds the shape with the structural-absence invariant
locked at the type/test level. It does NOT change `GovernorPolicy`,
does NOT change downstream consumers, and intentionally leaves
`configured_limit = 0` across the board — real capacity numbers come
from policy_file TOML loading in a follow-up slice. Numbers without
the shape are premature; the shape without the numbers is correct.

Changes:
- `core/continuum-core/src/genome/tier.rs`:
  - new `pub struct TierConfig { role, capacity, eviction }` with
    ts-rs export. `backing` field deferred to the next slice (when
    TierStore handles thread through).
  - new `pub fn tier_configs_for(hw: &HardwareClass) -> Vec<TierConfig>`
    that keys UMA via `hw.vram_mb == 0` (the existing implicit
    contract from `classify_hardware`, documented inline so a future
    PR that promotes `uma: bool` to a HardwareClass field doesn't
    silently invert this).
  - 5 regression tests pinning the load-bearing invariants:
    * `tier_configs_for_uma_has_no_warm` — 4 entries, no Warm
    * `tier_configs_for_discrete_has_warm` — 5 entries in canonical
      order
    * `tier_configs_for_uses_canonical_eviction_policy_per_role`
    * `tier_configs_for_emits_zero_capacity_until_policy_file_loads`
      — "shape, not numbers" gate
    * `tier_configs_for_addressable_by_role_uniformly_across_hardware`
      — substrate-doctrine smoke: same role lookup works on both
      hardware classes despite different vec lengths

Verified: 5/5 tier_configs tests green on rust 1.95 (Mac, --features
metal,accelerate); cargo fmt clean.

Compose: this lands the "shape" half of realization-priority #3
(SubstrateGovernor) — the next slices wire TierConfig into
GovernorPolicy and load real capacity bytes from the policy_file TOML.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@joelteply

Copy link
Copy Markdown
Contributor Author

Adversarial peer review (BIGMAMA): APPROVE-WITH-NITS — clean, well-scoped, GENOME-FOUNDRY-SENTINEL Part 2 contract honored, tests pin the load-bearing UMA-omits-Warm invariant. Compiles by inspection, genome→governor dep is acyclic. Findings:

  • F1 [MED] missing re-export. TierConfig + tier_configs_for added to tier.rs but NOT in genome/mod.rs's pub use tier::{...} barrel — every adjacent public type is surfaced there. Add them so callers (incl. my coordinator wiring) use genome::tier_configs_for not the full path.
  • F2 [LOW/MED] compression: UMA-omits-Warm encoded twice. TierRole::is_present_on_uma() already exists as the single source; tier_configs_for hardcodes two &[TierRole] arrays instead. Derive the UMA set from the helper ([Fast,Warm,Bench,Cold,Frozen].filter(|r| !is_uma || r.is_present_on_uma())) so it can't drift.
  • F3 [MED] CPU-only (TargetSilicon::None) silently gets the UMA 4-tier config. is_uma = hw.vram_mb == 0 also matches a GPU-less host (classify_hardware → None, vram 0). That's the exact CPU/Mac-floor smell Joel flagged on MY coordinator. Branch on hw.silicon == AppleM (the honest signal) and make None an explicit empty/Err, + a test. Same fix applies on both our sides.
  • F4/F5: nits (canonical_for(Warm) never exercised on UMA = intentional; cosmetic ts-rs reflow).

Tests are substantive (len+absence+order, policy mapping, zero-capacity guard, by-role uniformity), one #[cfg(test)] mod, local fixtures — compliant. Gap: no None/CPU-only test (F3).

Integration note for our lane intersection: to retire my UnifiedMemory coordinator default I'll consume classify_hardware(&profile).silicon (already on canary + tested — yields NvidiaCuda on the 5090) and add a From<governor::TargetSilicon> for cognition::TargetSilicon (AppleM→UnifiedMemory, NvidiaCuda/AmdRocm/IntelVulkan→Gpu, None→Cpu-or-Err). That bridge is net-new code I own at the seam — building it now, so #1618 and my wiring are independent. Nice work — fix F1+F3 and I'd merge.

joelteply added a commit that referenced this pull request Jun 15, 2026
…ifiedMemory CPU-floor default (#1628)

* feat(inference): coordinator detects hardware silicon — retire the UnifiedMemory CPU-floor default

Joel flagged the InferenceCoordinatorModule (#1619) shipping
`TargetSilicon::UnifiedMemory` as the production default — the CPU/Mac-floor
anchoring "GPU or bust" forbids. This wires the coordinator to the
governor's existing hardware detection (Mac's #1335 hw_probe +
classify_hardware, already on canary) so the prod default FOLLOWS the
hardware instead of a hardcoded floor.

- `coordinator_silicon_for(GovernorSilicon) -> TargetSilicon` — the seam
  between governor classification and the lane scheduler: AppleM →
  UnifiedMemory; NvidiaCuda/AmdRocm/IntelVulkan → Gpu; None → Cpu (honest,
  not a silent GPU pretense). (Per Mac's #1618 review: this bridge is the
  net-new code I own at the seam, since the two TargetSilicon enums don't
  share variants.)
- `CoordinatorConfig::for_silicon(silicon)` — canonical floor-shape builder
  retargeted to a silicon class; `realistic_floor_default()` now delegates
  to `for_silicon(UnifiedMemory)` (de-dup); `detected()` =
  probe_hardware_profile → classify_hardware → translate → for_silicon.
- `InferenceCoordinatorModule::with_detected_hardware()` (new production
  constructor) + ipc/mod.rs boot uses it. On the RTX 5090 the coordinator
  now targets `Gpu`; on Apple Silicon, `UnifiedMemory`; GPU-less, `Cpu`.

One-shot startup probe (a few file reads + per-backend FFI) — acceptable per
CONCURRENCY-STYLE-GUIDE. Per-tier budgets stay the realistic-floor numbers
until the governor's policy-file slice refines them; this fixes the SILICON
label, which is what Joel called out.

Validated rust:1.95 (continuum-core --lib): 6 tests pass (translation maps
discrete GPU→Gpu not floor / AppleM→UnifiedMemory / None→Cpu; for_silicon
targets one silicon end-to-end; detected() self-consistent), whole lib
compiles (no inference→governor cycle), CARGO_EXIT=0.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* chore(inference): drop dead with_realistic_floor, fix stale doc + test comment (reviewer nits, #1628)

Co-Authored-By: Claude Opus 4.8 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
@joelteply
joelteply merged commit f678c44 into canary Jun 15, 2026
2 checks passed
@joelteply
joelteply deleted the feat/governor-tier-configs-for branch June 15, 2026 20:06
joelteply added a commit that referenced this pull request Oct 31, 2026
Card 2a0d34cf: land the identity custody fix in base.

762adeb2 is the airc canary head + the read-never-mints identity
custody fix (fix/read-never-mints-identity, card 4b2dbdf3): a READ of
the work board on a named home no longer silently mints and overwrites
a citizen's identity.key; init --as mints explicitly.

Bumps every workspace pin in Cargo.toml [workspace.dependencies]
(airc-core, airc-blobs, airc-protocol, airc-ipc, airc-bus, airc-lib,
airc-wire, airc-trust, airc-work) and re-resolves Cargo.lock to the new
rev (15 lock entries).

This rev already carries #1623 (sealed progress / terminal reply
lifecycle, which satisfied the c7083d04 BLOCKED note) plus #1618, #1624,
#1630, #1633, #1635 on top.

Suite status: airc suite green at 762adeb2 (identity_commands 10/10,
airc-identity unit+doc). continuum suite re-run follows against this pin.
joelteply added a commit that referenced this pull request Nov 3, 2026
…y grant clears through

Three airc commits: #1630 adds `cambrian-flex` (ONE-BUDGET slice 1; its first continuum user, the
turn's allocation, follows), #1618 hook catch-up from an ORM index, #1624 one daemon initializer
before store access.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Nov 3, 2026
…y grant clears through (#5728)

* airc pin d26713b -> 38a22ab: adopt cambrian-flex, the one solver every grant clears through

Three airc commits: #1630 adds `cambrian-flex` (ONE-BUDGET slice 1; its first continuum user, the
turn's allocation, follows), #1618 hook catch-up from an ORM index, #1624 one daemon initializer
before store access.

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

* Cargo.lock: only the airc packages move (d26713b -> 38a22ab) plus their new fs2 edge; canary's windows-sys/windows-core edges kept (Cormac on #5728)

cargo update -p <airc crates> re-pointed eleven unrelated crates' windows-sys edges (0.61.2 -> 0.59/0.60)
and iana-time-zone's windows-core (0.58 -> 0.57) even with the MSRV fallback off. The lock is canary's with
only the airc-sourced [[package]] blocks replaced, in place; cargo metadata --locked accepts it.

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]>
joelteply added a commit that referenced this pull request Nov 4, 2026
…rains (the conditions #5743 set) (#5761)

#5743 reverted 38a22ab because airc #1618 derived every row at open and the M5's
residents (1.7-12.8 GB stores) stalled 4-8+ min at boot. Its stated way
forward: airc derives per page, never at open, and every store has a
byte-budgeted, set-based drain. Both are now in airc canary:
- #1654 (76e8e2d, card 70055c76): open is schema only (0.016 s on a copy of
  Paige's 1.55 GB store, against 23.4 s); indexes are built after the drain; a
  read derives nothing and says whether its file was settled; a store this
  binary wrote is settled at open by one index seek.
- #1653 (86b153e, card e95d41a4): each kind declares its retention, and the
  drain runs in bounded windows on its own connection.

Only the nine airc revs and their lock entries move (plus airc-lib's fs2 line);
no other package re-resolves. `cargo check --locked` of continuum-airc-protocol,
airc-test-fixtures, continuum-process and continuum-rooms passes on the new pin.


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

Co-authored-by: Claude Opus 5.5 (1M context) <[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