Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
6ebae37
feat(storage): add the benchmark rig for the LMDB and Postgres backends
chappie-daemon Nov 14, 2026
c3acc13
docs: record the benchmark rig's LMDB run and amend ADR 0012
chappie-daemon Nov 14, 2026
84f81d2
fix(bench): size the read windows from the corpus, assert exact total…
chappie-daemon Nov 14, 2026
b835532
docs: quote the rig's band and define its tables' arithmetic
chappie-daemon Nov 14, 2026
37cb5f4
fix(bench): refuse every repeat's store root and carry the percentile…
chappie-daemon Nov 14, 2026
64d3f5e
docs: quote the p95 band, define the exclusions and the percentile rule
chappie-daemon Nov 14, 2026
817a0cd
docs: correct the rig's exclusions, its disk arithmetic and its uncit…
chappie-daemon Nov 14, 2026
3ad5686
docs: correct the rig's claims about the append and ephemeral arms
chappie-daemon Nov 14, 2026
d0489b8
fix(bench): check operations not rates, refuse a directory artifact, …
chappie-daemon Nov 15, 2026
50a66cb
test(bench): ask the filesystem whether the probe should refuse
chappie-daemon Nov 15, 2026
c964cb0
style: rustfmt the harness after the rework
chappie-daemon Nov 15, 2026
6245c21
docs: quote the regenerated schema-2 artifact
chappie-daemon Nov 15, 2026
c3115cd
docs: read the regenerated run's bands instead of the old one's
chappie-daemon Nov 15, 2026
d808694
docs: quote the regenerated run's row rates and its date
chappie-daemon Nov 15, 2026
5a372e5
docs: enumerate the harness's three missing refusals (#1143)
avantikonde Nov 16, 2026
ccb96fe
docs: enumerate the harness's three missing refusals (#1143) (#1155)
avantikonde Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/benchmark-refusals-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/benchmark-rig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
11 changes: 11 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,17 @@ jobs:
env:
PARITY_ADMIN_URL: postgres://postgres:postgres@localhost:5432/postgres
run: cargo test -p nostream-storage --test migrations --test parity --test migration_pg -- --ignored --test-threads=1
# The benchmark rig's Postgres column: the same workload and the same `--verify` the LMDB
# arm runs, against the scratch database it drops and recreates. The dev profile is
# deliberate — this proves the path and the counts, and its timings are cited nowhere.
- name: Benchmark harness against Postgres
env:
PARITY_ADMIN_URL: postgres://postgres:postgres@localhost:5432/postgres
run: cargo run -p nostream-storage --example bench -- --backend postgres --events 2000 --seed 7 --verify --out /tmp/bench-postgres.json
# `cargo test --workspace` builds an example target and never runs its tests, so the rig's
# own tests need a command that does. They carry the rules `--verify` asserts.
- name: Benchmark harness unit tests
run: cargo test -p nostream-storage --all-features --example bench
- name: Storage builds without the Postgres driver
run: cargo check -p nostream-storage --no-default-features --all-targets
- name: Release build
Expand Down
23 changes: 18 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ cargo test --workspace --all-features
cargo build --workspace --all-features --release
```

CI additionally runs the three database-backed storage tests ("Storage parity against Postgres")
against a `postgres:16-alpine` service, and they are `#[ignore]`d so a checkout without a database still passes
`cargo test --workspace`:
CI additionally runs five database- and example-backed checks. Three are the storage tests
("Storage parity against Postgres"), against a `postgres:16-alpine` service; they are `#[ignore]`d
so a checkout without a database still passes `cargo test --workspace`:

```
cargo test -p nostream-storage --test migrations --test parity --test migration_pg \
Expand All @@ -48,8 +48,21 @@ cargo test -p nostream-storage --test migrations --test parity --test migration_
`PARITY_ADMIN_URL` names the administrative database (CI sets
`postgres://postgres:postgres@localhost:5432/postgres`); the targets create, migrate and
drop their own scratch databases — `migration_pg` seeds one and copies it into a temporary LMDB
store. `scripts/storage-parity.sh` runs all three plus the
TypeScript Cucumber suite against the sqlx-migrated schema — the complete local oracle. The
store. The fourth is the benchmark rig's Postgres arm ("Benchmark harness against Postgres"):
it runs `crates/nostream-storage/examples/bench.rs` against a scratch database and proves the path
and `--verify`, and its numbers are cited nowhere. The fifth, below, is the rig's own unit tests.

The rig's own unit tests need their own command, because `cargo test --workspace` only *builds* an
example target. CI runs it as "Benchmark harness unit tests", and so must you when you touch the
rig:

```
cargo test -p nostream-storage --all-features --example bench
```

`scripts/storage-parity.sh` runs the three storage targets plus the
TypeScript Cucumber suite against the sqlx-migrated schema — the local parity oracle. It does not
run the benchmark rig, which is a measurement and not a parity check. The
LMDB arm of that oracle needs no database: `cargo test -p nostream-storage --test parity_lmdb
-- --nocapture` replays the same fixture on a temporary store and runs inside the fifth
validation command above.
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions crates/nostream-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,17 @@ tracing = { workspace = true, optional = true }
uuid = { workspace = true, optional = true }

[dev-dependencies]
clap.workspace = true
serde_yaml.workspace = true
tempfile.workspace = true

# The benchmark rig (`docs/rewrite/benchmarks.md`). Both features are required: the harness holds
# either backend behind one `EventRepository`, so a build that turns one off has nothing to
# measure. The requirement is also what keeps CI's `--no-default-features --all-targets` check
# from compiling it.
[[example]]
name = "bench"
required-features = ["lmdb", "postgres"]

[lints]
workspace = true
Loading
Loading