Skip to content

Feat: enhance golden validation error output with mismatch details#550

Merged
ChaoWao merged 1 commit intohw-native-sys:mainfrom
sjduan:feat/enhance-golden-error-details
Apr 14, 2026
Merged

Feat: enhance golden validation error output with mismatch details#550
ChaoWao merged 1 commit intohw-native-sys:mainfrom
sjduan:feat/enhance-golden-error-details

Conversation

@sjduan
Copy link
Copy Markdown
Contributor

@sjduan sjduan commented Apr 14, 2026

Summary

  • Add detailed mismatch information to golden validation error messages
  • Show first 20 mismatched elements with indices and actual/expected values
  • Improve debugging experience for test failures

Changes

  • Modified examples/scripts/code_runner.py to include mismatch details in AssertionError
  • Display flattened tensor indices for easy element location
  • Limit output to first 20 mismatches to avoid overwhelming output

Testing

  • Verified on existing test failures
  • Tested on a2a3sim platform
  • Manually verified error message format

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 enhances the error reporting in the tensor comparison utility by including specific details for the first 20 mismatched elements in the AssertionError message. The feedback identifies an opportunity to optimize the string construction using vectorized indexing and list conversion to avoid the performance overhead of repeated .item() calls, while also noting a redundancy in the mismatch count calculation.

- Add detailed mismatch information to golden validation error messages
- Show first 20 mismatched elements with indices and actual/expected values
- Use vectorized operations for better performance
- Improve debugging experience for test failures
@sjduan sjduan force-pushed the feat/enhance-golden-error-details branch from d014989 to bcf2617 Compare April 14, 2026 12:47
@ChaoWao ChaoWao merged commit ee33104 into hw-native-sys:main Apr 14, 2026
29 of 30 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