diff --git a/.gitignore b/.gitignore index 53463fea..bf5a5562 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ target tinywasm wasmtime-as-lib -image_content +image_content/* .VSCodeCounter .gdbinit diff --git a/README.md b/README.md index 49f32c22..7c7efdfb 100644 --- a/README.md +++ b/README.md @@ -1,75 +1,73 @@ # AlloyStack - +[![CI](https://github.com/anti-entropy123/AlloyStack/actions/workflows/main.yml/badge.svg)](https://github.com/anti-entropy123/AlloyStack/actions/workflows/main.yml) -## 构建 +## Abstract +AlloyStack is a library OS designed for serverless workflow applications. It reduces cold start latency through on-demand loading and optimizes intermediate data transfer overhead via reference passing. We provide user-friendly tools and scripts in the AlloyStack code repository to automate the +build and testing processes. This document guides users in reproducing the experimental results. -### 全部构建 +## Artifact check-list -不使用 MPK: +* Program: AlloyStack +* Compilation: rustup toolchain (nightly-2023-12-01-x86_64-unknown-linux-gnu) and gcc (11.4.0) +* Run-time environment: Ubuntu 22.04 +* Hardware: Intel x86 servers equipped with MPK -```bash -./scripts/build_all_common.sh -./scripts/build_user.sh -``` +## Installation -使用 MPK +**Software dependencies**. To build AlloyStack’s LibOS and Rust functions, the toolchain must be installed via rustup. To build C and Python functions, gcc (version 11.4.0) need to be installed. To run automated tests and perform data analysis, [just](https://github.com/casey/just) and python3 need to be installed. -```bash -./scripts/build_all_common_mpk.sh -./scripts/build_user.sh mpk -``` +AlloyStack and its benchmarks are \href{https://github.com/anti-entropy123/AlloyStack}{open-sourced} and can be obtained via git clone. The code repository is structured as follows: -### 单个构建 - -不使用 MPK: - -```bash -./scripts/build_all_common.sh -cargo build --manifest-path user//Cargo.toml ``` - -使用 MPK: - -```bash -./scripts/build_all_common_mpk.sh -Cargo build --features mpk --manifest-path user//Cargo.toml +AlloyStack/ + |- libasvisor/ # source code of as-visor + |- as_std/ # source code of as-std + |- common_service/ + \- ... # as-libos modules + |- user/ + \- ... # source code of benchmarks + |- isol_config/ + \- *.json # workflow specification files + |- fs_images/ + \- *.img # file system images ``` -## 增加新工作流 + +To run a new test application on AlloyStack, user need to develop functions in the `user/` directory. Then, edit the workflow specification files in the `isol_config/` directory to declare how functions compose the workflow, specify dependencies on LibOS modules, and define input parameters for functions. If the workflow involves reading datasets from files, the datasets must also be added to the file system image. Please use the following command to extract the provided image archive, which contains the source code for the Python benchmarks. ```bash -cargo run -p gen-file -vim config.json -mv config.json isol_config/[your-isol-name].json +AlloyStack$ just init ``` -## 测试 +Additionally, the repository of AlloyStack is integrated with GitHub Actions. Therefore, tools such as [act](https://github.com/nektos/act) can be used locally to quickly run some basic test cases via Docker. -### 全部测试 -不使用 MPK: +## Evaluation +### Cold start latency + +The cold start of AlloyStack can be categorized into two scenarios: enabling and disabling on-demand loading. The approximate cold start latency is measured using the execution time of `hello_world` and `load_all`, respectively. The following script can be used to automate the testing process. ```bash -./scripts/run_tests.sh +AlloyStack$ just cold_start_latency ``` -使用 MPK: +### Intermediate Data Transfer Latency +Users can control the size of the data to be transferred (in bytes) via `user/data_size.config`. The following command can automatically run the test and output key result logs. ```bash -./scripts/run_tests.sh mpk +AlloyStack$ just data_transfer_latency ``` -### 单个测试 +### End-to-end latency -不使用 MPK: +The current implementation configures the parallelism of each function through the workflow specification file. Users can generate dataset files tailored to a specific parallelism level using the `scripts/gen_data.py` script. The size of the intermediate data in `Function Chain` can be adjusted via the `function_chain_data_size.config` file located in the `user/` directory. Running the following command will automatically complete data generation, function building, and end-to-end testing for `Word Count`, `Parallel Sorting`, and `Function Chain`. ```bash -cargo run -- --files isol_config/.json +AlloyStack$ just end_to_end_latency ``` -使用 MPK: +The breakdown, P99 latency and resource consumption experiments are conducted based on variants of the aforementioned applications. To disable the on-demand loading mechanism, the workflow configuration file needs to be modified (e.g., `map_reduce_load_all.json`). To disable the reference-passing mechanism, the parameter `--features file-based` should be added when building functions. For experiments requiring concurrent request generation, we provide the load generator `p99tester` and `resourcetester`. The following script automatically switches these configuration options and runs the tests. ```bash -cargo run --features mpk -- --files isol_config/.json -``` - +AlloyStack$ just breakdown && just p99_latency && just resource_consume +``` \ No newline at end of file diff --git a/common_service/ruxfdtab/Cargo.toml b/common_service/ruxfdtab/Cargo.toml index 98c362d0..5df902b9 100644 --- a/common_service/ruxfdtab/Cargo.toml +++ b/common_service/ruxfdtab/Cargo.toml @@ -35,6 +35,7 @@ lazy_static = { version = "1.5.0", features = ["spin_no_std"] } [features] mpk = ["as_std/mpk"] use-ramdisk = ["ruxfs/use-ramdisk", "ruxfs/full", "ruxdriver"] +lock = [] log = [] -default = ["use-ramdisk"] +default = ["use-ramdisk", "lock"] diff --git a/common_service/ruxfdtab/src/as_apis.rs b/common_service/ruxfdtab/src/as_apis.rs index fa0b81fb..a121a439 100644 --- a/common_service/ruxfdtab/src/as_apis.rs +++ b/common_service/ruxfdtab/src/as_apis.rs @@ -3,7 +3,8 @@ extern crate alloc; use std::path::PathBuf; use alloc::vec; -use as_std::{libos::libos}; +use as_std::libos::libos; +use spin::Mutex; use crate::{ fd_ops::{close_file_like, get_file_like}, @@ -93,9 +94,15 @@ lazy_static::lazy_static! { }; } +#[cfg(feature = "lock")] +static GLOBAL_LOCK: Mutex<()> = Mutex::new(()); + #[no_mangle] pub fn open(path: &str, flags: OpenFlags, mode: OpenMode) -> FdtabResult { let _exec = *MUST_EXIC; + #[cfg(feature = "lock")] + let _lock = GLOBAL_LOCK.lock(); + #[cfg(feature = "log")] { println!("ruxfdtab: open path={:?}", path); @@ -128,6 +135,9 @@ pub fn open(path: &str, flags: OpenFlags, mode: OpenMode) -> FdtabResult { #[no_mangle] pub fn write(fd: Fd, buf: &[u8]) -> FdtabResult { let _exec = *MUST_EXIC; + #[cfg(feature = "lock")] + let _lock = GLOBAL_LOCK.lock(); + // libos!(stdout(format!("fd: {}, buf: {:?}", fd, buf).as_bytes())); let f = get_file_like(fd)?; @@ -144,6 +154,9 @@ pub fn write(fd: Fd, buf: &[u8]) -> FdtabResult { #[no_mangle] pub fn read(fd: Fd, buf: &mut [u8]) -> FdtabResult { let _exec = *MUST_EXIC; + #[cfg(feature = "lock")] + let _lock = GLOBAL_LOCK.lock(); + get_file_like(fd)? .read(buf) .map_err(|e| FdtabError::RuxfsError(e.to_string())) @@ -152,12 +165,18 @@ pub fn read(fd: Fd, buf: &mut [u8]) -> FdtabResult { #[no_mangle] pub fn close(fd: Fd) -> FdtabResult<()> { let _exec = *MUST_EXIC; + #[cfg(feature = "lock")] + let _lock = GLOBAL_LOCK.lock(); + close_file_like(fd) } #[no_mangle] pub fn lseek(fd: Fd, pos: u32) -> FdtabResult<()> { let _exec = *MUST_EXIC; + #[cfg(feature = "lock")] + let _lock = GLOBAL_LOCK.lock(); + fs::File::from_fd(fd)? .inner .lock() @@ -170,6 +189,9 @@ pub fn lseek(fd: Fd, pos: u32) -> FdtabResult<()> { #[no_mangle] pub fn stat(fd: Fd) -> FdtabResult { let _exec = *MUST_EXIC; + #[cfg(feature = "lock")] + let _lock = GLOBAL_LOCK.lock(); + let stat = fs::File::from_fd(fd)? .stat() .map_err(|e| FdtabError::RuxfsError(e.to_string()))?; @@ -183,6 +205,8 @@ pub fn stat(fd: Fd) -> FdtabResult { #[no_mangle] pub fn readdir(path: &str) -> FdtabResult> { let _exec = *MUST_EXIC; + #[cfg(feature = "lock")] + let _lock = GLOBAL_LOCK.lock(); #[cfg(feature = "log")] println!("[DEBUG] ruxfs read_dir: {:?}", path); diff --git a/common_service/socket/Cargo.lock b/common_service/socket/Cargo.lock index 16bef442..e2de98e3 100644 --- a/common_service/socket/Cargo.lock +++ b/common_service/socket/Cargo.lock @@ -32,7 +32,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.96", ] [[package]] @@ -73,9 +73,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "defmt" -version = "0.3.5" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2d011b2fee29fb7d659b83c43fce9a2cb4df453e16d441a51448e448f3f98" +checksum = "86f6162c53f659f65d00619fe31f14556a6e9f8752ccc4a41bd177ffcf3d6130" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -83,12 +83,12 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.3.6" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54f0216f6c5acb5ae1a47050a6645024e6edafc2ee32d421955eccfef12ef92e" +checksum = "9d135dd939bad62d7490b0002602d35b358dce5fd9233a709d3c1ef467d4bde6" dependencies = [ "defmt-parser", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", "syn 2.0.96", @@ -96,9 +96,9 @@ dependencies = [ [[package]] name = "defmt-parser" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "269924c02afd7f94bc4cecbfa5c379f6ffcf9766b3408fe63d22c728654eccd0" +checksum = "3983b127f13995e68c1e29071e5d115cd96f215ccb5e6812e3728cd6f92653b3" dependencies = [ "thiserror", ] @@ -208,27 +208,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "proc-macro-error-attr2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" dependencies = [ - "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", - "version_check", ] [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "proc-macro-error2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" dependencies = [ + "proc-macro-error-attr2", "proc-macro2", "quote", - "version_check", + "syn 2.0.96", ] [[package]] @@ -417,18 +415,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", @@ -461,12 +459,6 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/common_service/socket/src/apis.rs b/common_service/socket/src/apis.rs index c1d0170a..ae2131d9 100644 --- a/common_service/socket/src/apis.rs +++ b/common_service/socket/src/apis.rs @@ -37,7 +37,10 @@ pub fn addrinfo(name: &str) -> SmoltcpResult { let dns_socket = sockets.get_mut::(dns_handle); let query = dns_socket .start_query(iface.context(), name, DnsQueryType::A) - .map_err(|e| SmoltcpError::SmoltcpErr(e.to_string()))?; + .map_err(|e| { + println!("query err: {}", e); + SmoltcpError::DNSQueryFailed + })?; (dns_handle, query) }; diff --git a/fs_images/fatfs.zip b/fs_images/fatfs.zip index b92d472e..2b4b84fb 100644 Binary files a/fs_images/fatfs.zip and b/fs_images/fatfs.zip differ diff --git a/isol_config/wasmtime_longchain.json b/isol_config/wasmtime_longchain.json index dc97a18c..f6a321e1 100644 --- a/isol_config/wasmtime_longchain.json +++ b/isol_config/wasmtime_longchain.json @@ -1,148 +1,112 @@ { - "services": [ - [ - "fdtab", - "libruxfdtab.so" - ], - [ - "stdio", - "libstdio.so" - ], - [ - "mm", - "libmm.so" - ], - [ - "time", - "libtime.so" - ], - [ - "fatfs", - "libfatfs.so" - ] + "services": [ + [ + "fdtab", + "libruxfdtab.so" + ], + [ + "stdio", + "libstdio.so" + ], + [ + "mm", + "libmm.so" ], - "apps": [ - [ - "func1", - "libwasmtime_func.so" + [ + "time", + "libtime.so" + ], + [ + "fatfs", + "libfatfs.so" + ] + ], + "apps": [ + [ + "func1", + "libwasmtime_longchain.so" + ] + ], + "groups": [ + { + "list": [ + "func1" ], - [ - "func2", - "libwasmtime_func.so" + "args": { + "func_num": "0" + } + }, + { + "list": [ + "func1" ], - [ - "func3", - "libwasmtime_func.so" + "args": { + "func_num": "1" + } + }, + { + "list": [ + "func1" ], - [ - "func4", - "libwasmtime_func.so" + "args": { + "func_num": "2" + } + }, + { + "list": [ + "func1" ], - [ - "func5", - "libwasmtime_func.so" + "args": { + "func_num": "3" + } + }, + { + "list": [ + "func1" ], - [ - "func6", - "libwasmtime_func.so" + "args": { + "func_num": "4" + } + }, + { + "list": [ + "func1" + ], + "args": { + "func_num": "5" + } + }, + { + "list": [ + "func1" ], - [ - "func7", - "libwasmtime_func.so" + "args": { + "func_num": "6" + } + }, + { + "list": [ + "func1" ], - [ - "func8", - "libwasmtime_func.so" + "args": { + "func_num": "7" + } + }, + { + "list": [ + "func1" ], - [ - "func9", - "libwasmtime_func.so" + "args": { + "func_num": "8" + } + }, + { + "list": [ + "func1" ], - [ - "func10", - "libwasmtime_func.so" - ] - ], - "groups": [ - { - "list": [ - "func1" - ], - "args": { - "func_num": "0" - } - }, - { - "list": [ - "func2" - ], - "args": { - "func_num": "1" - } - }, - { - "list": [ - "func3" - ], - "args": { - "func_num": "2" - } - }, - { - "list": [ - "func4" - ], - "args": { - "func_num": "3" - } - }, - { - "list": [ - "func5" - ], - "args": { - "func_num": "4" - } - }, - { - "list": [ - "func6" - ], - "args": { - "func_num": "5" - } - }, - { - "list": [ - "func7" - ], - "args": { - "func_num": "6" - } - }, - { - "list": [ - "func8" - ], - "args": { - "func_num": "7" - } - }, - { - "list": [ - "func9" - ], - "args": { - "func_num": "8" - } - }, - { - "list": [ - "func10" - ], - "args": { - "func_num": "9" - } + "args": { + "func_num": "9" } - ] - } \ No newline at end of file + } + ] +} \ No newline at end of file diff --git a/justfile b/justfile index 92937889..4d624397 100644 --- a/justfile +++ b/justfile @@ -53,7 +53,7 @@ parallel_sort: done long_chain: - for name in time fdtab stdio mm; do \ + for name in time stdio mm; do \ just libos $name; \ done @@ -78,56 +78,52 @@ cc_flags_p1 := "-Wl,--gc-sections -nostdlib -Wl,--whole-archive" cc_flags_p2 := "-Wl,--no-whole-archive -shared" target := "x86_64-unknown-none" +profile := if enable_release == "1" { + "release" +} else { + "debug" +} + +symbol_link func_name: + @ln -s $(pwd)/user/{{ func_name }}/target/{{target}}/{{profile}}/lib{{ func_name }}.so target/{{profile}}/ + wasm_func func_name: cd user/{{ func_name }} \ - && cargo build \ + && cargo build {{ release_flag }} \ --target {{target}} {{mpk_feature_flag}} \ && cc {{cc_flags_p1}} \ - target/{{target}}/debug/lib{{ func_name }}.a \ + target/{{target}}/{{profile}}/lib{{ func_name }}.a \ {{cc_flags_p2}} \ - -o target/{{target}}/debug/lib{{ func_name }}.so - -symbol_link func_name: - @ln -s $(pwd)/user/{{ func_name }}/target/{{target}}/debug/lib{{ func_name }}.so target/debug/ - + -o target/{{target}}/{{profile}}/lib{{ func_name }}.so + + @-rm target/{{profile}}/lib{{ func_name }}.so + just symbol_link {{ func_name }} -wasmtime_wordcount: +c_wordcount: just wasm_func wasmtime_mapper just wasm_func wasmtime_reducer - @-rm target/debug/libwasmtime_mapper.so - @-rm target/debug/libwasmtime_reducer.so - just symbol_link wasmtime_mapper - just symbol_link wasmtime_reducer -wasmtime_parallel_sort: +c_parallel_sort: just wasm_func wasmtime_sorter just wasm_func wasmtime_spliter just wasm_func wasmtime_merger just wasm_func wasmtime_checker - @-rm target/debug/libwasmtime_sorter.so - @-rm target/debug/libwasmtime_spliter.so - @-rm target/debug/libwasmtime_merger.so - @-rm target/debug/libwasmtime_checker.so - - just symbol_link wasmtime_sorter - just symbol_link wasmtime_spliter - just symbol_link wasmtime_merger - just symbol_link wasmtime_checker - -all_c_wasm: wasmtime_wordcount wasmtime_parallel_sort +c_long_chain: + just wasm_func wasmtime_longchain + +all_c_wasm: c_wordcount c_parallel_sort c_long_chain -cpython_wordcount: +python_wordcount: just wasm_func wasmtime_cpython_wordcount - @-rm target/debug/libwasmtime_cpython_wordcount.so - just symbol_link wasmtime_cpython_wordcount -cpython_parallel_sort: +python_parallel_sort: just wasm_func wasmtime_cpython_parallel_sort - @-rm target/debug/libwasmtime_cpython_parallel_sort.so - just symbol_link wasmtime_cpython_parallel_sort -all_py_wasm: cpython_wordcount cpython_parallel_sort +python_long_chain: + just wasm_func wasmtime_cpython_func + +all_py_wasm: python_wordcount python_parallel_sort python_long_chain all_wasm: all_c_wasm all_py_wasm @@ -142,3 +138,144 @@ measure_avg isol_file: gen_data: sudo -E ./scripts/gen_data.py + +init: + rustup override set 'nightly-2023-12-01' + rustup target add x86_64-unknown-linux-musl + [ -f fs_images/fatfs.img ] || unzip fs_images/fatfs.zip -d fs_images + +asvisor: + cargo build {{ release_flag }} + +cold_start_latency: asvisor all_libos + just rust_func hello_world + just rust_func load_all + @-./scripts/del_tap.sh 2>/dev/null + + @echo '\ncold start with on-demand loading' + target/{{profile}}/asvisor --files isol_config/base_config.json --metrics total-dur 2>&1 | grep 'ms' + @echo '\ncold start without on-demand loading' + target/{{profile}}/asvisor --files isol_config/load_all.json --metrics total-dur 2>&1 | grep 'ms' + +data_transfer_latency: asvisor all_libos + for data_size in '4*1024' '64*1024' '1024*1024' '16*1024*1024' '256*1024*1024'; do \ + echo $data_size > user/data_size.config; \ + just pass_args 1>/dev/null 2>/dev/null; \ + target/{{profile}}/asvisor --files isol_config/pass_complex_args.json 2>&1 | grep 'bytes'; \ + echo ''; \ + done + +end_to_end_latency: asvisor all_libos map_reduce parallel_sort long_chain + -sudo mount fs_images/fatfs.img image_content 2>/dev/null + sudo -E ./scripts/gen_data.py 3 '100 * 1024 * 1024' 3 '25 * 1024 * 1024' + + @echo 'word count cost: ' + target/{{profile}}/asvisor --files isol_config/map_reduce_large_c3.json --metrics total-dur 2>&1 | grep 'total_dur' + + @echo 'parallel sorting cost: ' + target/{{profile}}/asvisor --files isol_config/parallel_sort_c3.json --metrics total-dur 2>&1 | grep 'total_dur' + + @echo 'function chain cost: ' + target/{{profile}}/asvisor --files isol_config/long_chain_n15.json --metrics total-dur 2>&1 | grep 'total_dur' + + just c_end_to_end_latency + just py_end_to_end_latency + +c_end_to_end_latency: asvisor all_libos all_c_wasm + # C applications. + @echo 'C word count cost: ' + target/{{profile}}/asvisor --files isol_config/wasmtime_wordcount_c3.json --metrics total-dur 2>&1 | grep 'total_dur' + + @echo 'C parallel sorting cost: ' + target/{{profile}}/asvisor --files isol_config/wasmtime_parallel_sort_c3.json --metrics total-dur 2>&1 | grep 'total_dur' + + @echo 'C function chain cost: ' + target/{{profile}}/asvisor --files isol_config/wasmtime_longchain.json --metrics total-dur 2>&1 | grep 'total_dur' + +py_end_to_end_latency: asvisor all_libos all_py_wasm + # Python applications. + -sudo mount fs_images/fatfs.img image_content 2>/dev/null + sudo -E ./scripts/gen_data.py 1 '1 * 1024 * 1024' 1 '1 * 1024 * 1024' + + sleep 3 + @echo 'Python word count cost: ' + target/{{profile}}/asvisor --files isol_config/wasmtime_cpython_wordcount_c1.json --metrics total-dur 2>&1 | grep 'total_dur' + + @echo 'Python parallel sorting cost: ' + target/{{profile}}/asvisor --files isol_config/wasmtime_cpython_parallel_sort_c1.json --metrics total-dur 2>&1 | grep 'total_dur' + + @echo 'Python long chain cost: ' + target/{{profile}}/asvisor --files isol_config/wasmtime_cpython_functionchain_n5.json --metrics total-dur 2>&1 | grep 'total_dur' + +breakdown: asvisor all_libos + -sudo mount fs_images/fatfs.img image_content 2>/dev/null + -sudo ./scripts/del_tap.sh + sudo -E ./scripts/gen_data.py 5 '10 * 1024 * 1024' 5 '1 * 1024 * 1024' + @echo '1 * 1024 * 1024' > user/function_chain_data_size.config + + @echo 'base (-on-demand-loding, -reference-passing)' + for func_name in 'mapper' 'reducer' 'file_reader' 'sorter' 'splitter' 'merger' 'array_sum'; do \ + cargo build {{ release_flag }} {{ mpk_feature_flag }} --features file-based --manifest-path user/${func_name}/Cargo.toml; \ + done ; + + target/{{profile}}/asvisor --files isol_config/map_reduce_load_all.json --metrics total-dur 2>&1 | grep 'total_dur' + sudo rm -f ./image_content/*.imd + target/{{profile}}/asvisor --files isol_config/parallel_sort_load_all.json --metrics total-dur 2>&1 | grep 'total_dur' + sudo rm -f ./image_content/*.imd + target/{{profile}}/asvisor --files isol_config/long_chain_load_all.json --metrics total-dur 2>&1 | grep 'total_dur' + sudo rm -f ./image_content/*.imd + + @echo '\n+on-demand-loding (-reference-passing)' + target/{{profile}}/asvisor --files isol_config/map_reduce_large_c5.json --metrics total-dur 2>&1 | grep 'total_dur' + sudo rm -f ./image_content/*.imd + target/{{profile}}/asvisor --files isol_config/parallel_sort_c5.json --metrics total-dur 2>&1 | grep 'total_dur' + sudo rm -f ./image_content/*.imd + target/{{profile}}/asvisor --files isol_config/long_chain_n15.json --metrics total-dur 2>&1 | grep 'total_dur' + + @echo '\n+both' + for func_name in 'mapper' 'reducer' 'file_reader' 'sorter' 'splitter' 'merger' 'array_sum'; do \ + cargo build {{ release_flag }} {{ mpk_feature_flag }} --manifest-path user/${func_name}/Cargo.toml; \ + done ; + + target/{{profile}}/asvisor --files isol_config/map_reduce_large_c5.json --metrics total-dur 2>&1 | grep 'total_dur' + target/{{profile}}/asvisor --files isol_config/parallel_sort_c5.json --metrics total-dur 2>&1 | grep 'total_dur' + target/{{profile}}/asvisor --files isol_config/long_chain_n15.json --metrics total-dur 2>&1 | grep 'total_dur' + +p99: asvisor all_libos parallel_sort + -sudo mount fs_images/fatfs.img image_content 2>/dev/null + sudo -E ./scripts/gen_data.py 0 0 3 '25 * 1024 * 1024' + + @echo 'p99 10' + ./p99tester 10 | grep 'p99' + @echo 'p99 20' + ./p99tester 20 | grep 'p99' + @echo 'p99 40' + ./p99tester 40 | grep 'p99' + @echo 'p99 80' + ./p99tester 80 | grep 'p99' + +resource_consume: asvisor all_libos parallel_sort + -sudo mount fs_images/fatfs.img image_content 2>/dev/null + sudo -E ./scripts/gen_data.py 0 0 5 '25 * 1024 * 1024' + + @sleep 3 + @echo 'resource instances 20' + ./resourcetester 20 | grep 'total consume mem:' + mv monitor.log as_parallel_sort_resouce_c5_25_20.txt + + @sleep 3 + @echo 'resource instances 40' + ./resourcetester 40 | grep 'total consume mem:' + mv monitor.log as_parallel_sort_resouce_c5_25_40.txt + + @sleep 3 + @echo 'resource instances 60' + ./resourcetester 60 | grep 'total consume mem:' + mv monitor.log as_parallel_sort_resouce_c5_25_60.txt + + @sleep 3 + @echo 'resource instances 80' + ./resourcetester 80 | grep 'total consume mem:' + mv monitor.log as_parallel_sort_resouce_c5_25_80.txt + + ./scripts/comp_resource.py \ No newline at end of file diff --git a/p99tester b/p99tester new file mode 100755 index 00000000..55003149 Binary files /dev/null and b/p99tester differ diff --git a/resourcetester b/resourcetester new file mode 100755 index 00000000..7be9a608 Binary files /dev/null and b/resourcetester differ diff --git a/scripts/comp_resource.py b/scripts/comp_resource.py index f8f7b779..a6c8cf20 100755 --- a/scripts/comp_resource.py +++ b/scripts/comp_resource.py @@ -26,7 +26,7 @@ def comp(name): for line in lines: fields = line.strip().split(' ') timestamp = datetime.strptime( - fields[0] + ' ' + fields[1].replace(',', ''), "%Y-%m-%d %H:%M:%S") + fields[0] + ' ' + fields[1].replace(',', ''), "%Y-%m-%d %H:%M:%S.%f") ts = timestamp.timestamp() tss.append(ts) @@ -51,38 +51,37 @@ def comp(name): cpu_min, cpu_q1, cpu_median, cpu_q3, cpu_max = five_number_summary( cpus) - mem_min, mem_q1, mem_median, mem_q3, mem_max = five_number_summary( - mems) + # mem_min, mem_q1, mem_median, mem_q3, mem_max = five_number_summary( + # mems) - print(f"执行耗时: {tss[-1]-tss[0]}ms") - print("cpu累积量", sum(cpus) - cpu_min * len(cpus)) - print("user cpu累积量", sum(user_cpus) - min(user_cpus) * len(user_cpus)) - print("system cpu累积量", sum(sys_cpus) - min(sys_cpus) * len(sys_cpus)) - print("cpu五数概括:", cpu_min, cpu_q1, cpu_median, cpu_q3, cpu_max) + # print(f"执行耗时: {tss[-1]-tss[0]}ms") + print("cpu consume:", sum(cpus) - cpu_min * len(cpus)) + print("user cpu consume", sum(user_cpus) - min(user_cpus) * len(user_cpus)) + print("system cpu consume", sum(sys_cpus) - min(sys_cpus) * len(sys_cpus)) + # print("cpu五数概括:", cpu_min, cpu_q1, cpu_median, cpu_q3, cpu_max) - print("mem均值:", sum(mems)/len(mems)) - print("mem五数概括:", mem_min, mem_q1, mem_median, mem_q3, mem_max) + # print("mem均值:", sum(mems)/len(mems) - min(mems)) + # print("mem五数概括:", mem_min, mem_q1, mem_median, mem_q3, mem_max) print() -comp("as_map_reduce_resouce_c5_10_20.txt") -comp("as_map_reduce_resouce_c5_10_40.txt") -comp("as_map_reduce_resouce_c5_10_60.txt") -comp("as_map_reduce_resouce_c5_10_80.txt") +# comp("as_map_reduce_resouce_c5_10_20.txt") +# comp("as_map_reduce_resouce_c5_10_40.txt") +# comp("as_map_reduce_resouce_c5_10_60.txt") +# comp("as_map_reduce_resouce_c5_10_80.txt") -comp("faastlane_map_reduce_resouce_c5_10_20.txt") -comp("faastlane_map_reduce_resouce_c5_10_40.txt") -comp("faastlane_map_reduce_resouce_c5_10_60.txt") -comp("faastlane_map_reduce_resouce_c5_10_80.txt") +# comp("faastlane_map_reduce_resouce_c5_10_20.txt") +# comp("faastlane_map_reduce_resouce_c5_10_40.txt") +# comp("faastlane_map_reduce_resouce_c5_10_60.txt") +# comp("faastlane_map_reduce_resouce_c5_10_80.txt") comp("as_parallel_sort_resouce_c5_25_20.txt") comp("as_parallel_sort_resouce_c5_25_40.txt") comp("as_parallel_sort_resouce_c5_25_60.txt") comp("as_parallel_sort_resouce_c5_25_80.txt") -comp("as_parallel_sort_resouce_c5_25_100.txt") -comp("faastlane_parallel_sort_resouce_c5_25_20.txt") -comp("faastlane_parallel_sort_resouce_c5_25_40.txt") -comp("faastlane_parallel_sort_resouce_c5_25_60.txt") -comp("faastlane_parallel_sort_resouce_c5_25_80.txt") +# comp("faastlane_parallel_sort_resouce_c5_25_20.txt") +# comp("faastlane_parallel_sort_resouce_c5_25_40.txt") +# comp("faastlane_parallel_sort_resouce_c5_25_60.txt") +# comp("faastlane_parallel_sort_resouce_c5_25_80.txt") diff --git a/scripts/gen_data.py b/scripts/gen_data.py index fe30e85b..d33743c4 100755 --- a/scripts/gen_data.py +++ b/scripts/gen_data.py @@ -41,5 +41,13 @@ def gen_parallel_sort(file_num: int, total_size: int): if __name__ == "__main__": - gen_parallel_sort(3, 25 * 1024 * 1024) - # gen_word_count(3, 100 * 1024 * 1024) + import sys + wc_args = 3, 100 * 1024 * 1024 + if len(sys.argv) == 5 and eval(sys.argv[1]) and eval(sys.argv[2]): + wc_args = [eval(s) for s in sys.argv[1:3]] + gen_word_count(*wc_args) + + ps_args = 3, 25 * 1024 * 1024 + if len(sys.argv) == 5 and eval(sys.argv[3]) and eval(sys.argv[4]): + ps_args = [eval(s) for s in sys.argv[3:5]] + gen_parallel_sort(*ps_args) diff --git a/scripts/make_fs_img.sh b/scripts/make_fs_img.sh index 2b3a3342..5037b993 100755 --- a/scripts/make_fs_img.sh +++ b/scripts/make_fs_img.sh @@ -11,5 +11,5 @@ if [ -f "$image" ]; then rm "$image" fi -dd if=/dev/zero of="$image" bs=1M seek=400 count=0 && \ +dd if=/dev/zero of="$image" bs=1M seek=512 count=0 && \ mkfs.fat "$image" diff --git a/user/array_sum/src/lib.rs b/user/array_sum/src/lib.rs index c4225b0f..74ed5278 100644 --- a/user/array_sum/src/lib.rs +++ b/user/array_sum/src/lib.rs @@ -23,7 +23,7 @@ struct Arraysum { } #[allow(clippy::identity_op)] -const DATA_SIZE: usize = 1024 * 1024 * 1; +const DATA_SIZE: usize = include!("../../function_chain_data_size.config"); #[allow(clippy::result_unit_err)] #[no_mangle] diff --git a/user/data_size.config b/user/data_size.config new file mode 100644 index 00000000..7de89759 --- /dev/null +++ b/user/data_size.config @@ -0,0 +1 @@ +256*1024*1024 diff --git a/user/func_a/src/lib.rs b/user/func_a/src/lib.rs index 4a2990f9..b404382b 100644 --- a/user/func_a/src/lib.rs +++ b/user/func_a/src/lib.rs @@ -13,7 +13,7 @@ use as_std::{ use as_std_proc_macro::FaasData; // const DATA_SIZE: usize = 1024 * 1024 * 256 / 8; -const DATA_SIZE: usize = 1024 * 1024 * 16 / 8; +const DATA_SIZE: usize = include!("../../data_size.config") / 8; #[derive(FaasData, serde::Serialize, serde::Deserialize)] struct VecArg { @@ -22,9 +22,8 @@ struct VecArg { impl Default for VecArg { fn default() -> Self { - Self { - data: Vec::with_capacity(DATA_SIZE), - } + let data = Vec::with_capacity(DATA_SIZE); + Self { data } } } @@ -32,11 +31,13 @@ impl Default for VecArg { #[no_mangle] pub fn main() -> Result<()> { let mut d = DataBuffer::::with_slot("Conference".to_owned()); + d.data.resize(DATA_SIZE, 0); for (idx, val) in &mut d.data.iter_mut().enumerate() { *val = (idx % (u64::MAX - 1) as usize) as u64 } + println!("write {} bytes", d.data.len() * 8); // let register_start = SystemTime::now().duration_since(UNIX_EPOCH).as_nanos(); // let result = DataBuffer::::from_buffer_slot("Conference".to_owned()); diff --git a/user/func_b/src/lib.rs b/user/func_b/src/lib.rs index 16873510..9496843b 100644 --- a/user/func_b/src/lib.rs +++ b/user/func_b/src/lib.rs @@ -10,7 +10,7 @@ use as_std::{ }; use as_std_proc_macro::FaasData; -const DATA_SIZE: usize = 1024 * 1024 * 16 / 8; +const DATA_SIZE: usize = include!("../../data_size.config") / 8; #[derive(FaasData, serde::Serialize, serde::Deserialize)] struct MyComplexData { @@ -28,16 +28,18 @@ impl Default for MyComplexData { #[no_mangle] #[allow(clippy::result_unit_err)] pub fn main() -> Result<()> { - println!("func b"); + // println!("func b"); let func_b_start = SystemTime::now(); let data = DataBuffer::::from_buffer_slot("Conference".to_owned()); if let Some(buffer) = data { + let data_size = buffer.data.len(); for i in 0..buffer.data.len() { let _ = unsafe { core::ptr::read_volatile((&buffer.data[i]) as *const u64) }; } core::mem::forget(buffer); println!( - "phase34_dur={}", + "data size: {} bytes, cost {} ns", + data_size * 8, SystemTime::now().duration_since(func_b_start).as_nanos() ); Ok(().into()) diff --git a/user/function_chain_data_size.config b/user/function_chain_data_size.config new file mode 100644 index 00000000..f8a7d6ec --- /dev/null +++ b/user/function_chain_data_size.config @@ -0,0 +1 @@ +1 * 1024 * 1024 diff --git a/user/load_all/Cargo.toml b/user/load_all/Cargo.toml index 75f7a227..dc23fc84 100644 --- a/user/load_all/Cargo.toml +++ b/user/load_all/Cargo.toml @@ -20,4 +20,4 @@ cfg-if = "1.0.0" with_libos = ["as_std", "as_hostcall"] measure_mem = ["with_libos"] mpk = ["as_std/mpk"] -default = ["measure_mem"] +default = ["with_libos"] diff --git a/user/load_all/src/lib.rs b/user/load_all/src/lib.rs index 2f3b60a9..8ba41a3f 100644 --- a/user/load_all/src/lib.rs +++ b/user/load_all/src/lib.rs @@ -16,7 +16,7 @@ cfg_if::cfg_if! { pub fn main() -> Result<()> { println!("Hello, world! id: {}", args::get("id").unwrap()); - libos!(addrinfo("localhost")).unwrap(); + let ret = libos!(addrinfo("localhost")); Ok(().into()) } diff --git a/user/mapper/src/lib.rs b/user/mapper/src/lib.rs index 27b31b76..9175c05e 100644 --- a/user/mapper/src/lib.rs +++ b/user/mapper/src/lib.rs @@ -21,7 +21,7 @@ use as_std::{ fs::File, io::Read, println, - time::{SystemTime}, + time::SystemTime, }; use as_std_proc_macro::FaasData; @@ -30,10 +30,12 @@ use serde::{Deserialize, Serialize}; extern crate alloc; -// #[derive(Default, FaasData)] -// struct Reader2Mapper { -// content: String, -// } + +#[derive(Default, FaasData)] +#[cfg_attr(feature = "file-based", derive(Serialize, Deserialize))] +struct Reader2Mapper { + content: String, +} #[cfg_attr(feature = "file-based", derive(Serialize, Deserialize))] #[derive(FaasData)] @@ -65,16 +67,20 @@ pub fn getidx(word: &str, reducer_num: u64) -> u64 { } fn mapper_func(my_id: &str, reducer_num: u64) -> Result<()> { + let start = SystemTime::now(); + // let reader: DataBuffer = // DataBuffer::from_buffer_slot(format!("part-{}", my_id)).expect("missing input data."); // println!("access_buffer_long={}", reader.content.len()); + // let content = &reader.content; - let start = SystemTime::now(); + /////// file reader ////// let file_name = format!("fake_data_{}.txt", my_id); let mut f = File::open(&file_name)?; let mut content = String::new(); // let content = get_input_from_mem(&file_name); f.read_to_string(&mut content).expect("read file failed."); + ////////////////////////// println!( "read_end, cost: {}ms", diff --git a/user/sorter/src/lib.rs b/user/sorter/src/lib.rs index bd9dd223..1cddc6cf 100644 --- a/user/sorter/src/lib.rs +++ b/user/sorter/src/lib.rs @@ -25,7 +25,7 @@ struct Reader2Sorter { content: String, } -#[cfg_attr(feature = "file-based", derive(Serialize, , Deserialize))] +#[cfg_attr(feature = "file-based", derive(Serialize, Deserialize))] #[derive(Default, FaasData)] struct VecArg { #[cfg(feature = "pkey_per_func")] diff --git a/user/wasmtime_cpython_func/Cargo.lock b/user/wasmtime_cpython_func/Cargo.lock index 26c0f7c0..2d6b3970 100644 --- a/user/wasmtime_cpython_func/Cargo.lock +++ b/user/wasmtime_cpython_func/Cargo.lock @@ -26,6 +26,39 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.4.0" @@ -206,7 +239,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -457,37 +490,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", -] - [[package]] name = "naked-function" version = "0.1.5" @@ -506,7 +508,7 @@ checksum = "5b4123e70df5fe0bb370cff166ae453b9c5324a2cfc932c0f7e55498147a0475" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -639,29 +641,29 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr", @@ -744,9 +746,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -776,7 +778,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -911,7 +913,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -1009,7 +1011,7 @@ checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1045,9 +1047,9 @@ dependencies = [ name = "wasmtime_cpython_func" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", "lazy_static", - "ms_hostcall", - "ms_std", "sjlj", "spin", "wasmtime_wasi_api", @@ -1057,11 +1059,11 @@ dependencies = [ name = "wasmtime_wasi_api" version = "0.1.0" dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", "hashbrown 0.14.5", "lazy_static", - "ms_hostcall", - "ms_std", - "ms_std_proc_macro", "sjlj", "spin", "wasmtime", @@ -1192,5 +1194,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] diff --git a/user/wasmtime_hello/Cargo.lock b/user/wasmtime_hello/Cargo.lock index 96f71e97..68069899 100644 --- a/user/wasmtime_hello/Cargo.lock +++ b/user/wasmtime_hello/Cargo.lock @@ -26,6 +26,39 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -438,37 +471,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "ms_hostcall" -version = "0.1.0" -dependencies = [ - "bitflags", - "derive_more", - "thiserror-no-std", -] - -[[package]] -name = "ms_std" -version = "0.1.0" -dependencies = [ - "cfg-if", - "heapless", - "linked_list_allocator", - "ms_hostcall", - "ms_std_proc_macro", - "spin", - "thiserror-no-std", -] - -[[package]] -name = "ms_std_proc_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - [[package]] name = "naked-function" version = "0.1.5" @@ -487,7 +489,7 @@ checksum = "5b4123e70df5fe0bb370cff166ae453b9c5324a2cfc932c0f7e55498147a0475" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -537,9 +539,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -555,9 +557,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -629,31 +631,32 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] name = "serde_json" -version = "1.0.109" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0652c533506ad7a2e353cce269330d6afd8bdfb6d75e0ace5b35aacbd7b9e9" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -733,9 +736,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -765,7 +768,7 @@ checksum = "268026685b2be38d7103e9e507c938a1fcb3d7e6eb15e87870b617bf37b6d581" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -900,7 +903,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -998,7 +1001,7 @@ checksum = "89b3438cb56868e235825c7026e85fe8a6c4b5437b5786ad010948e5c6eff0d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] [[package]] @@ -1034,8 +1037,8 @@ dependencies = [ name = "wasmtime_hello" version = "0.1.0" dependencies = [ - "ms_hostcall", - "ms_std", + "as_hostcall", + "as_std", "sjlj", "wasmtime", ] @@ -1165,5 +1168,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.98", ] diff --git a/user/wasmtime_longchain/Cargo.lock b/user/wasmtime_longchain/Cargo.lock new file mode 100644 index 00000000..adbeb799 --- /dev/null +++ b/user/wasmtime_longchain/Cargo.lock @@ -0,0 +1,1207 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "anyhow" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" + +[[package]] +name = "arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" + +[[package]] +name = "as_hostcall" +version = "0.1.0" +dependencies = [ + "bitflags", + "derive_more", + "thiserror-no-std", +] + +[[package]] +name = "as_std" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std_proc_macro", + "cfg-if", + "heapless", + "linked_list_allocator", + "serde", + "serde_json", + "spin", + "thiserror-no-std", +] + +[[package]] +name = "as_std_proc_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cc" +version = "1.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cranelift-bforest" +version = "0.109.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fad7096c10a285583f2ed620c0c85d7baf745922e33415290f2900b73319f1e0" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.109.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0d5b0dcd4a4e18c6352304d76f1c63258b5b2c248fc261b89c3a02952d51ff" +dependencies = [ + "bumpalo", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-control", + "cranelift-entity", + "cranelift-isle", + "gimli", + "hashbrown 0.14.5", + "log", + "regalloc2", + "rustc-hash", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.109.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d14aa8551924931235a4eec42d561a8415d5a758267a549575a3fe0e13ba84f" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.109.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "315a326e9f63b996f55e93b73a9a239b55f2de1211fcfbcc99d9423f44dc6ded" + +[[package]] +name = "cranelift-control" +version = "0.109.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806ca69ca5aa8422035543444e1dc936f8f3e7f6854d562ef31db9fe30355c5c" +dependencies = [ + "arbitrary", +] + +[[package]] +name = "cranelift-entity" +version = "0.109.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9778487136bf37f9007920d9cb332a020e5d7259c1fbf35e625368eb88c7bfe" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "cranelift-frontend" +version = "0.109.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55326cb3b61ca368210899a35892bca66aea4d75e8ceb5464e0539906c2ffb61" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.109.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4807df8ebad0106f207bcdc1f38199200ed175066b4122689e7f18e33ec8548c" + +[[package]] +name = "cranelift-native" +version = "0.109.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c24c076002cb6a926a3f7220040278c7178878cd9142a418ddef9ee5b84963" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.109.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66ba3e8a666222d2df5a79a1279282c04545c4ca9712b7d85f4f54937617a533" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools", + "log", + "smallvec", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.98", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "foldhash" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator", + "indexmap", + "stable_deref_trait", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "serde", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "foldhash", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + +[[package]] +name = "indexmap" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", + "serde", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "linked_list_allocator" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" +dependencies = [ + "spinning_top", +] + +[[package]] +name = "linux-raw-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1ad52afd8f9448cbbe722ae722849cc41f1d365e285cca386896352bc08e1a9" + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "naked-function" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b8d5fca6ab1e6215b010aefd3b9ac5aae369dae0faea3a7f34f296cc9f719ac" +dependencies = [ + "cfg-if", + "naked-function-macro", +] + +[[package]] +name = "naked-function-macro" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b4123e70df5fe0bb370cff166ae453b9c5324a2cfc932c0f7e55498147a0475" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "crc32fast", + "hashbrown 0.15.2", + "indexmap", + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "serde", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psm" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" +dependencies = [ + "cc", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "ryu" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" + +[[package]] +name = "sc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "010e18bd3bfd1d45a7e666b236c78720df0d9a7698ebaa9c1c559961eb60a38b" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" + +[[package]] +name = "serde" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "serde_json" +version = "1.0.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "sjlj" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9b43efc387069aabdc27124a294337c7032a3cb62df0108d2578eff7f08e39" +dependencies = [ + "linux-raw-sys 0.2.2", + "naked-function", + "sc", +] + +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spinning_top" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9eb1a2f4c41445a3a0ff9abc5221c5fcd28e1f13cd7c0397706f9ac938ddb0" +dependencies = [ + "lock_api", +] + +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "thiserror-impl-no-std" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58e6318948b519ba6dc2b442a6d0b904ebfb8d411a3ad3e07843615a72249758" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "thiserror-no-std" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ad459d94dd517257cc96add8a43190ee620011bb6e6cdc82dafd97dfafafea" +dependencies = [ + "thiserror-impl-no-std", +] + +[[package]] +name = "unicode-ident" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasm-encoder" +version = "0.209.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4a05336882dae732ce6bd48b7e11fe597293cb72c13da4f35d7d5f8d53b2a7" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasmparser" +version = "0.209.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07035cc9a9b41e62d3bb3a3815a66ab87c993c06fe1cf6b2a3f2a18499d937db" +dependencies = [ + "ahash", + "bitflags", + "hashbrown 0.14.5", + "indexmap", + "semver", + "serde", +] + +[[package]] +name = "wasmprinter" +version = "0.209.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceca8ae6eaa8c7c87b33c25c53bdf299f8c2a764aee1179402ff7652ef3a6859" +dependencies = [ + "anyhow", + "wasmparser", +] + +[[package]] +name = "wasmtime" +version = "22.0.0" +source = "git+https://gitee.com/tju-cloud-computing/wasmtime-as-lib?branch=master#fb45fb8dde6d068abb3ae78bfab78253c9654af5" +dependencies = [ + "anyhow", + "bumpalo", + "cc", + "cfg-if", + "encoding_rs", + "hashbrown 0.14.5", + "indexmap", + "libc", + "libm", + "log", + "mach2", + "memfd", + "memoffset", + "object", + "once_cell", + "paste", + "postcard", + "psm", + "rustix", + "semver", + "serde", + "serde_derive", + "smallvec", + "sptr", + "target-lexicon", + "wasmparser", + "wasmtime-asm-macros", + "wasmtime-component-macro", + "wasmtime-component-util", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-jit-icache-coherence", + "wasmtime-slab", + "wasmtime-versioned-export-macros", + "wasmtime-winch", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d697d99c341d4a9ffb72f3af7a02124d233eeb59aee010f36d88e97cca553d5e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-component-macro" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b29b462b068e73b5b27fae092a27f47e5937cabf6b26be2779c978698a52feca" +dependencies = [ + "anyhow", + "proc-macro2", + "quote", + "syn 2.0.98", + "wasmtime-component-util", + "wasmtime-wit-bindgen", + "wit-parser", +] + +[[package]] +name = "wasmtime-component-util" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d2912c53d9054984b380dfbd7579f9c3681b2a73b903a56bd71a1c4f175f1e" + +[[package]] +name = "wasmtime-cranelift" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3975deafea000457ba84355c7c0fce0372937204f77026510b7b454f28a3a65" +dependencies = [ + "anyhow", + "cfg-if", + "cranelift-codegen", + "cranelift-control", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli", + "log", + "object", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-environ", + "wasmtime-versioned-export-macros", +] + +[[package]] +name = "wasmtime-environ" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f444e900e848b884d8a8a2949b6f5b92af642a3e663ff8fbe78731143a55be61" +dependencies = [ + "anyhow", + "cranelift-entity", + "gimli", + "indexmap", + "log", + "object", + "postcard", + "serde", + "serde_derive", + "target-lexicon", + "wasm-encoder", + "wasmparser", + "wasmprinter", + "wasmtime-component-util", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5afe2f0499542f9a4bcfa1b55bfdda803b6ade4e7c93c6b99e0f39dba44b0a91" +dependencies = [ + "anyhow", + "cfg-if", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-slab" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a7de1f2bec5bbb35d532e61c85c049dc84ae671df60492f90b954ecf21169e7" + +[[package]] +name = "wasmtime-types" +version = "22.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2017ea47e7a91440f94cc29f5f41d303e80f979a5384bf560d4b0afdabe32d0" +dependencies = [ + "cranelift-entity", + "serde", + "serde_derive", + "smallvec", + "wasmparser", +] + +[[package]] +name = "wasmtime-versioned-export-macros" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "wasmtime-winch" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed4db238a0241df2d15f79ad17b3a37a27f2ea6cb885894d81b42ae107544466" +dependencies = [ + "anyhow", + "cranelift-codegen", + "gimli", + "object", + "target-lexicon", + "wasmparser", + "wasmtime-cranelift", + "wasmtime-environ", + "winch-codegen", +] + +[[package]] +name = "wasmtime-wit-bindgen" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc077306b38288262e5ba01d4b21532a6987416cdc0aedf04bb06c22a68fdc" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "wit-parser", +] + +[[package]] +name = "wasmtime_longchain" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", + "lazy_static", + "spin", + "wasmtime_wasi_api", +] + +[[package]] +name = "wasmtime_wasi_api" +version = "0.1.0" +dependencies = [ + "as_hostcall", + "as_std", + "as_std_proc_macro", + "hashbrown 0.14.5", + "lazy_static", + "sjlj", + "spin", + "wasmtime", +] + +[[package]] +name = "winch-codegen" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c6915884e731b2db0d8cf08cb64474cb69221a161675fd3c135f91febc3daa" +dependencies = [ + "anyhow", + "cranelift-codegen", + "gimli", + "regalloc2", + "smallvec", + "target-lexicon", + "wasmparser", + "wasmtime-cranelift", + "wasmtime-environ", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-parser" +version = "0.209.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e79b9e3c0b6bb589dec46317e645851e0db2734c44e2be5e251b03ff4a51269" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] diff --git a/user/wasmtime_longchain/Cargo.toml b/user/wasmtime_longchain/Cargo.toml index 336dcfbf..a03775ae 100644 --- a/user/wasmtime_longchain/Cargo.toml +++ b/user/wasmtime_longchain/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wasmtime_func" +name = "wasmtime_longchain" version = "0.1.0" edition = "2021" build = "build.rs" diff --git a/user/wasmtime_longchain/func.cwasm b/user/wasmtime_longchain/func.cwasm new file mode 100644 index 00000000..a53d7c9c Binary files /dev/null and b/user/wasmtime_longchain/func.cwasm differ diff --git a/user/wasmtime_longchain/func.wasm b/user/wasmtime_longchain/func.wasm new file mode 100755 index 00000000..5dde85eb Binary files /dev/null and b/user/wasmtime_longchain/func.wasm differ