Skip to content

Convert to a workspace, and make fault injection opt-in - #3

Merged
eduralph merged 1 commit into
mainfrom
workspace-conversion
Jul 13, 2026
Merged

Convert to a workspace, and make fault injection opt-in#3
eduralph merged 1 commit into
mainfrom
workspace-conversion

Conversation

@eduralph

Copy link
Copy Markdown
Contributor

Phase 1 of the parity-harness plan: mechanical restructure, no behaviour change. Unblocks the runners.

Why

The repo is a client parity harness now, not a wyrd-specific gate, and the layout should say so. The M4 gate stops being the whole crate and becomes one suite among the ones to come; the fixtures it happened to own are split out so a future differential runner can use them without first agreeing to a MetadataStore.

crates/harness      client-agnostic: $PD_ADDRS, PD's region layout as ground truth,
                    deterministic byte corpora. Nothing here knows what a MetadataStore is.
crates/wyrd-gate    the M4 evaluation gate: the vendored contract, the TikvMetadataStore
                    mapping, and the 18 gate tests.

git mv throughout, so history follows (GitHub shows the files as renames). The crate rename client_rust_testwyrd_gate is the only source change. Same tests, same verdict.

Fault injection is now opt-in — and that is not cosmetic

fail was an unconditional dev-dependency carrying features = ["failpoints"]. In a single package that was merely untidy. In a workspace it is a hazard: cargo test --workspace unifies fail/failpoints into the same tikv-client that a differential runner links — compiling fault-injection machinery into the binary whose entire job is to observe unmodified client behaviour.

Compiled-in failpoints are inert until configured, so this is contamination rather than a live bug. Which is exactly the kind of thing that quietly makes a result untrustworthy months later, when nobody remembers why it's there.

It's now an optional dependency behind a failpoints feature, off by default. (A dev-dependency cannot be optional — Cargo features can't enable dev-deps — so fail moves to [dependencies], the same shape client-rust itself uses.) The failpoint suite declares required-features = ["failpoints"] so it cannot even build without it, and gate-verdict.sh builds only that binary with the feature: the gate suite observes an unmodified client.

Evidence

$ cargo tree -e features -i fail                                 # default build
  failpoints features: 0

$ cargo tree -e features -i fail --features wyrd-gate/failpoints
  failpoints features: 4

$ cargo check -p wyrd-gate --test failpoint_gate --features integration-tests
  error: target `failpoint_gate` in package `wyrd-gate` requires the features: `failpoints`

Full make verdict against a real cluster is unchanged: 17 green, d6 XFAIL on its own assertion, d7 XPASS locally (the sibling checkout carries PR 547's fix; CI runs at the pin, where it XFAILs).

Bonus: the region-encoding tests now run as cluster-free lib unit tests, where before they only ran inside the integration binary.

Also updated for the move: CODEOWNERS, README layout/paths, and the one findings doc that cited a test path.

Checklist

  • make check green (workspace-wide clippy -D warnings)
  • Verified against a real cluster — verdict identical to pre-conversion
  • Cross-vendor reviewed (Codex): no findings
  • History preserved (git mv; renames detected)

🤖 Generated with Claude Code

The repo is a client parity harness now, not a wyrd-specific gate, and the layout
should say so. The M4 gate stops being the whole crate and becomes one suite among
the ones to come; the fixtures it happened to own get split out so a future
differential runner can use them without first agreeing to a MetadataStore.

  crates/harness    client-agnostic: $PD_ADDRS, PD's region layout as ground
                    truth, deterministic byte corpora. Nothing here knows what a
                    MetadataStore is.
  crates/wyrd-gate  the M4 evaluation gate: the vendored contract, the
                    TikvMetadataStore mapping, and the 18 gate tests.

Mechanical: git mv throughout so history follows, and the crate rename
(client_rust_test -> wyrd_gate) is the only source change. Behaviour is unchanged
— same tests, same verdict.

FAULT INJECTION IS NOW OPT-IN, and that is not cosmetic.

`fail` was an unconditional dev-dependency carrying features = ["failpoints"]. In a
single package that was untidy. In a workspace it is a hazard: `cargo test
--workspace` unifies `fail/failpoints` into the SAME tikv-client that a differential
runner links, compiling fault-injection machinery into the binary whose entire job
is to observe UNMODIFIED client behaviour. Compiled-in failpoints are inert until
configured, so it is contamination rather than a live bug — which is exactly the
kind of thing that quietly makes a result untrustworthy months later, when nobody
remembers why.

It is now an optional dependency behind a `failpoints` feature, off by default.
A dev-dependency cannot be optional (Cargo features cannot enable dev-deps), so
`fail` moves to [dependencies] — the same shape client-rust itself uses. The
failpoint suite declares `required-features = ["failpoints"]`, so it cannot even
build without it, and gate-verdict.sh builds ONLY that binary with the feature: the
`gate` suite observes an unmodified client.

Verified: `cargo tree -e features -i fail` reports 0 `failpoints` features in the
default build and 4 with the feature on; `cargo check --test failpoint_gate` without
it errors "requires the features: failpoints" rather than silently building. Full
`make verdict` against a real cluster is unchanged — 17 green, d6 XFAIL on its own
assertion, d7 XPASS locally (the sibling carries PR 547's fix). The region-encoding
tests now run as cluster-free lib unit tests, where before they only ran inside the
integration binary.

Also updated for the move: CODEOWNERS, README layout/paths, and the one findings
doc that cited a test path.
@eduralph

Copy link
Copy Markdown
Contributor Author

@codex review

@eduralph
eduralph merged commit c5b78ba into main Jul 13, 2026
3 checks passed
@eduralph
eduralph deleted the workspace-conversion branch July 13, 2026 21:23
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