Repository navigation
feat: update to MoonBit v0.10.4 / async 0.20.2 and lift the 1000 req/s rate cap - #20
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Requires MoonBit toolchain v0.10.4+ (async 0.20.x uses new language syntax and the moon.mod manifest format). - migrate moon.mod.json to moon.mod (auto-migrated by moon fmt; the json form is deprecated and removed by the new toolchain) - switch release-please to the generic updater with x-release-please-version block annotations in moon.mod - update expect tests for the new core Show format (String tuple elements are no longer quoted) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- verify flag is deprecated in favor of trust (@tls.TrustedRoot); --insecure now maps to NoVerification, default to SystemRoot - Client::new / Server::new are deprecated aliases; use the struct-constructor call style - moon fmt migrated is-main to pkgtype(kind: "executable") Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The filler task loops forever, and spawn_bg waits for child tasks by default, so with_task_group never returned once a rate limit was set: every run with --rate hung after the test finished (duration mode) or after the request count was reached. spawn_bg(no_wait=true) marks the filler as an auxiliary task that the group cancels on termination. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ission @async.sleep has millisecond resolution, so a one-token-per-sleep filler tops out at ~1000 tokens/s. The filler now computes how many tokens are due at the current instant against the absolute schedule and emits them as a batch, keeping exact long-run pacing for any rate (verified at 3000 req/s end-to-end: 9006 requests over 3s). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
This was referenced Jul 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update the MoonBit toolchain to v0.10.4 and all dependencies to their latest versions,
fix a pre-existing hang in the rate limiter,
and lift its 1000 req/s cap.
The toolchain and moonbitlang/async are tightly coupled and cannot be updated independently:
async 0.20.x requires the moonc v0.10.4 syntax and the new manifest format,
while moonc v0.10.4 rejects the legacy syntax used inside async 0.17.1.
That is why the dependency updates land as a single PR.
Changes
Dependency updates (mechanical)
moon fmt; the json form is deprecated under the new toolchainx-release-please-start-versionblock annotations in moon.modverify~→trust~(@tls.TrustedRoot), andClient::new/Server::new→ struct-constructor call style.--insecuresemantics are unchanged (insecure →NoVerification, default →SystemRoot)Rate limiter (core)
--ratewas set (reproducible in v0.1.9).The token filler loops forever, and
spawn_bgwaits for child tasks by default,so
with_task_groupnever returned once the test finished.The filler is now spawned with
no_wait=true, making it an auxiliary task the group cancels on termination@async.sleephas millisecond resolution, so the previous one-token-per-sleep filler topped out at ~1000 tokens/s.The filler now computes how many tokens are due at the current instant against the absolute schedule and emits them as a batch,
keeping exact long-run pacing for any rate
Verification
moon test --target native256/256,moon test(wasm-gc) 187/187-d 3s -r 3000measured 3000.13 req/s (9,006 requests);-r 100measured 100.40 req/s-n+-rand-d+-rhangs are gone by comparing the new binary against the v0.1.9 release binaryNotes
A pre-existing display bug was found during this work and is intentionally out of scope for this PR:
format_us_as_msdrops the leading zero of the fractional part, rendering 80µs as "0.8ms" instead of "0.08ms" (src/lib/reporter/format.mbt).A follow-up PR will address it.
🤖 Generated with Claude Code