Skip to content

Rename locals away from every head the back end emits bare - #1371

Merged
yogthos merged 3 commits into
mainfrom
fix/site-restore-shadow
Oct 15, 2026
Merged

yogthos merged 3 commits into
mainfrom
fix/site-restore-shadow

Conversation

@yogthos

@yogthos yogthos commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

The new site-restore emits a bare pair?, and honeysql binds a local named pair?, so the restore called a boolean (41 libconformance errors). virtual-register and set-virtual-register! had the same gap.

Looking for others turned up about fifty more heads written into the output text but missing from rt-emitted-names. One predates this release: a local named fx+, fx- or fx> breaks any try/finally in its scope, because the finally's fiber mask calls them bare (0.8.21 has it too). The rest are Scheme procedures (car, cons, vector, not, string-append...) and runtime helpers at PIC, record, ffi, def and image sites. All of them are on the list now.

The list is only kept by hand, so the new emittedheads gate (in ci) reads backend_scheme.clj's string literals, collects every emitted head, and fails on any that munge-name leaves bare, except a short allowlist of prose and binders whose scope holds no user code. It reports 50 failures against main. Corpus rows cover both cases.

The restore around a non-tail call emits pair?, virtual-register and
set-virtual-register! bare, and none of them was in rt-emitted-names, so a
local with one of those names shadowed it: honeysql's (let [pair? ...]) made
the restore call its boolean, 41 library-gate errors. They join the names a
colliding local is renamed away from. Reminted.
A local named fx+, fx- or fx> broke any try/finally in its scope: the fiber
mask the finally lowers to calls them bare. A scan of the emitter's string
literals found about fifty such heads missing from rt-emitted-names, Scheme
procedures and runtime helpers alike. They are all listed now, and the new
emittedheads gate repeats the scan so a new emission site can't drift past
the list again.
@yogthos yogthos changed the title Keep site-restore's pair? and vreg heads from being shadowed by locals Rename locals away from every head the back end emits bare Oct 15, 2026
… after emitted heads

0.8.21 fails to build a program that defines vector or fx+: the def is a
Scheme define in the app unit and shadows the record ctor's (vector ...) and
the finally's (fx+ ...).
@yogthos
yogthos merged commit 80c63ee into main Oct 15, 2026
12 checks passed
@yogthos
yogthos deleted the fix/site-restore-shadow branch October 15, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant