Skip to content

Specs and parity tests

Changing. Follow: #507, #656, #715, #895, #896

A specification says what the game does, and a parity test checks that our output equals output the game produced. This page shows how each is built and how the two meet in a pair of issues. The exact rules for writing a spec are in docs/spec/README.md, and this page only helps you find your way around them.

Take docs/spec/whitelist.md as the model. Its section 0 holds the conventions of the document, and it takes the provenance labels from section 0.3 of docs/spec/registry.md.

Part What it holds
Terms (0.1) Each term of the domain, defined once. The text uses the same word every time.
Provenance and confidence (0.2) Where the labels such as black_box_confirmed and source_suggested come from, and the confidence that one observation gives.
ID prefixes (0.3) A short prefix per subject, for example WL-JOIN for the whitelist check at login.
Scope (0.4) What the document states, and what it leaves to other documents.
Rules One heading per rule, with an ID like WL-JOIN-002, the behavior, a provenance line, its kind and its confidence.
Intentional deviations Where mcrs does not copy an accident of the game, with the behavior of the game and the reason.
Unresolved What is not decided yet.

Some specs also have a section “Known vanilla quirks” or “Experiments”. An experiment records the steps and observed result of a run against the game; raw output goes to a test fixture. A spec holds no captured results or run logs, no status rows, no version header and no text about our code.

A rule exists only when an observer can see a difference: the vanilla client, a player in normal play, a data pack or a save file, or a user of the library. The author first writes the behavior a player expects from public documentation, the data pack and the artifacts of the game. Then the author lists the questions these sources leave open and reads the game’s code only to answer them.

A rule has one of seven kinds: wire, client agreement, semantic, layout, deviation, quirk or unspecified. A deviation is where mcrs differs from the game on purpose, and it is the default for an accident of the game. A quirk is an accident that mcrs keeps because a client, a data pack or a save file depends on it, and only the owner decides that a rule is a quirk. A parity test must not compare an unspecified rule.

A spec is ready when its section “Unresolved” is empty and no rule has the label source_suggested. An implementer does not start on a spec that is not ready.

On 2026-11-30, docs/spec/ holds 133 Markdown files, the README included. The specification index lists them by domain.

The specification index lists the remaining readiness limits; Parity with vanilla covers the implementation status of connection acknowledgements and reach checks.

Specifications use Simplified Technical English (ASD-STE100): one word for one concept, short sentences, simple tenses, active voice, “must” for a requirement. This site does not use that style. Write this site in plain English, and write docs/spec in ASD-STE100.

A new behavior takes two issues, as the section “A new behaviour” of docs/clean-room.md describes. Block breaking is an example. Its task asks for the specification and the implementation as two steps, with a second agent that implements from docs/spec/ only.1 The task for teleport confirmation asks for a specification first, and then for engine tests per rule.2 How to contribute describes the agent roles for such a pair.

A good pair looks like this:

  1. Issue A, label clean-room: “Specify X”. It is done when docs/spec/x.md is merged and states which inputs, outputs and order matter.
  2. Issue B: “Implement X”. Work on it starts when the spec is ready. It is done when each rule has a test that names its rule ID.

A spec PR is a docs PR and does not touch code. An implementation PR cites rule IDs and does not change the spec. If the spec is wrong or silent, go back to issue A.

Fixtures come from the game through the oracle

Section titled “Fixtures come from the game through the oracle”

A fixture is a file the game produced. The table tools/fixtures.json is the single place that states a fixture’s name, the Gradle task that makes it and the folder it goes to. It has 57 entries; 13 write fixtures into world generation crates.

A second file, tools/captures.json, records the game version at which each fixture was captured. A test fails by name for every fixture whose version is not the one in assets/minecraft/version.json, so after a snapshot update that test is your to-do list. Move to a new snapshot covers the rest of the update.

The tool that takes the captures is tools/vanilla-oracle. It runs parts of the game in a Gradle project and dumps their output. Most tasks start no server and no client. The capture of client frames starts a game client, and recordInventoryE17 runs the client recorder, which starts a vanilla server and a vanilla client. One command recaptures a fixture:

Terminal window
cargo run -p mcrs_minecraft_update -- recapture <fixture name>

The section “Experiments” of docs/spec/README.md names two more tools for a run against the game. tools/mcrs_minecraft_client_recorder records a vanilla client that the input agent of tools/vanilla-client plays, and tools/vanilla-server starts the vanilla server for a script.

tools/mcrs_minecraft_probe plays an experiment of a spec as a scenario file, which is a list of steps of scripted clients such as a join, a command or a container click, and writes a trace of what each client observed at each step. Its binary records the trace against the vanilla dedicated server on a new flat world, as its README describes. A test of the mcrs server plays the ban scenario on an embedded server and compares each step with the vanilla trace. For a step that traces/bans.mcrs.json lists as a known difference with a reason, the test compares with the result written in that file instead, so a listed step that changes again still fails.

A parity test lives in a file named parity.rs or *_parity.rs. It loads its expected values from a fixture through mcrs_minecraft_fixtures, because the test claims to match the game and only a file the game produced can back that claim. The parity check of xtask warns when such a test loads no fixture or compares against a literal. Run the check with scripts/hooks/run-checks commit.

To add a parity test, capture the fixture with the oracle as its README describes, load the fixture in a *_parity.rs test, and name the rule ID in the test name.

A report of the rules that no test names is planned.4

The parity of world generation is a special case. The reference dumps cover chosen seeds and chunks, so “matches vanilla” there means “matches on these dumps”. Parity explains this.

  1. Works#474 Asks for the specification and the plugin of block breaking. ↩

  2. Works#623 Asks to specify which accept confirms a teleport, and the resend of an unconfirmed one. ↩

  3. WIP#656 Plans that specifications mark edition-specific rules. ↩

  4. WIP#507 Plans a report of the specification rules that no test checks. ↩

Sources and verification

Verified: 26.4-snapshot-7, 1cf84286c, 2026-11-30

Related open issues:

  • #507 WIP Report the specification rules that no test checks
  • #656 WIP Specifications mark edition-specific rules
  • #715 WIP Specifications state expected semantics; a reference accident is a deviation unless the client needs it
  • #895 WIP Inventory specification: run the experiments and reach the status ready
  • #896 WIP Inventory transactions specification: run the server experiments