fix: handle the bug of wrong dag_parant index (#996)

* fix the dag_parant_index bug caused by the wrong calling order of

* auto-lint
This commit is contained in:
xuangu-fang
2025-06-27 17:01:29 +08:00
committed by GitHub
parent 7e77a44e11
commit cd0aab3c31
+8 -6
View File
@@ -222,7 +222,6 @@ class DataScienceRDLoop(RDLoop):
e = prev_out.get(self.EXCEPTION_KEY, None)
if e is None:
exp = prev_out["running"]
self.trace.hist.append((exp, prev_out["feedback"]))
# NOTE: we put below operations on selections here, instead of out of the if-else block,
# to fit the corner case that the trace will be reset
@@ -232,8 +231,16 @@ class DataScienceRDLoop(RDLoop):
self.trace.set_current_selection(exp.local_selection)
self.trace.sync_dag_parent_and_hist()
self.trace.hist.append((exp, prev_out["feedback"]))
else:
exp: DSExperiment = prev_out["direct_exp_gen"] if isinstance(e, CoderError) else prev_out["coding"]
# set the local selection to the trace as global selection, then set the DAG parent for the trace
if exp.local_selection is not None:
self.trace.set_current_selection(exp.local_selection)
self.trace.sync_dag_parent_and_hist()
self.trace.hist.append(
(
exp,
@@ -241,11 +248,6 @@ class DataScienceRDLoop(RDLoop):
)
)
# set the local selection to the trace as global selection, then set the DAG parent for the trace
if exp.local_selection is not None:
self.trace.set_current_selection(exp.local_selection)
self.trace.sync_dag_parent_and_hist()
if self.trace.sota_experiment() is None:
if DS_RD_SETTING.coder_on_whole_pipeline:
# check if feedback is not generated