Skip to content

fix(governor): MacIntelMetal variant + correct classify_silicon (task #52) - #1624

Merged
joelteply merged 1 commit into
canaryfrom
fix/governor-classify-silicon-mac-intel
Jun 15, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/governor-classify-silicon-mac-intel

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

Fixes task #52: the governor's classify_silicon was misclassifying Mac Intel hosts (Joel's MacBookPro15,1 with Radeon Pro 555X is the canonical example) as AppleM. The bug keyed on has_metal: true alone, but on Mac Intel has_metal is ALSO true — Apple's Metal driver exposes the discrete AMD GPU.

Misclassification cascaded:

has_metal=true on Mac Intel
  → classify_silicon → AppleM (WRONG)
  → classify_hardware → vram_mb = 0 (UMA branch)
  → tier_configs_for → 4-tier UMA shape (no Warm)

So Joel's host inferred against the wrong governor policy + paging shape, and the 4 GiB of GDDR5 on the Radeon reported as "no VRAM" downstream.

Changes

  1. New TargetSilicon::MacIntelMetal variant (governor/types.rs). Doc names the canonical hardware + tier policy semantics (discrete-GPU shape, not UMA).
  2. classify_silicon differentiates via the platform string's architecture hint. has_metal && platform contains x86_64/intel → MacIntelMetal; has_metal && (arm64 / default) → AppleM. Per task Build(deps-dev): Bump @types/node from 22.14.0 to 22.15.3 #47 the hw_probe already sets the platform string reliably.
  3. Two regression tests in governor::types::tests:
    • mac_intel_classifies_as_mac_intel_metal_not_apple_m — pins the load-bearing TargetSilicon discrimination.
    • mac_intel_preserves_real_vram_mb — pins the downstream side-effect: Joel's machine must report real VRAM, not 0.
  4. policy_selector::silicon_token extended to emit "mac-intel-metal" so policy_file matchers can target this row separately from apple-m for per-deployment tuning.

The vram_mb zeroing branch in classify_hardware is already gated on AppleM explicitly, so MacIntelMetal naturally falls through to the real-VRAM branch — no wire change needed there.

Verified

cargo test -p continuum-core --lib governor::types --features metal,accelerate → 38/38 green on rust 1.95. The two new regression tests each go red if the pre-fix classifier is reverted.

TS-rs consumer note

This adds a new variant to TargetSilicon. TypeScript consumers using exhaustive switch/match on the enum will need a new branch for "mac-intel-metal". That's intentional — the substrate's wire shape extending should force consumers to acknowledge the new hardware class rather than silently fall back to a wrong default.

Test plan

  • CI green (the new continuum-rust-tests workflow from ci(rust): cargo test -p continuum-core --lib on every PR #1616 will gate this if it merges first).
  • Joel's MacBookPro15,1 reports vram_mb: 4096 on next boot (instead of 0).
  • tier_configs_for on that host returns the 5-tier discrete-GPU shape (no longer the UMA 4-tier shape).

🤖 Generated with Claude Code

…52)

`classify_silicon` pre-fix keyed on `has_metal: true` alone and returned
`TargetSilicon::AppleM` for ANY Metal-capable host. But on Mac Intel
chassis (canonical case: Joel's MacBookPro15,1 with Radeon Pro 555X)
`has_metal` is ALSO true — Apple's Metal driver exposes the discrete
AMD GPU. Misclassification cascaded:

  has_metal=true on Mac Intel
    → classify_silicon → AppleM (WRONG)
    → classify_hardware → vram_mb = 0 (UMA branch)
    → tier_configs_for → 4-tier UMA shape (no Warm)

So Joel's host inferred against the wrong governor policy + paging
shape, and the 4 GiB of GDDR5 on the Radeon reported as "no VRAM."

Changes:

1. `TargetSilicon::MacIntelMetal` variant (governor/types.rs). Doc
   names the canonical hardware + tier policy semantics (discrete-GPU
   shape, not UMA).

2. `classify_silicon` differentiates via the platform string's
   architecture hint. `has_metal && platform contains x86_64/intel`
   → MacIntelMetal; `has_metal && (arm64 / default)` → AppleM. Per
   task #47 the hw_probe already sets the platform string reliably.

3. Two regression tests in governor::types::tests:
   - `mac_intel_classifies_as_mac_intel_metal_not_apple_m` — pins
     the load-bearing TargetSilicon discrimination.
   - `mac_intel_preserves_real_vram_mb` — pins the downstream
     side-effect: Joel's machine must report real VRAM, not 0.

4. `policy_selector::silicon_token` extended to emit `"mac-intel-metal"`
   so policy_file matchers can target this row separately from apple-m
   for per-deployment tuning.

Verified: 38/38 governor::types tests green on rust 1.95 with
--features metal,accelerate. The two new regression tests would each
go red if the pre-fix classifier were reverted.

`HardwareClass` already had no UMA-specific field that needed updating;
the vram-zeroing branch in `classify_hardware` is gated on `AppleM`
explicitly, so MacIntelMetal naturally falls through to the real-VRAM
branch.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@joelteply
joelteply force-pushed the fix/governor-classify-silicon-mac-intel branch from 0370d0e to 057970b Compare June 15, 2026 00:50
joelteply added a commit that referenced this pull request Jun 15, 2026
The substrate has Rust types with `#[derive(TS)]` + `#[ts(export_to =
"../../../protocol/typescript/...")]` attributes. `cargo test`
regenerates those .ts files as a side effect of running per-type
`export_bindings_*` tests.

When an author adds a new field or variant to a Rust type but forgets
to commit the regenerated .ts file, the wire shape drifts silently:

  - Mac/Linux dev: cargo test regenerates locally, looks fine, ships
    PR without the .ts in the diff.
  - Reviewer: sees only the Rust change, approves.
  - Downstream TS consumer at runtime: hits the new variant / missing
    field; no compile-time guard fires (the .ts file is stale).

Today's session had a near-miss on continuum #1624 (Mac Intel
classify_silicon fix): TargetSilicon gained the MacIntelMetal variant
but the regenerated `protocol/typescript/governor/TargetSilicon.ts`
was not in the initial push. Had to amend.

Adds `.github/workflows/ts-rs-binding-drift-guard.yml`:
  - triggers on PRs touching Cargo, rust-toolchain, core/**, or
    protocol/typescript/** (a TS edit needs the gate too — it must
    match the Rust source);
  - picks up Rust 1.95 from rust-toolchain.toml (#1614);
  - runs ONLY the `export_bindings_*` tests (cheap — same skip
    patterns as #1616's CI gate so GPU/env-var tests don't sink it);
  - then `git diff --exit-code protocol/typescript/`. Non-empty diff
    means the test run regenerated bindings that the PR did NOT
    commit. Fail with a verbatim fix-recipe in the error log.

Composes with:
  - #1614 toolchain pin (Rust version)
  - #1616 unit-test CI gate (same skip patterns)
  - #1624 (the near-miss this workflow would have caught at CI)

Co-authored-by: Claude Opus 4.7 <[email protected]>
@joelteply
joelteply merged commit b63f8df into canary Jun 15, 2026
2 checks passed
@joelteply
joelteply deleted the fix/governor-classify-silicon-mac-intel branch June 15, 2026 20:06
joelteply added a commit that referenced this pull request Jun 15, 2026
…ary --features metal was broken (#1633)

#1624 added the MacIntelMetal governor variant (Intel Mac w/ Metal GPU, task
#52) but `coordinator_silicon_for`'s match in inference/coordinator.rs wasn't
updated → non-exhaustive patterns → `cargo check -p continuum-core --features
metal,accelerate` FAILED to compile on canary. The Linux CI runs WITHOUT the
metal feature, so it stayed green and the break shipped — the GPU-first build
path was down.

Map MacIntelMetal → TargetSilicon::Gpu (a real Metal-addressable discrete/
integrated GPU, not Apple-silicon UnifiedMemory). Caught by a local --features
metal build on a fresh M5 Pro.

Co-authored-by: Claude Opus 4.8 <[email protected]>
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]>
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