Engine builds into site/dist/, no more site/dist-jit/

The wasm64 engine (qemu-system-arm.{js,wasm}, symbols, qemu-source.txt) now
deploys next to boards.tar and the Siemens key module in site/dist/, and
?dist= defaults to `dist`. Side-by-side builds under site/dist-* still work
through ?dist=<name>. The deploy bundle's engine is dist/dist/.

- build-qemu-wasm64.sh, ninja-fast.sh, build-release.sh, gate.sh,
  run-tcg-isa.sh, bundle-dist.sh and the tools default to dist.
- pack-boards.sh no longer deletes <engine dir>/boards.tar as a stale copy:
  that is now the boards.tar it packs.
- Links and example commands drop ?dist=dist, --dist dist, PROF_DIST=dist
  and DIST=dist, now the default.
- Two idlebench comments keep dist-jit: they record a past comparison.

An existing checkout moves its build with
  mv site/dist-jit/* site/dist/ && rmdir site/dist-jit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xda8d7rfJjkFSmKVQtcBGh
This commit is contained in:
Konstantin Pereiaslov 2026-11-15 20:13:22 -06:00
parent 036b96144d
commit ce67c28f0f
54 changed files with 117 additions and 125 deletions

5
.gitignore vendored
View file

@ -1,6 +1,5 @@
# build outputs
/site/dist/
/site/dist-jit/
/build/
# static deploy bundle (scripts/bundle-dist.sh → served by deploy/nginx/)
@ -39,8 +38,8 @@ tests/results/
tests/tcg-isa/*.o
tests/tcg-isa/*.elf
# A/B snapshot dists (baselines saved before candidate deploys;
# /site/dist/ and /site/dist-jit/ above are
# the live ones)
# /site/dist/ above is
# the live one)
/site/dist-*/
# fullflash dumps + sidecars (firmware images, not for git)

View file

@ -5,7 +5,7 @@ qemu-system-arm compiled to WebAssembly (`./build.sh` + `./serve.mjs`) —
splash draws, keypad/serial/sound work, every board reaches its idle
screen (the timing model below gives the firmware its full timing budgets
however slow the host is — a slow host merely boots slower). The engine is
the wasm64 TCG JIT backend (`site/dist-jit/`, every board — guest TBs
the wasm64 TCG JIT backend (`site/dist/`, every board — guest TBs
compiled to wasm at runtime, ~12 MB wasm, ~4 MB gzip'd). The documentation
index is [doc/README.md](doc/README.md).
@ -65,7 +65,7 @@ reconcile an own-file Siemens fullflash with the ESN the phone is handed
git submodule update --init qemu # build.sh does this too; the qemu
# tree is ~1 GB with history
./build.sh # ~30-60 min first run: emsdk 4.0.10 + glib/pixman/zlib/libffi
# built for wasm64, then qemu → site/dist-jit/
# built for wasm64, then qemu → site/dist/
# qemu-system-arm.wasm
./serve.mjs # http://127.0.0.1:8080 (COOP/COEP headers for pthreads)
# phone/LAN: auto-redirected to https://<lan-ip>:6808
@ -74,7 +74,7 @@ git submodule update --init qemu # build.sh does this too; the qemu
# for any host other than localhost/127.0.0.1)
```
`serve.mjs` keeps a gzip'd sidecar of the wasm (dist-jit: ~12 MB → ~4 MB
`serve.mjs` keeps a gzip'd sidecar of the wasm (dist: ~12 MB → ~4 MB
on the wire; `GZIP=0` disables) and revalidates with ETags, so repeat
visits skip the re-download (`tools/loadbench.mjs` measures the startup
path). The page also prefetches the engine wasm (plus the small Siemens
@ -225,12 +225,12 @@ still points one run at another binary.
board configs (lib/data/board) that boards.tar,
run-native.sh and the native tests boot with
build.sh one-shot WASM build (toolchain → deps → qemu →
site/dist-jit)
site/dist)
serve.mjs static server for the WASM page (COOP/COEP); serves
site/ — static files are edited in place, build
artifacts (qemu wasm/js, boards.tar) live in
site/dist/ (boards.tar, key module) and
site/dist-jit/ (the wasm64 backend)
site/dist/ (the wasm64 backend)
scripts/
build-deps.sh emsdk + glib/pixman/zlib/libffi built with emcc (wasm64)
build-dirs.sh the directories the build scripts share (WEB_BUILD,
@ -243,7 +243,7 @@ still points one run at another binary.
build-qemu.sh check the qemu, pmb887x-emu and bsp submodules out
when they are not yet, pack boards.tar, build
siemensfw and the wasm dist (wasm64 backend →
site/dist-jit/), from the submodules as checked out
site/dist/), from the submodules as checked out
sync-bsp.sh checks the bsp/ submodule out the first time
pack-boards.sh bsp/ board configs → site/dist/boards.tar (run by
every deploy path)
@ -277,7 +277,7 @@ still points one run at another binary.
run-native.sh native launcher (the web page's boot recipe, icount
clock by default)
ninja-fast.sh incremental rebuild + deploy (wasm64 →
site/dist-jit) — the iteration loop
site/dist) — the iteration loop
iterate.sh one-command edit→rebuild→browser-verdict loop
gate.sh builds the native references, then every
correctness gate, run concurrently, one verdict
@ -315,7 +315,7 @@ still points one run at another binary.
site/ the served web root — editable static page (index.html /
app.js / style.css / keyboards.js; fullflashes.js holds
the preset-fullflash inventory + Cache API handling)
plus dist/, dist-jit/ — build artifacts (gitignored);
plus dist/ — build artifacts (gitignored);
dist-*/ are A/B snapshots
tools/ headless-browser test/bench/probe helpers (playwright);
the ones that matter are listed in doc/diagnostics.md.
@ -480,7 +480,7 @@ s75/el71/c81/ke800/ke970 natively and benchmarks before/after, and
rules, the measuring method, the cost model, closed ideas and history.
- Fast iteration: `scripts/ninja-fast.sh` (incremental build and atomic
deploy to `site/dist-jit` or `$WEB_DIST`), then
deploy to `site/dist` or `$WEB_DIST`), then
`tools/perf/swab.sh <scene> <distA> <distB>` (paired free-run A/B of two
builds on pinned cores; both dists need `tools/perf/freerun.diff`) or
`tools/perf/bootab.sh` for the boot.

View file

@ -7,7 +7,7 @@ WEB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "== [1/3] toolchain + deps =="
bash "$WEB_DIR/scripts/build-deps.sh"
echo "== [2/3] qemu (wasm64, arm-softmmu, TCG backend -> site/dist-jit) =="
echo "== [2/3] qemu (wasm64, arm-softmmu, TCG backend -> site/dist) =="
bash "$WEB_DIR/scripts/build-qemu.sh"
echo "== [3/3] done =="

View file

@ -4,7 +4,7 @@
# `nginx-proxy` docker network.
#
# Build order matters: scripts/bundle-dist.sh must have produced ./dist
# (the webroot: page + dist/, dist-jit/ artifacts + .gz sidecars).
# (the webroot: page + dist/ artifacts + .gz sidecars).
# The build context is the repo root — /.dockerignore trims it to just
# dist/ + deploy/nginx/, so the multi-GB qemu/ submodule is never sent
# to the daemon.

View file

@ -26,7 +26,7 @@ tracked file under `site/` (outside `site/dist*`) is missing from it:
(drained by the AudioWorklet — leave it out and the page is silent) and
`img/ke970-wheel.webp`; then `dist/boards.tar` and the Siemens key module
`dist/siemens-recalc.{js,wasm}` (always fetched from `dist/`) and the
engine `dist-jit/qemu-system-arm.{js,wasm}`. Every text and wasm file
engine `dist/qemu-system-arm.{js,wasm}`. Every text and wasm file
gets a `.gz` sidecar (the ~12 MB wasm ships as ~4 MB), and
`manifest.sha256` covers every file — `cd dist && sha256sum -c
manifest.sha256` verifies a copy/deploy. Dev-only extras

View file

@ -17,7 +17,7 @@
# cache — which also lets Chromium keep its wasm code cache for
# qemu-system-arm.wasm (incl. the TurboFan tier-up) across visits.
# - the bundle's pre-gzip'd .gz sidecars via gzip_static: the ~12 MB
# dist-jit wasm ships as its ~4 MB sidecar; on-the-fly gzip only
# engine wasm ships as its ~4 MB sidecar; on-the-fly gzip only
# exists as a fallback for anything without one.
# - /gprs: the phone's GPRS WebSocket, passed to the GPRS gateway
# container (deploy/gprs-gw), as serve.mjs passes it to GPRS_GW.

View file

@ -21,7 +21,7 @@ speed. Everything else is reference.
| Command | What it does |
|---|---|
| `scripts/ninja-fast.sh` | incremental rebuild + deploy to `site/dist-jit`, or to `$WEB_DIST` |
| `scripts/ninja-fast.sh` | incremental rebuild + deploy to `site/dist`, or to `$WEB_DIST` |
| `scripts/gate.sh quick\|keep\|close` | builds the native references from `qemu/` as checked out, then every correctness gate, run concurrently, one verdict table |
| `tools/perf/swab.sh` | paired free-run A/B of two dists built with `tools/perf/freerun.diff` |
| `tools/perf/bootab.sh` | paired boot A/B of two dists, paced as on the page |

View file

@ -47,9 +47,9 @@ What else was tried, with the message each attempt ended in:
export ANDROID_EMU_CPUS=12-15,28-31 # taskset list; unset = not pinned
scripts/setup-android-emu.sh install
scripts/setup-android-emu.sh start
scripts/setup-android-emu.sh browser 'http://127.0.0.1:8080/?dist=dist-jit&suite=dist/tcgbench-quick.bin'
scripts/setup-android-emu.sh browser 'http://127.0.0.1:8080/?suite=dist/tcgbench-quick.bin'
curl http://127.0.0.1:9222/json/version
PROF_ATTACH=9222 PROF_DIST=dist-jit node tools/wprof2.mjs 45 "" 10000
PROF_ATTACH=9222 node tools/wprof2.mjs 45 "" 10000
scripts/setup-android-emu.sh stop
```
@ -142,8 +142,8 @@ Android. Still 10–30x slower than desktop.
```bash
scripts/setup-android-emu.sh linux-install
scripts/setup-android-emu.sh linux-browser 'http://127.0.0.1:8080/?dist=dist-jit&suite=dist/tcgbench-quick.bin'
PROF_ATTACH=9333 PROF_DIST=dist-jit node tools/wprof2.mjs 20 "" 1000
scripts/setup-android-emu.sh linux-browser 'http://127.0.0.1:8080/?suite=dist/tcgbench-quick.bin'
PROF_ATTACH=9333 node tools/wprof2.mjs 20 "" 1000
scripts/setup-android-emu.sh linux-stop
```

View file

@ -16,7 +16,7 @@ The Siemens/LG phone emulator runs entirely in the browser. Repo layout:
(src/siemens) → site/dist/siemens-recalc.wasm
(Advanced ▸ Siemens keys + device detection)
site/ served web root (index.html / app.js / keyboards.js /
fullflashes.js / siemensfw.js); dist-jit/ = the wasm
fullflashes.js / siemensfw.js); dist/ = the wasm
build, dist/ = boards.tar + key module + suite
images, dist-*/ = A/B snapshots (all gitignored)
tests/ native boot suite (run.mjs), tcg-isa op-suite,
@ -30,7 +30,7 @@ The Siemens/LG phone emulator runs entirely in the browser. Repo layout:
`qemu-system-arm` (arm-softmmu) is compiled to WebAssembly (wasm64 with
`-sMEMORY64=2`, pthreads, Asyncify) and driven from a page.
- `site/dist-jit/` — the engine, built around the **wasm64 TCG backend**
- `site/dist/` — the engine, built around the **wasm64 TCG backend**
(`tcg/wasm64/`). A new TB runs in an interpreter tier for its first 64
entries (`tcg/wasm64/w64-interp.c`), then the batch of TBs staged so far
is compiled into one wasm module. TBs chain by tail calls through a
@ -65,7 +65,7 @@ The Siemens/LG phone emulator runs entirely in the browser. Repo layout:
--with-coroutine=wasm`) in `build/qemu-wasm64`, link at `-O3` with the
Asyncify onlylist (`configs/meson/asyncify-only.txt`) and
`qom_cast_debug=false`, and deploy atomically (tmp+rename) to
`site/dist-jit/`, symbol map included, plus `qemu-source.txt`: the
`site/dist/`, symbol map included, plus `qemu-source.txt`: the
identity of the qemu source the dist was built from
(`scripts/qemu-source-id.sh`: HEAD, plus a hash of the uncommitted diff
when there is one), which the lockstep driver matches against the
@ -75,7 +75,7 @@ The Siemens/LG phone emulator runs entirely in the browser. Repo layout:
(SharedArrayBuffer), a gzip sidecar + ETag revalidation for the wasm,
and an https port for phone/LAN access.
Incremental iteration: `scripts/ninja-fast.sh` (wasm64 → `site/dist-jit`;
Incremental iteration: `scripts/ninja-fast.sh` (wasm64 → `site/dist`;
rebuild + atomic deploy + `qemu-source.txt` + boards.tar refresh, no tree
reset). One-shot: `./build.sh`.
@ -504,7 +504,7 @@ a quiet host.
|---|---|---|
| unit tests | the page modules' pure logic (board configs, device rules, keyboards, OTP words, exit reports, browser names) | `node --test tests/unit/*.test.mjs` |
| native boot suite | s75/el71/c81/ke800/ke970 boot-init/progress/no-exit | `node tests/run.mjs` |
| browser boot gate | s75/el71/ke800/ke970/cx70 boot on a wasm dist (progress in executed insns) | `node tools/bootcheck.mjs --dist dist-jit` |
| browser boot gate | s75/el71/ke800/ke970/cx70 boot on a wasm dist (progress in executed insns) | `node tools/bootcheck.mjs` |
| early key | a key delivered before the machine exists does not kill the module | `node tools/earlykey.mjs --board <b>` |
| guest op-suite | (value, NZCV) cases byte-identical across every backend built, the wasm64 page leg included | `scripts/run-tcg-isa.sh` |
| lockstep | whole-boot cross-backend value equality (regs + SRAM/SDRAM digests) against a native reference built from the dist's own source (`qemu-source.txt`); full 2.5e9-insn gate | `scripts/run-lockstep.sh`, `tools/lockstep-wasm.mjs` |

View file

@ -22,7 +22,7 @@ option they do not know (exit 2).
| Param | Effect |
|---|---|
| `?dist=<dir>` | build output under `site/` to run: default `dist-jit` (wasm64 TCG backend); any `dist-*` A/B snapshot. Only a bare directory name (letters, digits, `_`, `.`, `-`; not `.` or `..`) is taken; anything else blocks Start with a message |
| `?dist=<dir>` | build output under `site/` to run: default `dist` (wasm64 TCG backend); any `dist-*` A/B snapshot. Only a bare directory name (letters, digits, `_`, `.`, `-`; not `.` or `..`) is taken; anything else blocks Start with a message |
| `?icount=<spec>` | run `-icount <spec>` instead of the default `-accel tcg,thread=multi,vcpu-timers=on,vcpu-timers-bank=30,vcpu-timers-idle-lead=2000,cross-page-links=on` (`shift=3,sleep=off` = the deterministic, unpaced model the lockstep tools use; `none` = plain realtime clock). A `?qargs=` that carries its own `-accel` also drops the default |
| `?bank=<s>` | `vcpu-timers-bank`: for the guest's first `<s>` seconds of its own clock (default 30, the boot) time lost to a slow host is caught up — whenever the guest idles — instead of dropped; `0` = upstream (lag over 100 ms is dropped). The clock never runs ahead of wall time. While banked the pill's `slow` warning stays off (see below) |
| `?idlelead=<us>` | `vcpu-timers-idle-lead`: while the guest waits for an interrupt, its virtual timers run in batches up to `<us>` ahead of wall time, so the vCPU thread sleeps once per batch instead of once per timer (the DSP sync timer fires every 100 us). Default 2000; `0` = the idle clock follows wall time exactly. A build older than the option needs `?qargs=` with its own `-accel` |
@ -252,5 +252,5 @@ argument. `-device gsm-sim` plugs into the board's empty
`iso7816-slot`.) A wasm run under `?icount=shift=3,sleep=off` replays the
same instruction stream: diff the trace sequences (`COM_SET` →
`DSP_CFR cleared` → `SCU_DSP_INT` → …) between the native build and
`dist-jit` to find where they diverge and bisect a wasm-only failure.
`dist` to find where they diverge and bisect a wasm-only failure.
Remember: `>>EXIT<<` on serial = phone crashed; stop there.

View file

@ -234,7 +234,7 @@ adb=build/android-emu/sdk/platform-tools/adb # any adb 1.0.41
$adb shell svc power stayon usb # undo: svc power stayon false
node tools/perf/adbtun.mjs raw "reverse:forward:tcp:8080;tcp:$(hostname -i):8080"
node tools/perf/adbtun.mjs listen 9222 localabstract:chrome_devtools_remote &
SCENEBENCH_CDP=http://127.0.0.1:9222 node tools/scenebench.mjs stopwatch dist-jit \
SCENEBENCH_CDP=http://127.0.0.1:9222 node tools/scenebench.mjs stopwatch dist \
--runs 1 --measure 30 --keyscale 3
```
@ -505,7 +505,7 @@ and wait for its "measuring" line. Then run
`emscripten_get_now` under `tcg_qemu_tb_exec`); that, not an index
collision in V8, is where those names came from. The module buckets
(by url) were right throughout.
- Without `PROF_DIST`, wprof2 takes `site/dist-jit`'s symbols.
- Without `PROF_DIST`, wprof2 takes `site/dist`'s symbols.
- Fixed-length windows cover different instruction counts, so compare
per-subsystem deltas with care.

View file

@ -3,7 +3,7 @@
#
# Builds the emscripten wasm64 qemu (memory64, pthreads, ASYNCIFY) into
# build/qemu-wasm64/ and deploys qemu-system-arm.{js,wasm} into
# site/dist-jit/ (the emulator page's dist).
# site/dist/ (the emulator page's dist).
#
# The memory model is the 32-bit address limit (-sMEMORY64=2): i64
# pointers, i32 memory index. It is worth +19.2 % on J2ME (round thirty-six)
@ -44,7 +44,7 @@ SRC="$ROOT/qemu"
# The build dir is never reconfigured once it exists (the configure guard
# below), so a flags change means wiping build/qemu-wasm64 first.
BUILD_DIR="$BUILD/qemu-wasm64"
DIST="site/dist-jit"
DIST="site/dist"
if [ ! -f "$BUILD_DIR/build.ninja" ] || [ ! -f "$BUILD_DIR/meson-private/coredata.dat" ]; then
echo "== configuring $BUILD_DIR"

View file

@ -4,7 +4,7 @@
# Builds the qemu/ submodule as it is checked out (its gitlink is the pin;
# a checkout ahead of it is the normal state while developing, and is only
# warned about), then:
# the wasm64 TCG backend -> site/dist-jit/, plus site/dist/boards.tar
# the wasm64 TCG backend -> site/dist/, plus site/dist/boards.tar
# (board configs from bsp; the page always fetches it from dist/).
# site/ is served directly by serve.mjs — nothing is copied for it.
set -euo pipefail
@ -33,9 +33,9 @@ done
# --- board configs from the bsp/ submodule ---
bash "$WEB_DIR/scripts/sync-bsp.sh"
# --- build: wasm64 TCG backend (site/dist-jit/, the page default) ---
# --- build: wasm64 TCG backend (site/dist/, the page default) ---
# Its deploy (deploy-dist.sh) also packs boards.tar and builds the Siemens
# key module into site/dist/.
bash "$WEB_DIR/scripts/build-qemu-wasm64.sh"
echo "=== web dist ready: $WEB_DIR/site/dist-jit ==="
echo "=== web dist ready: $WEB_DIR/site/dist ==="

View file

@ -7,9 +7,8 @@
# ESN recovery — sr_read_identity/sr_recalc/sr_scan/sr_verify) and the
# Siemens half of device detection (sr_probe → probeFullflash).
#
# It deploys to site/dist/ and not site/dist-jit/: that is the directory the
# page fetches unconditionally whatever ?dist= selects, the same rule
# boards.tar follows (see scripts/pack-boards.sh).
# It deploys to site/dist/: the page fetches it from there whatever ?dist=
# selects, the same rule boards.tar follows (see scripts/pack-boards.sh).
#
# wasm32, unlike qemu — this module stands alone, so there is no reason to
# pay MEMORY64 for it. No -pthread either: the page spreads the sweep over

View file

@ -65,15 +65,15 @@ fi
# ---- 3. rebuild + bundle ------------------------------------------------
# build.sh: deps (cached unless DEPS_CLEAN) → submodule init/sync-bsp →
# build-qemu-wasm64 → site/dist-jit, whose deploy also packs boards.tar and
# build-qemu-wasm64 → site/dist, whose deploy also packs boards.tar and
# builds the key module into site/dist. Native build dirs
# (qemu-native*) are not part of the deploy path and are left alone.
bash ./build.sh
built="$(cat site/dist-jit/qemu-source.txt 2>/dev/null || true)"
built="$(cat site/dist/qemu-source.txt 2>/dev/null || true)"
pin="$(submodule_pin qemu)"
if [ "$built" != "$pin" ]; then
echo "build-release.sh: site/dist-jit was built from qemu ${built:-<no qemu-source.txt>}, not its gitlink $pin" >&2
echo "build-release.sh: site/dist was built from qemu ${built:-<no qemu-source.txt>}, not its gitlink $pin" >&2
exit 1
fi

View file

@ -2,7 +2,7 @@
# Assemble the deployable static bundle in <repo>/dist (gitignored):
# everything the page loads, plus a pre-gzip'd .gz sidecar next to every
# compressible file — so the nginx image (deploy/nginx/, gzip_static on)
# or any other static host serves the ~12 MB dist-jit wasm as its ~4 MB
# or any other static host serves the ~12 MB dist wasm as its ~4 MB
# sidecar without ever compressing on the fly (same idea as serve.mjs'
# gz sidecars, but frozen at bundle time).
#
@ -40,8 +40,8 @@ page="index.html app.js boards.js exit-report.js otp.js ua.js style.css keyboard
# page images (style.css references them by relative path)
images="img/ke970-wheel.webp"
# The engine: dist-jit = the wasm64 TCG backend build.
engines="dist-jit"
# The engine: dist = the wasm64 TCG backend build.
engines="dist"
for f in $page $images; do
[ -f "$SITE/$f" ] || fail "site/$f missing"
@ -59,8 +59,8 @@ fi
# app.js fetches "dist/boards.tar" unconditionally, whatever ?dist= selects
[ -f "$SITE/dist/boards.tar" ] ||
fail "site/dist/boards.tar missing — run scripts/build-qemu.sh (or scripts/pack-boards.sh)"
[ -f "$SITE/dist-jit/qemu-system-arm.wasm" ] ||
fail "site/dist-jit/qemu-system-arm.wasm missing — run scripts/build-qemu.sh"
[ -f "$SITE/dist/qemu-system-arm.wasm" ] ||
fail "site/dist/qemu-system-arm.wasm missing — run scripts/build-qemu.sh"
# the Siemens key module lives in dist/ for the same reason boards.tar does
[ -f "$SITE/dist/siemens-recalc.wasm" ] ||
fail "site/dist/siemens-recalc.wasm missing — run scripts/build-recalc-wasm.sh"
@ -73,14 +73,14 @@ if [ -e "$OUT" ] && { [ ! -d "$OUT" ] || { [ -n "$(ls -A "$OUT")" ] && [ ! -f "$
fail "$OUT is not empty and has no manifest.sha256, so it is no bundle; not deleting it"
fi
rm -rf "$OUT"
mkdir -p "$OUT/dist" "$OUT/dist-jit" "$OUT/img"
mkdir -p "$OUT/dist" "$OUT/img"
for f in $page $images; do
cp "$SITE/$f" "$OUT/$f"
done
# boards.tar only ever lives in dist/ (pack-boards.sh drops stale copies
# next to the other engine) — the page expects it there.
# boards.tar only ever lives in dist/, whatever ?dist= selects — the page
# expects it there.
cp "$SITE/dist/boards.tar" "$OUT/dist/boards.tar"
for f in siemens-recalc.js siemens-recalc.wasm; do
cp "$SITE/dist/$f" "$OUT/dist/$f"
@ -93,7 +93,7 @@ for d in $engines; do
done
if [ "${BUNDLE_TESTS:-0}" = 1 ]; then
for f in "$SITE"/dist/tcgisa.bin "$SITE"/dist/tcgbench*.bin "$SITE"/dist-jit/tcgisa.bin; do
for f in "$SITE"/dist/tcgisa.bin "$SITE"/dist/tcgbench*.bin; do
if [ -f "$f" ]; then cp "$f" "$OUT/${f#"$SITE"/}"; fi
done
fi
@ -108,7 +108,7 @@ fi
# -n: no filename/timestamp in the header → byte-deterministic bundles.
# Level 9 is build-time-only cost, worth it for the wasm (the wire
# bottleneck per README: dist-jit ~12 MB → ~4 MB).
# bottleneck per README: dist ~12 MB → ~4 MB).
gz_re='\.(html?|css|m?js|json|wasm|tar|bin|svg|txt|symbols)$'
while IFS= read -r -d '' f; do
[[ $f =~ $gz_re ]] || continue

View file

@ -13,7 +13,7 @@
# jobs of quick sum to 763 s and those of keep to 1009 s; the board boots
# (150 s each) are the longest of them.
#
# --dist D dist under site/ to gate (default dist-jit)
# --dist D dist under site/ to gate (default dist)
# --port P server port for the browser gates (default 8080). opsuite
# starts a server of its own on P+13 (8093 by default), so
# gates that run at the same time need ports 14 or more apart
@ -42,7 +42,7 @@
set -uo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
DIST=dist-jit
DIST=dist
PORT=8080
JOBS_MAX=6
TIER=keep
@ -94,7 +94,7 @@ export PLAYWRIGHT_BROWSERS_PATH="${PLAYWRIGHT_BROWSERS_PATH:-$ROOT/tools/chrome}
# not whatever TESTFLASH or the gitignored testflash.local.json names, so
# they run on a fresh clone and boot the same image everywhere.
#
# ui always drives the page's default dist (dist-jit): --dist does not reach
# ui always drives the page's default dist (dist): --dist does not reach
# it. It is here because nothing else runs it, and a UI check nobody runs
# rots -- its slow-warning check failed unnoticed because a page-level CPU
# throttle does not reach the guest's workers.

View file

@ -1,9 +1,9 @@
#!/bin/bash
# One-command C-iteration loop for the default wasm build (wasm64 TCG
# backend, site/dist-jit):
# backend, site/dist):
# edit qemu/**.c -> scripts/iterate.sh -> verdict
#
# Steps: incremental ninja rebuild + deploy to site/dist-jit/ (scripts/ninja-fast.sh),
# Steps: incremental ninja rebuild + deploy to site/dist/ (scripts/ninja-fast.sh),
# then the parallel boot-survival A/B check (tools/ab.mjs) against the fresh
# build. Total wall time ≈ rebuild (~10 s) + until-splash (~30 s).
#

View file

@ -1,12 +1,12 @@
#!/bin/bash
# Fast incremental rebuild + deploy of the default wasm build
# (build/qemu-wasm64, the wasm64 TCG backend -> site/dist-jit).
# (build/qemu-wasm64, the wasm64 TCG backend -> site/dist).
# Skips the submodule, bsp and meson configure steps of
# scripts/build-qemu.sh, and builds qemu/ as it is, uncommitted edits
# included: the iteration loop.
#
# With no arguments: builds qemu-system-arm.js and DEPLOYS the emscripten
# artifacts to $WEB_DIST (default site/dist-jit/) so the
# artifacts to $WEB_DIST (default site/dist/) so the
# next page load runs the
# new build — no manual cp, no stale-wasm traps (also drops stale .gz
# sidecars, which serve.mjs would otherwise prefer over the fresh file).
@ -23,7 +23,7 @@ source "$WEB_DIR/scripts/build-dirs.sh"
TARGET="$DEPS_ROOT/target"
BUILD_DIR="$BUILD/qemu-wasm64"
# absolute: the build below runs in the build dir
DIST="$(realpath -m -- "${WEB_DIST:-$WEB_DIR/site/dist-jit}")"
DIST="$(realpath -m -- "${WEB_DIST:-$WEB_DIR/site/dist}")"
use_emsdk
export PATH="$HOME/.local/bin:$PATH"

View file

@ -25,10 +25,4 @@ mkdir -p "$DIST"
tar -cf "$DIST/.boards.tar.tmp" -C "$BOARDS" .
mv -f "$DIST/.boards.tar.tmp" "$DIST/boards.tar"
# Per-dist copies are never fetched; an old one next to a build is a trap
# for anyone reading the tree, so drop them as we refresh the real one.
for stale in "$WEB_DIR"/site/dist-jit/boards.tar; do
[ -f "$stale" ] && rm -f "$stale"
done
echo "pack-boards: site/dist/boards.tar <- $(basename "$BOARDS") ($(tar tf "$DIST/boards.tar" | grep -c '\.toml$') configs)"

View file

@ -1,7 +1,7 @@
#!/bin/bash
# Phase-0a gate runner: build the guest
# op-suite image, run it on every backend — native TCG JIT, native TCI and
# the wasm64 page (site/dist-jit, or TCGISA_DIST) — and byte-compare all
# the wasm64 page (site/dist, or TCGISA_DIST) — and byte-compare all
# serial logs against the native JIT.
#
# scripts/run-tcg-isa.sh # skips the wasm leg if it cannot run
@ -153,7 +153,7 @@ else
# versatilepb machine-init path; the 0090 commit on the qemu branch
# added the missing onlylist names.)
# TCGISA_DIST re-points the wasm64 leg at a variant build. It was hard
# wired to dist-jit, which made this gate silently test the wrong binary
# wired to dist, which made this gate silently test the wrong binary
# whenever a variant was under evaluation: `gate.sh --dist X` passes X to
# every other job, so the summary read PASS for a dist nobody had run.
if ! start_serve "$ROOT" "$PORT_TCG"; then
@ -161,7 +161,7 @@ else
fail=1
else
echo "== serve.mjs on port $PORT_TCG, image site/dist/${IMG##*/}"
run_wasm_leg "wasm64 (page, ${TCGISA_DIST:-dist-jit})" "${TCGISA_DIST:-dist-jit}" \
run_wasm_leg "wasm64 (page, ${TCGISA_DIST:-dist})" "${TCGISA_DIST:-dist}" \
tcgisa.mjs "$T/wasm64.log" || fail=1
kill "$SRV" 2>/dev/null || true
SRV=""

View file

@ -287,7 +287,7 @@ cmd_devtools() {
}
cmd_browser() {
local url="${1:-http://127.0.0.1:$PAGE_PORT/?dist=dist-jit}"
local url="${1:-http://127.0.0.1:$PAGE_PORT/}"
local mark="/data/local/tmp/$PKG.rev"
if [ "$(adb shell "cat $mark 2>/dev/null" | tr -d '\r')" != "$CHROMIUM_REV" ] ||
! adb shell pm path "$PKG" 2>/dev/null | grep package: >/dev/null; then
@ -404,7 +404,7 @@ EOF
}
cmd_linux_browser() {
local url="${1:-http://127.0.0.1:$PAGE_PORT/?dist=dist-jit}" pin=()
local url="${1:-http://127.0.0.1:$PAGE_PORT/}" pin=()
# Android's V8 has no wasm trap handler: explicit bounds checks, no guard
# regions. The Linux build gets the same from this feature switch
# (--js-flags=--no-wasm-trap-handler does not do it).

View file

@ -1209,12 +1209,12 @@ async function applyFullflashFile(file) {
* suite prints TAP + value dumps on the PL011 and then parks, since a
* semihosting exit from the vCPU thread would tear the page down first;
* tools/tcgisa.mjs reads the serial log up to its "# result:" line. */
/* ?dist=<dir>: which build output to run (default dist-jit/; tools point
/* ?dist=<dir>: which build output to run (default dist/; tools point
* this at side-by-side builds). boards.tar is always served from dist/.
* Only a directory name under site/ is taken, anything else blocks Start;
* the wasm fetch and the loader import both resolve against ENGINE_DIR,
* since fetch() and import() resolve a free-form value differently. */
const DIST_DEFAULT = "dist-jit";
const DIST_DEFAULT = "dist";
const DIST = QS.get("dist") || null;
const DIST_OK = !DIST || (/^[\w.-]+$/.test(DIST) && !/^\.\.?$/.test(DIST));
const ENGINE_DIR = new URL(`${DIST_OK && DIST || DIST_DEFAULT}/`, import.meta.url);

View file

@ -35,7 +35,7 @@ build/qemu-native-build/qemu-system-arm -M versatilepb \
On the wasm page: `make install` then open
`http://127.0.0.1:8080/?suite=dist/tcgisa.bin` (or
`node tools/tcgisa.mjs 8080 dist-jit out.log` headlessly).
`node tools/tcgisa.mjs 8080 dist out.log` headlessly).
## Machine & conventions

View file

@ -4,7 +4,7 @@ The perf counterpart of the op-suite ([../tcg-isa/](../tcg-isa/)): a
fixed bare-metal ARM926EJ-S workload on `-M versatilepb` whose phases hit
the wasm64 TCG backend's per-op paths directly, timed by timestamping
each phase's serial line. A run takes ~3.5 s on the native JIT and ~90 s
on the wasm page (dist-jit, 2026-11), with per-phase attribution and a
on the wasm page (dist, 2026-11), with per-phase attribution and a
cross-backend checksum.
It has no phone devices and no DSP, so it says nothing about a phone
scene: the keep/revert meter for a change is the free-run A/B in
@ -58,8 +58,8 @@ make -C tests/tcgbench quick install # + tcgbench-quick*.bin (ITERS_DIV=4) ->
SUITE=quick node tools/tcgbench.mjs # ÷4 smoke image, 40 ms poll
node tools/tcgbench.mjs # native-jit + dist-jit (wasm64)
LEGS=native-jit,native-tci,dist-jit,dist-x node tools/tcgbench.mjs
node tools/tcgbench.mjs # native-jit + dist (wasm64)
LEGS=native-jit,native-tci,dist,dist-x node tools/tcgbench.mjs
ICOUNTS=0,1 node tools/tcgbench.mjs # icount-tax matrix
RUNS=3 node tools/tcgbench.mjs # medians
```

View file

@ -1,4 +1,4 @@
// A/B boot-survival check against the page's default build (site/dist-jit/).
// A/B boot-survival check against the page's default build (site/dist/).
//
// node ab.mjs [variant ...] (default: fast)
//

View file

@ -16,7 +16,7 @@
// "it did not this run"
//
// Capture a log first, e.g.
// EXTRA_Q="env=QEMU_COSTACK=1" DIST=dist-jit MATCH=COSTACK \
// EXTRA_Q="env=QEMU_COSTACK=1" MATCH=COSTACK \
// node tools/conlog.mjs 120 > costack.txt
// then
// node tools/asyncify-audit.mjs costack.txt <dist>

View file

@ -14,13 +14,13 @@
// back-pressured the guest's PCM pipeline instead of draining it. A second
// toggle checks that playback comes back.
//
// Usage: TESTFLASH=<fullflash> [PORT=8080] [MAX=120] [DIST=dist-jit] \
// Usage: TESTFLASH=<fullflash> [PORT=8080] [MAX=120] [DIST=dist] \
// [TOGGLE_AT=20,30] node audioprobe.mjs [extraQuery]
import { chromium } from "playwright-core";
import { files as fullflashFiles } from "./testflash.mjs";
import { QEMULOG_COUNT, QEMULOG_SINCE } from "./lib/page.mjs";
const dist = process.env.DIST || "dist-jit";
const dist = process.env.DIST || "dist";
const port = process.env.PORT || "8080";
const maxSecs = Number(process.env.MAX || 120);
const toggleAt = (process.env.TOGGLE_AT || "")

View file

@ -18,7 +18,7 @@
// actually change (ours is initial == max).
//
// So four modules, both axes crossed, identical code otherwise. The
// production engine is the -sMEMORY64=2 build: site/dist-jit imports an
// production engine is the -sMEMORY64=2 build: site/dist imports an
// i32 shared memory (initial == max), so i32+shared is the production leg
// and i64+shared is what a -sMEMORY64=1 build would give. If i32+shared is
// much faster, the lowering pays for itself; if only i64+unshared is fast,

View file

@ -63,7 +63,7 @@ if (!ph) {
console.error(`usage: node bootbench.mjs <${Object.keys(phones).join("|")}> [dists] [--runs N] [--warm]`);
process.exit(2);
}
const dists = (positional[1] || "dist-jit").split(",");
const dists = (positional[1] || "dist").split(",");
const runs = Number(opt("runs", 3));
const warm = flag("warm");
const afterS = Number(opt("after", 5));

View file

@ -9,7 +9,7 @@
// ever showed there), KE800 and KE970 are the LG boards, CX70 the x65
// one.
//
// node tools/bootcheck.mjs [--dist dist-jit] [--secs 150] [--flash id,id]
// node tools/bootcheck.mjs [--dist dist] [--secs 150] [--flash id,id]
// [--query q] [--port P (default $PORT, else 8080)]
//
// PASS for a board, after --secs:
@ -32,11 +32,11 @@ const ROOT = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
fs.mkdirSync(path.join(ROOT, "tests", "results"), { recursive: true });
const args = parseArgs(process.argv.slice(2), {
values: ["dist", "secs", "flash", "query", "port"],
usage: "node tools/bootcheck.mjs [--dist dist-jit] [--secs 150] [--flash id,id] [--query q] [--port P]",
usage: "node tools/bootcheck.mjs [--dist dist] [--secs 150] [--flash id,id] [--query q] [--port P]",
});
const opt = args.opt;
const DIST = opt("dist", "dist-jit");
const DIST = opt("dist", "dist");
const SECS = Number(opt("secs", 150));
const PORT = opt("port", process.env.PORT || "8080");
const ONLY = opt("flash", "").split(",").filter(Boolean);

View file

@ -1,5 +1,5 @@
// Boot a dist and capture qemu console lines matching a prefix.
// PORT=8080 DIST=dist-jit MATCH=COSTACK EXTRA_Q="env=QEMU_COSTACK=1" \
// PORT=8080 MATCH=COSTACK EXTRA_Q="env=QEMU_COSTACK=1" \
// node conlog.mjs <secs>
import { chromium } from "playwright-core";
import { files } from "./testflash.mjs";
@ -14,7 +14,7 @@ p.on("console", m => {
if (t.startsWith("[qemu") && (!match || t.includes(match)))
console.log(((Date.now() - t0) / 1000).toFixed(1) + "s " + t);
});
await p.goto(`http://127.0.0.1:${port}/?dist=${process.env.DIST || "dist-jit"}${process.env.EXTRA_Q ? "&" + process.env.EXTRA_Q : ""}`, { waitUntil: "domcontentloaded" });
await p.goto(`http://127.0.0.1:${port}/?dist=${process.env.DIST || "dist"}${process.env.EXTRA_Q ? "&" + process.env.EXTRA_Q : ""}`, { waitUntil: "domcontentloaded" });
await p.click("#ff-mode-own");
await p.setInputFiles("#fullflash", files);
await p.click("#btn-start");

View file

@ -3,7 +3,7 @@
import { chromium } from "playwright-core";
const port = process.argv[2] || "8080";
const dist = process.argv[3] || "dist-jit";
const dist = process.argv[3] || "dist";
const timeoutMs = 180 * 1000;
const browser = await chromium.launch({ headless: true });

View file

@ -2,7 +2,7 @@
# Run a command as if every core were RUN/(RUN+STOP) as fast: the command and
# all its descendants are stopped for STOP ms out of every RUN+STOP ms.
#
# RUN=2 STOP=8 tools/dutyhost.sh node tools/scenebench.mjs bobby dist-jit --keyscale 3
# RUN=2 STOP=8 tools/dutyhost.sh node tools/scenebench.mjs bobby dist --keyscale 3
#
# Unlike tools/slowhost.sh, whose spinners share each core with the command
# so a woken thread can wait a whole scheduler slice for its core, all of

View file

@ -1,7 +1,7 @@
// A key event that arrives before the machine exists must not take the
// module down.
//
// node tools/earlykey.mjs [--dist dist-jit] [--board cx70] [--port P (default $PORT, else 8080)]
// node tools/earlykey.mjs [--dist dist] [--board cx70] [--port P (default $PORT, else 8080)]
//
// wasm_send_key() is exported the moment the module instantiates, which is
// long before wasm_display_init() creates the bottom half it schedules --
@ -29,7 +29,7 @@ import { bootOwnFlash, bounded, pageCall } from "./lib/page.mjs";
const { opt } = parseArgs(process.argv.slice(2), {
values: ["board", "dist", "port"],
usage: "node tools/earlykey.mjs [--dist dist-jit] [--board s75|el71|ke800|ke970|cx70] [--port P]",
usage: "node tools/earlykey.mjs [--dist dist] [--board s75|el71|ke800|ke970|cx70] [--port P]",
});
// --board -> tools/lib/boards.mjs id (this check boots the other S75 image)
@ -40,7 +40,7 @@ if (!flash) { console.error(`unknown --board ${boardId}`); process.exit(2); }
const files = flashFiles(flash);
const missing = files.filter((f) => !fs.existsSync(f));
if (missing.length) { console.error(`fullflash not found: ${missing.join(", ")}`); process.exit(2); }
const dist = opt("dist", "dist-jit");
const dist = opt("dist", "dist");
const port = opt("port", process.env.PORT || "8080");
const b = await chromium.launch({ headless: true });

View file

@ -18,7 +18,7 @@ const args = parseArgs(process.argv.slice(2), {
values: ["flash"], positional: 2,
usage: "node tools/ffboot.mjs [--flash id] [dist] [extraQ]",
});
const dist = args.positional[0] || "dist-jit";
const dist = args.positional[0] || "dist";
const extraQ = args.positional[1] || "";
const flashId = args.opt("flash", "");
const fullflash = flashId ? flashFiles(flashId) : (await import("./testflash.mjs")).files;

View file

@ -2,7 +2,7 @@
// the phone's browser, and watch it arrive (doc/gsm-network.md).
//
// node tools/gprscheck.mjs [--phone el71] --flash <EL71v41lg91.bin> [--secs 300] [--keep] [--trace]
// PORT=8080 node tools/gprscheck.mjs --web [--dist dist-jit] [--gateway <dir>] --flash ...
// PORT=8080 node tools/gprscheck.mjs --web [--dist dist] [--gateway <dir>] --flash ...
// [--gateway-listen 127.0.0.1:5751] [--host-port 0] [--phone el71|s75|cx70|sl65] [--try]
//
// --phone picks the firmware whose menus the keys walk and whose LCD
@ -273,7 +273,7 @@ async function nativeBackend() {
async function webBackend() {
const { chromium } = await import("playwright-core");
const PORT = process.env.PORT || "8080";
const DIST = opt("dist", "dist-jit");
const DIST = opt("dist", "dist");
// HMP key names -> the linux keycodes the page's keypad sends
const KEYCODE = { ret: 28, f1: 59, f2: 60, f4: 62, up: 103, down: 108, right: 106, kp_divide: 98,
0: 11, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10 };

View file

@ -1,7 +1,7 @@
// GSM network check: boot a phone on a wasm dist with the GSM option on and
// watch it register (doc/gsm-network.md).
//
// node tools/gsmcheck.mjs [--dist dist-jit] [--flash <image>] [--secs 240]
// node tools/gsmcheck.mjs [--dist dist] [--flash <image>] [--secs 240]
// [--gsm 1|0] [--ref <png>] [--saveref <png>] [--rows 0,20]
// [--hold 60] [--keys 75:right_soft,82:left_soft] [--query q]
// [--port P (default $PORT, else 8080)]
@ -40,7 +40,7 @@ const { opt } = parseArgs(process.argv.slice(2), {
+ " [--saveref png] [--rows a,b] [--hold s] [--keys s:key,...] [--query q] [--port P]",
});
const DIST = opt("dist", "dist-jit");
const DIST = opt("dist", "dist");
const SECS = Number(opt("secs", 240));
const PORT = opt("port", process.env.PORT || "8080");
const GSM = opt("gsm", "1");

View file

@ -88,12 +88,12 @@
//
// Usage:
// PORT=8094 node tools/idlebench.mjs [dists] [--runs N] [--max S]
// dists: comma list, default "dist-jit" (the dist the page ships)
// dists: comma list, default "dist" (the dist the page ships)
// PORT=8094 node tools/idlebench.mjs --quick # ~2 min A/B
// PORT=8094 node tools/idlebench.mjs dist --runs 3
// PORT=8094 node tools/idlebench.mjs dist-jit --runs 3 --max 1800
// PORT=8094 node tools/idlebench.mjs dist --runs 3 --max 1800
// PORT=8094 node tools/idlebench.mjs --baseline tests/results/idlebench-<ts>.json
// PORT=8094 node tools/idlebench.mjs dist-jit --board ke800 --max 240
// PORT=8094 node tools/idlebench.mjs dist --board ke800 --max 240
import { chromium } from "playwright-core";
import { createHash } from "node:crypto";
import { readFileSync, writeFileSync, mkdirSync, mkdtempSync, copyFileSync, readdirSync } from "node:fs";
@ -123,9 +123,9 @@ const positional = argv.filter((a, i) => {
const prev = argv[i - 1];
return !(prev && prev.startsWith("--") && VALUE_OPTS.has(prev.slice(2)));
});
const dists = (positional[0] || "dist-jit").split(",");
const dists = (positional[0] || "dist").split(",");
// A dist may be written "<dir>@<query>" to append per-dist query parameters
// (e.g. "dist-jit@env=W64_COMPACT_MEMBERS=100000000"). That makes a KNOB
// (e.g. "dist@env=W64_COMPACT_MEMBERS=100000000"). That makes a KNOB
// A/B interleavable the way a two-build A/B is: EXTRA_Q applies to every
// dist of the invocation and so can only compare across invocations, which
// on a shared host is exactly the unpaired comparison doc/performance.md
@ -558,7 +558,7 @@ for (const d of dists) {
if (hashesOf(d).wasm === "MISSING") {
console.error(`no such dist: site/${distDir(d)}/qemu-system-arm.wasm is missing.\n` +
`The dist list is the first positional argument, e.g.\n` +
` node tools/idlebench.mjs dist-jit-a,dist-jit-b --board ke800`);
` node tools/idlebench.mjs dist-a,dist-b --board ke800`);
process.exit(2);
}
}

View file

@ -10,7 +10,7 @@ const b = await chromium.launch({ headless: true });
const p = await b.newPage();
const lines = [];
p.on("console", m => { const t = m.text(); if (t.startsWith("[qemu]")) lines.push(t.slice(7)); });
await p.goto(`http://127.0.0.1:${port}/?trace=${spec}&debug=1&dist=${process.env.DIST || "dist-jit"}${process.env.EXTRA_Q ? "&" + process.env.EXTRA_Q : ""}`, { waitUntil: "domcontentloaded" });
await p.goto(`http://127.0.0.1:${port}/?trace=${spec}&debug=1&dist=${process.env.DIST || "dist"}${process.env.EXTRA_Q ? "&" + process.env.EXTRA_Q : ""}`, { waitUntil: "domcontentloaded" });
await p.click("#ff-mode-own");
await p.setInputFiles("#fullflash", fullflashFiles);
await p.click("#btn-start");

View file

@ -25,7 +25,7 @@ if (!board) { console.error("unknown --board"); process.exit(2); }
const from = Number(opt("from", 30)); // ignore the boot: count only after this
const spec = process.env.TRACE || "scu,dif,ssc,dmac,gptu,tpu,vic";
const dist = opt("dist", "dist-jit");
const dist = opt("dist", "dist");
const port = process.env.PORT || "8080";
const b = await chromium.launch({ headless: true });

View file

@ -1,6 +1,6 @@
// Key-press response latency, per board.
//
// PORT=8080 node tools/keylag.mjs --board el71 [--dist dist-jit] [--presses 12]
// PORT=8080 node tools/keylag.mjs --board el71 [--dist dist] [--presses 12]
//
// uibench measures throughput while keys are pressed; nothing measured the
// thing a user actually calls lag: how long after the press the screen
@ -44,7 +44,7 @@ const boardId = opt("board", "el71");
const board = BOARDS[boardId];
if (!board) { console.error(`unknown --board ${boardId} (${Object.keys(BOARDS).join(", ")})`); process.exit(2); }
const dist = opt("dist", "dist-jit");
const dist = opt("dist", "dist");
const presses = Number(opt("presses", 12));
const settleS = Number(opt("settle", 90));
const gapMs = Number(opt("gap", 2500)); // quiet time between presses

View file

@ -7,7 +7,7 @@
// values: ["dist", "secs"], flags: ["keep"], positional: 0,
// usage: "node tools/x.mjs [--dist d] [--secs s] [--keep]",
// });
// args.opt("dist", "dist-jit") the value, or the default when the option
// args.opt("dist", "dist") the value, or the default when the option
// is absent or given an empty value
// args.flag("keep") whether the flag was given
// args.positional the bare arguments, in order

View file

@ -10,7 +10,7 @@
// node tools/lockstep-wasm.mjs --keep # keep the run dirs
//
// Requires: the wasm64 dist served on --port (see serve.mjs),
// scripts/build-qemu-wasm64.sh output copied to site/dist-jit/, and the
// scripts/build-qemu-wasm64.sh output copied to site/dist/, and the
// native reference build from scripts/build-native.sh, up to date with the
// qemu source the dist was built from (checked through the
// qemu-source.txt the server serves for the dist; --a-bin picks another
@ -50,7 +50,7 @@ function parseArgs() {
// SRAM (HARD) + a 1MB SDRAM slice (SOFT): keep the 16MB full-range
// default out — the M-digest reads were the first full-gate timeout
mem: "800000+18000:a8000000+100000",
port: process.env.PORT || "8080", dist: "dist-jit",
port: process.env.PORT || "8080", dist: "dist",
aBin: NATIVE_JIT_BIN,
label: "wasm",
env: [],

View file

@ -31,7 +31,7 @@ const busy = process.env.BUSY === "1";
const b = await chromium.launch({ headless: true });
const p = await b.newPage();
// BUSY boots on the real page; otherwise nothing else compiles meanwhile
if (busy) await p.goto(`http://127.0.0.1:${port}/?dist=dist-jit`, { waitUntil: "domcontentloaded" });
if (busy) await p.goto(`http://127.0.0.1:${port}/`, { waitUntil: "domcontentloaded" });
else await gotoBlank(p, `http://127.0.0.1:${port}`);
if (busy) {
await p.click("#ff-mode-own");

View file

@ -2,7 +2,7 @@
// worker: self time per class, so "where does the vCPU go" is one table.
// node tools/profcat.mjs <prof.json> [dist]
import fs from "node:fs";
const [file, dist = "dist-jit"] = process.argv.slice(2);
const [file, dist = "dist"] = process.argv.slice(2);
const profiles = JSON.parse(fs.readFileSync(file));
const syms = new Map();
for (const l of fs.readFileSync(new URL(`../site/${dist}/qemu-system-arm.js.symbols`, import.meta.url), "utf8").split("\n")) {

View file

@ -18,7 +18,7 @@ import { runStamp } from "./lib/results.mjs";
const here = fileURLToPath(new URL(".", import.meta.url));
const argv = process.argv.slice(2);
const opt = (n, d) => { const i = argv.indexOf("--" + n); return i >= 0 && argv[i + 1] ? argv[i + 1] : d; };
const dist = argv.find((a, i) => !a.startsWith("--") && argv[i - 1] !== "--secs") || "dist-jit";
const dist = argv.find((a, i) => !a.startsWith("--") && argv[i - 1] !== "--secs") || "dist";
const secs = Number(opt("secs", 10));
const muted = !argv.includes("--unmuted");
const port = process.env.PORT || "8080";

View file

@ -74,7 +74,7 @@ const argv = process.argv.slice(2);
const opt = (n, d) => { const i = argv.indexOf("--" + n); return i >= 0 && argv[i + 1] ? argv[i + 1] : d; };
const positional = argv.filter((a, i) => !a.startsWith("--") && !(i > 0 && argv[i - 1].startsWith("--")));
const scenarioName = positional[0];
const dists = (positional[1] || "dist-jit").split(",");
const dists = (positional[1] || "dist").split(",");
const runs = Number(opt("runs", 3));
const port = process.env.PORT || "8080";
const keyScale = Number(opt("keyscale", 1));

View file

@ -8,7 +8,7 @@
# count. cgroup cpu.max would be cleaner but /sys/fs/cgroup is read-only
# in this container.
#
# CORES=0-3 SPIN=1 tools/slowhost.sh node tools/idlebench.mjs dist-jit --quick
# CORES=0-3 SPIN=1 tools/slowhost.sh node tools/idlebench.mjs dist --quick
#
# Env: CORES (default 0-3), SPIN spinners per core (default 1 = 50 %).
set -euo pipefail

View file

@ -3,8 +3,8 @@
// timed by timestamping each phase's serial line. The phone-firmware
// boots stay the final gates; this is the A/B loop (seconds per leg).
//
// node tools/tcgbench.mjs # native-jit + dist-jit
// LEGS=native-jit,native-tci,dist-jit node tools/tcgbench.mjs
// node tools/tcgbench.mjs # native-jit + dist
// LEGS=native-jit,native-tci,dist node tools/tcgbench.mjs
// EXTRA_Q="env=NAME=VAL" node tools/tcgbench.mjs # page query: env= sets qemu's environment
// SUITE=quick node tools/tcgbench.mjs # ÷4-iteration smoke image
// (tcgbench-quick.bin, `make -C tests/tcgbench quick install`): ~3 s per
@ -32,7 +32,7 @@ import { median } from "./lib/stats.mjs";
const here = fileURLToPath(new URL(".", import.meta.url));
const ROOT = path.resolve(here, "..");
const port = process.env.PORT || "8080";
const legs = (process.env.LEGS || "native-jit,dist-jit").split(",");
const legs = (process.env.LEGS || "native-jit,dist").split(",");
const icounts = (process.env.ICOUNTS || "0").split(","); // e.g. "0,1": tax matrix
const extraQ = process.env.EXTRA_Q || "";
const runs = Number(process.env.RUNS || 1);

View file

@ -4,7 +4,7 @@
//
// The suite *image* comes from site/dist/tcgisa.bin, or TCGISA_IMAGE (a
// path under site/); the *engine* is whichever dist the page is pointed
// at (`dist-jit`, the wasm64 backend, by default).
// at (`dist`, the wasm64 backend, by default).
// scripts/run-tcg-isa.sh's wasm leg runs this, with an image of its own.
//
// The suite boots -M versatilepb, prints TAP + value dumps into
@ -25,7 +25,7 @@ import { chromium } from "playwright-core";
import { bounded, pageCall } from "./lib/page.mjs";
const port = process.argv[2] || "8080";
const dist = process.argv[3] || "dist-jit";
const dist = process.argv[3] || "dist";
const outFile = process.argv[4] || null;
const envs = process.argv.slice(5);
const image = process.env.TCGISA_IMAGE || "dist/tcgisa.bin";

View file

@ -6,7 +6,7 @@
// node tools/ui-acceptance.mjs [--flash id] # everything, including a real boot
// SKIP_BOOT=1 node tools/ui-acceptance.mjs
//
// The boot section needs a built site/dist-jit and a Siemens fullflash:
// The boot section needs a built site/dist and a Siemens fullflash:
// --flash names one by its tools/lib/boards.mjs id (the gate pins one),
// else the test fullflash (tools/testflash.local.json or TESTFLASH=).
// Everything else is pure UI.

View file

@ -1,6 +1,6 @@
// Per-board UI throughput meter — the S75 stopwatch for every phone.
//
// PORT=8080 node tools/uibench.mjs --board el71 [--dist dist-jit]
// PORT=8080 node tools/uibench.mjs --board el71 [--dist dist]
//
// idlebench measures boots. Nothing
// measured the *steady-state* cost of a board's UI, which is what a user
@ -64,7 +64,7 @@ if (!board && !opt("flash", null)) {
const FLASH = opt("flash", null) ?? here + "../fullflashes/" + board.flash;
const SIDECARS = opt("flash") ? [] : board.sidecars.map((f) => here + "../fullflashes/" + f);
const dist = opt("dist", "dist-jit");
const dist = opt("dist", "dist");
const measureS = Number(opt("measure", 20));
const idleMax = Number(opt("idlemax", 300));
const idleFloor = Number(opt("floor", 20));

View file

@ -14,13 +14,13 @@ import { BUILD } from "./lib/build-dirs.mjs";
// wasm-function[N] -> C symbol map (emcc --emit-symbol-map sidecar; the
// wasm binary carries no name section). It has to be the map of the build
// being served: ?dist=<d> (or PROF_DIST) reads site/<d>/ and nothing else;
// without one, the page's default site/dist-jit/, then the build tree it is
// without one, the page's default site/dist/, then the build tree it is
// copied from ($WEB_BUILD/qemu-wasm64, scripts/ninja-fast.sh).
const qDist = (/(?:^|&)dist=([^&]+)/.exec(process.argv[3] || "") || [])[1] || process.env.PROF_DIST;
const SYMS = "qemu-system-arm.js.symbols";
const ROOT = fileURLToPath(new URL("..", import.meta.url));
const symPaths = qDist ? [path.join(ROOT, "site", qDist, SYMS)]
: [path.join(ROOT, "site", "dist-jit", SYMS), path.join(BUILD, "qemu-wasm64", SYMS)];
: [path.join(ROOT, "site", "dist", SYMS), path.join(BUILD, "qemu-wasm64", SYMS)];
const fnSyms = new Map();
for (const p of symPaths) {
try {