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

moonbitlang / core / 6262
91%

Build:
DEFAULT BRANCH: main
Ran 21 Aug 2026 06:25AM UTC
Jobs 1
Files 452
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

21 Aug 2026 06:21AM UTC coverage: 90.795% (+0.02%) from 90.775%
6262

push

github

web-flow
perf(hex): vectorize encode/decode on the linear-memory backends (#4122)

* perf(hex): vectorize encode/decode on the linear-memory backends

`encode` and `decode` gain v128 fast paths on native and wasm, mirroring
the structure already used by `encoding/base64`: the scalar codec is
retained on every backend as the reference implementation, and the
public entry points dispatch with `#cfg`.

Encoding processes 16 source bytes per iteration: split each byte into
its nibbles, interleave them into output order with two `i8x16_shuffle`s,
and map nibbles to ASCII with a register-resident `i8x16_swizzle` table.
The 32 ASCII characters are widened to UTF-16 before being stored.

Decoding processes 32 characters per iteration: narrow the UTF-16 code
units to bytes with `i8x16_narrow_i16x8_u`, whose signed-lane saturation
sends every non-ASCII code unit to 255 or 0 and so keeps one from
masquerading as a hex digit by way of its low byte; validate the three
hex ranges vectorially; and fold to nibbles with wrapping adds. Anything
the fast path will not take -- short, odd-length, or invalid input --
falls back to the scalar decoder, which stays the single authority on
the `Malformed` rules.

Benchmarks (4 KiB payload, scalar vs public entry point):

| target | encode scalar | encode  | speedup | decode scalar | decode  | speedup |
| ------ | ------------- | ------- | ------- | ------------- | ------- | ------- |
| native | 16.33 us      | 634 ns  | 25.8x   | 7.56 us       | 815 ns  | 9.3x    |
| wasm   | 35.64 us      | 947 ns  | 37.6x   | 21.17 us      | 1.33 us | 15.9x   |
| js     | 38.60 us      | 35.93 us| 1.07x   | 43.38 us      | 44.01 us| 0.99x   |

js keeps the scalar path by `#cfg` and is unchanged, as expected.

Correctness is covered by differential white-box tests -- fast path vs
scalar for every length from 0 to 79, for views that start and end
inside a larger buffer, and for an invalid character planted at every
lane position -- and by quickcheck pr... (continued)

70 of 73 new or added lines in 4 files covered. (95.89%)

16591 of 18273 relevant lines covered (90.8%)

305880.59 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
94.44
-5.56% encoding/hex/decode.mbt
1
85.71
-14.29% encoding/hex/encode.mbt
1
95.65
encoding/hex/encode_v128.mbt
Jobs
ID Job ID Ran Files Coverage
1 6262.1 21 Aug 2026 06:25AM UTC 453
90.81
GitHub Action Run
Source Files on build 6262
  • Tree
  • List 452
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 02e40a4b on github
  • Prev Build on main (#6259)
  • Next Build on main (#6264)
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