---
title: "Testing & verification"
description: "Verification layers, ordered G0-G8 gates, and the current G6/G7 boundary for the Rust Swift family."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.myswift.rs/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing & verification

> **Current gate boundary — 2026-08-31**
>
> The historical examples on this page do not constitute acceptance of the
> current release line. Formal W068 replication plus W069 EC merge exactly once
> in fail-closed scorer W070: **G6 GREEN, 179/179, zero unexpected result**.
> The G7 lab gate is 20/20 PASS on swift1 `:18080`
> (`tools/test-results/optimize-ae-20261003/verdict.json`, 2026-10-03). The
> production cluster passed G7. Production
> `/usr/local/bin/swift-proxy-server` on swift1–4 and hkserver is sha256
> `ce738dc3a7adb01167c16660924e79a1e215a3245d5d90bbe682d36b7cfa5696`
> (`tools/test-results/optimize-ae-20261003/0I-g7-prod.md`, 2026-10-04).
> The last full production G7 on `http://10.0.0.10:8080` is 20 PASS, 0 FAIL, 0 NOT RUN
> (`tools/test-results/optimize-ae-20261003/verdict-prod.json`, 2026-10-04).
> The full yaml is the 20-case run.
> The production cluster passed G7. Production readiness is GO. The accepted
> Rust Swift source is `17adf0bfa78b30b2a7eed9f39836e0d63c715d2c`; see [Current
> status](/status-2026-08-31) for the dated record and evidence paths.

Peregrine is verified in ordered layers. A change is only accepted when the
required layer is green and its provenance is recorded; a unit result, a
single-node SAIO result, or a partial canary cannot close a later gate.

## Gate order and exact accounting

G0 provenance → G1 Linux environment → G2 reproducible build → G3 route-level
async proof → G4 official Swift functional parity → G5 official S3 parity →
G6 storage/probe semantics → G7 concurrency and fault behavior → G8 performance
and soak. The accepted G6 record has two explicit formal lanes: **147
replication identities in W068** and **32 EC identities in W069**. W070 merges
them against the frozen oracle exactly once; the replication lane is never
promoted by itself. This closes G6 and opens G7. The later lab run closed the
G7 lab gate on swift1 `:18080` only. It does not close G7 for the production
cluster.

## 0. CI — every push, the full suite

Since 2026-08-17 (`.github/workflows/ci.yml`) every push and pull request
runs the **entire** workspace test suite plus the EC slice on GitHub
Actions, with liberasurecode pinned ≥ 1.6.5
([why](/lab-cluster#install-checklist)). `cargo fmt` and `cargo clippy` run
as report boards over the known pre-existing debt. This gate exists because
filtered, manual test runs let a broken test target rot unnoticed for two
weeks — that class of debt is now structurally closed.

## 1. Unit + golden (format fidelity)

Every serialized format has a golden round-trip: the real Python Swift writes a
fixture, `swift-rust` must read it and reproduce it byte-for-byte, then Rust
writes and Python reads back. The workspace runs 1 400+ tests across 83
targets and grows with every fault-injection wave (2026-08-17 baseline:
1 422 passed, zero failures; the WORM and version-CAS waves added ~60 more
the same day).

```sh
cargo test --workspace --exclude swift-ec
cargo test -p swift-ec -p swift-object-server -p swift-proxy-server \
  --features swift-proxy-server/ec,swift-object-server/ec
cargo clippy --workspace --exclude swift-ec --all-targets -- -D warnings
```

## 2. Functional parity vs the Python oracle

A single parameterized suite runs against both a Rust stack and a Python Swift
SAIO, so the two PASS/FAIL tables are a direct parity comparison: CRUD, byte
ranges (single, suffix, multipart), swob conditionals, SLO/DLO, erasure coding,
copy, expiry, ACLs, cross-account denial, and negative cases.

> **Result**
>
> Everything matched the oracle except three deviations — client ETag not
> validated on PUT, a quoted client-facing ETag, and metadata length not
> enforced. All three were root-caused, fixed, and re-verified (Rust SAIO 54/54).
> See [Security](/security) for the details and the layering.

## 3. Performance A/B

A concurrent driver runs a PUT/GET matrix (object size × concurrency) and
reports throughput (ops/s, MB/s) and latency percentiles. Run it against a Rust
SAIO and a Python SAIO on the same host for an implementation A/B, and against
the cluster for production numbers. `cosbench-rs` + `autocos` provide
COSBench-grade load for larger runs.

## 4. Production, on the HA cluster

Against the four-node Contabo HA lab (VIP `10.0.0.10:8085` — see
[Lab cluster](/lab-cluster) for topology and cutover rules):

1. **Step 1**

   the functional suite on the real client path (prefer the Keepalived VIP, or a node HAProxy `:8085`);
2. **Step 2**

   sustained `cosbench-rs` / `autocos` load at production concurrency;
3. **Step 3**

   the console **Lab** for fault injection — fragment loss → reconstructor heal, and node-down failover — with read-back integrity;
4. **Step 4**

   large-object streaming-memory checks (a multi-GB PUT/GET while sampling RSS);
5. **Step 5**

   after replacing VMs: re-run `ha-test.sh`, `ec-heal-test.sh`, and confirm Prometheus `nodes_up=4`.

## 5. Strict S3 dual-oracle

The S3 surface has its own scored gate: the frozen 57-case runner sends
identical requests to the live Rust fleet and a stock Python Swift 2.33
oracle and compares what a client sees. Methodology, the GREEN contract, and
the historical 49/8 scoreboard: [Dual-oracle verification](/dual-oracle).

## Recent delivery — cold + Contabo S3

Lab LocalDir cold + restore + archive-on-transition units GREEN; Contabo S3 extended matrix 29/29 GREEN (bounded); canary runbook only. See [Cold + Contabo S3 delivery](/cold-contabo-delivery) (**IMPLEMENTED_SUBSET_ONLY**).

## The harnesses

`swift-rust/tools/` ships every harness used above, each runnable against any
endpoint:

| Script | Proves |
|--------|--------|
| `func-suite.sh` | functional parity (Rust and Python, one script) |
| `bench.py` / `wbench.py` | throughput + latency percentiles |
| `cbench.py` | write throughput vs container count |
| `py-saio-setup.sh` / `rust-saio-setup.sh` | stand up a Python / Rust SAIO |
| `ec-heal-test.sh` | EC fragment-loss → reconstructor heal |
| `ha-test.sh` | node-down failover via the console |
| `ci-fulltest.sh` / `regress.sh` | remote build + test + clippy + fmt; regression tally |

Source: https://docs.myswift.rs/testing/index.mdx
