Skip to content

Check compatibility against a real Redis, twice over - #1

Merged
tamnd merged 1 commit into
mainfrom
the-two-halves
Aug 28, 2026
Merged

tamnd merged 1 commit into
mainfrom
the-two-halves

Conversation

@tamnd

@tamnd tamnd commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Two halves, because they catch different things.

suite/fetch.sh vendors the Redis 8.10.1 release tarball's tests/ directory unmodified, and suite/runtest.sh points it at a running yodb through the suite's own external mode. Their tests, our server, nothing patched out. A test that fails because we have not written the command yet is still a compatibility failure, it is just one with a date on it.

yocompat is the other half. It starts a real Redis and a yodb, sends both of them the same commands, and reports every reply that is not byte for byte the same. This catches what their suite cannot, because their tests assert what their own developers thought was worth asserting and leave out everything they take for granted: that a missing key comes back as $-1 and not _, that INCRBYFLOAT replies with a bulk string and not a double, that GETRANGE on a missing key is an empty bulk string and not a null, that the first word of an error is WRONGTYPE and not ERR. Clients branch on all of it.

The RESP client here is our own and has no dependencies. A client from crates.io is written to be pleasant, which means it normalises: a null bulk string and a null array become the same None, a simple string and a bulk string become the same String. Those are exactly the differences this repository exists to find, so the reader here keeps a reply as its shape and its bytes and compares it that way.

The corpus files carry no expected answers, because the expected answer is whatever Redis says. Writing them down by hand would turn this into a test of our reading of the documentation. Five files so far: strings, numbers, expiry, errors and the protocol, and they are mostly edges rather than happy paths, because the happy path agrees on every server that has ever shipped.

Divergences are sorted worst first in the report. Accepting a command Redis refuses is a correctness bug that will corrupt data for a client that relied on the refusal, and refusing it with different wording is a bug too, but a smaller one.

divergences.toml holds the differences we have decided to live with, each with a reason next to it, and an entry with no reason does not load at all.

suite/passing.txt is empty. The Redis suite has not been run against yodb yet, and that is the honest thing to write down until it has been. The run comes next, on server3, against the same Redis 8.10.1 the benchmarks use.

Two halves, because they catch different things.

suite/fetch.sh vendors the Redis 8.10.1 release tarball's tests/ directory
unmodified and suite/runtest.sh points it at a running yodb through the suite's
external mode. Their tests, our server, nothing patched out. A test that fails
because we have not written the command yet is still a compatibility failure,
it is just one with a date on it.

yocompat is the other half. It starts a real Redis and a yodb, sends both the
same commands and reports every reply that is not byte for byte the same. This
catches what their suite cannot, because their tests assert what their own
developers thought was worth asserting and leave out everything they take for
granted: that a missing key is $-1 and not _, that INCRBYFLOAT replies with a
bulk string and not a double, that the first word of an error is WRONGTYPE and
not ERR. Clients branch on all of it.

The RESP client here is deliberately naive and has no dependencies, because a
client from crates.io is written to be pleasant and turns a null bulk string
and a null array into the same None. That is exactly the bug this is for.

The corpus files carry no expected answers, because the expected answer is
whatever Redis says. divergences.toml holds the differences we have decided to
live with, each with a reason, and an entry with no reason on it does not load.

suite/passing.txt is empty. The suite has not been run against yodb yet and
that is the honest thing to write down until it has been.
@tamnd
tamnd merged commit d477a02 into main Aug 28, 2026
2 checks passed
@tamnd
tamnd deleted the the-two-halves branch August 28, 2026 15:51
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