Skip to content

fix(ptodsl): validate VecValue arithmetic with SIMT#929

Open
jimmychou0 wants to merge 1 commit into
hw-native-sys:mainfrom
jimmychou0:codex/vec-value-arith-simt
Open

fix(ptodsl): validate VecValue arithmetic with SIMT#929
jimmychou0 wants to merge 1 commit into
hw-native-sys:mainfrom
jimmychou0:codex/vec-value-arith-simt

Conversation

@jimmychou0

@jimmychou0 jimmychou0 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add reflected and non-reflected add/sub support for PTODSL VecValue
  • keep vector division out of the PTODSL surface because the SIMT backend does not support it
  • validate VecValue add/sub/mul through SIMT compile, PTOAS frontend, and runtime ST paths
  • add an Ascend950 SIMT golden-output case for vector arithmetic

Validation

  • clean LLVM 21.1.8 build: ptoas and PTOPythonModules
  • ptodsl/tests/test_jit_compile.py
  • ptodsl/tests/test_ptoas_frontend_verify.py
  • Python syntax, git diff --check, and license-header checks
  • Ascend950PR_9599 simulator: PASS vec_value_arith / All cases passed.

Notes

  • the VecValue compile/frontend probes use @pto.simt helpers and assert pto.simt_launch
  • emitted MLIR contains arith.addf, arith.subf, and arith.mulf, with no arith.divf

@reedhecre

reedhecre commented Jul 10, 2026

Copy link
Copy Markdown

Codex Review

该评论由 review 机器人自动更新。

  • PR: fix(ptodsl): validate VecValue arithmetic with SIMT #929 fix(ptodsl): validate VecValue arithmetic with SIMT
  • Author: jimmychou0
  • Base/Head: main / codex/vec-value-arith-simt
  • Head SHA: 4b17f3ebb28c
  • Trigger: PR 有新提交
  • Generated At: 2026-07-10T06:15:42Z
  • Previous Head SHA: 60a45c9d7a3b
  • Status: failed at codex-review (exit=1)

Summary

Review failed at stage codex-review: exit=1

Findings

未生成结构化 findings,因为 review 过程提前失败。

Log Tail

set -euo pipefail
rm -rf '/tmp/ptoas-pr-review-monitor/runs/20260710_141527_pr929/repo'
git clone --branch 'main' --depth 50 'https://github.com/hw-native-sys/PTOAS.git' '/tmp/ptoas-pr-review-monitor/runs/20260710_141527_pr929/repo'
cd '/tmp/ptoas-pr-review-monitor/runs/20260710_141527_pr929/repo'
git fetch origin 'refs/pull/929/head:pr-929' --depth 50
git fetch origin 'main' --depth 50 || true
git checkout -f 'pr-929'
git rev-parse HEAD
git diff --stat 'origin/main...HEAD' || true
Cloning into '/tmp/ptoas-pr-review-monitor/runs/20260710_141527_pr929/repo'...
From https://github.com/hw-native-sys/PTOAS
 * [new ref]           refs/pull/929/head -> pr-929
From https://github.com/hw-native-sys/PTOAS
 * branch              main       -> FETCH_HEAD
Switched to branch 'pr-929'
4b17f3ebb28c06efd2c6f89921b689196ef864aa
 ptodsl/ptodsl/_surface_values.py           | 12 ++++
 ptodsl/tests/test_jit_compile.py           | 46 +++++++++++++++
 ptodsl/tests/test_ptoas_frontend_verify.py | 51 +++++++++++++++++
 test/dsl-st/vec_value_arith.py             | 92 ++++++++++++++++++++++++++++++
 4 files changed, 201 insertions(+)
===== END STAGE clone rc=0 @ 2026-07-10 14:15:34 =====

===== STAGE codex-review @ 2026-07-10 14:15:34 =====
set -euo pipefail
cd '/tmp/ptoas-pr-review-monitor/runs/20260710_141527_pr929/repo'
'codex' exec -C '/tmp/ptoas-pr-review-monitor/runs/20260710_141527_pr929/repo' -s read-only -c 'model_provider="codereview"' -c 'model="gpt-5.4"' -c 'model_reasoning_effort="xhigh"' --output-schema '/tmp/ptoas-pr-review-monitor/runs/20260710_141527_pr929/review_schema.json' -o '/tmp/ptoas-pr-review-monitor/runs/20260710_141527_pr929/codex_last_message.json' --color never - < '/tmp/ptoas-pr-review-monitor/runs/20260710_141527_pr929/review_prompt.txt'
[monitor] stage timeout: 1800s
OpenAI Codex v0.115.0 (research preview)
--------
workdir: /tmp/ptoas-pr-review-monitor/runs/20260710_141527_pr929/repo
model: gpt-5.4
provider: codereview
approval: never
sandbox: read-only
reasoning effort: xhigh
reasoning summaries: none
session id: 019f4aaa-cc1a-7f01-94ad-87f2e689b6c5
--------
user
你现在在审查 GitHub PR。

仓库:hw-native-sys/PTOAS
PR:#929 fix(ptodsl): validate VecValue arithmetic with SIMT
作者:jimmychou0
base branch:origin/main
head branch:HEAD(当前已 checkout 到 PR head)

要求:
1. 只审查这个 PR 相对 origin/main 的改动,必要时可以看上下文文件。
2. 重点找真实的 correctness / regression / contract mismatch / CI / runtime / compatibility 问题。
3. 不要提纯风格建议,不要提低价值猜测。
4. 严格按优先级输出:
   - P1:高概率会导致错误结果、编译/运行失败、严重回归、发布阻断
   - P2:重要缺陷、行为回归、遗漏校验/测试、较大兼容性问题
   - P3:次要但明确可改的问题
5. 如果没有问题,summary 直接写:未检查到 PR #929 存在问题,并返回 findings=[]。
6. 如果有问题,summary 简洁概括,findings 里每条都要给出:
   - severity
   - title
   - body(说明为什么是问题,尽量具体)
   - file(尽量给相对路径)
   - line(能确定就填整数,否则 null)

建议先查看:
- git status --short
- git diff --stat origin/main...HEAD
- git diff --unified=80 origin/main...HEAD

最终输出必须严格匹配 JSON schema。

mcp startup: no servers
Reconnecting... 1/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18d6f4e2b53453c-LAX, request id: 1ce2b829-8e6a-4a9c-9249-f01fe121fdfb)
Reconnecting... 2/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18d6f50df072aaa-LAX, request id: 74a277f6-5510-4cd3-998f-db2376ae5c5f)
Reconnecting... 3/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18d6f54dc81ae6a-LAX, request id: eb541732-e7bf-46ac-b617-54863b43dedf)
Reconnecting... 4/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18d6f5b4d0d0785-LAS, request id: 3f56e7d9-2218-436d-9b00-3ba0adf0bc25)
Reconnecting... 5/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18d6f674c792f4c-LAX, request id: 4629b2cc-3430-4062-9e5b-70f96b9965c9)
ERROR: unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18d6f7affc17650-LAX, request id: b3375076-20b2-43e1-9dde-a3bc6d4809b5
Warning: no last agent message; wrote empty content to /tmp/ptoas-pr-review-monitor/runs/20260710_141527_pr929/codex_last_message.json
===== END STAGE codex-review rc=1 @ 2026-07-10 14:15:42 =====

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request adds support for vector addition and subtraction operations (add, radd, sub, rsub) on VecValue objects, along with comprehensive JIT compilation, frontend verification, and end-to-end system tests. The review feedback points out that rmul is missing, which prevents multiplying a scalar by a VecValue (e.g., 2.0 * vec), and suggests adding it for completeness and consistency.

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.

Comment thread ptodsl/ptodsl/_surface_values.py
@jimmychou0 jimmychou0 force-pushed the codex/vec-value-arith-simt branch from 60a45c9 to c83b542 Compare July 10, 2026 06:13
Expose add and subtract for floating-point VecValue operands while keeping unsupported vector division out of the frontend surface. Cover the operations through SIMT compile, frontend, and runtime ST paths.
@jimmychou0 jimmychou0 force-pushed the codex/vec-value-arith-simt branch from c83b542 to 4b17f3e Compare July 10, 2026 06:15
@jimmychou0 jimmychou0 marked this pull request as ready for review July 10, 2026 06:31
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.

3 participants