Files
leleka/.github/workflows/port.yml
T
Pavlo RatushnyiandClaude Sonnet 5.5 43c639fc7d ci: add Rust port workflow (fast path, Linux type-check, CPU oracles, optional Docker Linux harness)
Existing workflows are unchanged. The oracle and Docker jobs are optional
(continue-on-error) until they have run green on the hosted runner and
claude/port-linux-tests is merged. No model weights or tokens are used.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:41:19 +02:00

108 lines
5.4 KiB
YAML

name: Rust port
# Checks for the Rust port of the Original engine (docs/port-status.md). Everything here runs without a GPU, model
# weights or tokens. The existing "Linux" workflow is unchanged; the jobs below add the port-specific gates:
# port-fast fmt, Clippy and tests on the host-buildable crates (scripts/check-local.sh --fast)
# port-typecheck Linux-only crates (cuda-driver with the cuda-driver feature, leleka-runtime) type-checked, not run
# port-oracles CPU oracle differentials against the unmodified Python tools (needs pip and a pinned llama.cpp gguf-py)
# port-linux-tests Docker Linux harness (scripts/linux-tests/run.sh); optional until branch claude/port-linux-tests merges
# Type-checking is not execution: nothing here runs the Linux-gated tests or any GPU smoke.
on:
push:
branches: [main, 'claude/port-*']
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: never
RUST_BACKTRACE: '1'
jobs:
port-fast:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake python3
- name: Install pinned Rust
run: scripts/install-pinned-rustup.sh rustup toolchain install 1.99.0 --profile minimal --component rustfmt --component clippy
- name: Fast path (fmt, Clippy, tests on host-buildable crates)
# Known fmt/Clippy debt in leleka-model-format and the Linux-only crates is reported as warnings;
# set STRICT_DEBT=1 to make it fatal once the owners have cleaned it up.
run: scripts/check-local.sh --fast
port-typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake python3
- name: Install pinned Rust
run: scripts/install-pinned-rustup.sh rustup toolchain install 1.99.0 --profile minimal --component rustfmt --component clippy --target x86_64-unknown-linux-gnu
- name: Type-check the Linux-gated crates (no tests are run)
run: >-
cargo check --locked --target x86_64-unknown-linux-gnu --all-targets
-p leleka-cuda-driver --features cuda-driver -p leleka-runtime
- name: Format and Clippy debt report for the Linux-only crates (informational)
continue-on-error: true
run: |
cargo fmt -p leleka-cuda-driver -p leleka-runtime -p leleka-native-cpu-expert --check
cargo clippy --locked --target x86_64-unknown-linux-gnu --no-deps -p leleka-cuda-driver --features cuda-driver -p leleka-runtime --all-targets -- -D warnings
port-oracles:
# CPU oracle differentials: the Rust side against the UNMODIFIED Python tools (docs/offline-port.md) and the
# sampler host shim. Optional until it has run green on the hosted runner; the committed goldens are replayed by
# port-fast regardless.
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake git python3 python3-venv
- name: Install pinned Rust
run: scripts/install-pinned-rustup.sh rustup toolchain install 1.99.0 --profile minimal --component rustfmt --component clippy
- name: Oracle Python environment (no model data)
run: |
python3 -m venv "$RUNNER_TEMP/oracle-venv"
"$RUNNER_TEMP/oracle-venv/bin/pip" install --disable-pip-version-check numpy==2.5.4 PyYAML==6.0.3 tqdm==4.70.1 Jinja2==3.1.6 regex==2026.9.10
- name: Fetch the pinned llama.cpp gguf-py
run: |
commit="$(sed -n 's/^LLAMA_CPP_COMMIT = "\(.*\)"$/\1/p' engine/strata/setup.py)"
test -n "$commit"
git init -q "$RUNNER_TEMP/llama.cpp"
git -C "$RUNNER_TEMP/llama.cpp" fetch --depth 1 https://github.com/ggml-org/llama.cpp "$commit"
git -C "$RUNNER_TEMP/llama.cpp" checkout -q FETCH_HEAD
- name: Port oracles (sampler shim and live Python differentials)
env:
OFFLINE_ORACLE_PYTHON: ${{ runner.temp }}/oracle-venv/bin/python
STRATA_GGUF_PY: ${{ runner.temp }}/llama.cpp/gguf-py
SKIP_LINUX_TYPECHECK: '1'
run: scripts/check-local.sh --port
port-linux-tests:
# Docker Linux harness that runs the Linux-gated tests of leleka-cuda-driver and leleka-runtime (mock driver, no
# GPU). The script is created on branch claude/port-linux-tests; until it is merged this job reports "absent"
# and stays green. Optional: a failure does not block the other jobs.
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- id: present
run: |
if [ -x scripts/linux-tests/run.sh ]; then
echo 'present=true' >> "$GITHUB_OUTPUT"
else
echo 'present=false' >> "$GITHUB_OUTPUT"
echo 'scripts/linux-tests/run.sh is absent (branch claude/port-linux-tests is not merged); skipping'
fi
- name: Install Docker
if: steps.present.outputs.present == 'true'
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io
- name: Linux test harness
if: steps.present.outputs.present == 'true'
run: scripts/linux-tests/run.sh