Skip to content

THROWAWAY: CI run for the JTS round 2 port (do not merge) - #714

Closed
peterstace wants to merge 6 commits into
masterfrom
throwaway_jtsport_round_2_ci
Closed

peterstace wants to merge 6 commits into
masterfrom
throwaway_jtsport_round_2_ci

Conversation

@peterstace

Copy link
Copy Markdown
Owner

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.

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.
@peterstace

Copy link
Copy Markdown
Owner Author

Closing: CI passed on amd64 (run 42142246675). This PR only existed to trigger CI.

@peterstace peterstace closed this Nov 6, 2026
@peterstace
peterstace deleted the throwaway_jtsport_round_2_ci branch November 6, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant