module style 4.5: introduce function cache to speed up some optimizations - #369
Merged
Merged
Conversation
prozacchiwawa
marked this pull request as ready for review
March 3, 2026 10:02
…the provided compileform. This eliminates the possibility of the context containing a stale dependency graph.
… well. not really necessary since this was checked when the first generation happened, but its ok
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
aqk
approved these changes
Apr 23, 2026
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.

Note
Medium Risk
Introduces a new caching path in
codegenthat can change emitted helper bodies when cache keys collide or are computed incorrectly, and it touches core compilation/optimization flow. Risk is mitigated by being opt-in (requiresfuncache+ dependency graph) and covered by new targeted tests.Overview
Adds an optional per-function codegen cache (
Funcache) to reuse previously generated non-inlinedefunoutputs during optimization runs when the helper’s effective dependencies (used constants/inlines + relevant env shape) haven’t changed.codegen/codegen_now accept an optionalFunctionDependencyGraph; when provided andfuncacheis enabled on the compile context, helpers can be served from cache via asha256tree-based key computed from the helper form plus depended-on forms (with unused env entries nil’d). Adds new tests for module disk-cache key stability/try_from_cachebehavior and for funcache correctness, plus a small coverage-script doc update and.gitignoreadditions.Reviewed by Cursor Bugbot for commit 060450b. Bugbot is set up for automated code reviews on this repo. Configure here.