@@ -19,7 +19,7 @@ const searchResult = struct {
1919};
2020
2121
22- pub const VStore = struct {
22+ pub const Vztor = struct {
2323 const Self = @This ();
2424
2525 arena : std.heap.ArenaAllocator ,
@@ -182,7 +182,7 @@ pub const VStore = struct {
182182 // Commit setup transaction; DB and txn handles go out of scope here
183183 try txn .commit ();
184184
185- // Store everything into VStore
185+ // Store everything into Vztor
186186 store .env = env ;
187187 store .rnd = rnd ;
188188 store .counter = counter ;
@@ -289,7 +289,7 @@ pub const VStore = struct {
289289
290290 try txn .commit ();
291291
292- // Return keys that were allocated with stable_alloc (owned by VStore )
292+ // Return keys that were allocated with stable_alloc (owned by Vztor )
293293 return nnkeys ;
294294 }
295295
@@ -346,7 +346,7 @@ pub const VStore = struct {
346346
347347 fn search (self : * Self , vector : nmslib.QueryPoint , k : usize ) ! []searchResult {
348348
349- // Stable allocator for returned results (owned by VStore )
349+ // Stable allocator for returned results (owned by Vztor )
350350 const stable_alloc = self .arena .allocator ();
351351
352352 const knn_result = try self .index .knnQuery (vector , k );
@@ -426,7 +426,7 @@ pub fn main() !void {
426426 const dist_type = nmslib .DistType .Float ;
427427 std .debug .assert (nmslib .isValidSpaceType (space_type ));
428428
429- var store = try VStore .init (allocator , db_path , space_type , vector_type , dist_type , max_readers );
429+ var store = try Vztor .init (allocator , db_path , space_type , vector_type , dist_type , max_readers );
430430 defer store .deinit () catch unreachable ;
431431
432432
@@ -452,8 +452,8 @@ pub fn main() !void {
452452
453453
454454
455- test "VStore : basic put/get/save and reload" {
456- std .debug .print ("[ ] VStore : basic put/get/save and reload\n " , .{});
455+ test "Vztor : basic put/get/save and reload" {
456+ std .debug .print ("[ ] Vztor : basic put/get/save and reload\n " , .{});
457457
458458 const allocator = std .heap .page_allocator ;
459459 const db_path = "testdb_vstore_zigtest" ;
@@ -462,7 +462,7 @@ test "VStore: basic put/get/save and reload" {
462462 const dist_type = nmslib .DistType .Float ;
463463
464464 // Initialize the store
465- var store = try VStore .init (allocator , db_path , space_type , vector_type , dist_type , 16 );
465+ var store = try Vztor .init (allocator , db_path , space_type , vector_type , dist_type , 16 );
466466
467467 // Prepare two sparse vectors and payloads
468468 const vectors = [_ ][]const nmslib.SparseElem {
@@ -498,7 +498,7 @@ test "VStore: basic put/get/save and reload" {
498498 try store .deinit ();
499499
500500 // Re-open the store from the same path (index should be loaded from disk)
501- var reopened = try VStore .init (allocator , db_path , space_type , vector_type , dist_type , 16 );
501+ var reopened = try Vztor .init (allocator , db_path , space_type , vector_type , dist_type , 16 );
502502
503503 // Re-fetch using the copied key (not owned by the arena)
504504 const got2 = try reopened .batchGet (key_copy );
@@ -512,21 +512,21 @@ test "VStore: basic put/get/save and reload" {
512512 const cwd = std .fs .cwd ();
513513 cwd .deleteTree (db_path ) catch {};
514514
515- std .debug .print ("[x] VStore : basic put/get/save and reload\n " , .{});
515+ std .debug .print ("[x] Vztor : basic put/get/save and reload\n " , .{});
516516}
517517
518518
519519
520- test "VStore : batchPut returns unique keys on repeated insert" {
521- std .debug .print ("[ ] VStore : batchPut returns unique keys on repeated insert\n " , .{});
520+ test "Vztor : batchPut returns unique keys on repeated insert" {
521+ std .debug .print ("[ ] Vztor : batchPut returns unique keys on repeated insert\n " , .{});
522522
523523 const allocator = std .heap .page_allocator ;
524524 const db_path = "testdb_vstore_unique_keys" ;
525525 const space_type = "negdotprod_sparse" ;
526526 const vector_type = nmslib .DataType .SparseVector ;
527527 const dist_type = nmslib .DistType .Float ;
528528
529- var store = try VStore .init (allocator , db_path , space_type , vector_type , dist_type , 16 );
529+ var store = try Vztor .init (allocator , db_path , space_type , vector_type , dist_type , 16 );
530530
531531 const vectors = [_ ][]const nmslib.SparseElem {
532532 &[_ ]nmslib.SparseElem {
@@ -557,21 +557,21 @@ test "VStore: batchPut returns unique keys on repeated insert" {
557557 const cwd = std .fs .cwd ();
558558 cwd .deleteTree (db_path ) catch {};
559559
560- std .debug .print ("[x] VStore : batchPut returns unique keys on repeated insert\n " , .{});
560+ std .debug .print ("[x] Vztor : batchPut returns unique keys on repeated insert\n " , .{});
561561}
562562
563563
564564
565- test "VStore : batchGet returns KeyNotFound for missing key" {
566- std .debug .print ("[ ] VStore : batchGet returns KeyNotFound for missing key\n " , .{});
565+ test "Vztor : batchGet returns KeyNotFound for missing key" {
566+ std .debug .print ("[ ] Vztor : batchGet returns KeyNotFound for missing key\n " , .{});
567567 const allocator = std .heap .page_allocator ;
568568 const db_path = "testdb_vstore_missing_key" ;
569569 const space_type = "negdotprod_sparse" ;
570570 const vector_type = nmslib .DataType .SparseVector ;
571571 const dist_type = nmslib .DistType .Float ;
572572
573573 {
574- var store = try VStore .init (allocator , db_path , space_type , vector_type , dist_type , 8 );
574+ var store = try Vztor .init (allocator , db_path , space_type , vector_type , dist_type , 8 );
575575
576576 // Attempt to get a key that does not exist
577577 const res = store .batchGet ("no-such-key" );
@@ -583,19 +583,19 @@ test "VStore: batchGet returns KeyNotFound for missing key" {
583583
584584 const cwd = std .fs .cwd ();
585585 cwd .deleteTree (db_path ) catch {};
586- std .debug .print ("[x] VStore : batchGet returns KeyNotFound for missing key\n " , .{});
586+ std .debug .print ("[x] Vztor : batchGet returns KeyNotFound for missing key\n " , .{});
587587}
588588
589589
590- test "VStore : bulk 10 insert and retrieve" {
591- std .debug .print ("[ ] VStore : bulk 10 insert and retrieve\n " , .{});
590+ test "Vztor : bulk 10 insert and retrieve" {
591+ std .debug .print ("[ ] Vztor : bulk 10 insert and retrieve\n " , .{});
592592 const allocator = std .heap .page_allocator ;
593593 const db_path = "testdb_vstore_bulk10" ;
594594 const space_type = "negdotprod_sparse" ;
595595 const vector_type = nmslib .DataType .SparseVector ;
596596 const dist_type = nmslib .DistType .Float ;
597597
598- var store = try VStore .init (allocator , db_path , space_type , vector_type , dist_type , 16 );
598+ var store = try Vztor .init (allocator , db_path , space_type , vector_type , dist_type , 16 );
599599 defer store .deinit () catch unreachable ;
600600
601601 const vectors = [_ ][]const nmslib.SparseElem {
@@ -636,11 +636,11 @@ test "VStore: bulk 10 insert and retrieve" {
636636
637637 const cwd = std .fs .cwd ();
638638 cwd .deleteTree (db_path ) catch {};
639- std .debug .print ("[x] VStore : bulk 10 insert and retrieve\n " , .{});
639+ std .debug .print ("[x] Vztor : bulk 10 insert and retrieve\n " , .{});
640640}
641641
642- test "VStore : init tolerates empty IDX directory" {
643- std .debug .print ("[ ] VStore : init tolerates empty IDX directory\n " , .{});
642+ test "Vztor : init tolerates empty IDX directory" {
643+ std .debug .print ("[ ] Vztor : init tolerates empty IDX directory\n " , .{});
644644 const allocator = std .heap .page_allocator ;
645645 const db_path = "testdb_vstore_empty_idx" ;
646646 const space_type = "negdotprod_sparse" ;
@@ -656,7 +656,7 @@ test "VStore: init tolerates empty IDX directory" {
656656 try cwd .makePath (db_path ++ "/IDX" );
657657
658658 // This call used to fail when IDX existed but had no index.
659- var store = try VStore .init (allocator , db_path , space_type , vector_type , dist_type , 16 );
659+ var store = try Vztor .init (allocator , db_path , space_type , vector_type , dist_type , 16 );
660660 defer store .deinit () catch unreachable ;
661661
662662 // Store should be usable: do a simple put/get round-trip
@@ -672,5 +672,5 @@ test "VStore: init tolerates empty IDX directory" {
672672
673673 // Cleanup
674674 cwd .deleteTree (db_path ) catch {};
675- std .debug .print ("[x] VStore : init tolerates empty IDX directory\n " , .{});
675+ std .debug .print ("[x] Vztor : init tolerates empty IDX directory\n " , .{});
676676}
0 commit comments