test: golden-pin the four de-duplicated indicators across all bindings (#305)

* test: golden-pin the four de-duplicated indicators across all C-ABI bindings

Extend gen_golden to emit reference fixtures for AdOscillator (ADOSC),
IntradayIntensity, AwesomeOscillatorHistogram and AverageDrawdown, and replay
them through the Go / C# / Java / R golden harnesses so their corrected
definitions stay bit-identical to the Rust core in every binding. Go suite
verified locally (gcc 13 + cgo): all 9 golden tests pass; C#/Java/R use the
same fixtures and harness pattern (CI-verified). First step of extending the
golden coverage beyond the seven archetype representatives.

* test: golden-pin the scalar-output tranche (308 indicators) against Rust

Extend gen_golden with a generated emit_scalar that writes reference fixtures
for every single-f64-output indicator (scalar / candle / pairwise input) using
valid constructor params, and add a manifest-driven generic Python golden
replay that reconstructs each by its native name and checks it bit-for-bit
against the Rust output. 308 indicators now value-tied to the Rust core in
Python (pytest: 308/308). Takes golden coverage from the 7 archetype
representatives to 308+ of the catalogue.

22 scalar indicators with non-default constructor constraints are skipped by
gen_golden for now (logged), as are non-f64-output ones; multi-output, exotic
inputs and the per-indicator arg arities of the C-ABI/Node replays follow.
Generated + verified locally with the full toolchain.

* test: golden-pin the multi-output tranche (70 indicators) in Python

Add a generated emit_multi to gen_golden (per-indicator Output-field access,
one CSV column per field) and a manifest-driven generic Python replay that
checks every field of each multi-output indicator against the Rust reference.
70 multi-output indicators now value-tied to Rust in Python; combined with the
scalar tranche, 378 indicators are golden-pinned. 8 multi with non-default
param constraints and 5 with non-f64 Output fields (Option/Vec/i64) are
deferred. pytest green.

* test(golden): add 30 constraint-tuned indicators to scalar/multi golden suite

Emit golden fixtures for 22 scalar-output and 8 multi-output indicators
whose constructors need non-default parameters (Alma, Jma, Psar, T3, Mama,
DoubleBollinger, ZigZag, ...). All 408 fixtures replay bit-for-bit through
the Python binding.

* test(golden): cover 36 missed scalar/multi indicators

Add 26 single-output (LinearRegression family, HT cycle, Candle
volatility estimators, DrawdownDuration) and 10 multi-output
(BollingerBands, MACD/MACDEXT/MACDFIX, Camarilla, VWAP bands, ...)
indicators to the golden suite. 444 fixtures replay bit-for-bit
through the Python binding.

* test(golden): cover 50 exotic-input indicators

Add deterministic synthetic feeders for the DerivativesTick (17),
CrossSection (15), Trade (8), TradeQuote (3) and OrderBook (7)
families, derived from the shared OHLCV input series in both
gen_golden and a new Python replay harness (test_golden_exotic).
All 494 fixtures replay bit-for-bit through the Python binding.

* test(golden): complete 514-indicator golden coverage

Add the final tranches: 3 mixed multi-output indicators (Ichimoku,
WilliamsFractals, LeadLagCrossCorrelation), 6 histogram profiles
(time/volume seasonality + TPO/volume price profiles), 10 alt-chart
bar builders and the footprint. Every one of the 514 distinct
indicators now has a Rust-generated g_<Canonical>.csv fixture and a
generic Python replay (scalar/multi/exotic/profile/bars), all passing
bit-for-bit.

* test(golden): add generic Node replay for all 514 indicators

A manifest-driven node:test harness reconstructs every indicator by its
native class, feeds the same synthetic stream derived from the shared
golden input, and checks output bit-for-bit against the Rust reference
fixtures (scalar/multi/exotic/profile/bars). node_manifest.json is
generated from index.d.ts plus the Python-side manifests. 514/514 pass.

* test(golden): add generated Go replay for all 514 indicators

golden_all_test.go (generated by gen_golden_test.py) reconstructs every
Go indicator, feeds the shared synthetic stream and checks output
bit-for-bit against the Rust reference fixtures. A reflection-based
comparator flattens multi-output structs, profiles and bar slices so one
path covers all archetypes. This is the first C-ABI binding verified
across the full catalogue. 514/514 pass.

* test(golden): add generated C# replay for all 514 indicators

GoldenAllTests.g.cs (generated by gen_golden_test.py) reconstructs every
C# indicator, feeds the shared synthetic stream and checks output
bit-for-bit against the Rust reference fixtures via a reflection-based
flatten covering scalar/multi/profile/bar archetypes. 514/514 pass.

Also add the '#nullable enable' directive the compiler requires to the
generated Indicators.g.cs, clearing the four CS8669 warnings on the
nullable double[] profile return types.

* fix(java): marshal C ABI bool params correctly; add 514 golden replay

The Java FFM binding marshalled the cross-section state flags (newHigh,
newLow, aboveMa, onBuySignal) as JAVA_DOUBLE arrays, but the C ABI takes
them as const bool* (one byte each), so the native side read the low byte
of each 8-byte double and saw every flag as false. Add WickraNative.
boolSegment and use it across the 15 cross-section indicators. Also pass
the MacdExt MaType arguments as byte to match the uint8_t downcall
descriptor (was int, throwing WrongMethodTypeException).

Add GoldenAllTest.java (generated by gen_golden_test.py): a reflection
runner replaying all 514 indicators against the Rust reference fixtures.
The bugs above were found by this test; 514/514 now pass.

* fix(r): marshal C ABI bool flags correctly; add 514 golden replay

The R wrapper passed the cross-section state flags as (bool *)REAL(x),
reinterpreting the 8-byte doubles as 1-byte bools so the native side read
every flag as false. Add wk_bool_vec to convert each flag vector into a
real C bool buffer and use it for all 15 cross-section update wrappers.

Add test-golden-all.R + generated golden_specs.R: a reflective runner
replaying all 514 indicators against the Rust reference fixtures. The bug
above was found by this test; verified 514/514 pass locally.

* test(golden): add WASM replay for all 514 indicators

A manifest-driven node:test harness loads the nodejs-target wasm-pack
build, reconstructs every indicator by its JS class, feeds the shared
synthetic stream and checks output bit-for-bit against the Rust
reference fixtures. wasm_manifest.json is generated from the wasm .d.ts
plus the shared manifests; a recursive flattener covers scalar, multi
(Reflect objects), profile and bar shapes. 514/514 pass locally
(wasm-pack build --target nodejs, then node --test).

* test(golden): add C and C++ replay for all 514 indicators

golden_test.c (generated by gen_golden_test.py) drives every indicator
through the C ABI (wickra.h) and checks output bit-for-bit against the
Rust reference fixtures. golden_test.cpp #includes the same source so the
identical runner is compiled and run under both gcc (C) and g++ (C++) via
the CMake targets golden_test / golden_test_cpp — proving the extern "C"
header is consumable from each language. Both 514/514 (verified via ctest).

* test(golden): gofmt the generated Go golden replay

* test(golden): make the Node fixture reader CRLF-safe and pin fixtures to LF
This commit is contained in:
kingchenc
2026-06-15 04:48:51 +02:00
committed by GitHub
parent de1112ea91
commit 4f708d410d
573 changed files with 102337 additions and 77 deletions
+81
View File
@@ -0,0 +1,81 @@
support,resistance
nan,nan
nan,nan
nan,nan
nan,nan
nan,nan
nan,nan
nan,nan
nan,nan
nan,nan
nan,nan
nan,nan
nan,nan
nan,nan
105.48528973597423,108.76572870814134
105.35455449711873,108.6426693151496
104.99613331709894,108.26415424635832
104.45423797197951,107.69469606786855
103.76663779870992,107.02741057227911
103.06061318592951,106.33590786742543
102.43098200940356,105.74322045382517
102.01535087802485,105.32463051632527
101.90645925660854,105.17147645630222
102.1639859216411,105.35682391936476
102.74616634399676,105.98614520029493
103.69944091712054,106.99783391906578
105.00121413283641,108.3204131352994
106.57237842993837,109.87014157860129
108.2982527721847,111.54900155100448
110.03456839896052,113.26358031500536
111.66103818764019,114.89853069142542
113.08968302693143,116.3593601306946
114.29721107031293,117.57000031802899
115.19492692914805,118.49623152556184
115.7610156295969,119.05680027398147
115.97655517589826,119.23030366756598
115.8387260537211,119.05576558295421
115.37184795637337,118.62039443562618
114.68531988726279,117.99056009163358
113.92096168322644,117.24475112428712
113.20152903795153,116.49952286227172
112.63807685790252,115.8745407167734
112.28618916797922,115.51073319157884
112.21307448239781,115.48306661197938
112.4897914934254,115.7960461414421
113.13296008084014,116.4384854458514
114.10446420380686,117.38847120867052
115.33337840244192,118.60950836671032
116.78486997883208,120.02422932037881
118.39145629210806,121.63045737917238
120.07205648721455,123.32931082821996
121.71145976981019,125.01865728958238
123.23150856387835,126.55334759289774
124.53297461259878,127.82696093235364
125.53022603154335,128.7609157102544
126.13330667266112,129.34283959048057
126.30465839074171,129.58363235409425
126.13219687879015,129.44901840587096
125.68534052391294,128.99791301162017
125.05610374914488,128.32612527277806
124.32304099775938,127.57988201018676
123.61786680358311,126.86281318210662
123.02767603836041,126.30743659280331
122.65512601039703,125.9500025048885
122.56435786720805,125.86329944126854
122.82025525538073,126.12884972272579
123.4777467261692,126.75897692900068
124.52914660401476,127.75292386050552
125.88889658382824,129.1094032659287
127.4696659224108,130.7577583580434
129.21644482829126,132.54053935472976
131.0136930507936,134.33022444409997
132.73711457487826,136.0050486727801
134.2578843094037,137.4720686952658
135.44786347633212,138.68508794243255
136.27656240894459,139.56375924051807
136.75506957168733,140.05710042578988
136.89863428953115,140.17970291899607
136.72570349503889,140.01027850792929
136.33473861820534,139.5942620800032
135.76225111438174,139.00175324359623
1 support resistance
2 nan nan
3 nan nan
4 nan nan
5 nan nan
6 nan nan
7 nan nan
8 nan nan
9 nan nan
10 nan nan
11 nan nan
12 nan nan
13 nan nan
14 nan nan
15 105.48528973597423 108.76572870814134
16 105.35455449711873 108.6426693151496
17 104.99613331709894 108.26415424635832
18 104.45423797197951 107.69469606786855
19 103.76663779870992 107.02741057227911
20 103.06061318592951 106.33590786742543
21 102.43098200940356 105.74322045382517
22 102.01535087802485 105.32463051632527
23 101.90645925660854 105.17147645630222
24 102.1639859216411 105.35682391936476
25 102.74616634399676 105.98614520029493
26 103.69944091712054 106.99783391906578
27 105.00121413283641 108.3204131352994
28 106.57237842993837 109.87014157860129
29 108.2982527721847 111.54900155100448
30 110.03456839896052 113.26358031500536
31 111.66103818764019 114.89853069142542
32 113.08968302693143 116.3593601306946
33 114.29721107031293 117.57000031802899
34 115.19492692914805 118.49623152556184
35 115.7610156295969 119.05680027398147
36 115.97655517589826 119.23030366756598
37 115.8387260537211 119.05576558295421
38 115.37184795637337 118.62039443562618
39 114.68531988726279 117.99056009163358
40 113.92096168322644 117.24475112428712
41 113.20152903795153 116.49952286227172
42 112.63807685790252 115.8745407167734
43 112.28618916797922 115.51073319157884
44 112.21307448239781 115.48306661197938
45 112.4897914934254 115.7960461414421
46 113.13296008084014 116.4384854458514
47 114.10446420380686 117.38847120867052
48 115.33337840244192 118.60950836671032
49 116.78486997883208 120.02422932037881
50 118.39145629210806 121.63045737917238
51 120.07205648721455 123.32931082821996
52 121.71145976981019 125.01865728958238
53 123.23150856387835 126.55334759289774
54 124.53297461259878 127.82696093235364
55 125.53022603154335 128.7609157102544
56 126.13330667266112 129.34283959048057
57 126.30465839074171 129.58363235409425
58 126.13219687879015 129.44901840587096
59 125.68534052391294 128.99791301162017
60 125.05610374914488 128.32612527277806
61 124.32304099775938 127.57988201018676
62 123.61786680358311 126.86281318210662
63 123.02767603836041 126.30743659280331
64 122.65512601039703 125.9500025048885
65 122.56435786720805 125.86329944126854
66 122.82025525538073 126.12884972272579
67 123.4777467261692 126.75897692900068
68 124.52914660401476 127.75292386050552
69 125.88889658382824 129.1094032659287
70 127.4696659224108 130.7577583580434
71 129.21644482829126 132.54053935472976
72 131.0136930507936 134.33022444409997
73 132.73711457487826 136.0050486727801
74 134.2578843094037 137.4720686952658
75 135.44786347633212 138.68508794243255
76 136.27656240894459 139.56375924051807
77 136.75506957168733 140.05710042578988
78 136.89863428953115 140.17970291899607
79 136.72570349503889 140.01027850792929
80 136.33473861820534 139.5942620800032
81 135.76225111438174 139.00175324359623