Repository navigation
Conversation
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.
Skippy Lab Qualification: PassedCommit: Native Spark lab qualification. Latest successful main: run 45835599636, attempt 1, commit
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>
|
Important Review skippedToo 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.
|
Set max_request_tier in the split plan's stage options
michaelneale
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
conditional approve - assumign you happy james and that feedback around it needing that last commit to work with mesh is needed/good
|
Needs ✝️ by @jaredwy |
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>
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
left a comment
There was a problem hiding this comment.
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_stateis 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.
|
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 The required
I have left this author declaration unchecked while working through CI. |
Summary
7191dbffa. Standalone HTTP listeners keep the default local request class. Embedders can accept classification headers from a trusted upstream that stamps them.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.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
48a8e9fto452361epreserved its source tree exactly.Validation before stacking
GitHub CI and the repository's cache and scheduler performance comparisons are pending.
Stacked validation
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 useghcr.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, andSKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just automation-contractspassed 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
After
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-contractsandgit diff --checkpassed on macOS ARM64, including the native-cache regressions. Fresh model/device qualification is pending on the new head.CI repair validation —
8cc6b12551b6f765511d8820d3ba4232d875dd5eRefreshed 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.cpp5bacb7c868a2bc98682de15f447fc1ce17c9c49c. 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-buildpassed against that separate native checkout; the nativeskippy_async_state_contractsplus both generated synthetic fixtures passed (3/3);LLAMA_STAGE_BACKEND=cpu just skippy-ffi-bindgen-checkpassed; andSKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just ci-automationpassed. 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-apialso 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 thepreparingphase 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), andSKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just ci-automationall 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