@@ -281,13 +281,12 @@ mod tests {
281281 use super :: * ;
282282 use crate :: canonical_node:: EdgeBlock ;
283283
284- /// Build a node in a domain: `classid` from the domain, hierarchy in the HHT
285- /// tiers, family = basin leaf, identity = leaf. Edges optional.
284+ /// Build a node in a domain: `classid` from the domain, hierarchy in the
285+ /// `hht` tiers `(heel, hip, twig)`, family = basin leaf, identity = leaf.
286+ /// Edges optional.
286287 fn node (
287288 domain : & DomainSpec ,
288- heel : u16 ,
289- hip : u16 ,
290- twig : u16 ,
289+ hht : ( u16 , u16 , u16 ) ,
291290 family : u32 ,
292291 identity : u32 ,
293292 in_fam : & [ u8 ] ,
@@ -301,7 +300,7 @@ mod tests {
301300 edges. out_family [ i] = b;
302301 }
303302 NodeRow {
304- key : NodeGuid :: new ( domain. classid , heel , hip , twig , family, identity) ,
303+ key : NodeGuid :: new ( domain. classid , hht . 0 , hht . 1 , hht . 2 , family, identity) ,
305304 edges,
306305 value : [ 0u8 ; 480 ] ,
307306 }
@@ -313,10 +312,10 @@ mod tests {
313312 // at member 2 (identity low byte 2) via in_family; member 1 also links
314313 // out to family B (low byte 0xB) via out_family.
315314 let rows = [
316- node ( & OSINT_GOTHAM , 1 , 0 , 0 , 0xA , 1 , & [ 2 ] , & [ 0xB ] ) ,
317- node ( & OSINT_GOTHAM , 1 , 0 , 0 , 0xA , 2 , & [ ] , & [ ] ) ,
318- node ( & OSINT_GOTHAM , 2 , 0 , 0 , 0xB , 1 , & [ ] , & [ ] ) ,
319- node ( & OSINT_GOTHAM , 2 , 0 , 0 , 0xB , 2 , & [ ] , & [ ] ) ,
315+ node ( & OSINT_GOTHAM , ( 1 , 0 , 0 ) , 0xA , 1 , & [ 2 ] , & [ 0xB ] ) ,
316+ node ( & OSINT_GOTHAM , ( 1 , 0 , 0 ) , 0xA , 2 , & [ ] , & [ ] ) ,
317+ node ( & OSINT_GOTHAM , ( 2 , 0 , 0 ) , 0xB , 1 , & [ ] , & [ ] ) ,
318+ node ( & OSINT_GOTHAM , ( 2 , 0 , 0 ) , 0xB , 2 , & [ ] , & [ ] ) ,
320319 ] ;
321320 let snap = project_snapshot ( & rows, & OSINT_GOTHAM ) ;
322321 // 4 member nodes + 2 family nodes
@@ -344,8 +343,8 @@ mod tests {
344343 ..FMA_ANATOMY
345344 } ;
346345 let rows = [
347- node ( & fma_bones, 0x1 , 0 , 0 , 0x01 , 1 , & [ ] , & [ ] ) , // bone
348- node ( & fma_bones, 0x2 , 0 , 0 , 0x02 , 1 , & [ ] , & [ ] ) , // tissue
346+ node ( & fma_bones, ( 0x1 , 0 , 0 ) , 0x01 , 1 , & [ ] , & [ ] ) , // bone
347+ node ( & fma_bones, ( 0x2 , 0 , 0 ) , 0x02 , 1 , & [ ] , & [ ] ) , // tissue
349348 ] ;
350349 let snap = project_snapshot ( & rows, & fma_bones) ;
351350 let anchor = snap. nodes . iter ( ) . find ( |n| n. id == "family:000001" ) . unwrap ( ) ;
@@ -366,10 +365,10 @@ mod tests {
366365 ..FMA_ANATOMY
367366 } ;
368367 let rows = [
369- node ( & fma_bones, 0x1000 , 0 , 0 , 0x01 , 1 , & [ ] , & [ ] ) , // the anchor itself
370- node ( & fma_bones, 0x1000 , 0 , 0 , 0x02 , 1 , & [ ] , & [ ] ) , // same HHT path
371- node ( & fma_bones, 0x1009 , 0 , 0 , 0x03 , 1 , & [ ] , & [ ] ) , // diverges late (lcp 7)
372- node ( & fma_bones, 0xF000 , 0 , 0 , 0x04 , 1 , & [ ] , & [ ] ) , // diverges early (lcp 4)
368+ node ( & fma_bones, ( 0x1000 , 0 , 0 ) , 0x01 , 1 , & [ ] , & [ ] ) , // the anchor itself
369+ node ( & fma_bones, ( 0x1000 , 0 , 0 ) , 0x02 , 1 , & [ ] , & [ ] ) , // same HHT path
370+ node ( & fma_bones, ( 0x1009 , 0 , 0 ) , 0x03 , 1 , & [ ] , & [ ] ) , // diverges late (lcp 7)
371+ node ( & fma_bones, ( 0xF000 , 0 , 0 ) , 0x04 , 1 , & [ ] , & [ ] ) , // diverges early (lcp 4)
373372 ] ;
374373 let hops = nearest_anchor ( & rows, & fma_bones) ;
375374 assert_eq ! ( hops. len( ) , 4 ) ;
@@ -391,7 +390,7 @@ mod tests {
391390 #[ test]
392391 fn nearest_anchor_with_no_anchors_is_unreachable ( ) {
393392 // Default OSINT declares no anchor families ⇒ every node is unreachable.
394- let rows = [ node ( & OSINT_GOTHAM , 1 , 0 , 0 , 0xA , 1 , & [ ] , & [ ] ) ] ;
393+ let rows = [ node ( & OSINT_GOTHAM , ( 1 , 0 , 0 ) , 0xA , 1 , & [ ] , & [ ] ) ] ;
395394 let hops = nearest_anchor ( & rows, & OSINT_GOTHAM ) ;
396395 assert_eq ! ( hops[ 0 ] . hops, u8 :: MAX ) ;
397396 assert_eq ! ( hops[ 0 ] . anchor_family, u32 :: MAX ) ;
@@ -402,8 +401,8 @@ mod tests {
402401 // Poison the value slab; the snapshot must be byte-identical (the
403402 // E-GUID-IS-THE-GRAPH / zero-value-decode invariant, falsifiable).
404403 let clean = [
405- node ( & OSINT_GOTHAM , 1 , 0 , 0 , 0xA , 1 , & [ 2 ] , & [ 0xB ] ) ,
406- node ( & OSINT_GOTHAM , 2 , 0 , 0 , 0xB , 2 , & [ ] , & [ ] ) ,
404+ node ( & OSINT_GOTHAM , ( 1 , 0 , 0 ) , 0xA , 1 , & [ 2 ] , & [ 0xB ] ) ,
405+ node ( & OSINT_GOTHAM , ( 2 , 0 , 0 ) , 0xB , 2 , & [ ] , & [ ] ) ,
407406 ] ;
408407 let mut poisoned = clean;
409408 for row in & mut poisoned {
0 commit comments