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 ff05c78
Browse filesBrowse the repository at this point in the historyBrowse files
memory: state the report-memory bound exactly and add the proofs for it (resident, disk, jailed arena) (#556)
memory: state the report-memory bound exactly and add the proofs for it (resident, disk, jailed arena)
The memory-management page said the default sink route keeps the equity
curve out of memory, but not what still grows with the bar count, and that
a jailed run without --report-sink-fd has no sink. It now states, with
sources: the resident equity-report buffers are bounded on the default
unjailed sink route; the curve scratch costs 24 B per script bar on disk
(6 MiB at 262,144 and 48 MiB at 2,097,152 bars) with the E output and the
JSON artifact; in a jailed run the scratch is the RAM-backed arena, so the
same 24 B per script bar are memory there, sized by the hosting wrapper and
failing closed with arena_exhausted; sink-off callers keep the native curve
plus an owning report copy. "O(1) in bars" is not claimed for the jailed
arena or the sink-off path.
Removed text, named. The page text below was introduced by 6d2bf95 (docs:
add the memory-management page, #531) and 30e9f9a (docs: memory-management
page re-read against main after the 1.8.0 changes, #546):
- the section "Use the report sink for bounded memory" is replaced by
"Report memory: resident buffers, disk and the jailed arena" (its line
citations were re-read and corrected);
- the phrase "a bounded default route is planned, with no release date" and
the sentence "Install a report sink; no release date for the default
route" are removed from the report-memory table (the page documents the
route as it is);
- the two sink rows of that table are reworded to separate resident buffers
from disk and arena growth; the sentences about the heap bound of the
equity curve and the ledger, the sink file growth, and the legacy FULL sink
route are rewritten into the new section, and the release container's
default profile sentence of 30e9f9a is replaced by the route table.
Tests: a two-size resident proof for the report scratch curve (N = 262,144
and 8N script bars, RSS growth within 1 MiB, scratch growth exactly 24 B per
added bar, metric block bit-equal to the sink-off result); a corpus
projection test that the temporary-sink route and the sink-off route give
bit-identical metrics and diagnostics on real modules (it replaces the
named-sink summary comparison on corpus modules that this test did before,
and still skips when its manifest variable is unset). Both report-memory
rows are pinned as slow rows (61 pinned names) and registered before the
CR-150 include block. The binary-route peak-RSS row is left out of this
change: its 9-minute wall exceeds the CI leg budget.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
ci: count the array-growth slow row with the report-memory slow row (62 pinned names)
Both the report-memory change and the paged array store added one pinned slow
row each on top of 60, and git merged the two identical edits of the count
into 61. The pinned set now holds 62 names: 43 from the PINEFORGE_PR_SLOW_TESTS
loop and 19 direct CMake LABELS assignments.
The test assertion on len(PINNED_SLOW_TEST_ROWS) and the four sentences in
docs/ci.md that state the count and its split (introduced by 3ea5a0d, ci:
split the long test rows, shard the full CI legs and run them on the larger
hosted runners, #544, and rewritten by the report-memory change) are updated
to 62 and 43 + 19. No other text is removed.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
ci: update the slow-row count literals in test_ci_preflight to 62, 43 and 19
test_documented_slow_row_counts_match_literal_population pins the three
numbers that docs/ci.md states for the pinned slow rows (all, from the
PINEFORGE_PR_SLOW_TESTS loop, direct LABELS assignments) and two sentences that
repeat them. The previous commit moved the documented count from 61 to 62
(43 + 19) but left this test at 61, 43 and 18, so test_ci_preflight_slice_6
failed on every profile. The test now states 62, 43 and 19. Only those literals
change.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
memory: move three docker/run_json.py citations after the bulk equity copy
The bulk path-sink equity copy added code above the report-sink helpers in
docker/run_json.py, so the three line ranges the memory-management page cites
for _ReportSink, _build_sink_report and _prepare_stream_report no longer
contained their symbols (doc-anchors: SYMMISS). The ranges now read 6183-6220,
7102-7148 and 6983-7003. Citation numbers only: no sentence is added, removed
or reworded.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Also rewritten: the 60-name slow-row counts in docs/ci.md introduced by 3ea5a0d (ci: split the long test rows ..., #544), now 62 = 43 + 19 (the report-memory row and #547's array-growth row); the Pine product host row of the report-memory table in docs/pages/memory-management.md introduced by 27cd77b (engine 1.8.0: cohort tables ..., #541), reworded to separate resident buffers from disk and arena growth.
Copy file name to clipboardExpand all lines: docs/ci.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -265,8 +265,8 @@ registry-name or exclusion-name fields; the default exclusion still adds
265
265
selected discovery and strict `ctest-exclusion` checks.
266
266
267
267
**Slow-label bound, 2026-10-24:**`PINNED_SLOW_TEST_ROWS` in
268
-
`scripts/ci_verify.py` pins all 60 source-labelled names: 43 from the
269
-
`PINEFORGE_PR_SLOW_TESTS` loop and 17 direct CMake `LABELS` assignments; the four report slices replace one direct name (+3), and the report and command-after covers remain outside the slow set.
268
+
`scripts/ci_verify.py` pins all 62 source-labelled names: 43 from the
269
+
`PINEFORGE_PR_SLOW_TESTS` loop and 19 direct CMake `LABELS` assignments; the four report slices replace one direct name (+3), and the report and command-after covers remain outside the slow set.
270
270
Every name listed by `ctest -N -L slow` must belong to that set; conditional
271
271
registration may omit names. An unpinned name fails `ctest-exclusion` on
272
272
plain and 1/1 runs, or `ctest-shard-discovery` for multiple shards, with the
@@ -1422,9 +1422,9 @@ fewer of the 43 than Release does. `live-sanitizers`, `live-tsan` and the
1422
1422
parity subset keep their existing selections.
1423
1423
1424
1424
**The slow-label inventory also includes rows with direct labels:**
1425
-
The timing list contains 43 names, and 17 additional names are pinned for
1425
+
The timing list contains 43 names, and 19 additional names are pinned for
1426
1426
direct `LABELS` assignments in `tests/CMakeLists.txt` and
1427
-
`tests/cr150.d/*.cmake`, making 60 distinct pinned slow names.
1427
+
`tests/cr150.d/*.cmake`, making 62 distinct pinned slow names.
1428
1428
`PINNED_SLOW_TEST_ROWS` bounds the discovered exclusion by those names,
1429
1429
independent of the registered count; each profile may register a subset.
There is no RAM fallback (the comment on `ScratchFile`
108
+
include/pineforge/detail/scratch_file.hpp:30-36).
109
+
110
+
A **jailed run without `--report-sink-fd` has no sink at all**:
111
+
`_new_report_sink` docker/run_json.py:5790-5807 returns `None`, so it retains
112
+
the native curve and owning FULL report copy described above. It also builds
113
+
the whole report text in memory before writing stdout, and that text is the
114
+
largest per-bar term of this route: measured at 8,000,000 bars (kernel peak
115
+
RSS slope, stdout byte-equal), about five bytes per stdout byte (one byte of
116
+
text plus a four-byte-per-character buffer), for example 363 B per bar for a
117
+
module with 63 B per bar of stdout and 767 B per bar for one with 144 B per
118
+
bar. This is `O(output)`: it is the report the caller asked for.
119
+
**"O(1) in bars" is not claimed for the jailed arena or the sink-off path.**
120
+
These report bounds also exclude input mappings, strategy histories and the
121
+
other stores listed on this page.
122
+
123
+
For the plain `.bin` input route the input file is mapped, 48 B per bar of file
124
+
payload (`_map_bar_file` docker/run_json.py:2685-2708), and the touched pages
125
+
count toward resident size as the run reads them. A read of the source sites
126
+
in `load_bars_bin` (docker/run_json.py:2779-2811) finds no further per-bar copy of the chart, but
127
+
this page publishes no measured figure for the route and does not give the
128
+
reading as a bound; the sink and arena paragraphs above govern the report
129
+
bytes.
66
130
67
131
## What you can set {#memory_controls}
68
132
@@ -220,10 +284,10 @@ or bounds the row.
220
284
221
285
| What | Grows with | Where it lives | Fix |
222
286
| --- | --- | --- | --- |
223
-
| C or C++ host with no sink, and jailed Python without `--report-sink-fd` (the default route of the C API): equity curve |`N`: 24 B per script bar | Heap (a vector, so spare capacity is extra) |Install a report sink (above); a bounded default route is planned, with no release date|
224
-
| Same route (no sink): closed trades |`T`: 168 B plus text per trade | Scratch, with 64 descriptor rows resident and a read cache of up to 65,536 entries (312 B each, allocated as trades accumulate); the FULL report built from them is `O(T)` heap | Install a report sink; no release date for the default route|
225
-
|Any report sink installed (native or Pine host, history streamed or not) |The heap is bounded for the equity curve (one held point and one 64 KiB batch) and for the ledger (64 descriptor rows and a 128-entry read cache). The trailing block of rows that share the last exit time stays resident only when history is streamed (`K` lots closed at one time, `O(K)`). The sink file and the scratch curve grow with the run | Heap, scratch and the sink file or stream | Not applicable |
226
-
| Pine product host (`PineStrategyHost`) | It cannot select `STREAMED` or `SUMMARY_ONLY`. With a sink installed and the default report mode (the legacy route) its report storage is bounded as in the row above: the curve through the scratch writer (`ScratchCurveWriter` at `src/engine_report.cpp:1211`), selected by the Pine host's report policy (`KernelRecordedAtHostMarks` at `src/source/pine_adapter.cpp:3039`) and the install condition (`report_policy` at `src/engine_report.cpp:1205`); and the ledger at 64 descriptor rows (`kResidentRows` at `include/pineforge/trade_ledger.hpp:38`) with the 128-entry sink read cache. Adapter state (placement rows, settled bracket families, script containers) is separate and has its own rows below |Heap bounded for the report; adapter state as the rows below | Not applicable |
287
+
| C/C++ or Python host with no sink, including jailed Python without `--report-sink-fd` (the default route of the C API): equity curve |`N`: 24 B per script bar plus vector spare capacity, then another 24 B per bar for the owning FULL report copy when the default FULL report is built, plus the whole report text held until written (`O(output)`, about five bytes per stdout byte on the jailed route; see [Report memory](#memory_sink)); sources in [Report memory](#memory_sink)| Heap |Install a report sink (no bounded default route exists in this release); account for disk scratch or jailed arena memory as above|
288
+
| Same route (no sink): closed trades |`T`: 168 B plus text per trade | Scratch, with 64 descriptor rows resident and a read cache of up to 65,536 entries (312 B each, allocated as trades accumulate); the FULL report built from them is `O(T)` heap | Install a report sink |
289
+
|Default report sink route (native or Pine host, history streamed or not) |Equity-report buffers are bounded (an editable tail and one 64 KiB writer batch, plus bounded metric-read windows); the ledger has 64 descriptor rows and a 128-entry read cache. The trailing block of rows that share the last exit time stays resident only when history is streamed (`K` lots closed at one time, `O(K)`). Binary curve scratch grows at 24 B per script bar; `E` output and the default path route's JSON artifact also grow | Disk scratch without an arena; RAM-backed scratch in the jailed arena, plus resident buffers and the sink file or stream; sources in [Report memory](#memory_sink)| Not applicable |
290
+
| Pine product host (`PineStrategyHost`) | It cannot select `STREAMED` or `SUMMARY_ONLY`. With a sink installed and the default report mode (the legacy route) its resident equity buffers and ledger cache are bounded as in the row above: the curve through the scratch writer (`ScratchCurveWriter` at `src/engine_report.cpp:1211`), selected by the Pine host's report policy (`KernelRecordedAtHostMarks` at `src/source/pine_adapter.cpp:3039`) and the install condition (`report_policy` at `src/engine_report.cpp:1205`); and the ledger at 64 descriptor rows (`kResidentRows` at `include/pineforge/trade_ledger.hpp:38`) with the 128-entry sink read cache. Adapter state (placement rows, settled bracket families, script containers) is separate and has its own rows below |Resident equity buffers and ledger cache bounded; curve scratch grows on disk or in the jailed RAM-backed arena; adapter state as the rows below | Not applicable |
227
291
| A touched dormant leg that is re-issued | One placement row per re-issue, until the position cycle ends or the origin closes; an untouched re-issue with the same exit id replaces its row in place | Heap | Planned, with no release date |
228
292
| Settled bracket families | One fixed record per archived family, which grows with `T` on a bracket strategy; not measured | Heap | Not scheduled |
229
293
| Pending-book reads |`R`: `O(R^2)` for a size or a late indexed copy, `O(P R^2)` for a full indexed walk of `P` projected rows, up to `O(R^3)` when `P = R`; this is time, and it was already so in v1.6.3 | CPU | Planned, with no release date |
0 commit comments