Include dialect in module cache keys#516
Conversation
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.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9c21fd1. Configure here.
| key_material.extend_from_slice(&include.fingerprint); | ||
| } | ||
| hex::encode(sha256tree_from_atom(&include_fingerprints)) | ||
| hex::encode(sha256tree_from_atom(&key_material)) |
There was a problem hiding this comment.
Cache key dialect not normalized
Medium Severity
cache_key hashes opts.dialect() as passed into try_from_cache, but module compilation rewrites dialect (int_fix, stepping floor, cse_dominance) before set_cache_element. Lookup and store therefore use different key material, so incremental module disk cache hits fail even when entries exist.
Reviewed by Cursor Bugbot for commit 9c21fd1. Configure here.
Prevent stale module artifacts from bypassing dialect-gated optimizer fixes by keying cached outputs on explicit dialect semantics.
Use the same effective module dialect for cache reads and writes so dialect-aware cache keys still hit valid module artifacts.
9c21fd1 to
a8f575a
Compare


Summary
cse_dominance, to module cache keys.Test plan
Note
Low Risk
Compiler disk-cache keying only; intentional cache invalidation improves correctness without touching runtime auth or data paths.
Overview
Module export disk cache keys now incorporate compiler dialect settings, not just include fingerprints, so cached hex cannot be reused across incompatible compiler configurations.
cache_keytakesCompilerOpts, buildsmodule-cache-v2key material from stepping,strict,int_fix,extra_numeric_constants, andcse_dominance, then appends include fingerprints before hashing. Lookups and writes already hadopts; they now feed that into the key. The stable empty-include test expectation changes accordingly, and a new unit test asserts different keys when onlycse_dominancetoggles. Integration tests resolve.chialisp/<key>/via the opts-awaremodule_cache_key_hexhelper.Reviewed by Cursor Bugbot for commit 9c21fd1. Bugbot is set up for automated code reviews on this repo. Configure here.