fix(mm_schedule): _collect_image_span_requests emit 4-tuple overlapping

The vision-CP cherry-pick stored (idx, item, token_count) 3-tuples into
PerImageRequestInfo.overlapping, but the field and its consumers
(_assemble_per_image_chunk, phase-1a) use (idx, item, start, end) with
cache key (hash, end-start+1). First owner-mode image request died with
'not enough values to unpack (expected 4, got 3)'.
This commit is contained in:
2026-10-19 21:47:57 +08:00
parent 068acff09d
commit 4f52678224
+11 -4
View File
@@ -450,12 +450,19 @@ def _collect_image_span_requests(
for req_info in per_image_requests:
chunk_start = req_info.extend_prefix_len
chunk_end = chunk_start + req_info.extend_seq_len # exclusive
# PerImageRequestInfo.overlapping is the 4-tuple (idx, item, start, end)
# convention shared with _batch_encode_per_image_misses /
# _assemble_per_image_chunk; the span cache key is the item's full
# token count, matching cache_key = (item.hash, end - start + 1).
req_info.overlapping = [
(idx, item, token_count)
for idx, item in enumerate(req_info.items)
if (token_count := _item_overlap(item, chunk_start, chunk_end)) is not None
(idx, item, start, end)
for idx, (item, (start, end)) in enumerate(
zip(req_info.items, req_info.items_offset)
)
if _item_overlap(item, chunk_start, chunk_end) is not None
]
for _idx, item, token_count in req_info.overlapping:
for _idx, item, start, end in req_info.overlapping:
token_count = end - start + 1
span = spans.get((item.hash, token_count))
if span is None:
spans[(item.hash, token_count)] = ImageSpanRequest(