You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d220bd7
Browse filesBrowse the repository at this point in the historyBrowse files
cr150-q7: cooperative SIGTERM abort at a completed input-bar boundary
Flag-only native SIGTERM handler (volatile sig_atomic_t store, no calls in
the handler). The pump stops after a completed input bar, the sink writer
flushes the whole-record prefix and closes fd 4 without a trailer, and the
invocation emits one typed run_aborted line (args.bars_count,
args.strategy_started, bars.count and strategy_started mirrors) before
exiting 1. Python blocks SIGTERM during startup so a pre-start signal is
reported instead of lost, and never installs a Python signal callback.
Catalog: run_aborted gains the two optional arguments and a boolean kind.
Class ruling (CORE-TOP, lane commit 8d16e20, applied by hand here): no
cancelled class, no retry field, fd 6 unused; its wording change in
docker/run_failure_codes.json is part of this commit.
(cherry picked from commit ffa4535 of lane core-cr150-batchc; applied on the
O(1) integration line by the supervisor with the 8 conflicts resolved by lane
o1w-merge0 round 10: README, run_json.py (Q7 fd ownership combined with the
jailed fd/path/admission rules and selected named-sink support), ABI inventory
union counted from the merged files (91 runtime definitions, 111 runtime-header
declarations, 156 over six headers), c_abi.cpp, native_execution_consumer.hpp,
tests/CMakeLists.txt with Q7's two registrations appended.)
KNOWN OPEN: docker/run_failure_codes_diff.json, src/run_failure_registry.inc and
docs/pages/run-failure-codes.md are STALE against the edited
docker/run_failure_codes.json (Q7 run_aborted arguments and wording, the
scratch_io_failed split); regenerate off the Mac and commit on top.
NOT VERIFIED: nothing was compiled or run on this commit.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ The separate PineForge compiler, [`pineforge-codegen`](https://github.com/pinefo
33
33
-**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.
34
34
-**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.
35
35
-**Deterministic to the bit.** Two runs with the same inputs produce identical trade lists. Same on Linux and macOS.
36
-
-**Yours to embed.**153`PF_API` declarations across six installed headers — `pineforge.h`'s 97 (77 of the 88 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.**156`PF_API` declarations across six installed headers — `pineforge.h`'s 100 (80 of the 91 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.
37
37
38
38
Recorded outputs and their additional API declarations described here are
39
39
part of **1.5.0**.
@@ -519,11 +519,11 @@ is in [CHANGELOG.md](CHANGELOG.md).
519
519
520
520
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.
521
521
522
-
A newly generated strategy `.so` exposes 104 compiled-strategy `PF_API` declarations
523
-
(88 runtime implementations plus sixteen generated exports) plus 43 native-host
524
-
declarations: 147`PF_API` exports in total; `use_bar_magnifier = true` adds
522
+
A newly generated strategy `.so` exposes 107 compiled-strategy `PF_API` declarations
523
+
(91 runtime implementations plus sixteen generated exports) plus 43 native-host
524
+
declarations: 150`PF_API` exports in total; `use_bar_magnifier = true` adds
525
525
`strategy_declares_bar_magnifier` and a module that records [outputs](docs/outputs.md) its
526
-
three outputs exports, bringing the inventories to at most 108 and 151. Older modules lack the six opt-in
526
+
three outputs exports, bringing the inventories to at most 111 and 154. Older modules lack the six opt-in
527
527
[checked-settings exports](docs/checked-settings.md). Older modules can also lack
528
528
the two opt-in [execution-capability exports](docs/strategy-capabilities.md).
529
529
In an optimized build `nm -gU` also shows libc++'s
@@ -557,6 +557,7 @@ inventories are pinned by `scripts/check_c_abi_runtime.py`:
557
557
|`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 |
558
558
|`strategy_request_abort` / `strategy_last_run_status`| Cooperative abort of a run in progress; `0`=completed, `1`=aborted |
559
559
|`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) |
560
+
|`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 |
560
561
|`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 |
561
562
|`strategy_set_probe_suppress_tail_logic`| ABI v4: the last bar runs only the broker's pre-`on_bar` steps (pending-order settlement, intraday-cap/loss checks) and returns — no `on_bar`, no margin-call / `process_orders_on_close` second pass / bracket-reissue processing (the range-end row is `strategy_set_realtime_tail`'s to skip; the flags are independent) |
562
563
|`strategy_set_path_order` / `strategy_last_bar_dual_entry_path`| ABI v4: force the intrabar O→H/L→C leg order (`AUTO`/`HIGH_FIRST`/`LOW_FIRST`) for path-dependent fill probing; read which side won a same-bar dual-entry-stop arbitration |
Copy file name to clipboardExpand all lines: docker/run_failure_codes.json
+12-2Lines changed: 12 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1107,9 +1107,18 @@
1107
1107
"since": "1.5.0"
1108
1108
},
1109
1109
"run_aborted": {
1110
-
"args": {},
1110
+
"args": {
1111
+
"bars_count": {
1112
+
"kind": "integer",
1113
+
"optional": true
1114
+
},
1115
+
"strategy_started": {
1116
+
"kind": "boolean",
1117
+
"optional": true
1118
+
}
1119
+
},
1111
1120
"class": "engine_fault",
1112
-
"description": "The run was aborted on request.",
1121
+
"description": "The run was aborted on request. Cooperative SIGTERM stops after the in-flight input bar completes, leaves no sink trailer, and exits 1. bars_count is the nonnegative number of fully completed input bars, mirrored as top-level bars.count, matching the runner's bars_processed population; strategy_started is a boolean mirrored at the top level. Both are optional for legacy abort raisers. There is no cancelled class: the abort path has exactly two internal callers, the orchestrator's hand-off at the service limit (the run is restarted with the same run id) and an operator stop. The abort line itself carries no retry semantics: it has no retryable field, and a retry is APP's decision from which caller stopped the run. On the abort path bars_count is diagnostic only and is never billed. No live-counter descriptor is used (fd 6 is not used).",
1113
1122
"english": [
1114
1123
"native run aborted"
1115
1124
],
@@ -2098,6 +2107,7 @@
2098
2107
}
2099
2108
},
2100
2109
"kinds": {
2110
+
"boolean": "A JSON boolean.",
2101
2111
"identifier": "A name the compiled strategy spells as a literal (a built-in, an argument).",
0 commit comments