library CB-Console; library CB-GenerationOptimized; fn main() { string dataset = "data/ai/shared-10gb-dataset.txt"; string index = "data/ai/shared-10gb-dataset.cbi"; array tags = [ "ai,index,generation", "ai,parsing,dataset", "ai,understanding,retrieval", "game,render,native", "game,physics,native", "game,topdown,render", "game,3d,render", "storage,dataset,index", "math,optimization,benchmark", "windows,native,index", "llama,cpp,dataset", "direct3d,gpu,compute", "kernel,popcount,index", "generation,tag,pick", "parsing,tag,normalize", "understanding,tag,score" ]; CB-GenerationOptimized.clear_cache(); u256 indexed = CB-GenerationOptimized.warm(index); u256 rounds = 250; u256 requests = rounds * tags.length(); u256 returned = 0; u256 started = time.nowUs(); for (u256 round = 0; round < rounds; round += 1) { array batches = CB-GenerationOptimized.query_batch(dataset, index, tags, 8); for (u256 at = 0; at < batches.length(); at += 1) { array batch_records = batches[at]; returned += batch_records.length(); } } u256 elapsed = time.nowUs() - started; if (elapsed == 0) { elapsed = 1; } println("ClosedBit Shared 10 GiB Hot Retrieval"); println("Indexed records: " + indexed); println("Requests: " + requests); println("Returned records: " + returned); println("Elapsed microseconds: " + elapsed); println("Native mapping hits: " + CB-GenerationOptimized.cache_hits()); println("Native mapping misses: " + CB-GenerationOptimized.cache_misses()); println("Native records scanned: " + CB-GenerationOptimized.records_scanned()); println("AI_HOT_BENCH|closedbit|" + indexed + "|" + requests + "|" + returned + "|" + elapsed + "|" + CB-GenerationOptimized.cache_hits() + "|" + CB-GenerationOptimized.cache_misses() + "|" + CB-GenerationOptimized.records_scanned()); }