Commit Graph
1477 Commits
Author SHA1 Message Date
Chris Tate 0a4bf78d4a Merge main into perf/int32-or-zero-peephole 2026-10-12 08:05:16 -05:00
Chris Tate 44d22d785c Merge pull request #870 from vercel-labs/feat/contract-types
Contract types: NoThrow, Int32 and Immutable as checked type annotations
2026-10-12 07:57:28 -05:00
Chris Tate 83248651e2 Publish Immutable factory arrays only after provable index writes 2026-10-12 02:33:29 -05:00
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 48b5935337 Unshare repeated IR nodes before emission and contract checks 2026-10-12 01:47:05 -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 f00e312d76 Merge branch 'feat/contract-types' into perf/int32-or-zero-peephole 2026-10-11 16:32:24 -07: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 15af413acd Merge branch 'main' into feat/contract-types 2026-10-11 16:32:00 -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 2162b0af65 Identity bitwise forms over proven int32 operands return the operand
`x | 0`, `x ^ 0`, `x & -1`, `x << 0`, `x >> 0` (and `x >>> 0` for a
uint32) over an operand the integer range analysis proves an int32 now
return the operand's number and its integer views instead of converting
to i32 and back: ranges exclude -0, so the result is the operand bit for
bit. The range analysis computes bitwise result ranges from the operand
ranges (exact ToInt32/ToUint32 views, shift-count ranges) instead of the
blanket int32 range, so `(n & 0xff) | 0`, `s.length >> 1` or `x >>> 1`
keep tight bounds for later integer consumers.
2026-10-11 14:24:59 -07: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 bb274adc5d Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	packages/compiler/test/ts7/baselines/order-parity.json
2026-10-11 13:27:39 -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