Skip to content

torture: check the root, use the generated commit concurrency, run in CI - #1004

Open
citizen-stig wants to merge 3 commits into
thrumdev:masterfrom
citizen-stig:nikolai/torture-root-check
Open

citizen-stig wants to merge 3 commits into
thrumdev:masterfrom
citizen-stig:nikolai/torture-root-check

Conversation

@citizen-stig

@citizen-stig citizen-stig commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Nothing runs torture today: not CI, not a script. And when it is run by hand, it misses two things. This makes it check more and adds a short CI job.

What torture missed

  • It never used more than one commit worker. The supervisor draws commit_concurrency (1..=64) and io_workers (1..=32) for every workload and sends them, but the agent never passed them to Options. Every workload ran with the defaults.
  • It never looked at the root. After a crash it compared the sync sequence number and, when asked to, the values. Values come from the beatree. The merkle pages are written and recovered on their own path (hash table and WAL), so a database with every value right and a wrong root passed.

Commits

  1. torture: open the database with the generated commit_concurrency and io_workers.
  2. torture: check the root against a trie built from the expected state. The agent reports its root. The supervisor compares it with nomt_core::update::build_trie over the state it expects, after every commit, rollback and hash-table growth, crashed or not. The snapshot keeps each value's hash, so the expected root costs about two hashes per key.
  3. ci: run three torture workloads. A new NOMT - torture job builds torture in release mode and runs seeds 6, 7 and 8 for at most 20 iterations each. Three things kept torture run from working as a CI step:
    • a failed workload was printed and the process exited with 0; it now exits with an error;
    • the length of a workload came from the assigned disk space alone; --max-iterations bounds it;
    • the agent crashes with abort. Where core dumps are collected, dumping it took longer than the five seconds the supervisor waits, and the workload failed with "agent did not die" (every run of seed 6 under systemd-coredump). The agent now sets its core limit to zero.

What the CI seeds cover

Seed commit workers Features
6 59 updates, commit crashes, hash-table growth with crashes
7 31 deletions, commit crashes, rollbacks with crashes
8 12 reads, updates, deletions, overflow values, commit crashes, rollbacks, growth

Testing

  • The exact CI command passes locally in about two minutes (32 cores).
  • Seven seeds that do not use trickfs (1, 2, 3, 4, 6, 7, 8) pass with the root check, 24–30 iterations each.
  • With the agent's reported root changed by one bit, the run fails with Unexpected root at sync_seqn 3 with 19345 keys and exits with 1.

Not covered, and caveats

  • The job has run once on a GitHub runner, on this PR: it passed in 5m24s, build included.
  • No trickfs seed. I could not run one locally (no fusermount3). The job installs FUSE so that one can be added.
  • A seed fixes the configuration, not the moment a crash lands, so a failure may not repeat.
  • Right after opening, the root is read from the root page alone. A wrong page below it shows in the root of a later commit that goes through it.
  • audit high fixes #997 also edits torture/src/agent.rs. The two merge without conflicts.

🤖 Generated with Claude Code

citizen-stig and others added 3 commits November 24, 2026 23:29
…io_workers

The supervisor draws commit_concurrency from 1..=64 and io_workers from
1..=32 for every workload and sends them in the open request, but the
agent never passed them to Options. Every workload ran with the
defaults, one commit worker and three I/O workers, so torture never
exercised a multi-worker commit.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
After a crash torture compared the sync sequence number and, when asked
to, the values. Values are read from the beatree. Nothing looked at the
merkle pages, which are written and recovered on their own path: the
hash table and its WAL. A database with every value right and a wrong
root passed.

The agent now reports its root, and the supervisor compares it with the
root of a trie built from scratch out of the state it expects, after
every commit, rollback and hash table growth, crashed or not. The
snapshot keeps the hash of each value, so the expected root costs two
hashes per key and no value is hashed twice.

Right after opening, the root is read from the root page alone. A wrong
page below it shows in the root of a later commit that goes through it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Nothing ran torture: not CI, not a script. The new job builds it in
release mode and runs seeds 6, 7 and 8 for at most 20 iterations each,
with every value and the root checked after each rollback and growth.
The three take two minutes on a 32-core machine.

Three things kept `torture run` from working as a CI step:

- A failed workload was printed and the process exited with 0. It now
  exits with an error.
- The length of a workload came from the assigned disk space alone.
  `--max-iterations` bounds it.
- The agent crashes with abort. Where core dumps are collected, dumping
  it took longer than the five seconds the supervisor waits, and the
  workload failed with "agent did not die": every run of seed 6 under
  systemd-coredump. The agent now sets its core limit to zero.

`run` also logs the configuration it derived from the seed.

A seed fixes the configuration, not the moment a crash lands, so a
failure may not repeat. None of the three seeds uses trickfs; the job
installs FUSE so that one that does can be added.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@citizen-stig
citizen-stig marked this pull request as ready for review November 25, 2026 07:57
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