Skip to content

Commit d76c631

Browse files
committed
docs(deepnsm): save SoA adjacency layout as future concept
Document the category-padded SoA layout (16 categories × 16 slots = 256 F32x16 lanes) as a future optimization concept in deepnsm.rs. Verified no overlap with existing patterns: - blasgraph CSR/CSC: graph adjacency matrix, not semantic vectors - SPO semiring: cost algebra, not vector layout - neighborhood CLAM: search scope, not decomposition format - aabb/spatial_hash SoA: spatial coords (x,y,z), not semantic categories - dn_tree SoA: HV summary layout, not NSM category decomposition The concept is clean for future implementation. https://claude.ai/code/session_01Y69Vnw751w75iVSBRws7o7
1 parent 2c5cc3a commit d76c631

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

src/hpc/deepnsm.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,3 +1282,37 @@ mod eval_tests {
12821282
assert!(msgs[1].content.contains("happy"));
12831283
}
12841284
}
1285+
1286+
// ============================================================================
1287+
// FUTURE CONCEPT: SoA adjacency layout for SIMD-native category decomposition
1288+
// ============================================================================
1289+
//
1290+
// Current: weights[74] in prime order → 4×F32x16 + 10 scalar remainder
1291+
// Future: weights[256] in category-padded SoA → 16×F32x16, zero remainder
1292+
//
1293+
// Layout: 16 NsmCategory groups, each padded to 16 slots:
1294+
// Substantive[16]: [I, You, Someone, Something, Thing, Body, 0, 0, ..., 0]
1295+
// Relational[16]: [Kind, Part, 0, 0, ..., 0]
1296+
// Mental[16]: [Think, Know, Want, DontWant, Feel, See, Hear, 0, ..., 0]
1297+
// ...
1298+
//
1299+
// Benefits:
1300+
// - One F32x16 per category → entire category comparison in one instruction
1301+
// - Cross-category similarity = 16 parallel dot products
1302+
// - Category masking = one F32Mask16 per category (is this word Mental? Spatial?)
1303+
// - No scalar remainder: 16×16 = 256 elements, all lanes used
1304+
// - SIMD-friendly alignment: each category starts at 64-byte boundary
1305+
//
1306+
// Does NOT duplicate:
1307+
// - blasgraph CSR/CSC: graph adjacency matrix, not semantic vectors
1308+
// - SPO semiring: cost algebra, not vector layout
1309+
// - neighborhood CLAM: search scope, not decomposition format
1310+
// - aabb/spatial_hash SoA: spatial coords (x,y,z), not semantic categories
1311+
//
1312+
// Integration points:
1313+
// - DeepNSM encoder.rs: bind() + bundle() operate on category-aligned vectors
1314+
// - CausalEdge64: S/P/O palette indices map to category-level features
1315+
// - Thinking styles: MODULATE verb maps content categories → style weights
1316+
//
1317+
// TODO: implement NsmDecompositionSoA with category-padded [f32; 256] storage
1318+
// ============================================================================

0 commit comments

Comments
 (0)