Run a virtual iPhone on an Apple Silicon Mac.
Swift
Enable persistent GPU shader caching in Standard
Arbifox7478cc38d78f
diff --git a/Documents/Guides/launchpad-cli.md b/Documents/Guides/launchpad-cli.mdindex a09c984b..01dcb1ec 100644--- a/Documents/Guides/launchpad-cli.md+++ b/Documents/Guides/launchpad-cli.md@@ -52,6 +52,9 @@ Older stores may still hold `<version>-local` or `<version>-ci.<commit>`.## Testing a VPhone.bundle build+For the one-time kernel and guest update that enables persistent shader caches+on an existing VM, see [Persistent shader caches](shader-cache.md).+```shxcodebuild -workspace VPhone.xcworkspace -scheme VPhone \-configuration Debug -destination 'platform=macOS,arch=arm64' \diff --git a/Documents/Guides/shader-cache.md b/Documents/Guides/shader-cache.mdnew file mode 100644index 00000000..c084e964--- /dev/null+++ b/Documents/Guides/shader-cache.md@@ -0,0 +1,50 @@+# Persistent shader caches++New VMs created with the Standard preset automatically enable the Task3 kernel+patch and guest Metal cache reuse. The host saves its cache in+`<machine>/ShaderCache`, for example `~/.vphone/machines/Lychee/ShaderCache`.+Animations can lag while shaders compile on the first runs; later boots reuse+the compiled shaders. A changed executable gets a new host cache identity.++## Existing VMs++Install a Core Bundle containing this feature and bind the stopped VM to it.+In Launchpad, use **Update Guest Environment** from the machine's actions menu,+then **Update Kernel** in its **Patches** inspector. Standard now selects+**GPU Task3 shader cache** automatically. An explicit per-VM opt-out is preserved;+enable that patch in the editor first if it was unchecked.++The equivalent Launchpad CLI sequence is:++```sh+# Replace <version> with the installed Core Bundle version from bundle list.+vphone-launchpad-cli vm stop Lychee+vphone-launchpad-cli vm set-bundle Lychee <version> --update-environment+vphone-launchpad-cli cfw update-kernel Lychee+vphone-launchpad-cli vm start Lychee --wait+```++`--update-environment` redeploys the guest libraries and cache-reuse marker.+`cfw update-kernel` re-patches the pristine kernel in `FirmwareOriginals` using+the current selection and replaces the kernelcache in Preboot. Both updates+keep the guest's data; no restore or `fw patch` is needed. Updating the Core+Bundle binding alone does not update the installed kernel.++Older VMs that have no pristine kernel in `FirmwareOriginals` need `fw prepare`+and `fw patch` with the new bundle first, so the fallback restore tree contains+the updated kernel. Then run `cfw update-kernel`; do not run `restore`.++Standalone CLI users run the new bundle's `vphone-cli cfw update-environment+Lychee` and `vphone-cli cfw update-kernel Lychee` with root authorization while+the VM is off. Use `vphone-cli fw patches Lychee` to inspect pending patches.+Both update commands apply the VM's current selection, including any other+pending guest or kernel changes.++## Resetting the host cache++Stop the VM, then delete its `ShaderCache` directory. The next launch starts a+fresh host cache. Guest Metal caches are separate files inside `Disk.img`, so+clearing 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.diff --git a/Research/0_binary_patch_comparison.md b/Research/0_binary_patch_comparison.mdindex 9acb0c13..5b8b7eaa 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-exp-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, opt-in.** 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 an opted-in install. Replacements use ARM64Encoder; new encoders have Keystone 0.9.2 parity tests. Gated by applyParavirtTask3 and blocked in shipped presets. 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`, `.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 |### EXP-Only Kernel Methods (Reference List)@@ -3282,3 +3282,18 @@ animation stutter; the user reports smooth warmed animations.The corrected bundle's reset/reboot test recorded 607 then seven host GPU taskcompilation events (129 then one during Settings), with zero GPU resets on bothboots. Fourteen cache/permission tests and the complete bundle build pass.++Standard promotion (2026-10-20): JB-32 is now enabled by Standard as+`kernel-cfw-paravirt_gpu_task3`; all four record suffixes and kernel writes are+unchanged. The shipped plist and catalog fallback agree. tvOS presets retain+an explicit block. The old `kernel-exp-paravirt_gpu_task3` identifier migrates+in VM selections, plans and receipts, including explicit opt-outs. New template+keys include the enabled kernel patch, so a pre-Task3 template cannot satisfy+the new Standard plan. Existing VMs bind the new bundle and run+`cfw update-environment` and `cfw update-kernel` while stopped, keeping data.+See `Documents/Guides/shader-cache.md` and the Standard promotion section in+`Guest/gpu_acceleration.md`. The previous opt-in notes describe development+validation; older host compatibility remains untested.+Promotion validation: 62 focused tests passed, as did the full `VPhone` bundle+build and admission check. The built CLI recognized Lychee's old Task3 receipt+under the new name as applied, enabled by its preset and not pending.diff --git a/Research/Guest/gpu_acceleration.md b/Research/Guest/gpu_acceleration.mdindex dbd93027..259958d3 100644--- a/Research/Guest/gpu_acceleration.md+++ b/Research/Guest/gpu_acceleration.md@@ -562,9 +562,10 @@ the switch the identity write needs.Phase 2 extends the same opt-in declaration with `.identity_hook` and`.identity_code`. All four sites are discovered and encoded before any write;-an unresolved site aborts a selected Task3 operation. It remains opt-in under-`kernel-exp-paravirt_gpu_task3`; the runtime coverage below is one host/guest-combination. Lychee explicitly enables it in its patch selection.+an unresolved site aborts a selected Task3 operation. Initially opt-in under+`kernel-exp-paravirt_gpu_task3`, it was tested with Lychee explicitly enabling+it. Standard now enables it under `kernel-cfw-paravirt_gpu_task3`; see the+preset promotion below. Runtime coverage is still one host/guest combination.The key is the owning executable's **20-byte code-signing cdhash**. It is neithera process name nor a PID, and it is obtained from the task recorded by the GPU@@ -744,7 +745,7 @@ aliases, checkpoint failure, symlink rejection, concurrent launch exclusion andhard-linked lock rejection. Initial relocation validation passed twelvecache/permission tests and 61 targeted Task3, encoder and patch-selection tests,plus the `VPhone` workspace build and bundle admission. The original 50 GiB-installer guard and shipped Task3 preset defaults are unchanged.+installer guard and, at that point, shipped Task3 preset defaults were unchanged.All 14 existing Lychee `functions.list`/`functions.data` checksums matched theinitial move. With relocation bundle `2.10.1-local.12d3a7da`, two full boot/shutdown@@ -805,6 +806,35 @@ the VM was shut down again.Captures and build/test logs are preserved beside the earlier validation under`reset-validation`.+#### Task3 enabled in Standard, 2026-10-20++Standard now enables the complete Task3 patch as+`kernel-cfw-paravirt_gpu_task3`, alongside the already enabled guest Metal cache+reuse marker. The shipped Standard plist and built-in fallback agree; tvOS and+tvOS 4K explicitly block Task3. The old experimental identifier maps to the new+one when reading VM selections, plans and receipts, preserving saved opt-outs+and recognizing kernels already installed by development bundles.++New Standard creations apply both layers automatically. The resolved kernel+patch is part of the template's boot-chain digest, so a template lacking Task3+does not satisfy the new Standard key. Existing machines need their new Core+Bundle bound, `cfw update-environment`, then `cfw update-kernel` while stopped.+Launchpad exposes both updates through its helper. No restore or data erasure+is involved. See `Documents/Guides/shader-cache.md` for the user workflow.++This changes preset selection and record naming only; the four kernel writes+and runtime coverage above are unchanged. The direct kernel patcher default+remains false for reference-fixture callers; normal firmware pipelines set it+from the resolved plan. Older hosts remain untested.++Validation: 62 focused Task3, encoder, catalog and patch-model tests passed,+including Standard enablement, migration of the old identifier, explicit+blocking and tvOS exclusions. The complete `VPhone` bundle build and admission+check passed. The finished bundle's read-only `fw patches Lychee --json` report+recognized the existing Task3 kernel receipt as applied under the new name,+with `inPreset: true`, `wanted: true` and `pending: false`. No guest rewrite or+additional runtime boot was needed for this preset-only change.+## Heap Textures Have No CPU LayoutOn the iPadOS 26.6.2 iPad Pro guest (cloudOS 26.4 driver, `standard` preset),diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchParavirtTask3.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchParavirtTask3.swiftindex a967d026..bf9e5594 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchParavirtTask3.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/CustomFirmwarePatches/Drivers/KernelCustomFirmwarePatchParavirtTask3.swift@@ -1,7 +1,7 @@// KernelCustomFirmwarePatchParavirtTask3.swift — CFW kernel patch: ask the host// for paravirtual GPU binary version 252 while the guest keeps the features of// the version it was built for, and fill each task's Task3 executable identity-// before the host registers it. Both parts share one opt-in declaration.+// before the host registers it. Both parts share one patch declaration.//// Background: the guest GPU kext (AppleParavirtGPUIOGPUFamily) negotiates a// binary version with ParavirtualizedGraphics at start-up, and the host derivesdiff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelCustomFirmwarePatcher.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelCustomFirmwarePatcher.swiftindex 5154fd96..f4ae7156 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelCustomFirmwarePatcher.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/Kernel/KernelCustomFirmwarePatcher.swift@@ -46,8 +46,8 @@ public final class KernelCustomFirmwarePatcher: KernelCustomFirmwarePatcherBase,/// writes what the reference records were taken from.public var applyParavirtUserClients = false- /// Paravirtual GPU binary version 252 (Task3). Opt-in; false here so a patcher- /// built directly writes what the reference records were taken from.+ /// Paravirtual GPU binary version 252 (Task3). Set from the plan; `standard`+ /// enables it. False here so direct patchers preserve the reference corpus.public var applyParavirtTask3 = falsepublic func findAll() throws -> [PatchRecord] {@@ -123,7 +123,7 @@ public final class KernelCustomFirmwarePatcher: KernelCustomFirmwarePatcherBase,patchParavirtDisplayRefreshRate()}- // Opt-in: negotiate Task3 and identify the executable before registration.+ // Negotiate Task3 and identify the executable before registration.if applyParavirtTask3 {guard patchParavirtTask3Version() else {throw NSError(domain: "FirmwarePatcher.ParavirtTask3", code: 1, userInfo: [diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelCustomFirmwarePatchSet.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelCustomFirmwarePatchSet.swiftindex db8af570..0173b8cc 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelCustomFirmwarePatchSet.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwareKernelCustomFirmwarePatchSet.swift@@ -324,7 +324,7 @@ public enum FirmwareKernelCustomFirmwarePatchSet {identifier: FirmwarePatchSetCatalog.paravirtTask3Patch,title: "GPU Task3 shader cache",summary: """- Research: the guest GPU driver asks the host for binary version 252 \+ The guest GPU driver asks the host for binary version 252 \(Task3) while keeping its own features, and writes the owning \executable's code-signing hash into each task root. The host \retains a separate shader cache for each executable across boots.diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swiftindex ecbe1693..faef8372 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcher/PatchSets/FirmwarePatchSetCatalog.swift@@ -61,7 +61,7 @@ public enum FirmwarePatchSetCatalog {Set(FirmwareKernelFridaPatchSet.manifest.patches.map(\.identifier)).union(hypervisorConcealmentPatches).union(experimentalIdentityPatches)- .union([FirmwareKernelCustomFirmwarePatchSet.tvTPROPagers, misTrustAuthPatch, FirmwareGuestSystemPatchSet.settingsRootRows, FirmwareGuestSystemPatchSet.settingsSoftwareUpdate, FirmwareGuestSystemPatchSet.tvTPRO, FirmwareGuestSystemPatchSet.tvOTAUserland, paravirtTask3Patch])+ .union([FirmwareKernelCustomFirmwarePatchSet.tvTPROPagers, misTrustAuthPatch, FirmwareGuestSystemPatchSet.settingsRootRows, FirmwareGuestSystemPatchSet.settingsSoftwareUpdate, FirmwareGuestSystemPatchSet.tvTPRO, FirmwareGuestSystemPatchSet.tvOTAUserland])/// ProMotion: the 120 Hz timing for the paravirtual display.///@@ -80,18 +80,21 @@ public enum FirmwarePatchSetCatalog {/// Paravirtual GPU Task3: keep the guest's features and supply each owning/// executable's cdhash so the host retains separate shader caches across- /// boots. Off unless a VM selects it. See+ /// boots. On in `standard`; tvOS presets leave it off. Introduced as+ /// `kernel-exp-paravirt_gpu_task3` in development bundles; existing VM+ /// records migrate through ``renamedPatches``. See/// `Research/Guest/gpu_acceleration.md`.- public static let paravirtTask3Patch = "kernel-exp-paravirt_gpu_task3"+ public static let paravirtTask3Patch = "kernel-cfw-paravirt_gpu_task3"- /// Identifiers a released bundle declared that a later one renamed, old to new.+ /// Identifiers an installed bundle declared that a later one renamed, old to new.////// A VM's `PatchSelection.plist` and `PatchReceipt.plist` outlive the bundle/// that wrote them, and `fw patch` throws `unknownPatch` for an identifier- /// nothing declares. Only renames that reached a release are listed: one that- /// never left a development branch has no record to carry.+ /// nothing declares. Include development bundles used on real VMs as well+ /// as releases: their records need the same migration.public static let renamedPatches: [String: String] = ["kernel-exp-display_refresh_120hz": proMotionPatch,+ "kernel-exp-paravirt_gpu_task3": paravirtTask3Patch,]/// The identifiers this bundle declares for ones a VM recorded, in order, each@@ -223,6 +226,7 @@ public enum FirmwarePatchSetCatalog {/// plain-arm64 HD cannot load it), debugserver, the environment hooks, and/// the iPhone 19 ARM64E_X1 boot path.public static let tvOSBlockedPatches: Set<String> = [+ paravirtTask3Patch,FirmwareGuestSystemPatchSet.arm64eX1CacheBootstrap,"dyld-boot-iomfb_force_kern","dyld-boot-iomfb_swapend",diff --git a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swiftindex fd9b7168..37732c39 100644--- a/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift+++ b/VPhoneExecutable/VPhoneCommand/FirmwarePatcherTests/PatchSets/FirmwarePatchSetCatalogTests.swift@@ -280,6 +280,36 @@ struct FirmwarePatchSetCatalogTests {#expect(!blocked.isEnabled(patch))}+ @Test+ func `Standard enables persistent GPU caches while explicit blocks and tvOS stay off`() throws {+ let patch = FirmwarePatchSetCatalog.paravirtTask3Patch+ let guest = FirmwareGuestSystemPatchSet.metalCacheReuse+ let standard = try VPhonePatchPlan.resolve(+ preset: FirmwarePatchSetCatalog.standardPreset,+ patchSets: FirmwarePatchSetCatalog.bundled,+ iOSBase: VPhoneVersion("27.0.1"), cloudOS: VPhoneVersion("26.4"),+ )+ #expect(standard.isEnabled(patch))+ #expect(standard.isEnabled(guest))+ // Existing records use the experimental identifier. A saved opt-out+ // must still win when the preset now turns the renamed patch on.+ let blocked = try VPhonePatchPlan.resolve(+ preset: FirmwarePatchSetCatalog.standardPreset,+ patchSets: FirmwarePatchSetCatalog.bundled,+ iOSBase: VPhoneVersion("27.0.1"), cloudOS: VPhoneVersion("26.4"),+ blocked: Set(FirmwarePatchSetCatalog.currentIdentifiers(["kernel-exp-paravirt_gpu_task3"])),+ )+ #expect(!blocked.isEnabled(patch))+ for preset in [FirmwarePatchSetCatalog.tvOSPreset, FirmwarePatchSetCatalog.tvOS4KPreset] {+ let plan = try VPhonePatchPlan.resolve(+ preset: preset, patchSets: FirmwarePatchSetCatalog.bundled,+ iOSBase: VPhoneVersion("27.0"), cloudOS: VPhoneVersion("26.4"),+ )+ #expect(!plan.isEnabled(patch))+ #expect(!plan.isEnabled(guest))+ }+ }+@Testfunc `A renamed patch maps to one the catalogue declares`() {let declared = Set(FirmwarePatchSetCatalog.allDeclarations.map(\.identifier))@@ -287,14 +317,16 @@ struct FirmwarePatchSetCatalogTests {#expect(!declared.contains(old), "\(old) is still declared")#expect(declared.contains(new), "\(old) maps to \(new), which nothing declares")}- // A record that named the old 120 Hz identifier, possibly beside the new- // one, reads as the new one, once, in place.+ // Records using an old identifier, possibly beside its replacement,+ // read as the new one, once, in place.#expect(FirmwarePatchSetCatalog.currentIdentifiers(["kernel-exp-hv_vmm","kernel-exp-display_refresh_120hz",FirmwarePatchSetCatalog.proMotionPatch,- ]) == ["kernel-exp-hv_vmm", FirmwarePatchSetCatalog.proMotionPatch],+ "kernel-exp-paravirt_gpu_task3",+ FirmwarePatchSetCatalog.paravirtTask3Patch,+ ]) == ["kernel-exp-hv_vmm", FirmwarePatchSetCatalog.proMotionPatch, FirmwarePatchSetCatalog.paravirtTask3Patch],)}diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plistindex fe2ff2d6..52f8f095 100644--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/standard.plist@@ -68,7 +68,6 @@<key>Patches</key><array><string>kernel-exp-frida_thread_set_state_entitlement_flag</string>- <string>kernel-exp-paravirt_gpu_task3</string><string>kernel-exp-frida_vm_map_delete_immutable_code</string><string>kernel-exp-hv_vmm</string><string>dyld-exp-hv_vmm</string>diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plistindex 8304b4d1..f07b8b56 100644--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos-4k.plist@@ -68,7 +68,7 @@<key>Patches</key><array><string>kernel-exp-frida_thread_set_state_entitlement_flag</string>- <string>kernel-exp-paravirt_gpu_task3</string>+ <string>kernel-cfw-paravirt_gpu_task3</string><string>kernel-exp-frida_vm_map_delete_immutable_code</string><string>kernel-exp-hv_vmm</string><string>dyld-exp-hv_vmm</string>diff --git a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plistindex 6c5f3872..b93b2088 100644--- a/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist+++ b/VPhoneExecutable/VPhoneVirtualization/Resources/patches_presets/tvos.plist@@ -68,7 +68,7 @@<key>Patches</key><array><string>kernel-exp-frida_thread_set_state_entitlement_flag</string>- <string>kernel-exp-paravirt_gpu_task3</string>+ <string>kernel-cfw-paravirt_gpu_task3</string><string>kernel-exp-frida_vm_map_delete_immutable_code</string><string>kernel-exp-hv_vmm</string><string>dyld-exp-hv_vmm</string>