Commit 76308956
7630895676caMergedfrom mrmrs-0aad77
mrmrs · 1 month ago · 15 files · ~15 modified
Description
Bench hardening: QA follow-ups for Round 2 addresses the QA FIX verdict on 5717cc9f (QA worker /Users/mrmrs/o/worker-mrmrs-20260928T190315-qa-hardening). Round 3 addresses QA round 2's blocking finding on 36943587 (actionable() recovery-mention laundering).
P2 conformance gate
a. publish_gate refuses any expected-failure entry whose ticket is still pending:<slug>, whatever the outcome (bug/refused/intermittent), via conformance_gate.pending_tickets(). devloop only notes pending tickets.
b. load_expected() rejects catch-all error patterns: a pattern that fullmatches the empty string, a generic sentinel, or seeded random text, or that has no required literal (wildcards/classes only). Invalid regexes are rejected too.
Round 2 adds 354 sentinels in total, including subject-shaped ones in the real leg-detail shape: "oak|git exited N: <panic | corrupt | database disk image is malformed | HTTP 500 | unable to open database file | bad object>", plus the legacy "command (...) failed (N): b'...'" shape. .*oak.*, (?:oak|git) .*, oak .* exited \d+: .* and .*error: .* are now rejected. All 11 shipped patterns still load.
P3 merge suite c. When a row violates its stated expectation, the law checks still run, and their reasons are appended. Rows without a unique merge base (criss-cross, t6416) run the base-free law checks (evidence.law_base_free): values both sides agree on must be kept, and no new conflict markers. Bug mapping stays strict (all reasons must match one bug). The fb-541 row still maps: it carries only its expectation reason, because Oak kept the agreed files and committed no markers. An injected extra loss unmaps it (unit test). d. Row schema is now merge_suite_schema_version 2. --resummarize exits 2 when any row is missing the version or is on another version. The message says "predate" for older rows and "NEWER merge suite" for newer ones. It also exits 2 on an empty file. --allow-stale-schema forces a summary, with every status "indeterminate". Bug status counts only pinned rows the run executed: a subset run says "not in this run". A pinned row that is now harness-error or unsupported goes to indeterminate_rows, and the bug reads "harness-error (indeterminate)", never "fixed?".
P4 robustness suite (SUITE_VERSION p4-robustness-2026-09-29.2)
e. M1: GitAdapter.blocking_locks() counts index.lock, HEAD.lock and the current branch's refs/heads/.lock as in progress. These are the locks that make git commit refuse with "remove the file manually". This is verified against real git with planted locks. config.lock, other refs' locks, tags, packed-refs.lock and ORIG_HEAD.lock do not block a commit and are not counted.
f. L1 (round 2): git's "Automatic merge failed; fix conflicts and then commit the result." / "Not possible to fast-forward, aborting." count as actionable only when:
- the subject is git (argv[0] basename), and
- every output line is on an allowlist of git's ordinary merge/pull lines (Auto-merging, CONFLICT (...), hint:, From, FETCH_HEAD, Updating, ref-update lines). Any other line makes the hint not count, e.g. bad object HEAD, unable to read sha1 file, invalid object, early EOF, segfault, unable to read tree, empty object file, unable to write new index file, unable to open database file, corrupt, HTTP 500, not a git repository. Each of these is tested before and after the hint. Round 3: actionable() now checks the corruption / internal / opaque wording FIRST and returns False before any recovery-command, recovery-step, hint, JSON-code or retry check. So corruption plus "git merge --abort" / "run oak push again" / "use --abort" is non-actionable. NON_ACTIONABLE_RE gains "unable to open database file" (fb-548's opaque error), bad/invalid object, unable to read sha1 file/tree, early EOF, Segmentation fault and "object file ... is empty". QA's 6 examples plus 5 more are pinned False for both actionable and env_actionable, for git and Oak. g. (round 2) The disk was really filled, so an op that fails, errors or hangs on it is always JUDGED (fired, invariants checked). fb-548's opaque "unable to open database file", a panic (rc 101) or a hang therefore violate op_failure_actionable / op_no_hang. Only a SUCCESSFUL op with measured free >= need and no ENOSPC is fault_not_fired. The separate unattributed class is removed. A failed calibration no longer zeroes the need: op_need_bytes returns None and the row is harness_error. Read-only works the same way: a failing op is always judged. A successful op is fired only if the path was unwritable and the op wrote there (a permission error in the output, or a clean probe run changes something under the path); otherwise it is "not exercised". A successful op whose probe failed is harness_error, never held. Tests cover fb-548's exact text, a panic and a hang, for both disk-full and read-only.
Validation (worker /Users/mrmrs/o/worker-mrmrs-20260928T183101-bench-hardening, oak 0.105.0; code identical to the pushed head)
- Unit: 1,380 tests OK (7 skipped); main 3354584a had 1,361.
- Merge suite, fresh run of --groups native,gix-text: gitoxide-text 51/2/11 (equal/differs/oak-wrong), native 8/0/1. Identical to the landed full4 for these groups. 0 unmapped. fb-537 11/11 and fb-541 1/1 as pinned, the others "not in this run". --resummarize reproduces the summary exactly (runs/merge-summary.json regenerated). The landed v1 full4 is refused.
- Conformance matrix: gate PASS: 47 pass, 6 xfail, 4 refused, 0 intermittent, 0 regressions, 0 unmeasured, 4 skips.
- Robustness --quick (round 3, bench quick-hardening-r3): 233 cases, held 168 / violated 45 / fault_not_fired 0 / unsupported 20 / harness 0 (landed QA 166/47/0/20; round 2 167/46/0/20).
- git crash_syscall switch "before rename#2": violated -> held (M1 false violation, same as round 2).
- git crash_time merge_local t=442ms: violated -> held vs round 2. Kill timing, not the rule: the later kill left MERGE_HEAD, so the next op says "You have not concluded your merge ... commit your changes" (actionable). The other points still hit "could not write index / stash failed" and stay violated. A stricter actionable() can only turn held into violated, never the reverse.
- Oak disk-full pull_ff / clone stay violated (op_failure_actionable), now also because "unable to open database file" is unactionable: pull "Database error: unable to open database file", clone "HTTP 500 ...: unable to open database file".
- Oak conc_same_branch / env_fsync_load concurrent.push: same rows violated, one fewer invariant name (acked_content_on_server) vs landed. This is run-to-run variance of the fb-534 race and identical to round 2.
Details
- Commit
- 7630895676ca
- Parent
- 3354584a5d91
- Merge parent
- bd39a563b7f5
scripts/oakbench/conformance_gate.pymodifiedView file
measured behaviours are UNMEASURED. publish_gate additionally requires a recorded profile;- harness errors, reader-unmeasured legs and required behaviours with no row make the result UNMEASURED. make the result UNMEASURED;- error patterns must be specific: the loader rejects any pattern that matches the empty string, matches a nonsense/generic sentinel string (``panicked``, ``corrupt``, random text ...) or contains no literal character at all (only wildcards/classes), because such a pattern would hide any error under the expected failure;- ``pending:`` tickets are listed in every summary; publish_gate refuses any entry that still carries one (devloop only notes them).Only the gated subject (Oak) is judged; Git rows are the reference arm."""import jsonfrom pathlib import Pathimport randomimport reimport stringtry: # Python >= 3.11 import re._parser as _sre_parse # type: ignore[import-not-found]except ImportError: # pragma: no cover - Python < 3.11 import sre_parse as _sre_parse # type: ignore[no-redef]ROOT = Path(__file__).resolve().parents[2]EXPECTED_FAILURES = ROOT / "config" / "conformance_expected_failures.json"SCHEMA_VERSION = 2 "non_utf8_names"})# A legitimate expected-failure pattern pins one concrete error; it must match# none of these. They cover generic failure words (so "panicked"/"corrupt"# cannot hide under an xfail), the kind of text a catch-all pattern swallows,# and deterministic random noise._rng = random.Random(0x0A4B)SENTINELS = ("", " ", "\n", "x", "panicked", "corrupt", "error", "failed", "zzz-sentinel", "thread 'main' panicked at src/main.rs:1:1", "database disk image is malformed", "internal error", "HTTP 500 Internal Server Error", "Segmentation fault: 11", "zzz-sentinel: no such behaviour exited 99", *("".join(_rng.choice(string.ascii_letters + string.digits + string.punctuation + " ") for _ in range(_rng.randint(1, 60))) for _ in range(24)))del _rng# Subject-shaped sentinels: real conformance leg details look like# "oak <cmd> exited N: error: ..." (legacy: "command (...) failed (N): b'...'"),# so a pattern like `oak .* exited \d+: .*` or `.*error: .*` would swallow a panic,# a corrupt store or a server 500 in that exact shape. None may match._BAD_ERRORS = ("thread 'main' panicked at src/main.rs:1:1", "error: corrupt object 0123abcd", "error: Database error: database disk image is malformed", "error: Server error: HTTP 500 Internal Server Error: internal error", "error: Database error: unable to open database file", "fatal: bad object HEAD")_COMMANDS = ("oak commit --no-verify", "oak push --repo", "oak clone conformance/r1-2", "oak pull", "oak status", "git commit -q", "git push -q", "git clone -q", "git pull -q")SUBJECT_SENTINELS = tuple( [f"{cmd} exited {rc}: {err}" for cmd in _COMMANDS for rc in (1, 2, 6, 101, 128) for err in _BAD_ERRORS] + [f"command ('commit', '--no-verify') failed ({rc}): b\"{err}\\n\"" for rc in (1, 2, 101) for err in _BAD_ERRORS] + [f"command ('commit', '--no-verify') failed ({rc}): b'{err}\\n'" for rc in (1, 2, 101) for err in _BAD_ERRORS if "'" not in err] + [err for err in _BAD_ERRORS] + [f"oak: {err}" for err in _BAD_ERRORS])SENTINELS = SENTINELS + SUBJECT_SENTINELSdel _BAD_ERRORS, _COMMANDSdef _has_literal(parsed) -> bool: """True if the parsed regex contains a literal character outside a character class.""" for op, arg in parsed: name = str(op) if name == "LITERAL": return True if name in ("NOT_LITERAL", "IN", "ANY", "AT", "CATEGORY", "GROUPREF", "GROUPREF_EXISTS"): continue if name == "SUBPATTERN": if _has_literal(arg[-1]): return True elif name in ("MAX_REPEAT", "MIN_REPEAT", "POSSESSIVE_REPEAT"): low, _high, sub = arg if low > 0 and _has_literal(sub): return True elif name == "BRANCH": # every alternative must carry a literal for the branch to count if all(_has_literal(alt) for alt in arg[1]): return True elif name == "ATOMIC_GROUP": if _has_literal(arg): return True return Falsedef pattern_too_broad(pattern: str) -> str | None: """Why an expected-failure error pattern is a catch-all, or None if it is specific.""" compiled = re.compile(pattern, re.S) for sentinel in SENTINELS: if compiled.fullmatch(sentinel): return f"matches the sentinel {sentinel!r}" if not _has_literal(_sre_parse.parse(pattern, re.S)): return "has no required literal text (wildcards/classes only)" return Nonedef fs_dependent_skip_allowed(behaviour: str) -> bool: from oakbench.conformance_matrix import BY_ID spec = BY_ID.get(behaviour) for leg, pattern in legs.items(): if not isinstance(pattern, str) or not pattern: raise ValueError(f"conformance expected-failures: {behaviour}/{leg} needs an error pattern") try: broad = pattern_too_broad(pattern) except re.error as exc: raise ValueError(f"conformance expected-failures: {behaviour}/{leg} pattern invalid: {exc}") if broad: raise ValueError(f"conformance expected-failures: {behaviour}/{leg} pattern {pattern!r} is a " f"catch-all ({broad}); pin the concrete error") compiled[leg] = re.compile(pattern, re.S) profiles = entry.get("fs_profiles") if profiles is not None and (not isinstance(profiles, list) or not profiles): return {"subject": data.get("subject", "oak"), "entries": entries, "coverage": coverage}def pending_tickets(expected: dict) -> list: """[(behaviour, ticket, outcome)] for entries whose ticket is still pending:<slug>.""" return sorted((behaviour, entry["ticket"], entry["outcome"]) for behaviour, entry in expected["entries"].items() if str(entry["ticket"]).startswith("pending:"))def row_failed_legs(row: dict) -> dict: """{failed leg: detail} for a failing row (legacy rows: {'behaviour': failure}).""" legs = row.get("legs")scripts/publish_gate.pymodifiedView file
Loading diff…
suites/merge/README.mdmodifiedView file
Loading diff…
suites/merge/mergesuite/classify.pymodifiedView file
Loading diff…
suites/merge/mergesuite/runner.pymodifiedView file
Loading diff…
suites/merge/run_merge_suite.pymodifiedView file
Loading diff…
suites/robustness/README.mdmodifiedView file
Loading diff…
suites/robustness/robustness/__init__.pymodifiedView file
Loading diff…
suites/robustness/robustness/adapters.pymodifiedView file
Loading diff…
suites/robustness/robustness/engine.pymodifiedView file
Loading diff…
suites/robustness/robustness/envfaults.pymodifiedView file
Loading diff…
suites/robustness/run_robustness.pymodifiedView file
Loading diff…
tests/test_conformance_gate.pymodifiedView file
Loading diff…
tests/test_merge_suite.pymodifiedView file
Loading diff…
tests/test_robustness_invariants.pymodifiedView file
Loading diff…