From 79cf4fb1b7ce3740b7374b7ae59cbb1eac5c5ffb Mon Sep 17 00:00:00 2001 From: leusernamealadeen Date: Tue, 24 Nov 2026 07:57:25 -0800 Subject: [PATCH 01/12] ci: fetch pinned kernel from publisher repo --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 08fe5cf9..f46315cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -144,13 +144,13 @@ jobs: for t in $(git ls-files '*/tests/host.sh' | grep -v '^kernel/'); do echo "== $t"; "$t"; done - name: Kernel from the kernel release, when one is pinned # kernel/release-kernel.txt (optional): "KERNEL_TAG SHA256" of an xnu-.tar.zst that - # kernel/publish.sh uploaded from a build machine. The package step checks its build record again. + # kernel/publish.sh uploaded from a build machine to akshaynexus/OneiOS. The package step checks its build record again. run: | set -euo pipefail [ -s kernel/release-kernel.txt ] || { echo "no kernel pinned: runtime only"; exit 0; } read -r ktag ksha < kernel/release-kernel.txt mkdir -p out/kernel/current out/kernel/dl - gh release download "$ktag" --repo "$GITHUB_REPOSITORY" --pattern 'xnu-*.tar.zst' --dir out/kernel/dl + gh release download "$ktag" --repo akshaynexus/OneiOS --pattern 'xnu-*.tar.zst' --dir out/kernel/dl echo "$ksha $(ls out/kernel/dl/xnu-*.tar.zst)" | sha256sum -c - zstd -dc out/kernel/dl/xnu-*.tar.zst | tar -x -C out/kernel/current - name: Package (refuses Apple files and what Android cannot load) From 076c1a324bdb3c9db2f97ba9b0882459315c50f9 Mon Sep 17 00:00:00 2001 From: leusernamealadeen Date: Tue, 24 Nov 2026 08:15:49 -0800 Subject: [PATCH 02/12] Include Metal build in workflow --- .github/workflows/release.yml | 130 ++++++++++++++++++++++++++++++++-- docs/building.md | 6 +- docs/releases.md | 22 +++--- runtime/package.sh | 9 +-- runtime/package/test.sh | 8 +-- 5 files changed, 151 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f46315cf..9a335e6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,9 @@ # OneiOS's one workflow (docs/releases.md, "CI and releases"): the runtime package and the OneOS app (the fork, -# submodule app/) built at the same time on two runners, and a release that carries both. +# submodule app/) built in parallel, and a release that carries both. # -# plan ──┬── runtime (ubuntu-24.04) script checks, host tests, runtime/package.sh, the Apple-file refusal, -# │ elf-check, drm2kgsl, the package's members, bin/oneios-tool for the -# │ phone and oneios-tool-VERSION-android-arm64 beside the package +# plan ──┬── metal (xcode-27) build the iPhone18,2 Metal and camera plug-ins from pinned sources +# ├── runtime (ubuntu-24.04) script checks, host tests, package the Metal artifact and kernel, +# │ the Apple-file refusal, elf-check, drm2kgsl and package contents # ├── apk (ubuntu-24.04) app/ at the head of the fork's branch, JDK 21, tribalfs' packages, # │ ./gradlew test assembleFullDebug, the APK's assets checked # ├── apk-macos (macos-15) ./gradlew test of the same checkout on a Mac (core:root's script tests) @@ -85,9 +85,97 @@ jobs: echo "release=$release version=$version runtime=$runtime apk=$apk" { echo "release=$release"; echo "version=$version"; echo "runtime=$runtime"; echo "apk=$apk"; } >> "$GITHUB_OUTPUT" - runtime: + metal: needs: plan if: needs.plan.outputs.runtime == 'true' + runs-on: xcode-27 + timeout-minutes: 180 + permissions: + contents: read + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Xcode and the iOS 27 SDK + run: | + set -euo pipefail + sudo xcode-select --switch /Applications/Xcode_27.2.app/Contents/Developer + xcodebuild -version + xcodebuild -version | grep -qx 'Xcode 27.2' || { echo "::error::Metal is pinned to Xcode 27.2 in kernel/pins.sh"; exit 1; } + sdk=$(xcrun --sdk iphoneos --show-sdk-version) + [[ "$sdk" == 27.* ]] || { echo "::error::the S24 Ultra plug-ins need the iOS 27 SDK; Xcode selected iOS $sdk"; exit 1; } + echo "Metal build uses iOS SDK $sdk and iPhone18,2 24A446 hooks" + - name: Metal build tools + run: | + set -euo pipefail + brew install ninja glslang shaderc spirv-tools bison llvm + echo "$(brew --prefix llvm)/bin" >> "$GITHUB_PATH" + echo "$(brew --prefix bison)/bin" >> "$GITHUB_PATH" + - name: Python tools for Mesa and the Metal bridge + run: | + set -euo pipefail + python3 -m venv "$RUNNER_TEMP/oneios-metal-venv" + "$RUNNER_TEMP/oneios-metal-venv/bin/python" -m pip install --upgrade pip + "$RUNNER_TEMP/oneios-metal-venv/bin/python" -m pip install meson mako pyyaml + echo "$RUNNER_TEMP/oneios-metal-venv/bin" >> "$GITHUB_PATH" + - name: Rust 1.98.0 and rust-src for the arm64e bridge + run: | + set -euo pipefail + rustup toolchain install 1.98.0 --profile minimal + rustup +1.98.0 component add rust-src + rustup default 1.98.0 + rustc --version + - name: Pinned Metal and kernel-base sources + run: | + set -euo pipefail + kernel/fetch.sh Droid-VM-UniXNU + scripts/setup/get-references.sh NativeMetal NativeAdreno NativeMobileDisplay AdrenoPM4 metal2vulkan mesa-droidvm + - name: Build the S24 Ultra Metal plug-in and capture module + env: + ONEIOS_METAL_TARGET: iPhone18,2 24A446 + IOS_MIN: '27.0' + IOS_TARGET: arm64e-apple-ios27.0 + JOBS: '6' + run: | + set -euo pipefail + userland/metal/build.sh all + userland/camera/build.sh out/userland/camera + bundle=out/userland/NativeAdrenoMetal.bundle + test -x "$bundle/NativeAdrenoMetal" + test -f "$bundle/libvulkan_freedreno.dylib" + test "$(cat "$bundle/oneios-target")" = 'iPhone18,2 24A446' + test -f out/userland/NativeAdrenoMetal.build.json + test -s out/userland/camera/H9ISP.mediacapture + grep -q 'iPhone18,2 24A446' out/userland/NativeAdrenoMetal.build.json + - name: Prepare the runtime artifact and its license texts + run: | + set -euo pipefail + base=out/metal-runtime + mkdir -p "$base/metal" "$base/camera" "$base/licenses" + cp -R out/userland/NativeAdrenoMetal.bundle "$base/metal/" + cp out/userland/NativeAdrenoMetal.build.json "$base/metal/" + cp out/userland/camera/H9ISP.mediacapture "$base/camera/" + for f in NativeMetal/LICENSE metal2vulkan/LICENSE metal2vulkan/LICENSE-GPL-2.0 \ + metal2vulkan/LICENSE-GPL-3.0 metal2vulkan/LICENSE-LGPL-3.0 \ + mesa-droidvm/LICENSING.md mesa-droidvm/licenses Droid-VM-UniXNU/LICENSE \ + NativeAdreno/LICENSE AdrenoPM4/LICENSE NativeMobileDisplay/LICENSE; do + src="external/$f" dst="$base/licenses/$f" + test -e "$src" || { echo "::error::missing pinned license source $src"; exit 1; } + mkdir -p "$(dirname "$dst")" + cp -R "$src" "$dst" + done + tar -czf out/oneios-metal-runtime.tar.gz -C "$base" metal camera licenses + (cd out && shasum -a 256 oneios-metal-runtime.tar.gz > oneios-metal-runtime.tar.gz.sha256) + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: oneios-metal-runtime + path: | + out/oneios-metal-runtime.tar.gz + out/oneios-metal-runtime.tar.gz.sha256 + if-no-files-found: error + retention-days: 14 + + runtime: + needs: [plan, metal] + if: needs.plan.outputs.runtime == 'true' runs-on: ubuntu-24.04 timeout-minutes: 45 env: @@ -116,6 +204,20 @@ jobs: set -euo pipefail [ "$(git ls-files -s app | cut -d' ' -f1)" = 160000 ] || { echo "::error::app is not a submodule"; exit 1; } [ -z "$(ls -A app 2>/dev/null)" ] || { echo "::error::app/ has files: the runtime job must not check out the fork"; exit 1; } + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + name: oneios-metal-runtime + path: out/metal-artifact + - name: Verify and unpack the Metal runtime artifact + run: | + set -euo pipefail + (cd out/metal-artifact && shasum -a 256 -c oneios-metal-runtime.tar.gz.sha256) + mkdir -p out/metal-runtime + tar -xzf out/metal-artifact/oneios-metal-runtime.tar.gz -C out/metal-runtime + test -x out/metal-runtime/metal/NativeAdrenoMetal.bundle/NativeAdrenoMetal + test -f out/metal-runtime/metal/NativeAdrenoMetal.bundle/libvulkan_freedreno.dylib + test "$(cat out/metal-runtime/metal/NativeAdrenoMetal.bundle/oneios-target)" = 'iPhone18,2 24A446' + test -s out/metal-runtime/camera/H9ISP.mediacapture - name: No firmware, no large binaries and no Python in git run: .github/scripts/check-tracked-files.sh - name: Script syntax @@ -134,6 +236,8 @@ jobs: scripts/setup/get-references.sh virglrenderer test -f external/virglrenderer/src/drm/drm2kgsl/drm2kgsl_renderer.c || { echo "virglrenderer checkout has no drm2kgsl"; exit 1; } - name: Host tests + env: + METAL_LICENSES_DIR: ${{ github.workspace }}/out/metal-runtime/licenses run: | set -euo pipefail runtime/package/elf-check-test.sh @@ -154,7 +258,23 @@ jobs: echo "$ksha $(ls out/kernel/dl/xnu-*.tar.zst)" | sha256sum -c - zstd -dc out/kernel/dl/xnu-*.tar.zst | tar -x -C out/kernel/current - name: Package (refuses Apple files and what Android cannot load) + env: + METAL_DIR: ${{ github.workspace }}/out/metal-runtime/metal + CAMERA_DIR: ${{ github.workspace }}/out/metal-runtime/camera + METAL_LICENSES_DIR: ${{ github.workspace }}/out/metal-runtime/licenses + REQUIRE_METAL: '1' run: runtime/package.sh "$VERSION" + - name: The runtime contains the matching Metal and camera plug-ins + run: | + set -euo pipefail + d=$(mktemp -d) + zstd -dc "out/release/oneios-runtime-$VERSION-arm64.tar.zst" | tar -x -C "$d" + test -x "$d/lib/guest/NativeAdrenoMetal.bundle/NativeAdrenoMetal" + test -f "$d/lib/guest/NativeAdrenoMetal.bundle/libvulkan_freedreno.dylib" + test "$(cat "$d/lib/guest/NativeAdrenoMetal.bundle/oneios-target")" = 'iPhone18,2 24A446' + test -s "$d/lib/guest/camera/H9ISP.mediacapture" + test -s "$d/lib/guest/NativeAdrenoMetal.build.json" + jq -e '.metal.target == "iPhone18,2 24A446" and .camera.path == "lib/guest/camera"' "$d/runtime.json" - name: The package's xnuhost and gpuctl have drm2kgsl run: | set -euo pipefail diff --git a/docs/building.md b/docs/building.md index 4849a75a..9f06b095 100644 --- a/docs/building.md +++ b/docs/building.md @@ -1095,14 +1095,14 @@ second time). ## 8. Releases A tag `vN.N.N` on `main` (or a dispatch with a version) runs `.github/workflows/release.yml`, which builds the -runtime package with the pinned NDK and the fork's APK (submodule `app/`, the head of `oneios`) on two runners at -once, and attaches both with their `.sha256` to the release. No kernel, no image, no package set. See +S24 Ultra Metal and camera plug-ins with Xcode 27.2, then packages them into the runtime alongside the pinned kernel; +the fork's APK (submodule `app/`, the head of `oneios`) builds in parallel. No image or package set is released. See [releases.md](releases.md). `scripts/release/release.sh VERSION [--build-only]` (run under `scripts/bg.sh`) builds the same files on the build machine, runs CI's checks and the host tests in parallel, and publishes the release without waiting for the runners. Its runtime carries the Metal plug-in and the capture plug-in, built from HEAD in the runtime lane (`userland/metal/build.sh`, `userland/camera/build.sh`; `--metal-dir DIR` takes a built one, `--no-metal` leaves them -out); CI's runtime has neither, so a phone-made image with a CI runtime composites on the CPU. It signs the APK with the debug key CI uses, `secrets/oneios-debug.keystore`, which is git-ignored (releases.md, +out); CI builds the same plug-ins for iPhone18,2 / 24A446 and requires them in the runtime artifact. It signs the APK with the debug key CI uses, `secrets/oneios-debug.keystore`, which is git-ignored (releases.md, "Releasing from a build machine" and "The debug key"). `runtime/package.sh VERSION` builds the phone's `bin/oneios-tool` with `ONEIOS_VERSION=VERSION`: its `serve` hello's `tool` is the release's version (up to v0.1.16 every release said the crate's `0.1.0`; issue 75). diff --git a/docs/releases.md b/docs/releases.md index d3664aff..c9d0e03a 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -37,7 +37,7 @@ window) around a ustar archive of regular files, `runtime.json` first, no top fo | `lib/profiles/*.toml` | this repository's IPSW profiles (`profiles/`: the members' names, sizes and hashes, no Apple file), and its host records (`profiles/host-*.toml`: what is known of each host phone, read by no code; the S24 Ultra's names every model number, the SM-S928W too), for the phone's `oneios-tool serve` `fetch`: the OneOS app's Make iOS image fetches the IPSW's members with `$STAGE/runtime/lib/profiles/ios-27.0.1-iPhone18-2.toml`, and on a Galaxy A56 with `ios-16.5-a56.toml` (iOS 16.5 20F66, Apple's pins since 2026-11-23; docs/a56.md; `runtime/package/test.sh` checks it is packed) (a package path has no comma; `runtime/package.sh` step 1c) | | `scripts/*` | `runtime/scripts/*`, when there are any | | `kernel/xnu.macho`, `kernel/xnu.macho.build.json` | the XNU that `kernel/` builds from Apple's open source, and its build record. Only when a kernel was built | -| `lib/guest/NativeAdrenoMetal.bundle/*`, `lib/guest/NativeAdrenoMetal.build.json`, `lib/guest/camera/H9ISP.mediacapture`, `lib/guest/NOTICE` | the guest's own iOS plug-ins (since 2026-11-24, when `runtime/package.sh` is given `METAL_DIR` and `CAMERA_DIR`; `scripts/release/release.sh` builds them from HEAD): the Metal plug-in as `userland/metal/build.sh` leaves it, with its build record (target, CDHashes, the sources' pins), and the capture plug-in. Our builds from source, linked against stubs of the SDK, signed ad hoc; no Apple code (the check below). The phone's Make iOS image seeds them into the image it makes when the bundle's `oneios-target` is that image's ([image-format.md](image-format.md), "The Metal plug-in of an image made on the phone"). `lib/guest/NOTICE`: the licences of the sources (metal2vulkan GPL-2.0-or-later or LGPL-3.0-or-later, Mesa MIT and the rest of its LICENSING.md, NativeMetal, NativeAdreno, AdrenoPM4 MIT, Droid-VM-UniXNU, NativeMobileDisplay BSD-2-Clause-Patent; their texts from `external/`) and where their source is (URL and commit). About 36 MB unpacked | +| `lib/guest/NativeAdrenoMetal.bundle/*`, `lib/guest/NativeAdrenoMetal.build.json`, `lib/guest/camera/H9ISP.mediacapture`, `lib/guest/NOTICE` | the guest's own iOS plug-ins, built by CI for iPhone18,2 / iOS build 24A446 from pinned sources: the Metal plug-in as `userland/metal/build.sh` leaves it, with its build record (target, CDHashes, source pins), and the capture plug-in. Both are built from source and signed ad hoc; no Apple code (the check below). Local builds can pass `METAL_DIR` and `CAMERA_DIR` to `runtime/package.sh`; `scripts/release/release.sh` builds them from HEAD. The phone's Make iOS image seeds them when the bundle target matches ([image-format.md](image-format.md), "The Metal plug-in of an image made on the phone"). `lib/guest/NOTICE` lists the sources and includes their license texts; CI transfers only those texts via `METAL_LICENSES_DIR`, while local packaging reads them from `external/`. About 36 MB unpacked | | `NOTICE`, `LICENSE` | licences; with a kernel, the APSL notice (`kernel/NOTICE.kernel`) | ## What is never in a release @@ -195,24 +195,28 @@ One workflow, `.github/workflows/release.yml` ("build and release"; `ci.yml` and before 2026-11-15 were merged into it). Its jobs: ``` -plan ──┬── runtime ubuntu-24.04 the runtime package and its checks +plan ──┬── metal xcode-27 the iPhone18,2 plug-ins, built with Xcode 27.2 from pinned sources ├── apk ubuntu-24.04 the OneOS app (submodule app/) and its checks ├── apk-macos macos-15 ./gradlew test of the same app on a Mac + ├── runtime ubuntu-24.04 needs metal; the runtime package and its checks └───────────── release needs runtime and apk; a tag or a dispatch only ``` -`runtime`, `apk` and `apk-macos` start together after `plan` and run on their own runners. +`metal`, `apk` and `apk-macos` start together after `plan`; `runtime` starts after the Metal artifact is verified. | Trigger | Builds | Releases | |---|---|---| -| a pull request, a push to `main` | runtime, apk, apk-macos | nothing (the runtime package and the APK are artifacts for 14 days) | -| a tag `vN.N.N` or `vN.N.N-suffix` on `main` | all three | the runtime and the APK on the release of the tag | -| a dispatch on `main` (Actions, "build and release", Run workflow; inputs `version` and `both` / `runtime only` / `apk only`) | what was asked (apk-macos with the APK) | the release `v`, its tag made at the dispatched commit when missing | +| a pull request, a push to `main` | metal, runtime, apk, apk-macos | nothing (the Metal artifact, runtime package and APK are artifacts for 14 days) | +| a tag `vN.N.N` or `vN.N.N-suffix` on `main` | all four jobs | the runtime and the APK on the release of the tag | +| a dispatch on `main` (Actions, "build and release", Run workflow; inputs `version` and `both` / `runtime only` / `apk only`) | what was asked (Metal with runtime; apk-macos with APK) | the release `v`, its tag made at the dispatched commit when missing | - **plan**: whether the run releases, the version (`0.0.0-ci` when not), what it builds. A release's version must be `N.N.N[-suffix]` and its commit on `main`. A tag whose release exists already (published from a build machine by `scripts/release/release.sh`, "Releasing from a build machine" below) does not release again: its run builds and tests only. +- **metal**: Xcode 27.2 on the `xcode-27` runner, with pinned Rust, Python, Mesa and Metal source references. Builds + `NativeAdrenoMetal.bundle` and `H9ISP.mediacapture` for iPhone18,2 / 24A446, verifies the target, and uploads a + checksum-protected archive with source license texts. The runtime job needs this artifact. - **runtime**: what `ci.yml` and the old `release.yml` did, on every build. `app/` must be an empty submodule folder (this job never checks the fork out); no firmware and no Python in git (`check-tracked-files.sh`: a tracked `*.py`, or an executable with a python shebang, fails it since 2026-11-21); `bash -n`, `shellcheck -S error`; NDK 28.2.13676358, Rust and @@ -226,8 +230,10 @@ plan ──┬── runtime ubuntu-24.04 the runtime package and its check --self-test`; every executable `*/tests/host.sh` of another area, among them `runtime/tests/host.sh`: the Rust workspace's `cargo test`, `cargo fmt --check`, `cargo clippy -D warnings` and `runtime/xnuhost/check-arm64.sh smoke check`); the pinned kernel when - `kernel/release-kernel.txt` names one; `runtime/package.sh ` (the Apple-file refusal and the elf-check of - the stage, and `bin/oneios-tool` built for the phone); the drm2kgsl check and `runtime/package/elf-check.sh` on + `kernel/release-kernel.txt` names one (fetched from `akshaynexus/OneiOS`, where `kernel/publish.sh` publishes it); + `runtime/package.sh ` with `REQUIRE_METAL=1` and the Metal/camera artifact (the Apple-file refusal, plug-in + manifest and elf-check of the stage, plus `bin/oneios-tool` built for the phone); the drm2kgsl check and + `runtime/package/elf-check.sh` on the unpacked archive; the members check (above); `.github/scripts/check-phone-tool.sh ` ("oneios-tool for the phone", below). Artifact `oneios-runtime`: the `.tar.zst`, its `.sha256`, `.runtime.json`, and `oneios-tool--android-arm64` with its `.sha256`. Its limit is 45 min (the tool's Android build comes on diff --git a/runtime/package.sh b/runtime/package.sh index c4f584b2..595b9969 100755 --- a/runtime/package.sh +++ b/runtime/package.sh @@ -30,7 +30,7 @@ # Env: ANDROID_NDK_ROOT (default $HOME/Android/Sdk/ndk/28.2.13676358, on macOS $HOME/Library/Android/sdk/ndk/...; # the revision is checked; runtime/build.sh gets it as NDK unless NDK is set), ANDROID_API (35), # KERNEL_DIR, OUT_DIR (out/release; a relative one is taken from the current folder), SOURCE_DATE_EPOCH (default: the commit time), -# METAL_DIR, CAMERA_DIR, REQUIRE_METAL (step 3b; neither given: no lib/guest/), +# METAL_DIR, CAMERA_DIR, METAL_LICENSES_DIR (default: $ROOT/external), REQUIRE_METAL (step 3b; neither given: no lib/guest/), # PACKAGE_EXTRA_DIR (a folder copied into the package as it is; used by the tests). set -euo pipefail ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) @@ -179,6 +179,7 @@ GUEST=$STAGE/lib/guest HAVE_METAL=0 if [ -n "${METAL_DIR:-}" ]; then B=$METAL_DIR/NativeAdrenoMetal.bundle + METAL_LICENSES_DIR=${METAL_LICENSES_DIR:-$ROOT/external} [ -f "$B/NativeAdrenoMetal" ] && [ -f "$B/oneios-target" ] && [ -f "$METAL_DIR/NativeAdrenoMetal.build.json" ] || { echo "package: METAL_DIR=$METAL_DIR holds no whole NativeAdrenoMetal.bundle (NativeAdrenoMetal, oneios-target) with NativeAdrenoMetal.build.json beside it (userland/metal/build.sh)" >&2; exit 1; } mkdir -p "$GUEST" @@ -204,11 +205,11 @@ if [ -n "${METAL_DIR:-}" ]; then for f in NativeMetal/LICENSE metal2vulkan/LICENSE metal2vulkan/LICENSE-GPL-2.0 metal2vulkan/LICENSE-GPL-3.0 \ metal2vulkan/LICENSE-LGPL-3.0 mesa-droidvm/LICENSING.md mesa-droidvm/licenses Droid-VM-UniXNU/LICENSE \ NativeAdreno/LICENSE AdrenoPM4/LICENSE NativeMobileDisplay/LICENSE; do - p=$ROOT/external/$f - [ -e "$p" ] || { echo "package: no $p: the Metal plug-in's licence texts come from external/ (scripts/setup/get-references.sh)" >&2; exit 1; } + p=$METAL_LICENSES_DIR/$f + [ -e "$p" ] || { echo "package: no $p: the Metal plug-in's licence texts come from the pinned source checkouts" >&2; exit 1; } # (a folder: every file below it, sorted) while IFS= read -r q; do - printf '\n==== %s\n\n' "${q#"$ROOT"/external/}"; cat "$q" + printf '\n==== %s\n\n' "${q#"$METAL_LICENSES_DIR"/}"; cat "$q" done < <(find "$p" -type f | LC_ALL=C sort) done } > "$GUEST/NOTICE" diff --git a/runtime/package/test.sh b/runtime/package/test.sh index f53ba2f5..5e0ddebc 100755 --- a/runtime/package/test.sh +++ b/runtime/package/test.sh @@ -150,9 +150,8 @@ zstd -dc "$P" | tar -xO NOTICE | grep -q 'Apple Public Source License' || fail " ok "own kernel accepted, APSL notice present" # 5. The guest's plug-ins (METAL_DIR, CAMERA_DIR: lib/guest/): made-up signed Mach-Os (`debug fixture`), taken and named -# in runtime.json; Apple's code or an executable there refused. lib/guest/NOTICE takes the licence texts from -# external/ (scripts/setup/get-references.sh): without those checkouts (CI's runtime job fetches virglrenderer only) -# this part is not run, and says so. +# in runtime.json; Apple's code or an executable there refused. lib/guest/NOTICE takes licence texts from +# METAL_LICENSES_DIR (default external/); CI supplies the pinned licence files from the Metal build job. guest_dir() { # DIR TARGET: userland/metal/build.sh's output folder, and DIR/camera as userland/camera/build.sh's local d=$1 b=$1/NativeAdrenoMetal.bundle p t mkdir -p "$b" "$d/camera" @@ -166,7 +165,8 @@ guest_dir() { # DIR TARGET: userland/metal/build.sh's output folder, and DIR/cam printf '{"bundle": "NativeAdrenoMetal.bundle", "target": "%s", "files": {"NativeAdrenoMetal": {"cdhash": "%s"}, "libvulkan_freedreno.dylib": {"cdhash": "%s"}}, "cdhashes": ["%s", "%s"], "sources": {"NativeMetal": "b0d6a07a3da3e23486593aff235904177e94a3ff"}}\n' \ "$2" "$p" "$t" "$p" "$t" > "$d/NativeAdrenoMetal.build.json" } -if [ -f "$ROOT/external/metal2vulkan/LICENSE-GPL-2.0" ] && [ -f "$ROOT/external/mesa-droidvm/LICENSING.md" ]; then +METAL_LICENSES_DIR=${METAL_LICENSES_DIR:-$ROOT/external} +if [ -f "$METAL_LICENSES_DIR/metal2vulkan/LICENSE-GPL-2.0" ] && [ -f "$METAL_LICENSES_DIR/mesa-droidvm/LICENSING.md" ]; then rm -rf "$T/extra" "$OUT_DIR" "$T/g" guest_dir "$T/g" "iPhone18,2 24A446" METAL_DIR=$T/g CAMERA_DIR=$T/g/camera "$ROOT/runtime/package.sh" $V > "$T/log" 2>&1 || { cat "$T/log"; fail "package with the guest plug-ins"; } From 84cb2efc8f408b9e48bac59b5df8b8d2be8bf25f Mon Sep 17 00:00:00 2001 From: leusernamealadeen Date: Tue, 24 Nov 2026 11:02:07 -0800 Subject: [PATCH 03/12] Force Refresh-Rate --- runtime/display/README.md | 13 ++++++----- runtime/display/java/OneiOSDisplay.java | 31 +++++++++++++++++-------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/runtime/display/README.md b/runtime/display/README.md index b9b3b0ff..83c54142 100644 --- a/runtime/display/README.md +++ b/runtime/display/README.md @@ -85,14 +85,15 @@ NDK's `ANativeWindow` on that `Surface`, from the mapped memfd straight into the 1440x3120: 1436x3120 at x = 2). Both layers are at the top of the built-in display's stack. - **The panel.** The modes come from surfaceflinger (`DisplayControl`, the way scrcpy reads them): the active one, and the native one, which is the largest the panel has at its highest refresh rate. With `--takeover` (a - session: system_server is gone) a panel that One UI left in a lower mode (FHD+ 1080x2340 is One UI's default - resolution setting) is put in the native mode: the display's desired mode specs are read, their default mode - replaced and their refresh ranges opened to that mode's rate, and written back + session: system_server is gone) the helper requests the native mode and opens its refresh ranges on every takeover, + including when One UI left the phone at native resolution but capped app refresh at 60 Hz. The display's desired + mode specs are read, their default mode replaced and their refresh ranges opened to that mode's rate, and written back (`SurfaceControl.setDesiredDisplayModeSpecs`); the helper waits up to a second for the mode to become active. Then the display's projection is set to the active mode, unrotated, so the layer space is the panel's own - pixels whatever rotation One UI left. If the mode is refused the panel stays as it was and the frame is - scaled. The return restarts surfaceflinger, which forgets both. Without `--takeover` nothing of the display is - changed and the logical size comes from the display manager. The layer votes for the mode's highest refresh + pixels whatever rotation One UI left. The helper checks the active mode id as well as its size, so it waits for the + requested mode when either differs. If the mode is refused the panel stays as it was and the frame is + scaled only when its size differs. The return restarts surfaceflinger, which forgets both. Without `--takeover` nothing + of the display is changed and the logical size comes from the display manager. The layer votes for the mode's highest refresh rate (`setFrameRate`, 120 Hz on this panel), which is the rate the guest's vsync tick runs at. Whether One UI's resolution setting is a panel mode or only a logical size on this phone is not known; the helper's `panel modes: active ..., native ...` line of the first run says. diff --git a/runtime/display/java/OneiOSDisplay.java b/runtime/display/java/OneiOSDisplay.java index 8a71346c..917c8fee 100644 --- a/runtime/display/java/OneiOSDisplay.java +++ b/runtime/display/java/OneiOSDisplay.java @@ -207,24 +207,35 @@ private static void quiet(Object target, String method) { */ private static int[] panel(Object transaction, boolean project, boolean takeover, int[] logical) { Object token = null; - int[] mode = null; // active width, height, hz; native width, height, hz, mode id + int[] mode = null; // active width, height, max Hz; native width, height, max Hz, ids try { Object[] display = display(); token = display[1]; mode = mode((Long) display[0], token); - log("panel modes: active " + mode[0] + "x" + mode[1] + " (up to " + mode[2] + " Hz), native " + mode[3] + "x" + mode[4] - + " at " + mode[5] + " Hz"); - if (takeover && (mode[0] != mode[3] || mode[1] != mode[4])) { - if (nativeMode(token, mode[6], mode[5])) { + log("panel modes: active " + mode[0] + "x" + mode[1] + " mode id " + mode[7] + " (up to " + mode[2] + + " Hz), native " + mode[3] + "x" + mode[4] + " at " + mode[5] + " Hz (mode id " + mode[6] + ")"); + // Refresh policy can be capped even while the native resolution and mode id are already active. In an + // explicit takeover, reopen the mode ranges every time; wait for a mode switch only when the id/size differs. + if (takeover && token != null && mode != null) { + boolean needsSwitch = mode[0] != mode[3] || mode[1] != mode[4] || mode[7] != mode[6]; + boolean requested = nativeMode(token, mode[6], mode[5]); + if (requested && needsSwitch) { // the switch happens at a vsync of surfaceflinger's: wait for it to be the active mode for (int tries = 0; tries < 20; tries++) { Thread.sleep(50); mode = mode((Long) display[0], token); - if (mode[0] == mode[3] && mode[1] == mode[4]) break; + if (mode[0] == mode[3] && mode[1] == mode[4] && mode[7] == mode[6]) break; } } - if (mode[0] == mode[3] && mode[1] == mode[4]) log("the panel is in its native mode " + mode[0] + "x" + mode[1]); - else log("the panel stays at " + mode[0] + "x" + mode[1] + ": the guest's frame is scaled to it"); + if (!requested) { + log("the native mode request failed; active mode id " + mode[7] + " at " + mode[0] + "x" + mode[1]); + } else if (mode[0] == mode[3] && mode[1] == mode[4] && mode[7] == mode[6]) { + log("the panel selected its native mode " + mode[0] + "x" + mode[1] + " (mode id " + mode[7] + + ", up to " + mode[5] + " Hz)"); + } else { + log("the native mode is not active (mode id " + mode[7] + "): panel stays at " + mode[0] + "x" + mode[1] + + "; the guest's frame is scaled only if its size differs"); + } } } catch (Throwable unavailable) { log("the display's modes are not readable (" + unavailable + ")"); @@ -318,7 +329,7 @@ private static Object[] display() throws Exception { /** * {active width, height, the highest refresh rate among the modes of that size; - * native width, height, its highest refresh rate, the id of the native mode at that rate}. + * native width, height, its highest refresh rate, the id of that native mode, active mode id}. * The native mode is the largest the panel has, not the one it is in. */ private static int[] mode(long id, Object token) throws Exception { @@ -404,6 +415,6 @@ static int[] pick(int[] ids, int[] widths, int[] heights, int[] rates, int activ long area = (long) widths[i] * heights[i], most = nativeAt < 0 ? 0 : (long) widths[nativeAt] * heights[nativeAt]; if (nativeAt < 0 || area > most || (area == most && widths[i] == widths[nativeAt] && rates[i] > rates[nativeAt])) nativeAt = i; } - return new int[]{width, height, best, widths[nativeAt], heights[nativeAt], rates[nativeAt], ids[nativeAt]}; + return new int[]{width, height, best, widths[nativeAt], heights[nativeAt], rates[nativeAt], ids[nativeAt], active}; } } From 56e1430e66d882b9e14339ada0b16aecac755f79 Mon Sep 17 00:00:00 2001 From: orumanayurpanjayat-ux Date: Tue, 24 Nov 2026 22:32:48 +0300 Subject: [PATCH 04/12] Add files via upload --- .github/workflows/release.yml | 134 ++-------------------------------- 1 file changed, 7 insertions(+), 127 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a335e6a..08fe5cf9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,9 @@ # OneiOS's one workflow (docs/releases.md, "CI and releases"): the runtime package and the OneOS app (the fork, -# submodule app/) built in parallel, and a release that carries both. +# submodule app/) built at the same time on two runners, and a release that carries both. # -# plan ──┬── metal (xcode-27) build the iPhone18,2 Metal and camera plug-ins from pinned sources -# ├── runtime (ubuntu-24.04) script checks, host tests, package the Metal artifact and kernel, -# │ the Apple-file refusal, elf-check, drm2kgsl and package contents +# plan ──┬── runtime (ubuntu-24.04) script checks, host tests, runtime/package.sh, the Apple-file refusal, +# │ elf-check, drm2kgsl, the package's members, bin/oneios-tool for the +# │ phone and oneios-tool-VERSION-android-arm64 beside the package # ├── apk (ubuntu-24.04) app/ at the head of the fork's branch, JDK 21, tribalfs' packages, # │ ./gradlew test assembleFullDebug, the APK's assets checked # ├── apk-macos (macos-15) ./gradlew test of the same checkout on a Mac (core:root's script tests) @@ -85,96 +85,8 @@ jobs: echo "release=$release version=$version runtime=$runtime apk=$apk" { echo "release=$release"; echo "version=$version"; echo "runtime=$runtime"; echo "apk=$apk"; } >> "$GITHUB_OUTPUT" - metal: - needs: plan - if: needs.plan.outputs.runtime == 'true' - runs-on: xcode-27 - timeout-minutes: 180 - permissions: - contents: read - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Xcode and the iOS 27 SDK - run: | - set -euo pipefail - sudo xcode-select --switch /Applications/Xcode_27.2.app/Contents/Developer - xcodebuild -version - xcodebuild -version | grep -qx 'Xcode 27.2' || { echo "::error::Metal is pinned to Xcode 27.2 in kernel/pins.sh"; exit 1; } - sdk=$(xcrun --sdk iphoneos --show-sdk-version) - [[ "$sdk" == 27.* ]] || { echo "::error::the S24 Ultra plug-ins need the iOS 27 SDK; Xcode selected iOS $sdk"; exit 1; } - echo "Metal build uses iOS SDK $sdk and iPhone18,2 24A446 hooks" - - name: Metal build tools - run: | - set -euo pipefail - brew install ninja glslang shaderc spirv-tools bison llvm - echo "$(brew --prefix llvm)/bin" >> "$GITHUB_PATH" - echo "$(brew --prefix bison)/bin" >> "$GITHUB_PATH" - - name: Python tools for Mesa and the Metal bridge - run: | - set -euo pipefail - python3 -m venv "$RUNNER_TEMP/oneios-metal-venv" - "$RUNNER_TEMP/oneios-metal-venv/bin/python" -m pip install --upgrade pip - "$RUNNER_TEMP/oneios-metal-venv/bin/python" -m pip install meson mako pyyaml - echo "$RUNNER_TEMP/oneios-metal-venv/bin" >> "$GITHUB_PATH" - - name: Rust 1.98.0 and rust-src for the arm64e bridge - run: | - set -euo pipefail - rustup toolchain install 1.98.0 --profile minimal - rustup +1.98.0 component add rust-src - rustup default 1.98.0 - rustc --version - - name: Pinned Metal and kernel-base sources - run: | - set -euo pipefail - kernel/fetch.sh Droid-VM-UniXNU - scripts/setup/get-references.sh NativeMetal NativeAdreno NativeMobileDisplay AdrenoPM4 metal2vulkan mesa-droidvm - - name: Build the S24 Ultra Metal plug-in and capture module - env: - ONEIOS_METAL_TARGET: iPhone18,2 24A446 - IOS_MIN: '27.0' - IOS_TARGET: arm64e-apple-ios27.0 - JOBS: '6' - run: | - set -euo pipefail - userland/metal/build.sh all - userland/camera/build.sh out/userland/camera - bundle=out/userland/NativeAdrenoMetal.bundle - test -x "$bundle/NativeAdrenoMetal" - test -f "$bundle/libvulkan_freedreno.dylib" - test "$(cat "$bundle/oneios-target")" = 'iPhone18,2 24A446' - test -f out/userland/NativeAdrenoMetal.build.json - test -s out/userland/camera/H9ISP.mediacapture - grep -q 'iPhone18,2 24A446' out/userland/NativeAdrenoMetal.build.json - - name: Prepare the runtime artifact and its license texts - run: | - set -euo pipefail - base=out/metal-runtime - mkdir -p "$base/metal" "$base/camera" "$base/licenses" - cp -R out/userland/NativeAdrenoMetal.bundle "$base/metal/" - cp out/userland/NativeAdrenoMetal.build.json "$base/metal/" - cp out/userland/camera/H9ISP.mediacapture "$base/camera/" - for f in NativeMetal/LICENSE metal2vulkan/LICENSE metal2vulkan/LICENSE-GPL-2.0 \ - metal2vulkan/LICENSE-GPL-3.0 metal2vulkan/LICENSE-LGPL-3.0 \ - mesa-droidvm/LICENSING.md mesa-droidvm/licenses Droid-VM-UniXNU/LICENSE \ - NativeAdreno/LICENSE AdrenoPM4/LICENSE NativeMobileDisplay/LICENSE; do - src="external/$f" dst="$base/licenses/$f" - test -e "$src" || { echo "::error::missing pinned license source $src"; exit 1; } - mkdir -p "$(dirname "$dst")" - cp -R "$src" "$dst" - done - tar -czf out/oneios-metal-runtime.tar.gz -C "$base" metal camera licenses - (cd out && shasum -a 256 oneios-metal-runtime.tar.gz > oneios-metal-runtime.tar.gz.sha256) - - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 - with: - name: oneios-metal-runtime - path: | - out/oneios-metal-runtime.tar.gz - out/oneios-metal-runtime.tar.gz.sha256 - if-no-files-found: error - retention-days: 14 - runtime: - needs: [plan, metal] + needs: plan if: needs.plan.outputs.runtime == 'true' runs-on: ubuntu-24.04 timeout-minutes: 45 @@ -204,20 +116,6 @@ jobs: set -euo pipefail [ "$(git ls-files -s app | cut -d' ' -f1)" = 160000 ] || { echo "::error::app is not a submodule"; exit 1; } [ -z "$(ls -A app 2>/dev/null)" ] || { echo "::error::app/ has files: the runtime job must not check out the fork"; exit 1; } - - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 - with: - name: oneios-metal-runtime - path: out/metal-artifact - - name: Verify and unpack the Metal runtime artifact - run: | - set -euo pipefail - (cd out/metal-artifact && shasum -a 256 -c oneios-metal-runtime.tar.gz.sha256) - mkdir -p out/metal-runtime - tar -xzf out/metal-artifact/oneios-metal-runtime.tar.gz -C out/metal-runtime - test -x out/metal-runtime/metal/NativeAdrenoMetal.bundle/NativeAdrenoMetal - test -f out/metal-runtime/metal/NativeAdrenoMetal.bundle/libvulkan_freedreno.dylib - test "$(cat out/metal-runtime/metal/NativeAdrenoMetal.bundle/oneios-target)" = 'iPhone18,2 24A446' - test -s out/metal-runtime/camera/H9ISP.mediacapture - name: No firmware, no large binaries and no Python in git run: .github/scripts/check-tracked-files.sh - name: Script syntax @@ -236,8 +134,6 @@ jobs: scripts/setup/get-references.sh virglrenderer test -f external/virglrenderer/src/drm/drm2kgsl/drm2kgsl_renderer.c || { echo "virglrenderer checkout has no drm2kgsl"; exit 1; } - name: Host tests - env: - METAL_LICENSES_DIR: ${{ github.workspace }}/out/metal-runtime/licenses run: | set -euo pipefail runtime/package/elf-check-test.sh @@ -248,33 +144,17 @@ jobs: for t in $(git ls-files '*/tests/host.sh' | grep -v '^kernel/'); do echo "== $t"; "$t"; done - name: Kernel from the kernel release, when one is pinned # kernel/release-kernel.txt (optional): "KERNEL_TAG SHA256" of an xnu-.tar.zst that - # kernel/publish.sh uploaded from a build machine to akshaynexus/OneiOS. The package step checks its build record again. + # kernel/publish.sh uploaded from a build machine. The package step checks its build record again. run: | set -euo pipefail [ -s kernel/release-kernel.txt ] || { echo "no kernel pinned: runtime only"; exit 0; } read -r ktag ksha < kernel/release-kernel.txt mkdir -p out/kernel/current out/kernel/dl - gh release download "$ktag" --repo akshaynexus/OneiOS --pattern 'xnu-*.tar.zst' --dir out/kernel/dl + gh release download "$ktag" --repo "$GITHUB_REPOSITORY" --pattern 'xnu-*.tar.zst' --dir out/kernel/dl echo "$ksha $(ls out/kernel/dl/xnu-*.tar.zst)" | sha256sum -c - zstd -dc out/kernel/dl/xnu-*.tar.zst | tar -x -C out/kernel/current - name: Package (refuses Apple files and what Android cannot load) - env: - METAL_DIR: ${{ github.workspace }}/out/metal-runtime/metal - CAMERA_DIR: ${{ github.workspace }}/out/metal-runtime/camera - METAL_LICENSES_DIR: ${{ github.workspace }}/out/metal-runtime/licenses - REQUIRE_METAL: '1' run: runtime/package.sh "$VERSION" - - name: The runtime contains the matching Metal and camera plug-ins - run: | - set -euo pipefail - d=$(mktemp -d) - zstd -dc "out/release/oneios-runtime-$VERSION-arm64.tar.zst" | tar -x -C "$d" - test -x "$d/lib/guest/NativeAdrenoMetal.bundle/NativeAdrenoMetal" - test -f "$d/lib/guest/NativeAdrenoMetal.bundle/libvulkan_freedreno.dylib" - test "$(cat "$d/lib/guest/NativeAdrenoMetal.bundle/oneios-target")" = 'iPhone18,2 24A446' - test -s "$d/lib/guest/camera/H9ISP.mediacapture" - test -s "$d/lib/guest/NativeAdrenoMetal.build.json" - jq -e '.metal.target == "iPhone18,2 24A446" and .camera.path == "lib/guest/camera"' "$d/runtime.json" - name: The package's xnuhost and gpuctl have drm2kgsl run: | set -euo pipefail From d157b43304acd600265c63268258b2d8bf584d5a Mon Sep 17 00:00:00 2001 From: leusernamealadeen Date: Tue, 24 Nov 2026 12:04:07 -0800 Subject: [PATCH 05/12] Shader-Fixes # Adreno-generic shader fixes rebased on the pinned metal2vulkan. Patches 0101 and 0102 are appended to the bridge's # patch list and built into the plug-in; 0103 stays staged but unapplied because its allocator tuning has no safe # per-process policy wired in yet. --- docs/gpu.md | 11 +++++++---- docs/s25.md | 2 +- docs/switches.md | 9 ++++----- tools/oneios-tool/crates/oneios-ios/src/metal.rs | 4 ++-- userland/metal/build.sh | 11 ++++------- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/docs/gpu.md b/docs/gpu.md index d3fe8813..c6ed923b 100644 --- a/docs/gpu.md +++ b/docs/gpu.md @@ -1504,10 +1504,13 @@ off in the root, is not taken: a fresh 20F66 Data store has the switch off alrea ## 7. The Metal plug-in (`userland/metal`) -**Build notes (2026-11-23, integration-switches; docs/switches.md "Found while building the Metal plug-in").** +**Build notes (2026-11-23, integration-switches; shader fixes enabled 2026-11-24).** `build.sh turnip` removes `build/mesa-tu-ios27` when the inputs of its cross file changed (the SDK, the compilers, -the base script), since an existing directory only gets `meson configure`. The `9xxx` copies of -`patches/metal2vulkan` (0101-0103) are in no list of the base's bridge script and are not applied; `stage` says so. +the base script), since an existing directory only gets `meson configure`. The Metal bridge now applies Adreno-generic +shader fixes 0101 and 0102 after the pinned bridge patches: large run-time-indexed constants use the shared constant +blob instead of per-thread private copies, and constant GEP pointers into that blob lower correctly. Patch 0103 remains +staged but unapplied because its process-specific allocation size has no safe policy wired in yet. The shader changes +have not been booted on the S24 Ultra. **metal2vulkan's upstream (2026-11-23, fix/m2v-update): the pin stays 624bab3.** Upstream `development` at `6462199fa` (2026-11-23) is 9,217 commits newer. It is a new runtime: `metal2vulkan-rt`, written from 2026-11-17 @@ -1604,7 +1607,7 @@ scripts/bg.sh metal userland/metal/build.sh # stage, turnip, plugin, finish | Piece | Source | Notes | |---|---|---| | `libvulkan_freedreno.dylib` | `external/mesa-droidvm` cecc0e9 (Droid-VM/mesa, `droidvm`) + the 30 patches listed in Droid-VM-UniXNU `scripts/data/adreno-compiler-inputs.json` (`patches/mesa/`: `turnip-darwin-kmd`, `turnip-darwin-virtgpu`, ...), then this project's `userland/metal/trace-turnip-init.patch` and `turnip-idle-bo-cache.patch` (appended to the staged list by `ios metal-stage-edit`) | meson cross build, `-Dvulkan-drivers=freedreno -Dfreedreno-kmds=darwin`, release. Its 5633 weak flat-namespace imports are bound to the image itself (`macho-weak-self-binds.py`) | -| `libadreno_metal_bridge.a` | `external/metal2vulkan` 624bab3 + NativeMetal `bridge/patches` 0001-0024 (without 0020) + Droid-VM-UniXNU `patches/metal2vulkan` 0011-0038 + this project's `userland/metal/trace-metal-vulkan-init.patch`, `m2v-spare-command-pools.patch` and `m2v-idle-memory.patch` (appended to the bridge script's list by `ios metal-stage-edit`) + `userland/metal/patches/metal2vulkan/` 0101-0103 (staged as 9xxx, in no list, not applied so they sort last: the Adreno-generic shader-translation fixes of hakios-arm64e-dada; `0104…NEEDS-REBASE` stays out, and the Mesa/nativemetal sets stay out as the wrong tree), behind `bridge/NativeMetalBridge.rs` | Rust 1.98.0, target `arm64e-apple-ios`, std built from `rust-src`, fat LTO. No `Cargo.lock` is pinned upstream: the crates are the newest that fit at build time | +| `libadreno_metal_bridge.a` | `external/metal2vulkan` 624bab3 + NativeMetal `bridge/patches` 0001-0024 (without 0020) + Droid-VM-UniXNU `patches/metal2vulkan` 0011-0038 + this project's `userland/metal/trace-metal-vulkan-init.patch`, `m2v-spare-command-pools.patch`, `m2v-idle-memory.patch` and shader fixes 0101/0102 (appended to the bridge script's list by `ios metal-stage-edit`); 0103 remains staged but unapplied, `0104…NEEDS-REBASE` stays out, and the Mesa/nativemetal sets stay out as the wrong tree, behind `bridge/NativeMetalBridge.rs` | Rust 1.98.0, target `arm64e-apple-ios`, std built from `rust-src`, fat LTO. No `Cargo.lock` is pinned upstream: the crates are the newest that fit at build time | | `NativeAdrenoMetal` | `external/NativeMetal` b0d6a07 (`NativeAdrenoMetalPlugin.mm`, `NativeBridgeMetalFrontend.mm`), `external/AdrenoPM4`, the bridge | The Rust objects' callback imports go through `RustPacBoundary.c`; their indirect branches through its trampolines (`rust-pac-rewrite.py`) | The steps are the kernel base's own scripts (`build-turnip-darwin.py`, `build-adreno-metal-bridge.py`, diff --git a/docs/s25.md b/docs/s25.md index c47d0a4c..86c5788d 100644 --- a/docs/s25.md +++ b/docs/s25.md @@ -110,7 +110,7 @@ A community kernel tree (6.6.77) is not this 6.6.127 build and does not replace | Display | **In the s25ver snapshot, not in this tree as such** (that snapshot made 1080x2340 the default of every fallback, which would change the S24 Ultra's). Here (2026-11-21): xnuhost takes the panel's mode from the display helper's report or the DRM panel, so an S25 session gets 1080x2340 without a setting; only where no panel is read does it assume a size, and `--set panel-fallback=1080x2340@120` (or `panel-fallback=` in the image set's `xnuhost.conf`) makes that the S25's instead of the S24's 1440x3120 (same aspect ratio, 1.78x the pixels, scaled down every frame; [booter.md](booter.md) 2.8). The display helper's last fallback is its existing `--logical 1080x2340` (passed by the OneOS fork's switch script, not here); `displayctl test --size 1080x2340` for the bench; the guest profile `userland/config/device-iphone18,2.toml` stays 1440x3120 (it only feeds `oneios-mg`'s expectations, which then report `identity=differs` on a 1080 panel: a log line, nothing waits on it). With the S25's panel the UI scale stays 3: **360x780 points**, the pixel grid of the iPhone 12 mini / 13 mini; `--scale 2` gives 540x1170. A point is 1/139 inch (the iPhone's 1/153): 44-point targets are 8.0 mm. The artwork set stays the Pro Max's (`artwork-device-subtype` 2868, its assets are certainly in the image); the 12/13 mini's subtype (2340) is an untested alternative [I]. `test_xnuhost` and `test_display_mode` cover `panel-fallback=`. At 1080x2340 a frame is 10.1 MB (18 MB before). | | CPU plan (`runtime/bridges/cpu/topology.rs`; `topology.c` then) | Oryon has no little cores. The old rule (lowest capacity = E) would have made the six performance cores an E cluster and left iOS two P cores. Now a Qualcomm core (MIDR implementer 0x51) is never E, and a host whose cores are all P but of different speeds **lends** its slowest cores to the guest as E vCPUs (one in four vCPUs, at least one; 8 vCPUs: 2 E + 6 P), because XNU's AMP scheduler and the iPhone's boot CPU want both kinds. Hosts with all-alike cores and the S24's A520 cores behave as before. Tests with an SM8750-shaped fixture (made-up capacities and frequencies, the real shape): `runtime/bridges/tests/test_bridges.c`, 210 checks. | | Phone gate in the OneOS fork | The fork only offered iOS on the S24 Ultra, in two places: `OneiosSystem.PROFILE_IDS` (Kotlin) and the preflight of `switcher/assets/oneios_switch.sh`. Both now accept `SM-S931*` / `pa1q` / `SM8750` as well (the fork already has the S25 profile `s-8750`). Its tests and the refusal texts follow. The fork's tests were not run here (Gradle); the workflow `oneos-apk.yml` runs them. | -| Metal translation | `userland/metal/patches/metal2vulkan/` holds the Adreno-generic shader-translation fixes of hakios-arm64e-dada (see below), rebased on the pin; `userland/metal/build.sh` stages them as `9xxx` patches after the base's own. | +| Metal translation | `userland/metal/patches/metal2vulkan/` holds the Adreno-generic shader-translation fixes of hakios-arm64e-dada, rebased on the pin; 0101/0102 are included in the Metal bridge, while 0103 remains staged pending a safe per-process allocation policy. | | Phone probe | `tools/probe/s25-probe.sh`: read-only; writes `/data/local/tmp/oneios-s25-probe-