pineforge-codegen 1.6.0__tar.gz → 1.6.1__tar.gz
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.
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/CHANGELOG.md +48 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/PKG-INFO +11 -10
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/README.md +10 -9
- pineforge_codegen-1.6.1/VERSION +1 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/docs/PUBLIC_CONTRACT.md +1 -1
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/analyzer/types.py +21 -1
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/types.py +51 -6
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/visit_call.py +13 -6
- pineforge_codegen-1.6.0/VERSION +0 -1
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/.gitignore +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/CONTRIBUTING.md +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/LEGAL.md +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/LICENSE +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/docs/codegen-coverage-gaps.md +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/docs/pine-cap-activation.md +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/__init__.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/analyzer/__init__.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/analyzer/base.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/analyzer/call_handlers.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/analyzer/contracts.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/analyzer/diagnostics.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/analyzer/tables.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/ast_nodes.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/block_locals.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/builtin_keywords.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/__init__.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/base.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/capabilities.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/checked_settings.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/collection_history.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/constant_fold.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/drawing.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/emit_top.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/helpers.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/helpers_syminfo.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/host_members.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/input.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/order_shapes.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/run_stops.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/security.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/session_market.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/ta.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/tables.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/tv_number_format.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/visit_expr.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/visit_stmt.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/collection_history.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/diagnostic_codes.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/diagnostics_catalog.json +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/errors.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/external_requests.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/finite_ta_length.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/lexer.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/library_inline.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/library_modules.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/library_v5.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/limits.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/matrix_overloads.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/method_binding.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/parser.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/pine_libraries.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/pine_spelling.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/pragmas.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/request_discovery.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/request_feed_inventory.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/security_contexts.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/session_reads.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/signatures.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/support_checker.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/symbols.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/timeframe_token_cli.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/tokens.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/tv_input_choices.py +0 -0
- {pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pyproject.toml +0 -0
|
@@ -20,6 +20,54 @@ supported as exact pairs; on the 0.x line they are independent. See the
|
|
|
20
20
|
the release commit. A prerelease note describes changes since the preceding
|
|
21
21
|
prerelease or stable tag; the final stable note consolidates the series.
|
|
22
22
|
|
|
23
|
+
## 1.6.1 — 2026-10-18
|
|
24
|
+
|
|
25
|
+
A patch release of the exact engine/codegen pair, paired with engine `v1.6.1`
|
|
26
|
+
and dated 2026-10-18; the prerelease `1.6.1-rc.1` pairs with engine
|
|
27
|
+
`v1.6.1-rc.1`. This entry records what changed in this repository since 1.6.0,
|
|
28
|
+
and nothing else: after
|
|
29
|
+
[#209](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/209) added
|
|
30
|
+
the 1.6.1 changelog entry for `v1.6.1-rc.1`, only the final release-note and
|
|
31
|
+
pairing documentation updates landed before `1.6.1`.
|
|
32
|
+
|
|
33
|
+
### Compatibility and migration
|
|
34
|
+
|
|
35
|
+
- No Python, JSON, diagnostic or C ABI contract changes.
|
|
36
|
+
- Strategies that previously failed native C++ compilation when calling a
|
|
37
|
+
calendar built-in (`hour`, `minute`, `second`, `dayofmonth`, `dayofweek`,
|
|
38
|
+
`month`, `year`, `weekofyear`) with `timezone=` and no positional `time`
|
|
39
|
+
argument, or when initializing a `var` array with `array.from(...)` over
|
|
40
|
+
unary-signed or mixed numeric constants, now emit matching C++ types and
|
|
41
|
+
compile cleanly.
|
|
42
|
+
- A pair change requires regenerated C++ and relinked strategy libraries against
|
|
43
|
+
the paired engine release's headers and `libpineforge.a` (README
|
|
44
|
+
[Engine pairing](README.md#engine-pairing)).
|
|
45
|
+
|
|
46
|
+
### Changes since 1.6.0
|
|
47
|
+
|
|
48
|
+
- Bind the omitted `time` argument of calendar built-ins (`hour`, `minute`,
|
|
49
|
+
`second`, `dayofmonth`, `dayofweek`, `month`, `year`, `weekofyear`) to the
|
|
50
|
+
active bar's timestamp (`current_bar_.timestamp` on the chart, `bar.timestamp`
|
|
51
|
+
inside `request.security`) when called with a `timezone=` keyword argument
|
|
52
|
+
only
|
|
53
|
+
([#205](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/205)).
|
|
54
|
+
- Infer a single consistent element type across every `array.from(...)` call
|
|
55
|
+
(`var` array declarations, plain declarations and inline arguments alike) in
|
|
56
|
+
`pineforge_codegen/codegen/types.py` and `pineforge_codegen/analyzer/types.py`,
|
|
57
|
+
preserving `int` for integer constants (including unary-signed constants and
|
|
58
|
+
function-local constants) and promoting to `double` when any element is
|
|
59
|
+
`float`. For previously compiling scripts, the observable emitted-C++ change
|
|
60
|
+
is that an `array.from` whose arguments are all integer, including
|
|
61
|
+
unary-signed ones like `array.from(-1, 1)`, now emits `std::vector<int>`
|
|
62
|
+
instead of `std::vector<double>`; with `na` mixed in (`array.from(-1, na)`) it
|
|
63
|
+
emits `int` with the `int` `na` sentinel, as `array.from(1, na)` already did.
|
|
64
|
+
Values are unchanged for arithmetic, since `/`, `%`, `math.max` and the array
|
|
65
|
+
reductions already work in `double`
|
|
66
|
+
([#205](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/205)).
|
|
67
|
+
- Group weekly Dependabot pull requests into one pull request per ecosystem
|
|
68
|
+
(`npm` and `pip`) in `.github/dependabot.yml`
|
|
69
|
+
([#206](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/206)).
|
|
70
|
+
|
|
23
71
|
## 1.6.0 — 2026-10-17
|
|
24
72
|
|
|
25
73
|
A minor release of the exact engine/codegen pair, paired with engine `v1.6.0`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pineforge-codegen
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.1
|
|
4
4
|
Summary: PineScript v6 to C++ transpiler that targets the pineforge-engine runtime.
|
|
5
5
|
Project-URL: Homepage, https://github.com/pineforge-4pass/pineforge-codegen-oss
|
|
6
6
|
Project-URL: Issues, https://github.com/pineforge-4pass/pineforge-codegen-oss/issues
|
|
@@ -327,7 +327,7 @@ for the changes in each release from 1.0.0 on and the release-note policy.
|
|
|
327
327
|
## Releases and this README
|
|
328
328
|
|
|
329
329
|
<!-- Release lane: before a release is tagged, add it to the Engine pairing
|
|
330
|
-
table and update every line that names `1.6.
|
|
330
|
+
table and update every line that names `1.6.1` or `v1.6.1` as the current
|
|
331
331
|
release or pair (this section's version and date, the baseline paragraph at
|
|
332
332
|
the top, the engine `src/source/` link, the `@pf-trace` note, the clone
|
|
333
333
|
command and its example output, "This section describes …", the timing note)
|
|
@@ -337,7 +337,7 @@ hosted-server line name no version. -->
|
|
|
337
337
|
|
|
338
338
|
This README ships with each release as its package description on PyPI
|
|
339
339
|
(`pineforge-codegen`); releases from 0.7.0 on are also on npm as
|
|
340
|
-
`@pineforge/codegen-pyodide`. It describes 1.6.
|
|
340
|
+
`@pineforge/codegen-pyodide`. It describes 1.6.1 (2026-10-18)
|
|
341
341
|
and what changed since 0.10.4. The 1.4.0 release's behavior was validated
|
|
342
342
|
before tagging on codegen `bfc4ddce` with engine `b3192bfc`, excluding engine
|
|
343
343
|
request #356; those validation builds reported `1.3.0`. Historical measurements
|
|
@@ -410,8 +410,8 @@ It does **not** own execution semantics. Order lifecycle, bracket legs,
|
|
|
410
410
|
fill-price and slippage rules, `process_orders_on_close` / `calc_on_order_fills`,
|
|
411
411
|
margin revival and trail/stop behaviour — everything TradingView parity depends
|
|
412
412
|
on at run time — live in the engine's source-adapter runtime
|
|
413
|
-
([`src/source/`](https://github.com/pineforge-4pass/pineforge-engine/tree/v1.6.
|
|
414
|
-
in engine `v1.6.
|
|
413
|
+
([`src/source/`](https://github.com/pineforge-4pass/pineforge-engine/tree/v1.6.1/src/source)
|
|
414
|
+
in engine `v1.6.1`), which maps them onto the engine's Pine-agnostic kernel.
|
|
415
415
|
See
|
|
416
416
|
the engine's [architecture notes](https://github.com/pineforge-4pass/pineforge-engine#architecture-kernel-vs-parity).
|
|
417
417
|
|
|
@@ -826,6 +826,7 @@ Generated C++ compiles only against the engine it was generated for:
|
|
|
826
826
|
| 1.4.0 (PyPI, 2026-10-08) | `v1.4.0` | Adds paired coded failures, corrected input manifests and collection lowering. C ABI 4 does not authorize a mixed pair. Regenerate and relink. |
|
|
827
827
|
| 1.5.0 (PyPI, 2026-10-12) | `v1.5.0` | Adds the nonfatal `note` diagnostic severity and diagnostic `user_message` templates. Regenerate and relink. |
|
|
828
828
|
| 1.6.0 (PyPI, 2026-10-17) | `v1.6.0` | Emitted C++ and the Python, JSON and diagnostic contract are unchanged since 1.5.0; test and comment cleanup only (#200, #201, #202). Regenerate and relink. |
|
|
829
|
+
| 1.6.1 (PyPI, 2026-10-18) | `v1.6.1` | Fixes emitted C++ for calendar built-ins called with `timezone=` and no positional `time`, and for `var` array initializers over unary-signed or mixed numeric constants (#205); the Python, JSON and diagnostic contract are unchanged since 1.6.0. Regenerate and relink. |
|
|
829
830
|
| Later `X.Y.Z` releases | `vX.Y.Z` of the same version | See below. |
|
|
830
831
|
|
|
831
832
|
On the 0.x line the engine and codegen versions are independent, and the
|
|
@@ -851,8 +852,8 @@ Pine as `strategy.pine`, write `strategy.generated.cpp` with the
|
|
|
851
852
|
[file example](#transpile-a-file-to-a-cpp) above, then from the same directory:
|
|
852
853
|
|
|
853
854
|
```bash
|
|
854
|
-
# 1.6.
|
|
855
|
-
git clone --branch v1.6.
|
|
855
|
+
# 1.6.1 pairs with engine v1.6.1. For 0.10.4 use v0.13.1.
|
|
856
|
+
git clone --branch v1.6.1 https://github.com/pineforge-4pass/pineforge-engine.git
|
|
856
857
|
cd pineforge-engine
|
|
857
858
|
cp ../strategy.generated.cpp tutorial/macd/generated.cpp # the tutorial's strategy slot
|
|
858
859
|
bash tutorial/run.sh # needs cmake, a C++17 compiler and python3
|
|
@@ -978,7 +979,7 @@ quote. The commercial-license store (coming soon) will take orders online.
|
|
|
978
979
|
|
|
979
980
|
## Explicit Pine execution attachment
|
|
980
981
|
|
|
981
|
-
This section describes the 1.6.
|
|
982
|
+
This section describes the 1.6.1 and engine `v1.6.1` pair. The Pine execution adapter is
|
|
982
983
|
the engine's full Pine execution runtime (`PineExecutionAdapter` and
|
|
983
984
|
`PineStrategyHost` in the engine's `src/source/`): order lifecycle, bracket
|
|
984
985
|
legs, fill-price and slippage rules, POOC / `calc_on_order_fills`, margin
|
|
@@ -1001,9 +1002,9 @@ Regenerate old generated C++ before using a new engine for Pine execution. C++
|
|
|
1001
1002
|
generated before the source-layer cut
|
|
1002
1003
|
([#129](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/129)),
|
|
1003
1004
|
0.10.4's included, derives from `BacktestEngine` and does not compile against
|
|
1004
|
-
engine `v1.6.
|
|
1005
|
+
engine `v1.6.1`; old cap-only C++ does not attach the priority rule, and
|
|
1005
1006
|
metadata cannot silently restore it. Rebuild all modules against the
|
|
1006
|
-
new matching C++ layout (`engine_script_run_v19` in engine `v1.6.
|
|
1007
|
+
new matching C++ layout (`engine_script_run_v19` in engine `v1.6.1`). Retaining
|
|
1007
1008
|
that epoch does not promise equal fingerprints, state hashes or trades across
|
|
1008
1009
|
releases. The extraction preserves Pine policy
|
|
1009
1010
|
under explicit attachment; it does not implement the generic native
|
|
@@ -42,7 +42,7 @@ for the changes in each release from 1.0.0 on and the release-note policy.
|
|
|
42
42
|
## Releases and this README
|
|
43
43
|
|
|
44
44
|
<!-- Release lane: before a release is tagged, add it to the Engine pairing
|
|
45
|
-
table and update every line that names `1.6.
|
|
45
|
+
table and update every line that names `1.6.1` or `v1.6.1` as the current
|
|
46
46
|
release or pair (this section's version and date, the baseline paragraph at
|
|
47
47
|
the top, the engine `src/source/` link, the `@pf-trace` note, the clone
|
|
48
48
|
command and its example output, "This section describes …", the timing note)
|
|
@@ -52,7 +52,7 @@ hosted-server line name no version. -->
|
|
|
52
52
|
|
|
53
53
|
This README ships with each release as its package description on PyPI
|
|
54
54
|
(`pineforge-codegen`); releases from 0.7.0 on are also on npm as
|
|
55
|
-
`@pineforge/codegen-pyodide`. It describes 1.6.
|
|
55
|
+
`@pineforge/codegen-pyodide`. It describes 1.6.1 (2026-10-18)
|
|
56
56
|
and what changed since 0.10.4. The 1.4.0 release's behavior was validated
|
|
57
57
|
before tagging on codegen `bfc4ddce` with engine `b3192bfc`, excluding engine
|
|
58
58
|
request #356; those validation builds reported `1.3.0`. Historical measurements
|
|
@@ -125,8 +125,8 @@ It does **not** own execution semantics. Order lifecycle, bracket legs,
|
|
|
125
125
|
fill-price and slippage rules, `process_orders_on_close` / `calc_on_order_fills`,
|
|
126
126
|
margin revival and trail/stop behaviour — everything TradingView parity depends
|
|
127
127
|
on at run time — live in the engine's source-adapter runtime
|
|
128
|
-
([`src/source/`](https://github.com/pineforge-4pass/pineforge-engine/tree/v1.6.
|
|
129
|
-
in engine `v1.6.
|
|
128
|
+
([`src/source/`](https://github.com/pineforge-4pass/pineforge-engine/tree/v1.6.1/src/source)
|
|
129
|
+
in engine `v1.6.1`), which maps them onto the engine's Pine-agnostic kernel.
|
|
130
130
|
See
|
|
131
131
|
the engine's [architecture notes](https://github.com/pineforge-4pass/pineforge-engine#architecture-kernel-vs-parity).
|
|
132
132
|
|
|
@@ -541,6 +541,7 @@ Generated C++ compiles only against the engine it was generated for:
|
|
|
541
541
|
| 1.4.0 (PyPI, 2026-10-08) | `v1.4.0` | Adds paired coded failures, corrected input manifests and collection lowering. C ABI 4 does not authorize a mixed pair. Regenerate and relink. |
|
|
542
542
|
| 1.5.0 (PyPI, 2026-10-12) | `v1.5.0` | Adds the nonfatal `note` diagnostic severity and diagnostic `user_message` templates. Regenerate and relink. |
|
|
543
543
|
| 1.6.0 (PyPI, 2026-10-17) | `v1.6.0` | Emitted C++ and the Python, JSON and diagnostic contract are unchanged since 1.5.0; test and comment cleanup only (#200, #201, #202). Regenerate and relink. |
|
|
544
|
+
| 1.6.1 (PyPI, 2026-10-18) | `v1.6.1` | Fixes emitted C++ for calendar built-ins called with `timezone=` and no positional `time`, and for `var` array initializers over unary-signed or mixed numeric constants (#205); the Python, JSON and diagnostic contract are unchanged since 1.6.0. Regenerate and relink. |
|
|
544
545
|
| Later `X.Y.Z` releases | `vX.Y.Z` of the same version | See below. |
|
|
545
546
|
|
|
546
547
|
On the 0.x line the engine and codegen versions are independent, and the
|
|
@@ -566,8 +567,8 @@ Pine as `strategy.pine`, write `strategy.generated.cpp` with the
|
|
|
566
567
|
[file example](#transpile-a-file-to-a-cpp) above, then from the same directory:
|
|
567
568
|
|
|
568
569
|
```bash
|
|
569
|
-
# 1.6.
|
|
570
|
-
git clone --branch v1.6.
|
|
570
|
+
# 1.6.1 pairs with engine v1.6.1. For 0.10.4 use v0.13.1.
|
|
571
|
+
git clone --branch v1.6.1 https://github.com/pineforge-4pass/pineforge-engine.git
|
|
571
572
|
cd pineforge-engine
|
|
572
573
|
cp ../strategy.generated.cpp tutorial/macd/generated.cpp # the tutorial's strategy slot
|
|
573
574
|
bash tutorial/run.sh # needs cmake, a C++17 compiler and python3
|
|
@@ -693,7 +694,7 @@ quote. The commercial-license store (coming soon) will take orders online.
|
|
|
693
694
|
|
|
694
695
|
## Explicit Pine execution attachment
|
|
695
696
|
|
|
696
|
-
This section describes the 1.6.
|
|
697
|
+
This section describes the 1.6.1 and engine `v1.6.1` pair. The Pine execution adapter is
|
|
697
698
|
the engine's full Pine execution runtime (`PineExecutionAdapter` and
|
|
698
699
|
`PineStrategyHost` in the engine's `src/source/`): order lifecycle, bracket
|
|
699
700
|
legs, fill-price and slippage rules, POOC / `calc_on_order_fills`, margin
|
|
@@ -716,9 +717,9 @@ Regenerate old generated C++ before using a new engine for Pine execution. C++
|
|
|
716
717
|
generated before the source-layer cut
|
|
717
718
|
([#129](https://github.com/pineforge-4pass/pineforge-codegen-oss/pull/129)),
|
|
718
719
|
0.10.4's included, derives from `BacktestEngine` and does not compile against
|
|
719
|
-
engine `v1.6.
|
|
720
|
+
engine `v1.6.1`; old cap-only C++ does not attach the priority rule, and
|
|
720
721
|
metadata cannot silently restore it. Rebuild all modules against the
|
|
721
|
-
new matching C++ layout (`engine_script_run_v19` in engine `v1.6.
|
|
722
|
+
new matching C++ layout (`engine_script_run_v19` in engine `v1.6.1`). Retaining
|
|
722
723
|
that epoch does not promise equal fingerprints, state hashes or trades across
|
|
723
724
|
releases. The extraction preserves Pine policy
|
|
724
725
|
under explicit attachment; it does not implement the generic native
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.6.1
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Public contract for 1.0
|
|
2
2
|
|
|
3
3
|
The supported Python/JSON contract began in 1.0.0; the sections below identify
|
|
4
|
-
later additions. This revision includes the 1.6.
|
|
4
|
+
later additions. This revision includes the 1.6.1 pair (2026-10-18).
|
|
5
5
|
|
|
6
6
|
Text marked **since 1.5.0** describes diagnostic additions that 1.4.0 and
|
|
7
7
|
earlier releases do not have: the `note` severity, the `user_message` template
|
|
@@ -173,6 +173,13 @@ class TypeHelper:
|
|
|
173
173
|
return TypeSpec.primitive("bool")
|
|
174
174
|
if isinstance(value, StringLiteral):
|
|
175
175
|
return TypeSpec.primitive("string")
|
|
176
|
+
if isinstance(value, UnaryOp):
|
|
177
|
+
if value.op == "not":
|
|
178
|
+
return TypeSpec.primitive("bool")
|
|
179
|
+
operand = self._array_from_element_spec(value.operand)
|
|
180
|
+
if operand is not None and operand.kind == "primitive" and operand.name in ("int", "int64", "float"):
|
|
181
|
+
return operand
|
|
182
|
+
return None
|
|
176
183
|
if isinstance(value, BinOp):
|
|
177
184
|
left = self._array_from_element_spec(value.left)
|
|
178
185
|
right = self._array_from_element_spec(value.right)
|
|
@@ -507,7 +514,20 @@ class TypeHelper:
|
|
|
507
514
|
elem = self._type_spec_from_hint(targs[0]) or TypeSpec.udt(targs[0])
|
|
508
515
|
return TypeSpec.array(elem)
|
|
509
516
|
if func == "from" and value.args:
|
|
510
|
-
|
|
517
|
+
elem_specs = [
|
|
518
|
+
self._array_from_element_spec(arg)
|
|
519
|
+
or self._pine_type_to_spec(self._visit(arg))
|
|
520
|
+
for arg in value.args
|
|
521
|
+
]
|
|
522
|
+
if any(
|
|
523
|
+
s is not None and s.kind == "primitive" and s.name == "float"
|
|
524
|
+
for s in elem_specs
|
|
525
|
+
) and all(
|
|
526
|
+
s is not None and s.kind == "primitive" and s.name in ("int", "int64", "float")
|
|
527
|
+
for s in elem_specs
|
|
528
|
+
):
|
|
529
|
+
return TypeSpec.array(TypeSpec.primitive("float"))
|
|
530
|
+
first_spec = elem_specs[0]
|
|
511
531
|
if first_spec is not None:
|
|
512
532
|
return TypeSpec.array(first_spec)
|
|
513
533
|
first = self._visit(value.args[0])
|
|
@@ -1373,6 +1373,13 @@ class TypeInferer:
|
|
|
1373
1373
|
slot populated; recover that exact scalar here rather than silently
|
|
1374
1374
|
defaulting ``array.from(string_udf())`` to ``std::vector<double>``.
|
|
1375
1375
|
"""
|
|
1376
|
+
if isinstance(node, UnaryOp):
|
|
1377
|
+
if node.op == "not":
|
|
1378
|
+
return TypeSpec.primitive("bool")
|
|
1379
|
+
operand = self._array_from_element_spec(node.operand)
|
|
1380
|
+
if operand is not None and operand.kind == "primitive" and operand.name in ("int", "int64", "float"):
|
|
1381
|
+
return operand
|
|
1382
|
+
return None
|
|
1376
1383
|
if isinstance(node, BinOp):
|
|
1377
1384
|
left = self._array_from_element_spec(node.left)
|
|
1378
1385
|
right = self._array_from_element_spec(node.right)
|
|
@@ -1527,12 +1534,30 @@ class TypeInferer:
|
|
|
1527
1534
|
node.name
|
|
1528
1535
|
)
|
|
1529
1536
|
if found_udt_binding:
|
|
1530
|
-
|
|
1531
|
-
TypeSpec.udt(exact_udt)
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1537
|
+
if exact_udt is not None:
|
|
1538
|
+
return TypeSpec.udt(exact_udt)
|
|
1539
|
+
local_cpp = getattr(self, "_current_func_local_types", {}).get(node.name)
|
|
1540
|
+
local_prim = {
|
|
1541
|
+
"int": "int",
|
|
1542
|
+
"int64_t": "int64",
|
|
1543
|
+
"double": "float",
|
|
1544
|
+
"bool": "bool",
|
|
1545
|
+
"std::string": "string",
|
|
1546
|
+
}.get(local_cpp)
|
|
1547
|
+
if local_prim is not None:
|
|
1548
|
+
return TypeSpec.primitive(local_prim)
|
|
1549
|
+
return None
|
|
1535
1550
|
if self._collection_name_is_lexically_shadowed(node.name):
|
|
1551
|
+
local_cpp = getattr(self, "_current_func_local_types", {}).get(node.name)
|
|
1552
|
+
local_prim = {
|
|
1553
|
+
"int": "int",
|
|
1554
|
+
"int64_t": "int64",
|
|
1555
|
+
"double": "float",
|
|
1556
|
+
"bool": "bool",
|
|
1557
|
+
"std::string": "string",
|
|
1558
|
+
}.get(local_cpp)
|
|
1559
|
+
if local_prim is not None:
|
|
1560
|
+
return TypeSpec.primitive(local_prim)
|
|
1536
1561
|
return None
|
|
1537
1562
|
sym = self.ctx.symbols.resolve(node.name)
|
|
1538
1563
|
if sym is not None:
|
|
@@ -1762,8 +1787,28 @@ class TypeInferer:
|
|
|
1762
1787
|
if targs:
|
|
1763
1788
|
return TypeSpec.array(self._type_spec_from_hint_name(targs[0]) or TypeSpec.udt(targs[0]))
|
|
1764
1789
|
if func_name == "from" and node.args:
|
|
1790
|
+
elem_specs = [
|
|
1791
|
+
self._array_from_element_spec(arg)
|
|
1792
|
+
for arg in node.args
|
|
1793
|
+
]
|
|
1794
|
+
if any(
|
|
1795
|
+
s is not None and s.kind == "primitive" and s.name == "float"
|
|
1796
|
+
for s in elem_specs
|
|
1797
|
+
) and all(
|
|
1798
|
+
(s is None or (s.kind == "primitive" and s.name in ("int", "int64", "float")))
|
|
1799
|
+
for s in elem_specs
|
|
1800
|
+
):
|
|
1801
|
+
return TypeSpec.array(TypeSpec.primitive("float"))
|
|
1802
|
+
if any(
|
|
1803
|
+
s is not None and s.kind == "primitive" and s.name == "int64"
|
|
1804
|
+
for s in elem_specs
|
|
1805
|
+
) and all(
|
|
1806
|
+
s is not None and s.kind == "primitive" and s.name in ("int", "int64")
|
|
1807
|
+
for s in elem_specs
|
|
1808
|
+
):
|
|
1809
|
+
return TypeSpec.array(TypeSpec.primitive("int64"))
|
|
1765
1810
|
return TypeSpec.array(
|
|
1766
|
-
|
|
1811
|
+
elem_specs[0]
|
|
1767
1812
|
or TypeSpec.primitive("float")
|
|
1768
1813
|
)
|
|
1769
1814
|
return TypeSpec.array(TypeSpec.primitive("float"))
|
|
@@ -2202,6 +2202,10 @@ class CallVisitor:
|
|
|
2202
2202
|
# ``color[] cs = array.from(c1, c2)`` declares
|
|
2203
2203
|
# ``std::vector<int64_t>`` and must construct one.
|
|
2204
2204
|
declared = self._collection_spec_for_name(target)
|
|
2205
|
+
if declared is None and getattr(self, "_active_func_name", None) is not None:
|
|
2206
|
+
declared = self._callable_var_collection_spec(
|
|
2207
|
+
target, self._active_func_name
|
|
2208
|
+
)
|
|
2205
2209
|
if (declared is not None and declared.kind == "array"
|
|
2206
2210
|
and declared.element is not None
|
|
2207
2211
|
and declared.element.kind == "primitive"
|
|
@@ -2408,13 +2412,16 @@ class CallVisitor:
|
|
|
2408
2412
|
and func_name in TIME_FIELD_EXPRS
|
|
2409
2413
|
and (node.args or node.kwargs)
|
|
2410
2414
|
):
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2415
|
+
bound = self._resolve_func_args(node, func_name)
|
|
2416
|
+
ts_node = bound.get("time")
|
|
2417
|
+
ts_arg = (
|
|
2418
|
+
self._visit_expr(ts_node)
|
|
2419
|
+
if ts_node is not None
|
|
2420
|
+
else "current_bar_.timestamp"
|
|
2421
|
+
)
|
|
2416
2422
|
ts_arg = self._coerce_int_slot(ts_arg, ts_node, "int64_t")
|
|
2417
|
-
|
|
2423
|
+
tz_node = bound.get("timezone")
|
|
2424
|
+
tz_arg = self._visit_expr(tz_node) if tz_node is not None else None
|
|
2418
2425
|
field_expr = TIME_FIELD_EXPRS[func_name]
|
|
2419
2426
|
if tz_arg is None:
|
|
2420
2427
|
# 1-arg form — fall back to ``syminfo.timezone`` per TV
|
pineforge_codegen-1.6.0/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.6.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/analyzer/call_handlers.py
RENAMED
|
File without changes
|
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/analyzer/diagnostics.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/capabilities.py
RENAMED
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/checked_settings.py
RENAMED
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/collection_history.py
RENAMED
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/constant_fold.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/helpers_syminfo.py
RENAMED
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/host_members.py
RENAMED
|
File without changes
|
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/order_shapes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/session_market.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/codegen/tv_number_format.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/diagnostics_catalog.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/request_feed_inventory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pineforge_codegen-1.6.0 → pineforge_codegen-1.6.1}/pineforge_codegen/timeframe_token_cli.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|