[PR #6606] [MERGED] chore(deps): migrate Transformers and preserve Buttplug intensity semantics #7250

Closed
opened 2026-10-23 04:17:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6606
Author: @SpicyMarinara
Created: 9/24/2026
Status: ✅ Merged
Merged: 9/24/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/6603-6604-runtime-migrations


📝 Commits (5)

  • 0076c34 chore(deps): migrate deferred model and haptic runtimes
  • bc06dba fix(haptics): preserve full intensity and zero output with Buttplug 5
  • 99f8803 fix(haptics): stop partial output failures and validate feature ranges
  • 87003fc fix(haptics): preserve existing timers when replacement commands are invalid
  • b8d065f fix(haptics): type prepared output commands explicitly

📊 Changes

9 files changed (+469 additions, -228 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/server/package.json (+4 -4)
📝 packages/server/src/services/haptic/buttplug-service.ts (+78 -40)
📝 patches/onnxruntime-node@1.30.0.patch (+1 -1)
📝 pnpm-lock.yaml (+63 -179)
📝 pnpm-workspace.yaml (+4 -4)
➕ scripts/regressions/haptic-protocol.regression.ts (+228 -0)
➕ scripts/regressions/transformers-runtime.regression.mjs (+30 -0)
➕ scripts/smoke-local-models.ts (+59 -0)

📄 Description

Linked issue

Closes #6603
Closes #6604

Why this change

The deferred upgrades need compatibility work: Transformers.js 4 requires matching ONNX runtimes, and Buttplug 5 changes percentage mapping so zero intensity on a signed rotation range could become full reverse output. This completes the maintenance batch merged in #6602.

What changed

  • Upgrade Transformers.js to 4.3.0, native ONNX Runtime to 1.30.0, and the web backend to its upstream-required 1.31.0 development build. Each backend keeps its matching common runtime; a regression checks the installed dependency graph.
  • Port the native installer's exclusive temporary-directory patch. The upstream installer still needed it; the existing extraction-security regression passes against the new package.
  • Upgrade Buttplug to 5.0.2 using each feature's explicit value range to preserve zero-based intensity and the full advertised maximum. The existing Intense setting and full 0–100% command range remain available at every sensitivity setting.
  • Validate all selected device commands before sending or replacing prior stop timers. Stop a device after partial output failures, once outstanding sends settle.
  • Add a loopback WebSocket protocol regression and an optional real-model smoke command, without changing model IDs, cache locations, application versions, or data formats.

Validation

Completed locally on macOS arm64; final pnpm check and the container use b8d065f71:

  • pnpm check passed, including localization, formatting, types/lint, and production builds. One existing GameNarration hook warning remains.
  • Frozen dependency installation and pnpm version:check passed.
  • Haptic protocol and normalization regressions passed: discovery, signed zero/midpoint/max, full vibration strength on features with different maxima, rounding/clamping, timed and untimed position, invalid ranges, unsupported outputs, partial failures, previous stop timers, automatic stop, cancellation of pending pattern steps, and disconnect.
  • Negative controls reproduced the bare v5 zero-to-full-reverse bug and the timer/partial-output failures before their fixes.
  • Actual MiniLM inference returned 384 finite normalized dimensions with expected semantic ordering. Both Whisper Tiny and Base transcribed the public whisper.cpp JFK WAV fixture.
  • Fresh downloads and fresh-process offline reuse passed. Caches produced with Transformers.js 3.8.1 also passed under 4.3.0 with fetch blocked. Four multilingual/text samples retained same-text retrieval against old vectors (cross-version cosine 0.9888–0.9953); numeric vectors are not identical across runtimes.
  • Lite-mode checks disabled local inference without network attempts. Installed runtime compatibility and archive-extraction security regressions passed.
  • The final full Linux arm64 container built and passed API/frontend, native binding, non-root startup, clean shutdown, and data persistence smoke checks.

The complete local Node suite finished 368/369 passed. The sole failure, decision-sidecar-runtime.regression.ts, reproduces on the unchanged Mac baseline: its Linux-only decision-model preflight returns unsupported before a test expects not_enough_disk. The complete hosted Linux regression suite passed on the same head. An earlier attempt was interrupted by disk exhaustion; task-owned temporary artifacts were cleaned and the full suite rerun.

Local CodeRabbit completed on the final head. Two substantive timer/failure-handling findings were reproduced and fixed. The final pass reported one minor suggestion: round fractional millisecond durations. This is a non-regression: Math.max(1, duration || 1) * 1000 is unchanged from origin/staging (old service lines 226–228), and both the old and new libraries pass that number through. Existing duration/minimum semantics are retained in this compatibility migration. No finding is being represented as a zero-finding review. GitHub checks and CodeRabbit remain merge gates.

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

The maintainer explicitly requested skipping physical Intiface calibration for this update and verifying that maximum vibration remains available. The tests use a loopback protocol fixture; no physical device was operated. No new browser UI was introduced.

To repeat the optional model proof, download https://github.com/ggml-org/whisper.cpp/blob/master/samples/jfk.wav as a raw WAV, then run pnpm --filter @marinara-engine/server exec tsx ../../scripts/smoke-local-models.ts online <isolated-data-dir> <wav-path> followed by offline with the same directory and lite with another isolated directory.

Docs and release impact

The Unreleased changelog covers both migrations and the haptic failure handling. The installation commands and user configuration remain unchanged; no translated documentation update is needed.

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

No UI changes.

Summary by CodeRabbit

  • Updates
    • Local embeddings and Whisper now use the latest supported Transformers runtime.
    • Intiface integration has been updated, with existing haptic intensity values preserved.
  • Bug Fixes
    • Incompatible haptic ranges are rejected before output starts.
    • If a command fails for any selected feature, active output is stopped. Invalid replacement commands also leave the current output timer unchanged.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/6606 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/24/2026 **Status:** ✅ Merged **Merged:** 9/24/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/6603-6604-runtime-migrations` --- ### 📝 Commits (5) - [`0076c34`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0076c34b295515492912e06d448dc13a43587c1f) chore(deps): migrate deferred model and haptic runtimes - [`bc06dba`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bc06dbabd715f5b9699aac53f0a139235b35185c) fix(haptics): preserve full intensity and zero output with Buttplug 5 - [`99f8803`](https://github.com/Pasta-Devs/Marinara-Engine/commit/99f8803369e2e593d52c28c1b66c85ff4ce99ea2) fix(haptics): stop partial output failures and validate feature ranges - [`87003fc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/87003fcf270d5aca92d725cd6549f66392db4def) fix(haptics): preserve existing timers when replacement commands are invalid - [`b8d065f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b8d065f7192cb98b5a4d12543d9560993b381704) fix(haptics): type prepared output commands explicitly ### 📊 Changes **9 files changed** (+469 additions, -228 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/server/package.json` (+4 -4) 📝 `packages/server/src/services/haptic/buttplug-service.ts` (+78 -40) 📝 `patches/onnxruntime-node@1.30.0.patch` (+1 -1) 📝 `pnpm-lock.yaml` (+63 -179) 📝 `pnpm-workspace.yaml` (+4 -4) ➕ `scripts/regressions/haptic-protocol.regression.ts` (+228 -0) ➕ `scripts/regressions/transformers-runtime.regression.mjs` (+30 -0) ➕ `scripts/smoke-local-models.ts` (+59 -0) </details> ### 📄 Description ## Linked issue Closes #6603 Closes #6604 ## Why this change The deferred upgrades need compatibility work: Transformers.js 4 requires matching ONNX runtimes, and Buttplug 5 changes percentage mapping so zero intensity on a signed rotation range could become full reverse output. This completes the maintenance batch merged in #6602. ## What changed - Upgrade Transformers.js to 4.3.0, native ONNX Runtime to 1.30.0, and the web backend to its upstream-required 1.31.0 development build. Each backend keeps its matching common runtime; a regression checks the installed dependency graph. - Port the native installer's exclusive temporary-directory patch. The upstream installer still needed it; the existing extraction-security regression passes against the new package. - Upgrade Buttplug to 5.0.2 using each feature's explicit value range to preserve zero-based intensity and the full advertised maximum. The existing Intense setting and full 0–100% command range remain available at every sensitivity setting. - Validate all selected device commands before sending or replacing prior stop timers. Stop a device after partial output failures, once outstanding sends settle. - Add a loopback WebSocket protocol regression and an optional real-model smoke command, without changing model IDs, cache locations, application versions, or data formats. ## Validation Completed locally on macOS arm64; final `pnpm check` and the container use `b8d065f71`: - `pnpm check` passed, including localization, formatting, types/lint, and production builds. One existing GameNarration hook warning remains. - Frozen dependency installation and `pnpm version:check` passed. - Haptic protocol and normalization regressions passed: discovery, signed zero/midpoint/max, full vibration strength on features with different maxima, rounding/clamping, timed and untimed position, invalid ranges, unsupported outputs, partial failures, previous stop timers, automatic stop, cancellation of pending pattern steps, and disconnect. - Negative controls reproduced the bare v5 zero-to-full-reverse bug and the timer/partial-output failures before their fixes. - Actual MiniLM inference returned 384 finite normalized dimensions with expected semantic ordering. Both Whisper Tiny and Base transcribed the public whisper.cpp JFK WAV fixture. - Fresh downloads and fresh-process offline reuse passed. Caches produced with Transformers.js 3.8.1 also passed under 4.3.0 with fetch blocked. Four multilingual/text samples retained same-text retrieval against old vectors (cross-version cosine 0.9888–0.9953); numeric vectors are not identical across runtimes. - Lite-mode checks disabled local inference without network attempts. Installed runtime compatibility and archive-extraction security regressions passed. - The final full Linux arm64 container built and passed API/frontend, native binding, non-root startup, clean shutdown, and data persistence smoke checks. The complete local Node suite finished **368/369 passed**. The sole failure, `decision-sidecar-runtime.regression.ts`, reproduces on the unchanged Mac baseline: its Linux-only decision-model preflight returns `unsupported` before a test expects `not_enough_disk`. The complete hosted Linux regression suite passed on the same head. An earlier attempt was interrupted by disk exhaustion; task-owned temporary artifacts were cleaned and the full suite rerun. Local CodeRabbit completed on the final head. Two substantive timer/failure-handling findings were reproduced and fixed. The final pass reported one minor suggestion: round fractional millisecond durations. This is a non-regression: `Math.max(1, duration || 1) * 1000` is unchanged from `origin/staging` (old service lines 226–228), and both the old and new libraries pass that number through. Existing duration/minimum semantics are retained in this compatibility migration. No finding is being represented as a zero-finding review. GitHub checks and CodeRabbit remain merge gates. - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes The maintainer explicitly requested skipping physical Intiface calibration for this update and verifying that maximum vibration remains available. The tests use a loopback protocol fixture; no physical device was operated. No new browser UI was introduced. To repeat the optional model proof, download `https://github.com/ggml-org/whisper.cpp/blob/master/samples/jfk.wav` as a raw WAV, then run `pnpm --filter @marinara-engine/server exec tsx ../../scripts/smoke-local-models.ts online <isolated-data-dir> <wav-path>` followed by `offline` with the same directory and `lite` with another isolated directory. ## Docs and release impact The Unreleased changelog covers both migrations and the haptic failure handling. The installation commands and user configuration remain unchanged; no translated documentation update is needed. - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see `CONTRIBUTING.md`) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) No UI changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Updates** * Local embeddings and Whisper now use the latest supported Transformers runtime. * Intiface integration has been updated, with existing haptic intensity values preserved. * **Bug Fixes** * Incompatible haptic ranges are rejected before output starts. * If a command fails for any selected feature, active output is stopped. Invalid replacement commands also leave the current output timer unchanged. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:17:55 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7250
No description provided.