Skip to content

feat: upgrade to WSJT-X 3.0.0 backend#2

Merged
boybook merged 6 commits into
mainfrom
feature/upgrade-wsjtx-3.0.0
May 5, 2026
Merged

feat: upgrade to WSJT-X 3.0.0 backend#2
boybook merged 6 commits into
mainfrom
feature/upgrade-wsjtx-3.0.0

Conversation

@boybook

@boybook boybook commented May 4, 2026

Copy link
Copy Markdown
Owner

Port WSJT-X 3.0.0 FT8 decoder: A8 list decode, 5-channel soft bits, 13 AP passes. New DecodeOptions API. C++20. 26/26 tests pass.

boybook and others added 6 commits May 4, 2026 08:45
- Port WSJT-X 3.0.0 FT8 decoder: A8 list decode, 5-channel soft bits, 13 AP passes
- Add DecodeOptions interface (dxCall/dxGrid for A8, freq range control)
- DecodeResult.messages direct return (eliminate hidden pullMessages)
- Fix WSJTXMode enum: WSPR=9, add JT65JT9=8
- C++20 upgrade (matching upstream)
- Per-instance message queue via thread_local
- C API v2: wsjtx_decode_options_t, wsjtx_pull_messages batch retrieval
- WSPR decode interface: IQ→Int16 audio

Breaking changes:
- decode() takes DecodeOptions instead of separate params
- decodeWSPR() accepts Int16Array instead of Float32Array IQ
- pullMessages() deprecated, use DecodeResult.messages

Co-Authored-By: Claude <noreply@anthropic.com>
- Add EXTERNAL SPLIT declaration in jplsubs.f to resolve name conflict
  with Fortran 2023 intrinsic 'split' in gfortran 16.1.0
- Fixes Windows CI build failure on win32-x64
The three new C ABI functions (wsjtx_decode_float_v2,
wsjtx_decode_int16_v2, wsjtx_pull_messages) were missing the
WSJTX_API export attribute. On Windows/MinGW, this meant they
were hidden (C_VISIBILITY_PRESET hidden) and not exported from
wsjtx_core.dll. The gendef step couldn't find them, so the MSVC
import library didn't include them, causing LNK2019 errors in
the .node linking phase.
The v2 decode/pull_messages declarations were placed after the
extern "C" closing brace and after the include guard #endif,
causing C++ name mangling. MinGW (Itanium ABI) and MSVC (MSVC ABI)
produce incompatible mangled names, so MSVC could never find
the symbols exported by the MinGW-built DLL.

Also add missing WSJTX_API to the v2 function definitions in
wsjtx_c_api.cpp for proper DLL export.

Fixes Windows CI LNK2019 unresolved external errors for
wsjtx_decode_float_v2, wsjtx_decode_int16_v2, wsjtx_pull_messages.
Bug fix:
  DecodeOptions.lowFreq / highFreq / tolerance were silently dropped
  at the C++ layer — the v2 decode functions read the C struct but
  never forwarded these fields to the underlying decoder, which kept
  using the hardcoded defaults (200 / 4000 / 20). Users could supply
  any range and it would have no effect.

  Now wsjtx_lib exposes setDecodeRange(low, high, tol) and the v2
  decode functions apply it (alongside dxCall / dxGrid) before each
  decode. Behaviour is also deterministic: the range is always
  re-applied per call, so prior calls cannot leak state.

Readability cleanup:
  src/index.ts, src/types.ts and the v2 portion of native/wsjtx_c_api.{h,cpp}
  had been compressed onto single lines (one-letter variables, magic
  numbers, struct typedefs squeezed inline, validators named vMode/vFreq).
  This was the same shape that hid the original Windows linker bug.
  Expanded everything to readable multi-line form, kept the public API
  byte-identical.

Test coverage:
  - wsjtx.basic.test.ts (smoke): 14 tests, runs in <1 s
  - wsjtx.test.ts (regression): 46 tests covering capability queries,
    encoding (FT8 + FT4 across 6 message forms with sample-count sanity),
    encode→decode round-trip on Float32 and Int16 paths, every
    DecodeOptions field individually and combined, narrow-window decode,
    state-isolation across reused lib instances, format conversion in
    both directions with round-trip, error paths.
Re-pin submodule onto the rebase-merged commit on master so the pointer
remains reachable once the upgrade/wsjtx-3.0.0 branch is deleted.
Submodule contents are identical (rebase preserved the same trees).
@boybook boybook merged commit 61355a8 into main May 5, 2026
7 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