2.3 KiB
2.3 KiB
tools/survey: the TeaVM compile survey
Compiles the whole client with TeaVM and records everything between it and a browser build:
missing classes and members, JDK classes TeaVM lacks, natives and reflection. Each finding is
triaged as stub, shim, rewrite or delete into
docs/port-backlog.md. tools/webbuild uses the same rules.
./incari fetch # once
JAVA_HOME=<JDK 25> ./incari survey # about a minute
JAVA_HOME=<JDK 25> ./incari survey --reclassify # re-triage the last run, seconds
INCARI_SURVEY_OPTS=-Xmx20g raises the heap (default 12 GB).
How it works
- Class path: the client jar plus libraries
rules.txtmarkskeep. Libraries markedreplaceordelete(LWJGL, JNA, OSHI…) stay off, so each call into them is a finding. - Roots: every method of every client class is an entry point (except
no-rootpackages such as data generators), since followingmain()misses code behind callbacks. - Host JDK hidden, so JDK classes TeaVM lacks are reported, not silently compiled in.
- Stub rounds: missing symbols get default-returning stubs, and it recompiles until nothing new turns up. Stubs are for analysis only; everything stubbed is still a finding.
- Scan and triage: a bytecode scan adds reflection and missing-class references; each finding
takes the first matching rule in
rules.txt.
Files
| File | What |
|---|---|
rules.txt |
The policy: which libraries compile in, which packages aren't roots, a triage rule per work item |
Main, Roots, TeaVmSurvey, Stubs, BytecodeScanner, Backlog |
Orchestration, roots, compile rounds, scan, markdown |
docs/port-backlog.md (tracked) |
Counts and a table per work item: API and package names only, never game code |
work/survey/<version>/ (ignored) |
Every call site, and the saved result --reclassify reuses |
Invariants
- Exactly JDK 25. TeaVM can't read Java 26 classes, and "missing" depends on the JDK.
- Deterministic: sorted, no timestamps.
- Every library has a rule, and no committed backlog has unclassified findings.
How to test
./gradlew :tools:survey:test # rules, stubs and roots; the full survey runs by hand