Files
scriptc/packages
Malte Ubl ecd9643eb0 Remove the large-array cliff (1.2M-element fill and update: 10.4 s to 0.03 s) (#743)
* Remove the large-array cliff past 2^20 elements

Arrays longer than 2^20 kept every element beyond the cutoff in a sorted
side store, and each indexed write to an existing entry deleted and
reinserted it, so fill + indexed read/write loops went quadratic
(n=1.2M: 10.4s on macOS arm64, 12.6s on Linux x64).

- Rewrite existing sparse entries in place.
- Let dense storage grow past the cutoff for contiguous extension of a
  populated prefix, bulk range writes, and sparse tails that reach 3/16
  density, migrating side-store entries so index < cap stays dense.
- Make the side store a deque with front slack so descending first-touch
  writes and prefix migration are amortized O(1).
- Bound range-derived slice/splice capacity hints for hole runs.

scr_arr_new now reserves the live count, so a 2^20+3 element Set
converts into dense storage instead of a sparse tail; the white-box
test_lib check that pinned the old policy now asserts dense storage.

* Share immortal boolean union boxes

Maybe-undefined reads of boolean[] elements (`if (composite[i])` in a
sieve) box the element in a boolean|undefined union and free it at once:
one calloc/free pair per read, about a quarter of numeric-kernels samples
at large scales. Unions are immutable and boolean arms own no payload, so
low tags now return headerless immortal instances, the same convention as
the compiler's static unit-arm constants.

* Record preflight/order baselines for corpus 3138
2026-10-08 15:01:21 -05:00
..
2026-10-08 11:00:13 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00
2026-10-07 19:15:55 -05:00