ReviewOS

home-lang/home

perf(ts): query complete binder declarations for require-assignment receiver facts

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

Follow-up to #854 and the latest-source native profile; refs #416, #881, #882. Exact image2c6666ac still displays the root-statement walk in memberAccessReceiverIsRequireAssignmentBinding in both fixed windows. Prior shared root-index reuse was unqualified and attachment-result memo was rejected; neither is revived.

Investigate using already-owned complete binder symbol declaration lists rather than building another checker index or repeating the full root walk. A bound-module completeness/ownership snapshot must identify the exact HIR, root and statement storage; absent/partial/stale/mutated ownership uses the unchanged scalar path. Queries must cover value and type import spaces, every duplicate declaration, only direct root statements (including export wrappers), import-equals bindings and original virtual-section/name behavior. No resolving a different lexical meaning, semantic caps, filename/workload predicates, source-hint shortcuts or weakened errors.

First prove exhaustive optimized-versus-scalar answers and correct fallback for module absence, incomplete bind, actual HIR growth/root replacement, duplicates, nested scopes/exports/virtual sections and allocation failures. Then all unfiltered source suites, actual-CLI extended/six-image protocol/scaled admission, unchanged full-library no-added-identities comparison. Freeze exact parent/source/native and all20 official plus unchanged512/8192 JS workloads for screen10+independent30 before first timing. Adoption requires positive independent lower95% bound on official128-family checkedJS and no wholly negative independent interval anywhere; every adverse observation retained, no repeat-to-win. Publish all raw evidence/results and a concise README table even if rejected. Source must not be pushed unless fully qualified.

8 days ago

Prototype implemented locally only: a no-allocation completeness/ownership certificate on the existing bound Module, invalidated before partial/repeated binding or augmentation; checker queries existing value/type declaration lists while retaining every scalar predicate and unchanged fallback. Added exhaustive per-identifier scalar comparisons across duplicate names, export wrappers, type-only imports, nested scopes and virtual sections, plus absent/partial/augmented/rebound ownership, different HIR/root-storage/actual-growth and allocator failure controls. No source adopted/pushed. Frozen exact parent d82db94, retained native2c6666ac; all20 official plus512/8192 scales fixed at screen10/independent30, seed883/20000 resamples before any timing. Full checker+binder+Program+driver+CLI+entrypoint source gates launched under unchanged per-phase guards; no source edits while gates run. Primary target and no-independent-loss adoption rule unchanged.

8 days ago

First source-gate attempt terminated before tests with a Zig container field/declaration ordering error. Exact failed patch, compiler diagnostic and guard outcome retained in home-ts-bound-receiver-declarations.HsS3Ve. Corrected only declaration placement; all test expectations/adoption conditions unchanged. A separate source-repair-1 evidence root now freezes the corrected patch and runs complete checker, binder, Program, driver, CLI and entrypoint suites. No source edits while those gates run; no benchmark timings/adoption yet.

8 days ago

Corrected checker gate terminated124 during compilation at the unchanged600-second bound; no test verdict or timing. Frozen patch a9412ef2e251f495f6ab80fe84365d6f2256c6324ea747ca931115ee9273aff0 remains unchanged. Timeout log/raw revision retained. Independent full binder/Program/driver/CLI/entrypoint suites now run on the same patch under identical per-phase guards; this cannot substitute for checker success. Host snapshot after timeout: load224.84/217.39/282.59, CPU25.72%user/74.27%system/0%idle, 1418processes/109running/48stuck, 17Gused/170Munused, disk2.8GiB free. Unrelated processes/shared caches untouched; guard limits not raised. Native build/admission/timing/adoption remain blocked until all source gates succeed.

8 days ago

Static equivalence audit found a recovery gap in a9412ef: prototype used declaration parent links for root membership, but the unchanged scalar predicate reads actual root statement IDs; existing recovery tests deliberately allow parentless declarations. No runtime red test was executed because full checker compilation timed out. Stopped only our still-waiting binder guard20525 (SIGTERM/-15; controller44533 terminal241), retained all wait/timeout records, and repaired membership to read the actual root list only after identifying an eligible require declaration. Unrecoverable import-parent entries fall back to the unchanged scalar scan. Added plain/exported/import-parent recovery regression expectations without weakening existing tests. No benchmark samples. After all task jobs were terminal, deleted only task .zig-cache47872993bytes; all48263 protected hashes unchanged, frozen native/raw evidence retained. New source-repair-2 runs all six complete suites (binder first, then checker/Program/driver/CLI/entrypoint) under unchanged guards. Baseline, all22 workloads,880-pair plan and strict adoption rule remain unchanged; no code adoption/push.

8 days ago

349e repaired version completed the full checker suite:4575passed/0skipped/1failed, all query scalar-equivalence/recovery/no-query-allocation tests passed. The newly added exhaustive binder allocation-failure control exposed a136-byte initialization leak at fail_index3/5 (440allocated/304freed,3allocations/2deallocations). Full raw4576-test log, failed source patch and exact failed test executable retained; no benchmark samples or source adoption. Cause: Binder.init may allocate its GPA-owned scope_stack in openScope before a later arena allocation fails; existing Module errdefers do not deinit that stack. Added errdefer binder.deinit() after Binder construction, preserving the failing test and all expectations. Full six-source-gate qualification will restart on the new frozen corrected revision; no source push or timing until every gate passes.

8 days ago

Error-path cleanup fixed without changing any test: errdefer binder.deinit() now releases GPA-owned scope_stack/diagnostics if Binder.init fails after partial root scope setup. Third frozen revision f60aae5102738bdef79a5832bccafee4aac8d3fc612fa1bb4f0836bd6f6b62b9 is running all six source gates. Full binder21/21 passed (peak456MB, host low-water44%); full unfiltered checker rerun live. Earlier349e full checker failure retained with all4576 observations and exact failed test binary SHA920e6f0f838654848ed1ae6cdbaa809302cb483b8e5210cdc93faa731b39adc8. Scalar-equivalence/recovery/allocation-free-query controls previously passed; allocation-failure expectation remains unchanged. No timings/adoption/source push yet.

8 days ago

Third revision completed all4576 checker tests:4575passed/0skipped/1failed, no leaks reported; same allocator control now reports NondeterministicMemoryUsage rather than the prior136-byte leak. Exact failed test executable retained (SHA5d1fee55d6d986776bbe4a56b67be74e1c6d10ca4c63f8763b65d8b893ab0998). Pinned std.testing helper requires deterministic allocation counts; arena in-place resize/remap is the inferred varying-count cause, not a traced allocator log. The control now retains normal-allocator success and exhaustively calibrates/fails every allocation with resize/remap disabled only in FailingAllocator, forcing growth into counted allocation points. Every index still must induce failure, return OutOfMemory, leave no complete certificate and free all bytes/allocation objects; no errors caught/ignored or points skipped. Fourth frozen source revision is running all six full gates; binder21/21 passed. Runtime compiler and performance rule unchanged; no timings/adoption/source push.

8 days ago

Fourth frozen revision19224418 now passes all4576 unfiltered checker tests, including exhaustive deterministic failure-at-every-allocation and recovered-parent scalar equivalence. Checker peak3487MB, host low-water31%; no skipped tests, no leaks. Binder21/21 passed too. Same controller continues full Program/driver/CLI/entrypoint gates, with source unchanged; all six required before separate-prefix native build and complete actualCLI/protocol/scaled/library controls. Earlier failures retained, expectations not weakened. No benchmark timing or adoption yet.

8 days ago

Same frozen192244 patch passes binder21/21, checker4576/4576 and Program268/268. Driver gate was killed125 before tests by host pressure4/11%free-and-uncompressed; disk had fallen to475MiB. All records retained, no guard overrides. After that terminal refusal, removed only task .zig-cache181735773bytes; all241 protected source/raw/retained-image hashes unchanged. Capacity then genuinely recovered to9.7GiBdisk/3012MiBunused/63.30%CPUidle. Separate capacity-recovered-gates now runs full driver/CLI/entrypoint under unchanged600s/3840MB/shared-lock/floors on exact same source. Previously passed suites are retained; any complete-gates record must verify raw source/log custody across all six plus refusal lineage. No native candidate/admission/timing/adoption yet.

Sign in to comment on this issue.