ReviewOS

home-lang/home

perf(ts): reuse complete per-pass global reference facts

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

Current evidence

Under #416/#848, a diagnostic-only native profile of clean source 30ab18c after the accepted CommonJS path and require indexes shows repeated Program.fileReferencesGlobalName scans and importProgramGlobals dominating worker samples on the unchanged 4096-family CommonJS generator. The re-export scale profile instead emphasizes resolver/export-name queries, so the scopes are distinct. The linked diagnostic image has identical instruction-section bytes, passed all 56 official admissions with the frozen timing binary, and is never used for timings.

Proposed scope

Build complete per-pass per-file reference-presence facts once from retained HIR and reuse them across global-owner eligibility queries. Preserve the exact existing value/type/namespace distinction, declaration-name and property-key exclusions, globalThis member references, implicit declaration-owner environment, local conflicts/merges, and source replacement behavior. No dropped owners or foreign TypeIds, depth limits, benchmark recognition, or partial OOM answers. Allocation failure must retain the complete scanner behavior.

Acceptance

  • Compare indexed presence with the existing scanner over every relevant key/space and syntactic role, including nested scopes and globalThis; retain allocation-failure and source-update controls.
  • Complete Program/checker/driver/CLI gates and unchanged pinned Zod diagnostic identities.
  • Frozen exact-parent A/B on official CommonJS and generated scales, with all admissions, warmups, alternating order, raw observations, complete family screen and independent adverse-family rechecks retained.
  • Publish accepted or rejected outcomes, checksums, detailed docs and a brief README table; no new ranking without a fully admitted competitor matrix.
8 days ago

The current-source diagnostic profile and its complete evidence are published on main in 7b9e6f2, pushed as Chris without coauthors. Report: https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#cpp-admission-and-current-source-profile-2026-10-08-utc

Source 30ab18c (compiler tree unchanged through the documentation rebase), pinned Zig2163, stripped ReleaseFast native SHA-256 9b5b834b77aa4ba400e79c7acd773732e44133be4414b7a85c0e4e79327a920f. Diagnostic image instruction bytes exactly match the original section (SHA-256 46f65426e7529763f8f22e4cd9869b7f190dc9d98866a76428beb010f897557f); both images pass all 56 semantic admissions. No diagnostic image timing, altered workload, or new speed claim.

The 4096-family CommonJS sample identifies repeated fileReferencesGlobalName/importProgramGlobals work; the independent re-export sample points to resolver/export-name work instead. The evidence preserves raw native samples, both complete scale corpora, original/renamed instruction bytes and fingerprints. Archive SHA-256 7f538b457302bd0bc307065ca0b1d7895a05e3d16a1382100bae1d5a16b2bbb6, 9,794 verified checksums. Home build/profile peaked at 2,986/843 MB under the unchanged 3,840 MB lock/guard. Next is scanner-equivalent per-pass reference presence with complete owner/merge/OOM controls, followed by exact-parent A/B and all-family regression checks.

8 days ago

The implementation draft and controls are now local: complete reference presence lives in a pass-local name-to-space-mask table, with no File/Checker layout or ownership changes. The existing scanner remains the complete allocation-failure path. The initial draft passed all 246 Program tests and the supported stripped native build under 3,840 MB. Before timing, construction is now lazy on the first actual reference query, so local-only globals pay no unnecessary indexing cost; a new allocator control checks that. Full final-source Program/build gates are running before any samples. Exact parent is 7b9e6f2, whose compiler tree equals the profiled 30ab18c; the frozen parent SHA-256 is 9b5b834b77aa4ba400e79c7acd773732e44133be4414b7a85c0e4e79327a920f. No production change, push, or speed claim yet.

8 days ago

Final lazy source passes Program 247/247 and the unchanged complete checker 4526/4526. The local-only allocator control proves no reference-table allocation when all globals are local. The parity controls exhaust every interned name across value/type/namespace spaces, including declaration/property/label exclusions, shorthand/destructuring/nested references, globalThis and mixed type/value names. Allocation-failure tests walk every construction allocation until success, check partial-state cleanup, complete scanner parity and retry; source replacement rebuilds the pass-local facts. Footprints: Program 3094 MB, checker 3239 MB, under the unchanged 3840 MB guard. Supported native build, pinned Zod parent/candidate parity and driver/CLI gates are pending. The 128-test benchmark harness also passes. No samples or pushed compiler change yet.

8 days ago

Final source gates are green: Program 247/247, checker 4526/4526, driver 200/200, CLI 74/74, entrypoint 35/35; supported stripped ReleaseFast build peaked at 2895 MB under the unchanged 3840 MB guard. The existing global and bound-global audit cases (116 per compiler; 464 retained process records) all pass on pinned TS6, native TS7, exact-parent Home and candidate Home. All exact case inputs and before/after executable/payload/harness fingerprints are retained. Pinned unmodified Zod 4.5.2 has identical 195 TS + 3 HM9002 diagnostic multisets, including complete primary messages and positions; normalized SHA-256 6bf2feb527d91c651631642e523da6d28cd2b0c7ae4898cac0888aa7b420874f. This is not production admission. Candidate SHA-256 74b7c607ea47308e26e7d057b7decb258b9d52ffe6ea1730916c311f29e4296c. The frozen exact-parent screen has started, with 56 official + 8 scale positive/negative admissions required before timing. No speedup or compiler push is claimed until confirmation and regression checks finish.

8 days ago

The first frozen-parent screen finished under the unchanged guard (983 MB peak). All 64 official/scale admissions pass and all binary/input/harness fingerprints are unchanged. Unfiltered medians and paired mean-saving 95% intervals:

WorkloadParentCandidateLower candidate pairsSaving interval
Official CommonJS24.663 ms24.185 ms12/20-0.357 to +0.996 ms (inconclusive)
Same generator, 1024 families321.150 ms290.896 ms6/6+23.965 to +36.308 ms
Same generator, 4096 families3610.959 ms2775.052 ms6/6+244.235 to +1191.925 ms

These are preliminary same-parent observations, not an accepted speedup, equivalence claim, or new competitor ranking. Independent confirmation (30 official, 10 scale1024, 30 scale4096 pairs) and the full 20-family screen are now queued/running under the shared machine lock. Every raw sample is retained. Independent rechecks will include selected adverse families and the carried-forward large-predicate risk from #848 regardless of its screen threshold.

8 days ago

The complete frozen-source experiment verifies 332 paired rounds and 256 official/scale admissions across four phases, with no filtered observations and unchanged binary/input/harness fingerprints.

Independent confirmation:

  • Official CommonJS: 26.271 -> 25.519 ms, 22/30 lower candidate pairs; mean saving CI +0.084 to +0.898 ms.
  • Scale1024: 375.040 -> 324.106 ms, 9/10; CI -10.883 to +86.004 ms, retained as inconclusive despite the lower median.
  • Scale4096: 3505.488 -> 3064.615 ms, 29/30; CI +377.701 to +575.922 ms.

All 20 family screens are retained. None crossed the predeclared >3%-slower-median threshold or had a wholly negative interval. Large-predicate candidate observations at 809.312 and 572.024 ms remain in the noisy screen; its interval is -208.651 to +35.513 ms. The carried-forward independent 30-pair recheck is 259.743 -> 259.157 ms, 17/30, interval -1.115 to +2.698 ms: inconclusive, not equivalence or universal regression freedom.

Main advanced independently to bdb366c (#842 transfer scratch). The #850 draft rebased cleanly with no Program conflict. Integrated checker/Program/native-build gates are running before publication. The frozen A/B remains explicitly based on 7b9e6f2 and SHA-pinned binaries, not relabeled as a measurement of the combined transfer change; no new competitor ranking or compiler push yet.

8 days ago

Published the frozen-candidate report and evidence in 28b7134 — docs(ts): retain global reference candidate measurements (#850). Normal push to origin/main succeeded as Chris Breuer without coauthors. This commit contains ONLY README/docs and the evidence archive; the compiler draft remains local and uncommitted pending integrated verification.

README now has the brief 3-row confirmation table and links the detailed report. Both explicitly say candidate/not yet landed, preserve the 1024-family inconclusive confirmation and adverse large-predicate screen, and do not replace the current competitor ranking.

Report: https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#per-pass-global-reference-candidate-2026-10-08-utc

Evidence: bench/vs_tsgo/evidence/20261008-per-pass-global-reference-candidate-850.tar.gz — SHA-256 ddbc0e6cc1346872078a1202290a236bc52fa0f7a0fcaefac18814231ac211ed; every one of 11,754 payload checksums verifies. It retains 332 raw paired rounds, 256 admissions, all exact scale/control and semantic-audit inputs, 464 oracle process records, full correctness/build/Zod logs, source patches/snapshots and statistics verifiers. Integration on bdb366c remains a distinct pending gate, never relabeled as the frozen measurement. #850 remains open.

8 days ago

Landed and documented on origin/main as Chris Breuer, without coauthors:

  • 28b7134: frozen candidate report/evidence, accurately marked pending at publication.
  • 00a9dcf: perf(ts): reuse per-pass global reference facts (#850).
  • 211d28c: final landed status and separate integrated-source verification evidence.

The first source push lost a concurrent evidence-only race; a normal fetch/rebase/push succeeded. Compiler inputs did not change in that rebase. No force push or coauthor trailers.

The complete frozen experiment retains 332 rounds / 256 admissions and all observations: official independent confirmation 26.271 -> 25.519 ms (22/30; saving CI +0.084 to +0.898 ms); scale4096 3505.488 -> 3064.615 ms (29/30; CI +377.701 to +575.922 ms). Scale1024 confirmation remains inconclusive, and the large-predicate screen plus its independent zero-spanning recheck are preserved. No universal regression-freedom or new competitor-ranking claim.

After integrating bdb366c, checker 4527/4527, Program 247/247, supported native build, all 32 official/scale admissions, all 116 semantic global cases on each of four binaries (464 records), and identical full Zod 195 TS + 3 HM9002 diagnostics pass. Integrated native SHA-256 c16c8caaf52d35180a7fcd53b87cac0dd71ff7b86526ef285e09bb4e088335f4. Integration is correctness-only, zero timing samples, not relabeled as the frozen A/B.

README table/report: https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#per-pass-global-reference-candidate-2026-10-08-utc

Frozen archive: ddbc0e6cc1346872078a1202290a236bc52fa0f7a0fcaefac18814231ac211ed, 11754 verified checksums. Integration archive: acd2390d230a7c2bd29f65a0e9c7e804069dc97bcacdb05336128c647e9d553a, 492 verified checksums. All tests/builds/measurements preserve the 3840 MB guard, shared lock and disk floors. Targeted Pickier, Zig formatting and diff checks pass.

This closes the scoped reference-index work only. #416 overall performance, #838 the expanded/version-pinned matrix/platform scope, and #548 full production admission remain open. The next step is the fresh admitted matrix on the landed compiler, not a universal-win declaration.

Sign in to comment on this issue.