Show HN: PS2 games को statically recompile करके WebAssembly में बदला गया
एक नया project PlayStation 2 games को statically recompile करके WebAssembly में बदलता है, ताकि वे browser में या native binaries के रूप में चल सकें; यह cycle-accurate emulation करने के बजाय vector units और graphics synthesizer जैसे प्रमुख hardware components को model करता है। टिप्पणीकार timing accuracy, पुराने netbooks से लेकर Steam Deck तक devices पर performance, और WebGPU बनाम legacy OpenGL जैसी graphics API choices के तकनीकी trade-offs पर चर्चा करते हैं। यह काम AI-assisted recompilation के game preservation, piracy risk, और commercial game development के दीर्घकालिक incentives पर व्यापक सवाल भी उठाता है.
तकनीकी दृष्टिकोण & सटीकता
- PS2 “EE” कोड का static AOT recompilation WebAssembly / native में; हर basic block एक cycle budget घटाता है।
- Timing लगभग है, cycle-accurate नहीं; interrupts, DMA, timers, vblank block boundaries पर deliver किए जाते हैं।
- टिप्पणीकारों का कहना है कि ज़्यादातर games interrupts/semaphores पर sync करते हैं, इसलिए यह कई titles के लिए काम करता है; timing bugs विशिष्ट edge cases के रूप में सामने आते हैं जिन्हें ठीक करना पड़ता है।
- VU1 microprograms पहली बार DMA के जरिए upload होने पर capture किए जाते हैं, प्रति game AOT compile होते हैं; जो unseen हों उन्हें JIT-compile करके WASM में बदला जाता है।
- कुछ PS2 pipeline quirks model किए गए हैं: flag latency, PS2-style non‑IEEE floats with clamping, और VU1 अपने अलग thread पर।
- GS (graphics) को WebGPU compute shaders से emulate किया गया है; texture sampling एक बड़ा GPU bottleneck है। GS frontend और VU1 दोनों CPU का बड़ा हिस्सा लेते हैं।
Performance & platform targets
- Browser build एक reasonably strong iGPU पर 1x–2x resolution में अच्छी तरह चलता है; integrated GPUs GPU-bound हो सकते हैं।
- Native Linux build wgpu + SDL2 (window, audio, gamepad) के जरिए Vulkan का उपयोग करता है। Steam Deck पर 1x resolution वास्तविक लक्ष्य है; multi-threaded native host अभी भी प्रगति पर है।
- पुराने APIs जैसे OpenGL 2.1 / WebGL 1 बनाम नए WebGPU/WebGL 2.0 को व्यापक hardware support के लिए target करने पर चर्चा, जिसमें complexity और “token cost” के tradeoffs हैं।
Controllers & input fidelity
- pressure-sensitive PS2 buttons (जैसे Gran Turismo में) खो देने को लेकर काफ़ी चिंता है।
- कुछ लोग विशिष्ट PS2‑to‑PS3 adapters और सही curves वाले modern controllers के साथ सफलता की रिपोर्ट करते हैं; दूसरों को mappings असंतोषजनक या ergonomically खराब लगती हैं।
Distribution, legality & hosting
- Author legally compiled game builds host नहीं कर सकता; users को अपनी ISOs local रूप से convert करनी होंगी।
- सुझाव है कि recompiler को ही WASM में चलाया जाए ताकि conversion client-side हो, और copyrighted assets की distribution से बचा जा सके।
- पूरे games को browser में host करने की तुलना अन्य gray-area archives से की गई; takedowns की संभावना की उम्मीद जताई गई।
AI, trust, and terminology
- AI-enabled recompilations पर mixed reactions: तकनीकी प्रगति को लेकर उत्साह बनाम programming as a profession पर असर को लेकर निराशा।
- “no emulation” का दावा करने वाले projects के प्रति skepticism, जबकि वे अभी भी कुछ cores (जैसे IOP) को interpret करते हैं या hardware को भारी मात्रा में model करते हैं।
- शिकायतें कि कुछ “native ports” सिर्फ emulators होते हैं जिनमें ROMs bundled होती हैं, जिससे genuine recompilations ढूँढना मुश्किल हो जाता है।
- Security concerns: native decomps malware छिपा सकती हैं; कुछ लोग तर्क देते हैं कि WASM अपेक्षाकृत सुरक्षित है, लेकिन emulator/ROM ecosystems में trust issues लंबे समय से रहे हैं।
Piracy, incentives, and game preservation
- इस पर बहस कि क्या आसान recompilation/rehosting बड़े-बजट games बनाने के incentives को कमजोर करता है।
- Counterpoints: piracy दशकों से मौजूद है; लोग फिर भी games खरीदते हैं, और पुराने titles वैसे भी अक्सर बेचे या supported नहीं होते।
- कई लोग recomps को preservation tools और classics को platforms, including embedded devices और handheld PCs, पर natively replay करने का तरीका मानते हैं।