Repository navigation
Make Duo DS an installable PWA with an Aleph Void icon, and run the threaded core - #2
Merged
Merged
Conversation
- Add a web app manifest so the page can be installed to the home screen and runs fullscreen. - Add app icons built from the Aleph Void aleph-null mark on a red clamshell with a hinge line. The glyphs are FreeSerif outlines, so the SVG needs no font. PNGs cover 192/512, maskable, Apple touch and favicon sizes. - Add a service worker that caches the app for offline use (network first, cores served cache first) and adds COOP/COEP headers. Pages can't set those headers itself, and cross-origin isolation is what allows SharedArrayBuffer. - With isolation available, load the multi-threaded melonDS build and enable its threaded software renderer. ?threads=0 forces the single-threaded build for comparison. The service worker has to be served from the site root. The deploy workflow needs one added line to copy it there. Assisted-by: claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013mySqFhLDykUTkvwZ3ZBZ4
Assisted-by: claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Installable app
duo/manifest.webmanifest: name "Duo DS", fullscreen display, any orientation, dark background/theme colour, icons.duo.htmllinks the manifest, an SVG/PNG favicon and the Apple touch icon, and sets the home-screen title.App icon
The Aleph Void mark (ℵ₀) in white on a two-tone Nintendo-red clamshell, with a dark hinge line across the middle.
icon.svguses glyph outlines taken from FreeSerif, which matches the aleph in the GitHub avatar, so it doesn't depend on any font.icon-192,icon-512,icon-maskable-512(logo kept inside the maskable safe zone),apple-touch-icon(180, opaque) andfavicon-32.Service worker (
duo/sw.js).datacore files load cache-first and refresh in the background.Cross-Origin-Opener-Policy/Cross-Origin-Embedder-Policyheaders. GitHub Pages can't send these itself, and they're what makes the page cross-origin isolated soSharedArrayBufferis available.Performance
The live site is already a release build: minified
emulator.min.jsand the prebuilt optimized melonDS core. When the page is cross-origin isolated it now:melonds-thread-wasm.data, which the deploy already copies), andAdd
?threads=0to the URL to force the single-threaded build and compare on a device.The service worker must be served from the site root to control the page. My credentials can't edit workflow files, so please add this line to the "Assemble site" step in
.github/workflows/duo-pages.yml, right aftercp -r duo _site/duo:cp duo/sw.js _site/sw.jsWithout it, the app still installs from the manifest, but there is no offline support and no threaded core (the page falls back to single-threaded as it does today).
Testing
Headless Chromium, mobile viewport, site assembled the same way as the deploy workflow plus the line above:
crossOriginIsolated === trueandSharedArrayBufferis available..ndsrequestsmelonds-thread-wasm.data,EJS_threadsis on, the threaded renderer isenabled, and the game renders across the fold as before.Not yet tested on a real iPhone. Safari supports cross-origin isolation and WebAssembly threads, but the actual speedup on an iPhone 16 needs checking on the device. Note that iOS Low Power Mode also caps frame rate.
Assisted-by: claude-opus-5-5
Generated by Claude Code