tester READMEs: templates with checksums computed from the files, make-tester-readme.sh (+ --verify), test

This commit is contained in:
Niko1221 committed 2026-10-18 01:24:05 +02:00
1 parent e1168345f1
commit a0469e9455
4 files changed
+324

No files matched your search

@@ -0,0 +1,75 @@
#!/usr/bin/env bash
# Write a tester's README with the checksums and sizes of the files it names, computed from the files themselves.
#
# apps/desktop/scripts/make-tester-readme.sh <template> <out.txt> --appimage <file name> --files-dir <dir> [--files-dir <dir> ...]
#
# Why: a README that carries a hand-pasted sha256 goes stale the moment the file is rebuilt (the Ubuntu 26.04 tester compared the file
# with the old build's hash). The template holds placeholders instead, and this script fills them from the real files:
# @APPIMAGE@ the AppImage's file name
# @SHA256:<name>@ sha256 of the file <name> found in one of the --files-dir folders
# @SIZE_GB:<name>@ its size in GB with one decimal
# @INCLUDE:<file>@ (alone on a line) the contents of <file> from the template's folder, with the same placeholders
# It refuses to write the README when a named file is missing or a placeholder is left over, so a stale or empty hash cannot ship.
# The same check is done by `--verify <readme> --files-dir <dir>`: every "<64 hex> <name>" or "sha256 <64 hex>" pair that names a file
# present in the folders must match that file.
set -euo pipefail
usage() { echo "usage: $0 <template> <out.txt> --appimage <name> --files-dir <dir> [--files-dir <dir> ...]" >&2; echo " $0 --verify <readme> --files-dir <dir> [...]" >&2; exit 2; }
VERIFY=""; TEMPLATE=""; OUT=""; APPIMAGE=""; DIRS=()
if [ "${1:-}" = "--verify" ]; then VERIFY="${2:?readme}"; shift 2; else TEMPLATE="${1:?template}"; OUT="${2:?out}"; shift 2 || usage; fi
while [ $# -gt 0 ]; do
case "$1" in
--appimage) APPIMAGE="$2"; shift 2 ;;
--files-dir) DIRS+=("$2"); shift 2 ;;
*) usage ;;
esac
done
[ ${#DIRS[@]} -gt 0 ] || usage
find_file() { local d; for d in "${DIRS[@]}"; do [ -f "$d/$1" ] && { echo "$d/$1"; return 0; }; done; return 1; }
sha_of() { sha256sum "$1" | awk '{print $1}'; }
size_gb() { awk -v b="$(stat -c %s "$1" 2>/dev/null || stat -f %z "$1")" 'BEGIN{printf "%.1f", b/1000000000}'; }
if [ -n "$VERIFY" ]; then
bad=0; seen=0
while IFS= read -r line; do
# "<hash> <name>" or "<name> <hash>" or "sha256 <hash>"
hash="$(grep -Eo '[0-9a-f]{64}' <<<"$line" | head -1 || true)"
[ -n "$hash" ] || continue
name="$(sed -E 's/[0-9a-f]{64}//; s/^[[:space:]]*(sha256|Checks:)?[[:space:]]*//; s/[[:space:]]*$//' <<<"$line")"
f="$(find_file "$name" 2>/dev/null || true)"
[ -n "$f" ] || continue
seen=$((seen + 1))
if [ "$(sha_of "$f")" != "$hash" ]; then echo "STALE: $name is $(sha_of "$f"), the README says $hash" >&2; bad=$((bad + 1)); fi
done < "$VERIFY"
echo "$seen checksum line(s) checked, $bad stale"
[ "$bad" = 0 ] && [ "$seen" -gt 0 ]
exit
fi
[ -n "$APPIMAGE" ] || usage
TDIR="$(cd "$(dirname "$TEMPLATE")" && pwd)"
TMP="$(mktemp)"; trap 'rm -f "$TMP" "$TMP.2"' EXIT
# includes first (one level), then the placeholders
while IFS= read -r line || [ -n "$line" ]; do
if [[ "$line" =~ ^@INCLUDE:([^@]+)@$ ]]; then cat "$TDIR/${BASH_REMATCH[1]}"; else printf '%s\n' "$line"; fi
done < "$TEMPLATE" | sed "s|@APPIMAGE@|$APPIMAGE|g" > "$TMP"
# @SHA256:name@ and @SIZE_GB:name@
while IFS= read -r token; do
kind="${token#@}"; kind="${kind%%:*}"; name="${token#@*:}"; name="${name%@}"
f="$(find_file "$name")" || { echo "make-tester-readme: no file named $name in: ${DIRS[*]} (a README must not carry a hash it did not compute)" >&2; exit 1; }
case "$kind" in
SHA256) value="$(sha_of "$f")" ;;
SIZE_GB) value="$(size_gb "$f")" ;;
*) echo "make-tester-readme: unknown placeholder $token" >&2; exit 1 ;;
esac
# replace every occurrence of this exact token (the token contains no sed-special characters except . and -)
esc="$(printf '%s' "$token" | sed 's/[.[\*^$/]/\&/g')"
sed "s/$esc/$value/g" "$TMP" > "$TMP.2" && mv "$TMP.2" "$TMP"
done < <(grep -Eo '@(SHA256|SIZE_GB):[^@ ]+@' "$TMP" | sort -u)
if grep -Eq '@[A-Z0-9_]+[:@]' "$TMP"; then echo "make-tester-readme: placeholders left over:" >&2; grep -En '@[A-Z0-9_]+[:@]' "$TMP" >&2; exit 1; fi
cp "$TMP" "$OUT"
echo "wrote $OUT"
@@ -0,0 +1,92 @@
STRATA FOR LINUX - TESTER BUILD FOR AMD RX 7000 (RDNA3) CARDS (RX 7900 XTX)
=====================================================================
This is a private test version of Strata for Linux with an AMD graphics card. Please keep it to yourself: it is not a public release.
THIS BUILD IS FOR AMD RX 7000 (RDNA3) CARDS ONLY (RX 7900 XTX, RX 7900 XT, RX 7800 XT, RX 7700 XT, RX 7600; gfx1100 / gfx1101 / gfx1102). If your card is from another family the engine will not start and says
so in one line; ask for the other build (the RX 9000 build: Strata-tester-linux-amd-rx9070.AppImage).
You have two programs; try either or both:
1. The desktop app: @APPIMAGE@ (about @SIZE_GB:@APPIMAGE@@ GB)
2. The terminal app: Strata-Terminal-Linux-tester-amd-rx7900.zip (about @SIZE_GB:Strata-Terminal-Linux-tester-amd-rx7900.zip@ GB)
Each one carries its own AI engine, so there is no engine to download. Only the AI model itself is downloaded when you pick one.
Checks (sha256; to check your copy type sha256sum <file> - the long number must be the same):
@APPIMAGE@ @SHA256:@APPIMAGE@@
Strata-Terminal-Linux-tester-amd-rx7900.zip @SHA256:Strata-Terminal-Linux-tester-amd-rx7900.zip@
WHAT YOU NEED
-------------
* Ubuntu 22.04 or newer, 64-bit.
* An AMD RX 7000 (RDNA3) graphics card (RX 7900 XTX, RX 7900 XT, RX 7800 XT, RX 7700 XT, RX 7600; gfx1100 / gfx1101 / gfx1102). No ROCm and no extra driver to install: the engine brings its own ROCm libraries, and the AMD
kernel driver (amdgpu) is already part of the Linux kernel. To check that the kernel sees your card, type: ls /dev/kfd /dev/dri
You should see /dev/kfd and a renderD128 line. If /dev/kfd is missing, tell us your kernel (uname -r) and what "lspci | grep -i vga" prints.
* Your user must be in the groups "render" and "video". This is the one setting the engine needs. Type once:
sudo usermod -aG render,video $USER
then LOG OUT AND LOG IN AGAIN (or reboot). Check with the command id - it must list render and video. Without this the engine says
something like "No device of requested type available" or cannot open /dev/kfd.
* 32 GB of RAM or more is best (the model list shows what fits your computer). The AI model's big parts live in your RAM; your card
holds the rest. Your RX 7900 XTX has 24 GB: the 32K or 64K context the app suggests is a good start.
* Disk: about 3 GB for the program and engine, plus 40 to 70 GB for each model you download (a fast NVMe disk is best).
THE DESKTOP APP (AppImage)
--------------------------
1. Save the file somewhere you can find it, for example your Downloads folder.
2. Make it runnable: right-click > Properties > Permissions > "Allow executing file as program", or in a terminal:
chmod +x @APPIMAGE@
3. Install FUSE 2 once, if your system does not have it (AppImages need it; Ubuntu 26.04 does not install it any more):
Ubuntu 22.04: sudo apt install libfuse2 Ubuntu 24.04 and 26.04: sudo apt install libfuse2t64
Without FUSE you can still run it with: ./@APPIMAGE@ --appimage-extract-and-run
4. Start it by double-click, or from a terminal (a terminal also shows messages if something goes wrong):
./@APPIMAGE@
The very first start takes about a minute longer: the engine that came with the app is unpacked into ~/.local/share/strata.
Then open the Models page, pick a model and press the install button. A model download is big; it carries on where it stopped if it is interrupted.
Closing the window stops Strata and the engine. To stop a running Strata from a terminal: ./@APPIMAGE@ --quit
For the assistant (chat that works on files and runs tools) choose a context of 32K or more when you load the model; a smaller context is too small for the assistant's instructions.
@INCLUDE:common-troubleshoot.txt@
Please tell us about the window: which Linux and desktop (for example "Ubuntu 24.04, GNOME, Wayland"), your graphics driver, and whether the Strata window showed up
and worked: yes / opened in the browser instead / blank / closed by itself.
THE TERMINAL APP (zip)
----------------------
unzip Strata-Terminal-Linux-tester-amd-rx7900.zip
cd strata-tester-linux-amd-rx7900
sh install-tester.sh
strata launch
It needs python3, curl and tar (normally present). Everything is explained in README-TESTER.md inside the zip (AI-SETUP.md is the same for an AI assistant:
give it that file and it can do the setup for you). The installer starts a tiny web server on your own computer only and stops it again; nothing is sent anywhere.
WHAT TO SEND BACK
-----------------
* The desktop app: Settings > Engine > Diagnostics > View logs > Save logs. Send the saved file.
* The terminal app: the output of strata doctor (and uname -r , id , ls /dev/kfd /dev/dri ).
* The speed: the tokens-per-second numbers. The app shows "generating - N tok/s" while it answers. In the terminal app,
with the server running: strata bench run --url http://127.0.0.1:8080 --suite serving-smoke --repeat 2 --out ~/strata-bench-1
prints "output ... tok/s" lines; please send ~/strata-bench-1/results.json too.
A line like "model iq2_xs, 32K context, RX 7900 XTX: 40 tok/s" is perfect.
* A few words about what you did and what you saw (a photo of the screen is fine).
Please do not send API keys.
WHAT WE TESTED AND WHAT WE DID NOT
----------------------------------
* NOT TESTED by us on any RDNA3 card (RX 7000 series): we have no such card. The engine and the libraries inside contain code for gfx1100, gfx1101 and
gfx1102 (we checked the files), but it has never run on real hardware. Expect problems; every report helps. This is the most important thing to know.
* The same program was tested on an RDNA4 card (AMD Radeon AI PRO R9700) under Ubuntu 24.04: it loads a model, answers, runs tool calls and stops cleanly.
The RDNA3 code is the same source compiled for your card.
* NOT tested by us either: the app window on a real desktop (our test box has no screen).
* Pictures (image input) do not work on AMD cards in this build; leave them off.
* Speed is not final; treat the numbers as a baseline.
WHERE THINGS ARE (to remove Strata completely, delete the files and these folders)
---------------------------------------------------------------------------------
~/.strata settings, chats, prepared model files
~/.local/share/strata the unpacked engine and the terminal app
~/.local/bin/strata the terminal app's command
~/Documents/Strata downloaded models (Models) and your work folder (Workspace)
@@ -0,0 +1,90 @@
STRATA FOR LINUX - TESTER BUILD FOR AMD RX 9000 (RDNA4) CARDS (RX 9070 XT)
=====================================================================
This is a private test version of Strata for Linux with an AMD graphics card. Please keep it to yourself: it is not a public release.
THIS BUILD IS FOR AMD RX 9000 (RDNA4) CARDS ONLY (RX 9070 XT, RX 9070, RX 9060 XT, AI PRO R9700; gfx1200 / gfx1201). If your card is from another family the engine will not start and says
so in one line; ask for the other build (the RX 7000 build: Strata-tester-linux-amd-rx7900.AppImage).
You have two programs; try either or both:
1. The desktop app: @APPIMAGE@ (about @SIZE_GB:@APPIMAGE@@ GB)
2. The terminal app: Strata-Terminal-Linux-tester-amd-rx9070.zip (about @SIZE_GB:Strata-Terminal-Linux-tester-amd-rx9070.zip@ GB)
Each one carries its own AI engine, so there is no engine to download. Only the AI model itself is downloaded when you pick one.
Checks (sha256; to check your copy type sha256sum <file> - the long number must be the same):
@APPIMAGE@ @SHA256:@APPIMAGE@@
Strata-Terminal-Linux-tester-amd-rx9070.zip @SHA256:Strata-Terminal-Linux-tester-amd-rx9070.zip@
WHAT YOU NEED
-------------
* Ubuntu 22.04 or newer, or CachyOS / Arch Linux (rolling), 64-bit.
* An AMD RX 9000 (RDNA4) graphics card (RX 9070 XT, RX 9070, RX 9060 XT, AI PRO R9700; gfx1200 / gfx1201). No ROCm and no extra driver to install: the engine brings its own ROCm libraries, and the AMD
kernel driver (amdgpu) is already part of the Linux kernel. To check that the kernel sees your card, type: ls /dev/kfd /dev/dri
You should see /dev/kfd and a renderD128 line. If /dev/kfd is missing, tell us your kernel (uname -r) and what "lspci | grep -i vga" prints.
* Your user must be in the groups "render" and "video". This is the one setting the engine needs. Type once:
sudo usermod -aG render,video $USER
then LOG OUT AND LOG IN AGAIN (or reboot). Check with the command id - it must list render and video. Without this the engine says
something like "No device of requested type available" or cannot open /dev/kfd.
* 32 GB of RAM or more is best (the model list shows what fits your computer). The AI model's big parts live in your RAM; your card
holds the rest. Your RX 9070 XT has 16 GB: start with the 32K context the app suggests.
* Disk: about 3 GB for the program and engine, plus 40 to 70 GB for each model you download (a fast NVMe disk is best).
THE DESKTOP APP (AppImage)
--------------------------
1. Save the file somewhere you can find it, for example your Downloads folder.
2. Make it runnable: right-click > Properties > Permissions > "Allow executing file as program", or in a terminal:
chmod +x @APPIMAGE@
3. Install FUSE 2 once, if your system does not have it (AppImages need it; Ubuntu 26.04 does not install it any more):
CachyOS / Arch: sudo pacman -S fuse2 Ubuntu 22.04: sudo apt install libfuse2 Ubuntu 24.04 and 26.04: sudo apt install libfuse2t64
Without FUSE you can still run it with: ./@APPIMAGE@ --appimage-extract-and-run
4. Start it by double-click, or from a terminal (a terminal also shows messages if something goes wrong):
./@APPIMAGE@
The very first start takes about a minute longer: the engine that came with the app is unpacked into ~/.local/share/strata.
Then open the Models page, pick a model and press the install button. A model download is big; it carries on where it stopped if it is interrupted.
Closing the window stops Strata and the engine. To stop a running Strata from a terminal: ./@APPIMAGE@ --quit
For the assistant (chat that works on files and runs tools) choose a context of 32K or more when you load the model; a smaller context is too small for the assistant's instructions.
@INCLUDE:common-troubleshoot.txt@
Please tell us about the window: which Linux and desktop (for example "CachyOS, KDE Plasma, Wayland"), your graphics driver, and whether the Strata window showed up
and worked: yes / opened in the browser instead / blank / closed by itself.
THE TERMINAL APP (zip)
----------------------
unzip Strata-Terminal-Linux-tester-amd-rx9070.zip
cd strata-tester-linux-amd-rx9070
sh install-tester.sh
strata launch
It needs python3, curl and tar (normally present). Everything is explained in README-TESTER.md inside the zip (AI-SETUP.md is the same for an AI assistant:
give it that file and it can do the setup for you). The installer starts a tiny web server on your own computer only and stops it again; nothing is sent anywhere.
WHAT TO SEND BACK
-----------------
* The desktop app: Settings > Engine > Diagnostics > View logs > Save logs. Send the saved file.
* The terminal app: the output of strata doctor (and uname -r , id , ls /dev/kfd /dev/dri ).
* The speed: the tokens-per-second numbers. The app shows "generating - N tok/s" while it answers. In the terminal app,
with the server running: strata bench run --url http://127.0.0.1:8080 --suite serving-smoke --repeat 2 --out ~/strata-bench-1
prints "output ... tok/s" lines; please send ~/strata-bench-1/results.json too.
A line like "model iq2_xs, 32K context, RX 9070 XT: 40 tok/s" is perfect.
* A few words about what you did and what you saw (a photo of the screen is fine).
Please do not send API keys.
WHAT WE TESTED AND WHAT WE DID NOT
----------------------------------
* TESTED by us: this engine on an AMD Radeon AI PRO R9700 (RDNA4, the same chip family, gfx1201, as the RX 9070 XT) under Ubuntu 24.04: it loads a
model, answers, runs tool calls, and stops cleanly, from the app's host and from the terminal app.
* NOT tested by us: an RX 9070 XT itself, CachyOS, the app window on a real desktop (our test box has no screen). A failure on your computer is a finding we want.
* Pictures (image input) do not work on AMD cards in this build; leave them off.
* Speed is not final; treat the numbers as a baseline.
WHERE THINGS ARE (to remove Strata completely, delete the files and these folders)
---------------------------------------------------------------------------------
~/.strata settings, chats, prepared model files
~/.local/share/strata the unpacked engine and the terminal app
~/.local/bin/strata the terminal app's command
~/Documents/Strata downloaded models (Models) and your work folder (Workspace)
+67
View File
@@ -0,0 +1,67 @@
"""The tester READMEs get their checksums from the files themselves (apps/desktop/scripts/make-tester-readme.sh)."""
import hashlib
import shutil
import subprocess
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[2]
SCRIPT = ROOT / "apps" / "desktop" / "scripts" / "make-tester-readme.sh"
TEMPLATES = ROOT / "apps" / "desktop" / "tester"
pytestmark = pytest.mark.skipif(shutil.which("bash") is None or shutil.which("sha256sum") is None, reason="needs bash and sha256sum")
def sha(path: Path) -> str:
return hashlib.sha256(path.read_bytes()).hexdigest()
def run(*args, check=True):
return subprocess.run(["bash", str(SCRIPT), *map(str, args)], capture_output=True, text=True, check=check)
def make(tmp_path, template, appimage, extra=()):
files = tmp_path / "files"
files.mkdir()
(files / appimage).write_bytes(b"app image bytes " * 1000)
for name in extra:
(files / name).write_bytes(b"zip bytes " * 500)
out = tmp_path / "README.txt"
return files, out
def test_every_hash_and_size_in_the_readme_comes_from_the_file(tmp_path):
files, out = make(tmp_path, "README-linux.txt.in", "Strata-tester-linux.AppImage")
run(TEMPLATES / "README-linux.txt.in", out, "--appimage", "Strata-tester-linux.AppImage", "--files-dir", files)
text = out.read_text()
assert sha(files / "Strata-tester-linux.AppImage") in text
assert "@" not in text.replace("@", "", 0) or "@APPIMAGE@" not in text
assert "libfuse2t64" in text and "--browser" in text and "--quit" in text and "Ubuntu 26.04" in text
assert "Strata opened in your browser because the app window couldn't start on this computer." in text
run("--verify", out, "--files-dir", files)
@pytest.mark.parametrize("variant", ["rx9070", "rx7900"])
def test_amd_readmes_hash_both_files(tmp_path, variant):
app, zipname = f"Strata-tester-linux-amd-{variant}.AppImage", f"Strata-Terminal-Linux-tester-amd-{variant}.zip"
files, out = make(tmp_path, f"README-amd-{variant}.txt.in", app, extra=(zipname,))
run(TEMPLATES / f"README-amd-{variant}.txt.in", out, "--appimage", app, "--files-dir", files)
text = out.read_text()
assert sha(files / app) in text and sha(files / zipname) in text
assert f"./{app} --browser" in text
def test_a_missing_file_stops_the_readme_instead_of_leaving_a_stale_hash(tmp_path):
files, out = make(tmp_path, "README-amd-rx9070.txt.in", "Strata-tester-linux-amd-rx9070.AppImage") # the zip is not there
result = run(TEMPLATES / "README-amd-rx9070.txt.in", out, "--appimage", "Strata-tester-linux-amd-rx9070.AppImage", "--files-dir", files, check=False)
assert result.returncode != 0 and "must not carry a hash it did not compute" in result.stderr
assert not out.exists()
def test_verify_catches_a_stale_hash(tmp_path):
files, out = make(tmp_path, "README-linux.txt.in", "Strata-tester-linux.AppImage")
run(TEMPLATES / "README-linux.txt.in", out, "--appimage", "Strata-tester-linux.AppImage", "--files-dir", files)
(files / "Strata-tester-linux.AppImage").write_bytes(b"rebuilt") # the file changed after the README was written
result = run("--verify", out, "--files-dir", files, check=False)
assert result.returncode != 0 and "STALE" in result.stderr