Repository navigation
Drop elabConfiguredPrograms from the elaborated plan - #12500
Conversation
0fdb3c2 to
eb9d0af
Compare
ulysses4ever
left a comment
There was a problem hiding this comment.
Thanks, this looks right to me. One comment inline on the test, and two on the description.
What I checked:
-
The field had one job: cf4083b (#2015) added it so that the
cache/configkey changes whenPATHdoes, whichPathRecomptests. Nothing reads it, and the key is compared with==(normaliseConfiguredPackageonly toucheselabProgramArgs), so a hash of theBinaryencoding notices the same changes. It is computed once, in thewhereofelaborateInstallPlan. -
The complete records are needed. Hashing
programDbSignature compilerProgDbinstead makesPathRecompfail, and clearing everyprogramVersionmakesConfiguredProgramCachefail; each test passes when only the other one's part is broken, so the new test isn't redundant. It also passes at the base, as it should for a change that keeps the behaviour. -
It merges cleanly with #12464, and the merge passes
ConfiguredProgramCache,PathRecompandT12463. -
On the #12463 repro (40 public sublibraries, 16 flags; GHC 9.10.3 on Linux, in a nix shell whose
PATHhas 43 entries), a no-opcabal build all, five runs each:improved-plancache/config(42 files)no-op base 0687f8d2f32.6 MB 16.4 MB 0.82–0.84 s this PR 30.2 MB 15.2 MB 0.56–0.57 s #12464 + this PR 2.8 MB 1.4 MB 0.14 s
On the description:
- It could say why
PATHhas to stay in the key: #2015 added the field so that aPATHchange reconfigures, andprogramDbSignaturedropsPATH(it keeps the versions, so "keepingPATHand tool versions" reads as if it didn't). - The QA notes say that changing only the version the script prints makes the next build reconfigure. It doesn't, at the base or with this PR: nothing monitors the tool, so the next build is up to date until
cabal.projectchanges too, as in the test.
The later commits fix up the first, whose message still mentions the PATH/REPL test that the third one removed, so I'd merge with squash (squash+merge me).
|
Thanks for checking all of that. I applied your comment on the test in 26cfc11. The description now says why Squash sounds right to me. |
❌ Left the queue ·
|
Keep the configured program database shared and fingerprint its complete records once per project for per-component cache invalidation. Cover PATH/REPL changes and a tool version change at a fixed path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PathRecomp already checks that a PATH change reaches the REPL. Keep the checks the fingerprint adds: a tool version change at a fixed path reconfigures, and elaborating again with the same programs does not. Use a checked-in package instead of writing it from the script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The haddock names the shared program database the fingerprint stands for and why it lives in the component: that record is the configure cache key. The test's comments say what it checks and what PathRecomp covers, and why editing cabal.project is what makes the plan elaborate again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The script is not monitored either; cabal probes the tool's version only when it elaborates the plan again, which the cabal.project edit forces. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The haddock listed what a configured program holds, PATH included, which read as if copying PATH into the records were intended (see haskell#12481). It now says only what the field is: a hash of the configured programs that changes the configure cache key when one of them changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
39ccf3f to
d7fc6bb
Compare
haskell#12464 imported Data.Binary qualified as Binary in ProjectPlanning. Distribution.Compat.Binary re-exports Data.Binary, so importing both under the same alias leaves one of them redundant, which -Werror rejects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d7fc6bb to
4d1b802
Compare
✅ Merged into
|
* Fingerprint configured programs in elaborated components Keep the configured program database shared and fingerprint its complete records once per project for per-component cache invalidation. Cover PATH/REPL changes and a tool version change at a fixed path. * Record the PR and issue numbers in the changelog Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Narrow the configured-program test to what PathRecomp does not cover PathRecomp already checks that a PATH change reaches the REPL. Keep the checks the fingerprint adds: a tool version change at a fixed path reconfigures, and elaborating again with the same programs does not. Use a checked-in package instead of writing it from the script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Say what the program fingerprint is for The haddock names the shared program database the fingerprint stands for and why it lives in the component: that record is the configure cache key. The test's comments say what it checks and what PathRecomp covers, and why editing cabal.project is what makes the plan elaborate again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Say that nothing monitors the tool in the configured-program test The script is not monitored either; cabal probes the tool's version only when it elaborates the plan again, which the cabal.project edit forces. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * Do not describe the program records in the fingerprint's haddock The haddock listed what a configured program holds, PATH included, which read as if copying PATH into the records were intended (see haskell#12481). It now says only what the field is: a hash of the configured programs that changes the configure cache key when one of them changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Use the Data.Binary import master already has haskell#12464 imported Data.Binary qualified as Binary in ProjectPlanning. Distribution.Compat.Binary re-exports Data.Binary, so importing both under the same alias leaves one of them redundant, which -Werror rejects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This removes
elabConfiguredProgramsfrom each elaborated component. Nothing read it; it was part of the configure cache key. Each component now keeps one hash of the list, computed once per project, and the records themselves stay in the sharedProgramDb.On #12463, Andrea traced the extra copies to #11768 and suggested stripping the field as
programDbSignaturedoes. I hashed the complete records instead: #10817 added the field for #2015 so that aPATHchange reconfigures, andprogramDbSignaturedropsPATH.Follow-up to #12464; applies with or without it.
On HLS at
bc2bbb8e, using the method from #12464, the second dry run of ten order-balanced rounds:improved-plan538d465eb00d86feb5eb9d0af60With #12464 the plan is within 3% of 3.16.
AI disclosure: written by Codex and Claude Code with Opus 5.5, following the review on #12464.
significance: significantin the changelog file.ConfiguredProgramCache)QA Notes
Build a package twice; the second build is up to date. Point
--with-haddockat a script that prints a version, then editcabal.project; the next build is still up to date. Change the version the script prints and editcabal.projectagain; the next build reconfigures. Changing only the version leaves the build up to date, at the base too, because nothing monitors the tool.ConfiguredProgramCachecovers this.