Commit 7472ce4
committed
fix(bgz-tensor): resolve 5 CI-invisible test failures (3 stale tests + 1 slice-bounds bug)
bgz-tensor is excluded from CI (no workflow tests its manifest), so these
reds accumulated unseen on main — surfaced by a local sweep of the
CI-uncovered standalone crates. Diagnosed each as test-stale vs code-bug
before fixing; did not blanket-bump assertions.
Test-stale (code was correct, expected values drifted):
- gamma_calibration: byte_size() is 48 (RoleGamma 36 + CosineGamma 12),
not 40 — the struct has 8 roles (32B)+phi_scale(4B)=36B; the stale
'28+12' comment assumed 7 roles.
- hhtl_cache: serialize() writes a 16-byte gamma_meta trailer that the
test's size formula omitted; added + 16.
- hhtl_d: 0x3C00 is the IEEE-half (F16) bit pattern for 1.0; real BF16
1.0 is 0x3F80. bf16_to_f32 was correct; the test literal was wrong.
Code-bug (genuine robustness fix, both encode + decode):
- matryoshka encode_row/decode_row panicked when the SVD basis rank is
lower than the band profile's nominal max (fewer sample rows than
requested components → a band extends past the available coeffs).
encode: clamp slice start (was only clamping end); decode: cap the
per-band component count to the coeff buffer. Symmetric, so the byte
stream stays in sync; roundtrip + quality assertions pass.
Verified: bgz-tensor 200 passed / 0 failed (was 195/5); fmt clean;
clippy -p bgz-tensor --all-targets -D warnings clean.1 parent cb14704 commit 7472ce4
4 files changed
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
| 435 | + | |
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
633 | | - | |
634 | | - | |
| 633 | + | |
| 634 | + | |
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
556 | | - | |
| 556 | + | |
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | | - | |
| 469 | + | |
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
556 | 559 | | |
557 | 560 | | |
558 | 561 | | |
| |||
0 commit comments