Stop dropping strip pixels, so panel bboxes tile the page

Answering whether the caption merge breaks the page-space key in
eval/chapter-truth.json. It does not. _merge_plan only groups adjacent
fragments and slice_webtoon cuts at gutter midpoints, so a vstacked panel's
[x, y0, w, sum(heights)] is the exact page region.

The defect is one line up. slice_webtoon skipped any segment shorter than
min_seg instead of absorbing it, so this chapter's 116 panels have a 62px hole
between panel_order 70 and 71 and lose 18px at the strip's end. A merge
spanning that hole reports a bbox 62px short of the page span it covers, and
every consumer mapping a detection back to the page is then wrong by that much,
silently. The 62px held the credits line, found at p_050.png row 338.

A short band is now held and absorbed by the next segment, or by the previous
one when it is last. min_seg still suppresses a tiny panel and no strip pixel
is discarded. The self-check asserts the bboxes tile the strip end to end.

Checks: worker_crop.py self-check passes and fails on the old code, where the
first band starts at 49 instead of 0. ruff check . exits 0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-13 23:41:11 +04:00
parent bc19f9e9fd
commit c19a726455
6 changed files with 124 additions and 72 deletions
+14
View File
@@ -801,3 +801,17 @@ visible speaker to attribute to under any linker. That is the case for `offscree
Step 0's dialogue half is not written. It needs 30 lines watched panel by panel, and `NEXT.md` holds no
per-line speaker truth to transcribe.
Then the question of whether the geometry key survives the caption merge. It does, and checking it found
a different defect one line up. `_merge_plan` only groups adjacent fragments, and `slice_webtoon` cuts at
gutter midpoints, so a vstacked panel's `[x, y0, w, sum(heights)]` is the exact page region.
But the 116 panels do not tile the strip. A 62px hole sits between `panel_order` 70 and 71, and 18px are
missing at the end, because `slice_webtoon` skipped any segment under `min_seg=64` instead of absorbing
it. The 62px held the chapter's credits line, `글 | H2J · 그림 | 이루리다`. Finding it meant reading the
PNG headers of all 79 tiles to locate the band at `p_050.png` row 338. Worthless content, and a hole in the
page-space y of everything after it. `slice_webtoon` now absorbs a short band into its neighbour
(`decisions/measurement-spine.md#slices-tile-the-strip`), and its self-check asserts the bboxes tile the
strip end to end.
Nothing ran on a GPU this session.