Commit 2a7f89e
committed
feat(jina): scaffold Jina v5 as main route, preserve v4 explicit route
Authorization: user directive "you can upgrade ndarray code from jina 4 to
jina5 but don't delete v4, just wire v5 as main route."
This is additive scaffolding — Jina v5 bytes are NOT yet baked into
weights/jina_v5_base17_151k.bin + weights/jina_v5_palette_151k.bin, so the
`JINA` main-route static continues to load v4 bytes today. What this commit
establishes is the migration path:
1. `ModelSource::JinaV5` variant added to the enum with a full docstring
describing the Qwen3 base, 151K BPE tokens, 1024D hidden, SiLU activation.
Explicitly marked as the MAIN ROUTE target per AdaWorldAPI model registry.
2. Internal weight-byte statics renamed for clarity:
JINA_BASE17 → JINA_V4_BASE17
JINA_PALETTE → JINA_V4_PALETTE
These are file-private `static` (not `pub`), so the rename does not
affect any downstream caller. Names make v4-specificity explicit so the
future JINA_V5_BASE17 / JINA_V5_PALETTE add-in is unambiguous.
3. `pub static JINA_V4` added as an explicit legacy-route accessor.
Semantically identical to `JINA` today; the difference appears only
AFTER v5 bake, at which point:
- `JINA` will load v5 bytes (main route advances)
- `JINA_V4` will still load v4 bytes (backward compat preserved)
Tests that need v4 specifically can reference JINA_V4 directly and will
NOT be silently upgraded to v5.
4. `JINA` main-route static keeps its current v4 load BUT gains a detailed
docstring + inline TODO(jina-v5-bake) pointing at the exact one-line
swap required when v5 weights are baked:
ModelRuntime::load(ModelSource::JinaV5, JINA_V5_BASE17, JINA_V5_PALETTE)
5. New test `test_jina_v4_explicit_route` asserts that `&*JINA_V4` loads
with `source == ModelSource::JinaV4` and `vocab_size() == 20000`. This
test MUST still pass after any future v5 swap — it is the backward-compat
guarantee that v4 is never silently deleted.
6. Existing test `test_jina_runtime_loads` is kept unchanged (still asserts
`JINA == JinaV4`) because JINA currently loads v4. Its docstring notes
that after v5 bake this test must be updated to assert JinaV5 source and
~151000 vocab_size.
Verified:
- `cargo check --lib` → clean (pre-existing warnings only, zero new)
- `cargo test --lib hpc::jina::runtime` → test_jina_runtime_loads PASS
- `cargo test --lib hpc::jina::runtime` → test_jina_v4_explicit_route PASS
Not in this commit (deferred, pending v5 bake pipeline):
- Actual JINA_V5_BASE17 / JINA_V5_PALETTE include_bytes statics
- Swapping JINA's load to JinaV5
- New test asserting JINA.source == JinaV5 (would replace the current
assertion in test_jina_runtime_loads after bake)
- GammaProfile per-role calibration for the v5 weights (related but
separate: see lance-graph/crates/bgz-tensor/src/gamma_phi.rs and the
"γ+φ as HDR-TV-style distribution normalizer" architectural note)
https://claude.ai/code/session_019RzHP8tpJu55ESTxhfUy1A1 parent 76a0a45 commit 2a7f89e
1 file changed
Lines changed: 68 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
18 | 30 | | |
19 | 31 | | |
20 | 32 | | |
| |||
23 | 35 | | |
24 | 36 | | |
25 | 37 | | |
26 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
27 | 42 | | |
28 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
29 | 55 | | |
30 | 56 | | |
31 | 57 | | |
| |||
190 | 216 | | |
191 | 217 | | |
192 | 218 | | |
193 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
194 | 233 | | |
195 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
196 | 246 | | |
197 | 247 | | |
198 | 248 | | |
| |||
211 | 261 | | |
212 | 262 | | |
213 | 263 | | |
| 264 | + | |
| 265 | + | |
214 | 266 | | |
215 | 267 | | |
216 | 268 | | |
217 | 269 | | |
218 | 270 | | |
219 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
220 | 282 | | |
221 | 283 | | |
222 | 284 | | |
| |||
0 commit comments