Skip to content

c_import facade over an omitted function (#2244); unsafe calls in generic templates (#2235); per-target C aliases (#2176); migrate rule tags for migrate_diff (#2230) - #2247

Merged
ehartford merged 9 commits into
mainfrom
facade-loud
Oct 7, 2026

Conversation

@ehartford

@ehartford ehartford commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

One branch, seven layers, one battery:

Gate green on f366957; battery pending.

Eric Hartford added 2 commits October 7, 2026 02:56
…lared-and-omitted name is a hard error (#2244)

A `c facade` item over a function the translator omitted reported "is
not a declaration in scope", hiding the reason; it now names the
omission and its reason, as any other use of the name does
(emit_ci_omitted_symbol_error). And the shape #2244 found — the
translator recorded a body as omitted yet still declared the name, so
the facade was accepted and the call trapped — is refused at the
import: a name both declared by the translation and recorded as omitted
is a hard error naming the function and the reason, never a stub.
… the declaration (#2235)

Whether a call needs an unsafe context is a property of the spelling,
not of T. A generic owner's method has no signature until an
instantiation and its body check returned at `sig_idx < 0`, so a library
whose generic impl called an `unsafe fn` bare passed `with check` until a
consumer instantiated it (trie, sorted_vec, hash_index on #2208). The
template body is now checked for that once, at its declaration: a free
function named by an identifier (not shadowed by a parameter) and the
owner's own method through `self.m(...)` resolve without T, through the
generic-aware decl map; a call that depends on T still waits for the
instantiation, and an `unsafe fn` template is its own context.
@ehartford ehartford changed the title c_import facade over an omitted function names the omission; declared-and-omitted is a hard error (#2244) c_import facade over an omitted function names the omission (#2244); unsafe calls in generic templates are checked at the declaration (#2235) Oct 7, 2026
Eric Hartford added 6 commits October 7, 2026 03:28
`long` is 32 bits on Windows and wasm32, `char` is unsigned on AArch64
Linux and wasm, and `long double` has a With float only where it is 64
bits (AArch64 Darwin, Windows); c_import and the migrate preamble emitted
the arm64 macOS table for every target. One helper
(ci_c_type_aliases) now derives the table from the parsed target — the
Windows selection or a named C model's triple, else the active target —
and a declaration that needs an unrepresentable `long double` is omitted
with that reason instead of aliased to f64. A cross target hands clang its
triple, so the C side parses as that target too (c_import still refuses a
cross target before parsing; the hook is the right half of that refusal).
The migrated corpora name an arm64 Darwin model and keep their bytes.
…n's body is evidence for its own parameters (#2230, D107)

The migration differential's second half: the migrator records each
rewrite rule it applies — D101's `{0}` and memset-to-zero rewrites to
`T.zeroed()`, D107's nullable-by-evidence parameters and the NULL-compare
folds they license — as `rule<TAB>function<TAB>detail`, one line per
distinct site, written as `rules.tsv` beside a directory migration's
output (never promoted). tools/migrate_diff.w names the rules under each
function whose lowering differs, and says when none was recorded: a
difference that is not a migrator rewrite.

The smoke found a D107 gap: the scan recorded a static definition's NULL
callers but never its own body, so a static callee with a NULL test and a
NULL caller rendered non-null and its test folded. A static definition
now records its own evidence as a header-owned inline does (name-keyed:
a second static of the same name in another unit keeps the first's). The
nullable selfhost case gains a static callee.
…re indexed; the generic gate hooks leave the module context alone

The re-promote under static-definition evidence found three defects:
the resolver's sink-chain walk had no visited set and went exponential
over helpers that forward one callback to several (tommyds and
c-algorithms ran past 20 minutes); find_symbol was a linear scan under
it (now a key index kept at ensure_symbol); and the #2235 gate hooks
called update_module_context for a generic declaration reached
callee-first from inside another body without restoring it, so the rest
of that body was checked under the wrong module (zlib's example.w failed
an Option-to-Option assignment).
…helpers' tested or NULL-passed callbacks are Option
…ot the driver

corpus_compile_binary built zlib's example and minigzip through the
Workspace API, which is the driver — the pinned seed — with the seed's
embedded bundle interface standing in for the corpus. The seed could no
longer type the corpus (zlib's Option callbacks), so zlib-build failed
under every fresh compiler that accepted the same file, and a migration
that changed a signature could never pass it: the pcre2 cohesive check's
defect, in the second place it lived. The binary is now the release
compiler's as a subprocess, the corpus on its source and the prelude off.
@ehartford ehartford changed the title c_import facade over an omitted function names the omission (#2244); unsafe calls in generic templates are checked at the declaration (#2235) c_import facade over an omitted function (#2244); unsafe calls in generic templates (#2235); per-target C aliases (#2176); migrate rule tags for migrate_diff (#2230) Oct 7, 2026
…ifferently on stage1 and the release compiler, #2248)
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on 4bd97c6 (gate 16s, uat 16s, battery-checks 98s; the fixture fix on top of the full green run on f366957 minus that one red test). Driven by the pinned seed; logs in out/battery/.

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