Title: Extract capability-scoped WASI host into a shared crate by youknowdot · Pull Request #9869 · RustPython/RustPython · GitHub
Open Graph Title: Extract capability-scoped WASI host into a shared crate by youknowdot · Pull Request #9869 · RustPython/RustPython
X Title: Extract capability-scoped WASI host into a shared crate by youknowdot · Pull Request #9869 · RustPython/RustPython
Description: Scope Extract the capability-scoped WASI host from the no-JS example into rustpython-wasi-host, implementing the shared-core prerequisite in #9853. This is independent of the errno alignment in #9868 and does not close #9853. Move the existing descriptor table, preopen rights checks, confined UTF-8 path handling, and file operations into a workspace crate depending only on cap-std and std. Separate generic guest-memory decoding/validation from the Rust-valued operations. Keep Wasmer bindings in the example runner. Move the existing capability tests into the workspace crate, so existing workspace test jobs exercise them without compiling Wasmer. Preserve the invalid guest range / non-consumption test using an in-memory adapter. Preserve missing-memory versus invalid-length error precedence. No syscall additions, changed rights, global descriptor tables, or native ambient-I/O checks. The core implementation is token-identical after removing runtime imports and changing visibility. The adapter uses static dispatch, not a trait object. The VM does not depend on the new crate yet; native host_io, stdio lending, browser integration, and additional syscall/importlib work remain separate stages. Validation cargo test --locked -p rustpython-wasi-host: 8 tests passed. cargo clippy --locked -p rustpython-wasi-host --all-targets -- -D warnings: passed. Example Wasmer runtime cargo check --locked and cargo build --locked: passed (dependency proc-macro-error2 future-incompatibility warning). cargo check --locked -p rustpython-wasi-host --all-targets --target x86_64-pc-windows-gnu: passed (cross-compilation, not Windows execution). Actual Wasmer WAT contract exercised all ten imported operations, read/write/seek/truncate/sync/close, confined paths, invalid UTF-8 and out-of-bounds memory. A separate start-function contract checks missing-memory error precedence. Both contracts passed on original-main and extracted runners in dev and release builds. Formatting, changed-file hooks and git diff --check: passed. The pre-existing per-iovec allocations remain unchanged: the 64 KiB transfer limit is not an aggregate allocation limit. This extraction does not claim to resolve that resource-budget question. A narrow release microbenchmark (10 million fd_fdstat_get calls, 4 ABBA blocks, 8 samples per version after warmup) measured baseline median 0.5109 s versus candidate 0.4938 s. This is not a claimed speedup or a general Python performance result. The dev-profile probe was slower (0.8077 s versus 0.9069 s for 1 million calls), so dev-mode overhead is not hidden. Release executable text/data/bss grew by 4,152 bytes (~0.023%); the native VM's dependency graph and execution path are unchanged. Full VM/CAPI/workspace tests and full Python cross-mode contracts have not been run locally. CI results are not a claim that the remaining #9853 backends are implemented. Assisted-by: Codex (model version unavailable).
Open Graph Description: Scope Extract the capability-scoped WASI host from the no-JS example into rustpython-wasi-host, implementing the shared-core prerequisite in #9853. This is independent of the errno alignment in #98...
X Description: Scope Extract the capability-scoped WASI host from the no-JS example into rustpython-wasi-host, implementing the shared-core prerequisite in #9853. This is independent of the errno alignment in #98...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9869
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:87520aa8-0634-ee1e-ed48-7db337151dfc |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CF08:31E99C:2F0D5CB:3EC5DD4:6B01DE27 |
| html-safe-nonce | a489fa5108f3c6eb82ac683d5a3ed30e39b80a13f82469f3067c77c4a437d3a1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjA4OjMxRTk5QzoyRjBENUNCOjNFQzVERDQ6NkIwMURFMjciLCJ2aXNpdG9yX2lkIjoiMjE1MjIxNjg0ODc2MjA1NjA3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 667e146ce0f66a8262def7b98d7fff70dcd2510ca04c442bf496c7f33a6c11a7 |
| hovercard-subject-tag | pull_request:5331025521 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9869/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | Scope Extract the capability-scoped WASI host from the no-JS example into rustpython-wasi-host, implementing the shared-core prerequisite in #9853. This is independent of the errno alignment in #98... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width