synapse
A component of the AienOS ecosystem.
Brought by drakestapleton
synapse / evidence / g3-shm-ring / x5 / RULE.md
| 1 | # X5 decision rule (fixed before the run) |
| 2 | |
| 3 | Step G3 of ADR 0003 (issue #46). This file is committed before any X5 measurement is taken. |
| 4 | The bench tool (`wire-transport --rule`) refuses to run unless this file is tracked by git and |
| 5 | unchanged from the committed version, and it records the commit and the file's SHA-256 in |
| 6 | `spec.json`. |
| 7 | |
| 8 | ## Question |
| 9 | |
| 10 | Does the shared-memory ring (`RingStream`) carry the G1 workload at lower cost per accepted |
| 11 | change than the Unix socket (`UnixStream`), the G1 default? |
| 12 | |
| 13 | ## Workload and arms |
| 14 | |
| 15 | - The G1 workload, unchanged: the `wire-transport` change set (same fixture, same blob sizes, |
| 16 | same store), 2,000 changes per arm per repetition, run with `--release`. |
| 17 | - Arms: `ring`, `wire` (Unix socket), `direct_auth` (no wire, reference only). Arm order rotates |
| 18 | each repetition. |
| 19 | - 5 repetitions. 30 s idle window before the run for the idle power figure. |
| 20 | - Echo round trips (20,000 per transport per repetition) are recorded as supporting data only. |
| 21 | They are not part of the verdict. |
| 22 | |
| 23 | ## Bound (same as G1) |
| 24 | |
| 25 | `docs/PHASE5_GROUP_COMMIT.md` section 5: t_floor 0.806 ms and E_floor 18.6 mJ per durable |
| 26 | change. Results are reported as multiples of this bound; the bound is not part of the verdict. |
| 27 | |
| 28 | ## Validity |
| 29 | |
| 30 | A run is valid only if every submitted change in every arm and repetition is accepted and none |
| 31 | is reported as a duplicate (the tool aborts otherwise). An invalid run gives no verdict: the ring |
| 32 | is NOT ADOPTED, and the run may be repeated once with both runs kept. |
| 33 | |
| 34 | ## Verdict |
| 35 | |
| 36 | ADOPTED only if both hold: |
| 37 | |
| 38 | 1. Seconds per accepted change: the ring's median over the 5 repetitions is lower than the |
| 39 | socket's, AND the ring's slowest repetition is faster than the socket's fastest repetition. |
| 40 | 2. Package joules per accepted change, from the real instrument: the same test (median lower, |
| 41 | ring maximum below socket minimum), with every repetition's energy window valid. If joules |
| 42 | are not available from a real instrument, the joules figure is INSTRUMENT_UNAVAILABLE and |
| 43 | the verdict is NOT ADOPTED. |
| 44 | |
| 45 | Otherwise NOT ADOPTED: the Unix socket stays the default transport, and the ring is kept as a |
| 46 | tested, optional transport (its safety tests and this measurement stay in the tree). |
| 47 | |
| 48 | The verdict is computed by `x5_verdict` in `crates/synapse-bench/src/bin/wire-transport.rs` |
| 49 | and written to `result.json`. One run; no re-runs to change a verdict. |