You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d150f41
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+19-6Lines changed: 19 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ The separate PineForge compiler, [`pineforge-codegen`](https://github.com/pinefo
33
33
-**Open runtime.** The engine and native live runner are Apache-2.0. The separately distributed [PineForge compiler](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/LICENSE) is source-available under the PineForge Source License 1.2 from its release 1.3.0 (release 1.2.0 keeps the PineForge Source License 1.1, and releases up to 1.1.0 keep the PolyForm Noncommercial terms they shipped with); personal trading is free, and commercial use requires a separate license; the capital in an account a proprietary-trading firm or funded-trader program provides or allocates, including a challenge, evaluation or simulated account, is investment capital. Public reference strategies, benchmarks and validation tooling are available in their respective repositories; the community-script test set is not redistributed.
34
34
-**Fast.** In-process, no interpreter: median **36× faster than PyneCore** on the 200 strategies both engines time (100 corpus probes and 100 held-out private strategies), measured at engine `35db01c8` on 2026-09-29 on an AWS c7a.8xlarge with PyneCore timed as a subprocess, its interpreter start-up included (PineForge runs a median 807k bars/s per strategy over its 201 slots with the bar magnifier on; [method](benchmarks/results/speed.md)). Parameter sweeps re-run a loaded `.so` with new inputs — no recompile, no fork.
35
35
-**Deterministic to the bit.** Two runs with the same inputs produce identical trade lists.
36
-
-**Yours to embed.**167`PF_API` declarations across six installed headers — `pineforge.h`'s 111 (91 of the 102 runtime exports and up to 20 per-strategy functions a generated module defines), eleven more runtime declarations in `execution_observer.h`, `selected_window.h` and `report_sink.h` (three, three and five), `native_c_api.h`'s 43 native-host declarations and `selected_window_plan.h`'s two planner declarations — an ABI that is append-only within a major version from 1.0 on. Call it from C, Python, Rust, Go, Node, Julia — or let an AI agent drive it over MCP.
36
+
-**Yours to embed.**169`PF_API` declarations across six installed headers — `pineforge.h`'s 113 (93 of the 104 runtime exports and up to 20 per-strategy functions a generated module defines), eleven more runtime declarations in `execution_observer.h`, `selected_window.h` and `report_sink.h` (three, three and five), `native_c_api.h`'s 43 native-host declarations and `selected_window_plan.h`'s two planner declarations — an ABI that is append-only within a major version from 1.0 on. Call it from C, Python, Rust, Go, Node, Julia — or let an AI agent drive it over MCP.
37
37
38
38
Recorded outputs and their additional API declarations described here are
39
39
part of **1.5.0**.
@@ -129,6 +129,18 @@ The [shared local/CI verifier](docs/ci.md) includes source guards, tests and ins
129
129
130
130
Prerequisites: CMake ≥ 3.16 to build (the verifier and `ctest --test-dir` need 3.20), a C++17 compiler whose standard library has floating-point `std::to_chars` (libstdc++ from GCC 11 or later, or libc++ 14 or later; CI builds with GCC on Ubuntu 24.04), Eigen 3.3+ (fetched automatically if absent), Python 3 for the tests (`-DPINEFORGE_BUILD_TESTS=OFF -DPINEFORGE_BUILD_TUTORIAL=OFF` for a library-only build). `cmake --install build --prefix /usr/local` installs `lib/libpineforge.a` and `lib/libpineforge_kernel.a`, `include/pineforge/`, and the `find_package(PineForge)` config.
131
131
132
+
Script maps have no pair limit by default. Their entry arenas grow in steps of
133
+
4,096 slots over the spilling Store, and their bucket tables scale with capacity.
134
+
Map sizes and slot links use 64-bit integers.
135
+
Use `docker/run_json.py --limit-map-pairs 50000` for TradingView's pair policy;
136
+
omitted or zero selects unlimited. C callers install the same creation policy
137
+
with `pf_map_pairs_limit_set_checked` before the strategy factory and restore
138
+
NULL afterward. C++ callers can override one map with
139
+
`PineMap<Key, Value>::new_(maximum)`. A refused distinct insertion raises
140
+
`MapCapacityError` with `RE10070`, `maxSize`, `currSize` and `bar_index`, exposed
141
+
through the `pine_map_capacity_exceeded` run-failure code. Replacing an existing
142
+
key remains valid at the configured maximum.
143
+
132
144
### Prebuilt library
133
145
134
146
The [v1.3.0 release](https://github.com/pineforge-4pass/pineforge-engine/releases/tag/v1.3.0) attaches the library prebuilt: `pineforge-v1.3.0-linux-x86_64.tar.gz`, `pineforge-v1.3.0-linux-aarch64.tar.gz` and `pineforge-v1.3.0-macos-universal.tar.gz`, each with a `.sha256`. Each unpacks to one directory holding what the install above writes (the two archives, `include/pineforge/` and the `find_package(PineForge)` config) plus `LICENSE`, `NOTICE` and `VERSION`; point `CMAKE_PREFIX_PATH` at it. The package asks for Eigen 3.3+: install it on Linux, while the macOS tarball carries Eigen 3.4.0 ([install guide](docs/pages/install.md)).
@@ -529,11 +541,11 @@ is in [CHANGELOG.md](CHANGELOG.md).
529
541
530
542
The counts below describe the current API, including recorded outputs, the report sink and scratch-table selection; recorded outputs are not part of 1.4.0.
531
543
532
-
A newly generated strategy `.so` exposes 118 compiled-strategy `PF_API` declarations
533
-
(102 runtime implementations plus sixteen generated exports) plus 43 native-host
534
-
declarations: 161`PF_API` exports in total; `use_bar_magnifier = true` adds
544
+
A newly generated strategy `.so` exposes 120 compiled-strategy `PF_API` declarations
545
+
(104 runtime implementations plus sixteen generated exports) plus 43 native-host
546
+
declarations: 163`PF_API` exports in total; `use_bar_magnifier = true` adds
535
547
`strategy_declares_bar_magnifier` and a module that records [outputs](docs/outputs.md) its
536
-
three outputs exports, bringing the inventories to at most 122 and 165. Older modules lack the six opt-in
548
+
three outputs exports, bringing the inventories to at most 124 and 167. Older modules lack the six opt-in
537
549
[checked-settings exports](docs/checked-settings.md). Older modules can also lack
538
550
the two opt-in [execution-capability exports](docs/strategy-capabilities.md).
539
551
In an optimized build `nm -gU` also shows libc++'s
@@ -571,6 +583,7 @@ inventories are pinned by `scripts/check_c_abi_runtime.py`:
571
583
|`strategy_execution_contract` / `strategy_configure_native_v1` / `strategy_configure_native_fx_curve_v1` / `_fx_curve_ext_v1`| Query Legacy vs NativeMarketV1; apply the versioned native run specification (an invalid or refused base call returns `-1` and leaves the handle Failed; a cooperative `Aborted` handle may be reused with the same key and a higher run number); stage or clear an immutable native FX curve, `_fx_curve_ext_v1` also writing the typed refusal (`pf_native_fx_curve_error_e`) and the offending point's index |
572
584
|`strategy_request_abort` / `strategy_last_run_status`| Cooperative abort of a run in progress; `0`=completed, `1`=aborted |
573
585
|`strategy_set_scratch_tables_v1`| Copy disk-scratch or bounded-memory table policy and its eleven admission maxima while idle; NULL restores disk defaults (since 1.7.0) |
586
+
|`pf_map_pairs_limit_set_checked`| Set the calling thread's creation-time limit for distinct pairs in each map before the strategy factory; NULL or zero selects unlimited. Restore NULL after the factory; existing hosts retain their captured policy |
574
587
|`strategy_set_cache_policy_v1`| Copy optional per-kind resident cache bytes before run admission; omitted kinds use internal defaults, zero bypasses, and idle changes apply to the next run. See [memory controls](docs/pages/memory-management.md#memory_controls) for supported kinds |
575
588
|`pf_run_abort_install_sigterm_v1` / `pf_run_abort_requested_v1` / `pf_run_abort_restore_sigterm_v1`| Opt-in child invocation SIGTERM flag; stop after a completed input bar, retaining typed progress and an incomplete sink; install/restore with SIGTERM blocked |
576
589
|`strategy_set_realtime_tail`| Live-runtime surface (ABI v4): the array's last bar is a still-forming tail — `barstate.islast=false`, `last_bar_index`/`last_bar_time` frozen at the horizon bar, no range-end row |
- **[v1.7.0](https://github.com/pineforge-4pass/pineforge-engine/releases/tag/v1.7.0)** (2026-10-25) — report-sink transport, scratch-backed history and bounded storage admission, with new C++ views and command-line report routes. `get_trade()` and `closed_trade()` now return `Trade` by value, working-book, journal and cohort accessors return views, and some reads can throw on scratch I/O; closing a trade writes `TradeLedger` scratch even without a report sink, so a run needs a disk-backed `TMPDIR` or an explicit scratch directory; the C++ epoch namespace is still `engine_script_run_v19` although the layout of `BacktestEngine` changed, so rebuild every C++ object that includes an engine header, regenerate strategy C++ with the matching codegen and relink. Pair with [codegen 1.7.0](https://github.com/pineforge-4pass/pineforge-codegen-oss/releases/tag/v1.7.0). The known limits of this release (slower than 1.6.3 on some scripts, the closed-trade cache and its size by entry point) are in [CHANGELOG.md](CHANGELOG.md#170--2026-10-25), section "Costs that remain".
724
+
- **[v1.7.0](https://github.com/pineforge-4pass/pineforge-engine/releases/tag/v1.7.0)** (2026-10-25) — report-sink transport, scratch-backed history and bounded storage admission, with new C++ views and command-line report routes. `get_trade()` and `closed_trade()` now return `Trade` by value, working-book, journal and cohort accessors return views, and some reads can throw on scratch I/O; closing a trade writes `TradeLedger` scratch even without a report sink, so a run needs a disk-backed `TMPDIR` or an explicit scratch directory; the C++ epoch namespace was still `engine_script_run_v19` although the layout of `BacktestEngine` changed, so rebuild every C++ object that includes an engine header, regenerate strategy C++ with the matching codegen and relink. Pair with [codegen 1.7.0](https://github.com/pineforge-4pass/pineforge-codegen-oss/releases/tag/v1.7.0). The known limits of this release (slower than 1.6.3 on some scripts, the closed-trade cache and its size by entry point) are in [CHANGELOG.md](CHANGELOG.md#170--2026-10-25), section "Costs that remain". <!-- verified HEAD -->
712
725
-**[v1.6.3](https://github.com/pineforge-4pass/pineforge-engine/releases/tag/v1.6.3)** (2026-10-23) — CI, release-gate and test-only changes after 1.6.2: the engine's CI runs on the GCP fleet (`pf-gcp-pr`, `pf-gcp-main`), fork-gated; the PR wall is split from full-event verification (the CI split); a release requires full verify and parity green first (C2); the live test matches delivery receipts by request sequence; a session tape comment no longer names a private repository. Nothing under `src/`, `include/`, `cmake/` or `runner/` changed since v1.6.2, and in `docker/` only the run-failure code catalog diff (`run_failure_codes_diff.json`) did. Pair with codegen 1.6.3. See [CHANGELOG.md](CHANGELOG.md#163--2026-10-23).
713
726
-**[v1.6.2](https://github.com/pineforge-4pass/pineforge-engine/releases/tag/v1.6.2)** (2026-10-21) — selected-window contract revision `1.3` again, declared with the completeness proof (`capabilities.selected_window_contract_revisions: ["1.3"]` on a supported runtime and `[]` otherwise; 1.6.1 declared `1.3-parity`); proportional annualisation for runs shorter than a day, never null (short-run annualisation); the ownership probes fixed so proof B reads 118/118 and the ownership manifest-controls test sharded four ways; CI changes: Linux x64 jobs on the pf-ci-spot pool and release jobs on pf-ci-release, `timeout-minutes` removed, the actions of `promote-baseline.yml` pinned by SHA, the PR tier skipping the slow rows (D1). It ships the [v1.6.2-rc.1](https://github.com/pineforge-4pass/pineforge-engine/releases/tag/v1.6.2-rc.1) candidate (2026-10-19). Pair with codegen 1.6.2, regenerate and relink. See [CHANGELOG.md](CHANGELOG.md#162--2026-10-21).
714
727
- **[v1.6.1](https://github.com/pineforge-4pass/pineforge-engine/releases/tag/v1.6.1)** (2026-10-18) — selected-window contract revision `1.3-parity` (`capabilities.selected_window_contract_revisions: ["1.3-parity"]` on a supported runtime and `[]` otherwise) rather than `1.3` until a completeness proof exists (EN-115), with the four typed value-ownership codes (`strategy_value_invalid`, `engine_command_value_invalid`, `report_result_invalid` and `report_post_execution_failed`) emitted and value parity with the 1.4.0 reference on the tested cases; per-stage `startedAt` and `seconds` in `preflight-summary.json`; `noindex` on raw Doxygen source listings and their omission from `sitemap.xml`; verifier-tests sharded across parallel `unittest` subprocesses; the lower-feed timing ratio skipped only under AddressSanitizer. The C layouts stayed at ABI 4, `PF_ABI_VERSION` was still 4, the selected-window wire version stayed 1, the phase version 1 and the fingerprint/schema version 2. Pair with codegen 1.6.1, regenerate and relink. See [CHANGELOG.md](CHANGELOG.md#161--2026-10-18). <!-- verified HEAD -->
0 commit comments