René's URL Explorer Experiment


Title: Emission-time renumbering of compiler-minted locals: keep supply history out of artifacts · Issue #306 · purescript-lua/purescript-lua · GitHub

Open Graph Title: Emission-time renumbering of compiler-minted locals: keep supply history out of artifacts · Issue #306 · purescript-lua/purescript-lua

X Title: Emission-time renumbering of compiler-minted locals: keep supply history out of artifacts · Issue #306 · purescript-lua/purescript-lua

Description: Problem Compiler-minted local names leak pipeline history into the emitted Lua text. Fresh names are drawn as x$N (rendered x_S_N by the Lua name mangler) from one monotone supply threaded through the whole IR pipeline — the uniquify pas...

Open Graph Description: Problem Compiler-minted local names leak pipeline history into the emitted Lua text. Fresh names are drawn as x$N (rendered x_S_N by the Lua name mangler) from one monotone supply threaded through ...

X Description: Problem Compiler-minted local names leak pipeline history into the emitted Lua text. Fresh names are drawn as x$N (rendered x_S_N by the Lua name mangler) from one monotone supply threaded through ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Emission-time renumbering of compiler-minted locals: keep supply history out of artifacts","articleBody":"## Problem\n\nCompiler-minted local names leak pipeline history into the emitted Lua text. Fresh names are drawn as `x$N` (rendered `x_S_N` by the Lua name mangler) from one monotone supply threaded through the whole IR pipeline — the uniquify pass, freshening on inline pastes, CSE, uncurrying all consume it — so any change that shifts the *count* of names consumed early in a module renames every later binder by a constant offset, even in code the change never touched. PR #304 showed the cost at review time: of the 26 golden modules that moved, several changed in nothing but indices (e.g. `Golden.NativeLoopsGuard`'s `v_S_1437 → v_S_1440` — the modules merely import `unsafe-coerce` transitively, and the newly lifted `λx. x` binder consumes supply indices where the binder-free accessor consumed none). This alpha-only churn is pure noise in golden diffs, inflates every optimizer PR's review surface, and forces `PSLUA_GOLDEN_ACCEPT` runs for changes that are semantically identity.\n\n## Approach\n\nNormalize at emission, not in the IR: the supply must stay global — the pipeline's unique-binders invariant (GUC) depends on it — so quarantine the fix in a late `Chunk → Chunk` pass that runs after every name-minting Lua-level transform (localization/promotion, loopification) and immediately before the printer. The pass walks the chunk and renumbers every `$N`-suffixed local binder in first-occurrence order, rewriting its references; unsuffixed names are untouched. The domain is well-defined because PureScript identifiers cannot contain `$`, so a `$`-suffix marks a compiler-minted name exclusively; sequential renumbering preserves uniqueness, so the pre-existing no-capture property carries over unchanged. Emitted names thereby become a function of the artifact's own structure — byte-stable under any upstream change that only perturbs supply consumption. Nothing semantic reads these names: FFI tables key exports by export name, the runtime-lazy factory is keyed by a string literal, and the locals/upvalue budget counting is name-agnostic. Landing the pass causes a one-time whole-corpus golden renumbering, accepted once; a possible follow-up (out of scope here) is dropping the suffix entirely where the base name is unambiguous in scope, which needs real shadowing analysis rather than renumbering.\n\n## Prerequisites / Relations\n\nIndependent. Sibling of the emission-ergonomics issues #276 (no width bound on emitted lines) and #273 (lua-language-server diagnostics on call sites); reduces the golden-churn class that #303 discusses from the harness side.\n\n## Verification / Measurement\n\nThe red is demonstrable as a differential: burn a synthetic offset of supply indices at pipeline start (a test-only knob or a prepended dummy binder) and recompile the golden corpus — today every module's `golden.lua` churns in indices; with the pass, all artifacts are byte-identical under the perturbation. Plus: the pass is idempotent (normalizing twice equals once), `luacheck` stays clean, and every hand-verified eval oracle is unchanged — renumbering is alpha-renaming by construction, and the eval goldens prove it on the corpus.\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-07-26T15:54:59Z","url":"https://github.com/purescript-lua/purescript-lua/issues/306"}

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:239a534c-69b6-a29a-eb29-22601acf700c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC94C:21AC3F:A05DD6:CEDBE8:6B00DFB6
html-safe-nonce73cfce426af93a04b46d4c77a6b4323ae26ae242a6c917e9ec9484fc79acf6b0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTRDOjIxQUMzRjpBMDVERDY6Q0VEQkU4OjZCMDBERkI2IiwidmlzaXRvcl9pZCI6IjY1NzM3NzU3ODEzOTMxMjkzOTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace609e975f611a159a33c1916c0f45258d47ee66448ce7d6f821228b83366846b
hovercard-subject-tagissue:4981336690
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/306/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6f2388907cb7ea46945d84fe41948ee3fcd2ff7261b4ca5060215e256e30ae3d/purescript-lua/purescript-lua/issues/306
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6f2388907cb7ea46945d84fe41948ee3fcd2ff7261b4ca5060215e256e30ae3d/purescript-lua/purescript-lua/issues/306
og:image:altProblem Compiler-minted local names leak pipeline history into the emitted Lua text. Fresh names are drawn as x$N (rendered x_S_N by the Lua name mangler) from one monotone supply threaded through ...
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/306#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2F306
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%2F306
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/306
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/306
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/306
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/306
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/306
#308https://github.com/purescript-lua/purescript-lua/pull/308
Emission-time renumbering of compiler-minted locals: keep supply history out of artifactshttps://github.com/purescript-lua/purescript-lua/issues/306#top
#308https://github.com/purescript-lua/purescript-lua/pull/308
area: codegenLua code generation / printinghttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20codegen%22
enhancementNew feature or requesthttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/Unisay
Unisayhttps://github.com/Unisay
on Jul 26, 2026https://github.com/purescript-lua/purescript-lua/issues/306#issue-4981336690
#304https://github.com/purescript-lua/purescript-lua/pull/304
#276https://github.com/purescript-lua/purescript-lua/issues/276
#273https://github.com/purescript-lua/purescript-lua/issues/273
#303https://github.com/purescript-lua/purescript-lua/issues/303
Unisayhttps://github.com/Unisay
enhancementNew feature or requesthttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22enhancement%22
area: codegenLua code generation / printinghttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20codegen%22
on Jul 26, 2026https://github.com/purescript-lua/purescript-lua/issues/306#event-28501969553
Unisayhttps://github.com/Unisay
completedhttps://github.com/purescript-lua/purescript-lua/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#308https://github.com/purescript-lua/purescript-lua/pull/308
on Jul 26, 2026https://github.com/purescript-lua/purescript-lua/issues/306#event-28507660922
Sign up for freehttps://github.com/signup?return_to=https://github.com/purescript-lua/purescript-lua/issues/306
Sign in to commenthttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/306
area: codegenLua code generation / printinghttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20codegen%22
enhancementNew feature or requesthttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22enhancement%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.