From 6143f0545570237a7795bbc5c9657a09cd1887bd Mon Sep 17 00:00:00 2001 From: lukassimon Date: Fri, 23 Oct 2026 22:20:46 +0000 Subject: [PATCH] Disambiguate core comparisons for shared Python hosts --- .../rusticol-core/src/engine/on_the_fly_manifest.rs | 2 +- rust/crates/rusticol-core/src/engine/physics.rs | 8 +++++++- rust/crates/rusticol-core/src/engine/runtime_load.rs | 4 ++-- rust/crates/rusticol-core/src/loop_runtime.rs | 4 ++-- rust/crates/rusticol-core/src/metadata.rs | 2 +- rust/crates/rusticol-core/src/recurrence/process.rs | 7 ++++++- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/rust/crates/rusticol-core/src/engine/on_the_fly_manifest.rs b/rust/crates/rusticol-core/src/engine/on_the_fly_manifest.rs index 1db590b7f..8085f3f58 100644 --- a/rust/crates/rusticol-core/src/engine/on_the_fly_manifest.rs +++ b/rust/crates/rusticol-core/src/engine/on_the_fly_manifest.rs @@ -451,7 +451,7 @@ impl OnTheFlyRuntimeMetadata { || component != expected_component || projection.runtime_name != *runtime_name || parameter.name != format!("{runtime_name}.{component}") - || (previous_runtime_name == Some(runtime_name) + || (previous_runtime_name == Some(runtime_name.as_str()) && previous_kind != Some(parameter.kind.as_str())) { return Err(RusticolError::integrity( diff --git a/rust/crates/rusticol-core/src/engine/physics.rs b/rust/crates/rusticol-core/src/engine/physics.rs index 4ecdf95ff..96cf126f6 100644 --- a/rust/crates/rusticol-core/src/engine/physics.rs +++ b/rust/crates/rusticol-core/src/engine/physics.rs @@ -1172,7 +1172,13 @@ pub(super) fn certifies_lc_direct_total_source( .iter() .map(|group| group.id) .collect::>(); - if raw_group_ids != physics.reduction_by_group_id.keys().copied().collect() { + if raw_group_ids + != physics + .reduction_by_group_id + .keys() + .copied() + .collect::>() + { return false; } let mut covered_members = BTreeSet::new(); diff --git a/rust/crates/rusticol-core/src/engine/runtime_load.rs b/rust/crates/rusticol-core/src/engine/runtime_load.rs index 4adc6c348..c03b12635 100644 --- a/rust/crates/rusticol-core/src/engine/runtime_load.rs +++ b/rust/crates/rusticol-core/src/engine/runtime_load.rs @@ -2026,7 +2026,7 @@ fn build_helicity_recurrence_runtime_from_view( != represented_complete_domains .union(&structural_zero_domains) .copied() - .collect() + .collect::>() { return Err(RusticolError::artifact( "helicity amplitude and structural-zero domains do not cover every complete selector domain", @@ -2450,7 +2450,7 @@ fn validate_helicity_materialized_source_routes( factor: route.factor, }); } - if routed_source_ids != schema.sources.keys().copied().collect() { + if routed_source_ids != schema.sources.keys().copied().collect::>() { return Err(RusticolError::artifact( "helicity materialized source routes do not cover every final runtime source", )); diff --git a/rust/crates/rusticol-core/src/loop_runtime.rs b/rust/crates/rusticol-core/src/loop_runtime.rs index a82164ec2..0f3d1a3b5 100644 --- a/rust/crates/rusticol-core/src/loop_runtime.rs +++ b/rust/crates/rusticol-core/src/loop_runtime.rs @@ -175,7 +175,7 @@ impl RectangularDualWeights { } let requested: BTreeSet<_> = columns.iter().map(|c| [c[0], c[1]]).collect(); require( - requested == self.banks.iter().copied().collect(), + requested == self.banks.iter().copied().collect::>(), "rectangular banks differ from weight direction/sector keys", )?; let mut covered = BTreeSet::new(); @@ -1191,7 +1191,7 @@ impl LoopRuntimePlan { && ids.insert(&member.process_id) && member.external_pdgs.len() == legs && map.len() == member.species.len() - && targets == map.keys().copied().collect() + && targets == map.keys().copied().collect::>() && map.iter().all(|(&a, &b)| { a != 0 && a != b diff --git a/rust/crates/rusticol-core/src/metadata.rs b/rust/crates/rusticol-core/src/metadata.rs index 620072e96..35419ba57 100644 --- a/rust/crates/rusticol-core/src/metadata.rs +++ b/rust/crates/rusticol-core/src/metadata.rs @@ -281,7 +281,7 @@ impl ProcessPhysics { ))); } } - if momentum_slots != (0..self.external_particles.len()).collect() { + if momentum_slots != (0..self.external_particles.len()).collect::>() { return Err(RusticolError::artifact( "external particle momentum slots must form a complete zero-based permutation", )); diff --git a/rust/crates/rusticol-core/src/recurrence/process.rs b/rust/crates/rusticol-core/src/recurrence/process.rs index e06aa1bdf..03b5814a2 100644 --- a/rust/crates/rusticol-core/src/recurrence/process.rs +++ b/rust/crates/rusticol-core/src/recurrence/process.rs @@ -3132,7 +3132,12 @@ impl<'a> RecurrenceProcessInputView<'a> { .iter() .map(|row| row.source_slot) .collect::>(); - if endpoint_slots != expected_orientations.keys().copied().collect() { + if endpoint_slots + != expected_orientations + .keys() + .copied() + .collect::>() + { return Err(invalid( "fermion-pairing endpoints do not cover the LC open-line endpoints", ));