Skip to content

#799: Vim compat 1/9: land the extended Neovim-oracle harness (1,432 cases) with a known-deviation list and make it a CI gate - #808

Merged
JDonaghy merged 1 commit into
developfrom
issue-799-vim-compat-1-9-land-the-extended-neovim
Sep 4, 2026
Merged

#799: Vim compat 1/9: land the extended Neovim-oracle harness (1,432 cases) with a known-deviation list and make it a CI gate#808
JDonaghy merged 1 commit into
developfrom
issue-799-vim-compat-1-9-land-the-extended-neovim

Conversation

@JDonaghy

@JDonaghy JDonaghy commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Closes #799

Automated PR opened by coordinator for review of issue #799.

…IONS gate

Grows tests/nvim_conformance.rs from 31 hand-picked cases to 1,432 across 16
areas (op, dot, undo, reg, mac, mark, search, ex, ins, vis, vb, num, scroll,
word, to, misc), taken from the analysis artifact on commit 1159730. This is
the only oracle-backed suite in the repo: nothing is hand-authored, so a case
cannot encode the author's misconception the way the ~1,300 expectation-based
Vim tests can.

Result against nvim 0.9.5 (what ubuntu-24.04's apt ships, i.e. what CI runs):
1,432 cases — 788 pass, 644 deviate. No case is skipped and every case gets a
real oracle answer.

KNOWN_DEVIATIONS gate
---------------------
The 644 deviating labels ship as `KNOWN_DEVIATIONS`, and the gate is
bidirectional, so the list can only ever shrink:

  * an unlisted label that fails  -> regression, test fails;
  * a listed label that passes    -> the fix must delete its entry, test fails;
  * an entry naming no case at all -> stale, test fails.

That last one matters because a stale entry would silently excuse the case if
it were ever re-added. Labels are asserted unique, since they are the gate's
identity. The eight follow-up issues in this chain each land by deleting lines
from this list.

The gate is extracted as a pure `classify()` and covered by
`known_deviation_gate_is_bidirectional`, which needs no nvim and asserts all
three failure directions plus the steady state — a gate never observed to fail
is not a gate (#553). All three were also demonstrated end-to-end against the
real corpus: deleting "scroll:H from 30" from the list produced
`1 conformance REGRESSION(S) ... FAIL CUR [scroll:H from 30] cursor: nvim=(30,1)
vimcode=(9,1)`; adding the passing "undo:xxx u" produced `1 case(s) listed in
KNOWN_DEVIATIONS now PASS`; a bogus entry produced `1 KNOWN_DEVIATIONS
entr(y/ies) match no case label`.

Harness fidelity (each of these was silencing real failures)
-----------------------------------------------------------
  * `undolevels = -1` around the fixture write, restored to 1000 —
    nvim_buf_set_lines is itself an undo step, so `u` undid the fixture
    (41 spurious undo failures);
  * feedkeys mode "ntx" not "nx" — without `t` the keys are mapping-sourced, so
    `q` records nothing and undo is not synced between commands;
  * capture nvim_win_get_height and mirror it via set_viewport_lines (headless
    nvim reports a stable 22 rows regardless of $LINES/$COLUMNS);
  * ensure_cursor_visible() after placing the start cursor, because
    nvim_win_set_cursor scrolls and a raw engine cursor write does not;
  * pump macro_playback_queue after every key, as the UI does;
  * per-case Lua `setup` via cs(), for pinning Vim-vs-Neovim option defaults.

Proof the fidelity fixes survived: `mac:qaxjq @a` and `undo:xxx u` PASS (they
could not without the "ntx" and undolevels fixes), and `scroll:H from 30`
produces a meaningful oracle answer — nvim (30,1) vs vimcode (9,1), a genuine
deviation rather than a degenerate comparison.

New here, beyond the artifact
-----------------------------
  * cases run across std::thread::scope workers — 1,432 serial nvim spawns is
    minutes of wall clock; the suite now finishes in ~12s. Output order stays
    deterministic (contiguous chunks, stable sort by category);
  * a probe is judged by whether it produced a parseable result, not by nvim's
    exit status: `<C-n>`/`<C-p>` leave nvim exiting non-zero even after `qa!`;
  * `ins:C-n/C-p completion` pin `completeopt=""` — with the default and two or
    more candidates nvim 0.9.x segfaults drawing the popup under `--headless -l`,
    so the oracle could never answer;
  * per-category pass/known/FAIL totals table;
  * CI's existing hard-fail-on-missing-nvim guard (#795) is preserved;
  * `CONFORMANCE_DUMP_DEVIATIONS=<path>` regenerates the list; `PROBE_FILTER`
    and `PROBE_VERBOSE` for triage.

Docs
----
The oracle-first policy ("a Vim-behaviour PR must add oracle cases; hand-written
expectations are second-class") is documented in docs/PATTERNS.md, NOT CLAUDE.md.
The issue asked for CLAUDE.md, but this repo has now reverted worker edits to
that file twice (f93fb3d/#657, 2d4d839/#796) — it is the coordinator's rulebook.
The coordinator should fold a pointer into CLAUDE.md's Testing section; suggested
wording is in the PR body.

Depends on #795 (nvim installed in CI); without it this gate protects nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@JDonaghy
JDonaghy merged commit 6039806 into develop Sep 4, 2026
2 checks passed
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.

Vim compat 1/9: land the extended Neovim-oracle harness (1,432 cases) with a known-deviation list and make it a CI gate

1 participant