Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.
C
mk-host: apply the ir3 patch here too, since this is where ir3's numbers come from
vcvkk9eeeadf2aadc
diff --git a/README.md b/README.mdindex b0202e0..b327d42 100644--- a/README.md+++ b/README.md@@ -542,7 +542,7 @@ P3 поверхности кадров копировались, и этого(`AGXCompilerCore`, 137 строк-суффиксов), а не угадан — так нашлась и одна ошибка в наших догадках.Операции проверены численно — на хосте: из 119 разных `air.*`, что встречаются в корпусе, 78 прогнаны-по одной против эталона вне этого дерева, 71 из них совпадает с функциями C на каждом из 45 652 случаев,+по одной против эталона вне этого дерева, 71 из них совпадает с функциями C на каждом из 45 697 случаев,47 — ещё и когда их **исполняет** softpipe, а не складывает оптимизатор (2 586 случаев), 10 атомиков ибарьер — на написанных для них ядрах, 13 текстурных операций — точно, по нескольким текселям каждая.**И все 78 прогнаны на самом Adreno телефона**, причём дважды: как порт стоял, и с однострочнойdiff --git a/docs/air.md b/docs/air.mdindex f7c85af..ea1f82e 100644--- a/docs/air.md+++ b/docs/air.md@@ -30,7 +30,7 @@ And of the 119 distinct `air.*` operations those modules call (`tools/air/intrin| | of 119 || --- | --- || checked numerically, one operation at a time, against a reference outside this tree | 78 |-| of those, exactly defined and agreeing on every case (45 652 cases) | 71 |+| of those, exactly defined and agreeing on every case (45 697 cases) | 71 || of those, approximate, so measured against libm and nothing concluded | 7 || of those, also *run* by a Gallium driver rather than folded (softpipe, 2 586 cases) | 47 || of those, run **on the phone's own Adreno** (714 cases) and agreeing there | 61 |@@ -48,11 +48,11 @@ functions and not entry points at all.- **The arithmetic operations are checked; two of them have now been checked against theAdreno, and the other 76 have not.** 71 of the corpus's declarations agree with C's own- functions on every one of 45 652 cases, and 47 of them agree again when *executed* by softpipe+ functions on every one of 45 697 cases, and 47 of them agree again when *executed* by softpipeinstead of folded — which is a real answer to what used to be the largest hole here (section 4,item 4), and found three bugs getting there. But those two engines are both on an x86 host. Anopcode whose Adreno instruction differs from what `nir_opt_constant_folding` and TGSI compute is- invisible to all 48 238 of those cases, and the 24 narrow-type declarations softpipe cannot run+ invisible to all 48 283 of those cases, and the 24 narrow-type declarations softpipe cannot runat all are exactly the ones where ir3 differs most from it.On 20 October that stopped being true. All 78 declarations ran on the phone's own Adreno, and@@ -610,7 +610,7 @@ Three references, each independent of the translator:--eval`. The reference is the C library's own `roundf`, `floorf`, `fmaxf`, `ldexpf` and theIEEE definitions, evaluated at the operation's own precision.- **71 exactly defined operations agree on every one of 45 652 cases; none differ.** Seven are+ **71 exactly defined operations agree on every one of 45 697 cases; none differ.** Seven areapproximate (`fast_sin`, `fast_cos`, `fast_exp`, `fast_pow`, `fast_atan2`) and are reportedwith their worst distance from libm and counted as nothing — see below.diff --git a/tools/air/mk-host.sh b/tools/air/mk-host.shindex acc41ee..f78b7d8 100755--- a/tools/air/mk-host.sh+++ b/tools/air/mk-host.sh@@ -24,7 +24,12 @@ SRC=$B/mesa-$VERSIONmkdir -p "$B"cd "$B"-PATCHES=$(cat "$ROOT"/tools/mesa/air*.patch | sha256sum | cut -d' ' -f1)+# air-*.patch is the frontend and the ir3 entry point; ir3-*.patch is a fix to ir3 itself, and it+# belongs here as much as in the cross build -- this tool is where the corpus's "compiled by ir3"+# column comes from and where its Adreno instructions are read, so a host ir3 that differs from the+# device's would make both of those say something about a compiler nothing runs. The other patches+# in tools/mesa are for the Darwin cross build and are deliberately left out.+PATCHES=$(cat "$ROOT"/tools/mesa/air*.patch "$ROOT"/tools/mesa/ir3-*.patch | sha256sum | cut -d' ' -f1)if [ ! -d "$SRC" ] || [ "$(cat "$SRC/.air-patches" 2>/dev/null)" != "$PATCHES" ]; thenif [ ! -f mesa-$VERSION.tar.xz ]; then# the cross build may already have fetched it@@ -38,7 +43,7 @@ if [ ! -d "$SRC" ] || [ "$(cat "$SRC/.air-patches" 2>/dev/null)" != "$PATCHES" ]echo "$SHA256 mesa-$VERSION.tar.xz" | sha256sum -c --quietrm -rf "$SRC" buildtar xJf mesa-$VERSION.tar.xz- for p in "$ROOT"/tools/mesa/air-*.patch; do+ for p in "$ROOT"/tools/mesa/air-*.patch "$ROOT"/tools/mesa/ir3-*.patch; dopatch -s --no-backup-if-mismatch -d "$SRC" -p1 < "$p"done