Skip to content

feat(brand): interactive 3D logo on Pages + looping GIF in the README #44

feat(brand): interactive 3D logo on Pages + looping GIF in the README

feat(brand): interactive 3D logo on Pages + looping GIF in the README #44

Workflow file for this run

name: Zig Native Matrix (CI)
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
env:
ZIG_VERSION: "0.16.0"
jobs:
build:
name: Build & Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- name: Checkout Source (Recursive)
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Zig 0.16.0 (direct from ziglang.org)
run: |
set -eux
case "$(uname -s)" in
Linux) ZIG_OS="linux" ;;
Darwin) ZIG_OS="macos" ;;
esac
case "$(uname -m)" in
x86_64|amd64) ZIG_ARCH="x86_64" ;;
aarch64|arm64) ZIG_ARCH="aarch64" ;;
esac
URL="https://ziglang.org/download/${ZIG_VERSION}/zig-${ZIG_ARCH}-${ZIG_OS}-${ZIG_VERSION}.tar.xz"
echo "Downloading $URL"
curl -fsSL "$URL" -o /tmp/zig.tar.xz
sudo mkdir -p /opt/zig
sudo tar -xJf /tmp/zig.tar.xz -C /opt/zig --strip-components=1
sudo ln -sf /opt/zig/zig /usr/local/bin/zig
zig version
- name: Install Dependencies (macOS)
if: runner.os == 'macOS'
run: brew install cmake
- name: Install Dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential clang libc++-dev libc++abi-dev
- name: Resolve llama.cpp submodule SHA (cache key)
id: llama_sha
run: |
SHA=$(git -C lib/llama.cpp rev-parse HEAD)
echo "sha=$SHA" >> "$GITHUB_OUTPUT"
echo "llama.cpp @ $SHA"
- name: Cache llama.cpp build output
id: cache_llama
uses: actions/cache@v4
with:
path: lib/llama.cpp/build
# -nonative-v3: the previous caches were built with GGML_NATIVE=ON
# (-march=native), so they carry the CPU features of whichever runner
# happened to build them. Restoring one onto a runner with a narrower
# feature set made the first ggml kernel — i.e. the first embed, during
# `mine` — die with SIGILL (exit 132). The key MUST change, or the
# poisoned archives are simply restored again and the flag below is moot.
key: llama-cpp-${{ runner.os }}-${{ runner.arch }}-${{ steps.llama_sha.outputs.sha }}-libcxx-nonative-v3
- name: Download Neural Matrix (GGUF)
run: |
mkdir -p lib
# MiniLM-L6-v2, 384-dim — must match EMBEDDING_DIM and the float[384] schema.
curl -L -o lib/minilm.gguf "https://huggingface.co/leliuga/all-MiniLM-L6-v2-GGUF/resolve/main/all-MiniLM-L6-v2.F16.gguf"
- name: Build llama.cpp Static Libraries
if: steps.cache_llama.outputs.cache-hit != 'true'
run: |
# GGML_NATIVE=OFF on BOTH arms. ggml defaults it ON, which compiles with
# the *build* runner's CPU features (-march=native). These archives are
# then cached and restored onto a DIFFERENT runner — GitHub's pool is
# heterogeneous — and the first ggml kernel executed hits an instruction
# the host doesn't have: SIGILL, exit 132. It surfaces in `memxt mine`
# (the first real embed); `init`/`stats` pass because they never touch
# the model. Build a portable baseline instead; CI perf is irrelevant.
if [ "${{ runner.os }}" = "macOS" ]; then
cmake -S lib/llama.cpp -B lib/llama.cpp/build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DGGML_NATIVE=OFF \
-DGGML_METAL=ON \
-DGGML_BLAS=ON \
-DLLAMA_BUILD_TESTS=OFF \
-DLLAMA_BUILD_EXAMPLES=OFF \
-DLLAMA_BUILD_SERVER=OFF \
-DLLAMA_BUILD_TOOLS=OFF
else
# Force clang + libc++ so the ABI matches Zig's bundled libc++.
CC=clang CXX=clang++ \
cmake -S lib/llama.cpp -B lib/llama.cpp/build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++" \
-DGGML_NATIVE=OFF \
-DGGML_METAL=OFF \
-DGGML_BLAS=OFF \
-DLLAMA_BUILD_TESTS=OFF \
-DLLAMA_BUILD_EXAMPLES=OFF \
-DLLAMA_BUILD_SERVER=OFF
fi
cmake --build lib/llama.cpp/build -j
- name: Verify llama.cpp static libraries were built
run: |
echo "--- .a files under lib/llama.cpp/build ---"
find lib/llama.cpp/build -name '*.a' -print
# Fail fast if the core libs we link against aren't present.
for lib in libllama.a libggml.a libggml-base.a libggml-cpu.a; do
if ! find lib/llama.cpp/build -name "$lib" -print -quit | grep -q .; then
echo "ERROR: $lib not found under lib/llama.cpp/build" >&2
exit 1
fi
done
- name: Compile Native Vector Pipelines (ReleaseFast)
run: zig build --release=fast
- name: Execute CLI Validation (incl. real embeddings)
run: |
set -eux
./zig-out/bin/memxt init
./zig-out/bin/memxt stats
printf 'The deploy key id is QUASAR-77 and must never be logged.\n' > smoke.txt
./zig-out/bin/memxt mine smoke.txt smoke
./zig-out/bin/memxt search "what is the deploy key" --wing smoke 2>&1 | tee /tmp/memxt-search.out
grep -q QUASAR-77 /tmp/memxt-search.out
- name: Integration tests (mine / ranking / MCP / hooks / schema)
run: bash scripts/integration-test.sh ./zig-out/bin/memxt