gtopt/lp_name_spill.hpp file

Async, Parquet-backed store for LP col/row label metadata.

The label metadata (SparseColLabel / SparseRowLabel — class name, variable / constraint name, uid, context) is needed ONLY to write a readable .lp dump (the lp_error / lp_debug error/debug LPs), but holding it resident across a full SDDP run (it lives in every cell's FlatLP.label_meta) costs hundreds of MB at CEN scale. This store lets a cell hand its metadata off to a BACKGROUND worker thread that writes it to a small Parquet file in a temp directory (so the caller can immediately free its copy and drop FlatLP.label_meta), then reads it back on demand — cached, so the per-(aperture / forward / backward) error-LP writes for one cell only touch disk once.

Persistence reuses gtopt's existing Apache Arrow / Parquet stack (the same parquet::arrow::WriteTable / parquet_read_table helpers the solution and cut I/O use). The metadata is stored DECOMPOSED as a long-format table so its low-cardinality fields dictionary-compress to almost nothing: kind: int8 (0 = column, 1 = row), class_ptr: int64, class_len: uint8, name_ptr: int64, name_len: uint8 (variable_name for cols, constraint_name for rows), uid: int32, context: fixed_size_binary(sizeof(LpContext)) (the trivially-copyable LpContext variant, memcpy'd opaque). write_lp re-synthesises the formatted names from this metadata via LabelMaker on load.

Gated entirely by lp_error || lp_debug: when both are off no store is created and no label metadata is generated, saved or loaded.

Namespaces

namespace gtopt

Classes

struct gtopt::LpLabelMeta
class gtopt::LpNameSpillStore