Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
93a6b87
feat(linx): adopt PTO ISA v0.58
Aug 11, 2026
820fdce
build: complete LLVM 23 migration for v0.58
Aug 11, 2026
41269fa
ci: install LLVM 23 nanobind dependency
Aug 11, 2026
907deee
ci: isolate PTOAS from bundled LLVM PTO dialect
Aug 11, 2026
e1743e5
ci: exclude upstream LLVM test targets
Aug 11, 2026
fb7e4bf
ci: pin optional PTO LLVM patch
Aug 11, 2026
c80734e
ci: pin LLVM PTO-off header fix
Aug 11, 2026
6a520f0
ci: install Python 3.10 stubgen dependency
Aug 11, 2026
bbaf8af
build: migrate PTO Python binding to nanobind
Aug 11, 2026
40fecce
build: allow CPython ABI resolution in wheel runtime
Aug 11, 2026
0ce5fe5
build: add binding contract license header
Aug 11, 2026
22894a7
release: align PTOAS with PTO ISA 0.58.1
Aug 16, 2026
bb48108
fix: close PTO ISA 0.58.1 review gaps
Aug 16, 2026
8adbd7f
fix: fail closed on Linx decoded forms
Aug 16, 2026
6256486
fix: close Linx TSTORE_FP verifier bypass
Aug 16, 2026
85b420d
fix: audit implicit Linx verifier dispatch
Aug 16, 2026
b222ae0
chore: add required license headers
Aug 16, 2026
2dc3311
build: pin corrected LinxISA LLVM 0.58.1 head
Aug 16, 2026
09ecdcb
build: repin final LinxISA LLVM 0.58.1
Aug 16, 2026
5922084
build: pin canonical LinxISA LLVM v0.58.1 head
Aug 16, 2026
27754c9
fix: package nanobind runtime for Linux wheels
Aug 16, 2026
647106c
chore: add wheel contract test license header
Aug 16, 2026
d55a4be
test: bind auditwheel lookup to repair step
Aug 16, 2026
036212f
test: validate packaged PTO ISA identity
Aug 16, 2026
32c6b54
fix: fail closed on packaged CLI identity
Aug 17, 2026
10f4557
test: reject dead CLI identity guards
Aug 17, 2026
6dd6146
test: execute packaged identity guards
Aug 17, 2026
e7fedbe
test: join packaged identity control flow
Aug 17, 2026
57115e6
ci: preserve resolved Python for nanobind
Aug 17, 2026
8acc780
fix: use stable LLVM 23 operand helper
Aug 17, 2026
797bf01
fix: migrate LLVM 23 SCF sample API
Aug 17, 2026
f1f931a
fix: verify TSTORE_FP tile sources
Aug 17, 2026
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
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
build
install
wheelhouse
__pycache__
*.pyc
34 changes: 12 additions & 22 deletions .github/scripts/update_pto_isa_pin.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
#!/usr/bin/env python3
# Copyright (c) 2026 Huawei Technologies Co., Ltd.
# This program is free software, you can redistribute it and/or modify it under the terms and conditions of
# CANN Open Software License Agreement Version 2.0 (the "License").
# Please refer to the License for details. You may not use this file except in compliance with the License.
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
# See LICENSE in the root of the software repository for the full text of the License.

import argparse
import pathlib
import re
import subprocess
import sys


DEFAULT_REPO_URL = "https://gitcode.com/cann/pto-isa.git"


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description="Update the pinned pto-isa commit used by CI and Docker."
)
parser.add_argument(
"--repo-url",
default=DEFAULT_REPO_URL,
help="pto-isa git repository URL.",
)
parser.add_argument(
"--commit",
help="Commit SHA to pin. If omitted, resolves the current remote HEAD.",
required=True,
help="Explicit reviewed implementation-header commit SHA to pin.",
)
parser.add_argument(
"--ci-workflow",
Expand All @@ -41,17 +40,6 @@ def parse_args() -> argparse.Namespace:
return parser.parse_args()


def resolve_head_commit(repo_url: str) -> str:
out = subprocess.check_output(
["git", "ls-remote", repo_url, "HEAD"],
text=True,
).strip()
sha = out.split()[0] if out else ""
if not re.fullmatch(r"[0-9a-f]{40}", sha):
raise RuntimeError(f"failed to resolve HEAD for {repo_url!r}: {out!r}")
return sha


def read_text(path: pathlib.Path) -> str:
return path.read_text(encoding="utf-8")

Expand Down Expand Up @@ -159,7 +147,9 @@ def verify(ci_path: pathlib.Path, docker_path: pathlib.Path, commit: str) -> Non

def main() -> int:
args = parse_args()
commit = args.commit or resolve_head_commit(args.repo_url)
commit = args.commit
if not re.fullmatch(r"[0-9a-f]{40}", commit):
raise RuntimeError("--commit must be a full 40-character lowercase SHA")
ci_path = pathlib.Path(args.ci_workflow)
docker_path = pathlib.Path(args.dockerfile)

Expand Down
34 changes: 22 additions & 12 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ permissions:
contents: write

env:
LLVM_TAG: llvmorg-19.1.7
LLVM_REPOSITORY: https://github.com/LinxISA/llvm-project.git
LLVM_COMMIT: 1245c0f89aab24104ea935fa686a0ac5ad9ab2c9

jobs:
build_wheel:
Expand Down Expand Up @@ -55,6 +56,9 @@ jobs:
echo "PY_VER=$PY_VER" >> $GITHUB_ENV
echo "PY_PATH=/opt/python/$PY_VER" >> $GITHUB_ENV

- name: Validate Python binding link contract
run: ${PY_PATH}/bin/python tools/check_python_binding_link_contract.py --ptoas-root .

- name: Compute PTOAS CLI version
run: |
if [ "${GITHUB_EVENT_NAME}" = "release" ]; then
Expand All @@ -78,9 +82,7 @@ jobs:
- name: Install Python dependencies
run: |
export PATH="${PY_PATH}/bin:$PATH"
# LLVM/MLIR Python bindings are not yet compatible with pybind11 3.x
# (see pybind11 static_assert on def_property + keep_alive).
pip install --no-cache-dir numpy 'pybind11<3' nanobind setuptools wheel auditwheel
pip install --no-cache-dir numpy nanobind typing_extensions setuptools wheel auditwheel

- name: Set build directories
run: |
Expand All @@ -95,26 +97,28 @@ jobs:
uses: actions/cache/restore@v4
with:
path: /llvm-workspace/llvm-project/build-shared
key: llvm-${{ env.LLVM_TAG }}-manylinux_2_34-${{ matrix.arch }}-${{ matrix.python }}-hardening-v2
key: llvm-${{ env.LLVM_COMMIT }}-manylinux_2_34-${{ matrix.arch }}-${{ matrix.python }}-pto-off-v2

- name: Prepare LLVM source
run: |
mkdir -p $LLVM_SOURCE_DIR
cd $LLVM_SOURCE_DIR
if [ ! -d .git ]; then
git init
git remote add origin https://github.com/llvm/llvm-project.git
git remote add origin ${{ env.LLVM_REPOSITORY }}
fi
git fetch --depth 1 origin tag ${{ env.LLVM_TAG }}
git checkout ${{ env.LLVM_TAG }}
git remote set-url origin ${{ env.LLVM_REPOSITORY }}
git fetch --depth 1 origin ${{ env.LLVM_COMMIT }}
git checkout --detach ${{ env.LLVM_COMMIT }}
test "$(git rev-parse HEAD)" = "${{ env.LLVM_COMMIT }}"

- name: Warn when default-branch cache is missing for PR/release runs
if: steps.cache-llvm.outputs.cache-hit != 'true' && (github.event_name == 'pull_request' || github.event_name == 'release')
run: |
echo "LLVM cache miss while running on PR/release."
echo "PR/release runs are cache-consumers only and should reuse cache generated on the default branch."
echo "Please run this workflow on the default branch first to populate cache key:"
echo "llvm-${{ env.LLVM_TAG }}-manylinux_2_34-${{ matrix.arch }}-${{ matrix.python }}-hardening-v2"
echo "llvm-${{ env.LLVM_COMMIT }}-manylinux_2_34-${{ matrix.arch }}-${{ matrix.python }}-pto-off-v1"

- name: Build LLVM/MLIR
if: steps.cache-llvm.outputs.cache-hit != 'true'
Expand All @@ -123,6 +127,10 @@ jobs:
cd $LLVM_SOURCE_DIR
cmake -C "$PTO_SOURCE_DIR/cmake/LinuxHardeningCache.cmake" -G Ninja -S llvm -B $LLVM_BUILD_DIR \
-DLLVM_ENABLE_PROJECTS="mlir;clang" \
-DMLIR_ENABLE_LINXISA_PTO=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DBUILD_SHARED_LIBS=ON \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
-DPython3_EXECUTABLE=${PY_PATH}/bin/python \
Expand All @@ -137,7 +145,7 @@ jobs:
uses: actions/cache/save@v4
with:
path: /llvm-workspace/llvm-project/build-shared
key: llvm-${{ env.LLVM_TAG }}-manylinux_2_34-${{ matrix.arch }}-${{ matrix.python }}-hardening-v2
key: llvm-${{ env.LLVM_COMMIT }}-manylinux_2_34-${{ matrix.arch }}-${{ matrix.python }}-pto-off-v2

- name: Build PTOAS
run: |
Expand All @@ -150,10 +158,12 @@ jobs:
-DMLIR_DIR=$LLVM_BUILD_DIR/lib/cmake/mlir \
-DPython3_ROOT_DIR=${PY_PATH} \
-DPython3_EXECUTABLE=${PY_PATH}/bin/python \
-DPython_EXECUTABLE=${PY_PATH}/bin/python \
-DPython3_FIND_STRATEGY=LOCATION \
-Dpybind11_DIR=$(${PY_PATH}/bin/python -m pybind11 --cmakedir) \
-Dnanobind_DIR=$(${PY_PATH}/bin/python -m nanobind --cmake_dir) \
-DMLIR_PYTHON_PACKAGE_DIR=${LLVM_BUILD_DIR}/tools/mlir/python_packages/mlir_core \
-DPTOAS_RELEASE_VERSION_OVERRIDE=${PTOAS_VERSION} \
-DPTOAS_ENABLE_WERROR=OFF \
-DCMAKE_INSTALL_PREFIX=${PTO_INSTALL_DIR} \
-DCMAKE_BUILD_TYPE=Release
ninja -C build
Expand Down Expand Up @@ -287,7 +297,7 @@ jobs:

bump_base_version:
name: Bump base version after release
if: github.event_name == 'release' && github.event.action == 'released'
if: ${{ github.event_name == 'release' && github.event.action == 'released' && !startsWith(github.event.release.tag_name, 'linxisa-') }}
needs: upload_release_assets
runs-on: ubuntu-latest

Expand Down
29 changes: 18 additions & 11 deletions .github/workflows/build_wheel_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ permissions:
contents: write

env:
LLVM_TAG: llvmorg-19.1.7
LLVM_REPOSITORY: https://github.com/LinxISA/llvm-project.git
LLVM_COMMIT: 1245c0f89aab24104ea935fa686a0ac5ad9ab2c9

jobs:
build_wheel:
Expand Down Expand Up @@ -82,9 +83,7 @@ jobs:

- name: Install Python dependencies
run: |
# LLVM/MLIR Python bindings are not yet compatible with pybind11 3.x
# (see pybind11 static_assert on def_property + keep_alive).
pip install --no-cache-dir numpy 'pybind11<3' nanobind setuptools wheel delocate
pip install --no-cache-dir numpy nanobind typing_extensions setuptools wheel delocate

- name: Set build directories
run: |
Expand All @@ -99,33 +98,39 @@ jobs:
uses: actions/cache/restore@v4
with:
path: ${{ runner.temp }}/llvm-workspace/llvm-project/build-shared
key: llvm-${{ env.LLVM_TAG }}-${{ steps.runner-meta.outputs.label }}-${{ matrix.arch }}-${{ matrix.python }}-v1
key: llvm-${{ env.LLVM_COMMIT }}-${{ steps.runner-meta.outputs.label }}-${{ matrix.arch }}-${{ matrix.python }}-pto-off-v2

- name: Prepare LLVM source
run: |
mkdir -p $LLVM_SOURCE_DIR
cd $LLVM_SOURCE_DIR
if [ ! -d .git ]; then
git init
git remote add origin https://github.com/llvm/llvm-project.git
git remote add origin ${{ env.LLVM_REPOSITORY }}
fi
git fetch --depth 1 origin tag ${{ env.LLVM_TAG }}
git checkout ${{ env.LLVM_TAG }}
git remote set-url origin ${{ env.LLVM_REPOSITORY }}
git fetch --depth 1 origin ${{ env.LLVM_COMMIT }}
git checkout --detach ${{ env.LLVM_COMMIT }}
test "$(git rev-parse HEAD)" = "${{ env.LLVM_COMMIT }}"

- name: Warn when default-branch cache is missing for PR/release runs
if: steps.cache-llvm.outputs.cache-hit != 'true' && (github.event_name == 'pull_request' || github.event_name == 'release')
run: |
echo "LLVM cache miss while running on PR/release."
echo "PR/release runs are cache-consumers only and should reuse cache generated on the default branch."
echo "Please run this workflow on the default branch first to populate cache key:"
echo "llvm-${{ env.LLVM_TAG }}-${{ steps.runner-meta.outputs.label }}-${{ matrix.arch }}-${{ matrix.python }}-v1"
echo "llvm-${{ env.LLVM_COMMIT }}-${{ steps.runner-meta.outputs.label }}-${{ matrix.arch }}-${{ matrix.python }}-pto-off-v2"

- name: Build LLVM/MLIR
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: |
cd $LLVM_SOURCE_DIR
cmake -G Ninja -S llvm -B $LLVM_BUILD_DIR \
-DLLVM_ENABLE_PROJECTS="mlir;clang" \
-DMLIR_ENABLE_LINXISA_PTO=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DBUILD_SHARED_LIBS=ON \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
-DPython3_EXECUTABLE=$(which python) \
Expand All @@ -140,7 +145,7 @@ jobs:
uses: actions/cache/save@v4
with:
path: ${{ runner.temp }}/llvm-workspace/llvm-project/build-shared
key: llvm-${{ env.LLVM_TAG }}-${{ steps.runner-meta.outputs.label }}-${{ matrix.arch }}-${{ matrix.python }}-v1
key: llvm-${{ env.LLVM_COMMIT }}-${{ steps.runner-meta.outputs.label }}-${{ matrix.arch }}-${{ matrix.python }}-pto-off-v2

- name: Build PTOAS
run: |
Expand All @@ -152,10 +157,12 @@ jobs:
-DMLIR_DIR=$LLVM_BUILD_DIR/lib/cmake/mlir \
-DPython3_ROOT_DIR=${PY_PATH} \
-DPython3_EXECUTABLE=$(which python) \
-DPython_EXECUTABLE=$(which python) \
-DPython3_FIND_STRATEGY=LOCATION \
-Dpybind11_DIR=$(python -m pybind11 --cmakedir) \
-Dnanobind_DIR=$(python -m nanobind --cmake_dir) \
-DMLIR_PYTHON_PACKAGE_DIR=${LLVM_BUILD_DIR}/tools/mlir/python_packages/mlir_core \
-DPTOAS_RELEASE_VERSION_OVERRIDE=${PTOAS_VERSION} \
-DPTOAS_ENABLE_WERROR=OFF \
-DCMAKE_INSTALL_PREFIX=${PTO_INSTALL_DIR} \
-DCMAKE_BUILD_TYPE=Release
ninja -C build
Expand Down
Loading
Loading