From 6a1cb424c00a2298fbb5b05814a4a7ba52145168 Mon Sep 17 00:00:00 2001 From: Vlad Munteanu Date: Fri, 28 Aug 2026 01:03:23 +0300 Subject: [PATCH] Make ColliderCouplingSet iteration deterministic (use DeterministicState, as HGrid already does) Co-Authored-By: Claude Fable 5 --- src/geometry/mod.rs | 2 +- src/integrations/rapier/fluids_pipeline.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs index 5ee5daa..b2d8aaf 100644 --- a/src/geometry/mod.rs +++ b/src/geometry/mod.rs @@ -5,7 +5,7 @@ pub use self::contacts::{ compute_contacts, compute_self_contacts, insert_boundaries_to_grid, insert_fluids_to_grid, HGridEntry, ParticlesContacts, }; -pub use self::hgrid::HGrid; +pub use self::hgrid::{DeterministicState, HGrid}; mod contact_manager; mod contacts; diff --git a/src/integrations/rapier/fluids_pipeline.rs b/src/integrations/rapier/fluids_pipeline.rs index d5d5f9c..bfa89c5 100644 --- a/src/integrations/rapier/fluids_pipeline.rs +++ b/src/integrations/rapier/fluids_pipeline.rs @@ -1,5 +1,5 @@ use crate::coupling::CouplingManager; -use crate::geometry::{HGrid, HGridEntry}; +use crate::geometry::{DeterministicState, HGrid, HGridEntry}; use crate::object::{BoundaryHandle, BoundarySet, Fluid}; use crate::solver::{DFSPHSolver, DfsphParameters, PressureSolver}; use crate::TimestepManager; @@ -171,14 +171,14 @@ pub struct ColliderCouplingEntry { /// Structure managing all the coupling between colliders from rapier with boundaries and fluids from salva. pub struct ColliderCouplingSet { /// The hashmap containing mappings from ColliderHandle to ColliderCouplingEntry - pub entries: HashMap, + pub entries: HashMap, } impl ColliderCouplingSet { /// Create a new collider coupling manager. pub fn new() -> Self { Self { - entries: HashMap::new(), + entries: HashMap::with_hasher(DeterministicState), } }