From cb789c3ef1245aa985266f00f5172256727b6fbe Mon Sep 17 00:00:00 2001 From: Zachery Aaron Shores-Chmielewski Date: Thu, 14 May 2026 11:19:28 +0400 Subject: [PATCH] feat: Working vastai single-node deployment for LLM inference --- .dockerignore | 2 + Cargo.toml | 2 +- examples/single-gpu-inference/Cargo.lock | 4949 +++++++++++++++++ examples/single-gpu-inference/Cargo.toml | 29 + examples/single-gpu-inference/Dockerfile | 27 + .../INTEGRATION_TEST_PLAN.md | 78 + examples/single-gpu-inference/Makefile | 13 + examples/single-gpu-inference/SPEC.md | 243 + examples/single-gpu-inference/echo_worker.py | 16 + .../single-gpu-inference/src/bin/gpu_node.rs | 310 ++ .../src/bin/single_gpu_inference.rs | 573 ++ .../src/inference_actor.rs | 220 + .../src/iroh_transport.rs | 161 + examples/single-gpu-inference/src/lib.rs | 4 + examples/single-gpu-inference/src/messages.rs | 67 + examples/single-gpu-inference/src/vastai.rs | 292 + .../single-gpu-inference/tests/t_actor.rs | 215 + .../single-gpu-inference/tests/t_binary.rs | 164 + .../single-gpu-inference/tests/t_cluster.rs | 270 + .../single-gpu-inference/tests/t_codec.rs | 153 + .../tests/t_integration.rs | 415 ++ .../single-gpu-inference/tests/t_vastai.rs | 235 + .../single-gpu-inference/tests/test_worker.py | 154 + .../single-gpu-inference/tinygrad_worker.py | 159 + 24 files changed, 8750 insertions(+), 1 deletion(-) create mode 100644 examples/single-gpu-inference/Cargo.lock create mode 100644 examples/single-gpu-inference/Cargo.toml create mode 100644 examples/single-gpu-inference/Dockerfile create mode 100644 examples/single-gpu-inference/INTEGRATION_TEST_PLAN.md create mode 100644 examples/single-gpu-inference/Makefile create mode 100644 examples/single-gpu-inference/SPEC.md create mode 100644 examples/single-gpu-inference/echo_worker.py create mode 100644 examples/single-gpu-inference/src/bin/gpu_node.rs create mode 100644 examples/single-gpu-inference/src/bin/single_gpu_inference.rs create mode 100644 examples/single-gpu-inference/src/inference_actor.rs create mode 100644 examples/single-gpu-inference/src/iroh_transport.rs create mode 100644 examples/single-gpu-inference/src/lib.rs create mode 100644 examples/single-gpu-inference/src/messages.rs create mode 100644 examples/single-gpu-inference/src/vastai.rs create mode 100644 examples/single-gpu-inference/tests/t_actor.rs create mode 100644 examples/single-gpu-inference/tests/t_binary.rs create mode 100644 examples/single-gpu-inference/tests/t_cluster.rs create mode 100644 examples/single-gpu-inference/tests/t_codec.rs create mode 100644 examples/single-gpu-inference/tests/t_integration.rs create mode 100644 examples/single-gpu-inference/tests/t_vastai.rs create mode 100644 examples/single-gpu-inference/tests/test_worker.py create mode 100644 examples/single-gpu-inference/tinygrad_worker.py diff --git a/.dockerignore b/.dockerignore index 17eb168..311f784 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,4 @@ * !target/x86_64-unknown-linux-musl/release/swactor +!examples/single-gpu-inference/target/release/gpu-node +!examples/single-gpu-inference/tinygrad_worker.py diff --git a/Cargo.toml b/Cargo.toml index 0fc2ee4..b3ba13a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ members = [ "tests/integration", "xtask", ] -exclude = ["crates/bindings/wasm-crypto"] +exclude = ["crates/bindings/wasm-crypto", "examples"] [package] name = "swactor" diff --git a/examples/single-gpu-inference/Cargo.lock b/examples/single-gpu-inference/Cargo.lock new file mode 100644 index 0000000..a082424 --- /dev/null +++ b/examples/single-gpu-inference/Cargo.lock @@ -0,0 +1,4949 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "assert-json-diff" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "async-compat" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ba85bc55464dcbf728b56d97e119d673f4cf9062be330a9a26f3acf504a590" +dependencies = [ + "futures-core", + "futures-io", + "once_cell", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async_io_stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" +dependencies = [ + "futures", + "pharos", + "rustc_version", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "attohttpc" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e2cdb6d5ed835199484bb92bb8b3edd526effe995c61732580439c1a67e2e9" +dependencies = [ + "base64", + "http", + "log", + "url", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "aws-lc-rs" +version = "1.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7b6141e96a8c160799cc2d5adecd5cbbe5054cb8c7c4af53da0f83bb7ad256" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.37.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b092fe214090261288111db7a2b2c2118e5a7f30dc2569f1732c4069a6840549" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + +[[package]] +name = "backon" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cffb0e931875b666fc4fcb20fee52e9bbd1ef836fd9e9e04ec21555f9f85f7ef" +dependencies = [ + "fastrand", + "gloo-timers", + "tokio", +] + +[[package]] +name = "base32" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "022dfe9eb35f19ebbcb51e0b40a5ab759f46ad60cadf7297e0bd085afb50e076" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" + +[[package]] +name = "blake3" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "cpufeatures", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96eb4cdd6cf1b31d671e9efe75c5d1ec614776856cefbe109ca373554a6d514f" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cc" +version = "1.2.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" +dependencies = [ + "iana-time-zone", + "num-traits", + "serde", + "windows-link", +] + +[[package]] +name = "cmake" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" +dependencies = [ + "cc", +] + +[[package]] +name = "cobs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" +dependencies = [ + "thiserror 2.0.18", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + +[[package]] +name = "constant_time_eq" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" + +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "cordyceps" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688d7fbb8092b8de775ef2536f36c8c31f2bc4006ece2e8d8ad2d17d00ce0a2a" +dependencies = [ + "loom", + "tracing", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-common" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211f05e03c7d03754740fd9e585de910a095d6b99f8bcfffdef8319fa02a8331" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto 0.2.9", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "5.0.0-pre.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f9200d1d13637f15a6acb71e758f64624048d85b31a5fdbfd8eca1e2687d0b7" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.11.0-rc.10", + "fiat-crypto 0.3.0", + "rand_core 0.9.5", + "rustc_version", + "serde", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "data-encoding" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" + +[[package]] +name = "deadpool" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0be2b1d1d6ec8d846f05e137292d0b89133caf95ef33695424c09568bdd39b1b" +dependencies = [ + "deadpool-runtime", + "lazy_static", + "num_cpus", + "tokio", +] + +[[package]] +name = "deadpool-runtime" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid 0.9.6", + "zeroize", +] + +[[package]] +name = "der" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71fd89660b2dc699704064e59e9dba0147b903e85319429e131620d022be411b" +dependencies = [ + "const-oid 0.10.2", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc3dc5ad92c2e2d1c193bbbbdf2ea477cb81331de4f3103f267ca18368b988c4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn", + "unicode-xid", +] + +[[package]] +name = "diatomic-waker" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab03c107fafeb3ee9f5925686dbb7a73bc76e3932abb0d2b365cb64b169cf04c" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common 0.1.7", +] + +[[package]] +name = "digest" +version = "0.11.0-rc.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afa94b64bfc6549e6e4b5a3216f22593224174083da7a90db47e951c4fb31725" +dependencies = [ + "block-buffer 0.11.0", + "const-oid 0.10.2", + "crypto-common 0.2.0", +] + +[[package]] +name = "dispatch2" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" +dependencies = [ + "bitflags", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "distribution" +version = "0.1.0" +dependencies = [ + "iroh", + "serde", + "serde_json", + "swactor", + "swactor-transport", + "tokio", +] + +[[package]] +name = "dlopen2" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b4f5f101177ff01b8ec4ecc81eead416a8aa42819a2869311b3420fa114ffa" +dependencies = [ + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "document-features" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" +dependencies = [ + "litrs", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8 0.10.2", + "signature 2.2.0", +] + +[[package]] +name = "ed25519" +version = "3.0.0-rc.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6e914c7c52decb085cea910552e24c63ac019e3ab8bf001ff736da9a9d9d890" +dependencies = [ + "pkcs8 0.11.0-rc.11", + "serde", + "signature 3.0.0-rc.10", +] + +[[package]] +name = "ed25519-dalek" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" +dependencies = [ + "curve25519-dalek 4.1.3", + "ed25519 2.2.3", + "rand_core 0.6.4", + "serde", + "sha2 0.10.9", + "subtle", + "zeroize", +] + +[[package]] +name = "ed25519-dalek" +version = "3.0.0-pre.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad207ed88a133091f83224265eac21109930db09bedcad05d5252f2af2de20a1" +dependencies = [ + "curve25519-dalek 5.0.0-pre.1", + "ed25519 3.0.0-rc.4", + "rand_core 0.9.5", + "serde", + "sha2 0.11.0-rc.2", + "signature 3.0.0-rc.10", + "subtle", + "zeroize", +] + +[[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 = "enum-as-inner" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "enum-assoc" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed8956bd5c1f0415200516e78ff07ec9e16415ade83c056c230d7b7ea0d55b7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fastbloom" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7f34442dbe69c60fe8eaf58a8cafff81a1f278816d8ab4db255b3bef4ac3c4" +dependencies = [ + "getrandom 0.3.4", + "libm", + "rand", + "siphasher", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "fiat-crypto" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64cd1e32ddd350061ae6edb1b082d7c54915b5c672c389143b9a63403a109f24" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-buffered" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8e0e1f38ec07ba4abbde21eed377082f17ccb988be9d988a5adbf4bafc118fd" +dependencies = [ + "cordyceps", + "diatomic-waker", + "futures-core", + "pin-project-lite", + "spin 0.10.0", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-lite" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generator" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f04ae4152da20c76fe800fa48659201d5cf627c5149ca0b707b69d7eef6cf9" +dependencies = [ + "cc", + "cfg-if", + "libc", + "log", + "rustversion", + "windows-link", + "windows-result", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi", + "wasip2", + "wasip3", + "wasm-bindgen", +] + +[[package]] +name = "gloo-timers" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "h2" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", +] + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version", + "serde", + "spin 0.9.8", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hickory-proto" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a6fe56c0038198998a6f217ca4e7ef3a5e51f46163bd6dd60b5c71ca6c6502" +dependencies = [ + "async-trait", + "bytes", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "h2", + "http", + "idna", + "ipnet", + "once_cell", + "rand", + "ring", + "rustls", + "thiserror 2.0.18", + "tinyvec", + "tokio", + "tokio-rustls", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto", + "ipconfig", + "moka", + "once_cell", + "parking_lot", + "rand", + "resolv-conf", + "rustls", + "smallvec", + "thiserror 2.0.18", + "tokio", + "tokio-rustls", + "tracing", +] + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hybrid-array" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b229d73f5803b562cc26e4da0396c8610a4ee209f4fac8fa4f8d709166dc45" +dependencies = [ + "typenum", +] + +[[package]] +name = "hyper" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2 0.6.2", + "system-configuration", + "tokio", + "tower-service", + "tracing", + "windows-registry", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "identity-hash" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfdd7caa900436d8f13b2346fe10257e0c05c1f1f9e351f4f5d57c03bd5f45da" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "igd-next" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516893339c97f6011282d5825ac94fc1c7aad5cad26bdc2d0cee068c0bf97f97" +dependencies = [ + "async-trait", + "attohttpc", + "bytes", + "futures", + "http", + "http-body-util", + "hyper", + "hyper-util", + "log", + "rand", + "tokio", + "url", + "xmltree", +] + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "ipconfig" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" +dependencies = [ + "socket2 0.5.10", + "widestring", + "windows-sys 0.48.0", + "winreg", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "iri-string" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "iroh" +version = "0.96.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5236da4d5681f317ec393c8fe2b7e3d360d31c6bb40383991d0b7429ca5ad117" +dependencies = [ + "backon", + "bytes", + "cfg_aliases", + "data-encoding", + "derive_more", + "ed25519-dalek 3.0.0-pre.1", + "futures-util", + "getrandom 0.3.4", + "hickory-resolver", + "http", + "igd-next", + "iroh-base", + "iroh-metrics", + "iroh-quinn", + "iroh-quinn-proto", + "iroh-quinn-udp", + "iroh-relay", + "n0-error", + "n0-future", + "n0-watcher", + "netdev", + "netwatch", + "papaya", + "pin-project", + "pkarr", + "pkcs8 0.11.0-rc.11", + "portmapper", + "rand", + "reqwest 0.12.28", + "rustc-hash", + "rustls", + "rustls-pki-types", + "rustls-webpki", + "serde", + "smallvec", + "strum", + "sync_wrapper", + "time", + "tokio", + "tokio-stream", + "tokio-util", + "tracing", + "url", + "wasm-bindgen-futures", + "webpki-roots", +] + +[[package]] +name = "iroh-base" +version = "0.96.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20c99d836a1c99e037e98d1bf3ef209c3a4df97555a00ce9510eb78eccdf5567" +dependencies = [ + "curve25519-dalek 5.0.0-pre.1", + "data-encoding", + "derive_more", + "digest 0.11.0-rc.10", + "ed25519-dalek 3.0.0-pre.1", + "n0-error", + "rand_core 0.9.5", + "serde", + "sha2 0.11.0-rc.2", + "url", + "zeroize", + "zeroize_derive", +] + +[[package]] +name = "iroh-metrics" +version = "0.38.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c946095f060e6e59b9ff30cc26c75cdb758e7fb0cde8312c89e2144654989fcb" +dependencies = [ + "iroh-metrics-derive", + "itoa", + "n0-error", + "postcard", + "ryu", + "serde", + "tracing", +] + +[[package]] +name = "iroh-metrics-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab063c2bfd6c3d5a33a913d4fdb5252f140db29ec67c704f20f3da7e8f92dbf" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "iroh-quinn" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "034ed21f34c657a123d39525d948c885aacba59508805e4dd67d71f022e7151b" +dependencies = [ + "bytes", + "cfg_aliases", + "iroh-quinn-proto", + "iroh-quinn-udp", + "pin-project-lite", + "rustc-hash", + "rustls", + "socket2 0.6.2", + "thiserror 2.0.18", + "tokio", + "tokio-stream", + "tracing", + "web-time", +] + +[[package]] +name = "iroh-quinn-proto" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de99ad8adc878ee0e68509ad256152ce23b8bbe45f5539d04e179630aca40a9" +dependencies = [ + "bytes", + "derive_more", + "enum-assoc", + "fastbloom", + "getrandom 0.3.4", + "identity-hash", + "lru-slab", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "sorted-index-buffer", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "iroh-quinn-udp" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f981dadd5a072a9e0efcd24bdcc388e570073f7e51b33505ceb1ef4668c80c86" +dependencies = [ + "cfg_aliases", + "libc", + "socket2 0.6.2", + "tracing", + "windows-sys 0.61.2", +] + +[[package]] +name = "iroh-relay" +version = "0.96.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd2b63e654b9dec799a73372cdc79b529ca6c7248c0c8de7da78a02e3a46f03c" +dependencies = [ + "blake3", + "bytes", + "cfg_aliases", + "data-encoding", + "derive_more", + "getrandom 0.3.4", + "hickory-resolver", + "http", + "http-body-util", + "hyper", + "hyper-util", + "iroh-base", + "iroh-metrics", + "iroh-quinn", + "iroh-quinn-proto", + "lru", + "n0-error", + "n0-future", + "num_enum", + "pin-project", + "pkarr", + "postcard", + "rand", + "reqwest 0.12.28", + "rustls", + "rustls-pki-types", + "serde", + "serde_bytes", + "strum", + "tokio", + "tokio-rustls", + "tokio-util", + "tokio-websockets", + "tracing", + "url", + "vergen-gitcl", + "webpki-roots", + "ws_stream_wasm", + "z32", +] + +[[package]] +name = "itoa" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.182" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "litrs" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "lru" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1dc47f592c06f33f8e3aea9591776ec7c9f9e4124778ff8a3c3b87159f7e593" +dependencies = [ + "hashbrown 0.16.1", +] + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "mac-addr" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3d25b0e0b648a86960ac23b7ad4abb9717601dec6f66c165f5b037f3f03065f" + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mio" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "moka" +version = "0.12.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac832c50ced444ef6be0767a008b02c106a909ba79d1d830501e94b96f6b7e" +dependencies = [ + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "equivalent", + "parking_lot", + "portable-atomic", + "smallvec", + "tagptr", + "uuid", +] + +[[package]] +name = "n0-error" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af4782b4baf92d686d161c15460c83d16ebcfd215918763903e9619842665cae" +dependencies = [ + "n0-error-macros", + "spez", +] + +[[package]] +name = "n0-error-macros" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03755949235714b2b307e5ae89dd8c1c2531fb127d9b8b7b4adf9c876cd3ed18" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "n0-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2ab99dfb861450e68853d34ae665243a88b8c493d01ba957321a1e9b2312bbe" +dependencies = [ + "cfg_aliases", + "derive_more", + "futures-buffered", + "futures-lite", + "futures-util", + "js-sys", + "pin-project", + "send_wrapper", + "tokio", + "tokio-util", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-time", +] + +[[package]] +name = "n0-watcher" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38795f7932e6e9d1c6e989270ef5b3ff24ebb910e2c9d4bed2d28d8bae3007dc" +dependencies = [ + "derive_more", + "n0-error", + "n0-future", +] + +[[package]] +name = "native-tls" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5d26952a508f321b4d3d2e80e78fc2603eaefcdf0c30783867f19586518bdc" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "netdev" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc9815643a243856e7bd84524e1ff739e901e846cfb06ad9627cd2b6d59bd737" +dependencies = [ + "block2", + "dispatch2", + "dlopen2", + "ipnet", + "libc", + "mac-addr", + "netlink-packet-core", + "netlink-packet-route 0.25.1", + "netlink-sys", + "objc2-core-foundation", + "objc2-system-configuration", + "once_cell", + "plist", + "windows-sys 0.59.0", +] + +[[package]] +name = "netlink-packet-core" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3463cbb78394cb0141e2c926b93fc2197e473394b761986eca3b9da2c63ae0f4" +dependencies = [ + "paste", +] + +[[package]] +name = "netlink-packet-route" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ec2f5b6839be2a19d7fa5aab5bc444380f6311c2b693551cb80f45caaa7b5ef" +dependencies = [ + "bitflags", + "libc", + "log", + "netlink-packet-core", +] + +[[package]] +name = "netlink-packet-route" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ce3636fa715e988114552619582b530481fd5ef176a1e5c1bf024077c2c9445" +dependencies = [ + "bitflags", + "libc", + "log", + "netlink-packet-core", +] + +[[package]] +name = "netlink-proto" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65d130ee111430e47eed7896ea43ca693c387f097dd97376bffafbf25812128" +dependencies = [ + "bytes", + "futures", + "log", + "netlink-packet-core", + "netlink-sys", + "thiserror 2.0.18", +] + +[[package]] +name = "netlink-sys" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd6c30ed10fa69cc491d491b85cc971f6bdeb8e7367b7cde2ee6cc878d583fae" +dependencies = [ + "bytes", + "futures-util", + "libc", + "log", + "tokio", +] + +[[package]] +name = "netwatch" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "454b8c0759b2097581f25ed5180b4a1d14c324fde6d0734932a288e044d06232" +dependencies = [ + "atomic-waker", + "bytes", + "cfg_aliases", + "derive_more", + "iroh-quinn-udp", + "js-sys", + "libc", + "n0-error", + "n0-future", + "n0-watcher", + "netdev", + "netlink-packet-core", + "netlink-packet-route 0.28.0", + "netlink-proto", + "netlink-sys", + "objc2-core-foundation", + "objc2-system-configuration", + "pin-project-lite", + "serde", + "socket2 0.6.2", + "time", + "tokio", + "tokio-util", + "tracing", + "web-sys", + "windows", + "windows-result", + "wmi", +] + +[[package]] +name = "ntimestamp" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c50f94c405726d3e0095e89e72f75ce7f6587b94a8bd8dc8054b73f65c0fd68c" +dependencies = [ + "base32", + "document-features", + "getrandom 0.2.17", + "httpdate", + "js-sys", + "once_cell", + "serde", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-conv" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + +[[package]] +name = "objc2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c2599ce0ec54857b29ce62166b0ed9b4f6f1a70ccc9a71165b6154caca8c05" +dependencies = [ + "objc2-encode", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags", + "block2", + "dispatch2", + "libc", + "objc2", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-security" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a" +dependencies = [ + "bitflags", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-system-configuration" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7216bd11cbda54ccabcab84d523dc93b858ec75ecfb3a7d89513fa22464da396" +dependencies = [ + "bitflags", + "dispatch2", + "libc", + "objc2", + "objc2-core-foundation", + "objc2-security", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +dependencies = [ + "critical-section", + "portable-atomic", +] + +[[package]] +name = "openssl" +version = "0.10.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "openssl-sys" +version = "0.9.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "papaya" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92dd0b07c53a0a0c764db2ace8c541dc47320dad97c2200c2a637ab9dd2328f" +dependencies = [ + "equivalent", + "seize", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pem-rfc7468" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6305423e0e7738146434843d1694d621cce767262b2a86910beab705e4493d9" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pharos" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" +dependencies = [ + "futures", + "rustc_version", +] + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkarr" +version = "5.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f950360d31be432c0c9467fba5024a94f55128e7f32bc9d32db140369f24c77" +dependencies = [ + "async-compat", + "base32", + "bytes", + "cfg_aliases", + "document-features", + "dyn-clone", + "ed25519-dalek 3.0.0-pre.1", + "futures-buffered", + "futures-lite", + "getrandom 0.4.1", + "log", + "lru", + "ntimestamp", + "reqwest 0.13.2", + "self_cell", + "serde", + "sha1_smol", + "simple-dns", + "thiserror 2.0.18", + "tokio", + "tracing", + "url", + "wasm-bindgen-futures", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der 0.7.10", + "spki 0.7.3", +] + +[[package]] +name = "pkcs8" +version = "0.11.0-rc.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12922b6296c06eb741b02d7b5161e3aaa22864af38dfa025a1a3ba3f68c84577" +dependencies = [ + "der 0.8.0", + "spki 0.8.0-rc.4", +] + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "plist" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "740ebea15c5d1428f910cd1a5f52cebf8d25006245ed8ade92702f4943d91e07" +dependencies = [ + "base64", + "indexmap", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "portmapper" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d2a8825353ace3285138da3378b1e21860d60351942f7aa3b99b13b41f80318" +dependencies = [ + "base64", + "bytes", + "derive_more", + "futures-lite", + "futures-util", + "hyper-util", + "igd-next", + "iroh-metrics", + "libc", + "n0-error", + "netwatch", + "num_enum", + "rand", + "serde", + "smallvec", + "socket2 0.6.2", + "time", + "tokio", + "tokio-util", + "tower-layer", + "tracing", + "url", +] + +[[package]] +name = "postcard" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "heapless", + "postcard-derive", + "serde", +] + +[[package]] +name = "postcard-derive" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0232bd009a197ceec9cc881ba46f727fcd8060a2d8d6a9dde7a69030a6fe2bb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro-crate" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c" +dependencies = [ + "memchr", +] + +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2 0.6.2", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2 0.6.2", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "quote" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "js-sys", + "log", + "mime", + "native-tls", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots", +] + +[[package]] +name = "reqwest" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" +dependencies = [ + "base64", + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "resolv-conf" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e061d1b48cb8d38042de4ae0a7a6401009d6143dc80d2e2d6f31f0bdd6470c7" + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[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 = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" +dependencies = [ + "aws-lc-rs", + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + +[[package]] +name = "rustls-webpki" +version = "0.103.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d17b898a6d6948c3a8ee4372c17cb384f90d2e6e912ef00895b14fd7ab54ec38" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "321c8673b092a9a42605034a9879d73cb79101ed5fd117bc9a597b89b4e9e61a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "seize" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b55fb86dfd3a2f5f76ea78310a88f96c4ea21a3031f8d212443d56123fd0521" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "self_cell" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b12e76d157a900eb52e81bc6e9f3069344290341720e9178cde2407113ac8d89" + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha1_smol" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.11.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1e3878ab0f98e35b2df35fe53201d088299b41a6bb63e3e34dada2ac4abd924" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.11.0-rc.10", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "signature" +version = "3.0.0-rc.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f1880df446116126965eeec169136b2e0251dba37c6223bcc819569550edea3" + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "simple-dns" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee851d0e5e7af3721faea1843e8015e820a234f81fda3dea9247e15bac9a86a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "single-gpu-inference" +version = "0.1.0" +dependencies = [ + "distribution", + "iroh", + "reqwest 0.12.28", + "serde", + "serde_json", + "swactor", + "swactor-process", + "tokio", + "urlencoding", + "wiremock", +] + +[[package]] +name = "siphasher" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "socket2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "sorted-index-buffer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea06cc588e43c632923a55450401b8f25e628131571d4e1baea1bdfdb2b5ed06" + +[[package]] +name = "spez" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c87e960f4dca2788eeb86bbdde8dd246be8948790b7618d656e68f9b720a86e8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spin" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der 0.7.10", +] + +[[package]] +name = "spki" +version = "0.8.0-rc.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8baeff88f34ed0691978ec34440140e1572b68c7dd4a495fd14a3dc1944daa80" +dependencies = [ + "base64ct", + "der 0.8.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "swactor" +version = "0.1.0" +dependencies = [ + "crossbeam-queue", + "crossbeam-utils", + "getrandom 0.2.17", + "serde", +] + +[[package]] +name = "swactor-process" +version = "0.1.0" +dependencies = [ + "crossbeam-queue", + "libc", + "serde", + "serde_json", + "serde_yaml", + "swactor", +] + +[[package]] +name = "swactor-transport" +version = "0.1.0" +dependencies = [ + "bs58", + "ed25519-dalek 2.2.0", + "rand_core 0.6.4", + "serde", + "serde_json", + "swactor", +] + +[[package]] +name = "syn" +version = "2.0.116" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df424c70518695237746f84cede799c9c58fcb37450d7b23716568cc8bc69cb" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + +[[package]] +name = "tempfile" +version = "3.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1" +dependencies = [ + "fastrand", + "getrandom 0.4.1", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[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", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +dependencies = [ + "deranged", + "itoa", + "js-sys", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "time-macros" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.6.2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "futures-util", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-websockets" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1b6348ebfaaecd771cecb69e832961d277f59845d4220a584701f72728152b7" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-sink", + "getrandom 0.3.4", + "http", + "httparse", + "rand", + "ring", + "rustls-pki-types", + "simdutf8", + "tokio", + "tokio-rustls", + "tokio-util", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.23.10+spec-1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.8+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0742ff5ff03ea7e67c8ae6c93cac239e0d9784833362da3f9a9c1da8dfefcbdc" +dependencies = [ + "winnow", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", + "serde_derive", +] + +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" +dependencies = [ + "getrandom 0.4.1", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vergen" +version = "9.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b849a1f6d8639e8de261e81ee0fc881e3e3620db1af9f2e0da015d4382ceaf75" +dependencies = [ + "anyhow", + "derive_builder", + "rustversion", + "vergen-lib 9.1.0", +] + +[[package]] +name = "vergen-gitcl" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9dfc1de6eb2e08a4ddf152f1b179529638bedc0ea95e6d667c014506377aefe" +dependencies = [ + "anyhow", + "derive_builder", + "rustversion", + "time", + "vergen", + "vergen-lib 0.1.6", +] + +[[package]] +name = "vergen-lib" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b07e6010c0f3e59fcb164e0163834597da68d1f864e2b8ca49f74de01e9c166" +dependencies = [ + "anyhow", + "derive_builder", + "rustversion", +] + +[[package]] +name = "vergen-lib" +version = "9.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b34a29ba7e9c59e62f229ae1932fb1b8fb8a6fdcc99215a641913f5f5a59a569" +dependencies = [ + "anyhow", + "derive_builder", + "rustversion", +] + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" +dependencies = [ + "cfg-if", + "futures-util", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "web-sys" +version = "0.3.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804f18a4ac2676ffb4e8b5b5fa9ae38af06df08162314f96a68d2a363e21a8ca" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "webpki-roots" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "widestring" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core", + "windows-link", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core", + "windows-link", +] + +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[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_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[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_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[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_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[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_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[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_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wiremock" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08db1edfb05d9b3c1542e521aea074442088292f00b5f28e435c714a98f85031" +dependencies = [ + "assert-json-diff", + "base64", + "deadpool", + "futures", + "http", + "http-body-util", + "hyper", + "hyper-util", + "log", + "once_cell", + "regex", + "serde", + "serde_json", + "tokio", + "url", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "wmi" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e49d9da833ef7c4419d8c3a18f0f7a8eca8ccc85f7ab8f359281c24100251211" +dependencies = [ + "chrono", + "futures", + "log", + "serde", + "thiserror 2.0.18", + "windows", + "windows-core", +] + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "ws_stream_wasm" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c173014acad22e83f16403ee360115b38846fe754e735c5d9d3803fe70c6abc" +dependencies = [ + "async_io_stream", + "futures", + "js-sys", + "log", + "pharos", + "rustc_version", + "send_wrapper", + "thiserror 2.0.18", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "xml-rs" +version = "0.8.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f" + +[[package]] +name = "xmltree" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d8a75eaf6557bb84a65ace8609883db44a29951042ada9b393151532e41fcb" +dependencies = [ + "xml-rs", +] + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "z32" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2164e798d9e3d84ee2c91139ace54638059a3b23e361f5c11781c2c6459bde0f" + +[[package]] +name = "zerocopy" +version = "0.8.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/examples/single-gpu-inference/Cargo.toml b/examples/single-gpu-inference/Cargo.toml new file mode 100644 index 0000000..aaa3df3 --- /dev/null +++ b/examples/single-gpu-inference/Cargo.toml @@ -0,0 +1,29 @@ +[workspace] + +[package] +name = "single-gpu-inference" +version = "0.1.0" +edition = "2024" +publish = false + +[dependencies] +swactor = { path = "../..", features = ["transport", "serde", "std"] } +swactor-process = { path = "../../crates/process" } +serde = { version = "1", features = ["derive"] } +serde_json = "1" +reqwest = { version = "0.12", features = ["json"] } +tokio = { version = "1", features = ["full"] } +distribution = { path = "../../crates/distribution", features = ["iroh"] } +iroh = "0.96" +urlencoding = "2" + +[[bin]] +name = "gpu-node" +path = "src/bin/gpu_node.rs" + +[[bin]] +name = "single-gpu-inference" +path = "src/bin/single_gpu_inference.rs" + +[dev-dependencies] +wiremock = "0.6" diff --git a/examples/single-gpu-inference/Dockerfile b/examples/single-gpu-inference/Dockerfile new file mode 100644 index 0000000..2119dd2 --- /dev/null +++ b/examples/single-gpu-inference/Dockerfile @@ -0,0 +1,27 @@ +FROM nvidia/cuda:12.6.3-devel-ubuntu24.04 + +# Install Python 3, pip, and CUDA runtime compiler (tinygrad compiles kernels via NVRTC) +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + python3 \ + python3-venv \ + python3-pip \ + ca-certificates && \ + rm -rf /var/lib/apt/lists/* + +# Install tinygrad and numpy +RUN python3 -m pip install --no-cache-dir --break-system-packages \ + tinygrad==0.12.0 \ + numpy + +# Copy the gpu-node binary and tinygrad worker +# Build context should be the workspace root: +# docker build -f examples/single-gpu-inference/Dockerfile -t . +COPY examples/single-gpu-inference/target/release/gpu-node /usr/local/bin/gpu-node +COPY examples/single-gpu-inference/tinygrad_worker.py /usr/local/share/tinygrad_worker.py + +# Enable CUDA backend for tinygrad +ENV CUDA=1 +ENV WORKER_SCRIPT=/usr/local/share/tinygrad_worker.py + +CMD ["gpu-node"] diff --git a/examples/single-gpu-inference/INTEGRATION_TEST_PLAN.md b/examples/single-gpu-inference/INTEGRATION_TEST_PLAN.md new file mode 100644 index 0000000..46859d8 --- /dev/null +++ b/examples/single-gpu-inference/INTEGRATION_TEST_PLAN.md @@ -0,0 +1,78 @@ +# Plan: Local Mock Integration Test + +## Context + +The smoke-test crate has 5 component test groups (T-codec, T-worker, T-vastai, T-actor, T-cluster) that each test a piece of the distributed inference pipeline in isolation. What's missing is a single test that wires them together: two swactor nodes on localhost, one running the real `InferenceActor` (with `echo_worker.py`), communicating over iroh/QUIC. This proves the full local chain before spending money on vast.ai. + +## Design Problem + +`InferenceActor::Incoming` is `InferenceActorMsg` (a union of `Request` and `Process` variants). But the network codec delivers raw `InferenceRequest`. When `rt.deliver_raw()` delivers a deserialized `InferenceRequest` to the `InferenceActor`, the downcast to `InferenceActorMsg` fails silently. + +**Solution:** Add a `RequestBridge` actor — same pattern as the existing `ProcessBridge`. It receives `InferenceRequest` from the network, wraps it as `InferenceActorMsg::Request(req)`, and forwards to the `InferenceActor`. ~10 lines. + +## Changes + +### 1. Add `RequestBridge` to `examples/single-gpu-inference/src/inference_actor.rs` + +A public actor struct placed after the existing `ProcessBridge` (~line 55). Fields: `target: ActorAddress`. Implements `ActorInterface` with `Incoming = InferenceRequest`, wraps and forwards to target as `InferenceActorMsg::Request`. + +### 2. Export it from `examples/single-gpu-inference/src/lib.rs` + +Already exports `pub mod inference_actor` — `RequestBridge` just needs to be `pub`. + +### 3. Create `examples/single-gpu-inference/tests/t_integration.rs` + +One test function: `distributed_inference_through_echo_worker`. + +**Setup (reuse patterns from t_cluster.rs and t_actor.rs):** +- Copy iroh helpers: `make_driver`, `make_converged_pair`, `IrohActorTransport`, `encode_wire`/`decode_wire`, `drain_actor_messages` (with reduced internal sleep for localhost — 100ms instead of 500ms) +- Copy process helpers: `echo_worker_spec`, `is_process_alive` + +**Test flow:** +1. Converge two iroh drivers via `make_converged_pair()` +2. Create `rt_a` (local) and `rt_b` (remote) runtimes +3. On `rt_b`: spawn `InferenceActor` (with `echo_worker_spec()`) + `RequestBridge` pointing at it +4. On `rt_a`: create `response_inbox` for `InferenceResponse` +5. Build `IrohActorTransport` in each direction, wire transport routers: + - `rt_a`: `bridge_addr → transport_a_to_b` + - `rt_b`: `inbox_addr → transport_b_to_a` +6. Install codec registries and transport routers (`&mut self` — must happen after all spawns/inbox creation) +7. Tick `rt_b` in a polling loop until `InferenceActorStatus::WorkerReady` (echo_worker.py started) +8. `rt_a.send_to(bridge_addr, InferenceRequest { prompt: "Hello from node A", reply_to: inbox_addr, ... })` +9. Pump loop (10s timeout): `drain_actor_messages` on both drivers → tick both runtimes → check `response_inbox` +10. Assert response text contains `"Hello from node A"` (echo worker reflects prompt) +11. Cleanup: stop inference actor, tick until echo_worker.py pid is dead, shutdown both drivers + +**Message path through the system:** +``` +rt_a.send_to(bridge_addr, InferenceRequest) + → transport router → IrohActorTransport (QUIC to node B) + → drain_actor_messages → rt_b.deliver_raw(bridge_addr, InferenceRequest) + → RequestBridge.handle() → ctx.send(inference_addr, InferenceActorMsg::Request(req)) + → InferenceActor.handle() → writes JSON to echo_worker.py stdin + → echo_worker.py → writes JSON to stdout + → ProcessActor → ProcessNotification::Output → ProcessBridge → InferenceActor + → InferenceActor.process_output_line() → ctx.send(reply_to, InferenceResponse) + → transport router → IrohActorTransport (QUIC to node A) + → drain_actor_messages → rt_a.deliver_raw(inbox_addr, InferenceResponse) + → response_inbox.try_recv() ✓ +``` + +## Files Modified + +| File | Change | +|---|---| +| `examples/single-gpu-inference/src/inference_actor.rs` | Add `pub struct RequestBridge` (~10 lines) | +| `examples/single-gpu-inference/tests/t_integration.rs` | New file — one integration test (~200 lines) | + +## Verification + +```bash +# Run just the new test +cargo test --manifest-path examples/single-gpu-inference/Cargo.toml t_integration + +# Confirm existing tests still pass +cargo test --manifest-path examples/single-gpu-inference/Cargo.toml +``` + +Expected: all 22 tests pass (21 existing + 1 new). Test runtime ~10-15s (dominated by iroh drain sleeps and echo_worker.py process I/O). diff --git a/examples/single-gpu-inference/Makefile b/examples/single-gpu-inference/Makefile new file mode 100644 index 0000000..17a8b5f --- /dev/null +++ b/examples/single-gpu-inference/Makefile @@ -0,0 +1,13 @@ +.PHONY: venv clean-venv + +VENV_DIR := .venv +PYTHON := $(VENV_DIR)/bin/python + +venv: $(VENV_DIR)/bin/python + +$(VENV_DIR)/bin/python: + uv venv $(VENV_DIR) --python python3.11 + uv pip install --python $(VENV_DIR)/bin/python "tinygrad==0.12.0" numpy + +clean-venv: + rm -rf $(VENV_DIR) diff --git a/examples/single-gpu-inference/SPEC.md b/examples/single-gpu-inference/SPEC.md new file mode 100644 index 0000000..e2ba804 --- /dev/null +++ b/examples/single-gpu-inference/SPEC.md @@ -0,0 +1,243 @@ +# Smoke Test Specification: Rent a GPU, Run Inference, Say Hello + +## 1. Wanted Behavior + +`smoke-run --vastai --api-key ` runs on the local machine. It: +1. Finds the cheapest available GPU on vast.ai and rents it. +2. Starts a local swactor node with iroh transport. +3. The rented instance boots our pre-built Docker image containing `gpu-node` + tinygrad. +4. The remote `gpu-node` reads `SEED_ADDR` from env and joins the local cluster via iroh/QUIC. +5. The local node discovers the remote `InferenceActor` via SWIM name resolution (`"inference"`). +6. The local node sends an `InferenceRequest` to the remote actor. +7. The remote actor runs tinygrad inference, replies with `InferenceResponse`. +8. Asserts the response is non-empty text and prints it. +9. Destroys the vast.ai instance. +10. Exits 0. + +If anything fails, the script destroys the instance (if one was created) and exits 1. + +Total wall-clock budget: 10 minutes. + +``` +local machine (smoke-run) vast.ai GPU (gpu-node) + | | + | 1. search offers (REST) | + | 2. create instance (REST) | + | SEED_ADDR= | + | ------------------------------------> | + | | [pulling docker image] + | 3. poll vast.ai status every 10s | [gpu-node starting] + | ------------------------------------> | [tinygrad loading model into VRAM] + | "loading" | + | <------------------------------------ | + | "running" | + | <------------------------------------ | + | | + | 4. SWIM cluster join (iroh/QUIC) | + | <--------------------------------->>> | + | [cluster converged] | + | [name "inference" resolved] | + | | + | 5. InferenceRequest (swactor msg) | + | "Say hello" | + | ------------------------------------> | + | | [tinygrad forward pass] + | InferenceResponse | + | "Hello! How can I help you?" | + | <------------------------------------ | + | | + | 6. assert len(response) > 0 | + | 7. DELETE instance (vast.ai REST) | + | ------------------------------------> | + | 8. exit 0 | +``` + +--- + +## 2. What Already Exists + +The entire pipeline is implemented and tested locally. The remaining work is deploying it to vast.ai for real. + +### Implemented components + +| Component | File(s) | Status | +|---|---|---| +| Message types + codec | `src/messages.rs` | Done, tested (T-codec: 7 tests) | +| InferenceActor + ProcessBridge | `src/inference_actor.rs` | Done, tested (T-actor: 4 tests) | +| RequestBridge (network→actor type bridge) | `src/inference_actor.rs` | Done | +| Iroh actor transport (shared) | `src/iroh_transport.rs` | Done, used by tests + binaries | +| vast.ai REST client | `src/vastai.rs` | Done, tested (T-vastai: 7 tests) | +| tinygrad worker (real GGUF model) | `tinygrad_worker.py` | Done, tested (T-worker: 5 test classes) | +| Cluster transport tests | `tests/t_cluster.rs` | Done (3 tests) | +| In-process integration test (echo) | `tests/t_integration.rs` | Done, passes | +| In-process integration test (tinygrad) | `tests/t_integration.rs` | Done, passes (`#[ignore]`, needs .venv) | +| `gpu-node` binary | `src/bin/gpu_node.rs` | Done, compiles | +| `smoke-run` binary (localhost + vastai) | `src/bin/smoke_run.rs` | Done, compiles | +| Binary e2e test (echo) | `tests/t_binary.rs` | Done, passes | +| Binary e2e test (tinygrad) | `tests/t_binary.rs` | Done, passes (`#[ignore]`, needs .venv) | +| Dockerfile | `Dockerfile` | Done | + +### Test commands + +```bash +# Fast tests (no GPU, no downloads, no vast.ai) — 22 tests +cargo test --manifest-path examples/single-gpu-inference/Cargo.toml + +# Slow tests (downloads ~1GB GGUF model, runs tinygrad on CPU) +cargo test --manifest-path examples/single-gpu-inference/Cargo.toml -- --ignored + +# Binary e2e on localhost (spawns gpu-node + smoke-run as child processes) +cargo test --manifest-path examples/single-gpu-inference/Cargo.toml binary_e2e_echo_worker +``` + +--- + +## 3. What Remains — Deployment to vast.ai + +### 3.1 Fix relay mode for WAN + +Both binaries currently use `RelayMode::Disabled`, which works on localhost but not over WAN. The remote `gpu-node` behind a vast.ai NAT cannot reach the local node without iroh relay servers. + +**Changes needed:** +- `gpu-node`: change `RelayMode::Disabled` to `RelayMode::Default` so iroh uses its public relay infrastructure for NAT traversal. +- `smoke-run` (vastai path): same — use `RelayMode::Default`. +- The localhost path (`smoke-run --seed`) can keep `RelayMode::Disabled`. + +### 3.2 Fix worker script path in Dockerfile + +The `Dockerfile` copies `tinygrad_worker.py` to `/usr/local/share/tinygrad_worker.py`, but `gpu-node` defaults `WORKER_SCRIPT` to `./tinygrad_worker.py`. + +**Fix**: either change the Dockerfile `COPY` destination to `/app/tinygrad_worker.py` and set `WORKDIR /app`, or set `ENV WORKER_SCRIPT=/usr/local/share/tinygrad_worker.py` in the Dockerfile. + +### 3.3 Add `pid` to tinygrad worker ready signal + +`tinygrad_worker.py` emits `{"status": "ready"}` but `echo_worker.py` emits `{"status": "ready", "pid": }`. The `InferenceActor` parses the `pid` field for `WorkerReady { pid }` status reporting. Without it, `worker_pid` is `None` — not fatal, but cleanup assertions in tests rely on it. + +**Fix**: change the ready signal to `_write({"status": "ready", "pid": os.getpid()})`. + +### 3.4 Build and push the Docker image + +```bash +# Cross-compile gpu-node for linux/amd64 (if not already on linux/amd64) +cargo build --release --bin gpu-node --manifest-path examples/single-gpu-inference/Cargo.toml + +# Build image +docker build -t /swactor-gpu:latest -f examples/single-gpu-inference/Dockerfile . + +# Push to registry (vast.ai pulls from here) +docker push /swactor-gpu:latest +``` + +The image name in `vastai.rs::create_instance` is hardcoded to `"swactor-gpu:latest"`. Update this to match whatever registry you push to, or make it a parameter. + +### 3.5 Run it for real + +```bash +VAST_API_KEY= cargo run --manifest-path examples/single-gpu-inference/Cargo.toml --bin single-gpu-inference -- \ + --vastai --api-key --gpu RTX_4090 +``` + +--- + +## 4. Architecture + +### Message flow (same for localhost and vast.ai) + +``` +smoke-run gpu-node +───────── ──────── +rt.send_to(bridge_addr, InferenceRequest) + → codec encodes → TransportRouter + → IrohActorTransport (QUIC to gpu-node) + drain_and_collect_reply_addrs() + → decode_wire → codecs.receive() + → rt.deliver_raw(bridge_addr, InferenceRequest) + → extract reply_to, add return transport route + RequestBridge.handle() + → ctx.send(inference_addr, InferenceActorMsg::Request) + InferenceActor.handle() + → JSON to tinygrad_worker.py stdin + tinygrad_worker.py + → Transformer forward pass + → JSON response to stdout + InferenceActor.process_output_line() + → ctx.send(reply_to, InferenceResponse) + → TransportRouter → IrohActorTransport (QUIC back) +drain_actor_messages() + → decode_wire → codecs.receive() + → rt.deliver_raw(inbox_addr, InferenceResponse) +response_inbox.try_recv() ✓ +``` + +### Name discovery + +The `gpu-node` registers its `RequestBridge` under the name `"inference"` via `DistributedNode::register_name`. This propagates through SWIM gossip piggyback. The `smoke-run` orchestrator calls `driver.node().resolve_name("inference")` to discover the bridge's `ActorAddress` without needing to know it ahead of time. + +### Dynamic return routing + +The `gpu-node`'s drain loop inspects incoming `InferenceRequest` payloads to extract the `reply_to` address. It then dynamically registers a transport route for that address pointing back to the only alive SWIM member (the orchestrator). This is necessary because the `gpu-node` doesn't know the orchestrator's inbox address at startup. + +--- + +## 5. tinygrad Worker + +`tinygrad_worker.py` — managed by swactor's process crate via stdin/stdout JSON. + +**Model**: `llama3.2:1b` from tinygrad's built-in GGUF catalog (~1GB download, fits in any modern GPU's VRAM). Loaded via `tinygrad.apps.llm.Transformer.from_gguf()`. + +**Protocol**: +``` +← stdout: {"status": "ready", "pid": 12345} +→ stdin: {"prompt": "Say hello", "max_tokens": 64, "temperature": 0.7} +← stdout: {"response": "Hello! How can I help you today?"} +→ stdin: {invalid json} +← stdout: {"error": "invalid JSON: ..."} +``` + +**Modes**: +- Default: downloads and loads real GGUF model, runs real inference. +- `--stub`: canned responses, no tinygrad import (for fast protocol tests). +- `--model `: override model (e.g., `qwen3:0.6b` for smaller download). + +**Environment**: +- `CUDA=1` → tinygrad uses CUDA backend (GPU). +- No env var → tinygrad auto-detects (CUDA if available, else CPU). +- `PYTHON=1` → forces tinygrad's pure-Python CPU backend (no clang needed). + +--- + +## 6. Error Modes + +| Failure | Detection | Response | +|---------|-----------|----------| +| No GPU offers available | vast.ai returns empty list | Print error, exit 1. No cleanup needed. | +| Instance creation rejected | API returns non-success | Print error, exit 1. No cleanup needed. | +| Instance never reaches `running` | 60 polls exhausted or terminal status | Destroy instance, exit 1. | +| Cluster never converges | SWIM timeout (2 min) | Destroy instance, exit 1. | +| Name `"inference"` never resolves | Timeout (1 min) | Destroy instance, exit 1. | +| tinygrad worker never reports ready | Process timeout (10 min) | Destroy instance, exit 1. | +| Empty/malformed response | Assertion on response text | Destroy instance, exit 1. | +| Destroy fails | Catch around cleanup | Print warning, exit 1. | + +Every path that allocates an instance also destroys it. + +--- + +## 7. Environment Requirements + +- Rust toolchain +- Python 3.10+ with tinygrad 0.12.0 + numpy (in `.venv/`) +- Docker (for building the GPU node image) +- `VAST_API_KEY` (vast.ai deployment only — not needed for local tests) +- Network access to iroh relay servers (vast.ai deployment only) + +--- + +## 8. What This Proves + +1. swactor nodes on rented GPUs can join a cluster with a local node over WAN via iroh/QUIC. +2. swactor messages traverse the WAN transparently — no HTTP layer needed for node-to-node communication. +3. tinygrad can load and run a LLaMA model on rented hardware via its CUDA backend. +4. The process crate manages the Python child process lifecycle cleanly. +5. SWIM gossip propagates actor name registrations, enabling dynamic service discovery. +6. The full lifecycle (rent → cluster → discover → infer → teardown) is fully automated. diff --git a/examples/single-gpu-inference/echo_worker.py b/examples/single-gpu-inference/echo_worker.py new file mode 100644 index 0000000..aa0e7f3 --- /dev/null +++ b/examples/single-gpu-inference/echo_worker.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +"""Stub worker for testing. Same JSON protocol as tinygrad_worker.py.""" +import json, os, sys + +print(json.dumps({"status": "ready", "pid": os.getpid()}), flush=True) +for line in sys.stdin: + line = line.strip() + if not line: + continue + try: + req = json.loads(line) + if req.get("prompt") == "__crash__": + os._exit(1) + print(json.dumps({"response": f"echo: {req['prompt']}"}), flush=True) + except Exception as e: + print(json.dumps({"error": str(e)}), flush=True) diff --git a/examples/single-gpu-inference/src/bin/gpu_node.rs b/examples/single-gpu-inference/src/bin/gpu_node.rs new file mode 100644 index 0000000..f995528 --- /dev/null +++ b/examples/single-gpu-inference/src/bin/gpu_node.rs @@ -0,0 +1,310 @@ +//! gpu-node — GPU inference node for distributed tinygrad inference. +//! +//! Runs inside a Docker container (or locally for testing). Joins an existing +//! cluster via `SEED_ADDR`, spawns an `InferenceActor` backed by +//! `tinygrad_worker.py`, and registers the bridge under the name `"inference"` +//! so the orchestrator can discover it. +//! +//! Environment variables: +//! - `SEED_ADDR` (required): hex-encoded NodeId of the seed node to join +//! - `SEED_DIRECT` (optional): comma-separated `ip:port` direct addresses for the seed +//! - `WORKER_CMD` (optional): path to Python interpreter (default: `python3`) +//! - `WORKER_SCRIPT` (optional): path to tinygrad_worker.py (default: `./tinygrad_worker.py`) +//! - `PYTHON` (optional): set to `1` for CPU fallback backend (no GPU/clang) + +use std::collections::HashMap; +use std::net::SocketAddr; +use std::sync::Arc; +use std::time::{Duration, Instant}; + +use distribution::iroh_driver::{IrohDriver, IrohDriverConfig}; +use distribution::node::DistributedNodeConfig; +use distribution::registry::RegistryConfig; +use distribution::swim::probe::SwimConfig; +use iroh::RelayMode; + +use swactor::actor::ActorAddress; +use swactor::runtime::{Runtime, RuntimeConfig}; +use swactor::transport::{CodecRegistry, TransportRouter}; + +use single_gpu_inference::inference_actor::{InferenceActor, InferenceActorStatus, RequestBridge}; +use single_gpu_inference::iroh_transport::{decode_wire, IrohActorTransport, ACTOR_ALPN}; +use single_gpu_inference::messages::{inference_codec_registry, InferenceRequest}; +use swactor_process::{ProcessMode, ProcessSpec}; + +fn parse_hex_node_id(s: &str) -> [u8; 32] { + assert!( + s.len() == 64, + "SEED_ADDR must be 64 hex characters (32 bytes)" + ); + let mut bytes = [0u8; 32]; + for i in 0..32 { + bytes[i] = u8::from_str_radix(&s[i * 2..i * 2 + 2], 16) + .unwrap_or_else(|_| panic!("invalid hex at position {}", i * 2)); + } + bytes +} + +fn node_config() -> DistributedNodeConfig { + DistributedNodeConfig { + swim: SwimConfig { + probe_interval: 10, + probe_timeout: 15, + indirect_probes: 2, + suspicion_timeout: 60, + dead_reprobe_interval: 100, + ..SwimConfig::default() + }, + cache_capacity: 100, + republish_interval: 50, + registry: RegistryConfig::default(), + metadata_lambda: 3, + } +} + +fn worker_spec() -> ProcessSpec { + let cmd = std::env::var("WORKER_CMD").unwrap_or_else(|_| "python3".into()); + let script = + std::env::var("WORKER_SCRIPT").unwrap_or_else(|_| "./tinygrad_worker.py".into()); + + let mut env = HashMap::new(); + if let Ok(val) = std::env::var("PYTHON") { + env.insert("PYTHON".into(), val); + } + + ProcessSpec { + command: cmd, + args: vec![script], + env, + working_dir: None, + mode: ProcessMode::Automated, + initial_pty_size: None, + kill_timeout: Some(Duration::from_secs(5)), + stdin_buffer_limit: None, + } +} + +/// Drain incoming actor messages from iroh into the swactor runtime. +/// +/// Like `drain_actor_messages` from the shared module, but also inspects +/// `InferenceRequest` payloads to extract `reply_to` addresses. Returns +/// the set of reply-to addresses found so the caller can dynamically +/// register transport routes for the response path. +fn drain_and_collect_reply_addrs( + driver: &IrohDriver, + codecs: &CodecRegistry, + rt: &Runtime, + drain_sleep: Duration, +) -> Vec { + let conns = driver.drain_other_connections(); + if conns.is_empty() { + return vec![]; + } + let handle = driver.tokio_handle(); + let (tx, rx) = std::sync::mpsc::channel::>(); + + for (_node_id, conn) in conns { + let tx = tx.clone(); + handle.spawn(async move { + loop { + match tokio::time::timeout(Duration::from_secs(1), conn.accept_uni()).await { + Ok(Ok(mut recv)) => { + if let Ok(data) = recv.read_to_end(256 * 1024).await { + let _ = tx.send(data); + } + } + _ => break, + } + } + }); + } + drop(tx); + std::thread::sleep(drain_sleep); + + let mut reply_addrs = Vec::new(); + for data in rx.try_iter() { + if let Some(envelope) = decode_wire(&data) { + // Inspect InferenceRequest payloads for reply_to addresses + if envelope.type_tag == "smoke::InferenceRequest" { + if let Ok(req) = serde_json::from_slice::(&envelope.payload) { + reply_addrs.push(req.reply_to); + } + } + if let Ok((addr, msg)) = codecs.receive(envelope) { + let _ = rt.deliver_raw(addr, msg); + } + } + } + reply_addrs +} + +fn main() { + // Create iroh driver + let mut driver = IrohDriver::new(IrohDriverConfig { + secret_key: None, + relay_mode: RelayMode::Default, + node: node_config(), + peer_auth: None, + additional_alpns: vec![ACTOR_ALPN.to_vec()], + }) + .expect("failed to create iroh driver"); + + // Print node address info so tests/orchestrators can discover us + let my_id = driver.node_id(); + let my_hex: String = my_id.0.iter().map(|b| format!("{:02x}", b)).collect(); + let direct_addrs: Vec = driver + .direct_addresses() + .iter() + .map(|sa| sa.to_string()) + .collect(); + let direct_str = direct_addrs.join(","); + eprintln!("gpu-node started (node_id: {my_hex})"); + eprintln!("GPU_NODE_ADDR {my_hex} {direct_str}"); + + // Optionally join a seed node (required for remote deployments, + // optional for localhost testing where the orchestrator joins us) + if let Ok(seed_hex_raw) = std::env::var("SEED_ADDR") { + let seed_hex = seed_hex_raw.trim().to_string(); + let seed_bytes = parse_hex_node_id(&seed_hex); + let seed_key = + iroh::PublicKey::from_bytes(&seed_bytes).expect("invalid seed public key"); + + let mut seed_addr = iroh::EndpointAddr::from(seed_key); + // Add relay URL so we can find the seed over the internet + if let Ok(relay) = std::env::var("SEED_RELAY") { + let relay = relay.trim().to_string(); + if let Ok(relay_url) = relay.parse::() { + eprintln!("using seed relay: {relay}"); + seed_addr = seed_addr.with_relay_url(relay_url); + } + } + if let Ok(direct) = std::env::var("SEED_DIRECT") { + for part in direct.split(',') { + if let Ok(sa) = part.trim().parse::() { + seed_addr = seed_addr.with_ip_addr(sa); + } + } + } + + eprintln!("joining seed: {seed_hex}"); + driver.join(&[seed_addr]); + } else { + eprintln!("no SEED_ADDR set — listening for incoming connections"); + } + + // Create actor runtime + let mut rt = Runtime::new(RuntimeConfig::default()); + let codecs = Arc::new(inference_codec_registry()); + + // Spawn InferenceActor + RequestBridge + let status_inbox = rt.new_inbox::().unwrap(); + let sender = rt.create_sender(); + let actor = + InferenceActor::new(worker_spec(), sender).with_status_addr(*status_inbox.addr()); + let inference_addr = rt.spawn(actor).unwrap(); + + let bridge = RequestBridge { target: inference_addr }; + let bridge_addr = rt.spawn(bridge).unwrap(); + + // Register "inference" name in the cluster + driver + .node_mut() + .register_name("inference".into(), bridge_addr); + eprintln!("registered name 'inference' -> bridge {:?}", bridge_addr); + + // Install codecs on the runtime + rt.set_codec_registry(codecs.clone()); + + // Transport router — routes are added dynamically as requests arrive + let router = Arc::new(TransportRouter::new()); + rt.set_transport_router(router.clone()); + + // Wait for worker to be ready (model download + load can take minutes) + let start = Instant::now(); + let mut worker_ready = false; + while start.elapsed() < Duration::from_secs(600) { + rt.tick(); + if let Some(status) = status_inbox.try_recv() { + match status { + InferenceActorStatus::WorkerReady { pid } => { + eprintln!("worker ready (pid: {:?})", pid); + worker_ready = true; + break; + } + InferenceActorStatus::ProcessStarted => { + eprintln!("worker process started"); + } + InferenceActorStatus::ProcessExited { status } => { + eprintln!("worker exited during startup: {:?}", status); + std::process::exit(1); + } + } + } + driver.recv(); + driver.tick(); + std::thread::sleep(Duration::from_millis(50)); + } + if !worker_ready { + eprintln!("worker did not become ready within 600s"); + std::process::exit(1); + } + + // Main loop + eprintln!("entering main loop"); + loop { + driver.recv(); + driver.tick(); + + // Drain incoming actor messages and collect reply_to addresses + let reply_addrs = + drain_and_collect_reply_addrs(&driver, &codecs, &rt, Duration::from_millis(50)); + + // Dynamically register transport routes for reply_to addresses. + // These addresses live on the remote orchestrator node — we need a + // transport route so InferenceActor can send InferenceResponse back. + for reply_addr in reply_addrs { + // Find the peer to route back to. With a single orchestrator peer, + // we route all reply addresses to the only alive member. + let snap = driver.snapshot(); + for member in &snap.members { + if member.state == "alive" && member.node_id.len() == 64 { + let peer_bytes = parse_hex_node_id(&member.node_id); + if let Ok(peer_key) = iroh::PublicKey::from_bytes(&peer_bytes) { + let peer_addr = iroh::EndpointAddr::from(peer_key); + let transport = Arc::new(IrohActorTransport::new( + driver.endpoint().clone(), + peer_addr, + driver.tokio_handle(), + )); + router.add_route(reply_addr, transport); + eprintln!("added return route for {:?}", reply_addr); + } + } + } + } + + rt.tick(); + + // Check worker health — log but don't exit, so SWIM stays alive + // for diagnostics when the worker crashes + if let Some(status) = status_inbox.try_recv() { + match status { + InferenceActorStatus::ProcessExited { status } => { + eprintln!("worker process exited: {:?}", status); + eprintln!("keeping main loop alive for diagnostics"); + } + other => { + eprintln!("worker status: {:?}", other); + } + } + } + + std::thread::sleep(Duration::from_millis(10)); + } + + // Cleanup + let _ = rt.stop_actor(inference_addr); + rt.tick(); + driver.shutdown(); + eprintln!("gpu-node shut down"); +} diff --git a/examples/single-gpu-inference/src/bin/single_gpu_inference.rs b/examples/single-gpu-inference/src/bin/single_gpu_inference.rs new file mode 100644 index 0000000..b563f1a --- /dev/null +++ b/examples/single-gpu-inference/src/bin/single_gpu_inference.rs @@ -0,0 +1,573 @@ +//! single-gpu-inference — Local-side orchestrator for distributed tinygrad inference. +//! +//! Starts a local iroh node, waits for the remote gpu-node to join and +//! register its `"inference"` name, then sends an `InferenceRequest` through +//! the full distributed pipeline and prints the response. +//! +//! Usage: +//! # Localhost mode (default): expects gpu-node already running with SEED_ADDR +//! single-gpu-inference --seed [--seed-direct ip:port,...] +//! +//! # vast.ai mode: rents a GPU, deploys the Docker image, runs the test +//! single-gpu-inference --vastai --api-key [--gpu RTX_4090] +//! +//! Environment variables: +//! PYTHON=1 — passed through to worker (CPU fallback, no GPU/clang) + +use std::net::SocketAddr; +use std::sync::Arc; +use std::time::{Duration, Instant}; + +use distribution::iroh_driver::{IrohDriver, IrohDriverConfig}; +use distribution::node::DistributedNodeConfig; +use distribution::registry::RegistryConfig; +use distribution::swim::probe::SwimConfig; +use iroh::{PublicKey, RelayMode}; + +use swactor::runtime::{Runtime, RuntimeConfig}; +use swactor::transport::TransportRouter; + +use single_gpu_inference::iroh_transport::{drain_actor_messages, IrohActorTransport, ACTOR_ALPN}; +use single_gpu_inference::messages::{inference_codec_registry, InferenceRequest, InferenceResponse}; + +fn parse_hex_node_id(s: &str) -> [u8; 32] { + assert!( + s.len() == 64, + "node id must be 64 hex characters (32 bytes)" + ); + let mut bytes = [0u8; 32]; + for i in 0..32 { + bytes[i] = u8::from_str_radix(&s[i * 2..i * 2 + 2], 16) + .unwrap_or_else(|_| panic!("invalid hex at position {}", i * 2)); + } + bytes +} + +fn node_config() -> DistributedNodeConfig { + DistributedNodeConfig { + swim: SwimConfig { + probe_interval: 10, + probe_timeout: 15, + indirect_probes: 2, + suspicion_timeout: 60, + dead_reprobe_interval: 100, + ..SwimConfig::default() + }, + cache_capacity: 100, + republish_interval: 50, + registry: RegistryConfig::default(), + metadata_lambda: 3, + } +} + +fn print_usage() { + eprintln!("Usage:"); + eprintln!(" single-gpu-inference --seed [--seed-direct ip:port,...]"); + eprintln!(" single-gpu-inference --vastai --api-key [--gpu RTX_4090] [--image ghcr.io/user/swactor-gpu:latest]"); +} + +fn main() { + let args: Vec = std::env::args().collect(); + + let mut seed_hex: Option = None; + let mut seed_direct: Vec = Vec::new(); + let mut vastai = false; + let mut api_key: Option = None; + let mut gpu_name = "RTX 4090".to_string(); + let mut image = "swactor-gpu:latest".to_string(); + + let mut i = 1; + while i < args.len() { + match args[i].as_str() { + "--seed" => { + i += 1; + if i >= args.len() { + eprintln!("--seed requires a value"); + std::process::exit(1); + } + seed_hex = Some(args[i].clone()); + } + "--seed-direct" => { + i += 1; + if i >= args.len() { + eprintln!("--seed-direct requires a value"); + std::process::exit(1); + } + for part in args[i].split(',') { + if let Ok(sa) = part.trim().parse::() { + seed_direct.push(sa); + } + } + } + "--vastai" => { + vastai = true; + } + "--api-key" => { + i += 1; + if i >= args.len() { + eprintln!("--api-key requires a value"); + std::process::exit(1); + } + api_key = Some(args[i].trim().to_string()); + } + "--gpu" => { + i += 1; + if i >= args.len() { + eprintln!("--gpu requires a value"); + std::process::exit(1); + } + gpu_name = args[i].clone(); + } + "--image" => { + i += 1; + if i >= args.len() { + eprintln!("--image requires a value"); + std::process::exit(1); + } + image = args[i].clone(); + } + "--help" | "-h" => { + print_usage(); + return; + } + other => { + eprintln!("unknown argument: {other}"); + print_usage(); + std::process::exit(1); + } + } + i += 1; + } + + if vastai { + run_vastai(api_key.expect("--api-key required with --vastai"), &gpu_name, &image); + } else { + let seed = seed_hex.expect("--seed required in localhost mode"); + run_localhost(&seed, &seed_direct); + } +} + +fn run_localhost(seed_hex: &str, seed_direct: &[SocketAddr]) { + let seed_bytes = parse_hex_node_id(seed_hex); + let seed_key = + iroh::PublicKey::from_bytes(&seed_bytes).expect("invalid seed public key"); + + // Build seed endpoint address + let mut seed_addr = iroh::EndpointAddr::from(seed_key); + for &sa in seed_direct { + seed_addr = seed_addr.with_ip_addr(sa); + } + + // Create local iroh driver + let mut driver = IrohDriver::new(IrohDriverConfig { + secret_key: None, + relay_mode: RelayMode::Disabled, + node: node_config(), + peer_auth: None, + additional_alpns: vec![ACTOR_ALPN.to_vec()], + }) + .expect("failed to create iroh driver"); + + let my_id = driver.node_id(); + let my_hex: String = my_id.0.iter().map(|b| format!("{:02x}", b)).collect(); + eprintln!("single-gpu-inference started (node id: {my_hex})"); + eprintln!("joining seed: {seed_hex}"); + + driver.join(&[seed_addr.clone()]); + + // Wait for SWIM convergence — the remote node must appear as alive + eprintln!("waiting for cluster convergence..."); + let start = Instant::now(); + let mut converged = false; + while start.elapsed() < Duration::from_secs(30) { + driver.recv(); + driver.tick(); + + let peer_key = PublicKey::from_bytes(&seed_bytes).unwrap(); + let snap = driver.snapshot(); + let peer_hex: String = peer_key.as_bytes().iter().map(|b| format!("{:02x}", b)).collect(); + let alive = snap + .members + .iter() + .any(|m| m.node_id == peer_hex && m.state == "alive"); + if alive { + eprintln!("cluster converged — remote node is alive"); + converged = true; + break; + } + std::thread::sleep(Duration::from_millis(50)); + } + if !converged { + eprintln!("cluster did not converge within 30s"); + driver.shutdown(); + std::process::exit(1); + } + + // Wait for name resolution — the remote node registers "inference" + eprintln!("resolving name 'inference'..."); + let start = Instant::now(); + let mut bridge_addr = None; + while start.elapsed() < Duration::from_secs(30) { + driver.recv(); + driver.tick(); + + if let Some((addr, _node_id)) = driver.node().resolve_name("inference") { + eprintln!("resolved 'inference' -> {:?}", addr); + bridge_addr = Some(addr); + break; + } + std::thread::sleep(Duration::from_millis(100)); + } + let bridge_addr = bridge_addr.expect("failed to resolve 'inference' name within 30s"); + + // Create actor runtime and response inbox + let mut rt = Runtime::new(RuntimeConfig::default()); + let codecs = Arc::new(inference_codec_registry()); + let response_inbox = rt.new_inbox::().unwrap(); + let inbox_addr = *response_inbox.addr(); + + // Build transport to the remote node + let transport_to_remote = Arc::new(IrohActorTransport::new( + driver.endpoint().clone(), + seed_addr, + driver.tokio_handle(), + )); + + // Wire routes: send to bridge_addr on remote + let router = TransportRouter::new(); + router.add_route(bridge_addr, transport_to_remote); + + rt.set_codec_registry(codecs.clone()); + rt.set_transport_router(Arc::new(router)); + + // Send InferenceRequest + eprintln!("sending InferenceRequest..."); + rt.send_to( + bridge_addr, + InferenceRequest { + prompt: "Say hello".into(), + max_tokens: 32, + temperature: 0.7, + reply_to: inbox_addr, + }, + ) + .unwrap(); + + // Pump loop: drain messages, tick, check for response + let start = Instant::now(); + let timeout = Duration::from_secs(300); // generous for model download + inference + let mut got_response = false; + + while start.elapsed() < timeout { + std::thread::sleep(Duration::from_millis(100)); + + driver.recv(); + driver.tick(); + drain_actor_messages(&driver, &codecs, &rt, Duration::from_millis(100)); + rt.tick(); + + if let Some(response) = response_inbox.try_recv() { + if response.text.is_empty() { + eprintln!("received empty response (worker may not be ready), retrying..."); + continue; + } + println!("=== Inference Response ==="); + println!("{}", response.text); + println!("=========================="); + got_response = true; + break; + } + } + + if !got_response { + eprintln!("did not receive InferenceResponse within timeout"); + driver.shutdown(); + std::process::exit(1); + } + + driver.shutdown(); + eprintln!("single-gpu-inference complete"); +} + +fn run_vastai(api_key_raw: String, gpu_name: &str, image: &str) { + let api_key = api_key_raw.trim().to_string(); + // Create a tokio runtime for the async vast.ai client + let tokio_rt = tokio::runtime::Runtime::new().expect("failed to create tokio runtime"); + + // Create local iroh driver first so we know our node id + // Use RelayMode::Default for WAN NAT traversal to vast.ai instances + let mut driver = IrohDriver::new(IrohDriverConfig { + secret_key: None, + relay_mode: RelayMode::Default, + node: node_config(), + peer_auth: None, + additional_alpns: vec![ACTOR_ALPN.to_vec()], + }) + .expect("failed to create iroh driver"); + + let my_id = driver.node_id(); + let my_hex: String = my_id.0.iter().map(|b| format!("{:02x}", b)).collect(); + eprintln!("single-gpu-inference started (node id: {my_hex})"); + + let base_url = "https://cloud.vast.ai"; + let client = reqwest::Client::new(); + + // Wait for relay connection so the remote gpu-node can find us over the internet + eprintln!("waiting for relay connection..."); + let relay_url = { + let start = Instant::now(); + loop { + driver.recv(); + driver.tick(); + if let Some(url) = driver.home_relay_url() { + eprintln!("home relay: {url}"); + break Some(url.to_string()); + } + if start.elapsed() > Duration::from_secs(15) { + eprintln!("warning: no relay URL available after 15s"); + break None; + } + std::thread::sleep(Duration::from_millis(100)); + } + }; + + // Retry loop: find offer → create → wait for running → wait for convergence. + // Broken hosts (CDI errors, GFW, networking) get excluded on retry. + let max_retries = 3; + let mut excluded_offers: Vec = Vec::new(); + let mut running_contract_id = 0u64; + let mut converged = false; + + for attempt in 1..=max_retries { + // 1. Find cheapest offer (excluding previously failed ones) + eprintln!("finding {gpu_name} offer on vast.ai (attempt {attempt}/{max_retries})..."); + let offer = match tokio_rt.block_on(single_gpu_inference::vastai::find_offer( + &client, base_url, &api_key, gpu_name, &excluded_offers, + )) { + Ok(o) => o, + Err(e) => { + eprintln!("no offers available: {e}"); + driver.shutdown(); + std::process::exit(1); + } + }; + eprintln!( + "found offer {} ({}, ${:.3}/hr, geo={:?})", + offer.id, offer.gpu_name, offer.dph_total, offer.geolocation + ); + let offer_id = offer.id; + + // 2. Create instance with our node id as SEED_ADDR + eprintln!("creating instance..."); + let instance = match tokio_rt.block_on(single_gpu_inference::vastai::create_instance( + &client, base_url, &api_key, offer_id, &my_hex, + relay_url.as_deref(), image, + )) { + Ok(i) => i, + Err(e) => { + eprintln!("failed to create instance: {e}"); + excluded_offers.push(offer_id); + continue; + } + }; + let contract_id = instance.contract_id; + eprintln!("instance created (contract: {contract_id})"); + + // 3. Wait for instance to be running + eprintln!("waiting for instance to start..."); + match tokio_rt.block_on(single_gpu_inference::vastai::wait_for_running( + &client, base_url, &api_key, contract_id, + Duration::from_secs(10), 60, + )) { + Ok(r) => { + eprintln!("instance running at {}:{}", r.ip, r.port); + running_contract_id = contract_id; + } + Err(e) => { + eprintln!("instance failed to start: {e}"); + eprintln!("destroying instance and excluding offer {offer_id}..."); + let _ = tokio_rt.block_on(single_gpu_inference::vastai::destroy_instance( + &client, base_url, &api_key, contract_id, + )); + excluded_offers.push(offer_id); + continue; + } + } + + // 4. Wait for SWIM convergence (gpu-node must connect back via iroh relay) + eprintln!("waiting for cluster convergence..."); + let start = Instant::now(); + let mut last_log = Instant::now(); + while start.elapsed() < Duration::from_secs(120) { + driver.recv(); + driver.tick(); + + let snap = driver.snapshot(); + if snap.members.iter().any(|m| m.state == "alive") { + eprintln!("cluster converged"); + converged = true; + break; + } + if last_log.elapsed() >= Duration::from_secs(15) { + let elapsed = start.elapsed().as_secs(); + let members: Vec<_> = snap.members.iter() + .map(|m| format!("{}={}", &m.node_id[..8], m.state)) + .collect(); + eprintln!(" convergence: {elapsed}s elapsed, members: {members:?}"); + last_log = Instant::now(); + } + std::thread::sleep(Duration::from_millis(100)); + } + + if converged { + break; + } + + // Convergence failed — fetch logs for debugging, then destroy + eprintln!("cluster did not converge, fetching instance logs..."); + if let Ok(log_url) = tokio_rt.block_on(single_gpu_inference::vastai::request_logs( + &client, base_url, &api_key, contract_id, + )) { + if let Ok(logs) = tokio_rt.block_on(single_gpu_inference::vastai::fetch_logs(&client, &log_url)) { + eprintln!("--- instance logs (contract {contract_id}) ---"); + // Print last 40 lines to avoid flooding + let lines: Vec<&str> = logs.lines().collect(); + let start = if lines.len() > 40 { lines.len() - 40 } else { 0 }; + for line in &lines[start..] { + eprintln!(" {line}"); + } + eprintln!("--- end logs ---"); + } + } + eprintln!("destroying instance and excluding offer {offer_id}..."); + let _ = tokio_rt.block_on(single_gpu_inference::vastai::destroy_instance( + &client, base_url, &api_key, contract_id, + )); + excluded_offers.push(offer_id); + } + + if !converged { + eprintln!("all {max_retries} attempts failed (no host converged), giving up"); + driver.shutdown(); + std::process::exit(1); + } + + // Resolve "inference" name + eprintln!("resolving 'inference' name..."); + let start = Instant::now(); + let mut bridge_addr = None; + let mut remote_node_id = None; + while start.elapsed() < Duration::from_secs(60) { + driver.recv(); + driver.tick(); + if let Some((addr, node_id)) = driver.node().resolve_name("inference") { + bridge_addr = Some(addr); + remote_node_id = Some(node_id); + break; + } + std::thread::sleep(Duration::from_millis(200)); + } + let bridge_addr = bridge_addr.expect("failed to resolve 'inference' name"); + let remote_node_id = remote_node_id.unwrap(); + + // Build transport to remote + let remote_key = PublicKey::from_bytes(&remote_node_id.0).expect("invalid remote node key"); + let remote_endpoint_addr = iroh::EndpointAddr::from(remote_key); + + let mut rt = Runtime::new(RuntimeConfig::default()); + let codecs = Arc::new(inference_codec_registry()); + let response_inbox = rt.new_inbox::().unwrap(); + let inbox_addr = *response_inbox.addr(); + + let transport_to_remote = Arc::new(IrohActorTransport::new( + driver.endpoint().clone(), + remote_endpoint_addr, + driver.tokio_handle(), + )); + let router = TransportRouter::new(); + router.add_route(bridge_addr, transport_to_remote); + rt.set_codec_registry(codecs.clone()); + rt.set_transport_router(Arc::new(router)); + + // Send request + eprintln!("sending InferenceRequest..."); + rt.send_to( + bridge_addr, + InferenceRequest { + prompt: "Say hello".into(), + max_tokens: 32, + temperature: 0.7, + reply_to: inbox_addr, + }, + ) + .unwrap(); + + // Pump loop + let start = Instant::now(); + let mut last_diag = Instant::now(); + let mut got_response = false; + while start.elapsed() < Duration::from_secs(300) { + std::thread::sleep(Duration::from_millis(100)); + driver.recv(); + driver.tick(); + drain_actor_messages(&driver, &codecs, &rt, Duration::from_millis(50)); + rt.tick(); + + // Periodic SWIM health diagnostics + if last_diag.elapsed() >= Duration::from_secs(15) { + let snap = driver.snapshot(); + let members: Vec<_> = snap.members.iter() + .map(|m| format!("{}={}", &m.node_id[..8], m.state)) + .collect(); + let elapsed = start.elapsed().as_secs(); + eprintln!(" inference wait: {elapsed}s elapsed, members: {members:?}"); + last_diag = Instant::now(); + } + + if let Some(response) = response_inbox.try_recv() { + if response.text.is_empty() { + continue; + } + println!("=== Inference Response ==="); + println!("{}", response.text); + println!("=========================="); + got_response = true; + break; + } + } + + if !got_response { + eprintln!("did not receive InferenceResponse within timeout"); + // Fetch logs for debugging before destroying + eprintln!("fetching instance logs..."); + if let Ok(log_url) = tokio_rt.block_on(single_gpu_inference::vastai::request_logs( + &client, base_url, &api_key, running_contract_id, + )) { + if let Ok(logs) = tokio_rt.block_on(single_gpu_inference::vastai::fetch_logs(&client, &log_url)) { + eprintln!("--- instance logs (contract {running_contract_id}) ---"); + let lines: Vec<&str> = logs.lines().collect(); + let tail = if lines.len() > 60 { lines.len() - 60 } else { 0 }; + for line in &lines[tail..] { + eprintln!(" {line}"); + } + eprintln!("--- end logs ---"); + } + } + } + + // 5. Destroy instance + eprintln!("destroying instance..."); + let _ = tokio_rt.block_on(single_gpu_inference::vastai::destroy_instance( + &client, + base_url, + &api_key, + running_contract_id, + )); + + driver.shutdown(); + if got_response { + eprintln!("single-gpu-inference complete"); + } else { + std::process::exit(1); + } +} diff --git a/examples/single-gpu-inference/src/inference_actor.rs b/examples/single-gpu-inference/src/inference_actor.rs new file mode 100644 index 0000000..3c5799d --- /dev/null +++ b/examples/single-gpu-inference/src/inference_actor.rs @@ -0,0 +1,220 @@ +//! InferenceActor — bridges swactor messaging to a Python child process. +//! +//! Spawns a Python worker (e.g. `echo_worker.py` or `tinygrad_worker.py`) via +//! the process crate and translates `InferenceRequest` messages into stdin JSON, +//! then parses stdout JSON into `InferenceResponse` replies. + +use std::collections::VecDeque; + +use swactor::actor::{ActorAddress, ActorInterface, Ctx}; +use swactor::runtime::ExternalSender; +use swactor_process::{ + spawn_local_process, ExitStatus, ProcessCommand, ProcessNotification, ProcessSpec, +}; + +use crate::messages::{InferenceRequest, InferenceResponse}; + +// ── Messages ────────────────────────────────────────────────────────────── + +/// Union type for messages the InferenceActor can receive. +#[derive(Clone, Debug)] +pub enum InferenceActorMsg { + /// An inference request from a client. + Request(InferenceRequest), + /// A forwarded notification from the child process. + Process(ProcessNotification), +} + +/// Status notifications emitted to an optional observer address. +#[derive(Clone, Debug)] +pub enum InferenceActorStatus { + ProcessStarted, + WorkerReady { pid: Option }, + ProcessExited { status: ExitStatus }, +} + +// ── ProcessBridge ───────────────────────────────────────────────────────── + +/// Receives `ProcessNotification` from the ProcessActor and forwards it +/// wrapped as `InferenceActorMsg::Process` to the InferenceActor. +/// +/// Necessary because swactor actors have a single `Incoming` type — the +/// ProcessActor sends `ProcessNotification`, but InferenceActor expects +/// `InferenceActorMsg`. +struct ProcessBridge { + target: ActorAddress, +} + +impl ActorInterface for ProcessBridge { + type Incoming = ProcessNotification; + type Response = (); + + fn handle(&mut self, ctx: &Ctx, msg: ProcessNotification) { + let _ = ctx.send(self.target, InferenceActorMsg::Process(msg)); + } +} + +// ── RequestBridge ──────────────────────────────────────────────────────── + +/// Receives `InferenceRequest` from the network and forwards it wrapped as +/// `InferenceActorMsg::Request` to the InferenceActor. +/// +/// Necessary because the network codec delivers raw `InferenceRequest`, but +/// InferenceActor expects `InferenceActorMsg`. +pub struct RequestBridge { + pub target: ActorAddress, +} + +impl ActorInterface for RequestBridge { + type Incoming = InferenceRequest; + type Response = (); + + fn handle(&mut self, ctx: &Ctx, msg: InferenceRequest) { + let _ = ctx.send(self.target, InferenceActorMsg::Request(msg)); + } +} + +// ── InferenceActor ──────────────────────────────────────────────────────── + +pub struct InferenceActor { + spec: ProcessSpec, + sender: ExternalSender, + process_addr: Option, + bridge_addr: Option, + pending_replies: VecDeque, + ready: bool, + process_alive: bool, + worker_pid: Option, + status_addr: Option, + output_buffer: String, +} + +impl InferenceActor { + pub fn new(spec: ProcessSpec, sender: ExternalSender) -> Self { + Self { + spec, + sender, + process_addr: None, + bridge_addr: None, + pending_replies: VecDeque::new(), + ready: false, + process_alive: false, + worker_pid: None, + status_addr: None, + output_buffer: String::new(), + } + } + + /// Set an observer address that receives `InferenceActorStatus` updates. + pub fn with_status_addr(mut self, addr: ActorAddress) -> Self { + self.status_addr = Some(addr); + self + } + + fn process_output_line(&mut self, ctx: &Ctx, line: &str) { + let Ok(val) = serde_json::from_str::(line) else { + // Log non-JSON output (Python tracebacks, error messages, etc.) + if !line.is_empty() { + eprintln!("worker: {line}"); + } + return; + }; + + if val.get("status").and_then(|v| v.as_str()) == Some("ready") { + self.ready = true; + let pid = val.get("pid").and_then(|v| v.as_u64()).map(|p| p as u32); + self.worker_pid = pid; + if let Some(addr) = self.status_addr { + let _ = ctx.send(addr, InferenceActorStatus::WorkerReady { pid }); + } + } else if let Some(response) = val.get("response").and_then(|v| v.as_str()) { + if let Some(reply_to) = self.pending_replies.pop_front() { + let _ = ctx.send(reply_to, InferenceResponse { text: response.to_string() }); + } + } else if let Some(err) = val.get("error").and_then(|v| v.as_str()) { + eprintln!("worker error: {err}"); + } + } +} + +impl ActorInterface for InferenceActor { + type Incoming = InferenceActorMsg; + type Response = (); + + fn on_start(&mut self, ctx: &Ctx) { + let proc_addr = spawn_local_process(ctx, &self.sender, self.spec.clone()) + .expect("failed to spawn worker process"); + + let bridge = ProcessBridge { target: ctx.self_addr() }; + let bridge_addr = ctx.spawn(bridge).expect("failed to spawn process bridge"); + + let _ = ctx.send(proc_addr, ProcessCommand::Subscribe { address: bridge_addr }); + + self.process_addr = Some(proc_addr); + self.bridge_addr = Some(bridge_addr); + } + + fn handle(&mut self, ctx: &Ctx, msg: InferenceActorMsg) { + match msg { + InferenceActorMsg::Request(req) => { + if !self.ready || !self.process_alive { + let _ = ctx.send(req.reply_to, InferenceResponse { text: String::new() }); + return; + } + self.pending_replies.push_back(req.reply_to); + let json = serde_json::json!({ + "prompt": req.prompt, + "max_tokens": req.max_tokens, + "temperature": req.temperature, + }); + let mut data = serde_json::to_vec(&json).unwrap(); + data.push(b'\n'); + if let Some(proc_addr) = self.process_addr { + let _ = ctx.send(proc_addr, ProcessCommand::WriteStdin { data }); + } + } + InferenceActorMsg::Process(notif) => match notif { + ProcessNotification::Started { .. } => { + self.process_alive = true; + if let Some(addr) = self.status_addr { + let _ = ctx.send(addr, InferenceActorStatus::ProcessStarted); + } + } + ProcessNotification::Output { data, .. } => { + let text = String::from_utf8_lossy(&data); + self.output_buffer.push_str(&text); + while let Some(pos) = self.output_buffer.find('\n') { + let line = self.output_buffer[..pos].to_string(); + self.output_buffer = self.output_buffer[pos + 1..].to_string(); + self.process_output_line(ctx, line.trim()); + } + } + ProcessNotification::Exited { status, .. } => { + self.process_alive = false; + self.ready = false; + // Drain pending requests with empty responses + for reply_to in self.pending_replies.drain(..) { + let _ = ctx.send(reply_to, InferenceResponse { text: String::new() }); + } + if let Some(addr) = self.status_addr { + let _ = ctx.send(addr, InferenceActorStatus::ProcessExited { status }); + } + } + ProcessNotification::Error { .. } => { + self.process_alive = false; + self.ready = false; + } + }, + } + } + + fn on_stop(&mut self, ctx: &Ctx) { + if let Some(proc_addr) = self.process_addr { + let _ = ctx.send(proc_addr, ProcessCommand::Close); + let _ = ctx.stop_actor(proc_addr); + } + if let Some(bridge_addr) = self.bridge_addr { + let _ = ctx.stop_actor(bridge_addr); + } + } +} diff --git a/examples/single-gpu-inference/src/iroh_transport.rs b/examples/single-gpu-inference/src/iroh_transport.rs new file mode 100644 index 0000000..c40197f --- /dev/null +++ b/examples/single-gpu-inference/src/iroh_transport.rs @@ -0,0 +1,161 @@ +//! Shared iroh transport infrastructure for actor-level QUIC messaging. +//! +//! Provides `IrohActorTransport` (sends `WireEnvelope`s over iroh QUIC +//! uni-directional streams), wire encoding/decoding, and a drain helper +//! that feeds incoming messages into a swactor `Runtime`. + +use std::time::Duration; + +use distribution::iroh_driver::IrohDriver; +use swactor::actor::ActorAddress; +use swactor::runtime::Runtime; +use swactor::transport::{CodecRegistry, Transport, WireEnvelope}; +use swactor::Error; + +/// ALPN protocol for actor-level messages (distinct from SWIM protocol). +pub const ACTOR_ALPN: &[u8] = b"swactor/actor/1"; + +/// Sends WireEnvelopes over iroh QUIC uni-directional streams. +/// +/// Caches the QUIC connection so it stays alive between sends — dropping +/// a connection before the receiver reads its streams causes "closed by +/// peer" errors. +/// +/// Wire format: [32B dest_addr][4B tag_len BE][tag bytes][payload bytes] +pub struct IrohActorTransport { + endpoint: iroh::Endpoint, + target_addr: iroh::EndpointAddr, + handle: tokio::runtime::Handle, + conn: std::sync::Mutex>, +} + +impl IrohActorTransport { + pub fn new( + endpoint: iroh::Endpoint, + target_addr: iroh::EndpointAddr, + handle: tokio::runtime::Handle, + ) -> Self { + Self { + endpoint, + target_addr, + handle, + conn: std::sync::Mutex::new(None), + } + } +} + +impl Transport for IrohActorTransport { + fn send(&self, envelope: WireEnvelope) -> Result<(), Error> { + let data = encode_wire(&envelope); + let ep = self.endpoint.clone(); + let target = self.target_addr.clone(); + let cached = self.conn.lock().unwrap().clone(); + + let conn = self.handle.block_on(async move { + if let Some(c) = cached { + if c.close_reason().is_none() { + return Ok(c); + } + } + ep.connect(target, ACTOR_ALPN) + .await + .map_err(|e| Error::from(format!("iroh connect: {e}"))) + })?; + + *self.conn.lock().unwrap() = Some(conn.clone()); + + self.handle.block_on(async move { + let mut stream = conn + .open_uni() + .await + .map_err(|e| Error::from(format!("iroh open_uni: {e}")))?; + stream + .write_all(&data) + .await + .map_err(|e| Error::from(format!("iroh write: {e}")))?; + stream + .finish() + .map_err(|e| Error::from(format!("iroh finish: {e}")))?; + Ok(()) + }) + } +} + +pub fn encode_wire(env: &WireEnvelope) -> Vec { + let tag = env.type_tag.as_bytes(); + let mut buf = Vec::with_capacity(32 + 4 + tag.len() + env.payload.len()); + buf.extend_from_slice(&env.dest.0); + buf.extend_from_slice(&(tag.len() as u32).to_be_bytes()); + buf.extend_from_slice(tag); + buf.extend_from_slice(&env.payload); + buf +} + +pub fn decode_wire(data: &[u8]) -> Option { + if data.len() < 36 { + return None; + } + let mut addr = [0u8; 32]; + addr.copy_from_slice(&data[..32]); + let tag_len = u32::from_be_bytes(data[32..36].try_into().ok()?) as usize; + if data.len() < 36 + tag_len { + return None; + } + let type_tag = String::from_utf8(data[36..36 + tag_len].to_vec()).ok()?; + let payload = data[36 + tag_len..].to_vec(); + Some(WireEnvelope { + dest: ActorAddress(addr), + type_tag, + payload, + }) +} + +/// Drain actor messages arriving via iroh into a swactor runtime. +/// +/// Spawns tokio tasks (on the driver's runtime) to read uni-directional +/// streams from pending actor-ALPN connections. Results are collected +/// via a channel and delivered to the swactor runtime. +/// +/// `drain_sleep` controls how long to wait for spawned tasks to read +/// streams before collecting results. Use shorter durations (e.g. 100ms) +/// for localhost tests, longer (e.g. 500ms) for cross-node scenarios. +pub fn drain_actor_messages( + driver: &IrohDriver, + codecs: &CodecRegistry, + rt: &Runtime, + drain_sleep: Duration, +) { + let conns = driver.drain_other_connections(); + if conns.is_empty() { + return; + } + let handle = driver.tokio_handle(); + let (tx, rx) = std::sync::mpsc::channel::>(); + + for (_node_id, conn) in conns { + let tx = tx.clone(); + handle.spawn(async move { + loop { + match tokio::time::timeout(Duration::from_secs(1), conn.accept_uni()).await { + Ok(Ok(mut recv)) => { + if let Ok(data) = recv.read_to_end(256 * 1024).await { + let _ = tx.send(data); + } + } + _ => break, + } + } + }); + } + drop(tx); + + std::thread::sleep(drain_sleep); + + for data in rx.try_iter() { + if let Some(envelope) = decode_wire(&data) { + if let Ok((addr, msg)) = codecs.receive(envelope) { + let _ = rt.deliver_raw(addr, msg); + } + } + } +} diff --git a/examples/single-gpu-inference/src/lib.rs b/examples/single-gpu-inference/src/lib.rs new file mode 100644 index 0000000..4315e61 --- /dev/null +++ b/examples/single-gpu-inference/src/lib.rs @@ -0,0 +1,4 @@ +pub mod inference_actor; +pub mod iroh_transport; +pub mod messages; +pub mod vastai; diff --git a/examples/single-gpu-inference/src/messages.rs b/examples/single-gpu-inference/src/messages.rs new file mode 100644 index 0000000..a3371b4 --- /dev/null +++ b/examples/single-gpu-inference/src/messages.rs @@ -0,0 +1,67 @@ +//! Inference message types, codec, and registry for the smoke test. + +use serde::{Deserialize, Serialize}; +use swactor::actor::ActorAddress; +use swactor::transport::{Codec, CodecRegistry, NetworkMessage}; +use swactor::Error; + +// ─── Message Types ───────────────────────────────────────────────────────── + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct InferenceRequest { + pub prompt: String, + pub max_tokens: u32, + pub temperature: f32, + pub reply_to: ActorAddress, +} + +impl NetworkMessage for InferenceRequest { + fn type_tag() -> &'static str { + "smoke::InferenceRequest" + } +} + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct InferenceResponse { + pub text: String, +} + +impl NetworkMessage for InferenceResponse { + fn type_tag() -> &'static str { + "smoke::InferenceResponse" + } +} + +// ─── JSON Codec ──────────────────────────────────────────────────────────── + +pub struct InferenceCodec; + +impl Codec for InferenceCodec { + fn encode(&self, msg: &InferenceRequest) -> Result, Error> { + serde_json::to_vec(msg).map_err(|e| Error::from(format!("encode InferenceRequest: {e}"))) + } + fn decode(&self, bytes: &[u8]) -> Result { + serde_json::from_slice(bytes) + .map_err(|e| Error::from(format!("decode InferenceRequest: {e}"))) + } +} + +impl Codec for InferenceCodec { + fn encode(&self, msg: &InferenceResponse) -> Result, Error> { + serde_json::to_vec(msg).map_err(|e| Error::from(format!("encode InferenceResponse: {e}"))) + } + fn decode(&self, bytes: &[u8]) -> Result { + serde_json::from_slice(bytes) + .map_err(|e| Error::from(format!("decode InferenceResponse: {e}"))) + } +} + +// ─── Registry ────────────────────────────────────────────────────────────── + +/// Build a `CodecRegistry` with inference message types registered. +pub fn inference_codec_registry() -> CodecRegistry { + let mut cr = CodecRegistry::new(); + cr.register::(InferenceCodec); + cr.register::(InferenceCodec); + cr +} diff --git a/examples/single-gpu-inference/src/vastai.rs b/examples/single-gpu-inference/src/vastai.rs new file mode 100644 index 0000000..5bc345d --- /dev/null +++ b/examples/single-gpu-inference/src/vastai.rs @@ -0,0 +1,292 @@ +//! vast.ai REST API client for the smoke test orchestrator. +//! +//! Functions: find_offer, create_instance, wait_for_running, destroy_instance. +//! All functions accept a `base_url` parameter so tests can point at a mock server. + +use reqwest::Client; +use serde::Deserialize; +use std::time::Duration; + +#[derive(Debug, Clone, Deserialize)] +pub struct Offer { + pub id: u64, + pub gpu_name: String, + pub dph_total: f64, + #[serde(default)] + pub geolocation: Option, +} + +#[derive(Debug, Clone)] +pub struct InstanceInfo { + pub contract_id: u64, +} + +#[derive(Debug, Clone)] +pub struct RunningInstance { + pub ip: String, + pub port: u16, +} + +#[derive(Debug, Deserialize)] +struct SearchResponse { + offers: Vec, +} + +#[derive(Debug, Deserialize)] +struct CreateResponse { + new_contract: u64, +} + +#[derive(Debug, Deserialize)] +struct InstanceResponse { + instances: InstanceStatus, +} + +#[derive(Debug, Deserialize)] +struct InstanceStatus { + actual_status: Option, + intended_status: Option, + #[serde(default)] + status_msg: Option, + #[serde(default)] + public_ipaddr: Option, + #[serde(default)] + ssh_port: Option, +} + +/// Find the cheapest offer matching a GPU type, excluding specific offer IDs. +pub async fn find_offer( + client: &Client, + base_url: &str, + api_key: &str, + gpu_name: &str, + exclude_ids: &[u64], +) -> Result { + let query = serde_json::json!({ + "gpu_name": {"eq": gpu_name}, + "rentable": {"eq": true}, + "rented": {"eq": false}, + "reliability2": {"gte": 0.99}, + "cuda_max_good": {"gte": 12.0}, + "verified": {"eq": true}, + "direct_port_count": {"gte": 1}, + "inet_down": {"gte": 100.0}, + }); + let url = format!( + "{base_url}/api/v0/bundles/?q={}", + urlencoding::encode(&query.to_string()) + ); + let resp = client + .get(&url) + .header("Authorization", format!("Bearer {api_key}")) + .send() + .await + .map_err(|e| format!("find_offer request failed: {e}"))?; + + if !resp.status().is_success() { + let status = resp.status(); + let body = resp.text().await.unwrap_or_default(); + return Err(format!("find_offer HTTP {status}: {body}")); + } + + let body: SearchResponse = resp + .json() + .await + .map_err(|e| format!("find_offer parse failed: {e}"))?; + + // Filter out hosts with unknown or Chinese geolocation — Docker Hub + // and iroh relays are unreachable from behind the Great Firewall. + let filtered: Vec = body + .offers + .into_iter() + .filter(|o| { + o.geolocation + .as_deref() + .map_or(false, |g| !g.to_uppercase().contains("CN")) + }) + .collect(); + + let candidates: Vec = filtered + .into_iter() + .filter(|o| !exclude_ids.contains(&o.id)) + .collect(); + + candidates + .into_iter() + .min_by(|a, b| a.dph_total.partial_cmp(&b.dph_total).unwrap()) + .ok_or_else(|| "no offers available (after geo/exclusion filter)".to_string()) +} + +/// Create a vast.ai instance from an offer, passing SEED_ADDR and SEED_RELAY in the env. +pub async fn create_instance( + client: &Client, + base_url: &str, + api_key: &str, + offer_id: u64, + seed_addr: &str, + seed_relay: Option<&str>, + image: &str, +) -> Result { + let url = format!("{base_url}/api/v0/asks/{offer_id}/"); + let mut env = serde_json::json!({ "SEED_ADDR": seed_addr }); + if let Some(relay) = seed_relay { + env["SEED_RELAY"] = serde_json::Value::String(relay.to_string()); + } + let body = serde_json::json!({ + "image": image, + "env": env, + "onstart": "exec /usr/local/bin/gpu-node 2>&1", + "disk": 20, + }); + + let resp = client + .put(&url) + .header("Authorization", format!("Bearer {api_key}")) + .json(&body) + .send() + .await + .map_err(|e| format!("create_instance request failed: {e}"))?; + + if !resp.status().is_success() { + let status = resp.status(); + let body = resp.text().await.unwrap_or_default(); + return Err(format!("create_instance HTTP {status}: {body}")); + } + + let parsed: CreateResponse = resp + .json() + .await + .map_err(|e| format!("create_instance parse failed: {e}"))?; + + Ok(InstanceInfo { + contract_id: parsed.new_contract, + }) +} + +/// Poll vast.ai until the instance reaches `running`, then extract IP + port. +/// Returns error immediately on terminal statuses like `exited`. +pub async fn wait_for_running( + client: &Client, + base_url: &str, + api_key: &str, + contract_id: u64, + poll_interval: Duration, + max_polls: u32, +) -> Result { + let url = format!("{base_url}/api/v0/instances/{contract_id}/"); + + for poll in 0..max_polls { + let resp = client + .get(&url) + .header("Authorization", format!("Bearer {api_key}")) + .send() + .await + .map_err(|e| format!("wait_for_running request failed: {e}"))?; + + if !resp.status().is_success() { + let status = resp.status(); + let body = resp.text().await.unwrap_or_default(); + return Err(format!("wait_for_running HTTP {status}: {body}")); + } + + let wrapper: InstanceResponse = resp + .json() + .await + .map_err(|e| format!("wait_for_running parse failed: {e}"))?; + let status = wrapper.instances; + + let actual = status.actual_status.as_deref().unwrap_or("unknown"); + let intended = status.intended_status.as_deref().unwrap_or("unknown"); + eprintln!(" poll {}/{}: status={actual}", poll + 1, max_polls); + + // Check for error in status_msg (host-side failures like OCI errors) + if let Some(msg) = &status.status_msg { + if msg.contains("Error") || msg.contains("failed") { + return Err(format!("instance error: {msg}")); + } + } + + // Check if intended_status has gone to stopped (instance gave up) + if intended == "stopped" && actual != "running" { + let msg = status.status_msg.unwrap_or_default(); + return Err(format!("instance stopped: {msg}")); + } + + match actual { + "running" => { + let ip = status + .public_ipaddr + .unwrap_or_else(|| "unknown".to_string()); + let port = status.ssh_port.unwrap_or(0); + return Ok(RunningInstance { ip, port }); + } + "exited" | "error" => { + return Err(format!("instance reached terminal status: {actual}")); + } + _ => { + tokio::time::sleep(poll_interval).await; + } + } + } + + Err("instance did not reach running within poll limit".to_string()) +} + +/// Request instance logs and return the download URL. +/// Logs take a few seconds to become available after this call. +pub async fn request_logs( + client: &Client, + base_url: &str, + api_key: &str, + contract_id: u64, +) -> Result { + let url = format!("{base_url}/api/v0/instances/request_logs/{contract_id}/"); + let resp = client + .put(&url) + .header("Authorization", format!("Bearer {api_key}")) + .send() + .await + .map_err(|e| format!("request_logs failed: {e}"))?; + + let body: serde_json::Value = resp + .json() + .await + .map_err(|e| format!("request_logs parse failed: {e}"))?; + + body["result_url"] + .as_str() + .map(|s| s.to_string()) + .ok_or_else(|| "no result_url in log response".to_string()) +} + +/// Fetch instance logs from S3 URL. Returns the log text. +pub async fn fetch_logs(client: &Client, log_url: &str) -> Result { + // Wait for the log to become available + tokio::time::sleep(std::time::Duration::from_secs(5)).await; + let resp = client + .get(log_url) + .send() + .await + .map_err(|e| format!("fetch_logs failed: {e}"))?; + resp.text() + .await + .map_err(|e| format!("fetch_logs read failed: {e}")) +} + +/// Destroy a vast.ai instance. +pub async fn destroy_instance( + client: &Client, + base_url: &str, + api_key: &str, + contract_id: u64, +) -> Result<(), String> { + let url = format!("{base_url}/api/v0/instances/{contract_id}/"); + client + .delete(&url) + .header("Authorization", format!("Bearer {api_key}")) + .send() + .await + .map_err(|e| format!("destroy_instance request failed: {e}"))?; + + Ok(()) +} diff --git a/examples/single-gpu-inference/tests/t_actor.rs b/examples/single-gpu-inference/tests/t_actor.rs new file mode 100644 index 0000000..68156a5 --- /dev/null +++ b/examples/single-gpu-inference/tests/t_actor.rs @@ -0,0 +1,215 @@ +//! T-actor: InferenceActor + process bridge component tests. +//! +//! Spawns the InferenceActor on a single swactor runtime with `echo_worker.py` +//! as the child process. No networking, no GPU. + +use std::collections::HashMap; +use std::time::{Duration, Instant}; + +use swactor::actor::ActorAddress; +use swactor::runtime::{Inbox, Runtime, RuntimeConfig}; + +use single_gpu_inference::inference_actor::{InferenceActor, InferenceActorMsg, InferenceActorStatus}; +use single_gpu_inference::messages::{InferenceRequest, InferenceResponse}; +use swactor_process::{ExitStatus, ProcessMode, ProcessSpec}; + +// ── Helpers ─────────────────────────────────────────────────────────────── + +fn echo_worker_spec() -> ProcessSpec { + ProcessSpec { + command: "python3".into(), + args: vec![format!("{}/echo_worker.py", env!("CARGO_MANIFEST_DIR"))], + env: HashMap::new(), + working_dir: None, + mode: ProcessMode::Automated, + initial_pty_size: None, + kill_timeout: Some(Duration::from_secs(2)), + stdin_buffer_limit: None, + } +} + +/// Tick the runtime in a polling loop until the inbox has a message or timeout. +fn tick_until_recv( + rt: &Runtime, + inbox: &Inbox, + timeout: Duration, +) -> Option { + let start = Instant::now(); + while start.elapsed() < timeout { + rt.tick(); + if let Some(msg) = inbox.try_recv() { + return Some(msg); + } + std::thread::sleep(Duration::from_millis(5)); + } + None +} + +/// Spin up an InferenceActor and wait until it reports WorkerReady. +/// Returns (actor address, worker PID). +fn spawn_and_wait_ready( + rt: &Runtime, + status_inbox: &Inbox, +) -> (ActorAddress, u32) { + let sender = rt.create_sender(); + let actor = InferenceActor::new(echo_worker_spec(), sender) + .with_status_addr(*status_inbox.addr()); + let addr = rt.spawn(actor).unwrap(); + + let timeout = Duration::from_secs(5); + let mut got_started = false; + let mut worker_pid = None; + + let start = Instant::now(); + while start.elapsed() < timeout { + if let Some(status) = tick_until_recv(rt, status_inbox, Duration::from_millis(100)) { + match status { + InferenceActorStatus::ProcessStarted => got_started = true, + InferenceActorStatus::WorkerReady { pid } => { + assert!(got_started, "WorkerReady should come after ProcessStarted"); + worker_pid = pid; + break; + } + other => panic!("unexpected status during startup: {:?}", other), + } + } + } + + let pid = worker_pid.expect("worker should report PID within timeout"); + (addr, pid) +} + +fn is_process_alive(pid: u32) -> bool { + std::fs::metadata(format!("/proc/{}", pid)).is_ok() +} + +// ── Tests ───────────────────────────────────────────────────────────────── + +#[test] +fn actor_spawns_process_and_receives_started() { + let rt = Runtime::new(RuntimeConfig::default()); + let status_inbox = rt.new_inbox::().unwrap(); + + let (_addr, pid) = spawn_and_wait_ready(&rt, &status_inbox); + + // The process should be alive + assert!(is_process_alive(pid), "worker process should be running"); +} + +#[test] +fn inference_request_flows_through_process_and_reply_arrives() { + let rt = Runtime::new(RuntimeConfig::default()); + let status_inbox = rt.new_inbox::().unwrap(); + let response_inbox = rt.new_inbox::().unwrap(); + + let (addr, _pid) = spawn_and_wait_ready(&rt, &status_inbox); + + // Send an inference request + rt.send_to( + addr, + InferenceActorMsg::Request(InferenceRequest { + prompt: "Hello, world!".into(), + max_tokens: 8, + temperature: 0.7, + reply_to: *response_inbox.addr(), + }), + ) + .unwrap(); + + let response = tick_until_recv(&rt, &response_inbox, Duration::from_secs(5)) + .expect("should receive InferenceResponse"); + + assert!( + response.text.contains("Hello, world!"), + "echo worker should reflect the prompt, got: {:?}", + response.text + ); +} + +#[test] +fn worker_crash_is_handled_without_poisoning_runtime() { + let rt = Runtime::new(RuntimeConfig::default()); + let status_inbox = rt.new_inbox::().unwrap(); + let response_inbox = rt.new_inbox::().unwrap(); + + let (addr, _pid) = spawn_and_wait_ready(&rt, &status_inbox); + + // Send a request whose prompt triggers an os._exit(1) in the worker + rt.send_to( + addr, + InferenceActorMsg::Request(InferenceRequest { + prompt: "__crash__".into(), + max_tokens: 1, + temperature: 0.0, + reply_to: *response_inbox.addr(), + }), + ) + .unwrap(); + + // The actor should report ProcessExited + let status = tick_until_recv(&rt, &status_inbox, Duration::from_secs(5)) + .expect("should receive ProcessExited status"); + match status { + InferenceActorStatus::ProcessExited { status } => { + assert_ne!( + status, + ExitStatus::Code(0), + "crashed worker should not exit 0" + ); + } + other => panic!("expected ProcessExited, got: {:?}", other), + } + + // Prove the runtime is still alive: spawn a trivial actor and interact with it + #[derive(Clone)] + struct Ping { + reply_to: ActorAddress, + } + #[derive(Clone, Debug, PartialEq)] + struct Pong; + + struct PongActor; + impl swactor::actor::ActorInterface for PongActor { + type Incoming = Ping; + type Response = Pong; + fn handle(&mut self, ctx: &swactor::runtime::Ctx, msg: Ping) { + let _ = ctx.send(msg.reply_to, Pong); + } + } + + let pong_inbox = rt.new_inbox::().unwrap(); + let pong_addr = rt.spawn(PongActor).unwrap(); + rt.send_to(pong_addr, Ping { reply_to: *pong_inbox.addr() }).unwrap(); + + let pong = tick_until_recv(&rt, &pong_inbox, Duration::from_secs(2)); + assert_eq!(pong, Some(Pong), "runtime should still be functional after worker crash"); +} + +#[test] +fn stopping_actor_kills_child_process() { + let rt = Runtime::new(RuntimeConfig::default()); + let status_inbox = rt.new_inbox::().unwrap(); + + let (addr, pid) = spawn_and_wait_ready(&rt, &status_inbox); + assert!(is_process_alive(pid), "worker should be alive before stop"); + + // Stop the InferenceActor + rt.stop_actor(addr).unwrap(); + + // Tick until the child process is gone + let start = Instant::now(); + let timeout = Duration::from_secs(5); + while start.elapsed() < timeout { + rt.tick(); + std::thread::sleep(Duration::from_millis(10)); + if !is_process_alive(pid) { + break; + } + } + + assert!( + !is_process_alive(pid), + "worker process (pid {}) should be dead after actor stop", + pid + ); +} diff --git a/examples/single-gpu-inference/tests/t_binary.rs b/examples/single-gpu-inference/tests/t_binary.rs new file mode 100644 index 0000000..e277b58 --- /dev/null +++ b/examples/single-gpu-inference/tests/t_binary.rs @@ -0,0 +1,164 @@ +//! Binary integration test — validates gpu-node and smoke-run work end-to-end. +//! +//! Spawns both binaries as child processes on localhost. gpu-node runs an +//! InferenceActor backed by a Python worker; smoke-run connects, sends an +//! InferenceRequest through the distributed pipeline, and receives the response. +//! +//! This proves the binaries work through actual process boundaries — the same +//! code path used in production, unlike the in-process tests in t_integration.rs. +//! +//! - `binary_e2e_echo_worker` — fast, uses echo_worker.py (canned echo responses). +//! - `binary_e2e_tinygrad` — slow (#[ignore]), uses real tinygrad inference. + +use std::io::{BufRead, BufReader}; +use std::process::{Child, Command, Stdio}; +use std::time::Duration; + +/// Parse the GPU_NODE_ADDR line from gpu-node's stderr. +/// Format: `GPU_NODE_ADDR ` +fn parse_gpu_node_addr(line: &str) -> Option<(String, String)> { + let line = line.trim(); + if !line.starts_with("GPU_NODE_ADDR ") { + return None; + } + let parts: Vec<&str> = line.splitn(3, ' ').collect(); + if parts.len() < 3 { + return None; + } + Some((parts[1].to_string(), parts[2].to_string())) +} + +/// Start gpu-node, wait for it to print its address, run smoke-run, verify response. +fn run_binary_e2e(worker_cmd: &str, worker_script: &str, extra_env: Vec<(&str, &str)>) { + let gpu_node_bin = env!("CARGO_BIN_EXE_gpu-node"); + let smoke_run_bin = env!("CARGO_BIN_EXE_single-gpu-inference"); + + // 1. Start gpu-node without SEED_ADDR (it just listens for connections) + let mut cmd = Command::new(gpu_node_bin); + cmd.env("WORKER_CMD", worker_cmd) + .env("WORKER_SCRIPT", worker_script) + .env_remove("SEED_ADDR") + .stderr(Stdio::piped()); + for (k, v) in &extra_env { + cmd.env(k, v); + } + let mut gpu_node = cmd.spawn().expect("failed to spawn gpu-node"); + + // 2. Read gpu-node stderr in a background thread to find its address + // and keep draining so the pipe buffer doesn't fill up. + let gpu_stderr = gpu_node.stderr.take().unwrap(); + let (addr_tx, addr_rx) = std::sync::mpsc::channel::<(String, String)>(); + let stderr_thread = std::thread::spawn(move || { + let reader = BufReader::new(gpu_stderr); + let mut sent = false; + for line in reader.lines().flatten() { + eprintln!("[gpu-node] {}", line); + if !sent { + if let Some(addr_info) = parse_gpu_node_addr(&line) { + let _ = addr_tx.send(addr_info); + sent = true; + } + } + } + }); + + // 3. Wait for gpu-node to print its address + let (node_id, direct_addrs) = addr_rx + .recv_timeout(Duration::from_secs(30)) + .expect("gpu-node did not print GPU_NODE_ADDR within 30s"); + eprintln!("gpu-node ready: node_id={node_id}, direct={direct_addrs}"); + + // 4. Spawn smoke-run pointing at gpu-node + let mut smoke_run = Command::new(smoke_run_bin) + .arg("--seed") + .arg(&node_id) + .arg("--seed-direct") + .arg(&direct_addrs) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .expect("failed to spawn smoke-run"); + + // 5. Wait for smoke-run with timeout (poll every 200ms, bail after 120s) + let start = std::time::Instant::now(); + let timeout = Duration::from_secs(120); + loop { + match smoke_run.try_wait() { + Ok(Some(_)) => break, + Ok(None) => { + if start.elapsed() > timeout { + let _ = smoke_run.kill(); + let _ = smoke_run.wait(); + cleanup(&mut gpu_node, stderr_thread); + panic!("smoke-run did not exit within {timeout:?}"); + } + std::thread::sleep(Duration::from_millis(200)); + } + Err(e) => { + cleanup(&mut gpu_node, stderr_thread); + panic!("error waiting for smoke-run: {e}"); + } + } + } + let output = smoke_run.wait_with_output().expect("failed to read smoke-run output"); + + let stdout = String::from_utf8_lossy(&output.stdout); + let stderr_out = String::from_utf8_lossy(&output.stderr); + eprintln!("=== smoke-run stderr ===\n{stderr_out}"); + eprintln!("=== smoke-run stdout ===\n{stdout}"); + + // 6. Clean up gpu-node + cleanup(&mut gpu_node, stderr_thread); + + // 7. Verify + assert!( + output.status.success(), + "smoke-run exited with {:?}", + output.status + ); + assert!( + stdout.contains("=== Inference Response ==="), + "stdout should contain response header" + ); + + // Extract and verify the response text + let response_text: String = stdout + .lines() + .skip_while(|l| *l != "=== Inference Response ===") + .skip(1) // skip the header itself + .take_while(|l| *l != "==========================") + .collect::>() + .join("\n"); + assert!( + !response_text.is_empty(), + "response text between markers should be non-empty" + ); + eprintln!("response: {response_text:?}"); +} + +fn cleanup(gpu_node: &mut Child, stderr_thread: std::thread::JoinHandle<()>) { + let _ = gpu_node.kill(); + let _ = gpu_node.wait(); + let _ = stderr_thread.join(); +} + +#[test] +fn binary_e2e_echo_worker() { + let manifest_dir = env!("CARGO_MANIFEST_DIR"); + let script = format!("{manifest_dir}/echo_worker.py"); + run_binary_e2e("python3", &script, vec![]); +} + +/// Full binary e2e with real tinygrad inference (~1B GGUF model). +/// +/// Requires `.venv` with tinygrad installed and downloads a large model. +/// Run explicitly with: +/// cargo test --package smoke-test binary_e2e_tinygrad -- --ignored +#[test] +#[ignore] +fn binary_e2e_tinygrad() { + let manifest_dir = env!("CARGO_MANIFEST_DIR"); + let python = format!("{manifest_dir}/.venv/bin/python"); + let script = format!("{manifest_dir}/tinygrad_worker.py"); + run_binary_e2e(&python, &script, vec![]); +} diff --git a/examples/single-gpu-inference/tests/t_cluster.rs b/examples/single-gpu-inference/tests/t_cluster.rs new file mode 100644 index 0000000..e6a89ec --- /dev/null +++ b/examples/single-gpu-inference/tests/t_cluster.rs @@ -0,0 +1,270 @@ +//! T-cluster: Cross-node messaging component tests. +//! +//! Two swactor nodes on localhost via iroh. Tests SWIM convergence, +//! actor-level InferenceRequest/InferenceResponse exchange, and +//! SWIM death detection after node shutdown. + +use std::sync::Arc; +use std::time::{Duration, Instant}; + +use distribution::iroh_driver::{IrohDriver, IrohDriverConfig}; +use distribution::node::DistributedNodeConfig; +use distribution::registry::RegistryConfig; +use distribution::swim::probe::SwimConfig; +use iroh::{PublicKey, RelayMode}; + +use swactor::actor::ActorInterface; +use swactor::runtime::{Ctx, Runtime, RuntimeConfig}; +use swactor::transport::TransportRouter; + +use single_gpu_inference::iroh_transport::{drain_actor_messages, IrohActorTransport, ACTOR_ALPN}; +use single_gpu_inference::messages::{inference_codec_registry, InferenceRequest, InferenceResponse}; + +// ── Test SWIM config ───────────────────────────────────────────────────── + +fn test_node_config() -> DistributedNodeConfig { + DistributedNodeConfig { + swim: SwimConfig { + probe_interval: 1, + probe_timeout: 3, + indirect_probes: 1, + suspicion_timeout: 5, + dead_reprobe_interval: 0, + ..SwimConfig::default() + }, + cache_capacity: 100, + republish_interval: 50, + registry: RegistryConfig::default(), + metadata_lambda: 3, + } +} + +fn make_driver() -> IrohDriver { + IrohDriver::new(IrohDriverConfig { + secret_key: None, + relay_mode: RelayMode::Disabled, + node: test_node_config(), + peer_auth: None, + additional_alpns: vec![ACTOR_ALPN.to_vec()], + }) + .expect("failed to create iroh driver") +} + +// ── Pump helpers ───────────────────────────────────────────────────────── + +fn pump_one(driver: &mut IrohDriver) { + driver.recv(); + driver.tick(); +} + +fn pump_until_pair( + a: &mut IrohDriver, + b: &mut IrohDriver, + timeout: Duration, + check_fn: fn(&IrohDriver, &IrohDriver) -> bool, +) -> bool { + let start = Instant::now(); + while start.elapsed() < timeout { + pump_one(a); + pump_one(b); + if check_fn(a, b) { + return true; + } + std::thread::sleep(Duration::from_millis(10)); + } + false +} + +fn sees_alive(driver: &IrohDriver, peer_key: &PublicKey) -> bool { + let snap = driver.snapshot(); + let peer_hex: String = peer_key + .as_bytes() + .iter() + .map(|b| format!("{:02x}", b)) + .collect(); + snap.members + .iter() + .any(|m| m.node_id == peer_hex && m.state == "alive") +} + +fn both_alive(a: &IrohDriver, b: &IrohDriver) -> bool { + let a_key = PublicKey::from_bytes(&a.node_id().0).unwrap(); + let b_key = PublicKey::from_bytes(&b.node_id().0).unwrap(); + sees_alive(a, &b_key) && sees_alive(b, &a_key) +} + +/// Create two IrohDrivers and converge them via seed join. +fn make_converged_pair() -> (IrohDriver, IrohDriver) { + let mut driver_a = make_driver(); + let mut driver_b = make_driver(); + + let a_addr = driver_a.endpoint_addr(); + driver_b.join(&[a_addr]); + + let converged = pump_until_pair( + &mut driver_a, + &mut driver_b, + Duration::from_secs(5), + both_alive, + ); + assert!(converged, "cluster setup: nodes did not converge within 5s"); + + (driver_a, driver_b) +} + +// ── Echo actor (replies InferenceResponse for any InferenceRequest) ───── + +struct EchoInferenceActor; + +impl ActorInterface for EchoInferenceActor { + type Incoming = InferenceRequest; + type Response = InferenceResponse; + + fn handle(&mut self, ctx: &Ctx, msg: InferenceRequest) { + let _ = ctx.send( + msg.reply_to, + InferenceResponse { + text: format!("echo: {}", msg.prompt), + }, + ); + } +} + +// ── Tests ──────────────────────────────────────────────────────────────── + +/// Node B joins node A via seed address. SWIM converges — both nodes see +/// each other alive within 5 seconds. +#[test] +fn cluster_converges_via_iroh_seed_join() { + let mut driver_a = make_driver(); + let mut driver_b = make_driver(); + + let a_addr = driver_a.endpoint_addr(); + driver_b.join(&[a_addr]); + + let converged = pump_until_pair( + &mut driver_a, + &mut driver_b, + Duration::from_secs(5), + both_alive, + ); + + assert!(converged, "nodes did not converge within 5s"); + assert_eq!(driver_a.snapshot().alive_count, 1); + assert_eq!(driver_b.snapshot().alive_count, 1); + + driver_a.shutdown(); + driver_b.shutdown(); +} + +/// Actor on node A sends InferenceRequest to actor on node B via the +/// transport router + codec. InferenceResponse arrives back at node A. +#[test] +fn inference_request_roundtrips_across_two_nodes() { + let (mut driver_a, mut driver_b) = make_converged_pair(); + + let codecs = Arc::new(inference_codec_registry()); + + let mut rt_a = Runtime::new(RuntimeConfig::default()); + let mut rt_b = Runtime::new(RuntimeConfig::default()); + + // Spawn echo actor on node B + let echo_addr = rt_b.spawn(EchoInferenceActor).unwrap(); + rt_b.tick(); + + // Inbox on node A for responses + let response_inbox = rt_a.new_inbox::().unwrap(); + let inbox_addr = *response_inbox.addr(); + + // Build iroh-backed transports for actor messages + let transport_a_to_b = Arc::new(IrohActorTransport::new( + driver_a.endpoint().clone(), + driver_b.endpoint_addr(), + driver_a.tokio_handle(), + )); + let transport_b_to_a = Arc::new(IrohActorTransport::new( + driver_b.endpoint().clone(), + driver_a.endpoint_addr(), + driver_b.tokio_handle(), + )); + + // Wire routes: A knows echo_addr is on B, B knows inbox_addr is on A + let router_a = TransportRouter::new(); + router_a.add_route(echo_addr, transport_a_to_b); + let router_b = TransportRouter::new(); + router_b.add_route(inbox_addr, transport_b_to_a); + + rt_a.set_codec_registry(codecs.clone()); + rt_a.set_transport_router(Arc::new(router_a)); + rt_b.set_codec_registry(codecs.clone()); + rt_b.set_transport_router(Arc::new(router_b)); + + // Send InferenceRequest from node A → actor on node B + rt_a.send_to( + echo_addr, + InferenceRequest { + prompt: "Hello from node A".into(), + max_tokens: 8, + temperature: 0.7, + reply_to: inbox_addr, + }, + ) + .unwrap(); + + // Allow iroh transport to deliver, then drain into runtime B + std::thread::sleep(Duration::from_millis(200)); + drain_actor_messages(&driver_b, &codecs, &rt_b, Duration::from_millis(500)); + rt_b.tick(); + + // Actor replied — allow transport to deliver, then drain into runtime A + std::thread::sleep(Duration::from_millis(200)); + drain_actor_messages(&driver_a, &codecs, &rt_a, Duration::from_millis(500)); + + let response = response_inbox + .try_recv() + .expect("InferenceResponse should arrive at node A"); + assert!( + response.text.contains("Hello from node A"), + "expected echo of prompt, got: {:?}", + response.text + ); + + driver_a.shutdown(); + driver_b.shutdown(); +} + +/// When node B shuts down, node A detects the death via SWIM within the +/// configured suspicion window. +#[test] +fn node_death_detected_via_swim_after_shutdown() { + let (mut driver_a, mut driver_b) = make_converged_pair(); + + assert_eq!( + driver_a.snapshot().alive_count, 1, + "precondition: A sees B alive" + ); + + // Kill node B + driver_b.shutdown(); + + // Pump node A until it sees zero alive peers + let start = Instant::now(); + let timeout = Duration::from_secs(10); + let mut detected = false; + while start.elapsed() < timeout { + driver_a.recv(); + driver_a.tick(); + if driver_a.snapshot().alive_count == 0 { + detected = true; + break; + } + std::thread::sleep(Duration::from_millis(10)); + } + + assert!( + detected, + "node A should detect node B's death via SWIM within the suspicion window" + ); + + driver_a.shutdown(); +} diff --git a/examples/single-gpu-inference/tests/t_codec.rs b/examples/single-gpu-inference/tests/t_codec.rs new file mode 100644 index 0000000..a8e2e08 --- /dev/null +++ b/examples/single-gpu-inference/tests/t_codec.rs @@ -0,0 +1,153 @@ +//! T-codec: InferenceRequest / InferenceResponse serialization tests. +//! +//! Validates the message contract that all other smoke test groups depend on: +//! - Roundtrip fidelity for both message types +//! - Graceful error handling on corrupted input + +use single_gpu_inference::messages::{ + inference_codec_registry, InferenceCodec, InferenceRequest, InferenceResponse, +}; +use swactor::actor::ActorAddress; +use swactor::transport::Codec; + +fn request_codec() -> &'static dyn Codec { + &InferenceCodec +} + +fn response_codec() -> &'static dyn Codec { + &InferenceCodec +} + +// ─── Roundtrip Tests ─────────────────────────────────────────────────────── + +/// A request with representative field values survives encode → decode +/// through both the direct codec and the type-erased registry path. +#[test] +fn inference_request_roundtrips_through_codec_and_registry() { + let original = InferenceRequest { + prompt: "Tell me about distributed systems".into(), + max_tokens: 128, + temperature: 0.7, + reply_to: ActorAddress::new_random(), + }; + + // Direct codec path + let codec = request_codec(); + let bytes = codec.encode(&original).expect("encode should succeed"); + let decoded = codec.decode(&bytes).expect("decode should succeed"); + assert_eq!(decoded, original); + + // Registry (type-erased) path — encode via TypeId, decode via type_tag + let registry = inference_codec_registry(); + let (tag, payload) = registry + .encode( + std::any::TypeId::of::(), + Box::new(original.clone()), + ) + .expect("registry encode should succeed"); + assert_eq!(tag, "smoke::InferenceRequest"); + + let any_msg = registry + .decode(&tag, &payload) + .expect("registry decode should succeed"); + let decoded = any_msg + .downcast::() + .expect("downcast should succeed"); + assert_eq!(*decoded, original); +} + +/// A response roundtrips through both the direct codec and the registry. +#[test] +fn inference_response_roundtrips_through_codec_and_registry() { + let original = InferenceResponse { + text: "Hello! I'd be happy to discuss distributed systems.".into(), + }; + + let codec = response_codec(); + let bytes = codec.encode(&original).expect("encode should succeed"); + let decoded = codec.decode(&bytes).expect("decode should succeed"); + assert_eq!(decoded, original); + + let registry = inference_codec_registry(); + let (tag, payload) = registry + .encode( + std::any::TypeId::of::(), + Box::new(original.clone()), + ) + .expect("registry encode should succeed"); + assert_eq!(tag, "smoke::InferenceResponse"); + + let any_msg = registry + .decode(&tag, &payload) + .expect("registry decode should succeed"); + let decoded = any_msg + .downcast::() + .expect("downcast should succeed"); + assert_eq!(*decoded, original); +} + +// ─── Corruption Tests ────────────────────────────────────────────────────── + +/// Completely random bytes are not valid JSON — the decoder must return +/// an error rather than panicking or producing a garbage message. +#[test] +fn corrupted_bytes_produce_error_for_request() { + let codec = request_codec(); + let garbage: Vec = vec![0xFF, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; + let result = codec.decode(&garbage); + assert!(result.is_err(), "garbage bytes must produce an error"); +} + +#[test] +fn corrupted_bytes_produce_error_for_response() { + let codec = response_codec(); + let garbage: Vec = vec![0xFF, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; + let result = codec.decode(&garbage); + assert!(result.is_err(), "garbage bytes must produce an error"); +} + +/// Truncated payload — valid JSON prefix cut short mid-value. +#[test] +fn truncated_request_bytes_produce_error() { + let codec = request_codec(); + let original = InferenceRequest { + prompt: "hello".into(), + max_tokens: 64, + temperature: 0.5, + reply_to: ActorAddress::new_random(), + }; + let bytes = codec.encode(&original).unwrap(); + // Chop off the last half + let truncated = &bytes[..bytes.len() / 2]; + let result = codec.decode(truncated); + assert!(result.is_err(), "truncated bytes must produce an error"); +} + +/// Empty input — zero bytes is not valid JSON. +#[test] +fn empty_bytes_produce_error() { + let req_codec = request_codec(); + let res_codec = response_codec(); + assert!(req_codec.decode(&[]).is_err()); + assert!(res_codec.decode(&[]).is_err()); +} + +/// Valid JSON but wrong schema — a response payload fed to the request +/// decoder. The missing required fields must cause an error. +#[test] +fn wrong_message_type_produces_error() { + let res_codec = response_codec(); + let req_codec = request_codec(); + + let response = InferenceResponse { + text: "oops".into(), + }; + let response_bytes = res_codec.encode(&response).unwrap(); + + // Decoding response bytes as a request should fail (missing prompt, max_tokens, etc.) + let result = req_codec.decode(&response_bytes); + assert!( + result.is_err(), + "decoding response bytes as request must fail" + ); +} diff --git a/examples/single-gpu-inference/tests/t_integration.rs b/examples/single-gpu-inference/tests/t_integration.rs new file mode 100644 index 0000000..c1cc9a7 --- /dev/null +++ b/examples/single-gpu-inference/tests/t_integration.rs @@ -0,0 +1,415 @@ +//! T-integration: End-to-end distributed inference tests. +//! +//! Two swactor nodes on localhost via iroh/QUIC. Node B runs an +//! `InferenceActor` backed by a Python worker. Node A sends an +//! `InferenceRequest` across the network, through the `RequestBridge`, +//! into the actor, through the child process, and back. +//! +//! - `distributed_inference_through_echo_worker` — fast, uses canned echo responses. +//! - `distributed_inference_through_tinygrad` — slow (#[ignore]), downloads a real +//! ~1B GGUF model and runs real tinygrad inference on CPU. + +use std::collections::HashMap; +use std::sync::Arc; +use std::time::{Duration, Instant}; + +use distribution::iroh_driver::{IrohDriver, IrohDriverConfig}; +use distribution::node::DistributedNodeConfig; +use distribution::registry::RegistryConfig; +use distribution::swim::probe::SwimConfig; +use iroh::{PublicKey, RelayMode}; + +use swactor::runtime::{Runtime, RuntimeConfig}; +use swactor::transport::TransportRouter; + +use single_gpu_inference::inference_actor::{InferenceActor, InferenceActorStatus, RequestBridge}; +use single_gpu_inference::iroh_transport::{drain_actor_messages, IrohActorTransport, ACTOR_ALPN}; +use single_gpu_inference::messages::{inference_codec_registry, InferenceRequest, InferenceResponse}; +use swactor_process::{ProcessMode, ProcessSpec}; + +// ── Iroh helpers (from t_cluster.rs) ──────────────────────────────────── + +fn test_node_config() -> DistributedNodeConfig { + DistributedNodeConfig { + swim: SwimConfig { + probe_interval: 1, + probe_timeout: 3, + indirect_probes: 1, + suspicion_timeout: 5, + dead_reprobe_interval: 0, + ..SwimConfig::default() + }, + cache_capacity: 100, + republish_interval: 50, + registry: RegistryConfig::default(), + metadata_lambda: 3, + } +} + +fn make_driver() -> IrohDriver { + IrohDriver::new(IrohDriverConfig { + secret_key: None, + relay_mode: RelayMode::Disabled, + node: test_node_config(), + peer_auth: None, + additional_alpns: vec![ACTOR_ALPN.to_vec()], + }) + .expect("failed to create iroh driver") +} + +fn pump_one(driver: &mut IrohDriver) { + driver.recv(); + driver.tick(); +} + +fn pump_until_pair( + a: &mut IrohDriver, + b: &mut IrohDriver, + timeout: Duration, + check_fn: fn(&IrohDriver, &IrohDriver) -> bool, +) -> bool { + let start = Instant::now(); + while start.elapsed() < timeout { + pump_one(a); + pump_one(b); + if check_fn(a, b) { + return true; + } + std::thread::sleep(Duration::from_millis(10)); + } + false +} + +fn sees_alive(driver: &IrohDriver, peer_key: &PublicKey) -> bool { + let snap = driver.snapshot(); + let peer_hex: String = peer_key + .as_bytes() + .iter() + .map(|b| format!("{:02x}", b)) + .collect(); + snap.members + .iter() + .any(|m| m.node_id == peer_hex && m.state == "alive") +} + +fn both_alive(a: &IrohDriver, b: &IrohDriver) -> bool { + let a_key = PublicKey::from_bytes(&a.node_id().0).unwrap(); + let b_key = PublicKey::from_bytes(&b.node_id().0).unwrap(); + sees_alive(a, &b_key) && sees_alive(b, &a_key) +} + +fn make_converged_pair() -> (IrohDriver, IrohDriver) { + let mut driver_a = make_driver(); + let mut driver_b = make_driver(); + + let a_addr = driver_a.endpoint_addr(); + driver_b.join(&[a_addr]); + + let converged = pump_until_pair( + &mut driver_a, + &mut driver_b, + Duration::from_secs(5), + both_alive, + ); + assert!(converged, "cluster setup: nodes did not converge within 5s"); + + (driver_a, driver_b) +} + +// ── Process helpers (from t_actor.rs) ──────────────────────────────────── + +fn echo_worker_spec() -> ProcessSpec { + ProcessSpec { + command: "python3".into(), + args: vec![format!("{}/echo_worker.py", env!("CARGO_MANIFEST_DIR"))], + env: HashMap::new(), + working_dir: None, + mode: ProcessMode::Automated, + initial_pty_size: None, + kill_timeout: Some(Duration::from_secs(2)), + stdin_buffer_limit: None, + } +} + +fn tinygrad_worker_spec() -> ProcessSpec { + let manifest = env!("CARGO_MANIFEST_DIR"); + ProcessSpec { + command: format!("{manifest}/.venv/bin/python"), + args: vec![format!("{manifest}/tinygrad_worker.py")], + env: HashMap::new(), + working_dir: None, + mode: ProcessMode::Automated, + initial_pty_size: None, + kill_timeout: Some(Duration::from_secs(5)), + stdin_buffer_limit: None, + } +} + +fn is_process_alive(pid: u32) -> bool { + std::fs::metadata(format!("/proc/{}", pid)).is_ok() +} + +// ── Test ───────────────────────────────────────────────────────────────── + +#[test] +fn distributed_inference_through_echo_worker() { + // 1. Converge two iroh drivers + let (mut driver_a, mut driver_b) = make_converged_pair(); + + let codecs = Arc::new(inference_codec_registry()); + + // 2. Create runtimes + let mut rt_a = Runtime::new(RuntimeConfig::default()); + let mut rt_b = Runtime::new(RuntimeConfig::default()); + + // 3. On rt_b: spawn InferenceActor with echo_worker + RequestBridge + let status_inbox = rt_b.new_inbox::().unwrap(); + let sender = rt_b.create_sender(); + let actor = InferenceActor::new(echo_worker_spec(), sender) + .with_status_addr(*status_inbox.addr()); + let inference_addr = rt_b.spawn(actor).unwrap(); + + let bridge = RequestBridge { target: inference_addr }; + let bridge_addr = rt_b.spawn(bridge).unwrap(); + + // 4. On rt_a: create response inbox + let response_inbox = rt_a.new_inbox::().unwrap(); + let inbox_addr = *response_inbox.addr(); + + // 5. Build iroh transports + let transport_a_to_b = Arc::new(IrohActorTransport::new( + driver_a.endpoint().clone(), + driver_b.endpoint_addr(), + driver_a.tokio_handle(), + )); + let transport_b_to_a = Arc::new(IrohActorTransport::new( + driver_b.endpoint().clone(), + driver_a.endpoint_addr(), + driver_b.tokio_handle(), + )); + + // Wire routes: A sends to bridge_addr on B, B sends to inbox_addr on A + let router_a = TransportRouter::new(); + router_a.add_route(bridge_addr, transport_a_to_b); + let router_b = TransportRouter::new(); + router_b.add_route(inbox_addr, transport_b_to_a); + + // 6. Install codecs and transport routers + rt_a.set_codec_registry(codecs.clone()); + rt_a.set_transport_router(Arc::new(router_a)); + rt_b.set_codec_registry(codecs.clone()); + rt_b.set_transport_router(Arc::new(router_b)); + + // 7. Tick rt_b until InferenceActor reports WorkerReady + let start = Instant::now(); + let mut worker_pid = None; + while start.elapsed() < Duration::from_secs(10) { + rt_b.tick(); + if let Some(status) = status_inbox.try_recv() { + match status { + InferenceActorStatus::WorkerReady { pid } => { + worker_pid = pid; + break; + } + InferenceActorStatus::ProcessStarted => {} + other => panic!("unexpected status during startup: {:?}", other), + } + } + std::thread::sleep(Duration::from_millis(5)); + } + let worker_pid = worker_pid.expect("echo_worker.py should report ready within 10s"); + + // 8. Send InferenceRequest from node A → bridge on node B + rt_a.send_to( + bridge_addr, + InferenceRequest { + prompt: "Hello from node A".into(), + max_tokens: 8, + temperature: 0.7, + reply_to: inbox_addr, + }, + ) + .unwrap(); + + // 9. Pump loop: drain messages on both sides, tick both runtimes + let start = Instant::now(); + let mut got_response = false; + while start.elapsed() < Duration::from_secs(10) { + // Let transport deliver + std::thread::sleep(Duration::from_millis(100)); + + // Drain incoming actor messages on both sides + drain_actor_messages(&driver_b, &codecs, &rt_b, Duration::from_millis(100)); + drain_actor_messages(&driver_a, &codecs, &rt_a, Duration::from_millis(100)); + + // Tick both runtimes + rt_b.tick(); + rt_a.tick(); + + // Check for response + if let Some(response) = response_inbox.try_recv() { + // 10. Assert + assert!( + response.text.contains("Hello from node A"), + "expected echo of prompt, got: {:?}", + response.text + ); + got_response = true; + break; + } + } + assert!(got_response, "should receive InferenceResponse within 10s"); + + // 11. Cleanup: stop inference actor, wait for process death, shutdown drivers + rt_b.stop_actor(inference_addr).unwrap(); + + let start = Instant::now(); + while start.elapsed() < Duration::from_secs(5) { + rt_b.tick(); + std::thread::sleep(Duration::from_millis(10)); + if !is_process_alive(worker_pid) { + break; + } + } + assert!( + !is_process_alive(worker_pid), + "echo_worker.py (pid {}) should be dead after actor stop", + worker_pid + ); + + driver_a.shutdown(); + driver_b.shutdown(); +} + +/// Full distributed inference through tinygrad with a real ~1B GGUF model. +/// +/// Ignored by default — requires the `.venv` with tinygrad installed and +/// downloads a ~1 GB model on first run. Run explicitly with: +/// cargo test --package smoke-test distributed_inference -- --ignored +#[test] +#[ignore] +fn distributed_inference_through_tinygrad() { + // 1. Converge two iroh drivers + let (mut driver_a, mut driver_b) = make_converged_pair(); + + let codecs = Arc::new(inference_codec_registry()); + + // 2. Create runtimes + let mut rt_a = Runtime::new(RuntimeConfig::default()); + let mut rt_b = Runtime::new(RuntimeConfig::default()); + + // 3. On rt_b: spawn InferenceActor with tinygrad_worker + RequestBridge + let status_inbox = rt_b.new_inbox::().unwrap(); + let sender = rt_b.create_sender(); + let actor = InferenceActor::new(tinygrad_worker_spec(), sender) + .with_status_addr(*status_inbox.addr()); + let inference_addr = rt_b.spawn(actor).unwrap(); + + let bridge = RequestBridge { target: inference_addr }; + let bridge_addr = rt_b.spawn(bridge).unwrap(); + + // 4. On rt_a: create response inbox + let response_inbox = rt_a.new_inbox::().unwrap(); + let inbox_addr = *response_inbox.addr(); + + // 5. Build iroh transports + let transport_a_to_b = Arc::new(IrohActorTransport::new( + driver_a.endpoint().clone(), + driver_b.endpoint_addr(), + driver_a.tokio_handle(), + )); + let transport_b_to_a = Arc::new(IrohActorTransport::new( + driver_b.endpoint().clone(), + driver_a.endpoint_addr(), + driver_b.tokio_handle(), + )); + + let router_a = TransportRouter::new(); + router_a.add_route(bridge_addr, transport_a_to_b); + let router_b = TransportRouter::new(); + router_b.add_route(inbox_addr, transport_b_to_a); + + // 6. Install codecs and transport routers + rt_a.set_codec_registry(codecs.clone()); + rt_a.set_transport_router(Arc::new(router_a)); + rt_b.set_codec_registry(codecs.clone()); + rt_b.set_transport_router(Arc::new(router_b)); + + // 7. Wait for tinygrad model download + load (generous timeout) + let start = Instant::now(); + let mut worker_pid = None; + while start.elapsed() < Duration::from_secs(600) { + rt_b.tick(); + if let Some(status) = status_inbox.try_recv() { + match status { + InferenceActorStatus::WorkerReady { pid } => { + worker_pid = pid; + break; + } + InferenceActorStatus::ProcessStarted => {} + other => panic!("unexpected status during startup: {:?}", other), + } + } + std::thread::sleep(Duration::from_millis(50)); + } + let worker_pid = worker_pid.expect("tinygrad_worker.py should report ready (model loaded)"); + + // 8. Send InferenceRequest from node A → bridge on node B + rt_a.send_to( + bridge_addr, + InferenceRequest { + prompt: "Say hello".into(), + max_tokens: 32, + temperature: 0.7, + reply_to: inbox_addr, + }, + ) + .unwrap(); + + // 9. Pump loop — generation on CPU can be slow + let start = Instant::now(); + let mut got_response = false; + while start.elapsed() < Duration::from_secs(300) { + std::thread::sleep(Duration::from_millis(200)); + + drain_actor_messages(&driver_b, &codecs, &rt_b, Duration::from_millis(100)); + drain_actor_messages(&driver_a, &codecs, &rt_a, Duration::from_millis(100)); + + rt_b.tick(); + rt_a.tick(); + + if let Some(response) = response_inbox.try_recv() { + assert!( + !response.text.is_empty(), + "expected non-empty generated text from tinygrad, got empty string" + ); + eprintln!("tinygrad response: {:?}", response.text); + got_response = true; + break; + } + } + assert!( + got_response, + "should receive InferenceResponse from tinygrad within timeout" + ); + + // 10. Cleanup + rt_b.stop_actor(inference_addr).unwrap(); + + let start = Instant::now(); + while start.elapsed() < Duration::from_secs(10) { + rt_b.tick(); + std::thread::sleep(Duration::from_millis(50)); + if !is_process_alive(worker_pid) { + break; + } + } + assert!( + !is_process_alive(worker_pid), + "tinygrad_worker.py (pid {}) should be dead after actor stop", + worker_pid + ); + + driver_a.shutdown(); + driver_b.shutdown(); +} diff --git a/examples/single-gpu-inference/tests/t_vastai.rs b/examples/single-gpu-inference/tests/t_vastai.rs new file mode 100644 index 0000000..33d9166 --- /dev/null +++ b/examples/single-gpu-inference/tests/t_vastai.rs @@ -0,0 +1,235 @@ +//! T-vastai: vast.ai API client tests with mocked HTTP responses. +//! +//! Validates the orchestration layer that rents and manages GPU instances. +//! All tests hit a local wiremock server — no real API calls, no VAST_API_KEY needed. + +use reqwest::Client; +use single_gpu_inference::vastai; +use std::time::Duration; +use wiremock::matchers::{header, method, path_regex}; +use wiremock::{Mock, MockServer, ResponseTemplate}; + +// ─── find_offer ─────────────────────────────────────────────────────────── + +/// Three offers at different prices — the client must pick the cheapest one. +#[tokio::test] +async fn find_offer_picks_cheapest_from_multiple_offers() { + let server = MockServer::start().await; + + Mock::given(method("GET")) + .and(path_regex("/api/v0/bundles.*")) + .and(header("Authorization", "Bearer test-key")) + .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({ + "offers": [ + { "id": 101, "gpu_name": "RTX 3090", "dph_total": 0.30, "geolocation": "US" }, + { "id": 102, "gpu_name": "RTX 3090", "dph_total": 0.15, "geolocation": "US" }, + { "id": 103, "gpu_name": "RTX 3090", "dph_total": 0.25, "geolocation": "US" }, + ] + }))) + .mount(&server) + .await; + + let client = Client::new(); + let offer = vastai::find_offer(&client, &server.uri(), "test-key", "RTX 3090", &[]) + .await + .expect("should find an offer"); + + assert_eq!(offer.id, 102, "must pick the cheapest offer (id=102, $0.15/hr)"); + assert!((offer.dph_total - 0.15).abs() < f64::EPSILON); +} + +/// Empty offer list — the client must return an error, not panic. +#[tokio::test] +async fn find_offer_returns_error_on_empty_list() { + let server = MockServer::start().await; + + Mock::given(method("GET")) + .and(path_regex("/api/v0/bundles.*")) + .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({ + "offers": [] + }))) + .mount(&server) + .await; + + let client = Client::new(); + let result = vastai::find_offer(&client, &server.uri(), "test-key", "RTX 3090", &[]).await; + + assert!(result.is_err(), "empty offer list must produce an error"); + assert!( + result.unwrap_err().contains("no offers"), + "error should mention no offers" + ); +} + +// ─── create_instance ────────────────────────────────────────────────────── + +/// Successful creation — parse the new_contract ID and verify SEED_ADDR is in the request. +#[tokio::test] +async fn create_instance_parses_contract_and_sends_seed_addr() { + let server = MockServer::start().await; + + Mock::given(method("PUT")) + .and(path_regex("/api/v0/asks/102/")) + .and(header("Authorization", "Bearer test-key")) + .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({ + "new_contract": 9999, + "success": true + }))) + .expect(1) + .mount(&server) + .await; + + let client = Client::new(); + let info = vastai::create_instance( + &client, + &server.uri(), + "test-key", + 102, + "iroh://node-abc123", + None, + "swactor-gpu:latest", + ) + .await + .expect("create should succeed"); + + assert_eq!(info.contract_id, 9999); +} + +/// Verify the request body contains SEED_ADDR by inspecting the recorded request. +#[tokio::test] +async fn create_instance_includes_seed_addr_in_env_payload() { + let server = MockServer::start().await; + + Mock::given(method("PUT")) + .and(path_regex("/api/v0/asks/55/")) + .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({ + "new_contract": 7777, + }))) + .mount(&server) + .await; + + let client = Client::new(); + vastai::create_instance( + &client, + &server.uri(), + "test-key", + 55, + "iroh://seed-address-xyz", + None, + "swactor-gpu:latest", + ) + .await + .expect("create should succeed"); + + // Inspect the recorded request to verify the body contains SEED_ADDR. + let requests = server.received_requests().await.unwrap(); + assert_eq!(requests.len(), 1); + let body: serde_json::Value = serde_json::from_slice(&requests[0].body).unwrap(); + assert_eq!( + body["env"]["SEED_ADDR"], + "iroh://seed-address-xyz", + "request body must contain SEED_ADDR in the env payload" + ); +} + +// ─── wait_for_running ───────────────────────────────────────────────────── + +/// Polling sequence: loading → loading → running. Must extract IP and port. +#[tokio::test] +async fn wait_for_running_handles_loading_then_running_sequence() { + let server = MockServer::start().await; + + // First two polls: loading + Mock::given(method("GET")) + .and(path_regex("/api/v0/instances/9999/")) + .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({ + "instances": { "actual_status": "loading" } + }))) + .up_to_n_times(2) + .expect(2) + .mount(&server) + .await; + + // Third poll: running with IP and port + Mock::given(method("GET")) + .and(path_regex("/api/v0/instances/9999/")) + .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({ + "instances": { + "actual_status": "running", + "public_ipaddr": "203.0.113.42", + "ssh_port": 31337 + } + }))) + .mount(&server) + .await; + + let client = Client::new(); + let running = vastai::wait_for_running( + &client, + &server.uri(), + "test-key", + 9999, + Duration::from_millis(10), // fast polling for tests + 10, + ) + .await + .expect("should eventually reach running"); + + assert_eq!(running.ip, "203.0.113.42"); + assert_eq!(running.port, 31337); +} + +/// Terminal status (exited) — must return error immediately without further polling. +#[tokio::test] +async fn wait_for_running_returns_error_on_exited_status() { + let server = MockServer::start().await; + + Mock::given(method("GET")) + .and(path_regex("/api/v0/instances/1234/")) + .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({ + "instances": { "actual_status": "exited" } + }))) + .expect(1) // Must only be called once — no further polling after terminal status. + .mount(&server) + .await; + + let client = Client::new(); + let result = vastai::wait_for_running( + &client, + &server.uri(), + "test-key", + 1234, + Duration::from_millis(10), + 10, + ) + .await; + + assert!(result.is_err(), "terminal status must produce an error"); + assert!( + result.unwrap_err().contains("terminal status"), + "error should mention terminal status" + ); +} + +// ─── destroy_instance ───────────────────────────────────────────────────── + +/// Verify the correct DELETE request is sent for instance teardown. +#[tokio::test] +async fn destroy_instance_sends_correct_delete_request() { + let server = MockServer::start().await; + + Mock::given(method("DELETE")) + .and(path_regex("/api/v0/instances/9999/")) + .and(header("Authorization", "Bearer test-key")) + .respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({ + "success": true + }))) + .expect(1) + .mount(&server) + .await; + + let client = Client::new(); + vastai::destroy_instance(&client, &server.uri(), "test-key", 9999) + .await + .expect("destroy should succeed"); +} diff --git a/examples/single-gpu-inference/tests/test_worker.py b/examples/single-gpu-inference/tests/test_worker.py new file mode 100644 index 0000000..4f5c13c --- /dev/null +++ b/examples/single-gpu-inference/tests/test_worker.py @@ -0,0 +1,154 @@ +"""T-worker: tinygrad worker protocol tests. + +Spawns tinygrad_worker.py --stub as a subprocess and verifies the +stdin/stdout JSON protocol defined in SPEC.md §2.3. +""" + +import json +import os +import signal +import subprocess +import sys +import time + +import pytest + +WORKER_SCRIPT = os.path.join(os.path.dirname(__file__), "..", "tinygrad_worker.py") +PYTHON = sys.executable + + +def spawn_worker(): + """Spawn the worker in --stub mode and return the Popen handle.""" + proc = subprocess.Popen( + [PYTHON, WORKER_SCRIPT, "--stub"], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, + ) + return proc + + +def read_line(proc, timeout=5): + """Read one line from the worker's stdout, with a timeout.""" + import selectors + sel = selectors.DefaultSelector() + sel.register(proc.stdout, selectors.EVENT_READ) + events = sel.select(timeout=timeout) + if not events: + raise TimeoutError(f"No output from worker within {timeout}s") + line = proc.stdout.readline() + sel.close() + if not line: + raise EOFError("Worker closed stdout") + return json.loads(line.strip()) + + +def send_line(proc, obj): + """Write a JSON line to the worker's stdin.""" + proc.stdin.write(json.dumps(obj) + "\n") + proc.stdin.flush() + + +def send_raw(proc, text): + """Write raw text to the worker's stdin.""" + proc.stdin.write(text + "\n") + proc.stdin.flush() + + +class TestWorkerStartup: + """Worker prints {"status": "ready"} on startup.""" + + def test_worker_emits_ready_on_startup(self): + proc = spawn_worker() + try: + msg = read_line(proc) + assert msg == {"status": "ready"}, f"Expected ready status, got: {msg}" + finally: + proc.terminate() + proc.wait(timeout=5) + + +class TestWorkerInference: + """Valid request produces a valid response with non-empty text.""" + + def test_valid_request_returns_non_empty_response(self): + proc = spawn_worker() + try: + ready = read_line(proc) + assert ready["status"] == "ready" + + send_line(proc, {"prompt": "Say hello", "max_tokens": 8}) + response = read_line(proc) + + assert "response" in response, f"Response missing 'response' field: {response}" + assert isinstance(response["response"], str) + assert len(response["response"]) > 0, "Response text must be non-empty" + finally: + proc.terminate() + proc.wait(timeout=5) + + def test_multiple_requests_in_sequence(self): + """Worker handles multiple requests without restarting.""" + proc = spawn_worker() + try: + read_line(proc) # ready + + for prompt in ["Hello", "World", "Test"]: + send_line(proc, {"prompt": prompt, "max_tokens": 8}) + response = read_line(proc) + assert "response" in response + assert len(response["response"]) > 0 + finally: + proc.terminate() + proc.wait(timeout=5) + + +class TestWorkerMalformedInput: + """Malformed JSON produces {"error": "..."} and worker continues.""" + + def test_malformed_json_returns_error_and_continues(self): + proc = spawn_worker() + try: + read_line(proc) # ready + + # Send garbage + send_raw(proc, "this is not json {{{") + err = read_line(proc) + assert "error" in err, f"Expected error response, got: {err}" + + # Worker should still be alive and handle the next valid request + send_line(proc, {"prompt": "Still alive?", "max_tokens": 8}) + response = read_line(proc) + assert "response" in response, "Worker should continue after malformed input" + assert len(response["response"]) > 0 + finally: + proc.terminate() + proc.wait(timeout=5) + + def test_partial_json_returns_error(self): + proc = spawn_worker() + try: + read_line(proc) # ready + + send_raw(proc, '{"prompt": "incomplete') + err = read_line(proc) + assert "error" in err + finally: + proc.terminate() + proc.wait(timeout=5) + + +class TestWorkerEOFShutdown: + """Closing stdin (EOF) causes worker to exit cleanly with code 0.""" + + def test_eof_causes_clean_exit(self): + proc = spawn_worker() + read_line(proc) # ready + + # Close stdin + proc.stdin.close() + + # Worker should exit cleanly + exit_code = proc.wait(timeout=5) + assert exit_code == 0, f"Worker exited with code {exit_code}, expected 0" diff --git a/examples/single-gpu-inference/tinygrad_worker.py b/examples/single-gpu-inference/tinygrad_worker.py new file mode 100644 index 0000000..722f981 --- /dev/null +++ b/examples/single-gpu-inference/tinygrad_worker.py @@ -0,0 +1,159 @@ +#!/usr/bin/env python3 +"""tinygrad compute worker — stdin/stdout JSON protocol. + +Startup: loads a model (or uses --stub for testing), prints {"status": "ready"}. + +Protocol (newline-delimited JSON): + → stdin: {"prompt": "Say hello", "max_tokens": 64, "temperature": 0.7} + ← stdout: {"response": "Hello! How can I help you today?"} + +Errors: + ← stdout: {"error": "description of what went wrong"} + +Flags: + --stub Skip model loading; return a canned response for every request. + Used for component tests that exercise the protocol without a GPU. + --model NAME Model from tinygrad's built-in catalog (default: llama3.2:1b). +""" + +import argparse +import json +import os +import sys + + +def main(): + parser = argparse.ArgumentParser(description="tinygrad inference worker") + parser.add_argument("--stub", action="store_true", + help="Stub mode: skip model loading, return canned responses") + parser.add_argument("--model", default="llama3.2:1b", + help="Model name from tinygrad catalog (default: llama3.2:1b)") + args = parser.parse_args() + + if args.stub: + model_data = None + else: + try: + model_data = _load_model(args.model) + except Exception as e: + import traceback + _log(traceback.format_exc()) + _write({"error": f"model load failed: {e}"}) + sys.exit(1) + + # Signal readiness + _write({"status": "ready", "pid": os.getpid()}) + + # Request loop + for line in sys.stdin: + line = line.strip() + if not line: + continue + try: + request = json.loads(line) + except (json.JSONDecodeError, ValueError) as e: + _write({"error": f"invalid JSON: {e}"}) + continue + + if "prompt" not in request: + _write({"error": "missing 'prompt' field"}) + continue + + prompt = request["prompt"] + max_tokens = request.get("max_tokens", 64) + temperature = request.get("temperature", 0.7) + + try: + text = _generate(model_data, prompt, max_tokens, temperature, stub=args.stub) + _write({"response": text}) + except Exception as e: + _write({"error": f"generation failed: {e}"}) + + +def _write(obj): + """Write a JSON object as a single line to stdout and flush.""" + print(json.dumps(obj), flush=True) + + +def _log(msg): + """Write a log message to stderr (not part of the JSON protocol).""" + print(msg, file=sys.stderr, flush=True) + + +def _load_model(model_name): + """Load a GGUF model via tinygrad 0.12.0's built-in catalog.""" + from tinygrad import Tensor + from tinygrad.helpers import fetch + from tinygrad.apps.llm import Transformer, SimpleTokenizer, models + + if model_name not in models: + available = ", ".join(models.keys()) + raise ValueError(f"Unknown model '{model_name}'. Available: {available}") + + url = models[model_name] + _log(f"Downloading {model_name} from {url}...") + gguf_path = fetch(url) + + _log(f"Loading model from {gguf_path}...") + model, kv = Transformer.from_gguf(Tensor(gguf_path), max_context=512) + tokenizer = SimpleTokenizer.from_gguf_kv(kv) + + # Find stop token IDs for generation + tokens_list = kv.get("tokenizer.ggml.tokens", []) + stop_ids = set() + for i, tok in enumerate(tokens_list): + if tok in ("<|end_of_text|>", "<|eot_id|>", "", "<|endoftext|>"): + stop_ids.add(i) + + # Find EOS token ID for chat template end-of-turn + eot_id = None + for i, tok in enumerate(tokens_list): + if tok == "<|eot_id|>": + eot_id = i + break + if eot_id is None: + for i, tok in enumerate(tokens_list): + if tok in ("", "<|end_of_text|>"): + eot_id = i + break + + _log(f"Model loaded. Stop IDs: {stop_ids}, EOT ID: {eot_id}") + return {"model": model, "tokenizer": tokenizer, "stop_ids": stop_ids, "eot_id": eot_id} + + +def _format_chat_tokens(tokenizer, prompt, eot_id): + """Format a prompt using Llama 3 instruct chat template.""" + tokens = tokenizer.role("user") + tokens += tokenizer.encode(prompt) + if eot_id is not None: + tokens += tokenizer.end_turn(eot_id) + tokens += tokenizer.role("assistant") + return tokens + + +def _generate(model_data, prompt, max_tokens, temperature, stub=False): + """Generate text from a prompt.""" + if stub: + return f"stub response to: {prompt}" + + model = model_data["model"] + tokenizer = model_data["tokenizer"] + stop_ids = model_data["stop_ids"] + eot_id = model_data["eot_id"] + + # Use chat template for instruction-tuned models + tokens = _format_chat_tokens(tokenizer, prompt, eot_id) + prompt_len = len(tokens) + + for i, tok_id in enumerate(model.generate(tokens)): + if tok_id in stop_ids: + tokens.pop() # remove the stop token from output + break + if i + 1 >= max_tokens: + break + + return tokenizer.decode(tokens[prompt_len:]) + + +if __name__ == "__main__": + main()