Two new tiers on the CpuOps contract (cpu_tier.h: no standard-library code in the tier files), for the CPUs below AVX2 that setup builds for
(STRATA_ISA_FLOOR none / avx): Nehalem / Westmere and the Pentium / Celeron / Atom parts without AVX (sse41), Sandy / Ivy Bridge and AMD's AVX
CPUs before Excavator (avx).
- cpu_kernels_sse41.cpp: 6 x 8 register tile on __m128; cpu_kernels_avx.cpp: 6 x 16 on __m256 (-msse4.1 / -mavx; MSVC /arch:AVX).
- No FMA on these CPUs: every product term is a multiply then an add, in the k order of every tier. The SSE4.1 tier's products are bit-identical
to the scalar tier's on x86 (unit test).
- F16 weights are converted in integer code, bit exact, without F16C (Sandy Bridge has none); the 16-bit rounding equals the scalar tier's bit
for bit; exp is the Cephes polynomial of the AVX2 tier with separate multiply and add; the one-vector tail product as in AVX2 / AVX-512.
- Dispatch: Isa ranks scalar < sse41 < avx < avx2 < avx512 (Neon apart); the probe reads SSE4.1 and AVX (with the OS ymm state);
STRATA_FORCE_ISA takes sse41 and avx.
- own_reader_supported keeps `auto` on mtmd for every x86 tier below AVX2 (the line reads `< Avx2` instead of `== Scalar`): behaviour unchanged
until the gate.
- strata-vision-own-cpu-test runs every tier the CPU has, capped by STRATA_FORCE_ISA, and adds the rotary / position-add kernels and the SSE4.1 =
scalar product check.
Checked: cpu-test on z440 (Haswell-EP) with each tier forced (scalar, sse41, avx, avx2): all passed; under qemu-user -cpu Westmere the cpu-test
picks sse41 and passes, and strata-vision --tower own / mtmd / auto and strata-vision-own read Qwen3.8 and Qwen3.6 pictures with no illegal
instruction (z440 job z440-20261111-1105-4195).
The MSVC-built CPU reader was 1.057 of mtmd-CPU's time on a 1,024-token picture (Ryzen 5 7600, 6 threads); level at 1 thread and ahead at 12, so the loss was the attention at 4,096 patches: every task (one head, 48 query rows) streamed all of the head's K and V again, V was read in place from the qkv rows (a 3,456-float stride), and the P*V product's last 8 columns (head size 72) went through a 32-wide tile and a buffer.
- V is packed per head (VP[h][j][d]) in the same pass as K^T.
- A task takes 96 query rows (kQBDefault), so K and V are streamed half as often.
- The raw-vector tiers (AVX2, AVX-512) compute a last column tile of one vector or less with a one-vector micro-kernel (the same FMA chain per lane as the two-vector one).
Every change moves only addresses, row grouping or tile width, never the order of a sum: outputs are byte-identical to 88fc47ccf. Diagnostics: STRATA_VIT_CPU_VPACK=0, STRATA_VIT_CPU_QB=<multiple of 48>, STRATA_VIT_CPU_TAIL1=0; and STRATA_VIT_PROF=1 prints the CPU tower's stage times (stderr, off by default).
Identity, old 88fc47ccf against new, 6 pictures:
- MSVC (owner PC): AVX-512 and AVX2 tiers, Qwen3.8: 12 of 12 identical
- GCC 13.3 (Ryzen 5 5600X): scalar and AVX2 tiers, Qwen3.6 and Qwen3.8: all identical; strata-vision-own-cpu-test passes
- Apple clang (M5 Max): NEON and scalar tiers, both readers: all identical; the unit test passes
Speed, 5 alternating pairs:
- MSVC against mtmd-CPU, 6 threads: big1024 0.986 (pairs 0.968-0.998; was 1.057, pairs 1.049-1.079), code4217 0.903, tiny_64x48 0.851
- NEON new against old: big1024 0.987, code4217 0.993, tiny 1.000; 96 against 48 query rows: 1.001 (level)
- GCC AVX2 new against old (3 runs, before the 96 default): about 0.95
`--tower auto` is unchanged (it keeps mtmd for an MSVC-built x86 reader until the numbers are confirmed).