From 94232a1c5c30294bc452316173dfc2b84253c8e4 Mon Sep 17 00:00:00 2001 From: Corbin Crutchley Date: Fri, 24 Jul 2026 02:41:10 -0700 Subject: [PATCH] chore: bootstrap phase 0 workspace --- .github/workflows/ci.yml | 76 ++++ .gitignore | 8 + CONTRIBUTING.md | 19 + Cargo.lock | 155 +++++++ Cargo.toml | 27 ++ LICENSE-APACHE | 201 +++++++++ LICENSE-MIT | 21 + README.md | 40 ++ crates/runtime-core/Cargo.toml | 13 + crates/runtime-core/src/lib.rs | 122 +++++ crates/wasm-probe/Cargo.toml | 17 + crates/wasm-probe/src/lib.rs | 81 ++++ crates/wasm-probe/src/main.rs | 19 + deny.toml | 29 ++ docs/architecture.md | 47 ++ docs/decisions/0000-template.md | 31 ++ docs/decisions/README.md | 7 + docs/licensing.md | 32 ++ rust-toolchain.toml | 5 + web/index.html | 26 ++ web/package.json | 28 ++ web/playwright.config.ts | 23 + web/pnpm-lock.yaml | 769 ++++++++++++++++++++++++++++++++ web/public/.gitkeep | 1 + web/src/main.ts | 44 ++ web/src/probe.ts | 22 + web/src/probe.worker.ts | 76 ++++ web/src/styles.css | 77 ++++ web/tests/probe.spec.ts | 12 + web/tsconfig.json | 13 + 30 files changed, 2041 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 CONTRIBUTING.md create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 LICENSE-APACHE create mode 100644 LICENSE-MIT create mode 100644 README.md create mode 100644 crates/runtime-core/Cargo.toml create mode 100644 crates/runtime-core/src/lib.rs create mode 100644 crates/wasm-probe/Cargo.toml create mode 100644 crates/wasm-probe/src/lib.rs create mode 100644 crates/wasm-probe/src/main.rs create mode 100644 deny.toml create mode 100644 docs/architecture.md create mode 100644 docs/decisions/0000-template.md create mode 100644 docs/decisions/README.md create mode 100644 docs/licensing.md create mode 100644 rust-toolchain.toml create mode 100644 web/index.html create mode 100644 web/package.json create mode 100644 web/playwright.config.ts create mode 100644 web/pnpm-lock.yaml create mode 100644 web/public/.gitkeep create mode 100644 web/src/main.ts create mode 100644 web/src/probe.ts create mode 100644 web/src/probe.worker.ts create mode 100644 web/src/styles.css create mode 100644 web/tests/probe.spec.ts create mode 100644 web/tsconfig.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d0876d5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,76 @@ +name: CI + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + test: + name: Rust and Chrome + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - name: Check out repository + uses: actions/checkout@v6 + + - name: Install pinned Rust toolchain + run: rustup show + + - name: Check Rust formatting + run: cargo fmt --all --check + + - name: Lint Rust + run: cargo clippy --workspace --all-targets --all-features -- -D warnings + + - name: Test Rust + run: cargo test --workspace --all-features + + - name: Check browser target + run: cargo check --workspace --all-targets --all-features --target wasm32-unknown-unknown + + - name: Install pnpm + uses: pnpm/action-setup@v6 + with: + package_json_file: web/package.json + + - name: Install Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + cache: pnpm + cache-dependency-path: web/pnpm-lock.yaml + + - name: Install web dependencies + run: pnpm --dir web install --frozen-lockfile + + - name: Install headless Chromium + run: pnpm --dir web exec playwright install --with-deps chromium + + - name: Check browser probe + run: pnpm --dir web run check + + - name: Audit production web dependencies + run: pnpm --dir web audit --prod --audit-level high + + - name: Build browser probe + run: pnpm --dir web run build + + - name: Test in headless Chrome + run: pnpm --dir web test + + dependencies: + name: Dependency policy + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v6 + + - name: Audit advisories, licenses, bans, and sources + uses: EmbarkStudios/cargo-deny-action@v2 + with: + rust-version: "1.93.0" + command: check + arguments: --all-features diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d9978f1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +/target/ +/.pnpm-store/ +/web/dist/ +/web/node_modules/ +/web/playwright-report/ +/web/test-results/ +/web/public/memory64-probe.wasm +.DS_Store diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d373613 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,19 @@ +# Contributing + +## Development checks + +Before opening a change, run the Rust formatter, Clippy with warnings denied, the Rust tests, the `wasm32-unknown-unknown` check, and the web checks documented in the README. + +Core CPU, IR, memory, ELF, and Linux semantics must remain testable without a browser. Browser capabilities belong behind explicit host boundaries. Add focused regression tests with every behavior change. + +## Dependencies + +Keep dependencies small and explicit. Record the license, browser compatibility, native-host assumptions, and reason for any foundational dependency in an architecture decision record. GPL implementation code must not enter the permissively licensed core accidentally. + +## Safety + +The workspace forbids `unsafe` code by default. A future exception must be narrowly scoped, document its invariants, and include targeted tests. + +## Commit style + +Use concise imperative subjects, such as `feat: add Memory64 browser probe` or `docs: record Icicle feasibility decision`. diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..c390b36 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,155 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "binarrow-runtime-core" +version = "0.1.0" + +[[package]] +name = "binarrow-wasm-probe" +version = "0.1.0" +dependencies = [ + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "foldhash", + "serde", + "serde_core", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown", + "serde", + "serde_core", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "wasm-encoder" +version = "0.254.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09480d646178e5fdd12bb06e812d0af9a3a191dbc9cd697fdc86687beade7393" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.254.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5769a29f799fbab136aaf65b4fe5384cd7d93fe6fc9ba0dcb6c8382a1f16e27" +dependencies = [ + "bitflags", + "hashbrown", + "indexmap", + "semver", + "serde", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..341be94 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,27 @@ +[workspace] +members = [ + "crates/runtime-core", + "crates/wasm-probe", +] +resolver = "3" + +[workspace.package] +version = "0.1.0" +edition = "2024" +rust-version = "1.93" +license = "MIT OR Apache-2.0" +repository = "https://github.com/crutchcorn/binarrow" + +[workspace.dependencies] +wasm-encoder = "0.254.0" + +[workspace.lints.rust] +unsafe_code = "forbid" + +[workspace.lints.clippy] +all = { level = "warn", priority = -1 } +pedantic = { level = "warn", priority = -1 } + +[profile.release] +lto = "thin" +strip = "debuginfo" diff --git a/LICENSE-APACHE b/LICENSE-APACHE new file mode 100644 index 0000000..3b2ff19 --- /dev/null +++ b/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2026 binarrow contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/LICENSE-MIT b/LICENSE-MIT new file mode 100644 index 0000000..02af8c6 --- /dev/null +++ b/LICENSE-MIT @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 binarrow contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..f822d8d --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# binarrow + +`binarrow` is an experimental browser runtime for AArch64 Linux ELF executables. It aims to load a userspace process image, interpret AArch64 through an architecture-neutral IR, handle Linux system calls against explicit host interfaces, and eventually translate hot guest code to WebAssembly. + +The project is in the Phase 0 feasibility stage described in [PLAN.md](PLAN.md). The current bootstrap deliberately contains only the boundaries needed for that work: + +- `crates/runtime-core`: host-independent process types, traps, and resource limits. +- `crates/wasm-probe`: generation of the Memory64 WebAssembly module used by browser tests. +- `web`: a Worker-based Chrome feature report and Playwright smoke test. +- `docs/decisions`: architecture decision records, including the pending Icicle evaluation. + +## Prerequisites + +- Rust 1.93 (installed automatically by `rustup` from `rust-toolchain.toml`) +- Node.js 24 +- pnpm 10 +- Chrome or Playwright's Chromium build for the browser smoke test + +## Checks + +```sh +cargo fmt --all --check +cargo clippy --workspace --all-targets --all-features -- -D warnings +cargo test --workspace --all-features +cargo check --workspace --all-targets --target wasm32-unknown-unknown + +pnpm --dir web install --frozen-lockfile +pnpm --dir web run check +pnpm --dir web test +``` + +The browser test generates `web/public/memory64-probe.wasm` from Rust before starting Vite. Generated artifacts are not committed. + +## Scope + +The immediate milestone is feasibility, not a web IDE or broad Linux compatibility. See [PLAN.md](PLAN.md) for the roadmap and [docs/architecture.md](docs/architecture.md) for the initial boundaries. + +## License + +Licensed under either the Apache License, Version 2.0 or the MIT license, at your option. diff --git a/crates/runtime-core/Cargo.toml b/crates/runtime-core/Cargo.toml new file mode 100644 index 0000000..63d84c9 --- /dev/null +++ b/crates/runtime-core/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "binarrow-runtime-core" +description = "Host-independent runtime vocabulary for binarrow" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +repository.workspace = true + +[dependencies] + +[lints] +workspace = true diff --git a/crates/runtime-core/src/lib.rs b/crates/runtime-core/src/lib.rs new file mode 100644 index 0000000..7ed94ba --- /dev/null +++ b/crates/runtime-core/src/lib.rs @@ -0,0 +1,122 @@ +//! Host-independent vocabulary shared by the binarrow runtime. +//! +//! This crate intentionally contains no browser or native host I/O. Keeping these +//! types portable lets CPU, loader, and runtime tests execute on native hosts and +//! `wasm32-unknown-unknown` from the same source. + +use core::fmt; + +/// An address in a guest process's virtual address space. +#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub struct GuestAddress(u64); + +impl GuestAddress { + /// The null guest address. + pub const NULL: Self = Self(0); + + /// Creates an address from its raw LP64 representation. + #[must_use] + pub const fn new(value: u64) -> Self { + Self(value) + } + + /// Returns the raw LP64 representation. + #[must_use] + pub const fn get(self) -> u64 { + self.0 + } + + /// Adds an offset without wrapping the guest address space. + #[must_use] + pub const fn checked_add(self, offset: u64) -> Option { + match self.0.checked_add(offset) { + Some(value) => Some(Self(value)), + None => None, + } + } +} + +impl fmt::Display for GuestAddress { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(formatter, "{:#018x}", self.0) + } +} + +/// Configurable limits enforced around each guest process. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct ResourceLimits { + /// Maximum guest linear memory in bytes. + pub max_memory_bytes: u64, + /// Maximum guest instructions before yielding or terminating. + pub instruction_budget: u64, + /// Maximum bytes accepted from stdout and stderr together. + pub max_output_bytes: u64, + /// Maximum simultaneously open guest descriptors. + pub max_open_files: u32, +} + +impl Default for ResourceLimits { + fn default() -> Self { + Self { + max_memory_bytes: 256 * 1024 * 1024, + instruction_budget: 10_000_000, + max_output_bytes: 4 * 1024 * 1024, + max_open_files: 256, + } + } +} + +/// A host-independent reason guest execution stopped unexpectedly. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum Trap { + /// An instruction could not be decoded or is outside the virtual CPU profile. + UnsupportedInstruction { pc: GuestAddress, encoding: u32 }, + /// The guest attempted an invalid memory access. + MemoryFault { + address: GuestAddress, + access: MemoryAccess, + }, + /// A configured resource limit was exhausted. + ResourceLimit(ResourceLimit), +} + +/// The operation that caused a guest memory fault. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum MemoryAccess { + Read, + Write, + Execute, +} + +/// A resource whose configured limit was exhausted. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum ResourceLimit { + Instructions, + Memory, + Output, + OpenFiles, +} + +#[cfg(test)] +mod tests { + use super::{GuestAddress, ResourceLimits}; + + #[test] + fn guest_address_addition_rejects_overflow() { + assert_eq!( + GuestAddress::new(u64::MAX).checked_add(1), + None, + "guest address arithmetic must never wrap" + ); + } + + #[test] + fn resource_defaults_are_bounded() { + let limits = ResourceLimits::default(); + + assert!(limits.max_memory_bytes > 0); + assert!(limits.instruction_budget > 0); + assert!(limits.max_output_bytes > 0); + assert!(limits.max_open_files > 0); + } +} diff --git a/crates/wasm-probe/Cargo.toml b/crates/wasm-probe/Cargo.toml new file mode 100644 index 0000000..a1f9720 --- /dev/null +++ b/crates/wasm-probe/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "binarrow-wasm-probe" +description = "Generated WebAssembly feature probes for binarrow" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +repository.workspace = true + +[dependencies] +wasm-encoder.workspace = true + +[dev-dependencies] +wasmparser = "0.254.0" + +[lints] +workspace = true diff --git a/crates/wasm-probe/src/lib.rs b/crates/wasm-probe/src/lib.rs new file mode 100644 index 0000000..16b674e --- /dev/null +++ b/crates/wasm-probe/src/lib.rs @@ -0,0 +1,81 @@ +//! Small generated WebAssembly modules used to probe browser capabilities. + +use wasm_encoder::{ + CodeSection, ConstExpr, ExportKind, ExportSection, Function, FunctionSection, GlobalSection, + GlobalType, Instruction, MemorySection, MemoryType, Module, TypeSection, ValType, +}; + +/// Emits a module with one 64-bit memory and an exported function that reports +/// the memory size in WebAssembly pages. +#[must_use] +pub fn memory64_probe() -> Vec { + let mut module = Module::new(); + + let mut types = TypeSection::new(); + types.ty().function([], [ValType::I64]); + module.section(&types); + + let mut functions = FunctionSection::new(); + functions.function(0); + module.section(&functions); + + let mut memories = MemorySection::new(); + memories.memory(MemoryType { + minimum: 1, + maximum: Some(2), + memory64: true, + shared: false, + page_size_log2: None, + }); + module.section(&memories); + + // Export a fixed marker as well as the memory so JavaScript can distinguish + // successful instantiation from a fetch or MIME-type failure. + let mut globals = GlobalSection::new(); + globals.global( + GlobalType { + val_type: ValType::I32, + mutable: false, + shared: false, + }, + &ConstExpr::i32_const(0x4249_4e41), + ); + module.section(&globals); + + let mut exports = ExportSection::new(); + exports.export("memory", ExportKind::Memory, 0); + exports.export("memory_pages", ExportKind::Func, 0); + exports.export("probe_marker", ExportKind::Global, 0); + module.section(&exports); + + let mut code = CodeSection::new(); + let mut function = Function::new([]); + function.instruction(&Instruction::MemorySize(0)); + function.instruction(&Instruction::End); + code.function(&function); + module.section(&code); + + module.finish() +} + +#[cfg(test)] +mod tests { + use super::memory64_probe; + + #[test] + fn generated_module_has_wasm_header() { + assert_eq!(&memory64_probe()[..8], b"\0asm\x01\0\0\0"); + } + + #[test] + fn generated_module_is_valid_memory64_wasm() { + wasmparser::Validator::new_with_features(wasmparser::WasmFeatures::all()) + .validate_all(&memory64_probe()) + .expect("generated Memory64 probe should be valid WebAssembly"); + } + + #[test] + fn generation_is_deterministic() { + assert_eq!(memory64_probe(), memory64_probe()); + } +} diff --git a/crates/wasm-probe/src/main.rs b/crates/wasm-probe/src/main.rs new file mode 100644 index 0000000..57584e3 --- /dev/null +++ b/crates/wasm-probe/src/main.rs @@ -0,0 +1,19 @@ +use std::{env, fs, process::ExitCode}; + +use binarrow_wasm_probe::memory64_probe; + +fn main() -> ExitCode { + let Some(output_path) = env::args_os().nth(1) else { + eprintln!("usage: binarrow-wasm-probe "); + return ExitCode::FAILURE; + }; + + let bytes = memory64_probe(); + match fs::write(&output_path, bytes) { + Ok(()) => ExitCode::SUCCESS, + Err(error) => { + eprintln!("failed to write {}: {error}", output_path.display()); + ExitCode::FAILURE + } + } +} diff --git a/deny.toml b/deny.toml new file mode 100644 index 0000000..1b2a06f --- /dev/null +++ b/deny.toml @@ -0,0 +1,29 @@ +[graph] +all-features = true +targets = [ + { triple = "x86_64-unknown-linux-gnu" }, + { triple = "wasm32-unknown-unknown" }, +] + +[advisories] +version = 2 +ignore = [] + +[licenses] +version = 2 +confidence-threshold = 0.8 +allow = [ + "Apache-2.0", + "Apache-2.0 WITH LLVM-exception", + "MIT", +] + +[bans] +multiple-versions = "warn" +wildcards = "deny" +highlight = "all" + +[sources] +unknown-registry = "deny" +unknown-git = "deny" +allow-registry = ["https://github.com/rust-lang/crates.io-index"] diff --git a/docs/architecture.md b/docs/architecture.md new file mode 100644 index 0000000..69d8a4c --- /dev/null +++ b/docs/architecture.md @@ -0,0 +1,47 @@ +# Architecture + +This document captures the boundaries the Phase 0 bootstrap establishes. It is intentionally smaller than the target workspace in `PLAN.md`; crates should be split only when a dependency or portability boundary becomes useful. + +## Dependency direction + +```text +browser UI / Worker + | + v +browser host boundary native host boundary + | | + +------------+---------------+ + v + Linux runtime + | + +----------+----------+ + v v + ELF/process loader execution engine + | + +-------------+-------------+ + v v + interpreter Wasm backend + | | + +-------------+-------------+ + v + normalized IR + | + v + AArch64 decoder/state +``` + +Architecture code must not depend on browser APIs. Linux behavior must not be embedded in instruction semantics. Host calls must cross explicit interfaces so the same core can run in Chrome, native tests, and deterministic tests. + +## Current crates + +### `binarrow-runtime-core` + +Owns small architecture-neutral vocabulary shared by future execution and host crates. It must remain browser-portable and avoid host I/O. + +### `binarrow-wasm-probe` + +Owns generated WebAssembly feature fixtures. Keeping the bytes generated by `wasm-encoder` makes feature probes reviewable and prevents checked-in binary drift. + +## Planned next boundaries + +The next crate should be an isolated Icicle experiment, not a dependency of `runtime-core`. Its ADR will decide whether decoder, P-code, memory, and Linux components are adopted selectively or rejected. ELF loading and guest memory should be added only after that feasibility result clarifies their interfaces. diff --git a/docs/decisions/0000-template.md b/docs/decisions/0000-template.md new file mode 100644 index 0000000..09753bf --- /dev/null +++ b/docs/decisions/0000-template.md @@ -0,0 +1,31 @@ +# ADR-NNNN: Decision title + +- Status: proposed +- Date: YYYY-MM-DD +- Owners: project maintainers + +## Context + +What problem or uncertainty requires a durable decision? + +## Decision drivers + +- Driver one +- Driver two + +## Considered options + +1. Option one +2. Option two + +## Decision + +What was selected, and why? + +## Consequences + +What becomes easier, harder, required, or explicitly deferred? + +## Validation + +Which prototype, test, benchmark, dependency graph, or browser experiment supports the decision? diff --git a/docs/decisions/README.md b/docs/decisions/README.md new file mode 100644 index 0000000..d1150ae --- /dev/null +++ b/docs/decisions/README.md @@ -0,0 +1,7 @@ +# Architecture decision records + +Architecture decision records (ADRs) document decisions that are costly to reverse or constrain multiple subsystems. + +Copy `0000-template.md`, assign the next number, and replace every placeholder. Keep superseded records; link the record that replaces them. + +`0001` is reserved for the Icicle adoption decision required by Phase 0. diff --git a/docs/licensing.md b/docs/licensing.md new file mode 100644 index 0000000..86d22f5 --- /dev/null +++ b/docs/licensing.md @@ -0,0 +1,32 @@ +# Licensing + +The project source is available under `MIT OR Apache-2.0`. This is an engineering inventory, not legal advice. + +## Dependency admission + +Before adopting a foundational emulator, decoder, ABI source, runtime, or toolchain component, record: + +- exact version or Git revision; +- declared and detected licenses; +- required notices and source-offer obligations; +- whether code is linked, modified, copied, or used only as a behavioral reference; +- transitive dependencies and native-only assumptions; +- `wasm32-unknown-unknown` compatibility; +- maintenance ownership if a fork is required. + +`cargo deny check` enforces the current Rust allowlist and rejects unknown registries and Git sources. CI also audits production web dependencies at high severity or above. + +## Current third-party code + +| Component | Purpose | License | Source form | +|---|---|---|---| +| `wasm-encoder` | Generate the browser Memory64 fixture | Apache-2.0 WITH LLVM-exception | Rust dependency | +| `wasmparser` | Validate generated WebAssembly in tests | Apache-2.0 WITH LLVM-exception | Rust dev dependency | +| `wasm-feature-detect` | Canonical browser feature probes | Apache-2.0 | JavaScript dependency | +| Vite, TypeScript, Playwright | Build, type-check, and test the probe | MIT / Apache-2.0 | Development dependencies | + +Refresh this table whenever production or foundational dependencies change. Toolchain and guest-runtime distribution manifests will be tracked separately once binary assets are introduced. + +## Architecture references + +Implementations may use public Arm and Linux specifications as behavioral sources. Do not copy specification prose, diagrams, pseudocode, or GPL implementation code into the permissive project core. ADR-0001 must include the full Icicle license and transitive-dependency review before any adoption decision. diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..a460dfe --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +channel = "1.93.0" +components = ["clippy", "rustfmt"] +targets = ["wasm32-unknown-unknown"] +profile = "minimal" diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..f97d29e --- /dev/null +++ b/web/index.html @@ -0,0 +1,26 @@ + + + + + + + binarrow browser probe + + + +
+

Phase 0 feasibility

+

binarrow browser probe

+

+ This Worker checks the WebAssembly capabilities required by the planned + AArch64 userspace runtime. Memory64 is tested by instantiating a module + generated from Rust with wasm-encoder. +

+

Starting probe Worker…

+
+
+ + diff --git a/web/package.json b/web/package.json new file mode 100644 index 0000000..95c517b --- /dev/null +++ b/web/package.json @@ -0,0 +1,28 @@ +{ + "name": "@binarrow/browser-probe", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "pnpm@10.33.0", + "engines": { + "node": ">=24" + }, + "scripts": { + "build": "vite build", + "check": "tsc --noEmit", + "dev": "vite --host 127.0.0.1", + "generate:probe": "cargo run --quiet --manifest-path ../Cargo.toml -p binarrow-wasm-probe -- public/memory64-probe.wasm", + "prebuild": "pnpm generate:probe", + "pretest": "pnpm generate:probe", + "test": "playwright test" + }, + "dependencies": { + "wasm-feature-detect": "^1.8.0" + }, + "devDependencies": { + "@playwright/test": "^1.61.1", + "@types/node": "^26.1.1", + "typescript": "^7.0.2", + "vite": "^8.1.5" + } +} diff --git a/web/playwright.config.ts b/web/playwright.config.ts new file mode 100644 index 0000000..0395bc2 --- /dev/null +++ b/web/playwright.config.ts @@ -0,0 +1,23 @@ +import { defineConfig, devices } from "@playwright/test"; + +export default defineConfig({ + testDir: "./tests", + forbidOnly: Boolean(process.env.CI), + retries: process.env.CI ? 2 : 0, + reporter: process.env.CI ? "github" : "list", + use: { + baseURL: "http://127.0.0.1:4173", + trace: "on-first-retry", + }, + webServer: { + command: "pnpm dev --port 4173", + url: "http://127.0.0.1:4173", + reuseExistingServer: !process.env.CI, + }, + projects: [ + { + name: "chromium", + use: { ...devices["Desktop Chrome"] }, + }, + ], +}); diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml new file mode 100644 index 0000000..24b362f --- /dev/null +++ b/web/pnpm-lock.yaml @@ -0,0 +1,769 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + wasm-feature-detect: + specifier: ^1.8.0 + version: 1.8.0 + devDependencies: + '@playwright/test': + specifier: ^1.61.1 + version: 1.61.1 + '@types/node': + specifier: ^26.1.1 + version: 26.1.1 + typescript: + specifier: ^7.0.2 + version: 7.0.2 + vite: + specifier: ^8.1.5 + version: 8.1.5(@types/node@26.1.1) + +packages: + + '@emnapi/core@1.11.1': + resolution: {integrity: sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==} + + '@emnapi/runtime@1.11.1': + resolution: {integrity: sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==} + + '@emnapi/wasi-threads@1.2.2': + resolution: {integrity: sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==} + + '@napi-rs/wasm-runtime@1.1.6': + resolution: {integrity: sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==} + peerDependencies: + '@emnapi/core': ^1.7.1 + '@emnapi/runtime': ^1.7.1 + + '@oxc-project/types@0.139.0': + resolution: {integrity: sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==} + + '@playwright/test@1.61.1': + resolution: {integrity: sha512-8nKv6+0RJSL9FE4jYOEGXnPeM/Hg12qZpmqzZjRh3qM0Y7c3z1mrOTfFLids72RDQYVh9WpLEfR5WdpNX4fkig==} + engines: {node: '>=18'} + hasBin: true + + '@rolldown/binding-android-arm64@1.1.5': + resolution: {integrity: sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.1.5': + resolution: {integrity: sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.1.5': + resolution: {integrity: sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.1.5': + resolution: {integrity: sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.1.5': + resolution: {integrity: sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.1.5': + resolution: {integrity: sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.1.5': + resolution: {integrity: sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.1.5': + resolution: {integrity: sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.1.5': + resolution: {integrity: sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.1.5': + resolution: {integrity: sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.1.5': + resolution: {integrity: sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.1.5': + resolution: {integrity: sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.1.5': + resolution: {integrity: sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.1.5': + resolution: {integrity: sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.1.5': + resolution: {integrity: sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.1': + resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} + + '@tybys/wasm-util@0.10.3': + resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==} + + '@types/node@26.1.1': + resolution: {integrity: sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==} + + '@typescript/typescript-aix-ppc64@7.0.2': + resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [aix] + + '@typescript/typescript-darwin-arm64@7.0.2': + resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [darwin] + + '@typescript/typescript-darwin-x64@7.0.2': + resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [darwin] + + '@typescript/typescript-freebsd-arm64@7.0.2': + resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [freebsd] + + '@typescript/typescript-freebsd-x64@7.0.2': + resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [freebsd] + + '@typescript/typescript-linux-arm64@7.0.2': + resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [linux] + + '@typescript/typescript-linux-arm@7.0.2': + resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==} + engines: {node: '>=16.20.0'} + cpu: [arm] + os: [linux] + + '@typescript/typescript-linux-loong64@7.0.2': + resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==} + engines: {node: '>=16.20.0'} + cpu: [loong64] + os: [linux] + + '@typescript/typescript-linux-mips64el@7.0.2': + resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==} + engines: {node: '>=16.20.0'} + cpu: [mips64el] + os: [linux] + + '@typescript/typescript-linux-ppc64@7.0.2': + resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [linux] + + '@typescript/typescript-linux-riscv64@7.0.2': + resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==} + engines: {node: '>=16.20.0'} + cpu: [riscv64] + os: [linux] + + '@typescript/typescript-linux-s390x@7.0.2': + resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==} + engines: {node: '>=16.20.0'} + cpu: [s390x] + os: [linux] + + '@typescript/typescript-linux-x64@7.0.2': + resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [linux] + + '@typescript/typescript-netbsd-arm64@7.0.2': + resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [netbsd] + + '@typescript/typescript-netbsd-x64@7.0.2': + resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [netbsd] + + '@typescript/typescript-openbsd-arm64@7.0.2': + resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [openbsd] + + '@typescript/typescript-openbsd-x64@7.0.2': + resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [openbsd] + + '@typescript/typescript-sunos-x64@7.0.2': + resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [sunos] + + '@typescript/typescript-win32-arm64@7.0.2': + resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [win32] + + '@typescript/typescript-win32-x64@7.0.2': + resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [win32] + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fsevents@2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + lightningcss-android-arm64@1.33.0: + resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.33.0: + resolution: {integrity: sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.33.0: + resolution: {integrity: sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.33.0: + resolution: {integrity: sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.33.0: + resolution: {integrity: sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.33.0: + resolution: {integrity: sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.33.0: + resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.33.0: + resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.33.0: + resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.33.0: + resolution: {integrity: sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.33.0: + resolution: {integrity: sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.33.0: + resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==} + engines: {node: '>= 12.0.0'} + + nanoid@3.3.16: + resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.5: + resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} + engines: {node: '>=12'} + + playwright-core@1.61.1: + resolution: {integrity: sha512-h7Qlt6m4REp25qvIdvbDtVmD4LqVXfpRxhORv9L0jzETM05p4fuPJ3dKyuSXQxDSbXnmS79HAgi9589lGSpLkg==} + engines: {node: '>=18'} + hasBin: true + + playwright@1.61.1: + resolution: {integrity: sha512-DWnY5o3YbLWK4GovuAVwpqL+1VwGNdUGrRr++8j8PtQQzvAVZUIMjKQ90fY689sEJZJBbZVw1rXaOKSTitkzPQ==} + engines: {node: '>=18'} + hasBin: true + + postcss@8.5.22: + resolution: {integrity: sha512-KBDEIpLrvpv16pp3K0Fw+UCoZfopFjjgeB+0tA/aaThfEE74kKDLrgg603YvOWJyg3+WYtyq3xYsQWsIyZlPqQ==} + engines: {node: ^10 || ^12 || >=14} + + rolldown@1.1.5: + resolution: {integrity: sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + typescript@7.0.2: + resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} + engines: {node: '>=16.20.0'} + hasBin: true + + undici-types@8.3.0: + resolution: {integrity: sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==} + + vite@8.1.5: + resolution: {integrity: sha512-7ULLwsCdYx/nRyrpiEwvqb5TFHrMVZyBt+rg/OAXT7rgj/z+DtTDyKFeLAdDkubDVDKD8jOsndmy7m55XcfUsw==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.3.0 + esbuild: ^0.27.0 || ^0.28.0 + jiti: '>=1.21.0' + less: ^4.0.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + wasm-feature-detect@1.8.0: + resolution: {integrity: sha512-zksaLKM2fVlnB5jQQDqKXXwYHLQUVH9es+5TOOHwGOVJOCeRBCiPjwSg+3tN2AdTCzjgli4jijCH290kXb/zWQ==} + +snapshots: + + '@emnapi/core@1.11.1': + dependencies: + '@emnapi/wasi-threads': 1.2.2 + tslib: 2.8.1 + optional: true + + '@emnapi/runtime@1.11.1': + dependencies: + tslib: 2.8.1 + optional: true + + '@emnapi/wasi-threads@1.2.2': + dependencies: + tslib: 2.8.1 + optional: true + + '@napi-rs/wasm-runtime@1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)': + dependencies: + '@emnapi/core': 1.11.1 + '@emnapi/runtime': 1.11.1 + '@tybys/wasm-util': 0.10.3 + optional: true + + '@oxc-project/types@0.139.0': {} + + '@playwright/test@1.61.1': + dependencies: + playwright: 1.61.1 + + '@rolldown/binding-android-arm64@1.1.5': + optional: true + + '@rolldown/binding-darwin-arm64@1.1.5': + optional: true + + '@rolldown/binding-darwin-x64@1.1.5': + optional: true + + '@rolldown/binding-freebsd-x64@1.1.5': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.1.5': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.1.5': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.1.5': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.1.5': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.1.5': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.1.5': + optional: true + + '@rolldown/binding-linux-x64-musl@1.1.5': + optional: true + + '@rolldown/binding-openharmony-arm64@1.1.5': + optional: true + + '@rolldown/binding-wasm32-wasi@1.1.5': + dependencies: + '@emnapi/core': 1.11.1 + '@emnapi/runtime': 1.11.1 + '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.1.5': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.1.5': + optional: true + + '@rolldown/pluginutils@1.0.1': {} + + '@tybys/wasm-util@0.10.3': + dependencies: + tslib: 2.8.1 + optional: true + + '@types/node@26.1.1': + dependencies: + undici-types: 8.3.0 + + '@typescript/typescript-aix-ppc64@7.0.2': + optional: true + + '@typescript/typescript-darwin-arm64@7.0.2': + optional: true + + '@typescript/typescript-darwin-x64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-x64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm@7.0.2': + optional: true + + '@typescript/typescript-linux-loong64@7.0.2': + optional: true + + '@typescript/typescript-linux-mips64el@7.0.2': + optional: true + + '@typescript/typescript-linux-ppc64@7.0.2': + optional: true + + '@typescript/typescript-linux-riscv64@7.0.2': + optional: true + + '@typescript/typescript-linux-s390x@7.0.2': + optional: true + + '@typescript/typescript-linux-x64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-sunos-x64@7.0.2': + optional: true + + '@typescript/typescript-win32-arm64@7.0.2': + optional: true + + '@typescript/typescript-win32-x64@7.0.2': + optional: true + + detect-libc@2.1.2: {} + + fdir@6.5.0(picomatch@4.0.5): + optionalDependencies: + picomatch: 4.0.5 + + fsevents@2.3.2: + optional: true + + fsevents@2.3.3: + optional: true + + lightningcss-android-arm64@1.33.0: + optional: true + + lightningcss-darwin-arm64@1.33.0: + optional: true + + lightningcss-darwin-x64@1.33.0: + optional: true + + lightningcss-freebsd-x64@1.33.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.33.0: + optional: true + + lightningcss-linux-arm64-gnu@1.33.0: + optional: true + + lightningcss-linux-arm64-musl@1.33.0: + optional: true + + lightningcss-linux-x64-gnu@1.33.0: + optional: true + + lightningcss-linux-x64-musl@1.33.0: + optional: true + + lightningcss-win32-arm64-msvc@1.33.0: + optional: true + + lightningcss-win32-x64-msvc@1.33.0: + optional: true + + lightningcss@1.33.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.33.0 + lightningcss-darwin-arm64: 1.33.0 + lightningcss-darwin-x64: 1.33.0 + lightningcss-freebsd-x64: 1.33.0 + lightningcss-linux-arm-gnueabihf: 1.33.0 + lightningcss-linux-arm64-gnu: 1.33.0 + lightningcss-linux-arm64-musl: 1.33.0 + lightningcss-linux-x64-gnu: 1.33.0 + lightningcss-linux-x64-musl: 1.33.0 + lightningcss-win32-arm64-msvc: 1.33.0 + lightningcss-win32-x64-msvc: 1.33.0 + + nanoid@3.3.16: {} + + picocolors@1.1.1: {} + + picomatch@4.0.5: {} + + playwright-core@1.61.1: {} + + playwright@1.61.1: + dependencies: + playwright-core: 1.61.1 + optionalDependencies: + fsevents: 2.3.2 + + postcss@8.5.22: + dependencies: + nanoid: 3.3.16 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + rolldown@1.1.5: + dependencies: + '@oxc-project/types': 0.139.0 + '@rolldown/pluginutils': 1.0.1 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.1.5 + '@rolldown/binding-darwin-arm64': 1.1.5 + '@rolldown/binding-darwin-x64': 1.1.5 + '@rolldown/binding-freebsd-x64': 1.1.5 + '@rolldown/binding-linux-arm-gnueabihf': 1.1.5 + '@rolldown/binding-linux-arm64-gnu': 1.1.5 + '@rolldown/binding-linux-arm64-musl': 1.1.5 + '@rolldown/binding-linux-ppc64-gnu': 1.1.5 + '@rolldown/binding-linux-s390x-gnu': 1.1.5 + '@rolldown/binding-linux-x64-gnu': 1.1.5 + '@rolldown/binding-linux-x64-musl': 1.1.5 + '@rolldown/binding-openharmony-arm64': 1.1.5 + '@rolldown/binding-wasm32-wasi': 1.1.5 + '@rolldown/binding-win32-arm64-msvc': 1.1.5 + '@rolldown/binding-win32-x64-msvc': 1.1.5 + + source-map-js@1.2.1: {} + + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.5) + picomatch: 4.0.5 + + tslib@2.8.1: + optional: true + + typescript@7.0.2: + optionalDependencies: + '@typescript/typescript-aix-ppc64': 7.0.2 + '@typescript/typescript-darwin-arm64': 7.0.2 + '@typescript/typescript-darwin-x64': 7.0.2 + '@typescript/typescript-freebsd-arm64': 7.0.2 + '@typescript/typescript-freebsd-x64': 7.0.2 + '@typescript/typescript-linux-arm': 7.0.2 + '@typescript/typescript-linux-arm64': 7.0.2 + '@typescript/typescript-linux-loong64': 7.0.2 + '@typescript/typescript-linux-mips64el': 7.0.2 + '@typescript/typescript-linux-ppc64': 7.0.2 + '@typescript/typescript-linux-riscv64': 7.0.2 + '@typescript/typescript-linux-s390x': 7.0.2 + '@typescript/typescript-linux-x64': 7.0.2 + '@typescript/typescript-netbsd-arm64': 7.0.2 + '@typescript/typescript-netbsd-x64': 7.0.2 + '@typescript/typescript-openbsd-arm64': 7.0.2 + '@typescript/typescript-openbsd-x64': 7.0.2 + '@typescript/typescript-sunos-x64': 7.0.2 + '@typescript/typescript-win32-arm64': 7.0.2 + '@typescript/typescript-win32-x64': 7.0.2 + + undici-types@8.3.0: {} + + vite@8.1.5(@types/node@26.1.1): + dependencies: + lightningcss: 1.33.0 + picomatch: 4.0.5 + postcss: 8.5.22 + rolldown: 1.1.5 + tinyglobby: 0.2.17 + optionalDependencies: + '@types/node': 26.1.1 + fsevents: 2.3.3 + + wasm-feature-detect@1.8.0: {} diff --git a/web/public/.gitkeep b/web/public/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/web/public/.gitkeep @@ -0,0 +1 @@ + diff --git a/web/src/main.ts b/web/src/main.ts new file mode 100644 index 0000000..1c7b2b5 --- /dev/null +++ b/web/src/main.ts @@ -0,0 +1,44 @@ +import "./styles.css"; + +import type { ProbeMessage } from "./probe"; + +const status = document.querySelector("#status"); +const report = document.querySelector("#report"); + +if (!status || !report) { + throw new Error("feature report markup is incomplete"); +} + +const worker = new Worker(new URL("./probe.worker.ts", import.meta.url), { + type: "module", +}); + +worker.addEventListener("message", (event: MessageEvent) => { + if (event.data.kind === "error") { + status.textContent = `Probe failed: ${event.data.message}`; + status.dataset.state = "error"; + return; + } + + status.textContent = "Feature report ready"; + status.dataset.state = "ready"; + + for (const result of event.data.results) { + const term = document.createElement("dt"); + term.textContent = result.name; + + const detail = document.createElement("dd"); + detail.dataset.supported = String(result.supported); + detail.textContent = result.supported ? "Supported" : "Unavailable"; + if (result.detail) { + detail.title = result.detail; + } + + report.append(term, detail); + } +}); + +worker.addEventListener("error", (event) => { + status.textContent = `Worker failed: ${event.message}`; + status.dataset.state = "error"; +}); diff --git a/web/src/probe.ts b/web/src/probe.ts new file mode 100644 index 0000000..de6dd2a --- /dev/null +++ b/web/src/probe.ts @@ -0,0 +1,22 @@ +export const featureNames = [ + "Memory64", + "JSPI", + "Tail calls", + "SIMD", + "Relaxed SIMD", + "Multiple memories", + "Typed function references", + "Exception handling", +] as const; + +export type FeatureName = (typeof featureNames)[number]; + +export interface FeatureResult { + name: FeatureName; + supported: boolean; + detail?: string; +} + +export type ProbeMessage = + | { kind: "report"; results: FeatureResult[] } + | { kind: "error"; message: string }; diff --git a/web/src/probe.worker.ts b/web/src/probe.worker.ts new file mode 100644 index 0000000..f7b1098 --- /dev/null +++ b/web/src/probe.worker.ts @@ -0,0 +1,76 @@ +import { + exceptionsFinal, + jspi, + multiMemory, + relaxedSimd, + simd, + tailCall, + typedFunctionReferences, +} from "wasm-feature-detect"; + +import type { FeatureName, FeatureResult, ProbeMessage } from "./probe"; + +interface Memory64Exports extends WebAssembly.Exports { + memory: WebAssembly.Memory; + memory_pages: () => bigint; + probe_marker: WebAssembly.Global; +} + +async function instantiateMemory64Probe(): Promise { + const response = await fetch("/memory64-probe.wasm"); + if (!response.ok) { + throw new Error(`Memory64 fixture returned HTTP ${response.status}`); + } + + const bytes = await response.arrayBuffer(); + const { instance } = await WebAssembly.instantiate(bytes); + const exports = instance.exports as Memory64Exports; + + return ( + exports.memory instanceof WebAssembly.Memory && + exports.memory_pages() === 1n && + exports.probe_marker.value === 0x4249_4e41 + ); +} + +async function runProbe( + name: FeatureName, + probe: () => Promise, +): Promise { + try { + const supported = await probe(); + return { name, supported }; + } catch (error) { + return { + name, + supported: false, + detail: error instanceof Error ? error.message : String(error), + }; + } +} + +async function createReport(): Promise { + return Promise.all([ + runProbe("Memory64", instantiateMemory64Probe), + runProbe("JSPI", jspi), + runProbe("Tail calls", tailCall), + runProbe("SIMD", simd), + runProbe("Relaxed SIMD", relaxedSimd), + runProbe("Multiple memories", multiMemory), + runProbe("Typed function references", typedFunctionReferences), + runProbe("Exception handling", exceptionsFinal), + ]); +} + +createReport() + .then((results) => { + const message: ProbeMessage = { kind: "report", results }; + self.postMessage(message); + }) + .catch((error) => { + const message: ProbeMessage = { + kind: "error", + message: error instanceof Error ? error.message : String(error), + }; + self.postMessage(message); + }); diff --git a/web/src/styles.css b/web/src/styles.css new file mode 100644 index 0000000..e6875bf --- /dev/null +++ b/web/src/styles.css @@ -0,0 +1,77 @@ +:root { + color: #171713; + background: #f1efe7; + font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; + font-synthesis: none; +} +body { + min-width: 20rem; + margin: 0; +} + +main { + width: min(52rem, calc(100% - 3rem)); + margin: 0 auto; + padding: 8vh 0; +} + +.eyebrow { + margin-bottom: 0.4rem; + color: #765c16; + font-size: 0.8rem; + letter-spacing: 0.12em; + text-transform: uppercase; +} + +h1 { + margin: 0; + font-family: Georgia, serif; + font-size: clamp(2.4rem, 8vw, 5.5rem); + font-weight: 500; + line-height: 0.95; +} + +.lede { + max-width: 47rem; + margin: 2rem 0; + font-family: system-ui, sans-serif; + font-size: 1.1rem; + line-height: 1.6; +} + +#status { + padding: 0.8rem 1rem; + border: 1px solid #aaa38c; + background: #e4dfce; +} + +#status[data-state="ready"] { + border-color: #4f7258; + background: #dbe7db; +} + +#status[data-state="error"] { + border-color: #8a3e35; + background: #f2d8d3; +} + +dl { + display: grid; + grid-template-columns: minmax(12rem, 1fr) auto; + border-top: 1px solid #aaa38c; +} + +dt, +dd { + margin: 0; + padding: 0.9rem 0; + border-bottom: 1px solid #aaa38c; +} + +dd[data-supported="true"] { + color: #315b3b; +} + +dd[data-supported="false"] { + color: #8a3e35; +} diff --git a/web/tests/probe.spec.ts b/web/tests/probe.spec.ts new file mode 100644 index 0000000..2fd8df0 --- /dev/null +++ b/web/tests/probe.spec.ts @@ -0,0 +1,12 @@ +import { expect, test } from "@playwright/test"; + +test("reports required WebAssembly features from a Worker", async ({ page }) => { + await page.goto("/"); + + await expect(page.getByRole("status")).toHaveText("Feature report ready"); + await expect(page.getByText("Memory64", { exact: true })).toBeVisible(); + await expect( + page.locator("dt", { hasText: "Memory64" }).locator("+ dd"), + ).toHaveText("Supported"); + await expect(page.locator("#report dt")).toHaveCount(8); +}); diff --git a/web/tsconfig.json b/web/tsconfig.json new file mode 100644 index 0000000..10bbfc1 --- /dev/null +++ b/web/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "lib": ["ESNext", "DOM", "WebWorker"], + "module": "ESNext", + "moduleResolution": "Bundler", + "noEmit": true, + "skipLibCheck": true, + "strict": true, + "target": "ES2024", + "types": ["node", "vite/client"] + }, + "include": ["src", "tests", "playwright.config.ts"] +} -- 2.51.2