Commit 778e52a
committed
fix: feature matrix — grpc + lab combinations were broken
Post-PR-#238 audit (user's "Careful" warning) surfaced three latent
bugs that --features serve tests alone couldn't catch:
1. --features grpc ALONE failed to compile — wire.rs was `serve`-only
gated but codec_research.rs (gated on any(serve, grpc)) imported
wire types unconditionally. Pre-existing architectural gap from
before this session; latent because no CI path exercised grpc-only.
Fix: widen wire.rs + auto_detect.rs + codec_kernel_cache.rs +
rotation_kernel.rs + decode_kernel.rs + token_agreement.rs gates
from `serve` to `any(serve, grpc)`. Both transports share the same
DTO surface; both need wire compiled.
2. --features grpc missing serde/serde_json/base64/bytemuck deps.
wire.rs needs them (serde derives on DTOs; serde_json in tests;
base64 for WireTensorView decode; bytemuck for lane casting).
Previously only `serve` pulled them.
Fix: new internal feature `_lab-dtos` that both serve + grpc pull
in. Keeps the dependency sharing explicit:
_lab-dtos = ["dep:serde", "dep:serde_json", "dep:base64", "dep:bytemuck"]
serve = ["_lab-dtos", "dep:axum", "dep:tokio"]
grpc = ["_lab-dtos", "dep:prost", "dep:tonic", "dep:tonic-build", "dep:tokio"]
3. --features lab failed with E0063 at grpc.rs:210 — WireCalibrateRequest
struct-literal was missing the `params` + `tensor_view` fields I
added in D0.1 (PR #227). Another latent bug: my --features serve
tests didn't exercise grpc.rs.
Fix: add `params: None, tensor_view: None` explicitly, with a
comment noting the gRPC path uses legacy num_* fields only until
the proto schema catches up (D0.3b follow-up).
4. Bonus — 3x redundant closures in grpc.rs that clippy only caught
under `--features lab`:
.map_err(|e| Status::invalid_argument(e)) → .map_err(Status::invalid_argument)
Rust 1.95 match-ergonomics check: grep'd `mut ref` + `ref mut` in
struct pattern field shorthand across cognitive-shader-driver/src.
Zero hits — no Rust 1.95 breakage lurking.
Verification (all passing now):
cargo check (default) ✓
cargo check --features serve ✓
cargo check --features grpc ✓
cargo check --features lab ✓
cargo test --features lab --lib: 117/117 pass
cargo test --features serve --lib: 117/117 pass
cargo test --lib (default): 39/39 pass
cargo clippy --features lab -- -D warnings: CLEAN
cargo clippy --features serve -- -D warnings: CLEAN
The session's 16 PRs all ran under --features serve only; this
commit is the rescue that proves the other feature combinations
compile clean too. Future sessions should exercise the full
feature matrix before declaring any DTO change complete.
https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh1 parent a1e5dec commit 778e52a
3 files changed
Lines changed: 23 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
213 | 218 | | |
214 | 219 | | |
215 | 220 | | |
216 | 221 | | |
217 | 222 | | |
218 | 223 | | |
219 | 224 | | |
220 | | - | |
| 225 | + | |
221 | 226 | | |
222 | 227 | | |
223 | 228 | | |
| |||
248 | 253 | | |
249 | 254 | | |
250 | 255 | | |
251 | | - | |
| 256 | + | |
252 | 257 | | |
253 | 258 | | |
254 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
120 | | - | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
125 | | - | |
| 128 | + | |
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
131 | | - | |
| 134 | + | |
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
138 | | - | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
142 | 145 | | |
143 | 146 | | |
144 | 147 | | |
145 | | - | |
| 148 | + | |
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
| |||
0 commit comments