Commit Graph
2 Commits
Author SHA1 Message Date
NunzeandClaude Opus 5.5 1f7e1faa73 tests: GLM-5.3's template renders a picture as the reference does; its tower against transformers
The golden renders gain GLM-5.3's picture between text: the engine's media marker becomes
<|begin_of_image|><|image|><|end_of_image|> with no separator, as the template's own emit_image()
writes it (tests/mkchatgolden.py).

tests/glm5_vision_reference.py runs transformers' tower alone on the CPU (only model.visual.*,
about 3 GB) over the pictures of one encoder pass and writes the processor's patches and the
merger's rows, with --taps the tensors on the way (the patch embedding, block 0's q and k after the
rotary, blocks 0, 11 and 23, the post-norm, the downsample), in bf16 or f32. With --compare it
checks what an engine wrote with RADIANCE_DEBUG_MM_DUMP: patches bit for bit, rows to a cosine of
0.99 and a median per-row relative error of 0.08 against the bf16 reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 11:06:34 +02:00
NunzeandClaude Opus 5.5 5ac0bc9690 tests/data/chat: GLM-5.3's template as a fifth reference render
The template as GLM-5.3-Flash ships it, in cases.json beside the other four, with its goldens from
mkchatgolden.py (jinja2 3.1.6); bos is empty, eos <|endoftext|>, and no media, since no
architecture here reads its pictures. It needs the dotted index (vendor/patches/0021).

Two cases leave it out: an assistant turn with tool calls and content null. The template prints
that content bare ({{- content }} in visible_text), so jinja2 writes "None" into the turn, and the
engine, as llama.cpp's runtime does, writes nothing. The golden would hold the engine to a
template bug; the reply-side tests for this format read those turns instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 15:34:15 +02:00