Skip to content

fix[notask]: expose binding.js via package exports on audiogen-ggml + tts-ggml for mobile bundler - #4087

Merged
GustavoA1604 merged 4 commits into
mainfrom
fix/audiogen-ggml-binding-mobile-export
Aug 26, 2026
Merged

fix[notask]: expose binding.js via package exports on audiogen-ggml + tts-ggml for mobile bundler#4087
GustavoA1604 merged 4 commits into
mainfrom
fix/audiogen-ggml-binding-mobile-export

Conversation

@Alok-Ranjan23

@Alok-Ranjan23 Alok-Ranjan23 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Two-line fix across packages/audiogen-ggml/package.json and packages/tts-ggml/package.json — adds "./binding.js": "./binding.js" to each addon's exports field so the mobile app bundler stops stripping binding.js from the shipped module. Aligns with the workaround pattern already used by @qvac/asr-ggml and @qvac/llm-llamacpp.

The bug (currently on main for audiogen; pre-empted for tts)

Mobile Android CI for @qvac/audiogen-ggml fails during addon construction on device:

[audiogen-mobile] load attempt 1/3 failed (MODULE_NOT_FOUND: Cannot find module './binding'
  imported from 'file:///app.bundle/node_modules/@qvac/audiogen-ggml/index.js'
Candidates:
- file:///app.bundle/node_modules/@qvac/audiogen-ggml/binding
- file:///app.bundle/node_modules/@qvac/audiogen-ggml/binding.js
- ... (12 candidates, none found)

Both testLoadModels and testGenerateMusicOnGpu fail within ~1 s. This happens in _createAddon() in index.js (~line 784) when it calls require('./binding').

@qvac/tts-ggml will hit the exact same failure the next time anyone runs its mobile CI — same code shape (require('./binding') in index.js), same missing ./binding.js in exports. It hasn't been mobile-tested since 2026-08-18 (before the bundler tightening on 2026-08-22), so the failure hasn't been observed empirically yet, but the diagnosis is identical.

Root cause

The mobile bundler (from tetherto/qvac-test-addon-mobile, called by integration-mobile-test-*-ggml.yml) recently tightened exports-field enforcement. Files not declared in exports are stripped from the on-device app.bundle. Neither audiogen-ggml nor tts-ggml had "./binding.js" in their exports — so binding.js gets excluded from the bundle, and require('./binding') in index.js has no file to resolve.

Evidence

Addon "./binding.js" in exports? Mobile addon load
@qvac/asr-ggml ✅ addon loads on device (verified 2026-08-25 run 32841431292: 6 GPU-smoke test cases ran end-to-end with 4–60 s timings)
@qvac/llm-llamacpp (declares the same workaround)
@qvac/tts-ggml before this PR (no recent mobile run; will fail next time it runs)
@qvac/audiogen-ggml before this PR fails on main — reproduced via workflow_dispatch runs 32967429767 and 32972232229, identical MODULE_NOT_FOUND signature

asr-ggml and llm-llamacpp already declare the same "./binding.js": "./binding.js" line — this PR aligns audiogen-ggml and tts-ggml with that pattern.

When it started failing

Last known-green audiogen mobile run: 2026-08-20 (SHA c7af7f156). Last known-green tts mobile run: 2026-08-18. Regression window includes the Node 22 + Appium 3 bump (dabf43fb2, 2026-08-22) which required matching updates in the external qvac-test-addon-mobile repo — the bundler tightening most likely rode along there. The addon source code did not need to change; the older lenient bundler was tolerating a missing exports declaration and the new one isn't.

Verification

  • node -e "JSON.parse(...)" on both modified package.json files — valid JSON.
  • prettier --check on both — no formatting drift.
  • git diff — two literal one-line additions.
  • No source code changed; binding.js content is unchanged in both addons; the addons behave identically at runtime.

The audiogen fix will be empirically re-validated by re-dispatching integration-mobile-test-audiogen-ggml.yml against main once merged. The tts fix will be validated when someone next runs integration-mobile-test-tts-ggml.yml.

What this unblocks

  • Any mobile CI validation of @qvac/audiogen-ggml (functional smoke, RTF benchmark), which has been red on main since ~2026-08-22.
  • The next mobile CI run of @qvac/tts-ggml, which would otherwise hit the same failure.
  • Empirical wall-time validation of QVAC-24086 / PR #4084, which is coverage-preserving-only and passed all non-mobile CI but couldn't be validated on device against this pre-existing regression.

What this does NOT change

  • No source code (JS, TS, C++).
  • No CI workflow, no mobile action, no benchmark path.
  • No version bump — this is a build-time export declaration, not a shipped-behavior change; the runtime is byte-identical for both packages.

… mobile bundler

The mobile bundler (qvac-test-addon-mobile at HEAD, called by
integration-mobile-test-audiogen-ggml.yml) recently tightened its enforcement
of the package.json "exports" field. Files not declared in "exports" are now
stripped from the on-device app.bundle. Since audiogen-ggml's exports listed
".", "./models", "./test/benchmark-runner" but NOT "./binding.js", the
bundler excluded binding.js from the shipped module, and require('./binding')
in index.js (line ~784, _createAddon) failed on device with

  MODULE_NOT_FOUND: Cannot find module './binding'
  imported from 'file:///app.bundle/node_modules/@qvac/audiogen-ggml/index.js'

Both testLoadModels and testGenerateMusicOnGpu failed within ~1 s during
addon construction (before any user code ran).

Pattern matches how @qvac/asr-ggml and @qvac/llm-llamacpp already declare
"./binding.js": "./binding.js" for the same reason. @qvac/audiogen-ggml and
@qvac/tts-ggml never added it and worked by accident under the older,
lenient bundler; the tighter enforcement (landing alongside the Node 22 +
Appium 3 bump on 2026-08-22) exposed the gap.

Verification
- Reproduced on main (Android Device Farm run 32972232229) and on an
  unrelated feature branch (run 32967429767) — identical error signature.
- Cross-check: @qvac/asr-ggml Android mobile CI on 2026-08-25 (run
  32841431292) loaded the addon successfully (6 GPU-smoke test cases ran
  end-to-end with real 4-60 s timings), confirming the failure is
  package-specific, not a global mobile-bundler outage.
- Fix scope: single-line addition to the exports field. No source or
  behavioral change to the addon itself; binding.js content is unchanged.

Unblocks any downstream mobile validation of @qvac/audiogen-ggml
(functional smoke + RTF benchmark), which has been red on main since the
bundler tightening landed.
@Alok-Ranjan23
Alok-Ranjan23 requested review from a team as code owners August 26, 2026 13:39
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Review Status

Current Status: ✅ APPROVED
Approvals so far: Team Lead: 1, Member: 1

@github-actions

Copy link
Copy Markdown
Contributor

License compliance — clean

No new dependency license findings in this PR.

Warn-only (shadow) mode — this check does not block merges yet.

Updated automatically by the canonical license compliance workflow.

NOTICE presence (advisory)

Missing NOTICE (advisory, does not block):

  • ./.github/actions/release-merge-guard
  • ./docs/website
  • ./packages/ggml-coload-smoke
  • ./packages/fabric/test/integration
  • ./packages/inference-addon-cpp/mobile
  • ./packages/sdk/e2e
  • ./packages/llm-llamacpp/benchmarks/performance
  • ./packages/llm-llamacpp/benchmarks/server
  • ./packages/vla-ggml/sim/server
  • ./packages/embed-llamacpp/benchmarks/performance
  • ./packages/embed-llamacpp/benchmarks/server
  • ./packages/asr-ggml/benchmarks/server

…le bundler

Same class of bug as the audiogen-ggml fix in this PR: mobile bundler
enforces "exports"; binding.js was not declared and gets stripped from the
on-device app.bundle, breaking require('./binding') in index.js at runtime.

@qvac/tts-ggml hasn't been mobile-tested since 2026-08-18 (before the
bundler tightening on 2026-08-22), so the failure hasn't been observed
empirically yet — but the diagnosis and fix are identical, and the pattern
matches how @qvac/asr-ggml and @qvac/llm-llamacpp already declare the same
"./binding.js": "./binding.js" export.

Pre-empting: without this line, the next mobile tts-ggml CI run will fail
the same way audiogen-ggml did.
@Alok-Ranjan23 Alok-Ranjan23 changed the title fix[notask][audiogen-ggml]: expose binding.js via package exports for mobile bundler fix[notask]: expose binding.js via package exports on audiogen-ggml + tts-ggml for mobile bundler Aug 26, 2026
@GustavoA1604
GustavoA1604 merged commit bbeff6f into main Aug 26, 2026
55 of 57 checks passed
@GustavoA1604
GustavoA1604 deleted the fix/audiogen-ggml-binding-mobile-export branch August 26, 2026 14:50
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.

3 participants