This repository has been archived on 2026-11-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
radiance-sycl/tests/ref2va_pack_test.cpp
T
Deadcode 6645337f69 radiance 1.13.0
New models:
- Tencent Hy-Memory (HYV3) from its BF16, FP8 and GGUF checkpoints, with its native tool calls
- M2XFP4: metadata-augmented MXFP4 weights for Qwen3.8-27B and its DFlash2 drafter (top-1 89.1% ->
  92.4% against plain MXFP4), its quantiser and recipe, and ParoQuant's M2XFP4 checkpoints
- Gemma 4 E2B/E4B audio input; NVIDIA-Nemotron-3.5-Bolt-E4B in int8 and 4-bit, on two cards by
  default; Ornith-1.5-122B compose files

Speed:
- Weight reads beside the decode all-reduces (qwen35_fp8, gemma3; --weight-prefetch, on by default):
  the 27B MXFP4 with DFlash2 61.2 -> 67.9 tok/s at c1, TranslateGemma 27B +13%
- Head-256 split-KV decode attention at 256 workgroups and without bank conflicts (27B: +3-5% a
  step at 25-41K context), and the prefill KV split for small launches (a short turn over a long
  context decodes the other sequences 27% faster in that step)
- MXFP4 decode gate_up, activation and fp8 quantiser in one launch (27B, Gemma 3 up to 64 rows:
  TranslateGemma +2-5% at 2-8 streams)
- ParoQuant int4/int5 tiled GEMMs 6-9% faster
- Speculation: a step's tokens are sent before the drafter's passes end, no step waits behind one
  that ends its requests, and the MTP head's first draft no longer collapses after short chats in
  the prefix cache

Features:
- --kv-resident N: KV streaming for a context bigger than VRAM (qwen4exp_fp8, GLM-5.3)
- MiniMax-H3: reference media and keyframe conditioning with the VAE encoders
- Krea 2 rebalance presets balanced, detail and subtle
- The dashboard's request history; a stall watch that reports a frozen step's thread and stack
- rad-tune at the served configuration, collectives measured as the exchange; Gemma 4 E2B/E4B's
  per-layer embeddings read ahead off the step path
- A GPTQ calibration tap and recipe for Gemma 4 31B's w4a8 container

Fixes:
- The two-rank all-reduce checks that a peer's push has landed before reducing it
- z-lab's DFlash drafter on Gemma 4 31B keeps drafting after a prefix-cache hit
- MiniMax-H3's modulation rows

Changes: Plugin ABI 31: out-of-tree plugins must be rebuilt. RADIANCE_PREFETCH_BESIDE is
--weight-prefetch now; RADIANCE_NO_HUGE_PAGES, RADIANCE_IDS_EARLY, RADIANCE_ATTN_BAND_SPLIT,
R4D_PREFILL_SPLITS, RAD_PLE_TIMING and RAD_PLE_CACHE_ROWS are gone.
2026-10-27 16:47:35 +01:00

412 lines
20 KiB
C++

/* ref2va_pack_test.cpp -- the Ref2VA packing against golden vectors produced by the reference
* implementation itself.
*
* arch/minimaxh3/rad_ref2va_pack.cpp is pure host arithmetic, so it is compiled straight in here --
* no rad_core, no device. tests/data/ref2va/golden.json is generated by gen_golden.py, which runs
* the reference PackedLayout (from the MiniMax-H3 model file of a ComfyUI install) over the cases;
* every expectation below is the reference's own output, not a re-derivation. The positions are
* compared after a float64 -> float cast, bit for bit: both sides run the same IEEE double
* operations, so an exact match is the contract -- a ULP drift would mean the port reordered the
* arithmetic.
*/
#include "rad_test.h"
#include "rad_ref2va_pack.h"
#include <nlohmann/json.hpp>
#include <fstream>
#include <string>
using namespace minimaxh3;
namespace {
nlohmann::json& golden() {
static nlohmann::json g = [] {
std::ifstream f(std::string(RAD_REF2VA_GOLDEN) + "/golden.json");
if (!f.is_open()) {
fprintf(stderr, " FAIL golden.json missing -- regenerate with "
"tests/data/ref2va/gen_golden.py\n");
std::exit(1);
}
return nlohmann::json::parse(f);
}();
return g;
}
/* The reference's names for the segment kinds. */
const char* kind_name(int kind) {
static const char* const kNames[kR2VKinds] = { "text", "cond", "cond_audio", "ref_img",
"ref_audio", "audio", "video" };
return kind >= 0 && kind < kR2VKinds ? kNames[kind] : "?";
}
int ref_kind(const std::string& s) {
if (s == "image") return kR2VRefImage;
if (s == "audio") return kR2VRefAudioOnly;
if (s == "video") return kR2VRefVideo;
if (s == "video_audio") return kR2VRefVideoAudio;
return -1;
}
/* The pack `name`'s case asks for, built. */
Ref2VAPack build_case(const nlohmann::json& c) {
Ref2VAGeom g{ c["latent_t"], c["latent_h"], c["latent_w"], c["audio_t"] };
std::vector<Ref2VAKeyframe> kfs;
for (const auto& k : c["keyframes"])
kfs.push_back({ k["frame"], k["video_t"], k["audio_t"] });
std::vector<Ref2VARef> refs;
for (const auto& r : c["refs"])
refs.push_back({ ref_kind(r["kind"].get<std::string>()), r["latent_h"], r["latent_w"],
r["latent_t"], r["ref_audio_t"] });
Ref2VAPack p;
CHECK_EQ(ref2va_build(c["text_len"], g, kfs, refs, &p), 0);
return p;
}
void check_case(const std::string& name) {
const nlohmann::json& c = golden()[name];
const Ref2VAPack p = build_case(c);
CHECK_EQ(p.rows, c["seq_len"].get<int64_t>());
CHECK_EQ((int64_t)p.pos.size(), p.rows * 3);
const auto& segs = c["segments"];
CHECK_EQ(p.segs.size(), segs.size());
for (size_t i = 0; i < p.segs.size() && i < segs.size(); ++i) {
CHECK_EQ(p.segs[i].start, segs[i][0].get<int64_t>());
CHECK_EQ(p.segs[i].end, segs[i][1].get<int64_t>());
CHECK(std::string(kind_name(p.segs[i].kind)) == segs[i][2].get<std::string>());
const std::string kind = segs[i][2].get<std::string>();
CHECK_EQ(p.segs[i].update, kind == "audio" || kind == "video" ? 1 : 0);
}
/* Positions, bit for bit after the float cast: a coordinate drawn a different way in double
* can round to the same f32 and still bend a rotary the next latent over. */
const auto& gp = c["positions"];
for (size_t i = 0; i < gp.size(); ++i)
for (int j = 0; j < 3; ++j) {
const float want = (float)gp[i][j].get<double>();
if (p.pos[(int64_t)j * p.rows + i] != want) {
::radtest::fail(__FILE__, __LINE__,
std::string(name) + ": row " + std::to_string(i) + " axis "
+ std::to_string(j) + " is "
+ std::to_string(p.pos[(int64_t)j * p.rows + i])
+ ", want " + std::to_string(want));
return;
}
}
/* The two latent spaces' row index lists and their update flags, rebuilt from the pack's
* segments the way the sampler scatters them, against the reference's concatenated lists. */
std::vector<int64_t> img_pos, audio_pos;
std::vector<int> img_up, audio_up;
for (const Ref2VASeg& s : p.segs) {
for (int64_t r = s.start; r < s.end; ++r) {
if (ref2va_is_img(s.kind)) { img_pos.push_back(r); img_up.push_back(s.update); }
if (ref2va_is_audio(s.kind)) { audio_pos.push_back(r); audio_up.push_back(s.update); }
}
}
CHECK(img_pos == c["img_pos"].get<std::vector<int64_t>>());
CHECK(audio_pos == c["audio_pos"].get<std::vector<int64_t>>());
std::vector<int> giu, gau;
for (const auto& b : c["img_update"]) giu.push_back(b.get<int>());
for (const auto& b : c["audio_update"]) gau.push_back(b.get<int>());
CHECK(img_up == giu);
CHECK(audio_up == gau);
}
} /* namespace */
TEST(pack_golden_t2va) { check_case("t2va"); }
TEST(pack_golden_fl2va) { check_case("fl2va"); }
TEST(pack_golden_ref2va_all) { check_case("ref2va_all"); }
TEST(pack_golden_chain) { check_case("chain"); }
TEST(pack_golden_no_text) { check_case("no_text"); }
TEST(pack_rejects_negative_dims) {
Ref2VAPack p;
Ref2VAGeom g{ 2, 4, 4, 1 };
CHECK_EQ(ref2va_build(-1, g, {}, {}, &p), -1);
CHECK_EQ(ref2va_build(0, Ref2VAGeom{ -1, 4, 4, 1 }, {}, {}, &p), -1);
CHECK_EQ(ref2va_build(0, g, { { -1, 1, 0 } }, {}, &p), -1);
CHECK_EQ(ref2va_build(0, g, {}, { { kR2VRefImage, -4, 4, 0, 0 } }, &p), -1);
CHECK_EQ(ref2va_build(0, g, {}, { { 7, 4, 4, 0, 0 } }, &p), -1);
}
TEST(pack_plain_matches_the_three_segment_order) {
/* With no references the pack is the text-to-video sequence [text | audio | video], the
* sampler owning the audio and video rows and nothing owning the prompt. */
Ref2VAPack p;
Ref2VAGeom g{ 3, 8, 10, 4 };
CHECK_EQ(ref2va_build(5, g, {}, {}, &p), 0);
CHECK_EQ(p.segs.size(), 3u);
CHECK_EQ(p.segs[0].kind, kR2VText);
CHECK_EQ(p.segs[1].kind, kR2VAudio);
CHECK_EQ(p.segs[2].kind, kR2VVideo);
CHECK_EQ(p.segs[0].update, 0);
CHECK_EQ(p.segs[1].update, 1);
CHECK_EQ(p.segs[2].update, 1);
CHECK_EQ(p.segs[0].start, 0);
CHECK_EQ(p.segs[0].end, 5); /* the prompt */
CHECK_EQ(p.segs[1].start, 5); /* 2 channels x 4 audio latents */
CHECK_EQ(p.segs[1].end, 5 + 8);
CHECK_EQ(p.segs[2].start, 5 + 8); /* 3 latents x (8/2)(10/2) patches */
CHECK_EQ(p.segs[2].end, 5 + 8 + 60);
CHECK_EQ(p.rows, 5 + 8 + 60);
CHECK_EQ(p.pos.size(), (size_t)(3 * p.rows)); /* planar, the shape R_ROPE stages */
/* The rows' positions, axis by axis: the prompt counts up on time and ignores space; the
* soundtrack runs channel-major (all of the left, then the right) at height 0 on the width
* axis' two ends; every video row carries its frame's time. */
const int64_t rows = p.rows;
for (int64_t i = 0; i < 5; ++i) {
CHECK_EQ(p.pos[(size_t)i], (float)i);
CHECK_EQ(p.pos[(size_t)rows + i], 0.0f);
CHECK_EQ(p.pos[(size_t)(2 * rows) + i], 0.0f);
}
for (int ch = 0; ch < 2; ++ch)
for (int k = 0; k < 4; ++k) {
const size_t r = (size_t)(5 + ch * 4 + k);
CHECK_EQ(p.pos[r], (float)(5 + k)); /* time counts per channel, not per row */
CHECK_EQ(p.pos[rows + r], 0.0f);
}
/* The channels sit at the opposite ends of the width axis, and they are different. */
CHECK(p.pos[2 * rows + 5] != p.pos[2 * rows + 9]);
/* Video rows: the first frame's time is the timeline origin (text_len + all reference
* spans -- none here); 20 rows (4x5 patches) per frame, h-major; and frame k+1's time is
* frame k's plus 5/3 * kPattern[k % 5]. */
const size_t v0 = 5 + 8;
const int64_t fpp = 4 * 5;
CHECK_EQ(p.pos[v0], 5.0f);
CHECK_EQ(p.pos[v0 + 1], 5.0f); /* still frame 0 */
CHECK_EQ(p.pos[v0 + fpp], (float)(5.0 + 5.0 / 3.0)); /* frame 1, span 1 · 5/3 */
CHECK_EQ(p.pos[(size_t)(rows + v0)], p.pos[(size_t)(rows + v0 + 1)]); /* same patch row */
CHECK(p.pos[(size_t)(rows + v0)] != p.pos[(size_t)(rows + v0 + 5)]); /* y = 1 begins */
}
TEST(pack_ref_kinds_predicates) {
CHECK_EQ(ref2va_seg_tag(kR2VText), 1);
CHECK_EQ(ref2va_seg_tag(kR2VVideo), 0);
CHECK_EQ(ref2va_seg_tag(kR2VAudio), 2);
CHECK_EQ(ref2va_seg_tag(kR2VCond), 0);
CHECK_EQ(ref2va_seg_tag(kR2VCondAudio), 2);
CHECK_EQ(ref2va_is_img(kR2VText), 0);
CHECK(ref2va_is_img(kR2VCond) && ref2va_is_img(kR2VRefImg) && ref2va_is_img(kR2VVideo));
CHECK(ref2va_is_audio(kR2VCondAudio) && ref2va_is_audio(kR2VRefAudio)
&& ref2va_is_audio(kR2VAudio));
CHECK(!ref2va_is_audio(kR2VRefImg) && !ref2va_is_img(kR2VRefAudio));
}
TEST(pack_mod_groups_images_collapse_to_four) {
/* Nine reference photos, the most a request carries. Every photo is a video-pinned block
* reading the same modulation cell, so the nine merge into one group and the sequence has
* four (prompt, photos, soundtrack, video) whatever the photo count. The merge is what fits
* the request's twelve segments into the plugin's kMaxSegs modulation groups. */
Ref2VAGeom g{ 2, 8, 8, 3 };
std::vector<Ref2VARef> refs(9, Ref2VARef{ kR2VRefImage, 6, 6, 1, 0 });
Ref2VAPack p;
CHECK_EQ(ref2va_build(7, g, {}, refs, &p), 0);
CHECK_EQ(p.segs.size(), 12u); /* text + 9 photos + audio + video */
const int64_t S = 24;
Ref2VAModGroups grp;
ref2va_mod_groups(p, S, {}, &grp);
CHECK_EQ(grp.md.size(), 4u);
CHECK(grp.md == std::vector<int>({ 1, 0, 2, 0 })); /* text, photos, audio, video */
/* Cells: text and the video target read the video schedule (r0 = 0), the photos the
* video-pinned block (2S), the soundtrack the audio schedule (S). */
CHECK(grp.r0 == std::vector<int64_t>({ 0, 2 * S, S, 0 }));
CHECK_EQ(grp.bound.size(), 5u);
CHECK_EQ(grp.bound.front(), 0);
CHECK_EQ(grp.bound.back(), p.rows);
/* The photo group spans the whole run of reference rows, from the prompt's end to the
* soundtrack's start: the two segment boundaries that survive the merge. */
const int64_t text_end = p.segs[0].end, audio_start = p.segs[p.segs.size() - 2].start;
CHECK_EQ(grp.bound[1], text_end);
CHECK_EQ(grp.bound[2], audio_start);
}
TEST(pack_mod_groups_pin_each_stream_at_its_own_block) {
/* A picture and a standalone soundtrack: each reads its own stream's pinned embeddings, the
* video's at 2S and the soundtrack's at 3S. */
Ref2VAGeom g{ 2, 8, 8, 3 };
const std::vector<Ref2VARef> refs = { { kR2VRefImage, 4, 4, 1, 0 },
{ kR2VRefAudioOnly, 0, 0, 0, 2 } };
Ref2VAPack p;
CHECK_EQ(ref2va_build(5, g, {}, refs, &p), 0);
const int64_t S = 10;
Ref2VAModGroups grp;
ref2va_mod_groups(p, S, {}, &grp);
CHECK(grp.md == std::vector<int>({ 1, 0, 2, 2, 0 }));
CHECK(grp.r0 == std::vector<int64_t>({ 0, 2 * S, 3 * S, S, 0 }));
}
TEST(pack_mod_groups_invariants_over_the_goldens) {
/* For every golden pack: the group boundaries span the sequence and are a strictly increasing
* subset of the segment boundaries, so no segment is split; every segment lies inside one
* group of its own modality; no two adjacent groups share a cell, so the merge is maximal; and
* the groups do not depend on the step count S. rad_arch_video_pack derives them at S = 1 and
* the step at the model's S, and the two tables must line up. */
for (const char* name : { "t2va", "fl2va", "ref2va_all", "chain", "no_text" }) {
const Ref2VAPack p = build_case(golden()[name]);
Ref2VAModGroups a, b;
ref2va_mod_groups(p, 1, {}, &a);
ref2va_mod_groups(p, 64, {}, &b);
CHECK(a.bound == b.bound);
CHECK(!a.bound.empty());
CHECK_EQ(a.bound.front(), 0);
CHECK_EQ(a.bound.back(), p.rows);
for (size_t i = 0; i + 1 < a.bound.size(); ++i)
CHECK(a.bound[i] < a.bound[i + 1]);
/* every boundary is a fine boundary (a segment start, or the closing rows count) */
for (int64_t x : a.bound) {
bool found = (x == p.rows);
for (const Ref2VASeg& s : p.segs) if (s.start == x) found = true;
CHECK(found);
}
/* every fine segment sits whole in a group carrying its own modality */
for (const Ref2VASeg& s : p.segs) {
if (s.end <= s.start) continue;
size_t g = 0;
while (g + 1 < a.bound.size() && a.bound[g + 1] <= s.start) ++g;
CHECK(a.bound[g] <= s.start && s.end <= a.bound[g + 1]);
CHECK_EQ(a.md[a.col[g]], ref2va_seg_tag(s.kind));
}
/* Adjacent groups differ in cell, and two groups share a column exactly when they read the
* same cell: a cond photo and a ref photo separated by a soundtrack are two groups on one
* column. Mirrors the pack's cell_of_kind at a's S. */
const int64_t S = 1;
auto cell = [S](int kind) -> std::pair<int, int64_t> {
switch (kind) {
case kR2VAudio: return { 2, S }; break; /* audio schedule */
case kR2VCondAudio:
case kR2VRefAudio: return { 2, 3 * S }; break; /* audio-pinned block */
case kR2VText: return { 1, 0 }; break; /* video schedule */
case kR2VCond:
case kR2VRefImg: return { 0, 2 * S }; break; /* video-pinned block */
default: return { 0, 0 }; break; /* video target */
}
};
auto kind_at = [&p](int64_t row) {
for (const Ref2VASeg& s : p.segs)
if (s.start <= row && row < s.end) return s.kind;
return -1;
};
for (size_t i = 0; i + 1 < a.col.size(); ++i) CHECK(a.col[i] != a.col[i + 1]);
std::vector<char> used(a.md.size(), 0);
for (size_t i = 0; i < a.col.size(); ++i) {
CHECK(a.col[i] >= 0 && (size_t)a.col[i] < a.md.size());
used[a.col[i]] = 1;
const std::pair<int, int64_t> c = cell(kind_at(a.bound[i]));
CHECK_EQ(a.md[a.col[i]], c.first);
CHECK_EQ(a.r0[a.col[i]], c.second);
for (size_t j = 0; j < i; ++j)
CHECK_EQ((int)(a.col[i] == a.col[j]),
(int)(cell(kind_at(a.bound[i])) == cell(kind_at(a.bound[j]))));
}
for (char u : used) CHECK(u); /* every column is addressed */
}
}
TEST(pack_mod_groups_plain_equals_the_fine_table) {
/* A plain [text | audio | video] pack has three distinct cells, so its groups are its three
* segments with the same boundaries: text-to-video modulates exactly as without the merge. */
Ref2VAPack p;
Ref2VAGeom g{ 3, 8, 10, 4 };
CHECK_EQ(ref2va_build(5, g, {}, {}, &p), 0);
Ref2VAModGroups grp;
ref2va_mod_groups(p, 32, {}, &grp);
CHECK_EQ(grp.md.size(), 3u);
CHECK(grp.md == std::vector<int>({ 1, 2, 0 })); /* text, audio, video */
CHECK(grp.r0 == std::vector<int64_t>({ 0, 32, 0 })); /* video sched, audio sched, video */
CHECK_EQ(grp.bound.size(), 4u);
CHECK(grp.bound == std::vector<int64_t>({ 0, 5, 13, 5 + 8 + 60 }));
}
TEST(pack_mod_groups_pad_run_cuts_the_prompt) {
/* One vision-pad run inside the prompt: ComfyUI tags those rows video, so they form a group
* reading the video projection on the prompt's timestep block. The text pieces before and
* after the pad share one cell, and the pad shares the video target's: three cells for five
* groups. */
Ref2VAPack p;
Ref2VAGeom g{ 3, 8, 10, 4 };
CHECK_EQ(ref2va_build(5, g, {}, {}, &p), 0);
const int64_t S = 32;
Ref2VAModGroups grp;
ref2va_mod_groups(p, S, { Ref2VATagRun{ 1, 3, 0 } }, &grp);
CHECK(grp.bound == std::vector<int64_t>({ 0, 1, 3, 5, 13, 5 + 8 + 60 }));
CHECK(grp.col == std::vector<int>({ 0, 1, 0, 2, 1 })); /* text, pad, text, audio, video */
CHECK(grp.md == std::vector<int>({ 1, 0, 2 }));
CHECK(grp.r0 == std::vector<int64_t>({ 0, 0, S })); /* pad on the video schedule */
}
TEST(pack_mod_groups_many_pads_stay_few_cells) {
/* Nine reference photos, each with its pad run and prompt text between: the groups multiply
* (text and pad alternate), the DISTINCT CELLS do not -- four: text, pad/video, the photos'
* pinned video cell, the soundtrack. This is the merge the fixed modulation table rides. */
Ref2VAGeom g{ 2, 8, 8, 3 };
std::vector<Ref2VARef> refs(9, Ref2VARef{ kR2VRefImage, 6, 6, 1, 0 });
Ref2VAPack p;
CHECK_EQ(ref2va_build(100, g, {}, refs, &p), 0);
std::vector<Ref2VATagRun> runs;
for (int i = 0; i < 9; ++i) runs.push_back({ (int64_t)i * 10 + 1, (int64_t)i * 10 + 3, 0 });
const int64_t S = 24;
Ref2VAModGroups grp;
ref2va_mod_groups(p, S, runs, &grp);
CHECK_EQ(grp.col.size(), 22u); /* 19 prompt pieces + photos + soundtrack + video */
CHECK_EQ(grp.md.size(), 4u); /* ... over four cells */
CHECK(grp.md == std::vector<int>({ 1, 0, 0, 2 })); /* text, pad, photo-pinned, audio */
CHECK(grp.r0 == std::vector<int64_t>({ 0, 0, 2 * S, S }));
/* The video target shares the pad's cell and column; the photo group shares the pad's
* projection but not its block. */
CHECK_EQ(grp.col.front(), 0);
CHECK_EQ(grp.col[1], 1);
CHECK_EQ(grp.col.back(), 1);
CHECK_EQ(grp.bound.front(), 0);
CHECK_EQ(grp.bound.back(), p.rows);
}
TEST(pack_mod_groups_runs_are_normalised) {
/* Runs arrive as the driver staged them: unsorted, partly outside the prompt, even empty. The
* merge clamps each to the text segment, drops what falls outside, and the result is the same
* cut as hand-placed in-range runs. A run covering the whole prompt leaves one pad group and
* NO text group; an out-of-range run cuts nothing at all. */
Ref2VAPack p;
Ref2VAGeom g{ 3, 8, 10, 4 };
CHECK_EQ(ref2va_build(5, g, {}, {}, &p), 0);
const int64_t S = 32;
Ref2VAModGroups one, a, b;
ref2va_mod_groups(p, S, { Ref2VATagRun{ 1, 5, 0 } }, &one);
/* Same cut: out-of-range tails, an empty run, a run starting before the prompt and one ending
* at its start, in scrambled order. The two in-range fragments meet and merge into one pad
* group [1,5), exactly the single-run table. */
ref2va_mod_groups(p, S,
{ Ref2VATagRun{ 4, 9, 0 }, Ref2VATagRun{ 3, 6, 0 }, Ref2VATagRun{ 1, 3, 0 },
Ref2VATagRun{ 2, 2, 0 }, Ref2VATagRun{ -4, 0, 0 } },
&a);
CHECK(a.bound == one.bound);
CHECK(a.col == one.col);
ref2va_mod_groups(p, S, { Ref2VATagRun{ 5, 9, 0 } }, &b); /* starts at the segment end */
CHECK_EQ(b.col.size(), 3u); /* untouched: the plain three groups */
CHECK(b.col == std::vector<int>({ 0, 1, 2 }));
}
TEST(pack_mod_groups_pad_tag_audio_reads_the_audio_projection) {
/* A run carries its tag: a tag-2 (audio) run on the prompt opens the (2, 0) cell, distinct
* from the text's and from the audio target's (2, S). The driver emits only tag 0 runs. */
Ref2VAPack p;
Ref2VAGeom g{ 3, 8, 10, 4 };
CHECK_EQ(ref2va_build(5, g, {}, {}, &p), 0);
Ref2VAModGroups grp;
ref2va_mod_groups(p, 16, { Ref2VATagRun{ 0, 5, 2 } }, &grp);
/* The run covers the whole prompt, so the text group is entirely pad: three groups over three
* distinct cells -- (2,0) pad, (2,16) audio target, (0,0) video target. */
CHECK(grp.bound == std::vector<int64_t>({ 0, 5, 13, 73 }));
CHECK(grp.md == std::vector<int>({ 2, 2, 0 }));
CHECK(grp.r0 == std::vector<int64_t>({ 0, 16, 0 }));
CHECK(grp.col == std::vector<int>({ 0, 1, 2 }));
}
RAD_TEST_MAIN()