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
//! Makes a modelless run's SKIPPED model gates say so, per test binary (#61).
//!
//! Every model gate in this repository is `#[ignore]`d — the convention — so a
//! run without `Models/` reports them as `ignored` and nothing else. That reads
//! identically whether the gates were deliberately skipped or whether the whole
//! suite evaporated, which is the third gap in #61: the absence is silent.
//!
//! [`report`] is a plain (NOT `#[ignore]`d) test body that each kit's shared
//! `common/mod.rs` calls, so every binary that already writes `mod common;`
//! gets it — including `coremlit-parity`'s oracle binaries, which
//! `#[path]`-include the very same files. It prints one line naming how many of
//! the binary's tests are model gates that did not run, and whether the models
//! root they need is on disk.
//!
//! # The count is libtest's, not a guess
//!
//! The binary re-executes ITSELF with `--list --ignored` — libtest's
//! ignored-ONLY listing, the same `RunIgnored::Only` filter and the same
//! `NAME: test` line shape CI's anti-vacuum guards count. So the number is what
//! libtest would actually select, not a scan of `#[ignore]` attributes that a
//! `cfg` could make a lie. `--list` executes no test, so the child cannot
//! recurse. Deliberately NOT a `cargo` invocation: `cargo` cannot nest inside a
//! `cargo test` run without deadlocking on the target-dir lock, which is why
//! the two gate-inventory checks next door are shell scripts rather than tests.
//!
//! # Written to the real fd 2, on purpose
//!
//! libtest CAPTURES `println!`/`eprintln!` from a test that PASSES and discards
//! it, so a passing test that "reports" something reports it to nobody unless
//! the reader remembers `--nocapture` — the same silence this is meant to end.
//! The capture is installed on the Rust-level stdout/stderr handles (and is
//! inherited by spawned threads), so the report writes to the inherited stderr
//! descriptor instead, in one `write` so lines from sibling tests cannot
//! interleave.
//!
//! # What it refuses, and what it does not
//!
//! Delete, un-`#[ignore]`, or `cfg` away a kit's gates and its binaries print
//! `0 of N`, in every ordinary run, next to that binary's own result line —
//! the "visibly report zero" half of the same property CI's `--list --ignored`
//! counts enforce by failing. It does NOT refuse a RENAMED gate: a rename
//! leaves the count alone. CI catches that where it matters, because a rename
//! breaks the gate plan's own selector (and, for CED, its `tiny::` filter).
//!
//! The one thing this DOES fail on is its own mechanism: a binary whose
//! unfiltered `--list` is empty could not have run this test, so an empty
//! listing means the self-exec is broken and every count it prints is a lie.
//!
//! The root probe is the DIRECTORY's existence, not an inventory of what is in
//! it: a half-staged tree — siglip's 33 MB tokenizer sidecar without its 748 MB
//! towers, say — reports `present`, and its gates then fail loudly on the
//! missing file. Naming the root is what turns "ignored" into "ignored, and
//! this is where the models would have been"; proving a tree COMPLETE is the
//! per-kit `model_io` gates' job, and CI's checksum step's.
use ;
/// Folds `a/../b` down to `b` so a root reads as a path rather than as the
/// expression that produced it. Purely lexical — the roots that most need
/// printing are the ones that do not exist, which `canonicalize` refuses.
/// Prints this binary's model-gate count and the state of the models roots
/// those gates need.
///
/// `roots` pairs each env var that overrides a root with the path this
/// binary's own resolver produced for it — pass `common::models_dir()` and
/// friends, never a second copy of the fallback, so the report cannot drift
/// from the gates it describes.
///
/// Panics only if the self-listing described in the module docs comes back
/// empty or fails to run.