Title: Growth veto: measure at fixpoint convergence to catch non-collapsing paste growth · Issue #339 · purescript-lua/purescript-lua · GitHub
Open Graph Title: Growth veto: measure at fixpoint convergence to catch non-collapsing paste growth · Issue #339 · purescript-lua/purescript-lua
X Title: Growth veto: measure at fixpoint convergence to catch non-collapsing paste growth · Issue #339 · purescript-lua/purescript-lua
Description: Problem The call-site inliner's growth veto (Note [Bounded call-site inlining growth]) speculates, measures, and reverts per rewrite sweep at expression granularity: a sweep that grows an expression past before + max 16 (before/4) IR nod...
Open Graph Description: Problem The call-site inliner's growth veto (Note [Bounded call-site inlining growth]) speculates, measures, and reverts per rewrite sweep at expression granularity: a sweep that grows an expressio...
X Description: Problem The call-site inliner's growth veto (Note [Bounded call-site inlining growth]) speculates, measures, and reverts per rewrite sweep at expression granularity: a sweep that grows an expre...
Opengraph URL: https://github.com/purescript-lua/purescript-lua/issues/339
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Growth veto: measure at fixpoint convergence to catch non-collapsing paste growth","articleBody":"## Problem\n\nThe call-site inliner's growth veto (`Note [Bounded call-site inlining growth]`) speculates, measures, and reverts per rewrite sweep at expression granularity: a sweep that grows an expression past `before + max 16 (before/4)` IR nodes is discarded and redone with paste tiers disarmed. Two kinds of growth slip under that dial: growth that accumulates across fixpoint rounds (each round re-measures against its own input, so N rounds compound), and pastes that are node-modest but line-heavy when printed. The Note documents the blind spot and already names the fix: \"catching it needs the measurement at fixpoint convergence rather than per sweep, where transient growth is invisible and the dial could drop.\"\n\nAdmitting n-ary worker pastes (#245, PR #337) widened the exposure: on product-type transformer chains nothing ever folds, so each pasted worker body survives whole. `Golden.LongStackBind` grew +55% bytes (+743 printed lines) and `Golden.LongStateBind` +14% (+202 lines). Verbatim from `Golden.LongStackBind.Test/golden.lua`, one of ~50 identical chain steps:\n\n```lua\n-- before\nreturn Golden_LongStackBind_Test_bindStateT.bind(Golden_LongStackBind_Test_put(Golden_LongStackBind_Test_add_S_w(x141, 1)))(function( )\n-- after\nreturn Golden_LongStackBind_Test_bindStateT.bind(function()\n return (Golden_LongStackBind_Test_monadExceptT.Applicative0()).pure({\n Data_Unit_unit,\n x141 + 1\n })\nend)(function()\n```\n\nEach step trades one call for the closure `put` allocated per call anyway — allocations unchanged, one call fewer, but the body is duplicated at every step instead of shared behind the binding, and the per-sweep dial never sees the sum.\n\n## Approach\n\nAdd a second measurement at specialize-fixpoint convergence: compare each expression's size at fixpoint exit against its size at fixpoint entry, and on overrun re-run that expression's fixpoint with the heuristic tiers disarmed one rung at a time, reusing the `CurriedPastesOnly` ladder from PR #337 (n-ary worker tier first, all heuristic tiers second). The per-sweep veto stays — it bounds transient growth within a round — while the convergence check catches the compounding the Note describes. Calibrate the convergence allowance against the corpus the same way the per-sweep dial was (LongEitherBind must still collapse; LongStackBind must be rejected).\n\n## Prerequisites / Relations\n\nBuilds on the growth veto (#221) and the fallback ladder introduced with the n-ary worker tier (#245, PR #337). The blind spot is pre-existing (`Golden.LongStateBind` grew under it before #245); #245 raised the stakes.\n\n## Verification / Measurement\n\n`Golden.LongStackBind` and `Golden.LongStateBind` return toward their pre-#245 sizes while the collapses #245 won stay collapsed (`Golden.Primops` constant folds, `Golden.MaybeChain`'s literal `42`, `Bench.CtorBuild`'s in-place builds). A fixpoint-granularity case joins the `#221` spec block (a chain whose per-round growth stays under the per-sweep dial but compounds past the convergence allowance). Corpus size and bench differential re-run through the #172 harness.\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-07-28T15:53:42Z","url":"https://github.com/purescript-lua/purescript-lua/issues/339"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:980558ba-42cc-dd0e-ed4b-939463c67d6f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DA0:27E5CD:855816:AE3092:6B00DB6A |
| html-safe-nonce | e66e7abadda0fbe4b68645704602f66bcf3cdb67cf3cbcce94112db32ecff8ec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REEwOjI3RTVDRDo4NTU4MTY6QUUzMDkyOjZCMDBEQjZBIiwidmlzaXRvcl9pZCI6IjkwMDg0NjUyNzU0NTYxMTc2MTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1d35db5d1e7fd804df9089edcaeabd61a5e931b432778ac17cf30c15e05b7d69 |
| hovercard-subject-tag | issue:5000510934 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/purescript-lua/purescript-lua/339/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c7c4dd57176ccc2159258c4dc17b7eeb41aad41ae0fe361056be6a669aee4534/purescript-lua/purescript-lua/issues/339 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c7c4dd57176ccc2159258c4dc17b7eeb41aad41ae0fe361056be6a669aee4534/purescript-lua/purescript-lua/issues/339 |
| og:image:alt | Problem The call-site inliner's growth veto (Note [Bounded call-site inlining growth]) speculates, measures, and reverts per rewrite sweep at expression granularity: a sweep that grows an expressio... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Unisay |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| turbo-cache-control | no-preview |
| go-import | github.com/purescript-lua/purescript-lua git https://github.com/purescript-lua/purescript-lua.git |
| octolytics-dimension-user_id | 131581790 |
| octolytics-dimension-user_login | purescript-lua |
| octolytics-dimension-repository_id | 587200487 |
| octolytics-dimension-repository_nwo | purescript-lua/purescript-lua |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 587200487 |
| octolytics-dimension-repository_network_root_nwo | purescript-lua/purescript-lua |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width