Repository navigation
THROWAWAY: CI run for the JTS round 2 port (do not merge) - #714
Closed
peterstace wants to merge 6 commits into
Closed
peterstace wants to merge 6 commits into
peterstace wants to merge 6 commits into
Conversation
This is a checkpoint of a new approach to porting JTS. A translator (internal/jts/tools/translator) reads the JTS sources with javac's compiler API and generates the Go package internal/jts. The generated code calls a hand-written runtime (internal/jts/java, internal/jts/junit) that reproduces the behaviour of the JDK classes JTS uses. An oracle (internal/jts/oracle) runs the same operations through JTS on the JVM and through the generated code, and requires identical results. It currently matches on about 285,000 results from the JTS XML tests, simplefeatures' test geometries, and generated geometries. The translated JTS JUnit tests also pass, apart from three that fail in Java too. Nothing outside internal/jts uses the translation yet. See internal/jts/DESIGN.md.
JTS's Maven build only runs tests in files named *Test.java, excluding *PerfTest.java, *StressTest.java, and the test.jts.perf package. Generate Go tests for the same set, and don't translate test.jts.perf or test.jts.fail (whose tests are known to fail in Java too) at all.
The unit tests now run in an image with JDK 21, which the internal/jts oracle tests need to run JTS. The oracle tests fetch and build JTS with tools/setup.sh when it is not already there, and fail rather than skip when Java is missing.
golangci-lint skips the generated internal/jts package. In the runtime (internal/jts/java and internal/jts/junit) it allows underscored names and "this" receivers, because the generated code calls the runtime by those names. The remaining findings in the runtime, the JUnit shim, and the oracle are fixed; tests that use unexported identifiers follow the repo's _internal_test.go convention.
StreamTokenizer turns an overlong number into inf/inf, and the CPU sets the sign of that NaN: positive on arm64, negative on amd64. The vectors were recorded on arm64, so the replay failed on amd64 CI even though the Go port matches what the JVM does on each CPU. The replay now treats any NaN nval as equal to any other, as TestMathVectors already does.
Owner
Author
|
Closing: CI passed on amd64 (run 42142246675). This PR only existed to trigger CI. |
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.
Throwaway PR to get CI to run the internal/jts tests, including the JVM oracle, on amd64. All testing so far has been on arm64.
Not for review or merge. It will be closed once the CI results are checked.