Fix the CI failures from #320: SpotBugs findings and a GPU-only assumption on pocl - #321
Merged
Merged
Conversation
…there is no GPU
CI went red on main immediately after the multi-GPU merge, with two unrelated
failures. Both were reachable on this machine and neither was run before merging:
I verified with mvn test, spotless:check and reuse lint, and never once with
spotbugs:check, which the code-style job runs early precisely so a finding fails
a push rather than surfacing at release.
SpotBugs: 14 findings, all in code added by that merge. Ten are fixed rather than
silenced:
EI_EXPOSE_REP/REP2 DeviceSweep took a live slice of the sweep's own
accumulator and handed the same list back out; its compact
constructor now copies
OCP_OVERLY_CONCRETE three parameters widened to Collection/Iterable, which is
all the bodies need
WEM_WEAK_EXCEPTION three exceptions now carry the device, the indices or the
configured counts instead of a fixed sentence
FORMAT_STRING withSignificantDigits assembled "%." + decimals + "f"; a
switch over literal formats also spells out that only three
shapes exist
PZLA_PREFER_ZERO the device-info query returned null on refusal; an empty
array is rejected by the same length checks, so the null
bought nothing
The remaining four are suppressed with rationale, following the precedent already
in spotbugs-exclude.xml: three EXS_EXCEPTION_SOFTENING where Jackson's checked
exception is wrapped while serialising POJOs this project owns end to end (a
failure there is a programming error no caller could act on), and one
ENMI_ONE_ENUM_VALUE for a stateless singleton, where a second constant would have
no meaning.
The test failure is a better lesson. run_noProducerConfiguredButGpuPresent_
sweepsTheDetectedDevices asserted that auto-discovery finds a device, guarded only
by "an OpenCL 2.0+ device is available". But an OpenCL device is not necessarily a
GPU, and auto-discovery deliberately sweeps GPUs only — a CPU runtime duplicates
what producerJava already does. The project's own OpenCL CI job runs on pocl,
which exposes exactly one CPU device. So the test asked the tuner to discover
something it correctly filters out, and failed on its own premise.
It now also assumes hasGpuOpenCLDevice(), a helper that already existed in
OpenCLPlatformAssume and that I did not look for. Worth noting that the exclusion
this tripped over is itself deliberate and tested — the failure was the test's
assumption, not the behaviour.
Verified: spotbugs:check reports 0 bugs (was 14), and 127 tests pass across
TuneConfigurationTest, StatisticsTest, OpenCLDeviceTopologyTest, ConsumerJavaTest,
ConfigFixturesParseTest and the architecture rules. REUSE 487/487, spotless clean,
spotbugs-exclude.xml parses.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bernardladenthin
had a problem deploying
to
maven-central
July 27, 2026 07:20 — with
GitHub Actions
Failure
bernardladenthin
had a problem deploying
to
startgate
July 27, 2026 07:20 — with
GitHub Actions
Error
bernardladenthin
had a problem deploying
to
maven-central
July 27, 2026 07:20 — with
GitHub Actions
Failure
|
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.




Summary
Fixes the two failures that turned
mainred immediately after #320. They are unrelated to each other, and both were reachable on a developer machine — I verified #320 withmvn test,spotless:checkandreuse lint, and never once withspotbugs:check.spotbugs-exclude.xml.What was actually wrong
EI_EXPOSE_REP/REP2DeviceSweeptook a live slice of the sweep's own accumulator and handed the same list back out. Its compact constructor now copies.OCP_OVERLY_CONCRETE×3Collection/Iterable— all the bodies ever needed.WEM_WEAK_EXCEPTION×3FORMAT_STRING_MANIPULATIONwithSignificantDigitsassembled"%." + decimals + "f". Aswitchover literal formats also spells out that only three shapes exist.PZLA_PREFER_ZERO_LENGTH_ARRAYSnullon refusal; an empty array is rejected by the same length checks, so thenullbought nothing.Suppressed with rationale: three
EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTSwhere Jackson's checked exception is wrapped while serialising POJOs this project owns end to end — a failure there means the POJO shape and the mapper have gone out of step, a programming error no caller could act on — and oneENMI_ONE_ENUM_VALUEfor a stateless singleton, where a second constant would have no meaning.The test failure is the better lesson
run_noProducerConfiguredButGpuPresent_sweepsTheDetectedDeviceswas guarded only by an OpenCL 2.0+ device is available. But an OpenCL device is not necessarily a GPU, and excluding CPU runtimes from auto-discovery is deliberate and tested behaviour — a CPU runtime duplicates whatproducerJavaalready does. This project's own OpenCL CI job runs on pocl, which exposes exactly one CPU device.So the test failed on its own premise, not on the behaviour under test. It now also assumes
hasGpuOpenCLDevice()— a helper that already existed inOpenCLPlatformAssumeand that I did not look for.Test plan
spotbugs:checkreports 0 bugs (was 14), reproduced locally with the same command thecode-stylejob uses:mvn -DskipTests -Denforcer.skip=true compile spotbugs:checkTuneConfigurationTest,StatisticsTest,OpenCLDeviceTopologyTest,ConsumerJavaTest,ConfigFixturesParseTestand the architecture rulesspotbugs-exclude.xmlparses as XML — a malformed filter silently disables every suppressionspotless:checkcleanNot verified here: the pocl job itself. There is no pocl runtime on this machine, so the assumption fix is reasoned from pocl exposing
CL_DEVICE_TYPE_CPUand from the failure message, not observed. This is exactly the class of gap that produced the bug, so it is worth watching thetest-opencljob on this branch rather than assuming.Related issues / PRs
Refs #320
Checklist
CONTRIBUTING.mdandCODE_OF_CONDUCT.md