1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// wst_bridge.h — C++ FFI surface for the omni-ffi Rust crate.
//
// The WSTResult struct itself is generated by cxx-build from the
// `#[cxx::bridge]` declaration in src/lib.rs and emitted into
// `target/cxxbridge/omni-ffi/src/lib.rs.h`. We include that generated header
// here so wst_bridge_cpu.cpp (and wst_bridge_cuda.cpp) can return the struct
// by value without redefining it — which would be an ODR violation.
//
// Contract: every function declared here must have an implementation in the
// active bridge translation unit (wst_bridge_cpu.cpp on the default build,
// wst_bridge_cuda.cpp when the `cuda` feature is enabled).
// Run the Wavelet Scattering Transform / Joint Time-Frequency Scattering
// pipeline against a Plasma-resident input buffer.
//
// Parameters:
// input_plasma_ptr — host-side pointer to a contiguous
// float32[batch_size * signal_len] tensor. Must be
// readable for the duration of this call.
// signal_len — samples per signal (>0).
// batch_size — number of signals in the batch (>0).
// J — maximum wavelet scale (>0).
// Q — wavelets per octave (>0).
// depth — scattering cascade depth (>0).
// use_jtfs — reserved for the JTFS phase-recovery pass. Ignored on
// the CPU build (always plain WST).
//
// Returns a WSTResult whose `fingerprint_ptr` owns a heap (CPU) or device
// (CUDA) allocation. The caller MUST release it via `free_wst_result`
// exactly once.
//
// Throws std::runtime_error on invalid inputs. cxx surfaces this to Rust as
// a `cxx::Exception` (i.e. an `Err` variant in the `Result<WSTResult>`).
WSTResult ;
// Release the tensor backing a WSTResult. Idempotent for the zero-pointer
// case; otherwise must be called exactly once per pointer returned by
// run_wst_pipeline.
void ;