8000 test: weekly soak test at 10M facts with checked samples and metrics (#392) by adityamukho · Pull Request #519 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

test: weekly soak test at 10M facts with checked samples and metrics (#392) - #519

Merged
adityamukho merged 4 commits into
v3from
test/392-soak
Oct 10, 2026
Merged

adityamukho merged 4 commits into
v3from
test/392-soak

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Part of #392 (tracker #383). Test and workflow only; no library change. A main PR with the same harness on the v2 API follows. This PR adds no closing keyword; #392 closes when both PRs are merged.

What

  • tests/soak_test.rs
    • soak (ignored): grows a file-backed database to 10M live facts in batches of 1–2,000 facts (1–4 multi-valued tags in one transaction, strings over 64 bytes, refs, a sparse per-shard attribute). It then churns the database for the rest of the budget at a capped 50 tx/s: retracts and re-asserts of random facts, plus long assert/retract histories on 32 hot entities. A checkpoint runs every 20–200 transactions, and a reopen every 2–10 minutes, half from a checkpointed file and half replaying the WAL.
    • Checks run every 10 minutes, after every reopen, and between churn writes. They cover EAVT per entity, AVET by unique name, AEVT over a shard attribute, :as-of on hot entities, and the tx counter. A full-scan row count runs in a child process (soak_full_scan_child), and verify() runs at the end. RSS measured after a reopen must stay below 1.25× its baseline plus 256 MiB.
    • Reference: each ordinary entity's facts are a function of its number, so only retracted slots are stored. Any entity or shard can be checked exactly at 10M facts, and the reference costs a few MB.
    • Metrics: one JSON line per check. Each line has file size, open time (from the file and with WAL replay), checkpoint p50/max, RSS, peak RSS, and p50/p99 per query path. These are the inputs for perf: benchmark queries at 100K–10M facts and publish a performance envelope #394.
    • soak_short: the same driver at 20K facts, in the per-PR suite, about 6 s in a debug build.
  • .github/workflows/soak.yml: weekly, alternating main (Saturday) and v3 (Sunday) at 01:00 UTC, plus manual dispatch with ref and minutes. It runs a 300-minute budget with the data on /mnt, uploads the metrics and log, and opens or comments on a "Weekly soak failure" issue on failure. Scheduled runs use the file from main, so it lands there with the main PR.
  • Spec: docs/superpowers/specs/2026-10-10-soak-test-design.md. Plan: docs/superpowers/plans/2026-10-10-soak-test.md.
  • Docs: CHANGELOG (Tests), ROADMAP, test counts (1,409: 1,399 passing, 10 ignored).

Local 10M run (--profile bench, 15-minute budget, seed 11): passed

Growth to 10M live facts 314 s
File at 10.6M facts 1.17 GB
Checkpoints / reopens 716 / 5
Checkpoint p50 / max at 10M 375 ms / 729 ms
RSS after a reopen (baseline → end) 172 MiB → 197 MiB
EAVT point query p50 / p99 52 µs / 122 µs
AEVT shard scan (~1,700 rows) p50 13.8 ms
:as-of hot entity p50 0.4 ms
AVET [?e :p/name "…"] p50 6.7 s (#518)

I broke the reference on purpose twice, once dropping a retract and once dropping a hot-entity change. Each time the test failed with a message that names the check, seed and step, and prints no UUIDs.

Findings

🤖 Generated with Claude Code

https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h

adityamukho and others added 3 commits October 10, 2026 16:53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
…392)

tests/soak_test.rs grows a file-backed database to 10M live facts, then
churns it at a capped rate (retract/re-assert, hot-entity histories) with
checkpoints every 20-200 transactions and reopens every 2-10 minutes. A
reference derived from each entity's number checks EAVT, AVET, AEVT,
:as-of and the tx counter; a full scan runs in a child process
8000
; verify()
at the end; RSS after a reopen is bounded. Metrics go to JSON lines,
uploaded by the weekly soak.yml (main Saturday, v3 Sunday). soak_short
runs the driver at 20K facts per PR. Found #518.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
A 10M-fact local run spent minutes on 6 s AVET lookups, stalling churn
writes to ~32 tx/s against the 50 tx/s target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
The first version passed on v2.0.4 despite #371: no check bound entity and
attribute together and the AEVT check read a single-valued attribute. Shard
attributes now carry two values written in one transaction and each sampled
entity's tags are read with [:eN :p/tag ?v]; v2.0.4 fails both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wXxZguv7PgKQjMMH4yJ5h
@codecov
codecov Bot commented Oct 10, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit ddd4c0b into v3 Oct 10, 2026
24 checks passed
@adityamukho
adityamukho deleted the test/392-soak branch October 10, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0