diff --git a/src/simulator/crates/mc-compute/src/ecology.rs b/src/simulator/crates/mc-compute/src/ecology.rs index a6c20a26..e4329f96 100644 --- a/src/simulator/crates/mc-compute/src/ecology.rs +++ b/src/simulator/crates/mc-compute/src/ecology.rs @@ -5,7 +5,7 @@ //! full-grid input buffers on every device, partition-sized output buffers. #[cfg(feature = "gpu")] -use std::collections::HashMap; +use std::collections::{BTreeMap, HashMap}; #[cfg(feature = "gpu")] use mc_core::grid::GridState; @@ -141,7 +141,7 @@ impl GpuEcologyEngine { pub fn upload( &mut self, grid: &GridState, - tile_populations: &HashMap<(i32, i32), Vec>, + tile_populations: &BTreeMap<(i32, i32), Vec>, species_registry: &HashMap, ) where S: PopSlotLike, @@ -179,7 +179,7 @@ impl GpuEcologyEngine { pub fn download_into( gpu_tiles: &[GpuTileEcology], grid: &GridState, - tile_populations: &mut HashMap<(i32, i32), Vec>, + tile_populations: &mut BTreeMap<(i32, i32), Vec>, ) { for (i, tile) in grid.tiles.iter().enumerate() { if i >= gpu_tiles.len() { diff --git a/src/simulator/crates/mc-compute/src/gpu/ecology_buffers.rs b/src/simulator/crates/mc-compute/src/gpu/ecology_buffers.rs index 602532fb..c66df656 100644 --- a/src/simulator/crates/mc-compute/src/gpu/ecology_buffers.rs +++ b/src/simulator/crates/mc-compute/src/gpu/ecology_buffers.rs @@ -7,7 +7,7 @@ //! Input buffers are full-grid sized (same pattern as climate buffers). Output buffers //! are partition-sized for multi-GPU dispatch. -use std::collections::HashMap; +use std::collections::{BTreeMap, HashMap}; use mc_core::grid::GridState; use wgpu::util::DeviceExt; @@ -156,7 +156,7 @@ impl EcologyBuffers { &self, queue: &wgpu::Queue, grid: &GridState, - tile_populations: &HashMap<(i32, i32), Vec>, + tile_populations: &BTreeMap<(i32, i32), Vec>, ) where S: PopSlotLike, {