Skip to content

scalasem: read Scala 3.10 builds, skip stale output, add an accuracy check - #30

Merged
prabhu merged 4 commits into
mainfrom
fix/scalasem-scala310-stale-output-review
Oct 28, 2026
Merged

prabhu merged 4 commits into
mainfrom
fix/scalasem-scala310-stale-output-review

Conversation

@prabhu

@prabhu prabhu commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Running scalasem over a current chen checkout found that none of its Scala 3.10 modules were analysed: the TASTy helper was compiled without the ASM artifacts that 3.10 takes from upstream, and --no-build also read the old sbt 1 output sitting next to the new output and reported it as modules of its own, so every fact in the report came from a stale 3.9 build.

The helper classpath is now read from the compiler's own POM in the local caches instead of a fixed artifact list, so 3.9 and 3.10 go through the same code, and mirrors that keep their repositories under bases other than maven2 are searched too. A failed helper compile now says which class it could not load. For --no-build, an sbt 2 build's target/out is taken as the list of modules the build declares: output for the same module anywhere else is skipped with a stale-output diagnostic, and directories that are not projects of the build are ignored. Builds whose layout can't be read behave as before. I also added test-fixtures/scalasem-accuracy.js, a script you run by hand against a local chen checkout. It scores coverage, library usage against class-file constant pools and a sample of call sites, writes JSON, and diffs against an earlier run.

Over chen at e23c8dfb with --no-build, files with facts went from 368 of 525 to 525 of 526, all from 3.10.0 output, with no helper-compile-failed and no stale modules. The one uncovered file is a Java source in a Scala module. The new toolchain and stale-output tests fail on main and pass here, and the JVM test now compiles and runs the helper for 3.3.7 through 3.10.0. One thing to know: the call-site spot check agrees on 131 of 201 sampled calls, and the misses are mostly interpolators and operators that aren't source text.

Closes #26, closes #27, closes #28.

The fixed artifact list stopped matching at Scala 3.10, which takes the upstream ASM artifacts instead of the shaded assembler. The classpath now comes from the POM in the local caches, mirrors with any repository base are searched, and helper-compile-failed names the class that was missing.
An sbt 2 build declares its modules under target/out. Output of the same module left elsewhere is skipped with a stale-output diagnostic, directories that are not projects of the build are ignored, and a module's sources are the project directory the output is named after.
Scores coverage, library usage against class file constant pools and a call site sample, writes JSON, and compares with an earlier run. Not part of CI.
@prabhu prabhu added bug Something isn't working enhancement New feature or request ai-auto A person set the task, and AI agents carried it through to completion labels Oct 28, 2026
@prabhu
prabhu enabled auto-merge October 28, 2026 14:33
@prabhu
prabhu disabled auto-merge October 28, 2026 14:35
@prabhu
prabhu enabled auto-merge October 28, 2026 14:36
@prabhu
prabhu added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 5ca0248 Oct 28, 2026
3 checks passed
@prabhu
prabhu deleted the fix/scalasem-scala310-stale-output-review branch October 28, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-auto A person set the task, and AI agents carried it through to completion bug Something isn't working enhancement New feature or request

Projects

None yet

1 participant