René's URL Explorer Experiment


Title: Keep the projection's annotation when folding a record projection by Unisay · Pull Request #193 · purescript-lua/purescript-lua · GitHub

Open Graph Title: Keep the projection's annotation when folding a record projection by Unisay · Pull Request #193 · purescript-lua/purescript-lua

X Title: Keep the projection's annotation when folding a record projection by Unisay · Pull Request #193 · purescript-lua/purescript-lua

Description: Fixes #169. The leak reduceObjectProp folded { foo: v }.foo to v verbatim, root annotation included. The Linker marks exactly one shape with Just Always: a foreign accessor alias, ObjectProp (Just Always) (Ref foreign) (PropName name) (see Note [Foreign bindings structure emitted by the Linker]). The leak takes three hops: the inliner copies such an accessor into a record literal's field (a typeclass dictionary), something projects that field back out, and the fold hands the field's Just Always to the result. That annotation then becomes the root annotation of whatever binding received the fold, so isInlinableExpr passes unconditionally: the binding gets duplicated at every use site and dropped from the uber-module bindings, regardless of its use count. The fix The fold result now carries the projection node's own annotation. This needed a new setAnn in IR.Types (the symmetric setter to getAnn; nothing on main could replace a root annotation without touching the rest of the tree), applied on both the LiteralObject and ObjectUpdate paths. Why the projection's annotation and not a plain reset to noAnn: the rewrite result occupies the projection's position in the tree, and the fall-through ObjectUpdate branch already keeps ann. A reset would also silently swallow an explicit user @inline pragma placed on the projection. A test pins this choice: a field annotated Just Always projected by a node annotated Just Never folds to a Just Never result, which distinguishes the fix both from the bug (Just Always) and from the reset variant (Nothing). Tests, demonstrated red first Three rule-level tests (leak out of a record literal, leak out of an update patch, the semantics pin above) and one UberModule-level test: a binding referenced twice whose RHS folds to an Always-annotated field must survive optimizedUberModule. All four failed before the fix (the first two returned Just Always) and pass after it. Goldens No golden changed. The issue predicted that Golden.TailRecM2Shadow.Test would get its shared add binding back, but on current main that chain no longer routes the leaked annotation through a shared binding: optimizer changes merged since the issue was filed reshaped it. I verified this directly by running the golden on a pre-fix build; its output is identical to the fixed build's. The leak is latent on the committed test programs, which is why the regression tests pin it at the rule and pipeline level instead. The eval/golden.txt oracles are untouched. Relations Related to #171, which concerns the same Linker Just Always annotation but a different interaction (the bare Ref alias), and stays open.

Open Graph Description: Fixes #169. The leak reduceObjectProp folded { foo: v }.foo to v verbatim, root annotation included. The Linker marks exactly one shape with Just Always: a foreign accessor alias, ObjectProp (Just ...

X Description: Fixes #169. The leak reduceObjectProp folded { foo: v }.foo to v verbatim, root annotation included. The Linker marks exactly one shape with Just Always: a foreign accessor alias, ObjectProp (Just ...

Opengraph URL: https://github.com/purescript-lua/purescript-lua/pull/193

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e17a1595-2f13-49a9-0fb3-ca1023d6b83a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8F28:3E4205:A607EC:DFAFA7:6B00EFB4
html-safe-nonce51d738a181fc411907779b9ad7198ed0fe6900b66a37fc7281ea385541076787
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjI4OjNFNDIwNTpBNjA3RUM6REZBRkE3OjZCMDBFRkI0IiwidmlzaXRvcl9pZCI6IjY1NDQ2OTg3NDU0MjUwMzEwOTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac8c751ad5bbd69e2cbe72da5c033a9d2b3d57a1881c065ad1a4730657258a2282
hovercard-subject-tagpull_request:4000987184
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/purescript-lua/purescript-lua/pull/193/files
twitter:imagehttps://avatars.githubusercontent.com/u/1009751?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1009751?s=400&v=4
og:image:altFixes #169. The leak reduceObjectProp folded { foo: v }.foo to v verbatim, root annotation included. The Linker marks exactly one shape with Just Always: a foreign accessor alias, ObjectProp (Just ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/purescript-lua/purescript-lua/pull/193/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fpull%2F193%2Ffiles
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%2Fpull%2F193%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=purescript-lua%2Fpurescript-lua
Reloadhttps://github.com/purescript-lua/purescript-lua/pull/193/files
Reloadhttps://github.com/purescript-lua/purescript-lua/pull/193/files
Reloadhttps://github.com/purescript-lua/purescript-lua/pull/193/files
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
Sign up for GitHub https://github.com/signup?return_to=%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2Fnew%2Fchoose
Unisayhttps://github.com/Unisay
mainhttps://github.com/purescript-lua/purescript-lua/tree/main
issue-169/object-prop-annotation-leakhttps://github.com/purescript-lua/purescript-lua/tree/issue-169/object-prop-annotation-leak
Conversation 1 https://github.com/purescript-lua/purescript-lua/pull/193
Commits 1 https://github.com/purescript-lua/purescript-lua/pull/193/commits
Checks 2 https://github.com/purescript-lua/purescript-lua/pull/193/checks
Files changed https://github.com/purescript-lua/purescript-lua/pull/193/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/193/files
Keep the projection's annotation when folding a record projection https://github.com/purescript-lua/purescript-lua/pull/193/files#top
Show all changes 1 commit https://github.com/purescript-lua/purescript-lua/pull/193/files
5583785 fix: keep the projection's annotation when folding a record projectio… Unisay Jul 6, 2026 https://github.com/purescript-lua/purescript-lua/pull/193/commits/55837858c418fc1c8947bfceba92da71a2dd62d3
Clear filters https://github.com/purescript-lua/purescript-lua/pull/193/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/193/files
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/193/files
Optimizer.hs https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-487ead9d0ca9c3e6f68e23c604b0ae9070089e0dd0f7d214cdce5fbc878f3315
Types.hs https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-c628fb950daac01f47dc80a039e24b8b452f9d578ab0d55483d10758027b4884
Spec.hs https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-241ea2421c606c31b9414fb386f9f4d1beb60055ed792935b393101edfd7b949
lib/Language/PureScript/Backend/IR/Optimizer.hshttps://github.com/purescript-lua/purescript-lua/pull/193/files#diff-487ead9d0ca9c3e6f68e23c604b0ae9070089e0dd0f7d214cdce5fbc878f3315
View file https://github.com/purescript-lua/purescript-lua/blob/55837858c418fc1c8947bfceba92da71a2dd62d3/lib/Language/PureScript/Backend/IR/Optimizer.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/193/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-487ead9d0ca9c3e6f68e23c604b0ae9070089e0dd0f7d214cdce5fbc878f3315
https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-487ead9d0ca9c3e6f68e23c604b0ae9070089e0dd0f7d214cdce5fbc878f3315
https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-487ead9d0ca9c3e6f68e23c604b0ae9070089e0dd0f7d214cdce5fbc878f3315
https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-487ead9d0ca9c3e6f68e23c604b0ae9070089e0dd0f7d214cdce5fbc878f3315
lib/Language/PureScript/Backend/IR/Types.hshttps://github.com/purescript-lua/purescript-lua/pull/193/files#diff-c628fb950daac01f47dc80a039e24b8b452f9d578ab0d55483d10758027b4884
View file https://github.com/purescript-lua/purescript-lua/blob/55837858c418fc1c8947bfceba92da71a2dd62d3/lib/Language/PureScript/Backend/IR/Types.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/193/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-c628fb950daac01f47dc80a039e24b8b452f9d578ab0d55483d10758027b4884
https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-c628fb950daac01f47dc80a039e24b8b452f9d578ab0d55483d10758027b4884
test/Language/PureScript/Backend/IR/Optimizer/Spec.hshttps://github.com/purescript-lua/purescript-lua/pull/193/files#diff-241ea2421c606c31b9414fb386f9f4d1beb60055ed792935b393101edfd7b949
View file https://github.com/purescript-lua/purescript-lua/blob/55837858c418fc1c8947bfceba92da71a2dd62d3/test/Language/PureScript/Backend/IR/Optimizer/Spec.hs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/purescript-lua/purescript-lua/pull/193/{{ revealButtonHref }}
https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-241ea2421c606c31b9414fb386f9f4d1beb60055ed792935b393101edfd7b949
https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-241ea2421c606c31b9414fb386f9f4d1beb60055ed792935b393101edfd7b949
https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-241ea2421c606c31b9414fb386f9f4d1beb60055ed792935b393101edfd7b949
https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-241ea2421c606c31b9414fb386f9f4d1beb60055ed792935b393101edfd7b949
https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-241ea2421c606c31b9414fb386f9f4d1beb60055ed792935b393101edfd7b949
https://github.com/purescript-lua/purescript-lua/pull/193/files#diff-241ea2421c606c31b9414fb386f9f4d1beb60055ed792935b393101edfd7b949
Please reload this pagehttps://github.com/purescript-lua/purescript-lua/pull/193/files
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.