ReviewOS

home-lang/home

refactor(ts): establish program-wide name identity for typed declaration linkage

#515
Closed chris opened this 8 days ago ·
8 days ago

Required integration work for #480 and #487; tracker #416. Current Program files each own an independent string-ID keyspace as well as their local HIR/type metadata. Cross-file declaration lookup needs stable program name identity without losing each declaration owner or flattening module-local symbols.

Implement a reference-counted shared string store, retain it through per-file Compilation handles, and use one store across serial, parallel, streaming, bind-only and recompile Program paths. Preserve independently owned per-file HIR, binder symbols and type metadata. Verify allocation-failure cleanup, concurrent sharing, surviving-owner lifetime, repeated compilation, module-name isolation, and unchanged diagnostics. Build declaration-owner lookup on real bound declarations rather than text concatenation or foreign local IDs.

This is part of actual typed global/import resolution, not graph benchmark readmission. Keep #480/#487 and both unchanged graph rejection gates open until full typed lookup and cycles work. Document any measured results separately from semantic completeness.

8 days ago

Pushed ac52b62 (Refs #515/#480/#487/#416): one reference-counted sharded name store per Program, retained by independent source owners. Interner 16/16, driver 187/187, program 107/107 passed, including allocation failure, concurrent handles, fresh serial/parallel/streaming paths, recompilation and module isolation. Next candidate replaces two raw global-name scans with an owner-preserving bound symbol index and corrects var/loop scope binding. A new untimed audit keeps missing-name, module/scope-isolation AND wrong-type controls, in both root orders. Full typed linkage and graph admission remain unresolved.

8 days ago

Completed the scoped name-identity and bound-owner work in five small commits: ac52b62 (shared store), 3f1c34e (56-case audit), 0a296c1 (var scope), 347693b (bound owner index), and 0e3049c (README/docs). Final evidence: interner 16/16, binder 21/21, driver 187/187, program 109/109, checker 4,261/4,261, conformance 1,417/1,417, harness 38/38. The audit improves Home 22/56 to 44/56; both TS baselines are 56/56. All 12 remaining Home failures are unchanged wrong-type controls, proving shared names do not pretend to link foreign TypeIds. Both graph rejection gates still fail and no timings/results were created. Final ReleaseFast SHA-256: 0b7289905e110f79611a967097cab671ef1726e5ae06a60cfaf7bb8a26b604ea. This closes only #515; #480, #487, and #416 remain active.

Sign in to comment on this issue.