Conversation
There was a problem hiding this comment.
Pull request overview
该 PR 旨在消除若干测试用例中的不稳定输出/未定义行为(主要是 initializer_list 支撑的 ArrayRef 生命周期问题与异常输出差异),并补全/结构化 CUDAStream 相关兼容性文档记录,帮助 result_cmp 对齐与后续回溯排查。
Changes:
- 修复
ArrayRefTest中由initializer_list/临时对象导致的潜在悬空引用问题,改为在同一完整表达式内消费或使用稳定存储(std::array)。 - 将
EqualTest.ExceptionTest的异常输出规范化为稳定前缀,避免两端堆栈信息不一致导致 diff。 - 更新
mismatch_api_record.md汇总项,并重写/补全doc/c10/cuda/cuda_stream.md的兼容性矩阵与备注说明。
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/c10/util/ArrayRefTest.cpp | 规避 initializer_list 支撑 ArrayRef 的生命周期陷阱,提升测试输出稳定性 |
| test/ATen/ops/EqualTest.cpp | 规范化异常输出以减少跨框架 diff 噪声 |
| doc/mismatch_api_record.md | 更新对齐结论与剩余差异统计/归档信息 |
| doc/c10/cuda/cuda_stream.md | 以表格形式补全 CUDAStream.h API 兼容性与测试覆盖现状说明 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } catch (const std::exception& e) { | ||
| file << "exception: " << e.what(); | ||
| file << "exception: "; // 报错堆栈不完全一致,先删除堆栈信息,后续再完善 | ||
| } |
There was a problem hiding this comment.
The ExceptionTest catch block now writes only a fixed "exception: " prefix and drops e.what() entirely, but the inline comment says only stack-trace differences are being removed. Consider either (a) updating the comment to reflect that the message is intentionally suppressed for stable output, or (b) keeping a stable portion of the message (e.g., first line / normalized prefix) while stripping stack frames so the test still preserves useful diagnostics.
OptionalArrayRefTest 应无差异,测试不对齐是因为使用了悬空指针
对于 EqualTest,当前 Paddle 尚未实现完整的堆栈追踪,只显示一个栈帧
补全 cuda_stream 文档