ReviewOS

home-lang/home

fix(ts): preserve imported class static types in value consumers

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

Follow-up to #522 and #521; parent #487; tracker #416.

The bound class collector now preserves actual declaration owners, export aliases, static fields and merged namespace visibility (b45b038). The 52-case class audit still has four failures: static-member type rejection and hidden merged-namespace member rejection, each with the app before/after declaration roots. The nominal audit also retains two private-static identity failures.

Trace and fix the imported-value consumer path. Known class constructor types must not be erased by presence-only any fallbacks. Namespace imports must obtain value-space types from the correct exported declarations, while preserving type-only restrictions, default/named aliases, lexical shadowing, mixed exports, and distinct declaration ownership. Do not synthesize an incomplete closed namespace or use special-case diagnostic suppression.

Retain all failing controls; add fair paired controls for the affected import forms and type-only/shadowing boundaries. Compare pinned TS 6.0.3 with native TS 7.0.2 (one competitor), run checker/Program/conformance regressions, and document all counts in TS_PERFORMANCE.md and the README. Original imported graph admission remains 0/2; no graph timing claim is eligible.

Evidence: bench/vs_tsgo/results/bound-classes.8s4Xq1, bindings-v1.log and nominal_origins-v1.log. Release binary SHA-256: 7f71d18f3a1648032b346183267382573f02475b824f5db8c30e0cc463568bd2.

8 days ago

Fair audit controls are pushed in 232961504 and 170613d. Expanded baseline: TS 6.0.3 and native TS 7.0.2 each pass 76/76; Home passes 48/76. This includes captures, destructuring, element access, mixed exports, name isolation, type-only restrictions, cyclic namespaces and a 41-link star chain. Both root orders and appended-only negatives remain mandatory.

Initial implementation passed the original 68/68 static-value controls and 52/52 class-export controls in Debug, but the added cycle control exposed an infinite containsFreeTypeParameter traversal. The failing test and stack sample are retained; replacing that walk with a visited worklist now, without dropping the cycle control. No final release claim yet. Evidence: bench/vs_tsgo/results/static-values.csYPot.

8 days ago

Shipped and verified on origin/main as Chris Breuer, without coauthors:

Final ReleaseFast results, against verified TS 6.0.3 and native TS 7.0.2:

  • Static-value controls: Home 52/84 -> 84/84; both baselines 84/84.
  • Class-export controls: 48/52 -> 52/52; both baselines 52/52.
  • Nominal identity: 40/52 -> 42/52; remaining generic and inheritance failures retained.
  • Existing owner/global/bound-global counts unchanged; discovery/export-origin and callable audits retain all passes.

Checker 4274/4274, conformance 1417/1417, Program 120/120, driver 187/187, CLI 69/69, harness 50/50. Formatting passes; Pickier has no errors and one pre-existing README fragment warning. The cycle regression was kept, its initial non-terminating run stopped and sampled, and the traversal fixed with a visited worklist. Full workload admission remains Home 16/18 vs baselines 18/18: original graph gates remain 0/2, with no new timing claims.

Evidence: bench/vs_tsgo/results/static-values.csYPot; final binary home-final SHA-256 9fb67479dbd422678c617facf686d4a09317658e7c4a871084db906bf12572c1. Detailed results: https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#imported-static-values-and-module-namespace-consumers-untimed

This completes the static-value consumer checkpoint, not full checked-type transfer. Next generic-argument/default/constraint linkage is tracked in #524; inheritance remains in #521/#487.

Sign in to comment on this issue.