Repository navigation
Conversation
The test module compiled ~70 Plinth splices in one GHC process. Plinth's per-splice working memory stays live until the process exits, so the peak is roughly the sum over all splices: ~20 GB RSS (~11 GB live heap; GHC 9.12). Splitting into modules inside one component doesn't help (same process). Move the splices into three internal libraries (splices-a/b/c), each its own GHC process; each depends on the previous so they build one after another. Peak GHC RSS drops from 20.2 GB to 9.4 GB. Test.LambdaBuffers.Runtime.PlutusTx.PlutusTx re-exports the same names, so the tests are unchanged (383 pass). Also: - drop fooE/fooFInt/fooGInt: unexported and never compiled. Compiled on its own, fooE (a ~30-field product of ledger types) exceeds 62 GB and is OOM-killed after 31 min; fooFInt/fooGInt fail with "Unsupported construct: Mutually recursive datatypes". - drop -ddump-splices (debug output; no effect on memory, 19.4 vs 19.6 GB). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018RYHrLvKaySdv9c2pzbW3G
This branch has not been deployed
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.
Fixes the memory blow-up when compiling the
lbt-plutus-plutustxtest suite. Nothing on this branch was actually broken: all 30 checks pass on a machine with 64 GB of RAM. The failure only happens when the machine runs out of memory compiling the test suite.Where the memory goes
All figures are peak RSS on GHC 9.12.1, measured on a 64 GB box.
-ddump-splices)TxInfo/ScriptContextfor V1–V3TxInfo/ScriptContextgroup (5 splices)fooEon its own-ddump-spliceshas no effect on memory.fooEexplains the "Compiling this causes an OOM" comment, but not the 20 GB.fooE(Eis a product type with about 30 ledger-type fields) is unexported, so GHC drops it before Plinth ever compiles it.fooFIntandfooGIntare the same: unexported, and Plinth can't compile them anyway ("Unsupported construct: Mutually recursive datatypes").Fix
splices-a,splices-bandsplices-c. Each library compiles in its own GHC process. Each depends on the one before it, so cabal and Nix build them one after another instead of in parallel, where their peaks would stack.Test.LambdaBuffers.Runtime.PlutusTx.PlutusTxre-exports the same names as before, so the tests themselves don't change.fooE,fooFIntandfooGInt, which were dead and can't be compiled. Removed-ddump-splices.Peak GHC RSS drops from 20.2 GB to 9.4 GB, and the whole machine peaks at 10.3 GB.
Verified
All of this was built on a 64 GB Hetzner box from this branch's derivations:
checks.x86_64-linuxpass, including pre-commit.lbt-plutus-plutustx: all 383 tests pass.Not addressed
Prelude.Array. No.lbffile uses it yet. In PlutusTx it isnewtype Array a = Array a, a single element rather than a list, and its derivedEqis Haskell'sEq, not PlutusTx's. Using it in a schema would probably need both fixed.🤖 Generated with Claude Code
https://claude.ai/code/session_018RYHrLvKaySdv9c2pzbW3G