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
//! Per-model inference modules.
//!
//! This is the home for architecture-specific inference code that does not
//! fit inside `src/serve/forward_mlx.rs` (which is Gemma-4-shaped).
//!
//! Per `project_model_class_split.md`: all model-specific code lives in a
//! per-model file under `models/`, not in generic infra.
//!
//! Populated by ADR-013 (Qwen3.5 / Qwen3.5-MoE).
pub
pub
pub
pub
/// ADR-053 — GLP (GGUF Layer Projection) runtime steering.
/// ADR-059 — KV-cache grafts (context-space steering artifacts).
// C1 is a contract oracle, not the C2 production multi-anchor implementation.
pub
/// ADR-005 iter-230 A2 — crate-wide serialization lock for GPU-executing
/// tests.
///
/// Concurrent Metal encoding from multiple `cargo test` threads corrupts
/// kernel results (NaN bit-patterns, non-finite outputs, parity blowups —
/// spike: `gpu_full_attn` family 5/65 FAILED parallel, 65/65 green
/// single-threaded). Production is NOT in this mode: serve routes GPU
/// encoding through the encoder-worker singleton
/// (`serve/encoder_worker_singleton.rs`). Concurrent multi-thread Metal
/// encoding is UNSUPPORTED crate-wide; this lock serializes the test-only
/// violations of that rule against each other, cross-module, while
/// leaving CPU tests fully parallel.
///
/// Every GPU-kernel-executing test must hold this guard before creating or
/// encoding Metal work. The initial four-family scope was insufficient:
/// unguarded tests in other modules kept corrupting guarded ones.
///
/// Acquire exactly once per test invocation. A private shared test-entry
/// helper may acquire as its first statement if its callers do not acquire;
/// the mutex is non-reentrant. Keep the guard alive through checked completion
/// of all submitted GPU work. CPU-only tests need no GPU guard.
///
/// Poison-tolerant by design: a panicked GPU test must not cascade
/// poison-unwrap failures through the rest of the suite. Limitation
/// (accepted, ADR iter-230): a panicking test could theoretically leave
/// in-flight GPU state; cascade failures are attributable via the
/// original panic. Runner caveat: `cargo-nextest` runs tests in separate
/// PROCESSES — an in-process mutex does not serialize it; GPU families
/// are supported under `cargo test` only.
pub
pub
pub
/// Issue #727 — slot-major KV row copies shared by every family's
/// reclaimed-slot spill.
pub
// Pending native0.15.13 publication/pin. Diagnostic only; no serving activation.