Skip to content

fix: evict memoized derived values when files are removed#110

Open
pfitzseb wants to merge 1 commit into
mainfrom
sp/evict-derived
Open

fix: evict memoized derived values when files are removed#110
pfitzseb wants to merge 1 commit into
mainfrom
sp/evict-derived

Conversation

@pfitzseb

@pfitzseb pfitzseb commented Jul 3, 2026

Copy link
Copy Markdown
Member

Removing a file only deleted its inputs; every derived value keyed by the URI (parse trees, diagnostics, testitems, ...) stayed in the Salsa storage for the lifetime of the workspace — measured at ~1.5 MB retained per removed file. Use the new Salsa.evict_derived! to drop all entries keyed by removed URIs in remove_file!, remove_all_children! (batched per call), and clear_indirect_file!.

The promotion path in add_file! (indirect file becoming a regular file) deliberately does not evict: the URI stays live and its derived values revalidate through normal Salsa invalidation.

Requires julia-vscode/Salsa.jl#56.

Removing a file only deleted its inputs; every derived value keyed by the
URI (parse trees, diagnostics, testitems, ...) stayed in the Salsa storage
for the lifetime of the workspace — measured at ~1.5 MB retained per
removed file. Use the new Salsa.evict_derived! to drop all entries keyed by
removed URIs in remove_file!, remove_all_children! (batched per call), and
clear_indirect_file!.

The promotion path in add_file! (indirect file becoming a regular file)
deliberately does not evict: the URI stays live and its derived values
revalidate through normal Salsa invalidation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant