Skip to content

v0.11.0

Choose a tag to compare

@github-actions github-actions released this 12 Nov 06:03
· 22 commits to main since this release
5d40d2a

Minor changes

  • 3024eb1: Rust crates: a compact graph in kgdiff-core, read through methods, and two more ways to build
    one. Breaking for Rust callers; no output changes by a byte.

    • Memory. normalize of 100k nodes and 300k edges now adds 42 MiB of resident memory
      instead of 150 MiB (RFC 0002 §7: under 50 MB), and the graph retains 23 MB of heap instead of
      100 MB. Edges are rows of positions into the nodes and into one table of predicates and labels;
      their structural keys are written when asked for. Nodes keep what few of them have
      (aliases, replaces, replacedBy, a position) apart.
    • normalize_input builds the graph from Rust values (GraphInput, NodeInput,
      EdgeInput, the members of graph.v1.json; attribute values stay js::Value) — the graph
      normalize(&input.to_value(), …) gives, with the same graph_to_json bytes, hash and issues,
      checked on every graph of the conformance corpus (RFC 0003, part 3).
    • normalize_json builds it from JSON text, element by element, without a tree of the whole
      document.
    • Breaking: KGraph, KGNode and KGEdge have no public fields. Read them through methods:
      graph.nodes(), node(id), node_at(i), node_index(id), contains_node(id),
      node_count(), edges() (EdgeRefs), edge(key), edge_at(i), edge_index(key),
      contains_edge(key), edge_count(), meta(), edge_identity(), issues(); node.id(),
      label(), types(), aliases(), attrs(), is_deprecated(), replaces(), replaced_by(),
      is_implicit(), position(); edge.key(), id(), source(), target(), predicate(),
      label(), attrs(), and EdgeRef::to_edge() for an edge on its own. outgoing and
      incoming yield EdgeRefs instead of &Arc<KGEdge>. A KGNode or KGEdge can no longer be
      built field by field: build graphs with normalize_input.

    @kgdiff/cli

  • 47a78d8: Breaking. The TypeScript compute code that kgdiff's Rust engine (@kgdiff/compute) replaced is removed (RFC 0002, phase 5): about 13,000 lines of source. The asynchronous functions that compute are unchanged, and the read path (normalize, hashGraph, diffFromJSON, applyDelta, formatHunk, layoutFromJSON, …) stays in TypeScript, synchronous.

    • @kgdiff/core: log2, deprecated in the previous change, is removed (use Math.log2). The TypeScript matching, classification, hunks, delta emission and similarity are removed; diff, matchNodes and textSimilarity run on @kgdiff/compute.
    • @kgdiff/formats: the TypeScript parsers are removed, and with them the dependency on n3. parseGraph, detectFormat, compactIri, FORMAT_EXTENSIONS and the types stay; the package remains deprecated in favour of @kgdiff/compute.
    • @kgdiff/layout: the TypeScript layout engine is removed, and with it the dependencies on d3-force and d3-quadtree.

    @kgdiff/core · @kgdiff/formats · @kgdiff/layout

  • 01a57e9: Breaking. Computing runs on kgdiff's Rust engine in WebAssembly (@kgdiff/compute) everywhere, and the functions that compute are asynchronous (RFC 0002, phase 5). The results are the kgdiff CLI's, byte for byte.

    • @kgdiff/core: diff, matchNodes and textSimilarity return promises. log2 is deprecated (use Math.log2).
    • @kgdiff/formats is deprecated in favour of @kgdiff/compute: parseGraph, detectFormat and compactIri return promises and run its parsers.
    • @kgdiff/layout: layoutDiff and extendLayout return promises; new layoutGraph, layoutDiffOn and layoutAfter, to keep one map across versions. Positions are the Rust engine's, which are 0.10's for the same input (the conformance corpus checked the two engines against each other on every case through 0.10); layouts are now written as version 2 documents.
    • @kgdiff/compute: diffSync and diffAndLayoutSync read the engine's diff back without diffFromJSON's consistency checks (it was written by the same build; documents from elsewhere are still checked), and keep the node positions of the graphs, so a diff of graphs with positions is still laid out anchored on them, and the issues found normalizing them. Graphs may be given as KGraphs: as in 0.10, two with the same edge identity are compared with it when the options name none, and matchNodes reads each with its own.
    • @kgdiff/viewer: the compute module and the standalone add-on run on @kgdiff/compute. The add-on inlines the layout-only module, so single-file reports expand collapsed groups offline; an expansion asked for while it compiles waits for it. load() in the standalone viewer needs @kgdiff/compute in the import map. The viewer bundle has no WebAssembly.

    Migrating: put await in front of each changed call, or await init() of @kgdiff/compute once and use its *Sync functions. Pages with a Content Security Policy need 'wasm-unsafe-eval' to compute. The read path (normalize, hashGraph, diffFromJSON, applyDelta, formatHunk, layoutFromJSON, …) stays synchronous. See docs/guide/migrating-to-0.11.md.

    @kgdiff/core · @kgdiff/formats · @kgdiff/layout · @kgdiff/viewer · @kgdiff/compute

  • de02790: @kgdiff/compute is published: kgdiff's Rust engine as three WebAssembly modules, each loaded only when asked for (RFC 0002, §7). compute diffs, matches and normalizes graphs, formats reads graph files, and layout lays diffs out on typed arrays, small enough to be inlined in an HTML report; @kgdiff/compute/layout loads that one alone. init() loads them (init({ modules: ['layout'] }) only some), then diffSync, matchNodesSync, textSimilaritySync, parseGraphSync, detectFormatSync, layoutDiffSync, extendLayoutSync, layoutGraphSync, layoutDiffOnSync and layoutAfterSync give the objects of @kgdiff/core, @kgdiff/formats and @kgdiff/layout; diff, parseGraph, layoutDiff and the others load their module themselves. json is the same on JSON text, byte for byte what the kgdiff CLI writes. The other packages do not use it yet.

    @kgdiff/compute


Every package is at 0.11.0: @kgdiff/cli · @kgdiff/core · @kgdiff/formats · @kgdiff/layout · @kgdiff/scene · @kgdiff/renderer · @kgdiff/viewer · @kgdiff/g6 · @kgdiff/compute.

GitHub Action: uses: iiwish/kgdiff@v0.11.0.