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 @@
base,level_618,level_1000,level_1618
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,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
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,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
nan,nan,nan,nan
nan,nan,nan,nan
nan,nan,nan,nan
nan,nan,nan,nan
126.11256849962119,111.69360385928405,102.78091050554816,88.36194586521103
126.5687481582892,112.14978351795207,103.23709016421617,88.81812552387905
127.02492781695719,112.60596317662007,103.69326982288416,89.27430518254704
127.4811074756252,113.06214283528806,104.14944948155217,89.73048484121503
127.93728713429319,113.51832249395605,104.60562914022016,90.18666449988302
128.3934667929612,113.97450215262407,105.06180879888817,90.64284415855104
128.84964645162918,114.43068181129206,105.51798845755616,91.09902381721903
129.3058261102972,114.88686146996008,105.97416811622418,91.55520347588705
129.7620057689652,115.34304112862807,106.43034777489217,92.01138313455505
107.20692609595461,121.53513781516853,130.39173470309686,144.71994642231078
107.67645569888904,122.00466741810295,130.86126430603127,145.1894760252452
108.14598530182349,122.4741970210374,131.33079390896575,145.65900562817964
108.61551490475792,122.94372662397183,131.80032351190016,146.12853523111409
109.08504450769234,123.41325622690626,132.26985311483458,146.5980648340485
109.55457411062679,123.8827858298407,132.73938271776905,147.06759443698294
110.02410371356122,124.35231543277513,133.20891232070346,147.5371240399174
110.49363331649566,124.82184503570957,133.6784419236379,148.0066536428518
110.96316291943009,125.291374638644,134.14797152657235,148.47618324578625
111.43269252236453,125.76090424157844,134.61750112950676,148.9457128487207
111.90222212529896,126.23043384451287,135.0870307324412,149.4152424516551
112.37175172823339,126.6999634474473,135.55656033537565,149.88477205458955
136.53513512382057,122.06850383776266,113.12634663505372,98.6597153489958
137.02502653417542,122.55839524811752,113.61623804540858,99.14960675935066
137.51491794453025,123.04828665847235,114.10612945576341,99.63949816970549
138.0048093548851,123.53817806882721,114.59602086611827,100.12938958006035
138.49470076523997,124.02806947918207,115.08591227647312,100.6192809904152
138.98459217559483,124.51796088953692,115.57580368682798,101.10917240077006
139.47448358594968,125.00785229989178,116.06569509718284,101.59906381112492
139.96437499630454,125.49774371024664,116.5555865075377,102.08895522147978
140.4542664066594,125.9876351206015,117.04547791789255,102.57884663183464
118.90348770093973,132.9657507827558,141.6579587071146,155.72022178893067
119.45286251880296,133.51512560061903,142.20733352497783,156.2695966067939
120.00223733666618,134.06450041848225,142.75670834284105,156.81897142465712
120.5516121545294,134.61387523634545,143.30608316070425,157.36834624252032
121.1009869723926,135.16325005420867,143.85545797856747,157.91772106038354
121.65036179025583,135.7126248720719,144.4048327964307,158.46709587824677
122.19973660811905,136.26199968993512,144.95420761429392,159.01647069611
122.74911142598226,136.81137450779832,145.50358243215715,159.56584551397322
123.29848624384547,137.36074932566154,146.05295725002034,160.1152203318364
123.8478610617087,137.91012414352477,146.60233206788357,160.66459514969964
124.39723587957192,138.459498961388,147.1517068857468,161.21396996756286
124.94661069743513,139.0088737792512,147.70108170361,161.76334478542606
148.21514229722695,134.16106328687997,125.47391412514443,111.41983511479744
148.7630456890799,134.7089666787329,126.02181751699737,111.96773850665038
149.31094908093286,135.25687007058588,126.56972090885034,112.51564189850335
149.8588524727858,135.80477346243882,127.11762430070328,113.06354529035629
150.40675586463877,136.3526768542918,127.66552769255625,113.61144868220926
150.9546592564917,136.90058024614473,128.2134310844092,114.1593520740622
151.50256264834468,137.4484836379977,128.76133447626216,114.70725546591517
152.05046604019762,137.99638702985064,129.3092378681151,115.25515885776811
1 base level_618 level_1000 level_1618
2 nan nan nan nan
3 nan nan nan nan
4 nan nan nan nan
5 nan nan nan nan
6 nan nan nan nan
7 nan nan nan nan
8 nan nan nan nan
9 nan nan nan nan
10 nan nan nan nan
11 nan nan nan nan
12 nan nan nan nan
13 nan nan nan nan
14 nan nan nan nan
15 nan nan nan nan
16 nan nan nan nan
17 nan nan nan nan
18 nan nan nan nan
19 nan nan nan nan
20 nan nan nan nan
21 nan nan nan nan
22 nan nan nan nan
23 nan nan nan nan
24 nan nan nan nan
25 nan nan nan nan
26 nan nan nan nan
27 nan nan nan nan
28 nan nan nan nan
29 nan nan nan nan
30 nan nan nan nan
31 nan nan nan nan
32 126.11256849962119 111.69360385928405 102.78091050554816 88.36194586521103
33 126.5687481582892 112.14978351795207 103.23709016421617 88.81812552387905
34 127.02492781695719 112.60596317662007 103.69326982288416 89.27430518254704
35 127.4811074756252 113.06214283528806 104.14944948155217 89.73048484121503
36 127.93728713429319 113.51832249395605 104.60562914022016 90.18666449988302
37 128.3934667929612 113.97450215262407 105.06180879888817 90.64284415855104
38 128.84964645162918 114.43068181129206 105.51798845755616 91.09902381721903
39 129.3058261102972 114.88686146996008 105.97416811622418 91.55520347588705
40 129.7620057689652 115.34304112862807 106.43034777489217 92.01138313455505
41 107.20692609595461 121.53513781516853 130.39173470309686 144.71994642231078
42 107.67645569888904 122.00466741810295 130.86126430603127 145.1894760252452
43 108.14598530182349 122.4741970210374 131.33079390896575 145.65900562817964
44 108.61551490475792 122.94372662397183 131.80032351190016 146.12853523111409
45 109.08504450769234 123.41325622690626 132.26985311483458 146.5980648340485
46 109.55457411062679 123.8827858298407 132.73938271776905 147.06759443698294
47 110.02410371356122 124.35231543277513 133.20891232070346 147.5371240399174
48 110.49363331649566 124.82184503570957 133.6784419236379 148.0066536428518
49 110.96316291943009 125.291374638644 134.14797152657235 148.47618324578625
50 111.43269252236453 125.76090424157844 134.61750112950676 148.9457128487207
51 111.90222212529896 126.23043384451287 135.0870307324412 149.4152424516551
52 112.37175172823339 126.6999634474473 135.55656033537565 149.88477205458955
53 136.53513512382057 122.06850383776266 113.12634663505372 98.6597153489958
54 137.02502653417542 122.55839524811752 113.61623804540858 99.14960675935066
55 137.51491794453025 123.04828665847235 114.10612945576341 99.63949816970549
56 138.0048093548851 123.53817806882721 114.59602086611827 100.12938958006035
57 138.49470076523997 124.02806947918207 115.08591227647312 100.6192809904152
58 138.98459217559483 124.51796088953692 115.57580368682798 101.10917240077006
59 139.47448358594968 125.00785229989178 116.06569509718284 101.59906381112492
60 139.96437499630454 125.49774371024664 116.5555865075377 102.08895522147978
61 140.4542664066594 125.9876351206015 117.04547791789255 102.57884663183464
62 118.90348770093973 132.9657507827558 141.6579587071146 155.72022178893067
63 119.45286251880296 133.51512560061903 142.20733352497783 156.2695966067939
64 120.00223733666618 134.06450041848225 142.75670834284105 156.81897142465712
65 120.5516121545294 134.61387523634545 143.30608316070425 157.36834624252032
66 121.1009869723926 135.16325005420867 143.85545797856747 157.91772106038354
67 121.65036179025583 135.7126248720719 144.4048327964307 158.46709587824677
68 122.19973660811905 136.26199968993512 144.95420761429392 159.01647069611
69 122.74911142598226 136.81137450779832 145.50358243215715 159.56584551397322
70 123.29848624384547 137.36074932566154 146.05295725002034 160.1152203318364
71 123.8478610617087 137.91012414352477 146.60233206788357 160.66459514969964
72 124.39723587957192 138.459498961388 147.1517068857468 161.21396996756286
73 124.94661069743513 139.0088737792512 147.70108170361 161.76334478542606
74 148.21514229722695 134.16106328687997 125.47391412514443 111.41983511479744
75 148.7630456890799 134.7089666787329 126.02181751699737 111.96773850665038
76 149.31094908093286 135.25687007058588 126.56972090885034 112.51564189850335
77 149.8588524727858 135.80477346243882 127.11762430070328 113.06354529035629
78 150.40675586463877 136.3526768542918 127.66552769255625 113.61144868220926
79 150.9546592564917 136.90058024614473 128.2134310844092 114.1593520740622
80 151.50256264834468 137.4484836379977 128.76133447626216 114.70725546591517
81 152.05046604019762 137.99638702985064 129.3092378681151 115.25515885776811