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

moonbitlang / core / 6857
89%

Build:
DEFAULT BRANCH: main
Ran 27 Sep 2026 10:25AM 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 10:21AM UTC coverage: 89.387% (+0.001%) from 89.386%
6857

push

github

bobzhang
refactor(json): factor the escape predicate and writer out of write_escaped

Review follow-ups:

- The "does this code unit need escaping" test is now one `#inline`
  `needs_escape_unit`, shared by `need_escape_scalar` and
  `write_escaped`, and the escape table is `write_escape`, so the loop is
  four lines and the escape set is defined once.
- The tail of the last run is written in the loop's `nobreak` branch
  instead of being returned and written afterwards.
- Runs are sliced with `exact_view` instead of the raw-offset `view`.
  Escaped code units are ASCII, so every run boundary sits next to an
  ASCII unit and never inside a surrogate pair of a valid UTF-16 string
  (MoonBit strings are always valid UTF-16; `@json.parse` rejects lone
  surrogate escapes). The escape quickcheck that fed `write_escaped`
  lone surrogate halves now generates valid UTF-16 that still puts
  surrogate pairs next to escapes.

Release, json/stringify_escape_bench_test.mbt (main / previous / now):

| bench                          | native             | js                 | wasm-gc            |
|--------------------------------|--------------------|--------------------|--------------------|
| strings slash escaped n=2048   | 262 / 200 / 164us  | 426 / 370 / 398us  | 282 / 260 / 274us  |
| strings quotes controls n=2048 | 227 / 183 / 145us  | 421 / 332 / 335us  | 267 / 247 / 251us  |
| 2KB prose, one newline, n=64   | 418 / 284 / 142us  | 847 / 265 / 234us  | 497 / 432 / 373us  |

(An `Option`-returning `escape_sequence` helper was tried first and was
8-15% slower than the previous version, `#inline` or not.)
Codex review (gpt-6-astra, high): "No blocking issues found in the two-commit
diff. Approved under the stated valid-UTF-16 contract." Its optional cleanup
(build the valid-UTF-16 quickcheck strings directly from a shared
`adversarial_unit`) is applied and was re-reviewed: "Approved; no findings."

Signed-off-by: Codex CLI <codex@openai.com>
Co-Authored-By: Claude Opu... (continued)

19 of 19 new or added lines in 1 file covered. (100.0%)

16609 of 18581 relevant lines covered (89.39%)

332855.9 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6857.1 27 Sep 2026 10:25AM UTC 451
89.39
GitHub Action Run
Source Files on build 6857
  • Tree
  • List 451
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • fd730d7d on github
  • Prev Build on main (#6855)
  • Next Build on main (#6860)
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