Skip to content

Report timeframe fields restored; aggregated-chart admission no longer aborts (FIX-E1E2) - #299

Merged
luisleo526 merged 2 commits into
mainfrom
r5/fix-e1e2
Sep 29, 2026
Merged

luisleo526 merged 2 commits into
mainfrom
r5/fix-e1e2

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Two source-layer bugs, found by the pre-release docs audit running the documented examples.

E1: script_tf_ratio and needs_aggregation always read 0.

E2: a run on an aggregated chart aborted with admission receipt requires its exact earlier command.

  • Trigger: commission plus Pine v6's default 100 % percent-of-equity sizing, with process_orders_on_close or calc_on_order_fills, on a chart aggregated from a finer input.
  • Cause: the adapter built its sizing and review receipts from the script-bar index, while the command it names was recorded with the input-bar index. The two differ only when the chart is aggregated.
  • Fix: all admission receipts now carry the command's own bar index.
  • Second fix: the opening-fill notification also re-dates rows that a later fill in the same pass already closed. Before this, a trade that opened and closed on one aggregated bar was dated one bar late.
  • Test: synthetic TradingView tapes (test_aggregated_admission_receipt_tapes), replayed natively and aggregated from 15m and 5m. They match trade for trade.

Both fixes are in the source layer (src/source/). No kernel file changes. ADR 0001 rows record the fields the source layer now writes.

Evidence

  • Tests fail on main and pass here:
    • test_report_timeframe_ratio: 19 of 79 checks fail on main.
    • test_aggregated_admission_receipt_tapes: 8 of 66 fail on main, from the aborts.
  • A sibling scan of 7 scripts × 32 configurations, run natively and aggregated: 102 aborts on main, 0 here, 832 identical trade sets.
  • A population replay of 2,752 probes that use process_orders_on_close or commissioned percent sizing, plus 40 controls: 0 trade-set changes and 0 tier changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LifAW9e5J6gFx7gatuxETE

luisleo526 and others added 2 commits September 30, 2026 02:23
pf_report_t::script_tf_ratio and needs_aggregation read 0 on every run
since #254 (73817c1) retired the legacy scheduler, whose run_tf_impl set
both (pine_scheduler.cpp:1334-1335) and whose simple run set 1 / false.
The native scheduler computes the same ratio at run begin
(PineScheduler::run_begin) and now hands it to the report fields there,
for every run the Pine host begins: the bare run, the timeframe-aware run,
an auto-detected input, the magnifier, a stream. Report-only: no trade
moves.

test_report_timeframe_ratio runs each route and a reused host; at
35db01c it fails 19 of its 79 checks (every ratio and aggregation flag
reads 0). ADR-0001 gains the row the kernel-seam-rows gate asks for
(the timeframe report facts, report-only, outside the hashed region);
doc anchors into pine_scheduler_native.cpp carried through the line map
from 35db01c.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…mmand's bar

A run with Pine v6's default sizing (100 % of equity), a commission and
process_orders_on_close stopped on an aggregated chart with "admission
receipt requires its exact earlier command" (market_admission.cpp:26).
The adapter binds each entry command's admission observation to the row's
projection bar, the input slot (projection_bar_index). Since #289
(0d76a09) the kernel's public interval_index is the script bar, and the
receipts that follow a command kept reading it: the sizing revision a
margin call makes of a pending default-quantity entry
(refresh_pending_sizing_after_margin) and the three market reviews
(DefaultGross, ExplicitPair, TerminalGross). On an aggregated chart the
script bar is smaller than the input slot, so the receipt preceded its own
command and Draft::sizing_revised / reviewed threw. The terminal review of
a process_orders_on_close pair of fixed-quantity calls at pyramiding 0 hit
the same check with no commission or percent sizing at all. Every receipt
now carries projection_bar_index(context); on a chart run the two indices
are equal.

With the pair's terminal review running on an aggregated chart, its
same-bar round trips were dated at the next bar's open: the reversing call
closes the first leg's lot before the first leg's own notification re-dates
it to the chart bar's open (PineStrategyHost::on_native_applied). The
opening notification now also re-dates the rows a later execution of the
same pass booked from its lot.

TradingView's tapes of two synthetic probes written for this lane
(tests/fixtures/aggregated_admission_receipt, BINANCE:ETHUSDT.P 60,
lab tv --no-note): test_aggregated_admission_receipt_tapes replays both on
the chart's bars and aggregated from 15 and from 5 minutes. At 35db01c the
four aggregated rows stop with the receipt error (8 of 66 checks fail);
with the receipts alone the pair's aggregated rows misdate eight round
trips (16 of 150 fail); all 150 pass.

ADR-0001's row of the kernel-row fields the Pine host amends names
Trade::entry_time. Floors: RELEASE_MIN_TESTS 792 and EXCLUDED_REGISTERED_MIN 773/773/782 for
the lane's two rows; doc anchors into pine_adapter.cpp and
pine_strategy_host.cpp carried through the line map from 35db01c, and the
RELEASE_MIN_TESTS citations to its new line.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@luisleo526
luisleo526 marked this pull request as ready for review September 29, 2026 19:42
@luisleo526
luisleo526 merged commit 4dc496d into main Sep 29, 2026
16 checks passed
luisleo526 added a commit that referenced this pull request Sep 29, 2026
…GINE) (#300)

Audit of every README and doc page of pineforge-engine against engine main
35db01c and the live measurement; each change names its source.

What was wrong, and the source of the truth:

- Parity numbers were the retired 4,190-probe round-39 era (badges, hero,
  scoreboard, lane table, contributing-llm.md, design/progress pages). Now the
  active baseline pineforge-parity-baseline-20260929-engine-35db01c8 (snapshot
  sha256 47cec517..., population cf857209...): 8,006 probes, 7,989 graded =
  7,905 excellent + 84 strong, 17 TradingView-side anomalies excluded,
  18 lanes, 2,759,431 TradingView trades (population tvTradeRows / 2). The
  "2.8M matched" count has no source in the snapshot and is gone. Public
  corpus: 311 excellent + 1 declared anomaly (scripts/check_corpus_parity.sh
  pinned headline; parity step of the XAU-CAL lane job on this tree), and
  anomaly-equity-mirror-strategy-equity-01 is that anomaly (it does not
  match trade-for-trade on the pinned corpus).
- Versions: no 1.0.0, 0.14.0 or rc tag exists (git tag; gh release list).
  CHANGELOG's "## 1.0.0" becomes "## Unreleased" and lists #292-#298, which
  it lacked (squash messages 7f807b9..35db01c); "34 more" PF_API is 39.
  README Releases: v0.13.1 entry added, v0.13.0 line corrected, the merged
  live/abi-v4 "Unreleased" line and the 1.0.0 line replaced. Pages that
  framed 1.0 as shipped now say planned.
- Front door 1 could not run: pineforge-codegen has no CLI (0.10.4 or main),
  PyPI 0.10.4 output does not compile against main (cc log), a plain
  -lpineforge link drops the runtime C ABI (run_strategy.py refuses it), and
  run_strategy.py needs --ohlcv/--no-trim-output without the corpus. The new
  block ran end to end from a clean clone (14 trades on the tutorial feed).
- Prerequisites: floating-point std::to_chars (src/str_utils.cpp:55) needs
  GCC 11 / libc++ 14; ctest --test-dir needs CMake 3.20; examples need
  -DPINEFORGE_BUILD_EXAMPLES=ON; the install also ships libpineforge_kernel.a.
- MCP section: the image, hosted server and npm package run engine 0.13.1 +
  codegen 0.10.4 (pineforge-release v0.1.25 notes); hosted server and npm
  package descriptions corrected from their live/ published sources.
- Benchmarks: every number reproduces (check_provenance 163/163); framing
  fixed (commit and method named, PineTS has had strategy.* since 0.9.17),
  recipes state their prerequisites, two wrong failing-gate cells fixed,
  personal host name scrubbed from 14 Google Benchmark JSONs with the
  manifest sha256 values updated (origin_sha256 keeps the measured file).
- Reference pages: native-engine.md, pine-to-native.md, coverage.md,
  pine_v6_coverage_detail.md, the contract pages, ci.md and the design notes
  described removed members and pre-#253/#254 behaviour, stale counts
  (src 48 -> 53 .cpp, 66 -> 70 indicator classes, 43/33/10 -> 46/35/11
  NativeRunSpec fields, floors 786/298 -> 790/300), wrong anchors, drawings
  as absent, and transpiler status of an old codegen (now "on codegen main,
  not in a release yet" where it differs from v0.10.4).
- Hygiene: internal host names, personal paths, private-repo references and
  campaign tool names marked or removed; the banner image's stale
  "V0.8.0 / 245/246 / 0 engine bugs" strip removed; a dead
  pineforge-workflow-live link replaced by the public pineforge-live repo.
- Two orphan pages, docs/cheatsheet-runtime-and-execution.md and
  docs/tv-parity-probe-spec.md, were wrong in their load-bearing claims
  (17 removed engine members, pointvalue/FX/slippage claims) and nothing
  linked them: deleted.
- Sample outputs were stale: every page and the tutorial README printed the
  tutorial MACD as 49 trades / -190.85; since 650b0cb (in v0.13.1) the report
  counts the range-end close, and every harness prints 50 / +569.97 (runs on
  a clean clone of this branch). examples-python-sweep.md's 10000 capital
  could not pay for its 1-BTC order (every combo 0 trades): 100000, output
  re-measured. examples-multi.md output format matches multi.py; the
  magnifier A/B page shows today's run. The report fields script_tf_ratio
  and needs_aggregation print their contract values again on this base
  (FIX-E1E2, #299; tutorial/run_mtf.py Table A: ratio 1/1/4/16, agg
  0/0/1/1), so the pages state them as plain facts.
- Doxygen: `file:line` in four pages autolinked to a dead "file:line" URL;
  spelled `path:line` now. Build: 0 warnings.

Review fixes (REVIEW-DOCS-ENGINE-final.md, verdict MERGE-WITH-FIXES, of the
first version of this change, 79bd84c1 + 6cb01aa0): its five P2 findings with
the reviewer's fix text, and every P3 row but the last.

P2
1. docs/pages/metrics.md: a timestamped FX curve no longer fails closed for a
   leveraged position across a rate change; that position takes the
   broker-open margin checkpoint at the step bar's open
   (tests/test_affordability_fx.cpp:152-154, :781).
2. docs/pages/report-schema.md: the #254 caveat sat inside the table, so the
   bar_magnifier_enabled row rendered as text; it now follows the table.
3. CONTRIBUTING.md, docs/pages/getting-started.md: compiler minimums are the
   ones README.md states (floating-point std::to_chars, src/str_utils.cpp:55:
   libstdc++ from GCC 11, libc++ 14, macOS 13.3; g++-9 and g++-10 fail).
4. docker/README.md: the sample is the published image's run (50 trades,
   17/33, +569.97, trade 1 entering 1777488300000).
5. docs/pages/mtf.md: expected Table A says main prints 0 in ratio and agg?
   until the #254 regression is fixed.

P3
- configuration.md, CHANGELOG.md, coverage.md: v5 scripts do not "keep" host
  defaults (both codegens refuse //@Version=5); code from an earlier codegen
  and a hand-built PineStrategyConfig do.
- streaming.md: "Every strategy_stream_* call above" (create/free return no
  status).
- examples-multi.md: a module also exports std::piecewise_construct.
- integration-cmake.md: EXACT 0.13.1 also matches a git-checkout build of
  main; the ABI promise starts "From 1.0.0".
- ffi-python.md, tutorial-macd.md: the mirror covers the report structs, not
  every struct (ffi-python.md:15-17).
- configuration.md: tracing costs one branch per traced call when disabled
  (report-schema.md:180), not zero.
- benchmarks/results/raw/README.md: "Two edits were made" (host_name was
  rewritten in every Google Benchmark file); benchmarks/README.md: the
  maintainer fetch runs with the campaign environment sourced. Wording only.
- AGENTS.md: the configure line exports compile commands, which the receipt
  check needs; AGENTS.md and docs/ci.md: promote-baseline.yml is installed
  from the campaign copy, not unchanged (31 lines differ).
- docs/ci.md: the debug profile also skips the twin-parity guard
  (TWIN_PARITY_PROFILES).
- mtf.md, timeframes.md: "reported for an engine fix" dropped (no public
  issue).
- native-feature-parity.md: the C API "landed on main", not "shipped".
- tutorial/README.md: Table B's script_tf_ratio prints 0 on main until the
  #254 regression is fixed.

Not changed here: benchmarks/results/summary.md and trade_comparison.md keep
the first version's text (hand edits of generated output; fixing the generator,
benchmarks/compare.py:361 and scripts/verify_corpus.py:1403, is an
engine-lane follow-up). No benchmark number or results file changes beyond
the raw/README.md and benchmarks/README.md wording above: BENCH-REFRESH is
re-measuring the benchmark.

Rebased onto 4dc496d (FIX-E1E2, #299), squashed to one commit. docs/ci.md
states the new floors: PR registration 773 (debug, sanitizers) and 782
(native), full-run release 792 and kernel 300 (scripts/ci_verify.py:320,
:594, :638). The one rebase conflict, a native-refactor-progress.md row,
keeps main's re-anchored lines and this change's host-name removal.

Sentences this commit deletes or rewrites past recognition, named by the
commit that introduced them (scripts/check_doc_reverts.py):
- a4ab775 (docs: source-verified runtime-overrides + order-execution cheatsheet): cheatsheet-runtime-and-execution.md (142)
- 480fd19 (Production-readiness probes + engine state-reset / finite-fill fixes (): tv-parity-probe-spec.md (61)
- 28ad088 (docs: add Part 3 (cross-cutting behaviors) to engine cheatsheet): cheatsheet-runtime-and-execution.md (60)
- a8f84b9 (docs(api): OpenCV-style C ABI reference site + CF Pages deploy): abi-stability.md (21), tutorial-macd.md (3), examples-magnifier.md (2), examples-multi.md (2), getting-started.md (2), index.md (2), report-schema.md (2), examples-rust.md (1), ffi-python.md (1), install.md (1), lifecycle.md (1)
- cc4a56e (docs: add Pine v6 runtime coverage report (docs/coverage.md)): coverage.md (37)
- 24dcc53 (docs: reconcile Pine v6 audit + coverage docs with the 2026-06-10 audi): pine_v6_coverage_detail.md (29)
- d093560 (INT26: wave H, the late picks and the corpus re-pin to b40aa8e (1.0.0-): native-refactor-progress.md (13), install.md (3), pine-to-native.md (2), CONTRIBUTING.md (1)
- 73817c1 (Lower generated Pine execution onto the native kernel and retire the l): cheatsheet-runtime-and-execution.md (8), README.md (3), tv-parity-probe-spec.md (2), reservation-expansion-candidate.md (1)
- b1fbf0b (docs: detailed Pine v6 coverage report (per-identifier audit)): pine_v6_coverage_detail.md (14)
- 622d653 (docs(README): rewrite for the round-11 engine — brand-first, OSS-first): README.md (12)
- 46b2ced (docs: ABI v4 live surface; cheatsheet corrections (trail_price is read): cheatsheet-runtime-and-execution.md (7), README.md (3), live-surface.md (2)
- c45cf5a (refactor: move retained-parent priority into Pine compatibility): README.md (7), pine-order-priority-boundary.md (4)
- c1084ff (docs: record round 39 fractional price admission parity): README.md (10)
- f268342 (feat: add historical account FX lifecycle (#125)): cheatsheet-runtime-and-execution.md (10)
- af4c688 (Document realtime streaming lifecycle): cheatsheet-runtime-and-execution.md (5), coverage.md (3), examples-python-sweep.md (1), tutorial-macd.md (1)
- 9507d8f (refactor(corpus): pull equity-mirror into corpus/parity-anomalies/): coverage.md (10)
- 76482e6 (fix(runtime): align TA coverage and corpus replay): coverage.md (9)
- cc0b22d (Refactor reservation growth and Pine market instruction ownership): fill-model.md (7), frozen-market-instruction.md (2)
- d5a5eaf (Align lifecycle and admission documentation with final v11 model): market-admission.md (9)
- a6b0b70 (docs(audit): exhaustive Pine v6 coverage audit — 38 critical, ~62 mino): pine_v6_audit_master.md (7)
- 1e360bd (INT27: wave I -- magnifier on TradingView's intrabars, recalculation f): cheatsheet-runtime-and-execution.md (5), magnifier.md (1)
- 1dd5430 (Add the native feature-parity design: gaps, kernel-vs-adapter rulings,): design/native-feature-parity.md (6)
- 74491fa (INT28: wave-J engine integration (TVDEF-DROPS, W3/W3B/W4/W5/W6/W6B/W8,): cheatsheet-runtime-and-execution.md (4), README.md (1)
- 7ad5d38 (docs: refresh parity scoreboard through round 23): README.md (5)
- 7f807b9 (Another symbol's bars reach a run as a feed: kernel instrument feeds +): coverage.md (4), mtf.md (1)
- 3b13183 (Refactor order admission and trigger lifecycle into generic submodels): exit-leg-lifecycle-reflection.md (5)
- e244d65 (docs(coverage): update pine_v6_coverage_detail.md for post-sprint stat): pine_v6_coverage_detail.md (5)
- f864be5 (refactor: isolate Pine cap policy from native order state): cheatsheet-runtime-and-execution.md (2), pine-intraday-cap-boundary.md (2)
- e7cdf05 (Add native execution terms: host-resolved sizing, exact reversal, prec): abi-stability.md (2), native-engine.md (2)
- b4dd9a3 (docs(mtf): add multi-timeframe tutorial + Doxygen page): mtf.md (4)
- 5c2be9d (docs: record round 38 whole-lot budget parity results): README.md (3)
- 6bfe983 (docs: align round 39 lane table and diagnostic evidence): README.md (3)
- 471a113 (Docs: the README carries the 200-strategy refresh -- tiers per engine ): README.md (3)
- 8df08f2 (fix(engine): make dead strategy.close semantically inert (#143)): cheatsheet-runtime-and-execution.md (3)
- d3cca9e (Docs: correct migration semantics and harden publication guards): cheatsheet-runtime-and-execution.md (2), pine-to-native.md (1)
- 52f4dde (Preserve complete mirror context and earlier standalone ABI controls): fill-model.md (3)
- 4fb9db3 (Docs: CONTRIBUTING.md rewritten for someone who has never seen this re): CONTRIBUTING.md (2)
- 2ab2bfb (docs(README): round-11 closed-test results and a full factual refresh): README.md (2)
- 0501468 (docs: task-13 fix round 1 — v4 report mirrors (schema, Rust), probe-su): README.md (1), cheatsheet-runtime-and-execution.md (1)
- cfbe677 (Docs: the session flags end a session where TradingView ends it (R5 la): cheatsheet-runtime-and-execution.md (2)
- 6aa1d13 (runtime: wire syminfo.pointvalue through all money paths; hold ScopedT): coverage.md (2)
- 8b7965a (Docs: onboarding written for the contributor who is a language model (): contributing-llm.md (2)
- 16f3652 (Docs: the two site front doors re-derived against HEAD (R5 lane L14-B,): index.md (2)
- 04b0588 (Add native resolved execution settlement and preserve paid entry costs): metrics.md (2)
- 149f77c (Replace seven pending-order flags with quantity and event facts): quantity-intent.md (2)
- 962960b (Session flags match TradingView on multi-window and extended-hours cha): pine_v6_coverage_detail.md (2)
- 5215291 (Merge branch 'round5/bar-indexed-extremes-ring' into round5/candidate): pine_v6_coverage_detail.md (2)
- b1b27f0 (Initial commit: PineForge runtime v0.1.0): CONTRIBUTING.md (1)
- bfdbe96 (docs: refresh parity scoreboard through round 24): README.md (1)
- cda51d5 (Record the round 35 parity scoreboard and raw trade gains): README.md (1)
- 0d76a09 (Wave G: no ordinary quantity request stops a run, cancelled exits stay): adr/0001-kernel-adapter-boundary.md (1)
- 0983770 (Unify remaining fill paths under native settlement (#247)): ci.md (1)
- 50339d0 (Docs: the §1 inventory carries its closure markers, and a gate keeps t): design/native-feature-parity.md (1)
- 8b3b481 (docs+fix: org rename to pineforge-4pass; AI capability-gap note in REA): examples-multi.md (1)
- c28c2db (Derive placement state from original admission observations): fill-model.md (1)
- 208f00b (docs: refresh ctest count + run_strategy usage example): install.md (1)
- 0c174d9 (Docs: the arm options, the adoption table and the grid re-lowering wai): native-engine.md (1)
- 4b05b62 (Adapter re-lowering: the TradingView margin call runs through the kern): native-engine.md (1)
- 8e558eb (Say what the per-bar broker hash is for, where its API is documented (): native-engine.md (1)
- 5f3299d (Build the standalone native execution path (#243)): native-engine.md (1)
- b18f75e (Native sizing bases and fractional reduces (R5 lane L3)): native-engine.md (1)
- 0ef00da (The pages say a working row tells an absent arm from an arm at 0.0 (R5): native-engine.md (1)
- 7328f4d (Docs: the migration page is a complete map, and a gate holds it comple): pine-to-native.md (1)
- ce64f06 (docs(audit): update Pine v6 master audit — mark 20 resolved critical i): pine_v6_audit_master.md (1)
- a19f5a8 (docs: repoint codegen references to pineforge-codegen-oss; purge old f): pine_v6_audit_master.md (1)
- 2db58d9 (runtime: reconcile per-trade MFE/MAE with TV excursion semantics; gate): pine_v6_audit_master.md (1)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
luisleo526 added a commit that referenced this pull request Sep 30, 2026
…e -- 36x over PyneCore 6.10.3 on that host; 35db01c takes 0.35x the time of 063e446 there

The timing window (2026-09-29, 20:36-23:27 UTC) ran on a dedicated AWS
c7a.8xlarge (AMD EPYC 9R14, 32 cores, SMT off, Ubuntu 24.04), nothing else on
it: the Mac the 2026-06-11 and 2026-09-22 tables were timed on (Apple M4 Max)
never got quiet (load 28-40 from Spotlight reindexing, a VM and other
projects), and a shared NVIDIA GB10 was given up once another supervisor's
suites started there (its partial timings are a cross-check only, not
published). Times from different hosts are not compared; every comparison
the READMEs print was measured in this window.

Measured (results/raw/2026-09-29-35db01c8, manifest.json):
- PineForge 35db01c with generated.cpp from codegen 121b3e6a, magnifier on,
  pinned to one core: median 66.8 ms per strategy, 807k bars/s (505k-1133k).
  Build g++ 13.3 Release; its 201 trade lists on this host are byte-identical
  to the graded (Mac) ones.
- PyneCore 6.10.3, 8 concurrent on eight pinned cores: median 2,629 ms, 200
  slots (192 has no strategy_pyne.py; 143 ran all 20 runs). Median speedup
  36x (p5 15x, p95 131x); vectorbt 13 ports 209.3 ms (4.2x); PineTS
  1416.2 ms.
- Same-window A/B, all 201 slots, each engine on its own generated.cpp,
  new/old/old/new: 35db01c takes 0.35x the time of 063e446 at the median
  (p10 0.28, p90 0.50), faster on all 201. A perf profile of two slots shows
  063e446's per-bar continuation-hash fold, event-journal scans,
  dynamic_cast and out-of-line accessors, none of which 35db01c keeps.
- The 2026-06-11 engine, rebuilt there: 4-8x faster than 35db01c on its
  three probes. PyneCore 6.10.3 vs 6.10.2 on 26 public slots: 1.01x.
- Throughput package: five runs 0.782/0.786/0.778/0.779/0.777 M bars/s; run 4
  published (0.78). A first run 1 was stopped: reproduce.sh's configure found
  the fetched Eigen as a system package, changed every compile command and
  began rebuilding the tree on the pinned core. After an all-core rebuild
  (then a no-op), identical trade lists, and a recheck of the 26 A/B slots
  (1.00x), the five runs built nothing.
- Every batch passed the quiet gate (load < 6, no build/test process, the
  pinned cores idle); gate.tsv and a load trace per batch are committed.

Harness: aggregate.py takes the timing host's facts (--host host.json) and
prints the busiest pinned core per batch; check_provenance.py derives the new
headline from the window (the host line, the host change, the 201-slot A/B,
the PyneCore release A/B, the 2026-09-22 table read from 35db01c, the tier
changes against its summary.md, the June engine on this host) and drops the
cross-host comparisons; test_check_provenance.py reads its targets from the
README.

Docs: benchmarks/README.md headline, non-excellent rows (PineForge none;
PyneCore 63, the window explanation re-measured, the multi-timeframe rows
after 6.10.3), methodology (pins in the timed run, pinning, same-host
comparisons), Fairness (the 2026-09-24 strategy() defaults the tapes predate);
the engine README's speed badge, the Fast bullet and the cross-engine
section; throughput/README.md and results/raw/README.md for the new window.

Rebased onto main 112c134 (DOCS-ENGINE b2a578c #300, 7d33942 #301, 112c134
#302). The engine README keeps main's text outside the speed badge, the Fast
bullet and the cross-engine section, #302's counts and badges included. The
Fast bullet keeps b2a578c's framing (engine, date, PyneCore timed as a
subprocess with its interpreter start-up) with this window's numbers, and
names both populations: the speedup's 200 strategies and the bars/s median's
201 slots. The section keeps b2a578c's PyneCore-sources paragraph and its
"main has moved on since" clause (4dc496d, #299, changed src/ after
35db01c, and nothing was re-measured on it). Its PineForge paragraph names
the engine and codegen the tiers were graded at, and its vectorbt bullet
keeps b2a578c's form with this window's numbers: a 4.2x median per-strategy
speedup, and vectorbt is still faster on 2 of the 13 (021, 064).
results/raw/README.md's Edits section replaces the paragraph b2a578c wrote
(and the previous commit extended) with one paragraph per window.

Sentences this commit deletes or rewrites past recognition in README.md,
named by the commit that introduced them (scripts/check_doc_reverts.py):
- 471a113 (the README carries the 200-strategy refresh, lane BENCH2): 7 --
  the strong row 181 and its extra trade, "to the tick", the compile
  rejection, the three runtime errors, 143 "could not be timed", and "the
  ratio fell because the engine is slower per bar".
- a02160f (PineForge re-timed at engine 063e446, lane BENCH3): 3 -- the
  speed paragraph's host, engine and window.
- f867096 (the multi-timeframe PyneCore rows reproduce 0-85.5 %, lane F10): 1
  -- the nine multi-timeframe scripts, rewritten for 6.10.3.
- b2a578c (make every README and doc page true before the release,
  DOCS-ENGINE, #300): 1 -- the 2026-06-11 engine "still runs close to its
  June timings", measured on the Apple M4 Max; this window's same-host
  timing of that engine replaces it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
luisleo526 added a commit that referenced this pull request Sep 30, 2026
…des #303, #304, #307) (#308)

* Tests: the lookup-index scaling row times its two tapes in turn, in user CPU (lane pf-perf-scale)

Engine CI failed test_adapter_lookup_index_scaling's applied-reversals
ratio on main at 35db01c (run 36554781580 attempt 1: 5.50, 6,000 bars
0.1179 s, 24,000 bars 0.6488 s) and 4dc496d (run 36621162191: 5.31,
0.2432 s, 1.2927 s). Not a regression: the same trees passed on the same
runner class -- 35db01c's re-run 3.97 (0.1178 s, 0.4672 s), XAU-CAL's PR
head 27c2d8e (same tree) 4.01, FIX-E1E2's PR head b045b96 (same tree as
4dc496d) 3.64 (0.2375 s, 0.8642 s). The small block matched; the large
block ran 39 and 50 % dearer. 32 earlier main/PR Release runs read
2.81-4.38 (ci-diagnostics LastTest.log).

On idle spark cores (pinned, base/XAU-CAL/head in turn, 12 runs each):
0411892 / 35db01c / 4dc496d read 3.85-3.94 / 3.89-3.93 / 3.91-3.97
(Cortex-A725, CI's 6,000 / 24,000 bars) and 4.03-4.07 / 4.03-4.05 /
4.04-4.07 (Cortex-X925, 24,000 / 96,000); the reversal leg costs
104,512 -> 104,322 user instructions a bar from 6,000 to 96,000 bars at
all three (perf stat instructions:u), the bracket leg ~66,300 flat. XAU-CAL
adds no per-bar lookup on this path: day_label_origin returns at once with
no day labels, and prepare_day_labels returns before any work for a
non-"D" script.

The row timed its legs in blocks (five small runs, then five large), so a
load that rises after the first small run and before the first large one
ends slows the large block alone. It now times the tapes in turn, the
large tape first and last (six rounds, the order alternating): no single
rise or fall of the load gives the small tape a quiet sample the large one
lacks. Migrated from a Cortex-X925 to a Cortex-A725 core (2.3x the CPU a
bar) 1.25-7 s into the row, the unchanged row failed for a move 1.75-3 s
in (5.93-9.26, 6 of 24) and this one for none (at most 4.04). The legs
are timed in user CPU (ratio_timing::user_cpu_seconds, as INT27 did for
the lower-lookup row) because the in-turn order moves the allocator's page
faults between the tapes: process CPU read in-turn at 4.13 against the
blocks' 4.00, user CPU 4.04 against 4.01 (A725, 12,000 / 48,000 bars).

After (same spark cores, 12 runs each, unchanged/fixed in turn): reversals
3.90-3.97 -> 4.02-4.08 (A725), 4.02-4.06 -> 3.94-4.01 (X925); brackets
3.94-4.02 -> 3.99-4.04. Mutant sensitivity kept: with every adapter lookup
walking (kIndexedFrom unbounded) the fixed row reads 6.37-6.43 and fails,
the unchanged row 6.19-6.27. The bound stays 5. No src/ or include/
change.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* CI: skip heavy jobs on docs-only changes (lane pf-ci-docs)

A new first job, changes, runs scripts/ci_docs_only.py on the standard
runner and answers docs_only. A changed path is documentation when it is a
Markdown file or lies under docs/, unless it lies under .github/,
benchmarks/, scripts/ or tests/, is a CMake file, or is one of the four
files a proof job reads (docs/pages/pine-to-native.md and
docs/pages/native-engine.md, whose code blocks CTest rows compile and run;
ADR-0001, which test_kernel_residuals, test_native_feature_rulings and the
kernel profile's kernel-residuals stage read; docs/build.sh, whose retry
self-test is a CTest row). A pull request is its tested merge against the
base it merged into, a push is before..after; every doubt (a dispatch, a
created or forced push, a merge of another head, an unreadable commit, an
empty change, a failed classification) answers no.

Each proof job (the four build legs, sanitizers, kernel-only, native-live,
corpus-parity-subset) now needs changes alone and skips only a docs-only
answer; preflight, which holds the documentation guards, and docs.yml run
as before. The build aggregate passes a proof lane that succeeded or was
skipped after changes succeeded and answered docs-only, and fails any other
skip or result; preflight must always succeed.

Pushes to main follow the same rule: release.yml is dispatch-only and
builds its own tarballs, promote-baseline.yml reads the maintainers'
pineforge/verify and pineforge/parity statuses on the PR head, no workflow
starts on workflow_run, and the ruleset requires only those two statuses.

The ci-workflow-contract stage pins the new wiring; test_ci_preflight.py
runs the aggregate's shell over every lane outcome; the new docs-only-tests
stage holds the rule against real git histories and fails when a CMake
file reads a path the rule would call documentation.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* CI docs-only skip: review fixes on 4b6a21e (8a280b9 before the cherry-pick) (lane pf-ci-docs)

- The changes job runs the base's copy of scripts/ci_docs_only.py (the
  pull request's base, or the pushed commit's parent) with --root, so a
  change to the rule is judged by the rule it changes; a base without the
  script runs every job. The classification step is pinned verbatim, and
  test_ci_preflight.py runs its shell in throwaway repositories.
- A push must carry one commit whose parent is before; anything else is a
  doubt, so the shallow fetch of an older before is gone. git calls time
  out as a doubt. Git control files (.gitattributes) are not documentation.
- Proof jobs skip only when changes succeeded and answered docs-only, the
  exact skip the build aggregate accepts.
- No job of ci.yml, native-live.yml or corpus-parity.yml, nor any step,
  may continue on error.
- docs/ci.md: the base copy, the one-commit push, the aligned condition,
  the badge after a documentation merge, and what the CMake scan checks;
  the start-order sentences no longer contradict the wait on changes:
  116c461's "The compilation lanes start alongside preflight" and
  "Preflight and all proof jobs start in parallel" now say that the
  proof jobs start once the few-second changes job has answered.
  AGENTS.md: a documentation-only change runs preflight alone, written
  inside the existing lines so the pinned AGENTS.md:144-145 stays put.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Bench: no committed result names a closed slot by its directory; the gate column is the rubric's

A closed slot's directory, NNN-<author>-<title>, carries the TradingView
author's handle, and fourteen committed files repeated it: the six result
files under results/ (five reports and the compile log), seven raw timing
files and the throughput package's JSON. Every harness step that writes a committed file now prints
the slot as NNN-closed:

- paths.public_name() is the one rule; compare.py (summary.md,
  trade_comparison.md) and speed/time_pynecore.py (its JSON keys) use it,
  and speed/pineforge_bench.cpp registers a closed-root slot as NNN-closed.
- select_population.py writes the public view of the manifest to
  results/selection.{json,md} (closed slots lose their probe id and
  replacement queue) and the full manifest beside the closed root, in
  assets-closed/_selection/; --render-public re-renders the public view
  without a new draw. The committed selection is re-rendered that way from
  its own full manifest (the draw is unchanged).
- The seven raw timing files and results/pynesys-compile-log.md are
  rewritten in place (closed names only); manifest.json keeps each
  measured file's sha256 as origin_sha256 and names the edit.
  results/raw/README.md's Edits paragraph, b2a578c's (#300) "Two edits
  were made", now counts three and describes the third.
- tests/test_public_names.py fails when any committed result spells a
  closed slot otherwise. speed.md and throughput/benchmark_results.json
  still do until the refresh regenerates them.

compare.py also printed a probe's declared inputs.json "notes" in the
failing-gates column of every engine's row: analyze_strategy returns the
declared note as its notes. Slots 023 and 168 showed PineForge's own
history in PyneCore's gate cell (DOCS-ENGINE fixed the two cells by hand
in b2a578c, #300; regeneration would put them back). failing_gates() prints the
rubric's gate booleans instead. A slot without strategy_pyne.py reads its
PyneSys compile error from the committed compile log when the maintainer's
request ledger is absent, so a fresh checkout reports slot 192 as the
compile rejection it is, not as a runner error carrying a local path.

compare_indicators.py links canonical.pine in the assets repository at the
last assets commit that changed it: GitHub does not resolve a relative link
into a submodule path (DOCS-ENGINE fixed that cell by hand as well).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Bench: PyneCore 6.10.3, the latest release; the harness pinned 6.10.2

uv.lock pinned pynesys-pynecore 6.10.2 (2026-09-20). 6.10.3 (2026-09-28)
is the latest release, so the refresh measures it: `uv lock
--upgrade-package pynesys-pynecore`, nothing else moves. Its fixes are in
the code the bench exercises: `pyne data convert-from` wrote schedules on
the wrong weekdays (Monday fell outside the session, so an unlagged daily
request.security showed Monday bars that day's own close) and
request.security aggregation resolves timezones like the runner. It also
ships compiled wheels (a native math module).

With 6.10.3 every compiled slot runs: 140, 166 and 197 raised a
RuntimeError in request.security on 6.10.2, and 143 did intermittently.
Only 192 has no trade list (PyneSys rejects its source). The committed
strategy_pyne.py files are unchanged: no PyneSys request was made.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Bench: regrade 201 slots at engine 35db01c with generated.cpp from codegen 121b3e6a -- PineForge 201/201 excellent, PyneCore 6.10.3 137

The release pair: engine main 35db01c running every slot's generated.cpp
re-emitted by codegen main 121b3e6a (transpile(strategy.pine,
filename="strategy.pine"), the call that reproduces all 201 files of the
previous codegen 89645d6 byte for byte; 159 of 201 files change). The
benchmarks/assets gitlink moves to e564cb9 (branch bench/refresh-2026-09-30
of pineforge-benchmarks-assets); the closed half is in a new
evidence tarball.

TradingView changed three Pine v6 strategy() defaults on 2026-09-24
(initial_capital 1000000 -> 100000, default_qty_type fixed ->
percent_of_equity, default_qty_value 1 -> 100); codegen 121b3e6a declares
the new values when a script omits them (codegen #147). Every bench tape
predates the change (closed tapes 2026-06-28..08-12), so a slot whose script
omits one runs with the tape's value, pinned in inputs.json
strategy_overrides as the corpus does: 64 slots (2 public, 62 closed).
Without the pins the regenerated closed half graded 45 excellent and 42
weak (PnL p90 ~90 % on capital, extra trades on percent-of-equity sizing).
PyneCore's own defaults are the pre-change values, so both engines run the
tape's settings.

Tiers (results/summary.md), against 2026-09-22 (engine 063e446):
- PineForge: 201/201 excellent (was 200 + 1 strong). Slot 181's extra
  opening long is gone with the regeneration.
- PyneCore 6.10.3: 137 excellent, 46 strong, 12 moderate, 4 weak,
  1 minimal, 1 n/a (was 6.10.2: 133 / 42 / 8 / 12 / 2 / 4). 140, 166 and
  197 now run; 192 stays a PyneSys compile rejection.
- vectorbt: unchanged (13 ports, 4 / 6 / 2 / 1).

Trade lists against the 2026-09-22 run (the old engine rebuilt and run
through its own run_strategy.py reproduces those lists byte for byte):
173 of 201 are byte-identical. 27 move with the engine and its runner, not
the regeneration (the same lists from the old generated.cpp on the new
engine): 22 only in the favorable/adverse excursion columns, 2 only in the
engine's incarnation column, and three in fills: 010 (six trades exit one
bar earlier), closed 103 (90 grid-bot trade quantities) and closed 191
(one trade exits a bar earlier). One moves with the regeneration: closed
181 loses the extra opening trade. Every slot grades excellent.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Bench: time_pynecore.py --first submits the longest slots first, so the pool stays full

A PyneCore slot that runs for a minute per backtest (178, then 162) takes
20 runs x its time in one worker. Submitted in slot order it started late
and ran on alone after the queue drained, so the 2026-09-22 window re-timed
162 and 178 across tool calls, 178 partly beside other chunks. --first
submits the named slots first; the other workers work through the rest, and
the sweep keeps --workers processes running until its last minutes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Bench: pineforge_bench times the graded strategy -- the slot's inputs.json pins apply, and each benchmark reports its trade count

TradingView changed three Pine v6 strategy() defaults on 2026-09-24, after
every bench tape was recorded; codegen 121b3e6a declares the new values for
a script that omits them, and 64 slots pin the tape's values in inputs.json
strategy_overrides. run_strategy.py applies those pins to the graded run,
but the Google Benchmark harness ran strategy_create with defaults only, so
on those slots it timed a configuration no tape has: slot 108 books 4,078
trades over the feed unpinned and 3,553 pinned.

The harness now reads each slot's flat strategy_overrides object and applies
it through the library's strategy_set_override after every strategy_create,
as run_strategy.py does (values as the JSON writes them); a slot that pins
settings its library cannot take is skipped with that error. It prints how
many slots pin settings (64 of 201). The three benchmark kinds share one
symbol table per dlopen, and each reports the last iteration's closed-trade
count as a "trades" counter: the workload its time was measured on.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Bench: every engine re-timed at 35db01c on a dedicated AWS c7a.8xlarge -- 36x over PyneCore 6.10.3 on that host; 35db01c takes 0.35x the time of 063e446 there

The timing window (2026-09-29, 20:36-23:27 UTC) ran on a dedicated AWS
c7a.8xlarge (AMD EPYC 9R14, 32 cores, SMT off, Ubuntu 24.04), nothing else on
it: the Mac the 2026-06-11 and 2026-09-22 tables were timed on (Apple M4 Max)
never got quiet (load 28-40 from Spotlight reindexing, a VM and other
projects), and a shared NVIDIA GB10 was given up once another supervisor's
suites started there (its partial timings are a cross-check only, not
published). Times from different hosts are not compared; every comparison
the READMEs print was measured in this window.

Measured (results/raw/2026-09-29-35db01c8, manifest.json):
- PineForge 35db01c with generated.cpp from codegen 121b3e6a, magnifier on,
  pinned to one core: median 66.8 ms per strategy, 807k bars/s (505k-1133k).
  Build g++ 13.3 Release; its 201 trade lists on this host are byte-identical
  to the graded (Mac) ones.
- PyneCore 6.10.3, 8 concurrent on eight pinned cores: median 2,629 ms, 200
  slots (192 has no strategy_pyne.py; 143 ran all 20 runs). Median speedup
  36x (p5 15x, p95 131x); vectorbt 13 ports 209.3 ms (4.2x); PineTS
  1416.2 ms.
- Same-window A/B, all 201 slots, each engine on its own generated.cpp,
  new/old/old/new: 35db01c takes 0.35x the time of 063e446 at the median
  (p10 0.28, p90 0.50), faster on all 201. A perf profile of two slots shows
  063e446's per-bar continuation-hash fold, event-journal scans,
  dynamic_cast and out-of-line accessors, none of which 35db01c keeps.
- The 2026-06-11 engine, rebuilt there: 4-8x faster than 35db01c on its
  three probes. PyneCore 6.10.3 vs 6.10.2 on 26 public slots: 1.01x.
- Throughput package: five runs 0.782/0.786/0.778/0.779/0.777 M bars/s; run 4
  published (0.78). A first run 1 was stopped: reproduce.sh's configure found
  the fetched Eigen as a system package, changed every compile command and
  began rebuilding the tree on the pinned core. After an all-core rebuild
  (then a no-op), identical trade lists, and a recheck of the 26 A/B slots
  (1.00x), the five runs built nothing.
- Every batch passed the quiet gate (load < 6, no build/test process, the
  pinned cores idle); gate.tsv and a load trace per batch are committed.

Harness: aggregate.py takes the timing host's facts (--host host.json) and
prints the busiest pinned core per batch; check_provenance.py derives the new
headline from the window (the host line, the host change, the 201-slot A/B,
the PyneCore release A/B, the 2026-09-22 table read from 35db01c, the tier
changes against its summary.md, the June engine on this host) and drops the
cross-host comparisons; test_check_provenance.py reads its targets from the
README.

Docs: benchmarks/README.md headline, non-excellent rows (PineForge none;
PyneCore 63, the window explanation re-measured, the multi-timeframe rows
after 6.10.3), methodology (pins in the timed run, pinning, same-host
comparisons), Fairness (the 2026-09-24 strategy() defaults the tapes predate);
the engine README's speed badge, the Fast bullet and the cross-engine
section; throughput/README.md and results/raw/README.md for the new window.

Rebased onto main 112c134 (DOCS-ENGINE b2a578c #300, 7d33942 #301, 112c134
#302). The engine README keeps main's text outside the speed badge, the Fast
bullet and the cross-engine section, #302's counts and badges included. The
Fast bullet keeps b2a578c's framing (engine, date, PyneCore timed as a
subprocess with its interpreter start-up) with this window's numbers, and
names both populations: the speedup's 200 strategies and the bars/s median's
201 slots. The section keeps b2a578c's PyneCore-sources paragraph and its
"main has moved on since" clause (4dc496d, #299, changed src/ after
35db01c, and nothing was re-measured on it). Its PineForge paragraph names
the engine and codegen the tiers were graded at, and its vectorbt bullet
keeps b2a578c's form with this window's numbers: a 4.2x median per-strategy
speedup, and vectorbt is still faster on 2 of the 13 (021, 064).
results/raw/README.md's Edits section replaces the paragraph b2a578c wrote
(and the previous commit extended) with one paragraph per window.

Sentences this commit deletes or rewrites past recognition in README.md,
named by the commit that introduced them (scripts/check_doc_reverts.py):
- 471a113 (the README carries the 200-strategy refresh, lane BENCH2): 7 --
  the strong row 181 and its extra trade, "to the tick", the compile
  rejection, the three runtime errors, 143 "could not be timed", and "the
  ratio fell because the engine is slower per bar".
- a02160f (PineForge re-timed at engine 063e446, lane BENCH3): 3 -- the
  speed paragraph's host, engine and window.
- f867096 (the multi-timeframe PyneCore rows reproduce 0-85.5 %, lane F10): 1
  -- the nine multi-timeframe scripts, rewritten for 6.10.3.
- b2a578c (make every README and doc page true before the release,
  DOCS-ENGINE, #300): 1 -- the 2026-06-11 engine "still runs close to its
  June timings", measured on the Apple M4 Max; this window's same-host
  timing of that engine replaces it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Docs: the window rows count exactly (review of the AWS window commit)

- benchmarks/README.md: of the 16 count-only PyneCore rows, 11 carry a
  position opened before TradingView's range: 7 hold it past the bar
  TradingView's first trade opens and 4 close it on that bar.
- results/raw/manifest.json: the 2026-09-22 throughput run 2 was the
  published benchmark_results.json until the 2026-09-29 window replaced it
  (sha256 unchanged).

The review's third note, README.md's Fast bullet pairing "200 timed
strategies" (the speedup's population) with the bars/s median (over
PineForge's 201 slots), is resolved in the previous commit: the rebase onto
112c134 rewrote that bullet there, in DOCS-ENGINE's framing, naming both
populations.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* Bench: pin benchmarks/assets at its main (5759bf2), the same tree as e564cb9

The assets commit landed on the assets repository's main by a rebase merge
(pineforge-benchmarks-assets#2), which gave it a new id with the same tree
(2ee1fefd). Pin the id main carries; e564cb9 stays reachable under the tag
engine-pin-e564cb9.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01QFVRQ4gcJCLbjfYqGtmy4k

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
@luisleo526
luisleo526 deleted the r5/fix-e1e2 branch October 5, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant