From 80e13c26d21f033ae09e3b82152f0ae0366700d2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 18:12:42 +0000 Subject: [PATCH 1/5] Initial plan From 3c5febc719ffafb063784dbf352d355ffba75300 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 18:17:16 +0000 Subject: [PATCH 2/5] Change get_random_connection receiver from &mut self to &self Co-authored-by: HyperCodec <72839119+HyperCodec@users.noreply.github.com> --- src/neuralnet.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neuralnet.rs b/src/neuralnet.rs index 86ac803..2097309 100644 --- a/src/neuralnet.rs +++ b/src/neuralnet.rs @@ -346,7 +346,7 @@ impl NeuralNetwork { /// doesn't have any outbound connections. /// Returns the connection if it found one before reaching max_retries. pub fn get_random_connection( - &mut self, + &self, max_retries: usize, rng: &mut impl rand::Rng, ) -> Option { From 477719404480047322b4b756f21ace0e72299977 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 18:36:50 +0000 Subject: [PATCH 3/5] Fix activations_in_scope NONE handling and ActivationFn deserialization panic Co-authored-by: HyperCodec <72839119+HyperCodec@users.noreply.github.com> --- src/activation.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/activation.rs b/src/activation.rs index dadb9d2..30a2155 100644 --- a/src/activation.rs +++ b/src/activation.rs @@ -80,10 +80,14 @@ impl ActivationRegistry { /// Gets all activation functions that are valid for a scope. pub fn activations_in_scope(&self, scope: NeuronScope) -> Vec { + if scope == NeuronScope::NONE { + return Vec::new(); + } + let acts = self.activations(); acts.into_iter() - .filter(|a| a.scope.contains(scope)) + .filter(|a| a.scope != NeuronScope::NONE && a.scope.contains(scope)) .collect() } @@ -197,13 +201,12 @@ impl<'a> Deserialize<'a> for ActivationFn { let reg = ACTIVATION_REGISTRY.read().unwrap(); - let f = reg.fns.get(name.as_str()); - - if f.is_none() { - panic!("Activation function {name} not found"); - } + let f = reg + .fns + .get(name.as_str()) + .ok_or_else(|| serde::de::Error::custom(format!("Activation function {name} not found")))?; - Ok(f.unwrap().clone()) + Ok(f.clone()) } } From 34b289d0a17d26acb112861509595dca04d7a5ca Mon Sep 17 00:00:00 2001 From: Tristan Murphy <72839119+HyperCodec@users.noreply.github.com> Date: Fri, 20 Feb 2026 18:41:46 +0000 Subject: [PATCH 4/5] cargo fmt --- src/activation.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/activation.rs b/src/activation.rs index 30a2155..90190b4 100644 --- a/src/activation.rs +++ b/src/activation.rs @@ -201,10 +201,9 @@ impl<'a> Deserialize<'a> for ActivationFn { let reg = ACTIVATION_REGISTRY.read().unwrap(); - let f = reg - .fns - .get(name.as_str()) - .ok_or_else(|| serde::de::Error::custom(format!("Activation function {name} not found")))?; + let f = reg.fns.get(name.as_str()).ok_or_else(|| { + serde::de::Error::custom(format!("Activation function {name} not found")) + })?; Ok(f.clone()) } From 3d8f98aa746e7e8ce9257ab70bcff7b6973341d2 Mon Sep 17 00:00:00 2001 From: Tristan Murphy <72839119+HyperCodec@users.noreply.github.com> Date: Fri, 20 Feb 2026 18:43:21 +0000 Subject: [PATCH 5/5] remove redundant check --- src/activation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/activation.rs b/src/activation.rs index 90190b4..1ddfcc8 100644 --- a/src/activation.rs +++ b/src/activation.rs @@ -87,7 +87,7 @@ impl ActivationRegistry { let acts = self.activations(); acts.into_iter() - .filter(|a| a.scope != NeuronScope::NONE && a.scope.contains(scope)) + .filter(|a| a.scope.contains(scope)) .collect() }