Skip to content

Fix VCG group reduction semantics#889

Open
mouliangyu wants to merge 1 commit into
hw-native-sys:mainfrom
mouliangyu:codex/fix-vcg-group-reductions
Open

Fix VCG group reduction semantics#889
mouliangyu wants to merge 1 commit into
hw-native-sys:mainfrom
mouliangyu:codex/fix-vcg-group-reductions

Conversation

@mouliangyu

Copy link
Copy Markdown
Contributor

Summary

  • update VCG group reduction docs to match the VISA per-VLane result layout
  • clarify contiguous low-element result placement for pto.vcgadd, pto.vcgmax, and pto.vcgmin
  • add a VPTO SIM runtime case covering VCG add/max/min result placement

Validation

  • git diff --check
  • WORK_SPACE=/tmp/pto-vpto-vcg-group CASE_NAME='micro-op/reduction/vcg-group' DEVICE=SIM test/vpto/scripts/run_host_vpto_validation.sh

@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 updates the documentation and specifications for per-VLane (group) reduction operations (pto.vcgadd, pto.vcgmax, and pto.vcgmin) to clarify that the 8 VLane results are written contiguously to the low elements (indices 0 to 7) of the destination vector, with the remaining elements zeroed out. It also adds a comprehensive micro-op test case to verify these operations. The feedback suggests explicitly clarifying the zero-filling behavior when the vector register is not fully populated (e.g., for larger element types like i64).

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 on lines +197 to +200
The vector register is organized as **8 VLanes** of 32 bytes each. Group
reductions operate within each VLane independently and produce one result per
VLane. The 8 VLane results are written contiguously to the low elements of the
destination vector; all remaining destination elements are zero.

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.

medium

The updated documentation states that group reductions produce one result per VLane and write them contiguously to the low elements of the destination vector. However, the documentation should explicitly clarify the behavior when the vector register is not fully populated (e.g., when the element type has fewer than 64 elements, such as i64 which has 32 elements). Please clarify if the remaining elements are always zero-filled up to the full vector register size N regardless of the element type.

@mouliangyu mouliangyu marked this pull request as ready for review July 1, 2026 07:45
@reedhecre

reedhecre commented Jul 1, 2026

Copy link
Copy Markdown

Codex Review

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

  • PR: Fix VCG group reduction semantics #889 Fix VCG group reduction semantics
  • Author: mouliangyu
  • Base/Head: main / codex/fix-vcg-group-reductions
  • Head SHA: 3ddcb476a392
  • Trigger: 检测到新的 open PR
  • Generated At: 2026-07-01T10:15:44Z
  • Status: failed at codex-review (exit=1)

Summary

Review failed at stage codex-review: exit=1

Findings

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

Log Tail

git fetch origin 'main' --depth 50 || true
git checkout -f 'pr-889'
git rev-parse HEAD
git diff --stat 'origin/main...HEAD' || true
Cloning into '/tmp/ptoas-pr-review-monitor/runs/20260701_181528_pr889/repo'...
From https://github.com/hw-native-sys/PTOAS
 * [new ref]           refs/pull/889/head -> pr-889
 * [new tag]           v0.27              -> v0.27
 * [new tag]           v0.28              -> v0.28
From https://github.com/hw-native-sys/PTOAS
 * branch              main       -> FETCH_HEAD
Switched to branch 'pr-889'
3ddcb476a392045357371f36c843c18788c0ef6c
 docs/isa/micro-isa/10-reduction-ops.md             |  85 +++++++++------
 docs/vpto-spec.md                                  |  12 ++-
 .../cases/micro-op/reduction/vcg-group/compare.py  |  62 +++++++++++
 .../cases/micro-op/reduction/vcg-group/golden.py   |  59 +++++++++++
 .../cases/micro-op/reduction/vcg-group/kernel.pto  |  60 +++++++++++
 .../cases/micro-op/reduction/vcg-group/launch.cpp  |  47 +++++++++
 .../cases/micro-op/reduction/vcg-group/main.cpp    | 117 +++++++++++++++++++++
 7 files changed, 407 insertions(+), 35 deletions(-)
===== END STAGE clone rc=0 @ 2026-07-01 18:15:36 =====

===== STAGE codex-review @ 2026-07-01 18:15:36 =====
set -euo pipefail
cd '/tmp/ptoas-pr-review-monitor/runs/20260701_181528_pr889/repo'
'codex' exec -C '/tmp/ptoas-pr-review-monitor/runs/20260701_181528_pr889/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/20260701_181528_pr889/review_schema.json' -o '/tmp/ptoas-pr-review-monitor/runs/20260701_181528_pr889/codex_last_message.json' --color never - < '/tmp/ptoas-pr-review-monitor/runs/20260701_181528_pr889/review_prompt.txt'
[monitor] stage timeout: 1800s
OpenAI Codex v0.115.0 (research preview)
--------
workdir: /tmp/ptoas-pr-review-monitor/runs/20260701_181528_pr889/repo
model: gpt-5.4
provider: codereview
approval: never
sandbox: read-only
reasoning effort: xhigh
reasoning summaries: none
session id: 019f1d2d-4ee2-76f1-a9da-243b3f18cbd2
--------
user
你现在在审查 GitHub PR。

仓库:hw-native-sys/PTOAS
PR:#889 Fix VCG group reduction semantics
作者:mouliangyu
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 #889 存在问题,并返回 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: a144a685ef993385-LAX, request id: c27873fb-ccbd-42c0-be9e-5a501e4e51fc)
Reconnecting... 2/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a144a6894839c277-LAX, request id: 2ee64a55-50e8-49c5-80d6-e349ab5c1370)
Reconnecting... 3/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a144a68dd912867d-LAX, request id: 3d1f97c3-740a-4bbe-a02d-d6cbc35d7672)
Reconnecting... 4/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a144a694edb0c213-LAX, request id: 2ab8ce75-6072-43ca-bba0-995e6188e31f)
Reconnecting... 5/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a144a6a0f8c7515a-LAX, request id: 97f22c40-8255-46cf-a018-a430084fb2e4)
ERROR: unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a144a6b719dd2ea8-LAX, request id: 05b6b829-b99f-4ec0-9fda-a8c949674c6d
Warning: no last agent message; wrote empty content to /tmp/ptoas-pr-review-monitor/runs/20260701_181528_pr889/codex_last_message.json
===== END STAGE codex-review rc=1 @ 2026-07-01 18:15:44 =====

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