Skip to content

fix: compare mrgsort_format2 by stable output prefix#477

Open
FangRui0 wants to merge 1 commit intohw-native-sys:mainfrom
FangRui0:fix_verify
Open

fix: compare mrgsort_format2 by stable output prefix#477
FangRui0 wants to merge 1 commit intohw-native-sys:mainfrom
FangRui0:fix_verify

Conversation

@FangRui0
Copy link
Copy Markdown
Contributor

No description provided.

@FangRui0
Copy link
Copy Markdown
Contributor Author

/run a3

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +1629 to +1634
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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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)

@reedhecre
Copy link
Copy Markdown

A3 板测完成(有跳过)

  • 触发方式:manual
  • 源码提交:2d7e07ae0c9d
  • 结果汇总:OK 184 / FAIL 0 / SKIP 1
  • 日志:/home/zhongxuan/ptoas-board-monitor/runtime/logs/20260413_195104_manual_pr477.log
  • 结果 TSV:/home/zhongxuan/ptoas-board-monitor/runtime/logs/20260413_195104_manual_pr477.tsv
  • 手动指令:/run a3
  • 触发人:FangRui0
  • 触发评论:fix: compare mrgsort_format2 by stable output prefix #477 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants