Standalone native Metal → Adreno 740 GPU driver for Xiaomi Pad 6S Pro (sheng, Qualcomm SM8550, Adreno 740 chip_id = 0x43050a01, 3048×2032 @ 120 Hz) running macOS on UniXNU — with zero metal2vulkan, Vulkan/Turnip runtime, or libLLVM dependency.
macOS Metal API (WindowServer / QuartzCore / RenderBox / CoreImage / MPS / Apps)
│
▼
objc/NativeAdrenoMetalV2/ arm64e Objective-C++ Metal frontend bundle (+ PAC trampoline)
│
├──► cpp/air-to-nir/ Direct Apple AIR 2.9 → Mesa NIR → Adreno 740 IR3 compiler + atomic Format-v3 disk cache
│
▼
rust/native-metal-v2-ffi/ Checked C ABI bridge (offset-based batch serialization, zero raw pointers)
│
▼
rust/metal-plan/ Platform-agnostic render-pass / GMEM / UBWC4 / hazard / residency / fence planner
│
├──► cpp/pm4-a740/ Adreno 740 PM4 command-stream emitter (pinned upstream Mesa XML register headers)
│
├──► rust/backend-xnu-adreno/ macOS/XNU NativeAdrenoABI v2 (`AGXAccelerator`) + `GopFramebuffer` scanout backend
└──► rust/backend-linux-msm/ Linux `/dev/dri/renderD128` (`drm/msm`) hardware test backend
schema/: Cross-language binary contracts (command_batch.schema,resource_contract.schema,fence_contract.schema,rpc_protocol.schema) and verified C/C++ + Rust ABI headers.manifests/: Reproducible hardware, register, and Mesa pin manifests (mesa_pin.json,xnu_mesa_audit.json,rd_170_manifest.json).rust/metal-plan/: Platform-agnostic Metal execution planner,O(1)hazard tracker, aliasing domains, GMEM tile planner, and fence/retirement state machine.rust/native-metal-v2-ffi/: FFI glue between the macOS Metal bundle,metal-plan,pm4-a740, andbackend-xnu-adreno.rust/backend-xnu-adreno/: XNUNativeAdrenoABI v2kernel transport andGopFramebufferpresentation backend.rust/backend-linux-msm/: Linuxdrm/msmioctl backend plusdevfreq/OPP/thermal/performance-counter readers for direct silicon verification.rust/runner-tablet/: StaticmuslBusyBox executor (pm4-runner) for live Adreno 740 hardware tests.rust/harness-host/: Host-side hardware regression and microbenchmark harness (smoke-3d,smoke-frame2, GMEM/FP16 probes).cpp/pm4-a740/: Adreno 740 PM4 emitter (Sysmem, GMEM, UBWC4, MSAA 4×, multi-MRT, indirect draws, primitive restart, per-tile state management) using pinned upstream Mesa headers (85fda3b36405).cpp/air-to-nir/: Direct Apple AIR bitcode → Mesa NIR → Adreno 740 IR3 compiler (air-to-nir-v9), stitching graph lowering, and atomic POSIX disk cache.cpp/compiler-shim/: Thin C ABI shader compilation shim.objc/NativeAdrenoMetalV2/: macOSarm64eMetal bundle (MTLDevice, queues, command buffers, render/compute/blit encoders,IOSurfaceimport + 32B-pitch GPU shadow backing,RustPacBoundary.c).linux-busybox/: Minimal BusyBox initramfs and scripts for RAM-only live Linuxdrm/msmsilicon testing.tools/: Offline ABI/schema checkers, C++ ASan/UBSan + Mesacffdumprunners, and Rust↔C++ end-to-end verification scripts.
python3 tools/verify_schemas.py
python3 tools/run_cpp_tests.py
RUSTFLAGS="-D warnings" cargo test --workspace
python3 tools/verify_rust_cpp_e2e.py
python3 cpp/air-to-nir/tools/run_air_tests.py
python3 tools/run_objc_tests.py # macOS only: ObjC++ runtime against the host-mock FFI- Zero translation runtime: No
metal2vulkan, Vulkan ICD/Turnip runtime, orlibLLVMin any runtime crate, library, or macOS bundle. - Checked cross-language boundaries: No raw pointers across Rust ↔ C++ or Host ↔ Tablet boundaries; all batch/resource/fence tables use checked relative offsets and generation-tagged GPU addresses.
- Hardware-first verification: Register layouts are pinned directly to upstream Mesa Adreno XML and validated via Mesa
cffdump, live Linuxdrm/msmsilicon regressions, and macOS desktop runs onsheng.