diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f60faae3..eeed01a8f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1238,6 +1238,11 @@ add_executable(npu_vision_image_test tests/npu_vision_image_test.cpp)
target_link_libraries(npu_vision_image_test PRIVATE onebit_npu)
add_test(NAME npu_vision_image COMMAND npu_vision_image_test)
add_dependencies(onebit npu_vision_image_test)
+# The text side of an image: its tokens and the canvas positions, against the reference model code's own answers.
+add_executable(npu_vision_prompt_test tests/npu_vision_prompt_test.cpp)
+target_include_directories(npu_vision_prompt_test PRIVATE npu)
+add_test(NAME npu_vision_prompt COMMAND npu_vision_prompt_test)
+add_dependencies(onebit npu_vision_prompt_test)
add_executable(npu_q4nx_test tests/npu_q4nx_test.cpp)
target_include_directories(npu_q4nx_test PRIVATE app)
target_link_libraries(npu_q4nx_test PRIVATE onebit_npu)
diff --git a/docs/npu.md b/docs/npu.md
index 3ace1d57f..a05b6fd46 100644
--- a/docs/npu.md
+++ b/docs/npu.md
@@ -1632,6 +1632,28 @@ images on a CPU build with AVX2 (torchvision is not on this box, so that link is
no real photograph or image decoder has been through it. The slice separators and placeholder rows on
the text side are not written.
+**The text side of an image (`npu/vision_prompt.h`).** Two more pieces of arithmetic, on token ids only:
+
+- `vision::image_tokens(plan, markers)`: what replaces one `<|image_pad|>` in the rendered prompt.
+ ``, one placeholder per row of the whole view, ``, then each row of slices as
+ `` placeholders `` per slice, with one newline token between rows. The tower's rows go
+ into the placeholders in order. (`k` in front is ordinary text, left to the
+ caller.)
+- `vision::prompt_positions(ids, markers, grids)`: the three position planes (t, h, w) for a prompt that
+ contains images, the model's `mrope_mode: canvas`. Text counts 1, 2, 3 on all three planes. An image
+ is laid on a canvas whose origin is the next free position: the slices tile it, the whole view is
+ stretched over it, `` sits one step before it and `` on its far corner, and the text
+ after it resumes at `origin + max(canvas height, canvas width) + 1`. So an image moves the position
+ counter by its **side**, not by its row count: a 480 × 640 picture is 203 placeholder rows and
+ advances the position by 15.
+
+Both follow transformers' `MiniCPMV4_7Processor.replace_image_token` and
+`MiniCPMV4_7Model.get_rope_index`, and `tests/npu_vision_prompt_test.cpp` holds that code's answers for
+eight prompts (one to two images, with and without slices, touching, newline-separated, with id
+prefixes, and none) as hashes over every token id and position. Images only: video frames are not
+handled. Nothing feeds these planes or the tower's rows into the text forward yet; that is the route's
+work.
+
## Serving
The 1bit NPU engine runs the model on the XDNA 2 NPU. With a release package that carries the NPU
diff --git a/npu/vision_prompt.h b/npu/vision_prompt.h
new file mode 100644
index 000000000..9544cbac2
--- /dev/null
+++ b/npu/vision_prompt.h
@@ -0,0 +1,252 @@
+// Copyright 2026 bong-water-water-bong
+// SPDX-License-Identifier: Apache-2.0
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// The text side of a MiniCPM-V 4.7 image (engine#1788): which tokens stand for it in the prompt, and which position
+// every token of a prompt with images gets. Arithmetic on token ids; no tokenizer, no tensor, no file.
+//
+// TOKENS. One `<|image_pad|>` in the rendered prompt is replaced by
+// pad x R0 the whole view, R0 = its rows after the tower
+// pad x R ... (one per slice of the row) then each row of slices,
+// "\n" rows separated by one newline token
+// (transformers' MiniCPMV4_7Processor.replace_image_token). The processor also puts `k` in front;
+// that is ordinary text and is the caller's to tokenise.
+//
+// POSITIONS. The model's `mrope_mode: canvas`: text counts 1, 2, 3 on all three planes; an image is laid on a square
+// canvas whose origin is the next free position, the whole view stretched over the canvas the slices tile, every slice
+// at its own place, and the text after it resumes at origin + max(canvas height, canvas width) + 1. So an image costs
+// positions by its side, not by its row count. This follows MiniCPMV4_7Model.get_rope_index line for line, including:
+// - `` sits one step before the canvas (the "halo"), `` on its far corner;
+// - the whole view's coordinates are torch.linspace(0, side - 1, n) in float32, rounded half to even;
+// - marker and newline tokens directly after an image belong to it (they take the canvas origin).
+// The reference also groups frames that only markers separate and steps once more after text between two frames of a
+// group. Both are kept below so the code can be read against it, but for prompts that hold only images neither can
+// change a position (an image's trailing markers already belong to it, so no such gap exists): removing either leaves
+// all eight tested prompts unchanged. They matter for video frames, which this does not handle.
+// tests/npu_vision_prompt_test.cpp holds the reference's positions for eight prompts and its linspace for 25,600 cases.
+#pragma once
+
+#include "vision_plan.h"
+
+#include
+#include
+#include
+#include
+#include
+
+namespace onebit::npu::vision {
+
+// The model's ids (config.json: image_start_id, image_end_id, slice_start_id, slice_end_id, image_token_id, newline_id).
+struct ImageMarkers {
+ int image_start = 0, image_end = 0, slice_start = 0, slice_end = 0, image_pad = 0, newline = 0;
+ bool is_marker(int id) const {
+ return id == slice_start || id == slice_end || id == image_start || id == image_end || id == newline;
+ }
+};
+
+// The tokens for one image. Its pieces receive the tower's rows in order: the first run of pads is the whole view,
+// then one run per slice, row by row.
+inline std::vector image_tokens(const ImagePlan& plan, const ImageMarkers& m) {
+ std::vector ids;
+ ids.push_back(m.image_start);
+ ids.insert(ids.end(), size_t(plan.source.rows), m.image_pad);
+ ids.push_back(m.image_end);
+ for (int r = 0; r < plan.slice_rows; ++r) {
+ if (r) ids.push_back(m.newline);
+ for (int c = 0; c < plan.slice_cols; ++c) {
+ ids.push_back(m.slice_start);
+ ids.insert(ids.end(), size_t(plan.slice.rows), m.image_pad);
+ ids.push_back(m.slice_end);
+ }
+ }
+ return ids;
+}
+
+// round(torch.linspace(0, last, n))[i] in float32: the first half counts up from 0, the second half down from `last`.
+inline int linspace_round(int last, int n, int i) {
+ if (n <= 1) return 0;
+ const float step = float(last) / float(n - 1);
+ const float v = i < n / 2 ? step * float(i) : float(last) - step * float(n - i - 1);
+ return int(std::nearbyintf(v));
+}
+
+struct PromptPositions {
+ std::vector t, h, w; // one per token
+ int next = 0; // the position of the first token generated after the prompt
+};
+
+// `grids` is the patch grid (height, width) of every piece in the order its pads appear: each image's whole view, then
+// its slices. Throws when the pads and the grids do not describe the same pieces.
+inline PromptPositions prompt_positions(const std::vector& ids, const ImageMarkers& m,
+ const std::vector>& grids) {
+ const int n = int(ids.size());
+ const int merge = 4; // "16x": two 2 x 2 merges
+ struct Frame {
+ int thumb_start, thumb_end, end;
+ std::vector> slices;
+ };
+ struct Group {
+ int start, end;
+ std::vector frames;
+ };
+ std::vector groups;
+ bool open = false;
+ int previous_end = 0;
+ for (int i = 0; i < n;) {
+ if (ids[size_t(i)] != m.image_pad) {
+ ++i;
+ continue;
+ }
+ int j = i;
+ while (j < n && ids[size_t(j)] == m.image_pad) ++j;
+ if (i == 0) throw std::runtime_error("an image placeholder opens the prompt with no in front of it");
+ if (open && ids[size_t(i - 1)] == m.slice_start) {
+ groups.back().frames.back().slices.push_back({i, j});
+ } else {
+ bool adjacent = !groups.empty();
+ for (int k = previous_end; adjacent && k < i - 1; ++k) adjacent = m.is_marker(ids[size_t(k)]);
+ if (!adjacent) groups.push_back({i - 1, 0, {}});
+ groups.back().frames.push_back({i, j, 0, {}});
+ open = true;
+ }
+ previous_end = j;
+ i = j;
+ }
+ for (Group& g : groups) {
+ for (Frame& f : g.frames) {
+ int e = f.slices.empty() ? f.thumb_end : f.slices.back().second;
+ while (e < n && m.is_marker(ids[size_t(e)])) ++e;
+ f.end = e;
+ }
+ g.end = g.frames.back().end;
+ }
+
+ PromptPositions p;
+ p.t.resize(size_t(n));
+ p.h.resize(size_t(n));
+ p.w.resize(size_t(n));
+ for (int i = 0; i < n; ++i) p.t[size_t(i)] = p.h[size_t(i)] = p.w[size_t(i)] = i;
+ const auto text = [&](int from, int to, int pos) {
+ for (int i = from; i < to; ++i) p.t[size_t(i)] = p.h[size_t(i)] = p.w[size_t(i)] = pos + (i - from);
+ };
+ size_t next_grid = 0;
+ const auto grid = [&]() {
+ if (next_grid >= grids.size()) throw std::runtime_error("the prompt holds more image pieces than grids were given");
+ const std::pair g = grids[next_grid++];
+ if (g.first <= 0 || g.second <= 0 || g.first % merge || g.second % merge)
+ throw std::runtime_error("a piece's patch grid is not a positive multiple of 4 in both extents");
+ return std::pair{g.first / merge, g.second / merge};
+ };
+ // a piece's tokens: `count` of them, row-major on a (gh, gw) grid
+ const auto piece = [&](int from, int to, std::pair g, int canvas_h, int canvas_w, int h_off, int w_off, int origin) {
+ if (to - from != g.first * g.second)
+ throw std::runtime_error("a piece has " + std::to_string(to - from) + " placeholders but its grid gives " +
+ std::to_string(g.first * g.second) + " rows");
+ for (int y = 0; y < g.first; ++y)
+ for (int x = 0; x < g.second; ++x) {
+ const size_t at = size_t(from + y * g.second + x);
+ p.t[at] = origin;
+ p.h[at] = origin + h_off + linspace_round((canvas_h ? canvas_h : g.first) - 1, g.first, y);
+ p.w[at] = origin + w_off + linspace_round((canvas_w ? canvas_w : g.second) - 1, g.second, x);
+ }
+ };
+
+ int current_pos = 0, current_idx = 0;
+ for (const Group& g : groups) {
+ if (g.start > current_idx) {
+ text(current_idx, g.start, current_pos);
+ current_pos += g.start - current_idx;
+ }
+ int cursor = g.start;
+ for (const Frame& f0 : g.frames) {
+ const std::pair thumb = grid();
+ const int frame_start = f0.thumb_start - 1;
+ if (frame_start > cursor) {
+ text(cursor, frame_start, current_pos);
+ current_pos += frame_start - cursor + 1;
+ }
+ const int frame_end = f0.end < g.end ? f0.end : g.end;
+ const int origin = current_pos, halo = origin > 0 ? origin - 1 : 0;
+ int canvas_h = thumb.first, canvas_w = thumb.second, slice_h = 0, slice_w = 0, rows = 0, cols = 0;
+ std::pair first_slice{0, 0};
+ const int ns = int(f0.slices.size());
+ if (ns) {
+ cols = ns;
+ for (int k = 0; k + 1 < ns; ++k)
+ if (f0.slices[size_t(k + 1)].first - f0.slices[size_t(k)].second > 2) {
+ cols = k + 1;
+ break;
+ }
+ rows = cols > 0 ? ns / cols : 1;
+ if (rows * cols != ns) {
+ rows = 1;
+ cols = ns;
+ }
+ first_slice = grid();
+ slice_h = first_slice.first;
+ slice_w = first_slice.second;
+ canvas_h = rows * slice_h;
+ canvas_w = cols * slice_w;
+ }
+ for (int i = frame_start; i < frame_end; ++i) p.t[size_t(i)] = p.h[size_t(i)] = p.w[size_t(i)] = origin;
+ p.h[size_t(frame_start)] = p.w[size_t(frame_start)] = halo;
+ if (f0.thumb_end < frame_end) {
+ p.h[size_t(f0.thumb_end)] = origin + canvas_h;
+ p.w[size_t(f0.thumb_end)] = origin + canvas_w;
+ }
+ piece(f0.thumb_start, f0.thumb_end, thumb, canvas_h, canvas_w, 0, 0, origin);
+ for (int k = 0; k < ns; ++k) {
+ const int h_off = (k / cols) * slice_h, w_off = (k % cols) * slice_w;
+ const std::pair sg = k == 0 ? first_slice : grid();
+ const int s0 = f0.slices[size_t(k)].first, s1 = f0.slices[size_t(k)].second;
+ if (s0 - 1 >= frame_start) {
+ p.h[size_t(s0 - 1)] = origin + h_off;
+ p.w[size_t(s0 - 1)] = origin + w_off;
+ }
+ if (s1 < frame_end) {
+ p.h[size_t(s1)] = origin + h_off + sg.first - 1;
+ p.w[size_t(s1)] = origin + w_off + sg.second - 1;
+ }
+ piece(s0, s1, sg, 0, 0, h_off, w_off, origin);
+ }
+ for (int k = 0; k + 1 < ns; ++k) {
+ const int gap0 = f0.slices[size_t(k)].second, gap1 = f0.slices[size_t(k + 1)].first;
+ if (gap1 - gap0 <= 2) continue;
+ for (int i = gap0 + 1; i < gap1 - 1; ++i) {
+ p.h[size_t(i)] = origin + (k / cols + 1) * slice_h - 1;
+ p.w[size_t(i)] = origin + cols * slice_w;
+ }
+ }
+ current_pos = origin + (canvas_h > canvas_w ? canvas_h : canvas_w) + 1;
+ cursor = frame_end;
+ }
+ if (cursor < g.end) {
+ text(cursor, g.end, current_pos);
+ current_pos += g.end - cursor;
+ }
+ current_idx = g.end;
+ }
+ if (current_idx < n) text(current_idx, n, current_pos);
+ if (next_grid != grids.size()) throw std::runtime_error("more grids were given than the prompt holds image pieces");
+ int mx = -1;
+ for (int i = 0; i < n; ++i) {
+ if (p.t[size_t(i)] > mx) mx = p.t[size_t(i)];
+ if (p.h[size_t(i)] > mx) mx = p.h[size_t(i)];
+ if (p.w[size_t(i)] > mx) mx = p.w[size_t(i)];
+ }
+ p.next = mx + 1;
+ return p;
+}
+
+} // namespace onebit::npu::vision
diff --git a/tests/npu_vision_prompt_test.cpp b/tests/npu_vision_prompt_test.cpp
new file mode 100644
index 000000000..bc53f91e0
--- /dev/null
+++ b/tests/npu_vision_prompt_test.cpp
@@ -0,0 +1,177 @@
+// Copyright 2026 bong-water-water-bong
+// SPDX-License-Identifier: Apache-2.0
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// npu_vision_prompt_test
+//
+// The text side of an image (npu/vision_prompt.h, engine#1788) against transformers 5.22.2's MiniCPM-V 4.7 code:
+// MiniCPMV4_7Processor.replace_image_token for the tokens and MiniCPMV4_7Model.get_rope_index for the positions.
+// Eight prompts are built here from plan_image() and image_tokens(); the reference built the same prompts from its own
+// processor arithmetic, and for each one this file holds its token count, piece count, next position and one FNV-1a
+// hash over (ids, t, h, w). A wrong token, a wrong order or one wrong position changes the hash.
+// Text tokens are 1000 + k; the marker ids are the published packs'.
+#include "../npu/vision_prompt.h"
+
+#include
+#include
+#include
+#include
+
+namespace {
+
+namespace vis = onebit::npu::vision;
+
+int g_fail = 0, g_arms = 0;
+void check(bool ok, const std::string& what) {
+ ++g_arms;
+ if (!ok) {
+ ++g_fail;
+ std::printf("FAIL %s\n", what.c_str());
+ }
+}
+
+const vis::ImageMarkers kM = {248078, 248079, 248088, 248089, 248056, 198};
+
+struct Prompt {
+ std::vector ids;
+ std::vector> grids;
+ void text(int n, int base) {
+ for (int i = 0; i < n; ++i) ids.push_back(1000 + base + i);
+ }
+ void raw(std::initializer_list v) { ids.insert(ids.end(), v); }
+ void image(int h, int w) {
+ const vis::ImagePlan p = vis::plan_image(h, w);
+ const std::vector t = vis::image_tokens(p, kM);
+ ids.insert(ids.end(), t.begin(), t.end());
+ grids.push_back({p.source.grid_h, p.source.grid_w});
+ for (int k = 0; k < p.slice_rows * p.slice_cols; ++k) grids.push_back({p.slice.grid_h, p.slice.grid_w});
+ }
+};
+
+Prompt scenario(int k) {
+ Prompt p;
+ const int NL = kM.newline;
+ switch (k) {
+ case 0: p.text(7, 0); p.image(448, 448); p.text(5, 50); break; // one view, no slices
+ case 1: p.text(3, 0); p.image(480, 640); p.raw({NL}); p.text(4, 50); break; // 1 x 2 slices, a newline after
+ case 2: p.text(2, 0); p.image(1080, 1920); p.image(100, 100); p.text(3, 50); break; // two images touching
+ case 3: p.text(1, 0); p.image(720, 1280); p.text(6, 50); p.image(3024, 4032); p.text(2, 80); break;
+ case 4: p.text(4, 0); p.image(5000, 300); p.text(1, 50); break; // 9 x 1 slices
+ case 5: // k prefixes
+ p.text(3, 0); p.raw({248090, 15, 248091}); p.image(600, 800); p.raw({NL, NL}); p.text(2, 50);
+ p.raw({248090, 16, 248091}); p.image(224, 2000); p.raw({NL});
+ break;
+ case 6: p.text(9, 0); break; // no image at all
+ case 7: p.text(1, 0); p.image(449, 448); p.raw({NL}); p.image(448, 449); break; // two images, a newline between
+ }
+ return p;
+}
+
+// {tokens, pieces, next position, hash(ids, t, h, w)}, from the reference
+struct Golden {
+ int tokens, pieces, next;
+ uint64_t hash;
+};
+const Golden kGolden[8] = {
+ {78, 1, 21, 0xccb3904ded7cd15bULL}, {217, 3, 22, 0xece6c1beaeb65928ULL}, {668, 10, 47, 0xcd6d6c517226c2afULL},
+ {1120, 17, 65, 0x9e0d9e3759a6b555ULL}, {693, 10, 105, 0xbfd3bd95f7383645ULL}, {662, 10, 79, 0xdd390fcf63fc8236ULL},
+ {9, 0, 9, 0x2d9fde739c2c5f7cULL}, {407, 6, 27, 0xbe7321611eaa8facULL},
+};
+const uint64_t kLinspaceHash = 0x2f0e4ce031c6cf8eULL; // round(linspace(0, c - 1, n)) for c, n in 1..160, by torch
+
+uint64_t fnv(const std::vector& v, uint64_t h) {
+ for (int x : v)
+ for (int b = 0; b < 4; ++b) h = (h ^ uint64_t((uint32_t(x) >> (8 * b)) & 0xff)) * 0x100000001b3ULL;
+ return h;
+}
+
+} // namespace
+
+int main() {
+ for (int k = 0; k < 8; ++k) {
+ const Prompt p = scenario(k);
+ const std::string name = "prompt " + std::to_string(k);
+ try {
+ const vis::PromptPositions pos = vis::prompt_positions(p.ids, kM, p.grids);
+ uint64_t h = fnv(p.ids, 0xcbf29ce484222325ULL);
+ h = fnv(pos.t, h);
+ h = fnv(pos.h, h);
+ h = fnv(pos.w, h);
+ check(int(p.ids.size()) == kGolden[k].tokens && int(p.grids.size()) == kGolden[k].pieces,
+ name + ": " + std::to_string(p.ids.size()) + " tokens and " + std::to_string(p.grids.size()) + " pieces, as the reference lays it out");
+ check(pos.next == kGolden[k].next, name + ": generation resumes at position " + std::to_string(pos.next));
+ check(h == kGolden[k].hash, name + ": every token id and every (t, h, w) is the reference's");
+ } catch (const std::exception& e) {
+ check(false, name + " is laid out (threw: " + e.what() + ")");
+ }
+ }
+
+ // prompt 1, spelled out: 3 text tokens, then a 480 x 640 image (a 7 x 9 view over 1 x 2 slices of 10 x 7)
+ {
+ const Prompt p = scenario(1);
+ const vis::PromptPositions pos = vis::prompt_positions(p.ids, kM, p.grids);
+ check(p.ids[3] == kM.image_start && pos.t[3] == 3 && pos.h[3] == 2 && pos.w[3] == 2,
+ " keeps the canvas origin on t and sits one step before it on h and w");
+ check(pos.t[4] == 3 && pos.h[4] == 3 && pos.w[4] == 3 && pos.w[5] == 5 && pos.w[6] == 6 && pos.w[7] == 8,
+ "the whole view is stretched over the slices' canvas: columns 0, 2, 3, 5 ... of 14 for 9 tokens");
+ check(p.ids[67] == kM.image_end && pos.t[67] == 3 && pos.h[67] == 13 && pos.w[67] == 17,
+ " sits on the canvas's far corner (10 down, 14 across)");
+ const size_t n = p.ids.size();
+ check(pos.t[n - 4] == 18 && pos.t[n - 1] == 21 && pos.next == 22,
+ "text resumes at origin + max(10, 14) + 1 = 18: the image costs its side, not its 203 rows");
+ check(p.ids[n - 5] == kM.newline && pos.t[n - 5] == 3 && pos.h[n - 5] == 3,
+ "a newline directly after the image belongs to it and takes the canvas origin");
+ }
+
+ {
+ uint64_t h = 0xcbf29ce484222325ULL;
+ for (int c = 1; c <= 160; ++c)
+ for (int n = 1; n <= 160; ++n) {
+ std::vector v(static_cast(n));
+ for (int i = 0; i < n; ++i) v[size_t(i)] = vis::linspace_round(c - 1, n, i);
+ h = fnv(v, h);
+ }
+ check(h == kLinspaceHash, "round(linspace(0, c - 1, n)) is torch's for every canvas and count up to 160");
+ }
+
+ // pads and grids that do not describe the same pieces
+ {
+ Prompt p = scenario(1);
+ std::string why;
+ auto g = p.grids;
+ g.pop_back();
+ try { vis::prompt_positions(p.ids, kM, g); } catch (const std::exception& e) { why = e.what(); }
+ check(why.find("more image pieces than grids") != std::string::npos, "a missing grid is refused");
+ why.clear();
+ g = p.grids;
+ g.push_back({32, 32});
+ try { vis::prompt_positions(p.ids, kM, g); } catch (const std::exception& e) { why = e.what(); }
+ check(why.find("more grids were given") != std::string::npos, "an extra grid is refused");
+ why.clear();
+ g = p.grids;
+ g[0] = {32, 32};
+ try { vis::prompt_positions(p.ids, kM, g); } catch (const std::exception& e) { why = e.what(); }
+ check(why.find("placeholders but its grid gives") != std::string::npos, "a grid that is not the piece's row count is refused");
+ why.clear();
+ g = p.grids;
+ g[1] = {39, 28};
+ try { vis::prompt_positions(p.ids, kM, g); } catch (const std::exception& e) { why = e.what(); }
+ check(why.find("multiple of 4") != std::string::npos, "a grid the tower cannot merge is refused");
+ why.clear();
+ try { vis::prompt_positions({kM.image_pad, 1000}, kM, {{4, 4}}); } catch (const std::exception& e) { why = e.what(); }
+ check(why.find("opens the prompt") != std::string::npos, "a placeholder with nothing in front of it is refused");
+ }
+ std::printf("vision prompt: %d checks, %d failed\n", g_arms, g_fail);
+ return g_fail ? 1 : 0;
+}