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 665a917
Browse filesBrowse the repository at this point in the historyBrowse files
Two ADR rows: the residue is deleted and the pair has no writer (R5 lane E6, item 3)
ADR-0001 on this branch predates lane L14-C's rewrite, so this is the smallest
edit that keeps it true, and it is exactly the two rows the lane moved.
1. Rule 5 ("Boundary rules") now records what it still covers. The comment
residue it covered is deleted -- the four spans L14-C tabulated, cited at
0a47cbf so the reader can find them in history -- and the last kernel
state a host wrote, PyramidEntry::skip_entry_bar_high / _low, has no writer
outside the kernel. What rule 5 still covers is the STORAGE of that pair.
2. A second row in "Kernel state the adapter sets -- the mechanism rulings",
beside ta::ema_na_warmup_flag: the mask pair, its new declaration seam, its
rule-2 argument on both halves, its two pinning suites, and the exact
mechanism that removes it at the next epoch (the owner keys its own tables
by entry_incarnation already, and the kernel's own fallback reader behind
`preceding_exit_path_prefix` has no writer anywhere in the tree, so it is
unreachable in every run).
The row adds four identifiers to the residual gate's first-column vocabulary
(`skip_entry_bar_high`, `skip_entry_bar_low`, `PyramidEntry`,
`ClosedLotExcursionFacts`); none matches a residual pattern, so the 106
vocabulary-matching identifiers the gate enforces are unchanged.
For the integrator carrying this onto r5/L14C, which rewrites the same file:
its section A table (`:468-490`) becomes "deleted by lane E6" and its
consequence bullet (`:595-598`) loses the "312 lines" claim; its section B row
for the pair (`:510`) and its "Current state vs. target" bullet (`:274-277`)
take the new writer. Both of this lane's edits are the same two facts.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit bb64f2ae54e6e0ab667bbba4bd299988e65c0f10)
Copy file name to clipboardExpand all lines: docs/adr/0001-kernel-adapter-boundary.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -382,6 +382,7 @@ see a mechanism, so these rows are held by reading, not by the checker):
382
382
| kernel state | who writes it | ruling |
383
383
|---|---|---|
384
384
| `ta::ema_na_warmup_flag()` — the thread-local ambient default for `ta::EmaSeeding`, `false` = `FirstValue`, `true` = `SimpleAverage` (`include/pineforge/ta.hpp`, `src/ta_moving_averages.cpp`) | three source-layer RAII scopes (`PineStrategyHost` chart dispatch, `pine_security_eval.cpp`, `pine_aux_security.cpp`) raise it around one evaluation context under the opt-in `chart_ema_na_warmup` / `security_range_start_na_warmup` run flags; nothing in the kernel raises it | **retained as a generic ambient indicator option** (R5 lane P2). An EMA seeds from its first finite input or from the simple average of its first `length` inputs; both are textbook, and the kernel names them per instance (`EMA(length, EmaSeeding)`), which is a bare host's spelling and touches no global. The ambient default is what an instance that names no seeding latches on its first `compute()`: a thread-local default for a per-computation option, the shape of a floating-point rounding mode, and the only zero-wiring way to seed every instance of one evaluation context when the generated strategy constructs its own `ta::EMA` members (so relocating it into the source layer would take a codegen change). The adapter uses it the way any host may; the kernel's spelling and comments carry no TradingView vocabulary. The accessor's name is kept: `na` is the kernel's own NaN spelling and eight twin-parity-frozen CHECK texts of `test_chart_ema_na_warmup` spell it. |
385
+
| `skip_entry_bar_high` / `skip_entry_bar_low` — one physical lot's entry-bar excursion mask (`PyramidEntry`, `include/pineforge/engine.hpp`): the end of the lot's entry bar the modeled path had already reached before that lot's own opening fill, folded into the run hash (`src/engine_state_hash.cpp`) and handed back to the excursion owner on the closing row's `ClosedLotExcursionFacts` | **no host, since R5 lane E6.** The owner of the lot's excursion (RULING A48, `owns_lot_excursions`) declares where its fill sat — `declare_opened_lot_entry_bar_mask` with `OpenedLotFillPoint::OnPath` or `::AfterPath` — and the kernel derives both flags from the bar's own path geometry (`bar_path_uses_high_first`, `first_touch_position`). The source adapter's two former writer sites in `PineStrategyHost::on_native_applied` are two calls; nothing outside the kernel assigns a lot's flags | **retained as the entry-side half of RULING A48** (R5 lane E6). It is generic under rule 2: what the declaration carries is where a fill sat on a bar, which any venue's host can answer, and the platform-specific half — which of ITS orders is a priced entry — stays in the adapter that knows it. It is not a knob under rule 2b: the leg order and the first-touch position are decisions the run has already made, in the matcher and in the closing row, and a host that wants the leg order stated says so once through `NativeRunSpec::path_order`. Pinned by `tests/test_e6_entry_bar_mask_declaration.cpp` (kernel-only) and `tests/test_l10d_entry_bar_excursion_masks.cpp` (the adapter's rows). **Removable at the next epoch, and only then:** the two booleans are durable lot state folded into the run hash, inside a POD the settlement ABI freezes, so dropping them moves the hash stream and a layout. The mechanism that replaces them needs no kernel storage — the excursion owner already keys its own tables by `entry_incarnation`, so it can keep the mask beside them and pass it in the facts it receives — and the kernel's own fallback that reads the pair (`src/engine_orders.cpp`, behind `preceding_exit_path_prefix`) has no writer anywhere in the tree, so it is unreachable in every run. |
385
386
386
387
What N14 moved out of the archive, so the tables above are complete: the `barmerge` merge-flag rule
387
388
(→ `src/source/pine_security_eval.cpp`), the `PineMatrix` / `PineGenericMatrix` names (→
@@ -599,7 +600,16 @@ than as violations:
599
600
stay byte-identical by construction (`docs/design/native-feature-parity.md` §3.1).
600
601
4. codegen emits translation + attachment, never runtime.
601
602
5. The residual TradingView-shaped state in `engine.hpp` is legacy to be *extracted into the
602
-
adapter over time*, not a precedent to copy.
603
+
adapter over time*, not a precedent to copy. R5 lane E6 closed what was left of it in two
604
+
ways. The **comment residue** — the four spans lane L14-C tabulated, 312 lines at `0a47cbf7`
605
+
in `src/engine_orders.cpp` (`:200-224`, `:530-697`), `src/engine_run.cpp` (`:148-186`) and
606
+
`include/pineforge/engine.hpp` (`:918-952`, `:1215-1381`), every one of them describing a
607
+
function the R5 lowerings deleted — is **deleted**, each span replaced by one sentence naming
608
+
the live generic mechanism. The **last kernel state a host wrote**,
609
+
`PyramidEntry::skip_entry_bar_high` / `_low`, is no longer written by any host: the excursion
610
+
owner declares its lot's fill point and the kernel derives the flags (the row in "Kernel state
611
+
the adapter sets" above). What rule 5 still covers is the *storage* of that pair, which is
612
+
hashed and therefore cannot move before the next epoch.
603
613
6. A `NativeRunSpec` field the adapter does not declare is a decision, not an omission: the change
604
614
that adds the field adds its row to "Kernel capabilities the Pine adapter does not declare" —
605
615
native-only (with a native example and a test), adapter-policy or adapter-hook — and the change
0 commit comments