Skip to content

docs: runnable quick start; pinned 0.1.12 and opt-in 1.0.0 runtimes; in-process ABI limit - #13

Merged
luisleo526 merged 3 commits into
mainfrom
docs/readme-truth
Sep 30, 2026
Merged

luisleo526 merged 3 commits into
mainfrom
docs/readme-truth

Conversation

@luisleo526

Copy link
Copy Markdown
Contributor

Summary

Documentation and package metadata text only: no code, test or version change. The quick start runs as written again, and the docs say which runtimes and engines the harness supports.

  • Quick start. Kraken serves only its latest 720 candles, so the README's July 2025 Kraken request returned no bars: step 2 raised IndexError and step 3 exited 1. The examples in the README, getting-started, backtesting and CCXT pages now use bitstamp. The example strategy sizes 10% of equity instead of an unfunded 1 BTC, whose 90 trades all had zero PnL on the pinned runtime.
  • Runtimes. The docs name the pinned default, pineforge-release 0.1.12 (engine 0.11.0, codegen 0.9.0). They now say how to run release 1.0.0 (engine 1.0.0, codegen 1.0.0), pinned by digest, in the CLI and in the server image, and that results differ between the two.
  • In-process runner. docs/api/backtesting.md states that PineForgeBacktestRunner accepts only PineForge C ABI 2, which engine v0.10.2 through v0.12.3 build. It refuses v0.13.x and v1.0.0 libraries.
  • Other corrections:
    • no macro provider ships, so the description, keywords and site description drop "macro";
    • the SQLAlchemy extra needs a database driver;
    • contract-term validation, sub-millisecond timestamp handling and the server cache default in the image are restated;
    • the warmup envelope example now carries the correct first-bar values and the strategy block;
    • a CSV example that raised SchemaMappingError is removed;
    • the fixture notes give the size in MiB and the market-data source.

Verification

This revision (c244330) on Linux arm64, with the README steps taken verbatim from this branch:

Check Result
pytest 104 passed, 3 skipped
Step 2 exit 0; prints the bitstamp bar timestamp_ms=1751413500000 … close=105709.0
Step 3, pinned default 0.1.12 exit 0; runtime engine 0.11.0, codegen 0.9.0; 88 trades, all with nonzero PnL, none same-bar; 772 equity points
Step 3 with --runtime-image pineforge-release:1.0.0@sha256:b271873d… exit 0; same top-level keys; runtime engine 1.0.0, codegen 1.0.0; 89 trades, all with nonzero PnL, none same-bar; 772 equity points
DockerBacktestRuntime(image=1.0.0) the docker-test fixture runs (24 of 24 bars)
Server image built on the 1.0.0 base ready; concurrent requests served; compile cache reused (one miss, two hits)
PineForgeBacktestRunner.load(<v1.0.0 strategy.so>) EngineBacktestError: PineForge ABI mismatch: strategy reports 4, expected 2
mkdocs build --strict exit 0

Added URLs return HTTP 200, and relative links in the changed files resolve. CI's twine check --strict step will likely fail on this PR: twine<7 rejects the Metadata-Version 2.5 that hatchling 1.32 and later write. That predates this PR.

Needed for engine 1.0 (not in this PR)

  1. In-process runner on ABI 4 (src/pineforge_data/backtest.py):

    • set EXPECTED_PF_ABI to 4 (line 21);
    • append open_at_end (int32) to _PfTrade;
    • keep or rename sharpe_tv and sortino_tv in _PfEquityStats: v1.0.0 renamed the C fields sharpe_monthly and sortino_monthly at the same offsets, and its release report keeps the old keys, so a rename here changes this report's JSON keys;
    • append broker_state_hash (uint64_t*) and broker_state_hash_len (int64_t) to _PfReport;
    • note that pf_trade_t.max_runup and max_drawdown now hold whole-trade excursions in account currency, not per-unit price travel.

    pf_bar_t and pf_trade_tick_t are unchanged from engine v0.11.0 to v1.0.0.

  2. Default runtime. If 1.0.0 should become the default, move the pin in release_contract.py:14-17, the docker/server.Dockerfile:3 default, the assertions at tests/test_docker_integration.py:64 and tests/test_docker_runtime.py:18, and the 0.1.12 trace-collection error at release_contract.py:91, and note the changed results.

Other follow-up

Before the next release, fix the twine>=6.2,<7 pin: it rejects the Metadata-Version 2.5 that hatchling 1.32 and later write.

🤖 Generated with Claude Code

luisleo526 and others added 3 commits September 29, 2026 19:17
- README/getting-started/backtesting/ccxt quickstarts used venue kraken for
  2025-07 15m bars; Kraken serves only its latest 720 candles, so step 2
  raised IndexError and step 3 exited 1 ("provider returned no confirmed
  bars"). Switched those examples to bitstamp (live runs: 96 bars, report
  exit 0) and noted the Kraken history limit in the CCXT guide.
- README strategy fixed 1 BTC per order against 10,000 capital (Pine v6
  default margin 100%): pinned runtime produced 90 zero-PnL same-bar trades,
  release 0.1.25 produced none. Size at 10% of equity (88/89 real trades).
- README and backtesting guide now name the pinned runtime:
  pineforge-release 0.1.12, engine 0.11.0, codegen 0.9.0
  (release_contract.py DEFAULT_RELEASE_IMAGE + image OCI labels).
- Report envelope example: provider_start_ms/first_bar_ms described 5000
  warmup bars, not 500 (warmup_request_start_ms and a live run give
  1750878000000); added the top-level strategy section the CLI emits.
- csv.md infer_bar_mapping({"timestamp": ...}) raised SchemaMappingError on
  the page's own header; removed that line.
- tabular-schema: ISO-8601/datetime sub-ms values are truncated, only
  numeric ones fail (tabular.py _timestamp_ms; reproduced).
- data-model: expiry_ms may be 0; only contract size and strike must be
  positive (models.py ContractSpec).
- server.md: /cache is the image default; code default differs.
- api/server.md: the packaged pineforge-backtest-server command serves
  /readyz 503 and fails backtests (runtime_unavailable) outside the server
  image; point to the image built from docker/server.Dockerfile.
- README SQLAlchemy row needs a dialect driver, as providers.md says.
- index.md, pyproject description, mkdocs site_description claimed macro
  providers/adapters; none ship (only macro contract types), and only bars
  reach pineforge-release.
- CORPUS.md: name the upstream market data (corpus NOTICE) and state the
  LFS object size in MiB (176,093,499 bytes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No macro-data provider ships; the package has only the macro contract
types (MacroObservation, MacroRequest, MacroDataProvider). The previous
commit dropped "macro" from the description; the keyword now matches.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The docs named only the pinned 0.1.12 runtime (engine 0.11.0, codegen
0.9.0). pineforge-release 1.0.0 (engine 1.0.0, codegen 1.0.0) is now the
latest release. This revision (c244330) was tested on Linux arm64 with
the README steps from this branch:

- step 2 prints the bitstamp bar (timestamp_ms 1751413500000, close
  105709.0);
- step 3 exits 0 on the pinned default (88 trades, all with nonzero PnL,
  none same-bar, 772 equity points) and with --runtime-image
  pineforge-release:1.0.0@sha256:b271873d... (89 trades, same checks,
  same top-level report keys);
- DockerBacktestRuntime runs the docker-test fixture on 1.0.0 (24 of 24
  bars), and the server image built on the 1.0.0 base serves concurrent
  requests and reuses its compile cache;
- PineForgeBacktestRunner refuses a v1.0.0 strategy library with
  "PineForge ABI mismatch: strategy reports 4, expected 2": backtest.py
  pins ABI 2, which engine v0.10.2 through v0.12.3 build.

The README, docs/backtesting.md and docs/server.md now show how to run
1.0.0 pinned by digest and that results differ from 0.1.12;
docs/api/backtesting.md states the in-process runner's ABI limit.
mkdocs build --strict passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@luisleo526
luisleo526 merged commit 589e678 into main Sep 30, 2026
6 of 7 checks passed
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