Port D2's ELK compatibility surface to ELK.js 0.12 - #3
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This updates elk-go from the ELK.js 0.8.2 behavior target to the exact official ELK.js 0.12.0 release.
The scope is deliberately limited to what D2 uses:
DisCo and its Polyomino-only metadata are removed because ELK.js no longer bundles that provider.
Compatibility evidence
The differential oracle is pinned to ELK.js commit
ff5771d7and SHA-2561222e44f…07b3.Against that official bundle:
CI runs tests, race detection, and vet on Go 1.23 and 1.26, plus the pinned Node 24.19 oracle gates. Architecture-sensitive V8 math behavior has explicit amd64 and arm64 expectations.
Scope boundary
This is not a general implementation of every expert ELK option combination. Metadata presence is not an execution guarantee. Known unsupported Layered strategies are documented and return errors instead of silently selecting another algorithm.
Performance and size
Compared with elk-go v0.1.1, benchmarks establish no material CPU regression. The dense 250-node/1,000-edge stable case changes by +4.56% B/op and +1.20% allocs/op.
In full D2 integration builds, the upgrade changes stripped native size by +0.51% and optimized WASM size by +1.11%. Execution remains native, self-contained Go with no Go module dependencies.
Provenance and licensing
The source map pins the corresponding ELK 0.12, ELK.js, GWT, and V8/fdlibm inputs. EPL-2.0, Apache-2.0, BSD-3-Clause, and Sun permission notices are preserved in the repository, with the historical 0.8 implementation provenance retained separately.
Validation
go test ./... -count=1go vet ./...go test -race ./...