Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0877c6b
human
ivankovic Nov 26, 2026
cf0fede
human
ivankovic Nov 26, 2026
8b24599
Rename the Maximal painting preset to Extended
ivankovic Nov 26, 2026
86f751f
Paper: Extended preset, and a table of the nine painting settings
ivankovic Nov 26, 2026
0a48b2d
human
ivankovic Nov 26, 2026
e350a0a
uman
ivankovic Nov 26, 2026
33dd796
Settings page: presets first, settings grouped, plainer text
ivankovic Nov 27, 2026
e2519f5
human
ivankovic Nov 27, 2026
2316348
Clamp seven fixtures to the new human solutions; refresh the baseline
ivankovic Nov 27, 2026
22c9f3b
human_solver: wrap the invariant popup's messages and sites
ivankovic Nov 27, 2026
9dc36a9
human
ivankovic Nov 27, 2026
5b4eb7c
human
ivankovic Nov 27, 2026
d2a296b
human
ivankovic Nov 28, 2026
b1524fd
human
ivankovic Nov 28, 2026
062a459
human
ivankovic Nov 28, 2026
50c424b
Invariant 33: a strict reordering is mapped as moves
ivankovic Nov 28, 2026
6d2f16d
Clamp two fixtures to the new human solutions; refresh the baseline
ivankovic Nov 28, 2026
99d4168
human
ivankovic Nov 28, 2026
5bc57d5
Invariant 34: a strict reordering's separators follow their elements
ivankovic Nov 28, 2026
d0b841b
Phase 9b: a strictly reordered sequence pairs its elements as moves
ivankovic Nov 28, 2026
8b9eedd
human
ivankovic Nov 29, 2026
cc66a2d
human
ivankovic Nov 30, 2026
718d33e
Clamp six fixtures to the phase-9b matcher; record the imapsync groun…
ivankovic Nov 30, 2026
b5330b8
human
ivankovic Dec 1, 2026
3c6577f
human
ivankovic Dec 1, 2026
68e52b7
human
ivankovic Dec 1, 2026
db9566f
human
ivankovic Dec 1, 2026
7b2c06d
human
ivankovic Dec 1, 2026
54d50ef
human
ivankovic Dec 1, 2026
21b0135
human
ivankovic Dec 2, 2026
90a253f
human
ivankovic Dec 2, 2026
73dc849
human-dataset: underline tabs in human_solver's text view; fix invari…
ivankovic Dec 2, 2026
ac1adaf
human-dataset: refresh fixture clamps to fresh actuals, regenerate qu…
ivankovic Dec 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ release does: a minor bump may change the JSON output or the library API, a patc

## [Unreleased]

### Changed

- The fuller highlighting preset is now called Extended instead of Maximal: `--extended` on the
command line, `2 Extended` in the `M` panel, and `RenderOptions::EXTENDED` in the library.
`--maximal` and `--full` still work, and `RenderOptions::MAXIMAL` and `RenderOptions::FULL` are
kept as deprecated aliases.

### Fixed

- A YAML file longer than 32,768 lines no longer shows an empty diff when the change is past that
Expand Down
4 changes: 2 additions & 2 deletions assets/mapping_site/viewer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ const summary = () => el("summary", undefined);
// The contract that makes remembering a painting by name safe across fixtures. Most of the corpus
// is unpainted, so the stored name usually names a rendering this page does not have.
{
const painted = ["From the node mapping", "Minimal", "Maximal"];
const painted = ["From the node mapping", "Minimal", "Extended"];

assert.strictEqual(pickRendering(painted, "Maximal"), 2);
assert.strictEqual(pickRendering(painted, "Extended"), 2);
assert.strictEqual(
pickRendering(painted, "Only one solution"),
0,
Expand Down
8 changes: 4 additions & 4 deletions assets/showcase/showcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const OmniDiffShowcase = (() => {
if (view === "diff") return payloads.diff;
if (options && presets) {
if (sameOptions(options, presets.minimal)) return payloads.minimal;
if (sameOptions(options, presets.maximal)) return payloads.maximal;
if (sameOptions(options, presets.extended)) return payloads.extended;
}
return payloads.omnidiff;
}
Expand Down Expand Up @@ -142,7 +142,7 @@ const OmniDiffShowcase = (() => {
change_counts: { insertions: 0, deletions: 0, updates: 0, moves: 0 },
plain_text_fallback: false,
large_residual: false,
render_options: presets ? presets.maximal : {},
render_options: presets ? presets.extended : {},
syntax: colors,
};
}
Expand Down Expand Up @@ -399,8 +399,8 @@ if (typeof module !== "undefined") {
const load = (suffix) => fetchJson(`cases/${name}.${suffix}.json`);
cache.set(
name,
Promise.all([load("diff"), load("omnidiff"), load("minimal"), load("maximal"), load("syntax")]).then(
([diff, omnidiff, minimal, maximal, syntax]) => ({ payloads: { diff, omnidiff, minimal, maximal }, syntax }),
Promise.all([load("diff"), load("omnidiff"), load("minimal"), load("extended"), load("syntax")]).then(
([diff, omnidiff, minimal, extended, syntax]) => ({ payloads: { diff, omnidiff, minimal, extended }, syntax }),
),
);
}
Expand Down
20 changes: 10 additions & 10 deletions assets/showcase/showcase.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ const none = { theme: null, step: 0 };

// ----- payloadFor -----------------------------------------------------------------------------

const presets = { minimal: { x: false, y: false }, maximal: { x: true, y: true } };
const presets = { minimal: { x: false, y: false }, extended: { x: true, y: true } };
const payloads = {
diff: { id: "diff", before: { spans: [1] }, after: { spans: [2] }, syntax: { theme: "t" } },
omnidiff: { id: "omnidiff", before: { spans: [3] }, after: { spans: [4] }, syntax: { theme: "t" } },
minimal: { id: "minimal" },
maximal: { id: "maximal" },
extended: { id: "extended" },
};

{
assert.equal(S.payloadFor("diff", payloads, presets, presets.maximal).id, "diff");
assert.equal(S.payloadFor("diff", payloads, presets, presets.extended).id, "diff");
assert.equal(S.payloadFor("omnidiff", payloads, presets, null).id, "omnidiff");
assert.equal(S.payloadFor("omnidiff", payloads, presets, { x: false, y: false }).id, "minimal");
assert.equal(S.payloadFor("omnidiff", payloads, presets, { x: true, y: true }).id, "maximal");
assert.equal(S.payloadFor("omnidiff", payloads, presets, { x: true, y: true }).id, "extended");
// Anything that is not a preset gets the default: there is nothing to recompute with.
assert.equal(S.payloadFor("omnidiff", payloads, presets, { x: true, y: false }).id, "omnidiff");
}
Expand Down Expand Up @@ -133,10 +133,10 @@ function ctx(view, entry) {

// Render options are remembered for the next /api/diff and echoed in the answer.
const c = ctx("omnidiff");
const filtered = S.routeApi("/api/render_options", presets.maximal, c);
assert.equal(filtered.json.id, "maximal");
assert.deepEqual(filtered.json.render_options, presets.maximal);
assert.equal(S.routeApi("/api/diff", {}, c).json.id, "maximal");
const filtered = S.routeApi("/api/render_options", presets.extended, c);
assert.equal(filtered.json.id, "extended");
assert.deepEqual(filtered.json.render_options, presets.extended);
assert.equal(S.routeApi("/api/diff", {}, c).json.id, "extended");

// A syntax theme the site was not baked with: the same spans under its name.
const highlight = S.routeApi("/api/highlight", { syntax_theme: "other" }, ctx("omnidiff"));
Expand Down Expand Up @@ -165,7 +165,7 @@ function ctx(view, entry) {
assert.equal(themedDiff.id, "omnidiff");
assert.deepEqual(themedDiff.before.spans, [5]);
assert.equal(themedDiff.syntax.theme, "Solarized (light)");
assert.deepEqual(S.routeApi("/api/render_options", presets.maximal, saved).json.before, { spans: [5] });
assert.deepEqual(S.routeApi("/api/render_options", presets.extended, saved).json.before, { spans: [5] });
// Settings that name no theme (the layout, the node highlight) change nothing.
S.routeApi("/api/settings", { layout: "single" }, saved);
assert.equal(saved.theme, "SolarizedLight");
Expand All @@ -180,7 +180,7 @@ function ctx(view, entry) {
assert.deepEqual(empty.before.lines, [""]);
assert.equal(empty.before.path, "a/docs/model.pdf");
assert.equal(empty.after.name, "model.pdf");
assert.deepEqual(empty.render_options, presets.maximal);
assert.deepEqual(empty.render_options, presets.extended);
assert.equal(empty.syntax.background, "#1e1e1e");
content.syntaxTheme = "Solarized (light)";
assert.equal(S.routeApi("/api/diff", {}, content).json.syntax.background, "#fdf6e3");
Expand Down
6 changes: 3 additions & 3 deletions assets/viewer/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@
applyRenderOptions(this.options);
return;
} else if (e.key === "2") {
this.options = { ...state.presets.maximal };
this.options = { ...state.presets.extended };
applyRenderOptions(this.options);
return;
} else if (e.key === "Escape") {
Expand All @@ -912,7 +912,7 @@
},
// Every key has a tap too: a row toggles, the footer buttons are 1, 2 and Esc.
render(container) {
const { body, footer } = box(container, "Render options", "↑/↓ move Enter/Space toggle 1: minimal 2: maximal Esc: close");
const { body, footer } = box(container, "Render options", "↑/↓ move Enter/Space toggle 1: minimal 2: extended Esc: close");
const labels = rows.map((row) => `[${this.options[row.key] ? "x" : " "}] ${row.label}`);
listRows(body, labels, this.selected).forEach((element, index) => {
element.addEventListener("click", () => {
Expand All @@ -922,7 +922,7 @@
});
dialogButtons(footer, [
["Minimal", () => this.key({ key: "1" })],
["Maximal", () => this.key({ key: "2" })],
["Extended", () => this.key({ key: "2" })],
["Close", () => this.key({ key: "Escape" })],
]);
},
Expand Down
8 changes: 4 additions & 4 deletions assets/viewer/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,14 @@ const OmniDiffModel = (() => {
return Object.keys(b).every((key) => a[key] === b[key]);
}

// `render_options_badge`: nothing for MAXIMAL, `[minimal]`, or the names of what differs from
// MAXIMAL - not of what is off, since MAXIMAL itself leaves whole-pair updates off.
// `render_options_badge`: nothing for EXTENDED, `[minimal]`, or the names of what differs from
// EXTENDED - not of what is off, since EXTENDED itself leaves whole-pair updates off.
function renderOptionsBadge(options, rows, presets) {
if (sameOptions(options, presets.maximal)) return "";
if (sameOptions(options, presets.extended)) return "";
if (sameOptions(options, presets.minimal)) return "[minimal]";
const differing = (state) =>
rows
.filter((row) => options[row.key] !== presets.maximal[row.key] && options[row.key] === state)
.filter((row) => options[row.key] !== presets.extended[row.key] && options[row.key] === state)
.map((row) => row.label);
const [off, on] = [differing(false), differing(true)];
const parts = [];
Expand Down
16 changes: 8 additions & 8 deletions assets/viewer/model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,27 +442,27 @@ function pairModel() {
{ key: "paint_displaced_moves", label: "Paint displaced moves" },
{ key: "paint_resized_moves", label: "Paint moves the two sides size differently" },
];
const maximal = { leading_whitespace: true, structural_punctuation: true, whole_pair_updates: false, paint_reindent_only_moves: true, paint_displaced_moves: true, paint_resized_moves: true };
const extended = { leading_whitespace: true, structural_punctuation: true, whole_pair_updates: false, paint_reindent_only_moves: true, paint_displaced_moves: true, paint_resized_moves: true };
const minimal = { leading_whitespace: false, structural_punctuation: false, whole_pair_updates: false, paint_reindent_only_moves: false, paint_displaced_moves: false, paint_resized_moves: false };
const presets = { maximal, minimal };
assert.strictEqual(M.renderOptionsBadge(maximal, rows, presets), "");
const presets = { extended, minimal };
assert.strictEqual(M.renderOptionsBadge(extended, rows, presets), "");
assert.strictEqual(M.renderOptionsBadge(minimal, rows, presets), "[minimal]");
// "Whole-pair updates" is off in MAXIMAL itself, so only a difference from MAXIMAL is named.
// "Whole-pair updates" is off in EXTENDED itself, so only a difference from EXTENDED is named.
assert.strictEqual(
M.renderOptionsBadge({ ...maximal, leading_whitespace: false }, rows, presets),
M.renderOptionsBadge({ ...extended, leading_whitespace: false }, rows, presets),
"[Leading whitespace off]"
);
assert.strictEqual(M.renderOptionsBadge({ ...maximal, whole_pair_updates: true }, rows, presets), "[Whole-pair updates on]");
assert.strictEqual(M.renderOptionsBadge({ ...extended, whole_pair_updates: true }, rows, presets), "[Whole-pair updates on]");
assert.strictEqual(
M.renderOptionsBadge({ ...maximal, leading_whitespace: false, whole_pair_updates: true }, rows, presets),
M.renderOptionsBadge({ ...extended, leading_whitespace: false, whole_pair_updates: true }, rows, presets),
"[Leading whitespace off; Whole-pair updates on]"
);
assert.strictEqual(
M.footerLeft({ cursor: [4, 9], counts: { insertions: 1, deletions: 0, updates: 0, moves: 0 }, changeProgress: [2, 5], plainText: true, layout: "Single", options: minimal, rows, presets }),
"Ln 5, Col 10 +1 change 2/5 [plain text] [layout: single] [minimal]"
);
assert.strictEqual(
M.footerLeft({ cursor: [0, 0], searchProgress: [1, 3], changeProgress: [2, 5], layout: "Auto", options: maximal, rows, presets }),
M.footerLeft({ cursor: [0, 0], searchProgress: [1, 3], changeProgress: [2, 5], layout: "Auto", options: extended, rows, presets }),
"Ln 1, Col 1 match 1/3",
"search progress replaces change progress"
);
Expand Down
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ Press `?` in the viewer for the full list of keybindings. The ones to know first
| `v` | Cycle the panel layout: auto, dual, single |
| `q` | Quit |

### Highlighting: Minimal and Full
### Highlighting: Minimal and Extended

OmniDiff has two highlighting presets, and both are faithful readings of the same diff. Minimal
paints only the ranges that carry meaning: standalone brackets and separators, leading whitespace,
and moves that only reindent go unpainted. Full paints them. In the settings menu (`M`), `1` and
and moves that only reindent go unpainted. Extended paints them. In the settings menu (`M`), `1` and
`2` pick the presets and each option has its own checkbox; the choice is saved. `--minimal` and
`--full` apply a preset to one run without saving it, and `--whole-updates` highlights both sides of
an updated pair whole instead of only the part that differs.
`--extended` apply a preset to one run without saving it, and `--whole-updates` highlights both
sides of an updated pair whole instead of only the part that differs.

### Colors

Expand Down
16 changes: 8 additions & 8 deletions research/analysis/benchmark_other_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@
painted fixtures only - which ones are painted is read off the CSV's blank cells each run:

- benchmark_other_painting_lines.tex (and `_with_omnidiff`): the line table's buckets with the
lines the painting touches as the reference, a tool matching a fixture with Minimal and Maximal
lines the painting touches as the reference, a tool matching a fixture with Minimal and Extended
paintings when it agrees with either (`painting_line_score`). Macros
`\\<Tool>PaintingLineFixtures` and `\\<Tool>PaintingLinePerfectPct`.
- benchmark_other_painting_bytes.tex (and `_with_omnidiff`): changed bytes against painted
bytes, Exact and Within 1% per graded case (`painting_case_shares`). Macros
`\\<Tool>Painting{Minimal,Maximal,Single}{Fixtures,ExactPct,WithinOnePct}`.
`\\<Tool>Painting{Minimal,Extended,Single}{Fixtures,ExactPct,WithinOnePct}`.

Neither is written, and their macros are absent, when the accuracy CSV predates the columns.
`make measure-tools-painting` regenerates the CSV, these tables and the macros together.
Expand Down Expand Up @@ -1248,10 +1248,10 @@ def write_variance_table(rows: list[dict], tools: list[str], output_path: Path)
# `<tool>_painting_line_<case>_mismatches`, the tool's line labels against the lines the painting
# touches. `case` is one of `PAINTING_CASES`, the graded cases of OmniDiff's own painting table.
# Which fixtures are painted is read off the blank cells each run, never listed here.
PAINTING_CASES = [("minimal", "Minimal"), ("maximal", "Maximal"), ("single", "Single")]
PAINTING_CASES = [("minimal", "Minimal"), ("extended", "Extended"), ("single", "Single")]
PAINTING_CASE_TITLES = {
"minimal": r"\emph{Minimal}",
"maximal": r"\emph{Maximal}",
"extended": r"\emph{Extended}",
"single": "One rendering",
}

Expand Down Expand Up @@ -1287,7 +1287,7 @@ def painting_case_shares(rows: list[dict], tool: str, case: str) -> tuple[int, f

def painting_line_score(row: dict, tool: str) -> int | None:
"""A fixture's line-level painting score for `tool`: the fewest mismatched lines over the cases
its painting grades. With a `Minimal` and a `Maximal` painting a tool matches when it agrees
its painting grades. With a `Minimal` and an `Extended` painting a tool matches when it agrees
with either - both are correct readings and a line tool has one output - and a single painting
is the only reference. None for an unpainted or unscored fixture. Mirrors
`benchmark_other.rs`'s `painting_line_score`; the per-case columns stay in the CSV for any
Expand Down Expand Up @@ -1358,7 +1358,7 @@ def write_painting_line_table(accuracy_rows, output_path, include_omnidiff):
(
r" \caption{Per-fixture line-level agreement with the hand painting, bucketed, on the"
r" painted fixtures. A line counts as changed in the painting when any of its bytes is"
r" painted. Where a fixture has a \emph{Minimal} and a \emph{Maximal} painting, a tool"
r" painted. Where a fixture has a \emph{Minimal} and an \emph{Extended} painting, a tool"
r" agrees when it agrees with either. ``Perfect'' means zero mismatched lines. Each tool"
r" is scored on its own applicable subset ($n$).}"
),
Expand Down Expand Up @@ -1437,7 +1437,7 @@ def write_painting_byte_table(accuracy_rows, output_path, include_omnidiff):
r" it reports, a tool with sub-line output its own ranges; a byte is painted when the"
r" painting gives it any label. \emph{Exact}: no byte differs. \emph{Within 1\%}: at"
r" most 1\% of the bytes of the two files. A fixture with a \emph{Minimal} and a"
r" \emph{Maximal} painting is scored against each, from the same output.}"
r" \emph{Extended} painting is scored against each, from the same output.}"
),
f" \\label{{tab:painting-bytes{suffix}}}",
r" \small",
Expand Down Expand Up @@ -1575,7 +1575,7 @@ def omnidiff_timed_as_process(rows: list[dict]) -> bool:
"""Whether this timing CSV times OmniDiff as a whole process, as every external tool is.

Since 2026-11-24 `benchmark_other` spawns the release `omnidiff` binary per repeat
(`omnidiff --headless --maximal --color never BEFORE AFTER`), and `omnidiff_ms` is that whole
(`omnidiff --headless --extended --color never BEFORE AFTER`), and `omnidiff_ms` is that whole
process - start, both parses, the diff, the rendering - while the old in-process time moved to
`omnidiff_inprocess_ms`. That column's presence is what tells the two formats apart, so a CSV
measured before the change still reads as it did."""
Expand Down
14 changes: 7 additions & 7 deletions research/analysis/invariants_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"""
The ground-truth invariants as a measure of the gap between an edit script and a visualization.

`src/test/helper/human_mapping/invariants.rs` states 32 rules a fixture's ground truth must obey
`src/test/helper/human_mapping/invariants.rs` states 34 rules a fixture's ground truth must obey
(its module doc lists them). They are rules about how a change is *shown*: nothing in them is
needed for a delta to convert one file into the other. So the number of them an account of a
change breaks is a distance from being a visualization, and this report measures it for five
Expand All @@ -30,7 +30,7 @@
* `human_mapping_rendered` and `tool_mapping_rendered` - the human mapping and OmniDiff's own,
through OmniDiff's renderer. Judged by the label-reading rules only; see the test's doc.

`GROUPS` sorts the 32 rules into the five families the paper's table prints. `MAPPING_ONLY` are
`GROUPS` sorts the 34 rules into the five families the paper's table prints. `MAPPING_ONLY` are
the rules that never read a painting: they judge the tree mapping, which every account shares,
so they are reported for `human` alone.

Expand All @@ -48,7 +48,7 @@

from _common import PAPER_DATASETS, REPO_ROOT, fixture_datasets, latex_number, read_rows

INVARIANTS = range(1, 33)
INVARIANTS = range(1, 35)

# (key, the table's row label, the rules, an example the table prints)
GROUPS = [
Expand All @@ -63,7 +63,7 @@
"What each preset paints",
(2, 4, 5, 6, 8, 16, 29, 30, 31, 32),
(
r"\emph{Minimal} never paints indentation; \emph{Maximal} paints a renamed identifier "
r"\emph{Minimal} never paints indentation; \emph{Extended} paints a renamed identifier "
r"entire; the space before an insertion follows its count"
),
),
Expand All @@ -76,13 +76,13 @@
(
"Units",
"Syntactic units stay together",
(3, 24, 25, 26),
(3, 24, 25, 26, 34),
r"a \texttt{;} goes with its statement, a call's dot with its member",
),
(
"Mapping",
"Form of a mapping",
(14, 15, 18, 20, 28),
(14, 15, 18, 20, 28, 33),
(
r"\texttt{NULL} $\rightarrow$ \texttt{nullptr} is one element changing, not a delete "
r"beside an insert"
Expand All @@ -91,7 +91,7 @@
]

# Rules that read the tree mapping and no painting.
MAPPING_ONLY = (3, 14, 15, 18, 20, 26, 28)
MAPPING_ONLY = (3, 14, 15, 18, 20, 26, 28, 33)

# A leaf the human mapping pairs, painted as deleted on one side and inserted on the other (10,
# 27) or as wholly removed (22): what a script does to code that survived.
Expand Down
Loading
Loading