Skip to content

feat: add TileType bridge and PTO capability manifest#256

Closed
zhoubot wants to merge 1 commit intozhangstevenunity:mainfrom
zhoubot:codex/tiletype-bridge-capability-manifest
Closed

feat: add TileType bridge and PTO capability manifest#256
zhoubot wants to merge 1 commit intozhangstevenunity:mainfrom
zhoubot:codex/tiletype-bridge-capability-manifest

Conversation

@zhoubot
Copy link
Contributor

@zhoubot zhoubot commented Mar 12, 2026

Summary

  • add a PTOAS capability manifest generator for cross-stack exposure checks
  • add the TileType -> buffer bridge in the C API and Python binding
  • update PTOAS docs and sample guidance to match the autosync/frontend direction

Validation

  • python3 tools/gen_pto_capability_manifest.py
  • local PTOAS build/export for the updated PTO Python module
  • PTODSL capability gate consumes the PTOAS manifest successfully

Notes

  • this is the PTOAS-side contract needed by the PTODSL frontend unification work
  • internal TileBufType usage is reduced but not fully eliminated yet

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: faf5af7a1b

ℹ️ 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".


def _extract_python_type_methods(text: str) -> dict[str, list[str]]:
type_block_pattern = re.compile(
r'mlir_type_subclass\(\s*m,\s*"([A-Za-z0-9_]+)"(.*?)(?=^\s*mlir_type_subclass\(\s*m,\s*"[A-Za-z0-9_]+"|^\s*populatePTODialectSubmodule\(m\);)',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop type-method parsing before attribute blocks

The mlir_type_subclass block regex currently terminates only at the next mlir_type_subclass, so any intervening mlir_attribute_subclass methods are incorrectly attributed to the preceding type. In this tree that already causes TileType to pick up TileBufConfigAttr methods (for example get_default), which makes the generated capability manifest report Python APIs that the type does not actually expose and can invalidate cross-stack capability checks.

Useful? React with 👍 / 👎.

Comment on lines +21 to +24
# This sample intentionally contains NO explicit sync ops.
#
# Use it with:
# ptoas --enable-insert-sync

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep MatMul sample synchronized for default ptoas flow

This change makes the sample depend on auto-inserted sync, but existing repo entry points still compile tmatmulk.pto without --enable-insert-sync while tools/ptoas/ptoas.cpp keeps that flag defaulted to false; in those paths the kernel is now emitted without explicit record_event/wait_event ordering. That can produce race-prone code and incorrect experiment results unless all callers are updated to force auto-sync.

Useful? React with 👍 / 👎.

@zhangstevenunity
Copy link
Owner

Will support L1 in a few months later.

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