Skip to content

CI: Generated Java Compiles — compare build inputs only, parallel generations, reuse them - #3777

Merged
squid-protocol merged 1 commit into
mainfrom
perf/java-compile-skip
Sep 26, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
perf/java-compile-skip

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Speeds up the Generated Java Compiles workflow on pull requests. On #3768 it took 5–7 minutes per corpus while the Java that gets compiled hadn't changed at all.

Where the time went (#3768)

  • The check compared every generated file. The only differences were porting-ticket JSON (ai_agent_jobs/*_port_ticket.json), which no build reads. Four of the six corpora still set up JDK 17/21 and Gradle and compiled every config on both paths.
  • The engine scan ran three times per job. On dsf a scan costs ~75s locally and more on CI, while generating Java per config is ~3s. It ran for the head and the base in the check, one after the other (416s on CI), then again in the build step.

Changes (tests/tools/java_target_matrix.py, java-compile.yml)

  1. Compare build inputs only (build_input): src/, pom.xml and the Gradle files. Reports (tickets, worklists, audit, traceability) are listed in the summary, but don't trigger a compile.
  2. Parallel generations: the check's four independent generations (head/base × plain/scan) run side by side.
  3. Base cached per base commit (--base-cache plus an actions/cache step keyed on the base SHA). A second push to the same PR generates only the head.
  4. Build what the check generated (--generated). When a build input changed, the build steps compile the head projects the check already produced, instead of refactoring and scanning the corpus again.

Pushes to main, the weekly run and manual runs still build from scratch, so the base always gets compiled.

Measured (dsf, locally)

check
before 170s
parallel, cold cache 104s
parallel, base cached 85s

The remaining time is the head's own engine scan, which is the thing a PR changes. On top of this, the build step no longer re-scans, and a PR like #3768 (tickets only) now skips the compile entirely.

Tests

test_java_matrix_gate.py: which files count as build inputs; that the base cache keeps only the projects and ignores an incomplete entry. I tested reuse end to end on zecs: a cached base on the second run, and --generated building PASS for default and gradle.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

…nerations, reuse them

The pull-request check (java_target_matrix.py --same-as) now:
- compares only what the build reads (src/, pom.xml, the Gradle files). On #3768 every
  difference was a porting ticket (ai_agent_jobs/*.json), yet four corpora set up the JDKs
  and compiled every config twice;
- runs its four generations (head/base x plain/scan) side by side;
- caches the base's generation per base commit (--base-cache), so a later push to the
  same PR generates only the head;
- and, when a build input did change, the build steps compile the projects the check
  already generated (--generated) instead of refactoring -- and engine-scanning -- the
  corpus a third time.
Pushes, the weekly run and manual runs still build from scratch.

dsf (the slowest check, 416s on CI): 170s -> 104s cold, 85s with the base cached,
locally; the remainder is the head's own engine scan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
@squid-protocol
squid-protocol merged commit a840479 into main Sep 26, 2026
@squid-protocol
squid-protocol deleted the perf/java-compile-skip branch September 26, 2026 18:51
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

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