Repository navigation
[0.0.25] fix(runtime): deflake command_invoke RC-1 wall budget under CI load - #2298
Merged
Merged
Conversation
…load
The integration fixtures drive the real host-mediated cross-VM command path:
one dispatch runs the caller chunk, the mediated callee chunk in a second VM,
schema validation, and result marshalling inside a single RC-1
`call_function` wall window. Reusing the 50 ms production wall budget for that
harness suspended at 80 ms on a shared macOS ARM64 runner (WallClockExceeded,
bitty#2259) and surfaced as `err:E_TIMEOUT` on a Linux Quality gates shard, with
the command path itself untouched.
Widen only the test harness wall dimension to 10x RC1_WALL_CLOCK_BUDGET_MS
through the existing `set_vm_wall_budget_ms` test hook (same treatment as
bitty#1727 and bitty#1744); production keeps `VmBudgets::default()` at 50 ms and
never calls the setter. The exact budget stays pinned by
`measurement_lua`/`load_gate` (`execute_with_elapsed` at 50 ms), and a new
runaway-callee test keeps the dispatch path bounded by the unchanged instruction
budget.
Measured idle dispatch cost is 11-27 us, so the CI observation is a scheduler
stall, not product work. 424 consecutive runs (40 serial + 384 concurrent) pass;
with the tight budget restored, a genuine ~75 ms command regression fails with
`WallClockExceeded { elapsed_ms: 50, budget_ms: 50 }`.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Xuepoo
added a commit
that referenced
this pull request
Oct 20, 2026
The first pass was audited at `470c20ab`; four commits merged while it was open and one of them changes a claim the entry makes. - #2296 adds the production component request surface (`bitty.component.request` / `bitty.component.poll`) and closes #2254, so the Known issues bullet no longer says no request producer exists. Its real limits replace it: no IPC verb, no streaming or retained handle, lossy UTF-8 response bodies, and a mirrored grant surviving a runtime-only suspend. - #2295 hardens the activation record against a planted symlink on both the write and read side, with a typed `ActivationWriteError`. - #2291 moves all six extracted extension pins to their upstream heads and adds the pin drift gate. - #2298 deflakes the cross-VM `command_invoke` test against the 50 ms production RC-1 wall budget. The provenance line now records the audited head `6c4ae437`. The RC-1 fuel accounting fix is still not claimed: PR #2292 remains open. Docs-only: no code, scripts, workflows, or pins touched.
Xuepoo
added a commit
that referenced
this pull request
Oct 20, 2026
The first pass was audited at `470c20ab`; four commits merged while it was open and one of them changes a claim the entry makes. - #2296 adds the production component request surface (`bitty.component.request` / `bitty.component.poll`) and closes #2254, so the Known issues bullet no longer says no request producer exists. Its real limits replace it: no IPC verb, no streaming or retained handle, lossy UTF-8 response bodies, and a mirrored grant surviving a runtime-only suspend. - #2295 hardens the activation record against a planted symlink on both the write and read side, with a typed `ActivationWriteError`. - #2291 moves all six extracted extension pins to their upstream heads and adds the pin drift gate. - #2298 deflakes the cross-VM `command_invoke` test against the 50 ms production RC-1 wall budget. The provenance line now records the audited head `6c4ae437`. The RC-1 fuel accounting fix is still not claimed: PR #2292 remains open. Docs-only: no code, scripts, workflows, or pins touched.
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.
Priority: P2 | Area: area:runtime | Labels: fix,P2,area:runtime | Milestone: 0.0.25 | RFC: RC-1 callback budget | Task: CTX-1381
Closes #2259
Root cause
crates/bitty-runtime/tests/command_invoke.rsdrives the real host-mediatedcross-VM command path, so one dispatch runs inside a single RC-1
call_functionwall window: the caller chunk executesbitty.commands.invoke,the host mediates the call, the callee chunk runs in a second VM, and the result
is schema-validated and marshalled back. The harness reused the 50 ms production
wall budget for that work.
Measured idle cost on this host (debug test profile, 20 runs of the failing
test): 11–27 µs per dispatch. So:
WallClockExceeded { elapsed_ms: 80, budget_ms: 50 }inraising_callee_is_contained_and_the_host_serves_on; rebase + rerun green.Quality gates (2)shard onmain(run 39293939250):args_schema_violation_is_refused_before_executionfailed withleft: "err:E_TIMEOUT"atcommand_invoke.rs:498— the same suspensionthrough the caller's
err:<code>mapping.That is a scheduler stall during sharded nextest, not extra product work: no
host regression, and the production budget is not exercised by the assertion.
Fix (issue option 1/3, repo precedent)
Widen only the test harness wall dimension through the existing
PluginRuntime::set_vm_wall_budget_mstest hook:Same treatment already accepted for bitty#1727 (
composer_headless_driver) andbitty#1744 (
plugin_ui). Production keepsRC1_WALL_CLOCK_BUDGET_MS = 50andVmBudgets::default(); production code never calls the setter, andinstruction/memory stay at RC defaults.
The exact 50 ms value stays pinned deterministically by
bitty-lua/tests/measurement_lua.rs(execute_with_elapsedat exactly 50 ms,check_budgets) andload_gate.rs. Newrunaway_callee_is_contained_and_the_host_serves_onproves the dispatch pathis still bounded by the unchanged 10M-instruction budget (timing-independent:
while true do endalways trips a budget), and that the host serves on after asuspension.
Repeat-run evidence
Mutation proof
Tight production budget restored (
HARNESS_WALL_BUDGET_MS = RC1_WALL_CLOCK_BUDGET_MS)plus a genuine ~75 ms regression in the dispatched command (8M-iteration loop):
i.e. the original tight budget still catches a real regression, and the failure
signature matches CI. With the widened harness and the same compute regression
the suite still fails — via
InstructionBudgetExceeded { used: 10000012, budget: 10000000 }— so wideningthe load-sensitive wall dimension does not hide Lua-compute regressions.
Accepted bound: sub-500 ms host-side latency regressions on this path are no
longer flagged by these integration tests; the 50 ms contract itself is pinned
by the deterministic VM-level tests above.
Gates
cargo fmt --all -- --check— clean.just clippy(workspace-D warnings, plusbitty-terminal --features dev-tools) — clean.cargo nextest run -p bitty-runtime -p bitty-lua— 2947 passed, 2 skipped.cargo check --target x86_64-pc-windows-gnu --workspace --all-targets— clean.just ci-local: not used as a gate for this PR (owner directive). The onlyattempts failed for infrastructure reasons, not code:
rust-lldaborted withsignal 7 [Bus error]while linking test binaries as/mnt/datareached 100%,and the retries failed seeding the act cache (
Permission denied, root-ownedcache dir). Local
fmt/clippy/nextest/Windows gates above plus remote CIare the acceptance gate.
macOS ARM64 check and testjob on this PR is the platform evidence.