Skip to main content

Module limits

Module limits 

Source
Expand description

Table cell budgets (#861; docling-core 2.103.1’s settings.max_table_cells and max_total_table_cells, its answer to a DoS advisory).

Every reader of a table materializes its grid — the dense rows the serializers print, the num_rows × num_cols slot map of the JSON export — so a table’s cost is its declared area, not its bytes: a docling-JSON TableData can declare num_rows = num_cols = 10^6 around one cell, and an OTSL stream (DocTags, DocLang) of one row of 10^6 tokens and 10^6 rows of one token asks for 10^12 slots from a few megabytes. docling-core rejects both at load; so do the readers here, through one TableCellBudget per document, with the typed LimitExceeded on the error’s source chain (read with ConversionError::limit()), never a bare parse error.

The rows and columns are bounded on their own too, as upstream does: a table of many rows and no columns still allocates one (empty) row each.

Structs§

LimitExceeded
An input asked for more than a safety limit allows. variable names the environment variable that raises the limit; what the input part.
TableCellBudget
The cell budget of one document: each table is checked against the per-table cap and added to the running total, which is checked against the per-document cap. One budget per conversion, read from the environment when it is created.

Constants§

MAX_TABLE_CELLS_VAR
Cells (rows × cols, and rows or columns alone) one table may declare; docling-core’s max_table_cells.
MAX_TOTAL_TABLE_CELLS_VAR
Cells every table of one document may declare together; docling-core’s max_total_table_cells. Bounds a document of many tables each just under the per-table cap.

Functions§

max_table_cells
DOCLING_RS_MAX_TABLE_CELLS (1 000 000, upstream’s default).
max_total_table_cells
DOCLING_RS_MAX_TOTAL_TABLE_CELLS (5 000 000, upstream’s default).