From 1ea8c1360ba724780f2317a44863fbf6aa73a029 Mon Sep 17 00:00:00 2001 From: Joshua Yanovski Date: Sat, 11 Jan 2020 22:05:22 +0100 Subject: [PATCH] Adding many new types of geomorphic laws: - soil production (currently disabled). - debris flow erosion (combined with regular stream power law). - flow computation using multiple receivers. - filling strategy during drainage network calculations. Also tweaks a variety of other aspects of erosion. --- Cargo.lock | 956 +++++++++++++++++++- Cargo.toml | 9 + world/Cargo.toml | 2 + world/src/config.rs | 4 +- world/src/sim/erosion.rs | 1811 ++++++++++++++++++++++++++++++++------ world/src/sim/mod.rs | 195 +++- 6 files changed, 2649 insertions(+), 328 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bfd87ed615..be7871b62c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,6 +13,14 @@ dependencies = [ "const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "aho-corasick" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "aho-corasick" version = "0.7.6" @@ -48,6 +56,14 @@ name = "android_glue" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "anymap" version = "0.12.1" @@ -108,6 +124,22 @@ name = "ascii" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "ash" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aster" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "atk-sys" version = "0.6.0" @@ -145,7 +177,7 @@ version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -186,6 +218,26 @@ dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bindgen" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "clang-sys 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "bindgen" version = "0.51.1" @@ -193,7 +245,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -204,6 +256,16 @@ dependencies = [ "shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bitflags" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bitflags" version = "1.2.1" @@ -229,6 +291,15 @@ name = "block" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "block-buffer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "brotli-sys" version = "0.3.2" @@ -267,6 +338,16 @@ dependencies = [ "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bumpalo" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byte-tools" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "byteorder" version = "0.5.3" @@ -312,6 +393,16 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "calloop" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "mio 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cast" version = "0.2.3" @@ -325,6 +416,14 @@ name = "cc" version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "cexpr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cexpr" version = "0.3.6" @@ -335,7 +434,7 @@ dependencies = [ [[package]] name = "cfg-if" -version = "0.1.10" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -371,6 +470,17 @@ name = "chunked_transfer" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "clang-sys" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "clang-sys" version = "0.28.1" @@ -386,9 +496,13 @@ name = "clap" version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -412,6 +526,14 @@ dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "cmake" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cocoa" version = "0.18.5" @@ -455,6 +577,11 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "colorful" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "conrod_core" version = "0.63.0" @@ -508,6 +635,11 @@ name = "constant_time_eq" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "copyless" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "copypasta" version = "0.6.0" @@ -547,6 +679,18 @@ dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "core-video-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "coreaudio-rs" version = "0.9.1" @@ -585,7 +729,7 @@ name = "crc32fast" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -626,7 +770,7 @@ name = "crossbeam" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -657,7 +801,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -670,7 +814,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -698,7 +842,7 @@ name = "crossbeam-utils" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -708,7 +852,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -732,6 +876,16 @@ dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "d3d12" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "daggy" version = "0.5.0" @@ -761,16 +915,19 @@ dependencies = [ ] [[package]] -name = "deunicode" -version = "1.0.0" +name = "digest" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "directories" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -789,12 +946,30 @@ name = "dirs-sys" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "discord-rpc-sdk" +version = "0.1.1" +source = "git+https://github.com/Songtronix/rust-discord-rpc.git#5823404967954992c0ee48c731f12ab2ca3aaa1d" +dependencies = [ + "discord-rpc-sys 0.1.0 (git+https://github.com/Songtronix/rust-discord-rpc.git)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "discord-rpc-sys" +version = "0.1.0" +source = "git+https://github.com/Songtronix/rust-discord-rpc.git#5823404967954992c0ee48c731f12ab2ca3aaa1d" +dependencies = [ + "bindgen 0.26.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "dispatch" version = "0.1.4" @@ -837,6 +1012,15 @@ name = "either" version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "env_logger" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "env_logger" version = "0.6.2" @@ -896,6 +1080,20 @@ dependencies = [ "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "faster" +version = "0.5.0" +source = "git+https://github.com/AdamNiederer/faster.git?rev=6f99e0396e9992222bb33e8fd1e84347b410d9c0#6f99e0396e9992222bb33e8fd1e84347b410d9c0" +dependencies = [ + "packed_simd 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "vektor 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "fern" version = "0.5.9" @@ -911,7 +1109,7 @@ name = "filetime" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -945,6 +1143,11 @@ name = "foreign-types-shared" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "frustum_query" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "fsevent" version = "0.4.0" @@ -981,6 +1184,14 @@ name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gdk" version = "0.8.0" @@ -1042,12 +1253,20 @@ dependencies = [ "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "generic-array" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "getrandom" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1062,6 +1281,116 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "gfx-auxil" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "spirv_cross 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gfx-backend-dx11" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-auxil 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "range-alloc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "spirv_cross 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wio 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gfx-backend-dx12" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "d3d12 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-auxil 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "range-alloc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "spirv_cross 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gfx-backend-empty" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gfx-backend-metal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)", + "copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-auxil 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "metal 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", + "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "range-alloc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "spirv_cross 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "storage-map 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gfx-backend-vulkan" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ash 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "x11 2.18.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gfx-hal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gfx_core" version = "0.9.2" @@ -1185,6 +1514,11 @@ dependencies = [ "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "glob" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "glob" version = "0.3.0" @@ -1199,6 +1533,16 @@ dependencies = [ "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "glsl-to-spirv" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "glutin" version = "0.21.1" @@ -1475,6 +1819,14 @@ dependencies = [ "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "js-sys" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -1489,6 +1841,11 @@ name = "khronos_api" version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "lazy_static" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "lazy_static" version = "1.4.0" @@ -1514,6 +1871,16 @@ name = "libc" version = "0.2.65" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "libloading" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "libloading" version = "0.5.2" @@ -1557,7 +1924,7 @@ name = "log" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1600,6 +1967,14 @@ name = "maybe-uninit" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "memchr" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "memchr" version = "2.2.1" @@ -1625,6 +2000,20 @@ dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "metal" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "mime" version = "0.2.6" @@ -1676,10 +2065,10 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.21" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1699,7 +2088,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1752,7 +2141,7 @@ name = "net2" version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1764,7 +2153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1782,6 +2171,14 @@ dependencies = [ "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "nom" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "nom" version = "4.2.3" @@ -1806,7 +2203,7 @@ dependencies = [ "inotify 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)", "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1925,6 +2322,7 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "objc_exception 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1937,6 +2335,14 @@ dependencies = [ "objc_id 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "objc_id" version = "0.1.1" @@ -1986,6 +2392,14 @@ dependencies = [ "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "packed_simd" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "pango" version = "0.4.0" @@ -2046,7 +2460,7 @@ name = "parking_lot_core" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2215,7 +2629,7 @@ name = "prometheus" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2239,6 +2653,26 @@ name = "protobuf" version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "quasi" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quasi_codegen" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "quick-error" version = "1.2.2" @@ -2442,6 +2876,11 @@ dependencies = [ "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "range-alloc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "raw-window-handle" version = "0.3.1" @@ -2496,6 +2935,18 @@ dependencies = [ "rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "regex" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "regex" version = "1.3.1" @@ -2515,11 +2966,28 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "regex-syntax" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "regex-syntax" version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "relevant" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "remove_dir_all" version = "0.5.2" @@ -2528,6 +2996,31 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rendy-descriptor" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "relevant 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rendy-memory" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "colorful 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hibitset 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "relevant 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rodio" version = "0.9.0" @@ -2603,6 +3096,11 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rustc-serialize" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "rustc_version" version = "0.2.3" @@ -2689,7 +3187,7 @@ name = "sdl2-sys" version = "0.32.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2739,6 +3237,17 @@ name = "sha1" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "sha2" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "shared_library" version = "0.1.9" @@ -2884,6 +3393,16 @@ name = "spin" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "spirv_cross" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "stable_deref_trait" version = "1.1.1" @@ -2907,6 +3426,19 @@ name = "stdweb" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "storage-map" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "sum_type" version = "0.2.0" @@ -2947,6 +3479,17 @@ dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "synstructure" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "synstructure" version = "0.12.3" @@ -2958,6 +3501,48 @@ dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "syntex" +version = "0.58.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syntex_errors" +version = "0.58.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syntex_pos" +version = "0.58.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syntex_syntax" +version = "0.58.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "tempdir" version = "0.3.7" @@ -2967,6 +3552,28 @@ dependencies = [ "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "term" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "term" version = "0.5.2" @@ -3059,14 +3666,6 @@ dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "treeculler" -version = "0.1.0" -source = "git+https://gitlab.com/yusdacra/treeculler.git#6c0fdf1c1cbf00be22e37410985d6a3973cd9bed" -dependencies = [ - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tuple_utils" version = "0.3.0" @@ -3080,6 +3679,16 @@ dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "typenum" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ucd-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicase" version = "1.4.2" @@ -3109,6 +3718,11 @@ name = "unicode-width" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicode-xid" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicode-xid" version = "0.1.0" @@ -3129,6 +3743,11 @@ dependencies = [ "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "utf8-ranges" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "uvth" version = "3.1.1" @@ -3139,6 +3758,11 @@ dependencies = [ "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "vec_map" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "vek" version = "0.9.11" @@ -3152,6 +3776,14 @@ dependencies = [ "static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "vektor" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "packed_simd 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "veloren-chat-cli" version = "0.4.0" @@ -3192,7 +3824,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "lz4-compress 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)", "mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "notify 5.0.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3249,20 +3881,18 @@ name = "veloren-voxygen" version = "0.4.0" dependencies = [ "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", - "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git)", "conrod_winit 0.63.0 (git+https://gitlab.com/veloren/conrod.git)", "cpal 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "deunicode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "dispatch 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "discord-rpc-sdk 0.1.1 (git+https://github.com/Songtronix/rust-discord-rpc.git)", "dot_vox 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "euc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "fern 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", + "frustum_query 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "gfx 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_device_gl 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_window_glutin 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3271,6 +3901,7 @@ dependencies = [ "guillotiere 0.4.2 (git+https://github.com/Imberflur/guillotiere)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "msgbox 0.4.0 (git+https://github.com/bekker/msgbox-rs.git?rev=68fe39a)", "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3281,13 +3912,10 @@ dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", - "specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)", - "treeculler 0.1.0 (git+https://gitlab.com/yusdacra/treeculler.git)", "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "veloren-client 0.4.0", "veloren-common 0.4.0", "veloren-server 0.4.0", - "veloren-world 0.4.0", "winit 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)", "winres 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3297,7 +3925,10 @@ name = "veloren-world" version = "0.4.0" dependencies = [ "arr_macro 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", + "faster 0.5.0 (git+https://github.com/AdamNiederer/faster.git?rev=6f99e0396e9992222bb33e8fd1e84347b410d9c0)", + "glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3305,6 +3936,7 @@ dependencies = [ "noise 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "packed_simd 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3312,8 +3944,12 @@ dependencies = [ "ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "roots 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "veloren-common 0.4.0", + "wgpu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winit 0.20.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)", + "zerocopy 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3341,6 +3977,55 @@ name = "wasi" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "wasm-bindgen" +version = "0.2.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bumpalo 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.55" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "wayland-client" version = "0.21.13" @@ -3361,8 +4046,10 @@ version = "0.23.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "calloop 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "downcast-rs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)", "nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-commons 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-scanner 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3448,6 +4135,42 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "wgpu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wgpu-native 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "zerocopy 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wgpu-native" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-backend-dx11 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-backend-dx12 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-backend-empty 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-backend-metal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-backend-vulkan 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rendy-descriptor 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rendy-memory 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "winapi" version = "0.2.8" @@ -3519,6 +4242,33 @@ dependencies = [ "x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "winit" +version = "0.20.0-alpha4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "calloop 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", + "core-video-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "dispatch 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "instant 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smithay-client-toolkit 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "winres" version = "0.1.11" @@ -3527,6 +4277,14 @@ dependencies = [ "toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "wio" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -3536,6 +4294,15 @@ dependencies = [ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "x11" +version = "2.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "x11-clipboard" version = "0.3.3" @@ -3574,13 +4341,34 @@ name = "xml-rs" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "zerocopy" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "zerocopy-derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "zerocopy-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [metadata] "checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" "checksum ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" +"checksum aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" "checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" "checksum alsa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0edcbbf9ef68f15ae1b620f722180b82a98b6f0628d30baa6b8d2a5abc87d58" "checksum andrew 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" "checksum android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" +"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" "checksum approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08abcc3b4e9339e33a3d0a5ed15d84a687350c05689d825e0f6655eef9e76a94" "checksum approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" @@ -3590,6 +4378,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" "checksum ascii 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "97be891acc47ca214468e09425d02cef3af2c94d0d82081cd02061f996802f14" +"checksum ash 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)" = "003d1fb2eb12eb06d4a03dbe02eea67a9fac910fa97932ab9e3a75b96a1ea5e5" +"checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0" "checksum atk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8dc233521f7bffd3042c31082ea71bd08820abf44bac938fb36591e20f76f39" "checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" @@ -3599,48 +4389,61 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" "checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" "checksum bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ab639324e3ee8774d296864fbc0dbbb256cf1a41c490b94cba90c082915f92" +"checksum bindgen 0.26.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c57d6c0f6e31f8dcf4d12720a3c2a9ffb70638772a5784976cf4fce52145f22a" "checksum bindgen 0.51.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ebd71393f1ec0509b553aa012b9b58e81dadbdff7130bd3b8cba576e69b32f75" +"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" +"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" "checksum bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a993f74b4c99c1908d156b8d2e0fb6277736b0ecbd833982fd1241d39b2766a6" "checksum blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +"checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" "checksum brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" "checksum brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" "checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" "checksum buf_redux 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" +"checksum bumpalo 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad807f2fc2bf185eeb98ff3a901bd46dc5ad58163d0fa4577ba0d25674d71708" +"checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" "checksum c_vec 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f8a318911dce53b5f1ca6539c44f5342c632269f0fa7ea3e35f32458c27a7c30" "checksum cairo-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a110f269c2fd382df5fe8bd46dfa5f1b83608aa717fecb6e7a28c08c202f0e13" "checksum cairo-sys-rs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0395175ecba60accac076a02c31d143b9dcd9d5eb5316d7163a3273803b765c7" +"checksum calloop 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7aa2097be53a00de9e8fc349fea6d76221f398f5c4fa550d420669906962d160" "checksum cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" "checksum cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)" = "aa87058dce70a3ff5621797f1506cb837edd02ac4c0ae642b4542dce802908b8" +"checksum cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c" "checksum cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" -"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" "checksum cgl 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "55e7ec0b74fe5897894cbc207092c577e87c52f8a59e8ca8d97ef37551f60a49" "checksum chashmap 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ff41a3c2c1e39921b9003de14bf0439c7b63a9039637c291e1a64925d8ddfa45" "checksum chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" "checksum chunked_transfer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87" +"checksum clang-sys 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "611ec2e3a7623afd8a8c0d027887b6b55759d894abbf5fe11b9dc11b50d5b49a" "checksum clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum claxon 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f86c952727a495bda7abaf09bafdee1a939194dd793d9a8e26281df55ac43b00" "checksum clipboard-win 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3a093d6fed558e5fe24c3dfc85a68bb68f1c824f440d3ba5aca189e2998786b" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +"checksum cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "81fb25b677f8bf1eb325017cb6bb8452f87969db0fedb4f757b297bee78a7c62" "checksum cocoa 0.18.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1706996401131526e36b3b49f0c4d912639ce110996f3ca144d78946727bce54" "checksum cocoa 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f29f7768b2d1be17b96158e3285951d366b40211320fb30826a76cb7a0da6400" "checksum color_quant 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0dbbb57365263e881e805dc77d94697c9118fd94d8da011240555aa7b23445bd" "checksum colored 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "433e7ac7d511768127ed85b0c4947f47a254131e37864b2dc13f52aa32cd37e5" +"checksum colorful 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0bca1619ff57dd7a56b58a8e25ef4199f123e78e503fe1653410350a1b98ae65" "checksum conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git)" = "" "checksum conrod_derive 0.63.0 (git+https://gitlab.com/veloren/conrod.git)" = "" "checksum conrod_winit 0.63.0 (git+https://gitlab.com/veloren/conrod.git)" = "" "checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" "checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" "checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" +"checksum copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6ff9c56c9fb2a49c05ef0e431485a22400af20d33226dc0764d891d09e724127" "checksum copypasta 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe78fc904c59791fc39ba6ed427d45c1cd81529f5496552c3e10dab17b37409" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" "checksum core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9" +"checksum core-video-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8dc065219542086f72d1e9f7aadbbab0989e980263695d129d502082d063a9d0" "checksum coreaudio-rs 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f229761965dad3e9b11081668a6ea00f1def7aa46062321b5ec245b834f6e491" "checksum coreaudio-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e8f5954c1c7ccb55340443e8b29fca24013545a5e7d72c1ca7db4fc02b982ce" "checksum cpal 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ded070249be850b5b59e1e3a44a70b8ae395e0e5c65b487131d8909a8208120" @@ -3658,25 +4461,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" "checksum csv 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37519ccdfd73a75821cac9319d4fce15a81b9fcf75f951df5b9988aa3a0af87d" "checksum csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9b5cadb6b25c77aeff80ba701712494213f4a8418fcda2ee11b6560c3ad0bf4c" +"checksum d3d12 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc7ed48e89905e5e146bcc1951cc3facb9e44aea9adf5dc01078cda1bd24b662" "checksum daggy 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9293a0da7d1bc1f30090ece4d9f9de79a07be7302ddb00e5eb1fefb6ee6409e2" "checksum deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)" = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" "checksum derivative 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "942ca430eef7a3806595a6737bc388bf51adb888d3fc0dd1b50f1c170167ee3a" -"checksum deunicode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a0f5bbdedde60605d0719b998e282af68e2b1c50203110211fe4abe857560" +"checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" "checksum directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" "checksum dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" "checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" +"checksum discord-rpc-sdk 0.1.1 (git+https://github.com/Songtronix/rust-discord-rpc.git)" = "" +"checksum discord-rpc-sys 0.1.0 (git+https://github.com/Songtronix/rust-discord-rpc.git)" = "" "checksum dispatch 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e93ca78226c51902d7aa8c12c988338aadd9e85ed9c6be8aaac39192ff3605" "checksum dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a" "checksum dot_vox 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "11afd3251e588f2770226659b2a1d55ec2f8aaf2ca42bdcdbd01ff53b4a81e70" "checksum downcast-rs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6" "checksum draw_state 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "33cf9537e2d06891448799b96d5a8c8083e0e90522a7fdabe6ebf4f41d79d651" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +"checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" "checksum euc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c20f6684a8420df7c300a36bed7cb0b2387b2bc385d4940282399b5df0c08ebd" "checksum euclid 0.19.9 (registry+https://github.com/rust-lang/crates.io-index)" = "596b99621b9477e7a5f94d2d8dd13a9c5c302ac358b822c67a42b6f1054450e1" "checksum euclid_macros 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcb84c18ea5037a1c5a23039b4ff29403abce2e0d6b1daa11cf0bde2b30be15" "checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" "checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" +"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +"checksum faster 0.5.0 (git+https://github.com/AdamNiederer/faster.git?rev=6f99e0396e9992222bb33e8fd1e84347b410d9c0)" = "" "checksum fern 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e69ab0d5aca163e388c3a49d284fed6c3d0810700e77c5ae2756a50ec1a4daaa" "checksum filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1ff6d4dab0aa0c8e6346d46052e93b13a16cf847b54ed357087c35011048cc7d" "checksum find_folder 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9f6d018fb95a0b59f854aed68ecd96ce2b80af7911b92b1fed3c4b1fa516b91b" @@ -3684,17 +4493,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +"checksum frustum_query 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e1771c26abed26b2527d888742fffd27dab86d205bf4846748abf29c06ef5a05" "checksum fsevent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" "checksum fsevent-sys 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" "checksum gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd30051ff3d908ff2fc7e5776ffe1c699821e043809f294c3a61004f11d6c3a9" "checksum gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5" "checksum gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df6a3b73e04fafc07f5ebc083f1096a773412e627828e1103a55e921f81187d8" "checksum gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3162ff940526ddff71bf1f630facee6b5e05d282d125ba0c4c803842819b80c3" +"checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" "checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" "checksum gfx 0.18.2 (registry+https://github.com/rust-lang/crates.io-index)" = "01de46f9508a5c259aef105f0bff760ceddca832ea9c87ce03d1923e22ee155b" +"checksum gfx-auxil 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "572eee952a9a23c99cfe3e4fd95d277784058a89ac3c77ff6fa3d80a4e321919" +"checksum gfx-backend-dx11 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b2cdc732e8cead82f5bfc8ce147ee0a2d8a425342aa7944f1c8f734e53ca3e6b" +"checksum gfx-backend-dx12 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6e913cc800fb12eaba2c420091a02aca9aafbefd672600dfc5b52654343d341" +"checksum gfx-backend-empty 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d383e6bc48867cb37d298a20139fd1eec298f8f6d594690cd1c50ef25470cc7" +"checksum gfx-backend-metal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "15b8aa3d56d78283546ce51adb3db2826b64232ccea961f1d5c55ce986518632" +"checksum gfx-backend-vulkan 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "62538fedd66a78968a162e8e1a29d085ffbc97f8782634684b2f7da7aea59207" +"checksum gfx-hal 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7c88981665c780447bb08eb099e1ded330754a7246719bab927ee4a949c0ba7f" "checksum gfx_core 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "75fbddaef2e12b4995900539d7209d947b988a3d87ee8737484d049b526e5441" "checksum gfx_device_gl 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)" = "109c385fa380c18888633aa27d1e16cbae518469702a2f69dcb5f52d5378bebc" "checksum gfx_gl 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8525888d909a6424b04f9136976f07a85fc1f3704555c1a73897e258326c8319" @@ -3707,8 +4526,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum gleam 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "cae10d7c99d0e77b4766e850a60898a17c1abaf01075531f1066f03dc7dc5fc5" "checksum glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e0be1b1432e227bcd1a9b28db9dc1474a7e7fd4227e08e16f35304f32d09b61" "checksum glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "615bef979b5838526aee99241afc80cfb2e34a8735d4bcb8ec6072598c18a408" +"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" "checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" "checksum glsl-include 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "daa2afb1631e7ab4543e0dde0e3fc68bb49c58fee89c07f30a26553b1f684ab6" +"checksum glsl-to-spirv 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "28caebc98746d507603a2d3df66dcbe04e41d4febad0320f3eec1ef72b6bbef1" "checksum glutin 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)" = "938ce7a2b1bbfe1535166133bea3f9c1b46350d2794b49561303575e9e1b9949" "checksum glutin_egl_sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "772edef3b28b8ad41e4ea202748e65eefe8e5ffd1f4535f1219793dbb20b3d4c" "checksum glutin_emscripten_sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "245b3fdb08df6ffed7585365851f8404af9c7e2dd4b59f15262e968b6a95a0c7" @@ -3737,12 +4558,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "c1aae18ffeeae409c6622c3b6a7ee49792a7e5a062eea1b135fbb74e301792ba" +"checksum js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)" = "1c840fdb2167497b0bd0db43d6dfe61e91637fa72f9d061f8bd17ddc44ba6414" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" +"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" "checksum lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8d542c1a317036c45c2aa1cf10cc9d403ca91eb2d333ef1a4917e5cb10628bd0" "checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" +"checksum libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9" "checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" "checksum line_drawing 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" @@ -3755,15 +4579,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +"checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" "checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" +"checksum metal 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f83c7dcc2038e12f68493fa3de44235df27b2497178e257185b4b5b5d028a1e4" "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" "checksum mime_guess 1.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0d977de9ee851a0b16e932979515c0f3da82403183879811bc97d50bd9cc50f7" "checksum minifb 0.13.0 (git+https://github.com/emoon/rust_minifb.git)" = "" "checksum minimp3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "542e9bed56860c5070a09939eee0e2df6f8f73f60304ddf56d620947e7017239" "checksum minimp3-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c109ae05c00ad6e3a53fab101e2f234545bdd010f0fffd399355efaf70817817" -"checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" +"checksum mio 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)" = "72f4261ee7ab03cd36dc99eea4db8be6e83e4164da470e0c84f6726d6c605855" "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum mopa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a785740271256c230f57462d3b83e52f998433a7062fc18f96d5999474a9f915" @@ -3773,6 +4599,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum noise 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "337525774dd8a197b613a01ea88058ef0ed023e5ed1e4b7e93de478e1f2bf770" +"checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" "checksum notify 5.0.0-pre.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d742ae493f34bd2e20ec2f3c1276fc1981343a8efd7ef12bca4368d0303bed50" "checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" @@ -3788,12 +4615,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" "checksum objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" "checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +"checksum objc_exception 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" "checksum objc_id 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" "checksum ogg 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d79f1db9148be9d0e174bb3ac890f6030fcb1ed947267c5a91ee4c91b5a91e15" "checksum orbclient 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)" = "f8b18f57ab94fbd058e30aa57f712ec423c0bb7403f8493a6c58eef0c36d9402" "checksum ordered-float 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" "checksum osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" +"checksum packed_simd 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a85ea9fc0d4ac0deb6fe7911d38786b32fc11119afd9e9d38b84ff691ce64220" "checksum pango 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45374801e224373c3c0393cd48073c81093494c8735721e81d1dbaa4096b2767" "checksum pango-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94039b3921a4af4058a3e4335e5d15099101f298a92f5afc40bab3a3027594a1" "checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" @@ -3823,6 +4652,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" "checksum prometheus-static-metric 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1baa57413523cff73783204f73299a3f602ebcf51a5e64752b32bc1b3c376013" "checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" +"checksum quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18c45c4854d6d1cf5d531db97c75880feb91c958b0720f4ec1057135fec358b3" +"checksum quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b9e25fa23c044c1803f43ca59c98dac608976dd04ce799411edd58ece776d4" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" @@ -3845,16 +4676,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" "checksum rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e18c91676f670f6f0312764c759405f13afb98d5d73819840cf72a518487bff" +"checksum range-alloc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd5927936723a9e8b715d37d7e4b390455087c4bdf25b9f702309460577b14f9" "checksum raw-window-handle 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9db80d08d3ed847ce4fb3def46de0af4bfb6155bd09bd6eaf28b5ac72541c1f1" "checksum rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "43739f8831493b276363637423d3622d4bd6394ab6f0a9c4a552e208aeb7fddd" "checksum rayon-core 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8bf17de6f23b05473c437eb958b9c850bfc8af0961fe17b4cc92d5a627b4791" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" +"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" "checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" "checksum regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "92b73c2a1770c255c240eaa4ee600df1704a38dc3feaa6e949e7fcd4f8dc09f9" +"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" +"checksum relevant 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bbc232e13d37f4547f5b9b42a5efc380cabe5dbc1807f8b893580640b2ab0308" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +"checksum rendy-descriptor 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f475bcc0505946e998590f1f0545c52ef4b559174a1b353a7ce6638def8b621e" +"checksum rendy-memory 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ed492161a819feae7f27f418bb16035276ac20649c60d756699152cb5c1960ec" "checksum rodio 0.9.0 (git+https://github.com/RustAudio/rodio?rev=e5474a2)" = "" "checksum ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5" "checksum roots 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e4c67c712ab62be58b24ab8960e2b95dd4ee00aac115c76f2709657821fe376d" @@ -3862,6 +4699,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" +"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rusttype 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" "checksum rusttype 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "14a911032fb5791ccbeec9f28fdcb9bf0983b81f227bafdfd227c658d0731c8a" @@ -3879,6 +4717,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum serde_derive 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)" = "ca13fc1a832f793322228923fbb3aba9f3f44444898f835d31ad1b74fa0a2bf8" "checksum serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "1a3351dcbc1f067e2c92ab7c3c1f288ad1a4cffc470b5aaddb4c2e0a3ae80043" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" +"checksum sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" "checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" "checksum shred 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "92472b9bafafbcba21935c6444d924e5332742f6778c49504a49a97eaeff6ccc" @@ -3895,17 +4734,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum specs 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4943fde8c5d3d14c3d19d2a4c7abbd7b626c270a19e6cd35252294a48feb698c" "checksum specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)" = "" "checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +"checksum spirv_cross 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fbbe441b3ac8ec0ae6a4f05234239bd372a241ce15793eef694e8b24afc267bb" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum stb_truetype 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" "checksum stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" +"checksum storage-map 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0a4829a5c591dc24a944a736d6b1e4053e51339a79fd5d4702c4c999a9c45e" +"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da5b4a0c9f3c7c8e891e445a7c776627e208e8bba23ab680798066dd283e6a15" "checksum svg_fmt 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20e5f95e89d737f30cd1f98a9af9a85c2a1cc162cfedfba5a0c54cf92d7206fc" "checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b" "checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" "checksum syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "661641ea2aa15845cddeb97dad000d22070bb5c1fb456b96c1cba883ec691e92" +"checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" +"checksum syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f5e3aaa79319573d19938ea38d068056b826db9883a5d47f86c1cecc688f0e" +"checksum syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c" +"checksum syntex_pos 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13ad4762fe52abc9f4008e85c4fb1b1fe3aa91ccb99ff4826a439c7c598e1047" +"checksum syntex_syntax 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e0e4dbae163dd98989464c23dd503161b338790640e11537686f2ef0f25c791" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +"checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1" "checksum term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" @@ -3916,22 +4765,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum tiny_http 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1661fa0a44c95d01604bd05c66732a446c657efb62b5164a7a083a3b552b4951" "checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" "checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" -"checksum treeculler 0.1.0 (git+https://gitlab.com/yusdacra/treeculler.git)" = "" "checksum tuple_utils 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1" "checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" +"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" +"checksum ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa9b3b49edd3468c0e6565d85783f51af95212b6fa3986a5500954f00b460874" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b561e267b2326bb4cebfc0ef9e68355c7abe6c6f522aeac2f5bf95d56c59bdcf" "checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" +"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +"checksum utf8-ranges 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba" "checksum uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e59a167890d173eb0fcd7a1b99b84dc05c521ae8d76599130b8e19bef287abbf" +"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum vek 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "1eb3ca8ea588deba055424cc1a79a830428b2f6c270b8d8f91946f660fa4d8ee" +"checksum vektor 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "42e86fbee9ad5d7dd720dbe6dd2e47c598d98632d707e18ed5186bd284e933da" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" +"checksum wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "29ae32af33bacd663a9a28241abecf01f2be64e6a185c6139b04f18b6385c5f2" +"checksum wasm-bindgen-backend 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "1845584bd3593442dc0de6e6d9f84454a59a057722f36f005e44665d6ab19d85" +"checksum wasm-bindgen-macro 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "87fcc747e6b73c93d22c947a6334644d22cfec5abd8b66238484dc2b0aeb9fe4" +"checksum wasm-bindgen-macro-support 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "3dc4b3f2c4078c8c4a5f363b92fcf62604c5913cbd16c6ff5aaf0f74ec03f570" +"checksum wasm-bindgen-shared 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "ca0b78d6d3be8589b95d1d49cdc0794728ca734adf36d7c9f07e6459508bb53d" "checksum wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "49963e5f9eeaf637bfcd1b9f0701c99fd5cd05225eb51035550d4272806f2713" "checksum wayland-client 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" "checksum wayland-commons 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "40c08896768b667e1df195d88a62a53a2d1351a1ed96188be79c196b35bb32ec" @@ -3942,6 +4801,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum wayland-scanner 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" "checksum wayland-sys 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)" = "520ab0fd578017a0ee2206623ba9ef4afe5e8f23ca7b42f6acfba2f4e66b1628" "checksum wayland-sys 0.23.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" +"checksum wgpu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e9c1ff587eddd68cdf2a78889c7a2128683161c72c67b94457cf498accaf7b" +"checksum wgpu-native 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6ffebfe1cef61a6ff4eea57211bca067b28ab49dd79095fc1afa887d24f136a2" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" @@ -3950,10 +4811,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" "checksum winit 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1e96eb4bb472fa43e718e8fa4aef82f86cd9deac9483a1e1529230babdb394a8" +"checksum winit 0.20.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)" = "56c565622ccb05351d92445415952ca09dade6a53e75dd9e75d9bd35d4e99333" "checksum winres 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ff4fb510bbfe5b8992ff15f77a2e6fe6cf062878f0eda00c0f44963a807ca5dc" +"checksum wio 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +"checksum x11 2.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39697e3123f715483d311b5826e254b6f3cfebdd83cf7ef3358f579c3d68e235" "checksum x11-clipboard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "89bd49c06c9eb5d98e6ba6536cf64ac9f7ee3a009b2f53996d405b3944f6bcea" "checksum x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)" = "be65e1342a3baae65439cd03306778831a3d133b0d20243a7fb83fd5cf403c58" "checksum xcb 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5e917a3f24142e9ff8be2414e36c649d47d6cc2ba81f16201cdef96e533e02de" "checksum xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" "checksum xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "541b12c998c5b56aa2b4e6f18f03664eef9a4fd0a246a55594efae6cc2d964b5" +"checksum zerocopy 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "992b9b31f80fd4a167f903f879b8ca43d6716cc368ea01df90538baa2dd34056" +"checksum zerocopy-derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b090467ecd0624026e8a6405d343ac7382592530d54881330b3fc8e400280fa5" diff --git a/Cargo.toml b/Cargo.toml index bd5b3c020b..387765c9a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,12 +38,21 @@ opt-level = 2 opt-level = 2 [profile.dev.package."veloren-world"] opt-level = 2 +[profile.no_overflow.overrides."veloren-world"] +opt-level = 3 # this profile is used by developers if dev doesn't has enough debug information, the name must != debug, as debug is used by dev because.... [profile.debuginfo] inherits= 'dev' debug = true +# used to perform things that do a *lot* of math (i.e. worldgen) but still need reasonable compilation time. Ideally this would also +# add -C target-cpu=native, but I don't think you can set this by profile currently. +[profile.no_overflow] +inherits= 'dev' +overflow-checks = false +debug-assertions = false + # this profile is used for veloren releases, compile time doesn't matter # we need stacktraces, light debug information, as much checks as possible # I would like to put it in a seperate `official_release` target, but that doesnt share caches with `cargo test` and `cargo bench` diff --git a/world/Cargo.toml b/world/Cargo.toml index 0907d0d53d..978be53dfb 100644 --- a/world/Cargo.toml +++ b/world/Cargo.toml @@ -8,6 +8,7 @@ edition = "2018" bincode = "1.2.0" common = { package = "veloren-common", path = "../common" } bitvec = "0.15.2" +faster = { git = "https://github.com/AdamNiederer/faster.git", rev = "6f99e0396e9992222bb33e8fd1e84347b410d9c0" } vek = "0.9.9" noise = { version = "0.6.0", default-features = false } num = "0.2.0" @@ -18,6 +19,7 @@ log = "0.4.8" rand = "0.7.2" rand_chacha = "0.2.1" arr_macro = "0.1.2" +packed_simd = "0.3.3" rayon = "1.2.0" roots = "0.0.5" serde = "1.0.102" diff --git a/world/src/config.rs b/world/src/config.rs index d14325521d..e05bb10bb4 100644 --- a/world/src/config.rs +++ b/world/src/config.rs @@ -8,7 +8,7 @@ pub struct Config { pub desert_hum: f32, pub forest_hum: f32, pub jungle_hum: f32, - /// Rainfall (in meters) per chunk per minute. Default is set to make it approximately + /// Rainfall (in meters) per m² of surface per minute. Default is set to make it approximately /// 1 m rainfall / year uniformly across the whole land area, which is the average rainfall /// on Earth. pub rainfall_chunk_rate: f32, @@ -54,7 +54,7 @@ pub const CONFIG: Config = Config { desert_hum: 0.15, forest_hum: 0.5, jungle_hum: 0.85, - rainfall_chunk_rate: 1.0 / 512.0, + rainfall_chunk_rate: 1.0 / (512.0 * 32.0 * 32.0), river_roughness: 0.06125, river_max_width: 2.0, river_min_height: 0.25, diff --git a/world/src/sim/erosion.rs b/world/src/sim/erosion.rs index db334a9e05..2563e06a0e 100644 --- a/world/src/sim/erosion.rs +++ b/world/src/sim/erosion.rs @@ -1,22 +1,31 @@ -use super::{diffusion, downhill, neighbors, uniform_idx_as_vec2, uphill, WORLD_SIZE}; -use bitvec::prelude::{bitbox, bitvec, BitBox}; +use super::{ + diffusion, downhill, neighbors, uniform_idx_as_vec2, uphill, vec2_as_uniform_idx, + NEIGHBOR_DELTA, WORLD_SIZE, +}; use crate::{config::CONFIG, util::RandomField}; +use arr_macro::arr; +use bitvec::prelude::{bitbox, bitvec, BitBox}; use common::{terrain::TerrainChunkSize, vol::RectVolSize}; +use faster::*; use noise::{NoiseFn, Point3}; -use num::Float; +use num::{Float, FromPrimitive, One, Zero}; use ordered_float::NotNan; +use packed_simd::{/*f32x8, f64x8,*/ m32, m64}; use rayon::prelude::*; use std::{ cmp::{Ordering, Reverse}, collections::BinaryHeap, - f32, f64, mem, + f32, f64, fmt, mem, path::PathBuf, + time::Instant, u32, }; use vek::*; -pub type Alt = f32; +pub type Alt = f64; +// pub type Altx8 = /*f64x8*/f32x8; pub type Compute = f64; +pub type Computex8 = [Compute; 8]; /// Compute the water flux at all chunks, given a list of chunk indices sorted by increasing /// height. @@ -41,6 +50,48 @@ pub fn get_drainage(newh: &[u32], downhill: &[isize], _boundary_len: usize) -> B flux } +/// Compute the water flux at all chunks for multiple receivers, given a list of chunk indices +/// sorted by increasing height and weights for each receiver. +pub fn get_multi_drainage( + mstack: &[u32], + mrec: &[u8], + mwrec: &[Computex8], + _boundary_len: usize, +) -> Box<[Compute]> { + // FIXME: Make the below work. For now, we just use constant flux. + // Initially, flux is determined by rainfall. We currently treat this as the same as humidity, + // so we just use humidity as a proxy. The total flux across the whole map is normalize to + // 1.0, and we expect the average flux to be 0.5. To figure out how far from normal any given + // chunk is, we use its logit. + // NOTE: If there are no non-boundary chunks, we just set base_flux to 1.0; this should still + // work fine because in that case there's no erosion anyway. + // let base_flux = 1.0 / ((WORLD_SIZE.x * WORLD_SIZE.y) as f32); + let base_area = 1.0; + let mut area = vec![base_area; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); + for &ij in mstack { + let ij = ij as usize; + let wrec_ij = &mwrec[ij]; + let area_ij = area[ij]; + // debug_assert!(area_ij >= 0.0); + for (k, ijr) in mrec_downhill(mrec, ij) { + /* if area_ij != 1.0 { + println!("ij={:?} wrec_ij={:?} k={:?} ijr={:?} area_ij={:?} wrec_ij={:?}", ij, wrec_ij, k, ijr, area_ij, wrec_ij[k]); + } */ + area[ijr] += area_ij * /*wrec_ij.extract(k);*/wrec_ij[k]; + } + } + area + /* + a=dx*dy*precip + do ij=1,nn + ijk=mstack(ij) + do k =1,mnrec(ijk) + a(mrec(k,ijk))=a(mrec(k,ijk))+a(ijk)*mwrec(k,ijk) + enddo + enddo + */ +} + /// Kind of water on this tile. #[derive(Clone, Copy, Debug, PartialEq)] pub enum RiverKind { @@ -149,18 +200,21 @@ impl RiverData { /// Draw rivers and assign them heights, widths, and velocities. Take some liberties with the /// constant factors etc. in order to make it more likely that we draw rivers at all. -pub fn get_rivers( +pub fn get_rivers, G: Float + Into>( newh: &[u32], - water_alt: &[f32], + water_alt: &[F], downhill: &[isize], indirection: &[i32], - drainage: &[f32], + drainage: &[G], ) -> Box<[RiverData]> { // For continuity-preserving quadratic spline interpolation, we (appear to) need to build // up the derivatives from the top down. Fortunately this computation seems tractable. let mut rivers = vec![RiverData::default(); WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); let neighbor_coef = TerrainChunkSize::RECT_SIZE.map(|e| e as f64); + // (Roughly) area of a chunk, times minutes per second. + let mins_per_sec = /*64.0*/1.0; //1.0 / 64.0; + let chunk_area_factor = neighbor_coef.x * neighbor_coef.y / mins_per_sec; // NOTE: This technically makes us discontinuous, so we should be cautious about using this. let derivative_divisor = 1.0; let height_scale = 1.0; // 1.0 / CONFIG.mountain_scale as f64; @@ -178,13 +232,15 @@ pub fn get_rivers( let dxy = (downhill_pos - uniform_idx_as_vec2(chunk_idx)).map(|e| e as f64); let neighbor_dim = neighbor_coef * dxy; // First, we calculate the river's volumetric flow rate. - let chunk_drainage = drainage[chunk_idx] as f64; + let chunk_drainage = drainage[chunk_idx].into(); // Volumetric flow rate is just the total drainage area to this chunk, times rainfall - // height per chunk per minute (needed in order to use this as a m³ volume). + // height per chunk per minute, times minutes per second + // (needed in order to use this as a m³ volume). // TODO: consider having different rainfall rates (and including this information in the // computation of drainage). - let volumetric_flow_rate = chunk_drainage * CONFIG.rainfall_chunk_rate as f64; - let downhill_drainage = drainage[downhill_idx] as f64; + let volumetric_flow_rate = + chunk_drainage * chunk_area_factor * CONFIG.rainfall_chunk_rate as f64; + let downhill_drainage = drainage[downhill_idx].into(); // We know the drainage to the downhill node is just chunk_drainage - 1.0 (the amount of // rainfall this chunk is said to get), so we don't need to explicitly remember the @@ -374,8 +430,8 @@ pub fn get_rivers( // network). let downhill_water_alt = water_alt[downhill_idx]; let neighbor_distance = neighbor_dim.magnitude(); - let dz = (downhill_water_alt - chunk_water_alt) / height_scale as f32;// * CONFIG.mountain_scale; - let slope = dz.abs() as f64 / neighbor_distance; + let dz = (downhill_water_alt - chunk_water_alt).into()/* / height_scale as f32*/; // * CONFIG.mountain_scale; + let slope = dz.abs() / neighbor_distance; if slope == 0.0 { // This is not a river--how did this even happen? let pass_idx = (-indirection_idx) as usize; @@ -433,11 +489,7 @@ pub fn get_rivers( // We can now weight the river's drainage by its direction, which we use to help improve // the slope of the downhill node. - let river_direction = Vec3::new( - neighbor_dim.x, - neighbor_dim.y, - (dz as f64).signum() * (dz as f64), - ); + let river_direction = Vec3::new(neighbor_dim.x, neighbor_dim.y, dz.signum() * dz); // Now, we can check whether this is "really" a river. // Currently, we just check that width and height are at least 0.5 and @@ -496,18 +548,19 @@ pub fn get_rivers( /// Precompute the maximum slope at all points. /// /// TODO: See if allocating in advance is worthwhile. -fn get_max_slope(h: &[/*f32*/Alt], rock_strength_nz: &(impl NoiseFn> + Sync)) -> Box<[f64]> { +fn get_max_slope(h: &[Alt], rock_strength_nz: &(impl NoiseFn> + Sync)) -> Box<[f64]> { let min_max_angle = (15.0/*6.0*//*30.0*//*6.0*//*15.0*/ / 360.0 * 2.0 * f64::consts::PI).tan(); - let max_max_angle = (45.0/*54.0*//*50.0*//*54.0*//*45.0*/ / 360.0 * 2.0 * f64::consts::PI).tan(); + let max_max_angle = + (60.0/*54.0*//*50.0*//*54.0*//*45.0*/ / 360.0 * 2.0 * f64::consts::PI).tan(); let max_angle_range = max_max_angle - min_max_angle; - let height_scale = 1.0; // 1.0 / CONFIG.mountain_scale as f64; + let height_scale = 1.0 / 4.0; // 1.0; // 1.0 / CONFIG.mountain_scale as f64; h.par_iter() .enumerate() .map(|(posi, &z)| { let wposf = uniform_idx_as_vec2(posi).map(|e| e as f64) * TerrainChunkSize::RECT_SIZE.map(|e| e as f64); let wposz = z as f64 / height_scale;// * CONFIG.mountain_scale as f64; // Normalized to be between 6 and and 54 degrees. - let div_factor = /*32.0*//*16.0*//*64.0*//*256.0*/8.0/*8.0*//*1.0*//*4.0*//* * /*1.0*/16.0/* TerrainChunkSize::RECT_SIZE.x as f64 / 8.0 */*/; + let div_factor = /*32.0*//*16.0*//*64.0*//*256.0*//*8.0 / 4.0*//*8.0*/(2.0 * TerrainChunkSize::RECT_SIZE.x as f64) / 8.0/* * 8.0*//*1.0*//*4.0*//* * /*1.0*/16.0/* TerrainChunkSize::RECT_SIZE.x as f64 / 8.0 */*/; let rock_strength = rock_strength_nz .get([ wposf.x, /* / div_factor*/ @@ -541,7 +594,7 @@ fn get_max_slope(h: &[/*f32*/Alt], rock_strength_nz: &(impl NoiseFn> // TODO: Make all this stuff configurable... but honestly, it's so complicated that I'm not // sure anyone would be able to usefully tweak them on a per-map basis? Plus it's just a // hacky heuristic anyway. - let center = /*0.25*/0.4; + let center = /*0.25*//*0.4*//*0.2*/0.4; let dmin = center - /*0.15;//0.05*/0.05; let dmax = center + /*0.05*//*0.10*/0.05;//0.05; let log_odds = |x: f64| logit(x) - logit(center); @@ -551,7 +604,7 @@ fn get_max_slope(h: &[/*f32*/Alt], rock_strength_nz: &(impl NoiseFn> ); // let rock_strength = 0.5; let max_slope = rock_strength * max_angle_range + min_max_angle; - // let max_slope = /*30.0.to_radians().tan();*/3.0.sqrt() / 3.0; + // let max_slope = /*30.0.to_radians().tan();*/3.0.sqrt() / 3.0; max_slope }) .collect::>() @@ -626,8 +679,13 @@ fn get_max_slope(h: &[/*f32*/Alt], rock_strength_nz: &(impl NoiseFn> /// Copyright 2003 by the American Geophysical Union /// 10.1029/135GM09 fn erode( + // Height above sea level of topsoil h: &mut [Alt], + // Height above sea level of bedrock b: &mut [Alt], + // Height above topsoil of alluvium (loose rock) + // a: &mut [Alt], + // Height above sea level of water wh: &mut [Alt], is_done: &mut BitBox, done_val: bool, @@ -643,15 +701,15 @@ fn erode( kf: impl Fn(usize) -> f64 + Sync, kd: impl Fn(usize) -> f64, g: impl Fn(usize) -> f32 + Sync, + epsilon_0: impl Fn(usize) -> f32 + Sync, + alpha: impl Fn(usize) -> f32 + Sync, is_ocean: impl Fn(usize) -> bool + Sync, ) { let compute_stats = true; log::debug!("Done draining..."); let height_scale = 1.0; // 1.0 / CONFIG.mountain_scale as f64; - let min_erosion_height = 0.0;//-f64::INFINITY as Alt; + let min_erosion_height = 0.0; // -::infinity(); let mmaxh = CONFIG.mountain_scale as f64 * height_scale; - // Minimum sediment thickness before we treat erosion as sediment based. - let sediment_thickness = 1.0; // Since maximum uplift rate is expected to be 5.010e-4 m * y^-1, and // 1.0 height units is 1.0 / height_scale m, whatever the // max uplift rate is (in units / y), we can find dt by multiplying by @@ -669,15 +727,28 @@ fn erode( // max_uplift / height_scale m / dt / (5.010e-4 m / y) = 1 // (max_uplift / height_scale / 5.010e-4) y = dt // 5e-7 - let dt = max_uplift as f64 / height_scale /* * CONFIG.mountain_scale as f64*/ / /*5.010e-4*/1e-3; - println!("dt={:?}", dt); + let dt = max_uplift as f64/* / height_scale*/ /* * CONFIG.mountain_scale as f64*/ / /*5.010e-4*/1e-3/*0.2e-3*/; + log::debug!("dt={:?}", dt); + // Minimum sediment thickness before we treat erosion as sediment based. + let sediment_thickness = 1.0e-4 * dt; let neighbor_coef = TerrainChunkSize::RECT_SIZE.map(|e| e as f64); let chunk_area = neighbor_coef.x * neighbor_coef.y; let min_length = neighbor_coef.reduce_partial_min(); - let max_stable = /*max_slope * */min_length * min_length / (dt/* / 2.0*/);//1.0/* + /*max_uplift as f64 / dt*/sed / dt*/; - // Landslide constant: ideally scaled to 10e-2 m / y^-1 + let max_stable = /*max_slope * */min_length * min_length / (dt/* / 2.0*/); //1.0/* + /*max_uplift as f64 / dt*/sed / dt*/; + // Landslide constant: ideally scaled to 10e-2 m / y^-1 let l = /*200.0 * max_uplift as f64;*/(1.0e-2 /*/ CONFIG.mountain_scale as f64*/ * height_scale); let l_tot = l * dt; + // Debris flow coefficient (m / year). + let k_df = 1.0e-4/*0.0*/; + // Debris flow area coefficient (m^(-2q)). + let q = 0.2; + let q_ = 1.5/*1.0*/; + let k_da = /*5.0*/2.5 * 16.0.powf(q); + let nx = WORLD_SIZE.x; + let ny = WORLD_SIZE.y; + let dx = TerrainChunkSize::RECT_SIZE.x as f64/* * height_scale*//* / CONFIG.mountain_scale as f64*/; + let dy = TerrainChunkSize::RECT_SIZE.y as f64/* * height_scale*//* / CONFIG.mountain_scale as f64*/; + // ε₀ = 0.000268 m/y, α = 0.03 (1/m). This is part of the soil production approximate // equation: // @@ -713,8 +784,8 @@ fn erode( // = (h_i - b_i) * √(H_i_fact^2 * (||p_i - p_j||^2 + (h_i - h_j)^2) + // 1 - 2 * H_i_fact * (h_i - h_j)) // = (h_i - b_i) * √((h_i - h_j)^2 / (||p_i - p_j||^2 + (h_i - h_j)^2) * (||p_i - p_j||^2 + (h_i - h_j)^2) + - // 1i - 2 * (h_i - h_j)^2 / (||p_i - p_j||^2 + (h_i - h_j)^2)) - // = (h_i - b_i) * √((h_i - h_j)^2 - 2(h_i - h_j) / (||p_i - p_j||^2 + (h_i - h_j)^2) + 1) + // 1 - 2 * (h_i - h_j)^2 / (||p_i - p_j||^2 + (h_i - h_j)^2)) + // = (h_i - b_i) * √((h_i - h_j)^2 - 2(h_i - h_j)^2 / (||p_i - p_j||^2 + (h_i - h_j)^2) + 1) // // where j is i's receiver and ||p_i - p_j|| is the horizontal displacement between them. The // idea here is that we first compute the hypotenuse between the horizontal and vertical @@ -723,9 +794,9 @@ fn erode( // the normal height H_i, while their square adds up to the vertical displacement (h_i - b_i). // If h and b have different slopes, this may not work completely correctly, but this is // probably fine as an approximation. - let epsilon_0 = 2.68e-4; + /* let epsilon_0 = 2.68e-4; let alpha = 3e-2; - let epsilon_0_tot = epsilon_0 * dt; + let epsilon_0_tot = epsilon_0 * dt; */ // Net precipitation rate (m / year) let p = 1.0 * height_scale; /* let n = 2.4;// 1.0;//1.5;//2.4;//1.0; @@ -744,24 +815,52 @@ fn erode( //erosion_base as f64 + 2.244 / mmaxh as f64 * /*10.0*//*5.0*//*9.0*//*7.5*//*5.0*//*2.5*//*1.5*//*5.0*//*1.0*//*1.5*//*2.5*//*3.75*/ * max_uplift as f64; // 2.5e-6 * dt; 2e-5 * dt; - // see http://geosci.uchicago.edu/~kite/doc/Whipple_and_Tucker_1999.pdf - //5e-6 * dt; // 2e-5 was designed for steady state uplift of 2mm / y whih would amount to 500 m / 250,000 y. - // (2.244*(5.010e-4)/512)/(2.244*(5.010e-4)/2500) = 4.88... - // 2.444 * 5 + // see http://geosci.uchicago.edu/~kite/doc/Whipple_and_Tucker_1999.pdf + //5e-6 * dt; // 2e-5 was designed for steady state uplift of 2mm / y whih would amount to 500 m / 250,000 y. + // (2.244*(5.010e-4)/512)/(2.244*(5.010e-4)/2500) = 4.88... + // 2.444 * 5 // Stream power erosion constant (sediment), in m^(1-2m) / year (times dt). - let k_fs_mult = 2.0;//2.0;/*1.5*/; + let k_fs_mult_sed = /*1.0;*//*2.0*/4.0; /*1.0;*///2.0;/*1.5*/; + // Stream power erosion constant (underwater). + let k_fs_mult_water = /*1.0*//*0.5*/0.25; + let g_fs_mult_sed = 1.0/*0.5*/; // let k_fs = k_fb * 1.0/*1.5*//*2.0*//*2.0*//*4.0*/; // u = k * h_max / 2.244 // let uplift_scale = erosion_base as f64 + (k_fb * mmaxh / 2.244 / 5.010e-4 as f64 * mmaxh as f64) * dt; - let ((dh, indirection, newh, maxh, area), (mut max_slopes, ht)) = rayon::join( + let ( + (dh, indirection, newh, maxh, mrec, mstack, mwrec, area), + (mut max_slopes, /*(ht, at)*/ h_t), + ) = rayon::join( || { - let mut dh = downhill(|posi| h[posi], |posi| is_ocean(posi) && h[posi] <= 0.0); + let mut dh = downhill( + |posi| h[posi], /* + a[posi].max(0.0)*//* + uplift(posi) as Alt*/ + |posi| { + is_ocean(posi) + && h[posi]/* + a[posi].max(0.0)*//* + uplift(posi) as Alt*/ <= 0.0 + }, + ); log::debug!("Computed downhill..."); - let (boundary_len, indirection, newh, maxh) = get_lakes(|posi| h[posi], &mut dh); + let (boundary_len, indirection, newh, maxh) = get_lakes( + |posi| h[posi], /* + a[posi].max(0.0)*//* + uplift(posi) as Alt*/ + &mut dh, + ); log::debug!("Got lakes..."); - let area = get_drainage(&newh, &dh, boundary_len); + let (mrec, mstack, mwrec) = get_multi_rec( + |posi| h[posi], + &dh, + &newh, + wh, + nx, + ny, + dx as Compute, + dy as Compute, + maxh, + ); + log::debug!("Got multiple receivers..."); + // let area = get_drainage(&newh, &dh, boundary_len); + let area = get_multi_drainage(&mstack, &mrec, &*mwrec, boundary_len); log::debug!("Got flux..."); - (dh, indirection, newh, maxh, area) + (dh, indirection, newh, maxh, mrec, mstack, mwrec, area) }, || { rayon::join( @@ -771,9 +870,17 @@ fn erode( max_slope }, || { - // Store the elevation at t h.to_vec().into_boxed_slice() - // h.into_par_iter().map(|e| e as f64).collect::>().into_boxed_slice() + /* rayon::join( + || { + // Store the elevation at t + h.to_vec().into_boxed_slice() + // h.into_par_iter().map(|e| e as f64).collect::>().into_boxed_slice() + }, + || { + a.to_vec().into_boxed_slice() + }, + ) */ }, ) }, @@ -781,123 +888,383 @@ fn erode( assert!(h.len() == dh.len() && dh.len() == area.len()); - // Precompute factors for Stream Power Law. - let k_fact = dh.par_iter().enumerate() - .map(|(posi, &posj)| { - if posj < 0 { - // Egress with no outgoing flows, no stream power. - 0.0 - } else { - let posj = posj as usize; - let dxy = (uniform_idx_as_vec2(posi) - uniform_idx_as_vec2(posj)).map(|e| e as f64); - let neighbor_distance = (neighbor_coef * dxy).magnitude(); - let old_b_i = b[posi]; - let sed = (ht[posi] - old_b_i) as f64; - let k = if sed > sediment_thickness { - // Sediment - // k_fs - k_fs_mult * kf(posi) - } else { - // Bedrock - // k_fb - kf(posi) - } * dt; - let n = n_f(posi) as f64; - let m = m_f(posi) as f64; - - k * (p * chunk_area * area[posi] as f64).powf(m) / neighbor_distance.powf(n) - } - }) - .collect::>(); - log::info!("Computed stream power factors..."); - // max angle of slope depends on rock strength, which is computed from noise function. // TODO: Make more principled. - let mid_slope = (30.0 / 360.0 * 2.0 * f64::consts::PI).tan();//1.0; + let mid_slope = (30.0 / 360.0 * 2.0 * f64::consts::PI).tan(); //1.0; - let mut lake_water_volume = vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); + type SimdType = f64; + type MaskType = m64; + let simd_func = f64s/*f32s*/; + + // Precompute factors for Stream Power Law. + let czero = ::zero(); + let (k_fs_fact, /*()*/ k_df_fact) = rayon::join( + || { + dh.par_iter().enumerate() + .map(|(posi, &posj)| { + let mut k_tot = /*Computex8::splat(czero);*/[czero; 8]; + if posj < 0 { + // Egress with no outgoing flows, no stream power. + k_tot + } else { + let old_b_i = b[posi]; + let sed = (h_t[posi] - old_b_i) as f64; + let k = if sed > sediment_thickness { + // Sediment + // k_fs + k_fs_mult_sed * kf(posi) + } else { + // Bedrock + // k_fb + kf(posi) + } * dt; + let n = n_f(posi) as f64; + let m = m_f(posi) as f64; + + let mwrec_i = &mwrec[posi]; + for (kk, posj) in mrec_downhill(&mrec, posi) { + // let posj = posj as usize; + let dxy = (uniform_idx_as_vec2(posi) - uniform_idx_as_vec2(posj)).map(|e| e as f64); + let neighbor_distance = (neighbor_coef * dxy).magnitude(); + let knew = (k * (p * chunk_area * (area[posi] as f64 * mwrec_i[kk] as f64)).powf(m) / neighbor_distance.powf(n)) as /*Compute*/SimdType; + // let knew = (k * (p * chunk_area * (area[posi] as f64 * mwrec_i.extract(kk) as f64)).powf(m) / neighbor_distance.powf(n)) as Compute; + k_tot[kk] = knew; + // k_tot = k_tot.replace(kk, knew); + } + k_tot + } + }) + .collect::>() + }, + || { + dh.par_iter().enumerate() + .map(|(posi, &posj)| { + let mut k_tot = /*Computex8::splat(czero);*/[czero; 8]; + let uplift_i = uplift(posi) as f64; + debug_assert!(uplift_i.is_normal() && uplift_i > 0.0 || uplift_i == 0.0); + if posj < 0 { + // Egress with no outgoing flows, no stream power. + k_tot + } else { + let area_i = area[posi] as f64; + let max_slope = max_slopes[posi]/*mid_slope*/; + let chunk_area_pow = chunk_area.powf(q); + + let old_b_i = b[posi]; + let sed = (h_t[posi] - old_b_i) as f64; + /* let k_f = if sed > sediment_thickness { + // Sediment + // k_fs + k_fs_mult_sed * kf(posi) + } else { + // Bedrock + // k_fb + kf(posi) + } * dt; */ + // let g_i = g(posi) as f64; + let g_i = if sed > sediment_thickness { + g_fs_mult_sed * g(posi) as f64 + } else { + g(posi) as f64 + }; + + // Higher rock strength tends to lead to higher curvature? + let kd_factor = + // 1.0; + (1.0 / (max_slope / mid_slope/*.sqrt()*//*.powf(0.03125)*/).powf(/*2.0*/2.0))/*.min(kdsed)*/; + let k_da = k_da / /*max_slope*/kd_factor; + + // let k_df = /*uplift_i*/0.05e-3 / (1.0 + k_da * /*chunk_area_pow*/(10_000.0).powf(q)) / max_slope.powf(q_); + // let k = (uplift_i - kf(posi) * dt * (p * chunk_area).powf(m_f(posi) as f64) * max_slope.powf(n_f(posi) as f64)).max(0.0) / (1.0 + k_da * chunk_area_pow) / max_slope.powf(q_); + // let k = (uplift_i * (1.0 + g_i / p) - k_f * (p * chunk_area).powf(m_f(posi) as f64) * max_slope.powf(n_f(posi) as f64)).max(0.0) / (1.0 + k_da * chunk_area_pow) / max_slope.powf(q_); + // let k = uplift_i / (1.0/* + k_da * chunk_area_pow*/) / max_slope.powf(q_); + // let k = uplift_i / (1.0 + k_da * chunk_area_pow) / max_slope.powf(q_); + // let k = (uplift_i + max_uplift as f64 * g_i / p) / (1.0 + k_da * chunk_area_pow) / max_slope.powf(q_); + // let k = (uplift_i + max_uplift as f64 * g_i / p) / (1.0 + k_da * (100.0 * 100.0).powf(q)) / max_slope.powf(q_); + // let k = k_df * dt; + + let mwrec_i = &mwrec[posi]; + for (kk, posj) in mrec_downhill(&mrec, posi) { + let mwrec_kk = mwrec_i[kk]; + // let posj = posj as usize; + + // Working equation: + // U = uplift per time + // D = sediment deposition per time + // E = fluvial erosion per time + // 0 = U + D - E - k_df * (1 + k_da * (mrec_kk * A)^q) * (∂B/∂p)^(q_) + // + // k_df = (U + D - E) / (1 + k_da * (mrec_kk * A)^q) / (∂B/∂p)^(q_) + // + // Want: ∂B/∂p = max slope at steady state, i.e. + // ∂B/∂p = max_slope + // Then: + // k_df = (U + D - E) / (1 + k_da * (mrec_kk * A)^q) / max_slope^(q_) + // Letting + // k = k_df * Δt + // we get: + // k = (U + D - E)Δt / (1 + k_da * (mrec_kk * A)^q) / (ΔB)^(q_) + // + // Now ∂B/∂t under constant uplift, without debris flow (U + D - E), is + // U + D - E = U - E + G/(p̃A) * ∫_A((U - ∂h/∂t) * dA) + // + // Observing that at steady state ∂h/∂t should theoretically + // be 0, we can simplify to: + // U + D = U + G/(p̃A) * ∫_A(U * dA) + // + // Upper bounding this at uplift = max_uplift/∂t for the whole prior + // drainage area, and assuming we account for just mrec_kk of + // the combined uplift and deposition, we get: + // + // U + D ≤ mrec_kk * U + G/p̃ * max_uplift/∂t + // (U + D - E)Δt ≤ (mrec_kk * uplift_i + G/p̃ * mrec_kk * max_uplift - EΔt) + // + // therefore + // k * (1 + k_da * (mrec_kk * A)^q) * max_slope^(q_) ≤ (mrec_kk * (uplift_i + G/p̃ * max_uplift) - EΔt) + // i.e. + // k ≤ (mrec_kk * (uplift_i + G/p̃ * max_uplift) - EΔt) / (1 + k_da * (mrec_kk * A)^q) / max_slope^q_ + // + // (eliminating EΔt maintains the sign, but it's somewhat imprecise; + // we can address this later, e.g. by assigning a debris flow / fluvial erosion ratio). + let chunk_neutral_area = /*10.0e6*/1.0e6/*0.1e6*//*100.0 * 100.0*/; // 1 km^2 * (1000 m / km)^2 = 1e6 m^2 + let k = (mwrec_kk * (uplift_i + max_uplift as f64 * g_i/* / p*/)) / (1.0 + k_da * (mwrec_kk * chunk_neutral_area).powf(q)) / max_slope.powf(q_); + + // ∆p = ||chunk_i - rec_i,kk|| + // k = k_df * Δt / (Δp)^(q_) + // we have + // + // + // ΔB = k * (1 + k_da * (mrec_kk * A)^q) * (∆p)^(q_) + // k * (1 + k_da * (mrec_kk * A)^q) = ΔB / ∆p^(q_) + // k = ΔB / (1 + k_da * (mrec_kk * A)^q) / ∆p + // + // Now ∂B/∂t under constant uplift, without debris flow, is + // ∂B/∂t = U - E + G/(p̃A) * ∫_A((U - ∂h/∂t) * dA) + let dxy = (uniform_idx_as_vec2(posi) - uniform_idx_as_vec2(posj)).map(|e| e as f64); + let neighbor_distance = (neighbor_coef * dxy).magnitude(); + + let knew = (k * (1.0 + k_da * chunk_area_pow * (area_i * mwrec_kk as f64).powf(q)) / neighbor_distance.powf(q_)) as SimdType/*Compute*/; + // let knew = (k * (1.0 + k_da * chunk_area_pow * (area_i * mwrec_i.extract(kk) as f64).powf(q)) / neighbor_distance.powf(q_)) as Compute; + // let knew = 0.0; + k_tot[kk] = knew; + // k_tot = k_tot.replace(kk, knew); + } + k_tot + } + }) + .collect::>() + }, + ); + /* h.par_iter_mut().enumerate().for_each(|(posi, h)| { + *h += uplift(posi) as Alt; + }); */ + + log::debug!("Computed stream power factors..."); + + let mut lake_water_volume = + vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); let mut elev = vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); - let mut hp = vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); + let mut h_p = vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); + /* let mut hp = vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); + let mut ap = vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); */ let mut deltah = vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); + /* let mut deltah_sediment = vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); + let mut deltah_alluvium = vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); */ // calculate the elevation / SPL, including sediment flux - let tol = 1.0e-4 as Compute * (maxh as Compute + 1.0); + let tol1 = 1.0e-4 as Compute * (maxh as Compute + 1.0); + let tol2 = 1.0e-3 as Compute * (max_uplift as Compute + 1.0); + let tol = tol1.max(tol2); let mut err = 2.0 * tol; // Some variables for tracking statistics, currently only for debugging purposes. - let mut minh = f64::INFINITY as Alt; + let mut minh = ::infinity(); let mut maxh = 0.0; let mut nland = 0usize; + let mut ncorr = 0usize; let mut sums = 0.0; let mut sumh = 0.0; + let mut suma = 0.0; let mut sumsed = 0.0; + let mut suma_land = 0.0; let mut sumsed_land = 0.0; let mut ntherm = 0usize; + // ln of product of actual slopes (only where actual is above critical). + let mut prods_therm = 0.0; + // ln of product of critical slopes (only where actual is above critical). + let mut prodscrit_therm = 0.0; let avgz = |x, y: usize| if y == 0 { f64::INFINITY } else { x / y as f64 }; + let geomz = |x: f64, y: usize| { + if y == 0 { + f64::INFINITY + } else { + (x / y as f64).exp() + } + }; // Gauss-Seidel iteration - let mut lake_sediment = vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); + let mut lake_silt = + vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); + /* let mut lake_sediment = vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); + let mut lake_alluvium = vec![/*-1i32*/0.0 as Compute; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); */ let mut lake_sill = vec![/*-1i32*/-1isize; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); + /* let mut h_ = (0..WORLD_SIZE.x * WORLD_SIZE.y) + .into_par_iter() + .map(|posi| ht[posi] + at[posi].max(0.0)) + .collect::>() + .into_boxed_slice(); */ let mut n_gs_stream_power_law = 0; - while err > tol && n_gs_stream_power_law < 99 { - log::info!("Stream power iteration #{:?}", n_gs_stream_power_law); + let max_n_gs_stream_power_law = /*199*/99; + while err > tol && n_gs_stream_power_law < max_n_gs_stream_power_law { + log::debug!("Stream power iteration #{:?}", n_gs_stream_power_law); // Reset statistics in each loop. maxh = 0.0; - minh = f64::INFINITY as Alt; + minh = ::infinity(); nland = 0usize; + ncorr = 0usize; sums = 0.0; sumh = 0.0; sumsed = 0.0; + suma = 0.0; sumsed_land = 0.0; + suma_land = 0.0; ntherm = 0usize; + prods_therm = 0.0; + prodscrit_therm = 0.0; // Keep track of how many iterations we've gone to test for convergence. n_gs_stream_power_law += 1; rayon::join( || { - // guess/update the elevation at t+Δt (k) - hp.par_iter_mut().zip(h.par_iter()).for_each(|(mut hp, h)| { - *hp = *h as Compute; - }); + /*rayon::join( + || */ + { + // guess/update the elevation at t+Δt (k) + h_p.par_iter_mut() + .zip(/*h_*/ h.par_iter()) /*.zip(wh.par_iter())*/ + .for_each(|((mut h_p, h_)/*, wh_*/)| { + *h_p = (*h_)/*.max(*wh_)*/ as Compute; + }); + /* hp.par_iter_mut().zip(h.par_iter()).for_each(|(mut hp, h)| { + *hp = *h as Compute; + }); */ + } /*, + || { + // guess/update the alluvium at t+Δt (k) + ap.par_iter_mut().zip(a.par_iter()).for_each(|(mut ap, a)| { + *ap = *a as Compute; + }); + }, */ + /*)*/ }, || { - // calculate erosion/deposition at each node - deltah.par_iter_mut().enumerate().for_each(|(posi, mut deltah)| { - let uplift_i = uplift(posi) as Alt; - *deltah = (ht[posi] + uplift_i - h[posi]) as Compute; - }); + /*rayon::join( + || */ + { + // calculate erosion/deposition of sediment at each node + deltah.par_iter_mut().enumerate().for_each(|(posi, mut deltah)| { + let uplift_i = uplift(posi) as Alt; + // h_j(t, FINAL) + U_j * Δt - h_j(t + Δt, k) + /* debug_assert!(((h[posi] + a[posi].max(0.0)) - h_[posi]).abs() <= 1.0e-6); + // let foo = (ht[posi] + uplift_i - h[posi] - (at[posi] - a[posi]/*.max(0.0)*/)) as Compute; + let foo = (ht[posi] + uplift_i - h[posi] - (at[posi] - a[posi].max(0.0)/*.max(0.0)*/)) as Compute; + // let foo = (ht[posi] + at[posi] + uplift_i - (h[posi] + a[posi].max(0.0))) as Compute; + let bar = (at[posi]/* + uplift_i*/ - a[posi].max(0.0)/* - (h[posi] - ht[posi]*/)) as Compute; */ + let delta = (/*ht[posi] + at[posi].max(0.0)*/h_t[posi] + uplift_i - /*h_*/h[posi]/*.max(wh[posi])*/) as Compute; + /* if (delta - (foo + bar)).abs() > 1.0e-6 { + println!("dh: {:?}, foo: {:?}, bar: {:?}, delta: {:?}, ht: {:?}, at: {:?}, h: {:?}, a: {:?}, h_: {:?}", + dh[posi], foo, bar, delta, + ht[posi], at[posi], + h[posi], a[posi], h_[posi]); + debug_assert_eq!(delta, foo + bar); + } */ + + *deltah = delta; + }); + /* deltah_sediment.par_iter_mut().enumerate().for_each(|(posi, mut deltah)| { + let uplift_i = uplift(posi) as Alt; + *deltah = (ht[posi] + uplift_i - h[posi] - (at[posi] - a[posi].max(0.0))) as Compute; + }); */ + } /*, + || { + // calculate erosion/deposition of alluvium at each node + deltah_alluvium.par_iter_mut().enumerate().for_each(|(posi, mut deltah)| { + let uplift_i = uplift(posi) as Alt; + *deltah = (at[posi]/* + uplift_i*/ - a[posi].max(0.0)/* - (h[posi] - ht[posi])*/) as Compute; + }); + }, + )*/ }, ); - + log::debug!("(Done precomputation)."); // sum the erosion in stack order // // After: - // deltah_i = Σ{j ∈ {i} ∪ upstream_i(t)}(h_j(t, FINAL) + U_j * Δt - h_j(t + Δt, k)) - for &posi in newh.iter().rev() { + // deltah_i = Σ{j ∈ {i} ∪ upstream_i(t)}(h_j(t, FINAL) + U_j * Δt - h_i(t + Δt, k)) + for &posi in /*newh.iter().rev()*/mstack.into_iter() { let posi = posi as usize; let posj = dh[posi]; if posj < 0 { - lake_sediment[posi] = deltah[posi]; + lake_silt[posi] = deltah[posi]; + /* lake_sediment[posi] = deltah_sediment[posi]; + lake_alluvium[posi] = deltah_alluvium[posi]; */ } else { let uplift_i = uplift(posi) as Alt; - let posj = posj as usize; - deltah[posi] -= ((ht[posi] + uplift_i) as Compute - hp[posi]); + /* if (deltah[posi] - (deltah_sediment[posi] + deltah_alluvium[posi])).abs() > 1.0e-2 { + println!("deltah_sediment: {:?}, deltah_alluvium: {:?}, deltah: {:?}, hp: {:?}, ap: {:?}, h_p: {:?}, ht: {:?}, at: {:?}, h: {:?}, a: {:?}, h_: {:?}", + deltah_sediment[posi], deltah_alluvium[posi], deltah[posi], + hp[posi], ap[posi], h_p[posi], + ht[posi], at[posi], + h[posi], a[posi], h_[posi]); + debug_assert_eq!(deltah[posi], deltah_sediment[posi] + deltah_alluvium[posi]); + } */ + deltah[posi] -= ((/*ht[posi] + at[posi].max(0.0)*/h_t[posi] + uplift_i) as Compute - h_p[posi]); + /* deltah_sediment[posi] -= ((ht[posi] + uplift_i - (at[posi] - ap[posi].max(0.0))) as Compute - hp[posi]); + deltah_alluvium[posi] -= ((at[posi]/* + uplift_i - (hp[posi] - ht[posi])*/) as Compute - ap[posi].max(0.0)); */ let lposi = lake_sill[posi]; if lposi == posi as isize { if deltah[posi] <= 0.0 { + lake_silt[posi] = 0.0; + } else { + lake_silt[posi] = deltah[posi]; + } + /* if deltah_sediment[posi] <= 0.0 { lake_sediment[posi] = 0.0; } else { - lake_sediment[posi] = deltah[posi]; + lake_sediment[posi] = deltah_sediment[posi]; } + if deltah_alluvium[posi] <= 0.0 { + lake_alluvium[posi] = 0.0; + } else { + lake_alluvium[posi] = deltah_alluvium[posi]; + } */ } - deltah[posi] += (ht[posi] + uplift_i) as Compute - hp[posi]; - deltah[posj] += deltah[posi]; + deltah[posi] += (/* ht[posi] + at[posi].max(0.0) */h_t[posi] + uplift_i) as Compute - h_p[posi]; + let mwrec_i = &mwrec[posi]; + for (k, posj) in mrec_downhill(&mrec, posi) { + deltah[posj] += deltah[posi] * mwrec_i[k]/*mwrec_i.extract(k)*/; + } + /* let posj = posj as usize; + deltah[posj] += deltah[posi]; */ + + /* deltah_sediment[posi] += (ht[posi] + uplift_i - (at[posi] - ap[posi].max(0.0))) as Compute - hp[posi]; + deltah_sediment[posj] += deltah_sediment[posi]; + deltah_alluvium[posi] += (at[posi]/* + uplift_i - (hp[posi] - ht[posi]*/) as Compute - ap[posi].max(0.0); + deltah_alluvium[posj] += deltah_alluvium[posi]; */ } + /* if (deltah[posi] - (deltah_sediment[posi] + deltah_alluvium[posi])).abs() > 1.0e-2 { + println!("deltah_sediment: {:?}, deltah_alluvium: {:?}, deltah: {:?}, hp: {:?}, ap: {:?}, h_p: {:?}, ht: {:?}, at: {:?}", + deltah_sediment[posi], deltah_alluvium[posi], deltah[posi], + hp[posi], ap[posi], h_p[posi], + ht[posi], at[posi]); + debug_assert_eq!(deltah[posi], deltah_sediment[posi] + deltah_alluvium[posi]); + } */ } + log::debug!("(Done sediment transport computation)."); // do ij=nn,1,-1 // ijk=stack(ij) // ijr=rec(ijk) @@ -918,11 +1285,37 @@ fn erode( // enddo elev.par_iter_mut().enumerate().for_each(|(posi, mut elev)| { + let uplift_i = uplift(posi) as Alt; + // let delta_a = a[posi] - at[posi]; if dh[posi] < 0 { - *elev = ht[posi] as Compute; + // *elev = (ht[posi] + uplift_i - delta_a) as Compute; + *elev = (/*ht[posi] + at[posi].max(0.0)*/h_t[posi] + uplift_i) as Compute; } else { - let uplift_i = uplift(posi) as Alt; - assert!(uplift_i.is_normal() && uplift_i > 0.0 || uplift_i == 0.0); + // let old_h_after_uplift_i = (ht[posi] + uplift_i - delta_a) as Compute; + let old_h_after_uplift_i = (/*ht[posi] + at[posi].max(0.0)*/h_t[posi] + uplift_i) as Compute; + let area_i = area[posi] as Compute; + // debug_assert!(area_i > 0.0); + let uphill_silt_i = deltah[posi] - (old_h_after_uplift_i - h_p[posi]); + // let uphill_sediment_i = deltah_sediment[posi] - (old_h_after_uplift_i - hp[posi]); + /* let uphill_sediment_alluvium_i = + deltah_sediment[posi] - (ht[posi] + uplift_i - (at[posi] - ap[posi].max(0.0)) - hp[posi]) + + deltah_alluvium[posi] - ((/*at[posi] + uplift_i - (hp[posi] - ht[posi]*/at[posi]) - ap[posi].max(0.0)/*at[posi]*/); */ + /* let uphill_sediment_alluvium_i = + deltah_sediment[posi] + deltah_alluvium[posi] - + 2.0 * (old_h_after_uplift_i - (hp[posi] + ap[posi])); */ + // let g_i = g(posi) as Compute; + let old_b_i = b[posi]; + let sed = (h_t[posi] - old_b_i) as f64; + let g_i = if sed > sediment_thickness { + g_fs_mult_sed * g(posi) as Compute + } else { + g(posi) as Compute + }; + // Make sure deposition coefficient doesn't result in more deposition than there + // actually was material to deposit. The current assumption is that as long as we + // are storing at most as much sediment as there actually was along the river, we + // are in the clear. + let g_i_ratio = (g_i / area_i)/*.min(1.0)*/; // One side of nonlinear equation (23): // // h_i(t) + U_i * Δt + G / (p̃ * Ã_i) * Σ{j ∈ upstream_i(t)}(h_j(t, FINAL) + U_j * Δt - h_j(t + Δt, k)) @@ -930,28 +1323,52 @@ fn erode( // where // // Ã_i = A_i / (∆x∆y) = N_i, number of cells upstream of cell i. - *elev = (ht[posi] + uplift_i) as Compute + (deltah[posi] - ((ht[posi] + uplift_i) as Compute - hp[posi])) * g(posi) as Compute / area[posi] as Compute; + // *elev = old_h_after_uplift_i + uphill_sediment_i * g_i_ratio; + *elev = old_h_after_uplift_i + /*uphill_sediment_alluvium_i*/uphill_silt_i * g_i_ratio; + /* if (*elev - (old_h_after_uplift_i + uphill_silt_i * g_i_ratio)).abs() > 1.0e-6 { + println!("deltah_sediment: {:?}, deltah_alluvium: {:?}, deltah: {:?}, hp: {:?}, ap: {:?}, h_p: {:?}", + deltah_sediment[posi], deltah_alluvium[posi], deltah[posi], + hp[posi], ap[posi], h_p[posi]); + debug_assert_eq!(*elev, old_h_after_uplift_i + uphill_silt_i * g_i_ratio); + } */ } }); + log::debug!("(Done elevation estimation)."); + let start_time = Instant::now(); + // TODO: Consider taking advantage of multi-receiver flow here. // Iterate in ascending height order. let mut sum_err = 0.0 as Compute; - for &posi in &*newh { + /* let mut k_df_weights = Computex8::new(0.0); + let mut k_fs_weights = Computex8::new(0.0); + let mut rec_heights = Computex8::new(0.0); */ + /* let mut k_df_weights = [0.0; 8]; + let mut k_fs_weights = [0.0; 8]; + let mut rec_heights = [0.0; 8]; */ + let mut simd_buf = [0.0; 8]; + let mut simd_buf2 = [0.0; 8]; + let mut simd_buf3 = [0.0; 8]; + for &posi in /*&*newh*/mstack.into_iter().rev() { let posi = posi as usize; - let old_h_i = /*h*/elev[posi] as f64; + let old_elev_i = /*h*/elev[posi] as f64; + let old_wh_i = wh[posi]; let old_b_i = b[posi]; - let sed = (ht[posi] - old_b_i) as f64; + let old_ht_i = /*ht*/h_t[posi]; + let sed = (old_ht_i - old_b_i) as f64; let posj = dh[posi]; if posj < 0 { if posj == -1 { panic!("Disconnected lake!"); } - if ht[posi] > 0.0 { + if /*ht*/h_t[posi] > 0.0 { log::warn!("Ocean above zero?"); } // wh for oceans is always at least min_erosion_height. - wh[posi] = min_erosion_height.max(ht[posi]); + let uplift_i = uplift(posi) as Alt; + // wh[posi] = min_erosion_height.max(ht[posi] + uplift_i); + wh[posi] = min_erosion_height.max(/*ht[posi] + at[posi].max(0.0)*/h_t[posi] + uplift_i); + // debug_assert!(wh[posi].is_normal() || wh[posi] == 0.0); lake_sill[posi] = posi as isize; lake_water_volume[posi] = 0.0; // max_slopes[posi] = kd(posi); @@ -974,16 +1391,61 @@ fn erode( // h[i](t + dt) = (h[i](t) + δt * (uplift[i] + flux(i) * h[j](t + δt))) / (1 + flux(i) * δt). // NOTE: posj has already been computed since it's downhill from us. // Therefore, we can rely on wh being set to the water height for that node. - let h_j = h[posj] as f64; + // let h_j = h[posj] as f64; + // let a_j = a[posj] as f64; let wh_j = wh[posj] as f64; - let mut new_h_i = /*old_h_i*/h[posi] as f64/* + uplift_i*/; + // let old_a_i = a[posi] as f64; + let old_h_i = h[posi] as f64; + let mut new_h_i = /*old_elev_i*//*old_h_i + old_a_i.max(0.0)*/old_h_i/*h[posi] as f64*//* + uplift_i*/; + /* let mut df_part; + + let old_df_part = { + let uphill_alluvium_i = + deltah_alluvium[posi] - ((/*at[posi] + uplift_i - (hp[posi] - ht[posi]*/at[posi]) - ap[posi].max(0.0)/*at[posi]*/); + /* let uphill_sediment_alluvium_i = + deltah_sediment[posi] + deltah_alluvium[posi] - + 2.0 * (old_h_after_uplift_i - (hp[posi] + ap[posi])); */ + let area_i = area[posi] as Compute; + let g_i = g(posi) as Compute; + // Make sure deposition coefficient doesn't result in more deposition than there + // actually was material to deposit. The current assumption is that as long as we + // are storing at most as much sediment as there actually was along the river, we + // are in the clear. + let g_i_ratio = (g_i / area_i)/*.min(1.0)*/; + at[posi].max(0.0) + uphill_alluvium_i * g_i_ratio + }; */ + // Only perform erosion if we are above the water level of the previous node. - if old_h_i > wh_j { + if old_elev_i > wh_j/*h_j*//*h[posj]*/ { + let mut dtherm = 0.0f64; + /* { + // Thermal erosion (landslide) + let dxy = (uniform_idx_as_vec2(posi) - uniform_idx_as_vec2(posj)).map(|e| e as f64); + let neighbor_distance = (neighbor_coef * dxy).magnitude(); + let dz = (new_h_i - /*h_j*//*h_k*//*wh_j*//*h_j*/wh_j.max(hp[posj])).max(0.0) / height_scale/* * CONFIG.mountain_scale as f64*/; + let mag_slope = dz/*.abs()*/ / neighbor_distance; + let max_slope = max_slopes[posi] as f64; + if mag_slope > max_slope { + let dh = max_slope * neighbor_distance * height_scale/* / CONFIG.mountain_scale as f64*/; + // new_h_i = (ht[posi] as f64 + l_tot * (mag_slope - max_slope)); + // new_h_i = new_h_i - l_tot * (mag_slope - max_slope); + let uplift_i = uplift(posi) as f64; + let g_i = g(posi) as f64; + dtherm = -((l_tot * (mag_slope - max_slope)).min(/*dh*//*g_i * *//*uplift_i*//*max_uplift as f64*//*dz*//*uplift_i*//*(new_h_i + uplift_i - old_elev_i).abs() * 0.5*//* * 0.5*//*g_i * dz * 0.5*//*dz*/(old_h_i + uplift_i - old_elev_i).abs() * 0.5)); + // new_h_i = hp[posj] + dh; + // new_h_i = /*old_h_i.max*/(/*wh_j*//*ht[posi] as Compute*//*h_j*/hp[posj]/*ht[posj] as Compute*/ + dh).max(new_h_i - l_tot * (mag_slope - max_slope)); + if compute_stats/* && new_h_i > wh_j*/ { + ntherm += 1; + } + } + } */ + let h0 = old_elev_i + dtherm; + // hi(t + ∂t) = (hi(t) + ∂t(ui + kp^mAi^m(hj(t + ∂t)/||pi - pj||))) / (1 + ∂t * kp^mAi^m / ||pi - pj||) /* let k = if sed > sediment_thickness { // Sediment // k_fs - k_fs_mult * kf(posi) + k_fs_mult_sed * kf(posi) } else { // Bedrock // k_fb @@ -994,17 +1456,262 @@ fn erode( let m = m_f(posi) as f64; */ let n = n_f(posi) as f64; - if /*n == 1.0*/(n - 1.0).abs() <= 1.0e-3/*f64::EPSILON*/ { - let flux = /*k * (p * chunk_area * area[posi] as f64).powf(m) / neighbor_distance;*/k_fact[posi]; - assert!(flux.is_normal() && flux.is_positive() || flux == 0.0); - new_h_i = (/*new_h_i*/old_h_i + flux * h_j) / (1.0 + flux); + // Fluvial erosion. + let k_df_fact = &k_df_fact[posi]; + let k_fs_fact = &k_fs_fact[posi];// k * (p * chunk_area * area[posi] as f64).powf(m) / neighbor_distance.powf(n); + /* // Multiply k_fs_fact by k_fs_mult_water for water. + let k_fs_fact = if h0 < wh_j { + k_fs_mult_* k_fs_fact + } else { + k_fs_fact + }; */ + // let elev_j = h_j/* + a_j.max(0.0)*/; + let new_ht_i = (old_ht_i/* + uplift(posi) as f64*/); + if /*n == 1.0*/(n - 1.0).abs() <= 1.0e-3/*f64::EPSILON*/ && (q_ - 1.0).abs() <= 1.0e-3 { + let mut f = h0; + let mut df = 1.0; + for (kk, posj) in mrec_downhill(&mrec, posi) { + // This can happen in cases where receiver kk is neither uphill of + // nor downhill from posi's direct receiver. + if /*new_ht_i/*old_ht_i*/ >= (h_t[posj]/* + uplift(posj) as f64*/)*/old_elev_i /*>=*/> wh[posj] as f64/*h[posj]*//*h_j*/ { + let h_j = h[posj] as f64; + let elev_j = h_j/* + a_j.max(0.0)*/; + /* let flux = /*k * (p * chunk_area * area[posi] as f64).powf(m) / neighbor_distance;*/k_fs_fact[kk] + k_df_fact[kk]; + assert!(flux.is_normal() && flux.is_positive() || flux == 0.0); + new_h_i = (/*new_h_i*//*(old_elev_i + (new_h_i - old_h_i))*/h0 + flux * elev_j) / (1.0 + flux); */ + let fact = k_fs_fact[kk] as f64 + k_df_fact[kk] as f64; + // let fact = k_fs_fact.extract(kk) as f64 + k_df_fact.extract(kk) as f64; + f += fact * elev_j; + df += fact; + } + } + new_h_i = f / df; } else { // Local Newton-Raphson - let omega = 0.875f64 / n; + let omega1 = 0.875f64 * n; + let omega2 = 0.875f64 / q_;/*if q_ < 0.5 { 0.875f64/* * q_*/ } else { 0.875f64 / q_ }*/; + let omega = omega1.max(omega2); + let tolp = 1.0e-3/*1.0e-4*/; + let mut errp = 2.0 * tolp; + // let h0 = old_elev_i + (new_h_i - old_h_i); + // let mut count = 0; + let mut max = 0usize; + /* let mut k_df_weights = [0.0; 8];//f64s(0.0);//f64x8::splat(0.0); + let mut k_fs_weights = [0.0; 8];//f64s(0.0);//f64x8::splat(0.0); + let n_weights = simd_func(n as SimdType - 1.0); + // let n_weights = f64s(n - 1.0);//f64x8::splat(n - 1.0); + let q__weights = simd_func(q_ as SimdType - 1.0); + // let q_weights = f64s(q_ - 1.0);//f64x8::splat(q_ - 1.0); + let czero = simd_func(0.0); + // let czero = f64s(0.0);//f64x8::splat(0.0); */ + let mut rec_heights = [0.0; 8];//f64s(0.0);//f64x8::splat(0.0); + let mut mask = [MaskType::new(false); 8]; + for (kk, posj) in mrec_downhill(&mrec, posi) { + if old_elev_i > wh[posj] as f64 { + // k_fs_weights[kk] = k_fs_fact[kk] as SimdType; + // k_fs_weights[max] = k_fs_fact[kk] as SimdType; + // /*k_fs_weights = */k_fs_weights.replace(max, k_fs_fact[kk]/*.extract(kk)*/ as f64); + // k_df_weights[kk] = k_df_fact[kk] as SimdType; + // k_df_weights[max] = k_df_fact[kk] as SimdType; + // /*k_df_weights = */k_df_weights.replace(max, k_df_fact[kk]/*.extract(kk)*/ as f64); + mask[kk] = MaskType::new(true); + rec_heights[kk] = h[posj] as SimdType; + // rec_heights[max] = h[posj] as SimdType; + // /*rec_heights = */rec_heights.replace(max, h[posj] as f64); + // max += 1; + } + } + /* let (weights_heights, max) = { + let mut iter = mrec_downhill(&mrec, posi); + let mut max = 0usize; + let arr = arr![ + match iter.next() { + Some((kk, posj)) if old_elev_i >= wh[posj] => { + max += 1; + (k_fs_fact[kk], k_df_fact[kk], h[posj]) + }, + _ => (0.0, 0.0, 0.0), + }; 8]; + (arr, max) + }; */ + assert!(max <= 8); + /* let k_fs_weights = &k_fs_weights[..max]; + let k_df_weights = &k_df_weights[..max]; + let rec_heights = &rec_heights[..max]; + let mut simd_buf = &mut simd_buf[..max]; + let mut simd_buf2 = &mut simd_buf2[..max]; + let mut simd_buf3 = &mut simd_buf3[..max]; */ + /* let czero = &czero[..max]; + let n_weights = &n_weights[..max]; + let q__weights = &q__weights[..max]; */ + while errp > tolp { + // count += 1; + /* if count > -1 { + println!("posi={:?} errp={:?} tolp={:?} h0={:?} new_h_i={:?} elev_j={:?} area={:?}", posi, errp, tolp, h0, new_h_i, elev_j, area[posi]); + } */ + let mut f = new_h_i - h0; + let mut df = 1.0; + + /* rec_heights.simd_iter(czero/*simd_func(0.0)*/) + .simd_map(|elev_j| czero/*simd_func(0.0)*/.max(new_h_i as SimdType - elev_j)) + .scalar_fill(&mut simd_buf); + + (k_fs_weights/*k_fs_fact*/.simd_iter(czero/*simd_func(0.0)*/), simd_buf.simd_iter(czero/*simd_func(0.0)*/)) + .zip() + .simd_map(|(k_fs_fact, dh)| k_fs_fact * dh.powf(/*simd_func(n as SimdType - 1.0)*/n_weights)) + .scalar_fill(&mut simd_buf2); + + (k_df_weights/*k_df_fact*/.simd_iter(czero/*simd_func(0.0)*/), simd_buf.simd_iter(czero/*simd_func(0.0)*/)) + .zip() + .simd_map(|(k_df_fact, dh)| k_df_fact * dh.powf(/*simd_func(q_ as SimdType - 1.0)*/q__weights)) + .scalar_fill(&mut simd_buf3); + + f += (simd_buf.simd_iter(czero/*simd_func(0.0)*/), simd_buf2.simd_iter(czero/*simd_func(0.0)*/), simd_buf3.simd_iter(czero/*simd_func(0.0)*/)) + .zip() + /* .simd_map(|(dh, k_fs_fact, k_df_fact)| (k_fs_fact + k_df_fact) * dh) + .simd_reduce(czero/*simd_func(0.0)*/, |a, v| a + v) */ + .simd_reduce(czero/*simd_func(0.0)*/, |a, (dh, k_fs_fact, k_df_fact)| a + (k_fs_fact + k_df_fact) * dh) + .sum() as f64; + + df += (simd_buf2.simd_iter(czero/*simd_func(0.0)*/), simd_buf3.simd_iter(czero/*simd_func(0.0)*/)) + .zip() + /* .simd_map(|(k_fs_fact, k_df_fact)| n as SimdType * k_fs_fact + q_ as SimdType * k_df_fact) + .simd_reduce(czero/*simd_func(0.0)*/, |a, v| a + v) */ + .simd_reduce(czero/*simd_func(0.0)*/, |a, (k_fs_fact, k_df_fact)| n as SimdType * k_fs_fact + q_ as SimdType * k_df_fact) + .sum() as f64; */ + + /* f += (k_fs_weights.simd_iter(simd_func(0.0)), k_df_weights.simd_iter(simd_func(0.0)), simd_buf.simd_iter(simd_func(0.0))) + .zip() + .simd_map(|(k_fs_fact, k_df_fact, dh)| { + // let dh = simd_func(0.0).max(new_h_i as SimdType - elev_j); + k_fs_fact * dh.powf(simd_func(n as SimdType)) + k_df_fact * dh.powf(simd_func(q_ as SimdType)) + }) + .simd_reduce(simd_func(0.0), |a, v| a + v) + .sum() as f64; + + df += (k_fs_weights.simd_iter(simd_func(0.0)), k_df_weights.simd_iter(simd_func(0.0)), rec_heights.simd_iter(simd_func(0.0))) + .zip() + .simd_map(|(k_fs_fact, k_df_fact, dh)| { + // let dh = simd_func(0.0).max(new_h_i as SimdType - elev_j); + n as SimdType * k_fs_fact * dh.powf(simd_func(n as SimdType) - 1.0) + + k_df_fact * q_ as SimdType * dh.powf(simd_func(q_ as SimdType - 1.0)) + }) + .simd_reduce(simd_func(0.0), |a, v| a + v) + .sum() as f64; */ + + /* let dh = (&rec_heights[..]).simd_iter(f64s(0.0)) + .simd_map(|elev_j| f64s(0.0).max(new_h_i - elev_j)); + let k_fs_fact = + (dh, (&k_fs_weights[..]).simd_iter(f64s(0.0))) + .zip() + .simd_map(|(dh, k_fs_fact)| k_fs_fact * dh.powf(f64s(n - 1.0))); + let k_df_fact = + (dh, (&k_df_weights[..]).simd_iter(f64s(0.0))) + .zip() + .simd_map(|dh, k_df_fact| k_df_fact * dh.powf(f64s(q_ - 1.0))); + f += (k_fs_fact, k_df_fact, dh) + .zip() + .simd_map(|(k_fs_fact, k_df_fact, dh)| (k_fs_fact + k_df_fact) * dh) + .simd_reduce(f64s(0.0), |a, v| a + v) + .sum(); + df += (k_fs_fact, k_df_fact, dh) + .zip() + .simd_map(|(k_fs_fact, k_df_fact, dh)| n * k_fs_fact + q_ * k_df_fact) + .simd_reduce(f64s(0.0), |a, v| a + v) + .sum(); */ + /* (k_fs_weights.simd_iter(f64s(0.0)), k_df_weights.simd_iter(f64s(0.0)), rec_heights.simd_iter(f64s(0.0))) + .zip() + .simd_map(|k_fs_fact, k_df_fact, elev_j| { + f64s(0.0).max(new_h_i - elev_j) + }) */ + /* let dh = (-rec_heights + new_h_i).max(czero); + let dh_fs_sample = k_fs_weights * dh.powf(n_weights); + let dh_df_sample = k_df_weights * dh.powf(q_weights); + f += ((dh_fs_sample + dh_df_sample) * dh).sum(); + df += (n * dh_fs_sample + q_ * dh_df_sample).sum(); */ + + /* for kk in (0..max) { + let dh = 0.0.max((new_h_i - rec_heights[kk])/*.abs()*/); + let dh_fs_sample = k_fs_weights[kk] * dh.powf(n - 1.0); + let dh_df_sample = k_df_weights[kk] * dh.powf(q_ - 1.0); + // Want: h_i(t+Δt) = h0 - fact * (h_i(t+Δt) - h_j(t+Δt))^n + // Goal: h_i(t+Δt) - h0 + fact * (h_i(t+Δt) - h_j(t+Δt))^n = 0 + f += (dh_fs_sample + dh_df_sample) * dh; + // ∂h_i(t+Δt)/∂n = 1 + fact * n * (h_i(t+Δt) - h_j(t+Δt))^(n - 1) + df += n * dh_fs_sample + q_ * dh_df_sample; + } */ + /* for (k_fs_fact, k_df_fact, elev_j) in weights_heights.iter().take(max) { + let dh = 0.0.max((new_h_i - elev_j)/*.abs()*/); + let dh_fs_sample = k_fs_fact * dh.powf(n - 1.0); + let dh_df_sample = k_df_fact * dh.powf(q_ - 1.0); + // Want: h_i(t+Δt) = h0 - fact * (h_i(t+Δt) - h_j(t+Δt))^n + // Goal: h_i(t+Δt) - h0 + fact * (h_i(t+Δt) - h_j(t+Δt))^n = 0 + f += (dh_fs_sample + dh_df_sample) * dh; + // ∂h_i(t+Δt)/∂n = 1 + fact * n * (h_i(t+Δt) - h_j(t+Δt))^(n - 1) + df += n * dh_fs_sample + q_ * dh_df_sample; + } */ + /* for (kk, posj) in mrec_downhill(&mrec, posi) { + if /*new_ht_i/*old_ht_i*/ > (h_t[posj]/* + uplift(posj) as f64*/)*/old_elev_i /*>=*/> wh[posj] as f64/*h[posj]*//*h_j*/ { + let h_j = h[posj] as /*f64*/SimdType; + let elev_j = h_j/* + a_j.max(0.0)*/; + let dh = 0.0.max((new_h_i as SimdType - elev_j)/*.abs()*/); + let dh_fs_sample = k_fs_fact[kk] as /*f64*/SimdType * dh.powf(n as SimdType - 1.0); + let dh_df_sample = k_df_fact[kk] as /*f64*/SimdType * dh.powf(q_ as SimdType - 1.0); + // Want: h_i(t+Δt) = h0 - fact * (h_i(t+Δt) - h_j(t+Δt))^n + // Goal: h_i(t+Δt) - h0 + fact * (h_i(t+Δt) - h_j(t+Δt))^n = 0 + f += ((dh_fs_sample + dh_df_sample) * dh) as f64; + // ∂h_i(t+Δt)/∂n = 1 + fact * n * (h_i(t+Δt) - h_j(t+Δt))^(n - 1) + df += (n as SimdType * dh_fs_sample + q_ as SimdType * dh_df_sample) as f64; + } + } */ + for kk in (0..8) { + //if /*new_ht_i/*old_ht_i*/ > (h_t[posj]/* + uplift(posj) as f64*/)*/old_elev_i /*>=*/> wh[posj] as f64/*h[posj]*//*h_j*/ { + if mask[kk].test() { + let h_j = rec_heights[kk]; + let elev_j = h_j/* + a_j.max(0.0)*/; + let dh = 0.0.max((new_h_i as SimdType - elev_j)/*.abs()*/); + let dh_fs_sample = k_fs_fact[kk] as /*f64*/SimdType * dh.powf(n as SimdType - 1.0); + let dh_df_sample = k_df_fact[kk] as /*f64*/SimdType * dh.powf(q_ as SimdType - 1.0); + // Want: h_i(t+Δt) = h0 - fact * (h_i(t+Δt) - h_j(t+Δt))^n + // Goal: h_i(t+Δt) - h0 + fact * (h_i(t+Δt) - h_j(t+Δt))^n = 0 + f += ((dh_fs_sample + dh_df_sample) * dh) as f64; + // ∂h_i(t+Δt)/∂n = 1 + fact * n * (h_i(t+Δt) - h_j(t+Δt))^(n - 1) + df += (n as SimdType * dh_fs_sample + q_ as SimdType * dh_df_sample) as f64; + } + //} + } + /* for (kk, posj) in mrec_downhill(&mrec, posi) { + if /*new_ht_i/*old_ht_i*/ > (h_t[posj]/* + uplift(posj) as f64*/)*/old_elev_i /*>=*/> wh[posj] as f64/*h[posj]*//*h_j*/ { + let h_j = h[posj] as f64; + let elev_j = h_j/* + a_j.max(0.0)*/; + let dh = 0.0.max((new_h_i - elev_j)/*.abs()*/); + let dh_fs_sample = k_fs_fact.extract(kk) as f64 * dh.powf(n - 1.0); + let dh_df_sample = k_df_fact.extract(kk) as f64 * dh.powf(q_ - 1.0); + // Want: h_i(t+Δt) = h0 - fact * (h_i(t+Δt) - h_j(t+Δt))^n + // Goal: h_i(t+Δt) - h0 + fact * (h_i(t+Δt) - h_j(t+Δt))^n = 0 + f += (dh_fs_sample + dh_df_sample) * dh; + // ∂h_i(t+Δt)/∂n = 1 + fact * n * (h_i(t+Δt) - h_j(t+Δt))^(n - 1) + df += n * dh_fs_sample + q_ * dh_df_sample; + } + } */ + // hn = h_i(t+Δt, k) - (h_i(t+Δt, k) - (h0 - fact * (h_i(t+Δt, k) - h_j(t+Δt))^n)) / ∂h_i/∂n(t+Δt, k) + let hn = new_h_i - f / df; + // errp = |(h_i(t+Δt, k) - (h0 - fact * (h_i(t+Δt, k) - h_j(t+Δt))^n)) / ∂h_i/∂n(t+Δt, k)| + errp = (hn - new_h_i).abs(); + // h_i(t+∆t, k+1) = ... + new_h_i = new_h_i * (1.0 - omega) + hn * omega; + } + // Correct new_h_i to keep it at or under h0. + /* if h0 < new_h_i { + println!("Huh? h0={:?}, new_h_i={:?},", h0, new_h_i); + // debug_assert!(new_h_i <= h0); + } */ + new_h_i = h0.min(new_h_i); + /* let omega = 0.875f64 / n; let tolp = 1.0e-3; let mut errp = 2.0 * tolp; - let h0 = old_h_i; - let fact = k_fact[posi];// k * (p * chunk_area * area[posi] as f64).powf(m) / neighbor_distance.powf(n); + // let h0 = old_elev_i; + let fact = k_fs_fact[posi];// k * (p * chunk_area * area[posi] as f64).powf(m) / neighbor_distance.powf(n); while errp > tolp { let mut f = new_h_i - h0; let mut df = 1.0; @@ -1019,7 +1726,7 @@ fn erode( errp = (hn - new_h_i).abs(); // h_i(t+∆t, k+1) = ... new_h_i = new_h_i * (1.0 - omega) + hn * omega; - } + } */ /* omega=0.875d0/n tolp=1.d-3 errp=2.d0*tolp @@ -1037,54 +1744,156 @@ fn erode( h(ijk)=h(ijk)*(1.d0-omega)+hn*omega enddo */ } - lake_sill[posi] = posi as isize; - lake_water_volume[posi] = 0.0; - /* // Thermal erosion (landslide) - let dz = (new_h_i - /*h_j*//*h_k*//*wh_j*/h_j).max(0.0) / height_scale/* * CONFIG.mountain_scale as f64*/; - let mag_slope = dz/*.abs()*/ / neighbor_distance; - let max_slope = max_slopes[posi] as f64; - if mag_slope > max_slope { - let dh = max_slope * neighbor_distance * height_scale/* / CONFIG.mountain_scale as f64*/; - // new_h_i = (ht[posi] as f64 + l_tot * (mag_slope - max_slope)); - // new_h_i = new_h_i - l_tot * (mag_slope - max_slope); - // new_h_i = new_h_i - l_tot * (mag_slope - max_slope); - // new_h_i = hp[posj] + dh; - new_h_i = /*old_h_i.max*/(/*wh_j*//*ht[posi] as Compute*//*h_j*/hp[posj]/*ht[posj] as Compute*/ + dh).max(new_h_i - l_tot * (mag_slope - max_slope)); - if compute_stats/* && new_h_i > wh_j*/ { - ntherm += 1; + // df_part = old_df_part - k_df_fact * 0.0.max((new_h_i - elev_j)/*.abs()*/).powf(q_); + // df_part = old_df_part;// - k_df_fact * 0.0.max((new_h_i - elev_j)/*.abs()*/).powf(q_); + + /* // Debris flow erosion. + { + let omega = 0.875f64 / q_; + let tolp = 1.0e-3; + let mut errp = 2.0 * tolp; + // let h0 = new_h_i; + let fact = k_df_fact[posi];// k * (p * chunk_area * area[posi] as f64).powf(m) / neighbor_distance.powf(n); + while errp > tolp { + let mut f = new_h_i - h0; + let mut df = 1.0; + // Want: h_i(t+Δt) = h0 - fact * (h_i(t+Δt) - h_j(t+Δt))^n + // Goal: h_i(t+Δt) - h0 + fact * (h_i(t+Δt) - h_j(t+Δt))^n = 0 + f += fact * 0.0.max(new_h_i - h_j).powf(q_); + // ∂h_i(t+Δt)/∂n = 1 + fact * n * (h_i(t+Δt) - h_j(t+Δt))^(n - 1) + df += fact * n * 0.0.max(new_h_i - h_j).powf(q_ - 1.0); + // hn = h_i(t+Δt, k) - (h_i(t+Δt, k) - (h0 - fact * (h_i(t+Δt, k) - h_j(t+Δt))^n)) / ∂h_i/∂n(t+Δt, k) + let hn = new_h_i - f / df; + // errp = |(h_i(t+Δt, k) - (h0 - fact * (h_i(t+Δt, k) - h_j(t+Δt))^n)) / ∂h_i/∂n(t+Δt, k)| + errp = (hn - new_h_i).abs(); + // h_i(t+∆t, k+1) = ... + new_h_i = new_h_i * (1.0 - omega) + hn * omega; } } */ + /* { + // Thermal erosion (landslide) + let dxy = (uniform_idx_as_vec2(posi) - uniform_idx_as_vec2(posj)).map(|e| e as f64); + let neighbor_distance = (neighbor_coef * dxy).magnitude(); + let dz = (new_h_i - /*h_j*//*h_k*//*wh_j*//*h_j*/wh_j/*.max(hp[posj])*/).max(0.0) / height_scale/* * CONFIG.mountain_scale as f64*/; + let mag_slope = dz/*.abs()*/ / neighbor_distance; + let max_slope = max_slopes[posi] as f64; + if mag_slope > max_slope { + let dh = max_slope * neighbor_distance * height_scale/* / CONFIG.mountain_scale as f64*/; + // new_h_i = (ht[posi] as f64 + l_tot * (mag_slope - max_slope)); + // new_h_i = new_h_i - l_tot * (mag_slope - max_slope); + let uplift_i = uplift(posi) as f64; + let g_i = g(posi) as f64; + let dtherm = + //(l_tot * (mag_slope - max_slope)).min(/*dh*//*g_i * *//*uplift_i*//*max_uplift as f64*/dz/*uplift_i*//*(new_h_i/* + uplift_i*/ - /*old_h_i*/old_ht_i)*/./*abs()*/max(0.0) * 0.5/* * 0.5*//*g_i * dz * 0.5*/); + 0.0; + new_h_i = new_h_i - dtherm; + // new_h_i = hp[posj] + dh; + // new_h_i = /*old_h_i.max*/(/*wh_j*//*ht[posi] as Compute*//*h_j*/hp[posj]/*ht[posj] as Compute*/ + dh).max(new_h_i - l_tot * (mag_slope - max_slope)); + if compute_stats/* && new_h_i > wh_j*/ { + ntherm += 1; + prodscrit_therm += max_slope.ln(); + prods_therm += mag_slope.ln(); + } + } + } */ + lake_sill[posi] = posi as isize; + lake_water_volume[posi] = 0.0; + // If we dipped below the receiver's water level, set our height to the receiver's // water level. - if new_h_i <= wh_j { - new_h_i = wh_j; - } else { + if new_h_i <= wh_j/*elev_j*//*h[posj]*/ { + if compute_stats { + ncorr += 1; + } + /* lake_sill[posi] = posi as isize; + lake_water_volume[posi] = 0.0; */ + // h_[posi] = wh_j* (1.0 - uchaos):; + // new_h_i = elev_j/* + ::epsilon()*/; + // NOTE: Why wh_j? + // Because in the next round, if the old height is still wh_j or under, it + // will be set precisely equal to the estimated height, meaning it + // effectively "vanishes" and just deposits sediment to its reciever. + // (This is probably related to criteria for block Gauss-Seidel, etc.). + new_h_i = /*h[posj];*/wh_j;// - df_part.max(0.0); + // df_part = 0.0; + /* let lposj = lake_sill[posj]; + lake_sill[posi] = lposj; + // TODO: Delete? + lake_water_volume[posi] = 0.0; + if lposj >= 0 { + let lposj = lposj as usize; + lake_water_volume[lposj] += wh_j - new_h_i; + } */ + }/* else if new_h_i <= wh_j { + // new_h_i = wh_j; + /* // new_h_i = elev_j;/* + ::epsilon();*/ + let lposj = lake_sill[posj]; + lake_sill[posi] = lposj; + // TODO: Delete? + lake_water_volume[posi] = 0.0; + if lposj >= 0 { + let lposj = lposj as usize; + lake_water_volume[lposj] += wh_j - new_h_i; + // println!("lake_sill[{:?}] = {:?}", posi, lposj); + } */ + } *//*else if new_h_i - df_part.max(0.0) <= wh_j { + if compute_stats { + ncorr += 1; + } + // df_part = 0.0; + // df_part = (new_h_i - wh_j).max(0.0); + // df_part = (new_h_i - wh_j).max(0.0); + h_[posi] = new_h_i; + df_part = new_h_i - wh_j; + new_h_i = wh_j;// - df_part.max(0.0); + // new_h_i = wh_j; + } */else { + /* lake_sill[posi] = posi as isize; + lake_water_volume[posi] = 0.0; */ + // h_[posi] = new_h_i; + // new_h_i -= df_part.max(0.0); + if compute_stats && new_h_i > 0.0 { let dxy = (uniform_idx_as_vec2(posi) - uniform_idx_as_vec2(posj)).map(|e| e as f64); let neighbor_distance = (neighbor_coef * dxy).magnitude(); - let dz = (new_h_i - /*h_j*//*h_k*/wh_j).max(0.0) / height_scale/* * CONFIG.mountain_scale as f64*/; + let dz = (new_h_i - /*h_j*//*h_k*/wh_j).max(0.0)/* / height_scale*//* * CONFIG.mountain_scale as f64*/; let mag_slope = dz/*.abs()*/ / neighbor_distance; nland += 1; sumsed_land += sed; + // suma_land += df_part; sumh += new_h_i; sums += mag_slope; } } } else { - new_h_i = old_h_i; + // df_part = old_df_part; + // df_part = old_a_i; + // h_[posi] = old_elev_i; + // new_h_i = old_elev_i - df_part.max(0.0); + new_h_i = old_elev_i; let lposj = lake_sill[posj]; lake_sill[posi] = lposj; if lposj >= 0 { let lposj = lposj as usize; - lake_water_volume[lposj] += wh_j - new_h_i; + lake_water_volume[lposj] += (wh_j - old_elev_i) as Compute; } } // Set max_slope to this node's water height (max of receiver's water height and // this node's height). - wh[posi] = wh_j.max(new_h_i) as Alt; + wh[posi] = wh_j.max(new_h_i/* + df_part.max(0.0)*/) as Alt; + /* if (wh[posi] - wh_j.max(h_[posi])).abs() > 1.0e-4 { + println!("deltah_sediment: {:?}, deltah_alluvium: {:?}, deltah: {:?}, hp: {:?}, ap: {:?}, h_p: {:?}, ht: {:?}, at: {:?}, h: {:?}, a: {:?}, h_: {:?}, wh_i: {:?}, wh_j: {:?}", + deltah_sediment[posi], deltah_alluvium[posi], deltah[posi], + hp[posi], ap[posi], h_p[posi], + ht[posi], at[posi], + h[posi], a[posi], h_[posi], + wh[posi], wh_j); + + debug_assert_eq!(wh[posi], wh_j.max(h_[posi])); + } */ // Prevent erosion from dropping us below our receiver, unless we were already below it. // new_h_i = h_j.min(old_h_i + uplift_i).max(new_h_i); // Find out if this is a lake bottom. @@ -1142,6 +1951,7 @@ fn erode( // Just use the computed rate. } */ h[posi] = new_h_i as Alt; + // a[posi] = df_part as Alt; // Make sure to update the basement as well! // b[posi] = (old_b_i + uplift_i).min(new_h_i) as f32; } @@ -1149,6 +1959,7 @@ fn erode( // *is_done.at(posi) = done_val; if compute_stats { sumsed += sed; + // suma += a[posi]; let h_i = h[posi]; if h_i > 0.0 { minh = h_i.min(minh); @@ -1156,16 +1967,34 @@ fn erode( maxh = h_i.max(maxh); } + /* if (h_[posi] - (h[posi] + a[posi].max(0.0))).abs() > 1.0e-6 { + println!("posi: {:?}, dh: {:?}, deltah_sediment: {:?}, deltah_alluvium: {:?}, deltah: {:?}, hp: {:?}, ap: {:?}, h_p: {:?}, ht: {:?}, at: {:?}, h: {:?}, a: {:?}, h_: {:?}", + posi, dh[posi], + deltah_sediment[posi], deltah_alluvium[posi], deltah[posi], + hp[posi], ap[posi], h_p[posi], + ht[posi], at[posi], + h[posi], a[posi], h_[posi], + ); + debug_assert_eq!(h[posi] + a[posi].max(0.0), h_[posi]); + } */ // Add sum of squares of errors. - sum_err += (h[posi] as Compute - hp[posi]).powi(2); + sum_err += (h[posi]/*.max(wh[posi])*/ as Compute/* + a[posi].max(0.0) as Compute*/ - /*hp*/h_p[posi] as Compute/* - ap[posi].max(0.0) as Compute*/).powi(2); } + log::debug!( + "(Done erosion computation, time={:?}ms)", + start_time.elapsed().as_millis() + ); - err = (sum_err / newh.len() as Compute).sqrt(); - if max_g == 0.0 { + err = (sum_err / /*newh*/mstack.len() as Compute).sqrt(); + /* if max_g == 0.0 { err = 0.0; - } - if n_gs_stream_power_law == 99 { - log::warn!("Beware: Gauss-Siedel scheme not convergent"); + } */ + if n_gs_stream_power_law == max_n_gs_stream_power_law { + log::warn!( + "Beware: Gauss-Siedel scheme not convergent: err={:?}, expected={:?}", + err, + tol + ); } } @@ -1216,48 +2045,55 @@ fn erode( b[posi] = new_b_i; } */ - b.par_iter_mut().zip(h.par_iter()).enumerate().for_each(|(posi, (mut b, &h_i))| { - let old_b_i = *b; - let uplift_i = uplift(posi) as Alt; + // TODO: Consider taking advantage of multi-receiver flow here. + b.par_iter_mut() + .zip(h.par_iter()) + .enumerate() + .for_each(|(posi, (mut b, &h_i))| { + let old_b_i = *b; + let uplift_i = uplift(posi) as Alt; - // First, add uplift... - /* let mut new_b_i = (old_b_i + uplift_i).min(h_i); */ - let mut new_b_i = old_b_i + uplift_i; + // First, add uplift... + /* let mut new_b_i = (old_b_i + uplift_i).min(h_i); */ + let mut new_b_i = old_b_i + uplift_i; - let posj = dh[posi]; - // Sediment height normal to bedrock. NOTE: Currently we can actually have sedment and - // bedrock slope at different heights, meaning there's no uniform slope. There are - // probably more correct ways to account for this, such as averaging, integrating, or doing - // things by mass / volume instead of height, but for now we use the time-honored - // technique of ignoring the problem. - let vertical_sed = (h_i - new_b_i).max(0.0) as f64; - let h_normal = if posj < 0 { - // Egress with no outgoing flows; for now, we assume this means normal and vertical - // coincide. - vertical_sed - } else { - let posj = posj as usize; - let h_j = h[posj]; - let dxy = (uniform_idx_as_vec2(posi) - uniform_idx_as_vec2(posj)).map(|e| e as f64); - let neighbor_distance_squared = (neighbor_coef * dxy).magnitude_squared(); - let dh = (h_i - h_j) as f64; - // H_i_fact = (h_i - h_j) / (||p_i - p_j||^2 + (h_i - h_j)^2) - let h_i_fact = dh / (neighbor_distance_squared + dh * dh); - let h_i_vertical = 1.0 - h_i_fact * dh; - // ||H_i|| = (h_i - b_i) * √((H_i_fact^2 * ||p_i - p_j||^2 + (1 - H_i_fact * (h_i - h_j))^2)) - vertical_sed * (h_i_fact * h_i_fact * neighbor_distance_squared + h_i_vertical * h_i_vertical).sqrt() - }; - // Rate of sediment production: -∂z_b / ∂t = ε₀ * e^(-αH) - let p_i = epsilon_0_tot * f64::exp(-alpha * h_normal); - // println!("h_normal = {:?}, p_i = {:?}", h_normal, p_i); + let posj = dh[posi]; + // Sediment height normal to bedrock. NOTE: Currently we can actually have sedment and + // bedrock slope at different heights, meaning there's no uniform slope. There are + // probably more correct ways to account for this, such as averaging, integrating, or doing + // things by mass / volume instead of height, but for now we use the time-honored + // technique of ignoring the problem. + let vertical_sed = (h_i - new_b_i).max(0.0) as f64; + let h_normal = if posj < 0 { + // Egress with no outgoing flows; for now, we assume this means normal and vertical + // coincide. + vertical_sed + } else { + let posj = posj as usize; + let h_j = h[posj]; + let dxy = (uniform_idx_as_vec2(posi) - uniform_idx_as_vec2(posj)).map(|e| e as f64); + let neighbor_distance_squared = (neighbor_coef * dxy).magnitude_squared(); + let dh = (h_i - h_j) as f64; + // H_i_fact = (h_i - h_j) / (||p_i - p_j||^2 + (h_i - h_j)^2) + let h_i_fact = dh / (neighbor_distance_squared + dh * dh); + let h_i_vertical = 1.0 - h_i_fact * dh; + // ||H_i|| = (h_i - b_i) * √((H_i_fact^2 * ||p_i - p_j||^2 + (1 - H_i_fact * (h_i - h_j))^2)) + vertical_sed + * (h_i_fact * h_i_fact * neighbor_distance_squared + + h_i_vertical * h_i_vertical) + .sqrt() + }; + // Rate of sediment production: -∂z_b / ∂t = ε₀ * e^(-αH) + let p_i = epsilon_0(posi) as f64 * dt * f64::exp(-alpha(posi) as f64 * h_normal); + // println!("h_normal = {:?}, p_i = {:?}", h_normal, p_i); - new_b_i -= p_i as Alt; + new_b_i -= p_i as Alt; - // Clamp basement so it doesn't exceed height. - new_b_i = new_b_i.min(h_i); - *b = new_b_i; - }); - log::info!("Done updating basement and applying soil production..."); + // Clamp basement so it doesn't exceed height. + new_b_i = new_b_i.min(h_i); + *b = new_b_i; + }); + log::debug!("Done updating basement and applying soil production..."); // update the height to reflect sediment flux. h.par_iter_mut().enumerate().for_each(|(posi, mut h)| { @@ -1267,10 +2103,11 @@ fn erode( if lake_water_volume[lposi] > 0.0 { // +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_sediment[lposi].min(lake_water_volume[lposi])) / - lake_water_volume[lposi] * - (wh[posi] - *h) as Compute) as Alt; + *h += (0.0.max( + /*lake_sediment[lposi]*/ lake_silt[posi].min(lake_water_volume[lposi]), + ) / lake_water_volume[lposi] + * (wh[posi]/* - a[posi].max(0.0)*/ - *h) as Compute) + as Alt; } } }); @@ -1282,32 +2119,65 @@ fn erode( // endif // enddo - log::info!( - "Done applying stream power (max height: {:?}) (avg height: {:?}) ((min height: {:?}) avg slope: {:?})\n \ + /* a.par_iter_mut().enumerate().for_each(|(posi, mut a)| { + let lposi = lake_sill[posi]; + if lposi >= 0 { + let lposi = lposi as usize; + let sed_flux = (0.0.max(lake_sediment[lposi].min(lake_water_volume[lposi]))); + + let volume = lake_water_volume[lposi] - sed_flux; + if volume > 0.0 { + // +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)) + *a += + (0.0.max(lake_alluvium[lposi].min(volume)) / + lake_water_volume[lposi] * + (wh[posi] - h[posi] - (*a).max(0.0)) as Compute) as Alt; + } + } + *a = a.max(0.0); + }); */ + + log::debug!( + "Done applying stream power (max height: {:?}) (avg height: {:?}) (min height: {:?}) (avg slope: {:?})\n \ + (above talus angle, geom. mean slope [actual/critical/ratio]: {:?} / {:?} / {:?})\n \ + (old avg alluvium thickness [all/land]: {:?} / {:?})\n \ (old avg sediment thickness [all/land]: {:?} / {:?})\n \ - (num land: {:?}) (num thermal: {:?})", + (num land: {:?}) (num thermal: {:?}) (num corrected: {:?})", maxh, avgz(sumh, nland), minh, avgz(sums, nland), + geomz(prods_therm, ntherm), + geomz(prodscrit_therm, ntherm), + geomz(prods_therm - prodscrit_therm, ntherm), + avgz(suma, newh.len()), + avgz(suma_land, nland), avgz(sumsed, newh.len()), avgz(sumsed_land, nland), nland, ntherm, + ncorr, ); // Apply thermal erosion. maxh = 0.0; - minh = f64::INFINITY as Alt; + minh = ::infinity(); sumh = 0.0; sums = 0.0; sumsed = 0.0; + suma = 0.0; sumsed_land = 0.0; + suma_land = 0.0; nland = 0usize; + ncorr = 0usize; ntherm = 0usize; + prods_therm = 0.0; + prodscrit_therm = 0.0; for &posi in &*newh { let posi = posi as usize; let old_h_i = h/*b*/[posi] as f64; + // let old_a_i = a[posi]; let old_b_i = b[posi] as f64; let sed = (old_h_i - old_b_i) as f64; @@ -1319,10 +2189,10 @@ fn erode( (1.0 / (max_slope / mid_slope/*.sqrt()*//*.powf(0.03125)*/).powf(/*2.0*/2.0))/*.min(kdsed)*/; max_slopes[posi] = if sed > sediment_thickness && kdsed > 0.0 { // Sediment - kdsed/* * kd_factor*/ + kdsed /* * kd_factor*/ } else { // Bedrock - kd(posi) / kd_factor + kd(posi) /* / kd_factor*/ }; let posj = dh[posi]; @@ -1331,8 +2201,12 @@ fn erode( panic!("Disconnected lake!"); } // wh for oceans is always at least min_erosion_height. - wh[posi] = min_erosion_height.max(ht[posi]); - // Egress with no outgoing flows. + // let uplift_i = uplift(posi) as Alt; + // wh[posi] = min_erosion_height.max(ht[posi] + uplift_i); + wh[posi] = min_erosion_height.max( + /*ht[posi] + at[posi].max(0.0)*//*h_t[posi] + uplift_i*/ old_h_i as Alt, + ); + // Egress with no outgoing flows. } else { let posj = posj as usize; // Find the water height for this chunk's receiver; we only apply thermal erosion @@ -1340,15 +2214,17 @@ fn erode( let mut wh_j = wh[posj] as f64; // If you're on the lake bottom and not right next to your neighbor, don't compute a // slope. - let mut new_h_i = old_h_i;/*old_b_i;*/ + let mut new_h_i = /*old_h_i*//*old_h_i + old_a_i.max(0.0)*/old_h_i; /*old_b_i;*/ if /* !is_lake_bottom */ /* !fake_neighbor */ - wh_j < old_h_i { + wh_j < old_h_i + /* + old_a_i.max(0.0)*/ + { // NOTE: Currently assuming that talus angle is not eroded once the substance is // totally submerged in water, and that talus angle if part of the substance is // in water is 0 (or the same as the dry part, if this is set to wh_j), but // actually that's probably not true. - let old_h_j = h[posj] as f64; + let old_h_j = (h[posj]/* + a[posj].max(0.0)*/) as f64; let h_j = /*h[posj] as f64*//*wh_j*/old_h_j; // let h_j = b[posj] as f64; /* let indirection_idx = indirection[posi]; @@ -1365,42 +2241,43 @@ fn erode( .min_by(|&(_, a), &(_, b)| a.partial_cmp(&b).unwrap()) .unwrap_or((posj, h_j)); */ (posj, h_j); - // .max(h_j); - let (posk, h_k) = if h_k < h_j { - (posk, h_k) - } else { - (posj, h_j) - }; + // .max(h_j); + let (posk, h_k) = if h_k < h_j { (posk, h_k) } else { (posj, h_j) }; let dxy = (uniform_idx_as_vec2(posi) - uniform_idx_as_vec2(posk)).map(|e| e as f64); let neighbor_distance = (neighbor_coef * dxy).magnitude(); - let dz = (new_h_i - /*h_j*/h_k).max(0.0) / height_scale/* * CONFIG.mountain_scale as f64*/; + let dz = (new_h_i - /*h_j*/h_k).max(0.0)/* / height_scale*//* * CONFIG.mountain_scale as f64*/; let mag_slope = dz/*.abs()*/ / neighbor_distance; if /* !is_lake_bottom && */ - mag_slope > max_slope { + mag_slope >= max_slope { // println!("old slope: {:?}, new slope: {:?}, dz: {:?}, h_j: {:?}, new_h_i: {:?}", mag_slope, max_slope, dz, h_j, new_h_i); // Thermal erosion says this can't happen, so we reduce dh_i to make the slope // exactly max_slope. // max_slope = (old_h_i + dh - h_j) / height_scale/* * CONFIG.mountain_scale */ / NEIGHBOR_DISTANCE // dh = max_slope * NEIGHBOR_DISTANCE * height_scale/* / CONFIG.mountain_scale */ + h_j - old_h_i. - let dh = max_slope * neighbor_distance * height_scale/* / CONFIG.mountain_scale as f64*/; + let dh = max_slope * neighbor_distance/* * height_scale*//* / CONFIG.mountain_scale as f64*/; // new_h_i = /*h_j.max*//*(h_k + dh).max*/(/*new_h_i*/ht[posi] as f64 + l_tot * (mag_slope - max_slope)); // new_h_i = /*h_j.max*//*(h_k + dh).max*/(/*new_h_i*/h_k + dh + l_tot * (mag_slope - max_slope)); // new_h_i = /*h_j.max*//*(h_k + dh).max*/(new_h_i - l_tot * (mag_slope - max_slope)); - let dtherm = (l_tot * (mag_slope - max_slope)).min((dz - dh)/* / 2.0*/); + let dtherm = 0.0/*dz - dh*//*(l_tot * (mag_slope - max_slope)).min(/*(dz/* - dh*/) / 2.0*/(1.0 + max_g) * max_uplift as f64)*/; new_h_i = /*h_j.max*//*(h_k + dh).max*/(/*new_h_i*//*h_k + dh*/new_h_i - dtherm); /* let new_h_j = (old_h_j + dtherm).min(old_h_j.max(new_h_i)); h[posj] = new_h_j as Alt; wh_j = wh_j.max(new_h_j); wh[posj] = wh_j as Alt; */ // No more hillslope processes on newly exposed bedrock. - max_slopes[posi] = 0.0; + // max_slopes[posi] = 0.0; // max_slopes[posi] = l; + // max_slopes[posi] = 0.0; if new_h_i <= wh_j { - new_h_i = wh_j; + if compute_stats { + ncorr += 1; + } + // new_h_i = wh_j; + // new_h_i = wh_j - old_a_i.max(0.0); } else { if compute_stats && new_h_i > 0.0 { - let dz = (new_h_i - /*h_j*//*h_k*/wh_j).max(0.0) / height_scale/* * CONFIG.mountain_scale as f64*/; + let dz = (new_h_i - /*h_j*//*h_k*//*wh_j*/h_j).max(0.0)/* / height_scale*//* * CONFIG.mountain_scale as f64*/; let slope = dz/*.abs()*/ / neighbor_distance; sums += slope; // max_slopes[posi] = /*(mag_slope - max_slope) * */max_slopes[posi].max(kdsed); @@ -1413,8 +2290,9 @@ fn erode( } */ // max_slopes[posi] *= kd_factor; nland += 1; - sumh += new_h_i; + sumh += new_h_i/* - old_a_i*/; sumsed_land += sed; + // suma_land += old_a_i; } // let slope = dz.signum() * max_slope; // new_h_i = slope * neighbor_distance * height_scale /* / CONFIG.mountain_scale as f64 */ + h_j; @@ -1422,12 +2300,19 @@ fn erode( } if compute_stats { ntherm += 1; + prodscrit_therm += max_slope.ln(); + prods_therm += mag_slope.ln(); } } else { // Poorly emulating nonlinear hillslope transport as described by // http://eps.berkeley.edu/~bill/papers/112.pdf. // sqrt(3)/3*32*32/(128000/2) - max_slopes[posi] = (max_slopes[posi] * 1.0 / (1.0 - (mag_slope / max_slope).powi(2))); + // Also Perron-2011-Journal_of_Geophysical_Research__Earth_Surface.pdf + let slope_ratio = (mag_slope / max_slope).powi(2); + let slope_nonlinear_factor = + slope_ratio * ((3.0 - slope_ratio) / (1.0 - slope_ratio).powi(2)); + max_slopes[posi] += (max_slopes[posi] * slope_nonlinear_factor).min(max_stable); + // max_slopes[posi] = (max_slopes[posi] * 1.0 / (1.0 - (mag_slope / max_slope).powi(2))); /*if kd_factor < 1.0 { max_slopes[posi] *= kd_factor; }*/ @@ -1439,13 +2324,14 @@ fn erode( sums += mag_slope; // Just use the computed rate. nland += 1; - sumh += new_h_i; + sumh += new_h_i/* - old_a_i*/; sumsed_land += sed; + // suma_land += old_a_i; } } - h/*b*/[posi] = /*old_h_i.min(new_h_i)*/new_h_i as Alt; + h/*b*/[posi] = /*old_h_i.min(new_h_i)*/(new_h_i/* - old_a_i.max(0.0)*/) as Alt; // Make sure to update the basement as well! - // b[posi] = old_b_i.min(new_h_i) as f32; + // b[posi] = old_b_i.min(new_h_i) as Alt; b[posi] = old_b_i.min(old_b_i + (/*old_h_i.min(*/new_h_i/*)*/ - old_h_i)) as Alt; // sumh += new_h_i; } @@ -1453,11 +2339,12 @@ fn erode( // this node's height). wh[posi] = wh_j.max(new_h_i) as Alt; } - max_slopes[posi] = max_slopes[posi].min(max_stable); + // max_slopes[posi] = max_slopes[posi].min(max_stable); // *is_done.at(posi) = done_val; if compute_stats { sumsed += sed; + // suma += old_a_i; let h_i = h[posi]; if h_i > 0.0 { minh = h_i.min(minh); @@ -1467,27 +2354,38 @@ fn erode( } log::debug!( "Done applying thermal erosion (max height: {:?}) (avg height: {:?}) (min height: {:?}) (avg slope: {:?})\n \ + (above talus angle, geom. mean slope [actual/critical/ratio]: {:?} / {:?} / {:?})\n \ + (avg alluvium thickness [all/land]: {:?} / {:?})\n \ (avg sediment thickness [all/land]: {:?} / {:?})\n \ - (num land: {:?}) (num thermal: {:?})", + (num land: {:?}) (num thermal: {:?}) (num corrected: {:?})", maxh, avgz(sumh, nland), minh, avgz(sums, nland), + geomz(prods_therm, ntherm), + geomz(prodscrit_therm, ntherm), + geomz(prods_therm - prodscrit_therm, ntherm), + avgz(suma, newh.len()), + avgz(suma_land, nland), avgz(sumsed, newh.len()), avgz(sumsed_land, nland), nland, ntherm, + ncorr, ); // Apply hillslope diffusion. - diffusion(WORLD_SIZE.x, WORLD_SIZE.y, - WORLD_SIZE.x as f64 * TerrainChunkSize::RECT_SIZE.x as f64 * height_scale/* / CONFIG.mountain_scale as f64*/, - WORLD_SIZE.y as f64 * TerrainChunkSize::RECT_SIZE.y as f64 * height_scale/* / CONFIG.mountain_scale as f64*/, - dt, - (), - h, b, - |posi| max_slopes[posi]/*kd*/, - /* kdsed */-1.0, + diffusion( + nx, + ny, + nx as f64 * dx, + ny as f64 * dy, + dt, + (), + h, + b, + |posi| max_slopes[posi], /*kd*/ + /* kdsed */ -1.0, ); log::debug!("Done applying diffusion."); log::debug!("Done eroding."); @@ -1498,18 +2396,29 @@ fn erode( /// http://horizon.documentation.ird.fr/exl-doc/pleins_textes/pleins_textes_7/sous_copyright/010031925.pdf /// /// See https://github.com/mewo2/terrain/blob/master/terrain.js -pub fn fill_sinks( - h: impl Fn(usize) -> f32 + Sync, +pub fn fill_sinks( + h: impl Fn(usize) -> F + Sync, is_ocean: impl Fn(usize) -> bool + Sync, -) -> Box<[f32]> { +) -> Box<[F]> { // NOTE: We are using the "exact" version of depression-filling, which is slower but doesn't // change altitudes. - let epsilon = /*1.0 / (1 << 7) as f32 * height_scale/* / CONFIG.mountain_scale */*/0.0; - let infinity = f32::INFINITY; + let epsilon = /*1.0 / (1 << 7) as f32 * height_scale/* / CONFIG.mountain_scale */*//*0.0*/F::zero(); + let infinity = F::infinity(); //f32::INFINITY; let range = 0..WORLD_SIZE.x * WORLD_SIZE.y; let oldh = range .into_par_iter() - .map(|posi| h(posi)) + .map(|posi| { + /* let h = h(posi); + let is_near_edge = is_ocean(posi); + if is_near_edge { + // debug_assert!(h <= 0.0); + // h + h.min(0.0) + } else { + h + } */ + h(posi) + }) .collect::>() .into_boxed_slice(); let mut newh = oldh @@ -1518,7 +2427,7 @@ pub fn fill_sinks( .map(|(posi, &h)| { let is_near_edge = is_ocean(posi); if is_near_edge { - debug_assert!(h <= 0.0); + debug_assert!(h <= F::zero()); h } else { infinity @@ -1569,8 +2478,6 @@ pub fn fill_sinks( } } -/// Computes which tiles are ocean tiles by - /// Algorithm for finding and connecting lakes. Assumes newh and downhill have already /// been computed. When a lake's value is negative, it is its own lake root, and when it is 0, it /// is on the boundary of Ω. @@ -1580,7 +2487,10 @@ pub fn fill_sinks( /// - A list of chunks on the boundary (non-lake egress points). /// - The second indirection vector (associating chunk indices with their lake's adjacency list). /// - The adjacency list (stored in a single vector), indexed by the second indirection vector. -pub fn get_lakes(h: impl Fn(usize) -> F, downhill: &mut [isize]) -> (usize, Box<[i32]>, Box<[u32]>, F) { +pub fn get_lakes( + h: impl Fn(usize) -> F, + downhill: &mut [isize], +) -> (usize, Box<[i32]>, Box<[u32]>, F) { // Associates each lake index with its root node (the deepest one in the lake), and a list of // adjacent lakes. The list of adjacent lakes includes the lake index of the adjacent lake, // and a node index in the adjacent lake which has a neighbor in this lake. The particular @@ -1882,6 +2792,16 @@ pub fn get_lakes(h: impl Fn(usize) -> F, downhill: &mut [isize]) -> (u log::debug!("Total lakes: {:?}", pass_flows_sorted.len()); // Perform the bfs once again. + #[derive(Clone, Copy, PartialEq)] + enum Tag { + UnParsed, + InQueue, + WithRcv, + } + let mut tag = vec![Tag::UnParsed; WORLD_SIZE.x * WORLD_SIZE.y]; + // TODO: Combine with adding to vector. + let mut filling_queue = Vec::with_capacity(downhill.len()); + let mut newh = Vec::with_capacity(downhill.len()); (&*boundary) .iter() @@ -1890,11 +2810,13 @@ pub fn get_lakes(h: impl Fn(usize) -> F, downhill: &mut [isize]) -> (u // Find all the nodes uphill from this lake. Since there is only one outgoing edge // in the "downhill" graph, this is guaranteed never to visit a node more than // once. - let start = newh.len(); + let mut start = newh.len(); // First, find the neighbor pass (assuming this is not the ocean). let neighbor_pass_idx = downhill[chunk_idx]; let first_idx = if neighbor_pass_idx < 0 { // This is the ocean. + newh.push(chunk_idx as u32); + start += 1; chunk_idx } else { // This is a "real" lake. @@ -1906,11 +2828,9 @@ pub fn get_lakes(h: impl Fn(usize) -> F, downhill: &mut [isize]) -> (u let pass_idx = pass_idx as usize; // Now, we should recompute flow paths so downhill nodes are contiguous. - // Carving strategy: reverse the path from the lake side of the pass to the + /* // Carving strategy: reverse the path from the lake side of the pass to the // lake bottom, and also set the lake side of the pass's downhill to its // neighbor pass. - // - // TODO: Implement filling strategy (not just carving strategy). let mut to_idx = neighbor_pass_idx; let mut from_idx = pass_idx; // NOTE: Since our side of the lake pass must be in the same basin as chunk_idx, @@ -1933,17 +2853,87 @@ pub fn get_lakes(h: impl Fn(usize) -> F, downhill: &mut [isize]) -> (u ) as usize; } // Remember to set the actual lake's from_idx properly! - downhill[from_idx] = to_idx as isize; + downhill[from_idx] = to_idx as isize; */ + + // TODO: Enqueue onto newh simultaneously with filling (this could help prevent + // needing a special tag just for checking if we are already enqueued). + // Filling strategy: nodes are assigned paths based on cost. + { + assert!(tag[pass_idx] == Tag::UnParsed); + + filling_queue.push(pass_idx); + tag[neighbor_pass_idx] = Tag::WithRcv; + tag[pass_idx] = Tag::InQueue; + + let outflow_coords = uniform_idx_as_vec2(neighbor_pass_idx); + let elev = h(neighbor_pass_idx).max(h(pass_idx));; + + while let Some(node) = filling_queue.pop() { + let coords = uniform_idx_as_vec2(node); + + let mut rcv = -1; + let mut rcv_cost = -f64::INFINITY;/*f64::EPSILON;*/ + let outflow_distance = (outflow_coords - coords).map(|e| e as f64); + + for ineighbor in neighbors(node) { + if indirection[ineighbor] != chunk_idx as i32 && + ineighbor != chunk_idx && ineighbor != neighbor_pass_idx || h(ineighbor) > elev { + continue; + } + let dxy = (uniform_idx_as_vec2(ineighbor) - coords).map(|e| e as f64); + let neighbor_distance = (/*neighbor_coef * */dxy); + let mut tag = &mut tag[ineighbor]; + match *tag { + Tag::WithRcv => { + // TODO: Remove outdated comment. + // + // // Proportional to + // // (vec_to_neighbor ⋅ vec_to_outflow) / |vec_to_neighbor| + // // + // // (proportional because the numerator of our actual + // // calculation is in chunk units, while the bottom is in + // // meters; this is effectively just multiplying the real costs in meters + // // by a constant [the chunk to meter ratio]). + // + // vec_to_outflow ⋅ (vec_to_neighbor / |vec_to_neighbor|) = ||vec_to_outflow||cos Θ + // where θ is the angle between vec_to_outflow and vec_to_neighbor. + // + // Which is also the scalar component of vec_to_outflow in the + // direction of vec_to_neighbor. + let cost = (outflow_distance.dot(neighbor_distance / neighbor_distance.magnitude()))/*.abs()*/; + if cost > rcv_cost { + rcv = ineighbor as isize; + rcv_cost = cost; + } + }, + Tag::UnParsed => { + filling_queue.push(ineighbor); + *tag = Tag::InQueue; + }, + _ => {} + } + } + assert!(rcv != -1); + downhill[node] = rcv; + // dist2receivers(node) = d8_distances[detail::get_d8_distance_id(node, rcv, static_cast(ncols))]; + tag[node] = Tag::WithRcv; + } + } + // Use our side of the pass as the initial node in the stack order. // TODO: Verify that this stack order will not "double reach" any lake chunks. - pass_idx + // pass_idx + neighbor_pass_idx }; // newh.push(chunk_idx as u32); // New lake root - newh.push(first_idx as u32); + /* newh.push(first_idx as u32); */ let mut cur = start; - while cur < newh.len() { - let node = newh[cur as usize]; + let mut node = first_idx; + // while cur < newh.len() + loop { + // let node = newh[cur as usize]; + // cur += 1; for child in uphill(downhill, node as usize) { // lake_idx is the index of our lake root. @@ -1957,6 +2947,11 @@ pub fn get_lakes(h: impl Fn(usize) -> F, downhill: &mut [isize]) -> (u newh.push(child as u32); } } + + if cur == newh.len() { + break; + } + node = newh[cur] as usize; cur += 1; } }); @@ -1964,6 +2959,274 @@ pub fn get_lakes(h: impl Fn(usize) -> F, downhill: &mut [isize]) -> (u (boundary.len(), indirection, newh.into_boxed_slice(), maxh) } +/// Iterate through set neighbors of multi-receiver flow. +pub fn mrec_downhill<'a>( + mrec: &'a [u8], + posi: usize, +) -> impl Clone + Iterator + 'a { + let pos = uniform_idx_as_vec2(posi); + let mrec_i = mrec[posi]; + NEIGHBOR_DELTA + .iter() + .enumerate() + .filter(move |&(k, _)| (mrec_i >> k as isize) & 1 == 1) + .map(move |(k, &(x, y))| { + ( + k, + vec2_as_uniform_idx(Vec2::new(pos.x + x as i32, pos.y + y as i32)), + ) + }) +} + +/// Algorithm for computing multi-receiver flow. +/// +/// * `h`: altitude +/// * `downhill`: single receiver +/// * `newh`: single receiver stack +/// * `wh`: buffer into which water height will be inserted. +/// * `nx`, `ny`: resolution in x and y directions. +/// * `dx`, `dy`: grid spacing in x- and y-directions +/// * `maxh`: maximum |height| among all nodes. +/// +/// +/// Updates the water height to a nearly planar surface, and returns a 3-tuple containing: +/// * A bitmask representing which neighbors are downhill. +/// * Stack order for multiple receivers (from top to bottom). +/// * The weight for each receiver, for each node. +pub fn get_multi_rec>( + h: impl Fn(usize) -> F + Sync, + downhill: &[isize], + newh: &[u32], + wh: &mut [F], + nx: usize, + ny: usize, + dx: Compute, + dy: Compute, + _maxh: F, +) -> (Box<[u8]>, Box<[u32]>, Box<[Computex8]>) +/*where + Compute: Into,*/ +{ + let nn = nx * ny; + let dxdy = Vec2::new(dx, dy); + + // set bc + let i1 = 0; + let i2 = nx; + let j1 = 0; + let j2 = ny; + /* let xcyclic = false; + let ycyclic = false; */ + /* + write (cbc,'(i4)') ibc + i1=1 + i2=nx + j1=1 + j2=ny + if (cbc(4:4).eq.'1') i1=2 + if (cbc(2:2).eq.'1') i2=nx-1 + if (cbc(1:1).eq.'1') j1=2 + if (cbc(3:3).eq.'1') j2=ny-1 + xcyclic=.FALSE. + ycyclic=.FALSE. + if (cbc(4:4).ne.'1'.and.cbc(2:2).ne.'1') xcyclic=.TRUE. + if (cbc(1:1).ne.'1'.and.cbc(3:3).ne.'1') ycyclic=.TRUE. + */ + assert_eq!(nn, wh.len()); + + /* // TODO: Remove this. + for w in &mut *wh { + *w = F::nan(); + } */ + + // fill the local minima with a nearly planar surface + // See https://matthew-brett.github.io/teaching/floating_error.html; + // our absolute error is bounded by β^(e-(p-1)), where e is the exponent of the largest value we + // care about. In this case, since we are summing up to nn numbers, we are bounded from above + // by nn * |maxh|; however, we only need to invoke this when we actually encounter a number, so + // we compute it dynamically. + // for nn + |maxh| + // TODO: Consider that it's probably not possible to have a downhill path the size of the whole grid... + // either measure explicitly (maybe in get_lakes) or work out a more precise upper bound (since + // using nn * 2 * (maxh + epsilon) makes f32 not work very well). + let deltah = F::epsilon() + F::epsilon(); + // let deltah = F::epsilon() * 2 * maxh; + // NumCast::from(nn); /* 1.0e-8 */ + // let deltah : F = (1.0e-7 as Compute).into(); + for &ijk in newh { + let ijk = ijk as usize; + let h_i = h(ijk); + let ijr = downhill[ijk]; + wh[ijk] = if ijr >= 0 { + let ijr = ijr as usize; + let wh_j = wh[ijr]; + // debug_assert!(wh_j.is_normal() || wh_j == F::zero()); + if wh_j /*>*/>= h_i { + /* if wh_j == h_i { + log::debug!("Interesting... ijk={:?}, ijr={:?}, wh_j{:?} h_i={:?}", uniform_idx_as_vec2(ijk), uniform_idx_as_vec2(ijr), wh_j, h_i); + } */ + let deltah = deltah * wh_j.abs(); + wh_j + deltah + } else { + h_i + } + // wh[ijk] = h_i.max(wh_j + deltah); + } else { + h_i + }; + } + + let mut wrec = Vec::::with_capacity(nn); + let mut mrec = Vec::with_capacity(nn); + let mut don_vis = Vec::with_capacity(nn); + + // loop on all nodes + (0..nn) + .into_par_iter() + .map(|ij| { + // TODO: SIMDify? Seems extremely amenable to that. + // let h_ij = h(ij); + let wh_ij = wh[ij]; + let mut mrec_ij = 0u8; + let mut ndon_ij = 0u8; + let neighbor_iter = |posi| { + let pos = uniform_idx_as_vec2(posi); + NEIGHBOR_DELTA + .iter() + .map(move |&(x, y)| Vec2::new(pos.x + x, pos.y + y)) + .enumerate() + .filter(move |&(_, pos)| { + pos.x >= 0 + && pos.y >= 0 + && pos.x < WORLD_SIZE.x as i32 + && pos.y < WORLD_SIZE.y as i32 + }) + .map(move |(k, pos)| (k, vec2_as_uniform_idx(pos))) + }; + + for (k, ijk) in neighbor_iter(ij) { + let wh_ijk = wh[ijk]; + // let h_ijk = h(ijk); + if + /*h_ij*/ + wh_ij > wh_ijk { + // Set neighboring edge lower than this one as being downhill. + // NOTE: relying on at most 8 neighbors. + mrec_ij |= (1 << k); + } else if + /*h_ijk*/ + wh_ijk > wh_ij { + // Avoiding ambiguous cases. + ndon_ij += 1; + } + } + // let vis_ij = mrec_ij.count_ones(); + (mrec_ij, (ndon_ij, ndon_ij)) + }) + .unzip_into_vecs(&mut mrec, &mut don_vis); + + let czero = ::zero(); + let (wrec, stack) = rayon::join( + || { + (0..nn) + .into_par_iter() + .map(|ij| { + let mut sumweight = czero; + let mut wrec = /*Computex8::splat(czero)*/[czero; 8]; + let mut nrec = 0; + // let mut wrec: [Compute; 8] = [czero, czero, czero, czero, czero, czero, czero, czero]; + for (k, ijk) in mrec_downhill(&mrec, ij) { + let lrec_ijk = ((uniform_idx_as_vec2(ijk) - uniform_idx_as_vec2(ij)) + .map(|e| e as Compute) + * dxdy) + .magnitude(); + let wrec_ijk = (wh[ij] - wh[ijk]).into() / lrec_ijk; + // let wrec_ijk = if ijk as isize == downhill[ij] { ::one() } else { ::zero() }; + wrec[k] = wrec_ijk; + // wrec = wrec.replace(k, wrec_ijk); + sumweight += wrec_ijk; + nrec += 1; + } + // let (_, ndon_ij) = ndon[ij]; + let slope = sumweight / (nrec as Compute).max(1.0); + let p_mfd_exp = 0.5 + 0.6 * slope; + // let p_mfd_exp = 10.0; + /* let ijr = downhill[ij]; + if ijr < 0 { + if sumweight != ::zero() { + log::error!("Huh? ij={:?} [h={:?}, wh={:?}], downhill={:?}, sum={:?}, mrec={:?}, mwrec={:?}", + uniform_idx_as_vec2(ij), h(ij), wh[ij], + ijr, + sumweight, mrec[ij], wrec); + } + debug_assert_eq!(sumweight, ::zero()); + } else { + if sumweight != ::one() { + let ijr = ijr as usize; + log::error!("Huh? ij={:?} [h={:?}, wh={:?}], downhill={:?} [h={:?}, wh={:?}], sum={:?}, mrec={:?}, mwrec={:?}", + uniform_idx_as_vec2(ij), h(ij), wh[ij], + uniform_idx_as_vec2(ijr), h(ijr), wh[ijr], + sumweight, mrec[ij], wrec); + } + debug_assert_eq!(sumweight, ::one()); + } */ + sumweight = czero; + for wrec_k in &mut wrec { + let wrec_ijk = wrec_k.powf(p_mfd_exp); + sumweight += wrec_ijk; + *wrec_k = wrec_ijk; + } + if sumweight > czero { + // wrec /= sumweight; + for wrec_k in &mut wrec { + *wrec_k /= sumweight; + } + } + wrec + }) + .collect_into_vec(&mut wrec); + wrec + }, + || { + let mut stack = Vec::with_capacity(nn); + let mut parse = Vec::with_capacity(nn); + + // we go through the nodes + for ij in 0..nn { + let (ndon_ij, _) = don_vis[ij]; + // when we find a "summit" (ie a node that has no donors) + // we parse it (put it in a stack called parse) + if ndon_ij == 0 { + parse.push(ij); + } + // we go through the parsing stack + while let Some(ijn) = parse.pop() { + // we add the node to the stack + stack.push(ijn as u32); + for (_, ijr) in mrec_downhill(&mrec, ijn) { + let (_, ref mut vis_ijr) = don_vis[ijr]; + if *vis_ijr >= 1 { + *vis_ijr -= 1; + if *vis_ijr == 0 { + parse.push(ijr); + } + } + } + } + } + + assert_eq!(stack.len(), nn); + stack + }, + ); + + ( + mrec.into_boxed_slice(), + stack.into_boxed_slice(), + wrec.into_boxed_slice(), + ) +} + /// Perform erosion n times. pub fn do_erosion( erosion_base: f32, @@ -1973,15 +3236,18 @@ pub fn do_erosion( rock_strength_nz: &(impl NoiseFn> + Sync), oldh: impl Fn(usize) -> f32 + Sync, oldb: impl Fn(usize) -> f32 + Sync, + // olda: impl Fn(usize) -> f32 + Sync, is_ocean: impl Fn(usize) -> bool + Sync, - uplift: impl Fn(usize) -> f32 + Sync, + uplift: impl Fn(usize) -> f64 + Sync, n: impl Fn(usize) -> f32 + Sync, theta: impl Fn(usize) -> f32 + Sync, kf: impl Fn(usize) -> f64 + Sync, kd: impl Fn(usize) -> f64 + Sync, g: impl Fn(usize) -> f32 + Sync, -) -> (Box<[Alt]>, Box<[Alt]>) { - log::info!("Initializing erosion arrays..."); + epsilon_0: impl Fn(usize) -> f32 + Sync, + alpha: impl Fn(usize) -> f32 + Sync, +) -> (Box<[Alt]>, Box<[Alt]> /*, Box<[Alt]>*/) { + log::debug!("Initializing erosion arrays..."); let oldh_ = (0..WORLD_SIZE.x * WORLD_SIZE.y) .into_par_iter() .map(|posi| oldh(posi) as Alt) @@ -1993,6 +3259,12 @@ pub fn do_erosion( .map(|posi| oldb(posi) as Alt) .collect::>() .into_boxed_slice(); + /* // Alluvium (the total depth of alluvium above the topsoil). + let mut a = (0..WORLD_SIZE.x * WORLD_SIZE.y) + .into_par_iter() + .map(|posi| olda(posi) as Alt) + .collect::>() + .into_boxed_slice(); */ // Stream power law slope exponent--link between channel slope and erosion rate. let n = (0..WORLD_SIZE.x * WORLD_SIZE.y) .into_par_iter() @@ -2024,12 +3296,22 @@ pub fn do_erosion( .map(|posi| g(posi)) .collect::>() .into_boxed_slice(); + let epsilon_0 = (0..WORLD_SIZE.x * WORLD_SIZE.y) + .into_par_iter() + .map(|posi| epsilon_0(posi)) + .collect::>() + .into_boxed_slice(); + let alpha = (0..WORLD_SIZE.x * WORLD_SIZE.y) + .into_par_iter() + .map(|posi| alpha(posi)) + .collect::>() + .into_boxed_slice(); let mut wh = vec![0.0; WORLD_SIZE.x * WORLD_SIZE.y].into_boxed_slice(); // TODO: Don't do this, maybe? // (To elaborate, maybe we should have varying uplift or compute it some other way). let uplift = (0..oldh_.len()) .into_par_iter() - .map(|posi| uplift(posi)) + .map(|posi| uplift(posi) as f32) .collect::>() .into_boxed_slice(); let sum_uplift = uplift @@ -2066,7 +3348,7 @@ pub fn do_erosion( /*1e-2*//*0.25e-2*/1e-2 / 1.0 * height_scale * height_scale/* / (CONFIG.mountain_scale as f64 * CONFIG.mountain_scale as f64) */ /* * k_fb / 2e-5 */; let kdsed = - /*1.5e-2*//*1e-4*//*1.25e-2*/1.5e-2 / 1.0 * height_scale * height_scale/* / (CONFIG.mountain_scale as f64 * CONFIG.mountain_scale as f64) */ + /*1.5e-2*//*1e-4*//*1.25e-2*//*1.5e-2 */1.5e-2/ 1.0 * height_scale * height_scale/* / (CONFIG.mountain_scale as f64 * CONFIG.mountain_scale as f64) */ /* * k_fb / 2e-5 */; // let kd = |posi: usize| kd_bedrock; // if is_ocean(posi) { /*0.0*/kd_bedrock } else { kd_bedrock }; let n = |posi: usize| n[posi]; @@ -2074,6 +3356,8 @@ pub fn do_erosion( let kd = |posi: usize| kd[posi]; // if is_ocean(posi) { /*0.0*/kd_bedrock } else { kd_bedrock }; let kf = |posi: usize| kf[posi]; let g = |posi: usize| g[posi]; + let epsilon_0 = |posi: usize| epsilon_0[posi]; + let alpha = |posi: usize| alpha[posi]; // Hillslope diffusion coefficient for sediment. let mut is_done = bitbox![0; WORLD_SIZE.x * WORLD_SIZE.y]; for i in 0..n_steps { @@ -2081,6 +3365,7 @@ pub fn do_erosion( erode( &mut h, &mut b, + // &mut a, &mut wh, &mut is_done, // The value to use to indicate that erosion is complete on a chunk. Should toggle @@ -2090,8 +3375,8 @@ pub fn do_erosion( erosion_base, max_uplift, max_g, - -1.0, - // kdsed, + // -1.0, + kdsed, seed, rock_strength_nz, |posi| uplift[posi], @@ -2100,8 +3385,10 @@ pub fn do_erosion( kf, kd, g, + epsilon_0, + alpha, |posi| is_ocean(posi), ); } - (h, b) + (h, b /*, a*/) } diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index b8fb96acff..0dd16be61b 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -6,8 +6,10 @@ mod util; // Reexports pub use self::diffusion::diffusion; +use self::erosion::Compute; pub use self::erosion::{ - Alt, do_erosion, fill_sinks, get_drainage, get_lakes, get_rivers, RiverData, RiverKind, + do_erosion, fill_sinks, get_drainage, get_lakes, get_multi_drainage, get_multi_rec, get_rivers, + mrec_downhill, Alt, RiverData, RiverKind, }; pub use self::location::Location; pub use self::settlement::Settlement; @@ -69,8 +71,8 @@ struct GenCdf { dh: Box<[isize]>, /// NOTE: Until we hit 4096 × 4096, this should suffice since integers with an absolute value /// under 2^24 can be exactly represented in an f32. - flux: Box<[f32]>, - pure_flux: InverseCdf, + flux: Box<[Compute]>, + pure_flux: InverseCdf, alt_no_water: InverseCdf, rivers: Box<[RiverData]>, } @@ -904,6 +906,130 @@ impl WorldSim { 1.0 // 1.5 }; + let epsilon_0_func = |posi| { + if is_ocean_fn(posi) { + // marine: ε₀ = 2.078e-3 + return 2.078e-3; + // return 5.0; + } + let wposf = (uniform_idx_as_vec2(posi) * TerrainChunkSize::RECT_SIZE.map(|e| e as i32)) + .map(|e| e as f64); + let turb_wposf = wposf + .div(TerrainChunkSize::RECT_SIZE.map(|e| e as f64)) + .div(turb_wposf_div); + let turb = Vec2::new( + gen_ctx.turb_x_nz.get(turb_wposf.into_array()), + gen_ctx.turb_y_nz.get(turb_wposf.into_array()), + ) * uplift_turb_scale + * TerrainChunkSize::RECT_SIZE.map(|e| e as f64); + // let turb = Vec2::zero(); + let turb_wposf = wposf + turb; + let turb_wposi = turb_wposf + .map2(TerrainChunkSize::RECT_SIZE, |e, f| e / f as f64) + .map2(WORLD_SIZE, |e, f| (e as i32).max(f as i32 - 1).min(0)); + let turb_posi = vec2_as_uniform_idx(turb_wposi); + let uheight = gen_ctx + .uplift_nz + .get(turb_wposf.into_array()) + /* .min(0.5) + .max(-0.5)*/ + .min(1.0) + .max(-1.0) + .mul(0.5) + .add(0.5); + let wposf3 = Vec3::new( + wposf.x, + wposf.y, + uheight * CONFIG.mountain_scale as f64 * rock_strength_div_factor, + ); + let rock_strength = gen_ctx + .rock_strength_nz + .get(wposf3.into_array()) + /* .min(0.5) + .max(-0.5)*/ + .min(1.0) + .max(-1.0) + .mul(0.5) + .add(0.5); + let center = /*0.25*/0.4; + let dmin = center - /*0.15;//0.05*/0.05; + let dmax = center + /*0.05*//*0.10*/0.05; //0.05; + let log_odds = |x: f64| logit(x) - logit(center); + let ustrength = logistic_cdf( + 1.0 * logit(rock_strength.min(1.0f64 - 1e-7).max(1e-7)) + + 1.0 * log_odds(uheight.min(dmax).max(dmin)), + ); + // marine: ε₀ = 2.078e-3 + // San Gabriel Mountains: ε₀ = 3.18e-4 + // Oregon Coast Range: ε₀ = 2.68e-4 + // Frogs Hollow (peak production = 0.25): ε₀ = 1.41e-4 + // Point Reyes: ε₀ = 8.1e-5 + // Nunnock River (fractured granite, least weathered?): ε₀ = 5.3e-5 + // The stronger the rock, the lower the production rate of exposed bedrock. + // ((1.0 - ustrength) * (/*3.18e-4*/2.078e-3 - 5.3e-5) + 5.3e-5) as f32 + 0.0 + }; + let alpha_func = |posi| { + if is_ocean_fn(posi) { + // marine: α = 3.7e-2 + return 3.7e-2; + } + let wposf = (uniform_idx_as_vec2(posi) * TerrainChunkSize::RECT_SIZE.map(|e| e as i32)) + .map(|e| e as f64); + let turb_wposf = wposf + .div(TerrainChunkSize::RECT_SIZE.map(|e| e as f64)) + .div(turb_wposf_div); + let turb = Vec2::new( + gen_ctx.turb_x_nz.get(turb_wposf.into_array()), + gen_ctx.turb_y_nz.get(turb_wposf.into_array()), + ) * uplift_turb_scale + * TerrainChunkSize::RECT_SIZE.map(|e| e as f64); + // let turb = Vec2::zero(); + let turb_wposf = wposf + turb; + let turb_wposi = turb_wposf + .map2(TerrainChunkSize::RECT_SIZE, |e, f| e / f as f64) + .map2(WORLD_SIZE, |e, f| (e as i32).max(f as i32 - 1).min(0)); + let turb_posi = vec2_as_uniform_idx(turb_wposi); + let uheight = gen_ctx + .uplift_nz + .get(turb_wposf.into_array()) + /* .min(0.5) + .max(-0.5)*/ + .min(1.0) + .max(-1.0) + .mul(0.5) + .add(0.5); + let wposf3 = Vec3::new( + wposf.x, + wposf.y, + uheight * CONFIG.mountain_scale as f64 * rock_strength_div_factor, + ); + let rock_strength = gen_ctx + .rock_strength_nz + .get(wposf3.into_array()) + /* .min(0.5) + .max(-0.5)*/ + .min(1.0) + .max(-1.0) + .mul(0.5) + .add(0.5); + let center = /*0.25*/0.4; + let dmin = center - /*0.15;//0.05*/0.05; + let dmax = center + /*0.05*//*0.10*/0.05; //0.05; + let log_odds = |x: f64| logit(x) - logit(center); + let ustrength = logistic_cdf( + 1.0 * logit(rock_strength.min(1.0f64 - 1e-7).max(1e-7)) + + 1.0 * log_odds(uheight.min(dmax).max(dmin)), + ); + // Frog Hollow (peak production = 0.25): α = 4.2e-2 + // San Gabriel Mountains: α = 3.8e-2 + // marine: α = 3.7e-2 + // Oregon Coast Range: α = 3e-2 + // Nunnock river (fractured granite, least weathered?): α = 2e-3 + // Point Reyes: α = 1.6e-2 + // The stronger the rock, the faster the decline in soil production. + (ustrength * (4.2e-2 - 1.6e-2) + 1.6e-2) as f32 + }; let uplift_fn = |posi| { if is_ocean_fn(posi) { /* return 1e-2 @@ -1044,7 +1170,7 @@ impl WorldSim { .add(bump_factor); /* .sub(/*1.0 / CONFIG.mountain_scale as f64*/(f32::EPSILON * 0.5) as f64) .add(bump_factor); */ - height as f32 + height as f64 }; let alt_func = |posi| { if is_ocean_fn(posi) { @@ -1163,10 +1289,14 @@ impl WorldSim { } })(); - let (alt, basement) = if let Some(map) = parsed_world_file { - (map.alt, map.basement) + let (alt, basement /*, alluvium*/) = if let Some(map) = parsed_world_file { + // let map_len = map.alt.len(); + ( + map.alt, + map.basement, /* vec![0.0; map_len].into_boxed_slice() */ + ) } else { - let (alt, basement) = do_erosion( + let (alt, basement /*, alluvium*/) = do_erosion( 0.0, max_erosion_per_delta_t as f32, n_steps, @@ -1182,6 +1312,7 @@ impl WorldSim { 0.0 } }, // if is_ocean_fn(posi) { old_height(posi) } else { 0.0 }, + // |posi| 0.0, is_ocean_fn, uplift_fn, |posi| n_func(posi), @@ -1189,6 +1320,8 @@ impl WorldSim { |posi| kf_func(posi), |posi| kd_func(posi), |posi| g_func(posi), + |posi| epsilon_0_func(posi), + |posi| alpha_func(posi), ); // Quick "small scale" erosion cycle in order to lower extreme angles. @@ -1198,15 +1331,18 @@ impl WorldSim { n_small_steps, &river_seed, &rock_strength_nz, - |posi| /* if is_ocean_fn(posi) { old_height(posi) } else { alt[posi] } */alt[posi] as f32, + |posi| /* if is_ocean_fn(posi) { old_height(posi) } else { alt[posi] } *//*alt[posi] as f32*/(alt[posi]/* + alluvium[posi]*/) as f32, |posi| basement[posi] as f32, + // |posi| /*alluvium[posi] as f32*/0.0f32, is_ocean_fn, - |posi| uplift_fn(posi) * (1.0 * height_scale / max_erosion_per_delta_t) as f32, + |posi| uplift_fn(posi) * (1.0 * height_scale / max_erosion_per_delta_t), |posi| n_func(posi), |posi| theta_func(posi), |posi| kf_func(posi), |posi| kd_func(posi), |posi| g_func(posi), + |posi| epsilon_0_func(posi), + |posi| alpha_func(posi), ) }; @@ -1248,8 +1384,8 @@ impl WorldSim { let (alt, basement) = (map.alt, map.basement); // Additional small-scale eroson after map load, only used during testing. - let (alt, basement) = if n_post_load_steps == 0 { - (alt, basement) + let (alt, basement /*, alluvium*/) = if n_post_load_steps == 0 { + (alt, basement /*, alluvium*/) } else { do_erosion( 0.0, @@ -1259,24 +1395,45 @@ impl WorldSim { &rock_strength_nz, |posi| /* if is_ocean_fn(posi) { old_height(posi) } else { alt[posi] } */alt[posi] as f32, |posi| basement[posi] as f32, + // |posi| alluvium[posi] as f32, is_ocean_fn, - |posi| uplift_fn(posi) * (1.0 * height_scale / max_erosion_per_delta_t) as f32, + |posi| uplift_fn(posi) * (1.0 * height_scale / max_erosion_per_delta_t), |posi| n_func(posi), |posi| theta_func(posi), |posi| kf_func(posi), |posi| kd_func(posi), |posi| g_func(posi), + |posi| epsilon_0_func(posi), + |posi| alpha_func(posi), ) }; let is_ocean = get_oceans(|posi| alt[posi]); let is_ocean_fn = |posi: usize| is_ocean[posi]; let mut dh = downhill( - |posi| alt[posi] as f32, /*&alt*/ + |posi| alt[posi], /*&alt*/ /*old_height*/ is_ocean_fn, ); - let (boundary_len, indirection, water_alt_pos, _) = get_lakes(/*&/*water_alt*/alt*/|posi| alt[posi] as f32, &mut dh); - let flux_old = get_drainage(&water_alt_pos, &dh, boundary_len); + let (boundary_len, indirection, water_alt_pos, maxh) = + get_lakes(/*&/*water_alt*/alt*/ |posi| alt[posi], &mut dh); + log::debug!("Max height: {:?}", maxh); + let (mrec, mstack, mwrec) = { + let mut wh = vec![0.0; WORLD_SIZE.x * WORLD_SIZE.y]; + get_multi_rec( + |posi| alt[posi], + &dh, + &water_alt_pos, + &mut wh, + WORLD_SIZE.x, + WORLD_SIZE.y, + TerrainChunkSize::RECT_SIZE.x as Compute, + TerrainChunkSize::RECT_SIZE.y as Compute, + maxh, + ) + }; + let flux_old = get_multi_drainage(&mstack, &mrec, &*mwrec, boundary_len); + let flux_rivers = get_drainage(&water_alt_pos, &dh, boundary_len); + // let flux_rivers = flux_old.clone(); let water_height_initial = |chunk_idx| { let indirection_idx = indirection[chunk_idx]; @@ -1321,7 +1478,7 @@ impl WorldSim { }; // Use the maximum of the pass height and chunk height as the parameter to fill_sinks. let chunk_alt = alt[chunk_idx]; - chunk_alt.max(chunk_water_alt) as f32 + chunk_alt.max(chunk_water_alt) }; let water_alt = fill_sinks(water_height_initial, is_ocean_fn); @@ -1330,7 +1487,7 @@ impl WorldSim { .map(|posi| water_height_initial(posi)) .collect::>(); */ - let rivers = get_rivers(&water_alt_pos, &water_alt, &dh, &indirection, &flux_old); + let rivers = get_rivers(&water_alt_pos, &water_alt, &dh, &indirection, &flux_rivers); let water_alt = indirection .par_iter() @@ -1357,7 +1514,7 @@ impl WorldSim { 0.0 } else { // This is not flowing into the ocean, so we can use the existing water_alt. - water_alt[chunk_idx] + water_alt[chunk_idx] as f32 } }) .collect::>() @@ -1948,7 +2105,7 @@ impl SimChunk { let basement_pre = gen_cdf.basement[posi] as f32; let water_alt_pre = gen_cdf.water_alt[posi]; let downhill_pre = gen_cdf.dh[posi]; - let flux = gen_cdf.flux[posi]; + let flux = gen_cdf.flux[posi] as f32; let river = gen_cdf.rivers[posi].clone(); // Can have NaNs in non-uniform part where pure_water returned true. We just test one of