• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moonbitlang / core / 4780
91%

Build:
DEFAULT BRANCH: main
Ran 27 Jun 2026 02:47AM UTC
Jobs 1
Files 381
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Jun 2026 02:45AM UTC coverage: 90.973%. Remained the same
4780

push

github

bobzhang
perf(builtin,deque): make checked index accessors inlineable

The checked view/deque accessors (`ArrayView::at`, `MutArrayView::at`/`set`,
`BytesView::at`, `Deque::at`/`set`) embed an interpolated `abort(...)` on the
out-of-bounds path. That message builds a `StringBuilder` and formats via
several calls, inflating the accessor body well past the C/LLVM backend's
inline-cost threshold (clang: cost=810 vs threshold=225). The backend therefore
cannot inline the accessor: every element access in a loop becomes an
out-of-line call, which blocks auto-vectorization and keeps the loop scalar.

Hoist the cold formatting into a shared `#inline(never)` `index_out_of_bounds`
helper. The accessor body drops to cost ~40, clang inlines it into callers, the
view-relative guard is proven redundant against the loop bound and eliminated,
and the loop auto-vectorizes. The exact diagnostic message is preserved (the
helper formats the identical string), so all panic-message tests pass unchanged.

Bench (native, n=100000, builtin/view_bench_test.mbt):
  ArrayView::at      122.75 us -> 4.67 us  (26x; now == unsafe_get 4.62 us)
  MutArrayView::at   123.49 us -> 4.60 us  (27x)
  MutArrayView::set  ~123 us   -> 7.70 us  (== unsafe_set 7.41 us)

Generated C / asm: ArrayView::at shrinks to guard + single `bl
index_out_of_bounds` + load; clang inlines it (cost 40) and the bench loop
emits a NEON `ldp q`/`add.4s` vectorized body.

Validation:
- moon check --target all (clean; only pre-existing missing_doc warnings)
- moon test --target native -p builtin (2835 passed), -p deque (225 passed)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

8 of 8 new or added lines in 6 files covered. (100.0%)

15167 of 16672 relevant lines covered (90.97%)

197060.95 hits per line

Jobs
ID Job ID Ran Files Coverage
1 4780.1 27 Jun 2026 02:47AM UTC 382
90.99
GitHub Action Run
Source Files on build 4780
  • Tree
  • List 381
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • c194b04e on github
  • Prev Build on main (#4778)
  • Next Build on main (#4782)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc