From 35a7ae5e1ff929b3ee3b77c04cb1f4a684a4b2d7 Mon Sep 17 00:00:00 2001 From: you-n-g Date: Mon, 3 Nov 2025 17:59:46 +0800 Subject: [PATCH] feat: show the summarized final difference between the final workspace and the base workspace (#1281) --- rdagent/log/ui/ds_trace.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/rdagent/log/ui/ds_trace.py b/rdagent/log/ui/ds_trace.py index 6ed43f87..f2648a5f 100644 --- a/rdagent/log/ui/ds_trace.py +++ b/rdagent/log/ui/ds_trace.py @@ -72,6 +72,18 @@ def convert_defaultdict_to_dict(d): def load_data(log_path: Path): + """ + Load and normalize logged data for the UI. + + Meaning of "no_tag": + - We attempt to extract an evolution id (ei) from each message tag. + - If no ei can be extracted (i.e., the entry is not tied to a specific evolving step), + the item is stored under the "no_tag" key. + - Typical "no_tag" entries include: + * direct_exp_gen["no_tag"]: the base experiment/hypothesis for the loop + * coding["no_tag"] / running["no_tag"]: the final workspace/result for that stage + * llm_data[loop_id][function]["no_tag"]: common LLM logs without an ei + """ data = defaultdict(lambda: defaultdict(dict)) llm_data = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) token_costs = defaultdict(list) @@ -576,6 +588,18 @@ def main_win(loop_id, llm_data=None): last_sota_exp=last_sota_exp, ) if "feedback" in loop_data: + # Show final diff between the final workspace and the base workspace + base_workspace = loop_data["direct_exp_gen"]["no_tag"].experiment_workspace + final_workspace = None + if "running" in loop_data and "no_tag" in loop_data["running"]: + final_workspace = loop_data["running"]["no_tag"].experiment_workspace + elif "coding" in loop_data and "no_tag" in loop_data["coding"]: + final_workspace = loop_data["coding"]["no_tag"].experiment_workspace + + if final_workspace is not None and base_workspace is not None: + st.subheader("Final Diff") + workspace_win(final_workspace, cmp_workspace=base_workspace, cmp_name="base workspace") + feedback_win(loop_data["feedback"], llm_data.get("feedback", None) if llm_data else None) if "record" in loop_data and "SOTA experiment" in loop_data["record"]: st.header("Record", divider="violet", anchor="record")