Repository navigation
transformer: keep outputs in TREE_CALCULUS_CACHE, beside every other cache - #58
Merged
Merged
Conversation
…cache `transformer` memoized into a directory of the caller's choosing (`cache_dir`), while every other reduction cache lives under TREE_CALCULUS_CACHE. Two spellings of one mechanism, and the private one did less: it never stamped an entry it read, so a pruner keeping what was recently used (arboretum's build deletes what no build has needed in 30 days) could not tell its live entries from dead ones, and the directory only grew. Now `memoize` writes to a `transform-v1` store under TREE_CALCULUS_CACHE, through the same `store` that writes, stamps and renames for the others. The key is unchanged — sha256 of the program's hash and the input — so an old `cache_dir`'s entries are valid there as they are. The `cache_dir` option, and with it `TransformerOptions`, goes: a caller still passing it is ignored, so nothing breaks before its own change lands, and its sources are cached exactly when everything else is. Tested: test-runner.sh gains three checks — a transformer answers, a fresh process asking the same thing again spawns no runner, the entry is in transform-v1 — runner 19/19, reduce_canonicalize 4/4; node src/test.mjs; `lambada emit` against this runtime gives byte-identical output to before under the Node evaluator and both runners, cold and warm, and warm never reaches the runner. bin/ rebuilt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011zRRfk1bnCFEJEjxgSDavL
olydis
pushed a commit
to lambada-llc/arboretum
that referenced
this pull request
Oct 2, 2026
tree-calculus 5a83063 -> 1fafaa4 (lambada-llc/tree-calculus#58): a transformer's outputs are kept under TREE_CALCULUS_CACHE, in transform-v1. lambada a7398b8 -> ef0bbc3 (lambada-llc/lambada#46): `--cache` is gone; compiled sources are cached exactly when everything else is. build.sh already stopped passing the flag (#76), so compiled sources now sit in .cache/tree-calculus and the 30-day prune covers them; an old .cache/lambada is dead and can be deleted. Tested: ./build.sh from an empty cache exits 0 in 3m26s with no diff; .cache holds only tree-calculus/, transform-v1 included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011zRRfk1bnCFEJEjxgSDavL
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.
This is the first of four PRs that move compiled-source caching onto the shared cache. The others are in lambada, arboretum and forest, and each one keeps every build working on its own, whatever order they merge in.
What changes.
transformerused to memoize into a directory the caller chose (cache_dir; lambada's--cache .cache/lambada). Every other reduction cache lives underTREE_CALCULUS_CACHE. The separate directory also never refreshed an entry's timestamp when it was read, so arboretum's age-based pruning couldn't reach it and it only grew.memoizenow writes to atransform-v1store underTREE_CALCULUS_CACHE, through the samestorecode as the other caches.cache_dirandTransformerOptionsare removed. A caller that still passescache_dirhas it ignored, and its compiled sources are cached exactly when everything else is.Existing caches. The key is unchanged, so entries from an old
cache_dirare valid intransform-v1as they are. Moving them over just saves recompiling once.Tested
test-runner.shhas three new checks: a transformer answers; a fresh process asking the same thing again doesn't spawn the runner; the entry lands intransform-v1. Runner 19/19, reduce_canonicalize 4/4.node src/test.mjspasses.lambada emitagainst this runtime gives byte-identical output to before with the Node evaluator and with both runners, on a cold and a warm cache. A warm run never reaches the runner.bin/is rebuilt.🤖 Generated with Claude Code
https://claude.ai/code/session_011zRRfk1bnCFEJEjxgSDavL
Generated by Claude Code