From 5708993eb68466167bc259353cc0908f82764c65 Mon Sep 17 00:00:00 2001 From: luisleo526 <20812494+luisleo526@users.noreply.github.com> Date: Fri, 20 Nov 2026 18:47:00 +0800 Subject: [PATCH 1/2] Put the released 1.14.0 and 1.13.0 changelog sections under their version and date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 1.14.0 entries were still under the heading "Unreleased" after v1.14.0 was tagged, and the 1.13.0 heading had no date. The first heading now reads "1.14.0 — 2026-11-20" and the second "1.13.0 — 2026-11-18", the dates of the commits the two release tags point to, in the form the older headings use. Only these two heading lines change; no entry is edited or moved. --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bc42e54c..6dec1488c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ README's *Releases* section and on the GitHub releases page. From 1.0.0 the version number follows semantic versioning over the surfaces the [public contract](docs/pages/public-contract.md) lists. -## Unreleased +## 1.14.0 — 2026-11-20 - The engine layout stamp that `pineforge-live` checks, `PF_STREAM_ENGINE_LAYOUT_VERSION`, is now 5. A strategy module built against 1.13.x headers declares stamp 4 and is refused by a 1.14.0 `pineforge-live` before it is created (`strategy engine layout mismatch: module=4 runtime=5`): rebuild such modules against the matching 1.14.0 headers. The earlier miss, disclosed: 1.13.0 changed the same internal layout without raising the stamp, so a module built against 1.12.x headers and loaded into a 1.13.x `pineforge-live` was not refused; rebuild such modules against matching headers too. `PF_ABI_VERSION` stays 5, and the C API and its caller-allocated structures are unchanged. - A new host helper, `strategy_convert_identity_or_warn`, lets generated code report `strategy.convert_to_account` and `strategy.convert_to_symbol` calls that had no account-currency rate: the value still comes back unchanged, and the run's warnings now list `currency_conversion_rate_unavailable` once for each such call site (#376). @@ -287,7 +287,7 @@ version number follows semantic versioning over the surfaces the - `strategy_pending_order_fill_qty` reported a wrong `close_only` for some entries: 1 where the fill opens or reverses the position (a market entry followed by a priced stop on the same bar and a short-seed percent entry, #905; a pyramiding entry after a same-bar close; an entry probed inside the callback that queued it) and 0 where the fill only closes (a priced entry that replaced a same-id market order, a frozen reversal, whose reported quantity is now the frozen transaction, and a host-sized `strategy.order` against an opposite position). It now applies the fill's prior-cycle rule and shape rules for these cases. A `strategy.order` with its own quantity against an opposite position now reports the quantity its fill transacts, and `close_only` 1 exactly when that fill opens nothing. While a close the script placed on the same bar is still waiting to fill ahead of the order, the report instead gives the quantity as written, with `close_only` 0, or 1 when the order is in an OCA cancel group. That answer can differ from the fill: in an OCA cancel group it says `close_only` 1 although the fill opens if the close leaves the position flat; otherwise it says `close_only` 0 although the fill only closes if the close leaves a position at least as large as what the order transacts; and the fill can transact less than the quantity as written, for example when the quantity is floored to the quantity step, or when an OCA cancel-group order closes no more than the close leaves. The report is made before the fill and does not account for checks the fill makes at fill time against equity, price and margin (for example, an entry the account cannot afford in whole units). In those cases the fill can differ from the report. Not modelled: fill-time money guards (whole-lot tie, low-value or fractional lot), affordability, margin-call surplus, the close quantity a reversal keeps when a margin call was booked after the script, a refused signal price, an admission refusal, earlier fills of the same pass, and an entry that names its own quantity or a row whose request cannot be read, such as a row held in the source's shadow queue (judged by the prior-cycle rule alone). Fills are unchanged. (#905, #910) - The C header and docs documented partition 2 for a pure percent-of-equity stop; the engine returns 1 (measured on 1.13.0). The documentation now matches the returned value; behaviour and ABI are unchanged. -## 1.13.0 +## 1.13.0 — 2026-11-18 ### Changed From 035368777224c38bf6382ebb50beaa7acc6cf02f Mon Sep 17 00:00:00 2001 From: luisleo526 <20812494+luisleo526@users.noreply.github.com> Date: Fri, 20 Nov 2026 18:58:16 +0800 Subject: [PATCH 2/2] Count unmatched trades on both sides in every grading tier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The corpus grader counted unmatched trades net: one engine-only and one TradingView-only trade left the two list sizes equal, so a probe with a real trade mismatch could still grade excellent, and strong grading and fragmented-FIFO eligibility read the net difference of the list sizes. analyze_strategy now takes ONE gross count: the unmatched TradingView trades plus the unmatched engine trades of the gated pools (a zero-alignment input counts both lists). The excellent gate, the strong tier and the fragmented-FIFO eligibility all read it; the percentage is that count over the larger gated pool (at least one). Thresholds, matching and every other gate are unchanged. The net difference of list sizes stays in the report as net_count_abs_delta next to gross_unmatched_count, and the printed count line shows both. There is no exception for any strategy: verify_corpus.py --all exits 1 and lists every strategy graded below Strong or missing an input, unless the strategy declares an anomaly or an engine-only outcome. The tests run real parsed tapes through analyze_strategy and main: balanced unmatched trades on both sides, one-sided mismatches on each side, the threshold boundary at and just below the strong limit, fragmented-FIFO eligibility, zero-alignment inputs, and the aggregate and single-strategy exits. check_corpus_parity.sh, README.md and docs/ci.md record the headline measured on 2026-11-19 on corpus 93d956a2: excellent=303, strong=8, moderate=0, anomaly=1 (excellent=311, strong=0 under the net count); all 312 pinned strategy trade outputs still match the baseline hashes. The two CHANGELOG entries sit under a new "Unreleased" heading above the 1.14.0 section; the 1.14.0 entry that called the correction planned for a later release stays as that release shipped it. Refs: https://github.com/pineforge-4pass/pineforge-engine/issues/836 Documentation provenance: the verbatim originals of the README.md sentences that this change removes or rewrites. 1. README.md:309 (removed; replaced by the historical regrade paragraph) Known issue ([#836](https://github.com/pineforge-4pass/pineforge-engine/issues/836)): the parity scoreboard counts unmatched trades net instead of gross, so a probe with one engine-only and one TradingView-only trade still grades excellent; counted gross, 24 of the 7,989 graded probes (7,959 excellent and 30 strong instead of 7,983 and 6) and 10 of the 312 open reference probes (301 excellent instead of 311) grade one tier lower, with no trade list changed, and the corrected grader is planned for a release after 1.14.0. 2. README.md:319 (Public board result cell rewritten; the whole table row follows) | **Public** — [open corpus](https://github.com/pineforge-4pass/pineforge-corpus) | 312 reference strategies on BINANCE:ETHUSDT.P 15m, Apache-2.0, reproducible by anyone | this repository's sweep of the v1.0.1 library: **311 excellent + 1 declared anomaly**; the 309 of them in the measured population: **309 excellent** | 3. README.md:343 (excellent bullet rewritten: "the same number of trades" -> "zero unmatched gated trades on either side") - **excellent** — the same number of trades, ≥ 99% of TradingView's trades matched, the distinct-entry identity check passed, entry and exit prices within 0.01% and PnL within 1% at the 90th percentile (trailing-stop scripts are graded on the *production* profile: exits within 0.02% and PnL within 1%, since a trail fill depends on TradingView's sub-bar path); 4. README.md:344 (strong bullet rewritten: "trade count within 6%" -> gross count rule) - **strong** — ≥ 95% matched, trade count within 6%, entries within 0.1% and exits within 0.5% at p90; --- CHANGELOG.md | 5 + README.md | 19 +- docs/ci.md | 4 +- scripts/check_corpus_parity.sh | 11 +- scripts/test_verify_corpus_count_rule.py | 404 +++++++++++++++++++++-- scripts/test_verify_corpus_metrics.py | 164 ++++++++- scripts/test_verify_corpus_open_mark.py | 4 + scripts/verify_corpus.py | 65 +++- 8 files changed, 622 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dec1488c..56ae55b14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ README's *Releases* section and on the GitHub releases page. From 1.0.0 the version number follows semantic versioning over the surfaces the [public contract](docs/pages/public-contract.md) lists. +## Unreleased + +- Corrected the parity grading for the historical population reported in [#836](https://github.com/pineforge-4pass/pineforge-engine/issues/836) on 2026-11-11: counting unmatched trades net instead of gross overstated the excellent tier by 10 of 312 reference probes (311 instead of 301) and by 24 of 7,989 graded probes. The trade data is unchanged. Measured on 2026-11-19 on the pinned reference corpus (93d956a2): 303 excellent and 8 strong with one declared anomaly, where the net count gave 311 excellent and 0 strong; all 312 pinned trade outputs still match their baseline hashes. +- The corpus grader counts every unmatched gated trade on either side as a gross mismatch. One engine-only trade and one TradingView-only trade count as two mismatches, so equal list sizes cannot satisfy the excellent count gate. The same gross count, divided by the larger gated trade count (zero for two empty pools), supplies the percentage for strong-tier grading and fragmented-FIFO eligibility; thresholds are unchanged (#836). + ## 1.14.0 — 2026-11-20 - The engine layout stamp that `pineforge-live` checks, `PF_STREAM_ENGINE_LAYOUT_VERSION`, is now 5. A strategy module built against 1.13.x headers declares stamp 4 and is refused by a 1.14.0 `pineforge-live` before it is created (`strategy engine layout mismatch: module=4 runtime=5`): rebuild such modules against the matching 1.14.0 headers. The earlier miss, disclosed: 1.13.0 changed the same internal layout without raising the stamp, so a module built against 1.12.x headers and loaded into a 1.13.x `pineforge-live` was not refused; rebuild such modules against matching headers too. `PF_ABI_VERSION` stays 5, and the C API and its caller-allocated structures are unchanged. diff --git a/README.md b/README.md index 4cd15efb2..c0fe588c8 100644 --- a/README.md +++ b/README.md @@ -306,7 +306,7 @@ the affected scripts and how to recognise it. An `engineErrors` entry (the "engine errors" count above) is not always an engine failure: it can also be a probe that was not graded because its reference data is incomplete. Release 1.13.0 records one such entry, the open corpus probe `validation/ta-stochastic-rsi-cross-01`. -Known issue ([#836](https://github.com/pineforge-4pass/pineforge-engine/issues/836)): the parity scoreboard counts unmatched trades net instead of gross, so a probe with one engine-only and one TradingView-only trade still grades excellent; counted gross, 24 of the 7,989 graded probes (7,959 excellent and 30 strong instead of 7,983 and 6) and 10 of the 312 open reference probes (301 excellent instead of 311) grade one tier lower, with no trade list changed, and the corrected grader is planned for a release after 1.14.0. +The historical gross-count regrade recorded in [#836](https://github.com/pineforge-4pass/pineforge-engine/issues/836) measured **7,959 excellent / 30 strong**: 24 probes moved from excellent to strong and none lower. That regrade and the dated scoreboard above describe their recorded pair and population; they are not a fresh measurement of this revision. The grader uses gross counting. Recorded release results remain historical measurements. Release **1.4.0 (2026-10-08)** maps to **7,983 excellent / 6 strong** on 7,989 graded probes (baseline `pineforge-parity-baseline-20261007-engine-b3192bfc`, promoted 2026-10-07 UTC), with 0 below strong and 0 engine errors. These are recorded grading outcomes for that pair and population. @@ -316,9 +316,11 @@ The quantities above render from the public [facts tokens](https://github.com/pi | Board | Test set | Result | |---|---|---| -| **Public** — [open corpus](https://github.com/pineforge-4pass/pineforge-corpus) | 312 reference strategies on BINANCE:ETHUSDT.P 15m, Apache-2.0, reproducible by anyone | this repository's sweep of the v1.0.1 library: **311 excellent + 1 declared anomaly**; the 309 of them in the measured population: **309 excellent** | +| **Public** — [open corpus](https://github.com/pineforge-4pass/pineforge-corpus) | 312 reference strategies on BINANCE:ETHUSDT.P 15m, Apache-2.0, reproducible by anyone | reference sweep **2026-11-19** ([#836](https://github.com/pineforge-4pass/pineforge-engine/issues/836), [#883](https://github.com/pineforge-4pass/pineforge-engine/issues/883)): **303 excellent + 8 strong + 1 declared anomaly**; the 309 of them in the dated scoreboard above: **309 excellent** | | **Closed test** | 7,680 probes of 741 TradingView scripts across the 18 lanes: 680 community-shared scripts (7,179 probes), private under TradingView's Terms of Service, and 61 probe scripts the maintainers wrote (501 probes) | **7,674 excellent + 6 strong** | +Aggregate reference verification (`scripts/verify_corpus.py --all`) has no per-strategy exception ([#836](https://github.com/pineforge-4pass/pineforge-engine/issues/836)): it exits 1 and lists every strategy graded below Strong or missing an input, unless the strategy declares an anomaly or engine-only outcome. This reference measurement is separate from the dated scoreboard metadata above; baseline promotion requires its own verification. + ### Lane by lane @@ -340,10 +342,19 @@ The hard lane combines 309