From 7e7afdd8bb27a6de4ce22db29b029a5b23f7b474 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 22:43:16 +0000 Subject: [PATCH 1/3] Initial plan From 7216bb8219e9ae06d7b1ff0592ed4a27dba9ee2e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 22:47:51 +0000 Subject: [PATCH 2/3] Fix KeyError in crossgen2_comparison.py: use base_results_by_name for omitted_from_diff_dir lookups The omitted_from_diff_dir set contains assemblies present in the base directory but not in the diff directory. Line 922 was incorrectly looking up these assemblies in diff_results_by_name (where they don't exist) instead of base_results_by_name (where they do exist), causing an intermittent KeyError when an assembly was omitted from the diff output. Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/416242cd-0d0e-4de1-bc09-46f242809cd5 Co-authored-by: jtschuster <36744439+jtschuster@users.noreply.github.com> --- src/tests/Common/scripts/crossgen2_comparison.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/scripts/crossgen2_comparison.py b/src/tests/Common/scripts/crossgen2_comparison.py index 17ad120b0058a1..a8b545123c9147 100644 --- a/src/tests/Common/scripts/crossgen2_comparison.py +++ b/src/tests/Common/scripts/crossgen2_comparison.py @@ -919,7 +919,7 @@ def compare_results(args): failureXml.appendChild(messageXml) for assembly_name in omitted_from_diff_dir: - base_result = diff_results_by_name[assembly_name] + base_result = base_results_by_name[assembly_name] message = 'Expected {0} got nothing'.format(json.dumps(base_result, cls=CrossGenResultEncoder, indent=2)) testresult = root.createElement('test') testresult.setAttribute('name', 'CrossgenCompile_{2}_Target_{0}_{1}_vs__Omitted'.format(args.target_arch_os, base_result.compiler_arch_os, assembly_name)) From ea26bafe6b416fd2ee283dc92e28cd6e75149fef Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Thu, 26 Mar 2026 18:53:15 -0700 Subject: [PATCH 3/3] Update src/tests/Common/scripts/crossgen2_comparison.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/tests/Common/scripts/crossgen2_comparison.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/scripts/crossgen2_comparison.py b/src/tests/Common/scripts/crossgen2_comparison.py index a8b545123c9147..45be87675fbbb5 100644 --- a/src/tests/Common/scripts/crossgen2_comparison.py +++ b/src/tests/Common/scripts/crossgen2_comparison.py @@ -918,7 +918,7 @@ def compare_results(args): messageXml.appendChild(root.createTextNode(message)) failureXml.appendChild(messageXml) - for assembly_name in omitted_from_diff_dir: + for assembly_name in sorted(omitted_from_diff_dir): base_result = base_results_by_name[assembly_name] message = 'Expected {0} got nothing'.format(json.dumps(base_result, cls=CrossGenResultEncoder, indent=2)) testresult = root.createElement('test')