From faea94948dc171d782d84c8ce508314424394a2e Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Fri, 13 Mar 2026 12:50:23 +0100 Subject: [PATCH] fix(tests): skip CPU-replay DQN tests on CUDA builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7 tests call train_step() via CPU experience replay, but with the cuda feature GPU PER is mandatory (no CPU path). Mark them #[cfg_attr(feature = "cuda", ignore)] — the GPU training pipeline integration tests cover this path properly on H100. Co-Authored-By: Claude Opus 4.6 --- crates/ml-dqn/src/dqn.rs | 5 +++++ crates/ml/src/validation/adapters.rs | 2 ++ 2 files changed, 7 insertions(+) diff --git a/crates/ml-dqn/src/dqn.rs b/crates/ml-dqn/src/dqn.rs index 04d6c35a4..6f3a8e02d 100644 --- a/crates/ml-dqn/src/dqn.rs +++ b/crates/ml-dqn/src/dqn.rs @@ -4748,6 +4748,7 @@ mod tests { } #[test] + #[cfg_attr(feature = "cuda", ignore)] // GPU PER mandatory on CUDA — CPU replay path unavailable fn test_training_step_with_data() -> anyhow::Result<()> { let mut config = DQNConfig::emergency_safe_defaults(); config.min_replay_size = 4; @@ -4808,6 +4809,7 @@ mod tests { } #[test] + #[cfg_attr(feature = "cuda", ignore)] // GPU PER mandatory on CUDA — CPU replay path unavailable fn test_cql_regularization() -> anyhow::Result<()> { let mut config = DQNConfig::emergency_safe_defaults(); config.state_dim = 8; @@ -5041,6 +5043,7 @@ mod tests { /// With weight_decay > 0, training a few steps should produce different final /// weights than weight_decay == 0, proving L2 regularization is active. #[test] + #[cfg_attr(feature = "cuda", ignore)] // GPU PER mandatory on CUDA — CPU replay path unavailable fn test_weight_decay_wired_to_optimizer() -> anyhow::Result<()> { // Helper: run a few training steps and return the first Q-network parameter tensor fn train_and_get_params(weight_decay: f64) -> anyhow::Result> { @@ -5212,6 +5215,7 @@ mod tests { } #[test] + #[cfg_attr(feature = "cuda", ignore)] // GPU PER mandatory on CUDA — CPU replay path unavailable fn test_branching_dqn_end_to_end() -> anyhow::Result<()> { // Phase C+: Verify branching DQN creates, selects actions, and trains let mut config = DQNConfig::emergency_safe_defaults(); @@ -5261,6 +5265,7 @@ mod tests { } #[test] + #[cfg_attr(feature = "cuda", ignore)] // GPU PER mandatory on CUDA — CPU replay path unavailable fn test_branching_regime_conditioning_affects_loss() -> anyhow::Result<()> { // Verify that regime-conditional IS weighting produces different losses // than the no-regime path when states contain regime features. diff --git a/crates/ml/src/validation/adapters.rs b/crates/ml/src/validation/adapters.rs index 1c62ad1c2..375a52c25 100644 --- a/crates/ml/src/validation/adapters.rs +++ b/crates/ml/src/validation/adapters.rs @@ -222,6 +222,7 @@ mod tests { } #[test] + #[cfg_attr(feature = "cuda", ignore)] // GPU PER mandatory on CUDA — CPU replay path unavailable fn test_dqn_strategy_train_and_evaluate() { let config = make_test_config(); let mut strategy = DqnStrategy::new(config) @@ -242,6 +243,7 @@ mod tests { } #[test] + #[cfg_attr(feature = "cuda", ignore)] // GPU PER mandatory on CUDA — CPU replay path unavailable fn test_dqn_strategy_reset() { let config = make_test_config(); let mut strategy = DqnStrategy::new(config)