Skip to content

Commit 6f489ec

Browse files
committed
plans: gemm consolidation v1.1 — Mississippi Queen amendment + Wave 0 static results
Two additions to the DRAFT, no code. §9 folds in the operator's Mississippi Queen metaphor, graded mechanism vs rhyme. The load-bearing one CORRECTS the plan: v1's D-GTM-F4 built the compacted row-index list "once per mask generation" — laying the whole river before any boat moves. `pack_a_f32` already walks a panel cursor, so the mask->index expansion belongs one panel AHEAD of that cursor, on the stack, not in an O(n_rows) prologue (which also quietly violated data-flow.md §1's no-alloc-in-hot-loop rule). M1b names where the cache lives: keyed by (mask generation, panel index), never by call — a per-call cache amortizes nothing. M2 turns D-GTM-0e into a lookahead ladder; M3 replaces the T2->T1 prohibition with a coal budget. The hexagon itself is marked rhyme [S]: the game's six is adjacency, the substrate's six is field carving. §10 runs the three measurement-free W0 probes. Each corrected §1.1: - 0a: both "duplicates" divergent, only one a defect. The bf16 pair is polyfill vs dispatcher and the facade already renames one `_amx`; `simd_avx2.rs:462 sgemm_blocked` is a naive scalar triple loop whose file, name and body disagree three ways. - 0b: blas_level3.rs is not empty — a six-method BlasLevel3<A> trait dispatching to BlasFloat::backend_gemm. A `pub fn` grep cannot see a method. This re-frames D-GTM-F3: two facades already exist, and BlasFloat's Float bound structurally excludes i8/bf16 from the generic one, so W1's first question is which is canonical. - 0f: pruned_gemm_rows and mixed_precision_gemm have zero callers anywhere. §2.3 called the former "the ONLY existing mask->GEMM bridge"; it is dead code, so D-GTM-5 is a first writer, not a migration. Also records a consumer-side iron-rule violation found incidentally: the five external bf16_tile_gemm_16x16 references resolve to two different bodies, one of them via `ndarray::hpc::*` past the facade. Both call sites are lance-graph's; reported, not fixed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EfrUJH3UNnv5NpDH4jDGHq
1 parent fe1154b commit 6f489ec

2 files changed

Lines changed: 270 additions & 6 deletions

File tree

‎.claude/blackboard.md‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,62 @@
33
> **Read this first.** The "Polyglot Notebook" architecture below is a
44
> separate/older program, not the current epoch.
55
6+
## 2026-09-05 (later) — GEMM consolidation plan v1.1: Mississippi Queen amendment + Wave 0 static results
7+
8+
**Operator metaphor folded in (§9).** Mississippi Queen: the river board is laid a
9+
few hex tiles ahead of the lead boat, speed changes ±1 and is committed before the
10+
move, extra maneuvers cost from a fixed coal budget, and a tile laid for the leader
11+
is free for every boat behind. Graded per the mechanism-vs-rhyme rule:
12+
13+
- **M1 [G] CORRECTS D-GTM-F4/D-GTM-5.** v1 said the compacted row-index list is
14+
"built once per mask generation" — laying the whole river before any boat moves.
15+
Wrong shape: `pack_a_f32` (`kernels_avx512.rs:552`) already walks a panel cursor,
16+
so mask→index expansion belongs ONE PANEL AHEAD of that cursor, in that loop.
17+
Signature changes `mask_to_row_indices(&[u64]) -> Vec<u32>` →
18+
`next_panel_indices(&[u64], cursor, mr) -> ArrayVec<u32, SGEMM_MR>` (stack, no
19+
hot-loop alloc — which also fixes a quiet `data-flow.md` §1 violation in v1).
20+
- **M1b [G] — the amortization itself.** Many boats, one river: the cache key is
21+
`(mask generation, panel index)`, NOT the call. Per-call caching amortizes nothing.
22+
- **M2 [H]** lookahead depth adapts ±1 and commits before the panel → D-GTM-0e
23+
becomes a LADDER (lookahead 1/2/4/8 × density 10/50/90%), not one crossover.
24+
- **M3 [H]** coal = a bounded budget for mid-stream re-chains; replaces the
25+
T2→T1 prohibition (`membrane-tiers.md:105`) with a budget.
26+
- **R1 [S] the hexagon is rhyme** pending one operator word: the game's six is
27+
ADJACENCY, the substrate's six (`6×(u8:u8)` facet rails, 6-byte HHTL path =
28+
CAM-PQ 6×256) is FIELD CARVING. Same cardinality, different mechanism. Unbuilt.
29+
30+
**Wave 0 static probes run (§10) — each corrected the inventory:**
31+
32+
- **0a:** both duplicate names DIVERGENT, only one a defect. `bf16_tile_gemm_16x16`
33+
= polyfill (`simd_ops.rs`, F32x16 decode) vs dispatcher (`hpc/`, AMX/VNNI) —
34+
legitimate, and `simd.rs:714` already renames the dispatcher `_amx`.
35+
`simd_avx2.rs:462 sgemm_blocked` is a **naive scalar triple loop** — neither AVX2
36+
nor blocked; file, name and body disagree three ways.
37+
- **0b:** `blas_level3.rs` is NOT empty — 393 lines, zero `pub fn` because it is a
38+
**trait** (`BlasLevel3<A>`: gemm/gemm_into/syrk/symm/trmm/trsm, blanket impl,
39+
re-exported `simd.rs:656`) dispatching to `BlasFloat::backend_gemm`
40+
(`backend/mod.rs:75`, impl'd **f32/f64 only**). CLAUDE.md was right; my `pub fn`
41+
grep was blind. **Re-frames D-GTM-F3: TWO facades already exist** — the generic
42+
trait method and the four free functions — and `BlasFloat`'s `num_traits::Float`
43+
bound structurally excludes i8/bf16 from the generic one. W1's first question is
44+
which is canonical, not how to build one.
45+
- **0f caller census:** `pruned_gemm_rows` **0 callers**, `mixed_precision_gemm`
46+
**0**, `blas_gemm` 0 external. §2.3 called `pruned_gemm_rows` "the ONLY existing
47+
mask→GEMM bridge" — it is dead code, so D-GTM-5 is a FIRST WRITER, not a
48+
migration. Only `bf16_tile_gemm_16x16` has real external consumers (5).
49+
50+
**Incidental find, reported not fixed (lance-graph call sites):** the 5 external
51+
references reach `bf16_tile_gemm_16x16` by two paths that resolve to two different
52+
bodies. `symbiont/src/domino.rs:27` imports it from `ndarray::simd` alongside
53+
`amx_available` and its doc mentions tile ops — but that name is the POLYFILL; it
54+
wants `bf16_tile_gemm_16x16_amx`. `thinking-engine/examples/amx_bf16_probe.rs:15`
55+
imports from `ndarray::hpc::bf16_tile_gemm::*`, reaching past the facade — the exact
56+
form the "all SIMD from `ndarray::simd`, never `hpc::*`" iron rule forbids. ndarray's
57+
own facade is correct; both defects are consumer-side (and symbiont is deprecated).
58+
59+
**Not run:** 0c (f64/tail bench), 0d (MKL-ternlog tail hunch), 0e (the M2 ladder —
60+
now known to measure a zero-caller kernel, fine for a probe, not production evidence).
61+
662
## 2026-09-05 — AMX f32 GEMM was silently bf16; `matmul_f32` made exact; consolidation plan filed
763

864
**Finding (measured, PR #303):** `hpc::amx_matmul::matmul_f32` downcast both operands

0 commit comments

Comments
 (0)