From 670adb4795676d5803c8d00ae4eac82215232de7 Mon Sep 17 00:00:00 2001 From: Cristian Cerroni Date: Fri, 23 Oct 2026 17:42:05 -0400 Subject: [PATCH] Verify standalone packages and Windows Vulkan rendering under isolated Wine --- GamePort.csproj | 5 +++-- README.md | 3 ++- docs/compatibility.md | 1 + docs/infrastructure.md | 4 ++++ docs/progress.md | 4 ++++ docs/reference-testing.md | 23 ++++++++++++++++++++ docs/tasks.md | 1 + packages.lock.json | 4 +++- src/GamePort/Platform/Sdl.cs | 3 ++- tools/recon/reference_capture.py | 36 +++++++++++++++++++++++++------- 10 files changed, 71 insertions(+), 13 deletions(-) diff --git a/GamePort.csproj b/GamePort.csproj index b190914..7a36f06 100644 --- a/GamePort.csproj +++ b/GamePort.csproj @@ -2,6 +2,7 @@ Exe net10.0 + linux-x64;win-x64 enable enable true @@ -15,7 +16,7 @@ - - + + diff --git a/README.md b/README.md index e796f16..5e202ec 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,8 @@ Packages are local directories `dist/linux-x64` and `dist/win-x64`. Run `launch-scene.sh` or `launch-scene.cmd`; append `--headless --frames 1` for a render smoke test. They include the .NET runtime, SDL3 native library, SPIR-V, original asset copies, prepared lab/Jimmy resources, audio and limitations. -Windows cross-publishing is verified; native Windows execution is **unverified**. +Windows cross-publishing and preliminary headless Wine64 rendering are verified; +native Windows execution is **unverified**. These are investigation packages, not a finished game release. `scripts/test.sh` runs 20 Python regressions, native C# data/algorithm checks, diff --git a/docs/compatibility.md b/docs/compatibility.md index 67f67c9..58fa895 100644 --- a/docs/compatibility.md +++ b/docs/compatibility.md @@ -11,6 +11,7 @@ separate evidence categories. **The game is not fully reconstructed/playable yet | C# original loaders | Linux runtime | All128 PNG /254 ASE base meshes; morph/base UV tests | | .NET10 Linux build | Pass, zero warnings/errors | Local SDK10.0.402/runtime10.0.13 | | Windows x64 publish | Pass | Correct PE32+ app and SDL3.dll; native execution untested | +| Windows package under Wine64 | Preliminary headless pass | Two frames, exit0; fixed-time readback identical to Linux on lavapipe; validation disabled | | Linux self-contained package | Native run verified | Two headless frames without SDK/source/originals mounted | | Vulkan1.3 lab | llvmpipe + GTX1070 | Real indexed/textured/depth frame/readback; validation enabled, zero errors | | Original camera/projection | Data/math integrated | GAM camera, recovered FOV/clips; startup/follow behavior not compared | diff --git a/docs/infrastructure.md b/docs/infrastructure.md index 576da23..29207b9 100644 --- a/docs/infrastructure.md +++ b/docs/infrastructure.md @@ -45,6 +45,10 @@ animation state/render sorting are incomplete. See rendering.md for evidence. unverified. - Linux/Windows self-contained cross-publishing succeeds. Native Windows execution remains unverified; Wine reference testing is a separate investigation path. +- Preliminary Windows-package Wine64 check: standalone .NET10 executable rendered + two frames, exit0, with byte-identical PPM to Linux on the same software driver. + Validation was disabled for this Wine test; SDL window/input/audio and native + Windows drivers remain untested. See reference-testing.md for exact scope. ## Scope limits diff --git a/docs/progress.md b/docs/progress.md index a0fcd45..2af3a8d 100644 --- a/docs/progress.md +++ b/docs/progress.md @@ -31,6 +31,10 @@ runtime with local Linux/Windows packages. No completed playable-scene claim. - Self-contained linux-x64/win-x64 packages built under dist/. Linux package also renders inside a separate filesystem namespace with no SDK/project/original directory mounted. Windows native execution remains unverified. +- Windows x64 package also renders two headless frames under isolated Wine64, + exit0, without source/SDK/originals mounted. Its fixed-time PPM is byte-identical + to the Linux package on the same lavapipe driver. Native Windows remains untested; + Wine test did not enable validation or exercise SDL window/audio/input. - Official Wine11 original-copy runs attempted in isolated filesystem/network namespaces. Both GL and Vulkan backends produce unusable frames; details below. diff --git a/docs/reference-testing.md b/docs/reference-testing.md index 4125e41..3fdfd45 100644 --- a/docs/reference-testing.md +++ b/docs/reference-testing.md @@ -36,3 +36,26 @@ Those frames are also unusable. Failures must not be treated as original behavio No native Windows installation/VM or Windows 98 image was available in the initial environment/tool inventory. A local reference machine remains necessary if Wine cannot render correctly. Native Windows port execution remains separately untested. + +## Preliminary Windows-port smoke under Wine64 + +`python3 tools/recon/reference_capture.py --port-smoke --seconds 24 --debug` +mounts only the self-contained Windows package in a fresh filesystem/network +namespace, with its own win64 prefix. The runtime, assets, shaders and scene data +all come from that package; the source, SDK and Original directory are not mounted. +The new port calls Vulkan directly and does not use Wine's legacy D3D backend. + +The Windows x64 .NET10.0.13 executable decoded LV1B, loaded original lab/character +resources and rendered two offscreen frames through lavapipe, exiting0. This test +disabled Vulkan validation and **does not** establish Windows-driver validation, +SDL window/audio/input functionality or native Windows compatibility. + +At fixed morph time0.05, its PPM GPU readback is byte-identical to the native Linux +package readback (SHA-256 `c30bcbc95d00ce104b146cc46c84e9a9d50849bf0b0bf33c027a402bb46e47c4`). +Both use the same software Vulkan driver. This establishes consistency between +those two package executions, not fidelity to the original game. + +An initial harness configuration disabled mscoree for the legacy game and thereby +prevented Wine from loading the port's IL-only System.Runtime.dll. Port mode now +uses Wine's built-in mscoree, correcting the test environment; no app workaround +or Mono runtime is required. Logs/readback are in artifacts/windows-smoke/. diff --git a/docs/tasks.md b/docs/tasks.md index cb58811..fba513d 100644 --- a/docs/tasks.md +++ b/docs/tasks.md @@ -15,6 +15,7 @@ - [x] SDL3 recovered WAV stream consumption test (dummy device). - [x] Self-contained Linux and Windows local packages, matching SDL3 libraries. - [x] Packaged Linux runtime isolated from SDK/source/originals; renders successfully. +- [x] Preliminary Wine64 Windows-package render; exact fixed-time readback matches Linux. - [x] Isolated copied-original Wine attempts; actual failures documented. ## Next implementation priorities diff --git a/packages.lock.json b/packages.lock.json index 8f990c9..ff03494 100644 --- a/packages.lock.json +++ b/packages.lock.json @@ -50,6 +50,8 @@ "Microsoft.Extensions.DependencyModel": "9.0.9" } } - } + }, + "net10.0/linux-x64": {}, + "net10.0/win-x64": {} } } \ No newline at end of file diff --git a/src/GamePort/Platform/Sdl.cs b/src/GamePort/Platform/Sdl.cs index 158899b..7b669fb 100644 --- a/src/GamePort/Platform/Sdl.cs +++ b/src/GamePort/Platform/Sdl.cs @@ -12,7 +12,8 @@ internal static unsafe class Sdl { if(name!=Library)return 0; var filename=OperatingSystem.IsWindows()?"SDL3.dll":"libSDL3.so.0"; - foreach(var candidate in new[]{Path.Combine(AppContext.BaseDirectory,filename),Path.Combine(Directory.GetCurrentDirectory(),".tools/sdl/lib",filename),filename}) + var localDirectory = OperatingSystem.IsWindows() ? ".tools/sdl-win" : ".tools/sdl/lib"; + foreach(var candidate in new[]{Path.Combine(AppContext.BaseDirectory,filename),Path.Combine(Directory.GetCurrentDirectory(),localDirectory,filename),filename}) if(NativeLibrary.TryLoad(candidate,out var handle))return handle; return 0; }); diff --git a/tools/recon/reference_capture.py b/tools/recon/reference_capture.py index 4c20e51..0250d89 100644 --- a/tools/recon/reference_capture.py +++ b/tools/recon/reference_capture.py @@ -47,7 +47,14 @@ def inside(args): if display.poll() is not None: raise RuntimeError('Xvfb failed; see xvfb.log') time.sleep(0.1) wine_env = dict(os.environ, LIBGL_DRIVERS_PATH='/native/usr/lib/i386-linux-gnu/dri') - wine = subprocess.Popen(['/opt/wine-stable/bin/wine', args.game], cwd='/work/game', stdout=wlog, stderr=wlog, env=wine_env) + application = ['/opt/wine-stable/bin/wine', args.game] + if args.port_smoke: + application = ['/opt/wine-stable/bin/wine', r'Z:\port\GamePort.exe', + '--assets', r'Z:\port\assets', '--scene', r'Z:\port\scenes\level1b\scene.json', + '--level', 'gam/level1b.gam', '--original-camera', '--with-player', + '--headless', '--frames', '2', '--time', '0.05', '--no-validation', + '--screenshot', r'Z:\work\port-frame.ppm'] + wine = subprocess.Popen(application, cwd='/work' if args.port_smoke else '/work/game', stdout=wlog, stderr=wlog, env=wine_env) captures = [] for index in range(3): time.sleep(args.seconds / 3) @@ -56,6 +63,7 @@ def inside(args): captures.append({'file': target, 'captureExit': image.returncode, 'wineExit': wine.poll()}) if args.enter: captures[-1]['sentReturn'] = enter_key() + if args.port_smoke and wine.poll() is not None: break tree = subprocess.run(['xwininfo', '-root', '-tree'], capture_output=True, text=True) (work/'windows.txt').write_text(tree.stdout + tree.stderr) processes = [] @@ -63,7 +71,7 @@ def inside(args): try: processes.append(path.parent.name + ': ' + path.read_bytes().replace(b'\x00', b' ').decode('utf8', 'replace')) except OSError: pass (work/'processes.txt').write_text('\n'.join(processes)+'\n') - (work/'capture.json').write_text(json.dumps({'game': args.game, 'captures': captures}, indent=2)+'\n') + (work/'capture.json').write_text(json.dumps({'game': 'GamePort.exe' if args.port_smoke else args.game, 'captures': captures}, indent=2)+'\n') finally: subprocess.run(['/opt/wine-stable/bin/wineserver', '-k'], timeout=10, check=False) if wine and wine.poll() is None: wine.terminate() @@ -79,17 +87,18 @@ def main(): p.add_argument('--enter', action='store_true', help='Send Return after each screenshot') p.add_argument('--debug', action='store_true', help='Record Wine process and exception diagnostics') p.add_argument('--wine-renderer', choices=['gl','vulkan'], default='gl') + p.add_argument('--port-smoke', action='store_true', help='Preliminary Windows port check under Wine64; not native Windows validation') p.add_argument('--output', type=Path) args = p.parse_args() if not 3 <= args.seconds <= 120: p.error('--seconds must be 3..120') if args.inside: return inside(args) project = Path(__file__).resolve().parents[2] source = project.parent/'Original' - work = (args.output or project/'artifacts/reference').resolve() + work = (args.output or project/('artifacts/windows-smoke' if args.port_smoke else 'artifacts/reference')).resolve() if work.is_relative_to(source.resolve()) or source.resolve().is_relative_to(work): p.error('Output must be separate from originals') work.mkdir(parents=True, exist_ok=True) - if not (work/'game').exists(): shutil.copytree(source, work/'game') + if not args.port_smoke and not (work/'game').exists(): shutil.copytree(source, work/'game') (work/'home').mkdir(exist_ok=True) (work/'home/.asoundrc').write_text('pcm.!default { type null }\nctl.!default { type hw card 0 }\n') (work/'alsa-null.conf').write_text('pcm.default { type null }\npcm.null { type null }\n') @@ -102,22 +111,33 @@ def main(): '--ro-bind', str(project/'.tools/wine/opt/wine-stable'), '/opt/wine-stable', '--ro-bind', str(project/'.tools/native'), '/native', '--ro-bind', str(Path(__file__).resolve()), '/capture.py'] - for key,value in {'HOME':'/work/home', 'WINEPREFIX':'/work/prefix', 'WINEARCH':'win32', + if args.port_smoke: + cmd += ['--ro-bind', str(project/'dist/win-x64'), '/port'] + for key,value in {'HOME':'/work/home', 'WINEPREFIX':'/work/prefix', 'WINEARCH':'win64' if args.port_smoke else 'win32', 'DISPLAY':':89', 'PATH':'/opt/wine-stable/bin:/usr/bin:/bin', 'LANG':'C.UTF-8', 'WINEDEBUG':'-all,err+all,warn+ddraw,warn+d3d,+seh' if args.debug else '-all', - 'ALSA_CONFIG_PATH':'/work/alsa-null.conf', 'WINEDLLOVERRIDES':'mscoree,mshtml=', + 'ALSA_CONFIG_PATH':'/work/alsa-null.conf', + 'WINEDLLOVERRIDES':'mscoree=b;mshtml=' if args.port_smoke else 'mscoree,mshtml=', 'WINE_D3D_CONFIG':'renderer='+args.wine_renderer, 'LD_LIBRARY_PATH':'/native/usr/lib/x86_64-linux-gnu:/native/usr/lib/i386-linux-gnu', 'LIBGL_ALWAYS_SOFTWARE':'1', '__GLX_VENDOR_LIBRARY_NAME':'mesa', '__EGL_VENDOR_LIBRARY_FILENAMES':'/usr/share/glvnd/egl_vendor.d/50_mesa.json'}.items(): cmd += ['--setenv', key, value] - if args.wine_renderer == 'vulkan': + if args.port_smoke: + cmd += ['--setenv', 'VK_DRIVER_FILES', '/usr/share/vulkan/icd.d/lvp_icd.json'] + elif args.wine_renderer == 'vulkan': cmd += ['--setenv', 'VK_DRIVER_FILES', '/native/usr/share/vulkan/icd.d/lvp_icd.json'] cmd += ['/usr/bin/python3', '/capture.py', '--inside', '--game', args.game, '--seconds', str(args.seconds)] if args.enter: cmd += ['--enter'] - print('Running copied original with no network and no original-directory mount:', work, flush=True) + if args.port_smoke: cmd += ['--port-smoke'] + print('Running isolated Windows port' if args.port_smoke else 'Running copied original', 'with no network and no original-directory mount:', work, flush=True) subprocess.run(cmd, check=True, timeout=args.seconds + 40) print('Capture metadata:', work/'capture.json') + if args.port_smoke: + result = json.loads((work/'capture.json').read_text()) + if result['captures'][-1]['wineExit'] != 0 or not (work/'port-frame.ppm').is_file(): + raise SystemExit('Windows port smoke did not pass; inspect wine.log (native Windows remains unverified)') + print('Windows port rendered under Wine; native Windows validation is still required') if __name__ == '__main__': main()