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.

The Linux and Windows releases ship raea song: raea-perceive and the Beat This! model are packed on every platform since #43, release-check maps a 12 s 120 BPM drum loop with the unpacked raea, and the Windows job plays bevy-ts's play cases live after its pack and check (ImageMagick for check.sh's pixel reads)

shinyobjectzc94e26cc2a5e
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 14e40224..a56ab914 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -42,9 +42,10 @@ jobs:
- os: macos-15
lib: libraea_bundle.dylib
extra: raea-perceive
+ # raea-perceive (`raea song`'s map) builds off Apple since #43
- os: ubuntu-24.04
lib: libraea_bundle.so
- extra: ""
+ extra: raea-perceive
runs-on: ${{ matrix.os }}
# a cold thin-LTO build of raea-cli with the plugin catalog is the long part; GitHub's own limit is 6 hours
timeout-minutes: 340
@@ -140,20 +141,30 @@ jobs:
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
+ # `raea song`'s beat model, which release.sh packs (into Git bash's ~/.local/share/raea-models, as on the others)
+ - name: Models (pinned by URL and sha256 in tools/release/models.tsv)
+ run: |
+ while IFS=$'\t' read -r path url sha; do
+ case $path in ''|'#'*) continue ;; esac
+ mkdir -p "$HOME/.local/share/raea-models/$(dirname "$path")"
+ curl -fsSL "$url" -o "$HOME/.local/share/raea-models/$path"
+ echo "$sha $HOME/.local/share/raea-models/$path" | sha256sum -c -
+ done < <(tr -d '\r' < tools/release/models.tsv)
# the app targets' hosts a cargo call each: with raea-cli's crates in one call taffy's features unify and
- # rune-taffy doesn't build
+ # rune-taffy doesn't build; raea-perceive (`raea song`'s map, #43) a call of its own too
- name: Build
run: |
feat=$(bash tools/bevy-plugins.sh features sdk/raea/bench/bevy-plugins)
cargo build --profile dist --locked -p raea-cli --bin raea --no-default-features --features "$feat"
cargo build --profile dist --locked -p raea-rune-host
cargo build --profile dist --locked -p raea-page-host --features window
+ cargo build --profile dist --locked -p raea-perceive
# which DLLs raea needs from the machine (the CRT's come from the VC++ redistributable)
- name: What raea.exe imports
run: |
- { echo '### what raea.exe and raea_bundle.dll import'; echo '```'
+ { echo '### what raea.exe, raea_bundle.dll and raea-perceive.exe import'; echo '```'
dumpbin=$(ls "/c/Program Files/Microsoft Visual Studio"/*/*/VC/Tools/MSVC/*/bin/HostX64/x64/dumpbin.exe | head -1)
- "$dumpbin" -nologo -dependents target/dist/raea.exe target/dist/raea_bundle.dll | grep -iE '\.dll$|Dump of' | sed 's/^ *//'
+ "$dumpbin" -nologo -dependents target/dist/raea.exe target/dist/raea_bundle.dll target/dist/raea-perceive.exe | grep -iE '\.dll$|Dump of' | sed 's/^ *//'
echo '```'; } | tee -a "$GITHUB_STEP_SUMMARY" || true
# release.sh's checks render on Mesa's lavapipe (software Vulkan, MIT; on the runner only, never in the zip): the
# runner has no GPU, and WARP, Windows' own software DX12, crashes compiling one of Bevy's compute shaders there
@@ -166,6 +177,19 @@ jobs:
env:
RAEA_CHECK_DIR: ${{ runner.temp }}/release-check
run: bash tools/release.sh "${TAG#v}" target/dist HEAD
+ # live play on Windows (PT20 left it unproven): bevy-ts's play cases, `play --offscreen` with an input script and
+ # a snapshot's pixels probed, run by the raea just built; check.sh reads the pixels with ImageMagick, which the
+ # image has only sometimes, and choco's PATH change doesn't reach the next step, so its folder goes on GITHUB_PATH
+ - name: ImageMagick (check.sh reads a snapshot's pixels)
+ shell: pwsh
+ run: |
+ if (-not (Get-Command magick -ErrorAction SilentlyContinue)) { choco install imagemagick -y --no-progress | Out-Null }
+ $im = Get-ChildItem "C:\Program Files" -Directory -Filter "ImageMagick-*" | Select-Object -First 1
+ if ($im) { Add-Content $env:GITHUB_PATH $im.FullName }
+ - name: Live play (bevy-ts's play cases)
+ run: |
+ b="$PWD/target/dist/raea.exe"
+ RAEA_BIN="$b" RAEA_PLUGIN_BIN="$b" bash sdk/raea/bench/bevy-ts/check.sh $(grep -l '^// play:' sdk/raea/bench/bevy-ts/cases/*.tsx) | tee -a "$GITHUB_STEP_SUMMARY"
- uses: actions/attest-build-provenance@v2
with:
subject-path: dist/raea-*.zip
diff --git a/tools/release-check.sh b/tools/release-check.sh
index 7b3c3eda..8a5ba72d 100644
--- a/tools/release-check.sh
+++ b/tools/release-check.sh
@@ -2,8 +2,9 @@
# The check every release archive passes (tools/release.sh runs it on the archive it just made; release.yml's
# windows-verify job runs it again on a fresh Windows runner, from the archive alone): unpacked into a fresh folder,
# with RAEA_NO_TREE=1 so it can't be reading a checkout, its raea renders a frame, has the plugin catalog, prints a
-# craft guide and writes styles.gen.ts; its binaries name none of raea's API, nothing in it looks like a key, and a
-# Windows archive holds no Microsoft file (the CRT comes from the VC++ redistributable; docs/handoff/ports.md).
+# craft guide, writes styles.gen.ts and maps a song; its binaries name none of raea's API, nothing in it looks like a
+# key, and a Windows archive holds no Microsoft file (the CRT comes from the VC++ redistributable;
+# docs/handoff/ports.md).
#
# tools/release-check.sh ARCHIVE raea-VERSION-PLATFORM.tar.gz or .zip
set -eu
@@ -87,6 +88,23 @@ for t in web native; do
done
grep -q "unsigned" "$check/app/native.log" || { tail -5 "$check/app/native.log" >&2; fail "the native film's report doesn't say it's unsigned"; }
! grep -qa c2pa "$check/app/native.mp4" || fail "the public engine's native film carries Content Credentials"
+# raea song on every platform (#43): the raea-perceive beside raea maps a 12 s drum loop at 120 BPM (perl writes it:
+# every runner has perl, Git's bash too) with the beat model the release ships, copied into a models folder of the
+# check's own (HOME, and LOCALAPPDATA on Windows)
+mkdir -p "$check/song/home"
+perl - "$check/song/loop.wav" <<'PL'
+my ($out) = @ARGV; my $sr = 22050; my $n = 12 * $sr; my @s; srand(1);
+for my $i (0 .. $n - 1) {
+ my $b = 2 * $i / $sr; my $ph = ($b - int($b)) / 2; my $h = 2 * $b; my $hp = ($h - int($h)) / 4;
+ my $kick = sin(2 * 3.14159265 * (50 + 100 * exp(-$ph * 40)) * $ph) * exp(-$ph * 12) * (int($b) % 4 == 0 ? 0.9 : 0.6);
+ push @s, int(32767 * 0.8 * ($kick + (rand() * 2 - 1) * exp(-$hp * 120) * 0.15));
+}
+open my $f, '>:raw', $out or die "$out: $!";
+print $f 'RIFF', pack('V', 36 + 2 * $n), 'WAVEfmt ', pack('VvvVVvv', 16, 1, 1, $sr, 2 * $sr, 2, 16), 'data', pack('V', 2 * $n), pack('s<*', @s);
+PL
+(cd "$check/song" && HOME="$check/song/home" LOCALAPPDATA="$check/song/home" RAEA_NO_TREE=1 "$raea" song loop.wav > song.log 2>&1) || { tail -20 "$check/song/song.log" >&2; fail "the unpacked raea didn't map a song"; }
+tempo=$(jq -r '.tempo' "$check/song/loop.song.json" | tr -d '\r')
+awk -v t="$tempo" 'BEGIN { exit !(t >= 118 && t <= 122) }' || fail "raea song read the 120 BPM loop as $tempo BPM"
# engine only: no raea API in the binaries, nothing key-shaped anywhere
api=$(cat "$check"/raea/bin/* | grep -aoE '(api|sign)\.raea\.io|RAEA_(SIGN|GEN)_TOKEN' | sort -u | tr '\n' ' ' || true)
[ -z "$api" ] || fail "the binaries name raea's API ($api): build raea-cli with --no-default-features"
diff --git a/tools/release.sh b/tools/release.sh
index 1ea57ca4..aa0f596c 100755
--- a/tools/release.sh
+++ b/tools/release.sh
@@ -7,9 +7,9 @@
# the runtime's packages (sdk/react/js/node_modules, installed, not committed) come from this checkout.
#
# tools/release.sh VERSION BIN_DIR [REF] BIN_DIR holds a release build's raea and its bundler
-# (libraea_bundle.dylib, .so, or raea.exe and raea_bundle.dll), and on
-# macOS raea-perceive (`raea song` runs it; it isn't ported, so Linux's
-# and Windows's archives have no `raea song`), and the app targets' two
+# (libraea_bundle.dylib, .so, or raea.exe and raea_bundle.dll),
+# raea-perceive (`raea song` runs it; off Apple since #43), and the app
+# targets' two
# hosts (docs/targets.feature T1f): raea-rune-host (native) and
# raea-page-host's window build (web), each built in a cargo call of its
# own, as they ship: `cargo build --profile dist -p raea-rune-host` and
@@ -93,23 +93,21 @@ since=${RAEA_SINCE:-$(git describe --tags --abbrev=0 --match 'v*' "$ref" 2>/dev/
} > "$out/raea-$version-skills.md"
case $platform in
linux-x86_64)
- cp "$bin/raea" "$bin/libraea_bundle.so" "$bin/raea-rune-host" "$bin/raea-page-host" "$stage/bin/"
+ cp "$bin/raea" "$bin/libraea_bundle.so" "$bin/raea-perceive" "$bin/raea-rune-host" "$bin/raea-page-host" "$stage/bin/"
# what a Linux machine needs beside it: the bundled Noto Sans JP is a Latin subset, so kanji and kana come from the
# system, as on a Mac (raea warns once a character when no font has it)
printf '%s\n' "raea $version for Linux x86_64 (glibc 2.39 or newer, Vulkan: a GPU driver or Mesa's llvmpipe).
Install a CJK font for Japanese, Chinese and Korean text (Debian and Ubuntu: apt install fonts-noto-cjk).
An app's window, on either target (raea app run, raea-rune-host and raea-page-host), needs a display (X11 or
Wayland; Xvfb on a server, as raea app check does there too), libxkbcommon-x11, the X client libraries and the Vulkan
-loader (Debian and Ubuntu: apt install libxkbcommon-x11-0 libxcursor1 libxi6 libxrandr2 libx11-xcb1 libvulkan1).
-Not in this build: raea song (its beat model's runner is macOS only so far)." > "$stage/README" ;;
+loader (Debian and Ubuntu: apt install libxkbcommon-x11-0 libxcursor1 libxi6 libxrandr2 libx11-xcb1 libvulkan1)." > "$stage/README" ;;
windows-x86_64)
- cp "$bin/raea.exe" "$bin/raea_bundle.dll" "$bin/raea-rune-host.exe" "$bin/raea-page-host.exe" "$stage/bin/"
+ cp "$bin/raea.exe" "$bin/raea_bundle.dll" "$bin/raea-perceive.exe" "$bin/raea-rune-host.exe" "$bin/raea-page-host.exe" "$stage/bin/"
# the C runtime isn't in the zip (ort's ONNX Runtime needs its DLLs, and they're Microsoft's to ship): the VC++
# redistributable, which most Windows machines already have, provides it
printf '%s\r\n' "raea $version for Windows x86_64 (Windows 10 or 11, a DirectX 12 or Vulkan GPU driver; with no GPU, Mesa's lavapipe and WGPU_BACKEND=vulkan)." \
"It needs the Microsoft Visual C++ Redistributable (x64), which most machines already have:" \
- "https://aka.ms/vs/17/release/vc_redist.x64.exe" \
- "Not in this build: raea song (its beat model's runner is macOS only so far)." > "$stage/README.txt" ;;
+ "https://aka.ms/vs/17/release/vc_redist.x64.exe" > "$stage/README.txt" ;;
*) cp "$bin/raea" "$bin/libraea_bundle.dylib" "$bin/raea-perceive" "$bin/raea-rune-host" "$bin/raea-page-host" "$stage/bin/" ;;
esac
# the packages sdk/tsconfig.base.json lists (@raea/<name>: its sources and package.json), which the bundlers resolve by it
@@ -132,11 +130,10 @@ git archive "$ref" sdk/tsconfig.base.json sdk/ui/src sdk/ui/package.json sdk/ui/
copy() { mkdir -p "$2" && tar -C "$(dirname "$1")" --exclude .cache -cf - "$(basename "$1")" | tar -C "$2" -xf -; }
# styles.gen's Tailwind (raea compiles it on JavaScriptCore: runtime/bundle/src/styles.rs), as installed here
copy sdk/react/tw/node_modules/tailwindcss "$stage/share/raea/sdk/react/tw/node_modules"
-# `raea song`'s beat model (Beat This! small0, MIT), copied into ~/.local/share/raea-models on first use
-if [ $platform = macos-arm64 ]; then
- mkdir -p "$stage/share/raea/models/beat-this"
- cp ~/.local/share/raea-models/beat-this/beat_this_small0.onnx "$stage/share/raea/models/beat-this/"
-fi
+# `raea song`'s beat model (Beat This! small0, MIT), copied on first use where raea-perceive reads it
+# (raea_io_home::models: ~/.local/share/raea-models, %LOCALAPPDATA%\raea\models on Windows); every platform since #43
+mkdir -p "$stage/share/raea/models/beat-this"
+cp ~/.local/share/raea-models/beat-this/beat_this_small0.onnx "$stage/share/raea/models/beat-this/"
# the agent skills (sdk/skills: raea, raea-bevy), which the installer copies into ~/.claude/skills; raea-bevy's topic files
# are links to the craft guides, so they go as the files they point to
skills=$(mktemp -d)