Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docker/run_failure_codes.json
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,8 @@
"max_bars_back",
"matrix_elements",
"udt_objects",
"drawing_ids"
"drawing_ids",
"live_drawings"
]
},
"max": {
Expand All @@ -822,7 +823,8 @@
"box drawing ID domain exhausted",
"label drawing ID domain exhausted",
"linefill drawing ID domain exhausted",
"generic drawing ID domain exhausted"
"generic drawing ID domain exhausted",
"The script keeps more than {max} live drawings of one type; the configured drawing capacity is exceeded."
],
"retryable": false,
"since": "1.4.0"
Expand Down
8 changes: 5 additions & 3 deletions docker/run_failure_codes_diff.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"to": {
"version": null,
"unreleased": true,
"catalogSha256": "d4a555dcea58c5d7a4c3a0f2223832acb04361f6eebda5f4a642226df4a5067f"
"catalogSha256": "00b60fe00cb9371b5e5be06f671217e3d14ed0f612434dae640bed2aabddd699"
},
"catalogSchema": {
"before": "pineforge-run-failure-catalog/v1",
Expand Down Expand Up @@ -238,7 +238,8 @@
"max_bars_back",
"matrix_elements",
"udt_objects",
"drawing_ids"
"drawing_ids",
"live_drawings"
]
},
{
Expand All @@ -262,7 +263,8 @@
"box drawing ID domain exhausted",
"label drawing ID domain exhausted",
"linefill drawing ID domain exhausted",
"generic drawing ID domain exhausted"
"generic drawing ID domain exhausted",
"The script keeps more than {max} live drawings of one type; the configured drawing capacity is exceeded."
]
}
]
Expand Down
10 changes: 5 additions & 5 deletions docs/design/BARS-BIN-INPUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ Selected-window selection includes a report policy, any window option or
`--validate-window-only` (`_selected_requested` docker/run_json.py:4699).
The refusals above use the ordinary request code, not a window-specific
code (`_request_invalid` docker/run_json.py:4465). The catalog names
`run_request_invalid` docker/run_failure_codes.json:1538 and includes the
option `ohlcv_bin` docker/run_failure_codes.json:1563.
`run_request_invalid` docker/run_failure_codes.json:1540 and includes the
option `ohlcv_bin` docker/run_failure_codes.json:1565.
These request refusals exit 1 and emit the failure JSON line on stdout
(`exit_status` docker/run_json.py:4465; `write_failure`
docker/run_json.py:2366).
Expand All @@ -224,7 +224,7 @@ Read-only searches covered `docker/`, `scripts/`, `runner/` and repository
filenames/release notes; `campaign/` and `cloudrun/` are absent. The local
backtest entry is `main` docker/run_json.py:5345; the catalog itself
identifies the optimizer-only refusal separately (`description`
docker/run_failure_codes.json:2593). Neither establishes the production HPO
docker/run_failure_codes.json:2595). Neither establishes the production HPO
runner's input support.

Check the separate **pineforge-hpo** repository named by this repository's
Expand Down Expand Up @@ -336,8 +336,8 @@ Failure JSON uses `engine`, `error`, `code`, `args` (`doc`
docker/run_json.py:2322; `code` docker/run_json.py:2325; `args`
docker/run_json.py:2326). The catalog entries are `chart_bars_unreadable`
docker/run_failure_codes.json:60, `symbol_feeds_refused`
docker/run_failure_codes.json:2178 and `run_request_invalid`
docker/run_failure_codes.json:1538. Shared binary-reader helpers additionally
docker/run_failure_codes.json:2180 and `run_request_invalid`
docker/run_failure_codes.json:1540. Shared binary-reader helpers additionally
refuse malformed file `size`, metadata/digests as `sidecar`, and a bad feed
companion as `close_file` (`bar_count` docker/pf_bars.py:101;
`check_sidecar` docker/pf_bars.py:137; `check_close_size`
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/memory-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ trailer, 7 internal error, 8 `sink_exhausted` (the stream exceeds `--max-bytes`;
`sink_exhausted` at `docker/pineforge_sink_finalize.py:115-123`). Its output is provisional until
exit 0, and a consumer must discard everything it received on exit 3 to 8 (`PROVISIONAL` at
`docker/pineforge_sink_finalize.py:24-26`). The failure catalog maps exit 8 to `report_sink_failed`
with `reason` `sink_exhausted` (`sink_exhausted` at `docker/run_failure_codes.json:1134`). A sink failure carries code `report_sink_failed` and a `reason`
from the closed list of the catalog (`report_sink_failed` at `docker/run_failure_codes.json:1074`):
with `reason` `sink_exhausted` (`sink_exhausted` at `docker/run_failure_codes.json:1136`). A sink failure carries code `report_sink_failed` and a `reason`
from the closed list of the catalog (`report_sink_failed` at `docker/run_failure_codes.json:1076`):
`arena_exhausted`, `arena_io`, `arena_backing`, `scratch_io`, `sink_io`, `sink_peer_closed` and
`sink_exhausted`. Only some reasons carry sizes: `arena_exhausted` carries `high_water_bytes`,
`arena_bytes`, `claimed_bytes`, `store` and `needed_bytes_lower_bound`, `sink_exhausted` carries
Expand Down
19 changes: 18 additions & 1 deletion docs/pages/run-failure-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ other `strategy_create_failed` lines omit it.
| `pine_map_capacity_exceeded` | `strategy_limit` | no | `bar_index` (integer), `code` (identifier), `currSize` (integer), `maxSize` (integer) | A distinct map insertion exceeds that map's configured pair limit. Zero or omitted selects no limit. Counts and bar index are engine-owned context; code is the fixed TradingView identifier RE10070. |
| `pine_matrix_error` | `strategy` | no | `function` (vocab, 15 values), `reason` (vocab, 10 values) | A matrix built-in refused its arguments (an index, a dimension, a size or an empty matrix). |
| `pine_na_reference` | `strategy` | no | `object` (vocab, 10 values) | The script called a method on an na reference (an array, matrix, map, drawing or object id). |
| `pine_runtime_limit` | `strategy_limit` | no | `limit` (vocab, 5 values), `max` (integer, optional) | The script reached a TradingView or PineForge resource limit. |
| `pine_runtime_limit` | `strategy_limit` | no | `limit` (vocab, 6 values), `max` (integer, optional) | The script reached a TradingView or PineForge resource limit. |
| `pine_string_error` | `strategy` | no | `reason` (vocab, 2 values) | A string built-in refused its arguments. |
| `recalc_cap` | `strategy_limit` | no | none | The script's calc_on_order_fills recalculation loop reached its cap. |
| `recorded_request_missing` | `no_data` | no | none | No recorded series is installed for a request the script reads. |
Expand Down Expand Up @@ -652,6 +652,23 @@ reads.
| `pine_string_stop(reason, english)` | `pine_string_error` |
| `pine_engine_invariant(english)` | `engine_invariant` |

`pine_limit_stop` accepts six closed `limit` values: `map_pairs`,
`max_bars_back`, `matrix_elements`, `udt_objects`, `drawing_ids` and
`live_drawings`. `max_bars_back` identifies the historical buffer limit;
`drawing_ids` identifies exhaustion of the logical drawing-ID domain.
`live_drawings` identifies an explicit operator capacity for live drawings
of one type.

`pine_limit_stop("live_drawings", N, english)` uses the operator's configured
capacity `N` as `max` and raises the existing nonretryable
`pine_runtime_limit`, class `strategy_limit`, with arguments
`{"limit":"live_drawings","max":N}`. Its catalog English template is:

> The script keeps more than {max} live drawings of one type; the configured drawing capacity is exceeded.

This vocabulary extension prepares the helper contract; drawing enforcement
and its defaults remain unchanged.

The generated wrapper records an exception that escapes the strategy with
`note_run_failure(engine, entrypoint, error)`: the text it writes is still
`"<entrypoint>: <what()>"`, and the code is the exception's own.
Expand Down
3 changes: 2 additions & 1 deletion include/pineforge/run_failure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
// polyline | table | udt_object
// pine_limit_stop(const char* limit, std::int64_t max, const char* english)
// -> pine_runtime_limit {limit, max}
// limit: map_pairs | max_bars_back | matrix_elements | udt_objects;
// limit: map_pairs | max_bars_back | matrix_elements | udt_objects |
// drawing_ids | live_drawings;
// max is the limit's engine or transpiler constant (pass -1 for none)
// pine_unsupported_stop(const char* reason, std::int32_t line,
// const char* english)
Expand Down
Loading
Loading