ReviewOS

home-lang/home

perf(ts): group ordered local namespace-import candidates by root and name

#857
Open chris opened this 8 days ago ·
8 days ago

Evidence and scope

Follow-up to #416/#854. Source b6608b1 / native SHA25668c6ed517f9125ae1b570ff2e585c5b368745389af828258f6621fe5e6e0311c now has direct native samples, not a relinked diagnostic image. All31 complete native admissions pass. Validated object/native layout maps only explicit raw PCs; no invented per-function counts from collapsed main labels. moduleNamespaceTypeForLocalImport offsets188/200 in both windows correspond to the original root-statement decrement/import-kind loop. Function signature scans also appear, but are a separate prospective change. This is source-level repeated-work evidence, not a CPU-share, benchmark gain or universal leadership claim. Exact-native profile archive (73checksums) SHA2560f0fb7ebcbf75e736903fd8cc8952cae9414af218289fea157f4523cdd051d60; publication pending.

The unchanged helper scans every physical root statement to find the first eligible namespace-import or require-assignment default binding by local identifier name, then performs live CommonJS/interoperability/Program/namespace type lowering. Repeated misses also scan the entire root.

Proposed implementation

Complete ordered syntax candidates keyed by physical root and interned local name, built on demand including natural absence. Preserve namespace-binding precedence, direct import-only selection (no invented export unwrapping), all original statement ordering and malformed/non-identifier handling. Group namespace/default binding candidates without caching mutable types or require eligibility; apply the existing require predicate live to matching default candidates, continue past ineligible defaults, and retain first eligible binding even when lowering returns null. No new virtual-section/visibility/prior-position filter, raw-source filename/library/benchmark shortcut, semantic cap, skipped bodies/diagnostics, or general local-declaration-index coupling. Source replacement and actual HIR growth invalidate facts. Every construction allocation failure releases partial ownership and keeps complete original scalar lookup; failed-revision behavior and already complete roots must be explicit.

Required gates and acceptance

Full scalar/node/name equivalence controls for duplicates, precedence, nested/multiple roots, type-only/direct exports, recovery order, virtual sections, live eligibility/null lowering, source replacement and real HIR growth; every forced-growth allocation failure and retry/cleanup behavior; complete diagnostic parity with scalar fallback. All checker/Program/driver/CLI/entrypoint suites, standalone native build,136 harness tests, complete unchanged pinned Zod primary diagnostic comparison. Freeze exact current-main parent, native images, patch, inputs and protocol before timing. Complete original positive/negative admission before every phase, including all15 checked-JS first/middle/last errors. Official checked-JS/512/8192 screens and independent confirmations, all20 family screens, all five large batches, independent adverse-median/negative-interval rechecks plus carried checkjs_jsdoc/deep_types/recursive_generics/type_predicates_large/reexport_graph, and independent30-pair class/interface checks. Retain every sample/attempt. Require supported target gain and reject a confirmed independent regression; no repeat-to-pass or layout tuning. Publish accepted or rejected raw checksum evidence, detailed docs and brief README table/link in small issue-linked Chris-only conventional origin/main commits, without coauthors. No implementation is pushed until those gates are met; local implementation and verification come first.

Whole goal remains incomplete: latest five-compiler snapshot Home1/20 leads,12/20 versus native TS7; Zod195TS+3HM9002 unadmitted; canonical C++ and other-platform coverage unresolved. Preserve concurrent runtime main work and verify the exact baseline before implementation.

8 days ago

Baseline frozen after profile publication at exact parent88a8c2d39c5608be367e75f8379d572b4f571c29, clean matching native SHA25668c6ed517f9125ae1b570ff2e585c5b368745389af828258f6621fe5e6e0311c. Local candidate now groups complete original-order direct namespace/default import candidates by physical root and local interned name; require eligibility and every original live lowering branch remain in the original lookup loop. Source replacement/HIR growth release facts, allocation failures release partials and use complete scalar statements, complete cached roots remain usable after another root fails. No general local-declaration-index coupling, type cache, new section/visibility/position filter or filename shortcut. Added initial scalar/root/name/ordering, live source eligibility/reset, namespace precedence/actual HIR growth, every forced-growth construction failure, and full diagnostic controls. Unfiltered initial checker run is live; additional adversarial controls and every remaining full gate required before freezing/timing. No candidate source commit, push, performance result or acceptance yet.

8 days ago

Initial unfiltered candidate checker suite passed all4558 tests, peak3405MB under unchanged3840MB guard. Complete initial draft retained (patchSHA256043cea7be50b4b0e97705364044d215d26d3ad891a4a81843ef2d524cb1ad35d) against frozen exact parent88a8c2d39c5608be367e75f8379d572b4f571c29/native68c6ed51. Two additional semantic controls now cover retaining already-complete roots after another root allocation fails, no failed-revision retries until actual HIR growth, first eligible missing-module null lowering, and recovery/use-before-import positions without invented filtering. Updated full checker suite is live; runtime design unchanged, only controls added. Every remaining module/build/Zod/harness/admission gate and final source/protocol freeze remain required before any measurement. No candidate timing, acceptance, production source commit or push.

8 days ago

Seven-control unfiltered checker passed all4560 tests (initial five-control4558 pass retained). Eighth control adds malformed non-identifier namespace precedence over valid default binding, missing source, invalid/equal/out-of-bounds spans and complete scalar selection parity. Final eight-control patch frozen before final gates/timing: SHA256e3234d7b55a978c565876fd382220f26850e4b6688dfff553281637d9e122fc6; exact parent88a8c2d39c5608be367e75f8379d572b4f571c29/native68c6ed51. Full frozen timing protocol SHA256a64c278e7e156d223bd628c1cb2bef3c50fcba9d5d0926abdddd5ba8e0567809: complete original admissions before each phase, official/512/8192 screen and independent confirmation, all20-family screen, all five large6-pair batches, predeclared adverse selectors plus checkjs/deep/recursive/predicate/reexport carries, independent30-pair class/interface controls. Exact pair and supplemental batch intervals retained; reject any confirmed independent regression and require supported target gain, no exclusions/repeat-to-pass/layout tuning. Current final checker live; Program/driver/CLI/entrypoint/build/complete Zod/harness gates remain mandatory before measurement. Runtime unchanged during added controls; no candidate timing/commit/push.

8 days ago

Final eight-control frozen source passed all4561 unfiltered checker tests, peak3448MB under unchanged3840MB guard. Earlier4558 and4560 full passes retained, no test filters/skips. Source/test patch e3234d7b55a978c565876fd382220f26850e4b6688dfff553281637d9e122fc6 and protocol a64c278e7e156d223bd628c1cb2bef3c50fcba9d5d0926abdddd5ba8e0567809 remain frozen. Cached final-checker confirmation plus full Program/driver/CLI/entrypoint/native-build/complete pinned-Zod comparison/136-harness gates are now running through the shared bounded runner. Timing cannot start before all pass and source/native/inputs are captured unchanged. No candidate timing, source commit, push or acceptance claim yet.

8 days ago

Frozen final candidate validation progress: checker4561 (full and cached confirmation) and Program251 all pass without filters/skips. Program peak3242MB under unchanged3840MB ceiling. Same final source/test patch e3234d7b55a978c565876fd382220f26850e4b6688dfff553281637d9e122fc6 and protocol a64c278e7e156d223bd628c1cb2bef3c50fcba9d5d0926abdddd5ba8e0567809; exact parent88a8c2d39/native68c6ed51 remains frozen. Driver/CLI/entrypoint/native build/complete Zod diagnostic comparison/136-test harness continue in the same serialized gate job. No timing, acceptance or candidate push yet. Full predeclared family screens, five large batches and every independent adverse-risk check remain required.

8 days ago

Same frozen final candidate now passes checker4561, Program251 and driver200 complete unfiltered suites. Driver peak2911MB under unchanged3840MB guard. CLI/entrypoint/native-build/complete pinned-Zod diagnostic parity/136-harness gates remain live in the same serialized job. Patch e3234d7b55a978c565876fd382220f26850e4b6688dfff553281637d9e122fc6/protocol a64c278e7e156d223bd628c1cb2bef3c50fcba9d5d0926abdddd5ba8e0567809 unchanged. Prepared documentation checks compare full tables/README medians and intervals to all raw observations for either accepted or rejected outcome. No candidate timing, source commit/push, gain or acceptance claim yet.

8 days ago

All final pre-timing gates pass: checker4561 (full/cached), Program251, driver200, CLI76, entrypoint38, stripped ReleaseFast native build and136 harness tests. Complete unchanged Zod4.5.2 primary diagnostics identical:195TS+3HM9002=198, normalizedSHA2566bf2feb527d91c651631642e523da6d28cd2b0c7ae4898cac0888aa7b420874f, still unadmitted. Native candidateSHA2561b3330a32a5ebcec0cc7783a2d086531a28e5675ff2298b0e95cc636527cd612; parent68c6ed517f9125ae1b570ff2e585c5b368745389af828258f6621fe5e6e0311c on exact88a8c2d39. Source/test patch e3234d7b55a978c565876fd382220f26850e4b6688dfff553281637d9e122fc6 and protocol a64c278e7e156d223bd628c1cb2bef3c50fcba9d5d0926abdddd5ba8e0567809 verified unchanged. Complete frozen A/B is now live only after every gate passed. All original positive/negative admission before each phase, five predeclared large batches, all20-family screen, carried-risk and class/interface30-pair controls retained. No candidate production commit/push, acceptance or speed claim before complete verified outcomes.

8 days ago

Frozen native A/B first phases verified:92 original rounds/132 admissions, stable fingerprints. Official screen25.660146/25.649542ms (9/20; saving95% -0.201298..+0.228819ms),512screen110.262521/111.034188ms (4/6; -2.168342..+2.326412ms),8192screen6.894239355/6.401856604s (6/6; +0.439000..+0.637418s,7.1% lower median). Independent official26.819708/26.732625ms (18/30; -0.116860..+0.760557ms) remains inconclusive. Independent512113.317229/110.762855ms (28/30; +1.165597..+3.011559ms,2.3% lower median). The slower/inconclusive initial512 screen remains, no replacement/exclusion. Full20-family screen is live; five predeclared large batches and all carried/declaration-risk confirmations remain required before acceptance. No candidate commit/push or universal/competitor gain claim.

8 days ago

Full20-family screen completed, retaining all292 original rounds/198 admissions so far. Two adverse screen intervals are now mandatory independent30-pair rechecks: control_flow parent25.672271/candidate26.018667ms,4/10 faster, paired saving95% [-0.892947,-0.037620]ms; destructuring14.650938/15.151271ms,2/10 faster,[-0.592631,-0.067560]ms. These are screen warnings, not independent confirmations, and target gains do not erase them. Selected rechecks: checkjs_jsdoc, control_flow, deep_types, destructuring, recursive_generics, reexport_graph, type_predicates_large. All five8192-family batches are now live, then all seven rechecks and independentclass/interface controls. Stable frozen patch/protocol/native/input fingerprints; no source edits, observations excluded, retries-to-pass, acceptance, candidate commit or push.

8 days ago

First of five predeclared8192-family independent batches completed: parent median6.830905938s/candidate6.238544104s,8.7% lower,6/6 candidate faster, paired saving95% [+0.506874518,+0.663470704]s. Partial verifier confirms298 original rounds/264 admissions with stable fingerprints. Four further batches, all seven selected30-pair carried/adverse rechecks (including control_flow and destructuring screen warnings), and independent class/interface30-pair controls remain mandatory. All observations retained, source/protocol unchanged; target gain does not override an independent regression. No acceptance, candidate commit/push or universal/competitor ranking claim yet.

8 days ago

Second predeclared8192-family batch complete: parent median6.801149333s/candidate6.262904167s,7.9% lower,6/6 faster, paired saving95% [+0.474144828,+0.656200283]s. All12 pairs across first two batches favor candidate, but remaining three batches and all seven independent carried/adverse rechecks plus class/interface controls are still mandatory. Partial verifier confirms304 original rounds/330 admissions; stable provenance, no discarded observations, source/protocol changes, repeats-to-pass or candidate push. Control-flow/destructuring screen warnings remain explicitly retained until independent confirmation; no acceptance or all-benchmark claim.

8 days ago

Third predeclared8192-family batch complete, all original samples retained: parent median6.980379396s/candidate6.357736125s (~8.9% lower),6/6 faster, paired saving95% [+0.418310182,+0.939442527]s. All18 first-three-batch pairs favor candidate, but two further batches and seven independent carried/adverse rechecks plus class/interface checks remain required. Partial verifier confirms310 rounds/396 admissions; stable fingerprints. Next phase waits on the shared lock for an unrelated native runtime build; do not stop it, weaken guard, duplicate work or infer a timing failure from the wait. Both control_flow/destructuring screen warnings remain for independent confirmation. No acceptance, candidate commit/push or universal gain claim.

8 days ago

Fourth predeclared8192-family batch completed without restarting: parent median6.841696250s/candidate6.270455646s (~8.3% lower),6/6 faster, paired saving95% [+0.472241409,+0.675177077]s. All24 pairs across first four batches favor candidate. Partial verifier confirms316 original rounds/462 admissions. Shared-lock delay retained; unrelated processes not stopped and limits unchanged. Final large batch plus all seven carried/adverse30-pair rechecks and independentclass/interface30-pair checks remain mandatory, especially retained control_flow/destructuring screen warnings. No acceptance, candidate commit/push or universal gain claim.

8 days ago

Complete frozen protocol verified:592 original rounds/660 admissions. Candidate REJECTED by independent destructuring recheck: parent13.908146ms/candidate14.030042ms, only9/30 faster, paired saving95% [-0.237131681,-0.028968253]ms. Positive target evidence does not override this:512 independent2.3% lower;8192 pooled6.823086895→6.281212312s,7.9% lower,30/30 faster, paired95% [+0.506043989,+0.630442605]s and five-batch interval [+0.461711151,+0.674775444]s. All five batches, variable observations and seven carried/adverse rechecks retained. Control-flow independent interval spans zero (slower median); predicate/deep/recursive warnings remain, no equivalence claim. Class inconclusive, interface positive. All source/test candidate changes removed with exact apply_patch reversal matching frozen patch; original native68c6ed51 restored byte-for-byte. Current clean main fast-forward preserves newer runtime commits at1d50e79971dfd0beb244502505f3497f20b08b07. Matching clean restoration build is live; candidate was never committed/pushed. Complete rejection docs/README table/raw checksum evidence follow. No repeat-to-pass, layout tuning, excluded observations or universal claim.

8 days ago

Restoration verified: clean current main1d50e79971dfd0beb244502505f3497f20b08b07 standalone stripped ReleaseFast build passes and reproduces original native SHA25668c6ed517f9125ae1b570ff2e585c5b368745389af828258f6621fe5e6e0311c, peak3101MB. Candidate and all eight index-specific controls removed with exact owned patch reversal; neither was committed/pushed. Newer Worker/WebSocket/runtime documentation commits preserved by fast-forward. All measurement/restoration jobs terminal0; final592-round/660-admission rejection record complete. Independent destructuring[-0.237132,-0.028968]ms interval determines rejection despite7.9% large median gain/30of30 faster. Full evidence and docs/brief README table publication is the next step; all data and warnings remain, no retesting/layout tuning to alter decision.

8 days ago

Complete rejection publication pushed to origin/main as Chris-only conventional commitaea27323599a13051ce1bfb8a98a19f4de457d1d, no coauthors. README brief table plus full592-round/660-admission report: https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#ordered-namespace-import-candidates-2026-10-09-utc . Immutable1725-checksum archive SHA25676786c37f15e3f68a9f950a8e2853a1d78004a1739ccf724005425d7494ed3ae; publication context12 checksums SHA256e7c2e0025c47ff1096be5ea8d52e30bb9cf1436ddc976208667a2a08053adc0c. Rejected runtime/eight controls fully removed, original native68c6ed51 reproduced on clean restoration and newer main f1e2d94, preserving runtime work. Independent destructuring[-0.237,-0.029]ms saving interval determines rejection despite2.3% medium/7.9% large gain and30/30 large wins; all slower/inconclusive samples, predicate/deep/recursive/control warnings, five batches and shared-lock delays retained. Final changed Markdown passes Pickier; full repo still11460 errors10613warnings, no auto-fix. No source retest/layout tweak/new competitor ranking/universal claim. Issue remains open for materially different logical work, not revival of this rejected binary.

Sign in to comment on this issue.