Skip to content

Commit 208f00b

Browse files
committed
docs: refresh ctest count + run_strategy usage example
- README + CONTRIBUTING + 2 docs/pages: ctest 16 → 30 (PR #13/#14/#15 added test_same_id_stop_replace, test_ta_rma_warmup, test_magnifier_real_bars, test_generic_matrix_bool_dispatch). - README parity probe section corrected: 5 parity probes + 1 anomaly probe (was 6 parity probes). - README Status section: added v0.2/v0.3 entries (VERSION 0.3.0 was invisible). - scripts/run_strategy.py: added --disable-trading-before-window usage example to module docstring. Audit notes (not implemented, future PRs): - No CHANGELOG.md (proposed). - README parity badge stuck at 167/168 (intentional public claim; bump in tandem with corpus submodule pin). - Missing -Wl,-force_load,libpineforge.a warning for ad-hoc clang++ rebuilds (real footgun, found via deep equity-mirror analysis). - No tests/README.md cataloguing the 30 binaries. - docs/site/html/ stale (next docs/build.sh run regenerates).
1 parent a7e12ae commit 208f00b

5 files changed

Lines changed: 18 additions & 10 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You'll need:
3636
- A C++17 compiler (GCC ≥ 9, Clang ≥ 10, Apple Clang ≥ 12)
3737
- Eigen 3.3+ (will be fetched automatically if not on system)
3838

39-
The full test suite — 16 binaries, 15 C++ + 1 pure-C ABI sanity test — completes in under a second. There is no slow-test tier; if your change makes ctest take more than ~10s, that's a regression.
39+
The full test suite — 30 binaries, 29 C++ + 1 pure-C ABI sanity test — completes in under a second. There is no slow-test tier; if your change makes ctest take more than ~10s, that's a regression.
4040

4141
## What changes are easy to land
4242

‎README.md‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ That's the entire integration. Every PineForge-compiled strategy `.so` exports t
109109
```bash
110110
cmake -B build -DCMAKE_BUILD_TYPE=Release
111111
cmake --build build -j
112-
ctest --test-dir build --output-on-failure # 16 tests, ~1 s
112+
ctest --test-dir build --output-on-failure # 30 tests, ~1 s
113113
bash tutorial/run.sh # full MACD backtest in 0.4 ms
114114
```
115115

@@ -134,15 +134,15 @@ The site auto-rebuilds on every push to `main` and every release tag.
134134

135135
PineForge is the **C++ runtime** that PineForge-compiled strategies link against. It implements PineScript v6 strategy semantics — order matching, fills, the magnifier, technical indicators, time/session math — as a static C++ library with a stable C ABI.
136136

137-
The runtime is parity-tested **trade-for-trade against TradingView's "List of Trades" CSV exports** on an internal reference corpus: **165 strict-excellent + 2 strong = 167/168 matching**, with **1 stress probe at the 1× margin boundary** that exercises an edge case where TV's published semantics are ambiguous. 168 total strategies = 162 reference + 6 parity probes under the canonical verifier. That corpus is **not shipped** in public checkouts; see **Contributing** / private `corpus` submodule below.
137+
The runtime is parity-tested **trade-for-trade against TradingView's "List of Trades" CSV exports** on an internal reference corpus: **165 strict-excellent + 2 strong = 167/168 matching**, with **1 stress probe at the 1× margin boundary** that exercises an edge case where TV's published semantics are ambiguous. 168 total strategies = 162 reference + 5 parity probes + 1 anomaly probe (equity-mirror, excluded from headline by default) under the canonical verifier. That corpus is **not shipped** in public checkouts; see **Contributing** / private `corpus` submodule below.
138138

139139
This repository ships:
140140

141141
- `libpineforge.a` — the static runtime library
142142
- `<pineforge/pineforge.h>` — the public C ABI (the canonical, stability-pinned consumer surface)
143143
- `<pineforge/*.hpp>` — the internal C++ headers (used by the closed PineForge transpiler; not part of the stability guarantee)
144-
- A 16-binary ctest suite (15 C++ + 1 pure-C ABI sanity test) that runs in CI on every commit (~81% line coverage of `src/` measured via `bash scripts/coverage.sh`)
145-
- `**corpus/`** (optional **git submodule**) — **168 reference strategies** (162 base + 6 parity probes) for maintainers who have access: each folder has `strategy.pine`, `generated.cpp`, `tv_trades.csv`, and `engine_trades.csv`, plus shared OHLCV under `corpus/data/`. Run `bash scripts/run_corpus.sh` after `git submodule update --init corpus`. Public clones omit this content.
144+
- A 30-binary ctest suite (29 C++ + 1 pure-C ABI sanity test) that runs in CI on every commit (~81% line coverage of `src/` measured via `bash scripts/coverage.sh`)
145+
- `**corpus/`** (optional **git submodule**) — **168 reference strategies** (162 base + 5 parity probes + 1 anomaly probe) for maintainers who have access: each folder has `strategy.pine`, `generated.cpp`, `tv_trades.csv`, and `engine_trades.csv`, plus shared OHLCV under `corpus/data/`. Run `bash scripts/run_corpus.sh` after `git submodule update --init corpus`. Public clones omit this content.
146146
- `[benchmarks/](benchmarks/)` — **three-way engine comparison** (PineForge ↔ [PyneCore](https://github.com/PyneSys/pynecore) ↔ [PineTS](https://github.com/LuxAlgo/PineTS)) on 50 strategies and 10 canonical indicators. The harness code and reports live here; **fixtures** (pinned OHLCV, every `strategies/`* folder with TV exports and trade CSVs) ship only via an optional **private `benchmarks/assets` submodule** — same confidentiality class as `corpus/`. With that init’d, `bash benchmarks/run_all.sh` reproduces the headline numbers with zero external API calls. PyneCore Python is official cloud-compiler output (no hand-ports). Headline: PineForge hits canonical *excellent* tier on 48/50 strategies vs PyneCore's 45/50; the 3 outliers are PyneCore-specific defects on bracket / trail / partial-exit semantics
147147

148148
## Coverage
@@ -178,7 +178,7 @@ cmake --build build -j
178178
ctest --test-dir build --output-on-failure
179179
```
180180

181-
Expect 16 tests to pass. The largest (`test_integration`, `test_request_security`) take a few hundred milliseconds; everything else completes faster.
181+
Expect 30 tests to pass. The largest (`test_integration`, `test_request_security`) take a few hundred milliseconds; everything else completes faster.
182182

183183
### Install
184184

@@ -258,7 +258,7 @@ src/ - implementation (~25 .cpp files split by concern)
258258
│ ├── ta_extremes_volume.cpp Highest/Lowest, OBV, AccDist, NVI/PVI/PVT, VWAP, ...
259259
│ └── ta_misc.cpp Linreg, PercentRank, BarsSince, ValueWhen, ...
260260
└── magnifier.cpp / matrix.cpp / session_time.cpp / str_utils.cpp / timeframe.cpp / timezone.cpp / math.cpp
261-
tests/ - 16 ctest binaries (15 C++ + 1 pure-C ABI sanity)
261+
tests/ - 30 ctest binaries (29 C++ + 1 pure-C ABI sanity)
262262
corpus/ - private submodule: 168 strategies (maintainers only); see CONTRIBUTING.md
263263
├── data/ - reference 36k-bar OHLCV feed (Binance ETH/USDT:USDT 15m)
264264
└── CMakeLists.txt - opt-in subproject that compiles every generated.cpp into strategy.so
@@ -349,7 +349,9 @@ for the full per-strategy table and methodology.
349349

350350
## Status
351351

352-
- v0.1 — initial public release. C ABI defined and pinned. Reported **165 strict-excellent + 2 strong = 167/168** TV parity on the internal corpus (private submodule, 168 strategies including 6 parity probes); the lone outlier is a 1×-margin stress probe on an undocumented TV edge case. 48/50 strategies hit canonical *excellent* tier in the three-way benchmark. CI runs on Ubuntu + macOS (ctest + install smoke; no corpus).
352+
- v0.1 — initial public release. C ABI defined and pinned. Reported **165 strict-excellent + 2 strong = 167/168** TV parity on the internal corpus (private submodule, 168 strategies including 5 parity probes + 1 anomaly probe); the lone outlier is a 1×-margin stress probe on an undocumented TV edge case. 48/50 strategies hit canonical *excellent* tier in the three-way benchmark. CI runs on Ubuntu + macOS (ctest + install smoke; no corpus).
353+
- v0.2 — same-id stop/replace deferred to post-bar OHLC resolution (PR #13); RMA warmup seed aligned to Pine reference formula, `-ffp-contract=off` build flag added (PR #14).
354+
- v0.3 — magnifier wrong-side gap fill fixed for entry bar; directional mintick rounding in `apply_slippage` (PR #15). ctest suite expanded to 30 binaries.
353355

354356
## License
355357

‎docs/pages/getting-started.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cmake --build build -j
2222
ctest --test-dir build --output-on-failure
2323
```
2424

25-
Expect 16 tests to pass. The largest (`test_integration`,
25+
Expect 30 tests to pass. The largest (`test_integration`,
2626
`test_request_security`) take a few hundred milliseconds; everything
2727
else completes faster.
2828

‎docs/pages/install.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ sudo cmake --install build --prefix /usr/local
1919
| Option | Default | Effect |
2020
| --- | --- | --- |
2121
| `CMAKE_BUILD_TYPE` | `Release` | Set to `Debug` for assertions and unstripped symbols. |
22-
| `PINEFORGE_BUILD_TESTS` | `ON` | Build the 16-binary `ctest` suite. Disable in package builds. |
22+
| `PINEFORGE_BUILD_TESTS` | `ON` | Build the 30-binary `ctest` suite. Disable in package builds. |
2323
| `PINEFORGE_BUILD_TUTORIAL` | `ON` | Build `tutorial/macd/strategy.so`. |
2424
| `PINEFORGE_BUILD_CORPUS_STRATEGIES` | `OFF` | Compile the private 168-strategy corpus (maintainers only). |
2525
| `PINEFORGE_ENABLE_COVERAGE` | `OFF` | Instrument runtime + tests for source coverage (Clang/GCC). |

‎scripts/run_strategy.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
3030
# All strategies (matches `bash scripts/run_corpus.sh`)
3131
for d in corpus/*/*/; do python scripts/run_strategy.py "$d"; done
32+
33+
# Warm indicators on pre-window bars but suppress order execution
34+
# until the comparison window opens (prevents warmup-period trades
35+
# from polluting engine_trades.csv in strategies with early signals):
36+
python scripts/run_strategy.py corpus/basic/greedy \\
37+
--disable-trading-before-window
3238
"""
3339
from __future__ import annotations
3440

0 commit comments

Comments
 (0)