Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/gunnar

bench/examples/stomach-probe.rs

//! **RETIRED 2026-08-10 — its subject no longer exists in this workspace.**
//!
//! # What it measured
//!
//! A counting probe over the **storage** path: what one *ref transaction* cost
//! on disk and in fsync, and what an open cost to replay. Three runs:
//!
//! * `append_run` — N single-ref transactions against a never-compacting Arrow
//!   log, then a reopen, so the append cost and the replay cost were separable.
//!   `CompactionPolicy::never` was deliberate: the append cost was the question,
//!   and a compaction firing mid-run would have folded the very bytes being
//!   counted.
//! * `compaction_table` — what an open costs at N pushes under three policies
//!   (`never`, `default(1024/256)`, `folded(window 4)`), reproducing the table
//!   in `arrow_log.rs`'s own header so it could be re-measured rather than
//!   carried forward stale.
//! * `concurrency_run` — the same total number of durable transactions spread
//!   over `writers` threads, each moving its **own** ref so no CAS ever
//!   conflicted. It asked whether group commit was worth building: if every
//!   transaction pays its own `fsync` under the writer mutex, throughput is flat
//!   in `writers` and `lock_wait` grows with it.
//!
//! # Why it cannot be ported, rather than why nobody has ported it
//!
//! It drove `gunnar_store::arrow_log::ArrowLogStore` through
//! `store.refs().transaction(vec![RefEdit { .. }])`. Two independent things
//! removed that:
//!
//! 1. **`RefStore` was deleted** with the rest of the old storage vocabulary
//!    in the 2026-08-10 storage rework. The contract's ref write is now
//!    `GitOps::put_refs` / `put_refs_cas`, and it belongs to an *engine*, not to
//!    a log type this workspace can name.
//! 2. **`ArrowLogStore` moved to `gunnar-core` and became secrets-only**
//!    (2026-08-10: secrets fold into the control redb). The type still exists
//!    at `gunnar_core::arrow_log::ArrowLogStore` and it still has
//!    `open_with_policy` and `CompactionPolicy` — but it now backs `SECRETS_LOG`
//!    and exposes `secrets()`, and it holds no refs at all.
//!
//! **That second point is the trap, and it is why this file refuses instead of
//! being repointed.** Every symbol this probe imported has a same-named
//! survivor, so the port compiles easily and the probe runs and prints a full
//! table — of secret-log append costs, under a heading that says ref
//! transactions. That is the "publish a full table about a subject nobody asked
//! about" failure that `bench/src/engine.rs::open_repo` refuses for the same
//! reason. A missing measurement is a gap; a plausible measurement of the wrong
//! subject is a false finding, and it is worse.
//!
//! # Where the question reattaches
//!
//! The ref-transaction cost is still a real and unanswered question — it just
//! belongs to an engine now. The Arrow arm keeps its refs in znippy
//! (`znippy/plugins/native/znippy-plugin-git`); the gix arm keeps them in
//! `edda/crates/storage-git-gix`. When one of them is reachable from a
//! measurement, this probe is rewritten against `GitOps::put_refs` and the three
//! runs above come back unchanged in shape. Until then it exits non-zero and
//! says so, which is what a guard-visible target should do.
//!
//! ```text
//! CARGO_TARGET_DIR=~/scratch/cargo/gunnar-belly \
//!   cargo run --release --example stomach-probe --manifest-path bench/Cargo.toml
//! ```

fn main() -> std::process::ExitCode {
    eprintln!(
        "stomach-probe is RETIRED: it measured the cost of a ref transaction on\n\
         `gunnar_store::arrow_log::ArrowLogStore`, and neither half of that subject survives\n\
         the 2026-08-10 demolition.\n\
         \n\
         * `RefStore` (and `RefEdit` / `FullName` / `Target` / `Change` / `PreviousValue`)\n\
           was deleted; the contract's ref write is `GitOps::put_refs`.\n\
         * `ArrowLogStore` moved to `gunnar_core::arrow_log` and is now SECRETS-ONLY.\n\
         \n\
         It refuses rather than being repointed at the surviving same-named type, because\n\
         that port compiles and runs and prints a table of secret-log append costs under a\n\
         heading that says ref transactions.\n\
         \n\
         The question reattaches at an engine: znippy-plugin-git or storage-git-gix.\n\
         See this file's module documentation."
    );
    std::process::ExitCode::FAILURE
}