Skip to content

fix(ci): prevent native filesystem pause deadlocks - #2

Merged
nocoo merged 2 commits into
mainfrom
fix/ci-cd-20260919-063540
Sep 19, 2026
Merged

nocoo merged 2 commits into
mainfrom
fix/ci-cd-20260919-063540

Conversation

@nocoo

@nocoo nocoo commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

Native pause and startup interrupts could freeze the browser: the emulator pthread waited for an asynchronous IDBFS fd_sync Promise on the main thread, while the main thread synchronously waited for the pthread to pause. The failing main CI runs are 35280585691 and 35223115650. The latest failure was unresolved for over 24 hours when repair began; one unchanged-main diagnostic attempt reproduced it. A local stalled pthread stack subsequently identified the filesystem proxy wait.

The build now adapts the pinned mGBA 2.5.1 JavaScript only after verifying its exact SHA-256. Before emulation starts, it reads the legacy SDK caches and imports every file into a memory filesystem. Native fd_sync then uses a synchronous numeric proxy, rejects asynchronous backing stores, and propagates errors. The application retains its existing awaited IndexedDB battery/snapshot persistence, and the old SDK databases remain untouched. Initial callback and configuration changes also stay paused until setup succeeds.

The temporary diagnostic fixture is removed. The required browser gate increases from 30 to 31 cases to cover real legacy IndexedDB import and prove that native working-copy writes do not rewrite the old databases. Existing GB/GBC/GBA SRAM, battery-byte, restore, authorization, isolation, timeout and security assertions are retained.

Validation: pre-commit G1 and 670/670 unit tests passed; full guarded, uninstrumented production-browser L3 passed 31/31 with zero skips/flaky results; pre-push L2 passed 40/40 and G2 passed with pinned OSV 2.5.1 and gitleaks 8.30.1. Typecheck, formatting, lint, actionlint and distribution checks passed. Both independent reviews approved exact commit 094da6816bd60c530021f7a4d9c7bcd99105df12.

The adapter deliberately fails the build if the SDK version or JavaScript changes; a future SDK update must review the adapter again. WebAssembly, dependencies, workflow permissions, deployment settings and secrets are unchanged.

@nocoo nocoo changed the title fix(ci): diagnose native pause hangs fix(ci): prevent native filesystem pause deadlocks Sep 18, 2026
@nocoo
nocoo marked this pull request as ready for review September 18, 2026 23:54
@nocoo
nocoo merged commit caf4d1a into main Sep 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant