Skip to content

json parity dashboard

Differential survey of graphviz-ts render(g, 'json') vs the native dot -Tjson oracle over the SVG-conformant corpus set, sorted by input size. -Tjson (not -Tjson0) is the oracle: the port structurally emits the doXDot=true shape ("_draw_": [] present on every node/edge — see the AD note atop test/golden/compare-json.ts). Semantic comparison (draw-op arrays at ±0.01, colors/fonts canonicalized, positional strings numeric-tolerant — see test/golden/compare-json.ts). Regenerate: npx tsx test/corpus/json-walk.ts --survey && npx tsx test/corpus/json-dashboard.ts.

Summary

  • Oracle: dot 15.1.0 (-Tjson) · corpus: ~/git/graphviz/tests
  • Walked (conformant SVG set): 761
  • json-conformant: 759 (99.7%)
  • diverged (tracked, will-fix): 0 · accepted (documented, won't-fix): 2
  • port-error: 0 · timeout: 0 · oracle-error: 0 (excluded from scoring)

json-conformant (759)

Port json is conformant with the oracle: every object/attr/draw-op matches, numeric payloads within ±0.01 and canonicalized colors/fonts/text equal.

Conformant ids (759) are omitted for brevity — the full roster is in json-parity.json.

Tracked diverged (0) — worst-first

idsizemaxΔ#diffsfirstDiff

Diverged buckets — by (object · attr · shape)

(none)

Accepted divergences (2) — documented, not chased

Irreducible C quirks (font-metric ULP, platform libm) recorded in test/corpus/accepted-divergences-json.json. Each is referenced in the mission decision journal with its mechanism.

idopClassdeltarationale
share-Latin1node:label / ldraw T.text [mixed-encoding]0Input is Latin-1 with NO charset declaration, so the bytes are invalid UTF-8. Native dot's -Tjson then emits a MIXED-ENCODING document: attribute values (e.g. node label) are echoed as RAW Latin-1 bytes (0xe1 0xe2 ... unconverted), while the DRAWN label text (ldraw T op, via make_label) is UTF-8 (0xc3 0xa1 ...). No single decode reads both halves correctly: Latin-1 recovers the attribute but mojibakes the text, UTF-8 does the reverse (and the attribute bytes are not valid UTF-8). The port decodes the input once (utils.c latin1ToUTF8 fallback) and is internally consistent valid UTF-8 on BOTH surfaces, so it cannot reproduce the oracle's split encoding. A4 class: the oracle output is an encoding bug; the port declines to emit invalid/mixed-encoding JSON. The DECLARED charset=latin1 case (graphs-Latin1/b60) IS handled via the stoj double-encode fix; only the UNDECLARED-charset case is irreducible.
windows-Latin1node:label / ldraw T.text [mixed-encoding]0Identical mechanism to share-Latin1: undeclared-charset Latin-1 input makes native -Tjson emit raw-Latin-1 attribute bytes alongside UTF-8 drawn text (mixed, invalid). The port's consistent-UTF-8 output cannot match both halves. A4 class.

port-error (0)

idpathmessage

timeout (0)

idpathmessage

oracle-error (0) — excluded from scoring

idpathmessage