postprocess: add --gc-cache to garbage collect any cache entries not used since the last --gc-cache call#1554
Open
kkysen wants to merge 3 commits intokkysen/postprocess-fail-slowfrom
Open
Conversation
f28d26b to
a97239b
Compare
brk
pushed a commit
to Aarno-Labs/c2rust
that referenced
this pull request
Jan 29, 2026
brk
pushed a commit
to Aarno-Labs/c2rust
that referenced
this pull request
Jan 29, 2026
…t used since the last `--gc-cache` call When there are input changes (like transpiler, refactorer, prompt, etc. changes), the cache becomes outdated and must be recalculated, but the previous entries aren't deleted. This tries to solve that. It tracks which cache entries are still actively tested/used (this is always done in `llm-cache/.gc`), and then `--gc-cache` deletes everything else. So the normal intended usage is to: * Run `rm -f llm-cache/.gc`. * Run all tests, updating the cache with new entries. * Run with `--gc-cache` to remove the outdated, unused entries.
…'s not actually used by it and comment transfering in general
Instead of storing paths in `.gc`, `.gc` is empty and just stores a ctime, before which everything should be deleted. When there's a cache hit, update the mtime, and use that to know which files are newer than the ctime and should be kept.
a97239b to
6fc147a
Compare
2612c20 to
ae20c1e
Compare
kkysen
commented
Feb 13, 2026
Contributor
Author
kkysen
left a comment
There was a problem hiding this comment.
I've detached --gc-cache from CommentTransferOptions now (it was never really needed there) and switched to an mtime-based version, but I haven't gotten around to fully separating --gc-cache into a separate script yet, which requires some more work, as part of the script will have to be deduplicated/set up to be imported.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When there are input changes (like transpiler, refactorer, prompt, etc. changes), the cache becomes outdated and must be recalculated, but the previous entries aren't deleted. This tries to solve that. It tracks which cache entries are still actively tested/used (this is always done in
llm-cache/.gc), and then--gc-cachedeletes everything else. So the normal intended usage is to:rm -f llm-cache/.gc.--gc-cacheto remove the outdated, unused entries.I tried to do this in a simple way, but it does seem pretty necessary once testing is added to CI and others will need to do the same on their own, instead of me manually deleting the right outdated cache entries. If there are better/simpler ways to do this, that would also be great.