fix: compare mrgsort_format2 by stable output prefix#477
fix: compare mrgsort_format2 by stable output prefix#477FangRui0 wants to merge 1 commit intohw-native-sys:mainfrom
Conversation
|
/run a3 |
There was a problem hiding this comment.
Code Review
This pull request introduces a 512-element comparison limit for the 'mrgsort_format2' testcase to handle implementation-defined tail regions on A3 architecture and ensure deterministic CI results. The review feedback suggests restricting this logic specifically to the A3 platform to avoid unnecessary loss of test coverage on other architectures and identifies a redundant integer cast.
| testcase_lc = testcase.lower() | ||
| if testcase_lc == "mrgsort_format2": | ||
| for p in output_ptrs: | ||
| name = p["name"] | ||
| file_cnt = int(ptr_elem_counts.get(name, logical_elem_count)) | ||
| compare_prefix_counts[name] = min(file_cnt, 512) |
There was a problem hiding this comment.
The current implementation applies the 512-element prefix limit to all SoC versions. However, the comment on line 1626 specifies that this issue (implementation-defined tail regions) is specific to the A3 architecture. Applying this limit globally unnecessarily reduces test coverage for other platforms; for instance, in the mrgsort_format2 test case, the 4-way merge output starts at offset 640 and is completely skipped by a 512-element limit.
Additionally, the int() cast on line 1633 is redundant as the values in ptr_elem_counts and logical_elem_count are already integers.
| testcase_lc = testcase.lower() | |
| if testcase_lc == "mrgsort_format2": | |
| for p in output_ptrs: | |
| name = p["name"] | |
| file_cnt = int(ptr_elem_counts.get(name, logical_elem_count)) | |
| compare_prefix_counts[name] = min(file_cnt, 512) | |
| testcase_lc = testcase.lower() | |
| soc_lc = (soc_version or "").lower() | |
| is_a3 = "910b" in soc_lc or os.environ.get("PTOAS_BOARD_IS_A3") == "1" | |
| if testcase_lc == "mrgsort_format2" and is_a3: | |
| for p in output_ptrs: | |
| name = p["name"] | |
| file_cnt = ptr_elem_counts.get(name, logical_elem_count) | |
| compare_prefix_counts[name] = min(file_cnt, 512) |
A3 板测完成(有跳过)
|
No description provided.