Files
scriptc/packages
Chris Tate bbefa36394 Bound loop counters compared as i + c with a bound
The range analysis narrowed a counter only when the comparison read the
counter itself (`i < n`). A comparison of the counter plus or minus an
integer literal (`i + 1 < xs.length`, `1 + i < n`, `i - 1 >= 0`) now
narrows it as `i < n - c` does. Against a bound within 2^52, a sum that
rounds has a magnitude of at least 2^53, so every such comparison answers
as the exact sum would.

The counter of `for (let i = 0; i + 1 < xs.length; i++)` then lands in
an i32 slot like the one of `i < xs.length - 1`, and helper calls that
index arrays with it read the elements without the double index checks.
2026-10-19 23:19:46 -05:00
..
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-18 09:55:59 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00
2026-10-17 13:47:41 -05:00