8000 GitHub - kakoc/hydo: Deterministic hypervisor and tooling for autonomous testing with bugs discovery and system quality assurance. · GitHub
[go: up one dir, main page]

Skip to content
kakocPublic

About

Deterministic hypervisor and tooling for autonomous testing with bugs discovery and system quality assurance.

Resources

Contributing

Stars

7 stars

Watchers

0 watching

Forks

Repository files navigation

hydo

An animated terminal in a repository with the Redis example. hydo onboard finds its hydo/ folder and installs the Claude Code skill, whose command is /hydo:onboard. hydo explore runs Redis 30 times with different faults: 13 runs fail, in 3 different ways, and each failing run fails again the same way when hydo replays it. hydo report lists the 3 problems, each with a label, how many runs show it, and the command that shows it again: Redis does not start again after disk errors, Redis loses confirmed data after a power cut with appendfsync set to no, and Redis loses confirmed data with a faulty disk.

What if the bug that shows up once in a thousand runs of your tests showed up every time?
What if the bugs that nobody wrote a test for turned up on their own?
What if "never charge a customer twice" were checked while your database crashes?

hydo runs your whole system in one virtual machine: your services, their databases, and a client that uses them. Then it breaks things. It kills processes, pauses them, cuts the network, pulls the power, makes the disk fail, and moves the clock. After each run it checks the rules that your system promises, for example that every confirmed payment is still there.

Nothing inside that machine is left to chance, so a run repeats bit for bit. When a rule breaks, hydo takes away faults until only the ones the failure needs are left. You get one command that makes the same failure happen again, tomorrow or on a colleague's laptop.

  • It looks for bugs on its own. hydo explore chooses the faults itself, runs them, and checks your rules after each run. It found the etcd and NATS bugs below without being told what to look for.
  • Every failure comes back. hydo writes the faults of each run as one line of text. hydo run with that line repeats the run, and the failure with it.
  • The rules can be your business rules. A rule is a command you write, such as a SQL query over your tables. Two such queries found the two Blnk bugs below.
  • Your software runs unmodified: Linux programs, plain files, or Docker images. A Docker Compose file imports with one command.

Watch it break a system

hydo-nsq-runs-1920x1080.mp4

hydo runs NSQ, a message queue, again and again under crashes, pauses, network cuts, and clock jumps.

  • Tiles: each is one function of NSQ. It lights up when a run first reaches it.
  • Lines: each is one run. Dots are faults, and a red end is a broken promise.
  • Bushes: hydo replays a failure with fewer faults to find its smallest cause.

It finds three issues, each with the command that replays it:

  • a crash in a new topic's first seconds loses its messages (#1542, reported by hydo);
  • after the clock is set back, every publish waits (#1124, a known bug);
  • a crash loses the message a consumer holds (#1386, a documented limit).

Install

On a Mac, with Homebrew:

brew install kakoc/tap/hydo

On a Mac or on Linux, with cargo:

cargo install hydo --locked
hydo setup

hydo setup downloads the kernel and the tools of hydo's virtual machine, and hydo doctor checks your machine. hydo needs an Apple Silicon Mac, or an x86_64 Linux machine with KVM. hydo update updates hydo and its onboarding skill. docs/INSTALL.md has the release archives, their checksums, and hydo's own kernel module for Intel machines.

What hydo found in real projects

Each project's folder in hydo/onboard/examples/ has hydo's setup for it, so you can see each bug happen yourself.

New bugs that hydo found and reported to each project:

  • ClickHouse: after a power cut, a change to a table's columns gets stuck for good, and every later change to that table waits behind it (#134373).
  • RabbitMQ: a message that RabbitMQ confirmed is lost for good when one server loses power while another one is paused (#18515). After the clock is set back, a stream has no server to write to for that long (#18516).
  • CockroachDB: when one server's clock runs one second ahead, all three servers stop, not only that one (#176268).
  • Weaviate: a server that loses power right after a new shard is made can never read that shard again (#14107).
  • Gitea: a power cut in the first 30 seconds after a repository is made breaks it for good (#40575). After the clock is set back, a stopwatch records negative time (#40576).
  • Microsoft Garnet: when data moves to another server and that server's backup takes over right after, part of the data has no server that answers for it, for good (#2440). A backup server stops copying its main server after that one restarts, and still reports that it is in sync (#2441).
  • Redpanda: a transaction can be saved in one place and dropped in another, and a confirmed write can be lost. Redpanda confirmed both and fixed them (#395, #396).
  • Apache RocketMQ: after the clock is set back, transactions that were already committed are stored again (#11651).
  • Apache Pulsar: after a server restart, the unfinished transaction of a client that crashed holds back every message after it (#27749).
  • Apache Kvrocks: a backup server that has just copied all the data from its main server does not start again after a power cut (#3827).
  • VictoriaMetrics: after the clock is set back, every server deletes the current month's data (#11973).
  • Typesense: a server that restarts repeats a delete in the wrong order and loses documents that it had saved (#3202). After the clock is set back, the cluster does not replace a failed leader for that long (#3203).
  • Meilisearch: after a crash, a swap of two indexes runs a second time and undoes itself (#6743). A power cut empties an upload that Meilisearch had accepted (#6749).
  • Prometheus: a backup snapshot leaves out data that arrived late (#20547).
  • Dragonfly: after the clock is set back, a restart loads an older copy of the data (#8826).
  • Temporal: after the clock is set back, one database crash leaves the server without its database for that long (#13099).
  • Valkey: after the clock is set back, copying data to a backup server waits for that long (#5406).
  • Restate: after the clock is set back and a restart, accepted work waits for that long (#5951).
  • NSQ: a crash in the first seconds of a new queue loses the messages it had accepted (#1542).
  • SurrealKV: one damaged byte on the disk makes it lose later data that it had saved (#536).
  • Saleor: a refund can be lost, and a gift card can be charged for an order that stays unpaid (#20022, #20023).
  • Blnk: payments can go past their overdraft limit (#437), and a batch that must be all or nothing can be half done (#438).
  • Vikunja: a power cut loses tasks that Vikunja had saved (#4502).
  • n8n: a database restart of about a second leaves workflows that n8n had already started running for good (#45828).
  • Lago: one month can be billed twice (#7164).
  • Hatchet: after a crash, work that Hatchet had accepted never runs (#5527).
  • Formance Ledger: two payments that use a new account at the same moment can make one of them fail (#2542).

Known bugs that showed up rarely, and with hydo show up on every run:

  • etcd: a server that crashes at one moment comes back out of step with the others (#14685). hydo found it without being told where to look.
  • NATS: a power cut deletes a whole stream (#6888). hydo found it without being told where to look.
  • TigerBeetle: a server stops for good when two payments expire in the same nanosecond (#3960).
  • Qdrant: a test that passed 2,604 times in a row fails on every run when hydo pauses one of its threads at the right moment (#10200).

Your own project

In your repository, run:

hydo onboard

Then:

  1. hydo onboard starts a hydo/ folder from your Docker Compose file, or writes a skeleton whose placeholders fail every run until you fill them in.
  2. It installs the onboarding skill for the AI coding tools it finds, such as Claude Code. The skill teaches the tool to set up hydo.
  3. In Claude Code, type /hydo:onboard. The skill asks about your system and writes the client and the rules with you.
  4. hydo explore looks for failures, and hydo report lists each one with the command that replays it.

To install the skill as a Claude Code plugin without hydo onboard, type these in Claude Code:

/plugin marketplace add kakoc/hydo
/plugin install hydo@hydo
/hydo:onboard

docs/ONBOARD.md describes the onboarding, and docs/YOUR-PROJECT.md shows how to write the hydo/ folder by hand.

Learn more

The current release is hydo 0.10.0. It is experimental: formats and commands can change between versions.

License

Apache-2.0 (LICENSE). The kernel module hv/hvx/hvx.c is GPL-2.0-only; hv/hvx/LICENSE.md has the details.

About

Deterministic hypervisor and tooling for autonomous testing with bugs discovery and system quality assurance.

Resources

Contributing

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0