From 48dfac6f8b6a6b36fdb0469f5a393cb0725c18ce Mon Sep 17 00:00:00 2001 From: Youser Nayme <7685106-NeutralModder@users.noreply.gitlab.com> Date: Sun, 23 Jun 2024 10:40:04 -0400 Subject: [PATCH 1/6] Update hashbrown --- Cargo.lock | 30 +++++++++++++++--------------- Cargo.toml | 2 +- voxygen/src/ui/graphic/mod.rs | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b9cb8bd65d..f992855ad7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2802,8 +2802,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ "ahash 0.8.11", - "rayon", - "serde", ] [[package]] @@ -2814,6 +2812,8 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash 0.8.11", "allocator-api2", + "rayon", + "serde", ] [[package]] @@ -7075,7 +7075,7 @@ dependencies = [ "authc", "byteorder", "clap", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "hickory-resolver", "image", "num 0.4.3", @@ -7109,7 +7109,7 @@ dependencies = [ "fluent", "fluent-bundle", "fluent-syntax", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "intl-memoizer", "serde", "tracing", @@ -7133,7 +7133,7 @@ dependencies = [ "dot_vox", "enum-map", "fxhash", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "indexmap", "itertools 0.10.5", "kiddo", @@ -7171,7 +7171,7 @@ version = "0.10.0" dependencies = [ "assets_manager", "dot_vox", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "image", "lazy_static", "ron", @@ -7226,7 +7226,7 @@ dependencies = [ name = "veloren-common-i18n" version = "0.1.0" dependencies = [ - "hashbrown 0.13.2", + "hashbrown 0.14.5", "rand 0.8.5", "serde", ] @@ -7237,7 +7237,7 @@ version = "0.10.0" dependencies = [ "bincode", "flate2", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "image", "num-traits", "serde", @@ -7256,7 +7256,7 @@ dependencies = [ "bincode", "bytes", "futures", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "hex", "num_cpus", "rayon", @@ -7308,7 +7308,7 @@ dependencies = [ "criterion", "crossbeam-channel", "futures-util", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "lazy_static", "lz-fear", "prometheus", @@ -7336,7 +7336,7 @@ dependencies = [ "bitflags 2.5.0", "bytes", "criterion", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "prometheus", "rand 0.8.5", "tokio", @@ -7363,7 +7363,7 @@ dependencies = [ "atomic_refcell", "enum-map", "fxhash", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "itertools 0.10.5", "rand 0.8.5", "rand_chacha 0.3.1", @@ -7391,7 +7391,7 @@ dependencies = [ "drop_guard", "enum-map", "futures-util", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "humantime", "itertools 0.10.5", "lazy_static", @@ -7507,7 +7507,7 @@ dependencies = [ "gilrs", "glyph_brush", "guillotiere", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "iced_native", "iced_winit", "image", @@ -7609,7 +7609,7 @@ dependencies = [ "fixed", "flate2", "fxhash", - "hashbrown 0.13.2", + "hashbrown 0.14.5", "image", "indicatif", "itertools 0.10.5", diff --git a/Cargo.toml b/Cargo.toml index 6b372d3d2f..ebde6261a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -142,7 +142,7 @@ prometheus-hyper = "0.2" strum = { version = "0.24", features = ["derive"] } enum-map = { version = "2.4" } -hashbrown = { version = "0.13", features = ["rayon", "serde", "nightly"] } +hashbrown = { version = "0.14", features = ["rayon", "serde", "nightly"] } fxhash = { version = "0.2.1" } crossbeam-utils = { version = "0.8.1" } crossbeam-channel = { version = "0.5" } diff --git a/voxygen/src/ui/graphic/mod.rs b/voxygen/src/ui/graphic/mod.rs index 38a0c8f8a6..5019599a51 100644 --- a/voxygen/src/ui/graphic/mod.rs +++ b/voxygen/src/ui/graphic/mod.rs @@ -322,7 +322,7 @@ impl GraphicCache { } }); } else { - self.cache_map.drain_filter(|key, details| { + let _ = self.cache_map.extract_if(|key, details| { if key.graphic_id == id { match details { // NOTE: if replace_graphic is used continously for small images (i.e. From a1930b81d00143cb97ca791d6f7ade4c12f3eb3b Mon Sep 17 00:00:00 2001 From: Youser Nayme <7685106-NeutralModder@users.noreply.gitlab.com> Date: Sun, 23 Jun 2024 11:07:15 -0400 Subject: [PATCH 2/6] Update image --- Cargo.lock | 35 ++++++++-------- Cargo.toml | 2 +- common/net/src/msg/compression.rs | 38 ++++++++++------- world/examples/batch_generate.rs | 4 +- .../examples/chunk_compression_benchmarks.rs | 41 +++++++++++++------ world/examples/heightmap_visualization.rs | 2 +- 6 files changed, 75 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f992855ad7..c35fb25623 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1078,12 +1078,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - [[package]] name = "colorchoice" version = "1.0.1" @@ -3184,16 +3178,16 @@ dependencies = [ [[package]] name = "image" -version = "0.24.9" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +checksum = "fd54d660e773627692c524beaad361aca785a4f9f5730ce91f42aabe5bce3d11" dependencies = [ "bytemuck", "byteorder", - "color_quant", - "jpeg-decoder", "num-traits", "png", + "zune-core", + "zune-jpeg", ] [[package]] @@ -3463,12 +3457,6 @@ dependencies = [ "libc", ] -[[package]] -name = "jpeg-decoder" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" - [[package]] name = "js-sys" version = "0.3.69" @@ -9169,3 +9157,18 @@ dependencies = [ "cc", "pkg-config", ] + +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + +[[package]] +name = "zune-jpeg" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec866b44a2a1fd6133d363f073ca1b179f438f99e7e5bfb1e33f7181facfe448" +dependencies = [ + "zune-core", +] diff --git a/Cargo.toml b/Cargo.toml index ebde6261a1..db39d99bbe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -157,7 +157,7 @@ serde_json = { version = "1.0.50" } ron = { version = "0.8", default-features = false } specs = { version = "0.20", features = ["nightly"] } -image = { version = "0.24", default-features = false, features = ["png"] } +image = { version = "0.25", default-features = false, features = ["png"] } rayon = { version = "1.5" } clap = { version = "4.2", features = ["derive"] } diff --git a/common/net/src/msg/compression.rs b/common/net/src/msg/compression.rs index beed5715a0..f7073a6c03 100644 --- a/common/net/src/msg/compression.rs +++ b/common/net/src/msg/compression.rs @@ -9,7 +9,7 @@ use num_traits::cast::FromPrimitive; use serde::{Deserialize, Serialize}; use std::{ fmt::Debug, - io::{Read, Write}, + io::{Cursor, Read, Write}, marker::PhantomData, }; use tracing::warn; @@ -142,7 +142,7 @@ pub trait VoxelImageDecoding: VoxelImageEncoding { fn get_block(ws: &Self::Workspace, x: u32, y: u32, is_border: bool) -> Block; } -pub fn image_from_bytes<'a, I: ImageDecoder<'a>, P: 'static + Pixel>( +pub fn image_from_bytes>( decoder: I, ) -> Option>> { let (w, h) = decoder.dimensions(); @@ -249,8 +249,13 @@ impl VoxelImageEncoding for QuadPngEncoding { CompressionType::Fast, FilterType::Up, ); - png.write_image(x.as_raw(), x.width(), x.height(), image::ColorType::L8) - .ok()?; + png.write_image( + x.as_raw(), + x.width(), + x.height(), + image::ExtendedColorType::L8, + ) + .ok()?; indices[i] = buf.len(); Some(()) }; @@ -268,7 +273,7 @@ impl VoxelImageEncoding for QuadPngEncoding { ws.3.as_raw(), ws.3.width(), ws.3.height(), - image::ColorType::Rgb8, + image::ExtendedColorType::Rgb8, ) .ok()?; } @@ -339,10 +344,10 @@ impl VoxelImageDecoding for QuadPngEncoding { indices[1]..indices[2], indices[2]..quad.len(), ]; - let a = image_from_bytes(PngDecoder::new(&quad[ranges[0].clone()]).ok()?)?; - let b = image_from_bytes(PngDecoder::new(&quad[ranges[1].clone()]).ok()?)?; - let c = image_from_bytes(PngDecoder::new(&quad[ranges[2].clone()]).ok()?)?; - let d = image_from_bytes(PngDecoder::new(&quad[ranges[3].clone()]).ok()?)?; + let a = image_from_bytes(PngDecoder::new(Cursor::new(&quad[ranges[0].clone()])).ok()?)?; + let b = image_from_bytes(PngDecoder::new(Cursor::new(&quad[ranges[1].clone()])).ok()?)?; + let c = image_from_bytes(PngDecoder::new(Cursor::new(&quad[ranges[2].clone()])).ok()?)?; + let d = image_from_bytes(PngDecoder::new(Cursor::new(&quad[ranges[3].clone()])).ok()?)?; Some((a, b, c, d, sprite_data, HashMap::new())) } @@ -533,8 +538,13 @@ impl VoxelImageEncoding for TriPngEncoding VoxelImageDecoding for TriPngEncoding> = HashMap::new(); if AVERAGE_PALETTE { for i in 0..=255 { diff --git a/world/examples/batch_generate.rs b/world/examples/batch_generate.rs index 3f52973abd..b66b33975c 100644 --- a/world/examples/batch_generate.rs +++ b/world/examples/batch_generate.rs @@ -17,7 +17,7 @@ use common::{ uniform_idx_as_vec2, }, }; -use image::{codecs::png::PngEncoder, ColorType, DynamicImage, GenericImage, ImageEncoder}; +use image::{codecs::png::PngEncoder, DynamicImage, GenericImage, ImageEncoder}; use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; use rand::{thread_rng, Rng}; use rayon::ThreadPool; @@ -222,7 +222,7 @@ fn generate_one( image.as_bytes(), map_size_lg.chunks().x as u32, map_size_lg.chunks().y as u32, - ColorType::Rgba8, + image::ExtendedColorType::Rgba8, ) { error!(?error, "Could not write image data"); } diff --git a/world/examples/chunk_compression_benchmarks.rs b/world/examples/chunk_compression_benchmarks.rs index b8191d69eb..c33bf5025b 100644 --- a/world/examples/chunk_compression_benchmarks.rs +++ b/world/examples/chunk_compression_benchmarks.rs @@ -20,7 +20,7 @@ use rayon::ThreadPoolBuilder; use serde::{Deserialize, Serialize}; use std::{ collections::BTreeMap, - io::{Read, Write}, + io::{Cursor, Read, Write}, mem, sync::Arc, time::Instant, @@ -205,7 +205,7 @@ impl VoxelImageEncoding for PngEncoding { ws.0.as_raw(), ws.0.width(), ws.0.height(), - image::ColorType::Rgba8, + image::ExtendedColorType::Rgba8, ) .ok()?; Some((buf, ws.1.clone())) @@ -308,8 +308,13 @@ impl VoxelImageEncoding for MixedEncoding { CompressionType::Fast, FilterType::Up, ); - png.write_image(x.as_raw(), x.width(), x.height(), image::ColorType::L8) - .ok()?; + png.write_image( + x.as_raw(), + x.width(), + x.height(), + image::ExtendedColorType::L8, + ) + .ok()?; indices[i] = buf.len(); Some(()) }; @@ -337,14 +342,14 @@ impl VoxelImageDecoding for MixedEncoding { indices[2]..indices[3], indices[3]..quad.len(), ]; - let a = image_from_bytes(PngDecoder::new(&quad[ranges[0].clone()]).ok()?)?; - let b = image_from_bytes(PngDecoder::new(&quad[ranges[1].clone()]).ok()?)?; - let c = image_from_bytes(PngDecoder::new(&quad[ranges[2].clone()]).ok()?)?; + let a = image_from_bytes(PngDecoder::new(Cursor::new(&quad[ranges[0].clone()])).ok()?)?; + let b = image_from_bytes(PngDecoder::new(Cursor::new(&quad[ranges[1].clone()])).ok()?)?; + let c = image_from_bytes(PngDecoder::new(Cursor::new(&quad[ranges[2].clone()])).ok()?)?; let sprite_data = bincode::deserialize::>>(&quad[ranges[4].clone()]) .ok()? .decompress()?; - let d = image_from_bytes(JpegDecoder::new(&quad[ranges[3].clone()]).ok()?)?; + let d = image_from_bytes(JpegDecoder::new(Cursor::new(&quad[ranges[3].clone()])).ok()?)?; Some((a, b, c, d, sprite_data)) } @@ -417,7 +422,7 @@ impl VoxelImageEncoding for MixedEncodingSparseSprites { ws.0.as_raw(), ws.0.width(), ws.0.height(), - image::ColorType::L8, + image::ExtendedColorType::L8, ) .ok()?; let index = buf.len(); @@ -474,8 +479,13 @@ impl VoxelImageEncoding for MixedEncodingDenseSprites { CompressionType::Fast, FilterType::Up, ); - png.write_image(x.as_raw(), x.width(), x.height(), image::ColorType::L8) - .ok()?; + png.write_image( + x.as_raw(), + x.width(), + x.height(), + image::ExtendedColorType::L8, + ) + .ok()?; indices[i] = buf.len(); Some(()) }; @@ -650,8 +660,13 @@ impl<'a, NN: NearestNeighbor, const N: u32> VoxelImageEncoding for PaletteEncodi CompressionType::Fast, FilterType::Up, ); - png.write_image(x.as_raw(), x.width(), x.height(), image::ColorType::L8) - .ok()?; + png.write_image( + x.as_raw(), + x.width(), + x.height(), + image::ExtendedColorType::L8, + ) + .ok()?; indices[i] = buf.len(); Some(()) }; diff --git a/world/examples/heightmap_visualization.rs b/world/examples/heightmap_visualization.rs index 3b5ed27b29..97b5bb908c 100644 --- a/world/examples/heightmap_visualization.rs +++ b/world/examples/heightmap_visualization.rs @@ -87,7 +87,7 @@ fn image_from_function [u8; 3]>( heightmap.as_raw(), heightmap.width(), heightmap.height(), - image::ColorType::Rgb8, + image::ExtendedColorType::Rgb8, ) .unwrap(); let mut f = File::create(name).unwrap(); From 36d192a2f6b7dc11bab4cdc88b2aabb074cbb584 Mon Sep 17 00:00:00 2001 From: Youser Nayme <7685106-NeutralModder@users.noreply.gitlab.com> Date: Sun, 23 Jun 2024 11:17:07 -0400 Subject: [PATCH 3/6] Update chrono-tz --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c35fb25623..c089c30036 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -860,9 +860,9 @@ dependencies = [ [[package]] name = "chrono-tz" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e" +checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb" dependencies = [ "chrono", "chrono-tz-build", @@ -872,9 +872,9 @@ dependencies = [ [[package]] name = "chrono-tz-build" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433e39f13c9a060046954e0592a8d0a4bcb1040125cbf91cb8ee58964cfb350f" +checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1" dependencies = [ "parse-zoneinfo", "phf", diff --git a/Cargo.toml b/Cargo.toml index db39d99bbe..3b5f3c93e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -131,7 +131,7 @@ chrono = { version = "0.4.24", default-features = false, features = [ "wasmbind", "serde", ] } -chrono-tz = { version = "0.8", features = ["serde"] } +chrono-tz = { version = "0.9", features = ["serde"] } inline_tweak = { version = "1.0.8" } tokio = { version = "1.28", default-features = false, features = ["rt"] } From ca6bcaab7d3e0e32e4b6da9361d8e023795469e5 Mon Sep 17 00:00:00 2001 From: Youser Nayme <7685106-NeutralModder@users.noreply.gitlab.com> Date: Sun, 23 Jun 2024 11:54:16 -0400 Subject: [PATCH 4/6] Update strum and itertools --- Cargo.lock | 67 ++++++++++++++++------------------------ Cargo.toml | 4 +-- common/src/comp/admin.rs | 6 ++-- 3 files changed, 32 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c089c30036..a593d7064a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3386,6 +3386,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -5194,7 +5203,7 @@ dependencies = [ "lru", "paste", "stability", - "strum 0.26.2", + "strum", "unicode-segmentation", "unicode-width", ] @@ -6292,42 +6301,20 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.24.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.24.3", -] - -[[package]] -name = "strum" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" -dependencies = [ - "strum_macros 0.26.2", + "strum_macros", ] [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", - "proc-macro2 1.0.83", - "quote 1.0.36", - "rustversion", - "syn 1.0.109", -] - -[[package]] -name = "strum_macros" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" -dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2 1.0.83", "quote 1.0.36", "rustversion", @@ -7123,7 +7110,7 @@ dependencies = [ "fxhash", "hashbrown 0.14.5", "indexmap", - "itertools 0.10.5", + "itertools 0.13.0", "kiddo", "lazy_static", "num-derive", @@ -7143,7 +7130,7 @@ dependencies = [ "slotmap", "specs", "spin_sleep", - "strum 0.24.1", + "strum", "tracing", "tracing-subscriber", "uuid", @@ -7270,7 +7257,7 @@ dependencies = [ name = "veloren-common-systems" version = "0.10.0" dependencies = [ - "itertools 0.10.5", + "itertools 0.13.0", "ordered-float 3.9.2", "rand 0.8.5", "rayon", @@ -7352,7 +7339,7 @@ dependencies = [ "enum-map", "fxhash", "hashbrown 0.14.5", - "itertools 0.10.5", + "itertools 0.13.0", "rand 0.8.5", "rand_chacha 0.3.1", "rayon", @@ -7381,7 +7368,7 @@ dependencies = [ "futures-util", "hashbrown 0.14.5", "humantime", - "itertools 0.10.5", + "itertools 0.13.0", "lazy_static", "noise", "num_cpus", @@ -7400,7 +7387,7 @@ dependencies = [ "serde", "serde_json", "specs", - "strum 0.24.1", + "strum", "tokio", "tracing", "vek 0.17.0", @@ -7421,7 +7408,7 @@ dependencies = [ name = "veloren-server-agent" version = "0.1.0" dependencies = [ - "itertools 0.10.5", + "itertools 0.13.0", "lazy_static", "rand 0.8.5", "specs", @@ -7500,7 +7487,7 @@ dependencies = [ "iced_winit", "image", "inline_tweak", - "itertools 0.10.5", + "itertools 0.13.0", "keyboard-keynames", "lazy_static", "levenshtein", @@ -7520,7 +7507,7 @@ dependencies = [ "shaderc", "slab", "specs", - "strum 0.24.1", + "strum", "tokio", "tracing", "treeculler", @@ -7600,7 +7587,7 @@ dependencies = [ "hashbrown 0.14.5", "image", "indicatif", - "itertools 0.10.5", + "itertools 0.13.0", "kiddo", "lazy_static", "lz-fear", @@ -7617,7 +7604,7 @@ dependencies = [ "rusqlite", "serde", "signal-hook", - "strum 0.24.1", + "strum", "svg_fmt", "tracing", "tracing-subscriber", diff --git a/Cargo.toml b/Cargo.toml index 3b5f3c93e6..4149a47a1b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -140,7 +140,7 @@ futures-util = { version = "0.3.7", default-features = false } prometheus = { version = "0.13", default-features = false } prometheus-hyper = "0.2" -strum = { version = "0.24", features = ["derive"] } +strum = { version = "0.26.3", features = ["derive"] } enum-map = { version = "2.4" } hashbrown = { version = "0.14", features = ["rayon", "serde", "nightly"] } fxhash = { version = "0.2.1" } @@ -150,7 +150,7 @@ ordered-float = { version = "3", default-features = true } num = { version = "0.4" } num-traits = { version = "0.2" } vek = { version = "0.17.0", features = ["serde"] } -itertools = { version = "0.10" } +itertools = { version = "0.13" } serde = { version = "1.0.118", features = ["derive"] } serde_json = { version = "1.0.50" } diff --git a/common/src/comp/admin.rs b/common/src/comp/admin.rs index 5109098320..ed4bbd0a3d 100644 --- a/common/src/comp/admin.rs +++ b/common/src/comp/admin.rs @@ -1,11 +1,11 @@ use serde::{Deserialize, Serialize}; use specs::{Component, DerefFlaggedStorage, VecStorage}; -use strum::EnumVariantNames; +use strum::VariantNames; -// EnumVariantNames is used by bins for clap only, but using strum here gets rid +// VariantNames is used by bins for clap only, but using strum here gets rid // of the clap dependency #[derive( - Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize, EnumVariantNames, + Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize, VariantNames, )] pub enum AdminRole { Moderator = 0, From a12c320f8c476611aa6399b50057eb5a757441b5 Mon Sep 17 00:00:00 2001 From: Youser Nayme <7685106-NeutralModder@users.noreply.gitlab.com> Date: Sun, 23 Jun 2024 12:51:16 -0400 Subject: [PATCH 5/6] Update ordered-float --- Cargo.lock | 17 ++++------------- Cargo.toml | 2 +- world/src/sim/erosion.rs | 13 +++++++------ 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a593d7064a..9c593df767 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4582,15 +4582,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "ordered-float" -version = "3.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" -dependencies = [ - "num-traits", -] - [[package]] name = "ordered-float" version = "4.2.0" @@ -7115,7 +7106,7 @@ dependencies = [ "lazy_static", "num-derive", "num-traits", - "ordered-float 3.9.2", + "ordered-float 4.2.0", "petgraph 0.6.5", "rand 0.8.5", "rand_chacha 0.3.1", @@ -7258,7 +7249,7 @@ name = "veloren-common-systems" version = "0.10.0" dependencies = [ "itertools 0.13.0", - "ordered-float 3.9.2", + "ordered-float 4.2.0", "rand 0.8.5", "rayon", "specs", @@ -7496,7 +7487,7 @@ dependencies = [ "native-dialog", "num 0.4.3", "num_cpus", - "ordered-float 3.9.2", + "ordered-float 4.2.0", "rand 0.8.5", "rand_chacha 0.3.1", "rayon", @@ -7595,7 +7586,7 @@ dependencies = [ "noise", "num 0.4.3", "num-traits", - "ordered-float 3.9.2", + "ordered-float 4.2.0", "rand 0.8.5", "rand_chacha 0.3.1", "rayon", diff --git a/Cargo.toml b/Cargo.toml index 4149a47a1b..f9e196e052 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -146,7 +146,7 @@ hashbrown = { version = "0.14", features = ["rayon", "serde", "nightly"] } fxhash = { version = "0.2.1" } crossbeam-utils = { version = "0.8.1" } crossbeam-channel = { version = "0.5" } -ordered-float = { version = "3", default-features = true } +ordered-float = { version = "4.2", default-features = true } num = { version = "0.4" } num-traits = { version = "0.2" } vek = { version = "0.17.0", features = ["serde"] } diff --git a/world/src/sim/erosion.rs b/world/src/sim/erosion.rs index 1bcbcb0503..a968758db9 100644 --- a/world/src/sim/erosion.rs +++ b/world/src/sim/erosion.rs @@ -12,7 +12,7 @@ use tracing::{debug, error, info, warn}; use itertools::izip; use noise::NoiseFn; use num::{Float, Zero}; -use ordered_float::NotNan; +use ordered_float::{FloatCore, NotNan}; use rayon::prelude::*; use std::{ cmp::{Ordering, Reverse}, @@ -1253,7 +1253,7 @@ fn erode( // Egress with no outgoing flows. // wh for oceans is always at least min_erosion_height. let uplift_i = uplift(posi) as Alt; - wh[posi] = min_erosion_height.max(h_t_i + uplift_i); + wh[posi] = FloatCore::max(min_erosion_height, h_t_i + uplift_i); lake_sill[stacki] = posi as isize; lake_water_volume[stacki] = 0.0; } else { @@ -1335,7 +1335,8 @@ fn erode( if mask_kk.any() { let h_j = rec_heights_kk; let elev_j = h_j; - let dh = 0.0.max(new_h_i as SimdType - elev_j); + let dh = + FloatCore::max(0.0, new_h_i as SimdType - elev_j); let powf = |a: SimdType, b| a.powf(b); let dh_fs_sample = k_fs_fact_kk as SimdType * powf(dh, n as SimdType - 1.0); @@ -1543,7 +1544,7 @@ fn erode( // +max(0.d0,min(lake_sediment(lake_sill(ij)), // lake_water_volume(lake_sill(ij))))/ // lake_water_volume(lake_sill(ij))*(water(ij)-h(ij)) - *h += (0.0.max(lake_silt[stacki].min(lake_water_volume[lposi])) + *h += (FloatCore::max(0.0, lake_silt[stacki].min(lake_water_volume[lposi])) / lake_water_volume[lposi] * (wh[posi] - *h) as Compute) as Alt; } @@ -1613,7 +1614,7 @@ fn erode( panic!("Disconnected lake!"); } // wh for oceans is always at least min_erosion_height. - wh[posi] = min_erosion_height.max(old_h_i as Alt); + wh[posi] = FloatCore::max(min_erosion_height, old_h_i as Alt); } else { let posj = posj as usize; // Find the water height for this chunk's receiver; we only apply thermal @@ -1818,7 +1819,7 @@ pub(crate) fn fill_sinks( /// adjacency list). /// - The adjacency list (stored in a single vector), indexed by the second /// indirection vector. -pub fn get_lakes( +pub fn get_lakes( map_size_lg: MapSizeLg, h: impl Fn(usize) -> F, downhill: &mut [isize], From a145b0ea2cbf6e7e62277c973b4025751eba6afb Mon Sep 17 00:00:00 2001 From: Youser Nayme <7685106-NeutralModder@users.noreply.gitlab.com> Date: Sun, 23 Jun 2024 13:02:17 -0400 Subject: [PATCH 6/6] Update dispatch --- Cargo.lock | 10 ++-------- voxygen/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c593df767..af344b665a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1828,12 +1828,6 @@ dependencies = [ "winreg 0.52.0", ] -[[package]] -name = "dispatch" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e93ca78226c51902d7aa8c12c988338aadd9e85ed9c6be8aaac39192ff3605" - [[package]] name = "dispatch" version = "0.2.0" @@ -7463,7 +7457,7 @@ dependencies = [ "crossbeam-utils 0.8.20", "directories-next", "discord-sdk", - "dispatch 0.1.4", + "dispatch", "dot_vox", "egui", "egui_wgpu_backend", @@ -8823,7 +8817,7 @@ dependencies = [ "cfg_aliases", "core-foundation", "core-graphics 0.22.3", - "dispatch 0.2.0", + "dispatch", "instant", "libc", "log", diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index 3639623df0..21185a0078 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -147,7 +147,7 @@ discord-sdk = { version = "0.3.0", optional = true } enum-map = { workspace = true } [target.'cfg(target_os = "macos")'.dependencies] -dispatch = "0.1.4" +dispatch = "0.2" [target.'cfg(target_family = "windows")'.build-dependencies] winres = "0.1"