From 90b7f10a77264eca711d86194582ea424bd93ae4 Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Fri, 10 May 2024 17:49:16 +0100 Subject: [PATCH] Update and fix bugs It's good to be back Signed-off-by: Nikolaos Karaolidis --- Cargo.lock | 597 ++++++++++-------- Cargo.toml | 39 +- src/bin/qrust/threads/data/websocket/news.rs | 6 +- src/lib/qrust/ml/batcher.rs | 1 + src/lib/qrust/ml/dataset.rs | 48 +- src/lib/qrust/ml/model.rs | 12 +- .../websocket/data/incoming/subscription.rs | 8 +- src/lib/qrust/types/ta.rs | 144 ++--- .../docker-entrypoint-initdb.d/0000_init.sql | 2 + 9 files changed, 430 insertions(+), 427 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88da51a..42c3195 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,9 +51,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "arc-swap" @@ -99,13 +99,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.79" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -127,7 +127,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-util", "itoa", "matchit", @@ -140,7 +140,7 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper 1.0.0", + "sync_wrapper 1.0.1", "tokio", "tower", "tower-layer", @@ -204,6 +204,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" + [[package]] name = "base64ct" version = "1.6.0" @@ -221,9 +227,9 @@ dependencies = [ [[package]] name = "bindgen_cuda" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853f25ad4724e82569cc7dd3b08048d21bd15950208f8b0ceeab6ac062b33c1f" +checksum = "1f8489af5b7d17a81bffe37e0f4d6e1e4de87c87329d05447f22c35d95a1227d" dependencies = [ "glob", "num_cpus", @@ -289,15 +295,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "burn" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b703e5dae87b2146649b64af54688ff86e16cf69fd19d28c43c8f9656d7d7c" +checksum = "3960b57a6ad4baf54d1dba766965e4559c4b9a8f391107fee5de29db57265840" dependencies = [ "burn-core", "burn-train", @@ -305,21 +311,22 @@ dependencies = [ [[package]] name = "burn-autodiff" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f306e1b2e480fa0960c3130a68ca5e0fa54b3e33ed2fda7cf2121434703dd771" +checksum = "cf9479c28bdce3f2b1541f0a9215628f6256b5f3d66871192a3c56d55171d28e" dependencies = [ "burn-common", "burn-tensor", "derive-new", + "log", "spin", ] [[package]] name = "burn-candle" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc87b644a2d83cc1b7c05d1176e9e24fb6394272256ab9ab8324ff7c4fe0e6a0" +checksum = "d811c54fa6d9beb38808a1aabd9515c39090720cae572d54f25c041b1702e8fd" dependencies = [ "burn-tensor", "candle-core", @@ -329,9 +336,9 @@ dependencies = [ [[package]] name = "burn-common" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1267068969f094323b62693df0c3b45d3b08a0568f3c3467e6a5c3207e6807c8" +checksum = "8d9540b2f45a2d337220e702d7a87572c8e1c78db91a200b22924a8c4a6e9be4" dependencies = [ "async-trait", "derive-new", @@ -345,9 +352,9 @@ dependencies = [ [[package]] name = "burn-compute" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b51588cf7c84976f6241a9ac5f77857712b8bf443dab77296c260785033fe8" +checksum = "3e890d8999b25a1a090c2afe198243fc79f0a299efb531a4871c084b0ab9fa11" dependencies = [ "burn-common", "derive-new", @@ -363,9 +370,9 @@ dependencies = [ [[package]] name = "burn-core" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b11d8fd1e8c656eee1a0bb503b798c4583904dcaf7a369cbb8fdfd3acc3d0ab" +checksum = "8af6bc0afe55a57ff0b08f52302df4e3d09f96805a4f1e15c521f1082cb02b4f" dependencies = [ "bincode", "burn-autodiff", @@ -373,7 +380,6 @@ dependencies = [ "burn-common", "burn-dataset", "burn-derive", - "burn-fusion", "burn-ndarray", "burn-tch", "burn-tensor", @@ -382,8 +388,8 @@ dependencies = [ "flate2", "half", "hashbrown 0.14.3", - "libm", "log", + "num-traits", "rand", "rmp-serde", "serde", @@ -393,9 +399,9 @@ dependencies = [ [[package]] name = "burn-dataset" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6050891281ae38ee9dc24d1d5badd084247717b15e3dcdae562a81456a41c6e" +checksum = "3feae7766b56e947d38ac4d6903388270d848609339a147a513145703426f6db" dependencies = [ "csv", "derive-new", @@ -419,21 +425,21 @@ dependencies = [ [[package]] name = "burn-derive" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f149de5f32baa3f2191c374edab71e5a323bade05eb6092c702aed76cdcb7b" +checksum = "8618ac2c171c7054ffd3ce8da15c3d4b11dc805eb393065c74c05882ef79d931" dependencies = [ "derive-new", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] name = "burn-fusion" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f512f780beaefca46088c4e4a80595511fbc3b35545118281fbf49f1fca767b4" +checksum = "8d77b882d131a67d15f91b915fb3e0a5add73547e7352310d33c877fbe77c79e" dependencies = [ "burn-common", "burn-tensor", @@ -445,10 +451,31 @@ dependencies = [ ] [[package]] -name = "burn-ndarray" -version = "0.12.1" +name = "burn-jit" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aef9fb0b72a1c0a112ed51e35284fb663d3ba3fd98f3a3bfa32db39fd24ae4d" +checksum = "0cb62a93030a690c329b95c01b43e3064a4bd36031e9111d537641d36e42f3ac" +dependencies = [ + "burn-common", + "burn-compute", + "burn-fusion", + "burn-tensor", + "bytemuck", + "derive-new", + "hashbrown 0.14.3", + "log", + "num-traits", + "rand", + "serde", + "spin", + "text_placeholder", +] + +[[package]] +name = "burn-ndarray" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f40bb0b5938937a721045752f1ec1baee8a873429fd17e6e6f2155c6cdf33a" dependencies = [ "burn-autodiff", "burn-common", @@ -465,9 +492,9 @@ dependencies = [ [[package]] name = "burn-tch" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d7aec36d836c5a11714480089738120899e2c91f6fe2e23abd09ec4a68a803" +checksum = "8cb9c2b547499a3d990e93b950965b9a478edfec4a7bf98d5d4412ff8c897129" dependencies = [ "burn-tensor", "half", @@ -478,15 +505,14 @@ dependencies = [ [[package]] name = "burn-tensor" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad09aeb0f2428a4ee91f9876a7d71cef6feb1fcacdab6389362dd878ec5f9b27" +checksum = "bfa19c21f54e1a189be3bbaec45efafdf1c89b2763710b381c9f32ae25e7dbe8" dependencies = [ "burn-common", "derive-new", "half", "hashbrown 0.14.3", - "libm", "num-traits", "rand", "rand_distr", @@ -495,9 +521,9 @@ dependencies = [ [[package]] name = "burn-train" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5536e98b23dd5047728f288e61e8a4d9fbffef6f55086d3483c2464758508d" +checksum = "0a0014ee82ef967bd82dda378cfaf340f255c39c729e29ac3bc65d3107e4c7ee" dependencies = [ "burn-core", "crossterm", @@ -515,24 +541,21 @@ dependencies = [ [[package]] name = "burn-wgpu" -version = "0.12.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "231d2deb14a02838c29dd5e90d1a87a9578d76bda7b02d5c7a77e5440ef6ae95" +checksum = "1575890471123109c6aeb725c52ac649fa9e0013e2303f57dc534d5e0cb857e5" dependencies = [ "burn-common", "burn-compute", + "burn-fusion", + "burn-jit", "burn-tensor", "bytemuck", "derive-new", "futures-intrusive", "hashbrown 0.14.3", "log", - "num-traits", "pollster", - "rand", - "serde", - "spin", - "text_placeholder", "wgpu", ] @@ -553,7 +576,7 @@ checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -597,9 +620,9 @@ dependencies = [ [[package]] name = "candle-core" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db8659ea87ee8197d2fc627348916cce0561330ee7ae3874e771691d3cecb2f" +checksum = "6f1b20174c1707e20f4cb364a355b449803c03e9b0c9193324623cf9787a4e00" dependencies = [ "byteorder", "candle-kernels", @@ -612,7 +635,7 @@ dependencies = [ "rand", "rand_distr", "rayon", - "safetensors 0.4.2", + "safetensors 0.4.3", "thiserror", "yoke", "zip", @@ -620,9 +643,9 @@ dependencies = [ [[package]] name = "candle-kernels" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d80cdd5f1cc60d30ba61353cdba5accd0fbc4d4ef2fe707fcb5179a9821adbea" +checksum = "5845911a44164ebb73b56a0e23793ba1b583bad102af7400fe4768babc5815b2" dependencies = [ "bindgen_cuda", ] @@ -635,12 +658,13 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "cc" -version = "1.0.90" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -650,16 +674,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "chrono" -version = "0.4.37" +name = "cfg_aliases" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -736,10 +766,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] -name = "com-rs" -version = "0.2.1" +name = "com" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "com_macros_support" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "constant_time_eq" @@ -899,9 +954,9 @@ dependencies = [ [[package]] name = "d3d12" -version = "0.7.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20" +checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307" dependencies = [ "bitflags 2.5.0", "libloading 0.8.3", @@ -929,7 +984,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -940,7 +995,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -991,7 +1046,7 @@ checksum = "d150dea618e920167e5973d70ae6ece4385b7164e0d799fe7c122dd0a5d912ad" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -1050,15 +1105,15 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -1072,7 +1127,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -1159,9 +1214,6 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ - "futures-core", - "futures-sink", - "nanorand", "spin", ] @@ -1198,7 +1250,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -1289,7 +1341,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -1458,9 +1510,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "js-sys", @@ -1533,9 +1585,9 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b838b2db8f62c9447d483a4c28d251b67fee32741a82cb4d35e9eb4e9fdc5ab" +checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" [[package]] name = "gl_generator" @@ -1616,11 +1668,10 @@ dependencies = [ [[package]] name = "gpu-allocator" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40fe17c8a05d60c38c0a4e5a3c802f2f1ceb66b76c67d96ffb34bef0475a7fad" +checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" dependencies = [ - "backtrace", "log", "presser", "thiserror", @@ -1650,9 +1701,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51ee2dd2e4f378392eeff5d51618cd9a63166a2513846bbc55f21cfacd9199d4" +checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" dependencies = [ "bytes", "fnv", @@ -1669,9 +1720,9 @@ dependencies = [ [[package]] name = "half" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "bytemuck", "cfg-if", @@ -1719,14 +1770,14 @@ dependencies = [ [[package]] name = "hassle-rs" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 1.3.2", - "com-rs", + "bitflags 2.5.0", + "com", "libc", - "libloading 0.7.4", + "libloading 0.8.3", "thiserror", "widestring", "winapi", @@ -1873,9 +1924,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", @@ -1913,7 +1964,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-util", "native-tls", "tokio", @@ -1932,7 +1983,7 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.2.0", + "hyper 1.3.1", "pin-project-lite", "socket2", "tokio", @@ -1952,7 +2003,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core", ] [[package]] @@ -2066,10 +2117,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "jobserver" -version = "0.1.28" +name = "jni-sys" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jobserver" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] @@ -2144,7 +2201,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -2155,13 +2212,12 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.5.0", "libc", - "redox_syscall", ] [[package]] @@ -2364,9 +2420,9 @@ dependencies = [ [[package]] name = "naga" -version = "0.14.2" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae585df4b6514cf8842ac0f1ab4992edc975892704835b549cf818dc0191249e" +checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843" dependencies = [ "bit-set", "bitflags 2.5.0", @@ -2382,15 +2438,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "nanorand" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" -dependencies = [ - "getrandom", -] - [[package]] name = "native-tls" version = "0.2.11" @@ -2423,6 +2470,15 @@ dependencies = [ "rayon", ] +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +dependencies = [ + "jni-sys", +] + [[package]] name = "no-std-compat" version = "0.4.1" @@ -2607,7 +2663,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -2724,14 +2780,14 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2790,9 +2846,9 @@ checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -2805,9 +2861,9 @@ checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" [[package]] name = "pulp" -version = "0.18.9" +version = "0.18.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03457ac216146f43f921500bac4e892d5cd32b0479b929cbfc90f95cd6c599c2" +checksum = "e14989307e408d9f4245d4fda09a7b144a08114ba124e26cab60ab83dc98db10" dependencies = [ "bytemuck", "libm", @@ -2860,9 +2916,9 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" dependencies = [ "crossbeam-utils", "libc", @@ -2875,9 +2931,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2990,9 +3046,9 @@ dependencies = [ [[package]] name = "raw-window-handle" -version = "0.5.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +checksum = "8cc3bcbdb1ddfc11e700e62968e6b4cc9c75bb466464ad28fb61c5b2c964418b" [[package]] name = "rawpointer" @@ -3037,9 +3093,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", @@ -3083,11 +3139,11 @@ checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" [[package]] name = "reqwest" -version = "0.12.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d66674f2b6fb864665eea7a3c1ac4e3dfacd2fda83cf6f935a612e01b0e3338" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ - "base64", + "base64 0.22.0", "bytes", "encoding_rs", "futures-core", @@ -3096,7 +3152,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -3140,9 +3196,9 @@ dependencies = [ [[package]] name = "rmp" -version = "0.8.12" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" dependencies = [ "byteorder", "num-traits", @@ -3151,9 +3207,9 @@ dependencies = [ [[package]] name = "rmp-serde" -version = "1.1.2" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" +checksum = "938a142ab806f18b88a97b0dea523d39e0fd730a064b035726adcfc58a8a5188" dependencies = [ "byteorder", "rmp", @@ -3188,9 +3244,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", "errno", @@ -3201,9 +3257,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", "ring", @@ -3215,24 +3271,25 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64", + "base64 0.22.0", + "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" dependencies = [ "ring", "rustls-pki-types", @@ -3241,9 +3298,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ryu" @@ -3263,9 +3320,9 @@ dependencies = [ [[package]] name = "safetensors" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d980e6bfb34436fb0a81e42bc41af43f11805bbbca443e7f68e9faaabe669ed" +checksum = "8ced76b22c7fba1162f11a5a75d9d8405264b467a07ae0c9c29be119b9297db9" dependencies = [ "serde", "serde_json", @@ -3328,9 +3385,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -3341,9 +3398,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" dependencies = [ "core-foundation-sys", "libc", @@ -3357,9 +3414,9 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] @@ -3387,13 +3444,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -3409,9 +3466,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -3430,13 +3487,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -3472,11 +3529,11 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.7.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ - "base64", + "base64 0.22.0", "chrono", "hex", "indexmap 1.9.3", @@ -3490,14 +3547,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.7.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -3578,9 +3635,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -3645,12 +3702,11 @@ dependencies = [ [[package]] name = "spirv" -version = "0.2.0+1.5.4" +version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 1.3.2", - "num-traits", + "bitflags 2.5.0", ] [[package]] @@ -3700,7 +3756,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -3722,9 +3778,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.55" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -3739,9 +3795,9 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sync_wrapper" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384595c11a4e2969895cad5a8c4029115f5ab956a9e5ef4de79d11a426e5f20c" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "synstructure" @@ -3751,7 +3807,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -3770,9 +3826,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.29.11" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd727fc423c2060f6c92d9534cef765c65a6ed3f428a03d7def74a8c4348e666" +checksum = "87341a165d73787554941cd5ef55ad728011566fe714e987d1b976c15dbc3a83" dependencies = [ "cfg-if", "core-foundation-sys", @@ -3780,7 +3836,7 @@ dependencies = [ "ntapi", "once_cell", "rayon", - "winapi", + "windows", ] [[package]] @@ -3869,22 +3925,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -3929,9 +3985,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -3952,9 +4008,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -4000,7 +4056,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -4249,7 +4305,7 @@ version = "2.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11f214ce18d8b2cbe84ed3aa6486ed3f5b285cf8d8fbdbce9f3f767a724adc35" dependencies = [ - "base64", + "base64 0.21.7", "flate2", "log", "once_cell", @@ -4354,7 +4410,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", "wasm-bindgen-shared", ] @@ -4388,7 +4444,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4401,9 +4457,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -4436,13 +4492,13 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "wgpu" -version = "0.18.0" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e7d227c9f961f2061c26f4cb0fbd4df0ef37e056edd0931783599d6c94ef24" +checksum = "cbd7311dbd2abcfebaabf1841a2824ed7c8be443a0f29166e5d3c6a53a762c01" dependencies = [ "arrayvec", "cfg-if", - "flume", + "cfg_aliases", "js-sys", "log", "naga", @@ -4461,16 +4517,19 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.18.1" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef91c1d62d1e9e81c79e600131a258edf75c9531cbdbde09c44a011a47312726" +checksum = "28b94525fc99ba9e5c9a9e24764f2bc29bad0911a7446c12f446a8277369bf3a" dependencies = [ "arrayvec", "bit-vec", "bitflags 2.5.0", + "cfg_aliases", "codespan-reporting", + "indexmap 2.2.6", "log", "naga", + "once_cell", "parking_lot", "profiling", "raw-window-handle", @@ -4484,9 +4543,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.18.1" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84ecc802da3eb67b4cf3dd9ea6fe45bbb47ef13e6c49c5c3240868a9cc6cdd9" +checksum = "fc1a4924366df7ab41a5d8546d6534f1f33231aa5b3f72b9930e300f254e39c3" dependencies = [ "android_system_properties", "arrayvec", @@ -4494,6 +4553,7 @@ dependencies = [ "bit-set", "bitflags 2.5.0", "block", + "cfg_aliases", "core-graphics-types", "d3d12", "glow", @@ -4509,6 +4569,7 @@ dependencies = [ "log", "metal", "naga", + "ndk-sys", "objc", "once_cell", "parking_lot", @@ -4527,9 +4588,9 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.18.0" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d5ed5f0edf0de351fe311c53304986315ce866f394a2e6df0c4b3c70774bcdd" +checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805" dependencies = [ "bitflags 2.5.0", "js-sys", @@ -4538,9 +4599,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -4560,11 +4621,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "134306a13c5647ad6453e8deaec55d3a44d6021970129e6188735e74bf546697" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -4575,21 +4636,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core 0.51.1", - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-core" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" -dependencies = [ - "windows-targets 0.48.5", + "windows-core", + "windows-targets 0.52.5", ] [[package]] @@ -4598,7 +4650,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -4616,7 +4668,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -4636,17 +4688,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -4657,9 +4710,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -4669,9 +4722,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -4681,9 +4734,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -4693,9 +4752,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -4705,9 +4764,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -4717,9 +4776,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -4729,15 +4788,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winreg" -version = "0.50.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if", "windows-sys 0.48.0", @@ -4752,14 +4811,14 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] name = "xml-rs" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" +checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" [[package]] name = "yoke" @@ -4781,7 +4840,7 @@ checksum = "9e6936f0cce458098a201c245a11bef556c6a0181129c7034d10d76d1ec3a2b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", "synstructure", ] @@ -4802,7 +4861,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", ] [[package]] @@ -4822,7 +4881,7 @@ checksum = "e6a647510471d372f2e6c2e6b7219e44d8c574d24fdc11c610a61455782f18c3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.60", "synstructure", ] diff --git a/Cargo.toml b/Cargo.toml index 4d5abc1..6321653 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,9 +24,9 @@ codegen-units = 1 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -axum = "0.7.4" +axum = "0.7.5" dotenv = "0.15.0" -tokio = { version = "1.32.0", features = [ +tokio = { version = "1.37.0", features = [ "macros", "rt-multi-thread", ] } @@ -34,29 +34,29 @@ tokio-tungstenite = { version = "0.21.0", features = [ "tokio-native-tls", "native-tls", ] } -log = "0.4.20" -log4rs = "1.2.0" -serde = "1.0.188" -serde_json = "1.0.105" -serde_repr = "0.1.18" -serde_with = "3.6.1" -serde-aux = "4.4.0" -futures-util = "0.3.28" -reqwest = { version = "0.12.0", features = [ +log = "0.4.21" +log4rs = "1.3.0" +serde = "1.0.201" +serde_json = "1.0.117" +serde_repr = "0.1.19" +serde_with = "3.8.1" +serde-aux = "4.5.0" +futures-util = "0.3.30" +reqwest = { version = "0.12.4", features = [ "json", ] } -http = "1.0.0" -governor = "0.6.0" +http = "1.1.0" +governor = "0.6.3" clickhouse = { version = "0.11.6", features = [ "watch", "time", "uuid", ] } -uuid = { version = "1.6.1", features = [ +uuid = { version = "1.8.0", features = [ "serde", "v4", ] } -time = { version = "0.3.31", features = [ +time = { version = "0.3.36", features = [ "serde", "serde-well-known", "serde-human-readable", @@ -67,19 +67,20 @@ time = { version = "0.3.31", features = [ backoff = { version = "0.4.0", features = [ "tokio", ] } -regex = "1.10.3" -async-trait = "0.1.77" +regex = "1.10.4" +async-trait = "0.1.80" itertools = "0.12.1" lazy_static = "1.4.0" nonempty = { version = "0.10.0", features = [ "serialize", ] } rand = "0.8.5" -rayon = "1.9.0" -burn = { version = "0.12.1", features = [ +rayon = "1.10.0" +burn = { version = "0.13.2", features = [ "wgpu", "cuda", "tui", + "metrics", "train", ] } diff --git a/src/bin/qrust/threads/data/websocket/news.rs b/src/bin/qrust/threads/data/websocket/news.rs index 5121d81..49d9fdd 100644 --- a/src/bin/qrust/threads/data/websocket/news.rs +++ b/src/bin/qrust/threads/data/websocket/news.rs @@ -8,7 +8,10 @@ use qrust::{ types::{alpaca::websocket, News}, utils::ONE_SECOND, }; -use std::{collections::HashMap, sync::Arc}; +use std::{ + collections::{HashMap, HashSet}, + sync::Arc, +}; use tokio::sync::{Mutex, RwLock}; pub struct Handler { @@ -37,6 +40,7 @@ impl super::Handler for Handler { unreachable!() }; + let symbols = symbols.into_iter().collect::>(); let mut state = state.write().await; let newly_subscribed = state diff --git a/src/lib/qrust/ml/batcher.rs b/src/lib/qrust/ml/batcher.rs index 6fda083..7197981 100644 --- a/src/lib/qrust/ml/batcher.rs +++ b/src/lib/qrust/ml/batcher.rs @@ -5,6 +5,7 @@ use burn::{ }; use rayon::iter::{IntoParallelIterator, ParallelIterator}; +#[derive(Clone, Debug)] pub struct BarWindowBatcher { pub device: B::Device, } diff --git a/src/lib/qrust/ml/dataset.rs b/src/lib/qrust/ml/dataset.rs index c3a3776..73e0e3a 100644 --- a/src/lib/qrust/ml/dataset.rs +++ b/src/lib/qrust/ml/dataset.rs @@ -1,12 +1,11 @@ use crate::types::{ - ta::{calculate_indicators, HEAD_SIZE, NUMERICAL_FIELD_COUNT}, + ta::{calculate_indicators, IndicatedBar, HEAD_SIZE, NUMERICAL_FIELD_COUNT}, Bar, }; use burn::{ data::dataset::{transform::ComposedDataset, Dataset}, tensor::Data, }; -use itertools::Itertools; pub const WINDOW_SIZE: usize = 48; @@ -28,8 +27,11 @@ struct SingleSymbolDataset { impl SingleSymbolDataset { #[allow(clippy::cast_possible_truncation)] - pub fn new(bars: Vec) -> Self { - let bars = calculate_indicators(&bars); + pub fn new(bars: Vec) -> Self { + if !bars.is_empty() { + let symbol = &bars[0].symbol; + assert!(bars.iter().all(|bar| bar.symbol == *symbol)); + } let (hours, days, numerical, targets) = bars.windows(2).skip(HEAD_SIZE - 1).fold( ( @@ -54,48 +56,27 @@ impl SingleSymbolDataset { (bar[0].volume_pct as f32).min(f32::MAX), bar[0].trades as f32, (bar[0].trades_pct as f32).min(f32::MAX), - bar[0].close_deriv as f32, - (bar[0].close_deriv_pct as f32).min(f32::MAX), bar[0].sma_3 as f32, - (bar[0].sma_3_pct as f32).min(f32::MAX), bar[0].sma_6 as f32, - (bar[0].sma_6_pct as f32).min(f32::MAX), bar[0].sma_12 as f32, - (bar[0].sma_12_pct as f32).min(f32::MAX), bar[0].sma_24 as f32, - (bar[0].sma_24_pct as f32).min(f32::MAX), bar[0].sma_48 as f32, - (bar[0].sma_48_pct as f32).min(f32::MAX), bar[0].sma_72 as f32, - (bar[0].sma_72_pct as f32).min(f32::MAX), bar[0].ema_3 as f32, - (bar[0].ema_3_pct as f32).min(f32::MAX), bar[0].ema_6 as f32, - (bar[0].ema_6_pct as f32).min(f32::MAX), bar[0].ema_12 as f32, - (bar[0].ema_12_pct as f32).min(f32::MAX), bar[0].ema_24 as f32, - (bar[0].ema_24_pct as f32).min(f32::MAX), bar[0].ema_48 as f32, - (bar[0].ema_48_pct as f32).min(f32::MAX), bar[0].ema_72 as f32, - (bar[0].ema_72_pct as f32).min(f32::MAX), bar[0].macd as f32, - (bar[0].macd_pct as f32).min(f32::MAX), bar[0].macd_signal as f32, - (bar[0].macd_signal_pct as f32).min(f32::MAX), bar[0].obv as f32, - (bar[0].obv_pct as f32).min(f32::MAX), bar[0].rsi as f32, - (bar[0].rsi_pct as f32).min(f32::MAX), bar[0].bbands_lower as f32, - (bar[0].bbands_lower_pct as f32).min(f32::MAX), bar[0].bbands_mean as f32, - (bar[0].bbands_mean_pct as f32).min(f32::MAX), bar[0].bbands_upper as f32, - (bar[0].bbands_upper_pct as f32).min(f32::MAX), ]); - targets.push(bar[1].close as f32); + targets.push(bar[1].close_pct as f32); (hours, days, numerical, targets) }, ); @@ -141,13 +122,10 @@ pub struct MultipleSymbolDataset { impl MultipleSymbolDataset { pub fn new(bars: Vec) -> Self { - let groups = bars + let groups = calculate_indicators(bars) .into_iter() - .group_by(|bar| bar.symbol.clone()) - .into_iter() - .map(|(_, group)| group.collect::>()) .map(SingleSymbolDataset::new) - .collect(); + .collect::>(); Self { composed_dataset: ComposedDataset::new(groups), @@ -174,7 +152,7 @@ mod tests { }; use time::OffsetDateTime; - fn generate_random_dataset(length: usize) -> SingleSymbolDataset { + fn generate_random_dataset(length: usize) -> MultipleSymbolDataset { let mut rng = rand::thread_rng(); let uniform = Uniform::new(1.0, 100.0); let mut bars = Vec::with_capacity(length); @@ -192,7 +170,7 @@ mod tests { }); } - SingleSymbolDataset::new(bars) + MultipleSymbolDataset::new(bars) } #[test] @@ -210,8 +188,6 @@ mod tests { let item = dataset.get(0).unwrap(); - assert_eq!(item.hours.shape.dims, [WINDOW_SIZE]); - assert_eq!(item.days.shape.dims, [WINDOW_SIZE]); assert_eq!( item.numerical.shape.dims, [WINDOW_SIZE, NUMERICAL_FIELD_COUNT] @@ -226,8 +202,6 @@ mod tests { let item = dataset.get(dataset.len() - 1).unwrap(); - assert_eq!(item.hours.shape.dims, [WINDOW_SIZE]); - assert_eq!(item.days.shape.dims, [WINDOW_SIZE]); assert_eq!( item.numerical.shape.dims, [WINDOW_SIZE, NUMERICAL_FIELD_COUNT] diff --git a/src/lib/qrust/ml/model.rs b/src/lib/qrust/ml/model.rs index 519dd87..c129a9d 100644 --- a/src/lib/qrust/ml/model.rs +++ b/src/lib/qrust/ml/model.rs @@ -4,7 +4,7 @@ use burn::{ config::Config, module::Module, nn::{ - loss::{MSELoss, Reduction}, + loss::{MseLoss, Reduction}, Dropout, DropoutConfig, Embedding, EmbeddingConfig, Linear, LinearConfig, Lstm, LstmConfig, }, tensor::{ @@ -79,13 +79,13 @@ impl Model { let x = Tensor::cat(vec![hour, day, numerical], 2); - let (x, _) = self.lstm_1.forward(x, None); + let (_, x) = self.lstm_1.forward(x, None); let x = self.dropout_1.forward(x); - let (x, _) = self.lstm_2.forward(x, None); + let (_, x) = self.lstm_2.forward(x, None); let x = self.dropout_2.forward(x); - let (x, _) = self.lstm_3.forward(x, None); + let (_, x) = self.lstm_3.forward(x, None); let x = self.dropout_3.forward(x); - let (x, _) = self.lstm_4.forward(x, None); + let (_, x) = self.lstm_4.forward(x, None); let x = self.dropout_4.forward(x); let [batch_size, window_size, features] = x.shape().dims; @@ -104,7 +104,7 @@ impl Model { target: Tensor, ) -> RegressionOutput { let output = self.forward(hour, day, numerical); - let loss = MSELoss::new().forward(output.clone(), target.clone(), Reduction::Mean); + let loss = MseLoss::new().forward(output.clone(), target.clone(), Reduction::Mean); RegressionOutput::new(loss, output, target) } diff --git a/src/lib/qrust/types/alpaca/websocket/data/incoming/subscription.rs b/src/lib/qrust/types/alpaca/websocket/data/incoming/subscription.rs index 6e05afd..1b3c73a 100644 --- a/src/lib/qrust/types/alpaca/websocket/data/incoming/subscription.rs +++ b/src/lib/qrust/types/alpaca/websocket/data/incoming/subscription.rs @@ -6,13 +6,13 @@ use serde::Deserialize; pub enum Message { #[serde(rename_all = "camelCase")] Market { - trades: Vec, - quotes: Vec, bars: Vec, updated_bars: Vec, - daily_bars: Vec, + statuses: Vec, + trades: Option>, + quotes: Option>, + daily_bars: Option>, orderbooks: Option>, - statuses: Option>, lulds: Option>, cancel_errors: Option>, }, diff --git a/src/lib/qrust/types/ta.rs b/src/lib/qrust/types/ta.rs index 4dd1331..7ee908c 100644 --- a/src/lib/qrust/types/ta.rs +++ b/src/lib/qrust/types/ta.rs @@ -1,15 +1,21 @@ use super::Bar; use crate::ta::{Bbands, Deriv, Ema, Macd, Obv, Pct, Rsi, Sma}; +use clickhouse::Row; +use itertools::Itertools; use rayon::scope; use serde::{Deserialize, Serialize}; use std::num::NonZeroUsize; +use time::OffsetDateTime; pub const HEAD_SIZE: usize = 72; -pub const FIELD_COUNT: usize = 54; +pub const FIELD_COUNT: usize = 33; pub const NUMERICAL_FIELD_COUNT: usize = FIELD_COUNT - 2; -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Row)] pub struct IndicatedBar { + pub symbol: String, + #[serde(with = "clickhouse::serde::time::datetime")] + pub time: OffsetDateTime, pub hour: u8, pub day: u8, pub open: f64, @@ -24,53 +30,32 @@ pub struct IndicatedBar { pub volume_pct: f64, pub trades: f64, pub trades_pct: f64, - pub close_deriv: f64, - pub close_deriv_pct: f64, pub sma_3: f64, - pub sma_3_pct: f64, pub sma_6: f64, - pub sma_6_pct: f64, pub sma_12: f64, - pub sma_12_pct: f64, pub sma_24: f64, - pub sma_24_pct: f64, pub sma_48: f64, - pub sma_48_pct: f64, pub sma_72: f64, - pub sma_72_pct: f64, pub ema_3: f64, - pub ema_3_pct: f64, pub ema_6: f64, - pub ema_6_pct: f64, pub ema_12: f64, - pub ema_12_pct: f64, pub ema_24: f64, - pub ema_24_pct: f64, pub ema_48: f64, - pub ema_48_pct: f64, pub ema_72: f64, - pub ema_72_pct: f64, pub macd: f64, - pub macd_pct: f64, pub macd_signal: f64, - pub macd_signal_pct: f64, pub obv: f64, - pub obv_pct: f64, pub rsi: f64, - pub rsi_pct: f64, pub bbands_lower: f64, - pub bbands_lower_pct: f64, pub bbands_mean: f64, - pub bbands_mean_pct: f64, pub bbands_upper: f64, - pub bbands_upper_pct: f64, } #[allow(clippy::too_many_lines)] -pub fn calculate_indicators(bars: &[Bar]) -> Vec { +fn _calculate_indicators(bars: &[Bar]) -> Vec { let length = bars.len(); - let (hour, day, open, high, low, close, volume, trades) = bars.iter().fold( + let (symbol, time, hour, day, open, high, low, close, volume, trades) = bars.iter().fold( ( Vec::with_capacity(length), Vec::with_capacity(length), @@ -80,9 +65,24 @@ pub fn calculate_indicators(bars: &[Bar]) -> Vec { Vec::with_capacity(length), Vec::with_capacity(length), Vec::with_capacity(length), + Vec::with_capacity(length), + Vec::with_capacity(length), + ), + |( + mut symbol, + mut time, + mut hour, + mut day, + mut open, + mut high, + mut low, + mut close, + mut volume, + mut trades, ), - |(mut hour, mut day, mut open, mut high, mut low, mut close, mut volume, mut trades), bar| { + symbol.push(bar.symbol.clone()); + time.push(bar.time); hour.push(bar.time.hour()); day.push(bar.time.day()); open.push(bar.open); @@ -91,7 +91,9 @@ pub fn calculate_indicators(bars: &[Bar]) -> Vec { close.push(bar.close); volume.push(bar.volume); trades.push(bar.trades as f64); - (hour, day, open, high, low, close, volume, trades) + ( + symbol, time, hour, day, open, high, low, close, volume, trades, + ) }, ); @@ -167,26 +169,6 @@ pub fn calculate_indicators(bars: &[Bar]) -> Vec { let mut close_pct = Vec::with_capacity(length); let mut volume_pct = Vec::with_capacity(length); let mut trades_pct = Vec::with_capacity(length); - let mut close_deriv_pct = Vec::with_capacity(length); - let mut sma_3_pct = Vec::with_capacity(length); - let mut sma_6_pct = Vec::with_capacity(length); - let mut sma_12_pct = Vec::with_capacity(length); - let mut sma_24_pct = Vec::with_capacity(length); - let mut sma_48_pct = Vec::with_capacity(length); - let mut sma_72_pct = Vec::with_capacity(length); - let mut ema_3_pct = Vec::with_capacity(length); - let mut ema_6_pct = Vec::with_capacity(length); - let mut ema_12_pct = Vec::with_capacity(length); - let mut ema_24_pct = Vec::with_capacity(length); - let mut ema_48_pct = Vec::with_capacity(length); - let mut ema_72_pct = Vec::with_capacity(length); - let mut macd_pct = Vec::with_capacity(length); - let mut macd_signal_pct = Vec::with_capacity(length); - let mut obv_pct = Vec::with_capacity(length); - let mut rsi_pct = Vec::with_capacity(length); - let mut bbands_upper_pct = Vec::with_capacity(length); - let mut bbands_mean_pct = Vec::with_capacity(length); - let mut bbands_lower_pct = Vec::with_capacity(length); scope(|s| { s.spawn(|_| open_pct.extend(open.iter().pct())); @@ -195,31 +177,13 @@ pub fn calculate_indicators(bars: &[Bar]) -> Vec { s.spawn(|_| close_pct.extend(close.iter().pct())); s.spawn(|_| volume_pct.extend(volume.iter().pct())); s.spawn(|_| trades_pct.extend(trades.iter().pct())); - s.spawn(|_| close_deriv_pct.extend(close_deriv.iter().pct())); - s.spawn(|_| sma_3_pct.extend(sma_3.iter().pct())); - s.spawn(|_| sma_6_pct.extend(sma_6.iter().pct())); - s.spawn(|_| sma_12_pct.extend(sma_12.iter().pct())); - s.spawn(|_| sma_24_pct.extend(sma_24.iter().pct())); - s.spawn(|_| sma_48_pct.extend(sma_48.iter().pct())); - s.spawn(|_| sma_72_pct.extend(sma_72.iter().pct())); - s.spawn(|_| ema_3_pct.extend(ema_3.iter().pct())); - s.spawn(|_| ema_6_pct.extend(ema_6.iter().pct())); - s.spawn(|_| ema_12_pct.extend(ema_12.iter().pct())); - s.spawn(|_| ema_24_pct.extend(ema_24.iter().pct())); - s.spawn(|_| ema_48_pct.extend(ema_48.iter().pct())); - s.spawn(|_| ema_72_pct.extend(ema_72.iter().pct())); - s.spawn(|_| macd_pct.extend(macd.iter().pct())); - s.spawn(|_| macd_signal_pct.extend(macd_signal.iter().pct())); - s.spawn(|_| obv_pct.extend(obv.iter().pct())); - s.spawn(|_| rsi_pct.extend(rsi.iter().pct())); - s.spawn(|_| bbands_upper_pct.extend(bbands_upper.iter().pct())); - s.spawn(|_| bbands_mean_pct.extend(bbands_mean.iter().pct())); - s.spawn(|_| bbands_lower_pct.extend(bbands_lower.iter().pct())); }); bars.iter() .enumerate() .map(|(i, _)| IndicatedBar { + symbol: symbol[i].clone(), + time: time[i], hour: hour[i], day: day[i], open: open[i], @@ -234,50 +198,49 @@ pub fn calculate_indicators(bars: &[Bar]) -> Vec { volume_pct: volume_pct[i], trades: trades[i], trades_pct: trades_pct[i], - close_deriv: close_deriv[i], - close_deriv_pct: close_deriv_pct[i], sma_3: sma_3[i], - sma_3_pct: sma_3_pct[i], sma_6: sma_6[i], - sma_6_pct: sma_6_pct[i], sma_12: sma_12[i], - sma_12_pct: sma_12_pct[i], sma_24: sma_24[i], - sma_24_pct: sma_24_pct[i], sma_48: sma_48[i], - sma_48_pct: sma_48_pct[i], sma_72: sma_72[i], - sma_72_pct: sma_72_pct[i], ema_3: ema_3[i], - ema_3_pct: ema_3_pct[i], ema_6: ema_6[i], - ema_6_pct: ema_6_pct[i], ema_12: ema_12[i], - ema_12_pct: ema_12_pct[i], ema_24: ema_24[i], - ema_24_pct: ema_24_pct[i], ema_48: ema_48[i], - ema_48_pct: ema_48_pct[i], ema_72: ema_72[i], - ema_72_pct: ema_72_pct[i], macd: macd[i], - macd_pct: macd_pct[i], macd_signal: macd_signal[i], - macd_signal_pct: macd_signal_pct[i], obv: obv[i], - obv_pct: obv_pct[i], rsi: rsi[i], - rsi_pct: rsi_pct[i], bbands_lower: bbands_lower[i], - bbands_lower_pct: bbands_lower_pct[i], bbands_mean: bbands_mean[i], - bbands_mean_pct: bbands_mean_pct[i], bbands_upper: bbands_upper[i], - bbands_upper_pct: bbands_upper_pct[i], }) .collect() } +pub fn calculate_indicators(bars: I) -> Vec> +where + I: IntoIterator, +{ + bars.into_iter() + .filter(|bar| { + bar.open > 0.0 + && bar.high > 0.0 + && bar.low > 0.0 + && bar.close > 0.0 + && bar.volume > 0.0 + && bar.trades > 0 + }) + .sorted_by_key(|bar| (bar.symbol.clone(), bar.time)) + .group_by(|bar| bar.symbol.clone()) + .into_iter() + .map(|(_, group)| _calculate_indicators(&group.collect::>())) + .collect::>() +} + #[cfg(test)] mod tests { use super::*; @@ -285,7 +248,6 @@ mod tests { distributions::{Distribution, Uniform}, Rng, }; - use time::OffsetDateTime; #[test] fn test_calculate_indicators() { @@ -308,8 +270,8 @@ mod tests { }); } - let indicated_bars = calculate_indicators(&bars); + let indicated_bars = calculate_indicators(bars); - assert_eq!(indicated_bars.len(), length); + assert_eq!(indicated_bars[0].len(), length); } } diff --git a/support/clickhouse/docker-entrypoint-initdb.d/0000_init.sql b/support/clickhouse/docker-entrypoint-initdb.d/0000_init.sql index b4659b2..5b6fe05 100644 --- a/support/clickhouse/docker-entrypoint-initdb.d/0000_init.sql +++ b/support/clickhouse/docker-entrypoint-initdb.d/0000_init.sql @@ -1,3 +1,5 @@ +CREATE DATABASE IF NOT EXISTS qrust; + CREATE TABLE IF NOT EXISTS qrust.assets ( symbol LowCardinality(String), class Enum('us_equity' = 1, 'crypto' = 2),