Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Linx TileOP API

Header-only C++ TileOP bindings for the LinxISA / PTO ISA 0.59.0 architectural contract.
The checked-in catalog and documentation are generated against the reviewed
PTO ISA 0.59.0 development golden (`development-not-published`, ABI
`pto-isa-0.58.7-mode-function-v1`).
Header-only C++ TileOP bindings for the LinxISA / PTO ISA 0.59.0 architectural
contract. The checked-in catalog and documentation are generated against the
published PTO ISA `v0.59.0.0` release (commit `b016532`, ABI
`pto-isa-0.59.0-mode-function-v1`). The release manifest records
`specification_status: draft` and limits implementation conformance to
`b-fpatr-and-tcvt-e8m0-asl-proven-other-numeric-domains-unproven`; this binding
carries that identity without claiming a finalized specification or full
numeric conformance. The semantic engine inventory remains the LinxISA v0.58
authority projection, whose 119-operation Tile catalog is byte-identical to the
release catalog.

Installed headers expose their provenance through
`<common/pto_tileop_api_revision.hpp>`. `PTO_TILEOP_API_VERSION` and
Expand All @@ -13,7 +19,7 @@ Installed headers expose their provenance through
allow consumers to reject toolchains that predate a required fix.

The normative operation inventory comes from the checked-in PTO catalog at
[`contracts/pto-isa-0.58.7-tile-operations.json`](contracts/pto-isa-0.58.7-tile-operations.json).
[`contracts/pto-isa-0.59.0-tile-operations.json`](contracts/pto-isa-0.59.0-tile-operations.json).
The public bindings retain the unique compiled `BSTART.TEPL` carrier for VEC/SFU
source compatibility and emit the named TLSU/CUBE operation forms accepted by
the current Linx compiler. The generated engine index is a wrapper compatibility
Expand Down Expand Up @@ -44,12 +50,14 @@ historical migration fixtures under `test/tileop_api` and
`docs/tileop-usage/migration/pto-0583-migration.md`; it is not the current API
baseline. Run the catalog and documentation checks before target compilation.

To refresh the pinned projection from the clean, exact reviewed LinxISA
authority commit recorded by the generator:
To refresh the pinned projection, provide the clean, exact reviewed LinxISA
v0.58 authority commit together with a clean checkout of `PTO-ISA/pto-spec` at
the `v0.59.0.0` release commit:

```sh
python3 tools/sync_linxisa_v058_contract.py \
/path/to/linx-isa/isa/v0.58/linxisa-v0.58.json
python3 tools/sync_pto_isa_0590_contract.py \
/path/to/linx-isa/isa/v0.58/linxisa-v0.58.json \
--pto-root /path/to/pto-spec
python3 tools/generate_engine_docs.py
make check
```
20 changes: 13 additions & 7 deletions contracts/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# LinxISA contract projections

`pto-isa-0.58.7-tile-operations.json` is the checked-in machine-readable snapshot
of the reviewed PTO ISA 0.58.7 development Tile catalog. It records all 119 accepted direct
`pto-isa-0.59.0-tile-operations.json` is the checked-in machine-readable snapshot
of the published PTO ISA 0.59.0.0 release Tile catalog. It records all 119 accepted direct
operations plus the catalog's deleted and rejected inventories. Its source of
truth is `PTO-ISA/pto-spec/spec/catalog/tile-operations.json`; refresh it only
from commit `f0a876e449a95d26841c5ee7affb4c905ebc5f5b` and review the resulting diff.
from the `v0.59.0.0` release commit `b0165320a4b575b18d2f4d93faf40178f661ab49`
and review the resulting diff. These bytes are identical to the PTO 0.58.7
development golden catalog (SHA-256 533db9b8...); only the surrounding encoding
identity moved to the release.

`linxisa-v0.58-engine-ops.json` is a generated, provenance-pinned LinxISA/PTO
0.58.7 development projection. It records operation ownership and encodings;
it does not claim that this repository implements every projected operation:
`linxisa-v0.58-engine-ops.json` is a generated, provenance-pinned projection of
the LinxISA v0.58 authority onto the PTO ISA 0.59.0.0 release encoding identity.
It records operation ownership and encodings; it does not claim that this
repository implements every projected operation. There is no LinxISA 0.59
profile, so the LinxISA `source` stays v0.58 and the development-golden lock it
carried is preserved under `pto_source.development_lock`:

```bash
python3 tools/sync_linxisa_v058_contract.py \
python3 tools/sync_pto_isa_0590_contract.py \
/path/to/linx-isa/isa/v0.58/linxisa-v0.58.json \
--pto-root /path/to/pto-spec
```
Expand Down
35 changes: 24 additions & 11 deletions contracts/linxisa-v0.58-engine-ops.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,36 @@
],
"profile": "v0.58",
"pto_source": {
"commit": "f0a876e449a95d26841c5ee7affb4c905ebc5f5b",
"development_manifest": {
"path": "spec/development-manifest.json",
"sha256": "0c6d0b2a1ec0b49e32e13971e751a5ea19946351a3880bfdfcef0f50351944f7"
},
"encoding_abi": "pto-isa-0.58.7-mode-function-v1",
"encoding_projection_sha256": "a5f78ecd707bde4a014542158ea257c783796b95fa4fbcce37742e41fee6a881",
"publication": null,
"release": "0.58.7",
"commit": "b0165320a4b575b18d2f4d93faf40178f661ab49",
"content_sha256": "a3e71975e7f753864f7ec09c57515e60f5a6e3e72dfdbce8e444c815a20b2835",
"development_lock": {
"catalog_sha256_matches_release": true,
"commit": "f0a876e449a95d26841c5ee7affb4c905ebc5f5b",
"development_manifest": {
"path": "spec/development-manifest.json",
"sha256": "0c6d0b2a1ec0b49e32e13971e751a5ea19946351a3880bfdfcef0f50351944f7"
},
"note": "The LinxISA v0.58 authority locked the PTO development golden; its Tile catalog bytes equal the 0.59.0.0 release Tile catalog (both SHA-256 533db9b8...), so the v0.58 engine projection remains valid against the published release.",
"release": "0.58.7",
"tree": "fe9e8e050375fbce3f526d08acca13c37cd15830"
},
"encoding_abi": "pto-isa-0.59.0-mode-function-v1",
"encoding_projection_sha256": "91509080ca656eb124f47830dcb09c50389dc177266b3b8df9d2d11dc37d5697",
"publication_version": "0.59.0.0",
"release": "0.59.0",
"release_manifest": {
"path": "spec/release-manifest.json",
"sha256": "3c6b20623e73822c0bd26021c10beb233b8809328b5515f57609eadad1749dc4"
},
"release_tag": "v0.59.0.0",
"repo": "https://github.com/PTO-ISA/pto-spec.git",
"status": "development-not-published",
"specification_status": "draft",
"tile_catalog": {
"count": 119,
"path": "spec/catalog/tile-operations.json",
"sha256": "533db9b8f31f118af5978de813cfaa3fa738de820ee24655faa2ee71f343a706"
},
"tree": "fe9e8e050375fbce3f526d08acca13c37cd15830"
"tree": "31ff0c2d39cbed714baf5be7929bfd06887be9fb"
},
"schema": "linx-tileop-api.engine-ops-projection.v2",
"semantic_engine_counts": {
Expand Down
18 changes: 11 additions & 7 deletions docs/tileop-usage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@

## 版本与兼容性

本目录当前以 PTO-ISA/pto-spec 的 **0.59.0** 架构规范为对照基线:
本目录当前以 PTO-ISA/pto-spec 的 **0.59.0.0** 发布规范为对照基线:

- architecture version:`0.59.0`
- publication version:`0.59.0.0`
- stable release commit:`de57af400cf607f03730aa522a4e9bfb160596de`
- release tag:`v0.59.0.0`
- encoding ABI:`pto-isa-0.58.7-mode-function-v1`

PTO `main` 是开发分支;需要可复现构建时应锁定上面的 release commit。本文档描述
的是架构规范和本仓库 wrapper 的交集,并不表示 wrapper 已实现 0.59.0 的全部操作。
- release commit:`b0165320a4b575b18d2f4d93faf40178f661ab49`
- encoding ABI:`pto-isa-0.59.0-mode-function-v1`
- specification status:`draft`(发布 manifest 自身记为 draft,实现 conformance 限定为
`b-fpatr-and-tcvt-e8m0-asl-proven-other-numeric-domains-unproven`)

PTO `main` 是开发分支;需要可复现构建时应锁定上面的 release commit。119 个操作的
Tile catalog 与 PTO 0.58.7 development golden 逐字节一致,只是 encoding identity 移到了
发布版本。本文档描述的是架构规范和本仓库 wrapper 的交集,并不表示 wrapper 已实现
0.59.0 的全部操作,也不表示该发布规范已最终定稿或数值 conformance 已全部证明。
每个操作页中的 C++ 签名以本仓库头文件为准,PTO ASL/NDF 是架构合法性的权威来源。

[0.58.3 迁移说明](migration/pto-0583-migration.md)是历史文档,保留用于迁移旧
Expand Down Expand Up @@ -153,7 +157,7 @@ clang++ --target=linx64v5-unknown-linux-musl -mlxbc -fenable-matrix \
也在该页面说明。
- 常规逐元素算子从 [TADD](elementwise-tile-tile/arithmetic/TADD.md) 开始;按目录选择
算术、逻辑、转换、归约、布局和不规则操作。
- PTO ISA v0.59.0 的 CUBE layout 重排操作从
- PTO ISA 0.59.0 的 CUBE layout 重排操作从
[TPERMUTE](layout-and-rearrangement/layout/TPERMUTE.md) 开始;
[TSHUF](layout-and-rearrangement/layout/TSHUF.md)、
[TPACK](layout-and-rearrangement/layout/TPACK.md)、
Expand Down
10 changes: 6 additions & 4 deletions docs/tileop-usage/generated/engines.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# LinxISA / PTO ISA v0.59.0 wrapper engine compatibility view
# LinxISA v0.58 / PTO ISA 0.59.0.0 wrapper engine compatibility view

架构定义的引擎类别只有 **VEC**, **TLSU**, **CUBE**, and **SFU**。
VEC 只包含逐元素操作;SFU 包含归约、广播、变换、排序以及其他需要更复杂硬件的操作。
TEPL 仍是唯一的编译 carrier 标识。`BSTART.VEC` 和 `BSTART.SFU` 是特定引擎的汇编别名;
inline wrapper 保留 `BSTART.TEPL`,以兼容之前的工具链源码。

下表根据本仓库固定的 LinxISA/PTO development golden 投影生成,数据记录在
下表根据本仓库固定的 LinxISA v0.58 authority 投影生成(其操作清单与 PTO ISA 0.59.0.0
发布 catalog 逐字节一致),数据记录在
[`contracts/linxisa-v0.58-engine-ops.json`](../../../contracts/linxisa-v0.58-engine-ops.json) 中。
Golden 共 119 项;其中 119 项在 `include/` 有名称引用,
投影共 119 项;其中 119 项在 `include/` 有名称引用,
0 项明确没有 wrapper。名称引用不证明 ASL/NDF 语义完整实现。

## VEC
Expand Down Expand Up @@ -152,7 +153,8 @@ Golden 共 119 项;其中 119 项在 `include/` 有名称引用,
## 分类语义

PTO ISA 0.59.0 将执行引擎与操作分类解耦。本表是 wrapper compatibility view;
其底层投影记录当前 development golden selector 数据。`elementwise-tile-tile`
其底层投影记录 LinxISA v0.58 authority 的 selector 数据(与 0.59.0.0 发布 catalog 一致)。
`elementwise-tile-tile`
和 `tile-scalar-and-immediate` 类别在 VEC 上执行逐元素操作,但其中的
`TEXP`、`TLOG`、`TRECIP`、`TSQRT`、`TRSQRT` 由 SFU 执行。
`reduce-and-expand`、`layout-and-rearrangement` 和 `irregular-and-complex` 类别由 SFU 执行。
Expand Down
27 changes: 19 additions & 8 deletions docs/tileop-usage/support-status.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PTO ISA 0.59.0 wrapper 支持状态

本表以 `contracts/pto-isa-0.58.7-tile-operations.json` 的 119 个
本表以 `contracts/pto-isa-0.59.0-tile-operations.json` 的 119 个
`accepted-direct-operation` 为操作清单。它描述 Linx TileOP C++ wrapper 的
公开实现状态,不替代 PTO-ISA/pto-spec 的 ASL/NDF 合法性、fault、completion、
rollback、definedness 或 memory-order 语义。
Expand All @@ -17,23 +17,34 @@ rollback、definedness 或 memory-order 语义。
| PTO catalog 范围 | 状态 | 说明 |
| --- | --- | --- |
| TEPL elementwise、scalar、reduce/expand、irregular(除 `TLEA`) | 已实现 | 逐操作页面和 `jcore/template_asm.hpp` 为 wrapper 权威;dtype、valid region、padding 和 selector 仍受 ASL 约束。 |
| `TLEA` | 尚无 wrapper | PTO development golden 已分配 SFU selector 31;本仓库尚无公开 C++ wrapper,不以相近操作代替。 |
| `TEXPDIF` | CPU simulator、JCORE inline-asm 已实现;LLVM MC catalog 已实现;LLVM compiler lowering 尚未完成;AArch64/SME 不支持 | PTO 0.59.0 selector 29。已有 wrapper 不等于 LLVM compiler 已具备从 IR/builtin 到 TEXPDIF 的端到端 lowering。 |
| `TLEA` | JCORE inline-asm wrapper 已实现(RowMajor 与 CUBE_M32);CPU simulator 未实现;AArch64/SME 未实现;LLVM MC / compiler lowering 分别判断 | PTO catalog 将 TLEA 列为 `accepted-direct-operation`(`BSTART.TEPL`,**VEC** 引擎,selector `0x2E`=46,function 14/mode 1);操作数为 S32/U32/S64/U64 element index、per-PE element-width 标量与 S64/U64 byte-offset 目标。`include/jcore/template_asm.hpp` 的 wrapper 以编译期约束限定 dtype/layout/logical-shape(RowMajor/CUBE_M32,Shared/CUBE_N8/CUBE_M16 拒绝);signed→S64/unsigned→U64 的严格配对由 ASL `lea-operands.asl` 要求,当前 wrapper 仅校验目标为 S64/U64,配对以指令 legality 为准。element-width 的运行时合法性(8/16/32/64)由指令 legality 检查,不是编译期静态拒绝。wrapper 存在不代表 CPU simulator、AArch64 或 LLVM 端到端已具备 TLEA 支持。 |
| `TEXPDIF` | CPU simulator、JCORE inline-asm 已实现;LLVM MC catalog 已实现;LLVM compiler lowering 尚未完成;AArch64/SME 不支持 | PTO selector 29。已有 wrapper 不等于 LLVM compiler 已具备从 IR/builtin 到 TEXPDIF 的端到端 lowering。 |
| TLSU `TLOAD`/`TSTORE`/`TMOV`/`TPREFETCH`/`GMOV` | 已实现 | 传输、peer move 和 prefetch 有独立 C++ 入口;layout conversion 仅对页面列出的组合开放。 |
| TLSU `MGATHER`/`MSCATTER` 及 atomic/reduction variants | 仅部分 layout 支持 | wrapper 覆盖当前公开 selector;ColumnMajor selector、mask/索引 dtype 和不同 atomic 组合不得由普通 gather/scatter 重载推断。 |
| CUBE TMATMUL/TGEMV 及 bias/acc/MX variants | 仅部分 layout 支持 | CUBE_M16/CUBE_M32、Shared physical shape、scale layout 和 InternalAcc 由具体 wrapper/操作页限制。 |
| TEPL layout/rearrangement(`TPERMUTE`、`TSHUF`、`TPACK`、`TUNPACK`、`TGPR2T`) | 仅部分 layout 支持 | 只覆盖已实现的 CUBE/Local 路径和控制字段;未列出的组合保持拒绝。 |
| 0.59.0 `MGATHER`/`MSCATTER` family | 已适配 | 0.59.0 removes the GM row-stride operand and interprets index tiles as explicit byte displacements;wrapper 与 contract test 已改为 base-only `B.IOR`。 |
| 0.59.0 `TROWEXPAND*`/`TCOLEXPAND*` roles | 已适配 | Source roles 使用 row-broadcast/column-broadcast operation view;wrapper 约束、注释及操作文档已同步。 |
| `MGATHER`/`MSCATTER` family(byte-displacement 索引) | 已适配 | 自 PTO 0.58.7 起 GM row-stride 操作数被移除、index tile 解释为显式 byte displacement,该语义在 0.59.0.0 发布 catalog 中保持不变;wrapper 与 contract test 使用 base-only `B.IOR`。 |
| `TROWEXPAND*`/`TCOLEXPAND*` roles | 已适配 | Source roles 使用 row-broadcast/column-broadcast operation view;wrapper 约束、注释及操作文档已同步。 |
| `deleted_names`、`rejected_names`,以及 `TTRANS`/`TFILLPAD` 等历史页面 | 仅历史参考 | 不属于 active catalog;页面必须保留明确的 retired 标识。 |

## 版本边界

- 当前 API/spec 基线:PTO ISA development golden `0.59.0`,状态
`development-not-published`,publication 为空,ABI
`pto-isa-0.58.7-mode-function-v1`。
- 当前 API/spec 基线:已发布的 PTO ISA `v0.59.0.0` release(commit `b016532`),ABI
`pto-isa-0.59.0-mode-function-v1`、encoding projection SHA-256
`91509080…`、ELF release 字段 `0.59.0`(见 `contracts/pto-isa-0.59.0-tile-operations.json`、
`contracts/linxisa-v0.58-engine-ops.json` 的 `pto_source` 与 provenance 测试)。
- 发布 manifest(`spec/release-manifest.json`)自身记为
`specification_status: draft`,并把 implementation conformance 限定为
`b-fpatr-and-tcvt-e8m0-asl-proven-other-numeric-domains-unproven`;本页据此
不宣称该规范已最终定稿或全部数值域已证明。119 个操作的 Tile catalog 与 PTO 0.58.7
development golden 逐字节一致(SHA-256 `533db9b8…`),因此 `TLEA` 等条目在两者之间保持一致,
只是 encoding identity 移到了发布版本。
- 语义 authority 仍是 LinxISA v0.58 profile(无 0.59 profile)与 PTO ASL/NDF:
engine-ops 投影保留真实 LinxISA v0.58 来源,并在 `pto_source.development_lock`
记录其曾锁定的 PTO development golden,不把旧来源伪标为 v0.59。
- backend 能力必须分别判断:CPU simulator/JCORE wrapper、LLVM MC
assembler/parser、LLVM compiler lowering 以及 AArch64/SME 并不是同一个状态。
`TLEA` 目前只有 JCORE inline-asm wrapper(RowMajor 与 CUBE_M32),没有 CPU simulator 语义。
- `TEXPDIF` 当前已有 CPU simulator 实现、JCORE inline-asm wrapper 和 LLVM
MC catalog 条目;LLVM compiler lowering 尚未完成,因此当前不能宣称 LLVM
端到端支持。
Expand Down
Loading
Loading