diff --git a/Cargo.lock b/Cargo.lock index 004a1bb..c213c72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -45,13 +45,22 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" dependencies = [ "memchr", ] +[[package]] +name = "aligned" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee4508988c62edf04abd8d92897fca0c2995d907ce1dfeaf369dac3716a40685" +dependencies = [ + "as-slice", +] + [[package]] name = "aligned-vec" version = "0.6.4" @@ -63,9 +72,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.100" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "approx" @@ -78,9 +87,9 @@ dependencies = [ [[package]] name = "arbitrary" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" +checksum = "3bc62ac97cc33321f50863d514c3bc38a453947a8f9e781137e47c7401020aed" [[package]] name = "arg_enum_proc_macro" @@ -90,14 +99,23 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.119", ] [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" + +[[package]] +name = "as-slice" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" +dependencies = [ + "stable_deref_trait", +] [[package]] name = "aspect" @@ -114,7 +132,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea4f672ac5290272725e1453014af99a86d2c1712808d647f469bf9427519f41" dependencies = [ - "indexmap 1.9.3", + "indexmap", "proc-macro2", "quote", "syn 1.0.109", @@ -163,9 +181,29 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "av-scenechange" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394" +dependencies = [ + "aligned", + "anyhow", + "arg_enum_proc_macro", + "arrayvec", + "log", + "num-rational", + "num-traits", + "pastey", + "rayon", + "thiserror", + "v_frame", + "y4m", +] [[package]] name = "av1-grain" @@ -183,18 +221,18 @@ dependencies = [ [[package]] name = "avif-serialize" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c8fbc0f831f4519fe8b810b6a7a91410ec83031b8233f730a0480029f6a23f" +checksum = "e7178fe5f7d460b13895ebb9dcb28a3a6216d2df2574a0806cb51b555d297f38" dependencies = [ "arrayvec", ] [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bindgen" @@ -212,8 +250,8 @@ dependencies = [ "quote", "regex", "rustc-hash", - "shlex", - "syn 2.0.108", + "shlex 1.3.0", + "syn 2.0.119", ] [[package]] @@ -224,27 +262,30 @@ checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" [[package]] name = "bitflags" -version = "2.10.0" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" [[package]] name = "bitstream-io" -version = "2.6.0" +version = "4.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6099cdc01846bc367c4e7dd630dc5966dccf36b652fae7a74e17b640411a91b2" +checksum = "7eff00be299a18769011411c9def0d827e8f2d7bf0c3dbf53633147a8867fd1f" +dependencies = [ + "no_std_io2", +] [[package]] name = "built" -version = "0.7.7" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b" +checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "bwapi_wrapper" @@ -258,9 +299,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.24.0" +version = "1.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" [[package]] name = "byteorder" @@ -276,14 +317,14 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "cc" -version = "1.2.44" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37521ac7aabe3d13122dc382493e20c9416f299d2ccd5b3a5340a2570cdeb0f3" +checksum = "6651c9ed80effdc7db0ff72512157f901af5e3549e341e24b1dd4887d836d838" dependencies = [ "find-msvc-tools", "jobserver", "libc", - "shlex", + "shlex 2.0.1", ] [[package]] @@ -295,27 +336,17 @@ dependencies = [ "nom 7.1.3", ] -[[package]] -name = "cfg-expr" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" -dependencies = [ - "smallvec", - "target-lexicon", -] - [[package]] name = "cfg-if" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" [[package]] name = "clang-sys" -version = "1.8.1" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a" dependencies = [ "glob", "libc", @@ -339,27 +370,27 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.5.0" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +checksum = "01a7799fd6b852db0e61728dde9a204c423b44d689dbd432522543614b490e78" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.15" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +checksum = "98b0cc327b5bc766e7fda9c9260cc0fa81b43a8e240440422dff70788e3f9ef1" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -367,18 +398,18 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.18" +version = "0.9.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.21" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" [[package]] name = "crunchy" @@ -404,7 +435,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.119", "unicode-xid", ] @@ -421,9 +452,9 @@ dependencies = [ [[package]] name = "either" -version = "1.15.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" [[package]] name = "equator" @@ -442,15 +473,9 @@ checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.119", ] -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - [[package]] name = "example_bot" version = "3.6.3" @@ -460,14 +485,16 @@ dependencies = [ [[package]] name = "exr" -version = "1.73.0" +version = "1.74.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83197f59927b46c04a183a619b7c29df34e63e63c7869320862268c0ef687e0" +checksum = "711fe42c9964295e01ee3fba3f9fe0e1d24b98886950d68efe81b1c76e21adf3" dependencies = [ "bit_field", "half", "lebe", - "miniz_oxide", + "miniz_oxide 0.8.9", + "num-complex", + "pulp", "rayon-core", "smallvec", "zune-inflate", @@ -475,23 +502,9 @@ dependencies = [ [[package]] name = "fax" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab" -dependencies = [ - "fax_derive", -] - -[[package]] -name = "fax_derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.108", -] +checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a" [[package]] name = "fdeflate" @@ -504,25 +517,50 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.4" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" +checksum = "aedcfb3409746eddb02b9e19ebda1c3394f759a152e48ee875a0844d1b955484" [[package]] name = "flate2" -version = "1.1.5" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" +checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.9.1", + "zlib-rs", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", ] [[package]] name = "getrandom" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", "js-sys", @@ -539,15 +577,26 @@ checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "libc", - "r-efi", + "r-efi 5.3.0", "wasip2", ] +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", +] + [[package]] name = "gif" -version = "0.13.3" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b" +checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159" dependencies = [ "color_quant", "weezl", @@ -555,9 +604,9 @@ dependencies = [ [[package]] name = "glob" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" [[package]] name = "half" @@ -585,23 +634,17 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" - [[package]] name = "hdrhistogram" -version = "7.5.4" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" +checksum = "f49d1053f4708f0af3cf9fc5bffc7e68a914a3c45becb231c80068c9c3f78bea" dependencies = [ "base64", "byteorder", "crossbeam-channel", "flate2", - "nom 7.1.3", + "nom 8.0.0", "num-traits", ] @@ -621,17 +664,11 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - [[package]] name = "image" -version = "0.25.8" +version = "0.25.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529feb3e6769d234375c4cf1ee2ce713682b8e76538cb13f9fc23e1400a591e7" +checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" dependencies = [ "bytemuck", "byteorder-lite", @@ -663,27 +700,27 @@ dependencies = [ [[package]] name = "imageproc" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2393fb7808960751a52e8a154f67e7dd3f8a2ef9bd80d1553078a7b4e8ed3f0d" +checksum = "602b4e8a4cc3e98372b766cd184ab532999bc0e839b7469e759511ccabc65d77" dependencies = [ "ab_glyph", "approx", - "getrandom 0.2.16", + "getrandom 0.2.17", "image", "itertools 0.12.1", "nalgebra", "num", - "rand", + "rand 0.8.8", "rand_distr", "rayon", ] [[package]] name = "imgref" -version = "1.12.0" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c5cedc30da3a610cac6b4ba17597bdf7152cf974e8aab3afb3d54455e371c8" +checksum = "6e44b0a4eaa4c82f441d50a963f2d5f05a787240aeee097597033e72accfd22f" [[package]] name = "indexmap" @@ -692,17 +729,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" -dependencies = [ - "equivalent", - "hashbrown 0.16.0", + "hashbrown", ] [[package]] @@ -722,7 +749,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.119", ] [[package]] @@ -754,21 +781,22 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" dependencies = [ - "getrandom 0.3.4", + "getrandom 0.4.3", "libc", ] [[package]] name = "js-sys" -version = "0.3.82" +version = "0.3.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65" +checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5" dependencies = [ - "once_cell", + "cfg-if", + "futures-util", "wasm-bindgen", ] @@ -780,15 +808,15 @@ checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" [[package]] name = "libc" -version = "0.2.177" +version = "0.2.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" +checksum = "ce5d3ddc6d3fa000eb1536d85e147bfe31aacaba692ed6a876f95cb7c855be78" [[package]] name = "libfuzzer-sys" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5037190e1f70cbeef565bd267599242926f724d3b8a9f510fd7e0b540cfa4404" +checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2" dependencies = [ "arbitrary", "cc", @@ -806,9 +834,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "lock_api" @@ -821,9 +849,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.28" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" [[package]] name = "loop9" @@ -836,9 +864,9 @@ dependencies = [ [[package]] name = "matrixmultiply" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" +checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7" dependencies = [ "autocfg", "rawpointer", @@ -856,9 +884,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.6" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "metered" @@ -882,8 +910,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5ef9d33baa693e2d449d069f6ef6eb549762ed0c0179976c45bd98f3aa4a4e1" dependencies = [ "aspect-weave", - "heck 0.4.1", - "indexmap 1.9.3", + "heck", + "indexmap", "proc-macro2", "quote", "syn 1.0.109", @@ -906,11 +934,21 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "miniz_oxide" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" +dependencies = [ + "adler2", + "simd-adler32", +] + [[package]] name = "moxcms" -version = "0.7.9" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbdd3d7436f8b5e892b8b7ea114271ff0fa00bc5acae845d53b07d498616ef6" +checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" dependencies = [ "num-traits", "pxfm", @@ -937,6 +975,15 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +[[package]] +name = "no_std_io2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418abd1b6d34fbf6cae440dc874771b0525a604428704c76e48b29a5e67b8003" +dependencies = [ + "memchr", +] + [[package]] name = "nom" version = "7.1.3" @@ -978,9 +1025,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" dependencies = [ "num-integer", "num-traits", @@ -992,6 +1039,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ + "bytemuck", "num-traits", ] @@ -1003,25 +1051,24 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.119", ] [[package]] name = "num-integer" -version = "0.1.46" +version = "0.1.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" dependencies = [ "num-traits", ] [[package]] name = "num-iter" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -1049,9 +1096,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "owned_ttf_parser" @@ -1101,22 +1148,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "pkg-config" -version = "0.3.32" +name = "pastey" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "png" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0" +checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" dependencies = [ "bitflags", "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.8.9", ] [[package]] @@ -1135,46 +1188,66 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.108", + "syn 2.0.119", ] [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" +checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5" dependencies = [ "profiling-procmacros", ] [[package]] name = "profiling-procmacros" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b" +checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb" dependencies = [ "quote", - "syn 2.0.108", + "syn 2.0.119", ] [[package]] -name = "pxfm" -version = "0.1.25" +name = "pulp" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3cbdf373972bf78df4d3b518d07003938e2c7d1fb5891e55f9cb6df57009d84" +checksum = "046aa45b989642ec2e4717c8e72d677b13edd831a4d3b6cf37d9a3e54912496a" dependencies = [ - "num-traits", + "bytemuck", + "cfg-if", + "libm", + "num-complex", + "paste", + "pulp-wasm-simd-flag", + "raw-cpuid", + "reborrow", + "version_check", ] +[[package]] +name = "pulp-wasm-simd-flag" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d8f70e07b9c3962945a74e59ca1c511bba65b6419468acc217c457d93f3c740" + +[[package]] +name = "pxfm" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea" + [[package]] name = "qoi" version = "0.4.1" @@ -1192,9 +1265,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quote" -version = "1.0.41" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ "proc-macro2", ] @@ -1205,15 +1278,31 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + [[package]] name = "rand" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", ] [[package]] @@ -1223,7 +1312,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[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]] @@ -1232,7 +1331,16 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.16", + "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]] @@ -1242,24 +1350,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" dependencies = [ "num-traits", - "rand", + "rand 0.8.8", ] [[package]] name = "rav1e" -version = "0.7.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" +checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b" dependencies = [ + "aligned-vec", "arbitrary", "arg_enum_proc_macro", "arrayvec", + "av-scenechange", "av1-grain", "bitstream-io", "built", "cfg-if", "interpolate_name", - "itertools 0.12.1", + "itertools 0.14.0", "libc", "libfuzzer-sys", "log", @@ -1268,13 +1378,11 @@ dependencies = [ "noop_proc_macro", "num-derive", "num-traits", - "once_cell", "paste", "profiling", - "rand", - "rand_chacha", + "rand 0.9.5", + "rand_chacha 0.9.0", "simd_helpers", - "system-deps", "thiserror", "v_frame", "wasm-bindgen", @@ -1282,9 +1390,9 @@ dependencies = [ [[package]] name = "ravif" -version = "0.11.20" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5825c26fddd16ab9f515930d49028a630efec172e903483c94796cfe31893e6b" +checksum = "e52310197d971b0f5be7fe6b57530dcd27beb35c1b013f29d66c1ad73fbbcc45" dependencies = [ "avif-serialize", "imgref", @@ -1295,6 +1403,15 @@ dependencies = [ "rgb", ] +[[package]] +name = "raw-cpuid" +version = "11.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" +dependencies = [ + "bitflags", +] + [[package]] name = "rawpointer" version = "0.2.1" @@ -1303,9 +1420,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" dependencies = [ "either", "rayon-core", @@ -1321,6 +1438,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "reborrow" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430" + [[package]] name = "redox_syscall" version = "0.5.18" @@ -1332,9 +1455,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" dependencies = [ "aho-corasick", "memchr", @@ -1344,9 +1467,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.13" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" dependencies = [ "aho-corasick", "memchr", @@ -1355,15 +1478,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "rgb" -version = "0.8.52" +version = "0.8.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c6a884d2998352bb4daf0183589aec883f16a6da1f4dde84d8e2e9a5409a1ce" +checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4" [[package]] name = "rsbwapi" @@ -1376,6 +1499,7 @@ dependencies = [ "imageproc", "inflate", "itertools 0.14.0", + "libc", "memchr", "metered", "num-derive", @@ -1399,9 +1523,9 @@ dependencies = [ [[package]] name = "rustc-hash" -version = "2.1.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" [[package]] name = "rusttype" @@ -1415,9 +1539,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" [[package]] name = "safe_arch" @@ -1436,9 +1560,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" dependencies = [ "serde_core", "serde_derive", @@ -1446,38 +1570,35 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 3.0.9", ] [[package]] -name = "serde_spanned" -version = "0.6.9" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" -dependencies = [ - "serde", -] +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "shlex" -version = "1.3.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "simba" @@ -1494,9 +1615,9 @@ dependencies = [ [[package]] name = "simd-adler32" -version = "0.3.7" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" [[package]] name = "simd_helpers" @@ -1507,11 +1628,17 @@ dependencies = [ "quote", ] +[[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" +version = "1.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "5b3dc8af474f516a851ff4bd12db780f948b9250ad37211e4eec0bccea54e01b" [[package]] name = "stable_deref_trait" @@ -1532,9 +1659,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.108" +version = "2.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" dependencies = [ "proc-macro2", "quote", @@ -1542,60 +1669,52 @@ dependencies = [ ] [[package]] -name = "synattra" -version = "0.2.1" +name = "syn" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "378cd5695f9ef5a26668bb70e81a464e7de6144bac3f77f42d5fa596c690be63" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" dependencies = [ - "auto_enums", "proc-macro2", - "syn 1.0.109", + "quote", + "unicode-ident", ] [[package]] -name = "system-deps" -version = "6.2.2" +name = "synattra" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +checksum = "378cd5695f9ef5a26668bb70e81a464e7de6144bac3f77f42d5fa596c690be63" dependencies = [ - "cfg-expr", - "heck 0.5.0", - "pkg-config", - "toml", - "version-compare", + "auto_enums", + "proc-macro2", + "syn 1.0.109", ] -[[package]] -name = "target-lexicon" -version = "0.12.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" - [[package]] name = "thiserror" -version = "1.0.69" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.69" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 3.0.9", ] [[package]] name = "tiff" -version = "0.10.3" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af9605de7fee8d9551863fd692cce7637f548dbd9db9180fcc07ccc6d26c336f" +checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52" dependencies = [ "fax", "flate2", @@ -1605,40 +1724,6 @@ dependencies = [ "zune-jpeg", ] -[[package]] -name = "toml" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" -dependencies = [ - "indexmap 2.12.0", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - [[package]] name = "ttf-parser" version = "0.15.2" @@ -1653,21 +1738,21 @@ checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" [[package]] name = "typenum" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "unicode-ident" -version = "1.0.22" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" [[package]] name = "unicode-segmentation" -version = "1.12.0" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] name = "unicode-xid" @@ -1686,12 +1771,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "version-compare" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" - [[package]] name = "version_check" version = "0.9.5" @@ -1706,18 +1785,18 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.1+wasi-0.2.4" +version = "1.0.4+wasi-0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.105" +version = "0.2.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60" +checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409" dependencies = [ "cfg-if", "once_cell", @@ -1728,9 +1807,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.105" +version = "0.2.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2" +checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1738,31 +1817,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.105" +version = "0.2.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc" +checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.108", + "syn 3.0.9", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.105" +version = "0.2.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76" +checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6" dependencies = [ "unicode-ident", ] [[package]] name = "weezl" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3" +checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" [[package]] name = "wide" @@ -1803,45 +1882,48 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] -name = "winnow" -version = "0.7.13" +name = "wit-bindgen" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" -dependencies = [ - "memchr", -] +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] -name = "wit-bindgen" -version = "0.46.0" +name = "y4m" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" +checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448" [[package]] name = "zerocopy" -version = "0.8.27" +version = "0.8.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +checksum = "86502bf56ac7c77571a32e2647bb2a15894565e981fb2a48d7bde2d91c965a9d" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.27" +version = "0.8.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +checksum = "5457206954b06561e2608c7e19cf58b1926586d999c246eebe4502f7e2039d1a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.119", ] +[[package]] +name = "zlib-rs" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" + [[package]] name = "zune-core" -version = "0.4.12" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" +checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b" [[package]] name = "zune-inflate" @@ -1854,9 +1936,9 @@ dependencies = [ [[package]] name = "zune-jpeg" -version = "0.4.21" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713" +checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296" dependencies = [ "zune-core", ] diff --git a/Cargo.toml b/Cargo.toml index 97ed45e..de04ae5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,7 @@ num-derive.workspace = true derive_more.workspace = true bwapi_wrapper = { path = "bwapi_wrapper", version = "3.6.3" } winapi = { version = "0.3", features = ["winbase", "memoryapi", "handleapi"] } +libc = "0.2" memchr = "2.7" rstar = "0.12" itertools = "0.14" diff --git a/bwapi_wrapper/build.rs b/bwapi_wrapper/build.rs index 2c9ac16..c0c7065 100644 --- a/bwapi_wrapper/build.rs +++ b/bwapi_wrapper/build.rs @@ -19,11 +19,6 @@ impl ParseCallbacks for FromPrimitiveDerive { } fn main() { - if env::var("CARGO_CFG_TARGET_OS").unwrap() != "windows" { - panic!( - "RSBWAPI does not yet support targeting OpenBW, please compile with a Windows target." - ); - } println!("cargo::rerun-if-changed=bwapi"); // The bindgen::Builder is the main entry point diff --git a/bwapi_wrapper/src/tech_type.rs b/bwapi_wrapper/src/tech_type.rs index a3a758d..ab65b00 100644 --- a/bwapi_wrapper/src/tech_type.rs +++ b/bwapi_wrapper/src/tech_type.rs @@ -14,7 +14,7 @@ pub(crate) struct TechTypeData { pub(crate) race: Race, pub(crate) name: &'static str, } -pub(crate) static TECH_TYPE_DATA: [TechTypeData; 38] = [ +pub(crate) static TECH_TYPE_DATA: [TechTypeData; 47] = [ TechTypeData { mineral_price: 100, gas_price: 100, @@ -591,6 +591,141 @@ pub(crate) static TECH_TYPE_DATA: [TechTypeData; 38] = [ race: Race::Terran, name: "Healing", }, + TechTypeData { + mineral_price: 0, + gas_price: 0, + what_uses: &[], + research_time: 0, + energy_cost: 0, + weapon: WeaponType::None, + targets_unit: false, + targets_position: false, + order: Order::None, + what_researches: UnitType::None, + required_unit: UnitType::None, + race: Race::None, + name: "Unused_35", + }, + TechTypeData { + mineral_price: 0, + gas_price: 0, + what_uses: &[], + research_time: 0, + energy_cost: 0, + weapon: WeaponType::None, + targets_unit: false, + targets_position: false, + order: Order::None, + what_researches: UnitType::None, + required_unit: UnitType::None, + race: Race::None, + name: "Unused_36", + }, + TechTypeData { + mineral_price: 0, + gas_price: 0, + what_uses: &[], + research_time: 0, + energy_cost: 0, + weapon: WeaponType::None, + targets_unit: false, + targets_position: false, + order: Order::None, + what_researches: UnitType::None, + required_unit: UnitType::None, + race: Race::None, + name: "Unused_37", + }, + TechTypeData { + mineral_price: 0, + gas_price: 0, + what_uses: &[], + research_time: 0, + energy_cost: 0, + weapon: WeaponType::None, + targets_unit: false, + targets_position: false, + order: Order::None, + what_researches: UnitType::None, + required_unit: UnitType::None, + race: Race::None, + name: "Unused_38", + }, + TechTypeData { + mineral_price: 0, + gas_price: 0, + what_uses: &[], + research_time: 0, + energy_cost: 0, + weapon: WeaponType::None, + targets_unit: false, + targets_position: false, + order: Order::None, + what_researches: UnitType::None, + required_unit: UnitType::None, + race: Race::None, + name: "Unused_39", + }, + TechTypeData { + mineral_price: 0, + gas_price: 0, + what_uses: &[], + research_time: 0, + energy_cost: 0, + weapon: WeaponType::None, + targets_unit: false, + targets_position: false, + order: Order::None, + what_researches: UnitType::None, + required_unit: UnitType::None, + race: Race::None, + name: "Unused_40", + }, + TechTypeData { + mineral_price: 0, + gas_price: 0, + what_uses: &[], + research_time: 0, + energy_cost: 0, + weapon: WeaponType::None, + targets_unit: false, + targets_position: false, + order: Order::None, + what_researches: UnitType::None, + required_unit: UnitType::None, + race: Race::None, + name: "Unused_41", + }, + TechTypeData { + mineral_price: 0, + gas_price: 0, + what_uses: &[], + research_time: 0, + energy_cost: 0, + weapon: WeaponType::None, + targets_unit: false, + targets_position: false, + order: Order::None, + what_researches: UnitType::None, + required_unit: UnitType::None, + race: Race::None, + name: "Unused_42", + }, + TechTypeData { + mineral_price: 0, + gas_price: 0, + what_uses: &[], + research_time: 0, + energy_cost: 0, + weapon: WeaponType::None, + targets_unit: false, + targets_position: false, + order: Order::None, + what_researches: UnitType::None, + required_unit: UnitType::None, + race: Race::None, + name: "Unused_43", + }, TechTypeData { mineral_price: 0, gas_price: 0, diff --git a/bwapi_wrapper/src/upgrade_type.rs b/bwapi_wrapper/src/upgrade_type.rs index 658929f..dc6f02b 100644 --- a/bwapi_wrapper/src/upgrade_type.rs +++ b/bwapi_wrapper/src/upgrade_type.rs @@ -9,7 +9,7 @@ pub(crate) struct UpgradeTypeData { pub(crate) upgrade_time_factor: i32, pub(crate) name: &'static str, } -pub(crate) static UPGRADE_TYPE_DATA: [UpgradeTypeData; 54] = [ +pub(crate) static UPGRADE_TYPE_DATA: [UpgradeTypeData; 63] = [ UpgradeTypeData { what_uses: &[ UnitType::Terran_Marine, @@ -654,6 +654,26 @@ pub(crate) static UPGRADE_TYPE_DATA: [UpgradeTypeData; 54] = [ upgrade_time_factor: 0, name: "Khaydarin_Core", }, + UpgradeTypeData { + what_uses: &[], + gas_price_factor: 0, + max_repeats: 0, + race: Race::None, + mineral_price_factor: 0, + what_upgrades: UnitType::None, + upgrade_time_factor: 0, + name: "Upgrade_45", + }, + UpgradeTypeData { + what_uses: &[], + gas_price_factor: 0, + max_repeats: 0, + race: Race::None, + mineral_price_factor: 0, + what_upgrades: UnitType::None, + upgrade_time_factor: 0, + name: "Upgrade_46", + }, UpgradeTypeData { what_uses: &[UnitType::Protoss_Corsair], gas_price_factor: 0, @@ -664,6 +684,16 @@ pub(crate) static UPGRADE_TYPE_DATA: [UpgradeTypeData; 54] = [ upgrade_time_factor: 0, name: "Argus_Jewel", }, + UpgradeTypeData { + what_uses: &[], + gas_price_factor: 0, + max_repeats: 0, + race: Race::None, + mineral_price_factor: 0, + what_upgrades: UnitType::None, + upgrade_time_factor: 0, + name: "Upgrade_48", + }, UpgradeTypeData { what_uses: &[UnitType::Protoss_Dark_Archon], gas_price_factor: 0, @@ -674,6 +704,16 @@ pub(crate) static UPGRADE_TYPE_DATA: [UpgradeTypeData; 54] = [ upgrade_time_factor: 0, name: "Argus_Talisman", }, + UpgradeTypeData { + what_uses: &[], + gas_price_factor: 0, + max_repeats: 0, + race: Race::None, + mineral_price_factor: 0, + what_upgrades: UnitType::None, + upgrade_time_factor: 0, + name: "Upgrade_50", + }, UpgradeTypeData { what_uses: &[UnitType::Terran_Medic], gas_price_factor: 0, @@ -714,6 +754,56 @@ pub(crate) static UPGRADE_TYPE_DATA: [UpgradeTypeData; 54] = [ upgrade_time_factor: 0, name: "Charon_Boosters", }, + UpgradeTypeData { + what_uses: &[], + gas_price_factor: 0, + max_repeats: 0, + race: Race::None, + mineral_price_factor: 0, + what_upgrades: UnitType::None, + upgrade_time_factor: 0, + name: "Upgrade_55", + }, + UpgradeTypeData { + what_uses: &[], + gas_price_factor: 0, + max_repeats: 0, + race: Race::None, + mineral_price_factor: 0, + what_upgrades: UnitType::None, + upgrade_time_factor: 0, + name: "Upgrade_56", + }, + UpgradeTypeData { + what_uses: &[], + gas_price_factor: 0, + max_repeats: 0, + race: Race::None, + mineral_price_factor: 0, + what_upgrades: UnitType::None, + upgrade_time_factor: 0, + name: "Upgrade_57", + }, + UpgradeTypeData { + what_uses: &[], + gas_price_factor: 0, + max_repeats: 0, + race: Race::None, + mineral_price_factor: 0, + what_upgrades: UnitType::None, + upgrade_time_factor: 0, + name: "Upgrade_58", + }, + UpgradeTypeData { + what_uses: &[], + gas_price_factor: 0, + max_repeats: 0, + race: Race::None, + mineral_price_factor: 0, + what_upgrades: UnitType::None, + upgrade_time_factor: 0, + name: "Upgrade_59", + }, UpgradeTypeData { what_uses: &[ UnitType::Terran_Vulture_Spider_Mine, @@ -789,3 +879,28 @@ impl UpgradeType { self.d().name } } + +#[cfg(test)] +mod row_tests { + use super::*; + use num_traits::FromPrimitive; + + #[test] + fn every_upgrade_and_tech_reads_its_own_row() { + for id in 0..UpgradeType::MAX as i32 { + if let Some(upgrade) = UpgradeType::from_i32(id) { + assert_eq!(upgrade.name(), format!("{upgrade:?}")); + } + } + for id in 0..TechType::MAX as i32 { + if let Some(tech) = TechType::from_i32(id) { + assert_eq!(tech.name(), format!("{tech:?}")); + } + } + for id in 0..WeaponType::MAX as i32 { + if let Some(weapon) = WeaponType::from_i32(id) { + assert_eq!(weapon.name(), format!("{weapon:?}")); + } + } + } +} diff --git a/src/can_do.rs b/src/can_do.rs index f2925e7..e252b67 100644 --- a/src/can_do.rs +++ b/src/can_do.rs @@ -227,7 +227,7 @@ impl CanBuild for (UnitType, bool, bool) { return Ok(false); } - if check_can_issue_command_type && unit.can_build(false)? { + if check_can_issue_command_type && !unit.can_build(false)? { return Ok(false); } @@ -437,7 +437,7 @@ impl CanMorph for bool { if unit.get_type().produces_larva() { if !unit.is_constructing() && unit.is_completed() - && !(unit.get_type().is_building() || unit.is_idle()) + && (!unit.get_type().is_building() || unit.is_idle()) { return Ok(true); } @@ -1028,7 +1028,7 @@ impl CanUnloadAllPosition for (Position, bool, bool) { return Ok(false); } - if check_can_issue_command_type && unit.can_unload_all_position(false)? { + if check_can_issue_command_type && !unit.can_unload_all_position(false)? { return Ok(false); } @@ -1170,7 +1170,7 @@ impl CanUseTechWithOrWithoutTarget for (TechType, bool, bool) { .self_() .expect("Self to exist") .has_researched(tech) - && unit.get_type() == UnitType::Zerg_Lurker + && unit.get_type() != UnitType::Zerg_Lurker { return Err(Error::Insufficient_Tech); } @@ -1203,7 +1203,7 @@ impl CanUseTechWithOrWithoutTarget for (TechType, bool, bool) { } } TechType::Burrowing => { - if unit.get_type().is_burrowable() { + if !unit.get_type().is_burrowable() { return Err(Error::Incompatible_UnitType); } if unit.is_burrowed() @@ -1234,6 +1234,9 @@ impl CanUseTechUnit for (TechType, bool, bool) { if check_can_issue_command_type && !unit.can_use_tech_with_or_without_target(false)? { return Ok(false); } + if !unit.can_use_tech_with_or_without_target((tech, false, false))? { + return Ok(false); + } if !tech.targets_unit() { return Err(Error::Incompatible_TechType); @@ -1283,7 +1286,7 @@ impl CanUseTechUnit for (TechType, &Unit, bool, bool, bool, bool) { if target_type != UnitType::Protoss_Dark_Templar { return Err(Error::Incompatible_UnitType); } - if target_unit.get_player() == unit.get_player() { + if target_unit.get_player() != unit.get_player() { return Err(Error::Unit_Not_Owned); } } @@ -1679,7 +1682,7 @@ impl Unit { { return Err(Error::Incompatible_State); } - if !self.is_completed() && !u_type.is_building() && self.is_morphing() { + if !self.is_completed() && !u_type.is_building() && !self.is_morphing() { return Err(Error::Incompatible_State); } Ok(true) @@ -2125,7 +2128,7 @@ impl Unit { if self.get_type().cloaking_tech() == TechType::None { return Err(Error::Incompatible_UnitType); } - if self.get_secondary_order() != Order::Cloak { + if self.get_secondary_order() == Order::Cloak { return Err(Error::Incompatible_State); } Ok(true) @@ -2297,7 +2300,7 @@ impl Unit { return Ok(false); } - if self.get_type().is_building() { + if !self.get_type().is_building() { return Err(Error::Incompatible_UnitType); } if self.is_completed() @@ -2313,7 +2316,7 @@ impl Unit { return Ok(false); } - if !self.get_addon().map(|a| a.is_completed()).unwrap_or(false) { + if self.get_addon().is_none_or(|addon| addon.is_completed()) { return Err(Error::Incompatible_UnitType); } Ok(true) @@ -2324,7 +2327,7 @@ impl Unit { return Ok(false); } - if self.get_order() == Order::ResearchTech { + if self.get_order() != Order::ResearchTech { return Err(Error::Incompatible_State); } Ok(true) @@ -2371,7 +2374,7 @@ impl CanResearch for (&Unit, bool) { return Ok(false); } - if unit.is_lifted() || !unit.is_idle() || unit.is_completed() { + if unit.is_lifted() || !unit.is_idle() || !unit.is_completed() { return Err(Error::Unit_Busy); } Ok(true) @@ -2390,9 +2393,8 @@ impl CanResearch for (Option<&Unit>, TechType, bool) { if !unit.get_type().is_successor_of(type_.what_researches()) { return Err(Error::Incompatible_UnitType); } - if check_can_issue_command_type && unit.is_lifted() - || !unit.is_idle() - || !unit.is_completed() + if check_can_issue_command_type + && (unit.is_lifted() || !unit.is_idle() || !unit.is_completed()) { return Err(Error::Unit_Busy); } @@ -2403,7 +2405,7 @@ impl CanResearch for (Option<&Unit>, TechType, bool) { if self_.has_researched(type_) { return Err(Error::Already_Researched); } - if self_.is_research_available(type_) { + if !self_.is_research_available(type_) { return Err(Error::Access_Denied); } if self_.minerals() < type_.mineral_price() { @@ -2549,3 +2551,112 @@ impl Game { checker.can_target_unit(self) } } + +#[cfg(test)] +mod tests { + use crate::game::Game; + use crate::shm::Shm; + use bwapi_wrapper::BWAPI_GameData; + use crate::*; + + const SCV: usize = 0; + const HATCHERY: usize = 1; + const FACTORY: usize = 2; + const MACHINE_SHOP: usize = 3; + const ACADEMY: usize = 4; + + /// A game where player 0 owns idle, completed, powered units of the given types. + fn game(setup: impl FnOnce(&mut BWAPI_GameData)) -> Game { + let types = [ + UnitType::Terran_SCV, + UnitType::Zerg_Hatchery, + UnitType::Terran_Factory, + UnitType::Terran_Machine_Shop, + UnitType::Terran_Academy, + ]; + let words = std::mem::size_of::().div_ceil(8); + let buffer: &'static mut [u64] = Box::leak(vec![0u64; words].into_boxed_slice()); + let bytes = + unsafe { std::slice::from_raw_parts_mut(buffer.as_mut_ptr().cast::(), words * 8) }; + let data = unsafe { &mut *bytes.as_mut_ptr().cast::() }; + data.playerCount = 2; + data.self_ = 0; + data.players[0].minerals = 1000; + data.players[0].isUnitAvailable = [true; 234]; + for (index, &unit_type) in types.iter().enumerate() { + let unit = &mut data.units[index]; + unit.player = 0; + unit.type_ = unit_type as i32; + unit.exists = true; + unit.isCompleted = true; + unit.isIdle = true; + unit.isInterruptible = true; + unit.isPowered = true; + unit.order = Order::Nothing as i32; + unit.addon = -1; + unit.hatchery = -1; + unit.transport = -1; + data.players[0].allUnitCount[unit_type as usize] += 1; + data.players[0].completedUnitCount[unit_type as usize] += 1; + } + setup(data); + Game::new(Shm::from_mut_slice(bytes)) + } + + #[test] + fn an_idle_hatchery_without_larva_can_morph() { + let game = game(|_| {}); + assert_eq!(game.get_unit(HATCHERY).unwrap().can_morph(true), Ok(true)); + } + + #[test] + fn research_can_be_cancelled_only_while_researching() { + let researching = game(|data| data.units[ACADEMY].order = Order::ResearchTech as i32); + assert_eq!( + researching.get_unit(ACADEMY).unwrap().can_cancel_research(true), + Ok(true) + ); + let idle = game(|_| {}); + assert_eq!( + idle.get_unit(ACADEMY).unwrap().can_cancel_research(true), + Err(Error::Incompatible_State) + ); + } + + #[test] + fn only_an_unfinished_addon_can_be_cancelled() { + let building = game(|data| { + data.units[FACTORY].addon = MACHINE_SHOP as i32; + data.units[MACHINE_SHOP].isCompleted = false; + }); + assert_eq!(building.get_unit(FACTORY).unwrap().can_cancel_addon(true), Ok(true)); + let finished = game(|data| data.units[FACTORY].addon = MACHINE_SHOP as i32); + assert_eq!( + finished.get_unit(FACTORY).unwrap().can_cancel_addon(true), + Err(Error::Incompatible_UnitType) + ); + let none = game(|_| {}); + assert_eq!( + none.get_unit(FACTORY).unwrap().can_cancel_addon(true), + Err(Error::Incompatible_UnitType) + ); + } + + #[test] + fn a_worker_able_to_build_passes_the_command_type_check() { + let game = game(|_| {}); + let scv = game.get_unit(SCV).unwrap(); + assert_eq!(scv.can_build(true), Ok(true)); + assert_eq!(scv.can_build((UnitType::Terran_Supply_Depot, true, true)), Ok(true)); + } + + #[test] + fn unloading_at_a_position_sends_the_positional_command() { + let game = game(|_| {}); + let unit = game.get_unit(SCV).unwrap(); + let command = unit.unload_all_command(Some(Position::new(64, 96))); + assert_eq!(command.get_type(), UnitCommandType::Unload_All_Position); + assert_eq!((command.x, command.y), (64, 96)); + assert_eq!(unit.unload_all_command(None).get_type(), UnitCommandType::Unload_All); + } +} diff --git a/src/client.rs b/src/client.rs index 1d181d4..9d4c7d9 100644 --- a/src/client.rs +++ b/src/client.rs @@ -2,10 +2,14 @@ use crate::game::Game; use bwapi_wrapper::*; use std::ffi::CStr; +#[cfg(windows)] use std::fs::File; +#[cfg(windows)] use std::fs::OpenOptions; use std::io::Read; use std::io::Write; +#[cfg(unix)] +use std::os::unix::net::UnixStream; use std::thread; use std::time::Duration; @@ -15,10 +19,15 @@ use crate::aimodule::AiModule; use super::shm; pub struct Client { - pipe: File, + pipe: SyncStream, game: Game, } +#[cfg(windows)] +type SyncStream = File; +#[cfg(unix)] +type SyncStream = UnixStream; + pub trait ToStr { fn to_str(&self) -> &str; } @@ -39,7 +48,12 @@ impl ToStr for [i8] { impl Default for Client { fn default() -> Self { + #[cfg(unix)] + let selected_pid = std::env::var("RSBWAPI_SERVER_PID") + .ok() + .map(|pid| pid.parse::().expect("Invalid RSBWAPI_SERVER_PID")); 'outer: loop { + #[cfg(windows)] if let Some(game_table) = shm::map_memory::("Local\\bwapi_shared_memory_game_list") { @@ -78,6 +92,66 @@ impl Default for Client { println!("Game table mapping not found."); thread::sleep(Duration::from_millis(1000)); } + + #[cfg(unix)] + if let Some(pid) = selected_pid { + if let Some(game_data) = + shm::map_memory::(&format!("/bwapi_shared_memory_{pid}")) + { + if let Ok(mut pipe) = UnixStream::connect(format!("/tmp/bwapi_socket_{pid}")) { + let mut code = [0]; + if pipe.read_exact(&mut code).is_ok() && code[0] == 2 { + println!("Connected to {pid}"); + break 'outer Client { + pipe, + game: Game::new(game_data), + }; + } + } + } + thread::sleep(Duration::from_millis(100)); + continue; + } + + #[cfg(unix)] + if let Some(game_table) = + shm::map_memory::("/bwapi_shared_memory_game_list") + { + let mut instances: Vec<_> = game_table + .get() + .gameInstances + .iter() + .filter(|instance| { + instance.serverProcessID != 0 + && !instance.isConnected + && selected_pid.is_none_or(|pid| instance.serverProcessID == pid) + }) + .collect(); + instances.sort_by_key(|instance| std::cmp::Reverse(instance.lastKeepAliveTime)); + for instance in instances { + let pid = instance.serverProcessID; + // OpenBW unlinks the game mapping as soon as it accepts the socket. + let Some(game_data) = + shm::map_memory::(&format!("/bwapi_shared_memory_{pid}")) + else { + continue; + }; + let Ok(mut pipe) = UnixStream::connect(format!("/tmp/bwapi_socket_{pid}")) + else { + continue; + }; + let mut code = [0]; + if pipe.read_exact(&mut code).is_err() || code[0] != 2 { + continue; + } + println!("Connected to {pid}"); + break 'outer Client { + pipe, + game: Game::new(game_data), + }; + } + } + thread::sleep(Duration::from_millis(100)); } } } diff --git a/src/game.rs b/src/game.rs index 5f770c3..d3b60ca 100644 --- a/src/game.rs +++ b/src/game.rs @@ -75,6 +75,42 @@ impl PositionValidator for &Game { } } +/// Whether a ground unit of type `other` in the way stops `placed` being built; an addon pushes +/// units that can move aside. +fn blocks_placement(placed: UnitType, other: UnitType) -> bool { + !(placed.is_addon() && other.can_move()) +} + +/// Index into a `width` x `height` grid, or `None` when (x, y) is outside it. +fn grid_index(x: i32, y: i32, width: i32, height: i32) -> Option<(usize, usize)> { + if x < 0 || y < 0 || x >= width || y >= height { + None + } else { + Some((x as usize, y as usize)) + } +} + +#[cfg(test)] +mod placement_tests { + use super::*; + + #[test] + fn grid_index_rejects_positions_outside_the_map() { + assert_eq!(grid_index(-4, 0, 10, 10), None); + assert_eq!(grid_index(0, -1, 10, 10), None); + assert_eq!(grid_index(10, 0, 10, 10), None); + assert_eq!(grid_index(0, 10, 10, 10), None); + assert_eq!(grid_index(9, 9, 10, 10), Some((9, 9))); + } + + #[test] + fn an_addon_pushes_mobile_units_aside_but_a_building_does_not() { + assert!(!blocks_placement(UnitType::Terran_Comsat_Station, UnitType::Terran_SCV)); + assert!(blocks_placement(UnitType::Terran_Comsat_Station, UnitType::Terran_Supply_Depot)); + assert!(blocks_placement(UnitType::Terran_Barracks, UnitType::Terran_SCV)); + } +} + impl Game { pub(crate) fn match_start(&mut self) { *self.inner.visible_units.borrow_mut() = (0..self.data.initialUnitCount as usize) @@ -575,7 +611,7 @@ impl Game { }, ) .iter() - .any(|u| !(u.get_type().is_addon() && u.get_type().can_move())); + .any(|u| blocks_placement(type_, u.get_type())); if collides_with_units { return Ok(false); } @@ -634,10 +670,13 @@ impl Game { // A building can build an addon at a different location (i.e. automatically lifts (if not already lifted) // then lands at the new location before building the addon), so we need to do similar checks for the - // location that the building will be when it builds the addon. + // location that the building will be when it builds the addon. A landed building already stands + // there, so re-checking would apply new-building rules (e.g. the resource depot spacing) to it. if let Some(builder) = builder && !builder.get_type().is_addon() && type_.is_addon() + && (builder.is_lifted() + || builder.get_tile_position() != lt - TilePosition { x: 4, y: 1 }) && !self.can_build_here( builder, lt - TilePosition { x: 4, y: 1 }, @@ -863,7 +902,7 @@ impl Game { && addon != UnitType::None && addon.what_builds().0 == type_.what_builds().0 && (builder.get_addon().is_none() - || builder.get_addon().map(|a| a.get_type()) == Some(addon)) + || builder.get_addon().map(|a| a.get_type()) != Some(addon)) { return Err(Error::Insufficient_Tech); } @@ -929,7 +968,9 @@ impl Game { position: TP, size: TS, ) -> bool { - let position = position.into().to_position() + size.into().to_position() * 16; + // BWAPI checks the building's center: half its size in tiles, i.e. 16 pixels per tile. + let size = size.into(); + let position = position.into().to_position() + Position::new(size.x * 16, size.y * 16); self.has_power_precise(position) } @@ -990,22 +1031,34 @@ impl Game { pub fn is_walkable>(&self, wp: P) -> bool { let p = wp.into(); - self.data.isWalkable[p.x as usize][p.y as usize] + match grid_index(p.x, p.y, self.map_width() * 4, self.map_height() * 4) { + Some((x, y)) => self.data.isWalkable[x][y], + None => false, + } } pub fn is_visible>(&self, tp: P) -> bool { let p = tp.into(); - self.data.isVisible[p.x as usize][p.y as usize] + match grid_index(p.x, p.y, self.map_width(), self.map_height()) { + Some((x, y)) => self.data.isVisible[x][y], + None => false, + } } pub fn is_buildable>(&self, tp: P) -> bool { let p = tp.into(); - self.data.isBuildable[p.x as usize][p.y as usize] + match grid_index(p.x, p.y, self.map_width(), self.map_height()) { + Some((x, y)) => self.data.isBuildable[x][y], + None => false, + } } pub fn is_explored>(&self, tp: P) -> bool { let p = tp.into(); - self.data.isExplored[p.x as usize][p.y as usize] + match grid_index(p.x, p.y, self.map_width(), self.map_height()) { + Some((x, y)) => self.data.isExplored[x][y], + None => false, + } } pub fn is_gui_enabled(&self) -> bool { @@ -1030,12 +1083,18 @@ impl Game { pub fn has_creep>(&self, tp: P) -> bool { let p = tp.into(); - self.data.hasCreep[p.x as usize][p.y as usize] + match grid_index(p.x, p.y, self.map_width(), self.map_height()) { + Some((x, y)) => self.data.hasCreep[x][y], + None => false, + } } pub fn get_ground_height>(&self, tp: P) -> i32 { let p = tp.into(); - self.data.getGroundHeight[p.x as usize][p.y as usize] + match grid_index(p.x, p.y, self.map_width(), self.map_height()) { + Some((x, y)) => self.data.getGroundHeight[x][y], + None => 0, + } } pub fn get_instance_number(&self) -> i32 { diff --git a/src/shm.rs b/src/shm.rs index 5883c51..fa4e792 100644 --- a/src/shm.rs +++ b/src/shm.rs @@ -1,14 +1,16 @@ use core::ops::{Deref, DerefMut}; use core::ptr::NonNull; -#[cfg(windows)] +#[cfg(any(unix, windows))] use std::ffi::CString; +#[cfg(unix)] +use std::os::fd::FromRawFd; #[cfg(windows)] use winapi::shared::minwindef::FALSE; #[cfg(windows)] use winapi::um::handleapi::CloseHandle; #[cfg(windows)] -use winapi::um::memoryapi::{MapViewOfFile, FILE_MAP_READ, FILE_MAP_WRITE}; +use winapi::um::memoryapi::{FILE_MAP_READ, FILE_MAP_WRITE, MapViewOfFile}; #[cfg(windows)] use winapi::um::winbase::OpenFileMappingA; #[cfg(windows)] @@ -17,8 +19,8 @@ use winapi::um::winnt::HANDLE; #[cfg(windows)] pub(crate) struct Shm(HANDLE, NonNull); -#[cfg(not(windows))] -pub(crate) struct Shm((), NonNull); +#[cfg(unix)] +pub(crate) struct Shm(Option, NonNull); impl Deref for Shm { type Target = T; @@ -46,7 +48,22 @@ impl Shm { #[cfg(test)] pub fn from_mut_slice(data: &mut [u8]) -> Shm { - Self((), NonNull::new(data.as_mut_ptr()).unwrap().cast()) + #[cfg(unix)] + return Self(None, NonNull::new(data.as_mut_ptr()).unwrap().cast()); + #[cfg(windows)] + Self( + std::ptr::null_mut(), + NonNull::new(data.as_mut_ptr()).unwrap().cast(), + ) + } +} + +#[cfg(unix)] +impl Drop for Shm { + fn drop(&mut self) { + if self.0.is_some() { + unsafe { libc::munmap(self.1.as_ptr().cast(), std::mem::size_of::()) }; + } } } @@ -75,7 +92,33 @@ pub(crate) fn map_memory(name: &str) -> Option> { } } -#[cfg(not(windows))] -pub(crate) fn map_memory(_name: &str) -> Option> { - None +#[cfg(unix)] +pub(crate) fn map_memory(name: &str) -> Option> { + let name = CString::new(name).ok()?; + let fd = unsafe { libc::shm_open(name.as_ptr(), libc::O_RDWR, 0) }; + if fd < 0 { + return None; + } + let file = unsafe { std::fs::File::from_raw_fd(fd) }; + let size = std::mem::size_of::(); + let mut stat = std::mem::MaybeUninit::::uninit(); + if unsafe { libc::fstat(fd, stat.as_mut_ptr()) } != 0 + || unsafe { stat.assume_init().st_size } < size as libc::off_t + { + return None; + } + let mapped = unsafe { + libc::mmap( + std::ptr::null_mut(), + size, + libc::PROT_READ | libc::PROT_WRITE, + libc::MAP_SHARED, + fd, + 0, + ) + }; + if mapped == libc::MAP_FAILED { + return None; + } + Some(Shm(Some(file), NonNull::new(mapped.cast())?)) } diff --git a/src/unit.rs b/src/unit.rs index 7792cc5..3c6228c 100644 --- a/src/unit.rs +++ b/src/unit.rs @@ -343,6 +343,10 @@ impl Unit { self.inner.remainingResearchTime } + pub fn get_remaining_upgrade_time(&self) -> i32 { + self.inner.remainingUpgradeTime + } + pub fn get_remaining_train_time(&self) -> i32 { self.inner.remainingTrainTime } @@ -969,7 +973,7 @@ impl Unit { pub fn build_addon(&self, type_: UnitType) -> BwResult { self.issue_command(UnitCommand { extra: type_ as i32, - ..self.command_type(UnitCommandType::Build, false) + ..self.command_type(UnitCommandType::Build_Addon, false) }) } @@ -1123,18 +1127,17 @@ impl Unit { } pub fn unload_all, OP: Into>>(&self, target: OP) -> BwResult { - let target = target.into(); - if let Some(target) = target { - let target = target.into(); - self.issue_command(UnitCommand { + self.issue_command(self.unload_all_command(target.into().map(Into::into))) + } + + pub(crate) fn unload_all_command(&self, target: Option) -> UnitCommand { + match target { + Some(target) => UnitCommand { x: target.x, y: target.y, - ..self.command_type(UnitCommandType::Unload_All, false) - }) - } else { - self.issue_command(UnitCommand { - ..self.command_type(UnitCommandType::Unload_All, false) - }) + ..self.command_type(UnitCommandType::Unload_All_Position, false) + }, + None => self.command_type(UnitCommandType::Unload_All, false), } } @@ -1299,7 +1302,7 @@ impl UnitOrPosition for &Unit { fn assign_use_tech(&self, tech: TechType, cmd: &mut UnitCommand) { cmd.targetIndex = self.id as i32; cmd.extra = tech as i32; - cmd.type_._base = UnitCommandType::Use_Tech as u32; + cmd.type_._base = UnitCommandType::Use_Tech_Unit as u32; } fn to_position(&self) -> Result { if self.exists() { @@ -1334,7 +1337,7 @@ impl + Copy> UnitOrPosition for I { cmd.x = pos.x; cmd.y = pos.y; cmd.extra = tech as i32; - cmd.type_._base = UnitCommandType::Use_Tech as u32; + cmd.type_._base = UnitCommandType::Use_Tech_Position as u32; } fn to_position(&self) -> Result {