Open a section from the left

Startup configuration

All tunables that the library accepts at process start live in an optional INI-like file (see examples/demo/pitlane.conf). Defaults are the member initializers on PitConf in desk/config.hpp. Omit a key, or leave the value empty, to keep that default. Unknown keys are ignored. Hard parse errors (truncated line, non-numeric where a number is required) make conf_load return false.

Broker ack_limit_us / life_limit_us / pull_limit_us default to 60000000 (60s), matching a typical 60-second heartbeat. Set a limit to 0 to turn that axis off. Host defaults enable thp_disable and mlockall. Desk FanRing soft caps stay at the compile-time maxima (kIntentCap …). Large symbol/quote pools live in the separate [yard] / Yard map (sized once at startup; hot path does not allocate). Mongo document roles and RabbitMQ topic roles are covered by local APIs (seed_facts / TopicBus / RouteBook), not by importing connection strings from MongoConf / broker URIs.

conf_normalize runs once after load. It clamps ring capacities to a power of two in [2, compile-time Cap], restores compile-time-only sizes (QueryFold, BrokerWatch::kCap) with a hint, and writes one human-readable line per adjustment into a caller buffer. Print those lines at startup. The hot path never opens the file again.


pitlane::PitConf conf{};
if (!pitlane::conf_load("/etc/pitlane.conf", conf)) return 1;
char hints[1024]{};
if (pitlane::conf_normalize(conf, hints, sizeof hints) > 0) {
    std::fputs(hints, stderr);
}

pitlane::MapOpt mop = pitlane::conf_map_opt(conf);
pitlane::MapInfo map{};
if (pitlane::map_create("desk.bin", pitlane::desk_bytes(), &map, mop) != 0) return 1;
pitlane::Desk* desk = pitlane::desk_view(&map, 1);
if (!desk) return 1;
if (!pitlane::desk_apply_conf(*desk, conf)) return 1;  // FanRing::tune, empty desk only

conf_map_opt / conf_arena_opt / conf_risk_caps / conf_yard_plan / conf_study_plan copy the normalized fields into the option structs used by map, arena, risk, yard, and study helpers. desk_apply_conf calls FanRing::tune on each desk ring while the ring is still empty. Soft capacity never grows past the compile-time slot array; the on-disk Desk layout stays kDeskVersion.

Section Keys (summary)
[map] hugepage, lock, prefault, numa_node, hugepage_dir
[arena] hugepage, lock, prefault, numa_node
[desk] intent_cap … query_cap, cash_cap, hold_cap
[broker] max_qty, max_notional, max_live, *_limit_us, watch_cap (hint-only)
[query] engines, accounts, queue, kinds (hint-only; compile-time)
[host] cpu, policy, priority, nice / set_nice, hugepages, thp_disable, mlockall, numa_node, irq_list
[shed] / [pace] StayShed / TokenBook–GCRA defaults for the caller to construct
[yard] sym_slots, quote_lanes, quote_depth, order_* / trade_* / rebuild_* / mix_* lanes and depths (depths power-of-two), base_info_cap, trade_time_cap
[study] signal_pools, sample_pools, factor_pools, nonstruct_pools, sample_depth, factor_depth, nonstruct_depth

conf_load_ex reports the failing 1-based line. conf_apply_host is best-effort. cash_apply_conf / hold_apply_conf soft-tune row boards.