Run a virtual iPhone on an Apple Silicon Mac.
Swift
Gate Task3 to cloudOS 26.4, keep the host's features, boot without a cache
Jacky49ae8f46771e
diff --git a/Documents/Guides/shader-cache.md b/Documents/Guides/shader-cache.mdindex c084e964..143bc225 100644--- a/Documents/Guides/shader-cache.md+++ b/Documents/Guides/shader-cache.md@@ -46,5 +46,8 @@ Stop the VM, then delete its `ShaderCache` directory. The next launch starts afresh host cache. Guest Metal caches are separate files inside `Disk.img`, soclearing the host cache does not necessarily reproduce all first-run lag.-Task3 is disabled in the tvOS presets. Runtime validation covered macOS 27.0.1,-cloudOS 26.4 and an iOS 27.0.1 guest; older hosts have not been validated.+Task3 applies to cloudOS 26.4 kernels only and is disabled in the tvOS presets.+On a host older than macOS 27 the guest negotiates the host's own maximum version+and keeps that version's features, so the host cache stays per-boot there.+Runtime validation covered macOS 27.0.1, cloudOS 26.4, and iOS 27.0.1 and 26.6.2+guests; older hosts were checked from their framework code, not run.diff --git a/Research/0_binary_patch_comparison.md b/Research/0_binary_patch_comparison.mdindex 5b8b7eaa..4d6c1130 100644--- a/Research/0_binary_patch_comparison.md+++ b/Research/0_binary_patch_comparison.md@@ -761,7 +761,7 @@ Apple's ROM and this patch. See `Firmware/openavb_boot_rom.md`.| JB-29 | C | `patch_fpfs_scoped_vnode_open` | Sandbox MACF `mpo_vnode_check_open` (`ops[267]`) → per-process trampoline code cave | **iOS-27 random-respring fix (fpfs balloon).** JB-09 blanket-neuters `mpo_vnode_check_open` (`ops[267]` → allow) so processes can read `/var/jb`. But FileProvider's fpfs parent-walk (`fpfs_pkg_fd_lookup` → `openbyid` climbing via `getattrlistat(ATTR_CMN_PAROBJID)`) uses the stock check's EACCES at the domain-container boundary as its terminus; neutered, the walk climbs unbounded → `ResolverService` (FileProviderResolver) balloons to ~12 GB → `vm-compressor-space-shortage` jetsam → backboardd killed → **respring** (seen on 27b4/24A5390f). Fix keeps the global bypass and enforces the real check for the FileProvider daemons only: on 27, `ops[267]` is left un-neutered (removed from JB-09's blanket list — conditional `if !applyIOS27` in `patchSandboxHooksExtended`), then retargeted to a 20-insn code-cave trampoline that inlines `current_proc` (`mrs tpidr_el1` → `ldr [+0x3F0]` uthread → `ldr [+0x18]` proc), loads `p_comm` (`+0x56C`), compares the first 8 bytes to `"Resolver"`/`"fileprov"`, and on match `b`s to the real `vnode_check_open` (restores the terminus) else returns allow (`mov x0,#0 ; ret` → `/var/jb` reads + Sileo/TrollStore icons unaffected). Register-only (x8–x10), no frame/call (~18 insns/open). Struct offsets recovered via the VZ gdb stub on vphone600; cave bytes from the Keystone-backed `ARM64Encoder`, verified by Capstone round-trip; the `ops[267]` retarget preserves the auth-rebase high bits (same encoder family as JB-09). **VALIDATED on-device (2026-07-23, `17,3_27.0_24A5390f` + cloudOS 26.4, JB, `setup_machine` deploy): resprings stop; Sileo/TrollStoreLite icons render.** Backward-compat: a 26.5 base is unaffected (`ops[267]` still blanket-neutered there) — verified byte-identical kernelcache pre-vs-post (`cmp` clean, `sha256` unchanged). See `KernelJBPatchFpfsScopedOpen.swift`. | Y || JB-30 | B | `patchParavirtDisplayRefreshRate` (record `kernel-cfw-display_promotion`; introduced as `kernel-exp-display_refresh_120hz`, renamed when `standard` turned it on) | `AppleParavirtDisplay::createDisplayAttributes` (AppleParavirtGPUIOGPUFamily), the per-mode timing element call | **ProMotion: 120 Hz display timing (on in `standard` since 2026-10-09; it shipped opt-in from 2.4.2).** The host VM service builds its one `PGDisplayMode` with a constant 60.0 Hz and writes it into the display shared state page as a 16-byte entry (u16 width, u16 height, u32 refresh in 16.16 Hz, flags); the guest turns each entry into an IOAV timing element with `ldurh w1,[xN,#-8]; ldurh w2,[xN,#-6]; ldur w3,[xN,#-4]; bl`. The `ldur w3` becomes `movz w3,#120,lsl #16`. Anchor: the `createDisplayAttributes` logger cstring (all refs in one function) + the only w1/w2/w3 load triple off one base at -8/-6/-4 ahead of a call. Gated by `KernelCustomFirmwarePatcher.applyProMotion`, set from the plan. See `Research/Guest/display_refresh_rate.md`. | Y || JB-31 | C | `patchParavirtUserClientsNarrow` (records `kernel-cfw-paravirt_user_clients.redirect` / `.cave`; introduced as `kernel-exp-paravirt_user_clients`, renamed when `standard` turned it on) | Same IOUserClient Sandbox gate; the deny block's `ldr Xt,[sp,#imm]` eight bytes before the fail-log `adrp` | **Paravirtual device access on a 26.x / 18.x base (on in `standard` since 2026-10-04; it shipped opt-in).** Narrow replacement for the broad gate-off: at the deny point the class-name C string is already in x0, so a code-cave trampoline reads its first eight bytes and branches to the gate's NotPermitted allow target only for `ApplePar` / `AppleVid` / `AppleVir` / `IOSurfac` (AppleParavirt\*, AppleVideoToolboxParavirt\*, AppleVirtIO\*, IOSurfaceAcceleratorParavirtClient); every other denial runs the displaced `ldr` and falls through to the real deny. Fixes `MTLCreateSystemDefaultDevice()` nil in daemons/CLI and the VideoToolbox/ANE/IOSurface denials (upstream issue #22) without opening the rest. Cave words verified by clang/as + capstone round-trip; the two `b` words via `ARM64Encoder`. Gated by `KernelCustomFirmwarePatcher.applyParavirtUserClients`, set from the plan when `applyIOS27` is false. See `Research/Guest/gpu_acceleration.md`. | Y |-| JB-32 | B/C | `patchParavirtTask3Version` (`kernel-cfw-paravirt_gpu_task3.request`, `.features`, `.identity_hook`, `.identity_code`) | `setupVersion`; task initializer's `Failed to create Page Table Lock`; superclass task retain/store; XNU flow-divert CDHASH log and proc/task inverse getter | **Persistent per-executable host shader caches through Task3, enabled in Standard.** Phase 1 (2026-10-19) requests binary version 252 while computing guest features from the original 245. Phase 2 (2026-10-20) writes the owning executable's 20-byte code-signing cdhash at TaskRoot+0x28 before descriptor preparation and task registration. The host uses `task-<40 hex>` and retains that directory. A missing proc/hash leaves twenty zero bytes and preserves the ephemeral fallback. The owning task field is recovered from the superclass initializer, not guessed or taken from current_proc. Kernel helpers are found through source-backed semantic call flow (`cs_get_cdhash`) and the dynamically recovered proc_struct_size global (`get_bsdtask_info`); no task/proc layout offsets or kernel VAs are hardcoded. The trampoline preserves x0–x18, LR and SP, copies exactly 20 bytes and replays the displaced descriptor load. All four sites must resolve before any is emitted; failure aborts a selected install. Replacements use ARM64Encoder; new encoders have Keystone 0.9.2 parity tests. Gated by applyParavirtTask3; Standard enables it and tvOS presets block it. Static fixture, missing-anchor and register-clobber execution tests pass. Lychee on macOS 27.0.1 / cloudOS 26.4 / iOS 27.0.1 negotiated 252 across three full boots, retained the same nine executable keys, and passed Camera with zero GPU resets. Host GPU compilation events fell 631 → 17 → 12; the Settings windows fell 121 → 5 → 0. Frame-counter gaps do not establish visible animation stutter; the user reports smooth warmed animations. Measurements, cdhash checks and crash analysis are in `Research/Guest/gpu_acceleration.md`. Older hosts remain untested. | Y |+| JB-32 | B/C | `patchParavirtTask3Version` (`kernel-cfw-paravirt_gpu_task3.request`, `.features`, `.features_code`, `.identity_hook`, `.identity_code`) | `setupVersion`; task initializer's `Failed to create Page Table Lock`; superclass task retain/store; XNU flow-divert CDHASH log and proc/task inverse getter | **Persistent per-executable host shader caches through Task3, enabled in Standard.** Phase 1 (2026-10-19) requests binary version 252 while computing guest features from the lower of the granted version and the original 245 (`.features` branches to `.features_code`, a five-instruction clamp after the identity trampoline in the same cave; a refusal passes through). Phase 2 (2026-10-20) writes the owning executable's 20-byte code-signing cdhash at TaskRoot+0x28 before descriptor preparation and task registration. The host uses `task-<40 hex>` and retains that directory. A missing proc/hash leaves twenty zero bytes and preserves the ephemeral fallback. The owning task field is recovered from the superclass initializer, not guessed or taken from current_proc. Kernel helpers are found through source-backed semantic call flow (`cs_get_cdhash`) and the dynamically recovered proc_struct_size global (`get_bsdtask_info`); no task/proc layout offsets or kernel VAs are hardcoded. The trampoline preserves x0–x18, LR and SP, copies exactly 20 bytes and replays the displaced descriptor load. All four sites must resolve before any is emitted; failure aborts a selected install. Replacements use ARM64Encoder; new encoders have Keystone 0.9.2 parity tests. Gated by applyParavirtTask3 and declared for cloudOS 26.4 only; Standard enables it there and tvOS presets block it. Static fixture, missing-anchor and register-clobber execution tests pass. Lychee on macOS 27.0.1 / cloudOS 26.4 / iOS 27.0.1 negotiated 252 across three full boots, retained the same nine executable keys, and passed Camera with zero GPU resets. Host GPU compilation events fell 631 → 17 → 12; the Settings windows fell 121 → 5 → 0. Frame-counter gaps do not establish visible animation stutter; the user reports smooth warmed animations. Measurements, cdhash checks and crash analysis are in `Research/Guest/gpu_acceleration.md`. Older hosts remain untested. | Y |### EXP-Only Kernel Methods (Reference List)@@ -3297,3 +3297,20 @@ validation; older host compatibility remains untested.Promotion validation: 62 focused tests passed, as did the full `VPhone` bundlebuild and admission check. The built CLI recognized Lychee's old Task3 receiptunder the new name as applied, enabled by its preset and not pending.++Review fixes (2026-10-21): JB-32 is declared for cloudOS 26.4 only. On the+cloudOS 26.1, 26.2 and 26.3 research kernels the owning-task anchor in the+superclass initializer does not resolve, and an ungated Standard patch made+`fw patch` and `cfw update-kernel` abort for every iOS 18.6.2–26.3.1 machine.+The `.features` site no longer loads a fixed 245: it branches to+`.features_code` (`sub x0,xV,#246; tbnz x0,#63; tbnz wV,#31; mov w0,#245`,+else `mov x0,xV`), which passes the granted version through when it is the+kext's own or lower, and a refusal unchanged. A host that does not know the+requested version grants its own maximum without the refusal bit+(`-[_PGDevice setBinaryVersion:]`: macOS 15.6.1 → 209, 26.0 → 233,+26.4 → 245, 27.0.1 → 252), so the fixed 245 had claimed 8 feature flags on a+15.6.1 host and 4 on 26.0 that the host never enabled. The clamp uses only+existing Keystone-checked encoders; the Task3 fixture test executes it for+252, 246, 245, 233, 209 and a refusal. The persistent host shader cache is no+longer required to launch: a VM that cannot prepare one logs a warning and+boots without it.diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchParavirtTask3.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchParavirtTask3.swiftindex bf9e5594..15433a52 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchParavirtTask3.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchParavirtTask3.swift@@ -28,8 +28,15 @@//// The guest's own table stops at the version it was built for, so a granted 252// would come back invalid and the kext would step down again. The patch asks for-// 252 and computes the guest's features from the original immediate, so the-// guest keeps its behaviour while the host runs its Task3 path.+// 252 and computes the guest's features from the lower of the granted version+// and the original immediate, so the guest keeps its behaviour while the host+// runs its Task3 path.+//+// A host that does not know the requested version grants its own maximum+// instead, without the refusal bit: 245 on macOS 26.4, 233 on 26.0, 209 on+// 15.6.1 (`-[_PGDevice setBinaryVersion:]`). Features computed from the kext's+// own 245 there would claim flags the host never enabled, so a granted version+// below the kext's own, or a refusal, still reaches the call unchanged.//// Anchor (no offsets): the `setupVersion` cstring, whose references all sit in// that one function; inside it, the request store and the readback of the same@@ -63,7 +70,7 @@ extension KernelCustomFirmwarePatcher {return false}- var hits: [(request: Int, rd: UInt32, version: UInt16, featureArg: Int)] = []+ var hits: [(request: Int, rd: UInt32, version: UInt16, granted: UInt32, featureArg: Int)] = []var off = funcStartwhile off < lastRef {defer { off += 4 }@@ -71,21 +78,27 @@ extension KernelCustomFirmwarePatcher {version >= 200, version < Self.paravirtTask3Version,let regDisp = requestStore(of: rd, after: off),let granted = readback(disp: regDisp, after: off),+ let grantedNumber = (0 ... 30).first(where: { ARM64Register.w($0) == granted.register }),let featureArg = versionArgument(granted.register, after: granted.offset)else { continue }- hits.append((off, rd, version, featureArg))+ hits.append((off, rd, version, UInt32(grantedNumber), featureArg))}guard hits.count == 1, let hit = hits.first else {log(" [-] version request not found uniquely (found \(hits.count))")return false}+ // One cave: the identity trampoline, then the feature-version clamp.+ let featureSlot = 256guard let request = ARM64Encoder.encodeMovzW(rd: hit.rd, imm16: Self.paravirtTask3Version),- let guestVersion = ARM64Encoder.encodeMovzW(rd: 0, imm16: hit.version),let identity = paravirtTaskIdentity(),- let cave = findCodeCave(size: 256),- let code = pvIdentityCode(identity, at: cave), code.count <= 256,- let branch = ARM64Encoder.encodeB(from: identity.hook, to: cave)+ let cave = findCodeCave(size: featureSlot + 32),+ let code = pvIdentityCode(identity, at: cave), code.count <= featureSlot,+ let branch = ARM64Encoder.encodeB(from: identity.hook, to: cave),+ let featureCode = pvFeatureVersionCode(+ granted: hit.granted, version: hit.version, at: cave + featureSlot, resume: hit.featureArg + 4,+ ),+ let featureBranch = ARM64Encoder.encodeB(from: hit.featureArg, to: cave + featureSlot)else {log(" [-] Task3 discovery or encoding failed; no Task3 sites written")return false@@ -103,16 +116,42 @@ extension KernelCustomFirmwarePatcher {virtualAddress: fileOffsetToVA(hit.request),description: "binary version request mov w\(hit.rd),#\(hit.version) -> #\(Self.paravirtTask3Version)",)+ emit(+ cave + featureSlot,+ featureCode,+ patchID: FirmwarePatchSetCatalog.paravirtTask3Patch + ".features_code",+ virtualAddress: fileOffsetToVA(cave + featureSlot),+ description: "guest features from min(granted, \(hit.version)); a refusal passes through",+ )emit(hit.featureArg,- guestVersion,+ featureBranch,patchID: FirmwarePatchSetCatalog.paravirtTask3Patch + ".features",virtualAddress: fileOffsetToVA(hit.featureArg),- description: "guest features from the granted version -> mov w0,#\(hit.version)",+ description: "guest features version mov x0,x\(hit.granted) -> b clamp",)return true}+ /// `x0` for the guest's feature lookup: the granted version, or the kext's+ /// own when the host granted a newer one. A granted version below the+ /// kext's own (an older host's maximum) and a refusal (bit 31) pass through+ /// as the displaced `mov x0, xV` would have passed them.+ private func pvFeatureVersionCode(granted: UInt32, version: UInt16, at cave: Int, resume: Int) -> Data? {+ let passThrough = cave + 20+ let words: [Data?] = [+ ARM64Encoder.encodeSubImm12(rd: 0, rn: granted, imm12: UInt32(version) + 1),+ ARM64Encoder.encodeTestBitBranch(nonzero: true, register: 0, bit: 63, from: cave + 4, to: passThrough),+ ARM64Encoder.encodeTestBitBranch(nonzero: true, register: granted, bit: 31, from: cave + 8, to: passThrough),+ ARM64Encoder.encodeMovzW(rd: 0, imm16: version),+ ARM64Encoder.encodeB(from: cave + 16, to: resume),+ ARM64Encoder.encodeMovX(rd: 0, rm: granted),+ ARM64Encoder.encodeB(from: cave + 24, to: resume),+ ]+ guard words.allSatisfy({ $0 != nil }) else { return nil }+ return words.compactMap { $0 }.reduce(into: Data()) { $0.append($1) }+ }+/// The register number and value when the instruction at `off` is a lone/// `mov wN, #imm` (no `movk` after it).private func plainMoveW(at off: Int) -> (UInt32, UInt16)? {diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelCustomFirmwarePatchSet.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelCustomFirmwarePatchSet.swiftindex 0173b8cc..94c82c84 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelCustomFirmwarePatchSet.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelCustomFirmwarePatchSet.swift@@ -330,6 +330,9 @@ public enum FirmwareKernelCustomFirmwarePatchSet {retains a separate shader cache for each executable across boots.""",target: .firmware(.kernelcache),+ // The task initializer and owning-task anchors differ on the+ // cloudOS 26.1–26.3 kernels; discovery fails there.+ applicability: VPhonePatchApplicability(cloudOS: .release(major: 26, minor: 4)),),],requires: ["vphone.kernel.base"],diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Kernel/KernelParavirtTask3Tests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Kernel/KernelParavirtTask3Tests.swiftindex 5af544c8..3589085e 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Kernel/KernelParavirtTask3Tests.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/Kernel/KernelParavirtTask3Tests.swift@@ -20,10 +20,10 @@ struct KernelParavirtTask3Tests {let data = try Data(contentsOf: URL(fileURLWithPath: #require(Self.fixture)))let patcher = prepared(data)#expect(patcher.patchParavirtTask3Version())- #expect(patcher.patches.count == 4)+ #expect(patcher.patches.count == 5)let ids = Set(patcher.patches.map(\.patchID))let prefix = FirmwarePatchSetCatalog.paravirtTask3Patch- #expect(ids == Set(["request", "features", "identity_hook", "identity_code"].map { prefix + "." + $0 }))+ #expect(ids == Set(["request", "features", "features_code", "identity_hook", "identity_code"].map { prefix + "." + $0 }))let code = try #require(patcher.patches.first { $0.patchID == prefix + ".identity_code" })let hook = try #require(patcher.patches.first { $0.patchID == prefix + ".identity_hook" })@@ -31,11 +31,55 @@ struct KernelParavirtTask3Tests {try executeTrampoline(code, hook: hook, procAvailable: availability.0, hashAvailable: availability.1)}+ // Hosts grant 252 (macOS 27), their own maximum (245 on 26.4, 233 on+ // 26.0, 209 on 15.6.1) or a refusal. Only a version above the kext's+ // own becomes the kext's own.+ let features = try #require(patcher.patches.first { $0.patchID == prefix + ".features" })+ let clamp = try #require(patcher.patches.first { $0.patchID == prefix + ".features_code" })+ for (granted, expected): (UInt64, UInt64) in [(252, 245), (246, 245), (245, 245), (233, 233), (209, 209), (0x8000_00F5, 0x8000_00F5)] {+ #expect(try executeFeatureClamp(clamp, branch: features, granted: granted) == expected)+ }+let second = prepared(patcher.patchedData)#expect(!second.patchParavirtTask3Version())#expect(second.patches.isEmpty)}+ /// Run the feature-version clamp from the branch that replaced the+ /// `mov x0, xV` and return `x0` where it rejoins the kext, one past that site.+ private func executeFeatureClamp(_ code: PatchRecord, branch: PatchRecord, granted: UInt64) throws -> UInt64 {+ let decoder = ARM64Disassembler()+ let jump = try #require(decoder.disassemble(branch.patchedBytes, at: UInt64(branch.fileOffset)).first)+ let displaced = try #require(decoder.disassemble(branch.originalBytes, at: UInt64(branch.fileOffset)).first)+ let grantedRegister = try #require(displaced.detail?.operands.last?.reg)+ #expect(jump.mnemonic == "b" && jump.detail?.operands.first?.imm == Int64(code.fileOffset))+ let instructions = decoder.disassemble(code.patchedBytes, at: UInt64(code.fileOffset))+ // tbnz names the W register for bits below 32; keep one X slot per register.+ func wide(_ r: ARM64Register) -> ARM64Register {+ (0 ... 30).first { ARM64Register.w($0) == r }.map { .x($0) } ?? r+ }+ var registers: [ARM64Register: UInt64] = [wide(grantedRegister): granted, .x(0): 0x1234]+ var pc = code.fileOffset+ for _ in 0 ..< 10 {+ if pc == branch.fileOffset + 4 { break }+ let i = try #require(instructions.first { $0.address == UInt64(pc) })+ let p = try #require(i.detail?.operands)+ var next = pc + 4+ switch i.mnemonic {+ case "sub": registers[wide(p[0].reg)] = registers[wide(p[1].reg), default: 0] &- UInt64(p[2].imm)+ case "tbnz": if registers[wide(p[0].reg), default: 0] >> UInt64(p[1].imm) & 1 == 1 { next = Int(p[2].imm) }+ case "mov" where p[1].type == .immediate: registers[wide(p[0].reg)] = UInt64(p[1].imm)+ case "mov": registers[wide(p[0].reg)] = registers[wide(p[1].reg), default: 0]+ case "b": next = Int(p[0].imm)+ default: Issue.record("Unexpected clamp instruction: \(i)")+ }+ pc = next+ }+ #expect(pc == branch.fileOffset + 4)+ #expect(registers[wide(grantedRegister)] == granted)+ return registers[.x(0), default: 0]+ }+/// Execute the emitted instructions with hostile caller-saved register/// clobbers at the two helper calls. This catches stack/LR/root-pointer/// mistakes and over-copying that a disassembly snapshot would miss.diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swiftindex 37732c39..325b31ac 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift@@ -300,6 +300,16 @@ struct FirmwarePatchSetCatalogTests {blocked: Set(FirmwarePatchSetCatalog.currentIdentifiers(["kernel-exp-paravirt_gpu_task3"])),)#expect(!blocked.isEnabled(patch))+ // The kernel anchors exist only in cloudOS 26.4; earlier kernels must+ // not select a patch whose discovery would abort the kernel install.+ for (iOS, cloudOS) in [("18.6.2", "26.1"), ("26.2", "26.2"), ("26.3.1", "26.3")] {+ let plan = try VPhonePatchPlan.resolve(+ preset: FirmwarePatchSetCatalog.standardPreset,+ patchSets: FirmwarePatchSetCatalog.bundled,+ iOSBase: VPhoneVersion(iOS), cloudOS: VPhoneVersion(cloudOS),+ )+ #expect(!plan.isEnabled(patch))+ }for preset in [FirmwarePatchSetCatalog.tvOSPreset, FirmwarePatchSetCatalog.tvOS4KPreset] {let plan = try VPhonePatchPlan.resolve(preset: preset, patchSets: FirmwarePatchSetCatalog.bundled,diff --git a/VPhoneExecutable/VPhoneVirtualization/UI/VirtualMachine/VPhoneVirtualMachine.swift b/VPhoneExecutable/VPhoneVirtualization/UI/VirtualMachine/VPhoneVirtualMachine.swiftindex b9fb9191..ec9ff7a0 100644--- a/VPhoneExecutable/VPhoneVirtualization/UI/VirtualMachine/VPhoneVirtualMachine.swift+++ b/VPhoneExecutable/VPhoneVirtualization/UI/VirtualMachine/VPhoneVirtualMachine.swift@@ -106,11 +106,17 @@ class VPhoneVirtualMachine: NSObject, VZVirtualMachineDelegate {ecidHex = identity.ecidHexprint("[vphone] ECID: \(identity.ecidHex)")print("[vphone] Predicted UDID: \(identity.udid)")- let shaderCache = try VPhoneShaderCache.prepare(- machineDirectory: options.configURL.deletingLastPathComponent(), ecid: identity.ecid,- )- self.shaderCache = shaderCache- print("[vphone] Shader cache: \(shaderCache.cacheURL.path)")+ // The cache only saves recompiling; a VM that cannot keep one boots without it.+ do {+ let shaderCache = try VPhoneShaderCache.prepare(+ machineDirectory: options.configURL.deletingLastPathComponent(), ecid: identity.ecid,+ )+ self.shaderCache = shaderCache+ print("[vphone] Shader cache: \(shaderCache.cacheURL.path)")+ } catch {+ shaderCache = nil+ print("[vphone] Warning: shader cache not kept for this run: \(error.localizedDescription)")+ }let outputURL = options.configURL.deletingLastPathComponent().appendingPathComponent("udid-prediction.txt",)