Skip to content

Commit 409ebad

Browse files
committed
fix(v19 KERNEL-EDGE): repair FX and calendar edges, expose host marks
Keep synchronous current-execution points out of the walked FX predecessor marks, and derive stream session-day neighbours from eligible calendar slots. Calculate a final pending script bucket at a complete batch end or stream_end(true) only when its contributing input reached the session close; warmup and stream_end(false) carry it. Expose KernelRecordedAtHostMarks through a C++ host call, document FeedTolerant warmup, and pin the four failures in a source-free test. Unreleased v19 value move, once in this commit: re-pin tests/test_native_calendar_hash_witness.cpp ny_daily_over_hourly (digest 0x12d290fd048a6c7c -> 0xfa85a7f9a92aea39; calculated bars 12 -> 13; driver rows 48 -> 52; trades 1 -> 2) because the final calendar-closed daily bucket now calculates. Update the final-batch sequence witness in test_native_htf_subscriptions_stream; the stream_end(false) and warmup sequences stay pending. Full remote profiles and corpus identity judge the final tree. (cherry picked from commit 6cded2c420b6e16ca13da16674d507871cccad34) INT25 merge: the floors add this lane's row to C-SURFACE-1's (kernel 273, release 674; CI-LITE's EXCLUDED_REGISTERED_MIN kept). The six pages merge on digit-normalised text (int16_digit_merge, a citation both sides moved mapped from this lane's tree); 80 anchors the lane's pages kept unmoved over its own native_execution_consumer.cpp / native_c_api.h / native_run_spec.hpp edits are carried through the exact line map (int24_exact_reanchor). Every anchor cites the text one parent cited (verify_carry: 1672 exact, 6 = the floor lines).
1 parent c6e0bb7 commit 409ebad

19 files changed

Lines changed: 786 additions & 401 deletions

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ What each gate refuses:
149149
### The floors
150150

151151
`ci_verify.py` counts the CTest rows that actually **ran** and fails below a
152-
floor — `KERNEL_MIN_TESTS` ci_verify.py:230 and `RELEASE_MIN_TESTS`
153-
ci_verify.py:333.
152+
floor — `KERNEL_MIN_TESTS` ci_verify.py:231 and `RELEASE_MIN_TESTS`
153+
ci_verify.py:335.
154154
A deleted or silently skipped row is a failure, not a quieter run. If your
155155
change adds rows, raise the floor in the same commit and say by how much; if it
156156
legitimately removes one, lower it deliberately and say why. `--min-tests`

‎docs/adr/0001-kernel-adapter-boundary.md‎

Lines changed: 68 additions & 54 deletions
Large diffs are not rendered by default.

‎docs/design/native-feature-parity.md‎

Lines changed: 74 additions & 74 deletions
Large diffs are not rendered by default.

‎docs/pages/contributing-llm.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ finding to report, not a step to take.
106106
coverage claim.
107107

108108
10. **A test row never silently disappears.** Each profile counts the rows that
109-
*ran* against a floor: `KERNEL_MIN_TESTS` ci_verify.py:230 and
110-
`RELEASE_MIN_TESTS` ci_verify.py:333. Adding rows means raising the floor
109+
*ran* against a floor: `KERNEL_MIN_TESTS` ci_verify.py:231 and
110+
`RELEASE_MIN_TESTS` ci_verify.py:335. Adding rows means raising the floor
111111
in the same commit.
112112

113113
## The recipe for a lane
@@ -227,7 +227,7 @@ decision, and removing one is a regression:
227227
| `NativeRunSpec::report_open_position_at_end` and the adapter's range-end rows | TradingView's range-end report re-marks the curve's last point and re-folds every extreme from it: report *shape*, not a mark-to-market row. | ADR 0001 ruling table, row `report_open_position_at_end`; design `native-feature-parity.md:615` |
228228
| `subscriptions` in the spec and the adapter's begin-time declaration | the adapter declares the same kernel subscriptions through a hook instead of the field, so a plain `request.security` site really is a kernel subscription. | ADR 0001 ruling table, row `subscriptions` |
229229
| the kernel's auxiliary feed and the adapter's auxiliary drive | the adapter's chart slice leaves pre-range coverage inert where the kernel folds by time, and evaluates after the bar's matching pass where the kernel delivers before it. | ADR 0001 ruling table, row `auxiliary_feed` |
230-
| `FeedTolerant` / `LegacyTolerant`, `NativeFeedTolerance` / `NativeLegacyTolerance` | deprecated spellings kept as exact aliases so existing hosts and the adapter compile unchanged; same value, same hash. | native_run_spec.hpp:310 and native_run_spec.hpp:352 |
230+
| `FeedTolerant` / `LegacyTolerant`, `NativeFeedTolerance` / `NativeLegacyTolerance` | deprecated spellings kept as exact aliases so existing hosts and the adapter compile unchanged; same value, same hash. | native_run_spec.hpp:311 and native_run_spec.hpp:353 |
231231

232232
## Glossary
233233

@@ -241,7 +241,7 @@ policy layer that *uses* kernel features. Where every TradingView rule lives.
241241

242242
**front door** — one of the three ways in: PineScript through codegen, C++
243243
through `NativeStrategyHost` native_host.hpp:826, or C through the
244-
`strategy_native_*` surface `sha256:1a4d41202e1b32a33ab75c2e42a36285ccb1d061087a8db1c19162b244c5b29f` native_c_api.h:2607.
244+
`strategy_native_*` surface `sha256:1a4d41202e1b32a33ab75c2e42a36285ccb1d061087a8db1c19162b244c5b29f` native_c_api.h:2609.
245245

246246
**twin** — a test unit compiled twice, once against a frozen historical header
247247
closure and once against the current one, so a behaviour change has to be
@@ -253,7 +253,7 @@ measurement that produced it, so a later change to it is visible as a change to
253253
the record, not as an edit to a literal.
254254

255255
**floor** — the minimum number of CTest rows a profile must actually run
256-
(`KERNEL_MIN_TESTS` ci_verify.py:230, `RELEASE_MIN_TESTS` ci_verify.py:333). It
256+
(`KERNEL_MIN_TESTS` ci_verify.py:231, `RELEASE_MIN_TESTS` ci_verify.py:335). It
257257
counts rows that ran, so a skipped row does not pad it.
258258

259259
**receipt** — the recorded evidence an ABI-comparison row needs (a prepared

‎docs/pages/live-surface.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ configuration**, not one-shot: it stays in effect until a caller passes
6868
day), pinned to agree with the `i+1` lookahead on every interior bar of
6969
the 24x7 lanes. Since R5 lane F5 that is the kernel's answer, not the
7070
host's: the tail bar reads `NativeDecisionContext::closes_session_day_open_ended`
71-
(`market_driver.hpp:157`), the same fact as `closes_session_day` on every
71+
(`market_driver.hpp:158`), the same fact as `closes_session_day` on every
7272
bar except a batch's final one, which it reads off the calendar instead
7373
of the run end. Historical bars read early closes correctly from the
7474
session day alone, with no holiday calendar; a *forming* tail bar

‎docs/pages/native-engine.md‎

Lines changed: 46 additions & 37 deletions
Large diffs are not rendered by default.

‎docs/pages/pine-to-native.md‎

Lines changed: 157 additions & 157 deletions
Large diffs are not rendered by default.

‎include/pineforge/market_driver.hpp‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,21 +129,22 @@ struct NativeDecisionContext {
129129
// day across local midnight). Every callback of the bar carries the same
130130
// four: its open, its sub-bars and ticks, its calculation, and every fill
131131
// and recalculation on it.
132-
// in_session the script bar's label is in session.
132+
// in_session the script bar has an eligible instant in session.
133133
// opens_session_day in session, and the bar before it is not, or is on
134134
// another session day.
135135
// closes_session_day in session, and the bar after it is not, or is on
136136
// another session day.
137137
// "The bar before / after" is the one the run holds — the batch input or
138-
// stream warmup being consumed — and otherwise the calendar's slot one
139-
// script width away. At the run's own edges nothing is held: its first bar
138+
// stream warmup being consumed — and otherwise the calendar's previous
139+
// or next eligible input slot, across declared breaks. At the run's own
140+
// edges nothing is held: its first bar
140141
// opens its session day, and a batch's final bar closes it, because a
141142
// batch is complete input; a stream reads on, because it continues.
142143
// closes_session_day_open_ended
143144
// closes_session_day for a run whose input goes on
144145
// past it: a batch's final bar, which nothing held
145-
// follows, is judged by the calendar one script width
146-
// on, exactly as a stream's bar is, instead of by the
146+
// follows, is judged by the calendar's next eligible
147+
// input slot, exactly as a stream's bar is, instead of by the
147148
// run's end. Every other bar reads closes_session_day.
148149
// It is what a host that recomputes a batch whose
149150
// last input is still forming reads for that bar.

‎include/pineforge/native_c_api.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
* strategy_native_execute_current_v1 answers the same verdicts as
104104
* pf_native_execute_outcome_e and pf_native_refusal_e
105105
* [C] execute_current strategy_native_execute_current_v1
106+
* [--] mark_native_report_point the C spec does not name KernelRecordedAtHostMarks,
107+
* so a C host cannot select its mark cadence
106108
* [C] native_series_bar strategy_native_series_bar_v1
107109
* [C] declare_timeframe_subscriptions strategy_native_declare_subscriptions_v1 -- a row is
108110
* pf_native_subscription_v1, whose `lookahead` / `gaps` bools are

‎include/pineforge/native_host.hpp‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,14 @@ class NativeStrategyHost : public BacktestEngine {
10761076
/// C spelling: strategy_native_execute_current_v1.
10771077
NativeCurrentExecutionResult execute_current(const NativeCurrentExecution&);
10781078

1079+
/// Append one kernel-owned equity point at this host's report mark.
1080+
/// Returns true only in a running KernelRecordedAtHostMarks run; false
1081+
/// changes nothing. Call at the desired mark inside a native callback.
1082+
/// This is reporting only: it does not book cash or place an order. A
1083+
/// host that records per-point broker hashes still owns those hash rows.
1084+
/// No C spelling: the C spec cannot select KernelRecordedAtHostMarks.
1085+
bool mark_native_report_point(int64_t report_ts);
1086+
10791087
/// The latest completed bucket delivered for a declared subscription, or
10801088
/// nullopt before its first delivery / for an unknown index. Legal inside
10811089
/// every native callback, including on_native_timeframe_bar itself. A

0 commit comments

Comments
 (0)