Add validated A5 VPTO ops#834
Conversation
Codex Review该评论由 review 机器人自动更新。
SummaryReview failed at stage Findings未生成结构化 findings,因为 review 过程提前失败。 Log Tail |
There was a problem hiding this comment.
Code Review
This pull request introduces several new VPTO operations for the A5 architecture, including SPR state operations (sprclr, sprsti, sprsts), loop-indexed tail predicates (pltm_b8/16/32), fused multiply-add (vmadd), extrema predicate reductions (vcbmax, vcbmin), and histogram updates (chistv2, dhistv2). Additionally, it restricts trem and trems operations on A5 to floating-point types, removing integer support. The review feedback points out potential ValueError exceptions in the test comparison script (compare.py) when comparing arrays of mismatched shapes.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if not ok: | ||
| diff = np.max(np.abs(golden.astype(np.float64) - output.astype(np.float64))) | ||
| print(f"[ERROR] compare failed: {label}, max_abs_diff={diff}") |
There was a problem hiding this comment.
If golden.shape != output.shape, ok will be False. In the error reporting block, evaluating golden.astype(np.float64) - output.astype(np.float64) will raise a ValueError due to shape mismatch, masking the actual error. We should check if the shapes match before performing element-wise operations.
| if not ok: | |
| diff = np.max(np.abs(golden.astype(np.float64) - output.astype(np.float64))) | |
| print(f"[ERROR] compare failed: {label}, max_abs_diff={diff}") | |
| if not ok: | |
| if golden.shape != output.shape: | |
| print(f"[ERROR] shape mismatch: golden={golden.shape}, output={output.shape}") | |
| else: | |
| diff = np.max(np.abs(golden.astype(np.float64) - output.astype(np.float64))) | |
| print(f"[ERROR] compare failed: {label}, max_abs_diff={diff}") |
| if not ok: | ||
| mismatch = np.flatnonzero(golden != output) | ||
| first = int(mismatch[0]) if mismatch.size else -1 | ||
| print( | ||
| f"[ERROR] compare failed: {label}, first_mismatch={first}, " | ||
| f"golden={golden[first] if first >= 0 else 'n/a'}, " | ||
| f"output={output[first] if first >= 0 else 'n/a'}" | ||
| ) |
There was a problem hiding this comment.
If golden.shape != output.shape, ok will be False. In the error reporting block, evaluating golden != output will raise a ValueError due to shape mismatch, masking the actual error. We should check if the shapes match before performing element-wise operations.
| if not ok: | |
| mismatch = np.flatnonzero(golden != output) | |
| first = int(mismatch[0]) if mismatch.size else -1 | |
| print( | |
| f"[ERROR] compare failed: {label}, first_mismatch={first}, " | |
| f"golden={golden[first] if first >= 0 else 'n/a'}, " | |
| f"output={output[first] if first >= 0 else 'n/a'}" | |
| ) | |
| if not ok: | |
| if golden.shape != output.shape: | |
| print(f"[ERROR] shape mismatch: golden={golden.shape}, output={output.shape}") | |
| else: | |
| mismatch = np.flatnonzero(golden != output) | |
| first = int(mismatch[0]) if mismatch.size else -1 | |
| print( | |
| f"[ERROR] compare failed: {label}, first_mismatch={first}, " | |
| f"golden={golden[first] if first >= 0 else 'n/a'}, " | |
| f"output={output[first] if first >= 0 else 'n/a'}" | |
| ) |
3c6fbeb to
1b6fa33
Compare
1b6fa33 to
dd67946
Compare
Summary
Validation