Commit Graph
1463 Commits
Author SHA1 Message Date
Chris Tate f77d68f600 Keep the RC entry points of array elements in one shared descriptor (#882) 2026-10-12 01:59:44 -05:00
Chris Tate c5c6657c4e Drop guards on private constructor stores and borrow construction-only fields (#838) 2026-10-12 01:20:56 -05:00
Chris Tate 72cc828ab0 Merge main into perf/compact-array-header-2 2026-10-12 01:12:21 -05:00
Chris Tate 2ea30ede5b Merge main into perf/static-immutability 2026-10-12 01:09:18 -05:00
Chris Tate 0dee8207bb Keep self-hosting emission tests from blocking the test worker (#883) 2026-10-12 01:06:52 -05:00
Chris Tate 8ba3de7685 Merge pull request #884 from vercel-labs/ctate/store-order-parity-6abc93
Store order-parity baselines one file per fixture
2026-10-12 00:43:33 -05:00
Chris Tate 5e5ec89c76 Run the emission test's compiler passes off the test worker 2026-10-12 00:32:48 -05:00
Chris Tate 2933ebc985 Store order-parity baselines one file per fixture 2026-10-12 00:08:53 -05:00
Chris Tate 0874739c02 Run the frontend services test's compiler and processes off the test worker 2026-10-12 00:07:55 -05:00
Chris Tate 3be37b4ab3 Merge pull request #873 from vercel-labs/perf/locality
Give glibc's large blocks transparent huge pages
2026-10-11 23:53:50 -05:00
Chris Tate 4184028663 Keep self-hosting emission tests from blocking the test worker 2026-10-11 23:39:43 -05:00
Chris Tate a2a6a52522 Merge pull request #846 from vercel-labs/fix/narrowed-property-calls
Check narrowed member reads that a call can invalidate
2026-10-11 23:00:18 -05:00
Chris Tate b1f3b31546 Order the heap page size before huge page advice 2026-10-11 22:58:10 -05:00
Chris Tate 1c4b34d2da Keep publication guards after self-stores and own borrowed-result call arguments 2026-10-11 22:40:27 -05:00
Chris Tate 063a3c7956 Merge main into fix/narrowed-property-calls 2026-10-11 22:29:21 -05:00
Chris Tate f1fe105f18 Merge pull request #857 from vercel-labs/perf/map-get-inline-retain
Retain string-keyed map reads inline
2026-10-11 22:27:36 -05:00
Malte Ubl fa55ce6b07 Keep the RC entry points of array elements in one shared descriptor
Every SCR_ELEM_REF array stored its element type's retain, release and trace entry points in its own header (24 bytes), so ScrArr was 80 bytes: an 80-byte block for arrays of acyclic elements and a 96-byte block for cycle-capable ones. The three pointers now live in one constant ScrArrOps descriptor per element type, which the compiler emits once per module (@sc_arrops.*) and the runtime keeps static, and the header holds a pointer to it plus a 4-byte `cyc` flag beside `elem` that the inline RC fast paths test. ScrArr is 64 bytes: arrays take 64- and 80-byte blocks.

scr_arr_new_ref(retain, release, trace, cap) becomes scr_arr_new_ops(ops, cap); scr_set_to_arr_ref takes the result's descriptor from its caller instead of building an array from the set's key adapters. The backend names the %ScrArr fields in SCR_ARR_FIELD. The layout change bumps the runtime ABI marker to scr_runtime_abi_v13.
2026-10-11 19:46:48 -07:00
Chris Tate aa4fa790a3 Merge main into fix/narrowed-property-calls 2026-10-11 21:37:45 -05:00
Chris Tate 31aaefb4c6 Merge main into perf/map-get-inline-retain 2026-10-11 21:31:11 -05:00
Chris Tate 6b708b2e3e Merge pull request #876 from vercel-labs/perf/array-growth
Size small arrays exactly and keep map storage on the runtime allocator
2026-10-11 20:14:17 -05:00
Chris Tate 2ca61fea97 Merge pull request #872 from vercel-labs/perf/codegen
Dispatch literal switches without range tests and inline indexed-read helpers
2026-10-11 19:40:47 -05:00
Chris Tate 0755c81a3c Merge pull request #871 from vercel-labs/perf/offthread-prefault
Pre-fault allocator memory on a helper thread (Linux)
2026-10-11 19:40:24 -05:00
Malte Ubl 5af0c17c39 Merge branch 'main' into perf/array-growth 2026-10-11 16:32:10 -07:00
Malte Ubl 825ff1dcfe Merge branch 'main' into perf/locality 2026-10-11 16:32:06 -07:00
Malte Ubl 448860dc94 Merge branch 'main' into perf/codegen 2026-10-11 16:32:03 -07:00
Malte Ubl 7027039809 Merge branch 'main' into perf/map-get-inline-retain 2026-10-11 16:31:53 -07:00
Malte Ubl b9d391fc8d Merge branch 'main' into fix/narrowed-property-calls 2026-10-11 16:31:49 -07:00
Malte Ubl f88830c4be Merge branch 'main' into perf/static-immutability 2026-10-11 16:31:46 -07:00
Malte Ubl cdf964ea85 Allocate plain map headers out of line
Map construction inlines into compiled callers, and the inline small-allocator path (with its clearing of recycled blocks) added 37 KB to tsc-ts across its constructors and init functions. A noinline helper keeps those call sites as small as the libc calloc call they had: tsc-ts text is now +5.6 KB over origin/main for this branch.
2026-10-11 16:30:23 -07:00
Malte Ubl 2a7c22ae49 Keep map storage on the runtime allocator
Acyclic map headers, entry arrays, bucket tables and number-key indices came from glibc (calloc/malloc/realloc/free) even when small: a map with one entry paid a 160-byte glibc header plus a 96-byte glibc entry block, and every growth step went through glibc realloc. They now use scr_mem_calloc/alloc/realloc/free like arrays, so blocks up to 512 bytes come from the size-class slices (inline free lists, huge pages after the slice prefix) and larger ones still go to the system through scr_mem_realloc. Nothing outside scr_map.c allocates or frees map storage.
2026-10-11 16:30:22 -07:00
Malte Ubl 6778826d8f Keep the array growth sequence; round only exact construction to its block
Rounding every dense capacity up to its allocator block changed the growth sequence (a 48-byte block holds 5 slots, so storage went 48/96/192/384 B instead of 48/80/144/288/576 B), which moved array storage into other size classes: +3.6% simulated L1 misses on the tsc-ts self-check and +2.6%/+4.3% wall on the self-check and TypeORM. Growth is back to 4, 8, 16, ...; only exactly sized construction fills its block. Adds a runtime test for exact construction followed by appends, index writes and length extension over the spare capacity.
2026-10-11 16:30:22 -07:00
Malte Ubl ead9f4ecba Size array storage to its construction count and its allocator block
Arrays constructed with a known element count (literals, slices, map/filter results) reserved at least four slots, so a one-element literal took a 48-byte block for 9 bytes of content. Construction now allocates exactly the requested slots, and any dense capacity is rounded up to fill its small-object allocator block (1 slot -> 16 B, 2-3 -> 32 B). Appends below four slots grow straight to four and double from there as before. The first storage of an array is a plain allocation with its states cleared, without the realloc, state move and sparse absorption of later growth. New capacity still starts as holes.
2026-10-11 16:30:21 -07:00
Chris Tate c9fe46d8c0 Merge main into perf/offthread-prefault 2026-10-11 18:10:02 -05:00
Chris Tate ddacf49d11 Merge pull request #875 from vercel-labs/ctate/prepare-v0-2-02ac14
Prepare v0.2.9
v0.2.9
2026-10-11 18:02:02 -05:00
Chris Tate 6adb753e89 Correct the runtime ABI version in the 0.2.9 notes 2026-10-11 17:32:45 -05:00
Chris Tate fa11424e5f Prepare v0.2.9 2026-10-11 17:25:14 -05:00
Chris Tate 83dce99e51 Merge pull request #874 from vercel-labs/ctate/give-sanitized-emitter-dec393
Give the sanitized emitter CI job swap and a larger stack
2026-10-11 17:23:51 -05:00
Chris Tate 3bf0d0b9a5 Give the sanitized emitter job swap and a larger stack
The sanitized native emitter peaks near 13 GB while it emits the
compiler and then compiles the 348 MB module with clang under
AddressSanitizer, which together exceed the 16 GB runner. Back the
rebuild-emit job with a 24 GiB swap file and lift its stack limit,
since the instrumented emitter's recursion can exceed 8 MiB.
2026-10-11 16:45:12 -05:00
Malte Ubl 9899c4014b Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	packages/compiler/test/ts7/baselines/order-parity.json
2026-10-11 13:39:52 -07:00
Malte Ubl eae8e02481 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	packages/compiler/test/ts7/baselines/order-parity.json
2026-10-11 13:27:25 -07:00
Malte Ubl 5ac6252916 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	packages/compiler/test/ts7/baselines/order-parity.json
2026-10-11 13:27:18 -07:00
Malte Ubl 0148f6b741 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	packages/compiler/test/ts7/baselines/order-parity.json
2026-10-11 13:27:11 -07:00
Chris Tate c9452c8c33 Merge pull request #867 from vercel-labs/perf/checker-round4
PR: Read nullable-union array elements inline and borrow them for preserving live ranges
2026-10-11 15:25:09 -05:00
Chris Tate d761cb530d Merge main into perf/static-immutability 2026-10-11 15:19:32 -05:00
Chris Tate 8706ceafcf Merge pull request #866 from vercel-labs/ctate/check-index-guard-9174bc
Check the index guard in the integer byte-loop test
2026-10-11 15:17:22 -05:00
Malte Ubl fa991511e1 Hint LLVM to inline the shared indexed-read helpers
Every safe a[i] read of one element type calls one lifted helper
(lowerSafeIndexRead): a dense bounds test, a state test and a load
behind cold runtime fallbacks, about twenty instructions. With many
callers LLVM kept the hot instances out of line, so each read paid a
call and converted an integer index to a double and back across it
(tsc-ts Checker.nodeLinks: two calls per paged lookup).

The helpers now carry inlinehint. tsc-ts self-check (callgrind,
single-threaded): -0.73 % instructions; binary +0.41 %.
2026-10-11 13:10:15 -07:00
Malte Ubl 994d9ea7f6 Dispatch literal integer switches without separate range tests
A literal integer switch over a number tested min <= x <= max with two
ordered compares before converting and round-tripping the discriminant.
The round trip alone already rejects every non-matching value once the
conversion is frozen: NaN and infinities compare unordered, a frozen
out-of-range conversion converts back to a different value, fractions
fail, and -0 selects case 0 like strict equality. Cases in [2^31, 2^32)
dispatch on i64 instead of fptoui to i32.

A discriminant already proven to be an exact integer (int32 slots,
x | 0, x >>> 0, counted-loop counters) now selects directly, narrowing
to i32 only when its proven range fits.

tsc-ts (callgrind, single-threaded): self-check about -0.8 % instructions,
mostly switch (node.kind) and token dispatch.
2026-10-11 13:10:11 -07:00
Malte Ubl 757c48c2f8 Anchor the canonical byte-loop check on the element-check blocks
f3cfa80a asserted that the canonical byte loop contains no `fptosi double`
at all, meaning no exact-index round trip. The fixture also coerces its
running sum with ToUint32, whose inline fast path legitimately uses
`fptosi double ... to i64`, so the test fails on main (aaccbb39) as well;
#865 merged before the shards that run it. Assert instead that no
`bytes.index` check block is emitted, which keeps the original intent
(no unproven-index path for a proven in-bounds induction index).
2026-10-11 13:10:06 -07:00
Chris Tate f43ef506db Update byte-loop emission test for exact index checks
(cherry picked from commit f3cfa80a8e)
2026-10-11 13:08:09 -07:00
Chris Tate 8b5cf78e19 Update constant-table emission test for exact index checks
(cherry picked from commit 9b80f3d4b4)
2026-10-11 13:08:08 -07:00