Play your Steam library's Windows games on a jailbroken PS5.
C++
Use kit H r9: Direct3D 9 effects for older games
Leonardo Lobatodf23c4f2e947
diff --git a/COMPATIBILITY.md b/COMPATIBILITY.mdindex ed828a6..727e1bc 100644--- a/COMPATIBILITY.md+++ b/COMPATIBILITY.md@@ -3,7 +3,7 @@Games tested on a PS5 on firmware 13.60, plus community test reports (linked in the notes) on other firmware. Last updated 2026-10-15.> [!NOTE]-> This release uses **kit H r8**, where OpenGL games draw through Mesa (Zink on Vulkan). Every game marked **H** was+> This release uses **kit H r9**, where OpenGL games draw through Mesa (Zink on Vulkan). Every game marked **H** was> checked on kit H (the revision where the column names one). Balatro was not, so its result is from kit C, which drew OpenGL through ps5-opengl instead.Did you test a game? [Open a test report](../../issues/new?template=test-report.yml), even when it works.@@ -110,6 +110,7 @@ uses: Direct3D 8–11 goes through DXVK to Vulkan.| Kit | What changed for games || --- | --- |+| H r9 | Wine builds more of the Direct3D 9 effects that games compile while they run, so DoDonPachi Resurrection starts and Star Wars: Empire at War shows its menus. No Recreate bottle needed. || H r8 | Games see the console's memory, about 12 GB, and a page file of the same size. Before, they saw almost none, so games that check free memory at start-up stopped (Fallout: New Vegas). No Recreate bottle needed. || H r6 | Bottles have the .NET Framework registry entries and files that Wine Mono's installer writes, so .NET lookups of the Framework folder work. Recreate bottle for games set up on an earlier kit. || H r4 | Wine Mono ships with the kit, so .NET programs start instead of being refused (ENSLAVED). |diff --git a/README.md b/README.mdindex 95847e9..7115e8c 100644--- a/README.md+++ b/README.md@@ -100,8 +100,8 @@ Other versions can work, but these are the ones we know.Download both files from the latest [release](../../releases):-- `playden-ps5-0.2.0.zip`: the Playden app (`FAKE77031`) and the console tools used below.-- `playden-kit-h-r8.zip`: the runtime kit (`hl2-fw1360-dev1`), with its source list and license texts.+- `playden-ps5-0.3.0.zip`: the Playden app (`FAKE77031`) and the console tools used below.+- `playden-kit-h-r9.zip`: the runtime kit (`hl2-fw1360-dev1`), with its source list and license texts.You need Python 3 on your computer for the tools. Unzip both files next to each other, then run the commands fromthe `playden-ps5-<version>` folder, which holds `tools/`.@@ -126,7 +126,7 @@ the `playden-ps5-<version>` folder, which holds `tools/`.### Update Playden-From the release after 0.2.0, Playden updates itself from this repository's GitHub releases:+Since 0.3.0, Playden updates itself from this repository's GitHub releases:- **Check:** at startup, and with Settings › About › Playden updates › Check now. When a newer release is out,Playden offers it once, with its notes, its download size, and a QR code for its release page on GitHub.@@ -149,10 +149,10 @@ backup of what it replaced, and puts those three folders' modes right if they ch### Install the runtime kit-This release uses **kit H r8**. Upload the kit folder from `playden-kit-h-r8.zip`:+This release uses **kit H r9**. Upload the kit folder from `playden-kit-h-r9.zip`:```sh-python3 tools/console_kit_upload.py ../playden-kit-h-r8/hl2-fw1360-dev1 --host <PS5 IP> --replace+python3 tools/console_kit_upload.py ../playden-kit-h-r9/hl2-fw1360-dev1 --host <PS5 IP> --replace```The upload checks every file before it switches to the new kit, and creates `/data/playden/kits` on a console thatdiff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.mdindex 5c29193..348e2f9 100644--- a/THIRD_PARTY_NOTICES.md+++ b/THIRD_PARTY_NOTICES.md@@ -46,8 +46,8 @@ revisions it was built from and includes their license texts in `LICENSES/`, and| Component | Version | License | Source || --- | --- | --- | --- || Wine | upstream with the prospero-win patch series | LGPL-2.1-or-later | [winehq.org](https://www.winehq.org/), patches in prospero-win `wine/patches/` |-| prospero-win (Wine's PS5 side, the 32-bit translator, the per-game app shell) | kit H r8: Wine and runtime `13fa077`, app shell `4a1aa7a` | LGPL-2.1 | [mpereiraesaa/prospero-win](https://github.com/mpereiraesaa/prospero-win), our fork [leolobato/prospero-win](https://github.com/leolobato/prospero-win) |-| prospero-foundation (native app tools for the per-game app shell) | kit H r8: `9c0b994` | GPL-3.0 | Fork of [mpereiraesaa/ps5-native-app-boilerplate](https://github.com/mpereiraesaa/ps5-native-app-boilerplate) |+| prospero-win (Wine's PS5 side, the 32-bit translator, the per-game app shell) | kit H r9: Wine and runtime `d069101`, app shell `4a1aa7a` | LGPL-2.1 | [mpereiraesaa/prospero-win](https://github.com/mpereiraesaa/prospero-win), our fork [leolobato/prospero-win](https://github.com/leolobato/prospero-win) |+| prospero-foundation (native app tools for the per-game app shell) | kit H r9: `9c0b994` | GPL-3.0 | Fork of [mpereiraesaa/ps5-native-app-boilerplate](https://github.com/mpereiraesaa/ps5-native-app-boilerplate) || DXVK | 2.6.2 | Zlib | [doitsujin/dxvk](https://github.com/doitsujin/dxvk) || Mesa (WGL and Zink, for OpenGL games) | PS5_Mesa `e4607ef` | MIT | [mpereiraesaa/PS5_Mesa](https://github.com/mpereiraesaa/PS5_Mesa), based on [Mesa](https://mesa3d.org/) || RADV for the PS5 (`libvulkan.prx`) | PS5_Vulkan `8aee3af`, PS5_Mesa `01d7057` | GPL-3.0 (PS5_Vulkan); MIT (Mesa) | [mpereiraesaa/PS5_Vulkan](https://github.com/mpereiraesaa/PS5_Vulkan), [mpereiraesaa/PS5_Mesa](https://github.com/mpereiraesaa/PS5_Mesa) |diff --git a/dependencies.lock.json b/dependencies.lock.jsonindex 3904dc8..490abe2 100644--- a/dependencies.lock.json+++ b/dependencies.lock.json@@ -176,7 +176,7 @@}},"prospero_win": {- "revision": "d069101587b8e740f6858f37f83617c514356477",+ "revision": "b9b0aa509e551bffae30e5d18b5559d09ce3c7dd","url": "https://github.com/leolobato/prospero-win.git","default_source": "third_party/prospero-win","published": false,@@ -226,9 +226,9 @@"prospero_kit": {"kit_id": "hl2-fw1360-dev1","published": false,- "status": "kit H r8: kit H r6 with ntdll.prx rebuilt from prospero-win 13fa077 with Wine patch 0603 (upstream PR #688): Windows memory queries report the title's direct-memory pool and largest free block, with an equal synthetic page file, instead of the sandbox's empty BSD readings (Fallout: New Vegas); r7 was a development kit; template, shell and Mono unchanged, so bottles need no Recreate. kit H r6: kit H r5 with the template bottle carrying what Wine Mono's support MSI (winemono-support.msi 11.3.0) writes when Wine installs it: HKLM\\Software\\Microsoft\\.NETFramework InstallRoot (C:\\windows\\Microsoft.NET\\Framework64\\, and Framework\\ in the Wow6432Node view), the policy, NET Framework Setup\\NDP, Active Setup, Post Platform and XNA keys of its Registry table, the CorSymWriter class, and C:\\windows\\Microsoft.NET (mscorlib/machine.config stubs and Wine's fake DLLs, 60 files), taken from a real install with kit H's host Wine (tools/kit-h/update_r6.py), so mscoree's LoadLibraryShim finds the install root (Antichamber); Mono stays at the kit root; bottles made from an earlier template need Recreate bottle; runtime and shell unchanged. kit H r5: kit H r4 with the title shell rebuilt from prospero-win 4a1aa7a, which reads a profile's [environment] section (up to 8 DXVK_/MESA_/RADV_/SDL_ variables or WINE_CPU_TOPOLOGY, logged as PW_WINE64 environment NAME=value), and ntdll.prx rebuilt from 70bfc92 with Wine patch 0958 (WINE_CPU_TOPOLOGY lowers NumberOfProcessors to its count), so Game settings > Environment variables and CPU cores reach the game; capability settings-profile-environment; template unchanged. kit H r4: kit H r3 with Wine Mono 11.3.0 at the kit root (mono/wine-mono-11.3.0, uploaded once, not copied per title or bottle) and the template's user.reg pointing Wine's mscoree at it (HKCU\\Software\\Wine\\Mono RuntimePath = Z:\\data\\playden\\kits\\hl2-fw1360-dev1\\mono\\wine-mono-11.3.0), so .NET and mixed C++/CLI programs can start (ENSLAVED); capability wine-mono; bottles made from an earlier template need Recreate bottle; runtime unchanged. kit H r3: kit H r2 with Wine patch 0957 (prospero-win 2b91e15): kernelbase reads the stored computer name when wineboot's volatile ActiveComputerName key is missing, so dxdiagn initializes (GUN). kit H r2: kit H with Wine patch 0170 (prospero-win 2c4eaa6): ntdll records the path of a directory it receives from the in-process server, so names opened relative to a directory handle resolve (.NET recursive enumeration, Caves of Qud). kit H: everything rebuilt on prospero-win rebased onto upstream 644e32e (bceed2d), with GnuTLS schannel and patch 0956 for Godot's OpenGL window; as kit G: OpenGL games draw through Mesa WGL/Zink (PE32/PE64 in the any-title shell at win/mesa-zink), the PS5 OpenGL SDK path is gone, our Wine patches at 0950-0955; development kit (Mesa DLLs and libgnutls.prx carry build paths); console acceptance pending; authorized no-drop fallback",- "manifest_sha256": "bcbf77d8780ad7c6337663e83a774db8a5daaef997a5c6aeb678d89378356e61",- "files_sha256": "0f08bcf5f579bb546ac180297c9856e5433a47e6eed6dd2ddce5acda3a892500",+ "status": "kit H r9: kit H r8 with wined3d.dll (i386 and x86_64, runtime and template system32/syswow64 copies) rebuilt from prospero-win d069101 with Wine patches 0959-0963: vkd3d-shader writes fx_2_0 effects with in-pass shaders, sampler states and parameter references, TRUE/FALSE for any state and NULL shader and texture states, and compiles ps_1_x effect shaders as ps_2_0, so D3DXCreateEffect builds the effects of DoDonPachi Resurrection and Star Wars: Empire at War; cross PRXs, shell, Mono and the rest of the template unchanged, so bottles need no Recreate. kit H r8: kit H r6 with ntdll.prx rebuilt from prospero-win 13fa077 with Wine patch 0603 (upstream PR #688): Windows memory queries report the title's direct-memory pool and largest free block, with an equal synthetic page file, instead of the sandbox's empty BSD readings (Fallout: New Vegas); r7 was a development kit; template, shell and Mono unchanged, so bottles need no Recreate. kit H r6: kit H r5 with the template bottle carrying what Wine Mono's support MSI (winemono-support.msi 11.3.0) writes when Wine installs it: HKLM\\Software\\Microsoft\\.NETFramework InstallRoot (C:\\windows\\Microsoft.NET\\Framework64\\, and Framework\\ in the Wow6432Node view), the policy, NET Framework Setup\\NDP, Active Setup, Post Platform and XNA keys of its Registry table, the CorSymWriter class, and C:\\windows\\Microsoft.NET (mscorlib/machine.config stubs and Wine's fake DLLs, 60 files), taken from a real install with kit H's host Wine (tools/kit-h/update_r6.py), so mscoree's LoadLibraryShim finds the install root (Antichamber); Mono stays at the kit root; bottles made from an earlier template need Recreate bottle; runtime and shell unchanged. kit H r5: kit H r4 with the title shell rebuilt from prospero-win 4a1aa7a, which reads a profile's [environment] section (up to 8 DXVK_/MESA_/RADV_/SDL_ variables or WINE_CPU_TOPOLOGY, logged as PW_WINE64 environment NAME=value), and ntdll.prx rebuilt from 70bfc92 with Wine patch 0958 (WINE_CPU_TOPOLOGY lowers NumberOfProcessors to its count), so Game settings > Environment variables and CPU cores reach the game; capability settings-profile-environment; template unchanged. kit H r4: kit H r3 with Wine Mono 11.3.0 at the kit root (mono/wine-mono-11.3.0, uploaded once, not copied per title or bottle) and the template's user.reg pointing Wine's mscoree at it (HKCU\\Software\\Wine\\Mono RuntimePath = Z:\\data\\playden\\kits\\hl2-fw1360-dev1\\mono\\wine-mono-11.3.0), so .NET and mixed C++/CLI programs can start (ENSLAVED); capability wine-mono; bottles made from an earlier template need Recreate bottle; runtime unchanged. kit H r3: kit H r2 with Wine patch 0957 (prospero-win 2b91e15): kernelbase reads the stored computer name when wineboot's volatile ActiveComputerName key is missing, so dxdiagn initializes (GUN). kit H r2: kit H with Wine patch 0170 (prospero-win 2c4eaa6): ntdll records the path of a directory it receives from the in-process server, so names opened relative to a directory handle resolve (.NET recursive enumeration, Caves of Qud). kit H: everything rebuilt on prospero-win rebased onto upstream 644e32e (bceed2d), with GnuTLS schannel and patch 0956 for Godot's OpenGL window; as kit G: OpenGL games draw through Mesa WGL/Zink (PE32/PE64 in the any-title shell at win/mesa-zink), the PS5 OpenGL SDK path is gone, our Wine patches at 0950-0955; development kit (Mesa DLLs and libgnutls.prx carry build paths); console acceptance pending; authorized no-drop fallback",+ "manifest_sha256": "a8390b0264ea6486d14846c1e1b5c09af6b7e02281b53dae21a26d8617f9a87b",+ "files_sha256": "9aa0ae18b5a0767001d917091fc4926b4694d66b0c697c6d0a9f19b92898a2c4","console_root": "/data/playden/kits/hl2-fw1360-dev1","firmware": ["13.60"@@ -246,8 +246,8 @@"wow64_i386"],"wrapper_revision": "4a1aa7a158c2b605becf8042c3ed9c9e142d9652",- "runtime_artifact_revision": "13fa077-kit-h-r8",- "runtime_inventory_source": "Kit H r8: kit H r6 (r5's runtime) with ntdll.prx rebuilt from prospero-win 13fa077 (patch 0603) in the same work folder; every other file unchanged. Kit H r5: kit H r4 with ntdll.prx rebuilt from prospero-win 70bfc92 (patch 0958); every other file unchanged. Kit H r3: kit H r2 with kernelbase.dll (i386 and x86_64, runtime and template system32/syswow64 copies) rebuilt from prospero-win 2b91e15 (patch 0957); every other file unchanged. Kit H r2: kit H r1 with ntdll.prx rebuilt from prospero-win 2c4eaa6 (patch 0170); every other file unchanged. Kit H: as kit G r2, every file rebuilt from prospero-win bceed2d (upstream 644e32e; adds libgnutls.prx, secur32.prx and share/wine/ca-certificates.crt); kit G: kit F's runtime key set, every file rebuilt from prospero-win f29127a on ps5-amd64 under the path-neutral prefix map (host Wine, cross PRXs and patched PE modules, wowprospero, wow64native); template from kit A's with its 516 builtins plus every patched module re-sourced and the i386 HID drivers in syswow64/drivers; shell from f29127a with Mesa e4607ef WGL/Zink (build/kit-g). r2: libvulkan.prx relinked from PS5_Vulkan 8aee3af (PS5_Mesa 01d7057), whose VideoOut hands the display from a swapchain that never presented to the next, so SDL and wined3d GL probe windows no longer keep a Zink game black.",+ "runtime_artifact_revision": "d069101-kit-h-r9",+ "runtime_inventory_source": "Kit H r9: kit H r8 with wined3d.dll (i386 and x86_64) rebuilt from prospero-win d069101 (patches 0959-0963) in the same work folder and stripped; every other file unchanged. Kit H r8: kit H r6 (r5's runtime) with ntdll.prx rebuilt from prospero-win 13fa077 (patch 0603) in the same work folder; every other file unchanged. Kit H r5: kit H r4 with ntdll.prx rebuilt from prospero-win 70bfc92 (patch 0958); every other file unchanged. Kit H r3: kit H r2 with kernelbase.dll (i386 and x86_64, runtime and template system32/syswow64 copies) rebuilt from prospero-win 2b91e15 (patch 0957); every other file unchanged. Kit H r2: kit H r1 with ntdll.prx rebuilt from prospero-win 2c4eaa6 (patch 0170); every other file unchanged. Kit H: as kit G r2, every file rebuilt from prospero-win bceed2d (upstream 644e32e; adds libgnutls.prx, secur32.prx and share/wine/ca-certificates.crt); kit G: kit F's runtime key set, every file rebuilt from prospero-win f29127a on ps5-amd64 under the path-neutral prefix map (host Wine, cross PRXs and patched PE modules, wowprospero, wow64native); template from kit A's with its 516 builtins plus every patched module re-sourced and the i386 HID drivers in syswow64/drivers; shell from f29127a with Mesa e4607ef WGL/Zink (build/kit-g). r2: libvulkan.prx relinked from PS5_Vulkan 8aee3af (PS5_Mesa 01d7057), whose VideoOut hands the display from a swapchain that never presented to the next, so SDL and wined3d GL probe windows no longer keep a Zink game black.","wine_mono": {"version": "11.3.0","url": "https://dl.winehq.org/wine/wine-mono/11.3.0/wine-mono-11.3.0-x86.tar.xz",diff --git a/src/runtime/kit_trust.h b/src/runtime/kit_trust.hindex 16bba1e..72a245d 100644--- a/src/runtime/kit_trust.h+++ b/src/runtime/kit_trust.h@@ -12,7 +12,7 @@ namespace playden::runtime {inline constexpr const char* kDevelopmentKitId = "hl2-fw1360-dev1";inline constexpr const char* kDevelopmentKitRoot = "/data/playden/kits/hl2-fw1360-dev1";inline constexpr const char* kExpectedKitManifestSha256 =- "bcbf77d8780ad7c6337663e83a774db8a5daaef997a5c6aeb678d89378356e61";+ "a8390b0264ea6486d14846c1e1b5c09af6b7e02281b53dae21a26d8617f9a87b";// What this build accepts from a kit, on any console firmware.KitAdmissionConfig DevelopmentKitAdmission();diff --git a/third_party/prospero-win b/third_party/prospero-winindex d069101..b9b0aa5 160000--- a/third_party/prospero-win+++ b/third_party/prospero-win@@ -1 +1 @@-Subproject commit d069101587b8e740f6858f37f83617c514356477+Subproject commit b9b0aa509e551bffae30e5d18b5559d09ce3c7dddiff --git a/tools/kit-h/README.md b/tools/kit-h/README.mdindex 24b0872..1523048 100644--- a/tools/kit-h/README.md+++ b/tools/kit-h/README.md@@ -69,12 +69,18 @@ template bottle what Wine Mono's support MSI writes when Wine installs it, whichthem mscoree's `LoadLibraryShim` fails (Antichamber). Install the MSI once with kit H's host Wine on an x86_64 Linux host(the commands are in `update_r6.py`; Rosetta can't run wow64 Wine), then run `update_r6.py` on the Mac on a copy of r5'sinputs and spec. It takes only what the MSI accounts for and checks each file against the MSI's hashes or the runtime's-builtins. Bottles made from an earlier template need Recreate bottle. Kit H r8 (the kit this release uses; runtime+builtins. Bottles made from an earlier template need Recreate bottle. Kit H r8 (runtime`13fa077-kit-h-r8`; r7 was a development kit and was not released) is r6 with Wine patch 0603: Windows memory queriesreport the title's direct-memory budget instead of about zero, so Fallout: New Vegas starts. Build the cross PRXs with`build_wine_ps5.sh` on 13fa077 into the same `wine-ps5` work folder as before (assert messages keep the source path, soanother folder name changes every PRX), then run `update_r8.py` on a copy of r6's inputs and spec with-`PLAYDEN_CROSS_PRX` at that build's `prx/sce_module`. Only `ntdll.prx` changes, so bottles need no Recreate. RADV (`libvulkan.prx`) comes+`PLAYDEN_CROSS_PRX` at that build's `prx/sce_module`. Only `ntdll.prx` changes, so bottles need no Recreate. Kit H r9+(the kit this release uses; runtime `d069101-kit-h-r9`) is r8 with Wine patches 0959-0963: vkd3d-shader builds the D3DX+effects that DoDonPachi Resurrection and Star Wars: Empire at War compile at runtime. Build with `build_wine_ps5.sh` on+d069101 into the same `wine-ps5` folder (every cross PRX must still be r8's), strip the build's `pe/*/wined3d.dll` with+`*-mingw32-strip -s`, then run `update_r9.py` on a copy of r8's inputs and spec with `PLAYDEN_CROSS_PE` at those PE files.+Only `wined3d.dll` changes, in the runtime and the template, and Wine loads the runtime's builtin, so bottles need no+Recreate. RADV (`libvulkan.prx`) comesfrom [PS5_Vulkan](https://github.com/mpereiraesaa/PS5_Vulkan) 8aee3af / [PS5_Mesa](https://github.com/mpereiraesaa/PS5_Mesa)01d7057, the same as kit G r2. OpenGL games under Zink need at least PS5_Mesa f2ee389.diff --git a/tools/kit-h/update_r9.py b/tools/kit-h/update_r9.pynew file mode 100644index 0000000..e88ed23--- /dev/null+++ b/tools/kit-h/update_r9.py@@ -0,0 +1,76 @@+#!/usr/bin/env python3+# Kit H r9: kit H r8 with wined3d.dll (i386 and x86_64) rebuilt from the prospero-win commit that adds Wine patches 0959-0963:+# vkd3d-shader writes fx_2_0 effects with in-pass shaders, sampler states and parameter references, accepts TRUE/FALSE for any+# state, writes NULL shader and texture states, and compiles ps_1_x effect shaders as ps_2_0, so D3DXCreateEffect builds the+# effects of DoDonPachi Resurrection and Star Wars: Empire at War. wined3d links vkd3d-shader, so it is the module that changes,+# in the runtime and in the template's system32/syswow64; every cross PRX stays r8's, and bottles need no Recreate.+# Copy kit H r8's inputs and kit-spec.json to PLAYDEN_KIT_DIR first (cp -c works). Build with build_cross.sh's arguments into+# the same wine-ps5 work folder as r8, then run this script with PLAYDEN_CROSS_PE at that build's pe folder (copied to the+# Mac), PLAYDEN_CROSS_PRX at its prx/sce_module and PLAYDEN_RUNTIME_REVISION set to that commit. The PE copies come out+# unstripped: strip them with *-mingw32-strip -s, as build_host_wine.sh does, before running this.+import hashlib, json, os, shutil+from pathlib import Path++work = Path(os.environ.get('PLAYDEN_KIT_WORK', Path.home() / 'playden-kit'))+pe = Path(os.environ.get('PLAYDEN_CROSS_PE', work / 'wine-ps5/pe')).resolve()+cross = Path(os.environ.get('PLAYDEN_CROSS_PRX', work / 'wine-ps5/prx/sce_module')).resolve()+here = Path(os.environ.get('PLAYDEN_KIT_DIR', 'build/kit-h-r9')).resolve()+previous = Path(os.environ.get('PLAYDEN_KIT_FROM', 'build/kit-h-r8')).resolve()+runtime = here / 'inputs/runtime/wine'+template = here / 'inputs/template/game'+def sha(p): return hashlib.sha256(p.read_bytes()).hexdigest()+def replace(source, target):+ mode = target.stat().st_mode & 0o7777+ target.unlink() # the inputs may be a copy-on-write clone of r8's+ shutil.copyfile(source, target); target.chmod(mode)++spec_path = here / 'kit-spec.json'+spec = json.loads(spec_path.read_text().replace(str(previous) + '/', str(here) + '/'))+assert spec['runtime']['artifact_revision'].endswith('-kit-h-r8'), 'r9 starts from r8'++# Every cross PRX must still be r8's.+drifted = [p.name for p in sorted(cross.glob('*.prx')) if sha(p) != sha(runtime / 'lib/wine/x86_64-unix' / p.name)]+assert not drifted, f'cross PRXs that differ from r8: {drifted}'++changed = []+for arch in ('i386-windows', 'x86_64-windows'):+ source, target = pe / arch / 'wined3d.dll', runtime / 'lib/wine' / arch / 'wined3d.dll'+ assert source.is_file() and target.is_file(), (source, target)+ if sha(source) != sha(target):+ replace(source, target)+ changed.append(f'lib/wine/{arch}/wined3d.dll')+substitutions = json.loads((here / 'inputs/template-substitutions.json').read_text())+template_changed = []+for entry in substitutions['files']:+ if entry['runtime_source'] in changed:+ target = template / entry['template_path']+ if sha(target) != sha(runtime / entry['runtime_source']):+ replace(runtime / entry['runtime_source'], target)+ entry['after_sha256'] = sha(target)+ template_changed.append(entry['template_path'])+assert len(template_changed) == len(changed), template_changed+inventory = {f'wine/{p.relative_to(runtime)}': sha(p) for p in sorted(runtime.rglob('*')) if p.is_file()}+(here / 'inputs/runtime-inventory.json').write_text(json.dumps(inventory, indent=1, sort_keys=True) + '\n')++revision = os.environ['PLAYDEN_RUNTIME_REVISION']+assert len(revision) == 40, revision+artifact = f'{revision[:7]}-kit-h-r9'+spec['runtime'].update(wine_revision=revision, artifact_revision=artifact)+spec['sources']['wine']['revision'] = revision+spec_path.write_text(json.dumps(spec, indent=1, sort_keys=True) + '\n')++substitutions['runtime_artifact_revision'] = artifact+substitutions['changed'] = sum(f['before_sha256'] != f['after_sha256'] for f in substitutions['files'])+(here / 'inputs/template-substitutions.json').write_text(json.dumps(substitutions, indent=1) + '\n')+record = json.loads((here / 'inputs/stage-record.json').read_text())+record['r9'] = {'wine_patches': ['0959-vkd3d-shader-fx-implement-pass-assignment-for-fx-2-0',+ '0960-vkd3d-shader-fx-write-sampler-state-initializers-for-fx-2-0',+ '0961-vkd3d-shader-fx-accept-true-and-false-for-any-fx-2-0-state',+ '0962-vkd3d-shader-fx-write-null-shader-and-texture-states-for-fx-2-0',+ '0963-vkd3d-shader-hlsl-compile-ps-1-x-effect-shaders-as-ps-2-0'],+ 'changed': changed, 'template_changed': template_changed}+record['cross_pe_modules'] = sorted(set(record.get('cross_pe_modules', [])) | {c.removeprefix('lib/wine/') for c in changed})+record['prospero_win'] = revision+record['artifact_revision'] = artifact+(here / 'inputs/stage-record.json').write_text(json.dumps(record, indent=1) + '\n')+print('changed', changed, 'template', template_changed, 'files', len(inventory), artifact)