CUBELinux-2: WordFlags/tri-channel 16-bit flag field, tag-14 + scan_by_word_flag, cubetrace capture→replay→golden→lineage, CUBE VP-tree balling index (cubecode::ballindex), cubefs-visible WordFlags, and cube-mvw (sharded multi-writer MVCC store with per-shard WALs + group-commit + compaction, impl CubeBackend => CubeStore<MvwBackend> DB). Adds show-flags/scan-word-flags/trace-*/golden-capture CLI; ~ tests green.

This commit is contained in:
CUBELinux-2
2026-09-06 21:20:04 -04:00
parent 3f007a1f38
commit cc896fc336
22 changed files with 1695 additions and 7 deletions
+35
View File
@@ -0,0 +1,35 @@
use cube_mvw::MvwBackend;
use cubecoords::Czyx;
use std::path::Path;
use std::time::Instant;
use std::thread;
fn bench(mode: &str) -> f64 {
let b = Path::new("/tmp/mvw-gc");
for i in 0..16 { std::fs::remove_file(format!("{}-s{}.log", b.display(), i)).ok(); std::fs::remove_file(format!("{}-s{}.ckpt", b.display(), i)).ok(); }
let back = MvwBackend::open(16, b).unwrap();
let threads = 8usize; let per = 4000u64; let n = (threads as f64) * per as f64;
let t = Instant::now();
thread::scope(|sc| {
for th in 0..threads {
let back = &back;
sc.spawn(move || for i in 0..per {
let k = Czyx::unpack_u32(((th as u64 * per + i) as u32) << 8 | 1);
back.put_shared(k, vec![i as u8; 16]);
});
}
});
if mode == "batch" { back.commit().unwrap(); }
let s = t.elapsed().as_secs_f64();
for i in 0..16 { std::fs::remove_file(format!("{}-s{}.log", b.display(), i)).ok(); std::fs::remove_file(format!("{}-s{}.ckpt", b.display(), i)).ok(); }
n / s / 1e3
}
fn main() {
let per_op = bench("per_op");
let batch = bench("batch");
println!("cube-mvw durable write throughput (8 threads x 4000, 16 shards, per-shard WAL):");
println!(" per-op fsync : {:>8.1} k puts/s", per_op);
println!(" group-commit : {:>8.1} k puts/s ({:.1}x)", batch, batch/per_op);
println!("\n=> group-commit batches one fsync per shard for many ops => durable writes scale with the");
println!(" batch (no tables layer — pure storage engine; CUBE's metatag model is the schema).");
}