Skip to content

Commit ba14721

Browse files
luisleo526claude
andcommitted
Add selected-capacity bounds, bounded drawings and native history storage
Integrated engine branch for the next release. It adds the selected-capacity input driver with three of its five bounds (primary rows, auxiliary rows and script bars), and it carries the work of the earlier draft pull request #734 (the head of its 1.11 engine batch is an ancestor of the integration line that this one commit squashes): native history storage, bounded ledger caching, bounded drawing creation with typed failures, and several runtime-scope and request fixes. It supersedes #734 and #745, which carry this work on older bases; the parts that are deferred are named below. Strategy modules built against 1.10.x must be rebuilt (the existing engine and codegen pairing rule): the C++ script ABI epoch moves from `engine_script_run_v19` to `engine_script_run_v20`, an explicit exception to the earlier promise of one epoch throughout 1.x. The C API only gains functions, and the caller-allocated C report and trade layouts are unchanged. ## Selected-capacity inputs A caller can bound the actual CSV inputs of a selected run. The driver (`src/selected_capacity_driver.*`) reads every supplied stream through a private single-pass chart CSV reader (`src/selected_capacity_csv_reader.*`), validates each record, and offers it to the observer of every bound that is present, on a tentative state. The primary sink receives a row only after every reservation for that row has succeeded, so a refused row is never materialized and neither a counter nor the stream state is committed for it. An absent bound imposes nothing; an explicit zero is finite. Source and auxiliary rows never reach the sink. Each owner reserves through the shared `reserve()` in `src/selected_capacity_core.cpp` and raises a canonical typed failure (class resource, not retryable, since 1.11.0; string arguments `limit`, `used` and `requested`, where `limit` and `used` are the bound and the count before the attempted reservation and `requested` is the count asked for): | bound | owner | code | English | | --- | --- | --- | --- | | primary rows | `src/selected_capacity_primary_rows.cpp` | `selected_primary_rows_limit_exceeded` (85) | Selected primary-row capacity exceeded. | | auxiliary rows | `src/selected_capacity_auxiliary_rows.cpp` | `selected_auxiliary_rows_limit_exceeded` (83) | Selected auxiliary-row capacity exceeded. | | script bars | `src/selected_capacity_script_bars.cpp` | `selected_script_bars_limit_exceeded` (86) | Selected script-bar capacity exceeded. | The script-bar bound counts the script buckets that the supplied primary rows open, by their native script bucket key: pre-roll rows, rows that are trimmed later and an unsealed final bucket all count; session-anchored buckets follow the session open; a bucket that continues from one primary stream into the next counts once, because the previous bucket is kept in the run state. The codes `selected_source_rows_limit_exceeded` (87) and `selected_bytes_limit_exceeded` (84) are in the catalog and the registry. Their owners, and the production entry that binds all five bounds (`materialize_selected_capacity` and `make_product_observer_table`, declared in `src/selected_capacity_driver.hpp`), are not part of this change. The ownership manifest, the release diff of the failure catalog and the generated tables of the failure-code page are brought up to date with the catalog: they list the five selected-capacity codes, the two runtime history storage codes and the map capacity code. Tests: `test_selected_capacity_primary_rows`, `test_selected_capacity_auxiliary_rows` and `test_selected_capacity_script_bars`, registered under the `selected_capacity` label. Their expected values come from the tests' own oracles over timestamps written into their CSV text; the script-bar test checks the exact limit, the limit minus one, an absent bound, an explicit zero, the roles that must not charge, the early stop, session anchoring, equal input and script timeframes, a bucket split over two primary streams, strict feeds, the failure class, the arguments, the English text and the committed run state. ## Also in this branch These changes were made on the batch branch before the selected-capacity work; they are listed here by their commit subjects, in order. - Map capacity is a parameter, default no limit; RE10070 pine_map_capacity_exceeded at the parameter - Assemble staged ledger, cache and provider source proposals - Use technical terminology for ledger cache configuration - Keep the descriptor layout docstring technical - Track runtime context storage and refusal argument ownership - Serialize quota observations and cover runtime context ownership - Clarify cursor contract and implementation detail assertions - Add deterministic two-host runtime scope isolation controls - Clarify cursor oracle provenance and characterization coverage - Read a deleted drawing as missing, return a typed status for a stale borrow, and add an opt-in bounded slot arena - Report applied grading policies and missing observations - Create drawings through a bounded arena: a refused creation returns the na handle and records a typed diagnostic - Validate request timeframes before registration - Regenerate the map failure catalog delta - Keep timezone conversion coherent across sequential engine modules - Describe the timezone mutex scope across separate engine images - Preserve scratch-file layout (the cold-book frame of the same commit is not in this change; see below) - Fix timeframe test registration-state observation - Code the drawing slot-bound and arena-misuse throws as engine invariants - Reconcile numeric catalog contracts with the selected release union - Code the drawing id-exhaustion and declared-count throws - Extend existing drawing failure vocabularies and messages - Regenerate the additive drawing failure registry and release diff - Avoid scanning unchanged chunks during object growth One part of the map capacity change is deferred to the next release: the 120,000-pair map command line row (`test_cr559_map_capacity_cli`, with its script `tests/cr559_map_capacity_cli.py` and fixture module) is not in this change, because it needs the bounded scratch cache redesign. It runs the command line runner with maps of 120,000 pairs, 50,001 and 50,000 pairs and two typed refusals; in a Debug build on x86-64 its cost grows by about 2.5 for each doubling of the pairs (5,000 pairs 26.0 s, 10,000 pairs 66.1 s, 20,000 pairs 181.6 s), because the bounded cache mode of `include/pineforge/detail/scratch_file.hpp` discards the whole file's page cache after every 64 KiB of clean reads and every 64 KiB of writes and a map insertion touches about 17 pages. The row is not kept under a `slow` label to hide that cost. The other eight map capacity rows (default, resident, limit, rehash, rollback, error context, run and calc on fill) are in this change and pass. The cold-book frame is deferred to the next release too. The commit "Preserve scratch-file layout and encode complete cold-book archive bytes" also stored every cold order book row behind a 10-byte frame (version, mode, decoded length, then a raw or run-length payload) with its own codec and unit test, and two later commits tested its malformed-row faults against real native reads; none of that is in this change. The row `test_native_dormant_book_cost` compares the real `pread` calls of the last eight ticks of a forced eager run with those of an always-eager reference, within the spread of the reference. With the frame it fails ("persistent eager fallback preads differ from the eager reference") on the commit that adds it and on every later state that was measured; it passes on the four earlier states that were measured and on the branch with the codec replaced by the identity (no frame header), and it still fails with raw frames and with the previous scratch file header. Measured per tick (Debug build, x86-64, the book of 4,608 rows): in both measured states the forced run costs 44,648 reads in every tick of that window while the always-eager reference costs 35,998 in its ordinary ticks, and the row passes only if a burst of about 45,000 extra reads of the reference falls into the window (it does with the codec replaced by the identity, it does not with the frame). The two states differ only in the byte layout of the stored rows, and the bursts fall in different ticks. So the pass without the frame does not show that the two runs cost the same; the difference and the bursts are not explained yet, and the frame stays out until the row passes for a reason. The scratch-file layout change of the same commit is in this change: it keeps the scratch file inside the size that the id-pair store requires. The calendar-bucket commit of the earlier draft #745, "Handle initial incomplete calendar request buckets", is not in this change either. It kept partial initial daily, weekly and monthly request buckets out of the historical batch state for continuous-session intraday chart input (edits in `src/source/pine_security_eval.cpp` and `src/source/pine_strategy_host.cpp`, and the row `test_security_initial_calendar_bucket`). On the integrated tree two rows fail with it: its own row and `test_adapter_security_route_conditions`, which exists on main and passes there. It is taken again with its own proof in a later release. ## Fixes made while integrating the branch The branch was built and run as a whole for the first time: every target of the Debug profile, then every non-slow test row, on x86-64 and on aarch64. That run found the following, which is fixed in this change. None of it alters the selected-capacity behavior. - **Script ABI epoch.** `PF_STREAM_ENGINE_LAYOUT_VERSION` moves from 3 to 4 and this branch changes the layout of the public `CacheDefaults` struct (`ledger_cache_max_bytes` and the cache policy classes), so the epoch moves: the inline namespaces of the engine, the host and the execution consumer are `engine_script_run_v20`, and the host capability macro is `PINEFORGE_HAS_NATIVE_STRATEGY_HOST_V20`. `tests/test_ledger_cache_epoch_layout.cpp` is registered and refuses a changed layout under an unchanged epoch; the state-hash domain tags keep their names. The public contract keeps the earlier promise visible as history and states the exception; the ABI page and the changelog say it too. - **Live runner.** With the layout stamp at 4, `runner/main.cpp` (`Strategy::load`, described in `runner/README.md`) refuses a module that declares a nonzero engine layout stamp other than the runtime's before it creates a strategy; a module that omits the stamp or declares 0 keeps the public report path. Two rows that exist only in the profiles that build the live runner were brought to that policy: `native_live_engine_layout_e2e` pins stamp 4, and `native_live_old_layout_report_e2e` now asserts the refusal of its stamp-2 control module (exit status 1, the message line `strategy engine layout mismatch: module=2 runtime=4`, no output, no ledger), where it used to compare that module's report with the output of main. - **Runtime context.** The runtime context service follows the engine's copy rule: a copy keeps its options and its enabled switch and nothing of a run (no contexts, no borrowed batch). A native stream keeps its begin mode for the whole run, so a stream feeds the live runtime history instead of being refused at `stream_begin`. Two fixtures of its tests state what the product does: a canceled quota ticket keeps the tracked endpoint, snapshot and factory JSON alive, so the ticket alone observes the same complete storage as with its client; and the managed race fixture finishes its client after the rejected overflow, because a host that sees a disconnect without a finish records a protocol refusal. - **Pins and counts.** The C ABI count pins are 124 declarations and 104 implementations, with the documents and unit tests that state them; the ABI layout probe pins the sizes and offsets measured on Linux x86-64; the source-bounds inventory knows the owned deque as a custom container and the owned allocator's record pool, and raises its unreviewed groups from 1,354 on main to 1,403, nothing marked bounded; the failure-code count pin of `tests/test_run_failure_codes.cpp` is 88 (87 codes and the none value), a row that runs only where the private fixtures are checked out; two slow-labelled rows are named in the pinned list of `scripts/ci_verify.py`. - **Memory-filesystem predicate.** The runtime context and the issued range state use the canonical predicate in `scratch_directory.hpp` instead of spelling the tmpfs and ramfs magic values again. - **Ledger cache tests.** The expectations of the tests of the former cache (an omitted setting holds 65,536 rows, one slot per ordinal, a rewind frees only the pages outside the retained window, a move starts cold) are reconciled with the cache this branch builds: a provisional 64 MiB byte default that holds 215,070 entries in four-way sets, every page released on retirement, a move that hands over the hot entries. The expected values come from independent oracles in `tests/ledger_default_cache_rows.hpp`, not from the product. The test of the removed history-sized cache (`test_ledger_auto_cache_growth`) is deleted with its pin, and the cache's own bound test, `test_ledger_cache_bound`, which had never been built, is built and registered as one slow row that runs three seeded populations. - **Owned allocator.** It keeps its allocation records in one vector that is reused after deallocation, where it allocated one record per allocation: the steady state of the RCI, median and mode windows no longer makes temporary allocations. - **Documentation and rulings.** Citations of source lines are re-pointed; the failure-code page counts the 87 named codes and announces the eight new ones; ADR-0001's residual table rules `pine_drawing_id_exhausted` and the engine-invariant counter text; the failure-code vocabulary guard has a reviewed entry for the cache policy setter's pass-through of the engine's code; the C header describes the ledger cache default as the byte default. - **Runtime history spill file.** The file that holds the runtime history once it no longer fits in memory is opened as an unnamed file (`O_TMPFILE`). Where the filesystem has no unnamed files (it answers `EOPNOTSUPP`, or `EISDIR` or `EINVAL` on older kernels), the run ended with `runtime history create spool: Operation not supported`. It now uses a named file that is removed as soon as it is open, the way the build without `O_TMPFILE` already did, and every other refusal is still raised. `test_runtime_history_spool_fallback` forces each of the three answers and checks that the history reads back from the file and that nothing is left under a name, and forces four other refusals and checks that each is raised. It is a Debug-build row, because it forces the refusals through a seam that release builds compile out. - **Two-module timezone row.** `test_timezone_multi_module` runs the Python interpreter under the sanitizer runtime, and with leak detection on, LeakSanitizer reported the interpreter's own exit-time allocations as leaks. The row now runs with leak detection off, as the stop-equivalence row that also hosts Python already does. The instrumented modules are still checked for memory errors, and the C++ rows keep leak detection. ## Documentation `docs/coverage.md` describes `tz_util::ScopedTimezone` in its module table and in the section "Time / Session / Timezone". Three sentences there are replaced because the guard changed: they said that it is a mutex-guarded `TZ` swap for thread-safe formatting, that it grabs a process-wide mutex and skips the `setenv` / `tzset` pair for a same-zone request, and that this is the only reason `pine_str_format_time` and the session helpers are safe to call from a multi-strategy harness (introduced by aa6ac08 and 6aa1d13). The page now says that the guard holds a per-image mutex for its whole scope, compares the actual `TZ` value, leaves `TZ` in place when the guard ends, and that separately linked engine images do not share the mutex. `docs/pages/memory-management.md` describes the ledger read cache. Nine sentences there are replaced because the cache changed (introduced by 69cddc9 and 772766a): the engine defaults to 65,536 ledger entries, applied through `TradeLedger::set_cache_rows`; the default cap is 65,536 occupied entries (`kSinkCacheRows = kDefaultCacheRows`), with an allowance of 20,449,280 B on LP64 for 65,536 entries; the host and standalone byte setters share `TradeLedger::cache_rows_for_capacity` and run begin applies the host result through `set_cache_rows`; retirement frees pages outside the retained window, bounding allocated slots by `min(cap,(ceil(retained_rows/256)+2)*256)`; a directory or page allocation failure permanently bypasses further cache allocation for that ledger, while reads, appends and replacements continue through backing. The page now says that an omitted setting keeps the provisional byte default of 67,108,864 B (64 MiB), which holds 215,070 entries, applied through `CacheDefaults::apply_ledger_cache`; that a global ordinal chooses one four-way set; that retirement and a rewind release every optional page; and that an allocation failure bypasses the cache until `clear()` for an explicit row setting and until the retained population has doubled for the byte default. It also states that a copy of a ledger starts with a cold cache and that a move hands the whole cache over, so the target is as hot as the source was (on main a move left the target cold; `test_p2cx_tledger_budget` states the new behavior). ## Verification of the selected-capacity part On the tree of this change (Ubuntu 24.04, GNU 13.3.0, CMake 3.28.3; x86-64 and aarch64): `ctest -N -L selected_capacity` lists exactly `test_selected_capacity_auxiliary_rows`, `test_selected_capacity_primary_rows` and `test_selected_capacity_script_bars` (main has no test with that label), and all three pass in the Debug profile of `scripts/ci_verify.py`; the kernel archive defines the script-bar owner (`observe_script_bars`) once, and the script-bar test links that definition and carries no stand-in of its own; `scripts/check_run_failure_codes.py --no-history` reports "87 codes, registry in sync, 94 files scanned for uncoded throws, OK". Six deliberate breakages of the script-bar owner (no role or bucket filter, rows counted instead of buckets, no enforcement, the wrong state field, a wrong code, a wrong English text) each make its test fail at the assertion that names the defect, and a test that gets a setup answer from the driver exits with status 2 instead of reporting a bound failure. Those breakages were run when the owner was written; the selected-capacity sources, the three tests, their fixture and their lane files are byte-identical in this change to the files they were run on. The rest of the suite, the parity runs and the performance and memory results are those of this pull request's checks. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1 parent 3080b40 commit ba14721

225 files changed

Lines changed: 21708 additions & 2357 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ version number follows semantic versioning over the surfaces the
77

88
## Unreleased
99

10+
- **Strategy modules built against 1.10.x must be rebuilt.** The C++ script
11+
ABI epoch moves from `engine_script_run_v19` to `engine_script_run_v20`
12+
(and `PINEFORGE_HAS_NATIVE_STRATEGY_HOST_V19` to `..._V20`) because
13+
`PF_STREAM_ENGINE_LAYOUT_VERSION` moves from 3 to 4 and the layout of
14+
`CacheDefaults` changed. This is an explicit exception to the earlier
15+
promise of one epoch throughout 1.x, and the existing engine and codegen
16+
pairing rule applies. The C API only gains functions; the caller-allocated
17+
C report and trade layouts are unchanged, and the state-hash domain tags
18+
keep their names.
1019
- `pineforge-live` status files now report `metrics.feed_idle_ms`, the
1120
milliseconds since the last feed arrival, or null before the first; the
1221
consumer owns freshness. HTTP and WebSocket feeds now also default to no

‎CMakeLists.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,13 @@ set(PINEFORGE_KERNEL_SOURCES src/array.cpp
131131
src/reservation_expansion.cpp
132132
src/engine_run.cpp
133133
src/engine_security.cpp
134+
src/runtime_context.cpp
134135
src/engine_state_hash.cpp
135136
src/engine_stream.cpp
136137
src/engine_trade_accessors.cpp
137138
src/pending_order_mirror.cpp
138139
src/native_order.cpp
140+
139141
src/native_journal_codec.cpp
140142
src/engine_consumer.cpp
141143
src/market_driver.cpp
@@ -163,6 +165,12 @@ set(PINEFORGE_KERNEL_SOURCES src/array.cpp
163165
src/native_bar_views.cpp
164166
src/selected_report_view.cpp
165167
src/selected_window_plan.cpp
168+
src/selected_capacity_core.cpp
169+
src/selected_capacity_csv_reader.cpp
170+
src/selected_capacity_driver.cpp
171+
src/selected_capacity_primary_rows.cpp
172+
src/selected_capacity_auxiliary_rows.cpp
173+
src/selected_capacity_script_bars.cpp
166174
src/metrics_spill_curve.cpp
167175
src/report_scratch.cpp
168176
src/detail/o1_store.cpp

‎README.md‎

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The separate PineForge compiler, [`pineforge-codegen`](https://github.com/pinefo
3333
- **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.
3434
- **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.
3535
- **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.
3737

3838
Recorded outputs and their additional API declarations described here are
3939
part of **1.5.0**.
@@ -129,6 +129,18 @@ The [shared local/CI verifier](docs/ci.md) includes source guards, tests and ins
129129

130130
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.
131131

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+
132144
### Prebuilt library
133145

134146
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).
529541

530542
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.
531543

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
535547
`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
537549
[checked-settings exports](docs/checked-settings.md). Older modules can also lack
538550
the two opt-in [execution-capability exports](docs/strategy-capabilities.md).
539551
In an optimized build `nm -gU` also shows libc++'s
@@ -571,6 +583,7 @@ inventories are pinned by `scripts/check_c_abi_runtime.py`:
571583
| `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 |
572584
| `strategy_request_abort` / `strategy_last_run_status` | Cooperative abort of a run in progress; `0`=completed, `1`=aborted |
573585
| `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 |
574587
| `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 |
575588
| `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 |
576589
| `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 |
@@ -708,7 +721,7 @@ Documentation: [C ABI reference](https://cdocs.pineforge.dev) · [Getting starte
708721

709722
## Releases
710723

711-
- **[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 -->
712725
- **[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).
713726
- **[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).
714727
- **[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

Comments
 (0)