hf2q 0.1.33

Pure Rust CLI for converting HuggingFace models to hardware-optimized formats and serving them over an OpenAI-compatible API on Apple Silicon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
//! Fail-closed route admission for Qwen joint B-row decode.
//!
//! A joint step packs one decode token from each of several independent
//! slots. Every product it issues either runs once over the packed rows or
//! runs once per row through the exact helper the serial one-token graph
//! uses. The contract depends on the route mode:
//!
//! - [`JointRouteMode::Exact`]: each row must be bitwise identical to its
//!   serial one-token forward. Packed products are admitted only for block
//!   storage whose canonical `m = 2..=8` route keeps one-row arithmetic
//!   (`Mv`, the `mvN` K-quant tiles, canonical Q5_K), and only while the
//!   model's routing policy keeps `mul_mv_ext` off. Float storage switches
//!   from a matvec at `m = 1` to tiled kernels at `m > 1`, so it runs per row.
//! - [`JointRouteMode::PaddedMvExt`]: the Qwen3.8 production policy
//!   (`dense_decode_mv_ext`, the model default or `HF2Q_DECODE_MV_EXT=1`)
//!   routes K-quants through the non-exact `mul_mv_ext` kernel at widths
//!   4..=8. Every step is padded to exactly
//!   [`PADDED_MV_EXT_WIDTH`] rows (joint width is capped there), so a row's
//!   packed width never depends on how many tenants share the step; the
//!   cohort-invariance gate checks the resulting bytes per row. Against
//!   stock serial decode this is a Q1 Class B route (decision envelope,
//!   `docs/research/adr063-q1-numeric-policy.md` §3.2), not bitwise.
//!   Only dense-FFN artifacts are admitted in this mode.
//!
//! The dense FFN's gate/up products have their own route
//! ([`JointDenseFfnRoute`]). Exact mode always uses the serial graph's
//! builder, whose fused gate/up/SiLU kernel launches one threadgroup row per
//! packed row and therefore reads the gate and up weights once per row. The
//! padded mode defaults to [`JointDenseFfnRoute::SharedWeights`]: gate and
//! up become separate packed products on the canonical dispatcher (each
//! weight block read once per step), followed by `silu_mul`. It is part of
//! the same Q1 Class B route; `HF2Q_QWEN_JOINT_FFN_SHARED=0` restores the
//! serial builder.
//!
//! Any other block storage type is refused, so an unproven artifact keeps the
//! serial path instead of coupling one conversation's numerics to another's.
//!
//! This contract covers plain joint decode and joint MTP verify steps. A
//! DFlash2 target verify step (`joint_verify`) is a route of its own: it
//! runs wide tiles and, with the prepared-route switches
//! (`HF2Q_REPACKED_GGUF_M32*`, `HF2Q_REPACKED_GGUF_ANY_WIDTH`), prepared
//! Q4_K / Q6_K kernels that the serial graph never takes, so a token it
//! verifies and the same token decoded serially or in a plain joint step
//! need not agree in bits (Q1 Class B). Outside a DFlash2 verify step those
//! switches act only on a 32-row joint step, and plain joint decode and
//! joint MTP verify never exceed [`MAX_JOINT_VERIFY_ROWS`] rows, so their
//! routes and this contract are unchanged by them.

use mlx_native::ops::quantized_matmul_ggml::GgmlType;
use mlx_native::DType;

/// Widest serving joint-decode pack. Production callers stay within this
/// bound.
pub(crate) const MAX_JOINT_DECODE_ROWS: usize = 8;
/// Widest diagnostic joint-MTP verify pack: four slots × four rows.
pub(crate) const MAX_JOINT_VERIFY_ROWS: usize = 16;
/// Fixed DFlash2 target width: four lanes × eight rows.
pub(crate) const DFLASH2_VERIFY_WIDTH: usize = 32;

/// The only packed width of the `mul_mv_ext` mode, and its row cap.
pub(crate) const PADDED_MV_EXT_WIDTH: usize = 4;

/// How a joint step's packed products are allowed to differ from serial.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(crate) enum JointRouteMode {
    /// Bitwise equal to serial decode per row.
    Exact,
    /// Packed products use `mul_mv_ext` at the fixed padded width; a Q1
    /// Class B route against serial decode.
    PaddedMvExt,
}

impl JointRouteMode {
    pub(crate) fn label(self) -> &'static str {
        match self {
            Self::Exact => "exact",
            Self::PaddedMvExt => "padded_mv_ext",
        }
    }
}

/// How one product of a joint step is issued.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(crate) enum JointProductRoute {
    /// One dispatch over every packed row.
    Batched,
    /// One serial-identical `m = 1` dispatch per row.
    PerRow,
}

/// The model's routing switches that decide the joint contract. Derived from
/// the model-lifetime [`mlx_native::GgmlRoutingPolicy`] frozen into its
/// kernel registry (#729), never from the live process environment.
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub(crate) struct JointRoutingPolicy {
    pub mv_ext: bool,
}

impl JointRoutingPolicy {
    pub(crate) fn from_ggml(policy: &mlx_native::GgmlRoutingPolicy) -> Self {
        Self {
            mv_ext: policy.dense_decode_mv_ext,
        }
    }
}

/// Route mode for this artifact family under the model's routing policy,
/// or the reason joint decode must stay serial.
pub(crate) fn select_joint_route_mode(
    policy: JointRoutingPolicy,
    moe: bool,
) -> Result<JointRouteMode, String> {
    match (policy.mv_ext, moe) {
        (false, _) => Ok(JointRouteMode::Exact),
        (true, false) => Ok(JointRouteMode::PaddedMvExt),
        (true, true) => Err(
            "the mul_mv_ext routing policy routes packed MoE rows through non-exact \
             mul_mv_ext and no Q1 gate covers MoE artifacts on that route"
                .into(),
        ),
    }
}

/// Reject a mode the model's routing policy cannot honour.
pub(crate) fn check_mode_policy(
    mode: JointRouteMode,
    policy: JointRoutingPolicy,
) -> Result<(), String> {
    if mode == JointRouteMode::Exact && policy.mv_ext {
        return Err(
            "exact joint decode requires a routing policy without mul_mv_ext (it is not bitwise)"
                .into(),
        );
    }
    Ok(())
}

/// Packed width for `rows` real rows. Exact steps pack only real rows; the
/// `mul_mv_ext` mode always packs [`PADDED_MV_EXT_WIDTH`] rows (callers cap
/// its rows there; see [`joint_mode_max_rows`]).
pub(crate) fn joint_padded_width(mode: JointRouteMode, rows: usize) -> usize {
    match mode {
        JointRouteMode::Exact => rows,
        JointRouteMode::PaddedMvExt => PADDED_MV_EXT_WIDTH,
    }
}

/// Joint row cap for `mode` given the operator's requested cap.
pub(crate) fn joint_mode_max_rows(mode: JointRouteMode, requested: usize) -> usize {
    match mode {
        JointRouteMode::Exact => requested,
        JointRouteMode::PaddedMvExt => requested.min(PADDED_MV_EXT_WIDTH),
    }
}

/// Packed width of a joint-MTP verify step with `rows` real rows (the lane
/// windows, `1..=`[`MAX_JOINT_VERIFY_ROWS`]). Exact steps pack only real
/// rows. The padded mode uses the smallest proven tile that covers the
/// step: width four, width eight, or the diagnostic-only width sixteen.
pub(crate) fn joint_verify_padded_width(mode: JointRouteMode, rows: usize) -> usize {
    match mode {
        JointRouteMode::Exact => rows,
        JointRouteMode::PaddedMvExt if rows <= PADDED_MV_EXT_WIDTH => PADDED_MV_EXT_WIDTH,
        JointRouteMode::PaddedMvExt if rows <= MAX_JOINT_DECODE_ROWS => MAX_JOINT_DECODE_ROWS,
        JointRouteMode::PaddedMvExt => MAX_JOINT_VERIFY_ROWS,
    }
}

/// Block storage whose packed route is proven (or, for `PaddedMvExt`,
/// width-consistent) on the default matvec family.
fn packed_block_type(ggml_type: GgmlType) -> bool {
    matches!(
        ggml_type,
        GgmlType::Q4_0 | GgmlType::Q8_0 | GgmlType::Q4_K | GgmlType::Q5_K | GgmlType::Q6_K
    )
}

/// Route for one projection with Metal storage `dtype` and GGUF type
/// `ggml_type`, or the reason the artifact must stay serial.
pub(crate) fn projection_route(
    name: &str,
    dtype: DType,
    ggml_type: GgmlType,
) -> Result<JointProductRoute, String> {
    match dtype {
        DType::F32 | DType::F16 | DType::BF16 => Ok(JointProductRoute::PerRow),
        DType::U8 if packed_block_type(ggml_type) => Ok(JointProductRoute::Batched),
        DType::U8 => Err(format!(
            "{name} is {ggml_type:?}, which has no proven joint decode route"
        )),
        other => Err(format!("{name} has unsupported joint storage {other:?}")),
    }
}

/// Dense FFN products always run packed on either [`JointDenseFfnRoute`]
/// (there is no per-row fallback in the joint graph), so both types must be
/// admitted.
pub(crate) fn dense_ffn_route(
    layer: usize,
    gate_up: GgmlType,
    down: GgmlType,
) -> Result<(), String> {
    for (role, ggml_type) in [("gate/up", gate_up), ("down", down)] {
        if !packed_block_type(ggml_type) {
            return Err(format!(
                "layer {layer} dense FFN {role} is {ggml_type:?}, which has no proven joint decode route"
            ));
        }
    }
    Ok(())
}

/// Kill switch for [`JointDenseFfnRoute::SharedWeights`]: `0`/`off`/`false`
/// keeps the serial builder in the padded mode; unset or `1`/`on`/`true`
/// selects the shared route.
pub(crate) const QWEN_JOINT_FFN_SHARED_ENV: &str = "HF2Q_QWEN_JOINT_FFN_SHARED";

/// How a joint step issues the dense FFN gate/up products.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(crate) enum JointDenseFfnRoute {
    /// The serial graph's builder at `seq = width`. For Q4_K, Q6_K, Q8_0
    /// and IQ4_NL gate/up it runs the fused gate/up/SiLU kernel, which
    /// launches one threadgroup row per packed row: the gate and up weights
    /// are read once per row.
    SerialBuilder,
    /// Gate and up as separate packed products on the canonical dispatcher
    /// (`mul_mv_ext`, `mvN` or canonical Q5_K at width 4, each reading every
    /// weight block once per step), then `silu_mul`; the down product is
    /// unchanged. Not bitwise equal to the serial builder (different
    /// reduction order), so it is admitted only in the padded mode, where
    /// it is part of that mode's Q1 Class B route.
    SharedWeights,
}

impl JointDenseFfnRoute {
    pub(crate) fn label(self) -> &'static str {
        match self {
            Self::SerialBuilder => "serial_builder",
            Self::SharedWeights => "shared_weights",
        }
    }
}

/// Parse [`QWEN_JOINT_FFN_SHARED_ENV`]; unset or blank means on.
pub(crate) fn parse_joint_ffn_shared(raw: Option<&str>) -> Result<bool, String> {
    let Some(raw) = raw.map(str::trim).filter(|raw| !raw.is_empty()) else {
        return Ok(true);
    };
    match raw.to_ascii_lowercase().as_str() {
        "1" | "on" | "true" => Ok(true),
        "0" | "off" | "false" => Ok(false),
        _ => Err(format!(
            "{QWEN_JOINT_FFN_SHARED_ENV} must be 1/on/true or 0/off/false, got {raw:?}"
        )),
    }
}

/// [`parse_joint_ffn_shared`] over the process environment.
pub(crate) fn joint_ffn_shared_from_process() -> Result<bool, String> {
    parse_joint_ffn_shared(std::env::var(QWEN_JOINT_FFN_SHARED_ENV).ok().as_deref())
}

/// Dense FFN route for `mode`. Exact mode keeps the serial builder whatever
/// the switch says: serial `m = 1` decode runs the same per-row fused
/// kernel, which is what makes its rows bitwise.
pub(crate) fn select_dense_ffn_route(mode: JointRouteMode, shared: bool) -> JointDenseFfnRoute {
    match mode {
        JointRouteMode::PaddedMvExt if shared => JointDenseFfnRoute::SharedWeights,
        JointRouteMode::Exact | JointRouteMode::PaddedMvExt => JointDenseFfnRoute::SerialBuilder,
    }
}

/// Reject a dense FFN route the mode's numeric contract cannot honour.
pub(crate) fn check_dense_ffn_route(
    mode: JointRouteMode,
    route: JointDenseFfnRoute,
) -> Result<(), String> {
    if mode == JointRouteMode::Exact && route == JointDenseFfnRoute::SharedWeights {
        return Err(
            "exact joint decode requires the serial dense FFN builder (the shared gate/up \
             route is not bitwise equal to serial decode)"
                .into(),
        );
    }
    Ok(())
}

/// Process-wide switches that change the serial one-token graph's
/// submission shape. Any of them keeps decode serial. (Layer-dump
/// diagnostics are checked by the graph, which owns their predicates.)
pub(crate) fn joint_decode_env_unavailable_reason() -> Option<String> {
    let flag = |name: &str| std::env::var(name).as_deref() == Ok("1");
    if flag("HF2Q_LEGACY_PER_LAYER_CB") {
        return Some("HF2Q_LEGACY_PER_LAYER_CB=1 selects the legacy serial graph".into());
    }
    if flag("MLX_UNRETAINED_REFS") {
        return Some("MLX_UNRETAINED_REFS=1 requires the serial buffer anchors".into());
    }
    None
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn exact_mode_is_selected_unless_mv_ext_is_on() {
        let off = JointRoutingPolicy { mv_ext: false };
        let on = JointRoutingPolicy { mv_ext: true };
        assert_eq!(
            select_joint_route_mode(off, false),
            Ok(JointRouteMode::Exact)
        );
        assert_eq!(
            select_joint_route_mode(off, true),
            Ok(JointRouteMode::Exact)
        );
        assert_eq!(
            select_joint_route_mode(on, false),
            Ok(JointRouteMode::PaddedMvExt)
        );
        assert!(select_joint_route_mode(on, true).is_err());
    }

    #[test]
    fn exact_mode_refuses_mv_ext_policy() {
        let on = JointRoutingPolicy { mv_ext: true };
        let off = JointRoutingPolicy { mv_ext: false };
        assert!(check_mode_policy(JointRouteMode::Exact, on).is_err());
        assert!(check_mode_policy(JointRouteMode::Exact, off).is_ok());
        assert!(check_mode_policy(JointRouteMode::PaddedMvExt, on).is_ok());
    }

    #[test]
    fn verify_width_covers_the_diagnostic_grid() {
        for rows in 1..=MAX_JOINT_VERIFY_ROWS {
            assert_eq!(joint_verify_padded_width(JointRouteMode::Exact, rows), rows);
            let padded = joint_verify_padded_width(JointRouteMode::PaddedMvExt, rows);
            assert!(padded >= rows);
            let expected = if rows <= 4 {
                4
            } else if rows <= 8 {
                8
            } else {
                16
            };
            assert_eq!(padded, expected);
        }
        assert_eq!(DFLASH2_VERIFY_WIDTH, 4 * 8);
    }

    #[test]
    fn joint_policy_reads_only_the_model_policy() {
        let mut ggml = mlx_native::GgmlRoutingPolicy::default();
        ggml.dense_decode_mv_ext = false;
        assert_eq!(
            JointRoutingPolicy::from_ggml(&ggml),
            JointRoutingPolicy { mv_ext: false }
        );
        ggml.dense_decode_mv_ext = true;
        assert_eq!(
            JointRoutingPolicy::from_ggml(&ggml),
            JointRoutingPolicy { mv_ext: true }
        );
    }

    #[test]
    fn padded_width_never_depends_on_tenant_count() {
        for rows in 1..=PADDED_MV_EXT_WIDTH {
            assert_eq!(joint_padded_width(JointRouteMode::PaddedMvExt, rows), 4);
            assert_eq!(joint_padded_width(JointRouteMode::Exact, rows), rows);
        }
        // An operator cap above four never widens a padded step.
        for requested in 2..=MAX_JOINT_DECODE_ROWS {
            let cap = joint_mode_max_rows(JointRouteMode::PaddedMvExt, requested);
            assert_eq!(cap, requested.min(4));
            assert_eq!(joint_padded_width(JointRouteMode::PaddedMvExt, cap), 4);
            assert_eq!(
                joint_mode_max_rows(JointRouteMode::Exact, requested),
                requested
            );
        }
    }

    #[test]
    fn float_storage_runs_per_row_and_unproven_blocks_are_refused() {
        for dtype in [DType::F32, DType::F16, DType::BF16] {
            assert_eq!(
                projection_route("router", dtype, GgmlType::F32),
                Ok(JointProductRoute::PerRow)
            );
        }
        for ggml_type in [
            GgmlType::Q4_0,
            GgmlType::Q8_0,
            GgmlType::Q4_K,
            GgmlType::Q5_K,
            GgmlType::Q6_K,
        ] {
            assert_eq!(
                projection_route("wq", DType::U8, ggml_type),
                Ok(JointProductRoute::Batched)
            );
        }
        for ggml_type in [
            GgmlType::Q2_K,
            GgmlType::Q3_K,
            GgmlType::Q5_0,
            GgmlType::IQ4_NL,
            GgmlType::IQ4_XS,
        ] {
            let error = projection_route("attn_qkv", DType::U8, ggml_type)
                .expect_err("unproven block storage must stay serial");
            assert!(error.contains("attn_qkv"), "{error}");
        }
    }

    #[test]
    fn dense_ffn_requires_both_roles_admitted() {
        assert!(dense_ffn_route(3, GgmlType::Q4_K, GgmlType::Q6_K).is_ok());
        let error = dense_ffn_route(3, GgmlType::IQ4_NL, GgmlType::Q6_K)
            .expect_err("unproven gate/up storage");
        assert!(
            error.contains("layer 3") && error.contains("gate/up"),
            "{error}"
        );
        assert!(dense_ffn_route(3, GgmlType::Q4_K, GgmlType::Q2_K).is_err());
    }

    #[test]
    fn shared_ffn_switch_defaults_on_and_parses_explicit_arms() {
        for raw in [
            None,
            Some(""),
            Some("  "),
            Some("1"),
            Some("On"),
            Some("true"),
        ] {
            assert_eq!(parse_joint_ffn_shared(raw), Ok(true), "{raw:?}");
        }
        for raw in ["0", "OFF", "false"] {
            assert_eq!(parse_joint_ffn_shared(Some(raw)), Ok(false), "{raw}");
        }
        let error = parse_joint_ffn_shared(Some("shared")).expect_err("invalid switch value");
        assert!(error.contains(QWEN_JOINT_FFN_SHARED_ENV), "{error}");
    }

    #[test]
    fn exact_mode_never_takes_the_shared_ffn_route() {
        for shared in [false, true] {
            let route = select_dense_ffn_route(JointRouteMode::Exact, shared);
            assert_eq!(route, JointDenseFfnRoute::SerialBuilder);
            assert!(check_dense_ffn_route(JointRouteMode::Exact, route).is_ok());
        }
        assert_eq!(
            select_dense_ffn_route(JointRouteMode::PaddedMvExt, true),
            JointDenseFfnRoute::SharedWeights
        );
        assert_eq!(
            select_dense_ffn_route(JointRouteMode::PaddedMvExt, false),
            JointDenseFfnRoute::SerialBuilder
        );
        assert!(
            check_dense_ffn_route(JointRouteMode::Exact, JointDenseFfnRoute::SharedWeights)
                .is_err()
        );
        for route in [
            JointDenseFfnRoute::SerialBuilder,
            JointDenseFfnRoute::SharedWeights,
        ] {
            assert!(check_dense_ffn_route(JointRouteMode::PaddedMvExt, route).is_ok());
        }
    }

    /// The shared route's saving rests on the canonical dispatcher reading
    /// each weight block once for all padded rows. Pin that for the Qwen3.8
    /// dense FFN shapes (gate/up `[17408, 5120]`, down `[5120, 17408]`) and
    /// every admitted type, under both padded-mode policies (`mvN` off, as
    /// Qwen3.8 serving sets it, and on).
    #[test]
    fn shared_ffn_products_read_weights_once_per_padded_step() {
        use mlx_native::{
            ggml_capability, GgmlCapabilityRequest, GgmlInvocation, GgmlKernelRoute,
            GgmlRoutingPolicy, GgmlWorkloadClass, GGML_CAPABILITY_SCHEMA_VERSION,
        };
        let m = PADDED_MV_EXT_WIDTH as u32;
        for dense_decode_mvn in [false, true] {
            let routing = GgmlRoutingPolicy {
                dense_decode_mvn,
                dense_decode_mv_ext: true,
                ..GgmlRoutingPolicy::default()
            };
            for ggml_type in [
                GgmlType::Q4_0,
                GgmlType::Q8_0,
                GgmlType::Q4_K,
                GgmlType::Q5_K,
                GgmlType::Q6_K,
            ] {
                assert!(packed_block_type(ggml_type));
                for (n, k) in [(17_408, 5_120), (5_120, 17_408)] {
                    let capability = ggml_capability(GgmlCapabilityRequest {
                        schema_version: GGML_CAPABILITY_SCHEMA_VERSION,
                        invocation: GgmlInvocation::DenseAuto { m, n, k },
                        ggml_type,
                        workload: GgmlWorkloadClass::ContinuousWidth,
                        routing,
                    });
                    let at = format!("{ggml_type:?} [{n}, {k}] m={m} mvn={dense_decode_mvn}");
                    assert!(capability.executable, "{at}: {}", capability.diagnostic);
                    assert!(
                        matches!(
                            capability.route,
                            Some(
                                GgmlKernelRoute::DenseWidthMvExt
                                    | GgmlKernelRoute::DenseQ4kWidthMn
                                    | GgmlKernelRoute::DenseQ5kWidthMn
                                    | GgmlKernelRoute::DenseQ6kWidthMn
                                    | GgmlKernelRoute::DenseQ5kCanonicalQ4x4
                            )
                        ),
                        "{at}: {:?} is not a multi-column route",
                        capability.route
                    );
                    assert_eq!(capability.dispatches, 1, "{at}: one weight pass");
                }
            }
        }
    }
}