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

moonbitlang / core / 6860
89%

Build:
DEFAULT BRANCH: main
Ran 27 Sep 2026 11:05AM UTC
Jobs 1
Files 451
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 Sep 2026 11:02AM UTC coverage: 89.419% (+0.03%) from 89.387%
6860

push

github

web-flow
perf(builtin): vectorise unsafe_range_equal bodies on wasm (#4308)

`String::unsafe_range_equal` and `Bytes::unsafe_range_equal` back
`StringView ==`, `equal_to_string`, `has_prefix`/`has_suffix`,
`BytesView ==`, `equal_to_bytes` and the verify step of
`Bytes::find`/`rev_find`. Native lowers both intrinsics to an inline
`memcmp`, but on wasm (linear memory) the MoonBit body is emitted as a
real function and runs a unit-at-a-time loop.

Split each intrinsic into two `#cfg` definitions carrying the same
`#intrinsic`: the non-wasm one keeps the original scalar body verbatim
(native/js/wasm-gc codegen is unchanged; the native C of the affected
functions is identical to main and still calls `memcmp`), and the wasm
one sends ranges of at least one vector (8 code units / 16 bytes) to an
outlined vector loop that compares with `i16x8_eq`/`i8x16_eq` plus
`all_true`. A remainder is covered by one overlapping load of the last
vector of each range, which stays inside both ranges because
`len >= width`, so there is no scalar tail. Shorter ranges keep the
scalar loop.

Adds private `i8x16_all_true`/`i16x8_all_true` helpers (wasm-only),
boundary tests planting a mismatch at every position with unaligned
offsets and ranges ending at the buffer end, direct wasm tests of the
vector bodies, QuickCheck differentials through the public view APIs,
and `range_equal_bench_test.mbt`.

This is a library workaround for a compiler gap: the wasm backend does
not lower these intrinsics although it already has vectorized runtime
routines for whole-object equality (compiler/ideas#2608). TODO comments
on both definitions list what to delete once it does.

Signed-off-by: Codex CLI <codex@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

24 of 28 new or added lines in 3 files covered. (85.71%)

6 existing lines in 2 files now uncovered.

16640 of 18609 relevant lines covered (89.42%)

332280.7 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
0.0
0.0% builtin/simd.mbt

Coverage Regressions

Lines Coverage ∆ File
3
17.92
8.25% builtin/bytes_unsafe.mbt
3
77.33
-0.36% builtin/string.mbt
Jobs
ID Job ID Ran Files Coverage
1 6860.1 27 Sep 2026 11:05AM UTC 451
89.42
GitHub Action Run
Source Files on build 6860
  • Tree
  • List 451
  • Changed 5
  • Source Changed 3
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 9b8603a3 on github
  • Prev Build on main (#6857)
  • Next Build on main (#6862)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc