From d8fffd046001334e0e48cbb5ed6dba9776ab4b48 Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Mon, 3 Aug 2026 20:11:10 +0200 Subject: [PATCH] fix(pipeline): split the closure_plan log line over the itoa ring capacity itoa_buf recycles a four-slot thread-local ring; the closure_plan line passed six conversions in one call, so two fields printed corrupted -- the kernel-scale profile showed surface_changed reporting the elapsed-ms value. Split into two calls of at most four conversions each. The same profile run, for the record, answered the incremental cost question with data (kernel corpus, one-file closure, worker total 238.5s): dump/publish 149.1s (62.5%), graph load 38.3s (16.1%), wholesale semantic-edges post-pass 18.1s, manifest hashing ~20s by residual -- while the repair itself (extract + resolve + registry rehydration) is 0.57s. The closure algorithm is effectively free at every scale; the remaining cost is generational I/O, which is the delta-merge (copy -> patch -> rename) follow-up's target. Signed-off-by: Martin Vogel --- src/pipeline/pipeline_incremental.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pipeline/pipeline_incremental.c b/src/pipeline/pipeline_incremental.c index 9c791f373..1b4da1b68 100644 --- a/src/pipeline/pipeline_incremental.c +++ b/src/pipeline/pipeline_incremental.c @@ -1735,9 +1735,13 @@ static int closure_try_plan(cbm_pipeline_t *p, cbm_store_t *store, const char *p } plan->n_changed = n_changed; plan->n_dependents = dependent_count; + /* Two calls, not one: itoa_buf recycles a four-slot ring, so six + * conversions in a single call print two corrupted fields (observed: + * surface_changed reporting the elapsed-ms value at kernel scale). */ cbm_log_info("incremental.closure_plan", "changed", itoa_buf(n_changed), "surface_changed", itoa_buf(n_surface_changed), "deleted", itoa_buf(n_deleted), "dependents", - itoa_buf(dependent_count), "closure", itoa_buf(plan->count), "elapsed_ms", + itoa_buf(dependent_count)); + cbm_log_info("incremental.closure_plan_done", "closure", itoa_buf(plan->count), "elapsed_ms", itoa_buf((int)elapsed_ms(t))); done: