Metal shader pipeline states not released when compiled functions are erased
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 28.5k
- Forks
- 2.3k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 62
Description
When a compiled function is removed from CompilerCache (via compile_erase or compile_clear_cache), the associated Metal shader libraries and pipeline states in Device::library_kernels_ are not released. They persist until process exit.
Device::clear_library() exists but is never called from the compile cache cleanup path.
Found while investigating Metal resource accumulation in a long-running process that creates and discards compiled functions over time.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at CompilerCache cleanup through compile_erase and compile_clear_cache, then trace how Device::library_kernels_ and Device::clear_library() are used. Confirm the cleanup path releases the associated Metal shader libraries and pipeline states when compiled functions are removed, rather than retaining them until process exit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100