Repository navigation
fix(whispercpp): ensure native binding compatibility on Windows - #807
Merged
Merged
Conversation
- Replace host-dependent C_LONG mapping with JAVA_LONG to prevent ClassCastException on Windows - Update binding generation script to automatically patch C_LONG for LLP64 architectures - Add layout and integration tests to verify whisper bindings across platforms
There was a problem hiding this comment.
🟡 Changes recommended
A critical native-memory layout bug can byte-swap non-zero size values on little-endian platforms, while the integration test can silently skip the only end-to-end regression check when model downloads fail.
2 open issues
What changed in this PR
This pull request fixes Windows LLP64 compatibility for generated whisper.cpp bindings and adds cross-platform regression coverage.
Changes:
- Map
size_t-backed fields to a portable 8-byte layout and update the generation script. - Add binding layout and native integration tests.
- Expand shared CI coverage to macOS and add required test fixtures.
- Use centralized application colors in the whisper model download UI.
| File | Summary |
|---|---|
desktop-shared/src/test/kotlin/io/askimo/ui/voice/whispercpp/WhisperBindingsLayoutTest.kt |
Adds regression coverage for binding initialization, field size, and alignment. |
desktop-shared/src/test/kotlin/io/askimo/ui/voice/impl/whispercpp/WhisperCppFfmSpeechToTextServiceIntegrationTest.kt |
Adds end-to-end native transcription coverage; model download failures are currently caught and may silently skip the test. |
desktop-shared/src/main/kotlin/io/askimo/ui/voice/impl/whispercpp/WhisperModelDownloadSection.kt |
Migrates card styling to centralized application color tokens. |
desktop-shared/src/main/java/io/askimo/ui/voice/whispercpp/whisper_h$shared.java |
Changes the generated C_LONG mapping to an 8-byte layout; the layout must also use native byte order for native struct compatibility. |
desktop-shared/scripts/generate-whisper-bindings.sh |
Automates the generated binding patch; the resulting 8-byte layout must preserve native byte order. |
desktop-shared/build.gradle.kts |
Adds shared test-fixture support for the new tests. |
.github/workflows/shared-tests.yml |
Adds macOS to the shared test matrix. |
Review effort: Lite
Comment on lines
+52
to
+58
| modelPath = try { | ||
| downloadModelIfMissing() | ||
| } catch (e: Exception) { | ||
| null.also { | ||
| println("Skipping ${javaClass.simpleName}: could not download whisper model (${e.message})") | ||
| } | ||
| } |
haiphucnguyen
deleted the
feature/fix-whisper-cpp-not-works-on-windows
branch
November 6, 2026 07:39
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.


Summary
Related Issue(s)
#806
Type of Change
What Changed & Why
How to Test
./gradlew testScreenshots / Recordings (if applicable)
Checklist
main./gradlew spotlessApplyand./gradlew detektlocally./gradlew testand all tests passgit commit -sAdditional Notes