You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collapse README bench block to a per-language bar chart
The auto-generated block was a TS-only expanded breakdown (per-issue table,
21-fix list, token table) — that doesn't scale as Monogram adds languages.
Replace it with one compact ASCII bar chart, one row per language (Monogram
vs official, % of that language's documented official-grammar bugs handled),
so new languages slot in as single rows.
- buildBenchMarkdown takes a per-language list and renders bars; TypeScript is
populated, JavaScript is a pending placeholder until it gets the oracle bench.
- The per-issue / token detail is dropped from the README (still printed when
you run the bench directly).
Copy file name to clipboardExpand all lines: README.md
+13-21Lines changed: 13 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,32 +56,24 @@ The valid-code/bidirectional numbers are the grammar's correctness proof; the hi
56
56
57
57
### Head-to-head: highlighter correctness vs the official grammar
58
58
59
-
The numbers below are **auto-generated** by [`test/highlight-bench.ts`](test/highlight-bench.ts) — it grades *both* the official TextMate grammar and Monogram's against a neutral `tsc` oracle, so the comparison is absolute (each has a real distance from 100%), not relative.
59
+
**Auto-generated** by [`test/highlight-bench.ts`](test/highlight-bench.ts) — one row per language, more as Monogram gains them:
60
60
61
61
<!-- bench:start -->
62
-
<!-- generated by `node test/highlight-bench.ts --write-readme` — do not edit by hand -->
62
+
<!-- generated by `npm run bench:readme` — do not edit by hand -->
63
63
64
-
Both grammars are graded against a neutral **`tsc`** oracle (the parser only — never
65
-
Monogram's own output, never the official grammar). Ceiling is 100%.
64
+
Each bar = **% of that language's documented official-grammar bugs** the highlighter renders
65
+
correctly, graded against a neutral `tsc` oracle (100% = all of them). Monogram derives its
66
+
highlighter from its conformance-proven parser; the official one is hand-written regex.
66
67
67
-
**On the documented official-grammar bug ledger** — the 49 [`microsoft/TypeScript-TmLanguage`](https://github.com/microsoft/TypeScript-TmLanguage/issues) issues in [`test/issue-cases.ts`](test/issue-cases.ts) (49 adjudicable by a syntactic oracle), graded per issue:
<sub>TypeScript = 49 oracle-adjudicable open [`microsoft/TypeScript-TmLanguage`](https://github.com/microsoft/TypeScript-TmLanguage/issues) issues ([`test/issue-cases.ts`](test/issue-cases.ts)) — 21 of Monogram's wins are fixes the official grammar gets *structurally* wrong. Per-issue breakdown: `node test/highlight-bench.ts`. Regenerate: `npm run bench:readme`.</sub>
85
77
<!-- bench:end -->
86
78
87
79
> **The other side of the ledger (honesty check).** On the *broad* TS parser-conformance corpus — not just the documented bugs — raw token-role accuracy flips: the official grammar's decade of hardening leads (~99% vs ~96%). Monogram's gap there is specific backlog (Unicode identifiers, qualified type names), **not** the ambiguity class above. Clone the TS corpus to `/tmp/ts-repo` and run `node test/highlight-bench.ts` to see both corpora.
out.push('<!-- generated by `node test/highlight-bench.ts --write-readme` — do not edit by hand -->');
587
+
out.push('<!-- generated by `npm run bench:readme` — do not edit by hand -->');
580
588
out.push('');
581
-
out.push('Both grammars are graded against a neutral **`tsc`** oracle (the parser only — never');
582
-
out.push("Monogram's own output, never the official grammar). Ceiling is 100%.");
583
-
if(iss){
584
-
out.push('');
585
-
out.push(`**On the documented official-grammar bug ledger** — the ${iss.total} [\`microsoft/TypeScript-TmLanguage\`](https://github.com/microsoft/TypeScript-TmLanguage/issues) issues in [\`test/issue-cases.ts\`](test/issue-cases.ts) (${iss.adj} adjudicable by a syntactic oracle), graded per issue:`);
586
-
out.push('');
587
-
out.push('| grammar | handles the bug correctly |');
588
-
out.push('|---|---|');
589
-
out.push(`| Official TextMate | ${p(iss.offPass,iss.adj)} (${iss.offPass}/${iss.adj}) |`);
? `TypeScript = ${ts.issue!.adj} oracle-adjudicable open [\`microsoft/TypeScript-TmLanguage\`](https://github.com/microsoft/TypeScript-TmLanguage/issues) issues ([\`test/issue-cases.ts\`](test/issue-cases.ts)) — ${ts.issue!.fixes.length} of Monogram's wins are fixes the official grammar gets *structurally* wrong. `
610
+
: '';
611
+
out.push(`<sub>${ctx}Per-issue breakdown: \`node test/highlight-bench.ts\`. Regenerate: \`npm run bench:readme\`.</sub>`);
611
612
returnout.join('\n');
612
613
}
613
614
@@ -649,8 +650,6 @@ async function allTs(dir: string): Promise<string[]> {
0 commit comments