Repository navigation
fix(cache): apply the Dylint thin-store skip only when the layer was not restored - #681
Merged
Merged
Conversation
…not restored decideCacheSaveGate skipped the build-cache and target-cache saves whenever dylint-output-cache was restored. The rule exists for the cold-seed case (658bcf9): with nothing restored, a Dylint-output hit leaves a thin store that would win the key and LRU-evict the real entry. When the layer WAS restored, the store is the restored entry plus this run's compiles, a superset, so skipping only throws away real work. FastLED/fbuild run 44501733207 dropped 242 new compiles every run that way. Skip on dylintOutputRestored only when !restored; otherwise fall through to the normal min-compiles gate (real compiles save, zero still skips). Local-Gate: v1 tree=5b1b0dadd02266aaa8fb846beee636db025e3942 secs=86 lanes=lint:run,typecheck:run,tests:run Ci-Attestation: {"at":1795084191,"gate":"general/all/lint","host":"linux-x86_64","key":"cb0893725a96","lane":"lint","parents":["a2c1d423f9c57faf5ebb2e0a3c1c3baf1c24fb0b"],"secs":0,"stamp":"4c626b2fc479477bf0d88c8a95a24f84","tree":"5b1b0dadd02266aaa8fb846beee636db025e3942","v":1,"via":"run"} Ci-Attestation: {"at":1795084191,"gate":"general/all/typecheck","host":"linux-x86_64","key":"c975705f878f","lane":"typecheck","parents":["a2c1d423f9c57faf5ebb2e0a3c1c3baf1c24fb0b"],"secs":9,"stamp":"3c9adac1df8a0e2afd13e3254ee75dcd","tree":"5b1b0dadd02266aaa8fb846beee636db025e3942","v":1,"via":"run"} Ci-Attestation: {"at":1795084191,"gate":"general/linux-x86_64/test","host":"linux-x86_64","key":"5af576733f01","lane":"tests","parents":["a2c1d423f9c57faf5ebb2e0a3c1c3baf1c24fb0b"],"secs":75,"stamp":"ecf2eff923b125dc10d5c5192bd350f6","tree":"5b1b0dadd02266aaa8fb846beee636db025e3942","v":1,"via":"run"}
Collaborator
Author
|
The steady-state symptom from the caveat (an exact hit is never re-saved, so recurring misses persist) is tracked in #682. This PR only fixes the gate for restored, non-exact (fallback) build/target caches. |
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.
Problem
decideCacheSaveGate(src/lib/compile-cache-stats.ts) skipped the build-cache and target-cache saves wheneverdylint-output-cachewas restored. The rule from 658bcf9 is for the cold-seed case: nothing was restored, so a Dylint-output hit leaves a thin store (~294 MB vs ~1.2 GB) that would win the key and LRU-evict the real entry. When the build/target cache was restored, the store is the restored entry plus this run's compiles. That is a superset, so skipping only throws work away.FastLED/fbuild run 44501733207 (Dylint Full job 135483075645, setup-soldr v0 = a2c1d42) logged:
Fix
Skip on
dylintOutputRestoredonly when!input.restored. Otherwise the normal*-save-min-compilesgate decides: real compiles save, zero still skips, and a raised threshold still applies. Both wrappers (decideBuildCacheSave,decideTargetCacheSave) share the gate, so target-cache gets the same treatment with its own input name in the reason text.Caveat (affects the fbuild symptom)
In that fbuild run the build cache was an exact hit (
...-dylint-unified-v2-514fdd037a76e524-s57d57d7814452b77).saveOnereturnsexact-hit-skipbefore uploading whatever this gate decides, because cache keys are immutable. So this fix lets a fallback restore (for example the first run after a soldr bump, when thes<soldr>segment changes) seed the new key. It does not re-save an exact-hit entry, and it will not by itself stop recurring misses on an unchanged exact key.Tests
target-cache-save-min-compilesreason.dist/rebuilt; README thin-store rule and CHANGELOG updated.