Repository navigation
feat(paging): select_leases_to_revoke — pressure-driven lease revocation classifier - #1613
Conversation
|
🟢 SENTINEL: APPROVE (inspection — Linux cargo validation still required by Mac/CI before merge) I performed a compile-by-inspection + logic review (I cannot build continuum-core on this Windows host — Smart App Control blocks the build scripts, os 4551). I did NOT run cargo; I verified by reading the actual continuum source on this branch. Scope (3-dot merge-base diff against canary): exactly two paging changes — 1. Type correctness — every referenced symbol verified against real source
No type mismatches found. By inspection this compiles. 2. Style guide (CONCURRENCY-STYLE-GUIDE.md)Genuinely pure: no I/O, no locks, no async, no mutation, O(N log N). Mirrors the endorsed 3. Algorithm — ladder is sound, safety invariant holds
4. Tests — validated-by-mutationAll 8 carry a 5. BoundaryCorrect home: this is continuum's CHOICE/allocation layer ( Verdict: APPROVE on inspection. No blocking issues. Per protocol, real |
|
Architecture note (after reading the surrounding code + design doc) — this is complementary to I checked whether this duplicates
This matches One elaboration flagged for design confirmation: I added pressure-tier gating (Warning ⇒ Hard-only; High/Critical ⇒ +Graceful) on top of the doc's plain Hard→Graceful ordering, so mild pressure sheds stale/Hard lanes before disrupting active Graceful holders. That's a reasonable 'escalate disruption with pressure' policy but it's beyond the doc's literal text — happy to simplify to pure ordering if the design prefers. slice 2 wires both together under Still gated on Linux cargo validation (Mac/CI) before merge — Windows-SAC blocks my local build. |
…ion classifier (WIP, pending Linux validation) First continuum realization-priority card: wire ThroughputLease policy into pressure-driven revocation. This slice is the PURE classifier only — `select_leases_to_revoke(leases, footprint_bytes_per_lease, tier, now, target)` mirroring the classify_peer_prune / plan_adaptive_throughput shape the concurrency style guide endorses (no I/O, no locks, no async, no mutation; the broker stays the single decision-maker — no parallel lease revoker). Revocation ladder (least-disruptive first): expired (any policy) → Hard (stale frames) → Graceful (needs holder notify); Pinned never while active. Pressure tier gates how far down the ladder we descend (Normal= expired only, Warning=+Hard, High/Critical=+Graceful). Within a rank, largest-first to hit the target with the fewest revocations. Returns None when the target is unachievable (escalate; never silently revoke a pin). 8 validated-by-mutation unit tests (zero-target, expired-pinned-first, active-pinned-never, tier-gates-graceful, hard-before-graceful, largest- first, unachievable-none, unknown-footprint-skipped). NOTE: written against verified signatures (throughput_lease.rs, broker.rs) but NOT yet locally compiled — BIGMAMA (Windows) hits Smart App Control (os error 4551) on continuum-core's unsigned build scripts. Needs Linux validation (Docker/Mac/CI) before merge. Follow-up slices: wire into PressureBroker::relieve + FootprintRegistry. Co-Authored-By: Claude Opus 4.8 <[email protected]>
ee74c3b to
551587a
Compare
…n stable (#1614) BIGMAMA's dogfood validation on continuum #1613 surfaced toolchain drift: docker/continuum-core{,-vulkan,-cuda}.Dockerfile all pinned rust:1.89-bookworm, but Cargo.lock requires rtc-mdns 0.20.0-alpha.1 which uses `Ipv4Addr::from_octets` (tracking issue #131360). That method only stabilized in a more recent stable; on 1.89 (and 1.90) `cargo build/test -p continuum-core` dies compiling rtc-mdns with E0658. The CPU Dockerfile builds release bins which may resolve features differently in CI, but real `cargo test -p continuum-core` on the project's own pinned toolchain is broken. No `rust-toolchain.toml` existed at the repo root, so cargo picks whatever rustc is on PATH. Joel's Mac (1.95.0 stable) compiles + runs `cargo test -p continuum-core --lib` end-to-end (8/8 green on lease_revocation per the #1613 validation). Pinning to 1.95 guarantees Docker + CI + Joel + BIGMAMA-Windows all agree on the compiler. Changes: - Add `rust-toolchain.toml` at repo root pinning channel "1.95" with rustfmt + clippy components. Doc comment names the failure shape so a future bump knows what to verify. - Bump `docker/continuum-core.Dockerfile` rust:1.89-bookworm → rust:1.95-bookworm - Bump `docker/continuum-core-vulkan.Dockerfile` similarly - Bump `docker/continuum-core-cuda.Dockerfile`: `--default-toolchain 1.89` → `1.95` and the stale "1.89-bookworm" comment Verified: `cargo check -p continuum-core --lib --features metal,accelerate` clean on the pinned 1.95 toolchain (60 warnings, no errors). The rtc-mdns transitive dep compiles fine. Co-authored-by: Claude Opus 4.7 <[email protected]>
…en lease revocation (slice 2) (#1615) * feat(inference): FootprintRegistry::revoke_leases_for — pressure-driven lease revocation (slice 2) Slice 2 of wiring ThroughputLease ↔ FootprintRegistry ↔ PressureBroker. Slice 1 (#1613) landed the pure `select_leases_to_revoke` classifier; this slice gives the FootprintRegistry the realization that actually reclaims footprint under pressure — the pressure-driven sibling of the clock-driven `expire_leases`. `revoke_leases_for(target_bytes, pressure_tier, now_ms) -> Option<LeaseRevocationOutcome>`: snapshots the live lease mirrors, picks the least-disruptive plan via the pure `select_leases_to_revoke` (expired → Hard → Graceful, active Pinned never; tier gates the ceiling), then RELEASES each chosen lease — removing its mirrored footprint so a subsequent `cheapest_eviction_for` pass can reclaim the now-unpinned keys. Returns None when policy can't satisfy the demand (caller escalates; a None pass releases nothing). Design (with Mac, "B-done-right"): the registry owns lease-reclaim mechanics (mirrors `expire_leases`); the PressureBroker stays the single decision-maker and will call this in phase 2 of `relieve()` (slice 3). Pool eviction stays dumb. No new tokio task / channel / pressure source — honors CONCURRENCY-STYLE-GUIDE. Validated on rust:1.95 (continuum-core --lib): 13 tests pass (5 new revoke_* + 8 slice-1 lease_revocation), CARGO_EXIT=0, clean compile. The 5 new tests cover: complementarity with key-eviction (reclaims an expired-Pinned lease that cheapest_eviction_for strands), pinned-safety (None releases nothing), tier-gating in the realization path, subset-only release, and zero-target no-op. Co-Authored-By: Claude Opus 4.8 <[email protected]> * chore(inference): drop redundant test-mod PressureTier import (reviewer nit, #1615) Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
…e single disruption_rank (slice 3) (#1617) * refactor(inference): collapse coordinator's revocation ladder onto the single disruption_rank (slice 3) The revocation ladder (expired → Hard → Graceful, never an active Pinned lane) was defined TWICE: once in `paging/lease_revocation::disruption_rank` (slice 1 #1613, read from `lease.revocation_policy`, consumed by `select_leases_to_revoke`), and again as a parallel inline `fn tier(class)` in `InferenceCoordinator::evict_under_pressure` (mapping `LaneClass`→tier). Compression-principle violation: one policy, two encodings that can drift. Collapse them onto the single definition: - `disruption_rank` is now `pub` — THE shared ladder. - `evict_under_pressure` builds candidates via `disruption_rank(lane.lease(), now_ms)?` (None = active Pinned → filtered out), sorts by (rank, acquired_at_ms), and derives `EvictionReason` from rank. The inline `tier()` and the separate Realtime-skip are gone. Behavior-preserving: `open_lane` sets `revocation_policy: class.revocation_policy()` (Realtime→Pinned, Interactive→Graceful, Background|Sentinel→Hard), and `lane.is_expired` delegates to `lease.is_expired`, so the ranks are identical to the former inline tier(). The coordinator keeps its own SELECTION STRATEGY (oldest-first, ungated, lane-aware side effects) on top of the shared ladder — distinct from `select_leases_to_revoke`'s broker-style strategy (largest-first, PressureTier-gated). One ladder, two strategies. Validated rust:1.95 (continuum-core --lib): 46 tests pass (full inference::coordinator + lease_revocation suites), CARGO_EXIT=0, behavior unchanged. Co-Authored-By: Claude Opus 4.8 <[email protected]> * chore(inference): drop now-dead EvictCandidate.class field (reviewer nit, #1617) The event/EvictedLane payloads re-fetch lane.class() after lanes.remove; the candidate field is vestigial post-ladder-collapse. Removes the 'field class is never read' warning. Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
Today's session (2026-06-14) opened the first continuum realization cards on canary — #1613 (lease-revocation classifier) + #1614 (rust toolchain pin). In doing so we discovered NO existing CI workflow runs `cargo test` against continuum-core. `docker-images.yml` builds release bins via cargo-chef (compiles but never executes tests). `carl-install-smoke.yml` exercises the install flow end-to-end. The Rust unit-test surface was entirely unguarded — every Rust PR before #1613 was inspection-verified rather than test-verified. Adds `.github/workflows/continuum-rust-tests.yml` with the minimum gate: - triggers on PRs that touch Cargo.{toml,lock}, rust-toolchain.toml, core/**, or this workflow itself, plus pushes to canary/main; - checks out with submodules: recursive (the llama.cpp + whisper.cpp prereq BIGMAMA hit during Docker self-validation today); - picks up Rust 1.95 from rust-toolchain.toml (PR #1614); - installs the same -dev deps continuum-core.Dockerfile uses; - caches cargo registry + target/ keyed on Cargo.lock with restore-key fallback (cold build ≈ 3-6 min, warm ≈ <1 min); - runs `cargo test -p continuum-core --lib` with default features (Linux-CPU-only, no metal/cuda); - 30-min timeout safety bound; - concurrency group cancels prior runs on the same PR head. `--lib` is the minimum scope. Integration tests + apps/cli + workers binaries can join in follow-up workflows once this one proves stable. The substrate doctrine the dogfood loop surfaced today: validation is infrastructure, not an operator concern. A test that doesn't run in CI is a documentation comment. Co-Authored-By: Claude Opus 4.7 <[email protected]>
* ci(rust): cargo test -p continuum-core --lib on every PR Today's session (2026-06-14) opened the first continuum realization cards on canary — #1613 (lease-revocation classifier) + #1614 (rust toolchain pin). In doing so we discovered NO existing CI workflow runs `cargo test` against continuum-core. `docker-images.yml` builds release bins via cargo-chef (compiles but never executes tests). `carl-install-smoke.yml` exercises the install flow end-to-end. The Rust unit-test surface was entirely unguarded — every Rust PR before #1613 was inspection-verified rather than test-verified. Adds `.github/workflows/continuum-rust-tests.yml` with the minimum gate: - triggers on PRs that touch Cargo.{toml,lock}, rust-toolchain.toml, core/**, or this workflow itself, plus pushes to canary/main; - checks out with submodules: recursive (the llama.cpp + whisper.cpp prereq BIGMAMA hit during Docker self-validation today); - picks up Rust 1.95 from rust-toolchain.toml (PR #1614); - installs the same -dev deps continuum-core.Dockerfile uses; - caches cargo registry + target/ keyed on Cargo.lock with restore-key fallback (cold build ≈ 3-6 min, warm ≈ <1 min); - runs `cargo test -p continuum-core --lib` with default features (Linux-CPU-only, no metal/cuda); - 30-min timeout safety bound; - concurrency group cancels prior runs on the same PR head. `--lib` is the minimum scope. Integration tests + apps/cli + workers binaries can join in follow-up workflows once this one proves stable. The substrate doctrine the dogfood loop surfaced today: validation is infrastructure, not an operator concern. A test that doesn't run in CI is a documentation comment. Co-Authored-By: Claude Opus 4.7 <[email protected]> * ci(rust): skip GPU + env-var-required tests on Linux CI First CI run on this PR exposed ~20 continuum-core unit tests that have never run on a Linux-CI runner before this workflow existed: GPU-required (need real GPU + driver): - gpu::memory_manager::tests::test_detect_returns_nonzero - modules::gpu::tests::* (13 tests) Env-var-required (assert behavior contingent on ANTHROPIC_API_KEY etc): - persona::allocator::tests::test_allocate_with_anthropic_key - modules::persona_allocator::tests::* (4 tests) These have never been false-positives — they catch real environment preconditions. They have just never been gated by feature flag or hidden-by-default annotation, so until someone built CI for cargo test they shipped as "ignored by virtue of nobody running them." This patch skips them by name pattern with --skip so the gate ships as the baseline (≈4000 other tests CONTINUE to run + protect every PR). Each skipped pattern is a follow-up: - task #221: persona_allocator → test-fixtures shim - new follow-up: gpu::* behind a feature flag The skip is named and inline-documented, not stealthy. Future PRs that ADD a real GPU/env-var test will hit the skip pattern and need to either fix the gate or graduate the test to a separate workflow that provides the prerequisite. Co-Authored-By: Claude Opus 4.7 <[email protected]> --------- Co-authored-by: Claude Opus 4.7 <[email protected]>
First continuum realization card — the lease↔pressure wiring (slice 1: the pure classifier)
Realization-priority #1 from the substrate map:
ThroughputLease,FootprintRegistry, andPressureBrokerexist but aren't connected — pressure evicts pool pages without consulting lease policy. This slice is the pure decision half: "under THIS pressure, which leases should we revoke to freetarget_bytes, respecting each lease's revocation policy?"A pure classifier (
core/continuum-core/src/paging/lease_revocation.rs), deliberately mirroringclassify_peer_prune/plan_adaptive_throughput— no I/O, no locks, no async, no mutation. The broker stays the single decision-maker (no parallel lease-revoker — a forbidden move per the concurrency style guide).Revocation ladder (least-disruptive first): expired (any policy, holder gone) →
Hard(stale frames) →Graceful(needs notify);Pinnednever while active. Pressure tier gates how far down (Normal=expired-only, Warning=+Hard, High/Critical=+Graceful). Within a rank, largest-first to hit the target with fewest revocations.Nonewhen unachievable (escalate — never silently revoke a pin).8 validated-by-mutation unit tests.
Validation note
cargo test -p continuum-core --lib lease_revocation --no-default-features). Do not merge until green.Follow-up slice 2: wire
select_leases_to_revokeintoFootprintRegistryeviction underPressureBroker::relieve.🤖 Generated with Claude Code