René's URL Explorer Experiment


Title: IR Optimizer spec never terminates at hspec seeds 109, 152 and 478 · Issue #348 · purescript-lua/purescript-lua · GitHub

Open Graph Title: IR Optimizer spec never terminates at hspec seeds 109, 152 and 478 · Issue #348 · purescript-lua/purescript-lua

X Title: IR Optimizer spec never terminates at hspec seeds 109, 152 and 478 · Issue #348 · purescript-lua/purescript-lua

Description: Problem The IR Optimizer spec group contains optimization keeps expressions well-scoped, a hedgehog property that feeds generated well-scoped IR expressions through the whole optimizedUberModule pipeline (the full optimizer: uniquificati...

Open Graph Description: Problem The IR Optimizer spec group contains optimization keeps expressions well-scoped, a hedgehog property that feeds generated well-scoped IR expressions through the whole optimizedUberModule pi...

X Description: Problem The IR Optimizer spec group contains optimization keeps expressions well-scoped, a hedgehog property that feeds generated well-scoped IR expressions through the whole optimizedUberModule pi...

Opengraph URL: https://github.com/purescript-lua/purescript-lua/issues/348

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"IR Optimizer spec never terminates at hspec seeds 109, 152 and 478","articleBody":"## Problem\n\nThe `IR Optimizer` spec group contains `optimization keeps expressions well-scoped`, a hedgehog property that feeds generated well-scoped IR expressions through the whole `optimizedUberModule` pipeline (the full optimizer: uniquification, the optimize+dce fixpoint, and everything after it) and asserts that the result has no unbound local reference. On some inputs that call never returns.\n\nThe stall is reproducible once hspec's global seed is pinned. Over seeds 1..500 of the group, three of them — **109, 152 and 478** — never finish:\n\n```\n$ timeout 900 spec --match \"IR Optimizer\" --seed 109\nexit=124 elapsed=900s\n```\n\nA complete run of the same group takes **0.35 s**, so 900 seconds is over 2500× the normal cost, and the process was still killed by the cap rather than finishing. It is a livelock, not a memory blow-up: sampled over a minute the process holds 99.8 % of one core with a flat 50 MiB resident set, so nothing is growing — the optimizer is spinning.\n\nThe output stops at exactly the same place every time. These are the last lines before the process goes quiet, with the property that never reports:\n\n```\n    inlining bindings does not unbind let-bound references [✔]\n        ✓ property passed 1 test.\n    beta reduction does not unbind a reference shadowed by the binder [✔]\n        ✓ property passed 1 test.\n    blanking an unused shadowing binder keeps outer references bound [✔]\n        ✓ property passed 1 test.\n```\n\n`blanking an unused shadowing binder keeps outer references bound` is the test declared immediately before the property, so the hang is inside `optimization keeps expressions well-scoped` itself.\n\n## How it shows up\n\nAs an intermittent CI/local hang rather than an assertion failure: with no `--seed`, hspec draws a random one, so roughly 3 runs in 500 of that group wedge and are eventually killed by whatever timeout wraps them. Repository policy already treats a hang as a failing test, not as flakiness, but the failure mode is easy to misread because the suite prints nothing at all — the group simply stops emitting lines.\n\n## Approach\n\nThe pipeline is a fixpoint (`RunFixpoint \"optimize+dce\"`, plus the enclosing settle/lower phases), so the likeliest shape is two rewrites that undo each other on some generated term, with each round reporting `Rewritten` and the fixpoint never converging. A 1000-round backstop was added to the fixpoint in an earlier change; either these seeds spin inside a single round, or the spin is in a loop that the backstop does not cover.\n\n## Verification / Measurement\n\nThe group must complete for every seed, so the check is the same sweep that found the stall: run `spec --match \"IR Optimizer\"` over a range of pinned seeds and require that none of them exceeds a timeout generous against the 0.35 s a full run costs.\n\n```\n$ cabal build test:spec\n$ timeout 60 $(cabal list-bin spec) --match \"IR Optimizer\" --seed 109 ; echo \"exit=$?\"\n```\n\nPrints the group up to `blanking an unused shadowing binder keeps outer references bound` and then hangs; `exit=124`. Seeds 152 and 478 behave the same way. Any other seed in 1..500 completes in about a third of a second. Reproduced on `main` at d79d95f.\n\n## Prerequisites / Relations\n\nIndependent — nothing needs to land first.\n\n#345 was a different intermittent red in the same group: `freshenBinders` renamed a free reference that shared a `Let` binder's name, which surfaced as `inlines expressions referenced once` failing an alpha-equivalence check. That is fixed (#347). These three seeds hang identically before and after that fix — the same seed set, {109, 152, 478}, on both builds — so nothing about it is shared.\n\nThere is also a structural reason the two cannot be the same bug. `optimizedUberModule` begins with the uniquify pass:\n\n```haskell\n  settlePhase =\n    [ -- The entry pass (issue #139): establishes the global-uniqueness\n      -- condition (GUC = 'UniqueBinders') that every\n      -- following pass requires and preserves.\n      RunPass uniquifyPass\n    , RunFixpoint \"optimize+dce\" (optimizePass :| [dcePass])\n    , …\n```\n\nso every expression this property optimizes has globally unique binders, the discipline under which the #345 shape cannot arise. The sibling property that did catch #345 calls `optimizedExpression` on deliberately non-uniquified terms instead.\n\n## Acceptance criteria\n\n- `spec --match \"IR Optimizer\" --seed 109` terminates, and likewise for seeds 152 and 478.\n- Whatever term drives the non-termination is captured as an example-based regression test, so the fix is pinned by something that does not depend on a generator draw.\n- If the cause is a non-converging rewrite pair, the fixpoint reports a diagnosable failure (naming the passes that keep firing) rather than spinning silently.\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-07-29T09:24:03Z","url":"https://github.com/purescript-lua/purescript-lua/issues/348"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5bb8ac83-83d3-3695-a848-a29aa2da3243
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE924:2D96F1:7A908A:A4A8C0:6B00DB5F
html-safe-noncedbee7020b333167d3450bb0eeaba5ea811d3e77c22ac3aa7f546b2d674d9881e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTI0OjJEOTZGMTo3QTkwOEE6QTRBOEMwOjZCMDBEQjVGIiwidmlzaXRvcl9pZCI6IjU2MTQ3MDgzMjE0NzU5NDMyNjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac0b00c2083d2deffe85c40a8d49d17ead700624eb295a20c70563cbc503235f3a
hovercard-subject-tagissue:5007626493
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/purescript-lua/purescript-lua/348/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1fc47d0c9e3cbce75e93aea993621cdcf4624fa15ec7cd0d5578385e1c79b0a1/purescript-lua/purescript-lua/issues/348
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1fc47d0c9e3cbce75e93aea993621cdcf4624fa15ec7cd0d5578385e1c79b0a1/purescript-lua/purescript-lua/issues/348
og:image:altProblem The IR Optimizer spec group contains optimization keeps expressions well-scoped, a hedgehog property that feeds generated well-scoped IR expressions through the whole optimizedUberModule pi...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameUnisay
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
turbo-cache-controlno-preview
go-importgithub.com/purescript-lua/purescript-lua git https://github.com/purescript-lua/purescript-lua.git
octolytics-dimension-user_id131581790
octolytics-dimension-user_loginpurescript-lua
octolytics-dimension-repository_id587200487
octolytics-dimension-repository_nwopurescript-lua/purescript-lua
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id587200487
octolytics-dimension-repository_network_root_nwopurescript-lua/purescript-lua
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/purescript-lua/purescript-lua/issues/348#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2F348
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2F348
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=purescript-lua%2Fpurescript-lua
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/348
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/348
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/348
purescript-luahttps://github.com/purescript-lua
purescript-luahttps://github.com/purescript-lua/purescript-lua
Codehttps://github.com/purescript-lua/purescript-lua
Issues48 (48)https://github.com/purescript-lua/purescript-lua/issues
Pull requestshttps://github.com/purescript-lua/purescript-lua/pulls
Discussionshttps://github.com/purescript-lua/purescript-lua/discussions
Actionshttps://github.com/purescript-lua/purescript-lua/actions
Projectshttps://github.com/purescript-lua/purescript-lua/projects
Security and qualityhttps://github.com/purescript-lua/purescript-lua/security
Insightshttps://github.com/purescript-lua/purescript-lua/insights
https://github.com/purescript-lua/purescript-lua
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/348
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/348
#350https://github.com/purescript-lua/purescript-lua/pull/350
IR Optimizer spec never terminates at hspec seeds 109, 152 and 478https://github.com/purescript-lua/purescript-lua/issues/348#top
#350https://github.com/purescript-lua/purescript-lua/pull/350
area: irIR / optimizer / DCE / inlinerhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20ir%22
bugSomething isn't workinghttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/Unisay
Unisayhttps://github.com/Unisay
on Jul 29, 2026https://github.com/purescript-lua/purescript-lua/issues/348#issue-5007626493
d79d95fhttps://github.com/purescript-lua/purescript-lua/commit/d79d95febda70af2ad7c9079686bac02ae957e67
#345https://github.com/purescript-lua/purescript-lua/issues/345
#347https://github.com/purescript-lua/purescript-lua/pull/347
#345https://github.com/purescript-lua/purescript-lua/issues/345
#345https://github.com/purescript-lua/purescript-lua/issues/345
Unisayhttps://github.com/Unisay
bugSomething isn't workinghttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22bug%22
area: irIR / optimizer / DCE / inlinerhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20ir%22
on Jul 29, 2026https://github.com/purescript-lua/purescript-lua/issues/348#event-28650010540
Unisayhttps://github.com/Unisay
on Jul 29, 2026https://github.com/purescript-lua/purescript-lua/issues/348#event-28655701359
Merge pull request #350 from purescript-lua/issue-348/optimizer-fixpo…https://github.com/purescript-lua/purescript-lua/commit/501cfbd663487431be99088a6ba65a73bb30fcbf
#350https://github.com/purescript-lua/purescript-lua/pull/350
501cfbdhttps://github.com/purescript-lua/purescript-lua/commit/501cfbd663487431be99088a6ba65a73bb30fcbf
Unisayhttps://github.com/Unisay
completedhttps://github.com/purescript-lua/purescript-lua/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#350https://github.com/purescript-lua/purescript-lua/pull/350
on Jul 29, 2026https://github.com/purescript-lua/purescript-lua/issues/348#event-28655701594
Sign up for freehttps://github.com/signup?return_to=https://github.com/purescript-lua/purescript-lua/issues/348
Sign in to commenthttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/348
area: irIR / optimizer / DCE / inlinerhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20ir%22
bugSomething isn't workinghttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.