test(golden): language-neutral fixtures + per-binding parity runners (#255)

**Task 5 — golden-fixture parity for the C-ABI bindings.** Lifts the C#/Go/Java/R tests from *one indicator per archetype* toward reference-value parity, catching FFI wiring bugs (swapped params, wrong multi-output field) the math-only core tests cannot see.

## What's here
- **`examples/rust/src/bin/gen_golden.rs`** + **`testdata/golden/*.csv`** — a Rust generator computing a deterministic OHLCV series plus the core's reference outputs for a curated archetype-spanning set: scalar (`Sma`/`Ema`/`Rsi`), candle (`Atr`), scalar multi-output (`MACD`), candle multi-output (`ADX`), pairwise (`Beta`). `nan` marks warmup. Regenerate with `cargo run -p wickra-examples --bin gen_golden`.
- **Parity runners** replaying the identical fixtures through each FFI (rel-tol 1e-6), each a standard test in the binding's existing suite (no `ci.yml` change — rides `dotnet test` / `go test` / `mvn install` / `R CMD`+testthat). A walk-up search locates `testdata/golden` regardless of run dir.
  - **C#** (`bindings/csharp/.../GoldenTests.cs`) —  validated locally, 7/7 pass.
  - **Go** (`bindings/go/golden_test.go`) —  validated locally, pass.
  - **Java** (`bindings/java/.../GoldenTests.java`) — modeled on the archetype API; validated by CI (no local mvn).
  - **R** (`bindings/r/tests/testthat/test-golden.R`) — modeled on the archetype API; validated by CI (no local Rscript).

## Notes
- The curated set spans every marshalling archetype; extending the indicator list is mechanical (add to the generator + regenerate). Bars/profile archetypes can be added next.
- No new CI jobs.
This commit is contained in:
kingchenc
2026-06-11 15:22:29 +02:00
committed by GitHub
parent 395a2289f4
commit 8bfe24ac1d
13 changed files with 1397 additions and 0 deletions
+81
View File
@@ -0,0 +1,81 @@
rsi
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
nan
46.84518809898699
45.82961265424322
46.5293990131247
49.23903870201344
53.518768674122796
58.56047460456064
63.58342577996474
68.07459111891804
71.80327260156207
74.72559789038102
76.88488357198254
78.34471541432595
79.15131540353094
79.31156608926268
77.35312513119456
73.13439349750769
67.51119167055117
61.48673113238304
55.86675382432369
51.14733221714866
47.57753664027756
45.28036590056008
44.36975889174273
45.212282377402985
48.12434665867438
52.61537254620642
57.83678169397702
62.992663568874654
67.57346293490359
71.3583982125327
74.31265622918312
76.4855340725887
77.9435594091973
78.73329989554925
78.85948376472163
76.76197022138767
72.44443440532005
66.78373698621982
60.77877328002407
55.21662487911296
50.57413251002351
47.087563552178636
44.87458874458458
44.050409895373384
45.01878876311954
48.0601943425273
52.64880490307121
57.92140340103244
63.088714334306665
67.65616719708338
71.41589642993111
74.34074717674663
76.4832369420561
77.91026866443379
78.66702552588708
78.75547116040536
76.51507736151031
72.09088140590961
66.3803507173797
60.378854393296976
54.856911707280055
50.27461841837877
46.857548898064
44.719625963574536
43.978649539628535
45.06927522550655
1 rsi
2 nan
3 nan
4 nan
5 nan
6 nan
7 nan
8 nan
9 nan
10 nan
11 nan
12 nan
13 nan
14 nan
15 nan
16 46.84518809898699
17 45.82961265424322
18 46.5293990131247
19 49.23903870201344
20 53.518768674122796
21 58.56047460456064
22 63.58342577996474
23 68.07459111891804
24 71.80327260156207
25 74.72559789038102
26 76.88488357198254
27 78.34471541432595
28 79.15131540353094
29 79.31156608926268
30 77.35312513119456
31 73.13439349750769
32 67.51119167055117
33 61.48673113238304
34 55.86675382432369
35 51.14733221714866
36 47.57753664027756
37 45.28036590056008
38 44.36975889174273
39 45.212282377402985
40 48.12434665867438
41 52.61537254620642
42 57.83678169397702
43 62.992663568874654
44 67.57346293490359
45 71.3583982125327
46 74.31265622918312
47 76.4855340725887
48 77.9435594091973
49 78.73329989554925
50 78.85948376472163
51 76.76197022138767
52 72.44443440532005
53 66.78373698621982
54 60.77877328002407
55 55.21662487911296
56 50.57413251002351
57 47.087563552178636
58 44.87458874458458
59 44.050409895373384
60 45.01878876311954
61 48.0601943425273
62 52.64880490307121
63 57.92140340103244
64 63.088714334306665
65 67.65616719708338
66 71.41589642993111
67 74.34074717674663
68 76.4832369420561
69 77.91026866443379
70 78.66702552588708
71 78.75547116040536
72 76.51507736151031
73 72.09088140590961
74 66.3803507173797
75 60.378854393296976
76 54.856911707280055
77 50.27461841837877
78 46.857548898064
79 44.719625963574536
80 43.978649539628535
81 45.06927522550655