ReviewOS

home-lang/home

perf(ts): reuse bound sources after completing program discovery

#505
Closed chris opened this 9 days ago ·
9 days ago

Follow-up to #480 and #487; tracker #416. Program.loadImportClosure currently runs full per-file checking in every discovery round. Early files retain results produced before later declarations are known; conformance compensates with recompileAll, reparsing and rebinding the complete graph. The CLI replays the early results. This is an incorrect scheduling boundary for source-owner integration and unnecessary repeated work.

Implement a retained parse/bind stage and a one-shot semantic/emit stage. Discover the complete closure using bound sources, then check against final program facts without replacing HIR, tokens, or binder owners. Preserve parser recovery spans and diagnostics after parser destruction; ensure failure cleanup and explicit invalidation/recompile behavior. Exercise serial, parallel, streaming, late-discovered declarations, and syntax recovery paths. Keep imported-type correctness gates unchanged: this scheduling work alone is not graph benchmark readmission. Record exact tests and untimed admission results, with a brief README link.

9 days ago

Implementation is in progress: prepareSource/checkPreparedSource preserve bound owner identity; closure rounds use bind-only preparation and final checking reuses the retained graph. The first driver suite passed 186/186 and program suite 105/105, including serial/parallel/streaming, zero-worker fallback, expansion of previously checked graphs, and check-failure retry. Final release/conformance validation is running. Exploration also reproduced unresolved sibling let/const globals; those are now permanent unwaived controls in audit_globals.py, not suppressed by the scheduling change. #480/#487 remain open and neither graph workload is readmitted.

9 days ago

Core changes are pushed: 4693c62 separates preparation/checking; 83d1459 integrates retained sources into serial/parallel/streaming program compilation and removes the second conformance parse/check pass. Driver 186/186, program 105/105, CLI 69/69, full conformance 1417/1417, and Python harness 33/33 pass. A two-hop CLI reference probe now accepts the valid project and reports only TS2304+TS2322 for the invalid-local variant; the prior binary emitted false TS6053/TS7017 as well. Typed global property rejection still fails and remains covered by 445422c; lexical globals by bebe678. Final documentation/checkpoint is pending. No graph readmission or new timing claim.

9 days ago

Completed in 4693c62 and 83d1459; audit controls in bebe678 and 445422c; documented in 1f76193. Final-source verification: driver 186/186, program 105/105, CLI 69/69, conformance 1417/1417 (fresh final rerun), harness 33/33. Fresh release fixes false two-hop reference/global-presence diagnostics; typed-global/imported-owner failures remain explicit in #480/#487. README and TS_PERFORMANCE.md include the updated untimed table, binary identities, reproduction, and scope limits. Both graph timing claims remain ineligible; no new timing run.

Sign in to comment on this issue.