Skip to content

Sync Mesh request tiers and exact-state retention - #113

Open
i386 wants to merge 17 commits into
codex/native-decode-portfrom
codex/sync-mesh-request-tiers-and-retention
Open

i386 wants to merge 17 commits into
codex/native-decode-portfrom
codex/sync-mesh-request-tiers-and-retention

Conversation

@i386

@i386 i386 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Port request priority, admission and cache partitioning from Mesh #3154 at 7191dbffa. Standalone HTTP listeners keep the default local request class. Embedders can accept classification headers from a trusted upstream that stamps them.
  • Port the exact-state retention and native runtime changes from Mesh #3098 at ea3d3e5c6. The automatic cache limit retains an active conversation working set. An explicit budget keeps the single-snapshot allowance. The port also carries the serving warmup, native sampling and synchronization regressions.
  • Advance the stage protocol to generation 17 with stage-state version 18. Upgrade split peers together. Preserve standalone split planning and the existing recipe-bound certification roster.

This PR is stacked on Skippy #9 at 1ebce5e. The stack preserves the conditional GPU result fence from Mesh #3098 and the per-window sampling index from #9.

The review diff contains the Mesh port and the native patch reconciliation. Updating the stack from 48a8e9f to 452361e preserved its source tree exactly.

Validation before stacking

  • All-target workspace check, warning-denying Clippy, formatting, and whitespace checks passed.
  • Full affected-crate suites passed 2462 tests, including the trusted HTTP tier regression and exact-state cache retention cases. The default run left 38 opt-in tests ignored.
  • All 143 native patches replayed directly on the pinned llama.cpp revision. The LLVM 22 binding freshness and mutation checks and generated native API reference check passed.
  • Metal fixture generation and the async state, Qwen3.5 recurrent retention, and concurrent Gemma sampling contracts passed (six CTest cases).
  • The inference, automation and release contract suites passed (32 checks).

GitHub CI and the repository's cache and scheduler performance comparisons are pending.

Stacked validation

  • All 153 native patches replayed directly and matched the resolved native tree.
  • All-target workspace check, warning-denying Clippy, and LLVM 22 binding freshness and mutation checks passed.
  • Twelve focused Metal test cases passed, including asynchronous state, shared verification rollback, sampling history, and concurrent sampling.
  • Full affected-crate suites passed 2,481 tests. Thirty-eight opt-in tests were ignored. The generated native API reference check passed.
  • GitHub CI for the stacked head is pending.

CI image repair

Stacked PR CI inherited references to the retired ghcr.io/general-inference/skippy-ci-* namespace. The quality job in the failed run was denied before it could execute checks. The affected compiler image references now use ghcr.io/mesh-llm/skippy-ci-*, matching the repository’s published images.

CI image validation

actionlint .github/workflows/ci.yml, node --test .github/scripts/*.test.cjs, and SKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just automation-contracts passed locally. These validate workflow syntax and offline contracts; fresh package and hardware checks remain pending in CI.

Workflow diagrams

The diagrams compare the live target branch with the proposed .github/workflows/ci.yml. Arrows show job dependencies; CPU-to-backend CLI artifact handoffs are labeled. Qualification/publication outside this workflow remains separately gated.

Before

flowchart TD
  trigger["pull_request, push, schedule, workflow_dispatch, workflow_call"]
  changes["Select checks by path"]
  plan["Validate build targets"]
  quality["Quality canary: Mesh-LLM image"]
  native_contracts["Check llama.cpp Graph Contracts, patches, and API docs"]
  package_darwin_aarch64_cpu["Build, package, and smoke · macOS ARM64 CPU"]
  package_darwin_aarch64_metal["Build, package, and smoke · macOS ARM64 Metal"]
  package_linux_x86_64_cpu["Build, package, and smoke · Linux x64 CPU"]
  package_linux_x86_64_cuda12["Build, package, and smoke · Linux x64 CUDA 12: Mesh-LLM image"]
  release_smoke_linux_x86_64_cuda12["Release GPU smoke · Linux x64 CUDA 12"]
  package_linux_x86_64_cuda13["Build, package, and smoke · Linux x64 CUDA 13"]
  package_linux_aarch64_cpu["Build, package, and smoke · Linux ARM64 CPU"]
  package_linux_aarch64_cuda12["Build, package, and smoke · Linux ARM64 CUDA 12: Mesh-LLM image"]
  release_smoke_linux_aarch64_cuda12["Release GPU smoke · Linux ARM64 CUDA 12"]
  package_linux_aarch64_cuda13["Build, package, and smoke · Linux ARM64 CUDA 13: Mesh-LLM image"]
  release_smoke_linux_aarch64_cuda13["Release GPU smoke · Linux ARM64 CUDA 13"]
  gate["gate"]
  trigger --> changes
  changes --> plan
  changes --> quality
  plan --> quality
  plan --> native_contracts
  quality --> native_contracts
  plan --> package_darwin_aarch64_cpu
  quality --> package_darwin_aarch64_cpu
  plan --> package_darwin_aarch64_metal
  quality --> package_darwin_aarch64_metal
  package_darwin_aarch64_cpu -->|CLI artifact| package_darwin_aarch64_metal
  changes --> package_darwin_aarch64_metal
  plan --> package_linux_x86_64_cpu
  quality --> package_linux_x86_64_cpu
  plan --> package_linux_x86_64_cuda12
  quality --> package_linux_x86_64_cuda12
  package_linux_x86_64_cpu -->|CLI artifact| package_linux_x86_64_cuda12
  package_linux_x86_64_cuda12 --> release_smoke_linux_x86_64_cuda12
  plan --> package_linux_x86_64_cuda13
  quality --> package_linux_x86_64_cuda13
  package_linux_x86_64_cpu -->|CLI artifact| package_linux_x86_64_cuda13
  changes --> package_linux_x86_64_cuda13
  plan --> package_linux_aarch64_cpu
  quality --> package_linux_aarch64_cpu
  plan --> package_linux_aarch64_cuda12
  quality --> package_linux_aarch64_cuda12
  package_linux_aarch64_cpu -->|CLI artifact| package_linux_aarch64_cuda12
  package_linux_aarch64_cuda12 --> release_smoke_linux_aarch64_cuda12
  plan --> package_linux_aarch64_cuda13
  quality --> package_linux_aarch64_cuda13
  package_linux_aarch64_cpu -->|CLI artifact| package_linux_aarch64_cuda13
  package_linux_aarch64_cuda13 --> release_smoke_linux_aarch64_cuda13
  changes --> gate
  plan --> gate
  quality --> gate
  native_contracts --> gate
  package_darwin_aarch64_cpu --> gate
  package_darwin_aarch64_metal --> gate
  package_linux_x86_64_cpu --> gate
  package_linux_x86_64_cuda12 --> gate
  package_linux_x86_64_cuda13 --> gate
  package_linux_aarch64_cpu --> gate
  package_linux_aarch64_cuda12 --> gate
  package_linux_aarch64_cuda13 --> gate
  release_smoke_linux_x86_64_cuda12 --> gate
  release_smoke_linux_aarch64_cuda12 --> gate
  release_smoke_linux_aarch64_cuda13 --> gate
Loading

After

flowchart TD
  trigger["pull_request, push, schedule, workflow_dispatch, workflow_call"]
  changes["Select checks by path"]
  plan["Validate build targets"]
  quality["Quality canary: Mesh-LLM image"]
  native_contracts["Check llama.cpp Graph Contracts, patches, and API docs"]
  package_darwin_aarch64_cpu["Build, package, and smoke · macOS ARM64 CPU"]
  package_darwin_aarch64_metal["Build, package, and smoke · macOS ARM64 Metal"]
  package_linux_x86_64_cpu["Build, package, and smoke · Linux x64 CPU"]
  package_linux_x86_64_cuda12["Build, package, and smoke · Linux x64 CUDA 12: Mesh-LLM image"]
  release_smoke_linux_x86_64_cuda12["Release GPU smoke · Linux x64 CUDA 12"]
  package_linux_x86_64_cuda13["Build, package, and smoke · Linux x64 CUDA 13"]
  package_linux_aarch64_cpu["Build, package, and smoke · Linux ARM64 CPU"]
  package_linux_aarch64_cuda12["Build, package, and smoke · Linux ARM64 CUDA 12: Mesh-LLM image"]
  release_smoke_linux_aarch64_cuda12["Release GPU smoke · Linux ARM64 CUDA 12"]
  package_linux_aarch64_cuda13["Build, package, and smoke · Linux ARM64 CUDA 13: Mesh-LLM image"]
  release_smoke_linux_aarch64_cuda13["Release GPU smoke · Linux ARM64 CUDA 13"]
  gate["gate"]
  trigger --> changes
  changes --> plan
  changes --> quality
  plan --> quality
  plan --> native_contracts
  quality --> native_contracts
  plan --> package_darwin_aarch64_cpu
  quality --> package_darwin_aarch64_cpu
  plan --> package_darwin_aarch64_metal
  quality --> package_darwin_aarch64_metal
  package_darwin_aarch64_cpu -->|CLI artifact| package_darwin_aarch64_metal
  changes --> package_darwin_aarch64_metal
  plan --> package_linux_x86_64_cpu
  quality --> package_linux_x86_64_cpu
  plan --> package_linux_x86_64_cuda12
  quality --> package_linux_x86_64_cuda12
  package_linux_x86_64_cpu -->|CLI artifact| package_linux_x86_64_cuda12
  package_linux_x86_64_cuda12 --> release_smoke_linux_x86_64_cuda12
  plan --> package_linux_x86_64_cuda13
  quality --> package_linux_x86_64_cuda13
  package_linux_x86_64_cpu -->|CLI artifact| package_linux_x86_64_cuda13
  changes --> package_linux_x86_64_cuda13
  plan --> package_linux_aarch64_cpu
  quality --> package_linux_aarch64_cpu
  plan --> package_linux_aarch64_cuda12
  quality --> package_linux_aarch64_cuda12
  package_linux_aarch64_cpu -->|CLI artifact| package_linux_aarch64_cuda12
  package_linux_aarch64_cuda12 --> release_smoke_linux_aarch64_cuda12
  plan --> package_linux_aarch64_cuda13
  quality --> package_linux_aarch64_cuda13
  package_linux_aarch64_cpu -->|CLI artifact| package_linux_aarch64_cuda13
  package_linux_aarch64_cuda13 --> release_smoke_linux_aarch64_cuda13
  changes --> gate
  plan --> gate
  quality --> gate
  native_contracts --> gate
  package_darwin_aarch64_cpu --> gate
  package_darwin_aarch64_metal --> gate
  package_linux_x86_64_cpu --> gate
  package_linux_x86_64_cuda12 --> gate
  package_linux_x86_64_cuda13 --> gate
  package_linux_aarch64_cpu --> gate
  package_linux_aarch64_cuda12 --> gate
  package_linux_aarch64_cuda13 --> gate
  release_smoke_linux_x86_64_cuda12 --> gate
  release_smoke_linux_aarch64_cuda12 --> gate
  release_smoke_linux_aarch64_cuda13 --> gate
Loading

Native cache validation

The v1 shared Cargo/sccache inputs omitted the native patch recipe, allowing native artifacts from another source tree to be reused. Ported main’s source-bound dependency/extra-file identity and cold-build directory fix. Native patch edits/removals now invalidate dependency caches; Rust-only changes retain their permitted dependency reuse.

SKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just automation-contracts and git diff --check passed on macOS ARM64, including the native-cache regressions. Fresh model/device qualification is pending on the new head.

CI repair validation — 8cc6b12551b6f765511d8820d3ba4232d875dd5e

Refreshed the native parent and main cc2a27435e798649a9cb938d600d39722e4a2263, including qualification deadlines, verified formation peers/listeners and cold-runner patch replay. Native ABI 0.1.90, bindings, generated API reference and recipe identity agree with llama.cpp 5bacb7c868a2bc98682de15f447fc1ce17c9c49c. Runtime archives must be rebuilt for this recipe. The feature’s request-tier wire/header contract is preserved.

The focused async-state contract exposed an interaction between the branch's fence-accounting change and main's loader/accounting patch: the merged decode path incremented the queued-token count twice. Core patch 0071 now counts the new batch once, after prior output and scheduler synchronization. This preserves the preceding batch's accounting and avoids attributing new work to an older fence.

Updated the sampler-detach regression to the pinned upstream contract: removing an attached sampler invalidates its graph and reserves once; repeating removal of an absent sampler is a no-op. The test continues to check attachment, replacement and pooled-embedding accounting; no runtime guard was disabled. Native ABI remains 0.1.90 and the recipe identity was regenerated.

Validation after this correction: text-only application of the new patch after the previously verified 176-patch cold replay passed; LLAMA_STAGE_BACKEND=cpu just native-contract-build passed against that separate native checkout; the native skippy_async_state_contracts plus both generated synthetic fixtures passed (3/3); LLAMA_STAGE_BACKEND=cpu just skippy-ffi-bindgen-check passed; and SKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just ci-automation passed. The earlier full Rust check/lint/test gates cover the unchanged Rust feature code; this follow-up changes native implementation/test code and recipe data. LLAMA_STAGE_BACKEND=cpu just --command cargo test -p skippy-api also passed after the final recipe correction. The earlier full Rust gates include both workspaces, warning-denying all-target Clippy and integration/doc/native facade tests. All-workflow actionlint passed with narrow local 1.7.12 exceptions for documented GitHub cache-mode and queue: max keys; repository lint rules were retained. Fresh exact-head full CI and real-model/device qualification remain pending. Contributor declarations remain unchanged.

Split preparation rendezvous repair

The follow-up to main's peer lifecycle improvements is included at c992ceb6424673071acce8edecced6c57fc43845. The failed #239 split attempt showed a late-starting peer remained invisible during model admission and stage planning. Control now exposes the matching formation/source/attempt in the preparing phase during those operations. Native-child readiness, listener ownership and completion evidence remain required; timeouts and qualification policy are unchanged.

Validation for this head: git diff --check, just --command env PYTHONPATH=scripts /tmp/skippy-ci-repair/automation-venv312/bin/python scripts/tests/inference_peer.py (12 tests), and SKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just ci-automation all passed. The new real-loopback regression covers both roles and both preparation operations, rejects premature readiness, and verifies cleanup on preparation failure. Exact-head hardware qualification is pending CI.

Acceptance criteria

  • I ran the relevant local checks, or explained why they do not apply.
  • UI changes include screenshots or video, or explain why visual aids are not needed.
  • I agree to license my contributions under the Apache License, Version 2.0.

i386 and others added 2 commits November 21, 2026 14:14
Port the Skippy changes from Mesh-LLM/mesh-llm#3154 (7191dbffa) and Mesh-LLM/mesh-llm#3098 (ea3d3e5c6). Preserve standalone split planning and certification. Require trusted-upstream opt-in for HTTP request class headers.

Co-authored-by: benthecarman <15256660+benthecarman@users.noreply.github.com>
Keep the conditional GPU result fence from Mesh #3098 and the sampled output index from shared verification. Regenerate the verification patch against its new native parent.
@i386
i386 changed the base branch from main to codex/native-decode-port November 21, 2026 03:21
@i386
i386 added this pull request to stack #114 November 21, 2026 03:42
@i386
i386 marked this pull request as ready for review November 21, 2026 03:42
@i386 i386 mentioned this pull request Nov 21, 2026
1 of 2 tasks
@i386
i386 removed this pull request from stack #114 November 21, 2026 03:54
@i386
i386 added this pull request to stack #116 November 21, 2026 03:54
@i386 i386 added the qualify Run real-model inference qualification for this pull request label Nov 21, 2026 — with ChatGPT Codex Connector
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Skippy Lab Qualification: Passed

Commit: c992ceb6424673071acce8edecced6c57fc43845 · PR smoke · Workflow and timings · Saved evidence

Native Spark lab qualification.

Latest successful main: run 45835599636, attempt 1, commit f243a305f497cbe5f897fdbe384235b0a62edf3f. Comparison unavailable: workload inputs changed or could not be verified.

Configuration Outcome Prefill tok/s Prefill vs main Decode tok/s Decode vs main Actions logs
qwen35-4b-standalone Passed 3537.0 Unavailable 64.2 Unavailable Logs
qwen3-coder-30b-a3b-standalone Passed 2886.6 Unavailable 85.1 Unavailable Logs
qwen3-coder-30b-a3b-split Passed 2096.3 Unavailable 54.5 Unavailable Logs
qwen36-35b-a3b-standalone Passed 1976.5 Unavailable 63.7 Unavailable Logs
qwen36-35b-a3b-split Passed 1850.6 Unavailable 38.8 Unavailable Logs
qwen38-flash-next-standalone Passed 726.3 Unavailable 31.1 Unavailable Logs
qwen38-flash-next-split Passed 515.6 Unavailable 25.8 Unavailable Logs

TPS comes from three separate warmed, uncached probes at concurrency 1, each generating exactly 128 tokens. The scored correctness answers and each probe's 64-token warmup are excluded. Each rate is total tokens / total server-reported phase time, not an average of request rates. Client elapsed times and raw responses are retained in throughput-probe.json. These bounded samples are not sustained benchmarks or controlled speedup comparisons. Legacy short-answer receipts and missing or invalid probe evidence show as Unavailable.

Deltas use unrounded rates from matching PR-profile smoke receipts on the latest successful main run, including the nightly smoke evidence. Positive means faster. Changed workload inputs, different serving host classes, unequal phase token counts or missing evidence show Unavailable. Physical Spark placement and runtime conditions can differ; deltas are descriptive, not controlled speedup claims.

Smoke checks cover GPU startup, deterministic endpoint repeats and bounded streaming. They do not establish an AgentX performance score. Nightly history and saved performance baselines are published separately; a saved baseline can be older than the latest successful main run used here. Native build and qualification output streams into each configuration’s Actions log, with per-attempt copies in Saved evidence. Any capture gaps are reported in the log and saved diagnostics. GitHub evidence copies expire after 30 days.

execution/split/plan.rs builds AdmittedStageOptions without the max_request_tier field this branch adds, so skippy-api does not compile (E0063) and both Build, package, and smoke jobs fail. None serves the stamped tier, as the other split initializer in split_execution/direct.rs does.

Signed-off-by: Michael Neale <14976+michaelneale@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 106 files, which is 6 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This organization's CodeRabbit subscription is cancelled. Resubscribe in Billing to continue reviews beyond the free-tier limit.

Check out review usage here.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 77c8ea3c-03ea-44ab-b7f3-d8956ce3975d
Commits

Reviewing files that changed from the base of the PR and between 5fd7a54 and c992ceb.

Files selected for processing: 106

  • crates/skippy-api/src/execution/split/plan.rs
  • crates/skippy-api/src/native-recipe.json
  • crates/skippy-api/src/serving.rs
  • crates/skippy-api/src/split_execution/direct.rs
  • crates/skippy-api/src/stage.rs
  • crates/skippy-api/src/stage_load.rs
  • crates/skippy-cache/README.md
  • crates/skippy-cache/src/identity.rs
  • crates/skippy-cache/src/radix.rs
  • crates/skippy-inference-api/README.md
  • crates/skippy-inference-api/src/anthropic/routes.rs
  • crates/skippy-inference-api/src/anthropic/translate.rs
  • crates/skippy-inference-api/src/backend.rs
  • crates/skippy-inference-api/src/chat/generation.rs
  • crates/skippy-inference-api/src/chat/request_view.rs
  • crates/skippy-inference-api/src/generation/request.rs
  • crates/skippy-inference-api/src/guardrails/compact.rs
  • crates/skippy-inference-api/src/guardrails/mod.rs
  • crates/skippy-inference-api/src/hooks.rs
  • crates/skippy-inference-api/src/lib.rs
  • crates/skippy-inference-api/src/request_tier.rs
  • crates/skippy-inference-api/src/router.rs
  • crates/skippy-inference-api/src/router/generation.rs
  • crates/skippy-inference-api/tests/request_context_wrappers.rs
  • crates/skippy-protocol/README.md
  • crates/skippy-protocol/src/binary/types.rs
  • crates/skippy-protocol/src/config.rs
  • crates/skippy-scheduler/README.md
  • crates/skippy-scheduler/src/cache_policy.rs
  • crates/skippy-scheduler/src/capacity.rs
  • crates/skippy-scheduler/src/engine.rs
  • crates/skippy-scheduler/src/lib.rs
  • crates/skippy-scheduler/src/sequence.rs
  • crates/skippy-serving/src/binary_transport/binary_messaging/public_frontend.rs
  • crates/skippy-serving/src/binary_transport/stage_execution.rs
  • crates/skippy-serving/src/embedded.rs
  • crates/skippy-serving/src/frontend/admission.rs
  • crates/skippy-serving/src/frontend/backend.rs
  • crates/skippy-serving/src/frontend/backend/inference.rs
  • crates/skippy-serving/src/frontend/backend/tests/admission.rs
  • crates/skippy-serving/src/frontend/backend/tier_admission_tests.rs
  • crates/skippy-serving/src/frontend/embedded_generation.rs
  • crates/skippy-serving/src/frontend/embedded_generation/lifecycle.rs
  • crates/skippy-serving/src/frontend/generation.rs
  • crates/skippy-serving/src/frontend/generation/cache_hints.rs
  • crates/skippy-serving/src/frontend/generation/execution.rs
  • crates/skippy-serving/src/frontend/generation/queue.rs
  • crates/skippy-serving/src/frontend/generation/server.rs
  • crates/skippy-serving/src/frontend/generation/service_estimate.rs
  • crates/skippy-serving/src/frontend/generation_flow.rs
  • crates/skippy-serving/src/frontend/iteration_scheduler.rs
  • crates/skippy-serving/src/frontend/iteration_scheduler/cache_runtime.rs
  • crates/skippy-serving/src/frontend/iteration_scheduler/direct_batch/coalescing_tests.rs
  • crates/skippy-serving/src/frontend/iteration_scheduler/tests.rs
  • crates/skippy-serving/src/frontend/local_generation/tests/recurrent_fixture.rs
  • crates/skippy-serving/src/frontend/local_generation/token_generation.rs
  • crates/skippy-serving/src/frontend/local_generation/token_generation/cache_prefill.rs
  • crates/skippy-serving/src/frontend/native_mtp/verify_window.rs
  • crates/skippy-serving/src/frontend/prefix_cache.rs
  • crates/skippy-serving/src/frontend/prefix_cache/split_restore.rs
  • crates/skippy-serving/src/frontend/system_one/causal.rs
  • crates/skippy-serving/src/frontend/system_one/causal/cache.rs
  • crates/skippy-serving/src/frontend/system_one/causal/preparation.rs
  • crates/skippy-serving/src/frontend/system_one/causal/sequence.rs
  • crates/skippy-serving/src/frontend/tests/enc_dec_lane_admission.rs
  • crates/skippy-serving/src/frontend/tests/generation.rs
  • crates/skippy-serving/src/frontend/tests/support.rs
  • crates/skippy-serving/src/frontend/tests/wire_messages.rs
  • crates/skippy-serving/src/frontend/wire_messages.rs
  • crates/skippy-serving/src/kv_integration/cache_affinity.rs
  • crates/skippy-serving/src/kv_integration/config.rs
  • crates/skippy-serving/src/kv_integration/config/exact_state_limits.rs
  • crates/skippy-serving/src/kv_integration/config/exact_state_retention.rs
  • crates/skippy-serving/src/kv_integration/config/runtime_identity.rs
  • crates/skippy-serving/src/kv_integration/config/tests/exact_state_retention.rs
  • crates/skippy-serving/src/kv_integration/config/tests/reserved_admission.rs
  • crates/skippy-serving/src/kv_integration/exact_state.rs
  • crates/skippy-serving/src/kv_integration/exact_state/resident_preference/tests.rs
  • crates/skippy-serving/src/kv_integration/exact_state_record_queue_tests.rs
  • crates/skippy-serving/src/kv_integration/l2_serving.rs
  • crates/skippy-serving/src/kv_integration/mod.rs
  • crates/skippy-serving/src/kv_integration/records.rs
  • crates/skippy-serving/src/kv_integration/resident_prefill_tests.rs
  • crates/skippy-serving/src/kv_integration/resident_prefix.rs
  • crates/skippy-serving/src/kv_integration/resident_prefix/recording.rs
  • crates/skippy-serving/src/kv_integration/tier_metrics.rs
  • crates/skippy-serving/src/lib.rs
  • crates/skippy-serving/src/runtime_state.rs
  • crates/skippy-serving/src/runtime_state/lane_lifecycle.rs
  • crates/skippy-serving/src/runtime_state/lane_lifecycle/tests/generation_warmup.rs
  • crates/skippy-serving/src/runtime_state/model_content.rs
  • crates/skippy-serving/src/stage_request_class.rs
  • docs/CAUSAL_DECISIONS.md
  • docs/DATA_FLOW.md
  • llama_cpp/patches/0002-feat-skippy-realize-admitted-stages-from-live-graphs.patch
  • llama_cpp/patches/0003-feat-llama-integrate-live-stage-planning-and-executi.patch
  • llama_cpp/patches/0006-test-skippy-cover-live-graph-and-state-contracts.patch
  • llama_cpp/patches/0010-feat-skippy-read-selected-token-scores-in-causal-bat.patch
  • llama_cpp/patches/0022-skippy-report-native-trace-spans-and-GPU-command-tim.patch
  • llama_cpp/patches/0023-skippy-sample-a-batch-s-requests-concurrently.patch
  • llama_cpp/patches/0055-skippy-preserve-loader-progress-and-position-contracts.patch
  • llama_cpp/patches/0062-feat-skippy-share-target-forwards-across-speculative.patch
  • llama_cpp/patches/0071-skippy-count-decode-work-once-after-fences.patch
  • scripts/build-llama.sh
  • scripts/inference-execute.py
  • scripts/tests/inference_peer.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Set max_request_tier in the split plan's stage options

@michaelneale michaelneale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The port is faithful (65 of the 88 Rust files are byte-identical to MeshLLM main's copy, and the differences I read are deliberate), but one change breaks MeshLLM as an embedder, so I'm asking for a small fix before this merges.

Problem. This PR makes the HTTP frontend remove the request class headers (REQUEST_TIER_HEADER, CACHE_PARTITION_HEADER) unless the frontend was built with InferenceFrontendConfig::with_trusted_request_class_headers(). That is right for a standalone listener. But the embedded entry points build their router from InferenceFrontendConfig::default() (openai_backend_router_with_lifecycle_observer in crates/skippy-serving/src/embedded.rs), and take no config, so an embedder cannot opt in.

MeshLLM strips client-supplied values at its own ingress, stamps its own class (mark_class_for_local_server), and forwards over loopback to a server it starts with start_openai_backend_with_lifecycle_observer / start_openai_backend_with_tokenizer_and_lifecycle_observer. With this PR every such request arrives as Local, not private: request tiers do nothing and private requests share the default cache partition. Nothing fails; MeshLLM's CI is green against this branch.

Proof. The test in the patch below, on a7617ef without the fix:

left:  [InferenceRequestClass { tier: Local, private: false }]
right: [InferenceRequestClass { tier: Trusted, private: true }]

With the fix it passes.

Suggested patch (the two lifecycle-observer entry points trust the embedder's headers):

diff --git a/crates/skippy-serving/src/embedded.rs b/crates/skippy-serving/src/embedded.rs
index 7cae0f1..e29083a 100644
--- a/crates/skippy-serving/src/embedded.rs
+++ b/crates/skippy-serving/src/embedded.rs
@@ -579,9 +579,14 @@ fn openai_backend_router_with_lifecycle_observer(
     backend: Arc<dyn InferenceBackend>,
     lifecycle_observer: Option<Arc<dyn InferenceLifecycleObserver>>,
 ) -> Router {
-    let config = lifecycle_observer.map_or_else(InferenceFrontendConfig::default, |observer| {
-        InferenceFrontendConfig::default().with_lifecycle_observer(observer)
-    });
+    // The embedder is the trusted upstream: it strips client-supplied request
+    // class headers at its own ingress and stamps its classification before
+    // it forwards a request to this in-process server.
+    let config = InferenceFrontendConfig::default().with_trusted_request_class_headers();
+    let config = match lifecycle_observer {
+        Some(observer) => config.with_lifecycle_observer(observer),
+        None => config,
+    };
     skippy_inference_api::router_for_with_config(backend, config)
 }
 
@@ -772,6 +777,89 @@ mod tests {
         }
     }
 
+    #[derive(Default)]
+    struct ClassCaptureBackend {
+        classes: Mutex<Vec<skippy_inference_api::InferenceRequestClass>>,
+    }
+
+    #[async_trait::async_trait]
+    impl InferenceBackend for ClassCaptureBackend {
+        async fn models(
+            &self,
+        ) -> skippy_inference_api::InferenceResult<Vec<skippy_inference_api::ModelObject>> {
+            Ok(vec![skippy_inference_api::ModelObject::new("class-model")])
+        }
+
+        async fn chat_completion(
+            &self,
+            request: skippy_inference_api::generation::GenerationRequest,
+        ) -> skippy_inference_api::InferenceResult<
+            skippy_inference_api::generation::GenerationResponse,
+        > {
+            Ok(skippy_inference_api::generation::GenerationResponse::new(
+                request.model,
+                "ok",
+                skippy_inference_api::Usage::new(1, 1),
+            ))
+        }
+
+        async fn chat_completion_with_context(
+            &self,
+            request: skippy_inference_api::generation::GenerationRequest,
+            context: skippy_inference_api::InferenceRequestContext,
+        ) -> skippy_inference_api::InferenceResult<
+            skippy_inference_api::generation::GenerationResponse,
+        > {
+            self.classes.lock().unwrap().push(context.request_class());
+            self.chat_completion(request).await
+        }
+
+        async fn chat_completion_stream(
+            &self,
+            _request: skippy_inference_api::generation::GenerationRequest,
+            _context: skippy_inference_api::InferenceRequestContext,
+        ) -> skippy_inference_api::InferenceResult<
+            skippy_inference_api::generation::GenerationEventStream,
+        > {
+            Ok(Box::pin(futures_util::stream::empty()))
+        }
+    }
+
+    /// An embedder such as MeshLLM classifies a request at its own ingress and
+    /// forwards it to this server with the class in headers.
+    #[tokio::test]
+    async fn embedded_openai_backend_keeps_the_embedders_request_class() {
+        use axum::{body::Body, http::Request};
+        use skippy_inference_api::{
+            CACHE_PARTITION_HEADER, InferenceRequestClass, InferenceRequestTier,
+            REQUEST_TIER_HEADER,
+        };
+        use tower::ServiceExt;
+
+        let backend = Arc::new(ClassCaptureBackend::default());
+        let response = openai_backend_router_with_lifecycle_observer(backend.clone(), None)
+            .oneshot(
+                Request::post("/v1/chat/completions")
+                    .header("content-type", "application/json")
+                    .header(REQUEST_TIER_HEADER, "trusted")
+                    .header(CACHE_PARTITION_HEADER, "private")
+                    .body(Body::from(
+                        r#"{"model":"class-model","messages":[{"role":"user","content":"test"}]}"#,
+                    ))
+                    .unwrap(),
+            )
+            .await
+            .unwrap();
+        assert!(response.status().is_success());
+        assert_eq!(
+            *backend.classes.lock().unwrap(),
+            [InferenceRequestClass::new(
+                InferenceRequestTier::Trusted,
+                true
+            )],
+        );
+    }
+
     #[tokio::test]
     async fn failed_server_load_releases_its_bound_resources() {
         let listener = std::net::TcpListener::bind("127.0.0.1:0").unwrap();

If you would rather not change what those entry points mean, an explicit option on them that MeshLLM turns on works as well; the test applies either way. start_openai_backend and start_openai_backend_with_tokenizer still use the default (untrusted) config; I left them alone because MeshLLM does not call them.

Checked (macOS arm64, Rust 1.99.1, on a7617ef plus the patch): cargo fmt -p skippy-serving -- --check and cargo clippy -p skippy-serving --all-targets --features dynamic-native-runtime -- -D warnings pass. cargo test -p skippy-serving --lib --features dynamic-native-runtime: 1383 passed, 13 failed, 34 ignored. All 13 failures are tests that call into the native runtime, which I did not supply (12 ask for SKIPPY_NATIVE_RUNTIME_BUNDLE_DIR, one reports the library is not loaded).

Not reviewed: the native patch queue and the protocol generation bump. This PR's own build and tests have not run on GitHub, because it targets #9's branch rather than main.

The frontend now removes the request tier and cache partition headers unless it was built to trust them. The embedded entry points with a lifecycle observer built their router from the default config and take no config, so an embedder could not opt in. MeshLLM classifies a request at its own ingress and forwards it to this server with the class in those headers, so every request arrived as local and not private.

Those entry points now trust the headers, and a test sends a classified request through their router.

Checked on macOS arm64 with Rust 1.99.1: the new test fails without the fix and passes with it; cargo fmt and clippy with warnings denied pass for skippy-serving. The crate's tests that need a native runtime were not run.

Signed-off-by: Michael Neale <14976+michaelneale@users.noreply.github.com>
@michaelneale
michaelneale dismissed their stale review November 22, 2026 01:39

should be done now

michaelneale
michaelneale previously approved these changes Nov 22, 2026

@michaelneale michaelneale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conditional approve - assumign you happy james and that feedback around it needing that last commit to work with mesh is needed/good

@i386
i386 requested a review from jaredwy November 22, 2026 01:46
@i386

i386 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Needs ✝️ by @jaredwy

@i386
i386 removed this pull request from stack #116 November 22, 2026 02:43
@i386
i386 added this pull request to stack #161 November 22, 2026 02:43
#141 and ca24a05 each added the field; the merge kept both, so skippy-api
did not compile with dynamic-native-runtime.

Signed-off-by: Michael Neale <14976+michaelneale@users.noreply.github.com>
michaelneale added a commit to Mesh-LLM/mesh-llm that referenced this pull request Nov 23, 2026
Pin Skippy to the commit of release tag v0.80.1 instead of a stand-in
branch, so a node downloads the published 0.80.1 runtime.

That release differs from the stand-in in two ways:

- Split certification is gone from Skippy (Mesh-LLM/skippy#162), so the
  --allow-uncertified-split flag and the split_certification status field
  go too.
- It has no request tiers (Mesh-LLM/skippy#113). The node still classifies
  each request and runs hooks and plugins at that tier, but Skippy no
  longer orders admission or eviction by tier, reserves KV for local
  requests, or keeps a cache per tier. local_kv_reserve_percent is marked
  unwired. A private request still starts no peer consultation: the node
  turns its hooks flag off before the request reaches the server. A hook
  on the local server's task runs at the mesh tier.

Signed-off-by: Michael Neale <14976+michaelneale@users.noreply.github.com>
michaelneale added a commit to Mesh-LLM/mesh-llm that referenced this pull request Nov 23, 2026
The wiring manifest only allows an unwired node-level field as a silent
no-op, which static validation must reject, and nothing rejects this one.
Three mesh-llm-config contract tests failed on that mismatch.

The node still parses, validates and resolves the field; only the KV
reserve in Skippy is missing until a release has request tiers
(Mesh-LLM/skippy#113). That is what partial means in the manifest, so the
schema lists the field as experimental and a config that sets it stays
valid.

Signed-off-by: Michael Neale <14976+michaelneale@users.noreply.github.com>

@i386 i386 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented at head 8010da07cd — content verified including michaelneale's ask; blocked only by a rebase and a green rerun, then ready for owner decision.

michaelneale's dismissed review asked for the embedded lifecycle-observer entry points to trust request-class headers (with a suggested patch and a failing-then-passing test as proof). That exact fix — with_trusted_request_class_headers() plus his comment text — is in embedded.rs at this head, with the test. His "conditional approve" condition is satisfied on content; the reviews were auto-dismissed by the later pushes, so nothing is hidden there.

Remaining before this can merge:

  • mergeable_state is dirty — it conflicts with main now and needs a rebase (stack members #129/#130 sit on it, so they follow).
  • Real lanes at this head were green/skipped; the red is the stale aggregate gate only. After the rebase, CI should be re-confirmed.

Given #129 deliberately changes this PR's design in one commit (its own body says so), the stack will want one more coherence look after the rebase — I'll do that pass when the rebased heads exist.

@michaelneale

Copy link
Copy Markdown
Contributor

FYI focus of my feedback and so on thus far has been more consistency with main mesh state (before the skippy split). So if it’s not relevant and a deliberate change don’t take it to seriously

@i386

i386 commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

@i386 The required PR checks gate needs your licensing declaration. Please tick this checkbox in the PR description if you agree:

  • I agree to license my contributions under the Apache License, Version 2.0.

I have left this author declaration unchecked while working through CI.

@i386 i386 mentioned this pull request Nov 28, 2026
6 tasks done

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

qualify Run real-model inference qualification for this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants