Visitar URL original
chore(deps): bump wasmtime and wasmtime-wasi to 48.0.0 together by robcohen · Pull Request #2140 · rustledger/rustledger · GitHub
Skip to content

chore(deps): bump wasmtime and wasmtime-wasi to 48.0.0 together - #2140

Merged
robcohen merged 2 commits into
mainfrom
chore/wasmtime-48-pair
Aug 24, 2026
Merged

robcohen merged 2 commits into
mainfrom
chore/wasmtime-48-pair

Conversation

@robcohen

Copy link
Copy Markdown
Member

Supersedes #2134 and #2136. Both can be closed.

Why neither Dependabot PR can pass

They raise the same version bump as two separate PRs. Either alone leaves the other crate at 47.0.3, and the resulting lockfile carries both versions. From #2134's failing job log:

Downloaded wasmtime-environ v47.0.3
Downloaded wasmtime-environ v48.0.0

That is why all 14 checks fail on each, identically. They have to move in one commit.

48.0.0 also changes the WASI sandbox API

Neither PR could have handled this, since Dependabot does not migrate code. DirPerms and FilePerms are replaced by a single FsPerms enum, and preopened_dir takes three arguments instead of four.

The mapping is exact at all three call sites, so no permission widens:

before after
DirPerms::READ, FilePerms::READ FsPerms::ReadOnly
DirPerms::all(), FilePerms::all() FsPerms::ReadWrite

Calling that out explicitly because these are sandbox policy, not ergonomics. The Python plugin runtime mounts its stdlib read-only and its work directory read-write; both are unchanged. The component parity test's preopen stays read-only.

Verification

  • workspace compiles, no 47.0.3 left in Cargo.lock
  • cargo test --workspace passes except the pre-existing corpus_parity failure (28 files, stale prebuilt wasm) which fails identically on main
  • cargo +1.97.0 clippy --workspace --all-targets clean
  • rustledger-plugin tests pass, which are the ones that actually build a WASI context

🤖 Generated with Claude Code

https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr

Supersedes #2134 and #2136, which cannot pass individually.

Dependabot raised the pair as two PRs. Either alone leaves the other at
47.0.3, and the resulting lockfile carries BOTH versions -- the failing job
logs show `wasmtime-environ v47.0.3` and `v48.0.0` downloaded side by side --
so all 14 checks fail on each. They have to move in one commit.

48.0.0 also changes the WASI sandbox API, which neither PR could have
handled. `DirPerms` and `FilePerms` are replaced by a single `FsPerms`, and
`preopened_dir` takes three arguments instead of four. The mapping is exact
at all three call sites, so no permission widens:

  DirPerms::READ, FilePerms::READ    -> FsPerms::ReadOnly
  DirPerms::all(), FilePerms::all()  -> FsPerms::ReadWrite

Worth stating explicitly because these are sandbox policy: the Python plugin
runtime mounts its stdlib read-only and its work directory read-write, and
that is unchanged.

Verified: workspace compiles, `cargo test --workspace` passes except the
pre-existing `corpus_parity` failure (28 files, stale prebuilt wasm, fails
identically on main), clippy clean on 1.97.
@robcohen
robcohen requested a review from a team as a code owner August 24, 2026 19:57
Copilot AI lite review requested due to automatic review settings August 24, 2026 19:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the workspace’s Wasmtime runtime dependencies to v48.0.0 in a single coordinated change, including the required WASI sandbox API migration so the plugin runtime and component-parity tests continue to build and enforce the same sandbox policy.

Changes:

  • Bumped wasmtime and wasmtime-wasi workspace dependencies to 48.0.0 (together to avoid dual-version lockfile resolution).
  • Migrated WASI preopen permission configuration from DirPerms/FilePerms to FsPerms at all existing call sites (Python WASI runtime + component parity test).
  • Refreshed Cargo.lock and supply-chain/imports.lock to reflect the new dependency graph and publisher metadata.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
supply-chain/imports.lock Updates vetted publisher/version entries for Wasmtime-related crates after the bump.
crates/rustledger-plugin/src/python/runtime.rs Migrates WASI preopened directory configuration to FsPerms while keeping stdlib read-only and work dir read-write.
crates/rustledger-ffi-component-tests/tests/parity.rs Updates the parity harness’ preopen to the new FsPerms API (read-only /work).
Cargo.toml Bumps workspace dependency versions for wasmtime and wasmtime-wasi to 48.0.0.
Cargo.lock Regenerates the lockfile so the workspace resolves a single Wasmtime major version and its updated transitive deps.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

Shape rustledger beancount Speedup RSS (rledger / beancount)
simple 51.5ms ± 4.4ms 766.3ms ± 5.6ms 14.9x 55.0 MB / 50.0 MB
investment 72.0ms ± 1.6ms 3004.3ms ± 107.5ms 41.7x 58.9 MB / 57.9 MB
fifo 71.9ms ± 1.2ms 16497.4ms ± 233.8ms 229.4x 59.2 MB / 57.8 MB

vs base, measured in this run

Shape base this PR Change RSS base → PR
simple 49.2ms ± 4.2ms 51.5ms ± 4.4ms +4.7% ✅ within noise 55.1 MB → 55.0 MB (-0.2%)
investment 75.4ms ± 5.4ms 72.0ms ± 1.6ms -4.6% ✅ within noise 59.1 MB → 58.9 MB (-0.2%)
fifo 70.5ms ± 2.8ms 71.9ms ± 1.2ms +2.1% ✅ within noise 61.1 MB → 59.2 MB (-3.1%)

A difference counts only when it clears the combined spread of the two measurements, per shape (2σ: simple 2.7ms, investment 2.5ms, fifo 1.4ms), and is at least 5%.
10,000 transactions per shape · 20 runs, 3 warmup · hyperfine

What do these numbers mean?
  • simple — Two-posting transfers, one currency. The historical workload — keep as the floor, not as the benchmark.
  • investment — Cost specs, per-unit prices and lot reductions. Exercises booking and inventory, which simple leaves at 0.3%.
  • fifo — Bare {} reductions against a FIFO account — how FIFO sells are normally written. The other four shapes reach the ordered-selection path twice in 2k transactions between them, so it was effectively unprofiled until it turned out to be quadratic (plan_ordered scans every lot per reduction: FIFO ledgers are quadratic (8.8s at 20k transactions) #2083).
  • vs base: the PR and the base-branch commit it is built on, built and measured in the same job
  • RSS: peak resident set size, a single sample — reported without a verdict because there is no spread to test it against
  • A shape with no beancount column is one bean-check reports errors on; it is timed for rledger only

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100% (raw 93%, 170 masked)
Full AST Match 100%
Total Files 811
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
    The headline is the EFFECTIVE rate, after pairs where beanquery
    itself is wrong are masked. raw is the same run with nothing
    masked. A widening gap means the registry grew, not that rledger
    changed.
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

@robcohen
robcohen merged commit ffa4faf into main Aug 24, 2026
60 checks passed
@robcohen
robcohen deleted the chore/wasmtime-48-pair branch August 24, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants