You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Campaign: migrate compiler id spaces to enforced-distinct types (NodeId, Symbol, TypeId, FileId) #666
The #660 class (a symbol id read as a node id) is representable because every compiler id space is a transparent i32. With has distinct types (§4.x, behav_distinct_compat.w) and the compiler now carries its first one: AstFileId (Ast.w, the per-node file column API). This campaign extends that to the load-bearing spaces.
Staged recipe (one space per stage, each gated by full build+fixpoint+test)
FileId (~50 sites): unify Ast.AstFileId with compiler/foundation/Ids.FileId (currently a transparent alias — flip it to distinct), thread through Span.file, Lexer.file_id, Parser.file_id, Zcu source tables. Smallest space, proves the recipe end-to-end.
TypeId (~hundreds): already aliased in Sema; flip to distinct, use the build-error list as the work queue (the flag-day 'red build is the instrument' protocol from D7).
Symbol (~hundreds): parser/intern pool tier.
NodeId (~thousands): last, biggest; after 1-3 the remaining mixing sites are precisely the interesting ones.
Rules
Each stage is a flag-day: flip the alias, let the compiler enumerate every mixing site, fix mechanically (explicit casts only at true boundaries: serialization, hashing, extra-pool packing).
Every explicit as i32 that survives a stage is a documented boundary, greppable forever.
Two-generation verification per stage; reseed between stages if the seed can no longer parse the tree.
Cross-pool id translation sites (codegen intern vs sema pool) become typed conversions instead of silent reuse.
Payoff: the #660/#663 class becomes a compile error; the pool-probing discriminators and their audits become redundant where adopted.
Triage 2026-10-25, with v0.15.3.0 (main a261b65): still open. Only the pilot exists: type AstFileId = distinct i32 (src/Ast.w); NodeId, Symbol and TypeId are still transparent i32.
Activity
Ast: per-node file-id column + AstFileId distinct-type pilot
ehartford commentedon Oct 25, 2026
Triage 2026-10-25,
with v0.15.3.0(main a261b65): still open. Only the pilot exists:type AstFileId = distinct i32(src/Ast.w); NodeId, Symbol and TypeId are still transparenti32.post-release: a staged compiler-wide campaign.