ReviewOS

home-lang/home

perf(ts): reuse coherent ordered binding facts for function-signature collection

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

Evidence and scope

Follow-up to #416/#854 after rejected #857. Exact native68c6ed517f9125ae1b570ff2e585c5b368745389af828258f6621fe5e6e0311c on sourceb6608b14c has explicitly displayed collectFunctionSignaturesFromStatements offsets36/56 early and36/96 middle; actual native disassembly maps scan instructions. Collapsed native sample group counts/ellipses are not invented function CPU shares. Current clean mainaea27323599a13051ce1bfb8a98a19f4de457d1d preserves runtime work and the same compiler bytes. Latest complete competitor result remains Home1/20 leads,12/20 versus native TS7.

Current collector directly unwraps one export layer, selects all named fn_decl nodes in original input order and reads current signature TypeIds/flags live. Caller stops immediately after a namespace collection, but only stops a block walk once output is nonempty. No current-section/visibility/prior-position rule exists in this physical statement scan.

Read-only source audit: LocalValueContainerIndex retains only first declaration per name/section, so cannot directly supply all overloads. Binder Symbol.decls retains merged declarations, but ownership/container identity, original order, augmentation and HIR coherence cannot be assumed. A standalone two-test characterization probe passed representative exact-container filtering/order across overloads, exports, named expressions, nested blocks/functions, separate namespaces, parameters and virtual sections. A real HIR-growth control explicitly proves stale bound declarations are incomplete (scalar2 declarations, binder1). This is a limited selection characterization, not a full semantic suite, implementation, gain or compatibility claim. Initial launcher failed before compilation due incorrect Zig lib path; failure retained and path fixed, no compiler/corpus/timing changed.

Proposed direction

Prefer coherent reuse of already bound candidate facts over another independent per-checker cache. Introduce only the ownership/completeness/revision association actually needed, with precise physical container/direct-export identity and all original declaration ordering. Preserve namespace/block caller stopping rules, live current TypeIds/signature flags and append-error behavior. Binding facts with absent/stale ownership, incomplete/failed construction, HIR growth, augmentation/foreign declarations or unsupported association must use the complete original scalar path. Do not substitute first-declaration indexes, sort recovery positions, introduce section/name/library/benchmark filters, cache mutable types, cap declarations or skip bodies/diagnostics. No general local-value index construction change merely to force reuse. Exact implementation/coverage must be proved before claiming a fast path; all-container optimization remains part of the end goal, not silently redefined to root-only success.

Required validation and acceptance

Complete scalar selection/signature/diagnostic controls for overloads/duplicates/order, namespace and block stopping, direct/nested exports, named expressions, parameter/name collisions, virtual sections, malformed/recovery roots, current TypeId changes, owner/source replacement, real HIR growth, augmentation/foreign identifiers, absent binding and every OOM/partial construction/append-error behavior. Full binder and checker/Program/driver/CLI/entrypoint suites, native build,136 harness tests and complete unchanged pinned Zod diagnostic comparison. Freeze exact current-main parent/native/patch/inputs/protocol before timings; complete original positive/negative admission before every phase including full checked-JS first/middle/last errors. All original official/scaling confirmations,20-family screen, all predeclared large batches and independent adverse-risk rechecks. Carry destructuring/control_flow plus checkjs/deep/recursive/predicates/reexports and class/interface risks. A supported target gain cannot override any confirmed independent regression. Retain every original observation/attempt; no repeat-to-pass or layout/alignment tuning. Publish accepted or rejected raw checksums/full docs/brief README tables and link issues in small Chris-only conventional origin/main commits without coauthors. No candidate production push before complete verification. Universal performance, Zod195TS+3HM9002 admission, canonical C++ and other-platform coverage remain incomplete.

8 days ago

Characterization source/log pinned: probeSHA256684094af728418a9dbdeae5baf52c7059883033c85ea0aed2d15e912763f51de; logSHA256d048c7f5ba8e7a41162c8d2fee807adbc269294ad9e428bc7bc6b79416f573d0. Both standalone selection tests pass unfiltered, peak360MB under unchanged3840MB guard. This is exactly2 characterization tests, not a full binder/checker suite or performance result. Four representative source layouts cover overload/direct-export/named-expression/nested-block/function/parameter/namespace/virtual-section selection order via exact physical-container filtering. Real HIR growth inserts new higherNodeId function first; complete scalar collector finds2 while old bound candidate list finds1. Current Binder.Module lacks owner/root/revision/completeness association for guarded reuse; module.root introducingNode is none, function body binding uses function scope rather than a distinct body-block scope. Existing local-value index retains first declaration only and cannot substitute complete overloads. Need explicit coherence/fallback contract and further augmentation/foreign-owner/recovery tests before any source implementation. Launcher path failure retained, corrected same probe without modifying compiler or timing. Worktree remains clean ataea27323599a13051ce1bfb8a98a19f4de457d1d/native68c6ed51. No candidate, timing, gain or broader completion claim.

8 days ago

Expanded standalone audit now4/4 passes, peak349MB, sourceSHA2561890c0422902d229b59c2f9e34ac7cb36a7cc68bc15385c3ad5167aaa36fd11c/logSHA256ee2359b8fd068cab7ae25cf31dfa2dc3e78011f108217c72a279ad09f961f83d. New controls prove augmentation produces foreign equal NodeIds (complete scalar1 vs filtered bound2), and borrowed shared symbols can be extended through another module without changing the source HIR (again scalar1,bound2). Therefore owner pointer/node-count alone cannot justify mutable Symbol.decls reuse; no unguarded binder fast path will be implemented. Existing first-declaration local-value map also incomplete for all overloads. A separate already-owned Checker forward_overload_groups_by_root table exists, but currently excludes ordinary functions/single declarations (requires>=2 with bodyless declaration) and unwraps exports recursively, unlike this collector single-layer rule. Investigate complete physical-container syntax facts shared with that forward-overload consumer: preserve its original lazy qualification/checking and this collector direct-export/liveTypeId/block-namespace semantics; all-container completeness/source-HIR invalidation/OOM/active borrowed-list lifetime required. Do not substitute sparse group absence for complete absence or change binder/general-index construction just to force reuse. Four characterization tests only, not full semantic gates/performance evidence. Current source unchanged/clean mainaea273235/native68c6ed51; all #857 and prior adverse-risk controls remain. Both earlier two-test outputs and launcher failure preserved.

8 days ago

Implementation direction changed by proven audit constraints: four standalone controls rule out unguarded mutable binder Symbol.decls reuse (growth incomplete, augmentation foreign equal NodeIds, shared-symbol mutation without owner HIR growth). Current local candidate instead reuses the existing forward-overload table as complete immutable physical-container statement groups, one-pass original order, ordinary functions included, raw statement IDs retained. The forward consumer still recursively unwraps exports, requires>=2 declarations with some bodyless declaration and lowers lazily only requested group. Signature collector keeps single-export unwrapping, liveTypeId/flags, append errors and original block/namespace stopping; snapshot construction OOM uses full scalar collection. Per-snapshot HIR count and retained ownership pin active groups through replacement, source reset or nested checking; no separate Checker cache, binder/general-index construction change, filters/type caches/caps/source-name shortcut/layout tuning. Clean exact parentaea27323599a13051ce1bfb8a98a19f4de457d1d/native68c6ed51 frozen. Initial four controls cover all-container current-signature parity, live mutableTypeIds, real HIR-growth replacement and active snapshot lifetime/reset, original forward lazy qualification. Initial checker attempt failed before tests due test-only wrong Primitive.number name; full failed log/command and patch21331aaa retained. Corrected test to actual number_t, runtime unchanged, corrected draft27d894bae029f9ce318b1e0525f9387a869e3123b367018b7af7f359c4050fce. Unfiltered checker now live; OOM/wrapper/stopping/diagnostic controls and every final gate/A/B remain required. No timing/gain/acceptance/source commit or push.

8 days ago

Initial shared immutable function-statement candidate passed all4557 unfiltered checker tests, peak3333MB under unchanged3840MB guard. Four initial controls cover all physical block/namespace signature parity, live currentTypeId changes, retained snapshots across actual HIR-growth replacement/source reset, and original lazy forward-overload eligibility. Failed earlier test-constant compile attempt remains fully recorded; corrected four-control patch27d894bae029f9ce318b1e0525f9387a869e3123b367018b7af7f359c4050fce/parentaea273235/native68c6ed51 frozen as initial draft. Two additional controls now cover every forced-growth snapshot/map/list allocation failure with full partial cleanup/retry, complete scalar collection when metadata OOM with preallocated output, and preserving both indexed/scalar appendOOM as errors. Updated six-control full checker is live. Runtime unchanged while adding these tests. Export/recovery/stopping/full diagnostic/stale replacement failure controls and all final suites/Zod/harness/admission/A-B are still required before source push; no timing/gain/acceptance yet.

8 days ago

The six-control development draft passed the complete checker suite: 4,559/4,559, exit 0, peak bounded footprint 3,281 MB. Frozen draft SHA256 e8c0efdf5bb47b96674d4d5164ffceb5bfaff21d23805f0ae7e70b3932154d29 and complete original logs retained. Three additional controls now cover direct versus nested/empty export wrappers and unnamed/nonidentifier declarations in unsorted recovery order; original namespace unconditional-stop versus empty-block ascent; and failed stale replacement retaining old consumer/map ownership across multiple roots and source reset. Nine-control draft SHA256 3a969f5c38c4448bddcf4ca913c7c8f88e3f56ccf4988026cdc4637334b200cd; complete checker rerun is waiting on the existing shared bounded-run lock, not bypassing it. Audit correction: unwrapExportDecl performs ONE layer, not recursive unwrapping. Both original forward grouping and collection therefore select direct exports only; the runtime helper itself is unchanged. Binder augmented/mutable lists remain unsuitable, so the candidate reuses and completes the existing forward-overload table rather than adding a binder cache. No timing, source commit, production push or speed claim yet. All final semantic/module/build/harness/unchanged-Zod gates and frozen fair A/B protocol remain required.

8 days ago

The nine-control draft passed all 4,562 checker tests (exit0, peak3,405 MB); the full136 harness tests passed too. Final draft now corrects only the misleading recursive-export comment: both consumers and the unchanged helper unwrap exactly ONE layer. Final patch frozen before timing:25a2a5a7c760bff71ffd3d5d48acaef5572cff7d663c92bce326bf96bc9efd7c. Protocol:f1479a40089e390d41a7a9fbf204ea4eb482e648282cc2ea43e574bf424c7ff2. Exact current-main parentaea27323599a13051ce1bfb8a98a19f4de457d1d/native68c6ed517f9125ae1b570ff2e585c5b368745389af828258f6621fe5e6e0311c; all development drafts, failures and complete logs retained. Final checker rerun and serialized binder/Program/driver/CLI/entrypoint/native-build gates are active, followed by four untimed full-native complete-output diagnostic comparisons and unchanged pinned Zod198 diagnostics. Predeclared timing includes full original66 admissions per phase,20-family screen, official/512 independent confirmations,all five8192 batches and independent carried destructuring/control_flow/checkjs/deep/recursive/predicate/reexport/class/interface risks. Any independently confirmed regression rejects; no repeat-to-pass/layout changes. No measurements or source push yet; universal goal remains incomplete.

8 days ago

Final frozen patch checker rerun passed4,562/4,562 (exit0,peak3,454 MB), full binder21/21 passed,136 harness tests passed; remaining serialized Program/driver/CLI/entrypoint/native/diagnostic/Zod gates continue. Upstream advanced to dad1ea9 while validating. Read-only git ls-tree audit confirms exact tracked input records across all selected TS compiler modules, benchmark harness,build.zig/build.zig.zon,package.json/bunfig.toml remain identical to originalaea2732 (tree-record SHA81474f5289781cec4d2514e3070d8816040d591d37d7359ad92ef2aeb31c9813). New changes are runtime/evidence work and will be preserved; clean-parent and candidate native-byte proofs plus provenance reconciliation are still required before timings. No source commit/push or performance claim yet.

8 days ago

Remaining gate progress: Program251/251 and driver200/200 passed, exit0, bounded peaks3,207 and2,931 MB respectively. Complete run continues with CLI/entrypoint/native build/four complete-output diagnostic controls/Zod/harness. Final source remains frozen and onlycheck.zig is dirty. Still no measurements or source push. Original source/native/protocol/gates will be retained before reconciling latestorigin; current-main parent and re-applied candidate byte proofs are required before any fair A/B phase.

8 days ago

All full final-frozen module suites are now green: checker4,562/binder21/Program251/driver200/CLI76/entrypoint38, all exit0 and no named test filters. CLI peak2,730 MB and entrypoint3,114 MB under unchanged3,840 MB guard. Native build is active, followed by complete untimed parent/candidate stdout/stderr diagnostic controls, full unchanged pinned Zod comparison and harness verification. No timings or source push yet. Universal leadership is still unproven; current competitor matrix remains1/20 leads,12/20 versus nativeTS7.

8 days ago

All pre-timing gates completed successfully, including native build (exit0,peak3,066 MB), four full-process diagnostic controls with exact stdout/stderr/exit equality, and unchanged pinned Zod4.5.2:195TS+3HM9002 diagnostics, no additions/removals, normalized SHA6bf2feb527d91c651631642e523da6d28cd2b0c7ae4898cac0888aa7b420874f. Zod remains UNADMITTED. Qualified original candidate nativecf83d04c72ebed61e39be784bfb431e5012c0d691027509bb996a6d643e768dd; original patch25a2a5a7c760bff71ffd3d5d48acaef5572cff7d663c92bce326bf96bc9efd7c. Every original draft/log/control/protocol retained. Temporarily removed only owned candidate via exact reverse apply_patch and clean-fast-forwarded to dad1ea9, preserving upstream runtime work. First reverse patch conversion failed atomically on repeated function-header skip contexts; source hash verified unchanged, ordinary context conversion succeeded; mechanical failure retained, no compiler/tests/timings from it. Current clean-parent build is active; will reapply identical candidate and verify both native images byte-for-byte against the qualified originals. Fresh reconciled experiment records may update parent source only, with an assertion that every original timing/acceptance rule remains identical. No timing or production source push yet.

8 days ago

Current-main reconciliation progress: clean dad1ea9 parent native matches original68c6ed517f9125ae1b570ff2e585c5b368745389af828258f6621fe5e6e0311c byte-for-byte; clean before/after build, exit0, peak2,977 MB. Reapplied EXACT original patch25a2a5a7c760bff71ffd3d5d48acaef5572cff7d663c92bce326bf96bc9efd7c. Current-main source/protocol freeze recorded before timing, protocol58c6eeb955f7af2110f9fd143048aabb3429401d09eb74fb6216517721c0be3b; assertion proves only parent_source changed versus original predeclared protocol (timing, admission, retention, semantic and acceptance rules identical). Current candidate rebuild is queued on shared lock; requires exact originalcf83d04c72ebed61e39be784bfb431e5012c0d691027509bb996a6d643e768dd native proof before qualification/timing. All original source/native/protocol/gate evidence preserved under original-experiment snapshot in fresh reconciled cache. No production source push or speed claim.

8 days ago

Reconciliation is fully verified: current-main dad1ea9 candidate rebuild succeeded (peak3,132 MB) and matches the qualified originalcf83d04c72ebed61e39be784bfb431e5012c0d691027509bb996a6d643e768dd BYTE-FOR-BYTE; clean parent also matches68c6ed5... . Exact tracked TS input tree81474f5289781cec4d2514e3070d8816040d591d37d7359ad92ef2aeb31c9813 and exact25a2... patch reverified. Qualification records explicitly retain original full-semantic-gate sourceaea2732 and current-main native/input proofs rather than claiming gates ran under a different commit. Current protocol58c6eeb955f7af2110f9fd143048aabb3429401d09eb74fb6216517721c0be3b changes only parent_source from originalf147...; all timing/admission/retention/acceptance rules equal. Complete predeclared A/B orchestration is now active, with original66 admissions before EACH phase. All observations retained, no methods/alignment changes or repeat-to-pass. No speed conclusion or source push yet.

8 days ago

Initial frozen A/B screen completed32 pairs,66/66 admissions, exit0 (peak279 MB). All6 original large-screen pairs retained: parent median7.0219693125s versus candidate6.396837625s; saving CI+[0.334679528,1.034497153]s. This is preliminary, NOT acceptance or universal leadership. Independent official/512 confirmation completed60 pairs and66/66 admissions, exit0 (peak249 MB); 512 medians112.4787495ms→110.040229ms,27/30 candidate wins, saving CI+[0.363633616,3.613694118]ms. Candidate135.526583ms observation retained, no sample filtering or repeat-to-pass. Complete20-family screen active, then all five8192 independent batches, carried adverse-family rechecks and class/interface controls. All originally predeclared work remains required before the statistical decision, source push, full evidence/docs and README result table.

8 days ago

All20-family screen completed200 pairs,66/66 admissions, exit0 (peak244 MB). Adverse/inconclusive evidence is retained: destructuring14.291021→14.7522085ms (3/10 wins, savingCI[-0.332151133,+0.048725733]ms) and CommonJS17.645167→18.246479ms (4/10 wins,CI[-0.648207842,+0.294791242]ms) trigger >3% adverse-median independent30-pair rechecks under the frozen rule. Official checked-JS independent confirmation is SLOWER at its median26.543979→26.6788335ms,13/30 wins,CI[-0.255239683,+0.156384217]ms: inconclusive, NOT equivalence and NOT an erased warning. Other zero-spanning/adverse family observations likewise retained; no confirmed screen-negative interval used to change methods. First independent8192 batch is live; all five batches plus carried checkjs/deep/recursive/predicates/reexports/destructuring/control_flow/CommonJS risks and independent class/interface controls remain. No acceptance, source push or universal-speed claim until the complete protocol decision.

8 days ago

First two of FIVE predeclared8192 independent batches completed, each6 fresh pairs and66/66 admissions, exit0. Batch1 medians7.1155868955s→6.4928374795s,6/6 wins, savingCI+[0.263794082,1.344125861]s; parent8.315782666s retained. Batch2 medians8.048152375s→7.260370729s,6/6 wins, savingCI+[0.058477029,1.579863429]s. LARGE VARIATION retained: parent9.877657125s and candidate8.444707125s, along with every other observation; no exclusions/adjusted warmups/retiming. Batch3 live; all remaining batches, independent carried/CommonJS risk checks and class/interface still required. No supported full target/acceptance claim yet; pooled and supplemental five-batch intervals are evaluated only after all five.

8 days ago

Complete frozen protocol VERIFIED:622 original pairs/660 admissions, all ten phases terminal0, no exclusions or repeat-to-pass. Decision REJECTED. Independent type_predicates_large:242.1781665→243.7080005ms,12/30 candidate wins, saving95CI[-7.550489701,-0.121624299]ms, wholly negative. This confirmed loss overrides the supported large target: all five8192 batches, pooled medians7.2958365→6.566492104s,30/30 wins, paired savingCI[+0.616392621,+1.052242709]s and supplemental five-batchCI[+0.530418853,+1.138216477]s. All official/512/family/CommonJS/destructuring/control-flow/deep/recursive/reexport/class/interface warnings retained; inconclusive is NOT equivalence. Exact candidate plus all nine candidate controls removed via apply_patch; source now clean dad1ea9 matching origin/main and all upstream runtime changes preserved. Restored native build live; requires exact parent byte proof before publishing complete raw evidence/docs/README rejection table. Candidate never committed or pushed. Do not revive this binary or tune layout/alignment; materially different future design only.

8 days ago

Published to origin/main as Chris Breuer without coauthors: e720676, docs(ts): retain rejected function-group evidence (#416,#859). Clean worktree and remote commit verified; native remains restored68c6ed517f9125ae1b570ff2e585c5b368745389af828258f6621fe5e6e0311c. Candidate never committed/pushed. Full report and all tables: https://github.com/home-lang/home/blob/main/docs/docs/TS_PERFORMANCE.md#shared-function-statement-groups-2026-10-10-utc . Brief README rejection table links that report and raw archive. Complete622-pair/660-admission archive:20261010-shared-function-statement-groups-rejected-859.tar.gz, SHAa464393450de380317dc7f424ee3855311c73b8f731f9492b805945db28e7b1f,1,892 verified checksums. Publication context:20261010-function-group-rejection-publication-context-859.tar.gz, SHAc66d7ee7f289f1185378c99963b5f172a73617d6883d62dc03e9e0be0a5dd23b,11 checksums. Fullrepo Pickier retains11460errors/10613warnings outside changed Markdown; both changed files and final claim/raw/native verifiers pass. All jobs terminal; no exclusions/retesting/alignment tuning. Issue remains open only for materially different future work; same rejected binary is not eligible for revival. Universal goal, Zod admission, canonical C++ and other platforms remain incomplete.

Sign in to comment on this issue.