Skip to content

fix(llvm): a void callee with a bound result is not a disagreement #107

fix(llvm): a void callee with a bound result is not a disagreement

fix(llvm): a void callee with a bound result is not a disagreement #107

Workflow file for this run

name: Publish Wiki & Deploy Site
on:
push:
branches:
- main
paths:
- 'book/**'
- 'website/**'
- 'crates/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.env.markflow'
- '.github/workflows/wiki.yml'
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
publish-wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare wiki content
run: |
mkdir -p wiki
# Copy book files to wiki directory
cp book/README.md wiki/Home.md
cp book/01-introduction.md wiki/01-Introduction.md
cp book/02-getting-started.md wiki/02-Getting-Started.md
cp book/03-using-the-cli.md wiki/03-Using-the-CLI.md
cp book/04-grammar-syntax.md wiki/04-Grammar-Syntax.md
cp book/05-semantic-actions.md wiki/05-Semantic-Actions.md
cp book/06-typed-ast.md wiki/06-The-TypedAST.md
cp book/07-typed-ast-builder.md wiki/07-TypedAST-Builder.md
cp book/08-zig-example.md wiki/08-Zig-Example.md
cp book/09-reference.md wiki/09-Reference.md
cp book/10-packaging-distribution.md wiki/10-Packaging-Distribution.md
cp book/11-hir-builder.md wiki/11-HIR-Builder.md
cp book/12-embedding-sdk.md wiki/12-Embedding-SDK.md
cp book/13-async-runtime.md wiki/13-Async-Runtime.md
cp book/14-runtime-plugins.md wiki/14-Runtime-Plugins.md
cp book/15-building-dsls.md wiki/15-Building-DSLs.md
cp book/16-image-pipeline-dsl.md wiki/16-Image-Pipeline-DSL.md
# Fix internal links for wiki format
sed -i 's|\./01-introduction\.md|01-Introduction|g' wiki/*.md
sed -i 's|\./02-getting-started\.md|02-Getting-Started|g' wiki/*.md
sed -i 's|\./03-using-the-cli\.md|03-Using-the-CLI|g' wiki/*.md
sed -i 's|\./04-grammar-syntax\.md|04-Grammar-Syntax|g' wiki/*.md
sed -i 's|\./05-semantic-actions\.md|05-Semantic-Actions|g' wiki/*.md
sed -i 's|\./06-typed-ast\.md|06-The-TypedAST|g' wiki/*.md
sed -i 's|\./07-typed-ast-builder\.md|07-TypedAST-Builder|g' wiki/*.md
sed -i 's|\./08-zig-example\.md|08-Zig-Example|g' wiki/*.md
sed -i 's|\./09-reference\.md|09-Reference|g' wiki/*.md
sed -i 's|\./10-packaging-distribution\.md|10-Packaging-Distribution|g' wiki/*.md
sed -i 's|\./11-hir-builder\.md|11-HIR-Builder|g' wiki/*.md
sed -i 's|\./12-embedding-sdk\.md|12-Embedding-SDK|g' wiki/*.md
sed -i 's|\./13-async-runtime\.md|13-Async-Runtime|g' wiki/*.md
sed -i 's|\./14-runtime-plugins\.md|14-Runtime-Plugins|g' wiki/*.md
sed -i 's|\./15-building-dsls\.md|15-Building-DSLs|g' wiki/*.md
sed -i 's|\./16-image-pipeline-dsl\.md|16-Image-Pipeline-DSL|g' wiki/*.md
- name: Upload wiki
uses: Andrew-Chen-Wang/github-wiki-action@v4
with:
path: wiki/
token: ${{ secrets.GITHUB_TOKEN }}
benchmark:
name: bench (${{ matrix.kernel }} · ${{ matrix.os }})
runs-on: ${{ matrix.os }}
# Matrix-per-kernel mirrors rayzor's CI shape: each kernel gets a
# fresh GHA runner so cumulative thermal/cache throttling from
# heavy earlier kernels (mandelbrot, nbody) doesn't bleed into the
# later light ones. `fail-fast: false` keeps one bad kernel from
# cancelling the rest of the sweep.
strategy:
fail-fast: false
matrix:
# Both architectures are published. The x86_64 runner is the
# baseline; the Apple one is not a duplicate of it, because
# Accelerate reaches the AMX coprocessor that no instruction
# the compiler emits can address, and the ML rows are the ones
# that shows in. Publishing both is what lets a reader see the
# size of that gap rather than take a claim about it.
os:
- ubuntu-latest
- macos-latest
kernel:
- mandelbrot
- nbody
- nbody_ref
- fib
# Same source as `fib` with cross-branch pure-call PRE off.
# The pair is what makes the pass's contribution a published
# number rather than a claim.
- fib_no_pure_call_pre
- inlined_call
- free_function_call
# The allocator row. Nothing else in the suite allocates per
# iteration, so without it no published number covers what
# malloc and free cost.
- binary_trees
# Tensor kernels at real shapes: each isolates one shape the
# vectorizer either matches or declines.
- tensor_add
- tensor_axpy
- tensor_dot
- tensor_matmul
# The two halves of serving a model. Prefill is dense matrix
# multiply and compute bound; decode is one token at a time
# and bound by weight bandwidth. Publishing both is what makes
# the difference between them a number rather than a claim.
- llm_prefill
- llm_decode
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo artifacts
uses: Swatinem/rust-cache@v2
with:
key: bench-runner-${{ matrix.os }}
- name: Install LLVM 21 (Linux)
if: runner.os == 'Linux'
run: |
wget -qO llvm.sh https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21 all
echo "LLVM_SYS_211_PREFIX=/usr/lib/llvm-21" >> "$GITHUB_ENV"
- name: Install LLVM 21 (macOS)
if: runner.os == 'macOS'
run: |
brew install llvm@21
echo "LLVM_SYS_211_PREFIX=$(brew --prefix llvm@21)" >> "$GITHUB_ENV"
# Accelerate ships with macOS, so there is nothing to install for
# it; this records that it is present and reachable, because a
# published row that claims to use it should fail loudly rather
# than quietly fall back to the portable path.
- name: Confirm Accelerate is present (macOS)
if: runner.os == 'macOS'
run: |
test -d /System/Library/Frameworks/Accelerate.framework
echo "Accelerate.framework found"
- name: Run benchmark (${{ matrix.kernel }})
env:
RUST_MIN_STACK: 134217728
# Median-of-9 + per-kernel runner = honest x86_64 numbers.
# 9 samples dampens GHA shared-tenant noise (variable CPU
# clock, neighbour load, thermal throttling) meaningfully
# below the typical 10-20% single-run drift; per-kernel
# matrix means the extra runs don't serialize with the rest
# of the sweep. `--filter` runs only this matrix entry's
# kernel; the JSON naturally ends up with just that kernel's
# data plus meta. `--features llvm-backend` exercises the
# full tier-up ladder so the `zyntax-tiered-llvm` column
# reflects honest LLVM-tier numbers. `--no-cache` compiles
# every user kernel from source while the fixed grammar and
# stdlib enter through the build-time artifacts used by
# production ZynML. The runner restores `target/` between
# runs, including the HIR snapshot cache, so a published
# number measures the compiler in the tree rather than an
# old per-kernel snapshot.
run: |
mkdir -p bench-out
cargo run --release --package zynml --example bench_runner --features llvm-backend -- \
--out bench-out/results-${{ matrix.kernel }}.json \
--filter ${{ matrix.kernel }} \
--runs 9 \
--no-cache
- name: Upload partial benchmark result
uses: actions/upload-artifact@v4
with:
# The architecture is in the name because both are published
# and a shared name would let one quietly replace the other.
name: bench-${{ matrix.os }}-${{ matrix.kernel }}
path: bench-out/results-${{ matrix.kernel }}.json
retention-days: 90
benchmark-aggregate:
name: Aggregate benchmark results
needs: benchmark
# `needs` alone would skip this whenever any matrix leg failed, and a
# skipped aggregate skips the deploy, so one crashing kernel takes the
# whole published page down with it rather than just its own row. Run
# on the legs that did produce results; a kernel that failed simply has
# no partial to merge and does not appear.
if: ${{ always() && needs.benchmark.result != 'cancelled' }}
runs-on: ubuntu-latest
steps:
- name: Download x86_64 per-kernel results
uses: actions/download-artifact@v4
with:
pattern: bench-ubuntu-latest-*
path: bench-parts
merge-multiple: true
- name: Download Apple per-kernel results
uses: actions/download-artifact@v4
with:
pattern: bench-macos-latest-*
path: bench-parts-macos
merge-multiple: true
- name: Merge per-architecture results
# jq deep-merge across all per-kernel partials. Each partial
# already carries the same `meta` block (same commit/date/os/
# arch), so the merge keeps whichever lands last — harmless.
# Per-kernel objects accumulate under their kernel name; the
# final results.json has the shape the static page expects.
#
# The two architectures stay in separate files. Every kernel key
# is the same on both, so merging them into one table would let
# whichever ran last overwrite the other's numbers rather than
# report both. The page loads each file and labels the switch
# from its own `meta.cpu`.
run: |
mkdir -p bench-out
ls -la bench-parts/ || true
if compgen -G 'bench-parts/*.json' > /dev/null; then
jq -s 'reduce .[] as $x ({}; . * $x)' bench-parts/*.json > bench-out/results.json
cat bench-out/results.json | jq 'keys'
else
echo "::error::no x86_64 partials produced; nothing to publish"
exit 1
fi
# macOS runners are best-effort: a failed or skipped leg leaves
# no partials, and the page renders the x86_64 set alone.
if compgen -G 'bench-parts-macos/*.json' > /dev/null; then
jq -s 'reduce .[] as $x ({}; . * $x)' bench-parts-macos/*.json > bench-out/results-macos.json
cat bench-out/results-macos.json | jq 'keys'
else
echo "no macOS partials; publishing x86_64 only"
fi
- name: Upload merged benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: bench-out/
retention-days: 90
deploy-site:
needs: benchmark-aggregate
if: ${{ always() && needs.benchmark-aggregate.result == 'success' }}
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download benchmark results
uses: actions/download-artifact@v4
with:
name: benchmark-results
path: bench-out
- name: Install Markflow
run: curl -sL https://raw.githubusercontent.com/darmie/markflow/main/install.sh | bash
- name: Build site
run: |
export PATH="$HOME/.markflow:$PATH"
mkdir -p site
# Copy website landing page and assets to site root
cp website/index.html site/index.html
cp website/og-image.png site/og-image.png
cp website/favicon.ico site/favicon.ico
cp website/favicon.svg site/favicon.svg
cp website/apple-touch-icon.png site/apple-touch-icon.png
cp website/icon-192x192.png site/icon-192x192.png
cp website/site.webmanifest site/site.webmanifest
touch site/.nojekyll
echo "zyntax.org" > site/CNAME
# Build book docs with Markflow into /book subdirectory
markflow build --prebake --source ./book --output ./site/book --config .env.markflow
# Publish benchmark page + CI-produced results.json
mkdir -p site/benchmark
cp website/benchmark/index.html site/benchmark/index.html
cp bench-out/results.json site/benchmark/results.json
if [ -f bench-out/results-macos.json ]; then
cp bench-out/results-macos.json site/benchmark/results-macos.json
fi
# Verify book output exists
ls -la site/book/
ls -la site/benchmark/
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4