From 2cede55386c72faecf4cba22fbf546a589ccfdd0 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Fri, 13 Nov 2026 00:02:53 -0400 Subject: [PATCH 1/2] serve: main does not compile at the #2327 image refusal -- one brace short (fix-forward) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #2327 added the "this route has no vision wiring" refusal and left the nlohmann initialiser one `}` short, so `1bit` does not build on main at all: app/forward_serve.cpp:282:76: error: expected '}' before '.' token Counted: after {"code", 400} the statement needs four closings -- the code pair, the inner ordered_json, the {"error", …} pair and the outer initialiser -- and it has three. Rather than add the missing brace to a 6-line nested initialiser, the body is written the way the other error responses in this file are written (a named ordered_json), so the next reader does not have to count braces to see what it says. The message text is unchanged. Found while about to import a container: the acceptance-case import needs a working `1bit`, and main had none. No open PR covered it (searched before touching it). --- app/forward_serve.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/forward_serve.cpp b/app/forward_serve.cpp index 3724e313d..bab353fd1 100644 --- a/app/forward_serve.cpp +++ b/app/forward_serve.cpp @@ -274,12 +274,18 @@ void handle_generate_impl(ForwardEngine& e, const httplib::Request& req, httplib // than rendered as text and answered. The chain it would call exists; the parse and the join here do not. if (npu::message_carries_an_image(ordered.at("messages"))) { res.status = 400; - res.set_content(nlohmann::ordered_json{{"error", nlohmann::ordered_json{{"message", - "this route has no vision wiring yet (engine#2324): the request carries an image part and the " - "NPU route parses no pixels, so answering it would ignore the picture. Text-only requests are " - "unaffected. The vision chain exists (npu/vision_tower.h and friends) and is driven by " - "npu/forward/minicpm_image_probe.cpp; the serve-side parse and the image positions are what is missing."}, - {"type", "unsupported_image_part"}, {"code", 400}}}.dump(), "application/json"); + // engine#2327 left this one brace short of compiling; written the way the other error bodies in + // this file are, so the next reader does not have to count braces to see what it says. + nlohmann::ordered_json body_out; + body_out["error"] = { + {"message", + "this route has no vision wiring yet (engine#2324): the request carries an image part and the " + "NPU route parses no pixels, so answering it would ignore the picture. Text-only requests are " + "unaffected. The vision chain exists (npu/vision_tower.h and friends) and is driven by " + "npu/forward/minicpm_image_probe.cpp; the serve-side parse and the image positions are what is missing."}, + {"type", "unsupported_image_part"}, + {"code", 400}}; + res.set_content(body_out.dump(), "application/json"); return; } // An earlier call's arguments arrive as a JSON string; the template is written against the From a010d7ab0a039ee2ddf0b937dd652307ab5c230a Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Fri, 13 Nov 2026 00:21:21 -0400 Subject: [PATCH 2/2] CMake: compile app/forward_serve.cpp outside the ONEBIT_NPU guard, so CI catches a brace engine#2330 had to exist because a one-brace error in app/forward_serve.cpp reached main with `build` green. The file is added to `onebit` inside `if(ONEBIT_NPU)`, and CI configures without it because the NPU runtime is private -- so no CI job compiled the file that broke, and the failure was found by the next lane's container import instead. `onebit_serve_syntax` is an OBJECT library outside the guard that compiles that one file with ONEBIT_NPU_RUNTIME_OWN and only public headers (app, npu, npu/forward/include, build/generated, json, cpp-httplib) -- the same shape as `onebit_npu_forward_syntax` for q4nx_forward.cpp, and `add_dependencies(onebit onebit_serve_syntax)` puts it in CI's build with no workflow change (a workflow edit needs the `workflow` scope, which this token does not have). Measured both ways on the same target: main (the broken file): 17 errors, first 'app/forward_serve.cpp:282:76: error: expected } before . token' with engine#2330 applied: 0 errors --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b81dca211..aa5dd2b89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -927,6 +927,18 @@ if(OpenMP_CXX_FOUND) endif() add_dependencies(onebit onebit_npu_forward_syntax) +# engine#2330: app/forward_serve.cpp lives under `if(ONEBIT_NPU)` (below), and CI configures without it because +# the NPU runtime is private -- so on 2026-11-13 a one-brace error in that file reached main with `build` green, +# and the next lane's container import failed on it. The file is compiled by ITSELF here, outside the guard, with +# ONEBIT_NPU_RUNTIME_OWN and only public headers: the same shape as onebit_npu_forward_syntax above, and it needs +# no private runtime, no device and no workflow change -- `add_dependencies(onebit ...)` puts it in the CI build. +add_library(onebit_serve_syntax OBJECT app/forward_serve.cpp) +target_compile_definitions(onebit_serve_syntax PRIVATE ONEBIT_NPU_RUNTIME_OWN) +target_include_directories(onebit_serve_syntax PRIVATE + app npu npu/forward/include ${CMAKE_BINARY_DIR}/generated) +target_link_libraries(onebit_serve_syntax PRIVATE nlohmann_json::nlohmann_json httplib::httplib) +add_dependencies(onebit onebit_serve_syntax) + # What one MTP head step costs on the HOST (tools/mtp_head_bench.cpp). The draft route's per-iteration cost is two # base passes plus the drafter's logits calls (both on the array) and the head's own arithmetic (this host), so this # is the only term measurable without the device -- and the term a maths change has to be stated on. It also prints