From 40bf66f34c090043b9c8c1b9c39e1867b234c1df Mon Sep 17 00:00:00 2001 From: Guo Cheng <224264187+GuoCheng24@users.noreply.github.com> Date: Wed, 2 Sep 2026 08:49:45 +0800 Subject: [PATCH] Make the data-leakage trigger reachable should_check_data_leakage compares the metric with == 1.0 / == 0.0, so the check it guards (check_data_leakage, on by default) effectively never runs: a leaked AUC lands on 0.99997 and a leaked RMSE on 1.2e-08. Compare against configurable bounds instead, chosen conservatively so the exact-1.0 and exact-0.0 cases stay inside the new bounds and ordinary scores do not fire. --- agents/triggers.py | 7 +++++-- config/__init__.py | 3 +++ config/config.yaml | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/agents/triggers.py b/agents/triggers.py index 83609b23..0617408b 100644 --- a/agents/triggers.py +++ b/agents/triggers.py @@ -14,10 +14,13 @@ def should_check_data_leakage(agent, node: SearchNode) -> bool: metric_value = node.metric.value maximize = agent.metric_maximize + # Exact float equality almost never fires in practice: a leaked AUC lands + # on 0.99997, a leaked RMSE on 1.2e-08. Compare against a threshold instead, + # keeping the old exact-1.0 / exact-0.0 cases inside the new bounds. if maximize: - is_extreme = (metric_value == 1.0) + is_extreme = (metric_value >= agent.acfg.leakage_max_threshold) else: - is_extreme = (metric_value == 0.0) + is_extreme = (metric_value <= agent.acfg.leakage_min_threshold) if is_extreme: logger.info( diff --git a/config/__init__.py b/config/__init__.py index 66a24b24..28737424 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -102,6 +102,9 @@ class AgentConfig: use_evolution: bool = True use_fusion: bool = True use_aggregation: bool = True + # Bounds for the data-leakage trigger (see agents/triggers.py). + leakage_max_threshold: float = 0.999 + leakage_min_threshold: float = 1e-6 @dataclass class ExecConfig: timeout: int diff --git a/config/config.yaml b/config/config.yaml index 6ef3c1cc..37f6af13 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -56,6 +56,9 @@ agent: # --- Submission check --- check_data_leakage: True + # A metric at or beyond these bounds triggers the data-leakage check. + leakage_max_threshold: 0.999 + leakage_min_threshold: 1e-6 # --- Code gen mode --- use_diff_mode: True # Multi-Mode Codegen