ReviewOS

home-lang/home

fix(ts): preserve imported class type arguments and constraints

#524
Open chris opened this 9 days ago ·
9 days ago

Follow-up to #523 and #521; imported graph parent #487; tracker #416.

The static-value checkpoint cdcb60b passes 84/84 static controls and 52/52 class-export controls. The nominal audit still fails both private-generic negative controls: cross-owner assignment is rejected, but a different type argument from the same declaration is accepted. resolveQualifiedImportNamespaceTypeRef currently reaches programExportedClassInstanceTypeForImportPath without carrying the type reference arguments. Class projection still stores simple member type names rather than complete source-owned generic semantics.

Preserve generic declaration identity and instantiate imported class references with their actual arguments, defaults and constraints. Link generic member type expressions to their declaration owner rather than a global spelling table; retain nested type structure and nominal origins. Cover named/default/namespace imports, aliases and re-exports, repeated instantiations, same-owner versus different-owner assignments, generic member containers, defaults, constraints, and root-order independence. Do not use hard-coded type names, synthetic brand properties, or new any fallbacks to manufacture passing controls.

Retain paired positive/appended-only-negative controls for all supported and unsupported cases, comparing pinned TS 6.0.3 and native TS 7.0.2. Run full regressions, document exact counts/remaining failures in TS_PERFORMANCE.md and the README, and link small conventional commits here. Private/protected inheritance remains tracked in #521; the original graph admission gates remain 0/2, so no imported-graph timing claim is eligible.

9 days ago

Checkpoint pushed to main:

  • d7f80bd: fair 100-case generic-class audit (25 families, positive/appended-only negative, both root orders).
  • f0d8481: retain optional/readonly class-field modifiers in HIR, including intervening comments.
  • af11e4e: source-owned declaration schema and collector, with identity-based parameters/references, defaults, constraints, nested annotations, recursion and explicit unsupported forms. This collector is independently tested but not yet invoked in production class collection; unused schema graphs are not allocated.
  • ca94ccc: document baseline and evidence in TS_PERFORMANCE.md and README table.

Pinned and installed binaries verified: TS 6.0.3 and native TS 7.0.2 (one native competitor). Old 7.0.0-dev.20260707.2 and version suffix mismatches are rejected. All 19 preflight tests pass.

Baseline: TS6 100/100, TS7 100/100, Home 50/100. Experimental Debug collection gives the same 50/100; static-value audit remains 84/84 for all three. No timing claim. Final foundation tests: Program 129/129 (nine schema tests), parser 898/898, driver 187/187, CLI 69/69, harness 53/53. Formatting passes; Pickier has no errors and one pre-existing README fragment warning. Full checker/conformance not rerun for this metadata-only foundation.

Next: wire a source-owned consumer that applies actual type arguments, defaults and constraints consistently for named/default/namespace references and recursively instantiates aliases without leaking free parameters or importer-local names. This issue remains open. Original graph admission remains 0/2.

9 days ago

Verified checkpoint pushed to main: audit additions 96d0da0, 71023f9, 65ea1e8, bb6f553; schema/receiver support 0a1e5af; source-owned imported generic instantiation 33ddbef; results and README table ed12aa1.

The expanded fair audit has 120 cases (30 families × positive/appended-only negative × two root orders). Identical files/options, silent positives, exact negative diagnostic multisets; no exclusions. Pinned executable versions verified: TS 6.0.3 and native TS 7.0.2 (tsgo is the TS 7 competitor, not a separate entry). Both pass 120/120. Frozen Home before: 62/120; new ReleaseFast: 118/120. All original 100 controls pass. Remaining two failures are growing-recursive-alias negatives; lazy parameterized expansion is still needed. Phantom parameters remain structurally compatible; defaults, dependent constraints, unknown arguments and explicit this receivers are covered.

Nominal controls improve 42/52 → 44/52, with eight private/protected inheritance failures remaining. Static 84/84 and bound-class 52/52 retained. Full checker 4279/4279, conformance 1417/1417, Program 130/130, driver 187/187, CLI 69/69, harness 53/53. Other release audits retain their documented results. Original workload admission remains 16/18; imported graphs remain 0/2. No new timing claim.

Evidence: bench/vs_tsgo/results/generic-classes.9vD3xi; audit-before-120.log, audit-final-120.log, admission-final.log, release-final-v2.log and individual final regression logs. Release SHA-256: 5a4127f13c8901a1899686b09ca7d62d9bf338f41ff8ea5b43c08d179d35bbb7. Full methodology and remaining limits: https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#imported-generic-class-instantiation-untimed

Keeping this issue open: growing recursive types, unsupported generic annotation forms and broader checked-type transfer are not solved by this checkpoint. Parents #521 #487; tracker #416.

9 days ago

Recursive-generic coverage expanded in 6576ff8: 192 controls across 16 families, three placements (local/named import/namespace import), positive/appended-only negative pairs, and both root orders. Frozen release 33ddbef (SHA-256 5a4127f13c8901a1899686b09ca7d62d9bf338f41ff8ea5b43c08d179d35bbb7) passes 72/192: local 8/64, named 32/64, namespace 32/64. Verified TS 6.0.3 and native TS 7.0.2 each pass 192/192. The original 120-case audit remains distinct at 118/120; no passing subset replaces the new failures.

Coverage includes fixed and growing recursion at multiple depths, mutual recursion, parameter permutation, method returns, arrays, optional unions, indexed access, keyof, inference, destructuring and structurally matching distinct recursive origins. Evidence: bench/vs_tsgo/results/recursive-generics.mlQve8/audit-before.log. The gap is broader than imported names: local class consumers also fail.

Implementation in progress: pool-owned generic declaration identities with explicit parameter IDs and a symbolic body, preserving recursive instantiation edges across type-pool transfer. This is prerequisite work for shared lazy expansion; no depth truncation or permissive fallback is being added. Full regressions are running. No new timing or success claim.

9 days ago

Verified representation checkpoint pushed: 6576ff8 adds recursive consumers, 42452f8 adds nonrecursive calibration, c6c6c66 retains generic definitions across owned type pools, and 98e39c6 publishes results plus the README table.

Final audit: 216 cases, TS 6.0.3 216/216, native TS 7.0.2 216/216, Home 96/216 (local 16/72, named 40/72, namespace 40/72). Both calibration families pass all 24 controls; the original 192 cases retain all 120 failures. Before/after definition-foundation release outcomes match exactly across all 648 compiler/case checks. The separate imported-class audit stays 118/120. Original workload admission remains 16/18, including graph admission 0/2; no new timing claim.

The new primitive stores a distinct declaration identity, its parameter TypeIds and symbolic body in the owned type pool. Recursive references retain definition/argument identities. Two-phase publication and cross-pool relocation preserve recursive edges/provenance and reject incomplete definitions; allocation failure is tested. This does not yet produce or lazily evaluate those definitions in production checking. Next work is the shared lazy evaluator and local/imported member, indexed-access, inference and relation consumers, preserving callable metadata and diagnostics. Do not replace failures with finite-depth unrolling or permissive recovery.

Verification: checker 4282/4282, conformance 1417/1417, Program 130/130, driver 187/187, CLI 69/69, harness 56/56; definition focus 4/4, transfer focus 10/10. Evidence under bench/vs_tsgo/results/recursive-generics.mlQve8. Release SHA-256 95ababead014327b0e3bc97b7909eae88aeabaf5b2542612ba79fb74ffc6e173. Details: https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#recursive-generic-consumer-baseline-untimed

Issue remains open; parents #521 #487, tracker #416.

9 days ago

Work in progress: 220a62d expands the recursive audit to 288 controls by retaining non-exported local generic classes as a fourth placement; the frozen foundation baseline is Home 112/288, TS 6.0.3 and native TS 7.0.2 both 288/288. No prior controls were removed. The uncommitted implementation now produces source-owned generic definitions, substitutes arguments while keeping nested references symbolic, and expands requested member/relation surfaces through a shared cache. Local declarations are collected without becoming importable exports. Review also caught transparent aliases overwriting another type’s recursion origin; a dedicated regression and ownership fix are being verified. Earlier verification was interrupted and is not counted as passing; fresh full suites and an immutable release build are running. No new timing claim yet; original graph admission remains unresolved. Parents #521 #487; tracker #416.

9 days ago

Pushed de72563: a separate recursive_generics throughput workload with 256 distinct payload types, four growing recursive array levels, concrete container/leaf uses, and nine appended negative controls across first/middle/last payloads. Identical project/options for TS 6.0.3, native TS 7.0.2 and Home. The frozen foundation accepts the invalid uses and is excluded from timing. The candidate Debug build passes positive plus all nine negative controls; harness 60/60. The existing 288-case audit also passes all 864 compiler/case checks on the immutable Debug candidate (Home baseline 112/288). ReleaseFast candidate SHA-256 267691e33056e2c4a8b23b757bc3eed19c8b3d90fa9407120b8985834a844ccd is now undergoing complete audits. Original 18-workload admission and its two failing graphs remain tracked separately; the added workload cannot erase those failures. Source implementation and docs are still uncommitted pending final verification; no new speed claim yet.

9 days ago

Pushed implementation 3b7f0ea as Chris Breuer, no coauthors. Immutable ReleaseFast verification: recursive 288/288 (Home baseline 112/288), imported generic classes 120/120 (previous 118/120), nominal 44/52 unchanged, static values 84/84, bound-class exports 52/52 and callable identity 56/56. TS 6.0.3 and native TS 7.0.2 pass all controls in those suites. Original workload admission remains Home 16/18; expanded set with the new recursive workload is 17/19. Both original graph rejection gates still fail and cannot be timed. Debug driver 187/187, CLI 69/69, Program 131/131, focused source-owned 9/9 and harness 60/60 pass. The pre-alias-ownership final-review source also passed checker 4284/4284 and conformance 1417/1417; full suites for the exact committed source are still running and will be reported separately. Remaining audits, gated timings and the docs/README checkpoint follow. No universal speed claim.

9 days ago

Verified checkpoint and docs are pushed: de72563 (gated recursive throughput), 3b7f0ea (lazy source-owned consumers), 74d1163 (complete-report integrity), 91d6ca8 (full results and README). All commits use Chris Breuer with no coauthors.

Release results: recursive 112/288 -> 288/288; imported generic classes 118/120 -> 120/120. Nominal 44/52, owner 10/20, globals 32/56 and bound globals 44/56 remain unchanged. Static 84/84, bound classes 52/52, callable identity 56/56, callable unions 256/256, graph discovery 28/28 and export origins 32/32 pass. TS 6.0.3 and native TS 7.0.2 pass all controls. Original admission remains Home 16/18; expanded admission 17/19. Both original graphs remain excluded from timing.

Exact committed-source suites pass: checker 4285/4285, conformance 1417/1417, Program 131/131, driver 187/187, CLI 69/69, source-owned focus 9/9, harness 66/66. Release SHA-256 267691e33056e2c4a8b23b757bc3eed19c8b3d90fa9407120b8985834a844ccd; evidence lazy-generics.2H3YDX. No interrupted run is counted as passing.

Full measurement 20260828T221149Z validates 510 round files / 1530 samples and records lower Home means on all 17 admitted timed workloads. Recursive: Home 29.7 ms vs native 71.8 ms (2.42x); independent 30-round confirmation 20260828T221611Z: 29.6 vs 73.1 ms (2.47x, Home faster 30/30 paired rounds). Large predicates: 377.0 vs 393.6 ms in the noisy full run (1.04x), 349.9 vs 392.7 ms in confirmation (1.12x, 28/30 pairs). Both runs retained separately with sample standard deviations; shared-host contention prevents a universal leadership claim. The predecessor accepts the recursive negative controls and is ineligible for before/after timing there.

Full results, limitations, hashes and reproduction: https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#lazy-generic-checkpoint-performance . Issue remains open for broader generic semantics; parents #521 #487, tracker #416 updated.

Sign in to comment on this issue.