Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

#82: raea built natively for Windows on ARM in CI (windows-arm.yml on windows-11-arm: the release's four binaries, raea --version, a 2D still on WARP); rav1d's assembly off there, where MSVC skips its GNU .S files

shinyobjectzc41dd64516ce
diff --git a/.github/workflows/windows-arm.yml b/.github/workflows/windows-arm.yml
new file mode 100644
index 00000000..ed07f9b2
--- /dev/null
+++ b/.github/workflows/windows-arm.yml
@@ -0,0 +1,108 @@
+# raea built natively for Windows on ARM (#82: a Snapdragon X runs the x64 build under emulation, and asked for its
+# own). GitHub's windows-11-arm runner builds what release.yml's windows job builds, for aarch64-pc-windows-msvc, runs
+# `raea --version` and a 2D still on WARP (Windows' software DX12, an ARM64 build of it here), and keeps the binaries
+# as an artifact. It doesn't attach anything to a release; once it passes, release.yml takes the same steps.
+name: windows-arm
+
+on:
+ workflow_dispatch:
+ inputs:
+ ref:
+ description: "commit, branch or tag to build"
+ required: false
+ push:
+ branches: [windows-arm64]
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ runs-on: windows-11-arm
+ timeout-minutes: 350
+ defaults:
+ run:
+ shell: bash
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ inputs.ref || github.sha }}
+ submodules: true
+ lfs: false
+ - name: Toolchain (rust-toolchain.toml's pin)
+ run: |
+ if ! command -v rustup >/dev/null; then
+ curl -fsSL --retry 3 -o "$RUNNER_TEMP/rustup-init.exe" https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe
+ "$RUNNER_TEMP/rustup-init.exe" -y --default-toolchain none --profile minimal
+ echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH"
+ export PATH="$USERPROFILE/.cargo/bin:$PATH"
+ fi
+ rustup show active-toolchain || rustup toolchain install
+ rustc -vV
+ # ring builds its aarch64 assembly with clang (and only clang) on Windows
+ - name: clang (ring's assembly)
+ run: |
+ if ! command -v clang >/dev/null; then
+ for d in "/c/Program Files/LLVM/bin" "/c/Program Files/Microsoft Visual Studio"/*/*/VC/Tools/Llvm/ARM64/bin; do
+ [ -x "$d/clang.exe" ] && { echo "$d" >> "$GITHUB_PATH"; export PATH="$d:$PATH"; break; }
+ done
+ fi
+ command -v clang >/dev/null || { winget install -e --id LLVM.LLVM --accept-source-agreements --accept-package-agreements --silent; echo "/c/Program Files/LLVM/bin" >> "$GITHUB_PATH"; export PATH="/c/Program Files/LLVM/bin:$PATH"; }
+ clang --version
+ - name: jq that writes LF
+ run: |
+ mkdir -p "$RUNNER_TEMP/jq"
+ printf '#!/bin/bash\nexec "%s" -b "$@"\n' "$(command -v jq)" > "$RUNNER_TEMP/jq/jq"
+ chmod +x "$RUNNER_TEMP/jq/jq"
+ echo "$RUNNER_TEMP/jq" >> "$GITHUB_PATH"
+ - uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: 1.4.2
+ - name: The runtime's packages
+ run: for d in sdk/react/js sdk/react/tw; do (cd "$d" && bun install --frozen-lockfile); done
+ - name: Build
+ run: |
+ feat=$(bash tools/bevy-plugins.sh features sdk/raea/bench/bevy-plugins)
+ t() { s=$SECONDS; "$@"; echo "::notice::Windows ARM64 $(( (SECONDS - s) / 60 )) min: ${*:7}"; }
+ t cargo build --profile dist --locked -p raea-cli --bin raea --no-default-features --features "$feat"
+ t cargo build --profile dist --locked -p raea-rune-host
+ t cargo build --profile dist --locked -p raea-page-host --features window
+ t cargo build --profile dist --locked -p raea-perceive
+ - name: What raea.exe is and imports
+ run: |
+ file target/dist/raea.exe || true
+ dumpbin=$(ls "/c/Program Files/Microsoft Visual Studio"/*/*/VC/Tools/MSVC/*/bin/Hostarm64/arm64/dumpbin.exe 2>/dev/null | head -1)
+ [ -n "$dumpbin" ] && "$dumpbin" -nologo -headers -dependents target/dist/raea.exe | grep -iE 'machine|\.dll$' | sed 's/^ *//' | tee -a "$GITHUB_STEP_SUMMARY" || true
+ target/dist/raea.exe --version | tee -a "$GITHUB_STEP_SUMMARY"
+ # a 2D still on WARP: Vello's pages and the encoder's kernels, the parts #82's stripes were in
+ - name: A still on WARP
+ env:
+ WGPU_BACKEND: dx12
+ WGPU_ADAPTER_NAME: Microsoft Basic Render Driver
+ run: |
+ d="$RUNNER_TEMP/still"; mkdir -p "$d"
+ cat > "$d/still.tsx" <<'TSX'
+ import { AbsoluteFill } from "raea"
+ export default function Still() {
+ return (
+ <AbsoluteFill style={{ background: "#111", display: "flex", alignItems: "center", justifyContent: "center" }}>
+ <div style={{ color: "white", fontSize: 120, fontWeight: 700 }}>raea on ARM64</div>
+ </AbsoluteFill>
+ )
+ }
+ TSX
+ (cd "$d" && "$GITHUB_WORKSPACE/target/dist/raea.exe" render still.tsx -o still.png --frame 0 --w 1280 --h 720) 2>&1 | tail -20
+ ls -la "$d"/still.png
+ - uses: actions/upload-artifact@v4
+ if: always()
+ with:
+ name: windows-arm64-bins
+ path: |
+ target/dist/raea.exe
+ target/dist/raea_bundle.dll
+ target/dist/raea-rune-host.exe
+ target/dist/raea-page-host.exe
+ target/dist/raea-perceive.exe
+ ${{ runner.temp }}/still/still.png
+ retention-days: 7
+ if-no-files-found: ignore
diff --git a/io/av1/Cargo.toml b/io/av1/Cargo.toml
index 8fbd9281..bf00da85 100644
--- a/io/av1/Cargo.toml
+++ b/io/av1/Cargo.toml
@@ -11,5 +11,11 @@ raea-io-codec = { path = "../codec", features = ["mux"] }
raea-io-soft = { path = "../soft" }
muxide = "0.2"
# from the v1.1.0 tag: the crates.io package leaves out src/arm/asm-offsets.h, which its arm assembly includes
-rav1d = { git = "https://github.com/memorysafety/rav1d", tag = "v1.1.0" }
+rav1d = { git = "https://github.com/memorysafety/rav1d", tag = "v1.1.0", default-features = false, features = ["bitdepth_8", "bitdepth_16"] }
rav1e = { version = "0.8", default-features = false, features = ["threading"] }
+
+# rav1d's assembly everywhere but Windows on ARM (#82): there its arm64 .S files are GNU syntax, which MSVC's cl.exe
+# skips (the link then fails), and building them with clang-cl instead breaks metis-sys's GKlib headers. The Rust and
+# C paths decode the same frames, slower.
+[target.'cfg(not(all(windows, target_arch = "aarch64")))'.dependencies]
+rav1d = { git = "https://github.com/memorysafety/rav1d", tag = "v1.1.0", features = ["asm", "asm_arm64_dotprod", "asm_arm64_i8mm", "asm_arm64_sve2"] }