Commit 2983327
test: Q4_K and Q6_K lazy-transpose invariant coverage
Adds direct unit tests for the Q4_K and Q6_K `ops.transpose`
specializations in `DefaultCpuOpsJvm` — the ones added in ef4c40c and
ace832a. Both checks run in the same `QuantizedMemSegMatmulTest` class
that already covers the Q4/Q8 MemSeg variants.
Each test asserts the two invariants the specialization promises:
1. Shape is swapped (rows × cols → cols × rows).
2. `packedData` byte array is the SAME reference — no copy, no
re-layout. This is the load-bearing property: without it, the
transpose falls through to the generic element-wise path in
`DefaultCpuOpsBase`, which attempts a Byte→Float cast on the packed
nibbles and blows up with `ClassCastException` a few stack frames
deep inside `DenseTensorDataFactory.init`.
Closes the test gap both ef4c40c and ace832a noted out loud
("Validated at the DSL level by GemmaDslQ4KTest in the transformers
repo"): that integration test can't guard SKaiNET on its own because
it lives in the sibling repo. These two local tests reproduce the
contract here.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 37f5d94 commit 2983327
1 file changed
Lines changed: 58 additions & 0 deletions
File tree
- skainet-backends/skainet-backend-cpu/src/jvmTest/kotlin/sk/ainet/exec/tensor/ops
Lines changed: 58 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
125 | 129 | | |
126 | 130 | | |
127 | 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 | + | |
| 184 | + | |
| 185 | + | |
128 | 186 | | |
129 | 187 | | |
130 | 188 | | |
| |||
0 commit comments