docs: design dual-output TEXTRACT support - #1289
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33964d4323
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 4. 任一 TSTORE source static range 与任一 partial destination range 相交即拒绝。TSTORE source | ||
| 是 block argument/call operand 派生值而无法解析为唯一 static absolute range 时也保守拒绝; | ||
| 首版不为此建立 argument-effect/range summary fixed point。 |
There was a problem hiding this comment.
Compare address spaces before rejecting TSTORE aliases
Restrict this range-intersection check to sources in the same address space as the partial destination. TStoreOp accepts VEC, MAT, and ACC sources, and those local memories can legitimately reuse the same numeric offsets; therefore a component containing a partial VEC destination at address 0 and an unrelated MAT/ACC TSTORE source at address 0 would be rejected even though that store cannot expose the UB destination. The helper should carry the address space with each range and only report an alias when both the space and byte intervals overlap.
Useful? React with 👍 / 👎.
| 该 helper 使用 `getBufferBitSize(alloc.getResult())` 填 `allocateSize`,从 tile memory space 填 | ||
| `addressSpace`,把静态 byte `addr` 乘 `kBitsToByte` 后作为唯一 `addresses` 元素,并记录 | ||
| `parentLoop`。地址不可折叠时写入 `ShapedType::kDynamic`,在同 address space 中保持保守冲突, |
There was a problem hiding this comment.
Check overflow before converting GraphSync addresses to bits
Require checked multiplication when converting the byte address to GraphSync's bit units. Existing AllocTileOp verification only enforces non-negativity and alignment, so a level-3 constant greater than INT64_MAX / 8 can reach GraphSync; because GraphSync runs before the proposed post-planning helper, addr * kBitsToByte then overflows signed int64_t before the later range validation can reject it, potentially producing incorrect hazard decisions or undefined behavior. Reject the address or conservatively mark it dynamic when the conversion is not representable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc225c66ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| indexRow_k + dst_k.validRows <= src.physicalRows | ||
| indexCol_k + dst_k.validCols <= src.physicalCols |
There was a problem hiding this comment.
Bound extraction windows by the source valid region
When src.valid_shape is smaller than its physical shape, these checks accept a window entirely outside the valid region—for example, a physical 64x128 source with valid 16x16 and indexRow=32. The proposed A2/A3 scalar lowering and A5 template then read those padding elements and expose them through dst.valid_shape, producing undefined or stale output. Either require a full-valid source or check each window against src.validRows/src.validCols rather than its allocation extent.
Useful? React with 👍 / 👎.
9280ad6 to
ddb76ef
Compare
Summary
这是一个 docs-only 设计 PR,目标是让 PTOAS 在现有
pto.textract/TExtractOp上承载 PTO-ISA 的 ND -> 2xNZ 双输出 overload。本 PR 不实现代码,不新增 MLIR op、dotted mnemonic、driver 参数或构建配置。
设计范围
pto.textract,通过完整 operand segment schema 和 tile layout 推断单输出/双输出 form。LowerPTOToUBufOps内展开为两路 scalar pointer loop 和 V/S 内部同步,不能残留 pointer-formpto.textract。1x1只作为 UB-only TEXTRACT 覆盖,禁止通过同址 alias generic TSTORE 导出未定义 NZ padding。不在本 PR
TExtractNd2xNzOp、第二个 IR mnemonic或 backend TEXTRACT op。--pto-isa-include-root、codegen environment 属性、compile probe 或其他 capability discovery 机制。Review focus
请重点评审:现有 op 的 operand/schema 兼容性、A2/A3 VPTO lowering、双输出的内存与同步语义、partial-valid 的 TSTORE 安全边界、跨函数/跨 child 调用闭包、A5 physical layout 与 gap 观测边界,以及后续实现拆分和回归覆盖。
Scope
本分支只新增:
docs/designs/textract-nd-to-2xnz-design.md没有代码、测试或依赖变更。