diff --git a/docs/audits/797/README.md b/docs/audits/797/README.md new file mode 100644 index 0000000000..88a6e13677 --- /dev/null +++ b/docs/audits/797/README.md @@ -0,0 +1,244 @@ +# Shared committed reader evaluation (#797) + +Evaluation date: 2026-10-30. Base: `15badca89db60bbd458b52af59a064b9c0e7da1f` +on `v3`. Design: `docs/superpowers/specs/2026-10-30-797-shared-reader-design.md`. + +## Verdict + +**Neither candidate passes. No production change is proposed.** + +- **H** (shared non-generic `ReaderCore`, `patches/shared-reader.patch`) + fails the primary runtime gate. It saves 3,288 native bytes, and every + bench-run correctness gate passes except all-target clippy, which fails + identically on B. Semver, Chrome and macOS/Windows were not run (see + below). In the second envelope (opt-level 3) campaign, the upper + bounds for attribute/value and `:as-of` point queries are 1.0245 and 1.0260, + against a limit of 1.02. The B:B control in the same campaign stays within + 0.7% (0.9937–1.0022), so this is a measured slowdown of about 1–2% on envelope point + queries, not noise. In the release (opt-level z) configuration, H costs at + most 0.6% (upper bound ≤ 1.0092). +- **P** (the #772 boxed-reader prototype, + `docs/audits/772/evidence/patches/reader-erasure.patch`) saves more bytes and + passes the primary gate. It fails the secondary gate on direct reader + construction (`con_direct`, ratio 1.166, upper bound 1.174 native; 1.119 / + 1.130 under WASI): the boxed reader makes two allocations per construction, B one. The spec + needs a new maintainer decision to ship P in any case. + +Neither candidate meets AC 6 literally either: the opt-level-z library +consumer grows by 48 bytes (H) and 64 bytes (P) (see Sizes). Other categories +are not fully accepted for either candidate (see Limitations): + +- the cold category, under the residency rule fixed before acceptance; +- the concurrency category, whose results were checked by row count only; +- the CI-only checks a PR would run. + +None of these changes the outcome. + +## Sizes (AC 6) + +`sizes.sh` (the #772 `matrix.sh` method) on each variant's commit, one +`Cargo.lock` (SHA-256 `82fa4d92e6389dc4a44d47bac6fdc361ffb4e736433735da140624eb40807660`). +Bytes; `evidence/sizes-{B,H,P}.tsv` has the artifact hashes. + +Artifact | B | H | P | H − B | P − B +---|---:|---:|---:|---:|---: +native CLI (release, stripped; the size gate's artifact) | 1,259,384 | 1,256,096 | 1,251,936 | **−3,288** | −7,448 +WASI CLI | 876,947 | 876,884 | 876,849 | −63 | −98 +browser raw Wasm | 1,582,757 | 1,582,447 | 1,582,014 | −310 | −743 +browser wasm-bindgen Wasm | 1,001,653 | 1,001,392 | 1,001,017 | −261 | −636 +browser wasm-bindgen JS | 43,712 | 43,712 | 43,712 | 0 | 0 +library consumer, opt-level 3, stripped | 2,150,336 | 2,137,128 | 2,129,960 | −13,208 | −20,376 +library consumer, opt-level 3, unstripped | 4,737,512 | 4,722,448 | 4,710,704 | −15,064 | −26,808 +library consumer, release (opt-level z) | 1,459,888 | 1,459,936 | 1,459,952 | +48 | +64 + +AC 6 has two conditions: the native CLI at least 2,000 bytes smaller, and no +measured artifact larger than B. H meets the first, at 3,288 bytes. It fails +the second: the opt-level-z library consumer is a measured artifact (the +user's size bar names the library consumer) and grows by 48 bytes (P: 64). +Every other artifact shrinks or stays the same. + +## Correctness gates (AC 8–11), H + +`gates.sh` on H's commit `1b5169ef8e31e3f1bf848d52ffc2e08f3c17068f` +(`evidence/gates-H.tsv`; logs are not kept, since they hold bench paths): + +Step | Result +---|--- +`cargo test --all-features` | pass: 2,074 passed, 0 failed, 20 ignored +`test-hooks` suites | pass: 2,074 passed, 0 failed, 20 ignored +CI-toolchain clippy (CI's arguments) | clean +clippy `--all-targets` | fails identically on B: the same targets with the same error counts (3,753 log lines each), pre-existing lints in tests, examples and benches +`cargo fmt --check` | clean +`cargo +1.89.0 check --all-features --locked` | clean +clippy, wasm32 browser and WASI | clean +WASI tests under Wasmtime 49.0.2 | pass (782 + doc/integration suites) +BrowserDb headless Firefox | pass: 63 passed +`minigraf_shuttle` deterministic suite | pass: 3 passed (seed 760, 1,000 iterations) +coverage gates (nightly-2026-10-01) | pass; `src/storage/reader.rs` 98.45% lines / 94.74% branches (floors 97/94), and the extracted logic stays in that file + +`patches/entry-point-tests.patch` adds direct tests of the reader entry points +that had none (AC 5). These tests pass on both B and H. The gate run above +predates that commit; the tests were run on their own on both variants. +Not run: the Chrome browser suite, macOS/Windows native, and the +`semver-checks` output (AC 2), which only a PR's CI provides. They would be +needed to ship H; it does not ship, so they stay unverified. + +## Runtime (AC 12–14) + +### Method + +- **Variants.** B, H and P are built from `15badca89` with the same lock, + toolchain (`evidence/compiler.txt`: rustc 1.99.1, LLVM 23.1.1), features and + profiles. Every variant gets the same measurement hooks under + `--cfg minigraf_ab` (`ab-hook.patch`): committed-memory WASI reader + construction and a direct reader-construction entry point. These hooks are + measurement-only. `raw/manifest.json` records each variant's commit, lock + hash, `reader.rs` hash, binary hashes and build commands, plus the + harness/hook hashes and the fixture checksum. +- **Harnesses.** `reader_ab.rs` covers native and WASI, and `ab_browser.rs` + covers BrowserDb in headless Firefox via `wasm-bindgen-test-runner` + 0.2.130, with `webdriver.json` for full-precision timers. The fixture is + 100,000 facts over 16,666 entities, built by B's `perf_envelope` + (SHA-256 `59e0023aad11…`, in the manifest). +- **Unit and estimand.** The unit is one process block. Each block runs a + warm-up and at least 1 s of timed work per workload. The estimand is the candidate's mean ns/op over + the base's (for `cc_*`, wall time per operation), compared as natural logs. + The bound is the one-sided 95% Student t upper bound on the mean log ratio, + exponentiated (`analyze.py`). +- **Result validation** differs by category (the `Validation` column of + `evidence/tables.md`): + - **Query workloads** (`pt_*`, `sh_*`, `sc_*`, `cw_long`, `fl_paged`, + `nc_*`, `con_large_tx`, WASI queries, browser): every block hashes the + complete results of every distinct query outside timing, and that digest + must match B's. Each timed operation then checks its row count. + - **Cold** (`cold_*`): the digest comes from a warm run on the fixture, and + each cold observation checks only its row count. + - **Concurrency** (`cc_*`): row counts only, digest 0. **The concurrency + category is not fully accepted.** + - **Construction** (`con_open`, `con_direct`, `con_checkpoint`, + `wasi_committed_con_direct`): these produce no result, and their digest + is a constant 0. +- **Placement.** Paired campaigns run the base and the candidate at the same + time, one on NUMA node 1 and one on node 3 (`numactl` CPU and memory + binding), swapping every block. Pair order rotates. Cold, concurrency and + browser campaigns run one process at a time, alternating the order. +- **Fixed in advance.** Block counts, the analysis method and the campaign + order were fixed from the pilots (`raw/pilot-*.jsonl.gz`, not counted) + before any acceptance run. They were committed as `acceptance-plan.json` in + `2313d245b` at 09:53:09 UTC. The last pilot block ended at 09:52:28 and the + first acceptance block started at 09:53:17 (`evidence/plan-provenance.txt`). + The published branch has the same files, rebased as `9fea12192` with a + later date, because the outcome dropped H's commits; the original commit is + preserved on the origin branch `audit/797-h-measured`. The plan fixed: primary + 128 blocks; secondary, cold and concurrency 48; WASI and browser 32. Each + campaign ran once, from a script that waited for a 1-minute load average + below 2. `run.py` refuses to overwrite a raw file, so no campaign was + rerun. +- **Primary families.** `pt_ea` (entity/attribute), `pt_av` + (attribute/value) and `pt_asof` (`:as-of` transaction counter). Each covers + fixed and varied keys and existing and missing entities, through ordinary + queries, prepared queries and cursors pulled in batches of one. A point + query returns at most one row, so the cursor path never returns more than + one non-empty batch. + Profiles: `envelope` (the opt-level-3 consumer) and `release` (the gate's + configuration). + +### Primary gate (AC 13): pt families, B:H upper bound ≤ 1.02 in each campaign + +Campaign | pt_ea | pt_av | pt_asof | B:B control range (lower–upper) +---|---:|---:|---:|--- +primary-1 envelope | 1.0155 | 1.0172 | 1.0179 | 0.9959–1.0050 +primary-1 release | 1.0067 | 1.0058 | 1.0049 | 0.9957–1.0070 +primary-2 envelope | 1.0199 | **1.0245** | **1.0260** | 0.9937–1.0022 +primary-2 release | 1.0092 | 1.0071 | 1.0044 | 0.9924–1.0017 + +The B:P upper bounds are at most 1.0055 in envelope and 1.0161 in release. +`evidence/tables.md` has the ratios, p50/p99, allocations and RSS. + +### Secondary gate (AC 14): every other workload, upper bound ≤ 1.05 + +Every H secondary workload has an upper bound of at most 1.05. Its highest +upper bounds: + +Workload | B:H ratio | upper +---|---:|---: +cc_44 (44 threads, inverse throughput) | 1.034 | 1.047 +cold_point | 0.990 | 1.027 +sh_attribute_value | 1.019 | 1.026 +cc_8 | 1.010 | 1.021 +sh_point_entity | 1.013 | 1.021 + +P fails on `con_direct`: native 1.166 (upper bound 1.174), and WASI +`wasi_committed_con_direct` 1.119 (upper bound 1.130). All of P's other +workloads pass. + +No digest mismatches were found, for either candidate. This covers only the +workloads with a real digest (see Result validation). + +### Per-workload tables + +`evidence/tables.md` (from `report.py`) covers every campaign, workload and +pair. Each row has the blocks, ratio, upper bound, verdict, validation +method, base and candidate means, and the absolute delta in ns. It also has +p50/p99, allocations per operation and RSS. `evidence/summary.json` holds the +analyzer's output. + +## Limitations and deviations + +- **Cold residency (AC 14).** `acceptance-plan.json` requires zero resident + pages after eviction for every cold observation. This was not met. + Residency was checked after every eviction (`posix_fadvise(DONTNEED)`, then + `mmap` and `mincore` on the copy), but the harness recorded the sum over a + process's observations. Per observation (sum ÷ observations), point queries + leave a median of 1.1 of 2,628 pages resident (worst process 148) and scans + leave 7.9, likely the pages the open handle mapped or touched. Under the + fixed rule, the cold category is outstanding for both candidates. Also, the + database handle opens before the eviction and residency check, so its open + reads happen while the cache is still warm. The latency ratios are + reported, but they do not count as a pass: `tables.md` labels the cold rows + "category outstanding". This changes no + verdict: H already fails the primary gate. +- `analyze.py` was changed after the campaigns in two ways, neither touching + the ratio, bound or digest computation. It now reads gzipped raw files, and + it reports residency per observation instead of the maximum of per-process + sums. `report.py` (presentation only) gained the validation, absolute-delta + and n/a labels. +- **Unmeasured fields.** The browser harness does not measure allocations + or RSS, and WASI does not measure RSS. The raw records hold 0 for these; + `tables.md` shows n/a. The browser harness does not cover prepared queries. +- **Browser build.** Every variant's browser A/B module was built with + `CARGO_PROFILE_RELEASE_LTO=false` because the release profile's LTO cannot + link the harness (`ab_browser.rs`). The browser size row above uses + the normal release build. +- Bench machine (non-identifying): Linux 6.8 x86-64 (Ubuntu 24.04), two Intel + Xeon E5-2696 v4 sockets, 44 cores and 88 threads with SMT on, 4 NUMA nodes. + The `schedutil` governor was used, with transparent huge pages set to + `madvise`. The fixture was on ext4 on a hardware-RAID volume that the kernel + reports as rotational. Firefox 158.0 with geckodriver 0.37.1, Wasmtime + 49.0.2 and Python 3.12. Wasmtime, wasm-pack and wasm-bindgen are user-local + and are removed after the evaluation, with the fixtures and temporary + directories. + +## Files + +- `patches/shared-reader.patch`: H, as measured (`1b5169ef8`). +- `patches/entry-point-tests.patch`: direct entry-point tests; pass on B and H. +- `reader_ab.rs`, `ab_browser.rs`, `ab-hook.patch`, `webdriver.json`: harnesses. +- `run.py` (build and campaigns), `analyze.py`, `report.py`, `sizes.sh`, + `gates.sh`, `wasm_funcs.py` / `elf_funcs.sh` (size attribution). +- `specs/*.json`, `acceptance-plan.json`: campaign definitions and the plan + fixed in advance. +- `raw/*.jsonl.gz`: every process's reports, by campaign, including pilots. + `raw/*.spec.json` are the specs each run used. `raw/manifest.json` has the + pinned inputs. +- `evidence/`: sizes, gate status, compiler versions, `summary.json`, + `tables.md`, `plan-provenance.txt`. +- The patches are `git format-patch` output with the author and trailer + lines removed; the `From ` line keeps the commit hash. + +Reproduce the analysis: + +```sh +python3 analyze.py $(ls raw/*.jsonl.gz | grep -v pilot) > summary.json +python3 report.py summary.json +``` diff --git a/docs/audits/797/ab-hook.patch b/docs/audits/797/ab-hook.patch new file mode 100644 index 0000000000..4d0eee678e --- /dev/null +++ b/docs/audits/797/ab-hook.patch @@ -0,0 +1,115 @@ +diff --git a/Cargo.toml b/Cargo.toml +index 91f8cc639..57f0a5a51 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -140,7 +140,7 @@ workspace = true + + [workspace.lints.rust] + # Kani proof harnesses (#627): `cargo kani` sets cfg(kani). +-unexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)', 'cfg(minigraf_shuttle)'] } ++unexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)', 'cfg(minigraf_shuttle)', 'cfg(minigraf_ab)'] } + + [workspace.lints.clippy] + # Panic prevention — use Result/? or debug_assert! instead +diff --git a/src/db.rs b/src/db.rs +index e47e9c708..85d5fcfa6 100644 +--- a/src/db.rs ++++ b/src/db.rs +@@ -3445,3 +3445,64 @@ mod wasi_tests { + } + } + } ++ ++/// Measurement only (#797, `--cfg minigraf_ab`): an in-memory database whose ++/// facts were checkpointed into a memory backend, so queries read a populated ++/// committed reader (`Minigraf::in_memory` keeps every fact pending). ++#[cfg(minigraf_ab)] ++#[doc(hidden)] ++pub struct AbCommittedMemory { ++ pub db: Minigraf, ++ pfs: PersistentFactStorage, ++} ++ ++#[cfg(minigraf_ab)] ++impl AbCommittedMemory { ++ /// Run `commands` (transactions) and checkpoint them into the backend. ++ pub fn new(commands: &[String]) -> Result { ++ (|| -> Result { ++ let mut pfs = PersistentFactStorage::new(MemoryBackend::new(), 256)?; ++ let db = Minigraf::from_parts( ++ pfs.storage().clone(), ++ WriteContext::Memory, ++ OpenOptions::default(), ++ ); ++ for c in commands { ++ db.execute(c)?; ++ } ++ pfs.mark_dirty(); ++ pfs.save()?; ++ Ok(AbCommittedMemory { db, pfs }) ++ })() ++ .map_err(MinigrafError::from) ++ } ++ ++ /// Build and drop `n` committed readers of the checkpointed generation. ++ pub fn construct_readers(&self, n: usize) { ++ for _ in 0..n { ++ std::hint::black_box(self.pfs.ab_reader()); ++ } ++ } ++} ++ ++#[cfg(all(minigraf_ab, not(target_arch = "wasm32")))] ++impl Minigraf { ++ /// Measurement only (#797): build and drop `n` committed readers of a ++ /// file database's active meta, as an open or checkpoint builds one. ++ #[doc(hidden)] ++ pub fn ab_construct_readers(&self, n: usize) -> Result<(), MinigrafError> { ++ let ctx = self ++ .inner ++ .write_lock ++ .lock() ++ .map_err(|_| MinigrafError::from(err_coded!(ErrorCode::Api001)))?; ++ let pfs = match &*ctx { ++ WriteContext::File { pfs, .. } | WriteContext::ReadOnly { pfs } => pfs, ++ WriteContext::Memory => return Ok(()), ++ }; ++ for _ in 0..n { ++ std::hint::black_box(pfs.ab_reader()); ++ } ++ Ok(()) ++ } ++} +diff --git a/src/storage/persistent_facts.rs b/src/storage/persistent_facts.rs +index 32d842eab..df9d75947 100644 +--- a/src/storage/persistent_facts.rs ++++ b/src/storage/persistent_facts.rs +@@ -758,7 +758,7 @@ impl PersistentFactStorage { + self.meta + } + +- #[cfg(any(not(target_arch = "wasm32"), feature = "browser", test))] ++ #[cfg(any(not(target_arch = "wasm32"), feature = "browser", test, minigraf_ab))] + /// Mark storage as dirty (needs saving) + pub fn mark_dirty(&mut self) { + self.dirty = true; +@@ -789,6 +789,19 @@ impl PersistentFactStorage { + } + } + ++/// Measurement only (#797, `--cfg minigraf_ab`): a new committed reader of ++/// the active meta, as `activate` builds one, without installing it. ++#[cfg(minigraf_ab)] ++impl PersistentFactStorage { ++ pub(crate) fn ab_reader(&self) -> Arc { ++ Arc::new(OnDiskReader::new( ++ self.backend.clone(), ++ self.page_cache.clone(), ++ &self.meta, ++ )) ++ } ++} ++ + impl Drop for PersistentFactStorage { + fn drop(&mut self) { + // Auto-save on drop, unless an earlier commit failed: the WAL still diff --git a/docs/audits/797/ab_browser.rs b/docs/audits/797/ab_browser.rs new file mode 100644 index 0000000000..d369b99a7d --- /dev/null +++ b/docs/audits/797/ab_browser.rs @@ -0,0 +1,204 @@ +//! BrowserDb runtime harness of the #797 reader A/B (measurement only). +//! +//! `run.py` copies this file to `examples/ab_browser.rs` in every variant, +//! builds it once (`cargo test --release --target wasm32-unknown-unknown +//! --features browser --example ab_browser --no-run`: the release profile +//! without LTO, which cannot link this harness; an example, because a test +//! target also links the `minigraf` binary, whose `.wasm` collides with the +//! library's cdylib, rust-lang/cargo#6313) and runs the module in headless +//! Firefox with `wasm-bindgen-test-runner`, +//! with `webdriver.json` beside it (full-precision `performance.now()`). One +//! run prints one JSON line per workload, prefixed `AB `. +//! +//! The database is `BrowserDb.openInMemory`, its facts checkpointed so that +//! queries read the committed `BrowserBufferBackend` reader (page cache +//! capacity 0: RAM reads). IndexedDB is not used: no open or flush is timed. + +#![allow(clippy::unwrap_used, clippy::indexing_slicing)] + +/// Nothing to do natively; the harness is a wasm-bindgen test. +fn main() {} + +#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] +mod ab { + use minigraf::browser::BrowserDb; + use std::collections::hash_map::DefaultHasher; + use std::hash::{Hash, Hasher}; + use wasm_bindgen::JsValue; + use wasm_bindgen_test::*; + + wasm_bindgen_test_configure!(run_in_browser); + + const ENTITIES: usize = 5_000; + const SECS: f64 = 1.5; + + struct Clock { + perf: JsValue, + now: js_sys::Function, + } + + impl Clock { + fn new() -> Self { + let perf = js_sys::Reflect::get(&js_sys::global(), &"performance".into()).unwrap(); + let now = js_sys::Reflect::get(&perf, &"now".into()).unwrap().into(); + Clock { perf, now } + } + /// Milliseconds. + fn now(&self) -> f64 { + self.now.call0(&self.perf).unwrap().as_f64().unwrap() + } + } + + fn transactions() -> Vec { + let mut out = Vec::new(); + for lo in (0..ENTITIES).step_by(200) { + let hi = (lo + 200).min(ENTITIES); + let mut cmd = String::from("(transact ["); + for i in lo..hi { + let follows = (i * 7919 + 1) % ENTITIES; + cmd.push_str(&format!( + "[:p{i} :name \"p{i}\"][:p{i} :age {}][:p{i} :group {}][:p{i} :follows :p{follows}]", + i % 90, + i % 100 + )); + if i > 0 { + cmd.push_str(&format!("[:p{i} :manager :p{}]", i / 10)); + } + } + cmd.push_str("])"); + out.push(cmd); + } + out + } + + fn varied_keys(range: usize, n: usize) -> Vec { + let mut x: u64 = 0x2545_f491_4f6c_dd1d; + (0..n) + .map(|_| { + x = x.wrapping_mul(6_364_136_223_846_793_005).wrapping_add(1); + ((x >> 33) as usize) % range + }) + .collect() + } + + /// Rows of a cursor, as the JSON batches it returns. + fn drain(db: &BrowserDb, q: &str, batch: u32, h: Option<&mut DefaultHasher>) -> usize { + let mut c = db.query(q).unwrap(); + let mut n = 0; + let mut h = h; + while let Some(json) = c.next_batch(batch).unwrap() { + let rows: serde_json::Value = serde_json::from_str(&json).unwrap(); + n += rows.as_array().map_or(0, Vec::len); + if let Some(h) = h.as_deref_mut() { + json.hash(h); + } + } + n + } + + fn report(name: &str, samples: &mut [f64], digest: u64, rows: usize) { + let ops = samples.len(); + let total: f64 = samples.iter().sum(); + samples.sort_by(f64::total_cmp); + let at = |p: f64| samples[((p * ops as f64).ceil() as usize).clamp(1, ops) - 1]; + let min_step = samples + .iter() + .copied() + .filter(|&s| s > 0.0) + .fold(f64::INFINITY, f64::min); + console_log!( + "AB {{\"name\":\"{name}\",\"ops\":{ops},\"total_ns\":{:.0},\"mean_ns\":{:.1},\"p50_ns\":{:.0},\ + \"p99_ns\":{:.0},\"allocs_per_op\":0,\"digest\":\"{digest:016x}\",\"rows\":{rows},\"rss_kb\":0,\ + \"min_nonzero_sample_ns\":{:.0}}}", + total * 1e6, + total * 1e6 / ops as f64, + at(0.50) * 1e6, + at(0.99) * 1e6, + min_step * 1e6 + ); + } + + /// Time `op` (returns its row count, checked against `expect`) for `SECS`. + fn timed(clock: &Clock, name: &str, digest: u64, op: impl Fn(usize) -> usize, expect: impl Fn(usize) -> usize) { + let start = clock.now(); + let mut i = 0; + while i < 3 || clock.now() - start < 300.0 { + assert_eq!(op(i), expect(i), "warm-up rows"); + i += 1; + } + let mut samples = Vec::new(); + let mut rows = 0; + let start = clock.now(); + let mut i = 0; + while samples.len() < 5 || clock.now() - start < SECS * 1000.0 { + let t = clock.now(); + let r = op(i); + samples.push(clock.now() - t); + assert_eq!(r, expect(i), "rows changed"); + rows += r; + i += 1; + } + report(name, &mut samples, digest, rows); + } + + #[wasm_bindgen_test] + async fn reader_ab() { + let clock = Clock::new(); + let db = BrowserDb::open_in_memory().unwrap(); + for t in transactions() { + db.execute(t).await.unwrap(); + } + db.checkpoint().await.unwrap(); + let m = ENTITIES / 2; + let keys = varied_keys(ENTITIES, 256); + // Point families: fixed, varied and missing keys through a cursor + // pulled in batches of one. + let families: [(&str, Box String>); 2] = [ + ( + "br_pt_ea", + Box::new(move |i| { + let j = (i / 3) % 256; + match i % 3 { + 0 => format!("(query [:find ?a :where [:p{m} :age ?a]])"), + 1 => format!("(query [:find ?a :where [:p{} :age ?a]])", keys[j]), + _ => format!("(query [:find ?a :where [:missing{j} :age ?a]])"), + } + }), + ), + ( + "br_pt_av", + Box::new(move |i| { + let j = (i / 3) % 256; + match i % 3 { + 0 => format!("(query [:find ?e :where [?e :name \"p{m}\"]])"), + 1 => format!("(query [:find ?e :where [?e :name \"p{}\"]])", varied_keys(ENTITIES, 256)[j]), + _ => format!("(query [:find ?e :where [?e :name \"nope{j}\"]])"), + } + }), + ), + ]; + for (name, text) in &families { + let texts: Vec = (0..3 * 256).map(text).collect(); + let mut h = DefaultHasher::new(); + let expect: Vec = texts.iter().map(|q| drain(&db, q, 1, Some(&mut h))).collect(); + timed( + &clock, + name, + h.finish(), + |i| drain(&db, &texts[i % texts.len()], 1, None), + |i| expect[i % texts.len()], + ); + } + for (name, q) in [ + ("br_scan", "(query [:find ?e ?a :where [?e :age ?a]])".to_string()), + ( + "br_join_2", + format!("(query [:find ?n :where [:p{m} :follows ?f] [?f :name ?n]])"), + ), + ] { + let mut h = DefaultHasher::new(); + let n = drain(&db, &q, 1_000, Some(&mut h)); + timed(&clock, name, h.finish(), |_| drain(&db, &q, 1_000, None), |_| n); + } + } +} diff --git a/docs/audits/797/acceptance-plan.json b/docs/audits/797/acceptance-plan.json new file mode 100644 index 0000000000..68738e794e --- /dev/null +++ b/docs/audits/797/acceptance-plan.json @@ -0,0 +1,33 @@ +{ + "fixed_before_acceptance": "2026-10-30, after the pilots in raw/pilot-*.jsonl and before any acceptance campaign ran", + "order": [ + "primary-1-envelope", + "primary-1-release", + "secondary", + "cold", + "concurrency", + "wasi", + "browser", + "primary-2-envelope", + "primary-2-release" + ], + "estimand": "per block: candidate mean ns/op / base mean ns/op (cc_*: wall ns per operation, inverse throughput); compared as natural logs", + "bound": "one-sided 95% Student t upper bound on the mean log ratio over the campaign's blocks, exponentiated (analyze.py)", + "gates": { + "primary": "pt_ea, pt_av, pt_asof: upper bound <= 1.02 for B:H in each of primary-1 and primary-2, in both envelope and release", + "control": "B:B in each primary campaign and profile: lower bound >= 0.98 and upper bound <= 1.02 for every family, else the campaign is inconclusive", + "secondary": "every other workload: upper bound <= 1.05 (B:H)", + "results": "every block's result digests equal between base and candidate; any mismatch fails", + "cold": "every cold observation's resident page count after eviction is 0, else the cold category is outstanding" + }, + "block_counts": { + "primary": 128, + "secondary": 48, + "cold": 48, + "concurrency": 48, + "wasi": 32, + "browser": 32 + }, + "block_count_basis": "pilot log-ratio sd: primary envelope <= 0.024, release <= 0.060 (16 blocks); secondary <= 0.056; cold <= 0.021; concurrency <= 0.096; wasi <= 0.055; browser <= 0.020. Primary: 128 blocks give a one-sided 95% half-width of 1.657*0.060/sqrt(128) = 0.0088 at the worst release sd, so the B:B control can resolve +-2%. Others: 1.68*0.096/sqrt(48) = 0.023 < 0.05.", + "no_retry": "each campaign runs once into raw/.jsonl (run.py refuses an existing file); an interrupted or failed campaign is reported, not rerun into the same name" +} \ No newline at end of file diff --git a/docs/audits/797/analyze.py b/docs/audits/797/analyze.py new file mode 100644 index 0000000000..0f6edf0bbc --- /dev/null +++ b/docs/audits/797/analyze.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +"""Analyze #797 campaigns: per-block log mean-latency ratios and bounds. + + analyze.py RAW.jsonl[.gz] [RAW.jsonl[.gz] ...] > summary.json + +For each campaign, pair and workload: the block ratio is the candidate's +mean ns/op over the base's (for `cc_*`, wall time per operation: inverse +throughput). Ratios are compared as logs; the bound is the one-sided 95% +Student t upper bound on the mean log ratio, exponentiated. Every block must +have the same result digest in both processes (the harness checks every +timed operation's row count): a mismatch is reported and fails the workload. p50/p99, allocations and RSS are medians +over blocks and do not gate. +""" +import gzip +import json +import math +import statistics +import sys + + +def t_quantile(p, df): + """Inverse Student t CDF by bisection on its numeric integral.""" + def cdf(x): + # Regularized incomplete beta through a continued fraction. + t = df / (df + x * x) + ib = _betai(df / 2, 0.5, t) + return 1 - 0.5 * ib if x > 0 else 0.5 * ib + lo, hi = 0.0, 50.0 + for _ in range(200): + mid = (lo + hi) / 2 + if cdf(mid) < p: + lo = mid + else: + hi = mid + return (lo + hi) / 2 + + +def _betai(a, b, x): + if x <= 0: + return 0.0 + if x >= 1: + return 1.0 + lbeta = math.lgamma(a + b) - math.lgamma(a) - math.lgamma(b) + front = math.exp(lbeta + a * math.log(x) + b * math.log(1 - x)) + if x < (a + 1) / (a + b + 2): + return front * _betacf(a, b, x) / a + return 1 - front * _betacf(b, a, 1 - x) / b + + +def _betacf(a, b, x): + tiny = 1e-300 + c, d = 1.0, 1 - (a + b) * x / (a + 1) + d = 1 / (d if abs(d) > tiny else tiny) + h = d + for m in range(1, 300): + m2 = 2 * m + aa = m * (b - m) * x / ((a + m2 - 1) * (a + m2)) + d = 1 + aa * d + d = 1 / (d if abs(d) > tiny else tiny) + c = 1 + aa / c + c = c if abs(c) > tiny else tiny + h *= d * c + aa = -(a + m) * (a + b + m) * x / ((a + m2) * (a + m2 + 1)) + d = 1 + aa * d + d = 1 / (d if abs(d) > tiny else tiny) + c = 1 + aa / c + c = c if abs(c) > tiny else tiny + delta = d * c + h *= delta + if abs(delta - 1) < 1e-12: + break + return h + + +def metric(r): + return r.get("inverse_throughput_ns", r["mean_ns"]) + + +def main(paths): + groups = {} + for path in paths: + for line in (gzip.open(path, "rt") if path.endswith(".gz") else open(path)): + rec = json.loads(line) + for rb, rc in zip(rec["base_reports"], rec["cand_reports"]): + assert rb["name"] == rc["name"] + key = (rec["campaign"], rec["pair"], rb["name"]) + groups.setdefault(key, []).append((rec, rb, rc)) + out = [] + for (campaign, pair, name), rows in sorted(groups.items()): + logs = [math.log(metric(rc) / metric(rb)) for _, rb, rc in rows] + n = len(logs) + mean = statistics.fmean(logs) + sd = statistics.stdev(logs) if n > 1 else float("inf") + t = t_quantile(0.95, n - 1) if n > 1 else float("inf") + half = t * sd / math.sqrt(n) + # Complete results are validated once per process outside timing and + # hashed; each timed operation checks its row count in the harness. + mismatches = sum(1 for _, rb, rc in rows if rb["digest"] != rc["digest"]) + med = lambda rs, k: statistics.median(r[k] for r in rs) + bs = [rb for _, rb, _ in rows] + cs = [rc for _, _, rc in rows] + extra = {} + if "resident_pages_after_evict" in bs[0]: + # The harness sums residency over a process's observations; + # report it per observation (mean within a process). + per = [r["resident_pages_after_evict"] / r["ops"] for r in bs + cs] + extra["resident_pages_per_observation_median"] = statistics.median(per) + extra["resident_pages_per_observation_max"] = max(per) + extra["file_pages"] = bs[0]["file_pages"] + out.append({ + "campaign": campaign, "pair": pair, "workload": name, "blocks": n, + "ratio_geomean": math.exp(mean), + "upper95": math.exp(mean + half), "lower95": math.exp(mean - half), + "log_sd": sd, + "digest_or_row_mismatches": mismatches, + "base_mean_ns_median": med(bs, "mean_ns"), "cand_mean_ns_median": med(cs, "mean_ns"), + "base_metric_median": statistics.median(metric(r) for r in bs), + "cand_metric_median": statistics.median(metric(r) for r in cs), + "base_p50_ns": med(bs, "p50_ns"), "cand_p50_ns": med(cs, "p50_ns"), + "base_p99_ns": med(bs, "p99_ns"), "cand_p99_ns": med(cs, "p99_ns"), + "base_allocs_per_op": med(bs, "allocs_per_op"), "cand_allocs_per_op": med(cs, "allocs_per_op"), + "base_rss_kb": med(bs, "rss_kb"), "cand_rss_kb": med(cs, "rss_kb"), + "ops_per_block_min": min(r["ops"] for r in bs + cs), + **extra, + }) + print(json.dumps(out, indent=1)) + + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/docs/audits/797/elf_funcs.sh b/docs/audits/797/elf_funcs.sh new file mode 100644 index 0000000000..e3acaacd16 --- /dev/null +++ b/docs/audits/797/elf_funcs.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# Per-symbol size differences of two unstripped ELF builds (#797), with Rust +# symbol hashes removed. Attribution only: the stripped artifact is the measure. +# Usage: elf_funcs.sh BASE CANDIDATE +set -euo pipefail +sizes() { + nm -S --size-sort -C "$1" | awk '{size=strtonum("0x"$2); $1=$2=$3=""; sub(/^ +/, ""); gsub(/::h[0-9a-f]{16}$/, ""); s[$0]+=size} END {for (k in s) print s[k] "\t" k}' | sort -t$'\t' -k2 +} +join -t$'\t' -1 2 -2 2 -a 1 -a 2 -e 0 -o 0,1.1,2.1 <(sizes "$1") <(sizes "$2") \ + | awk -F'\t' '$2 != $3 {d=$3-$2; t+=d; printf "%+7d %7d %7d %s\n", d, $2, $3, $1} END {printf "%+7d total symbol bytes\n", t}' \ + | sort -n diff --git a/docs/audits/797/evidence/compiler.txt b/docs/audits/797/evidence/compiler.txt new file mode 100644 index 0000000000..fa1bb24cce --- /dev/null +++ b/docs/audits/797/evidence/compiler.txt @@ -0,0 +1,9 @@ +rustc 1.99.1 (58cf8f9c3 2026-10-13) +binary: rustc +commit-hash: 58cf8f9c35b355199727627d07ae34a4e2846d67 +commit-date: 2026-10-13 +host: x86_64-unknown-linux-gnu +release: 1.99.1 +LLVM version: 23.1.1 +cargo 1.99.1 (5f94df478 2026-08-27) +wasm-bindgen 0.2.130 diff --git a/docs/audits/797/evidence/gates-H.tsv b/docs/audits/797/evidence/gates-H.tsv new file mode 100644 index 0000000000..09ead930dd --- /dev/null +++ b/docs/audits/797/evidence/gates-H.tsv @@ -0,0 +1,13 @@ +step status +test-all-features 0 +test-hooks 0 +clippy-ci 0 +clippy-all-targets 101 +fmt 0 +msrv 0 +clippy-wasm-browser 0 +clippy-wasi 0 +wasi-tests 0 +browser-firefox 0 +shuttle 0 +coverage 0 diff --git a/docs/audits/797/evidence/plan-provenance.txt b/docs/audits/797/evidence/plan-provenance.txt new file mode 100644 index 0000000000..ebcc802516 --- /dev/null +++ b/docs/audits/797/evidence/plan-provenance.txt @@ -0,0 +1,14 @@ +The harness and acceptance plan were committed before the first acceptance block. + +Original commit: 2313d245b88338cd85be45ee85425036bc05f800 + committed 1793353989 = 2026-10-30T09:53:09Z + parent 3280481369a9dc34c455870057f45f65a781653a (H's entry-point tests) + docs/audits/797 tree ed15680326a801e606066c44a116b366536ce447 +Last pilot block ended 2026-10-30T09:52:28Z (pilot-browser-2, 1793353948) +First acceptance block started 2026-10-30T09:53:17Z (primary-1-envelope, 1793353997) + +The published branch drops H's commits (the outcome is docs-only), so the +same files were rebased onto the spec commit as 9fea12192; its +docs/audits/797 tree at that commit is +ed15680326a801e606066c44a116b366536ce447, identical to the original's. +The original commit is preserved on the origin branch audit/797-h-measured. diff --git a/docs/audits/797/evidence/sizes-B.tsv b/docs/audits/797/evidence/sizes-B.tsv new file mode 100644 index 0000000000..5289efeed7 --- /dev/null +++ b/docs/audits/797/evidence/sizes-B.tsv @@ -0,0 +1,9 @@ +case bytes sha256 +native 1259384 66d923515db3563c3b69ff6a62905f96022dbbd9224041bdc3efc5c450c58466 +wasi 876947 f2e85f503107dafa3f9624080812912ac8d18eac3865aac947097941c848c801 +browser-raw 1582757 ecb619025b0d53665df5904df38d71df5420ed9b2f2c9f56b40d4a64f0bdb803 +browser-packaged-wasm 1001653 84fbb40428af2377d4374d49e11c2b9f0824880dfd7539e7b430a11be1706bca +browser-packaged-js 43712 60f0844e0b5cdeef707e529c9591750e2a29e01ede9746fd2ddd4cb94d612957 +consumer-size 1459888 09cd30c28fef3868f76045d71473635ccdfb95b94bb6bcb70734341f57ecbb22 +consumer-speed 4737512 1cc76977765207cb114dc81fec54f44bf9f7511f2abb7bfa174473c1b65ba449 +consumer-speed-stripped 2150336 6db7dc0979c1ae955bd3bcd16931da8a8c3727df062acaa135c36e45480df600 diff --git a/docs/audits/797/evidence/sizes-H.tsv b/docs/audits/797/evidence/sizes-H.tsv new file mode 100644 index 0000000000..18afc6dae6 --- /dev/null +++ b/docs/audits/797/evidence/sizes-H.tsv @@ -0,0 +1,9 @@ +case bytes sha256 +native 1256096 16db6ff1bc011c3740f67b4e9d5c01c62c2961c18a9281fe636c8510f7c74041 +wasi 876884 6ef6589e12ccad8f3a3d3020fe5d7cf000fc3ada713ee20cc83eecfb99bbec9d +browser-raw 1582447 9f3184c444abecd38298244ed4871ab4178873f508fc51f9d9eaf3e589ffaf6e +browser-packaged-wasm 1001392 8ab43b86fd7b6a2f8abe1203d369241a02746778de372460d685781c1e388607 +browser-packaged-js 43712 dffb849e16e09295b91b72fdbd10f7bbe5b286e9999dcbfbb0d79ab6cd16de9b +consumer-size 1459936 bf66294abe2f501899e8bc516c4268aaa9baefa2151b88241882376c06dba7a4 +consumer-speed 4722448 2ea02b182fec319fbaceb35bc7b3f7a591b5f2877731f6c32b4bd78ad8d4ec59 +consumer-speed-stripped 2137128 2538a014adf336f0e1b9bb4cfffdab2268108ecd60d2ea450a67f56a61edb361 diff --git a/docs/audits/797/evidence/sizes-P.tsv b/docs/audits/797/evidence/sizes-P.tsv new file mode 100644 index 0000000000..07ef5b48d8 --- /dev/null +++ b/docs/audits/797/evidence/sizes-P.tsv @@ -0,0 +1,9 @@ +case bytes sha256 +native 1251936 3ca969a1d9b1dba75e46b20d8bb83f62ae7735f27c86802b4b0fab2b81828fee +wasi 876849 d82021efda57f9923a30aa0dbb6b2f2e1cec052ae3c2105e2078c5d12fb37c93 +browser-raw 1582014 088699e113b9c4a0a776cf6e53829734118c5be2fc0d26818d9f77788b7b381a +browser-packaged-wasm 1001017 ce6b64928364bc0b55b509309195eefaa7c2987e72f088d93bad394c426dc33c +browser-packaged-js 43712 52e66cdc1ce79392a1b56c846e0dceb3e17d56691c2b267c04e71f0b4abe6b5b +consumer-size 1459952 c761814940dd38c3a0bae81286351400fb358e72b2c0f557ff227be7353d5e94 +consumer-speed 4710704 935ed11040ac26459c3f10e71ccfc6381405719f64daf25fdae42cb0b241f78b +consumer-speed-stripped 2129960 80dfe1e56388e660ced813442c8eda3723694351ae0d777daddccc9179384719 diff --git a/docs/audits/797/evidence/summary.json b/docs/audits/797/evidence/summary.json new file mode 100644 index 0000000000..0a71a6dece --- /dev/null +++ b/docs/audits/797/evidence/summary.json @@ -0,0 +1,3086 @@ +[ + { + "campaign": "browser", + "pair": "B:H", + "workload": "br_join_2", + "blocks": 32, + "ratio_geomean": 1.0057090769253672, + "upper95": 1.0169506371568264, + "lower95": 0.9945917829776589, + "log_sd": 0.03708605333693023, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 125519.5, + "cand_mean_ns_median": 125131.6, + "base_metric_median": 125519.5, + "cand_metric_median": 125131.6, + "base_p50_ns": 122565.0, + "cand_p50_ns": 122495.0, + "base_p99_ns": 158449.5, + "cand_p99_ns": 158680.0, + "base_allocs_per_op": 0.0, + "cand_allocs_per_op": 0.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 10458 + }, + { + "campaign": "browser", + "pair": "B:H", + "workload": "br_pt_av", + "blocks": 32, + "ratio_geomean": 1.0072521509283172, + "upper95": 1.0164545857687146, + "lower95": 0.9981330299990158, + "log_sd": 0.030343141809227397, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 57908.8, + "cand_mean_ns_median": 57822.2, + "base_metric_median": 57908.8, + "cand_metric_median": 57822.2, + "base_p50_ns": 59818.0, + "cand_p50_ns": 60089.0, + "base_p99_ns": 82424.5, + "cand_p99_ns": 81005.5, + "base_allocs_per_op": 0.0, + "cand_allocs_per_op": 0.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 23431 + }, + { + "campaign": "browser", + "pair": "B:H", + "workload": "br_pt_ea", + "blocks": 32, + "ratio_geomean": 1.0013922472073866, + "upper95": 1.013721476143682, + "lower95": 0.9892129705900868, + "log_sd": 0.040826688497170055, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 63835.15, + "cand_mean_ns_median": 63740.649999999994, + "base_metric_median": 63835.15, + "cand_metric_median": 63740.649999999994, + "base_p50_ns": 68956.0, + "cand_p50_ns": 68866.5, + "base_p99_ns": 114662.0, + "cand_p99_ns": 112288.0, + "base_allocs_per_op": 0.0, + "cand_allocs_per_op": 0.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 20849 + }, + { + "campaign": "browser", + "pair": "B:H", + "workload": "br_scan", + "blocks": 32, + "ratio_geomean": 1.0042432276461002, + "upper95": 1.0097177098814936, + "lower95": 0.9987984269300587, + "log_sd": 0.018138253085690222, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 10749238.350000001, + "cand_mean_ns_median": 10762806.3, + "base_metric_median": 10749238.350000001, + "cand_metric_median": 10762806.3, + "base_p50_ns": 10662459.0, + "cand_p50_ns": 10669661.5, + "base_p99_ns": 11854526.5, + "cand_p99_ns": 11352730.0, + "base_allocs_per_op": 0.0, + "cand_allocs_per_op": 0.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 128 + }, + { + "campaign": "browser", + "pair": "B:P", + "workload": "br_join_2", + "blocks": 32, + "ratio_geomean": 1.0071114241174932, + "upper95": 1.0163304793297603, + "lower95": 0.9979759942423927, + "log_sd": 0.030401923450577066, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 126117.95000000001, + "cand_mean_ns_median": 125911.2, + "base_metric_median": 126117.95000000001, + "cand_metric_median": 125911.2, + "base_p50_ns": 122829.5, + "cand_p50_ns": 123144.5, + "base_p99_ns": 160203.0, + "cand_p99_ns": 158972.0, + "base_allocs_per_op": 0.0, + "cand_allocs_per_op": 0.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 10208 + }, + { + "campaign": "browser", + "pair": "B:P", + "workload": "br_pt_av", + "blocks": 32, + "ratio_geomean": 0.9949642851981055, + "upper95": 1.0009364235185052, + "lower95": 0.9890277799461805, + "log_sd": 0.01996616249305635, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 57902.350000000006, + "cand_mean_ns_median": 57724.4, + "base_metric_median": 57902.350000000006, + "cand_metric_median": 57724.4, + "base_p50_ns": 60079.0, + "cand_p50_ns": 59949.0, + "base_p99_ns": 81251.5, + "cand_p99_ns": 83507.0, + "base_allocs_per_op": 0.0, + "cand_allocs_per_op": 0.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 23441 + }, + { + "campaign": "browser", + "pair": "B:P", + "workload": "br_pt_ea", + "blocks": 32, + "ratio_geomean": 0.992693367246007, + "upper95": 1.0004872190235978, + "lower95": 0.9849602300126662, + "log_sd": 0.026092163237350887, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 63846.8, + "cand_mean_ns_median": 63659.399999999994, + "base_metric_median": 63846.8, + "cand_metric_median": 63659.399999999994, + "base_p50_ns": 69261.5, + "cand_p50_ns": 68881.5, + "base_p99_ns": 114331.5, + "cand_p99_ns": 111405.5, + "base_allocs_per_op": 0.0, + "cand_allocs_per_op": 0.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 20987 + }, + { + "campaign": "browser", + "pair": "B:P", + "workload": "br_scan", + "blocks": 32, + "ratio_geomean": 1.0012222344796275, + "upper95": 1.0051901137107184, + "lower95": 0.9972700180225512, + "log_sd": 0.013195966340136029, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 10726368.8, + "cand_mean_ns_median": 10743174.4, + "base_metric_median": 10726368.8, + "cand_metric_median": 10743174.4, + "base_p50_ns": 10657691.0, + "cand_p50_ns": 10632954.5, + "base_p99_ns": 11367877.0, + "cand_p99_ns": 11823376.0, + "base_allocs_per_op": 0.0, + "cand_allocs_per_op": 0.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 132 + }, + { + "campaign": "cold", + "pair": "B:H", + "workload": "cold_point", + "blocks": 48, + "ratio_geomean": 0.989656958851583, + "upper95": 1.0265257000762507, + "lower95": 0.9541123969235373, + "log_sd": 0.1510269578082909, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 321312.15, + "cand_mean_ns_median": 320678.75, + "base_metric_median": 321312.15, + "cand_metric_median": 320678.75, + "base_p50_ns": 317705.0, + "cand_p50_ns": 317348.5, + "base_p99_ns": 364695.5, + "cand_p99_ns": 358365.0, + "base_allocs_per_op": 300.01, + "cand_allocs_per_op": 300.01, + "base_rss_kb": 4970.0, + "cand_rss_kb": 4952.0, + "ops_per_block_min": 1429, + "resident_pages_per_observation_median": 1.0685740791649003, + "resident_pages_per_observation_max": 147.8206465067779, + "file_pages": 2628 + }, + { + "campaign": "cold", + "pair": "B:H", + "workload": "cold_scan", + "blocks": 48, + "ratio_geomean": 1.0076129765790556, + "upper95": 1.014779586472864, + "lower95": 1.0004969789542115, + "log_sd": 0.029263599673848083, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 12984385.45, + "cand_mean_ns_median": 13087053.55, + "base_metric_median": 12984385.45, + "cand_metric_median": 13087053.55, + "base_p50_ns": 12909324.5, + "cand_p50_ns": 12917523.5, + "base_p99_ns": 14579687.5, + "cand_p99_ns": 14619511.0, + "base_allocs_per_op": 112496.08, + "cand_allocs_per_op": 112496.08, + "base_rss_kb": 6426.0, + "cand_rss_kb": 6416.0, + "ops_per_block_min": 70, + "resident_pages_per_observation_median": 7.896103896103896, + "resident_pages_per_observation_max": 8.106666666666667, + "file_pages": 2628 + }, + { + "campaign": "cold", + "pair": "B:P", + "workload": "cold_point", + "blocks": 48, + "ratio_geomean": 1.0085344433863455, + "upper95": 1.046556689049601, + "lower95": 0.9718935764676947, + "log_sd": 0.15280369747696418, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 320954.1, + "cand_mean_ns_median": 321832.75, + "base_metric_median": 320954.1, + "cand_metric_median": 321832.75, + "base_p50_ns": 318841.0, + "cand_p50_ns": 319636.0, + "base_p99_ns": 359682.0, + "cand_p99_ns": 359988.0, + "base_allocs_per_op": 300.01, + "cand_allocs_per_op": 300.01, + "base_rss_kb": 4988.0, + "cand_rss_kb": 4940.0, + "ops_per_block_min": 1430, + "resident_pages_per_observation_median": 1.0621373449839353, + "resident_pages_per_observation_max": 16.40494997367035, + "file_pages": 2628 + }, + { + "campaign": "cold", + "pair": "B:P", + "workload": "cold_scan", + "blocks": 48, + "ratio_geomean": 0.9873639843379554, + "upper95": 0.9950780888279673, + "lower95": 0.9797096815949128, + "log_sd": 0.03213400278775887, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 12992931.899999999, + "cand_mean_ns_median": 12829694.2, + "base_metric_median": 12992931.899999999, + "cand_metric_median": 12829694.2, + "base_p50_ns": 12865788.5, + "cand_p50_ns": 12829400.5, + "base_p99_ns": 14909494.5, + "cand_p99_ns": 14265157.5, + "base_allocs_per_op": 112496.08, + "cand_allocs_per_op": 112496.08, + "base_rss_kb": 6424.0, + "cand_rss_kb": 6398.0, + "ops_per_block_min": 68, + "resident_pages_per_observation_median": 7.894718614718615, + "resident_pages_per_observation_max": 8.103896103896103, + "file_pages": 2628 + }, + { + "campaign": "concurrency", + "pair": "B:H", + "workload": "cc_1", + "blocks": 48, + "ratio_geomean": 0.9958983541591178, + "upper95": 1.0028248034877019, + "lower95": 0.9890197453906538, + "log_sd": 0.02861787481363271, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 17387.65, + "cand_mean_ns_median": 17345.45, + "base_metric_median": 17456.2, + "cand_metric_median": 17416.7, + "base_p50_ns": 19713.5, + "cand_p50_ns": 19576.5, + "base_p99_ns": 28076.0, + "cand_p99_ns": 27936.5, + "base_allocs_per_op": 211.32, + "cand_allocs_per_op": 211.32, + "base_rss_kb": 7040.0, + "cand_rss_kb": 7040.0, + "ops_per_block_min": 80628 + }, + { + "campaign": "concurrency", + "pair": "B:H", + "workload": "cc_44", + "blocks": 48, + "ratio_geomean": 1.034242917863184, + "upper95": 1.0465346158787874, + "lower95": 1.0220955875902378, + "log_sd": 0.04878304526134341, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 337472.05, + "cand_mean_ns_median": 350676.85, + "base_metric_median": 7683.45, + "cand_metric_median": 7984.35, + "base_p50_ns": 347765.0, + "cand_p50_ns": 359739.5, + "base_p99_ns": 669378.5, + "cand_p99_ns": 682662.5, + "base_allocs_per_op": 210.62, + "cand_allocs_per_op": 210.62, + "base_rss_kb": 19068.0, + "cand_rss_kb": 19296.0, + "ops_per_block_min": 178707 + }, + { + "campaign": "concurrency", + "pair": "B:H", + "workload": "cc_8", + "blocks": 48, + "ratio_geomean": 1.0097478940822084, + "upper95": 1.0210241516454888, + "lower95": 0.9985961722455594, + "log_sd": 0.045854915555910016, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 87512.0, + "cand_mean_ns_median": 88355.0, + "base_metric_median": 10960.9, + "cand_metric_median": 11066.95, + "base_p50_ns": 93986.0, + "cand_p50_ns": 93945.5, + "base_p99_ns": 147631.5, + "cand_p99_ns": 148801.5, + "base_allocs_per_op": 210.65, + "cand_allocs_per_op": 210.65, + "base_rss_kb": 11844.0, + "cand_rss_kb": 11784.0, + "ops_per_block_min": 123927 + }, + { + "campaign": "concurrency", + "pair": "B:P", + "workload": "cc_1", + "blocks": 48, + "ratio_geomean": 1.004701133938163, + "upper95": 1.0105809439751912, + "lower95": 0.9988555340911031, + "log_sd": 0.024093855912360955, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 17345.949999999997, + "cand_mean_ns_median": 17466.25, + "base_metric_median": 17414.15, + "cand_metric_median": 17535.75, + "base_p50_ns": 19670.5, + "cand_p50_ns": 19846.0, + "base_p99_ns": 28040.0, + "cand_p99_ns": 28063.5, + "base_allocs_per_op": 211.32, + "cand_allocs_per_op": 211.32, + "base_rss_kb": 7010.0, + "cand_rss_kb": 6974.0, + "ops_per_block_min": 78939 + }, + { + "campaign": "concurrency", + "pair": "B:P", + "workload": "cc_44", + "blocks": 48, + "ratio_geomean": 0.9941384032338136, + "upper95": 1.006766224328888, + "lower95": 0.9816689723009794, + "log_sd": 0.052117721604492295, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 340017.7, + "cand_mean_ns_median": 335510.8, + "base_metric_median": 7741.95, + "cand_metric_median": 7641.25, + "base_p50_ns": 347871.0, + "cand_p50_ns": 342718.0, + "base_p99_ns": 664409.0, + "cand_p99_ns": 673365.0, + "base_allocs_per_op": 210.62, + "cand_allocs_per_op": 210.63, + "base_rss_kb": 19262.0, + "cand_rss_kb": 19248.0, + "ops_per_block_min": 184761 + }, + { + "campaign": "concurrency", + "pair": "B:P", + "workload": "cc_8", + "blocks": 48, + "ratio_geomean": 0.9987561205694331, + "upper95": 1.0103927790102996, + "lower95": 0.9872534811184905, + "log_sd": 0.047829808653783626, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 87199.15, + "cand_mean_ns_median": 87009.5, + "base_metric_median": 10925.45, + "cand_metric_median": 10899.3, + "base_p50_ns": 95163.0, + "cand_p50_ns": 92550.5, + "base_p99_ns": 145100.5, + "cand_p99_ns": 149636.5, + "base_allocs_per_op": 210.65, + "cand_allocs_per_op": 210.65, + "base_rss_kb": 11850.0, + "cand_rss_kb": 11894.0, + "ops_per_block_min": 125077 + }, + { + "campaign": "primary-1-envelope", + "pair": "B:B", + "workload": "pt_asof", + "blocks": 128, + "ratio_geomean": 1.000568426304228, + "upper95": 1.004614601300924, + "lower95": 0.9965385476385653, + "log_sd": 0.027556200728105912, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 14191.95, + "cand_mean_ns_median": 14223.75, + "base_metric_median": 14191.95, + "cand_metric_median": 14223.75, + "base_p50_ns": 15327.0, + "cand_p50_ns": 15298.0, + "base_p99_ns": 24458.5, + "cand_p99_ns": 24491.5, + "base_allocs_per_op": 212.05, + "cand_allocs_per_op": 212.05, + "base_rss_kb": 5816.0, + "cand_rss_kb": 5828.0, + "ops_per_block_min": 95872 + }, + { + "campaign": "primary-1-envelope", + "pair": "B:B", + "workload": "pt_av", + "blocks": 128, + "ratio_geomean": 1.0008867269606077, + "upper95": 1.0050112451076068, + "lower95": 0.9967791356390822, + "log_sd": 0.02807974112667863, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 16835.4, + "cand_mean_ns_median": 16838.449999999997, + "base_metric_median": 16835.4, + "cand_metric_median": 16838.449999999997, + "base_p50_ns": 16317.0, + "cand_p50_ns": 16292.0, + "base_p99_ns": 22888.5, + "cand_p99_ns": 23204.0, + "base_allocs_per_op": 254.25, + "cand_allocs_per_op": 254.25, + "base_rss_kb": 5670.0, + "cand_rss_kb": 5696.0, + "ops_per_block_min": 78782 + }, + { + "campaign": "primary-1-envelope", + "pair": "B:B", + "workload": "pt_ea", + "blocks": 128, + "ratio_geomean": 0.9998786227397345, + "upper95": 1.0038876527956047, + "lower95": 0.9958856027642194, + "log_sd": 0.027322531597455426, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 14183.4, + "cand_mean_ns_median": 14155.5, + "base_metric_median": 14183.4, + "cand_metric_median": 14155.5, + "base_p50_ns": 15813.5, + "cand_p50_ns": 15785.5, + "base_p99_ns": 24283.0, + "cand_p99_ns": 24231.5, + "base_allocs_per_op": 202.29, + "cand_allocs_per_op": 202.29, + "base_rss_kb": 5782.0, + "cand_rss_kb": 5800.0, + "ops_per_block_min": 96193 + }, + { + "campaign": "primary-1-envelope", + "pair": "B:H", + "workload": "pt_asof", + "blocks": 128, + "ratio_geomean": 1.0129881730105752, + "upper95": 1.0179437403064329, + "lower95": 1.0080567304735342, + "log_sd": 0.03332168727495889, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 14234.0, + "cand_mean_ns_median": 14501.5, + "base_metric_median": 14234.0, + "cand_metric_median": 14501.5, + "base_p50_ns": 15381.5, + "cand_p50_ns": 15560.5, + "base_p99_ns": 24510.0, + "cand_p99_ns": 24838.0, + "base_allocs_per_op": 212.05, + "cand_allocs_per_op": 212.05, + "base_rss_kb": 5824.0, + "cand_rss_kb": 5780.0, + "ops_per_block_min": 93845 + }, + { + "campaign": "primary-1-envelope", + "pair": "B:H", + "workload": "pt_av", + "blocks": 128, + "ratio_geomean": 1.0129963498813488, + "upper95": 1.017229866051888, + "lower95": 1.0087804527955064, + "log_sd": 0.028476429138772377, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 16904.3, + "cand_mean_ns_median": 17168.65, + "base_metric_median": 16904.3, + "cand_metric_median": 17168.65, + "base_p50_ns": 16341.5, + "cand_p50_ns": 16523.5, + "base_p99_ns": 23210.5, + "cand_p99_ns": 23632.0, + "base_allocs_per_op": 254.25, + "cand_allocs_per_op": 254.25, + "base_rss_kb": 5704.0, + "cand_rss_kb": 5652.0, + "ops_per_block_min": 79369 + }, + { + "campaign": "primary-1-envelope", + "pair": "B:H", + "workload": "pt_ea", + "blocks": 128, + "ratio_geomean": 1.0112236117487858, + "upper95": 1.0154683957927828, + "lower95": 1.0069965714294138, + "log_sd": 0.02860201226110826, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 14208.15, + "cand_mean_ns_median": 14390.95, + "base_metric_median": 14208.15, + "cand_metric_median": 14390.95, + "base_p50_ns": 15830.0, + "cand_p50_ns": 15972.0, + "base_p99_ns": 24297.0, + "cand_p99_ns": 24600.0, + "base_allocs_per_op": 202.29, + "cand_allocs_per_op": 202.29, + "base_rss_kb": 5810.0, + "cand_rss_kb": 5760.0, + "ops_per_block_min": 96007 + }, + { + "campaign": "primary-1-envelope", + "pair": "B:P", + "workload": "pt_asof", + "blocks": 128, + "ratio_geomean": 0.9951082401982873, + "upper95": 0.9998153261587871, + "lower95": 0.9904233149885379, + "log_sd": 0.032222169863965186, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 14262.9, + "cand_mean_ns_median": 14222.35, + "base_metric_median": 14262.9, + "cand_metric_median": 14222.35, + "base_p50_ns": 15358.0, + "cand_p50_ns": 15282.0, + "base_p99_ns": 24515.0, + "cand_p99_ns": 24508.0, + "base_allocs_per_op": 212.05, + "cand_allocs_per_op": 212.05, + "base_rss_kb": 5832.0, + "cand_rss_kb": 5780.0, + "ops_per_block_min": 94860 + }, + { + "campaign": "primary-1-envelope", + "pair": "B:P", + "workload": "pt_av", + "blocks": 128, + "ratio_geomean": 0.9993720169193039, + "upper95": 1.0039264919886586, + "lower95": 0.9948382039634834, + "log_sd": 0.03104713411807401, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 16903.6, + "cand_mean_ns_median": 16866.7, + "base_metric_median": 16903.6, + "cand_metric_median": 16866.7, + "base_p50_ns": 16381.5, + "cand_p50_ns": 16307.0, + "base_p99_ns": 23121.5, + "cand_p99_ns": 23299.5, + "base_allocs_per_op": 254.25, + "cand_allocs_per_op": 254.25, + "base_rss_kb": 5708.0, + "cand_rss_kb": 5644.0, + "ops_per_block_min": 79793 + }, + { + "campaign": "primary-1-envelope", + "pair": "B:P", + "workload": "pt_ea", + "blocks": 128, + "ratio_geomean": 0.9928075506501041, + "upper95": 0.9971498024758765, + "lower95": 0.9884842078697647, + "log_sd": 0.0297988864117785, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 14235.75, + "cand_mean_ns_median": 14135.35, + "base_metric_median": 14235.75, + "cand_metric_median": 14135.35, + "base_p50_ns": 15850.0, + "cand_p50_ns": 15728.5, + "base_p99_ns": 24314.5, + "cand_p99_ns": 24171.0, + "base_allocs_per_op": 202.29, + "cand_allocs_per_op": 202.29, + "base_rss_kb": 5816.0, + "cand_rss_kb": 5760.0, + "ops_per_block_min": 95980 + }, + { + "campaign": "primary-1-release", + "pair": "B:B", + "workload": "pt_asof", + "blocks": 128, + "ratio_geomean": 1.0002858959938064, + "upper95": 1.0042537331651349, + "lower95": 0.9963337358683263, + "log_sd": 0.02703135838074842, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22776.95, + "cand_mean_ns_median": 22791.4, + "base_metric_median": 22776.95, + "cand_metric_median": 22791.4, + "base_p50_ns": 24655.5, + "cand_p50_ns": 24639.0, + "base_p99_ns": 39083.0, + "cand_p99_ns": 39065.5, + "base_allocs_per_op": 212.05, + "cand_allocs_per_op": 212.05, + "base_rss_kb": 4848.0, + "cand_rss_kb": 4840.0, + "ops_per_block_min": 58931 + }, + { + "campaign": "primary-1-release", + "pair": "B:B", + "workload": "pt_av", + "blocks": 128, + "ratio_geomean": 1.0026998496703967, + "upper95": 1.0069602669170752, + "lower95": 0.99845745811521, + "log_sd": 0.028950647348182396, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 26365.45, + "cand_mean_ns_median": 26408.25, + "base_metric_median": 26365.45, + "cand_metric_median": 26408.25, + "base_p50_ns": 25537.5, + "cand_p50_ns": 25564.5, + "base_p99_ns": 33681.0, + "cand_p99_ns": 33894.0, + "base_allocs_per_op": 254.25, + "cand_allocs_per_op": 254.25, + "base_rss_kb": 4770.0, + "cand_rss_kb": 4768.0, + "ops_per_block_min": 51034 + }, + { + "campaign": "primary-1-release", + "pair": "B:B", + "workload": "pt_ea", + "blocks": 128, + "ratio_geomean": 0.9994145108517378, + "upper95": 1.0031824923960595, + "lower95": 0.9956606819516518, + "log_sd": 0.025694716222999923, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22510.15, + "cand_mean_ns_median": 22516.5, + "base_metric_median": 22510.15, + "cand_metric_median": 22516.5, + "base_p50_ns": 24815.5, + "cand_p50_ns": 24816.0, + "base_p99_ns": 38709.5, + "cand_p99_ns": 38676.0, + "base_allocs_per_op": 202.29, + "cand_allocs_per_op": 202.28, + "base_rss_kb": 4832.0, + "cand_rss_kb": 4828.0, + "ops_per_block_min": 60536 + }, + { + "campaign": "primary-1-release", + "pair": "B:H", + "workload": "pt_asof", + "blocks": 128, + "ratio_geomean": 1.0011596344842368, + "upper95": 1.0048848716966745, + "lower95": 0.9974482072043396, + "log_sd": 0.02535957528715879, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22829.3, + "cand_mean_ns_median": 22865.25, + "base_metric_median": 22829.3, + "cand_metric_median": 22865.25, + "base_p50_ns": 24672.0, + "cand_p50_ns": 24610.0, + "base_p99_ns": 39249.5, + "cand_p99_ns": 39619.5, + "base_allocs_per_op": 212.05, + "cand_allocs_per_op": 212.05, + "base_rss_kb": 4844.0, + "cand_rss_kb": 4830.0, + "ops_per_block_min": 55829 + }, + { + "campaign": "primary-1-release", + "pair": "B:H", + "workload": "pt_av", + "blocks": 128, + "ratio_geomean": 1.001671053383377, + "upper95": 1.0057618779568382, + "lower95": 0.9975968677838695, + "log_sd": 0.02782905896794564, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 26446.35, + "cand_mean_ns_median": 26479.75, + "base_metric_median": 26446.35, + "cand_metric_median": 26479.75, + "base_p50_ns": 25634.0, + "cand_p50_ns": 25798.0, + "base_p99_ns": 33759.5, + "cand_p99_ns": 34066.5, + "base_allocs_per_op": 254.25, + "cand_allocs_per_op": 254.25, + "base_rss_kb": 4768.0, + "cand_rss_kb": 4756.0, + "ops_per_block_min": 47012 + }, + { + "campaign": "primary-1-release", + "pair": "B:H", + "workload": "pt_ea", + "blocks": 128, + "ratio_geomean": 1.003262382084773, + "upper95": 1.006717611199138, + "lower95": 0.9998190119148629, + "log_sd": 0.02347543517872444, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22497.6, + "cand_mean_ns_median": 22590.35, + "base_metric_median": 22497.6, + "cand_metric_median": 22590.35, + "base_p50_ns": 24781.5, + "cand_p50_ns": 24855.5, + "base_p99_ns": 38757.0, + "cand_p99_ns": 39074.0, + "base_allocs_per_op": 202.29, + "cand_allocs_per_op": 202.28, + "base_rss_kb": 4832.0, + "cand_rss_kb": 4816.0, + "ops_per_block_min": 56122 + }, + { + "campaign": "primary-1-release", + "pair": "B:P", + "workload": "pt_asof", + "blocks": 128, + "ratio_geomean": 1.0081019121343497, + "upper95": 1.0127837679307172, + "lower95": 1.0034416994313968, + "log_sd": 0.03163771952863907, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22763.55, + "cand_mean_ns_median": 22912.35, + "base_metric_median": 22763.55, + "cand_metric_median": 22912.35, + "base_p50_ns": 24614.5, + "cand_p50_ns": 24553.5, + "base_p99_ns": 39035.0, + "cand_p99_ns": 39316.5, + "base_allocs_per_op": 212.05, + "cand_allocs_per_op": 212.05, + "base_rss_kb": 4844.0, + "cand_rss_kb": 4830.0, + "ops_per_block_min": 54505 + }, + { + "campaign": "primary-1-release", + "pair": "B:P", + "workload": "pt_av", + "blocks": 128, + "ratio_geomean": 1.0104407559953306, + "upper95": 1.0161078769558476, + "lower95": 1.0048052421709348, + "log_sd": 0.038188683967040934, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 26423.949999999997, + "cand_mean_ns_median": 26680.4, + "base_metric_median": 26423.949999999997, + "cand_metric_median": 26680.4, + "base_p50_ns": 25619.5, + "cand_p50_ns": 25829.0, + "base_p99_ns": 33880.0, + "cand_p99_ns": 34538.5, + "base_allocs_per_op": 254.25, + "cand_allocs_per_op": 254.25, + "base_rss_kb": 4764.0, + "cand_rss_kb": 4754.0, + "ops_per_block_min": 43061 + }, + { + "campaign": "primary-1-release", + "pair": "B:P", + "workload": "pt_ea", + "blocks": 128, + "ratio_geomean": 1.0098737125205952, + "upper95": 1.0147458747278817, + "lower95": 1.005024943327427, + "log_sd": 0.032863003344925264, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22502.9, + "cand_mean_ns_median": 22732.199999999997, + "base_metric_median": 22502.9, + "cand_metric_median": 22732.199999999997, + "base_p50_ns": 24797.0, + "cand_p50_ns": 24869.0, + "base_p99_ns": 38778.0, + "cand_p99_ns": 39330.0, + "base_allocs_per_op": 202.28, + "cand_allocs_per_op": 202.29, + "base_rss_kb": 4824.0, + "cand_rss_kb": 4820.0, + "ops_per_block_min": 53162 + }, + { + "campaign": "primary-2-envelope", + "pair": "B:B", + "workload": "pt_asof", + "blocks": 128, + "ratio_geomean": 0.9978891748440728, + "upper95": 1.0020654790412866, + "lower95": 0.9937302762127751, + "log_sd": 0.0285167951092779, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 14192.0, + "cand_mean_ns_median": 14191.25, + "base_metric_median": 14192.0, + "cand_metric_median": 14191.25, + "base_p50_ns": 15327.5, + "cand_p50_ns": 15333.5, + "base_p99_ns": 24490.0, + "cand_p99_ns": 24418.0, + "base_allocs_per_op": 212.05, + "cand_allocs_per_op": 212.05, + "base_rss_kb": 5786.0, + "cand_rss_kb": 5822.0, + "ops_per_block_min": 92336 + }, + { + "campaign": "primary-2-envelope", + "pair": "B:B", + "workload": "pt_av", + "blocks": 128, + "ratio_geomean": 0.9985092852968898, + "upper95": 1.0021831870780589, + "lower95": 0.9948488516665256, + "log_sd": 0.025077012693356437, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 16867.15, + "cand_mean_ns_median": 16852.6, + "base_metric_median": 16867.15, + "cand_metric_median": 16852.6, + "base_p50_ns": 16285.0, + "cand_p50_ns": 16298.0, + "base_p99_ns": 22885.5, + "cand_p99_ns": 22930.5, + "base_allocs_per_op": 254.25, + "cand_allocs_per_op": 254.25, + "base_rss_kb": 5660.0, + "cand_rss_kb": 5698.0, + "ops_per_block_min": 80919 + }, + { + "campaign": "primary-2-envelope", + "pair": "B:B", + "workload": "pt_ea", + "blocks": 128, + "ratio_geomean": 0.9978863011647074, + "upper95": 1.0014416178849543, + "lower95": 0.9943436065252245, + "log_sd": 0.024284145737899762, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 14187.3, + "cand_mean_ns_median": 14174.85, + "base_metric_median": 14187.3, + "cand_metric_median": 14174.85, + "base_p50_ns": 15798.5, + "cand_p50_ns": 15795.5, + "base_p99_ns": 24265.5, + "cand_p99_ns": 24247.0, + "base_allocs_per_op": 202.29, + "cand_allocs_per_op": 202.29, + "base_rss_kb": 5768.0, + "cand_rss_kb": 5806.0, + "ops_per_block_min": 94005 + }, + { + "campaign": "primary-2-envelope", + "pair": "B:H", + "workload": "pt_asof", + "blocks": 128, + "ratio_geomean": 1.0221292503027022, + "upper95": 1.0260425718049508, + "lower95": 1.018230854190102, + "log_sd": 0.026092024568551107, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 14178.05, + "cand_mean_ns_median": 14478.35, + "base_metric_median": 14178.05, + "cand_metric_median": 14478.35, + "base_p50_ns": 15310.5, + "cand_p50_ns": 15578.5, + "base_p99_ns": 24463.5, + "cand_p99_ns": 24821.5, + "base_allocs_per_op": 212.05, + "cand_allocs_per_op": 212.05, + "base_rss_kb": 5820.0, + "cand_rss_kb": 5780.0, + "ops_per_block_min": 94912 + }, + { + "campaign": "primary-2-envelope", + "pair": "B:H", + "workload": "pt_av", + "blocks": 128, + "ratio_geomean": 1.021099767632606, + "upper95": 1.0245285260374868, + "lower95": 1.0176824841490184, + "log_sd": 0.022889625021784925, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 16839.9, + "cand_mean_ns_median": 17174.699999999997, + "base_metric_median": 16839.9, + "cand_metric_median": 17174.699999999997, + "base_p50_ns": 16309.0, + "cand_p50_ns": 16593.0, + "base_p99_ns": 23273.5, + "cand_p99_ns": 23349.0, + "base_allocs_per_op": 254.25, + "cand_allocs_per_op": 254.25, + "base_rss_kb": 5690.0, + "cand_rss_kb": 5652.0, + "ops_per_block_min": 79079 + }, + { + "campaign": "primary-2-envelope", + "pair": "B:H", + "workload": "pt_ea", + "blocks": 128, + "ratio_geomean": 1.0167260158344853, + "upper95": 1.0199439150407377, + "lower95": 1.013518269024996, + "log_sd": 0.02157646308362445, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 14164.4, + "cand_mean_ns_median": 14373.900000000001, + "base_metric_median": 14164.4, + "cand_metric_median": 14373.900000000001, + "base_p50_ns": 15814.0, + "cand_p50_ns": 15939.0, + "base_p99_ns": 24221.5, + "cand_p99_ns": 24567.5, + "base_allocs_per_op": 202.29, + "cand_allocs_per_op": 202.29, + "base_rss_kb": 5804.0, + "cand_rss_kb": 5762.0, + "ops_per_block_min": 94952 + }, + { + "campaign": "primary-2-envelope", + "pair": "B:P", + "workload": "pt_asof", + "blocks": 128, + "ratio_geomean": 0.9935159412415088, + "upper95": 0.9978641051915599, + "lower95": 0.98918672428999, + "log_sd": 0.02981814059587473, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 14219.45, + "cand_mean_ns_median": 14103.150000000001, + "base_metric_median": 14219.45, + "cand_metric_median": 14103.150000000001, + "base_p50_ns": 15359.0, + "cand_p50_ns": 15198.5, + "base_p99_ns": 24532.5, + "cand_p99_ns": 24249.0, + "base_allocs_per_op": 212.05, + "cand_allocs_per_op": 212.05, + "base_rss_kb": 5832.0, + "cand_rss_kb": 5792.0, + "ops_per_block_min": 96185 + }, + { + "campaign": "primary-2-envelope", + "pair": "B:P", + "workload": "pt_av", + "blocks": 128, + "ratio_geomean": 1.0015840410806898, + "upper95": 1.005519139135661, + "lower95": 0.9976643430276672, + "log_sd": 0.026774077990524753, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 16876.4, + "cand_mean_ns_median": 16866.3, + "base_metric_median": 16876.4, + "cand_metric_median": 16866.3, + "base_p50_ns": 16328.0, + "cand_p50_ns": 16296.0, + "base_p99_ns": 23033.0, + "cand_p99_ns": 22849.5, + "base_allocs_per_op": 254.25, + "cand_allocs_per_op": 254.25, + "base_rss_kb": 5700.0, + "cand_rss_kb": 5652.0, + "ops_per_block_min": 81656 + }, + { + "campaign": "primary-2-envelope", + "pair": "B:P", + "workload": "pt_ea", + "blocks": 128, + "ratio_geomean": 0.9940471417628789, + "upper95": 0.9978450417368051, + "lower95": 0.9902636969835056, + "log_sd": 0.02603792246759184, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 14180.95, + "cand_mean_ns_median": 14096.2, + "base_metric_median": 14180.95, + "cand_metric_median": 14096.2, + "base_p50_ns": 15839.0, + "cand_p50_ns": 15683.5, + "base_p99_ns": 24242.5, + "cand_p99_ns": 24073.5, + "base_allocs_per_op": 202.29, + "cand_allocs_per_op": 202.29, + "base_rss_kb": 5810.0, + "cand_rss_kb": 5772.0, + "ops_per_block_min": 97034 + }, + { + "campaign": "primary-2-release", + "pair": "B:B", + "workload": "pt_asof", + "blocks": 128, + "ratio_geomean": 0.9965551932395444, + "upper95": 1.0006814961251451, + "lower95": 0.9924459051339408, + "log_sd": 0.02821371624341058, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22862.35, + "cand_mean_ns_median": 22822.8, + "base_metric_median": 22862.35, + "cand_metric_median": 22822.8, + "base_p50_ns": 24647.0, + "cand_p50_ns": 24616.5, + "base_p99_ns": 39362.5, + "cand_p99_ns": 39280.5, + "base_allocs_per_op": 212.05, + "cand_allocs_per_op": 212.05, + "base_rss_kb": 4838.0, + "cand_rss_kb": 4846.0, + "ops_per_block_min": 58211 + }, + { + "campaign": "primary-2-release", + "pair": "B:B", + "workload": "pt_av", + "blocks": 128, + "ratio_geomean": 0.9974794218455492, + "upper95": 1.001749452377104, + "lower95": 0.993227592632395, + "log_sd": 0.029167367476087044, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 26427.2, + "cand_mean_ns_median": 26385.55, + "base_metric_median": 26427.2, + "cand_metric_median": 26385.55, + "base_p50_ns": 25598.0, + "cand_p50_ns": 25546.5, + "base_p99_ns": 33943.0, + "cand_p99_ns": 33629.5, + "base_allocs_per_op": 254.25, + "cand_allocs_per_op": 254.25, + "base_rss_kb": 4768.0, + "cand_rss_kb": 4776.0, + "ops_per_block_min": 50080 + }, + { + "campaign": "primary-2-release", + "pair": "B:B", + "workload": "pt_ea", + "blocks": 128, + "ratio_geomean": 0.9968842743715359, + "upper95": 1.0002533346575415, + "lower95": 0.9935265617779773, + "log_sd": 0.023037179819528273, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22517.75, + "cand_mean_ns_median": 22475.4, + "base_metric_median": 22517.75, + "cand_metric_median": 22475.4, + "base_p50_ns": 24803.0, + "cand_p50_ns": 24764.0, + "base_p99_ns": 38734.0, + "cand_p99_ns": 38660.0, + "base_allocs_per_op": 202.28, + "cand_allocs_per_op": 202.285, + "base_rss_kb": 4828.0, + "cand_rss_kb": 4836.0, + "ops_per_block_min": 60307 + }, + { + "campaign": "primary-2-release", + "pair": "B:H", + "workload": "pt_asof", + "blocks": 128, + "ratio_geomean": 1.0007863529781984, + "upper95": 1.0044007423239334, + "lower95": 0.9971849702042352, + "log_sd": 0.024615497116287893, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22735.550000000003, + "cand_mean_ns_median": 22791.550000000003, + "base_metric_median": 22735.550000000003, + "cand_metric_median": 22791.550000000003, + "base_p50_ns": 24620.0, + "cand_p50_ns": 24616.5, + "base_p99_ns": 39029.0, + "cand_p99_ns": 39329.5, + "base_allocs_per_op": 212.05, + "cand_allocs_per_op": 212.05, + "base_rss_kb": 4844.0, + "cand_rss_kb": 4840.0, + "ops_per_block_min": 59812 + }, + { + "campaign": "primary-2-release", + "pair": "B:H", + "workload": "pt_av", + "blocks": 128, + "ratio_geomean": 1.0033681478083953, + "upper95": 1.0070631460900266, + "lower95": 0.99968670678219, + "log_sd": 0.025098837230984786, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 26410.85, + "cand_mean_ns_median": 26448.55, + "base_metric_median": 26410.85, + "cand_metric_median": 26448.55, + "base_p50_ns": 25534.5, + "cand_p50_ns": 25700.5, + "base_p99_ns": 33848.0, + "cand_p99_ns": 33911.0, + "base_allocs_per_op": 254.25, + "cand_allocs_per_op": 254.25, + "base_rss_kb": 4768.0, + "cand_rss_kb": 4764.0, + "ops_per_block_min": 50796 + }, + { + "campaign": "primary-2-release", + "pair": "B:H", + "workload": "pt_ea", + "blocks": 128, + "ratio_geomean": 1.0060245789241617, + "upper95": 1.0092372187758425, + "lower95": 1.0028221656620526, + "log_sd": 0.021770030930253446, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22478.05, + "cand_mean_ns_median": 22614.95, + "base_metric_median": 22478.05, + "cand_metric_median": 22614.95, + "base_p50_ns": 24777.5, + "cand_p50_ns": 24867.0, + "base_p99_ns": 38653.5, + "cand_p99_ns": 39048.0, + "base_allocs_per_op": 202.29, + "cand_allocs_per_op": 202.28, + "base_rss_kb": 4832.0, + "cand_rss_kb": 4824.0, + "ops_per_block_min": 59396 + }, + { + "campaign": "primary-2-release", + "pair": "B:P", + "workload": "pt_asof", + "blocks": 128, + "ratio_geomean": 1.0024474846682476, + "upper95": 1.0061626745188723, + "lower95": 0.998746012913092, + "log_sd": 0.02525887246245562, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22748.35, + "cand_mean_ns_median": 22798.15, + "base_metric_median": 22748.35, + "cand_metric_median": 22798.15, + "base_p50_ns": 24605.5, + "cand_p50_ns": 24433.5, + "base_p99_ns": 39024.0, + "cand_p99_ns": 39129.5, + "base_allocs_per_op": 212.05, + "cand_allocs_per_op": 212.05, + "base_rss_kb": 4844.0, + "cand_rss_kb": 4836.0, + "ops_per_block_min": 57316 + }, + { + "campaign": "primary-2-release", + "pair": "B:P", + "workload": "pt_av", + "blocks": 128, + "ratio_geomean": 1.006167989239919, + "upper95": 1.0099113453234019, + "lower95": 1.0024385083493752, + "log_sd": 0.025356080983276595, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 26432.85, + "cand_mean_ns_median": 26568.2, + "base_metric_median": 26432.85, + "cand_metric_median": 26568.2, + "base_p50_ns": 25617.5, + "cand_p50_ns": 25694.5, + "base_p99_ns": 33699.5, + "cand_p99_ns": 34134.0, + "base_allocs_per_op": 254.25, + "cand_allocs_per_op": 254.25, + "base_rss_kb": 4768.0, + "cand_rss_kb": 4762.0, + "ops_per_block_min": 50236 + }, + { + "campaign": "primary-2-release", + "pair": "B:P", + "workload": "pt_ea", + "blocks": 128, + "ratio_geomean": 1.0052991352296137, + "upper95": 1.0087712601565468, + "lower95": 1.00183896113037, + "log_sd": 0.023542318732054632, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22506.4, + "cand_mean_ns_median": 22595.7, + "base_metric_median": 22506.4, + "cand_metric_median": 22595.7, + "base_p50_ns": 24791.0, + "cand_p50_ns": 24760.5, + "base_p99_ns": 38644.0, + "cand_p99_ns": 38942.5, + "base_allocs_per_op": 202.28, + "cand_allocs_per_op": 202.28, + "base_rss_kb": 4828.0, + "cand_rss_kb": 4820.0, + "ops_per_block_min": 58745 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "con_checkpoint", + "blocks": 48, + "ratio_geomean": 0.9940947996850437, + "upper95": 1.005172221361543, + "lower95": 0.983139455865842, + "log_sd": 0.04575620047482824, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 631270.05, + "cand_mean_ns_median": 620908.6, + "base_metric_median": 631270.05, + "cand_metric_median": 620908.6, + "base_p50_ns": 613403.5, + "cand_p50_ns": 609313.5, + "base_p99_ns": 964533.0, + "cand_p99_ns": 960965.0, + "base_allocs_per_op": 1672.71, + "cand_allocs_per_op": 1672.63, + "base_rss_kb": 66180.0, + "cand_rss_kb": 66244.0, + "ops_per_block_min": 877 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "con_direct", + "blocks": 48, + "ratio_geomean": 1.005560454370674, + "upper95": 1.018300786513469, + "lower95": 0.9929795211650679, + "log_sd": 0.05198563793858075, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 97.75, + "cand_mean_ns_median": 97.05000000000001, + "base_metric_median": 97.75, + "cand_metric_median": 97.05000000000001, + "base_p50_ns": 96.0, + "cand_p50_ns": 94.0, + "base_p99_ns": 103.0, + "cand_p99_ns": 103.0, + "base_allocs_per_op": 1.0, + "cand_allocs_per_op": 1.0, + "base_rss_kb": 66936.0, + "cand_rss_kb": 67134.0, + "ops_per_block_min": 6161753 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "con_large_tx", + "blocks": 48, + "ratio_geomean": 0.9962559078019553, + "upper95": 1.0014984512729344, + "lower95": 0.9910408074708135, + "log_sd": 0.021670981141781252, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 20870.300000000003, + "cand_mean_ns_median": 20845.65, + "base_metric_median": 20870.300000000003, + "cand_metric_median": 20845.65, + "base_p50_ns": 20592.5, + "cand_p50_ns": 20559.5, + "base_p99_ns": 25495.5, + "cand_p99_ns": 25821.0, + "base_allocs_per_op": 284.0, + "cand_allocs_per_op": 284.0, + "base_rss_kb": 66180.0, + "cand_rss_kb": 66244.0, + "ops_per_block_min": 44798 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "con_open", + "blocks": 48, + "ratio_geomean": 0.997815734408645, + "upper95": 1.0015296292209588, + "lower95": 0.994115611545033, + "log_sd": 0.015339807254248279, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 26038.7, + "cand_mean_ns_median": 25903.0, + "base_metric_median": 26038.7, + "cand_metric_median": 25903.0, + "base_p50_ns": 25666.0, + "cand_p50_ns": 25498.5, + "base_p99_ns": 30732.5, + "cand_p99_ns": 31048.5, + "base_allocs_per_op": 64.0, + "cand_allocs_per_op": 64.0, + "base_rss_kb": 14830.0, + "cand_rss_kb": 14428.0, + "ops_per_block_min": 35551 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "cw_long", + "blocks": 48, + "ratio_geomean": 0.9959729715974953, + "upper95": 0.9993702301743836, + "lower95": 0.9925872616594296, + "log_sd": 0.014060120464298024, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 11879403.2, + "cand_mean_ns_median": 11824931.1, + "base_metric_median": 11879403.2, + "cand_metric_median": 11824931.1, + "base_p50_ns": 11804306.5, + "cand_p50_ns": 11792789.5, + "base_p99_ns": 13217290.5, + "cand_p99_ns": 13284318.0, + "base_allocs_per_op": 112171.0, + "cand_allocs_per_op": 112171.0, + "base_rss_kb": 14830.0, + "cand_rss_kb": 14428.0, + "ops_per_block_min": 81 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "fl_paged", + "blocks": 48, + "ratio_geomean": 0.9880158850539835, + "upper95": 0.9909154657603876, + "lower95": 0.9851247889949216, + "log_sd": 0.012099917446274802, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22703569.700000003, + "cand_mean_ns_median": 22469659.6, + "base_metric_median": 22703569.700000003, + "cand_metric_median": 22469659.6, + "base_p50_ns": 22579422.0, + "cand_p50_ns": 22370454.0, + "base_p99_ns": 24009678.0, + "cand_p99_ns": 23888775.0, + "base_allocs_per_op": 483666.0, + "cand_allocs_per_op": 483666.0, + "base_rss_kb": 14830.0, + "cand_rss_kb": 14428.0, + "ops_per_block_min": 42 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "nc_point", + "blocks": 48, + "ratio_geomean": 1.002649753370443, + "upper95": 1.0074076650695871, + "lower95": 0.9979143129354376, + "log_sd": 0.019547280695381246, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 24790.5, + "cand_mean_ns_median": 24826.9, + "base_metric_median": 24790.5, + "cand_metric_median": 24826.9, + "base_p50_ns": 28153.0, + "cand_p50_ns": 28326.0, + "base_p99_ns": 36583.5, + "cand_p99_ns": 37165.5, + "base_allocs_per_op": 212.0, + "cand_allocs_per_op": 212.0, + "base_rss_kb": 14830.0, + "cand_rss_kb": 14428.0, + "ops_per_block_min": 37170 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "nc_scan", + "blocks": 48, + "ratio_geomean": 0.9950779699695143, + "upper95": 0.9989633495578005, + "lower95": 0.991207702221469, + "log_sd": 0.01609079398768498, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 12689756.399999999, + "cand_mean_ns_median": 12672949.95, + "base_metric_median": 12689756.399999999, + "cand_metric_median": 12672949.95, + "base_p50_ns": 12623336.0, + "cand_p50_ns": 12598568.0, + "base_p99_ns": 14076313.5, + "cand_p99_ns": 13885363.0, + "base_allocs_per_op": 112701.0, + "cand_allocs_per_op": 112701.0, + "base_rss_kb": 14830.0, + "cand_rss_kb": 14428.0, + "ops_per_block_min": 74 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sc_dense_uuid", + "blocks": 48, + "ratio_geomean": 0.9957751479297884, + "upper95": 1.0002814492578502, + "lower95": 0.991289147639674, + "log_sd": 0.018643426687299538, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 11487511.899999999, + "cand_mean_ns_median": 11450242.05, + "base_metric_median": 11487511.899999999, + "cand_metric_median": 11450242.05, + "base_p50_ns": 11426981.5, + "cand_p50_ns": 11396480.5, + "base_p99_ns": 12923934.0, + "cand_p99_ns": 12913895.0, + "base_allocs_per_op": 112016.0, + "cand_allocs_per_op": 112016.0, + "base_rss_kb": 14830.0, + "cand_rss_kb": 14428.0, + "ops_per_block_min": 82 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sc_long_history", + "blocks": 48, + "ratio_geomean": 0.9951313933710296, + "upper95": 0.9995609947777939, + "lower95": 0.9907214219505547, + "log_sd": 0.018338637077665195, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 249671.34999999998, + "cand_mean_ns_median": 248601.95, + "base_metric_median": 249671.34999999998, + "cand_metric_median": 248601.95, + "base_p50_ns": 247393.5, + "cand_p50_ns": 246849.0, + "base_p99_ns": 271320.5, + "cand_p99_ns": 267436.0, + "base_allocs_per_op": 3260.0, + "cand_allocs_per_op": 3260.0, + "base_rss_kb": 14830.0, + "cand_rss_kb": 14428.0, + "ops_per_block_min": 3714 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sc_short", + "blocks": 48, + "ratio_geomean": 0.9952650654835382, + "upper95": 0.9997194011060198, + "lower95": 0.9908305765358495, + "log_sd": 0.018438337663024107, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 11986978.399999999, + "cand_mean_ns_median": 11944553.8, + "base_metric_median": 11986978.399999999, + "cand_metric_median": 11944553.8, + "base_p50_ns": 11920101.5, + "cand_p50_ns": 11890838.5, + "base_p99_ns": 13434857.0, + "cand_p99_ns": 13481144.0, + "base_allocs_per_op": 112021.0, + "cand_allocs_per_op": 112021.0, + "base_rss_kb": 14830.0, + "cand_rss_kb": 14428.0, + "ops_per_block_min": 78 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sc_sparse_uuid", + "blocks": 48, + "ratio_geomean": 0.9921453284276469, + "upper95": 0.9957351915296448, + "lower95": 0.9885684076392285, + "log_sd": 0.014913023608560866, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 260969.95, + "cand_mean_ns_median": 258895.0, + "base_metric_median": 260969.95, + "cand_metric_median": 258895.0, + "base_p50_ns": 259164.0, + "cand_p50_ns": 257662.0, + "base_p99_ns": 282145.5, + "cand_p99_ns": 275966.0, + "base_allocs_per_op": 5024.0, + "cand_allocs_per_op": 5024.0, + "base_rss_kb": 14830.0, + "cand_rss_kb": 14428.0, + "ops_per_block_min": 3633 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_as_of", + "blocks": 48, + "ratio_geomean": 1.004621821812364, + "upper95": 1.009987174823653, + "lower95": 0.9992849711560088, + "log_sd": 0.02199308654151913, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 20131.65, + "cand_mean_ns_median": 20228.65, + "base_metric_median": 20131.65, + "cand_metric_median": 20228.65, + "base_p50_ns": 19918.5, + "cand_p50_ns": 19983.5, + "base_p99_ns": 25226.5, + "cand_p99_ns": 25763.0, + "base_allocs_per_op": 285.0, + "cand_allocs_per_op": 285.0, + "base_rss_kb": 12882.0, + "cand_rss_kb": 12404.0, + "ops_per_block_min": 46745 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_as_of_ts", + "blocks": 48, + "ratio_geomean": 0.9982787183457312, + "upper95": 1.002502308166955, + "lower95": 0.9940729227089521, + "log_sd": 0.017432530884400055, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 775707.3, + "cand_mean_ns_median": 772527.1499999999, + "base_metric_median": 775707.3, + "cand_metric_median": 772527.1499999999, + "base_p50_ns": 769604.0, + "cand_p50_ns": 769312.5, + "base_p99_ns": 816682.5, + "cand_p99_ns": 822024.0, + "base_allocs_per_op": 11877.0, + "cand_allocs_per_op": 11877.0, + "base_rss_kb": 12882.0, + "cand_rss_kb": 12404.0, + "ops_per_block_min": 1195 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_as_of_ts_scan", + "blocks": 48, + "ratio_geomean": 0.9987934403283618, + "upper95": 1.002880239020968, + "lower95": 0.9947232955919353, + "log_sd": 0.016860412458966925, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 7626127.95, + "cand_mean_ns_median": 7628113.3, + "base_metric_median": 7626127.95, + "cand_metric_median": 7628113.3, + "base_p50_ns": 7580549.5, + "cand_p50_ns": 7588713.5, + "base_p99_ns": 7901030.0, + "cand_p99_ns": 7811623.0, + "base_allocs_per_op": 76294.0, + "cand_allocs_per_op": 76294.0, + "base_rss_kb": 12882.0, + "cand_rss_kb": 12404.0, + "ops_per_block_min": 124 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_attribute_scan", + "blocks": 48, + "ratio_geomean": 1.0021641753221768, + "upper95": 1.0061518652583956, + "lower95": 0.9981922898301743, + "log_sd": 0.01639711792133448, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 10672537.6, + "cand_mean_ns_median": 10690609.3, + "base_metric_median": 10672537.6, + "cand_metric_median": 10690609.3, + "base_p50_ns": 10612747.0, + "cand_p50_ns": 10634511.0, + "base_p99_ns": 11566579.0, + "cand_p99_ns": 11865178.0, + "base_allocs_per_op": 112021.0, + "cand_allocs_per_op": 112021.0, + "base_rss_kb": 6684.0, + "cand_rss_kb": 6664.0, + "ops_per_block_min": 89 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_attribute_value", + "blocks": 48, + "ratio_geomean": 1.0192123405778706, + "upper95": 1.0261857545906592, + "lower95": 1.0122863141874265, + "log_sd": 0.028154441039779588, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 15999.85, + "cand_mean_ns_median": 16272.85, + "base_metric_median": 15999.85, + "cand_metric_median": 16272.85, + "base_p50_ns": 15786.5, + "cand_p50_ns": 16087.5, + "base_p99_ns": 20515.0, + "cand_p99_ns": 21331.5, + "base_allocs_per_op": 270.0, + "cand_allocs_per_op": 270.0, + "base_rss_kb": 5416.0, + "cand_rss_kb": 5374.0, + "ops_per_block_min": 54327 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_count", + "blocks": 48, + "ratio_geomean": 0.9968400361510361, + "upper95": 1.0025555268297912, + "lower95": 0.9911571290378041, + "log_sd": 0.02360660883265057, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 41068304.3, + "cand_mean_ns_median": 41006882.3, + "base_metric_median": 41068304.3, + "cand_metric_median": 41006882.3, + "base_p50_ns": 40912169.0, + "cand_p50_ns": 40831575.0, + "base_p99_ns": 42866036.5, + "cand_p99_ns": 42457291.0, + "base_allocs_per_op": 477489.72, + "cand_allocs_per_op": 477489.72, + "base_rss_kb": 12882.0, + "cand_rss_kb": 12404.0, + "ops_per_block_min": 23 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_count_grouped", + "blocks": 48, + "ratio_geomean": 0.9910752644530202, + "upper95": 0.9961039043096012, + "lower95": 0.9860720107220209, + "log_sd": 0.020897390502564683, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 6041161.9, + "cand_mean_ns_median": 5989567.4, + "base_metric_median": 6041161.9, + "cand_metric_median": 5989567.4, + "base_p50_ns": 5996008.0, + "cand_p50_ns": 5952319.5, + "base_p99_ns": 6417955.5, + "cand_p99_ns": 6326556.0, + "base_allocs_per_op": 75953.0, + "cand_allocs_per_op": 75953.0, + "base_rss_kb": 12882.0, + "cand_rss_kb": 12404.0, + "ops_per_block_min": 151 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_hot_as_of", + "blocks": 48, + "ratio_geomean": 0.998900212639742, + "upper95": 1.003243730925394, + "lower95": 0.9945754995063341, + "log_sd": 0.017915323788746072, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 240524.5, + "cand_mean_ns_median": 241330.84999999998, + "base_metric_median": 240524.5, + "cand_metric_median": 241330.84999999998, + "base_p50_ns": 238767.0, + "cand_p50_ns": 239112.5, + "base_p99_ns": 263498.5, + "cand_p99_ns": 261413.0, + "base_allocs_per_op": 2778.0, + "cand_allocs_per_op": 2778.0, + "base_rss_kb": 14830.0, + "cand_rss_kb": 14428.0, + "ops_per_block_min": 3802 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_hot_current", + "blocks": 48, + "ratio_geomean": 0.998224557741526, + "upper95": 1.0030730410769684, + "lower95": 0.9933995101776489, + "log_sd": 0.02000657315967259, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 249974.2, + "cand_mean_ns_median": 250580.95, + "base_metric_median": 249974.2, + "cand_metric_median": 250580.95, + "base_p50_ns": 247659.0, + "cand_p50_ns": 248358.5, + "base_p99_ns": 274711.5, + "cand_p99_ns": 272499.5, + "base_allocs_per_op": 3267.0, + "cand_allocs_per_op": 3267.0, + "base_rss_kb": 14830.0, + "cand_rss_kb": 14428.0, + "ops_per_block_min": 3748 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_join_2", + "blocks": 48, + "ratio_geomean": 1.0125155942294306, + "upper95": 1.017739558063069, + "lower95": 1.007318444523158, + "log_sd": 0.021248492437932122, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 36335.0, + "cand_mean_ns_median": 36839.2, + "base_metric_median": 36335.0, + "cand_metric_median": 36839.2, + "base_p50_ns": 35866.5, + "cand_p50_ns": 36452.5, + "base_p99_ns": 42397.0, + "cand_p99_ns": 43068.5, + "base_allocs_per_op": 534.0, + "cand_allocs_per_op": 534.0, + "base_rss_kb": 6688.0, + "cand_rss_kb": 6672.0, + "ops_per_block_min": 25890 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_join_3_scan", + "blocks": 48, + "ratio_geomean": 0.9925277718142428, + "upper95": 0.9957498244554637, + "lower95": 0.9893161451082998, + "log_sd": 0.013382387979644039, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 43328360.1, + "cand_mean_ns_median": 42914958.2, + "base_metric_median": 43328360.1, + "cand_metric_median": 42914958.2, + "base_p50_ns": 43182827.5, + "cand_p50_ns": 42742793.5, + "base_p99_ns": 44561955.0, + "cand_p99_ns": 44375078.5, + "base_allocs_per_op": 628334.0, + "cand_allocs_per_op": 628334.0, + "base_rss_kb": 12882.0, + "cand_rss_kb": 12404.0, + "ops_per_block_min": 22 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_not_join_hash", + "blocks": 48, + "ratio_geomean": 0.999390100562883, + "upper95": 1.004305527207196, + "lower95": 0.9944987317559922, + "log_sd": 0.020258531633360277, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 5802646.25, + "cand_mean_ns_median": 5792829.449999999, + "base_metric_median": 5802646.25, + "cand_metric_median": 5792829.449999999, + "base_p50_ns": 5778831.0, + "cand_p50_ns": 5774830.0, + "base_p99_ns": 6157891.0, + "cand_p99_ns": 6171069.5, + "base_allocs_per_op": 69282.755, + "cand_allocs_per_op": 69282.76, + "base_rss_kb": 12882.0, + "cand_rss_kb": 12404.0, + "ops_per_block_min": 161 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_not_probe", + "blocks": 48, + "ratio_geomean": 0.9989759099763497, + "upper95": 1.0034610067227232, + "lower95": 0.9945108599409989, + "log_sd": 0.01849657519648541, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 2627998.7, + "cand_mean_ns_median": 2626831.45, + "base_metric_median": 2627998.7, + "cand_metric_median": 2626831.45, + "base_p50_ns": 2566280.5, + "cand_p50_ns": 2568067.5, + "base_p99_ns": 2804513.5, + "cand_p99_ns": 2801176.5, + "base_allocs_per_op": 33879.615000000005, + "cand_allocs_per_op": 33879.61, + "base_rss_kb": 12882.0, + "cand_rss_kb": 12404.0, + "ops_per_block_min": 360 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_or_2", + "blocks": 48, + "ratio_geomean": 1.0000854322666428, + "upper95": 1.0042534135740893, + "lower95": 0.9959347494497413, + "log_sd": 0.01717247405704726, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 9449519.95, + "cand_mean_ns_median": 9448738.3, + "base_metric_median": 9449519.95, + "cand_metric_median": 9448738.3, + "base_p50_ns": 9391437.5, + "cand_p50_ns": 9389164.5, + "base_p99_ns": 9927541.0, + "cand_p99_ns": 9776643.5, + "base_allocs_per_op": 104895.68, + "cand_allocs_per_op": 104895.68, + "base_rss_kb": 12882.0, + "cand_rss_kb": 12404.0, + "ops_per_block_min": 101 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_point_entity", + "blocks": 48, + "ratio_geomean": 1.0131236071575838, + "upper95": 1.020684232996151, + "lower95": 1.0056189859688611, + "log_sd": 0.030699227944587938, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 15917.7, + "cand_mean_ns_median": 16144.05, + "base_metric_median": 15917.7, + "cand_metric_median": 16144.05, + "base_p50_ns": 15748.5, + "cand_p50_ns": 15950.5, + "base_p99_ns": 20570.0, + "cand_p99_ns": 21063.5, + "base_allocs_per_op": 260.0, + "cand_allocs_per_op": 260.0, + "base_rss_kb": 5464.0, + "cand_rss_kb": 5436.0, + "ops_per_block_min": 57268 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_recursive_ancestors", + "blocks": 48, + "ratio_geomean": 0.998143701028598, + "upper95": 1.0027159547577924, + "lower95": 0.9935922961789542, + "log_sd": 0.018870876623313815, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 1209488.65, + "cand_mean_ns_median": 1207755.3, + "base_metric_median": 1209488.65, + "cand_metric_median": 1207755.3, + "base_p50_ns": 1201178.5, + "cand_p50_ns": 1199923.0, + "base_p99_ns": 1273989.5, + "cand_p99_ns": 1267516.0, + "base_allocs_per_op": 17734.0, + "cand_allocs_per_op": 17734.0, + "base_rss_kb": 12882.0, + "cand_rss_kb": 12404.0, + "ops_per_block_min": 769 + }, + { + "campaign": "secondary", + "pair": "B:H", + "workload": "sh_window", + "blocks": 48, + "ratio_geomean": 0.9949846151573873, + "upper95": 0.9995671237389269, + "lower95": 0.9904231150548196, + "log_sd": 0.018973015808673315, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 36824513.05, + "cand_mean_ns_median": 36766100.35, + "base_metric_median": 36824513.05, + "cand_metric_median": 36766100.35, + "base_p50_ns": 36725989.5, + "cand_p50_ns": 36557236.0, + "base_p99_ns": 38143837.5, + "cand_p99_ns": 37981422.5, + "base_allocs_per_op": 561647.0, + "cand_allocs_per_op": 561647.0, + "base_rss_kb": 14830.0, + "cand_rss_kb": 14428.0, + "ops_per_block_min": 26 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "con_checkpoint", + "blocks": 48, + "ratio_geomean": 1.0014804704297116, + "upper95": 1.0133040922711776, + "lower95": 0.9897948111549776, + "log_sd": 0.048462356267495704, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 629057.65, + "cand_mean_ns_median": 629841.25, + "base_metric_median": 629057.65, + "cand_metric_median": 629841.25, + "base_p50_ns": 611758.5, + "cand_p50_ns": 612601.0, + "base_p99_ns": 961767.0, + "cand_p99_ns": 963720.0, + "base_allocs_per_op": 1672.605, + "cand_allocs_per_op": 1673.78, + "base_rss_kb": 66820.0, + "cand_rss_kb": 60566.0, + "ops_per_block_min": 859 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "con_direct", + "blocks": 48, + "ratio_geomean": 1.166326866481871, + "upper95": 1.1743961188360452, + "lower95": 1.15831305779999, + "log_sd": 0.02846837134203863, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 97.5, + "cand_mean_ns_median": 114.05, + "base_metric_median": 97.5, + "cand_metric_median": 114.05, + "base_p50_ns": 95.5, + "cand_p50_ns": 114.0, + "base_p99_ns": 103.0, + "cand_p99_ns": 118.5, + "base_allocs_per_op": 1.0, + "cand_allocs_per_op": 2.0, + "base_rss_kb": 67118.0, + "cand_rss_kb": 61480.0, + "ops_per_block_min": 5902887 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "con_large_tx", + "blocks": 48, + "ratio_geomean": 1.0095375005116378, + "upper95": 1.0160820419060304, + "lower95": 1.0030351122311636, + "log_sd": 0.026680900042092923, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 20813.35, + "cand_mean_ns_median": 21034.15, + "base_metric_median": 20813.35, + "cand_metric_median": 21034.15, + "base_p50_ns": 20542.0, + "cand_p50_ns": 20799.5, + "base_p99_ns": 25887.5, + "cand_p99_ns": 25734.0, + "base_allocs_per_op": 284.0, + "cand_allocs_per_op": 285.0, + "base_rss_kb": 66820.0, + "cand_rss_kb": 60566.0, + "ops_per_block_min": 44089 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "con_open", + "blocks": 48, + "ratio_geomean": 1.0035395732324197, + "upper95": 1.0074911315070323, + "lower95": 0.9996035136677306, + "log_sd": 0.016226612769613704, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 25781.15, + "cand_mean_ns_median": 25914.95, + "base_metric_median": 25781.15, + "cand_metric_median": 25914.95, + "base_p50_ns": 25446.5, + "cand_p50_ns": 25584.5, + "base_p99_ns": 31372.0, + "cand_p99_ns": 30579.0, + "base_allocs_per_op": 64.0, + "cand_allocs_per_op": 65.0, + "base_rss_kb": 14794.0, + "cand_rss_kb": 14172.0, + "ops_per_block_min": 36351 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "cw_long", + "blocks": 48, + "ratio_geomean": 0.9945205523165525, + "upper95": 0.9987099753378214, + "lower95": 0.9903487032313457, + "log_sd": 0.017357011382559556, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 11875157.45, + "cand_mean_ns_median": 11838938.15, + "base_metric_median": 11875157.45, + "cand_metric_median": 11838938.15, + "base_p50_ns": 11810475.5, + "cand_p50_ns": 11776852.0, + "base_p99_ns": 13175814.5, + "cand_p99_ns": 12960986.0, + "base_allocs_per_op": 112171.0, + "cand_allocs_per_op": 112171.0, + "base_rss_kb": 14794.0, + "cand_rss_kb": 14172.0, + "ops_per_block_min": 79 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "fl_paged", + "blocks": 48, + "ratio_geomean": 0.9841003657990087, + "upper95": 0.9884664013545992, + "lower95": 0.9797536149317461, + "log_sd": 0.01827821953512587, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 22716849.8, + "cand_mean_ns_median": 22357293.05, + "base_metric_median": 22716849.8, + "cand_metric_median": 22357293.05, + "base_p50_ns": 22584409.5, + "cand_p50_ns": 22207455.5, + "base_p99_ns": 24400651.5, + "cand_p99_ns": 23874188.5, + "base_allocs_per_op": 483666.0, + "cand_allocs_per_op": 483666.0, + "base_rss_kb": 14794.0, + "cand_rss_kb": 14172.0, + "ops_per_block_min": 42 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "nc_point", + "blocks": 48, + "ratio_geomean": 1.008112517923222, + "upper95": 1.0137445001457095, + "lower95": 1.0025118248704907, + "log_sd": 0.023003270299887423, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 24789.85, + "cand_mean_ns_median": 25037.5, + "base_metric_median": 24789.85, + "cand_metric_median": 25037.5, + "base_p50_ns": 28166.5, + "cand_p50_ns": 28408.0, + "base_p99_ns": 37189.0, + "cand_p99_ns": 37156.5, + "base_allocs_per_op": 212.0, + "cand_allocs_per_op": 212.0, + "base_rss_kb": 14794.0, + "cand_rss_kb": 14172.0, + "ops_per_block_min": 37747 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "nc_scan", + "blocks": 48, + "ratio_geomean": 0.9951861645581404, + "upper95": 0.9988782076140997, + "lower95": 0.9915077679926372, + "log_sd": 0.015289937254953893, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 12713403.95, + "cand_mean_ns_median": 12654989.25, + "base_metric_median": 12713403.95, + "cand_metric_median": 12654989.25, + "base_p50_ns": 12618898.0, + "cand_p50_ns": 12581153.5, + "base_p99_ns": 14029561.0, + "cand_p99_ns": 14024657.5, + "base_allocs_per_op": 112701.0, + "cand_allocs_per_op": 112701.0, + "base_rss_kb": 14794.0, + "cand_rss_kb": 14172.0, + "ops_per_block_min": 75 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sc_dense_uuid", + "blocks": 48, + "ratio_geomean": 0.9998864419283651, + "upper95": 1.003865713136761, + "lower95": 0.9959229443430172, + "log_sd": 0.016399769046483936, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 11486807.85, + "cand_mean_ns_median": 11494298.899999999, + "base_metric_median": 11486807.85, + "cand_metric_median": 11494298.899999999, + "base_p50_ns": 11419483.0, + "cand_p50_ns": 11434132.5, + "base_p99_ns": 13024490.0, + "cand_p99_ns": 12806693.0, + "base_allocs_per_op": 112016.0, + "cand_allocs_per_op": 112016.0, + "base_rss_kb": 14794.0, + "cand_rss_kb": 14172.0, + "ops_per_block_min": 82 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sc_long_history", + "blocks": 48, + "ratio_geomean": 1.002452470671045, + "upper95": 1.007696536288219, + "lower95": 0.9972356952381741, + "log_sd": 0.021543609810998468, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 249798.2, + "cand_mean_ns_median": 251703.5, + "base_metric_median": 249798.2, + "cand_metric_median": 251703.5, + "base_p50_ns": 247919.5, + "cand_p50_ns": 249092.0, + "base_p99_ns": 273116.5, + "cand_p99_ns": 271534.0, + "base_allocs_per_op": 3260.0, + "cand_allocs_per_op": 3260.0, + "base_rss_kb": 14794.0, + "cand_rss_kb": 14172.0, + "ops_per_block_min": 3724 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sc_short", + "blocks": 48, + "ratio_geomean": 0.9960707900742068, + "upper95": 0.9998291875500545, + "lower95": 0.9923265205631779, + "log_sd": 0.015550418151720743, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 11994266.15, + "cand_mean_ns_median": 11936334.1, + "base_metric_median": 11994266.15, + "cand_metric_median": 11936334.1, + "base_p50_ns": 11903360.5, + "cand_p50_ns": 11879789.0, + "base_p99_ns": 13278073.5, + "cand_p99_ns": 13281634.0, + "base_allocs_per_op": 112021.0, + "cand_allocs_per_op": 112021.0, + "base_rss_kb": 14794.0, + "cand_rss_kb": 14172.0, + "ops_per_block_min": 79 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sc_sparse_uuid", + "blocks": 48, + "ratio_geomean": 0.9941567509061248, + "upper95": 0.9983332873613792, + "lower95": 0.9899976870293998, + "log_sd": 0.01731005221011407, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 261261.25, + "cand_mean_ns_median": 260373.75, + "base_metric_median": 261261.25, + "cand_metric_median": 260373.75, + "base_p50_ns": 258949.0, + "cand_p50_ns": 258043.0, + "base_p99_ns": 284821.0, + "cand_p99_ns": 281407.5, + "base_allocs_per_op": 5024.0, + "cand_allocs_per_op": 5024.0, + "base_rss_kb": 14794.0, + "cand_rss_kb": 14172.0, + "ops_per_block_min": 3623 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_as_of", + "blocks": 48, + "ratio_geomean": 0.9981702329632761, + "upper95": 1.0056565037004774, + "lower95": 0.9907396912442279, + "log_sd": 0.030852119624773064, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 20188.75, + "cand_mean_ns_median": 20304.45, + "base_metric_median": 20188.75, + "cand_metric_median": 20304.45, + "base_p50_ns": 19935.0, + "cand_p50_ns": 19985.5, + "base_p99_ns": 25756.0, + "cand_p99_ns": 24997.0, + "base_allocs_per_op": 285.0, + "cand_allocs_per_op": 285.0, + "base_rss_kb": 12844.0, + "cand_rss_kb": 12334.0, + "ops_per_block_min": 45391 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_as_of_ts", + "blocks": 48, + "ratio_geomean": 0.997339299222915, + "upper95": 1.001706421369013, + "lower95": 0.9929912163436442, + "log_sd": 0.018040597901652626, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 775711.1000000001, + "cand_mean_ns_median": 775346.05, + "base_metric_median": 775711.1000000001, + "cand_metric_median": 775346.05, + "base_p50_ns": 772649.0, + "cand_p50_ns": 772284.5, + "base_p99_ns": 817278.5, + "cand_p99_ns": 820585.5, + "base_allocs_per_op": 11877.0, + "cand_allocs_per_op": 11877.0, + "base_rss_kb": 12844.0, + "cand_rss_kb": 12334.0, + "ops_per_block_min": 1223 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_as_of_ts_scan", + "blocks": 48, + "ratio_geomean": 0.9983942399573561, + "upper95": 1.0019173104788115, + "lower95": 0.9948835577096328, + "log_sd": 0.01454459949446612, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 7634308.45, + "cand_mean_ns_median": 7626841.5, + "base_metric_median": 7634308.45, + "cand_metric_median": 7626841.5, + "base_p50_ns": 7585552.5, + "cand_p50_ns": 7588468.0, + "base_p99_ns": 7920116.0, + "cand_p99_ns": 8025112.0, + "base_allocs_per_op": 76294.0, + "cand_allocs_per_op": 76294.0, + "base_rss_kb": 12844.0, + "cand_rss_kb": 12334.0, + "ops_per_block_min": 123 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_attribute_scan", + "blocks": 48, + "ratio_geomean": 0.9978576306298844, + "upper95": 1.001961636718708, + "lower95": 0.9937704344321383, + "log_sd": 0.0169471034981202, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 10689254.350000001, + "cand_mean_ns_median": 10663976.4, + "base_metric_median": 10689254.350000001, + "cand_metric_median": 10663976.4, + "base_p50_ns": 10617501.5, + "cand_p50_ns": 10612681.5, + "base_p99_ns": 12065213.5, + "cand_p99_ns": 11734378.5, + "base_allocs_per_op": 112021.0, + "cand_allocs_per_op": 112021.0, + "base_rss_kb": 6692.0, + "cand_rss_kb": 6664.0, + "ops_per_block_min": 88 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_attribute_value", + "blocks": 48, + "ratio_geomean": 1.0048418484142685, + "upper95": 1.0142084183260376, + "lower95": 0.9955617820557403, + "log_sd": 0.03831017952561757, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 15998.3, + "cand_mean_ns_median": 16180.85, + "base_metric_median": 15998.3, + "cand_metric_median": 16180.85, + "base_p50_ns": 15777.5, + "cand_p50_ns": 15985.0, + "base_p99_ns": 21012.5, + "cand_p99_ns": 20572.0, + "base_allocs_per_op": 270.0, + "cand_allocs_per_op": 270.0, + "base_rss_kb": 5410.0, + "cand_rss_kb": 5374.0, + "ops_per_block_min": 56160 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_count", + "blocks": 48, + "ratio_geomean": 1.0004748588030061, + "upper95": 1.0040376463867104, + "lower95": 0.9969247136290882, + "log_sd": 0.014677741725809535, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 41186280.1, + "cand_mean_ns_median": 41172853.2, + "base_metric_median": 41186280.1, + "cand_metric_median": 41172853.2, + "base_p50_ns": 41017123.5, + "cand_p50_ns": 40999824.0, + "base_p99_ns": 42818934.0, + "cand_p99_ns": 43001729.5, + "base_allocs_per_op": 477489.72, + "cand_allocs_per_op": 477489.72, + "base_rss_kb": 12844.0, + "cand_rss_kb": 12334.0, + "ops_per_block_min": 22 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_count_grouped", + "blocks": 48, + "ratio_geomean": 0.9913660216893323, + "upper95": 0.9953359302916656, + "lower95": 0.9874119471123077, + "log_sd": 0.016501597576008595, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 6045797.05, + "cand_mean_ns_median": 5998476.1, + "base_metric_median": 6045797.05, + "cand_metric_median": 5998476.1, + "base_p50_ns": 6011242.0, + "cand_p50_ns": 5965905.5, + "base_p99_ns": 6455302.0, + "cand_p99_ns": 6467170.0, + "base_allocs_per_op": 75953.0, + "cand_allocs_per_op": 75953.0, + "base_rss_kb": 12844.0, + "cand_rss_kb": 12334.0, + "ops_per_block_min": 157 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_hot_as_of", + "blocks": 48, + "ratio_geomean": 1.0051909370635603, + "upper95": 1.0109500653701458, + "lower95": 0.9994646170627338, + "log_sd": 0.023589278477901966, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 241393.8, + "cand_mean_ns_median": 243603.2, + "base_metric_median": 241393.8, + "cand_metric_median": 243603.2, + "base_p50_ns": 239578.5, + "cand_p50_ns": 241117.0, + "base_p99_ns": 262098.5, + "cand_p99_ns": 265086.5, + "base_allocs_per_op": 2778.0, + "cand_allocs_per_op": 2778.0, + "base_rss_kb": 14794.0, + "cand_rss_kb": 14172.0, + "ops_per_block_min": 3813 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_hot_current", + "blocks": 48, + "ratio_geomean": 1.0039821120448478, + "upper95": 1.00969328345282, + "lower95": 0.9983032449805662, + "log_sd": 0.023421489975384683, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 250834.3, + "cand_mean_ns_median": 252495.2, + "base_metric_median": 250834.3, + "cand_metric_median": 252495.2, + "base_p50_ns": 248819.0, + "cand_p50_ns": 250239.5, + "base_p99_ns": 271672.0, + "cand_p99_ns": 272260.5, + "base_allocs_per_op": 3267.0, + "cand_allocs_per_op": 3267.0, + "base_rss_kb": 14794.0, + "cand_rss_kb": 14172.0, + "ops_per_block_min": 3700 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_join_2", + "blocks": 48, + "ratio_geomean": 0.9983501225663999, + "upper95": 1.0056044662052557, + "lower95": 0.991148111135086, + "log_sd": 0.029894395057859315, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 36607.45, + "cand_mean_ns_median": 36649.55, + "base_metric_median": 36607.45, + "cand_metric_median": 36649.55, + "base_p50_ns": 36062.0, + "cand_p50_ns": 36083.0, + "base_p99_ns": 42815.0, + "cand_p99_ns": 42361.0, + "base_allocs_per_op": 534.0, + "cand_allocs_per_op": 534.0, + "base_rss_kb": 6702.0, + "cand_rss_kb": 6668.0, + "ops_per_block_min": 25326 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_join_3_scan", + "blocks": 48, + "ratio_geomean": 0.99526457486281, + "upper95": 1.0000109891676727, + "lower95": 0.9905406887591346, + "log_sd": 0.019644510136465863, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 43266295.099999994, + "cand_mean_ns_median": 43176694.6, + "base_metric_median": 43266295.099999994, + "cand_metric_median": 43176694.6, + "base_p50_ns": 43180432.0, + "cand_p50_ns": 42940630.0, + "base_p99_ns": 44721884.5, + "cand_p99_ns": 44870019.0, + "base_allocs_per_op": 628334.0, + "cand_allocs_per_op": 628334.0, + "base_rss_kb": 12844.0, + "cand_rss_kb": 12334.0, + "ops_per_block_min": 22 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_not_join_hash", + "blocks": 48, + "ratio_geomean": 0.9958156508501911, + "upper95": 0.9994270863676441, + "lower95": 0.9922172652757248, + "log_sd": 0.014947281874316364, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 5802256.5, + "cand_mean_ns_median": 5779014.3, + "base_metric_median": 5802256.5, + "cand_metric_median": 5779014.3, + "base_p50_ns": 5771005.5, + "cand_p50_ns": 5753748.0, + "base_p99_ns": 6184750.5, + "cand_p99_ns": 6181489.5, + "base_allocs_per_op": 69282.75, + "cand_allocs_per_op": 69282.75, + "base_rss_kb": 12844.0, + "cand_rss_kb": 12334.0, + "ops_per_block_min": 163 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_not_probe", + "blocks": 48, + "ratio_geomean": 0.9974272760052694, + "upper95": 1.0011474519048504, + "lower95": 0.9937209239522131, + "log_sd": 0.015371675543026342, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 2627805.9000000004, + "cand_mean_ns_median": 2623650.15, + "base_metric_median": 2627805.9000000004, + "cand_metric_median": 2623650.15, + "base_p50_ns": 2565157.5, + "cand_p50_ns": 2561114.5, + "base_p99_ns": 2809393.5, + "cand_p99_ns": 2786158.0, + "base_allocs_per_op": 33879.61, + "cand_allocs_per_op": 33879.61, + "base_rss_kb": 12844.0, + "cand_rss_kb": 12334.0, + "ops_per_block_min": 355 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_or_2", + "blocks": 48, + "ratio_geomean": 0.9957641980554498, + "upper95": 0.9997887350398103, + "lower95": 0.9917558613915879, + "log_sd": 0.016654472561608905, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 9416899.100000001, + "cand_mean_ns_median": 9388147.350000001, + "base_metric_median": 9416899.100000001, + "cand_metric_median": 9388147.350000001, + "base_p50_ns": 9381848.0, + "cand_p50_ns": 9355176.5, + "base_p99_ns": 9748922.0, + "cand_p99_ns": 9705875.5, + "base_allocs_per_op": 104895.68, + "cand_allocs_per_op": 104895.68, + "base_rss_kb": 12844.0, + "cand_rss_kb": 12334.0, + "ops_per_block_min": 101 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_point_entity", + "blocks": 48, + "ratio_geomean": 0.995941472043322, + "upper95": 1.0048421027284045, + "lower95": 0.9871196808359812, + "log_sd": 0.036736785844418474, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 15971.6, + "cand_mean_ns_median": 15951.2, + "base_metric_median": 15971.6, + "cand_metric_median": 15951.2, + "base_p50_ns": 15760.5, + "cand_p50_ns": 15786.5, + "base_p99_ns": 20903.0, + "cand_p99_ns": 20277.5, + "base_allocs_per_op": 260.0, + "cand_allocs_per_op": 260.0, + "base_rss_kb": 5464.0, + "cand_rss_kb": 5438.0, + "ops_per_block_min": 56764 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_recursive_ancestors", + "blocks": 48, + "ratio_geomean": 0.9974209035465579, + "upper95": 1.0013904860139868, + "lower95": 0.9934670567838174, + "log_sd": 0.01640027793991715, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 1211471.55, + "cand_mean_ns_median": 1205869.9, + "base_metric_median": 1211471.55, + "cand_metric_median": 1205869.9, + "base_p50_ns": 1203253.5, + "cand_p50_ns": 1200294.0, + "base_p99_ns": 1274175.5, + "cand_p99_ns": 1274807.5, + "base_allocs_per_op": 17734.0, + "cand_allocs_per_op": 17734.0, + "base_rss_kb": 12844.0, + "cand_rss_kb": 12334.0, + "ops_per_block_min": 786 + }, + { + "campaign": "secondary", + "pair": "B:P", + "workload": "sh_window", + "blocks": 48, + "ratio_geomean": 0.9927716446821427, + "upper95": 0.9968786420284355, + "lower95": 0.9886815675771827, + "log_sd": 0.01704613463024415, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 36881034.8, + "cand_mean_ns_median": 36745260.900000006, + "base_metric_median": 36881034.8, + "cand_metric_median": 36745260.900000006, + "base_p50_ns": 36750471.5, + "cand_p50_ns": 36543122.5, + "base_p99_ns": 38616509.0, + "cand_p99_ns": 38075479.5, + "base_allocs_per_op": 561647.0, + "cand_allocs_per_op": 561647.0, + "base_rss_kb": 14794.0, + "cand_rss_kb": 14172.0, + "ops_per_block_min": 26 + }, + { + "campaign": "wasi", + "pair": "B:H", + "workload": "wasi_committed_con_direct", + "blocks": 32, + "ratio_geomean": 0.9862420487194111, + "upper95": 1.0006732000046938, + "lower95": 0.9720190154564935, + "log_sd": 0.048465383464626144, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 192.35000000000002, + "cand_mean_ns_median": 188.1, + "base_metric_median": 192.35000000000002, + "cand_metric_median": 188.1, + "base_p50_ns": 191.0, + "cand_p50_ns": 188.0, + "base_p99_ns": 211.0, + "cand_p99_ns": 204.0, + "base_allocs_per_op": 1.0, + "cand_allocs_per_op": 1.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 1854620 + }, + { + "campaign": "wasi", + "pair": "B:H", + "workload": "wasi_committed_join_2", + "blocks": 32, + "ratio_geomean": 0.9966310938228659, + "upper95": 1.0009806951606586, + "lower95": 0.9923003929812457, + "log_sd": 0.014529190806343698, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 43240.9, + "cand_mean_ns_median": 43219.1, + "base_metric_median": 43240.9, + "cand_metric_median": 43219.1, + "base_p50_ns": 42688.0, + "cand_p50_ns": 42668.0, + "base_p99_ns": 50068.5, + "cand_p99_ns": 49647.0, + "base_allocs_per_op": 532.0, + "cand_allocs_per_op": 532.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 21585 + }, + { + "campaign": "wasi", + "pair": "B:H", + "workload": "wasi_committed_pt_av", + "blocks": 32, + "ratio_geomean": 1.0027033726344363, + "upper95": 1.0079361290981124, + "lower95": 0.9974977823169257, + "log_sd": 0.017365995030847202, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 20859.15, + "cand_mean_ns_median": 21039.4, + "base_metric_median": 20859.15, + "cand_metric_median": 21039.4, + "base_p50_ns": 20036.5, + "cand_p50_ns": 20124.5, + "base_p99_ns": 28792.0, + "cand_p99_ns": 28571.0, + "base_allocs_per_op": 254.23, + "cand_allocs_per_op": 254.23, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 41840 + }, + { + "campaign": "wasi", + "pair": "B:H", + "workload": "wasi_committed_pt_ea", + "blocks": 32, + "ratio_geomean": 1.0021649530223589, + "upper95": 1.0090331360906117, + "lower95": 0.9953435195968797, + "log_sd": 0.02278720622803134, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 17791.65, + "cand_mean_ns_median": 17778.199999999997, + "base_metric_median": 17791.65, + "cand_metric_median": 17778.199999999997, + "base_p50_ns": 18062.0, + "cand_p50_ns": 18154.0, + "base_p99_ns": 29233.5, + "cand_p99_ns": 28955.5, + "base_allocs_per_op": 208.995, + "cand_allocs_per_op": 208.99, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 50684 + }, + { + "campaign": "wasi", + "pair": "B:H", + "workload": "wasi_committed_scan", + "blocks": 32, + "ratio_geomean": 0.9938072828512112, + "upper95": 0.9983664081665229, + "lower95": 0.9892689771703249, + "log_sd": 0.015270648023149695, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 4008200.65, + "cand_mean_ns_median": 3990149.2, + "base_metric_median": 4008200.65, + "cand_metric_median": 3990149.2, + "base_p50_ns": 3986505.5, + "cand_p50_ns": 3972311.0, + "base_p99_ns": 4183370.5, + "cand_p99_ns": 4233772.5, + "base_allocs_per_op": 34030.0, + "cand_allocs_per_op": 34030.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 231 + }, + { + "campaign": "wasi", + "pair": "B:H", + "workload": "wasi_pending_pt_av", + "blocks": 32, + "ratio_geomean": 1.0000261159624728, + "upper95": 1.00233997087966, + "lower95": 0.9977176024710827, + "log_sd": 0.007710725030937643, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 2305855.8, + "cand_mean_ns_median": 2305695.7, + "base_metric_median": 2305855.8, + "cand_metric_median": 2305695.7, + "base_p50_ns": 2299936.5, + "cand_p50_ns": 2298078.0, + "base_p99_ns": 2394942.0, + "cand_p99_ns": 2443001.5, + "base_allocs_per_op": 35103.009999999995, + "cand_allocs_per_op": 35103.02, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 425 + }, + { + "campaign": "wasi", + "pair": "B:H", + "workload": "wasi_pending_pt_ea", + "blocks": 32, + "ratio_geomean": 0.9923982294519678, + "upper95": 1.0013874445382878, + "lower95": 0.9834897083950256, + "log_sd": 0.030084903534046508, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 8873.25, + "cand_mean_ns_median": 8743.05, + "base_metric_median": 8873.25, + "cand_metric_median": 8743.05, + "base_p50_ns": 9607.0, + "cand_p50_ns": 9467.0, + "base_p99_ns": 12021.5, + "cand_p99_ns": 11854.5, + "base_allocs_per_op": 77.22, + "cand_allocs_per_op": 77.22, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 100653 + }, + { + "campaign": "wasi", + "pair": "B:H", + "workload": "wasi_pending_scan", + "blocks": 32, + "ratio_geomean": 1.005177767909251, + "upper95": 1.0105224973908513, + "lower95": 0.999861307103811, + "log_sd": 0.017693069082203607, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 4443464.550000001, + "cand_mean_ns_median": 4454651.199999999, + "base_metric_median": 4443464.550000001, + "cand_metric_median": 4454651.199999999, + "base_p50_ns": 4425839.0, + "cand_p50_ns": 4445678.0, + "base_p99_ns": 4656610.0, + "cand_p99_ns": 4721459.0, + "base_allocs_per_op": 45243.0, + "cand_allocs_per_op": 45243.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 219 + }, + { + "campaign": "wasi", + "pair": "B:P", + "workload": "wasi_committed_con_direct", + "blocks": 32, + "ratio_geomean": 1.1185051644234723, + "upper95": 1.1300672852776779, + "lower95": 1.1070613397454225, + "log_sd": 0.03431127262860933, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 193.10000000000002, + "cand_mean_ns_median": 215.3, + "base_metric_median": 193.10000000000002, + "cand_metric_median": 215.3, + "base_p50_ns": 191.5, + "cand_p50_ns": 212.0, + "base_p99_ns": 212.0, + "cand_p99_ns": 235.0, + "base_allocs_per_op": 1.0, + "cand_allocs_per_op": 2.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 1831294 + }, + { + "campaign": "wasi", + "pair": "B:P", + "workload": "wasi_committed_join_2", + "blocks": 32, + "ratio_geomean": 0.9935610493020229, + "upper95": 1.001511107707746, + "lower95": 0.9856740989618697, + "log_sd": 0.026589880770671797, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 43143.899999999994, + "cand_mean_ns_median": 43071.149999999994, + "base_metric_median": 43143.899999999994, + "cand_metric_median": 43071.149999999994, + "base_p50_ns": 42677.0, + "cand_p50_ns": 42507.5, + "base_p99_ns": 50055.0, + "cand_p99_ns": 49318.0, + "base_allocs_per_op": 532.0, + "cand_allocs_per_op": 532.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 20760 + }, + { + "campaign": "wasi", + "pair": "B:P", + "workload": "wasi_committed_pt_av", + "blocks": 32, + "ratio_geomean": 0.9844444262736274, + "upper95": 0.9940226361391731, + "lower95": 0.9749585101858016, + "log_sd": 0.03230437154666988, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 20822.45, + "cand_mean_ns_median": 20660.25, + "base_metric_median": 20822.45, + "cand_metric_median": 20660.25, + "base_p50_ns": 20003.5, + "cand_p50_ns": 19749.0, + "base_p99_ns": 28829.0, + "cand_p99_ns": 28273.0, + "base_allocs_per_op": 254.23, + "cand_allocs_per_op": 254.23, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 42579 + }, + { + "campaign": "wasi", + "pair": "B:P", + "workload": "wasi_committed_pt_ea", + "blocks": 32, + "ratio_geomean": 0.9955528693396765, + "upper95": 1.0048345859475851, + "lower95": 0.9863568884980266, + "log_sd": 0.030961334988752892, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 17832.75, + "cand_mean_ns_median": 17737.85, + "base_metric_median": 17832.75, + "cand_metric_median": 17737.85, + "base_p50_ns": 18050.0, + "cand_p50_ns": 18208.0, + "base_p99_ns": 28918.0, + "cand_p99_ns": 28635.5, + "base_allocs_per_op": 208.99, + "cand_allocs_per_op": 208.99, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 50101 + }, + { + "campaign": "wasi", + "pair": "B:P", + "workload": "wasi_committed_scan", + "blocks": 32, + "ratio_geomean": 0.9930664921324246, + "upper95": 0.9985365871189111, + "lower95": 0.9876263629374246, + "log_sd": 0.018327175998009773, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 4010476.95, + "cand_mean_ns_median": 3992315.95, + "base_metric_median": 4010476.95, + "cand_metric_median": 3992315.95, + "base_p50_ns": 3991959.0, + "cand_p50_ns": 3967182.0, + "base_p99_ns": 4239511.0, + "cand_p99_ns": 4234810.5, + "base_allocs_per_op": 34030.0, + "cand_allocs_per_op": 34030.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 233 + }, + { + "campaign": "wasi", + "pair": "B:P", + "workload": "wasi_pending_pt_av", + "blocks": 32, + "ratio_geomean": 0.9963615543365427, + "upper95": 1.0015794985234652, + "lower95": 0.9911707941540633, + "log_sd": 0.0174268994666647, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 2307227.55, + "cand_mean_ns_median": 2289418.5, + "base_metric_median": 2307227.55, + "cand_metric_median": 2289418.5, + "base_p50_ns": 2294288.5, + "cand_p50_ns": 2286704.5, + "base_p99_ns": 2436091.0, + "cand_p99_ns": 2413597.5, + "base_allocs_per_op": 35103.0, + "cand_allocs_per_op": 35103.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 410 + }, + { + "campaign": "wasi", + "pair": "B:P", + "workload": "wasi_pending_pt_ea", + "blocks": 32, + "ratio_geomean": 0.9896830060874341, + "upper95": 1.0031887090329281, + "lower95": 0.9763591273694352, + "log_sd": 0.045221699376814646, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 8863.4, + "cand_mean_ns_median": 8788.0, + "base_metric_median": 8863.4, + "cand_metric_median": 8788.0, + "base_p50_ns": 9599.5, + "cand_p50_ns": 9429.0, + "base_p99_ns": 11938.0, + "cand_p99_ns": 11816.5, + "base_allocs_per_op": 77.22, + "cand_allocs_per_op": 77.22, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 98124 + }, + { + "campaign": "wasi", + "pair": "B:P", + "workload": "wasi_pending_scan", + "blocks": 32, + "ratio_geomean": 0.9920040614006693, + "upper95": 0.9982468909702812, + "lower95": 0.9858002731958619, + "log_sd": 0.02093039586366256, + "digest_or_row_mismatches": 0, + "base_mean_ns_median": 4445031.1, + "cand_mean_ns_median": 4410443.95, + "base_metric_median": 4445031.1, + "cand_metric_median": 4410443.95, + "base_p50_ns": 4425609.5, + "cand_p50_ns": 4393544.5, + "base_p99_ns": 4648340.0, + "cand_p99_ns": 4616716.5, + "base_allocs_per_op": 45243.0, + "cand_allocs_per_op": 45243.0, + "base_rss_kb": 0.0, + "cand_rss_kb": 0.0, + "ops_per_block_min": 210 + } +] diff --git a/docs/audits/797/evidence/tables.md b/docs/audits/797/evidence/tables.md new file mode 100644 index 0000000000..ad807e1b9e --- /dev/null +++ b/docs/audits/797/evidence/tables.md @@ -0,0 +1,174 @@ +Means, deltas and percentiles are medians over blocks, in ns. Δ is the candidate's median block mean minus the base's (for `cc_*`, wall ns per operation). Allocations and RSS are n/a where the harness cannot measure them: browser (both) and WASI (RSS). + +### primary-1-envelope + +Workload | Pair | Blocks | Ratio | 95% upper | Gate | Verdict | Validation | Base mean | Cand mean | Δ | Base p50/p99 | Cand p50/p99 | Allocs/op B→C | RSS KiB B→C +---|---|---:|---:|---:|---:|---|---|---:|---:|---:|---:|---:|---:|---: +pt_asof | B:B | 128 | 1.0006 | 1.0046 | ±2% control | resolves ±2% | digest of complete results; timed reads row counts | 14,192.0 | 14,223.8 | +31.8 | 15,327/24,458 | 15,298/24,492 | 212.1→212.1 | 5,816→5,828 +pt_asof | B:H | 128 | 1.0130 | 1.0179 | 1.02 | pass | digest of complete results; timed reads row counts | 14,234.0 | 14,501.5 | +267.5 | 15,382/24,510 | 15,560/24,838 | 212.1→212.1 | 5,824→5,780 +pt_asof | B:P | 128 | 0.9951 | 0.9998 | 1.02 | pass | digest of complete results; timed reads row counts | 14,262.9 | 14,222.4 | -40.5 | 15,358/24,515 | 15,282/24,508 | 212.1→212.1 | 5,832→5,780 +pt_av | B:B | 128 | 1.0009 | 1.0050 | ±2% control | resolves ±2% | digest of complete results; timed reads row counts | 16,835.4 | 16,838.4 | +3.0 | 16,317/22,888 | 16,292/23,204 | 254.2→254.2 | 5,670→5,696 +pt_av | B:H | 128 | 1.0130 | 1.0172 | 1.02 | pass | digest of complete results; timed reads row counts | 16,904.3 | 17,168.7 | +264.4 | 16,342/23,210 | 16,524/23,632 | 254.2→254.2 | 5,704→5,652 +pt_av | B:P | 128 | 0.9994 | 1.0039 | 1.02 | pass | digest of complete results; timed reads row counts | 16,903.6 | 16,866.7 | -36.9 | 16,382/23,122 | 16,307/23,300 | 254.2→254.2 | 5,708→5,644 +pt_ea | B:B | 128 | 0.9999 | 1.0039 | ±2% control | resolves ±2% | digest of complete results; timed reads row counts | 14,183.4 | 14,155.5 | -27.9 | 15,814/24,283 | 15,786/24,232 | 202.3→202.3 | 5,782→5,800 +pt_ea | B:H | 128 | 1.0112 | 1.0155 | 1.02 | pass | digest of complete results; timed reads row counts | 14,208.1 | 14,391.0 | +182.8 | 15,830/24,297 | 15,972/24,600 | 202.3→202.3 | 5,810→5,760 +pt_ea | B:P | 128 | 0.9928 | 0.9971 | 1.02 | pass | digest of complete results; timed reads row counts | 14,235.8 | 14,135.4 | -100.4 | 15,850/24,314 | 15,728/24,171 | 202.3→202.3 | 5,816→5,760 + +### primary-1-release + +Workload | Pair | Blocks | Ratio | 95% upper | Gate | Verdict | Validation | Base mean | Cand mean | Δ | Base p50/p99 | Cand p50/p99 | Allocs/op B→C | RSS KiB B→C +---|---|---:|---:|---:|---:|---|---|---:|---:|---:|---:|---:|---:|---: +pt_asof | B:B | 128 | 1.0003 | 1.0043 | ±2% control | resolves ±2% | digest of complete results; timed reads row counts | 22,777.0 | 22,791.4 | +14.5 | 24,656/39,083 | 24,639/39,066 | 212.1→212.1 | 4,848→4,840 +pt_asof | B:H | 128 | 1.0012 | 1.0049 | 1.02 | pass | digest of complete results; timed reads row counts | 22,829.3 | 22,865.2 | +36.0 | 24,672/39,250 | 24,610/39,620 | 212.1→212.1 | 4,844→4,830 +pt_asof | B:P | 128 | 1.0081 | 1.0128 | 1.02 | pass | digest of complete results; timed reads row counts | 22,763.5 | 22,912.3 | +148.8 | 24,614/39,035 | 24,554/39,316 | 212.1→212.1 | 4,844→4,830 +pt_av | B:B | 128 | 1.0027 | 1.0070 | ±2% control | resolves ±2% | digest of complete results; timed reads row counts | 26,365.5 | 26,408.2 | +42.8 | 25,538/33,681 | 25,564/33,894 | 254.2→254.2 | 4,770→4,768 +pt_av | B:H | 128 | 1.0017 | 1.0058 | 1.02 | pass | digest of complete results; timed reads row counts | 26,446.3 | 26,479.8 | +33.4 | 25,634/33,760 | 25,798/34,066 | 254.2→254.2 | 4,768→4,756 +pt_av | B:P | 128 | 1.0104 | 1.0161 | 1.02 | pass | digest of complete results; timed reads row counts | 26,423.9 | 26,680.4 | +256.5 | 25,620/33,880 | 25,829/34,538 | 254.2→254.2 | 4,764→4,754 +pt_ea | B:B | 128 | 0.9994 | 1.0032 | ±2% control | resolves ±2% | digest of complete results; timed reads row counts | 22,510.2 | 22,516.5 | +6.3 | 24,816/38,710 | 24,816/38,676 | 202.3→202.3 | 4,832→4,828 +pt_ea | B:H | 128 | 1.0033 | 1.0067 | 1.02 | pass | digest of complete results; timed reads row counts | 22,497.6 | 22,590.3 | +92.8 | 24,782/38,757 | 24,856/39,074 | 202.3→202.3 | 4,832→4,816 +pt_ea | B:P | 128 | 1.0099 | 1.0147 | 1.02 | pass | digest of complete results; timed reads row counts | 22,502.9 | 22,732.2 | +229.3 | 24,797/38,778 | 24,869/39,330 | 202.3→202.3 | 4,824→4,820 + +### primary-2-envelope + +Workload | Pair | Blocks | Ratio | 95% upper | Gate | Verdict | Validation | Base mean | Cand mean | Δ | Base p50/p99 | Cand p50/p99 | Allocs/op B→C | RSS KiB B→C +---|---|---:|---:|---:|---:|---|---|---:|---:|---:|---:|---:|---:|---: +pt_asof | B:B | 128 | 0.9979 | 1.0021 | ±2% control | resolves ±2% | digest of complete results; timed reads row counts | 14,192.0 | 14,191.2 | -0.8 | 15,328/24,490 | 15,334/24,418 | 212.1→212.1 | 5,786→5,822 +pt_asof | B:H | 128 | 1.0221 | 1.0260 | 1.02 | FAIL | digest of complete results; timed reads row counts | 14,178.0 | 14,478.4 | +300.3 | 15,310/24,464 | 15,578/24,822 | 212.1→212.1 | 5,820→5,780 +pt_asof | B:P | 128 | 0.9935 | 0.9979 | 1.02 | pass | digest of complete results; timed reads row counts | 14,219.5 | 14,103.2 | -116.3 | 15,359/24,532 | 15,198/24,249 | 212.1→212.1 | 5,832→5,792 +pt_av | B:B | 128 | 0.9985 | 1.0022 | ±2% control | resolves ±2% | digest of complete results; timed reads row counts | 16,867.2 | 16,852.6 | -14.6 | 16,285/22,886 | 16,298/22,930 | 254.2→254.2 | 5,660→5,698 +pt_av | B:H | 128 | 1.0211 | 1.0245 | 1.02 | FAIL | digest of complete results; timed reads row counts | 16,839.9 | 17,174.7 | +334.8 | 16,309/23,274 | 16,593/23,349 | 254.2→254.2 | 5,690→5,652 +pt_av | B:P | 128 | 1.0016 | 1.0055 | 1.02 | pass | digest of complete results; timed reads row counts | 16,876.4 | 16,866.3 | -10.1 | 16,328/23,033 | 16,296/22,850 | 254.2→254.2 | 5,700→5,652 +pt_ea | B:B | 128 | 0.9979 | 1.0014 | ±2% control | resolves ±2% | digest of complete results; timed reads row counts | 14,187.3 | 14,174.9 | -12.4 | 15,798/24,266 | 15,796/24,247 | 202.3→202.3 | 5,768→5,806 +pt_ea | B:H | 128 | 1.0167 | 1.0199 | 1.02 | pass | digest of complete results; timed reads row counts | 14,164.4 | 14,373.9 | +209.5 | 15,814/24,222 | 15,939/24,568 | 202.3→202.3 | 5,804→5,762 +pt_ea | B:P | 128 | 0.9940 | 0.9978 | 1.02 | pass | digest of complete results; timed reads row counts | 14,181.0 | 14,096.2 | -84.8 | 15,839/24,242 | 15,684/24,074 | 202.3→202.3 | 5,810→5,772 + +### primary-2-release + +Workload | Pair | Blocks | Ratio | 95% upper | Gate | Verdict | Validation | Base mean | Cand mean | Δ | Base p50/p99 | Cand p50/p99 | Allocs/op B→C | RSS KiB B→C +---|---|---:|---:|---:|---:|---|---|---:|---:|---:|---:|---:|---:|---: +pt_asof | B:B | 128 | 0.9966 | 1.0007 | ±2% control | resolves ±2% | digest of complete results; timed reads row counts | 22,862.3 | 22,822.8 | -39.5 | 24,647/39,362 | 24,616/39,280 | 212.1→212.1 | 4,838→4,846 +pt_asof | B:H | 128 | 1.0008 | 1.0044 | 1.02 | pass | digest of complete results; timed reads row counts | 22,735.6 | 22,791.6 | +56.0 | 24,620/39,029 | 24,616/39,330 | 212.1→212.1 | 4,844→4,840 +pt_asof | B:P | 128 | 1.0024 | 1.0062 | 1.02 | pass | digest of complete results; timed reads row counts | 22,748.3 | 22,798.2 | +49.8 | 24,606/39,024 | 24,434/39,130 | 212.1→212.1 | 4,844→4,836 +pt_av | B:B | 128 | 0.9975 | 1.0017 | ±2% control | resolves ±2% | digest of complete results; timed reads row counts | 26,427.2 | 26,385.5 | -41.7 | 25,598/33,943 | 25,546/33,630 | 254.2→254.2 | 4,768→4,776 +pt_av | B:H | 128 | 1.0034 | 1.0071 | 1.02 | pass | digest of complete results; timed reads row counts | 26,410.8 | 26,448.5 | +37.7 | 25,534/33,848 | 25,700/33,911 | 254.2→254.2 | 4,768→4,764 +pt_av | B:P | 128 | 1.0062 | 1.0099 | 1.02 | pass | digest of complete results; timed reads row counts | 26,432.8 | 26,568.2 | +135.4 | 25,618/33,700 | 25,694/34,134 | 254.2→254.2 | 4,768→4,762 +pt_ea | B:B | 128 | 0.9969 | 1.0003 | ±2% control | resolves ±2% | digest of complete results; timed reads row counts | 22,517.8 | 22,475.4 | -42.3 | 24,803/38,734 | 24,764/38,660 | 202.3→202.3 | 4,828→4,836 +pt_ea | B:H | 128 | 1.0060 | 1.0092 | 1.02 | pass | digest of complete results; timed reads row counts | 22,478.0 | 22,615.0 | +136.9 | 24,778/38,654 | 24,867/39,048 | 202.3→202.3 | 4,832→4,824 +pt_ea | B:P | 128 | 1.0053 | 1.0088 | 1.02 | pass | digest of complete results; timed reads row counts | 22,506.4 | 22,595.7 | +89.3 | 24,791/38,644 | 24,760/38,942 | 202.3→202.3 | 4,828→4,820 + +### browser + +Workload | Pair | Blocks | Ratio | 95% upper | Gate | Verdict | Validation | Base mean | Cand mean | Δ | Base p50/p99 | Cand p50/p99 | Allocs/op B→C | RSS KiB B→C +---|---|---:|---:|---:|---:|---|---|---:|---:|---:|---:|---:|---:|---: +br_join_2 | B:H | 32 | 1.0057 | 1.0170 | 1.05 | pass | digest of complete results; timed reads row counts | 125,519.5 | 125,131.6 | -387.9 | 122,565/158,450 | 122,495/158,680 | n/a | n/a +br_join_2 | B:P | 32 | 1.0071 | 1.0163 | 1.05 | pass | digest of complete results; timed reads row counts | 126,118.0 | 125,911.2 | -206.8 | 122,830/160,203 | 123,144/158,972 | n/a | n/a +br_pt_av | B:H | 32 | 1.0073 | 1.0165 | 1.05 | pass | digest of complete results; timed reads row counts | 57,908.8 | 57,822.2 | -86.6 | 59,818/82,424 | 60,089/81,006 | n/a | n/a +br_pt_av | B:P | 32 | 0.9950 | 1.0009 | 1.05 | pass | digest of complete results; timed reads row counts | 57,902.4 | 57,724.4 | -178.0 | 60,079/81,252 | 59,949/83,507 | n/a | n/a +br_pt_ea | B:H | 32 | 1.0014 | 1.0137 | 1.05 | pass | digest of complete results; timed reads row counts | 63,835.2 | 63,740.6 | -94.5 | 68,956/114,662 | 68,866/112,288 | n/a | n/a +br_pt_ea | B:P | 32 | 0.9927 | 1.0005 | 1.05 | pass | digest of complete results; timed reads row counts | 63,846.8 | 63,659.4 | -187.4 | 69,262/114,332 | 68,882/111,406 | n/a | n/a +br_scan | B:H | 32 | 1.0042 | 1.0097 | 1.05 | pass | digest of complete results; timed reads row counts | 10,749,238.4 | 10,762,806.3 | +13,567.9 | 10,662,459/11,854,526 | 10,669,662/11,352,730 | n/a | n/a +br_scan | B:P | 32 | 1.0012 | 1.0052 | 1.05 | pass | digest of complete results; timed reads row counts | 10,726,368.8 | 10,743,174.4 | +16,805.6 | 10,657,691/11,367,877 | 10,632,954/11,823,376 | n/a | n/a + +### cold + +Workload | Pair | Blocks | Ratio | 95% upper | Gate | Verdict | Validation | Base mean | Cand mean | Δ | Base p50/p99 | Cand p50/p99 | Allocs/op B→C | RSS KiB B→C +---|---|---:|---:|---:|---:|---|---|---:|---:|---:|---:|---:|---:|---: +cold_point (pages resident after eviction, per observation: median 1.1, worst process 147.8, of 2628) | B:H | 48 | 0.9897 | 1.0265 | 1.05 | bound ≤ 1.05; category outstanding: residency ≠ 0 | digest of a warm run; cold reads row counts only | 321,312.2 | 320,678.8 | -633.4 | 317,705/364,696 | 317,348/358,365 | 300.0→300.0 | 4,970→4,952 +cold_point (pages resident after eviction, per observation: median 1.1, worst process 16.4, of 2628) | B:P | 48 | 1.0085 | 1.0466 | 1.05 | bound ≤ 1.05; category outstanding: residency ≠ 0 | digest of a warm run; cold reads row counts only | 320,954.1 | 321,832.8 | +878.7 | 318,841/359,682 | 319,636/359,988 | 300.0→300.0 | 4,988→4,940 +cold_scan (pages resident after eviction, per observation: median 7.9, worst process 8.1, of 2628) | B:H | 48 | 1.0076 | 1.0148 | 1.05 | bound ≤ 1.05; category outstanding: residency ≠ 0 | digest of a warm run; cold reads row counts only | 12,984,385.4 | 13,087,053.6 | +102,668.1 | 12,909,324/14,579,688 | 12,917,524/14,619,511 | 112496.1→112496.1 | 6,426→6,416 +cold_scan (pages resident after eviction, per observation: median 7.9, worst process 8.1, of 2628) | B:P | 48 | 0.9874 | 0.9951 | 1.05 | bound ≤ 1.05; category outstanding: residency ≠ 0 | digest of a warm run; cold reads row counts only | 12,992,931.9 | 12,829,694.2 | -163,237.7 | 12,865,788/14,909,494 | 12,829,400/14,265,158 | 112496.1→112496.1 | 6,424→6,398 + +### concurrency + +Workload | Pair | Blocks | Ratio | 95% upper | Gate | Verdict | Validation | Base mean | Cand mean | Δ | Base p50/p99 | Cand p50/p99 | Allocs/op B→C | RSS KiB B→C +---|---|---:|---:|---:|---:|---|---|---:|---:|---:|---:|---:|---:|---: +cc_1 | B:H | 48 | 0.9959 | 1.0028 | 1.05 | bound ≤ 1.05; not fully accepted: results not digested | row counts only | 17,456.2 | 17,416.7 | -39.5 | 19,714/28,076 | 19,576/27,936 | 211.3→211.3 | 7,040→7,040 +cc_1 | B:P | 48 | 1.0047 | 1.0106 | 1.05 | bound ≤ 1.05; not fully accepted: results not digested | row counts only | 17,414.2 | 17,535.8 | +121.6 | 19,670/28,040 | 19,846/28,064 | 211.3→211.3 | 7,010→6,974 +cc_44 | B:H | 48 | 1.0342 | 1.0465 | 1.05 | bound ≤ 1.05; not fully accepted: results not digested | row counts only | 7,683.4 | 7,984.4 | +300.9 | 347,765/669,378 | 359,740/682,662 | 210.6→210.6 | 19,068→19,296 +cc_44 | B:P | 48 | 0.9941 | 1.0068 | 1.05 | bound ≤ 1.05; not fully accepted: results not digested | row counts only | 7,741.9 | 7,641.2 | -100.7 | 347,871/664,409 | 342,718/673,365 | 210.6→210.6 | 19,262→19,248 +cc_8 | B:H | 48 | 1.0097 | 1.0210 | 1.05 | bound ≤ 1.05; not fully accepted: results not digested | row counts only | 10,960.9 | 11,067.0 | +106.1 | 93,986/147,632 | 93,946/148,802 | 210.7→210.7 | 11,844→11,784 +cc_8 | B:P | 48 | 0.9988 | 1.0104 | 1.05 | bound ≤ 1.05; not fully accepted: results not digested | row counts only | 10,925.5 | 10,899.3 | -26.2 | 95,163/145,100 | 92,550/149,636 | 210.7→210.7 | 11,850→11,894 + +### secondary + +Workload | Pair | Blocks | Ratio | 95% upper | Gate | Verdict | Validation | Base mean | Cand mean | Δ | Base p50/p99 | Cand p50/p99 | Allocs/op B→C | RSS KiB B→C +---|---|---:|---:|---:|---:|---|---|---:|---:|---:|---:|---:|---:|---: +con_checkpoint | B:H | 48 | 0.9941 | 1.0052 | 1.05 | pass | none (no result) | 631,270.1 | 620,908.6 | -10,361.5 | 613,404/964,533 | 609,314/960,965 | 1672.7→1672.6 | 66,180→66,244 +con_checkpoint | B:P | 48 | 1.0015 | 1.0133 | 1.05 | pass | none (no result) | 629,057.7 | 629,841.2 | +783.6 | 611,758/961,767 | 612,601/963,720 | 1672.6→1673.8 | 66,820→60,566 +con_direct | B:H | 48 | 1.0056 | 1.0183 | 1.05 | pass | none (no result) | 97.8 | 97.1 | -0.7 | 96/103 | 94/103 | 1.0→1.0 | 66,936→67,134 +con_direct | B:P | 48 | 1.1663 | 1.1744 | 1.05 | FAIL | none (no result) | 97.5 | 114.0 | +16.5 | 96/103 | 114/118 | 1.0→2.0 | 67,118→61,480 +con_large_tx | B:H | 48 | 0.9963 | 1.0015 | 1.05 | pass | digest of complete results; timed reads row counts | 20,870.3 | 20,845.7 | -24.7 | 20,592/25,496 | 20,560/25,821 | 284.0→284.0 | 66,180→66,244 +con_large_tx | B:P | 48 | 1.0095 | 1.0161 | 1.05 | pass | digest of complete results; timed reads row counts | 20,813.3 | 21,034.2 | +220.8 | 20,542/25,888 | 20,800/25,734 | 284.0→285.0 | 66,820→60,566 +con_open | B:H | 48 | 0.9978 | 1.0015 | 1.05 | pass | none (no result) | 26,038.7 | 25,903.0 | -135.7 | 25,666/30,732 | 25,498/31,048 | 64.0→64.0 | 14,830→14,428 +con_open | B:P | 48 | 1.0035 | 1.0075 | 1.05 | pass | none (no result) | 25,781.2 | 25,915.0 | +133.8 | 25,446/31,372 | 25,584/30,579 | 64.0→65.0 | 14,794→14,172 +cw_long | B:H | 48 | 0.9960 | 0.9994 | 1.05 | pass | digest of complete results; timed reads row counts | 11,879,403.2 | 11,824,931.1 | -54,472.1 | 11,804,306/13,217,290 | 11,792,790/13,284,318 | 112171.0→112171.0 | 14,830→14,428 +cw_long | B:P | 48 | 0.9945 | 0.9987 | 1.05 | pass | digest of complete results; timed reads row counts | 11,875,157.4 | 11,838,938.2 | -36,219.3 | 11,810,476/13,175,814 | 11,776,852/12,960,986 | 112171.0→112171.0 | 14,794→14,172 +fl_paged | B:H | 48 | 0.9880 | 0.9909 | 1.05 | pass | digest of complete results; timed reads row counts | 22,703,569.7 | 22,469,659.6 | -233,910.1 | 22,579,422/24,009,678 | 22,370,454/23,888,775 | 483666.0→483666.0 | 14,830→14,428 +fl_paged | B:P | 48 | 0.9841 | 0.9885 | 1.05 | pass | digest of complete results; timed reads row counts | 22,716,849.8 | 22,357,293.1 | -359,556.8 | 22,584,410/24,400,652 | 22,207,456/23,874,188 | 483666.0→483666.0 | 14,794→14,172 +nc_point | B:H | 48 | 1.0026 | 1.0074 | 1.05 | pass | digest of complete results; timed reads row counts | 24,790.5 | 24,826.9 | +36.4 | 28,153/36,584 | 28,326/37,166 | 212.0→212.0 | 14,830→14,428 +nc_point | B:P | 48 | 1.0081 | 1.0137 | 1.05 | pass | digest of complete results; timed reads row counts | 24,789.8 | 25,037.5 | +247.7 | 28,166/37,189 | 28,408/37,156 | 212.0→212.0 | 14,794→14,172 +nc_scan | B:H | 48 | 0.9951 | 0.9990 | 1.05 | pass | digest of complete results; timed reads row counts | 12,689,756.4 | 12,672,949.9 | -16,806.4 | 12,623,336/14,076,314 | 12,598,568/13,885,363 | 112701.0→112701.0 | 14,830→14,428 +nc_scan | B:P | 48 | 0.9952 | 0.9989 | 1.05 | pass | digest of complete results; timed reads row counts | 12,713,403.9 | 12,654,989.2 | -58,414.7 | 12,618,898/14,029,561 | 12,581,154/14,024,658 | 112701.0→112701.0 | 14,794→14,172 +sc_dense_uuid | B:H | 48 | 0.9958 | 1.0003 | 1.05 | pass | digest of complete results; timed reads row counts | 11,487,511.9 | 11,450,242.1 | -37,269.8 | 11,426,982/12,923,934 | 11,396,480/12,913,895 | 112016.0→112016.0 | 14,830→14,428 +sc_dense_uuid | B:P | 48 | 0.9999 | 1.0039 | 1.05 | pass | digest of complete results; timed reads row counts | 11,486,807.8 | 11,494,298.9 | +7,491.0 | 11,419,483/13,024,490 | 11,434,132/12,806,693 | 112016.0→112016.0 | 14,794→14,172 +sc_long_history | B:H | 48 | 0.9951 | 0.9996 | 1.05 | pass | digest of complete results; timed reads row counts | 249,671.3 | 248,602.0 | -1,069.4 | 247,394/271,320 | 246,849/267,436 | 3260.0→3260.0 | 14,830→14,428 +sc_long_history | B:P | 48 | 1.0025 | 1.0077 | 1.05 | pass | digest of complete results; timed reads row counts | 249,798.2 | 251,703.5 | +1,905.3 | 247,920/273,116 | 249,092/271,534 | 3260.0→3260.0 | 14,794→14,172 +sc_short | B:H | 48 | 0.9953 | 0.9997 | 1.05 | pass | digest of complete results; timed reads row counts | 11,986,978.4 | 11,944,553.8 | -42,424.6 | 11,920,102/13,434,857 | 11,890,838/13,481,144 | 112021.0→112021.0 | 14,830→14,428 +sc_short | B:P | 48 | 0.9961 | 0.9998 | 1.05 | pass | digest of complete results; timed reads row counts | 11,994,266.2 | 11,936,334.1 | -57,932.1 | 11,903,360/13,278,074 | 11,879,789/13,281,634 | 112021.0→112021.0 | 14,794→14,172 +sc_sparse_uuid | B:H | 48 | 0.9921 | 0.9957 | 1.05 | pass | digest of complete results; timed reads row counts | 260,970.0 | 258,895.0 | -2,075.0 | 259,164/282,146 | 257,662/275,966 | 5024.0→5024.0 | 14,830→14,428 +sc_sparse_uuid | B:P | 48 | 0.9942 | 0.9983 | 1.05 | pass | digest of complete results; timed reads row counts | 261,261.2 | 260,373.8 | -887.5 | 258,949/284,821 | 258,043/281,408 | 5024.0→5024.0 | 14,794→14,172 +sh_as_of | B:H | 48 | 1.0046 | 1.0100 | 1.05 | pass | digest of complete results; timed reads row counts | 20,131.7 | 20,228.7 | +97.0 | 19,918/25,226 | 19,984/25,763 | 285.0→285.0 | 12,882→12,404 +sh_as_of | B:P | 48 | 0.9982 | 1.0057 | 1.05 | pass | digest of complete results; timed reads row counts | 20,188.8 | 20,304.5 | +115.7 | 19,935/25,756 | 19,986/24,997 | 285.0→285.0 | 12,844→12,334 +sh_as_of_ts | B:H | 48 | 0.9983 | 1.0025 | 1.05 | pass | digest of complete results; timed reads row counts | 775,707.3 | 772,527.1 | -3,180.2 | 769,604/816,682 | 769,312/822,024 | 11877.0→11877.0 | 12,882→12,404 +sh_as_of_ts | B:P | 48 | 0.9973 | 1.0017 | 1.05 | pass | digest of complete results; timed reads row counts | 775,711.1 | 775,346.1 | -365.1 | 772,649/817,278 | 772,284/820,586 | 11877.0→11877.0 | 12,844→12,334 +sh_as_of_ts_scan | B:H | 48 | 0.9988 | 1.0029 | 1.05 | pass | digest of complete results; timed reads row counts | 7,626,128.0 | 7,628,113.3 | +1,985.3 | 7,580,550/7,901,030 | 7,588,714/7,811,623 | 76294.0→76294.0 | 12,882→12,404 +sh_as_of_ts_scan | B:P | 48 | 0.9984 | 1.0019 | 1.05 | pass | digest of complete results; timed reads row counts | 7,634,308.5 | 7,626,841.5 | -7,467.0 | 7,585,552/7,920,116 | 7,588,468/8,025,112 | 76294.0→76294.0 | 12,844→12,334 +sh_attribute_scan | B:H | 48 | 1.0022 | 1.0062 | 1.05 | pass | digest of complete results; timed reads row counts | 10,672,537.6 | 10,690,609.3 | +18,071.7 | 10,612,747/11,566,579 | 10,634,511/11,865,178 | 112021.0→112021.0 | 6,684→6,664 +sh_attribute_scan | B:P | 48 | 0.9979 | 1.0020 | 1.05 | pass | digest of complete results; timed reads row counts | 10,689,254.4 | 10,663,976.4 | -25,278.0 | 10,617,502/12,065,214 | 10,612,682/11,734,378 | 112021.0→112021.0 | 6,692→6,664 +sh_attribute_value | B:H | 48 | 1.0192 | 1.0262 | 1.05 | pass | digest of complete results; timed reads row counts | 15,999.9 | 16,272.9 | +273.0 | 15,786/20,515 | 16,088/21,332 | 270.0→270.0 | 5,416→5,374 +sh_attribute_value | B:P | 48 | 1.0048 | 1.0142 | 1.05 | pass | digest of complete results; timed reads row counts | 15,998.3 | 16,180.9 | +182.6 | 15,778/21,012 | 15,985/20,572 | 270.0→270.0 | 5,410→5,374 +sh_count | B:H | 48 | 0.9968 | 1.0026 | 1.05 | pass | digest of complete results; timed reads row counts | 41,068,304.3 | 41,006,882.3 | -61,422.0 | 40,912,169/42,866,036 | 40,831,575/42,457,291 | 477489.7→477489.7 | 12,882→12,404 +sh_count | B:P | 48 | 1.0005 | 1.0040 | 1.05 | pass | digest of complete results; timed reads row counts | 41,186,280.1 | 41,172,853.2 | -13,426.9 | 41,017,124/42,818,934 | 40,999,824/43,001,730 | 477489.7→477489.7 | 12,844→12,334 +sh_count_grouped | B:H | 48 | 0.9911 | 0.9961 | 1.05 | pass | digest of complete results; timed reads row counts | 6,041,161.9 | 5,989,567.4 | -51,594.5 | 5,996,008/6,417,956 | 5,952,320/6,326,556 | 75953.0→75953.0 | 12,882→12,404 +sh_count_grouped | B:P | 48 | 0.9914 | 0.9953 | 1.05 | pass | digest of complete results; timed reads row counts | 6,045,797.0 | 5,998,476.1 | -47,321.0 | 6,011,242/6,455,302 | 5,965,906/6,467,170 | 75953.0→75953.0 | 12,844→12,334 +sh_hot_as_of | B:H | 48 | 0.9989 | 1.0032 | 1.05 | pass | digest of complete results; timed reads row counts | 240,524.5 | 241,330.8 | +806.3 | 238,767/263,498 | 239,112/261,413 | 2778.0→2778.0 | 14,830→14,428 +sh_hot_as_of | B:P | 48 | 1.0052 | 1.0110 | 1.05 | pass | digest of complete results; timed reads row counts | 241,393.8 | 243,603.2 | +2,209.4 | 239,578/262,098 | 241,117/265,086 | 2778.0→2778.0 | 14,794→14,172 +sh_hot_current | B:H | 48 | 0.9982 | 1.0031 | 1.05 | pass | digest of complete results; timed reads row counts | 249,974.2 | 250,581.0 | +606.8 | 247,659/274,712 | 248,358/272,500 | 3267.0→3267.0 | 14,830→14,428 +sh_hot_current | B:P | 48 | 1.0040 | 1.0097 | 1.05 | pass | digest of complete results; timed reads row counts | 250,834.3 | 252,495.2 | +1,660.9 | 248,819/271,672 | 250,240/272,260 | 3267.0→3267.0 | 14,794→14,172 +sh_join_2 | B:H | 48 | 1.0125 | 1.0177 | 1.05 | pass | digest of complete results; timed reads row counts | 36,335.0 | 36,839.2 | +504.2 | 35,866/42,397 | 36,452/43,068 | 534.0→534.0 | 6,688→6,672 +sh_join_2 | B:P | 48 | 0.9984 | 1.0056 | 1.05 | pass | digest of complete results; timed reads row counts | 36,607.4 | 36,649.6 | +42.1 | 36,062/42,815 | 36,083/42,361 | 534.0→534.0 | 6,702→6,668 +sh_join_3_scan | B:H | 48 | 0.9925 | 0.9957 | 1.05 | pass | digest of complete results; timed reads row counts | 43,328,360.1 | 42,914,958.2 | -413,401.9 | 43,182,828/44,561,955 | 42,742,794/44,375,078 | 628334.0→628334.0 | 12,882→12,404 +sh_join_3_scan | B:P | 48 | 0.9953 | 1.0000 | 1.05 | pass | digest of complete results; timed reads row counts | 43,266,295.1 | 43,176,694.6 | -89,600.5 | 43,180,432/44,721,884 | 42,940,630/44,870,019 | 628334.0→628334.0 | 12,844→12,334 +sh_not_join_hash | B:H | 48 | 0.9994 | 1.0043 | 1.05 | pass | digest of complete results; timed reads row counts | 5,802,646.2 | 5,792,829.4 | -9,816.8 | 5,778,831/6,157,891 | 5,774,830/6,171,070 | 69282.8→69282.8 | 12,882→12,404 +sh_not_join_hash | B:P | 48 | 0.9958 | 0.9994 | 1.05 | pass | digest of complete results; timed reads row counts | 5,802,256.5 | 5,779,014.3 | -23,242.2 | 5,771,006/6,184,750 | 5,753,748/6,181,490 | 69282.8→69282.8 | 12,844→12,334 +sh_not_probe | B:H | 48 | 0.9990 | 1.0035 | 1.05 | pass | digest of complete results; timed reads row counts | 2,627,998.7 | 2,626,831.5 | -1,167.2 | 2,566,280/2,804,514 | 2,568,068/2,801,176 | 33879.6→33879.6 | 12,882→12,404 +sh_not_probe | B:P | 48 | 0.9974 | 1.0011 | 1.05 | pass | digest of complete results; timed reads row counts | 2,627,805.9 | 2,623,650.1 | -4,155.8 | 2,565,158/2,809,394 | 2,561,114/2,786,158 | 33879.6→33879.6 | 12,844→12,334 +sh_or_2 | B:H | 48 | 1.0001 | 1.0043 | 1.05 | pass | digest of complete results; timed reads row counts | 9,449,519.9 | 9,448,738.3 | -781.6 | 9,391,438/9,927,541 | 9,389,164/9,776,644 | 104895.7→104895.7 | 12,882→12,404 +sh_or_2 | B:P | 48 | 0.9958 | 0.9998 | 1.05 | pass | digest of complete results; timed reads row counts | 9,416,899.1 | 9,388,147.4 | -28,751.8 | 9,381,848/9,748,922 | 9,355,176/9,705,876 | 104895.7→104895.7 | 12,844→12,334 +sh_point_entity | B:H | 48 | 1.0131 | 1.0207 | 1.05 | pass | digest of complete results; timed reads row counts | 15,917.7 | 16,144.0 | +226.3 | 15,748/20,570 | 15,950/21,064 | 260.0→260.0 | 5,464→5,436 +sh_point_entity | B:P | 48 | 0.9959 | 1.0048 | 1.05 | pass | digest of complete results; timed reads row counts | 15,971.6 | 15,951.2 | -20.4 | 15,760/20,903 | 15,786/20,278 | 260.0→260.0 | 5,464→5,438 +sh_recursive_ancestors | B:H | 48 | 0.9981 | 1.0027 | 1.05 | pass | digest of complete results; timed reads row counts | 1,209,488.6 | 1,207,755.3 | -1,733.3 | 1,201,178/1,273,990 | 1,199,923/1,267,516 | 17734.0→17734.0 | 12,882→12,404 +sh_recursive_ancestors | B:P | 48 | 0.9974 | 1.0014 | 1.05 | pass | digest of complete results; timed reads row counts | 1,211,471.6 | 1,205,869.9 | -5,601.7 | 1,203,254/1,274,176 | 1,200,294/1,274,808 | 17734.0→17734.0 | 12,844→12,334 +sh_window | B:H | 48 | 0.9950 | 0.9996 | 1.05 | pass | digest of complete results; timed reads row counts | 36,824,513.0 | 36,766,100.4 | -58,412.7 | 36,725,990/38,143,838 | 36,557,236/37,981,422 | 561647.0→561647.0 | 14,830→14,428 +sh_window | B:P | 48 | 0.9928 | 0.9969 | 1.05 | pass | digest of complete results; timed reads row counts | 36,881,034.8 | 36,745,260.9 | -135,773.9 | 36,750,472/38,616,509 | 36,543,122/38,075,480 | 561647.0→561647.0 | 14,794→14,172 + +### wasi + +Workload | Pair | Blocks | Ratio | 95% upper | Gate | Verdict | Validation | Base mean | Cand mean | Δ | Base p50/p99 | Cand p50/p99 | Allocs/op B→C | RSS KiB B→C +---|---|---:|---:|---:|---:|---|---|---:|---:|---:|---:|---:|---:|---: +wasi_committed_con_direct | B:H | 32 | 0.9862 | 1.0007 | 1.05 | pass | none (no result) | 192.4 | 188.1 | -4.3 | 191/211 | 188/204 | 1.0→1.0 | n/a +wasi_committed_con_direct | B:P | 32 | 1.1185 | 1.1301 | 1.05 | FAIL | none (no result) | 193.1 | 215.3 | +22.2 | 192/212 | 212/235 | 1.0→2.0 | n/a +wasi_committed_join_2 | B:H | 32 | 0.9966 | 1.0010 | 1.05 | pass | digest of complete results; timed reads row counts | 43,240.9 | 43,219.1 | -21.8 | 42,688/50,068 | 42,668/49,647 | 532.0→532.0 | n/a +wasi_committed_join_2 | B:P | 32 | 0.9936 | 1.0015 | 1.05 | pass | digest of complete results; timed reads row counts | 43,143.9 | 43,071.1 | -72.8 | 42,677/50,055 | 42,508/49,318 | 532.0→532.0 | n/a +wasi_committed_pt_av | B:H | 32 | 1.0027 | 1.0079 | 1.05 | pass | digest of complete results; timed reads row counts | 20,859.2 | 21,039.4 | +180.2 | 20,036/28,792 | 20,124/28,571 | 254.2→254.2 | n/a +wasi_committed_pt_av | B:P | 32 | 0.9844 | 0.9940 | 1.05 | pass | digest of complete results; timed reads row counts | 20,822.5 | 20,660.2 | -162.2 | 20,004/28,829 | 19,749/28,273 | 254.2→254.2 | n/a +wasi_committed_pt_ea | B:H | 32 | 1.0022 | 1.0090 | 1.05 | pass | digest of complete results; timed reads row counts | 17,791.7 | 17,778.2 | -13.5 | 18,062/29,234 | 18,154/28,956 | 209.0→209.0 | n/a +wasi_committed_pt_ea | B:P | 32 | 0.9956 | 1.0048 | 1.05 | pass | digest of complete results; timed reads row counts | 17,832.8 | 17,737.8 | -94.9 | 18,050/28,918 | 18,208/28,636 | 209.0→209.0 | n/a +wasi_committed_scan | B:H | 32 | 0.9938 | 0.9984 | 1.05 | pass | digest of complete results; timed reads row counts | 4,008,200.6 | 3,990,149.2 | -18,051.4 | 3,986,506/4,183,370 | 3,972,311/4,233,772 | 34030.0→34030.0 | n/a +wasi_committed_scan | B:P | 32 | 0.9931 | 0.9985 | 1.05 | pass | digest of complete results; timed reads row counts | 4,010,477.0 | 3,992,316.0 | -18,161.0 | 3,991,959/4,239,511 | 3,967,182/4,234,810 | 34030.0→34030.0 | n/a +wasi_pending_pt_av | B:H | 32 | 1.0000 | 1.0023 | 1.05 | pass | digest of complete results; timed reads row counts | 2,305,855.8 | 2,305,695.7 | -160.1 | 2,299,936/2,394,942 | 2,298,078/2,443,002 | 35103.0→35103.0 | n/a +wasi_pending_pt_av | B:P | 32 | 0.9964 | 1.0016 | 1.05 | pass | digest of complete results; timed reads row counts | 2,307,227.5 | 2,289,418.5 | -17,809.0 | 2,294,288/2,436,091 | 2,286,704/2,413,598 | 35103.0→35103.0 | n/a +wasi_pending_pt_ea | B:H | 32 | 0.9924 | 1.0014 | 1.05 | pass | digest of complete results; timed reads row counts | 8,873.2 | 8,743.0 | -130.2 | 9,607/12,022 | 9,467/11,854 | 77.2→77.2 | n/a +wasi_pending_pt_ea | B:P | 32 | 0.9897 | 1.0032 | 1.05 | pass | digest of complete results; timed reads row counts | 8,863.4 | 8,788.0 | -75.4 | 9,600/11,938 | 9,429/11,816 | 77.2→77.2 | n/a +wasi_pending_scan | B:H | 32 | 1.0052 | 1.0105 | 1.05 | pass | digest of complete results; timed reads row counts | 4,443,464.6 | 4,454,651.2 | +11,186.6 | 4,425,839/4,656,610 | 4,445,678/4,721,459 | 45243.0→45243.0 | n/a +wasi_pending_scan | B:P | 32 | 0.9920 | 0.9982 | 1.05 | pass | digest of complete results; timed reads row counts | 4,445,031.1 | 4,410,444.0 | -34,587.1 | 4,425,610/4,648,340 | 4,393,544/4,616,716 | 45243.0→45243.0 | n/a diff --git a/docs/audits/797/gates.sh b/docs/audits/797/gates.sh new file mode 100644 index 0000000000..3fc97eee00 --- /dev/null +++ b/docs/audits/797/gates.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# Correctness gates of one variant (#797, AC 8-11), on the bench machine. +# Run from the variant's source root with the shared Cargo.lock in place. +# Usage: bash gates.sh OUTPUT_DIR TOOLS_DIR +# Every step runs; each one's exit status is recorded in status.tsv. +set -uo pipefail +out=${1:?output directory required} +tools=${2:?tools directory required} +mkdir -p "$out" +out=$(realpath "$out") +tools=$(realpath "$tools") +# The fault matrix and file tests write under TMPDIR: keep it on disk (ext4). +export TMPDIR="$out/tmp" +mkdir -p "$TMPDIR" +export CARGO_TERM_COLOR=never +git rev-parse HEAD > "$out/commit.txt" +sha256sum Cargo.lock > "$out/lock.sha256" +rustc -Vv > "$out/compiler.txt" +printf 'step\tstatus\n' > "$out/status.tsv" +step() { + local name=$1 + shift + "$@" > "$out/$name.log" 2>&1 + printf '%s\t%s\n' "$name" "$?" >> "$out/status.tsv" +} +step test-all-features cargo test --locked --all-features +step test-hooks cargo test --locked --features test-hooks +step clippy-ci cargo clippy --locked --all-features -- -D warnings +step clippy-all-targets cargo clippy --locked --all-targets -- -D warnings +step fmt cargo fmt --check +step msrv cargo +1.89.0 check --all-features --locked +step clippy-wasm-browser cargo clippy --locked --target wasm32-unknown-unknown --features browser -- -D warnings +step clippy-wasi cargo clippy --locked --target wasm32-wasip1 -- -D warnings +export PATH="$tools/wasmtime-v49.0.2-x86_64-linux:$tools/wasm-pack-v0.13.1-x86_64-unknown-linux-musl:$PATH" +step wasi-tests env CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime run --dir ." cargo test --locked --target wasm32-wasip1 --lib --tests +step browser-firefox wasm-pack test --headless --firefox --features browser +# #760 deterministic storage suite, in its own cfg build (PR settings). +shuttle() { + local target=target-shuttle + RUSTFLAGS="--cfg minigraf_shuttle" CARGO_TARGET_DIR=$target cargo test --locked --lib graph::storage::deterministic:: -- --list > "$out/shuttle-list.txt" 2>&1 || return 1 + test "$(grep -c '^graph::storage::deterministic::.*: test$' "$out/shuttle-list.txt")" -eq 3 || return 1 + RUSTFLAGS="--cfg minigraf_shuttle" CARGO_TARGET_DIR=$target MINIGRAF_DST_SEED=760 MINIGRAF_DST_ITERATIONS=1000 \ + cargo test --locked --lib graph::storage::deterministic:: -- --nocapture --test-threads=1 || return 1 +} +step shuttle shuttle +# Coverage gates (#396), CI's nightly and cargo-llvm-cov pins. +coverage() { + cargo build --examples --target-dir "$out/lock-examples" || return 1 + MINIGRAF_PID_NS_HELPER="$out/lock-examples/debug/examples/pid_ns_helper" \ + cargo +nightly-2026-10-01 llvm-cov --branch --no-report || return 1 + cargo +nightly-2026-10-01 llvm-cov report --branch --json --summary-only --output-path "$out/coverage.json" || return 1 + python3 scripts/coverage_gates.py coverage-thresholds.toml "$out/coverage.json" +} +step coverage coverage +rm -rf "$TMPDIR" "$out/lock-examples" +cat "$out/status.tsv" diff --git a/docs/audits/797/patches/entry-point-tests.patch b/docs/audits/797/patches/entry-point-tests.patch new file mode 100644 index 0000000000..e605810f46 --- /dev/null +++ b/docs/audits/797/patches/entry-point-tests.patch @@ -0,0 +1,239 @@ +From 3280481369a9dc34c455870057f45f65a781653a Mon Sep 17 00:00:00 2001 +Date: Fri, 30 Oct 2026 14:28:05 +0530 +Subject: [PATCH] test(storage): direct tests of the committed reader's + remaining entry points (#797) + +next_ids, the long value and transaction-id lookups, and the fact log's +last_tx, walk (resume after a key, early stop, prefix, INT-049 before the +empty-root check) and decode had only indirect coverage. A tx_order read +that fails must not be cached. + +--- + src/storage/reader.rs | 214 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 214 insertions(+) + +diff --git a/src/storage/reader.rs b/src/storage/reader.rs +index 8ea56bd89..0e9743229 100644 +--- a/src/storage/reader.rs ++++ b/src/storage/reader.rs +@@ -851,3 +851,217 @@ mod uuid_batch_tests { + } + } + } ++ ++/// The reader's entry points with no direct test elsewhere (#797): the ++/// dictionary's long values and transaction ids, `next_ids`, and the fact ++/// log's `last_tx`, `walk` and `decode`; and a `tx_order` read that fails is ++/// not cached. ++#[cfg(test)] ++mod entry_point_tests { ++ use super::*; ++ use crate::graph::types::{VALID_TIME_FOREVER, Value}; ++ use crate::storage::backend::MemoryBackend; ++ use crate::storage::persistent_facts::PersistentFactStorage; ++ use std::sync::atomic::{AtomicBool, Ordering}; ++ ++ /// A memory backend whose reads fail while `fail` is set. ++ struct FailingReads { ++ inner: MemoryBackend, ++ fail: Arc, ++ } ++ ++ impl StorageBackend for FailingReads { ++ fn write_page(&mut self, page_id: u64, data: &[u8]) -> Result<()> { ++ self.inner.write_page(page_id, data) ++ } ++ fn read_page(&self, page_id: u64) -> Result> { ++ if self.fail.load(Ordering::SeqCst) { ++ anyhow::bail!("injected read failure"); ++ } ++ self.inner.read_page(page_id) ++ } ++ fn sync(&mut self) -> Result<()> { ++ self.inner.sync() ++ } ++ fn page_count(&self) -> Result { ++ self.inner.page_count() ++ } ++ fn close(&mut self) -> Result<()> { ++ self.inner.close() ++ } ++ fn backend_name(&self) -> &'static str { ++ "failing-reads" ++ } ++ } ++ ++ const LONG: &str = "a string well over the sixty-four bytes kept inline in an index key, so it lives in a value page"; ++ ++ fn entity(i: u128) -> EntityId { ++ EntityId::from_u128(i + 1) ++ } ++ ++ /// Facts of entities 0..4 in transactions 1..=4 (`tx_id` 100 × n), one of ++ /// them a long string, checkpointed with no page cache. ++ fn committed() -> (PersistentFactStorage, Arc) { ++ let fail = Arc::new(AtomicBool::new(false)); ++ let backend = FailingReads { ++ inner: MemoryBackend::new(), ++ fail: fail.clone(), ++ }; ++ let mut pfs = PersistentFactStorage::new(backend, 0).unwrap(); ++ for i in 0..4u64 { ++ let value = if i == 2 { ++ Value::String(LONG.to_string()) ++ } else { ++ Value::Integer(i as i64) ++ }; ++ for attribute in [":t/a", ":t/b"] { ++ let fact = Fact { ++ entity: entity(u128::from(i)), ++ attribute: attribute.to_string(), ++ value: value.clone(), ++ tx_id: 100 * (i + 1), ++ tx_count: i + 1, ++ valid_from: 0, ++ valid_to: VALID_TIME_FOREVER, ++ asserted: true, ++ }; ++ assert!(pfs.storage().load_fact(fact).unwrap(), "loaded"); ++ } ++ } ++ pfs.mark_dirty(); ++ pfs.save().unwrap(); ++ (pfs, fail) ++ } ++ ++ fn code(e: anyhow::Error) -> &'static str { ++ crate::error::MinigrafError::from(e).code() ++ } ++ ++ #[test] ++ fn dictionary_entry_points() { ++ let (pfs, _) = committed(); ++ let snap = pfs.storage().snapshot().unwrap(); ++ let reader = snap.committed.as_ref().expect("committed"); ++ let src = reader.key_source().expect("keys"); ++ let (next_eid, next_iid) = src.next_ids(); ++ let eids: Vec = (0..4) ++ .map(|i| src.eid_of(&entity(i)).unwrap().expect("committed entity")) ++ .collect(); ++ assert!(eids.iter().all(|&e| e < next_eid), "eids below next_eid"); ++ assert_eq!(src.eid_of(&entity(9)).unwrap(), None, "absent entity"); ++ for a in [":t/a", ":t/b"] { ++ let iid = src.iid_of(a).unwrap().expect("committed ident"); ++ assert!(iid < next_iid, "iids below next_iid"); ++ assert_eq!(src.ident_of(iid).unwrap(), a); ++ } ++ for n in 1..=4 { ++ assert_eq!(src.tx_id_of(n).unwrap(), 100 * n, "tx_id of tx_count"); ++ } ++ let vref = src ++ .long_value_ref(LONG) ++ .unwrap() ++ .expect("stored long string"); ++ assert_eq!(src.long_value(vref).unwrap(), LONG); ++ let bytes = src.long_bytes(vref).unwrap(); ++ assert_eq!(src.long_bytes_ref(&bytes).unwrap(), Some(vref)); ++ assert_eq!(src.long_value_ref(&format!("{LONG}!")).unwrap(), None); ++ assert_eq!(src.long_bytes_ref(b"absent").unwrap(), None); ++ } ++ ++ #[test] ++ fn log_entry_points() { ++ let (pfs, _) = committed(); ++ let snap = pfs.storage().snapshot().unwrap(); ++ let reader = snap.committed.as_ref().expect("committed"); ++ let log = reader.log_source().expect("log"); ++ assert_eq!( ++ log.last_tx(), ++ pfs.last_checkpointed_tx_count(), ++ "the generation's last checkpointed tx_count" ++ ); ++ let mut keys = Vec::new(); ++ log.walk(Index::Eavt, &[], None, &mut |k| { ++ keys.push(k.to_vec()); ++ Ok(true) ++ }) ++ .unwrap(); ++ assert_eq!(keys.len(), 8, "every EAVT key"); ++ assert!( ++ log.decode(Index::Eavt, &keys).unwrap() == reader.all_facts().unwrap(), ++ "decode gives the facts in key order" ++ ); ++ // Resume after an exact key, an early stop, and an entity prefix. ++ let mut rest = Vec::new(); ++ log.walk(Index::Eavt, &[], Some(&keys[2]), &mut |k| { ++ rest.push(k.to_vec()); ++ Ok(true) ++ }) ++ .unwrap(); ++ assert!(rest == keys[3..], "resumes after the key"); ++ let mut seen = 0; ++ log.walk(Index::Aevt, &[], None, &mut |_| { ++ seen += 1; ++ Ok(seen < 3) ++ }) ++ .unwrap(); ++ assert_eq!(seen, 3, "stops when visit returns false"); ++ let e = reader ++ .key_source() ++ .unwrap() ++ .eid_of(&entity(1)) ++ .unwrap() ++ .unwrap(); ++ let mut of_entity = 0; ++ log.walk(Index::Eavt, &keys::entity_prefix(e), None, &mut |_| { ++ of_entity += 1; ++ Ok(true) ++ }) ++ .unwrap(); ++ assert_eq!(of_entity, 2, "the entity's keys only"); ++ for index in [Index::Avet, Index::Vaet] { ++ let err = log.walk(index, &[], None, &mut |_| Ok(true)).unwrap_err(); ++ assert_eq!(code(err), "INT-049", "fact log walks EAVT or AEVT only"); ++ } ++ } ++ ++ #[test] ++ fn log_walk_of_an_empty_generation() { ++ let mut pfs = PersistentFactStorage::new(MemoryBackend::new(), 0).unwrap(); ++ pfs.mark_dirty(); ++ pfs.save().unwrap(); ++ let snap = pfs.storage().snapshot().unwrap(); ++ let log = snap.committed.as_ref().unwrap().log_source().unwrap(); ++ let mut seen = 0; ++ log.walk(Index::Eavt, &[], None, &mut |_| { ++ seen += 1; ++ Ok(true) ++ }) ++ .unwrap(); ++ assert_eq!(seen, 0, "an empty tree has no keys"); ++ // The index is checked before the empty root. ++ let err = log ++ .walk(Index::Avet, &[], None, &mut |_| Ok(true)) ++ .unwrap_err(); ++ assert_eq!(code(err), "INT-049"); ++ assert!(log.decode(Index::Eavt, &[]).unwrap().is_empty()); ++ } ++ ++ #[test] ++ fn failed_tx_order_is_not_cached() { ++ let (pfs, fail) = committed(); ++ let snap = pfs.storage().snapshot().unwrap(); ++ let src = snap.committed.as_ref().unwrap().key_source().unwrap(); ++ fail.store(true, Ordering::SeqCst); ++ assert!(src.tx_order().is_err(), "the DICT read fails"); ++ assert!(src.last_tx_at(250).is_err(), "and so does last_tx_at"); ++ fail.store(false, Ordering::SeqCst); ++ let order = src.tx_order().unwrap(); ++ assert!(order.monotonic, "rising tx_ids"); ++ assert_eq!(order.last, Some((4, 400)), "newest transaction"); ++ assert_eq!(src.last_tx_at(250).unwrap(), 2, "newest tx_id <= 250"); ++ // Cached now: no page is read. ++ fail.store(true, Ordering::SeqCst); ++ assert_eq!(src.tx_order().unwrap(), order, "cached after success"); ++ } ++} +-- +2.55.0 + diff --git a/docs/audits/797/patches/shared-reader.patch b/docs/audits/797/patches/shared-reader.patch new file mode 100644 index 0000000000..a7599c74b3 --- /dev/null +++ b/docs/audits/797/patches/shared-reader.patch @@ -0,0 +1,681 @@ +From 1b5169ef8e31e3f1bf848d52ffc2e08f3c17068f Mon Sep 17 00:00:00 2001 +Date: Fri, 30 Oct 2026 13:37:59 +0530 +Subject: [PATCH] perf(storage): share the committed reader's logic across + backends (#797) + +OnDiskReader monomorphized every read per backend, although the tree, +cursor, dictionary and cache code below it already reads pages through +&dyn StorageBackend. Its generation metadata and reads move into a +non-generic ReaderCore held inline; the generic reader keeps only the +MutexStorageBackend adapter and trait methods that pass it on. No +allocation, lock, cache or behavior change. + +--- + src/storage/reader.rs | 428 ++++++++++++++++++++++++++++-------------- + 1 file changed, 283 insertions(+), 145 deletions(-) + +diff --git a/src/storage/reader.rs b/src/storage/reader.rs +index 09ba6f1ab..8ea56bd89 100644 +--- a/src/storage/reader.rs ++++ b/src/storage/reader.rs +@@ -19,8 +19,18 @@ use anyhow::Result; + use std::sync::{Arc, Mutex, OnceLock}; + + /// [`CommittedReader`] over one committed meta's trees. ++/// ++/// Only the backend adapter depends on `B`. The reads themselves are ++/// [`ReaderCore`]'s, compiled once for every backend: the tree and dictionary ++/// code below them already reads pages through `&dyn StorageBackend` (#797). + pub struct OnDiskReader { + backend: MutexStorageBackend, ++ core: ReaderCore, ++} ++ ++/// The generation an [`OnDiskReader`] reads, and its reads, given the ++/// reader's backend adapter. ++struct ReaderCore { + cache: Arc, + eavt_root: u64, + aevt_root: u64, +@@ -39,6 +49,18 @@ impl OnDiskReader { + pub fn new(backend: Arc>, cache: Arc, meta: &MetaPage) -> Self { + OnDiskReader { + backend: MutexStorageBackend(backend), ++ core: ReaderCore::new(cache, meta), ++ } ++ } ++ ++ fn dict(&self) -> DictReader<'_> { ++ self.core.dict(&self.backend) ++ } ++} ++ ++impl ReaderCore { ++ fn new(cache: Arc, meta: &MetaPage) -> Self { ++ ReaderCore { + cache, + eavt_root: meta.eavt_root, + aevt_root: meta.aevt_root, +@@ -53,14 +75,15 @@ impl OnDiskReader { + } + } + +- fn dict(&self) -> DictReader<'_> { +- DictReader::new(self.dict_root, &self.backend, &self.cache).with_shared(&self.shared) ++ fn dict<'a>(&'a self, backend: &'a dyn StorageBackend) -> DictReader<'a> { ++ DictReader::new(self.dict_root, backend, &self.cache).with_shared(&self.shared) + } + + /// Facts of every `index` entry starting with `prefix`. + #[cfg(test)] + fn scan( + &self, ++ backend: &dyn StorageBackend, + index: Index, + root: u64, + prefix: &[u8], +@@ -69,18 +92,17 @@ impl OnDiskReader { + if root == 0 { + return Ok(Vec::new()); + } +- prefix_scan(root, prefix, &self.backend, &self.cache)? ++ prefix_scan(root, prefix, backend, &self.cache)? + .iter() + .map(|(k, _)| dict.fact(&KeyFact::decode(index, k)?)) + .collect() + } +-} + +-impl OnDiskReader { + /// Visit the DICT's transactions `(tx_count, tx_id)` in `tx_count` order, + /// from `from` on (all when `None`), until `visit` returns false. + fn dict_txs( + &self, ++ backend: &dyn StorageBackend, + from: Option, + visit: &mut dyn FnMut(u64, u64) -> Result, + ) -> Result<()> { +@@ -88,8 +110,7 @@ impl OnDiskReader { + return Ok(()); + } + let prefix = [keys::DICT_TX]; +- let mut cursor = +- LeafCursor::new(self.dict_root, Some(&prefix), &self.backend, &self.cache)?; ++ let mut cursor = LeafCursor::new(self.dict_root, Some(&prefix), backend, &self.cache)?; + if let Some(m) = from { + cursor.seek(&keys::dict_tx_key(m))?; + } +@@ -111,6 +132,7 @@ impl OnDiskReader { + #[cfg(test)] + fn live_scan( + &self, ++ backend: &dyn StorageBackend, + index: Index, + root: u64, + prefix: &[u8], +@@ -119,10 +141,19 @@ impl OnDiskReader { + ) -> Result> { + let mut out = Vec::new(); + let bound = TxBound::of(as_of); +- self.live_walk(index, root, prefix, None, &bound, usize::MAX, &mut |k| { +- out.push(dict.fact(&KeyFact::decode(index, k)?)?); +- Ok(()) +- })?; ++ self.live_walk( ++ backend, ++ index, ++ root, ++ prefix, ++ None, ++ &bound, ++ usize::MAX, ++ &mut |k| { ++ out.push(dict.fact(&KeyFact::decode(index, k)?)?); ++ Ok(()) ++ }, ++ )?; + Ok(out) + } + +@@ -155,6 +186,7 @@ impl OnDiskReader { + #[allow(clippy::too_many_arguments)] + fn live_walk( + &self, ++ backend: &dyn StorageBackend, + index: Index, + root: u64, + prefix: &[u8], +@@ -166,7 +198,7 @@ impl OnDiskReader { + if root == 0 { + return Ok(None); + } +- let mut cursor = LeafCursor::new(root, Some(prefix), &self.backend, &self.cache)?; ++ let mut cursor = LeafCursor::new(root, Some(prefix), backend, &self.cache)?; + if let Some(after) = resume { + // Past every entry of the triple: `tx↓` starts below 0xFF, and the + // next triple differs from this one within its length. +@@ -251,102 +283,10 @@ impl OnDiskReader { + } + } + } +-} + +-/// Entries of one triple passed over before the walk seeks past them. +-const SEEK_AFTER: usize = 8; ++ // ─── KeySource ─────────────────────────────────────────────────────────── + +-/// What the walk does with one entry. +-enum Step { +- /// Pass over it; a seek past the run goes to `Seek`. +- Pass(Seek), +- /// An entry of a transaction the bound keeps; `key` is kept for +- /// assertions only. +- Entry { tx: u64, key: Option> }, +-} +- +-/// Where a seek past passed-over entries of one triple goes. +-enum Seek { +- /// Past the whole triple. +- Triple, +- /// To the triple's entries of this transaction and older. +- Tx(u64), +-} +- +-/// The entries of one triple with one `tx_count`. +-#[derive(Default)] +-struct TxGroup { +- tx: Option, +- retracted: bool, +- /// Key of each assertion (distinct windows, since keys are unique). +- assertions: Vec>, +-} +- +-impl TxGroup { +- /// Visit the group's assertions unless it holds a retraction, and reset +- /// it. Returns the number visited. +- fn flush(&mut self, visit: &mut dyn FnMut(&[u8]) -> Result<()>) -> Result { +- let group = std::mem::take(self); +- if group.retracted { +- return Ok(0); +- } +- for key in &group.assertions { +- visit(key)?; +- } +- Ok(group.assertions.len()) +- } +-} +- +-impl KeySource for OnDiskReader { +- fn next_ids(&self) -> (u64, u32) { +- (self.next_eid, self.next_iid) +- } +- +- fn eid_of(&self, entity: &EntityId) -> Result> { +- self.dict().eid_of(entity) +- } +- +- fn iid_of(&self, ident: &str) -> Result> { +- self.dict().iid_of(ident) +- } +- +- fn uuid_of(&self, eid: u64) -> Result { +- self.dict().uuid_of(eid) +- } +- +- fn uuids_of( +- &self, +- eids: &[u64], +- visit: &mut dyn FnMut(u64, EntityId) -> Result<()>, +- ) -> Result<()> { +- self.dict().uuids_of(eids, visit) +- } +- +- fn ident_of(&self, iid: u32) -> Result { +- self.dict().name_of(iid) +- } +- +- fn long_value(&self, vref: ValueRef) -> Result { +- self.dict().long_value(vref) +- } +- +- fn long_value_ref(&self, s: &str) -> Result> { +- self.dict().find_long_value(s) +- } +- +- fn long_bytes(&self, vref: ValueRef) -> Result> { +- self.dict().long_bytes(vref) +- } +- +- fn long_bytes_ref(&self, bytes: &[u8]) -> Result> { +- self.dict().find_long_bytes(bytes) +- } +- +- fn tx_id_of(&self, tx_count: u64) -> Result { +- self.dict().tx_id_of(tx_count) +- } +- +- fn tx_order(&self) -> Result { ++ fn tx_order(&self, backend: &dyn StorageBackend) -> Result { + if let Some(order) = self.tx_order.get() { + return Ok(*order); + } +@@ -354,7 +294,7 @@ impl KeySource for OnDiskReader { + monotonic: true, + last: None, + }; +- self.dict_txs(None, &mut |tx_count, tx_id| { ++ self.dict_txs(backend, None, &mut |tx_count, tx_id| { + if order.last.is_some_and(|(_, last)| tx_id < last) { + order.monotonic = false; + } +@@ -364,13 +304,14 @@ impl KeySource for OnDiskReader { + Ok(*self.tx_order.get_or_init(|| order)) + } + +- fn last_tx_at(&self, t: u64) -> Result { ++ /// `order` is this reader's [`Self::tx_order`]. ++ fn last_tx_at(&self, backend: &dyn StorageBackend, order: TxOrder, t: u64) -> Result { + // The first transaction at or after `m`, if its `tx_id` is at most + // `t`: true up to the newest transaction with `tx_id <= t`, false + // after it, since `tx_id`s rise with `tx_count` here. + let at_or_before = |m: u64| -> Result { + let mut kept = false; +- self.dict_txs(Some(m), &mut |_, tx_id| { ++ self.dict_txs(backend, Some(m), &mut |_, tx_id| { + kept = tx_id <= t; + Ok(false) + })?; +@@ -378,7 +319,7 @@ impl KeySource for OnDiskReader { + }; + // The least `m` in `1..=newest + 1` whose first transaction at or + // after it is not kept; that transaction is `m - 1`. +- let newest = self.tx_order()?.last.map_or(0, |(tx_count, _)| tx_count); ++ let newest = order.last.map_or(0, |(tx_count, _)| tx_count); + let (mut lo, mut hi) = (1u64, newest.saturating_add(1)); + while lo < hi { + let mid = lo + (hi - lo) / 2; +@@ -391,9 +332,14 @@ impl KeySource for OnDiskReader { + Ok(lo - 1) + } + +- fn tx_runs(&self, t: u64, out: &mut Vec<(u64, u64)>) -> Result<()> { ++ fn tx_runs( ++ &self, ++ backend: &dyn StorageBackend, ++ t: u64, ++ out: &mut Vec<(u64, u64)>, ++ ) -> Result<()> { + let mut open: Option<(u64, u64)> = None; +- self.dict_txs(None, &mut |tx_count, tx_id| { ++ self.dict_txs(backend, None, &mut |tx_count, tx_id| { + match (tx_id <= t, open.as_mut()) { + (true, Some(run)) => run.1 = tx_count, + (true, None) => open = Some((tx_count, tx_count)), +@@ -405,19 +351,21 @@ impl KeySource for OnDiskReader { + Ok(()) + } + +- fn any_key(&self, index: Index, prefix: &[u8]) -> Result { ++ fn any_key(&self, backend: &dyn StorageBackend, index: Index, prefix: &[u8]) -> Result { + let root = self.root(index); + if root == 0 { + return Ok(false); + } +- let mut cursor = LeafCursor::new(root, Some(prefix), &self.backend, &self.cache)?; ++ let mut cursor = LeafCursor::new(root, Some(prefix), backend, &self.cache)?; + Ok(cursor + .next_ref()? + .is_some_and(|(k, _)| k.starts_with(prefix))) + } + ++ #[allow(clippy::too_many_arguments)] + fn live_keys( + &self, ++ backend: &dyn StorageBackend, + index: Index, + prefix: &[u8], + resume: Option<&[u8]>, +@@ -426,20 +374,17 @@ impl KeySource for OnDiskReader { + out: &mut Vec, + ) -> Result>> { + let root = self.root(index); +- self.live_walk(index, root, prefix, resume, bound, max, &mut |k| { ++ self.live_walk(backend, index, root, prefix, resume, bound, max, &mut |k| { + out.push(KeyFact::decode(index, k)?); + Ok(()) + }) + } +-} + +-impl LogSource for OnDiskReader { +- fn last_tx(&self) -> u64 { +- self.last_tx +- } ++ // ─── LogSource ─────────────────────────────────────────────────────────── + + fn walk( + &self, ++ backend: &dyn StorageBackend, + index: Index, + prefix: &[u8], + after: Option<&[u8]>, +@@ -455,7 +400,7 @@ impl LogSource for OnDiskReader { + if root == 0 { + return Ok(()); + } +- let mut cursor = LeafCursor::new(root, Some(prefix), &self.backend, &self.cache)?; ++ let mut cursor = LeafCursor::new(root, Some(prefix), backend, &self.cache)?; + if let Some(after) = after { + // Keys are unique, so the first key after `after` is the first one + // at or above `after ‖ 0x00`. +@@ -471,26 +416,22 @@ impl LogSource for OnDiskReader { + Ok(()) + } + +- fn decode(&self, index: Index, keys: &[Vec]) -> Result> { +- let mut dict = self.dict(); ++ fn decode(mut dict: DictReader<'_>, index: Index, keys: &[Vec]) -> Result> { + keys.iter() + .map(|k| dict.fact(&KeyFact::decode(index, k)?)) + .collect() + } +-} + +-impl CommittedReader for OnDiskReader { +- fn log_source(&self) -> Option<&dyn LogSource> { +- Some(self) +- } +- +- fn key_source(&self) -> Option<&dyn KeySource> { +- Some(self) +- } ++ // ─── CommittedReader (tests) ───────────────────────────────────────────── + + #[cfg(test)] +- fn live_facts(&self, scan: Scan<'_>, as_of: Option) -> Result> { +- let mut dict = self.dict(); ++ fn live_facts( ++ &self, ++ backend: &dyn StorageBackend, ++ scan: Scan<'_>, ++ as_of: Option, ++ ) -> Result> { ++ let mut dict = self.dict(backend); + let (index, root, prefix) = match scan { + Scan::All => (Index::Eavt, self.eavt_root, Vec::new()), + Scan::Entity(entity) => { +@@ -520,16 +461,16 @@ impl CommittedReader for OnDiskReader { + (Index::Aevt, self.aevt_root, keys::attribute_prefix(a)) + } + }; +- self.live_scan(index, root, &prefix, as_of, &mut dict) ++ self.live_scan(backend, index, root, &prefix, as_of, &mut dict) + } + + #[cfg(test)] +- fn all_facts(&self) -> Result> { ++ fn all_facts(&self, backend: &dyn StorageBackend) -> Result> { + if self.eavt_root == 0 { + return Ok(Vec::new()); + } +- let mut dict = self.dict(); +- let mut cursor = LeafCursor::new(self.eavt_root, None, &self.backend, &self.cache)?; ++ let mut dict = self.dict(backend); ++ let mut cursor = LeafCursor::new(self.eavt_root, None, backend, &self.cache)?; + let mut facts = Vec::new(); + while let Some((k, _)) = cursor.next_ref()? { + facts.push(dict.fact(&KeyFact::decode(Index::Eavt, k)?)?); +@@ -538,13 +479,18 @@ impl CommittedReader for OnDiskReader { + } + + #[cfg(test)] +- fn facts_for_entity(&self, entity: &EntityId) -> Result> { +- let mut dict = self.dict(); ++ fn facts_for_entity( ++ &self, ++ backend: &dyn StorageBackend, ++ entity: &EntityId, ++ ) -> Result> { ++ let mut dict = self.dict(backend); + let Some(e) = dict.eid_of(entity)? else { + return Ok(Vec::new()); + }; + dict.seed_entity(e, *entity); + self.scan( ++ backend, + Index::Eavt, + self.eavt_root, + &keys::entity_prefix(e), +@@ -553,25 +499,35 @@ impl CommittedReader for OnDiskReader { + } + + #[cfg(test)] +- fn facts_for_entity_attribute(&self, entity: &EntityId, attribute: &str) -> Result> { +- let mut dict = self.dict(); ++ fn facts_for_entity_attribute( ++ &self, ++ backend: &dyn StorageBackend, ++ entity: &EntityId, ++ attribute: &str, ++ ) -> Result> { ++ let mut dict = self.dict(backend); + let (Some(e), Some(a)) = (dict.eid_of(entity)?, dict.iid_of(attribute)?) else { + return Ok(Vec::new()); + }; + dict.seed_entity(e, *entity); + dict.seed_ident(a, attribute); + let prefix = keys::entity_attribute_prefix(e, a); +- self.scan(Index::Eavt, self.eavt_root, &prefix, &mut dict) ++ self.scan(backend, Index::Eavt, self.eavt_root, &prefix, &mut dict) + } + + #[cfg(test)] +- fn facts_for_attribute(&self, attribute: &str) -> Result> { +- let mut dict = self.dict(); ++ fn facts_for_attribute( ++ &self, ++ backend: &dyn StorageBackend, ++ attribute: &str, ++ ) -> Result> { ++ let mut dict = self.dict(backend); + let Some(a) = dict.iid_of(attribute)? else { + return Ok(Vec::new()); + }; + dict.seed_ident(a, attribute); + self.scan( ++ backend, + Index::Aevt, + self.aevt_root, + &keys::attribute_prefix(a), +@@ -580,6 +536,188 @@ impl CommittedReader for OnDiskReader { + } + } + ++/// Entries of one triple passed over before the walk seeks past them. ++const SEEK_AFTER: usize = 8; ++ ++/// What the walk does with one entry. ++enum Step { ++ /// Pass over it; a seek past the run goes to `Seek`. ++ Pass(Seek), ++ /// An entry of a transaction the bound keeps; `key` is kept for ++ /// assertions only. ++ Entry { tx: u64, key: Option> }, ++} ++ ++/// Where a seek past passed-over entries of one triple goes. ++enum Seek { ++ /// Past the whole triple. ++ Triple, ++ /// To the triple's entries of this transaction and older. ++ Tx(u64), ++} ++ ++/// The entries of one triple with one `tx_count`. ++#[derive(Default)] ++struct TxGroup { ++ tx: Option, ++ retracted: bool, ++ /// Key of each assertion (distinct windows, since keys are unique). ++ assertions: Vec>, ++} ++ ++impl TxGroup { ++ /// Visit the group's assertions unless it holds a retraction, and reset ++ /// it. Returns the number visited. ++ fn flush(&mut self, visit: &mut dyn FnMut(&[u8]) -> Result<()>) -> Result { ++ let group = std::mem::take(self); ++ if group.retracted { ++ return Ok(0); ++ } ++ for key in &group.assertions { ++ visit(key)?; ++ } ++ Ok(group.assertions.len()) ++ } ++} ++ ++// The trait methods below only pass the backend adapter to `ReaderCore`. ++ ++impl KeySource for OnDiskReader { ++ fn next_ids(&self) -> (u64, u32) { ++ (self.core.next_eid, self.core.next_iid) ++ } ++ ++ fn eid_of(&self, entity: &EntityId) -> Result> { ++ self.dict().eid_of(entity) ++ } ++ ++ fn iid_of(&self, ident: &str) -> Result> { ++ self.dict().iid_of(ident) ++ } ++ ++ fn uuid_of(&self, eid: u64) -> Result { ++ self.dict().uuid_of(eid) ++ } ++ ++ fn uuids_of( ++ &self, ++ eids: &[u64], ++ visit: &mut dyn FnMut(u64, EntityId) -> Result<()>, ++ ) -> Result<()> { ++ self.dict().uuids_of(eids, visit) ++ } ++ ++ fn ident_of(&self, iid: u32) -> Result { ++ self.dict().name_of(iid) ++ } ++ ++ fn long_value(&self, vref: ValueRef) -> Result { ++ self.dict().long_value(vref) ++ } ++ ++ fn long_value_ref(&self, s: &str) -> Result> { ++ self.dict().find_long_value(s) ++ } ++ ++ fn long_bytes(&self, vref: ValueRef) -> Result> { ++ self.dict().long_bytes(vref) ++ } ++ ++ fn long_bytes_ref(&self, bytes: &[u8]) -> Result> { ++ self.dict().find_long_bytes(bytes) ++ } ++ ++ fn tx_id_of(&self, tx_count: u64) -> Result { ++ self.dict().tx_id_of(tx_count) ++ } ++ ++ fn tx_order(&self) -> Result { ++ self.core.tx_order(&self.backend) ++ } ++ ++ fn last_tx_at(&self, t: u64) -> Result { ++ let order = self.tx_order()?; ++ self.core.last_tx_at(&self.backend, order, t) ++ } ++ ++ fn tx_runs(&self, t: u64, out: &mut Vec<(u64, u64)>) -> Result<()> { ++ self.core.tx_runs(&self.backend, t, out) ++ } ++ ++ fn any_key(&self, index: Index, prefix: &[u8]) -> Result { ++ self.core.any_key(&self.backend, index, prefix) ++ } ++ ++ fn live_keys( ++ &self, ++ index: Index, ++ prefix: &[u8], ++ resume: Option<&[u8]>, ++ bound: &TxBound, ++ max: usize, ++ out: &mut Vec, ++ ) -> Result>> { ++ self.core ++ .live_keys(&self.backend, index, prefix, resume, bound, max, out) ++ } ++} ++ ++impl LogSource for OnDiskReader { ++ fn last_tx(&self) -> u64 { ++ self.core.last_tx ++ } ++ ++ fn walk( ++ &self, ++ index: Index, ++ prefix: &[u8], ++ after: Option<&[u8]>, ++ visit: &mut dyn FnMut(&[u8]) -> Result, ++ ) -> Result<()> { ++ self.core.walk(&self.backend, index, prefix, after, visit) ++ } ++ ++ fn decode(&self, index: Index, keys: &[Vec]) -> Result> { ++ ReaderCore::decode(self.dict(), index, keys) ++ } ++} ++ ++impl CommittedReader for OnDiskReader { ++ fn log_source(&self) -> Option<&dyn LogSource> { ++ Some(self) ++ } ++ ++ fn key_source(&self) -> Option<&dyn KeySource> { ++ Some(self) ++ } ++ ++ #[cfg(test)] ++ fn live_facts(&self, scan: Scan<'_>, as_of: Option) -> Result> { ++ self.core.live_facts(&self.backend, scan, as_of) ++ } ++ ++ #[cfg(test)] ++ fn all_facts(&self) -> Result> { ++ self.core.all_facts(&self.backend) ++ } ++ ++ #[cfg(test)] ++ fn facts_for_entity(&self, entity: &EntityId) -> Result> { ++ self.core.facts_for_entity(&self.backend, entity) ++ } ++ ++ #[cfg(test)] ++ fn facts_for_entity_attribute(&self, entity: &EntityId, attribute: &str) -> Result> { ++ self.core ++ .facts_for_entity_attribute(&self.backend, entity, attribute) ++ } ++ ++ #[cfg(test)] ++ fn facts_for_attribute(&self, attribute: &str) -> Result> { ++ self.core.facts_for_attribute(&self.backend, attribute) ++ } ++} ++ + /// Every fact in `root`'s tree of kind `index`, in key order (tests, verify). + #[cfg(test)] + pub fn all_entries_as_facts( +-- +2.55.0 + diff --git a/docs/audits/797/raw/browser.jsonl.gz b/docs/audits/797/raw/browser.jsonl.gz new file mode 100644 index 0000000000..24403d54d9 Binary files /dev/null and b/docs/audits/797/raw/browser.jsonl.gz differ diff --git a/docs/audits/797/raw/browser.spec.json b/docs/audits/797/raw/browser.spec.json new file mode 100644 index 0000000000..6cdea0e896 --- /dev/null +++ b/docs/audits/797/raw/browser.spec.json @@ -0,0 +1,13 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "browser", + "workloads": [ + "br" + ], + "secs": 1.5, + "blocks": 32, + "placement": "sequential" +} \ No newline at end of file diff --git a/docs/audits/797/raw/cold.jsonl.gz b/docs/audits/797/raw/cold.jsonl.gz new file mode 100644 index 0000000000..8cc434ae3b Binary files /dev/null and b/docs/audits/797/raw/cold.jsonl.gz differ diff --git a/docs/audits/797/raw/cold.spec.json b/docs/audits/797/raw/cold.spec.json new file mode 100644 index 0000000000..103a9e8bd7 --- /dev/null +++ b/docs/audits/797/raw/cold.spec.json @@ -0,0 +1,14 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "envelope", + "workloads": [ + "cold_point", + "cold_scan" + ], + "secs": 1.0, + "blocks": 48, + "placement": "sequential" +} \ No newline at end of file diff --git a/docs/audits/797/raw/concurrency.jsonl.gz b/docs/audits/797/raw/concurrency.jsonl.gz new file mode 100644 index 0000000000..f08cec6647 Binary files /dev/null and b/docs/audits/797/raw/concurrency.jsonl.gz differ diff --git a/docs/audits/797/raw/concurrency.spec.json b/docs/audits/797/raw/concurrency.spec.json new file mode 100644 index 0000000000..6b06e41488 --- /dev/null +++ b/docs/audits/797/raw/concurrency.spec.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "envelope", + "workloads": [ + "cc_1", + "cc_8", + "cc_44" + ], + "secs": 1.5, + "blocks": 48, + "placement": "sequential", + "nodes": "2,3" +} \ No newline at end of file diff --git a/docs/audits/797/raw/manifest.json b/docs/audits/797/raw/manifest.json new file mode 100644 index 0000000000..5129634d4e --- /dev/null +++ b/docs/audits/797/raw/manifest.json @@ -0,0 +1,155 @@ +{ + "rustc": "rustc 1.99.1 (58cf8f9c3 2026-10-13)\nbinary: rustc\ncommit-hash: 58cf8f9c35b355199727627d07ae34a4e2846d67\ncommit-date: 2026-10-13\nhost: x86_64-unknown-linux-gnu\nrelease: 1.99.1\nLLVM version: 23.1.1\n", + "harness_sha256": "1ec86c064401a4af53f1c33425022821f3b5e44460667f4bbfa0a246711415ef", + "hook_patch_sha256": "8c5cc9471bd2b3862119091b6d1c34ddd345ec939ac628860c7d3e109f2e5760", + "variants": { + "B": { + "commit": "15badca89db60bbd458b52af59a064b9c0e7da1f", + "lock_sha256": "82fa4d92e6389dc4a44d47bac6fdc361ffb4e736433735da140624eb40807660", + "reader_rs_sha256": "cd4dfca87925337e4fa32f2a3eaf2c7d320425d6820c807cfd55b418409fb91e", + "binaries": { + "envelope": { + "file": "B-envelope", + "sha256": "a10ff3740d73de4546033754e65aa6f13ec1b971bd05107ad32f6d9b96c476b3", + "cargo": "--profile envelope", + "env": {} + }, + "release": { + "file": "B-release", + "sha256": "4b724bd22c5aa288878f972949e59f24b6f255820b99309254a29c41999be8b4", + "cargo": "--release", + "env": {} + }, + "ab-envelope": { + "file": "B-ab-envelope", + "sha256": "2f97f19ed4fc8dfa803c31d9cbcc5805b9578f3e160e041e0a79738029702e95", + "cargo": "--profile envelope", + "env": { + "RUSTFLAGS": "--cfg minigraf_ab", + "CARGO_TARGET_DIR": "target-ab" + } + }, + "wasi-envelope": { + "file": "B-wasi-envelope.wasm", + "sha256": "e61dc27ba843c70238c0ee955b65ea9a02c26a4ca9b0b3ad16e883b9bf5d176f", + "cargo": "--profile envelope --target wasm32-wasip1", + "env": { + "RUSTFLAGS": "--cfg minigraf_ab", + "CARGO_TARGET_DIR": "target-ab" + } + }, + "browser": { + "file": "B-browser.wasm", + "sha256": "a5c7bf47361493452aaefed670d2758a6f27de462f440df9bbe5180158169a1e", + "cargo": "test --release --target wasm32-unknown-unknown --features browser --example ab_browser --no-run", + "env": { + "CARGO_PROFILE_RELEASE_LTO": "false" + } + } + } + }, + "H": { + "commit": "1b5169ef8e31e3f1bf848d52ffc2e08f3c17068f", + "lock_sha256": "82fa4d92e6389dc4a44d47bac6fdc361ffb4e736433735da140624eb40807660", + "reader_rs_sha256": "1a336147cca5ec99ac34b2dfe72a367e8f9314f8f4c109f5e9fbd9a94488b258", + "binaries": { + "envelope": { + "file": "H-envelope", + "sha256": "1a357ce8fe8f025d158b74d719be7995e93d050a79581c699432e0bde33bbf01", + "cargo": "--profile envelope", + "env": {} + }, + "release": { + "file": "H-release", + "sha256": "dc1d019904d57ffaaf3bfaf2f395b62ba75d01b4326f710cf74e75d286eaaf94", + "cargo": "--release", + "env": {} + }, + "ab-envelope": { + "file": "H-ab-envelope", + "sha256": "065be98e15fb23470ff566e810b9208b8cea2bea3f9668d13af0cfd5ec024931", + "cargo": "--profile envelope", + "env": { + "RUSTFLAGS": "--cfg minigraf_ab", + "CARGO_TARGET_DIR": "target-ab" + } + }, + "wasi-envelope": { + "file": "H-wasi-envelope.wasm", + "sha256": "4822d26360b7819439e3b1156fd4a4aa73440f8b1d4045837634c84f253e42c1", + "cargo": "--profile envelope --target wasm32-wasip1", + "env": { + "RUSTFLAGS": "--cfg minigraf_ab", + "CARGO_TARGET_DIR": "target-ab" + } + }, + "browser": { + "file": "H-browser.wasm", + "sha256": "e97a0938c066d6bb49f09ae74e06262bc1179ebd24526e53f0af8aa6c30cbda8", + "cargo": "test --release --target wasm32-unknown-unknown --features browser --example ab_browser --no-run", + "env": { + "CARGO_PROFILE_RELEASE_LTO": "false" + } + } + } + }, + "P": { + "commit": "194544597c6ba31618ab44945a46b3972c076bc3", + "lock_sha256": "82fa4d92e6389dc4a44d47bac6fdc361ffb4e736433735da140624eb40807660", + "reader_rs_sha256": "4c12cad868ba807cdec868479501524805f162d7d855619f831ceaa6147b7872", + "binaries": { + "envelope": { + "file": "P-envelope", + "sha256": "95c5412bb9747e070f78c1ee868799a331bd6fa4eb1883e798c125624c47f255", + "cargo": "--profile envelope", + "env": {} + }, + "release": { + "file": "P-release", + "sha256": "10d6334bb275b216f9b50377550dba9478e15534edb9e8fbaac9ff09ed14a497", + "cargo": "--release", + "env": {} + }, + "ab-envelope": { + "file": "P-ab-envelope", + "sha256": "79ea461244aa45db8aed7d947f7307a8122964baa300b7d1f81c6e64d08ff5f5", + "cargo": "--profile envelope", + "env": { + "RUSTFLAGS": "--cfg minigraf_ab", + "CARGO_TARGET_DIR": "target-ab" + } + }, + "wasi-envelope": { + "file": "P-wasi-envelope.wasm", + "sha256": "0c8e4cf8863ca1774db4e4afd630120d99dd7a5e2939e3c9109bc6e3594221b2", + "cargo": "--profile envelope --target wasm32-wasip1", + "env": { + "RUSTFLAGS": "--cfg minigraf_ab", + "CARGO_TARGET_DIR": "target-ab" + } + }, + "browser": { + "file": "P-browser.wasm", + "sha256": "c6985e8ac1505c7b82e58273c4f31f03b340eea5dd447ba1a481663a3818c3f8", + "cargo": "test --release --target wasm32-unknown-unknown --features browser --example ab_browser --no-run", + "env": { + "CARGO_PROFILE_RELEASE_LTO": "false" + } + } + } + } + }, + "fixture": { + "file": "fixture-100k.graph", + "sha256": "59e0023aad119ea1939876519887c6b10b66c6558e32bf9dc78476ed6216c0fe", + "meta": { + "build_ms": 92080.77345, + "entities": 16666, + "facts": 100000, + "file_bytes": 10764288, + "hot_tx_half": 1253, + "peak_rss_kb": 189680, + "tx_half": 126 + } + } +} diff --git a/docs/audits/797/raw/pilot-browser-2.jsonl.gz b/docs/audits/797/raw/pilot-browser-2.jsonl.gz new file mode 100644 index 0000000000..b8417a6367 Binary files /dev/null and b/docs/audits/797/raw/pilot-browser-2.jsonl.gz differ diff --git a/docs/audits/797/raw/pilot-browser-2.spec.json b/docs/audits/797/raw/pilot-browser-2.spec.json new file mode 100644 index 0000000000..1658d9b417 --- /dev/null +++ b/docs/audits/797/raw/pilot-browser-2.spec.json @@ -0,0 +1 @@ +{"pairs": ["B:H", "B:P"], "profile": "browser", "workloads": ["br"], "secs": 1.5, "blocks": 4, "placement": "sequential"} \ No newline at end of file diff --git a/docs/audits/797/raw/pilot-browser.jsonl.gz b/docs/audits/797/raw/pilot-browser.jsonl.gz new file mode 100644 index 0000000000..b1774c468c Binary files /dev/null and b/docs/audits/797/raw/pilot-browser.jsonl.gz differ diff --git a/docs/audits/797/raw/pilot-browser.spec.json b/docs/audits/797/raw/pilot-browser.spec.json new file mode 100644 index 0000000000..fdae027981 --- /dev/null +++ b/docs/audits/797/raw/pilot-browser.spec.json @@ -0,0 +1,13 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "browser", + "workloads": [ + "br" + ], + "secs": 1.5, + "blocks": 2, + "placement": "sequential" +} \ No newline at end of file diff --git a/docs/audits/797/raw/pilot-cold.jsonl.gz b/docs/audits/797/raw/pilot-cold.jsonl.gz new file mode 100644 index 0000000000..e35a78b3a3 Binary files /dev/null and b/docs/audits/797/raw/pilot-cold.jsonl.gz differ diff --git a/docs/audits/797/raw/pilot-cold.spec.json b/docs/audits/797/raw/pilot-cold.spec.json new file mode 100644 index 0000000000..e379f0a807 --- /dev/null +++ b/docs/audits/797/raw/pilot-cold.spec.json @@ -0,0 +1,14 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "envelope", + "workloads": [ + "cold_point", + "cold_scan" + ], + "secs": 1.0, + "blocks": 4, + "placement": "sequential" +} \ No newline at end of file diff --git a/docs/audits/797/raw/pilot-concurrency.jsonl.gz b/docs/audits/797/raw/pilot-concurrency.jsonl.gz new file mode 100644 index 0000000000..b10d8f6afe Binary files /dev/null and b/docs/audits/797/raw/pilot-concurrency.jsonl.gz differ diff --git a/docs/audits/797/raw/pilot-concurrency.spec.json b/docs/audits/797/raw/pilot-concurrency.spec.json new file mode 100644 index 0000000000..764b22be6f --- /dev/null +++ b/docs/audits/797/raw/pilot-concurrency.spec.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "envelope", + "workloads": [ + "cc_1", + "cc_8", + "cc_44" + ], + "secs": 1.5, + "blocks": 4, + "placement": "sequential", + "nodes": "2,3" +} \ No newline at end of file diff --git a/docs/audits/797/raw/pilot-diag-envelope.jsonl.gz b/docs/audits/797/raw/pilot-diag-envelope.jsonl.gz new file mode 100644 index 0000000000..1959d98976 Binary files /dev/null and b/docs/audits/797/raw/pilot-diag-envelope.jsonl.gz differ diff --git a/docs/audits/797/raw/pilot-diag-envelope.spec.json b/docs/audits/797/raw/pilot-diag-envelope.spec.json new file mode 100644 index 0000000000..0b4b548677 --- /dev/null +++ b/docs/audits/797/raw/pilot-diag-envelope.spec.json @@ -0,0 +1,14 @@ +{ + "pairs": [ + "B:H", + "B:B" + ], + "profile": "envelope", + "workloads": [ + "pt_asof", + "pt_av" + ], + "secs": 1.5, + "blocks": 16, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/raw/pilot-diag-release.jsonl.gz b/docs/audits/797/raw/pilot-diag-release.jsonl.gz new file mode 100644 index 0000000000..3cbe87161f Binary files /dev/null and b/docs/audits/797/raw/pilot-diag-release.jsonl.gz differ diff --git a/docs/audits/797/raw/pilot-diag-release.spec.json b/docs/audits/797/raw/pilot-diag-release.spec.json new file mode 100644 index 0000000000..ae8730ec34 --- /dev/null +++ b/docs/audits/797/raw/pilot-diag-release.spec.json @@ -0,0 +1,15 @@ +{ + "pairs": [ + "B:H", + "B:B" + ], + "profile": "release", + "workloads": [ + "pt_asof", + "pt_av", + "pt_ea" + ], + "secs": 1.5, + "blocks": 16, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/raw/pilot-primary.jsonl.gz b/docs/audits/797/raw/pilot-primary.jsonl.gz new file mode 100644 index 0000000000..a6900b31ab Binary files /dev/null and b/docs/audits/797/raw/pilot-primary.jsonl.gz differ diff --git a/docs/audits/797/raw/pilot-primary.spec.json b/docs/audits/797/raw/pilot-primary.spec.json new file mode 100644 index 0000000000..b19b653892 --- /dev/null +++ b/docs/audits/797/raw/pilot-primary.spec.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P", + "B:B" + ], + "profile": "envelope", + "workloads": [ + "pt_ea", + "pt_av", + "pt_asof" + ], + "secs": 1.5, + "blocks": 8, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/raw/pilot-secondary.jsonl.gz b/docs/audits/797/raw/pilot-secondary.jsonl.gz new file mode 100644 index 0000000000..be119a3913 Binary files /dev/null and b/docs/audits/797/raw/pilot-secondary.jsonl.gz differ diff --git a/docs/audits/797/raw/pilot-secondary.spec.json b/docs/audits/797/raw/pilot-secondary.spec.json new file mode 100644 index 0000000000..67ba6488fc --- /dev/null +++ b/docs/audits/797/raw/pilot-secondary.spec.json @@ -0,0 +1,41 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "ab-envelope", + "workloads": [ + "sh_point_entity", + "sh_attribute_value", + "sh_attribute_scan", + "sh_join_2", + "sh_join_3_scan", + "sh_not_probe", + "sh_not_join_hash", + "sh_or_2", + "sh_recursive_ancestors", + "sh_as_of", + "sh_as_of_ts", + "sh_as_of_ts_scan", + "sh_count", + "sh_count_grouped", + "sh_window", + "sh_hot_current", + "sh_hot_as_of", + "sc_short", + "sc_long_history", + "sc_dense_uuid", + "sc_sparse_uuid", + "cw_long", + "fl_paged", + "nc_point", + "nc_scan", + "con_open", + "con_direct", + "con_checkpoint", + "con_large_tx" + ], + "secs": 1.0, + "blocks": 4, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/raw/pilot-wasi.jsonl.gz b/docs/audits/797/raw/pilot-wasi.jsonl.gz new file mode 100644 index 0000000000..d672907561 Binary files /dev/null and b/docs/audits/797/raw/pilot-wasi.jsonl.gz differ diff --git a/docs/audits/797/raw/pilot-wasi.spec.json b/docs/audits/797/raw/pilot-wasi.spec.json new file mode 100644 index 0000000000..83ce793360 --- /dev/null +++ b/docs/audits/797/raw/pilot-wasi.spec.json @@ -0,0 +1,21 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "wasi-envelope", + "workloads": [ + "wasi_pending_pt_ea", + "wasi_pending_pt_av", + "wasi_pending_scan", + "wasi_committed_pt_ea", + "wasi_committed_pt_av", + "wasi_committed_scan", + "wasi_committed_join_2", + "wasi_committed_con_direct" + ], + "secs": 1.0, + "blocks": 4, + "placement": "paired", + "wasi_entities": 5000 +} \ No newline at end of file diff --git a/docs/audits/797/raw/primary-1-envelope.jsonl.gz b/docs/audits/797/raw/primary-1-envelope.jsonl.gz new file mode 100644 index 0000000000..fa77a88b3e Binary files /dev/null and b/docs/audits/797/raw/primary-1-envelope.jsonl.gz differ diff --git a/docs/audits/797/raw/primary-1-envelope.spec.json b/docs/audits/797/raw/primary-1-envelope.spec.json new file mode 100644 index 0000000000..e480c7ec7b --- /dev/null +++ b/docs/audits/797/raw/primary-1-envelope.spec.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P", + "B:B" + ], + "profile": "envelope", + "workloads": [ + "pt_ea", + "pt_av", + "pt_asof" + ], + "secs": 1.5, + "blocks": 128, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/raw/primary-1-release.jsonl.gz b/docs/audits/797/raw/primary-1-release.jsonl.gz new file mode 100644 index 0000000000..b2223ebd02 Binary files /dev/null and b/docs/audits/797/raw/primary-1-release.jsonl.gz differ diff --git a/docs/audits/797/raw/primary-1-release.spec.json b/docs/audits/797/raw/primary-1-release.spec.json new file mode 100644 index 0000000000..7ff26a7b13 --- /dev/null +++ b/docs/audits/797/raw/primary-1-release.spec.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P", + "B:B" + ], + "profile": "release", + "workloads": [ + "pt_ea", + "pt_av", + "pt_asof" + ], + "secs": 1.5, + "blocks": 128, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/raw/primary-2-envelope.jsonl.gz b/docs/audits/797/raw/primary-2-envelope.jsonl.gz new file mode 100644 index 0000000000..afed261fe4 Binary files /dev/null and b/docs/audits/797/raw/primary-2-envelope.jsonl.gz differ diff --git a/docs/audits/797/raw/primary-2-envelope.spec.json b/docs/audits/797/raw/primary-2-envelope.spec.json new file mode 100644 index 0000000000..e480c7ec7b --- /dev/null +++ b/docs/audits/797/raw/primary-2-envelope.spec.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P", + "B:B" + ], + "profile": "envelope", + "workloads": [ + "pt_ea", + "pt_av", + "pt_asof" + ], + "secs": 1.5, + "blocks": 128, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/raw/primary-2-release.jsonl.gz b/docs/audits/797/raw/primary-2-release.jsonl.gz new file mode 100644 index 0000000000..1921cefd87 Binary files /dev/null and b/docs/audits/797/raw/primary-2-release.jsonl.gz differ diff --git a/docs/audits/797/raw/primary-2-release.spec.json b/docs/audits/797/raw/primary-2-release.spec.json new file mode 100644 index 0000000000..7ff26a7b13 --- /dev/null +++ b/docs/audits/797/raw/primary-2-release.spec.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P", + "B:B" + ], + "profile": "release", + "workloads": [ + "pt_ea", + "pt_av", + "pt_asof" + ], + "secs": 1.5, + "blocks": 128, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/raw/secondary.jsonl.gz b/docs/audits/797/raw/secondary.jsonl.gz new file mode 100644 index 0000000000..f6286bfead Binary files /dev/null and b/docs/audits/797/raw/secondary.jsonl.gz differ diff --git a/docs/audits/797/raw/secondary.spec.json b/docs/audits/797/raw/secondary.spec.json new file mode 100644 index 0000000000..67c24c830a --- /dev/null +++ b/docs/audits/797/raw/secondary.spec.json @@ -0,0 +1,41 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "ab-envelope", + "workloads": [ + "sh_point_entity", + "sh_attribute_value", + "sh_attribute_scan", + "sh_join_2", + "sh_join_3_scan", + "sh_not_probe", + "sh_not_join_hash", + "sh_or_2", + "sh_recursive_ancestors", + "sh_as_of", + "sh_as_of_ts", + "sh_as_of_ts_scan", + "sh_count", + "sh_count_grouped", + "sh_window", + "sh_hot_current", + "sh_hot_as_of", + "sc_short", + "sc_long_history", + "sc_dense_uuid", + "sc_sparse_uuid", + "cw_long", + "fl_paged", + "nc_point", + "nc_scan", + "con_open", + "con_direct", + "con_checkpoint", + "con_large_tx" + ], + "secs": 1.0, + "blocks": 48, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/raw/wasi.jsonl.gz b/docs/audits/797/raw/wasi.jsonl.gz new file mode 100644 index 0000000000..f3c23d2a42 Binary files /dev/null and b/docs/audits/797/raw/wasi.jsonl.gz differ diff --git a/docs/audits/797/raw/wasi.spec.json b/docs/audits/797/raw/wasi.spec.json new file mode 100644 index 0000000000..cd82714d4d --- /dev/null +++ b/docs/audits/797/raw/wasi.spec.json @@ -0,0 +1,21 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "wasi-envelope", + "workloads": [ + "wasi_pending_pt_ea", + "wasi_pending_pt_av", + "wasi_pending_scan", + "wasi_committed_pt_ea", + "wasi_committed_pt_av", + "wasi_committed_scan", + "wasi_committed_join_2", + "wasi_committed_con_direct" + ], + "secs": 1.0, + "blocks": 32, + "placement": "paired", + "wasi_entities": 5000 +} \ No newline at end of file diff --git a/docs/audits/797/reader_ab.rs b/docs/audits/797/reader_ab.rs new file mode 100644 index 0000000000..3888562fd8 --- /dev/null +++ b/docs/audits/797/reader_ab.rs @@ -0,0 +1,911 @@ +//! Runtime harness of the #797 reader A/B (measurement only, never shipped). +//! +//! `run.py` copies this file to `examples/reader_ab.rs` in every variant (B, +//! H, P) and builds it identically. One process runs the workloads it is +//! given and prints one JSON object per workload: +//! +//! ```text +//! reader_ab run FIXTURE WORKLOADS SECS [COLD_COPY] (native) +//! reader_ab wasi WORKLOADS SECS ENTITIES (wasm32-wasip1) +//! ``` +//! +//! `FIXTURE` is a `perf_envelope __build` 100K fixture with its `.json` +//! metadata beside it, opened read-only for warm reads. Each workload is warmed +//! up (code and runtime state, never a cold observation's pages), then timed +//! one operation at a time until `SECS` and at least five operations. Before +//! timing, every distinct query it runs is executed once outside the timed +//! loop and its complete rows, in returned order, are hashed into `digest`; +//! every timed operation checks its row count. +//! +//! Workloads that need crate internals (`con_direct`, `wasi_committed_*`) exist +//! only in a `--cfg minigraf_ab` build with `ab-hook.patch` applied. + +#![allow( + clippy::unwrap_used, + clippy::expect_used, + clippy::indexing_slicing, + clippy::cast_possible_truncation, + clippy::cast_sign_loss, + clippy::cast_precision_loss +)] +// The WASI build uses only the in-memory workloads. +#![cfg_attr(target_arch = "wasm32", allow(unused_imports, dead_code))] + +use minigraf::{BindValue, Minigraf, OpenOptions, Value}; +use std::alloc::{GlobalAlloc, Layout, System}; +use std::collections::hash_map::DefaultHasher; +use std::hash::{Hash, Hasher}; +use std::sync::atomic::{AtomicU64, Ordering}; +use std::time::{Duration, Instant}; + +/// Counts allocations (and reallocations) of the whole process. +struct Counting; + +static ALLOCS: AtomicU64 = AtomicU64::new(0); + +unsafe impl GlobalAlloc for Counting { + unsafe fn alloc(&self, layout: Layout) -> *mut u8 { + ALLOCS.fetch_add(1, Ordering::Relaxed); + unsafe { System.alloc(layout) } + } + unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { + unsafe { System.dealloc(ptr, layout) } + } + unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { + ALLOCS.fetch_add(1, Ordering::Relaxed); + unsafe { System.realloc(ptr, layout, new_size) } + } +} + +#[global_allocator] +static GLOBAL: Counting = Counting; + +const WARMUP: Duration = Duration::from_millis(300); +const MIN_OPS: usize = 5; +/// Varied point keys per family. +const VARIED: usize = 256; + +fn main() { + let args: Vec = std::env::args().skip(1).collect(); + match args[0].as_str() { + #[cfg(not(target_arch = "wasm32"))] + "run" => native::run(&args[1], &args[2], args[3].parse().unwrap(), args.get(4)), + "wasi" => wasi::run(&args[1], args[2].parse().unwrap(), args[3].parse().unwrap()), + other => panic!("unknown mode {other}"), + } +} + +// ─── Measurement ───────────────────────────────────────────────────────────── + +/// A timed workload's result, printed as one JSON line. +struct Report { + name: String, + samples: Vec, + allocs: u64, + digest: u64, + rows: u64, + extra: String, +} + +impl Report { + fn print(mut self) { + let ops = self.samples.len(); + let total: u128 = self.samples.iter().map(|&s| u128::from(s)).sum(); + self.samples.sort_unstable(); + let at = |p: f64| { + let rank = ((p * ops as f64).ceil() as usize).clamp(1, ops); + self.samples[rank - 1] + }; + println!( + "{{\"name\":\"{}\",\"ops\":{ops},\"total_ns\":{total},\"mean_ns\":{:.1},\ + \"p50_ns\":{},\"p99_ns\":{},\"allocs_per_op\":{:.2},\"digest\":\"{:016x}\",\ + \"rows\":{},\"rss_kb\":{}{}}}", + self.name, + total as f64 / ops as f64, + at(0.50), + at(0.99), + self.allocs as f64 / ops as f64, + self.digest, + self.rows, + rss_kb(), + self.extra, + ); + } +} + +/// Warm `op` up, then time it one call at a time for `secs` (and `MIN_OPS`). +/// `op(i)` returns its row count, which must equal `expect(i)`. +fn timed( + name: &str, + secs: f64, + digest: u64, + mut op: impl FnMut(usize) -> usize, + expect: impl Fn(usize) -> usize, +) -> Report { + let start = Instant::now(); + let mut i = 0; + while i < 3 || start.elapsed() < WARMUP { + assert_eq!(op(i), expect(i), "warm-up row count"); + i += 1; + } + let budget = Duration::from_secs_f64(secs); + let mut samples = Vec::with_capacity(1 << 16); + let mut rows = 0u64; + let allocs = ALLOCS.load(Ordering::Relaxed); + let start = Instant::now(); + let mut i = 0; + while samples.len() < MIN_OPS || start.elapsed() < budget { + let t = Instant::now(); + let r = op(i); + samples.push(t.elapsed().as_nanos() as u64); + assert_eq!(r, expect(i), "row count changed"); + rows += r as u64; + i += 1; + } + let allocs = ALLOCS.load(Ordering::Relaxed) - allocs; + Report { + name: name.to_string(), + samples, + allocs, + digest, + rows, + extra: String::new(), + } +} + +/// Hash of complete results in returned order. +fn hash_rows(h: &mut DefaultHasher, rows: &[Vec]) { + rows.len().hash(h); + for row in rows { + for v in row { + format!("{v:?}").hash(h); + } + } +} + +fn result_rows(r: minigraf::QueryResult) -> Vec> { + match r { + minigraf::QueryResult::QueryResults { results, .. } => results, + _ => panic!("not a query result"), + } +} + +/// Every row of a cursor, pulled in batches of `batch`. +fn drain(cursor: &mut minigraf::Cursor, batch: usize) -> Vec> { + let mut rows = Vec::new(); + while let Some(b) = cursor.next_batch(batch).unwrap() { + rows.extend(b); + } + rows +} + +fn count(cursor: &mut minigraf::Cursor, batch: usize) -> usize { + let mut n = 0; + while let Some(b) = cursor.next_batch(batch).unwrap() { + n += b.len(); + } + n +} + +fn rss_kb() -> u64 { + std::fs::read_to_string("/proc/self/status") + .ok() + .and_then(|s| { + s.lines() + .find(|l| l.starts_with("VmHWM:")) + .and_then(|l| l.split_whitespace().nth(1)) + .and_then(|v| v.parse().ok()) + }) + .unwrap_or(0) +} + +fn entity(name: &str) -> uuid::Uuid { + uuid::Uuid::new_v5(&uuid::Uuid::NAMESPACE_OID, name.as_bytes()) +} + +/// `n` keys in `0..range`, spread by a fixed LCG. +fn varied_keys(range: usize, n: usize) -> Vec { + let mut x: u64 = 0x2545_f491_4f6c_dd1d; + (0..n) + .map(|_| { + x = x.wrapping_mul(6_364_136_223_846_793_005).wrapping_add(1); + ((x >> 33) as usize) % range + }) + .collect() +} + +// ─── Point families ────────────────────────────────────────────────────────── + +/// One point family: a key-to-query mapping, read through the three entry +/// points with fixed, varied and missing keys. +struct Family { + name: &'static str, + /// Query text for key `k` (`None`: a missing entity or value). + text: Box, usize) -> String>, + /// Prepared form and its binding for a key. + prepared: String, + slot: &'static str, + bind: Box, usize) -> BindValue>, + fixed: usize, + keys: Vec, +} + +impl Family { + /// The key of operation `i`: combination `i % 9` is (entry, key mode). + fn key(&self, i: usize) -> (usize, Option, usize) { + let combo = i % 9; + let j = (i / 9) % self.keys.len(); + let key = match combo % 3 { + 0 => Some(self.fixed), + 1 => Some(self.keys[j]), + _ => None, + }; + (combo / 3, key, j) + } +} + +fn families(entities: usize, tx_half: u64) -> Vec { + let m = entities / 2; + vec![ + Family { + name: "pt_ea", + text: Box::new(|k, j| match k { + Some(k) => format!("(query [:find ?a :where [:p{k} :age ?a]])"), + None => format!("(query [:find ?a :where [:missing{j} :age ?a]])"), + }), + prepared: "(query [:find ?a :where [$e :age ?a]])".into(), + slot: "e", + bind: Box::new(|k, j| match k { + Some(k) => BindValue::Entity(entity(&format!(":p{k}"))), + None => BindValue::Entity(entity(&format!(":missing{j}"))), + }), + fixed: m, + keys: varied_keys(entities, VARIED), + }, + Family { + name: "pt_av", + text: Box::new(|k, j| match k { + Some(k) => format!("(query [:find ?e :where [?e :name \"p{k}\"]])"), + None => format!("(query [:find ?e :where [?e :name \"nope{j}\"]])"), + }), + prepared: "(query [:find ?e :where [?e :name $v]])".into(), + slot: "v", + bind: Box::new(|k, j| match k { + Some(k) => BindValue::Val(Value::String(format!("p{k}"))), + None => BindValue::Val(Value::String(format!("nope{j}"))), + }), + fixed: m, + keys: varied_keys(entities, VARIED), + }, + Family { + name: "pt_asof", + text: Box::new(move |k, j| match k { + Some(k) => format!("(query [:find ?a :as-of {tx_half} :where [:p{k} :age ?a]])"), + None => { + format!("(query [:find ?a :as-of {tx_half} :where [:missing{j} :age ?a]])") + } + }), + prepared: format!("(query [:find ?a :as-of {tx_half} :where [$e :age ?a]])"), + slot: "e", + bind: Box::new(|k, j| match k { + Some(k) => BindValue::Entity(entity(&format!(":p{k}"))), + None => BindValue::Entity(entity(&format!(":missing{j}"))), + }), + // Entities below e/4 were written before `tx_half`. + fixed: m / 4, + keys: varied_keys(entities / 4, VARIED), + }, + ] +} + +/// Time one point family on `db`: the nine (entry point × key mode) +/// combinations in turn. Query texts are built before timing. +fn point_family(db: &Minigraf, f: &Family, secs: f64, name: &str) -> Report { + let prepared = db.prepare(&f.prepared).unwrap(); + let n = f.keys.len(); + let texts: Vec<[String; 3]> = (0..n) + .map(|j| { + [ + (f.text)(Some(f.fixed), j), + (f.text)(Some(f.keys[j]), j), + (f.text)(None, j), + ] + }) + .collect(); + let binds: Vec<[BindValue; 3]> = (0..n) + .map(|j| { + [ + (f.bind)(Some(f.fixed), j), + (f.bind)(Some(f.keys[j]), j), + (f.bind)(None, j), + ] + }) + .collect(); + let run = |i: usize| -> Vec> { + let (entry, key, j) = f.key(i); + let mode = (i % 9) % 3; + match entry { + 0 => result_rows(db.execute(&texts[j][mode]).unwrap()), + 1 => result_rows( + prepared + .execute(&[(f.slot, binds[j][mode].clone())]) + .unwrap(), + ), + _ => { + let mut c = db.query(&texts[j][mode]).unwrap(); + let _ = key; + drain(&mut c, 1) + } + } + }; + // Validation: every distinct query, all three entry points equal. + let mut h = DefaultHasher::new(); + let mut expect = vec![0usize; 9 * n]; + for i in 0..9 * n { + let rows = run(i); + expect[i] = rows.len(); + hash_rows(&mut h, &rows); + } + for i in 0..9 * n { + let e = expect[i - (i % 9) + (i % 3)]; + assert_eq!(expect[i], e, "entry points disagree"); + } + let digest = h.finish(); + let mut r = timed( + name, + secs, + digest, + |i| { + let (entry, _, j) = f.key(i); + let mode = (i % 9) % 3; + match entry { + 0 => result_rows(db.execute(&texts[j][mode]).unwrap()).len(), + 1 => result_rows( + prepared + .execute(&[(f.slot, binds[j][mode].clone())]) + .unwrap(), + ) + .len(), + _ => count(&mut db.query(&texts[j][mode]).unwrap(), 1), + } + }, + |i| expect[i % (9 * n)], + ); + // Per-entry-point means, for the breakdown (not the decision metric). + r.extra = String::new(); + r +} + +// ─── Query shapes ──────────────────────────────────────────────────────────── + +/// The 17 warm-read shapes of the #772 audit (`compare.py` indices of the +/// pinned `perf_envelope`), rebuilt from the fixture metadata. +fn audit_shapes(entities: usize, tx_half: u64, tx_half_time: &str, hot_tx_half: u64) -> Vec<(&'static str, String)> { + let e = entities; + let m = e / 2; + let leaf = e - 1; + vec![ + ("point_entity", format!("[:find ?a :where [:p{m} :age ?a]]")), + ("attribute_value", format!("[:find ?e :where [?e :name \"p{m}\"]]")), + ("attribute_scan", "[:find ?e ?a :where [?e :age ?a]]".into()), + ("join_2", format!("[:find ?n :where [:p{m} :follows ?f] [?f :name ?n]]")), + ("join_3_scan", "[:find ?e ?n :where [?e :follows ?f] [?f :group 7] [?f :name ?n]]".into()), + ("not_probe", "[:find ?e :where [?e :group 7] (not [?e :age 7])]".into()), + ( + "not_join_hash", + "[:find ?e :where [?e :group 7] [?e :age ?a] \ + (not-join [?a] [?f :group 17] [?f :age ?a] [(< ?a 50)])]" + .into(), + ), + ( + "or_2", + "[:find ?e :where [?e :group 7] [?e :age ?a] \ + (or-join [?a] (and [?f :group 17] [?f :age ?a] [(< ?a 30)]) \ + (and [?g :group 27] [?g :age ?a] [(> ?a 60)]))]" + .into(), + ), + ("recursive_ancestors", format!("[:find ?b :where (boss :p{leaf} ?b)]")), + ("as_of", format!("[:find ?a :as-of {tx_half} :where [:p{} :age ?a]]", m / 4)), + ( + "as_of_ts", + format!("[:find ?a :as-of \"{tx_half_time}\" :where [:p{} :age ?a]]", m / 4), + ), + ( + "as_of_ts_scan", + format!("[:find ?e ?a :as-of \"{tx_half_time}\" :where [?e :age ?a]]"), + ), + ("count", "[:find (count ?v) :where [?e ?a ?v]]".into()), + ("count_grouped", "[:find ?g (count ?e) :where [?e :group ?g]]".into()), + ("window", "[:find ?e (rank :over (:order-by ?a)) :where [?e :age ?a]]".into()), + ("hot_current", "[:find ?v :where [:hot :counter ?v]]".into()), + ( + "hot_as_of", + format!( + "[:find ?v :as-of {hot_tx_half} :valid-at :any-valid-time :where [:hot :counter ?v]]" + ), + ), + ] +} + +/// Time one query drained in cursor batches of `batch`. +fn shape(db: &Minigraf, name: &str, query: &str, secs: f64, batch: usize) -> Report { + let q = if query.starts_with('(') { + query.to_string() + } else { + format!("(query {query})") + }; + let mut h = DefaultHasher::new(); + let rows = drain(&mut db.query(&q).unwrap(), batch); + hash_rows(&mut h, &rows); + let n = rows.len(); + drop(rows); + timed( + name, + secs, + h.finish(), + |_| count(&mut db.query(&q).unwrap(), batch), + |_| n, + ) +} + +fn define_rules(db: &Minigraf) { + db.execute("(rule [(boss ?x ?y) [?x :manager ?y]])").unwrap(); + db.execute("(rule [(boss ?x ?z) [?x :manager ?y] (boss ?y ?z)])") + .unwrap(); +} + +// ─── Native ────────────────────────────────────────────────────────────────── + +#[cfg(not(target_arch = "wasm32"))] +mod native { + use super::*; + use minigraf::{FactFilter, FactOrder}; + use std::path::Path; + + struct Meta { + entities: usize, + tx_half: u64, + hot_tx_half: u64, + tx_half_time: String, + } + + fn meta(fixture: &Path) -> Meta { + let s = std::fs::read_to_string(fixture.with_extension("json")).unwrap(); + let num = |k: &str| -> u64 { + let at = s.find(&format!("\"{k}\":")).unwrap() + k.len() + 3; + s[at..] + .chars() + .take_while(char::is_ascii_digit) + .collect::() + .parse() + .unwrap() + }; + let tx_half = num("tx_half"); + let db = OpenOptions::new().read_only(true).path(fixture).open().unwrap(); + let rec = db + .fact_log(&FactFilter::new().tx_range(tx_half..=tx_half)) + .unwrap() + .next_batch(1) + .unwrap() + .unwrap() + .remove(0); + let t = chrono::DateTime::from_timestamp_millis(rec.tx_id as i64).unwrap(); + Meta { + entities: num("entities") as usize, + tx_half, + hot_tx_half: num("hot_tx_half"), + tx_half_time: t.format("%Y-%m-%dT%H:%M:%S%.3fZ").to_string(), + } + } + + fn open_ro(fixture: &Path, cache: Option) -> Minigraf { + let mut o = OpenOptions::new() + .read_only(true) + .max_derived_facts(usize::MAX); + if let Some(c) = cache { + o = o.page_cache_size(c); + } + let db = o.path(fixture).open().unwrap(); + define_rules(&db); + db + } + + pub fn run(fixture: &str, workloads: &str, secs: f64, cold_copy: Option<&String>) { + let fixture = Path::new(fixture); + let meta = meta(fixture); + let db = open_ro(fixture, None); + let fams = families(meta.entities, meta.tx_half); + let shapes = audit_shapes(meta.entities, meta.tx_half, &meta.tx_half_time, meta.hot_tx_half); + for w in workloads.split(',') { + let report = match w { + "pt_ea" | "pt_av" | "pt_asof" => { + let f = fams.iter().find(|f| f.name == w).unwrap(); + point_family(&db, f, secs, w) + } + _ if w.starts_with("sh_") => { + let (_, q) = shapes.iter().find(|(n, _)| *n == &w[3..]).unwrap(); + shape(&db, w, q, secs, 1_000) + } + // Populated committed scans: short history, long history, + // dense and sparse UUID projection. + "sc_short" => shape(&db, w, "[:find ?e ?a :where [?e :age ?a]]", secs, 1_000), + "sc_long_history" => shape( + &db, + w, + "[:find ?e ?v :valid-at :any-valid-time :where [?e :counter ?v]]", + secs, + 1_000, + ), + "sc_dense_uuid" => shape(&db, w, "[:find ?e :where [?e :age ?a]]", secs, 1_000), + "sc_sparse_uuid" => shape(&db, w, "[:find ?e :where [?e :group 7]]", secs, 1_000), + // Long cursor walk in small batches. + "cw_long" => shape(&db, w, "[:find ?e ?a :where [?e :age ?a]]", secs, 100), + "fl_paged" => fact_log(&db, w, secs), + // Application page cache disabled (OS cache warm). + "nc_point" => { + let db = open_ro(fixture, Some(0)); + point_family(&db, &fams[0], secs, w) + } + "nc_scan" => { + let db = open_ro(fixture, Some(0)); + shape(&db, w, "[:find ?e ?a :where [?e :age ?a]]", secs, 1_000) + } + "con_open" => con_open(fixture, w, secs), + "con_checkpoint" => con_checkpoint(cold_copy.expect("scratch copy"), w, secs), + "con_large_tx" => con_large_tx(cold_copy.expect("scratch copy"), w, secs, &meta), + #[cfg(minigraf_ab)] + "con_direct" => { + let mut r = timed( + w, + secs, + 0, + |_| { + db.ab_construct_readers(1).unwrap(); + 0 + }, + |_| 0, + ); + r.extra = String::new(); + r + } + "cold_point" | "cold_scan" => cold(fixture, cold_copy.expect("cold copy"), w, secs, &meta), + _ if w.starts_with("cc_") => concurrent(fixture, &fams[0], w, secs), + other => panic!("unknown workload {other}"), + }; + report.print(); + } + } + + /// Every committed fact version through the fact log, paged. + fn fact_log(db: &Minigraf, name: &str, secs: f64) -> Report { + let filter = FactFilter::new() + .attributes([":age"]) + .order(FactOrder::Storage); + let walk = |h: Option<&mut DefaultHasher>| -> usize { + let mut log = db.fact_log(&filter).unwrap(); + let mut n = 0; + let mut h = h; + while let Some(page) = log.next_batch(500).unwrap() { + n += page.len(); + if let Some(h) = h.as_deref_mut() { + for r in &page { + (r.entity.as_u128(), &r.attribute, format!("{:?}", r.value), r.tx_count, r.tx_id, r.valid_from, r.valid_to, r.asserted).hash(h); + } + } + } + n + }; + let mut h = DefaultHasher::new(); + let n = walk(Some(&mut h)); + timed(name, secs, h.finish(), |_| walk(None), |_| n) + } + + fn con_open(fixture: &Path, name: &str, secs: f64) -> Report { + timed( + name, + secs, + 0, + |_| { + let db = OpenOptions::new().read_only(true).path(fixture).open().unwrap(); + drop(db); + 0 + }, + |_| 0, + ) + } + + /// A dirty checkpoint that publishes a new generation: one small + /// transaction (not timed), then the timed checkpoint. + fn con_checkpoint(copy: &str, name: &str, secs: f64) -> Report { + let db = OpenOptions::new() + .wal_checkpoint_threshold(usize::MAX) + .path(copy) + .open() + .unwrap(); + let mut n = 0u64; + let mut samples = Vec::new(); + let write = |n: &mut u64| { + db.execute(&format!("(transact [[:ckpt :n {n}]])")).unwrap(); + *n += 1; + }; + for _ in 0..3 { + write(&mut n); + db.checkpoint().unwrap(); + } + let allocs = ALLOCS.load(Ordering::Relaxed); + let mut alloc_skip = 0; + let start = Instant::now(); + while samples.len() < MIN_OPS || start.elapsed() < Duration::from_secs_f64(secs) { + let a = ALLOCS.load(Ordering::Relaxed); + write(&mut n); + alloc_skip += ALLOCS.load(Ordering::Relaxed) - a; + let t = Instant::now(); + db.checkpoint().unwrap(); + samples.push(t.elapsed().as_nanos() as u64); + } + Report { + name: name.into(), + samples, + allocs: ALLOCS.load(Ordering::Relaxed) - allocs - alloc_skip, + digest: 0, + rows: 0, + extra: String::new(), + } + } + + /// Reads inside a large file-backed `WriteTransaction`: each read builds + /// a fresh reader over the working trees. + fn con_large_tx(copy: &str, name: &str, secs: f64, meta: &Meta) -> Report { + let db = OpenOptions::new() + .wal_checkpoint_threshold(usize::MAX) + .transaction_chunk_facts(1) + .path(copy) + .open() + .unwrap(); + let mut tx = db.begin_write().unwrap(); + tx.execute("(transact [[:big :a 1] [:big :b 2] [:big :c 3]])") + .unwrap(); + let m = meta.entities / 2; + let q = format!("(query [:find ?a :where [:p{m} :age ?a]])"); + let mut h = DefaultHasher::new(); + let rows = result_rows(tx.execute(&q).unwrap()); + hash_rows(&mut h, &rows); + let big = result_rows(tx.execute("(query [:find ?v :where [:big :b ?v]])").unwrap()); + assert_eq!(big.len(), 1, "read-your-writes"); + let n = rows.len(); + let r = timed( + name, + secs, + h.finish(), + |_| result_rows(tx.execute(&q).unwrap()).len(), + |_| n, + ); + tx.rollback(); + r + } + + unsafe extern "C" { + fn posix_fadvise(fd: i32, offset: i64, len: i64, advice: i32) -> i32; + fn mmap(addr: *mut u8, len: usize, prot: i32, flags: i32, fd: i32, off: i64) -> *mut u8; + fn munmap(addr: *mut u8, len: usize) -> i32; + fn mincore(addr: *mut u8, len: usize, vec: *mut u8) -> i32; + } + const POSIX_FADV_DONTNEED: i32 = 4; + const PROT_READ: i32 = 1; + const MAP_SHARED: i32 = 1; + + /// Drop `path`'s clean pages from the OS page cache, then count the + /// pages still resident. + fn evict(path: &Path) -> usize { + use std::os::fd::AsRawFd; + let f = std::fs::File::open(path).unwrap(); + let len = f.metadata().unwrap().len() as usize; + let rc = unsafe { posix_fadvise(f.as_raw_fd(), 0, 0, POSIX_FADV_DONTNEED) }; + assert_eq!(rc, 0, "posix_fadvise"); + let pages = len.div_ceil(4096); + let mut vec = vec![0u8; pages]; + unsafe { + let p = mmap(std::ptr::null_mut(), len, PROT_READ, MAP_SHARED, f.as_raw_fd(), 0); + assert!(!p.is_null() && p as isize != -1, "mmap"); + assert_eq!(mincore(p, len, vec.as_mut_ptr()), 0, "mincore"); + munmap(p, len); + } + vec.iter().filter(|&&b| b & 1 == 1).count() + } + + /// Cold observations: each opens its own handle (empty application + /// cache), evicts the copy from the OS page cache, checks residency, then + /// times one query. Warm-up runs on the fixture, not the copy. + fn cold(fixture: &Path, copy: &str, name: &str, secs: f64, meta: &Meta) -> Report { + let copy = Path::new(copy); + let q = if name == "cold_point" { + format!("(query [:find ?a :where [:p{} :age ?a]])", meta.entities / 2) + } else { + "(query [:find ?e ?a :where [?e :age ?a]])".to_string() + }; + let warm = open_ro(fixture, None); + let mut h = DefaultHasher::new(); + let rows = drain(&mut warm.query(&q).unwrap(), 1_000); + hash_rows(&mut h, &rows); + let n = rows.len(); + for _ in 0..3 { + assert_eq!(count(&mut warm.query(&q).unwrap(), 1_000), n); + } + drop(warm); + let mut samples = Vec::new(); + let mut resident = 0usize; + let mut file_pages = 0usize; + let mut allocs = 0u64; + let start = Instant::now(); + while samples.len() < MIN_OPS || start.elapsed() < Duration::from_secs_f64(secs) { + let db = OpenOptions::new().read_only(true).path(copy).open().unwrap(); + resident += evict(copy); + file_pages = (std::fs::metadata(copy).unwrap().len() as usize).div_ceil(4096); + let a = ALLOCS.load(Ordering::Relaxed); + let t = Instant::now(); + let r = count(&mut db.query(&q).unwrap(), 1_000); + samples.push(t.elapsed().as_nanos() as u64); + allocs += ALLOCS.load(Ordering::Relaxed) - a; + assert_eq!(r, n, "row count changed"); + } + let ops = samples.len(); + Report { + name: name.into(), + samples, + allocs, + digest: h.finish(), + rows: (n * ops) as u64, + extra: format!(",\"resident_pages_after_evict\":{resident},\"file_pages\":{file_pages}"), + } + } + + /// `threads` readers sharing one handle, each running the entity/attribute + /// family's text queries. `mean_ns` is wall time per operation (inverse + /// throughput); percentiles are per query. + fn concurrent(fixture: &Path, f: &Family, name: &str, secs: f64) -> Report { + let threads: usize = name[3..].parse().unwrap(); + let db = std::sync::Arc::new(open_ro(fixture, None)); + let texts: Vec = (0..f.keys.len()) + .flat_map(|j| [(f.text)(Some(f.fixed), j), (f.text)(Some(f.keys[j]), j), (f.text)(None, j)]) + .collect(); + let texts = std::sync::Arc::new(texts); + let expect = |i: usize| usize::from(i % 3 != 2); + for i in 0..texts.len() { + assert_eq!(result_rows(db.execute(&texts[i]).unwrap()).len(), expect(i)); + } + let barrier = std::sync::Arc::new(std::sync::Barrier::new(threads + 1)); + let budget = Duration::from_secs_f64(secs); + let handles: Vec<_> = (0..threads) + .map(|t| { + let (db, texts, barrier) = (db.clone(), texts.clone(), barrier.clone()); + std::thread::spawn(move || { + for i in 0..texts.len() { + db.execute(&texts[(i + t) % texts.len()]).unwrap(); + } + barrier.wait(); + let mut samples = Vec::new(); + let start = Instant::now(); + let mut i = t * 7; + while samples.len() < MIN_OPS || start.elapsed() < budget { + let k = i % texts.len(); + let s = Instant::now(); + let r = result_rows(db.execute(&texts[k]).unwrap()).len(); + samples.push(s.elapsed().as_nanos() as u64); + assert_eq!(r, usize::from(k % 3 != 2)); + i += 1; + } + samples + }) + }) + .collect(); + barrier.wait(); + let allocs = ALLOCS.load(Ordering::Relaxed); + let start = Instant::now(); + let mut samples = Vec::new(); + for h in handles { + samples.extend(h.join().unwrap()); + } + let wall = start.elapsed().as_nanos() as u64; + let ops = samples.len(); + let allocs = ALLOCS.load(Ordering::Relaxed) - allocs; + let mut r = Report { + name: name.into(), + samples, + allocs, + digest: 0, + rows: 0, + extra: format!(",\"threads\":{threads},\"wall_ns\":{wall},\"wall_ns_per_op\":{:.1}", wall as f64 / ops as f64), + }; + // The decision metric is wall time per operation: report it as the mean. + let per_op = wall as f64 / ops as f64; + r.extra.push_str(&format!(",\"query_mean_ns\":{:.1}", r.samples.iter().map(|&s| s as f64).sum::() / ops as f64)); + r.extra.push_str(&format!(",\"inverse_throughput_ns\":{per_op:.1}")); + r + } +} + +// ─── WASI ──────────────────────────────────────────────────────────────────── + +mod wasi { + use super::*; + + /// The fixture's facts for `entities` entities, as `perf_envelope` builds + /// them (without valid-time history). + fn transactions(entities: usize) -> Vec { + let mut out = Vec::new(); + for lo in (0..entities).step_by(200) { + let hi = (lo + 200).min(entities); + let mut cmd = String::from("(transact ["); + for i in lo..hi { + let follows = (i * 7919 + 1) % entities; + cmd.push_str(&format!( + "[:p{i} :name \"p{i}\"][:p{i} :age {}][:p{i} :group {}][:p{i} :follows :p{follows}]", + i % 90, + i % 100 + )); + if i > 0 { + cmd.push_str(&format!("[:p{i} :manager :p{}]", i / 10)); + } + } + cmd.push_str("])"); + out.push(cmd); + } + out + } + + /// `wasi_pending_*`: the CLI's own path, `Minigraf::in_memory`, where + /// every fact stays pending. `wasi_committed_*`: the same facts + /// checkpointed into a memory backend and read through a populated + /// committed reader (`--cfg minigraf_ab`). + pub fn run(workloads: &str, secs: f64, entities: usize) { + let txs = transactions(entities); + let pending = Minigraf::in_memory().unwrap(); + for t in &txs { + pending.execute(t).unwrap(); + } + define_rules(&pending); + #[cfg(minigraf_ab)] + let committed = { + let c = minigraf::db::AbCommittedMemory::new(&txs).unwrap(); + define_rules(&c.db); + c + }; + let fams = families(entities, 0); + for w in workloads.split(',') { + let (kind, rest) = w.strip_prefix("wasi_").unwrap().split_once('_').unwrap(); + let db: &Minigraf = match kind { + "pending" => &pending, + #[cfg(minigraf_ab)] + "committed" => &committed.db, + other => panic!("unknown kind {other}"), + }; + let report = match rest { + "pt_ea" | "pt_av" => { + let f = fams.iter().find(|f| f.name == rest).unwrap(); + point_family(db, f, secs, w) + } + "scan" => shape(db, w, "[:find ?e ?a :where [?e :age ?a]]", secs, 1_000), + "join_2" => shape( + db, + w, + &format!("[:find ?n :where [:p{} :follows ?f] [?f :name ?n]]", entities / 2), + secs, + 1_000, + ), + #[cfg(minigraf_ab)] + "con_direct" if kind == "committed" => timed( + w, + secs, + 0, + |_| { + committed.construct_readers(1); + 0 + }, + |_| 0, + ), + other => panic!("unknown workload {other}"), + }; + report.print(); + } + } +} diff --git a/docs/audits/797/report.py b/docs/audits/797/report.py new file mode 100644 index 0000000000..7a583191a6 --- /dev/null +++ b/docs/audits/797/report.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 +"""Markdown tables of the #797 evidence, from analyze.py's summary. + + report.py SUMMARY.json > tables.md + +Prints, per category, every workload's B:H and B:P bound against its gate, +and the B:B control of each primary campaign. No pooled score. +""" +import json +import sys + +summary = json.load(open(sys.argv[1])) +PRIMARY = {"pt_ea", "pt_av", "pt_asof"} +# Workloads with no result to hash: construction and checkpoint time only. +NO_RESULT = {"con_open", "con_direct", "con_checkpoint", "wasi_committed_con_direct"} + + +def gate(row): + if row["campaign"].startswith("primary"): + return 1.02 if row["workload"] in PRIMARY else None + return 1.05 + + +def validation(row): + """How the workload's results were checked against B.""" + w = row["workload"] + if w in NO_RESULT: + return "none (no result)" + if w.startswith("cc_"): + return "row counts only" + if w.startswith("cold_"): + return "digest of a warm run; cold reads row counts only" + return "digest of complete results; timed reads row counts" + + +def ns(x): + return f"{x:,.1f}" + + +def verdict(row): + if row["digest_or_row_mismatches"]: + return "FAIL (results differ)" + g = gate(row) + if row["pair"] == "B:B": + ok = row["lower95"] >= 0.98 and row["upper95"] <= 1.02 + return "resolves ±2%" if ok else "INCONCLUSIVE" + if g is None: + return "" + within = row["upper95"] <= g + if row["workload"].startswith("cold_"): + # acceptance-plan.json: residency after eviction must be 0. + return ("bound ≤ 1.05" if within else "FAIL") + "; category outstanding: residency ≠ 0" + if row["workload"].startswith("cc_"): + return ("bound ≤ 1.05" if within else "FAIL") + "; not fully accepted: results not digested" + return "pass" if within else "FAIL" + + +def allocs(row): + if row["campaign"] == "browser": + return "n/a" + return f"{row['base_allocs_per_op']:.1f}→{row['cand_allocs_per_op']:.1f}" + + +def rss(row): + if row["campaign"] in ("browser", "wasi"): + return "n/a" + return f"{row['base_rss_kb']:,.0f}→{row['cand_rss_kb']:,.0f}" + + +by_campaign = {} +for r in summary: + by_campaign.setdefault(r["campaign"], []).append(r) + +print("Means, deltas and percentiles are medians over blocks, in ns. Δ is the candidate's median " + "block mean minus the base's (for `cc_*`, wall ns per operation). Allocations and RSS are " + "n/a where the harness cannot measure them: browser (both) and WASI (RSS).") +for campaign in sorted(by_campaign, key=lambda c: (not c.startswith("primary"), c)): + rows = sorted(by_campaign[campaign], key=lambda r: (r["workload"], r["pair"])) + print(f"\n### {campaign}\n") + print("Workload | Pair | Blocks | Ratio | 95% upper | Gate | Verdict | Validation | Base mean | Cand mean | Δ | " + "Base p50/p99 | Cand p50/p99 | Allocs/op B→C | RSS KiB B→C") + print("---|---|---:|---:|---:|---:|---|---|---:|---:|---:|---:|---:|---:|---:") + for r in rows: + g = gate(r) + extra = "" + if "resident_pages_per_observation_max" in r: + extra = (f" (pages resident after eviction, per observation: median " + f"{r['resident_pages_per_observation_median']:.1f}, worst process " + f"{r['resident_pages_per_observation_max']:.1f}, of {r['file_pages']})") + print( + f"{r['workload']}{extra} | {r['pair']} | {r['blocks']} | {r['ratio_geomean']:.4f} | " + f"{r['upper95']:.4f} | {g if g and r['pair'] != 'B:B' else ('±2% control' if r['pair'] == 'B:B' else '')} | " + f"{verdict(r)} | {validation(r)} | {ns(r['base_metric_median'])} | {ns(r['cand_metric_median'])} | " + f"{r['cand_metric_median'] - r['base_metric_median']:+,.1f} | " + f"{r['base_p50_ns']:,.0f}/{r['base_p99_ns']:,.0f} | {r['cand_p50_ns']:,.0f}/{r['cand_p99_ns']:,.0f} | " + f"{allocs(r)} | {rss(r)}" + ) diff --git a/docs/audits/797/run.py b/docs/audits/797/run.py new file mode 100644 index 0000000000..c6efc21dd2 --- /dev/null +++ b/docs/audits/797/run.py @@ -0,0 +1,216 @@ +#!/usr/bin/env python3 +"""Build and run the #797 reader A/B on the bench machine. + + run.py setup ROOT build every variant's binaries, the fixture + run.py campaign ROOT NAME SPEC.json run one fixed-size campaign + run.py wasi ROOT NAME SPEC.json the same, under Wasmtime + +ROOT holds the variant sources (ROOT/src/{B,H,P}, each with the shared +Cargo.lock), ROOT/bin, ROOT/fixture and ROOT/raw. A campaign SPEC fixes, before +any of its results are seen: pairs, profile, workloads, seconds per workload, +block count, placement ("paired": base and candidate at once on NUMA nodes 1 +and 3, swapped every block; "sequential": one at a time on `nodes`, order +alternating). Every process's output is appended to raw/NAME.jsonl as it +arrives; nothing is retried or dropped. +""" +import hashlib +import json +import os +import shutil +import subprocess +import sys +import time +from concurrent.futures import ThreadPoolExecutor +from pathlib import Path + +VARIANTS = ["B", "H", "P"] +HERE = Path(__file__).resolve().parent + + +def sha256(path): + return hashlib.sha256(Path(path).read_bytes()).hexdigest() + + +def sh(cmd, cwd=None, env=None, out=None): + e = dict(os.environ) + e.pop("RUSTFLAGS", None) + e.update(env or {}) + with open(out, "a") if out else open(os.devnull, "w") as log: + subprocess.run(cmd, cwd=cwd, env=e, check=True, stdout=log, stderr=subprocess.STDOUT) + + +def setup(root): + root = Path(root) + bins = root / "bin" + bins.mkdir(parents=True, exist_ok=True) + log = root / "build.log" + builds = { + # name: (cargo args, env, artifact under the variant's source) + "envelope": (["--profile", "envelope"], {}, "target/envelope/examples/reader_ab"), + "release": (["--release"], {}, "target/release/examples/reader_ab"), + "ab-envelope": (["--profile", "envelope"], + {"RUSTFLAGS": "--cfg minigraf_ab", "CARGO_TARGET_DIR": "target-ab"}, + "target-ab/envelope/examples/reader_ab"), + "wasi-envelope": (["--profile", "envelope", "--target", "wasm32-wasip1"], + {"RUSTFLAGS": "--cfg minigraf_ab", "CARGO_TARGET_DIR": "target-ab"}, + "target-ab/wasm32-wasip1/envelope/examples/reader_ab.wasm"), + } + manifest = {"rustc": subprocess.check_output(["rustc", "-Vv"], text=True), + "harness_sha256": sha256(HERE / "reader_ab.rs"), + "hook_patch_sha256": sha256(HERE / "ab-hook.patch"), + "variants": {}} + for v in VARIANTS: + src = root / "src" / v + shutil.copy(HERE / "reader_ab.rs", src / "examples" / "reader_ab.rs") + info = {"commit": subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=src, text=True).strip(), + "lock_sha256": sha256(src / "Cargo.lock"), + "reader_rs_sha256": sha256(src / "src/storage/reader.rs"), + "binaries": {}} + for name, (args, env, artifact) in builds.items(): + sh(["cargo", "build", "--locked", "--example", "reader_ab", *args], cwd=src, env=env, out=log) + dst = bins / f"{v}-{name}" if not artifact.endswith(".wasm") else bins / f"{v}-{name}.wasm" + shutil.copy(src / artifact, dst) + info["binaries"][name] = {"file": dst.name, "sha256": sha256(dst), + "cargo": " ".join(args), "env": env} + # The browser module: an example built as a wasm-bindgen test, the + # release profile without LTO (see ab_browser.rs). + shutil.copy(HERE / "ab_browser.rs", src / "examples" / "ab_browser.rs") + built = subprocess.run( + ["cargo", "test", "--locked", "--release", "--target", "wasm32-unknown-unknown", + "--features", "browser", "--example", "ab_browser", "--no-run", "--message-format=json"], + cwd=src, env={**{k: x for k, x in os.environ.items() if k != "RUSTFLAGS"}, + "CARGO_PROFILE_RELEASE_LTO": "false"}, + check=True, text=True, capture_output=True).stdout + wasm = [m["executable"] for m in map(json.loads, built.splitlines()) + if m.get("reason") == "compiler-artifact" and m["target"]["name"] == "ab_browser" + and m.get("executable")][-1] + dst = bins / f"{v}-browser.wasm" + shutil.copy(wasm, dst) + info["binaries"]["browser"] = {"file": dst.name, "sha256": sha256(dst), + "cargo": "test --release --target wasm32-unknown-unknown --features browser --example ab_browser --no-run", + "env": {"CARGO_PROFILE_RELEASE_LTO": "false"}} + manifest["variants"][v] = info + # The fixture: B's perf_envelope build of 100K facts. + fx = root / "fixture" + fx.mkdir(exist_ok=True) + graph = fx / "fixture-100k.graph" + if not graph.exists(): + src = root / "src" / "B" + sh(["cargo", "build", "--locked", "--profile", "envelope", "--example", "perf_envelope"], cwd=src, out=log) + meta = subprocess.check_output([src / "target/envelope/examples/perf_envelope", "__build", graph, "100000"], text=True) + (fx / "fixture-100k.json").write_text(meta) + manifest["fixture"] = {"file": graph.name, "sha256": sha256(graph), + "meta": json.loads((fx / "fixture-100k.json").read_text())} + (root / "manifest.json").write_text(json.dumps(manifest, indent=2) + "\n") + print(json.dumps(manifest["fixture"])) + + +def process(root, variant, profile, workloads, secs, node_args, scratch, wasi_entities=None): + """Run one harness process; returns its parsed reports.""" + root = Path(root) + if profile == "browser": + # One headless Firefox run of the prebuilt ab_browser module, from + # the harness directory, where webdriver.json is. + env = dict(os.environ) + env["GECKODRIVER"] = shutil.which("geckodriver") or "geckodriver" + cmd = [str(root / "tools" / "wasm-bindgen-test-runner"), + str(root / "bin" / f"{variant}-browser.wasm"), "--nocapture"] + out = subprocess.run(node_args + cmd, cwd=HERE, env=env, check=True, text=True, capture_output=True).stdout + return [json.loads(line[line.index("AB {") + 3:]) for line in out.splitlines() if "AB {" in line] + if wasi_entities is not None: + wasm = root / "bin" / f"{variant}-{profile}.wasm" + cmd = [str(root / "tools" / "wasmtime"), "run", str(wasm), "wasi", ",".join(workloads), str(secs), str(wasi_entities)] + else: + exe = root / "bin" / f"{variant}-{profile}" + cmd = [str(exe), "run", str(root / "fixture" / "fixture-100k.graph"), ",".join(workloads), str(secs)] + if scratch: + cmd.append(str(scratch)) + out = subprocess.run(node_args + cmd, check=True, text=True, capture_output=True).stdout + return [json.loads(line) for line in out.splitlines() if line.startswith("{")] + + +def numa(nodes): + return ["numactl", f"--cpunodebind={nodes}", f"--membind={nodes}"] + + +def campaign(root, name, spec_path, wasi=False): + root = Path(root) + spec = json.loads(Path(spec_path).read_text()) + raw = root / "raw" + raw.mkdir(exist_ok=True) + out = raw / f"{name}.jsonl" + assert not out.exists(), f"{out} exists: campaigns are never rerun into the same file" + shutil.copy(spec_path, raw / f"{name}.spec.json") + scratch_dir = root / "scratch" + scratch_dir.mkdir(exist_ok=True) + fixture = root / "fixture" / "fixture-100k.graph" + needs_scratch = any(w.startswith(("con_checkpoint", "con_large_tx", "cold_")) for w in spec["workloads"]) + + def scratch_for(tag): + if not needs_scratch: + return None + p = scratch_dir / f"{name}-{tag}.graph" + shutil.copy(fixture, p) + return p + + def cleanup(p): + if p: + for f in (p, Path(str(p) + ".wal")): + f.unlink(missing_ok=True) + + pairs = spec["pairs"] + blocks = spec["blocks"] + entities = spec.get("wasi_entities") if wasi else None + with open(out, "a") as f, ThreadPoolExecutor(max_workers=2) as pool: + for b in range(blocks): + # Balanced pair order and placement. + order = pairs[b % len(pairs):] + pairs[:b % len(pairs)] + for pair in order: + base, cand = pair.split(":") + swap = b % 2 == 1 + started = time.time() + if spec["placement"] == "paired": + nb, nc = ("3", "1") if swap else ("1", "3") + sb, sc = scratch_for(f"{b}-{pair}-base"), scratch_for(f"{b}-{pair}-cand") + fb = pool.submit(process, root, base, spec["profile"], spec["workloads"], spec["secs"], numa(nb), sb, entities) + fc = pool.submit(process, root, cand, spec["profile"], spec["workloads"], spec["secs"], numa(nc), sc, entities) + rb, rc = fb.result(), fc.result() + cleanup(sb) + cleanup(sc) + first = "both" + else: + # One at a time; the node alternates every two blocks + # unless the spec fixes it. + nodes = spec.get("nodes") or ("1" if (b // 2) % 2 == 0 else "3") + nb = nc = nodes + runs = [("base", base), ("cand", cand)] + if swap: + runs.reverse() + res = {} + for role, v in runs: + s = scratch_for(f"{b}-{pair}-{role}") + res[role] = process(root, v, spec["profile"], spec["workloads"], spec["secs"], numa(nodes), s, entities) + cleanup(s) + rb, rc = res["base"], res["cand"] + first = runs[0][0] + rec = {"campaign": name, "block": b, "pair": pair, "base": base, "cand": cand, + "base_node": nb, "cand_node": nc, "first": first, + "started": started, "seconds": time.time() - started, + "base_reports": rb, "cand_reports": rc} + f.write(json.dumps(rec) + "\n") + f.flush() + print(name, b, pair, f"{rec['seconds']:.1f}s", flush=True) + + +if __name__ == "__main__": + cmd = sys.argv[1] + if cmd == "setup": + setup(sys.argv[2]) + elif cmd == "campaign": + campaign(sys.argv[2], sys.argv[3], sys.argv[4]) + elif cmd == "browser": + campaign(sys.argv[2], sys.argv[3], sys.argv[4]) + elif cmd == "wasi": + campaign(sys.argv[2], sys.argv[3], sys.argv[4], wasi=True) + else: + sys.exit(f"unknown command {cmd}") diff --git a/docs/audits/797/sizes.sh b/docs/audits/797/sizes.sh new file mode 100644 index 0000000000..ad115820c1 --- /dev/null +++ b/docs/audits/797/sizes.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Shipped-artifact sizes of one variant (#797), the #772 matrix.sh method. +# Run from the variant's source root, with the shared Cargo.lock in place. +# Usage: bash sizes.sh OUTPUT_DIR WASM_BINDGEN_EXE +set -euo pipefail +out=${1:?output directory required} +bindgen=${2:?wasm-bindgen executable required} +mkdir -p "$out" +out=$(realpath "$out") +unset RUSTFLAGS CARGO_BUILD_RUSTFLAGS +rustc -Vv > "$out/compiler.txt" +cargo -V >> "$out/compiler.txt" +"$bindgen" --version >> "$out/compiler.txt" +git rev-parse HEAD > "$out/commit.txt" +sha256sum Cargo.lock > "$out/lock.sha256" +printf 'case\tbytes\tsha256\n' > "$out/sizes.tsv" +record() { + printf '%s\t%s\t%s\n' "$1" "$(stat -c %s "$2")" "$(sha256sum "$2" | cut -d ' ' -f 1)" >> "$out/sizes.tsv" +} +measure() { + local name=$1 artifact=$2 + shift 2 + cargo build --locked "$@" > "$out/$name.log" 2>&1 + cp "$artifact" "$out/$name.bin" + record "$name" "$out/$name.bin" +} +# The binary-size gate's artifact: `cargo build --release`, stripped by the profile. +measure native target/release/minigraf --release --bin minigraf +measure wasi target/wasm32-wasip1/release/minigraf.wasm --release --target wasm32-wasip1 --bin minigraf +measure browser-raw target/wasm32-unknown-unknown/release/minigraf.wasm --release --target wasm32-unknown-unknown --features browser --lib +rm -rf "$out/pkg" +"$bindgen" --target web --out-name minigraf --out-dir "$out/pkg" "$out/browser-raw.bin" +record browser-packaged-wasm "$out/pkg/minigraf_bg.wasm" +record browser-packaged-js "$out/pkg/minigraf.js" +measure consumer-size target/release/examples/perf_envelope --release --example perf_envelope +measure consumer-speed target/envelope/examples/perf_envelope --profile envelope --example perf_envelope +strip --strip-all -o "$out/consumer-speed-stripped.bin" "$out/consumer-speed.bin" +record consumer-speed-stripped "$out/consumer-speed-stripped.bin" +cat "$out/sizes.tsv" diff --git a/docs/audits/797/specs/browser.json b/docs/audits/797/specs/browser.json new file mode 100644 index 0000000000..6cdea0e896 --- /dev/null +++ b/docs/audits/797/specs/browser.json @@ -0,0 +1,13 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "browser", + "workloads": [ + "br" + ], + "secs": 1.5, + "blocks": 32, + "placement": "sequential" +} \ No newline at end of file diff --git a/docs/audits/797/specs/cold.json b/docs/audits/797/specs/cold.json new file mode 100644 index 0000000000..103a9e8bd7 --- /dev/null +++ b/docs/audits/797/specs/cold.json @@ -0,0 +1,14 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "envelope", + "workloads": [ + "cold_point", + "cold_scan" + ], + "secs": 1.0, + "blocks": 48, + "placement": "sequential" +} \ No newline at end of file diff --git a/docs/audits/797/specs/concurrency.json b/docs/audits/797/specs/concurrency.json new file mode 100644 index 0000000000..6b06e41488 --- /dev/null +++ b/docs/audits/797/specs/concurrency.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "envelope", + "workloads": [ + "cc_1", + "cc_8", + "cc_44" + ], + "secs": 1.5, + "blocks": 48, + "placement": "sequential", + "nodes": "2,3" +} \ No newline at end of file diff --git a/docs/audits/797/specs/pilot-browser.json b/docs/audits/797/specs/pilot-browser.json new file mode 100644 index 0000000000..fdae027981 --- /dev/null +++ b/docs/audits/797/specs/pilot-browser.json @@ -0,0 +1,13 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "browser", + "workloads": [ + "br" + ], + "secs": 1.5, + "blocks": 2, + "placement": "sequential" +} \ No newline at end of file diff --git a/docs/audits/797/specs/pilot-cold.json b/docs/audits/797/specs/pilot-cold.json new file mode 100644 index 0000000000..e379f0a807 --- /dev/null +++ b/docs/audits/797/specs/pilot-cold.json @@ -0,0 +1,14 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "envelope", + "workloads": [ + "cold_point", + "cold_scan" + ], + "secs": 1.0, + "blocks": 4, + "placement": "sequential" +} \ No newline at end of file diff --git a/docs/audits/797/specs/pilot-concurrency.json b/docs/audits/797/specs/pilot-concurrency.json new file mode 100644 index 0000000000..764b22be6f --- /dev/null +++ b/docs/audits/797/specs/pilot-concurrency.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "envelope", + "workloads": [ + "cc_1", + "cc_8", + "cc_44" + ], + "secs": 1.5, + "blocks": 4, + "placement": "sequential", + "nodes": "2,3" +} \ No newline at end of file diff --git a/docs/audits/797/specs/pilot-diag-envelope.json b/docs/audits/797/specs/pilot-diag-envelope.json new file mode 100644 index 0000000000..0b4b548677 --- /dev/null +++ b/docs/audits/797/specs/pilot-diag-envelope.json @@ -0,0 +1,14 @@ +{ + "pairs": [ + "B:H", + "B:B" + ], + "profile": "envelope", + "workloads": [ + "pt_asof", + "pt_av" + ], + "secs": 1.5, + "blocks": 16, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/specs/pilot-diag-release.json b/docs/audits/797/specs/pilot-diag-release.json new file mode 100644 index 0000000000..ae8730ec34 --- /dev/null +++ b/docs/audits/797/specs/pilot-diag-release.json @@ -0,0 +1,15 @@ +{ + "pairs": [ + "B:H", + "B:B" + ], + "profile": "release", + "workloads": [ + "pt_asof", + "pt_av", + "pt_ea" + ], + "secs": 1.5, + "blocks": 16, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/specs/pilot-primary.json b/docs/audits/797/specs/pilot-primary.json new file mode 100644 index 0000000000..b19b653892 --- /dev/null +++ b/docs/audits/797/specs/pilot-primary.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P", + "B:B" + ], + "profile": "envelope", + "workloads": [ + "pt_ea", + "pt_av", + "pt_asof" + ], + "secs": 1.5, + "blocks": 8, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/specs/pilot-secondary.json b/docs/audits/797/specs/pilot-secondary.json new file mode 100644 index 0000000000..67ba6488fc --- /dev/null +++ b/docs/audits/797/specs/pilot-secondary.json @@ -0,0 +1,41 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "ab-envelope", + "workloads": [ + "sh_point_entity", + "sh_attribute_value", + "sh_attribute_scan", + "sh_join_2", + "sh_join_3_scan", + "sh_not_probe", + "sh_not_join_hash", + "sh_or_2", + "sh_recursive_ancestors", + "sh_as_of", + "sh_as_of_ts", + "sh_as_of_ts_scan", + "sh_count", + "sh_count_grouped", + "sh_window", + "sh_hot_current", + "sh_hot_as_of", + "sc_short", + "sc_long_history", + "sc_dense_uuid", + "sc_sparse_uuid", + "cw_long", + "fl_paged", + "nc_point", + "nc_scan", + "con_open", + "con_direct", + "con_checkpoint", + "con_large_tx" + ], + "secs": 1.0, + "blocks": 4, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/specs/pilot-wasi.json b/docs/audits/797/specs/pilot-wasi.json new file mode 100644 index 0000000000..83ce793360 --- /dev/null +++ b/docs/audits/797/specs/pilot-wasi.json @@ -0,0 +1,21 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "wasi-envelope", + "workloads": [ + "wasi_pending_pt_ea", + "wasi_pending_pt_av", + "wasi_pending_scan", + "wasi_committed_pt_ea", + "wasi_committed_pt_av", + "wasi_committed_scan", + "wasi_committed_join_2", + "wasi_committed_con_direct" + ], + "secs": 1.0, + "blocks": 4, + "placement": "paired", + "wasi_entities": 5000 +} \ No newline at end of file diff --git a/docs/audits/797/specs/primary-1-envelope.json b/docs/audits/797/specs/primary-1-envelope.json new file mode 100644 index 0000000000..e480c7ec7b --- /dev/null +++ b/docs/audits/797/specs/primary-1-envelope.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P", + "B:B" + ], + "profile": "envelope", + "workloads": [ + "pt_ea", + "pt_av", + "pt_asof" + ], + "secs": 1.5, + "blocks": 128, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/specs/primary-1-release.json b/docs/audits/797/specs/primary-1-release.json new file mode 100644 index 0000000000..7ff26a7b13 --- /dev/null +++ b/docs/audits/797/specs/primary-1-release.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P", + "B:B" + ], + "profile": "release", + "workloads": [ + "pt_ea", + "pt_av", + "pt_asof" + ], + "secs": 1.5, + "blocks": 128, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/specs/primary-2-envelope.json b/docs/audits/797/specs/primary-2-envelope.json new file mode 100644 index 0000000000..e480c7ec7b --- /dev/null +++ b/docs/audits/797/specs/primary-2-envelope.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P", + "B:B" + ], + "profile": "envelope", + "workloads": [ + "pt_ea", + "pt_av", + "pt_asof" + ], + "secs": 1.5, + "blocks": 128, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/specs/primary-2-release.json b/docs/audits/797/specs/primary-2-release.json new file mode 100644 index 0000000000..7ff26a7b13 --- /dev/null +++ b/docs/audits/797/specs/primary-2-release.json @@ -0,0 +1,16 @@ +{ + "pairs": [ + "B:H", + "B:P", + "B:B" + ], + "profile": "release", + "workloads": [ + "pt_ea", + "pt_av", + "pt_asof" + ], + "secs": 1.5, + "blocks": 128, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/specs/secondary.json b/docs/audits/797/specs/secondary.json new file mode 100644 index 0000000000..67c24c830a --- /dev/null +++ b/docs/audits/797/specs/secondary.json @@ -0,0 +1,41 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "ab-envelope", + "workloads": [ + "sh_point_entity", + "sh_attribute_value", + "sh_attribute_scan", + "sh_join_2", + "sh_join_3_scan", + "sh_not_probe", + "sh_not_join_hash", + "sh_or_2", + "sh_recursive_ancestors", + "sh_as_of", + "sh_as_of_ts", + "sh_as_of_ts_scan", + "sh_count", + "sh_count_grouped", + "sh_window", + "sh_hot_current", + "sh_hot_as_of", + "sc_short", + "sc_long_history", + "sc_dense_uuid", + "sc_sparse_uuid", + "cw_long", + "fl_paged", + "nc_point", + "nc_scan", + "con_open", + "con_direct", + "con_checkpoint", + "con_large_tx" + ], + "secs": 1.0, + "blocks": 48, + "placement": "paired" +} \ No newline at end of file diff --git a/docs/audits/797/specs/wasi.json b/docs/audits/797/specs/wasi.json new file mode 100644 index 0000000000..cd82714d4d --- /dev/null +++ b/docs/audits/797/specs/wasi.json @@ -0,0 +1,21 @@ +{ + "pairs": [ + "B:H", + "B:P" + ], + "profile": "wasi-envelope", + "workloads": [ + "wasi_pending_pt_ea", + "wasi_pending_pt_av", + "wasi_pending_scan", + "wasi_committed_pt_ea", + "wasi_committed_pt_av", + "wasi_committed_scan", + "wasi_committed_join_2", + "wasi_committed_con_direct" + ], + "secs": 1.0, + "blocks": 32, + "placement": "paired", + "wasi_entities": 5000 +} \ No newline at end of file diff --git a/docs/audits/797/wasm_funcs.py b/docs/audits/797/wasm_funcs.py new file mode 100644 index 0000000000..7fe158aeb8 --- /dev/null +++ b/docs/audits/797/wasm_funcs.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 +"""Per-function code sizes of an unstripped Wasm module, by name (#797). + +Usage: wasm_funcs.py BASE.wasm CANDIDATE.wasm +Prints the functions whose body size differs, grouped by name with the Rust +symbol hash removed. Attribution only: the stripped artifact is the measure. +""" +import re +import sys +from collections import Counter +from pathlib import Path + + +def leb(data, pos): + value, shift = 0, 0 + while True: + byte = data[pos] + pos += 1 + value |= (byte & 127) << shift + if byte < 128: + return value, pos + shift += 7 + + +def functions(path): + data = Path(path).read_bytes() + pos, imported, bodies, names = 8, 0, [], {} + while pos < len(data): + kind = data[pos] + size, pos = leb(data, pos + 1) + end = pos + size + if kind == 2: + count, p = leb(data, pos) + for _ in range(count): + for _ in range(2): + n, p = leb(data, p) + p += n + desc = data[p] + p += 1 + if desc == 0: + _, p = leb(data, p) + imported += 1 + elif desc == 1: + p += 1 + flags, p = leb(data, p) + _, p = leb(data, p) + if flags & 1: + _, p = leb(data, p) + elif desc == 2: + flags, p = leb(data, p) + _, p = leb(data, p) + if flags & 1: + _, p = leb(data, p) + elif desc == 3: + p += 2 + else: + p += 2 + elif kind == 10: + count, p = leb(data, pos) + for _ in range(count): + n, p = leb(data, p) + bodies.append(n) + p += n + elif kind == 0: + n, p = leb(data, pos) + if data[p:p + n] == b"name": + p += n + while p < end: + sub = data[p] + sz, p = leb(data, p + 1) + if sub == 1: + q = p + count, q = leb(data, q) + for _ in range(count): + idx, q = leb(data, q) + ln, q = leb(data, q) + names[idx] = data[q:q + ln].decode("utf-8", "replace") + q += ln + p += sz + pos = end + out = Counter() + for i, n in enumerate(bodies): + name = names.get(imported + i, f"<{imported + i}>") + out[re.sub(r"17h[0-9a-f]{16}E", "", name)] += n + return out + + +base, cand = functions(sys.argv[1]), functions(sys.argv[2]) +rows = sorted(set(base) | set(cand), key=lambda k: cand[k] - base[k]) +total = 0 +for k in rows: + d = cand[k] - base[k] + if d: + total += d + print(f"{d:+7d} {base[k]:7d} {cand[k]:7d} {k}") +print(f"{total:+7d} total code bytes") diff --git a/docs/audits/797/webdriver.json b/docs/audits/797/webdriver.json new file mode 100644 index 0000000000..d8970b7591 --- /dev/null +++ b/docs/audits/797/webdriver.json @@ -0,0 +1,9 @@ +{ + "moz:firefoxOptions": { + "prefs": { + "privacy.reduceTimerPrecision": false, + "privacy.reduceTimerPrecision.unconditional": false, + "privacy.resistFingerprinting.reduceTimerPrecision.microseconds": 1 + } + } +} diff --git a/docs/superpowers/specs/2026-10-30-797-shared-reader-design.md b/docs/superpowers/specs/2026-10-30-797-shared-reader-design.md new file mode 100644 index 0000000000..7b33916e7c --- /dev/null +++ b/docs/superpowers/specs/2026-10-30-797-shared-reader-design.md @@ -0,0 +1,181 @@ +# Spec — 001-shared-reader (#797) + +**Mission Type:** mixed (code + performance evidence) +**Base branch:** `v3` (v3.0.0 milestone). Worktree `.worktrees/797-shared-reader`, branch `perf/797-shared-reader`, created from `v3` at `15badca89`. No `main` backport: this is size/performance work, not data integrity. + +## 1. User Intent + +> #797 + +> [How to proceed] Helper extraction + A/B (Recommended): spec and implement +> the non-generic helper in a v3 worktree, A/B it against the baseline and the +> Box prototype on the bench (longer point runs, reader creation, cold reads, +> concurrency, WASI/browser), PR only if the numbers hold. + +> [Invoking the planner] run the review + +> [Q1, regression margin] ≤2% upper bound, mean: one-sided 95% upper bound on +> the per-block mean latency ratio ≤ 1.02 for each point family, in two +> fixed-size campaigns plus a baseline-vs-baseline control. Every other +> workload ≤ 1.05. p50/p99 reported but not gating. + +> [Q2, size bar] Native ≥2,000 B, none grow: at least 2,000 bytes smaller on +> the native CLI, and no measured artifact (WASI, browser raw/packaged, +> library consumer) larger than baseline. + +> [Q3, Wasm runtime] User-local tools on bench: install Wasmtime and wasm-pack +> under ~ on the bench machine (no sudo, removed afterwards). Browser runs use +> its headless Firefox. Native cold reads via posix_fadvise eviction. + +Issue #797 (child of the #772 size audit), summarized: `OnDiskReader` repeats its read logic per backend even though the tree/cache primitives below it take `dyn StorageBackend`. The audit's boxed prototype saved 7,448 native CLI bytes, with a +3.91% median point p50 change in a 32-pair rerun. Deliver a small, evaluated change only if its tradeoffs are acceptable, and compare against extracting shared non-generic helpers. Preserve lock lifetimes, cache ownership, error ordering, UUID batching, temporal visibility, snapshot pinning, and API/format behavior. Run full suites, platform and coverage gates on the bench. Keep the size cap, coverage floors, MSRV and portability. Reject the change if reliable performance is compromised. + +## 2. Goal + +Remove the per-backend duplication of the committed-fact reader's logic without changing observable behavior, API, file format, configuration or dependencies, and with read performance within the user-approved non-inferiority margins (AC 13–14). Decide by evidence. Build three variants on one pinned v3 revision, toolchain and lock: +- **B**: unchanged base. +- **H**: the shared-helper extraction. This is the candidate to ship. +- **P**: the audit's boxed prototype. A comparison only, never merged. + +Measure all three for size on every shipped artifact and for runtime on the bench machine. Open a PR for H only if it meets every gate below. Otherwise publish the evidence and leave production source unchanged. + +## 3. Context & Investigation Findings + +Paths are relative to the worktree, at `15badca89`. + +### Reader and dispatch +- `src/storage/reader.rs:22-36`: `OnDiskReader` holds a concrete `MutexStorageBackend` plus generation metadata (roots, DICT root, id counters, `last_tx`, one `SharedDictCache`, one `OnceLock`). Every method is in an `impl` block (`:38`, `:79`, `KeySource` `:300`, `LogSource` `:436`, `CommittedReader` `:482`), so each backend monomorphizes a copy. +- **Backend calls are already dynamic.** Every use of `&self.backend` goes to `DictReader` (`dict.rs:77`, `:90`), `LeafCursor` (`btree.rs:626`) or `prefix_scan` (`btree.rs:533`). All of them hold or take `&dyn StorageBackend`. `PageCache` calls `backend.read_page()` through `&dyn` on a miss (`cache.rs:94-130`). `CommittedReader`/`KeySource` are themselves trait objects (`storage/mod.rs:370`, `:510`; `activate` returns `Arc`, `persistent_facts.rs:294`). +- P (`docs/audits/772/evidence/patches/reader-erasure.patch`) boxes the same adapter. The source shows no added vtable call. It adds one allocation per constructed reader and changes specialization/inlining. Whether LTO devirtualizes anything in B that P or H loses needs generated-code or runtime evidence. *(Correction of Claude-01, which claimed P adds a pointer hop per call.)* +- `MutexStorageBackend::read_page` (`btree.rs:880-883`) locks `Mutex` for one backend call only, never across a scan, a dictionary translation or a callback. Its `page_count`/`partial_page`/`holds_every_page` behavior also matters. Note that the nearby comment claiming every other method fails is not literally accurate. +- With capacity zero, `PageCache` loads the page inside the current cache read guard. Miss-path lock lifetimes are not uniform today, and this mission doesn't change them. + +### When readers are constructed (from Codex-01, verified) + +| Path | Construction | +|---|---| +| Open (incl. v7 migration), read-only open | one reader for the chosen meta (`persistent_facts.rs:94`, `:109`, `:125`, `:140`) | +| Dirty save/checkpoint | new reader per published generation; a clean save does not activate (`:433`, `:504`) | +| Index rebuild | new reader after commit (`:716`) | +| Large transaction commit | new reader (`large_tx.rs:315`) | +| Ordinary query/cursor/fact log | clones the installed `Arc`, pins separately (`graph/storage.rs:949`, `:966`) — **no construction** | +| Read command inside a large file-backed `WriteTransaction` | **a fresh reader per command** over the working roots, with its own DICT cache (`db.rs:1777`, `:1795`; `large_tx.rs:213-218`) | + +The audit's warm loop opens before timing (`examples/perf_envelope.rs:835`, `:887`), so P's allocation cannot explain its steady-state point delta. Construction is measured separately, including repeated reads inside a large transaction. + +### Which backend each artifact instantiates + +| Artifact | Reader backend(s) | +|---|---| +| Native CLI | `FileBackend`, `MemoryBackend` (`main.rs:18`; `db.rs:573`, `:669`) | +| WASI CLI (`wasm32-wasip1`) | `MemoryBackend` only (`main.rs:7`) | +| BrowserDb Wasm | `BrowserBufferBackend` only, including `openInMemory` (`browser/mod.rs:36`, `:60`, `:85`, `:274`), page cache capacity 0 | +| Tests | also `CountingBackend`, `FaultInjectingBackend` (not shipped) | + +So the native saving comes from two backends. Single-backend Wasm artifacts may save little or nothing. `Minigraf::in_memory` installs an initially empty committed reader and keeps later data pending (`db.rs:669-678`), so WASI CLI queries alone never exercise a populated committed tree. Browser query reads are RAM reads with the cache disabled. IndexedDB is touched only on open/import/flush (`browser/mod.rs:158`). + +### Semantics the change must keep (reference, not exhaustive) +- `live_walk` (`reader.rs:138-257`, `:276-297`) covers whole-triple resume, the newest kept transaction deciding a triple, same-transaction retraction dominance, distinct valid windows, and the seek after 8 skips. +- `LogSource::walk` (`:448`) rejects AVET/VAET with `INT-049` *before* the empty-root check, and resumes after an exact key (live scans resume after a triple). +- `any_key` (`:408`) checks raw presence, including retracted/historical keys. Planner proofs (#641) rely on this. +- `uuids_of` (`dict.rs:192`) expects sorted distinct ids, uses dense cursor walks above thresholds and exact sparse reads otherwise, and may deliver a callback prefix before an error. +- `tx_order` is lazy and cached per reader. A failed computation must not cache an order. +- Much of `CommittedReader`'s fact-returning code (`reader.rs:491-579`) is `cfg(test)`, so moving it alone saves nothing in release builds. + +### Audit evidence and harness limits +- Audit baseline `3d19abbce`. The five storage files and `perf_envelope.rs` are unchanged since then, but other v3 changes shift the link. Historical bytes are not reused; all three variants are measured fresh on the same base. +- Recomputed from `reader-point-runtime.json` (32 pairs): point +3.91% (paired range −11.95% to +19.28%), attribute/value +0.84%, as-of +2.02%. Point baseline p50 is 18.1 µs. Socket split: +4.95% with the baseline on node 1, +2.65% on node 3, so placement must be balanced. +- **Harness limits:** `perf_envelope.rs:890` caps a shape at 200 runs (~3.6 ms of point work), whatever `compare.py`'s 2-second budget says. Warmup is 3 queries (`:881`). Each sample opens and drains a new cursor (`:907`), with no prepared execution or cursor reuse. The JSON records row counts and percentiles, not full results or raw durations. Placement is NUMA-node affinity, not per-core pinning. +- Size gate: `.github/workflows/binary-size.yml:17`, 1,263,616 bytes (1,234 KiB). `TandemKit/Planner.md`'s "1230 KiB" is stale. #794/#795 merged since the audit. #796 (dist LTO) is separate and must not be combined with this measurement. + +### Bench machine (checked 2026-10-30) +It has Firefox and an ext4 root filesystem. It lacks Wasmtime, Chromium, Node and wasm-pack, and has no sudo. Cold-file eviction can use `posix_fadvise(POSIX_FADV_DONTNEED)` on the fixture, which needs no root. + +## 4. Acceptance Criteria + +**Variants and reproducibility** +1. B, H and P are built from one pinned v3 commit with one `Cargo.lock`, toolchain, target set, features and profiles. Each result records the patch/commit, lock hash, `rustc -V`, harness version, fixture checksum and command. Nothing unrelated is in any variant. + +**Behavior of H** +2. No public API, error code, file format, configuration or dependency change. The `semver-checks` job's own output shows no API change. On v3 PRs that job is `continue-on-error` (`.github/workflows/policy.yml:61-70`), so a green PR status alone doesn't prove this. `docs/ERROR_REFERENCE.md` is unchanged. +3. Constructing a reader, or entering shared code, allocates nothing B does not. Ordinary queries keep reusing the installed reader. +4. The backend mutex is held only for one backend call, as in B. Cache-hit paths take no backend lock. The page cache stays one `Arc` per `PersistentFactStorage`, shared by every generation reader and by `large_reader`, with unchanged generation-bound behavior (`persistent_facts.rs:43`, `:147-150`, `:294-300`; `large_tx.rs:218-225`). `SharedDictCache` and `tx_order` stay per reader, as `OnDiskReader::new` creates them today. A large-transaction reader still never shares the committed reader's DICT cache. +5. All results (values and multiplicities), the documented ordering, error codes and first-error behavior match B. This is shown by the suites in AC 9, not by row counts alone. The `CountingBackend` page-read bounds in the `storage::reader` and `storage::dict` tests still hold. A reader entry point without a direct test gets one. + +**Size (Q2)** +6. On the same base, measure B, H and P for: the gate's stripped native CLI, the WASI CLI, raw and wasm-bindgen-packaged browser Wasm, and the stripped opt-level-3 library consumer (audit `matrix.sh` method). **H passes** if the native CLI is at least 2,000 bytes smaller than B, *and* no measured artifact is larger than B. +7. The binary-size gate passes at its current limit with unchanged build settings. + +**Correctness gates (bench machine first)** +8. `cargo test --all-features` and the `test-hooks` suites pass, with counts recorded. The fault matrix runs with disk-backed durability coverage, and the `minigraf_shuttle` deterministic suite passes in its cfg build. Interrupted runs don't count. +9. These named suites must pass, as part of the above: `storage::reader`, `storage::dict`, `storage::persistent_facts` (incl. `large_tx`: read-your-writes, rejected-statement rollback, readers spanning large transactions), and `tests/` `cursor_test`, `fact_log_test`, `live_reads_test`, `point_query_history_test`, `snapshot_atomicity_test`, `concurrency_test`, `read_only_open_test`, `wal_test`, `golden_corpus_test`, `migration_matrix_test`, `integrity_test`, `index_corruption_test`, the `tests/answers/` frozen answers, and the set/temporal suites. +10. Coverage gates pass with unchanged floors. The reader's file floor (97% lines / 94% branches, `coverage-thresholds.toml` `[files."src/storage/reader.rs"]`) applies to every extracted reader logic, wherever it ends up. If that logic moves to another file, equivalent protection at no lower floor is enforced there, and the mapping is recorded in the evidence. Being covered only by the whole-crate totals (94/84) doesn't count. +11. `cargo +1.89.0 check --all-features --locked`, CI-toolchain clippy and `cargo fmt --check` are clean. The WASI tests (Wasmtime) and the BrowserDb headless suites (Chrome and Firefox, as `.github/workflows/wasm.yml:23-85` runs them) pass. The PR's CI covers whatever the bench cannot. + +**Runtime (Q1, Q3)** +12. **Method.** Measure B vs H and B vs P on the bench machine (Linux x86_64), with balanced order and placement across NUMA nodes 1/3 and the same fixture for every variant: + - The unit is an independent process block. The primary estimand is each block's candidate/baseline ratio of steady-state mean ns/op, compared as logs. + - Each block has real warmup and at least 1 s of timed work per variant for point families (the 200-run cap does not apply to the decisive runs). + - A baseline-vs-baseline (B vs B) control shows the harness resolves a 2% margin. + - The block count is fixed from a pilot *before* acceptance runs (start at ≥32 blocks), and the analysis method is fixed then too. Pilot data is kept separate and not counted. + - No retry-until-pass. Inconclusive is not pass. + - Every comparison checks complete results equal to B, not only counts. +13. **Primary gate.** For each point family (entity/attribute, attribute/value, `:as-of` transaction counter), the one-sided 95% upper confidence bound of H's mean-latency ratio is at most **1.02**. It must hold in **each of two** fixed-size campaigns run at different times, in both the opt-level-3 consumer and the gate's release configuration. Point keys cover fixed and varied keys and existing and missing entities. Entry points cover ordinary queries, prepared queries and cursors pulled in several batches. +14. **Secondary gate.** For every other workload, the upper bound is at most **1.05**. For throughput, the bound applies to inverse throughput. The workloads: + - all 17 audit warm-read shapes; + - reader construction: direct construction and drop, open, dirty checkpoint publish, and repeated reads inside a large transaction (a clean no-op checkpoint doesn't count); + - populated committed scans, short and long histories, dense and sparse UUID projection; + - application cache disabled (OS cache warm), labeled as such; + - cold file reads (ext4 fixture, `posix_fadvise(DONTNEED)` per the user's Q3 choice). A **cold observation** is one query or scan traversal that starts with every application-cache and OS page-cache page it will read absent. Each cold observation is reset independently, for each variant. Residency is checked after eviction (e.g. `mincore`/`fincore`) and recorded as evidence that eviction worked. Warmup and result validation must not prewarm a cold observation. These cold rules take precedence over AC 12's warmup: warmup may prepare code and runtime state only. Variants never run concurrently against the same fixture file during cold measurement (separate copies, or one at a time). Reset and setup time are excluded from latency. Warm repeats are never averaged into the cold metric. A process block may contain several independently reset observations. No claim is made about the device's own cache. If effective eviction can't be shown, the cold category stays outstanding and blocks the PR; + - concurrent read-only queries at 1, 8 and 44 threads; + - long cursor walks and a paged fact-log walk; + - WASI under Wasmtime, covering both the real in-memory CLI path and a populated committed-memory-reader fixture (internal test/bench code only, with no new public API); + - BrowserDb point and scan queries in headless Firefox, kept separate from IndexedDB open/flush. + + Report p50, p99 (per-query samples, not batch averages), absolute deltas, allocations and RSS for each workload, with no pooled score. A required category left unmeasured or inconclusive blocks the PR. +15. Wasmtime and wasm-pack are installed user-locally on the bench machine and removed afterwards, along with fixtures and temp directories. The evidence never contains addresses, credentials, or any other access or identifying information. It does keep the non-identifying measurement metadata needed to interpret it: CPU model and topology, SMT/NUMA placement, OS/kernel, storage and cache conditions, and runtime, packaging and build versions, as `docs/audits/772/README.md:9-20` does. + +**Evidence and outcome** +16. Evidence lives under `docs/audits/797/`: scripts, raw records, and a README with the method, the pinned inputs, the pilot-derived sample sizes fixed in advance, and per-workload tables for H and P. Historical `docs/audits/772/` files are not modified. +17. **Draft PR:** when H passes every bench-verifiable gate (AC 2–10, the bench-runnable parts of AC 11, and AC 12–14, all measured on the bench), open a draft PR against `v3` with H and its evidence. It links #797 without a closing keyword, and lists explicitly the checks still pending in CI (Chrome browser suite, macOS/Windows native, anything else the bench can't run). **Ready:** only after those CI checks pass, AC 2's semver output is inspected, and the Codex review is done. CI build or test success never stands in for a required benchmark category. +18. **H fails, P passes:** report both. P is not shipped without a new maintainer decision. +19. **Neither passes:** a docs-only PR to `v3` with the evidence. Comment on #797 with the verdict and recommend closing. No production source changes. +20. **Docs sync, H shipped:** a `CHANGELOG.md` v3.0.0 entry with the measured saving. `docs/BENCHMARKS.md` gets a link to the evidence. Update the `CLAUDE.md` `reader.rs` line, `docs/TEST_COVERAGE.md` and the `CLAUDE.md` test count only if they change. `ROADMAP.md`, `README.md` and the docs site change only if one of their claims becomes false (none is expected for an internal refactor). No version bump or tag. + +## 5. Edge Cases & Boundaries +- Empty roots (EAVT/AEVT/AVET/VAET/DICT) and absent entities/idents keep their early returns, with no new reads. An invalid log index still errors on an empty tree. +- History: same-transaction assert and retract, distinct valid windows, triples with no live rows, a bound below, inside or above the stored range, and irregular or decreasing `tx_id`s. +- Resume: exactly-full and partial batches, many versions of one triple, the last triple, and seeks across leaves. Batch size never changes retraction dominance. Early callback stop and callback errors keep their prefix/error behavior. +- UUID batches at 63/64 ids, the density threshold, the 1,024-id chunk boundary, invalid order or duplicates, missing UUIDs, corrupt UUID bytes, and an error after a callback prefix (tests at `reader.rs:660`, `dict.rs:650`, `:721`). +- Long strings and sets still read the right value pages, and short values still avoid value-page reads. +- Cursors and fact logs survive later writes and checkpoints (`tests/cursor_test.rs:263`). Partial pulls, close/drop and an error on a later pull are unchanged. +- Large-transaction reads see finished staged statements, then drop their reader state. A rollback or a rejected statement leaves no uncommitted id visible to later committed reads (`large_tx.rs:895`, `:974`, `:1300`). +- Concurrent cache hits never take the backend mutex. Poisoned locks and corrupt pages keep their handling, and no helper takes the backend lock around code that reads through the same adapter. +- Measurement labels: capacity zero is not cold storage, a new process is not an evicted OS cache, browser buffer reads are RAM reads, and WASI CLI queries are not committed-tree reads. +- Environmental failures, missing tools and statistical uncertainty are recorded as missing evidence, never as passes. Thresholds are not changed after candidate results are seen. + +## 6. Key Decisions +- **H is the candidate; P is the comparison** (user, 2026-10-30). Sharing the logic needs no boxing, since backend calls are already dynamic. +- **Margins (user, Q1):** point families ≤ 1.02 upper bound on the mean ratio, in two campaigns with a B-vs-B control; everything else ≤ 1.05; p50/p99 reported, not gating. +- **Size bar (user, Q2):** at least 2,000 native bytes saved, and no artifact grows. +- **Wasm runtime on the bench (user, Q3)** with user-local tools and Firefox headless; cold native reads via `posix_fadvise`. +- **Not shipping is a valid outcome.** If H fails, its evidence lands as a docs-only PR (Claude's default; Codex had left this open). +- **The base contract is preserved:** shared code doesn't mean shared mutable cursors, longer locks, global DICT caches or merged generations. The helper's shape is the Generator's choice. +- **Round 3 (Codex-02, all accepted):** page cache shared per storage, not per reader (H1); a defined and validated cold observation (H2); the reader coverage floor follows extracted code (M1); draft-PR gates split from ready gates (M2); non-identifying bench metadata is kept (M3); the goal is worded around the margins (L1); semver output is checked directly (L2). +- **Doc sync (resolved with Codex-02):** Codex asked to update `CLAUDE.md`, `ROADMAP.md`, `README.md`, `docs/TEST_COVERAGE.md`, `CHANGELOG.md`, `docs/BENCHMARKS.md` and to cross-check the docs site. Claude's position: the project rule is "keep docs from contradicting each other". An internal refactor makes no user-visible claim false, so AC 20 requires the CHANGELOG and benchmark link, and the rest only where text changes. + +## 7. Out of Scope +- Changing `LeafCursor`, `DictReader`, `MutexStorageBackend`, `PageCache`, lock granularity, cache policy, or the UUID/history algorithms, including to recover lost speed. +- Erasing other generics (`PersistentFactStorage`, browser/IndexedDB code). +- Size-cap changes. #794/#795/#796 work, or combining their changes into the measured variants. +- v2.x backport. New public or benchmark APIs, options, dependencies, or file/WAL format changes. +- Claims about environments that were not measured. + +## 8. Possible Directions & Ideas (non-binding) +- A borrowed non-generic read context, or shared routines for the large bodies (`dict_txs`, `live_walk`, the tx-order/time-bound logic, log walk/decode), may give most of the sharing. Check emitted symbols (`cargo bloat`, symbol sizes) before widening the refactor, because source sharing doesn't guarantee smaller machine code. +- A companion to `perf_envelope` could separate construction, first use and steady state. Leave the original for broad regression detection. +- `docs/audits/772/compare.py`, `prototypes.py` and `matrix.sh` are a starting harness. +- Measure the reader directly as well as through the public API, so parser time can't hide a reader regression. The public-API result is the decision metric. +- Remember that `bench` profile is opt-level z, while `envelope` is opt-level 3. + +## Open Questions +None. Q1–Q3 were answered by the user.