Reversible clean-root candidate rebuilt from oak/benchmarks main@009dead264ca; original repository retained.

mrmrs-95dda3

mrmrs-95dda3Closedinto main

4 commits · 46 files · +43 added · ~3 modified

Description

P4 robustness suite: crash points, fault injection, concurrency invariants

Adds suites/robustness/, a VCS-agnostic robustness harness for Oak (loopback oak serve) and Git (local bare repo / stdlib smart-HTTP), plus the robustness lane in the row contract (scripts/oakbench/rows.py, lane_contract.py, scenarios/robustness.yaml; additive).

  • crash_time_v1 / crash_syscall_v1: kill -9 the client at 11 time fractions and before every fsync / F_FULLFSYNC / rename (DYLD interposer on an ad-hoc re-signed copy of the same binary, codesign checked, both sha256 recorded) during commit, push, pull (ff and diverged/re-parent), clone, switch and git merge.
  • fault_proxy_v1: loopback-only fault proxy (503, drop-after-send, truncated reply, kill before/after upstream, slow, jitter) on every recorded request.
  • conc_* / lock_*: N-client same/distinct-branch pushes checked by a stdlib linearizability checker (Porcupine method, re-implemented), a no-lost- acknowledged-write oracle, and Oak's reported pushed_head vs the local head; shared-checkout commit/push lock contention; stale lock owner reaping.
  • env_*: disk full (RAM disk filled to 1-byte granularity, free space measured before the op), read-only store/subdir, fsync storm.
  • hosted_merge_invariants_v1: merge-owner invariants spec (unsupported rows until a local oakspace driver exists).

Invariants are judged by independent readers: stdlib sqlite3 on private copies of Oak's stores, P1's oak_sqlite_reader for hash-verified trees, and real Git plumbing for Git. Classes: held / violated / fault_not_fired / unsupported / harness_error. A case whose fault never took effect (kill after the op exited, disk not short of the op's need, no proxy rule matched) is fault_not_fired, never held; late time kills are re-aimed from the observed duration first. worktree_not_torn fails when the op's own partial output (target-side files while HEAD is on the old side, or its temp files) is presented as ordinary uncommitted user changes. "Actionable" requires a concrete recovery command, an explicit manual step, a documented retryable condition or a specific error code; corruption, internal and panic text never qualify. The lane validator rejects unknown classes, class/returncode mismatches, and held rows whose fault did not fire. Oak bugs are reported here, not fixed.

Results on this head (4f4412a1), oak 0.105.0 (sha256 4dc220e1...) vs git 2.50.1 (Apple Git-155), macOS arm64, loopback only.

Full matrix (20260928T233950Z, 31.5 min): 517 cases, held 366 / violated 122 / fault_not_fired 9 / unsupported 20 / harness_error 0. oak: held 222 / violated 80 / fault_not_fired 4 / unsupported 12 git: held 144 / violated 42 / fault_not_fired 5 / unsupported 8 28 time points were re-aimed and fired; 0 held rows have fault_fired=false. fault_not_fired: 7 disk-full rows (4 MiB free was enough, and git commit at 256 KiB) plus 2 time points where the op beat every re-aimed kill.

Quick matrix, run twice: 233 cases each. quick1 (11.8 min): held 165 / violated 48 / fault_not_fired 0 / unsupported 20 quick2 (14.9 min): held 166 / violated 47 / fault_not_fired 0 / unsupported 20 Every oak cell is identical across the two runs. Three git crash_time cells (clone, merge_local, push; 3 rows each) moved by one row because the ms-scale git ops put the kill in a different phase; every row fired.

Oak bugs (repros in suites/robustness/repro/):

  • fb-534 Blocker (loopback oak serve): two concurrent pushes to one branch are both acknowledged and one is lost. Suite: conc_same_branch N=8 and N=16, and under the fsync storm, violate no_lost_acknowledged_write, acked_content_on_server and linearizable. Repro: concurrent-push-lost-ack.sh.
  • fb-535 High: kill -9 during oak switch or oak pull (ff and diverged) leaves a torn worktree. HEAD / current_branch still names the old side while some files hold the target side (plus a .tmp file). Status presents these as the user's uncommitted changes with progress_state.in_progress=false. A re-run switch refuses with no guidance. A re-run pull advises "run oak commit to keep them", which would commit the pull's partial output as the user's own work. Violated fired crash rows: switch 26/27, pull_ff 25/27, pull_diverged 23/26. The held rows were killed before any file changed, or after the ref and worktree had both reached the target. A pull that fails on a read-only subdirectory reaches the same state. Repros: switch-kill.sh, pull-kill.sh.
  • Observations (not filed): at 0 bytes free, oak pull fails with "Database error: unable to open database file" and oak clone with the serve's "HTTP 500 Internal Server Error". Neither names the cause. Same-branch contention liveness is low under N=8/16.

Held for oak: every commit, push and clone crash point (73 fired), all 132 network-fault cases (unknown outcomes never reported as success), stale lock-owner reaping, shared commit/push locks, read-only store, and disk full at 0 / 256 KiB for commit and at 256 KiB for pull and clone.

Git findings under the same oracles (differential context, not Oak bugs):

  • a torn clone that status does not recognise (partial_clone_detected);
  • a crashed merge's stale index.lock with "Unable to write index";
  • the switch window before HEAD's rename (index and worktree switched, HEAD old, no lock left);
  • a pull that hits ENOSPC or a read-only subdir leaves half-applied files;
  • losing the ref-lock race gives "remote rejected (failed to update ref)" with no recovery step;
  • a push killed during the remote-tracking ref update leaves an empty ref .lock, and git 2.50's fsck then reports badRefContent. Mid-checkout git crashes that leave index.lock count as flagged, because every git mutation refuses until the user intervenes.

Tests: tests/test_robustness_{lincheck,faultproxy,runner,invariants}.py. Full bare suite python3 -m unittest discover -s tests on this head (merged with main 5dd811a1): 1288 tests OK (36 skipped).

Provenance and attribution: all ideas are re-implemented here, and no code is copied. ALICE (OSDI'14) and CrashMonkey/ACE (OSDI'18) crash-state enumeration; Porcupine (MIT license) linearizability checking method, Wing-Gong/Lowe; jj's test_bad_locking (Apache-2.0) copied-workspace pattern; Jepsen nemeses. Seed harnesses: L9 pull-loss kill-9 matrix, L8 lock/fsync harnesses, W3a QA fault proxy. Results are not committed (ADR-0003).

Commits4

docs/prior-art.mdmodifiedView file

@@ -3,7 +3,27 @@
33 This page records prior-art influence without importing another project's
44 benchmark implementation. The suite may learn from behavior categories,
55 reporting vocabulary, and measurement controls, but it must not vendor external
6-benchmark code or translate external shell scripts into local Python.
6+benchmark code or translate external shell scripts into local Python, except
7+for the recorded exception below.
8+
9+## Recorded Exception: gitoxide merge baselines (2026-09-28)
10+
11+`suites/merge/vendor/gitoxide/` vendors three gix-merge fixture scripts
12+(`tree-baseline.sh`, `tree-cartesian-baseline.sh`, `text-baseline.sh`)
13+verbatim from gitoxide commit `acf906f8fcdb8e8d143570737786543dc5a204a0`.
14+
15+- License: MIT OR Apache-2.0 (permissive). Both license texts and a `NOTICE`
16+ are carried next to the scripts. The SHA-256 of each script is pinned in
17+ `UPSTREAM.json` and checked by `tests/test_merge_suite.py`.
18+- Rationale: the scripts are a curated, upstream-maintained catalogue of
19+ merge-ort edge cases, including an exhaustive 14x14 operation product.
20+ Re-deriving them would lose that coverage and add transcription risk. They
21+ are only executed with real Git to build fixture repositories. Git's own
22+ merge-ort computes the reference result, and no gitoxide code runs in the
23+ measured path.
24+- Scope: this exception covers only these files. GPL sources, including
25+ Git's t64xx merge tests, stay clean-room: shapes are re-expressed from
26+ testcase prose and cited by ID, and no text is copied.
727
828 ## Clean-Room Rule
929