@pineforge/codegen-pyodide 0.7.4 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pineforge/codegen-pyodide",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "Gate-validated Pyodide payload for the PineScript v6 -> C++ transpiler: archive (run in Pyodide), unpacked source, introspected tables, and release metadata.",
5
5
  "type": "module",
6
6
  "main": "index.mjs",
@@ -611,17 +611,27 @@ class TopLevelEmitter:
611
611
  lines.append(" static_cast<MagnifierDistribution>(magnifier_dist));")
612
612
  else:
613
613
  # The magnifier-aware run() overload handles ratio=1 (no
614
- # aggregation) and empty itf/stf (auto-detect) on its own, so
615
- # we only need to fall back to the simple ``run(bars, n)``
616
- # path when the caller explicitly opted out of magnifier AND
617
- # there is no timeframe aggregation in play. Previously the
618
- # short-circuit ``itf.empty() || stf.empty() || itf == stf``
619
- # silently dropped the bar_magnifier flag whenever the host
620
- # passed empty TFs (the validator's default) — turning every
621
- # magnifier-opt-in run into a non-magnifier run and producing
622
- # 0.21% exit-price drift on the magnifier-distribution probes.
614
+ # aggregation), empty itf (auto-detect from bar timestamps),
615
+ # and empty stf (default-to-input) entirely on its own, so we
616
+ # route through it whenever ANY TF/magnifier knob is set. We
617
+ # only fall back to the simple ``run(bars, n)`` path when the
618
+ # caller passed NO magnifier AND NO timeframe at all.
619
+ #
620
+ # The previous guard ``(!itf.empty() && !stf.empty() && itf != stf)``
621
+ # required BOTH timeframes to be present before aggregating.
622
+ # The cloud caller passes ``input_tf=""`` (auto-detect) with a
623
+ # concrete ``script_tf="240"``; that made the guard false and
624
+ # the chosen ``script_tf`` was silently ignored — the strategy
625
+ # ran on raw 1m bars with no aggregation. It also dropped the
626
+ # bar_magnifier flag whenever the host passed empty TFs,
627
+ # producing 0.21% exit-price drift on the magnifier probes.
628
+ #
629
+ # Over-approximating to ``!itf.empty() || !stf.empty()`` is
630
+ # always correct: the TF-aware overload is a no-op when the
631
+ # ratio resolves to 1, so the only thing lost in that case is
632
+ # the precalc optimization — never correctness.
623
633
  lines.append(" bool needs_full_run = (bar_magnifier != 0)")
624
- lines.append(" || (!itf.empty() && !stf.empty() && itf != stf);")
634
+ lines.append(" || !itf.empty() || !stf.empty();")
625
635
  lines.append(" if (!needs_full_run) {")
626
636
  lines.append(" strat->run(bars, n);")
627
637
  lines.append(" } else {")
@@ -865,7 +875,7 @@ class TopLevelEmitter:
865
875
  lines.append(" bool bar_magnifier = false,")
866
876
  lines.append(" int magnifier_samples = 4,")
867
877
  lines.append(" MagnifierDistribution magnifier_dist = MagnifierDistribution::ENDPOINTS) {")
868
- lines.append(" bool needs_dynamic = bar_magnifier || (!input_tf.empty() && !script_tf.empty() && input_tf != script_tf);")
878
+ lines.append(" bool needs_dynamic = bar_magnifier || !input_tf.empty() || !script_tf.empty();")
869
879
  lines.append(" if (needs_dynamic) {")
870
880
  lines.append(" _use_precalc = false;")
871
881
  lines.append(" } else {")
Binary file
package/release.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
- "codegen": "0.7.4",
2
+ "codegen": "0.7.5",
3
3
  "pyodide": "314.0.0",
4
4
  "python": "3.14.0",
5
5
  "emscripten": "emscripten_5_0_3",
6
- "sha256": "cd01ab4408e2d24d3b1b6627fe2c92c533a3cc3d91f0d1386953d128bdcc5995"
6
+ "sha256": "f7bb6b9c29fef9cfd3a5b65a10fb290614e3fc7e35e3fe5f4786cc3de3e14d73"
7
7
  }
package/tables.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "CODEGEN_VERSION": "0.7.4",
2
+ "CODEGEN_VERSION": "0.7.5",
3
3
  "TA_CLASS_MAP_KEYS": [
4
4
  "sma",
5
5
  "ema",
Binary file