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
# rustqual.toml — Configuration for the rustqual code quality analyzer
#
# Place this file in your project root.
# Run `rustqual --init` to generate this file.
# ── Function Classification ──────────────────────────────────────────────
# Function names (or glob patterns) to exclude from analysis.
# Examples: "main", "test_*", "visit_*"
= [
"main",
"test_*",
# Test / bench helpers called only from #[test] / #[bench] functions.
# Rustqual's DEAD_CODE testonly heuristic flags these as uncalled
# because they don't carry the #[test] attribute themselves; these
# name patterns cover the project's documented test-helper conventions.
"wht_*",
"rotation_*",
"roundtrip_*",
"*_check",
"*_roundtrip",
# Test-data factories (exact names, not a glob, so that production
# helpers like `make_quant_config` are still analysed).
"make_kv",
"make_q",
"make_kv_gpu",
"make_q_gpu",
"make_config",
"pqo_config",
"cosine_sim",
"compute_*",
"measure_compression_ratio",
"random_unit_vec",
"random_normal_vec",
"run_large_cache_e2e",
"attend_config",
"mse_distortion",
"assert_codebook_valid",
"assert_symmetric",
"assert_in_range",
"cuda_device",
"drive_decode",
"create_tq*_cache",
"bench_*",
]
# Glob patterns for files to exclude from analysis.
# Examples: "generated/**", "tests/**"
= []
# If true, closures count as "logic" even when passed to iterator adaptors.
# Default: false (lenient — closures inside .map()/.filter() are ignored).
= false
# If true, iterator chains (.map, .filter, .fold, ...) count as own calls.
# Default: false.
= false
# If true, recursive calls (function calling itself) are allowed and don't
# count as violations. Default: false.
= false
# If true, the ? operator counts as logic (implicit control flow).
# Default: false.
= false
# ── Suppression Health ───────────────────────────────────────────────────
# Maximum ratio of suppressed functions before a warning is emitted.
# Default: 0.05 (5%). Temporarily bumped to 0.07 until a few rustqual
# false-positive bugs are fixed (then lower back toward 0.05).
= 0.07
# If true, exit with code 1 when warnings are present (e.g. suppression ratio exceeded).
# Default: false. Use --fail-on-warnings CLI flag to enable.
= false
# ── Complexity Analysis ──────────────────────────────────────────────────
[]
= true
= 15
= 10
= true
= true
= [
# Small ints that appear universally in index arithmetic.
"0", "1", "-1", "2", "3", "4", "5", "6", "7", "8", "9",
# Low-range integers used as sequential test-seed indices in
# many generators (each test gets a distinct deterministic seed).
"11", "12", "13", "14", "15", "20", "21", "22", "23", "30", "31",
"48",
# Small floats that appear universally in arithmetic.
"0.0", "1.0", "-1.0", "2.0", "3.0", "4.0", "0.5",
# Standard ML head dimensions (powers of 2 from 16 up to 1024). These
# are the conventional choices for transformer attention and appear
# in test fixtures as self-documenting values.
"16", "32", "64", "128", "256", "512", "1024",
# Standard test batch / sample counts.
"10", "100", "1000", "10000",
"50", "1024",
# Standard numerical tolerances used in approx::assert_abs_diff_eq
# and statistical bias/variance bounds.
"1e-6", "1e-8", "1e-10",
# Common test seeds / counts that appear across many files but have no
# semantic meaning beyond "pick a distinct deterministic value".
"42", # widely-used default seed
"77",
"12345", "54321", "99999",
"11111", "22222", "33333", "44444", "55555", "66666",
"7777", "8888", "9999",
"1337",
# Round-thousand offsets used to separate seed ranges in tests and benches.
"2000", "3000", "4000", "5000", "6000", "7000", "8000", "9000",
]
# ── DRY / Duplicate Detection ───────────────────────────────────────────
[]
= true
= 0.85
= 30
= 5
= 3
= true
= true
= true
= true
= true
# ── Boilerplate Detection ───────────────────────────────────────────────
[]
= true
# Optional: limit to specific patterns (empty = all patterns).
# patterns = ["BP-001", "BP-003"]
= true
# ── SRP (Single Responsibility) ─────────────────────────────────────────
[]
= true
= 0.6
= 12
= 20
= 10
= 2
= [0.4, 0.25, 0.15, 0.2]
= 300
= 800
= 3
= 5
# Maximum number of parameters before a function triggers SRP-004.
= 5
# ── Coupling Analysis ───────────────────────────────────────────────────
[]
= true
= 0.8
= 15
= 12
# Check Stable Dependencies Principle (stable modules should not depend on unstable ones).
= true
# ── Test Quality Analysis ──────────────────────────────────────────────
[]
= true
# Optional: path to LCOV coverage file for TQ-004/TQ-005 checks.
# coverage_file = "lcov.info"
# ── Quality Score Weights ──────────────────────────────────────────────
# Weights for each dimension in the overall quality score.
# Must sum to approximately 1.0.
[]
= 0.25
= 0.20
= 0.15
= 0.20
= 0.10
= 0.10