Skip to content

fix(macos): restore production FFTC runtime and matching JNI bindings - #29

Merged
xiaopingshao merged 9 commits into
mainfrom
fix/28-macos-native
Nov 16, 2026
Merged

xiaopingshao merged 9 commits into
mainfrom
fix/28-macos-native

Conversation

@xiaopingshao

@xiaopingshao xiaopingshao commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Restore the macOS ARM64 runtime from the Windows-matched historical algorithm baseline 46a640bdc6d019ec4a51dbdef7f675d1c5700b06: production FFTC libraries and the original default license at the backend platform root, without prd or a test-runtime payload. Frontend POSIX loading and packaging use the same FFTC layout. Existing Java entry points delegate to the neutral native exports; Windows payload files are unchanged.

Review fixes in fd52282:

  • Reject macOS non-production staging and missing/empty root licenses, with regression tests.
  • Cover all 33 Java compatibility/native signature pairs. Generate JNI declarations with javac, including generic/multiline methods, overloads and escaped identifiers; verify actual exports and run the real JVM smoke via one documented entry point.
  • Preserve the seven legacy log-message strings while retaining SDK-compatible enum identifiers.
  • Record the complete algorithm patch at fixed private NativeDriver merge commit 92982a31, with SHA256 and replay instructions. Keep the detached/dirty source record truthful.
  • Limit SHA256SUMS to runtime binaries and License.dat; validate algorithm metadata separately.
  • Correct the FFT dependency failure test to select the configured platform library without changing Linux binaries or its FFT backend.

Current local macOS validation:

  • Algorithm runtime: 227 tests passed, including 33 binding cases.
  • Frontend native addon: 45 passed.
  • Packaging/license: 35 passed, one case-sensitive-filesystem test skipped.
  • Verifier regressions: 2 passed.
  • Eight ARM64 dylibs load; all 323 javac-generated backend JNI exports match. Windows algorithm exports: 148/148 static PE matches, not Windows execution.
  • Real JVM -Xcheck:jni: original default license imports; FFT returns expected feature-denied 13300010; license state releases in finally.
  • Seven legacy log-message strings checked by a compiled C++ probe; framework boundary guard passed. No hardware or full licensed FFT acceptance claimed.

Owner confirmations still requested in the two open review topics:

  1. JNI/framework owner: Windows and macOS evidence is supplied. No Linux backend payload is present; shared POSIX NativeDriver sources use the same neutral names, but externally supplied Linux binary compatibility remains unverified. Confirm the acceptable scope; this PR does not implement Linux delivery.
  2. Authorization/product-release owner: confirm the signed initial device001 machine-match exception and default community FFT feature-denial behavior. The full patch is traceable; no SKU restriction or additional entitlement bypass has been silently introduced. macOS and Windows default license JSON payload/signature are equal (trailing newline differs).

Core minimum macOS is 12. SonoDAQ SDK 1.4.0 requires macOS 26 and is delivered separately by crysound/OpenTest-Plugins#4. Its prior 14/14 result and generated local package depended on shared runtime fixes now withdrawn; they are not current-branch acceptance/release artifacts.

Unrelated shared CI/runtime fixes were withdrawn in f4cd7ac and #30 is closed. No workflow changes remain. Windows frontend/backend tests are informational under the currently active main rules; docs-policy, CodeQL rules, two designated-team approvals and resolved discussions remain required. No merge or approval bypass is requested.

Refs #28

Companions: crysound/OpenTest-NativeDriver#1 (merged), crysound/OpenTest-Plugins#4.

@xiaopingshao
xiaopingshao marked this pull request as ready for review November 16, 2026 07:42
@xiaopingshao
xiaopingshao requested a review from a team November 16, 2026 07:42

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI 代码审查(claude-opus-5-5)

本次改动恢复 macOS ARM64 生产运行库,并让 Java 的 BK 系列 JNI 方法委托到新的中性导出名。整体方向与 Windows 的交付方式一致,相关测试也同步调整。合入前需要先确认以下几点:

  1. Java JNI 绑定改名影响所有平台。 本 PR 只交付了 macOS 二进制,verify-macos-native.py 也只校验 macOS。Windows 和 Linux 的预编译 JNI 是否已导出新名称,目前没有证据。JNI 在首次调用时才解析符号,现有用例可能发现不了问题,详见行内意见。
  2. 授权策略变更不在本仓库内,无法审查。 device001 签名许可证在所有平台跳过机器匹配,这一改动位于预编译算法库中,并且基于未提交的脏工作树补丁(sourceTreeDirty: true,sourceBranch 为空)。建议由安全或授权负责人确认,并让补丁内容可追溯。
  3. 对默认 FFT 插件的产品影响需要确认。 macOS 现在只允许 production 算法。默认 License.dat 下 FFT 返回 13300010,即 default-plugins.json 中默认交付的 fft-tools 在 macOS 社区包中无法完成计算。macOS 源码开发也无法再使用 test 算法调试 FFT。请确认这与 Windows 的现状及产品预期一致。
  4. 共享设备运行时的行为变化缺少测试。 common_device_runtime 的两处修改改变了所有设备插件的行为,包括 Windows。描述中提到的测试未出现在本 PR 的 diff 中。
  5. 验证脚本未接入自动化。 新增的 verify-macos-native.py 和 MacJniSmoke.java 目前都没有被任何测试或 CI 调用,只能靠人工执行。

跳过 9 个文件(锁文件、生成文件、二进制或无文本 diff)

由 AI 自动生成,仅供参考,不作为合并依据。审查提交:10dced5。维护者可评论 /review 重新审查。

Comment thread tools/package-posix-native.mjs Resolved
Comment thread apps/native/src/tools/logcode.h Resolved
Comment thread tools/verify-macos-native.py Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI 代码审查(claude-opus-5-5)

本 PR 恢复 macOS ARM64 生产运行库,并将 Java 侧 BK 系列 JNI 方法改为公开包装方法加私有中性名 native 方法。整体方向合理,但仍有几项需要先确认或修正:

  1. 跨平台 JNI 符号兼容性:AlgorithmLibJNIBridge 由所有平台共用。重命名 native 方法后,Windows 和 Linux 预编译库都必须导出新的 Java_..._createAdvancedFftTask 等符号,否则运行时会抛出 UnsatisfiedLinkError。本 diff 只证明了 macOS(verify-macos-native.py)。
  2. 构建来源不可复现:sourceTreeDirty: true,sourceBranch 为空,补丁内容只记录了 SHA256。同时,授权策略改为“device001 在所有平台跳过机器匹配”,这项安全相关变更只存在于预编译二进制中,本仓库无法审查。
  3. 日志码字符串变化:PR 描述称“不改变值”,但 GetErrorMsg 返回的名称字符串已经改变。
  4. 测试与工具覆盖不足:只有 trigger 方法有绑定契约测试。MacJniSmoke.java 和 verify-macos-native.py 都未接入任何自动化流程,PR 中的验证结论无法在 CI 中复现。

PR 仍为草稿,也未做真机验收。建议在配套 PR(#29、NativeDriver#1、Plugins#4)合入顺序明确后,再合入本 PR。

跳过 9 个文件(锁文件、生成文件、二进制或无文本 diff)

由 AI 自动生成,仅供参考,不作为合并依据。审查提交:44d1420。维护者可评论 /review 重新审查。

Comment thread apps/native/src/tools/logcode.h Resolved
Comment thread tools/package-posix-native.mjs Resolved
Comment thread tools/verify-macos-native.py Resolved
@xiaopingshao
xiaopingshao merged commit 051d488 into main Nov 16, 2026
10 of 13 checks passed
@xiaopingshao
xiaopingshao deleted the fix/28-macos-native branch November 16, 2026 09:08
xiaopingshao added a commit to crysound/OpenTest-Plugins that referenced this pull request Nov 16, 2026
Add the official SonoDAQ 1.4.0 macOS ARM64 headers/runtime, default
macOS CMake SDK resolution, test runtime search paths, and reproducible
`.otplugin` packaging. Vendor inputs remain original; staged copies
strip local/debug symbols with exported-symbol equality checks and
ad-hoc signing. SDK requires macOS 26; the vendor development-path
exception remains as requested.

Release compilation, staged SDK version query and runtime-module loading
succeeded. The earlier 14/14 root CTest result and generated local
package used OpenTest shared runtime fixes in 10dced55. Those fixes are
now withdrawn from #29 as unrelated scope, so the earlier
results/package are not acceptance/release artifacts for the current
branch. Property payload length and channel streaming failures need
separate owner triage. No hardware acceptance is claimed.

Refs crysound/OpenTest#28

Companion: crysound/OpenTest#29; crysound/OpenTest-NativeDriver#1
(merged).

---------

Co-authored-by: xiaopingshao <25676237+xiaopingshao@users.noreply.github.com>
yangdekun2026 added a commit that referenced this pull request Nov 17, 2026
…tory (#34)

## Behavior

Adds shared CAN reception, device configuration/manual reception, manual
and DBC project signals, Raw Frames history/CSV, Monitor values/curves,
and CAN-only or mixed Recorder history. Consumers release their own
subscriptions; recordings freeze definitions, units, event timing, loss
gaps and completion facts for offline playback and project migration.

Based on main `17f7574f9764a5a18c1f04adf85eaa932f7edae9`; feature head
`2eb78c33e55c28e31945dab69a0a45e5a30ff9b4` synchronizes the current main
changes. Temporary installed mock plugins, local acceptance artifacts
and native build outputs are excluded. Scope and contracts are
documented under `docs/can-integration*` and ADR 0046. Companion JNI
change: crysound/OpenTest-NativeDriver#2.

## Validation

- Initial changed Java test selection: 448 tests in 45 suites pass.
Frontend selection: 495 tests in 26 files pass; SDK build, boundaries,
Vue checks and bilingual document policy pass. These are scoped local
runs, not all repository tests.
- Finish-time source-failure regression and related suites: 98 pass.
Ordinary graphic admission fix: 313 tests, 0 failures/errors, 3 skips.
Source-filter expectation fix: 23 pass.
- Pure CAN Repeat failed in the actual application while preparing its
next round: the host incorrectly required ordinary sampled inputs.
Commit `7049c3de` allows an explicitly CAN-only group to inherit empty
physical clocks while retaining scope and ordinary-input validation. The
regression reproduces the original exception before the fix; all 65
related tests pass after it. This commit is installed as Windows release
`20261116T123049Z-ba0e7376`; actual loaded test-library hashes were
verified. On November 17, this installed release passed two CAN-only
Repeat rounds and two real SonoDAQ Ch1 + CAN6–9 Repeat rounds. Disk,
HTTP and read-only SQLite snapshots agree. Each mixed round contains one
2-second, mono 48kHz WAV (96000 samples), 28 Crybin files and one CAN
event file; native finish reports drained/complete with zero recorded
loss.

## Application evidence and remaining gates

Windows release `20261117T061811Z-3d19ce05` tested head
`2eb78c33e55c28e31945dab69a0a45e5a30ff9b4` with the rebuilt x64 CAN JNI
(`13f99746…`) and matching 2.5.0 test DLL/DAT from the internal plugin
repository. Loaded-module hashes, test-signed target certificate and 9
ready plugins were verified. This test overlay is not included in the
PR's production binaries.

On that release, pure CAN Repeat and real SonoDAQ Ch1 plus controlled
CAN recording completed, with event files matched across
disk/HTTP/persisted snapshots and source-idle playback. The real
ordinary waveform contained 192000 samples at 48kHz. Decoded video clips
cover pure CAN initial placeholders, valid values and history playback;
they do not cover the later mixed/Repeat runs. CAN input is a test
fixture, not physical-bus certification.

Acceptance is now 64/76 clauses and 7/9 work packages, combining scoped
archived and current evidence. Pure and mixed short Repeat, All Inputs
growth and explicit-subset freezing are covered on deployed head
`2eb78c33e55c28e31945dab69a0a45e5a30ff9b4` in release
`20261117T061811Z-3d19ce05`. The separate automatic Monitor cleanup
check restored idle ports and original configuration. The new-head
Repeat runs also ended with both CAN ports idle and the original
dashboard configuration restored. The formal navigator Refresh entry
confirms aborting the Recorder and actually reloads the document while
preserving the existing manual receiveId. This passed for CAN-only and
real Ch1 + CAN6–9 recordings; the mixed run retained its initial cleanup
error and passed a separate recovery check. Forced transport-loss
acceptance remains open.

Ordinary signal-trigger preparation was diagnosed with an actual JVM
Flight Recording: `dashboard-start` threw `UnsatisfiedLinkError` for
`createBkTriggerTask`; the loaded DLL exports `createSignalTriggerTask`.
The error escaped `catch (Exception)` and appeared later as `task
timeout`. A generated-header audit found 34 missing algorithm JNI
exports before synchronization. Current main PR #29 already contains the
Java adapters; syncing main brings the mismatch to 0 across 148
algorithm declarations. The current feature passed 39 JNI/bridge tests,
43 CAN/trigger tests and 181 Monitor tests. A matching Windows Electron
native runtime was rebuilt on the Mac. The exact head is now deployed
and application acceptance passed ordinary SIGNAL trigger request
`2122586283422519296` (status2, WAV + CAN6 event, dependency rejection
and CAN-source exclusion), two pure CAN Repeat rounds
(`2122586895526662144`, `2122586876694237184`) and two mixed real Ch1 +
CAN6–9 Repeat rounds (`2122588219890733056`, `2122588211103666176`).

The pre-acquisition detail timeout left PENDING request
`2122537553168285696` without a recording-start stream or resource use;
its failed report is retained. Earlier ordinary audio overrun `13101013`
remains unresolved. Neither is counted as passing. Remaining trigger
behavior, frozen playback processing, mixed source-failure/loss
handling, storage and migration combinations remain open.

Current-head CI run `44026488806` has backend and frontend failures;
backend evidence includes provider test-fixture compilation,
installed-content path handling and CommonProto descriptor expectations.
Docs-policy run `44026488837` passed. Prior base comparisons do not make
this run pass. Keep this PR Draft until checks, application acceptance
and review are complete.

Refs #31
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