Skip to content

fix(benchmark_runner): record failed-item exceptions on TestRecord so…#1552

Merged
superdosh merged 2 commits into
mlcommons:mainfrom
WatchTree-19:fix/1353-record-failed-item-exceptions
Jul 9, 2026
Merged

fix(benchmark_runner): record failed-item exceptions on TestRecord so…#1552
superdosh merged 2 commits into
mlcommons:mainfrom
WatchTree-19:fix/1353-record-failed-item-exceptions

Conversation

@WatchTree-19

Copy link
Copy Markdown
Contributor

… # errors is accurate (#1353)

_make_test_record hardcoded test_item_exceptions=[], so exceptions captured on failed items never reached the TestRecord. HazardScore.score() sums len(test_record.test_item_exceptions) into HazardScore.exceptions, which feeds the '# errors' column of the results table, so it always read 0 even when items raised.

Populate test_item_exceptions from run.failed_items_for(sut, test), one TestItemExceptionRecord per failed item carrying exceptions (mirrors simple_test_runner). Adds a regression test plus a clean-run test.

… # errors is accurate (mlcommons#1353)

_make_test_record hardcoded test_item_exceptions=[], so exceptions captured on
failed items never reached the TestRecord. HazardScore.score() sums
len(test_record.test_item_exceptions) into HazardScore.exceptions, which feeds the
'# errors' column of the results table, so it always read 0 even when items raised.

Populate test_item_exceptions from run.failed_items_for(sut, test), one
TestItemExceptionRecord per failed item carrying exceptions (mirrors simple_test_runner).
Adds a regression test plus a clean-run test.
@WatchTree-19
WatchTree-19 requested a review from a team as a code owner June 24, 2026 14:19
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@WatchTree-19

Copy link
Copy Markdown
Contributor Author

recheck

@superdosh superdosh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for this contribution! We've added some better clarity on the desired outcome in the card, and I've suggested a way to address below.

Comment thread src/modelbench/benchmark_runner.py Outdated
test_item_exceptions = [
TestItemExceptionRecord(
test_item=item.test_item,
error_message=str(item.exceptions[-1]),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Per discussion in #1353 , let's simplify this to remove if exceptions in the loop below, but for error_message and cause below, add something like str(item.exceptions[-1]) if item.exceptions else "".

This way we'll count all failed items and not exceptions-only.

…view

remove the 'if item.exceptions' filter and default error_message/cause to ''
for failed items without a captured exception, so HazardScore.exceptions /
the '# errors' column count every failed item. +test.

Signed-off-by: WatchTree-19 <119982314+WatchTree-19@users.noreply.github.com>
@WatchTree-19
WatchTree-19 temporarily deployed to Scheduled Testing July 8, 2026 11:49 — with GitHub Actions Inactive
@WatchTree-19

Copy link
Copy Markdown
Contributor Author

thanks @superdosh - done. dropped the if item.exceptions filter so there's one record per failed item, and defaulted error_message/cause to "" when an item has no captured exception. so HazardScore.exceptions and the # errors column now count all failed items, not exceptions-only. added a test for the no-exception case.

@superdosh
superdosh merged commit 8020008 into mlcommons:main Jul 9, 2026
3 checks passed
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