From be9490f4173744926f6ebbd01eec121d8671b7eb Mon Sep 17 00:00:00 2001 From: xuangu-fang Date: Fri, 11 Jul 2025 17:13:00 +0800 Subject: [PATCH] fix: handle the no-update case of root node in uncommited_rec_status (#1062) * fix: improve scheduler API (suggest_sel) and add timer.remain_time() * chore: exclude .venv from auto-black and auto-isort tasks * refactor: wrap RoundRobinScheduler commit and selection in retry loop * set search_type="ancestors" for experiment_and_feedback_list_after_init * fix bug: no update of uncommited_rec_status with root node --------- Co-authored-by: Young --- .../data_science/proposal/exp_gen/trace_scheduler.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rdagent/scenarios/data_science/proposal/exp_gen/trace_scheduler.py b/rdagent/scenarios/data_science/proposal/exp_gen/trace_scheduler.py index b28be59a..8bd91fe1 100644 --- a/rdagent/scenarios/data_science/proposal/exp_gen/trace_scheduler.py +++ b/rdagent/scenarios/data_science/proposal/exp_gen/trace_scheduler.py @@ -56,8 +56,13 @@ class RoundRobinScheduler(TraceScheduler): while True: # step 0: Commit the pending selections for i in range(self.rec_commit_idx, len(trace.dag_parent)): - for p in trace.dag_parent[i]: - self.uncommited_rec_status[p] -= 1 + + if trace.dag_parent[i] == trace.NEW_ROOT: + self.uncommited_rec_status[trace.NEW_ROOT] -= 1 + else: + for p in trace.dag_parent[i]: + self.uncommited_rec_status[p] -= 1 + self.rec_commit_idx = len(trace.hist) # step 1: select the parant trace to expand