Skip to content

Commit aab50fb

Browse files
luisleo526claude
andcommitted
abi: native_order_v8 and PF_ABI_VERSION 5, so a stale native module or a strategy library built for ABI 4 is refused
The layouts of BindOpenings, OpeningsClose, TargetObservation, CommandContext and WorkingRequestCore changed in 1.8.0 while the inline namespace that versions them stayed native_order_v7, and the C ABI version stayed 4. A native C++ module built against the earlier headers could link against the new archive and read a different layout. Two guards now refuse it. - The order value namespace is native_order_v8 (headers, sources, tests, the namespace pins in scripts/check_native_cpp_versions.py, and the generated source-site inventory: 293 scope strings renamed, nothing else). Identity types stay in native_order_v1. - PF_ABI_VERSION is 5. The runtime and the Python harness compare the stamp for equality, so a library stamped 4 is refused with the existing mismatch message (the typed strategy_library_incompatible error in run_json.py, "strategy ABI mismatch" in the C++ runner) before any strategy entry point is called. Every current-value statement, pin and fixture moves to 5; releases that used 4 keep 4 and are marked as history. Documentation this replaces. The all-1.x promise is gone: the pages said "Semantic versioning at the ABI level" and "PF_ABI_VERSION is 4 for every 1.x release", that "A consumer built against one 1.x" release "loads a library" built for another, and that "PF_ABI_VERSION stays 4"; 1.8.0 is the exception because the native order types changed layout. Sentences that stated the old current value are rewritten to history or to 5: 622d653, d093560, cc0b22d, b2a578c, c5383e6, 3b13183, 5f3299d, 5a1ad3a, e81072d, 517a1b4, 7858fea and f864be5 introduced the ones that left (README, the boundary ADR, the frozen market note, abi-stability, exit-leg-lifecycle, native-engine, public-contract, report-schema, pine-intraday-cap-boundary). The 1.8.0 changelog sentence "No public header changed" is replaced by the rebuild requirement, which was true of the header change. Tests: - test_native_order_epoch_reject compiles one caller against the public headers and against a copy whose namespace is rewritten to v7, and requires the copy to fail to link with an unresolved WorkingRequestCore constructor (a compile failure or an unrelated link error does not count). - test_native_order_epoch_rebuild_bytes builds the frozen previous runtime from its Git objects (every tracked path of the base commit except corpus, benchmarks and docs) and the current one, loads each in its own process and compares the whole report-word transcript of the finite control cases byte for byte. - test_strategy_module_abi_epoch loads two modules built from tests/test_live_contract_plugins.cpp, one stamped with the previous release's literal 4 and one with the header's value, through the real run_json.py loader: the 4-stamped one must be refused with the typed error naming 4 and the header value and no strategy entry point called; the current one loads. - scripts/check_settlement_cpp_abi.py separates the historical v6 to v7 relocation, which stays as recorded, from the current order epoch. The comment in src/native_order.cpp that promised at least 128 resident journal events now states the two loop conditions: 128 is a stopping threshold, a spill of up to 32 events can leave fewer. No code changed there. The run failure catalog message for abi_mismatch expects 5 and the per-release diff records it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1 parent 95f4fd1 commit aab50fb

60 files changed

Lines changed: 1109 additions & 569 deletions

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: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ paired with [pineforge-codegen 1.8.0](https://github.com/pineforge-4pass/pinefor
1212
A minor release. It speeds up the `run_json` wrapper (the wrapper only, not the
1313
engine), adds one unused storage building block to the library, states where
1414
scratch files are placed, carries release-gate and CI changes, and stops
15-
building and publishing macOS. The C ABI (`PF_ABI_VERSION` 4) and the
16-
run-failure code catalog are unchanged (0 codes added, changed or removed
17-
since 1.7.0). The report keys are unchanged except for two additive
18-
diagnostics keys, described below.
15+
building and publishing macOS. The C ABI version is now `PF_ABI_VERSION` 5,
16+
requiring strategy libraries to be rebuilt for the native order layouts.
17+
The run-failure code catalog adds or removes no code and changes two entries
18+
since 1.7.0: the optional `engine_invariant` reason vocabulary and the expected
19+
ABI number in `strategy_library_incompatible`'s message. The report keys are
20+
unchanged except for two additive diagnostics keys, described below.
1921

2022
### Compatibility and migration
2123

@@ -24,10 +26,21 @@ diagnostics keys, described below.
2426
and relink every strategy library against the 1.8.0 headers and
2527
`libpineforge.a`, as for every pair change; replacing the archive alone does
2628
not update a statically linked strategy library.
27-
- No public header changed. The only new header is
28-
`include/pineforge/detail/o1_store.hpp`, an internal building block that no
29-
engine path uses yet (below); its object code is part of `libpineforge.a`,
30-
which therefore grows slightly.
29+
- **Native C++ modules require a rebuild.** The native order value namespace
30+
advances from the previous `pineforge::native_order::native_order_v7` to <!-- verified HEAD -->
31+
`pineforge::native_order::native_order_v8`. The layouts of `BindOpenings`,
32+
`OpeningsClose`, `TargetObservation`, `CommandContext` and
33+
`WorkingRequestCore` changed with opening readbacks and scratch-backed core
34+
storage. Rebuild every C++ object that includes these headers and relink
35+
against the matching archive; stale v7 order symbols now fail to link or
36+
load. Identity types remain in `native_order_v1`. The C ABI version
37+
advances from 4 to 5, so a strategy library stamped 4 is refused at load
38+
with the existing `pineforge ABI mismatch: .so reports 4, harness expects 5; rebuild.`
39+
typed diagnostic in the Python loader, before a strategy entry point is called.
40+
The caller-allocated C report and trade layouts do not grow.
41+
- `include/pineforge/detail/o1_store.hpp` is a new internal building block
42+
that no engine path uses yet (below); its object code is part of
43+
`libpineforge.a`, which therefore grows slightly.
3144
- Hosts that read the codegen input manifest must recognize the new input type
3245
`color` (a packed unsigned `0xAARRGGBB` integer default). That is a codegen
3346
change, described in the codegen 1.8.0 notes; the engine side is unchanged:
@@ -129,8 +142,8 @@ diagnostics keys, described below.
129142
holds waiting requests used to end the run as `engine_invariant`; it now ends
130143
it as `scratch_io_failed` (a non-retryable `resource` failure), as the
131144
other scratch consumers already did. A typed failure the storage layer had
132-
already recorded keeps its own code. The catalog is unchanged: no code is
133-
added, changed or removed.
145+
already recorded keeps its own code. This classification adds or removes
146+
no code.
134147

135148
### Known limits
136149

@@ -1117,7 +1130,7 @@ library.
11171130
completeness claim. A build declaring `1.3-parity` cannot be promoted to a
11181131
stable app pin; the app pins it only as a prerelease (`1.6.1-rc.N`), and
11191132
only a completeness proof (EN-115) allows `"1.3"` again. The C layouts stay
1120-
at ABI 4, `PF_ABI_VERSION` stays 4, the selected-window wire version stays
1133+
at ABI 4, `PF_ABI_VERSION` was still 4, the selected-window wire version stays <!-- verified HEAD -->
11211134
1, the phase version 1 and the fingerprint/schema version 2.
11221135
- **Preflight stage timings ([#402]).** `scripts/ci_preflight.py` records `startedAt` (UTC ISO-8601) and `seconds` (monotonic duration; `null` while a stage is running) on each stage and on the top-level `preflight-summary.json` summary.
11231136
- **API documentation (`noindex` on Doxygen source listings and report-schema wording, [#398], [#400]).**
@@ -1179,7 +1192,7 @@ linked strategy library.
11791192
completeness claim. A build declaring `1.3-parity` cannot be promoted to a
11801193
stable app pin; the app pins it only as a prerelease (`1.6.1-rc.N`), and
11811194
only a completeness proof (EN-115) allows `"1.3"` again. The C layouts stay
1182-
at ABI 4, `PF_ABI_VERSION` stays 4, the selected-window wire version stays
1195+
at ABI 4, `PF_ABI_VERSION` was still 4, the selected-window wire version stays <!-- verified HEAD -->
11831196
1, the phase version 1 and the fingerprint/schema version 2.
11841197
- **Preflight stage timings ([#402]).** `scripts/ci_preflight.py` records `startedAt` (UTC ISO-8601) and `seconds` (monotonic duration; `null` while a stage is running) on each stage and on the top-level `preflight-summary.json` summary.
11851198
- **API documentation (`noindex` on Doxygen source listings and report-schema wording, [#398], [#400]).**
@@ -1519,7 +1532,7 @@ does not update a statically linked strategy library.
15191532
`docker/run_failure_codes.json`). Recording is off until a caller
15201533
turns it on, and nothing a run computes depends on it: trades, reports,
15211534
metrics and every hash are byte-identical, `pf_report_t` and every existing
1522-
symbol are unchanged, and `PF_ABI_VERSION` stays 4. The new members enter
1535+
symbol are unchanged, and `PF_ABI_VERSION` was still 4. The new members enter <!-- verified HEAD -->
15231536
`engine_script_run_v19` without an epoch; a C++ object compiled against an
15241537
earlier v19 header is rebuilt with the library.
15251538
- **A run's report belongs to the call that began it ([#361]).** Once a call
@@ -1607,7 +1620,7 @@ strategy library.
16071620
The C header adds `strategy_get_last_error_code` and
16081621
`strategy_get_last_error_args`, behind `PINEFORGE_HAS_RUN_FAILURE_CODES_V1`.
16091622
No existing C signature, struct layout or enumerator changes:
1610-
`PF_ABI_VERSION` stays 4 and `PF_CAPABILITIES_API_VERSION` stays 1.
1623+
`PF_ABI_VERSION` was still 4 and `PF_CAPABILITIES_API_VERSION` stays 1. <!-- verified HEAD -->
16111624
The native C header and frozen header fixtures are unchanged. The script
16121625
epoch stays `engine_script_run_v19`; *State hashes* below describes the
16131626
recipe additions. *Report keys and provenance* describes the JSON changes
@@ -1733,7 +1746,7 @@ results on that population, not cross-version trade or hash identity.
17331746
the text, so a script's `runtime.error` always reads
17341747
`strategy_runtime_error`, whatever English it copies; an argument is never a
17351748
value the script computed while it ran. Both getters are additive runtime
1736-
exports that every strategy library links, so `PF_ABI_VERSION` stays 4; a
1749+
exports that every strategy library links, so `PF_ABI_VERSION` was still 4; a <!-- verified HEAD -->
17371750
harness looks them up with `dlsym` (Python: `hasattr`), and a library built
17381751
against an earlier runtime lacks them.
17391752
[Run-failure codes](docs/pages/run-failure-codes.md) lists every code, its
@@ -2023,8 +2036,8 @@ pineforge-codegen 1.3.0, the pair the release hub's image
20232036
attaches the three prebuilt tarballs, `pineforge-v1.3.0-linux-x86_64.tar.gz`,
20242037
`pineforge-v1.3.0-linux-aarch64.tar.gz` and
20252038
`pineforge-v1.3.0-macos-universal.tar.gz`, each with a `.sha256`.
2026-
`<pineforge/pineforge.h>` is v1.2.0's byte for byte, so `PF_ABI_VERSION` stays
2027-
4 and `PF_CAPABILITIES_API_VERSION` stays 1; the two confirmed-bar calls are
2039+
`<pineforge/pineforge.h>` was v1.2.0's byte for byte, so `PF_ABI_VERSION` was still 4 <!-- verified HEAD -->
2040+
and `PF_CAPABILITIES_API_VERSION` stays 1; the two confirmed-bar calls are
20282041
per-strategy symbols the generated module defines, not runtime exports.
20292042
`native_c_api.h` and the native C++ host headers are unchanged, so no
20302043
published layout moves; the frozen historical headers and archives are
@@ -2264,7 +2277,7 @@ pairs with pineforge-codegen 1.2.0, the pair the release hub's image
22642277
attaches the three prebuilt tarballs, `pineforge-v1.2.0-linux-x86_64.tar.gz`,
22652278
`pineforge-v1.2.0-linux-aarch64.tar.gz` and
22662279
`pineforge-v1.2.0-macos-universal.tar.gz`, each with a `.sha256`.
2267-
`PF_ABI_VERSION` stays 4: `pineforge.h` only gains declarations and one
2280+
`PF_ABI_VERSION` was still 4: `pineforge.h` only gains declarations and one <!-- verified HEAD -->
22682281
updated comment, and `native_c_api.h` and the native C++ host headers are
22692282
unchanged, so no published layout moves; the frozen historical headers and
22702283
archives are untouched. The script ABI epoch stays `engine_script_run_v19` and
@@ -2540,7 +2553,7 @@ lists the other symbols' feeds a script requests
25402553
installs ([#327]). The GitHub release attaches the three prebuilt tarballs,
25412554
`pineforge-v1.1.0-linux-x86_64.tar.gz`, `pineforge-v1.1.0-linux-aarch64.tar.gz`
25422555
and `pineforge-v1.1.0-macos-universal.tar.gz`, each with a `.sha256`.
2543-
`PF_ABI_VERSION` stays 4: `pineforge.h` only gains declarations, and
2556+
`PF_ABI_VERSION` was still 4: `pineforge.h` only gains declarations, and <!-- verified HEAD -->
25442557
`native_c_api.h` and the native C++ host headers are unchanged, so no published
25452558
layout moves; the frozen historical headers and archives are untouched. The
25462559
script ABI epoch stays `engine_script_run_v19` and the state hashes keep their
@@ -2848,7 +2861,7 @@ A documentation-only release that pairs with pineforge-codegen 1.0.1, the pair
28482861
the release hub's image `ghcr.io/pineforge-4pass/pineforge-release:1.0.1`
28492862
carries. Since v1.0.0 no file under `src/`, `include/`, `cmake/` or
28502863
`examples/`, no CMake file and nothing under `docker/` but its README changed:
2851-
the library, the C ABI (`PF_ABI_VERSION` 4), the native C++ API, the script ABI
2864+
the library, the then-current C ABI (`PF_ABI_VERSION` 4, which was unchanged), the native C++ API, the script ABI <!-- verified HEAD -->
28522865
epoch `engine_script_run_v19` and its state-hash values, and the JSON report
28532866
keys of `docker/run_json.py` (`metrics.equity.sharpe_tv` / `sortino_tv`
28542867
included) are v1.0.0's. The GitHub release attaches the three prebuilt
@@ -2918,7 +2931,7 @@ was never tagged.
29182931

29192932
### Breaking changes: what a 0.x user must act on
29202933

2921-
- **C ABI version 4.** `PF_ABI_VERSION` is 4 (0.13.1: 3). `pf_report_t`
2934+
- **C ABI version 4.** `PF_ABI_VERSION` was 4 in 1.0.0 (0.13.1: 3). `pf_report_t` <!-- verified HEAD -->
29222935
appends `broker_state_hash` and `broker_state_hash_len`, and it is
29232936
caller-allocated, so a mirror built for ABI 3 under-sizes it: update FFI
29242937
mirrors and check `pf_abi_version() == PF_ABI_VERSION` before a run

0 commit comments

Comments
 (0)