Repository navigation
fix(cache): keep Mesh's caches in <platform cache>/mesh-llm after the Skippy move - #3230
Conversation
Skippy from crates.io resolves application_cache_dir() and its native runtime cache under <platform cache>/skippy, while the in-tree copy used <platform cache>/mesh-llm. mesh_cache_dir() delegated to Skippy, so since Mesh-LLM#3193 model usage, GGUF metadata, weight digests, the blobstore and materialized stages moved, and runtimes installed by earlier releases are no longer seen by runtime list or prune. Resolve <platform cache>/mesh-llm in Mesh itself, and hand Skippy <mesh cache>/native-runtimes as the runtime cache unless one of the two cache variables is set.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Original problem
Since #3193, Mesh's caches live in a different directory. The in-tree Skippy resolved
application_cache_dir()to<platform cache>/mesh-llm; Skippy from crates.io resolves it to<platform cache>/skippy.mesh_cache_dir()says it preserves Mesh's location but delegates to Skippy, so everything built on it moved: model usage records, GGUF metadata, weight digests, the plugin blobstore, the Metal pipeline cache and materialized stages.The native runtime cache moved the same way, from
<platform cache>/mesh-llm/native-runtimesto<platform cache>/skippy/native-runtimes. Runtimes installed by earlier releases stay on disk, andruntime listandruntime pruneno longer see them.Diagnostics
On Windows (
<platform cache>is%LOCALAPPDATA%), a release build of main served Qwen3-8B, whose digest a 0.80.0 node had already written to%LOCALAPPDATA%\mesh-llm\weights-digest\7ff051ec….json. Main computed it again and wrote the same file under%LOCALAPPDATA%\skippy\weights-digest. That machine's 0.80.0 cache also holds 2 GB of older CUDA runtimes in%LOCALAPPDATA%\mesh-llm\native-runtimesthat main can't prune.Fix
mesh_llm_skippy_adapter::mesh_cache_dir()resolves<platform cache>/mesh-llmitself, with the fallbacks the in-tree code had.mesh_llm_system::native_runtime_install::mesh_cache_dir()resolves the same directory, for the crates that don't depend on the adapter.modelscommands now use it instead of Skippy's directory.MESH_LLM_NATIVE_RUNTIME_CACHE_DIR, then<mesh cache>/native-runtimes. When onlySKIPPY_NATIVE_RUNTIME_CACHE_DIRis set, Mesh passes nothing and Skippy reads it, as before.Builds of main since #3193 wrote some entries under
skippy. Nothing migrates them; the next run recomputes them undermesh-llm.Validation
runtime list --installedwith no cache variable: main shows no runtime and the cache%LOCALAPPDATA%\skippy\native-runtimes; this branch shows the 0.76.1 and 0.78.1 CUDA runtimes under%LOCALAPPDATA%\mesh-llm\native-runtimes.%LOCALAPPDATA%\skippyand leaves the existingmesh-llm\weights-digestentry untouched.cargo test -p mesh-llm-system --lib native_runtime_install(10 passed) andcargo test -p mesh-llm-host-runtime --lib mesh_cache_locationpass;cargo fmt --all -- --checkis clean.cargo clippy -p mesh-llm-system -p mesh-llm-skippy-adapter -p mesh-llm-commands --all-targets -- -D warnings -A dead-codeis clean on Windows. Without-A dead-code, clippy on Windows already fails on main with unused functions inmesh-llm-system/src/hardware/mod.rs, which this PR doesn't touch.Summary by CodeRabbit