Skip to content

fix(build): keep the OCP suppression list in step with the renamed setters - #409

Merged
bernardladenthin merged 1 commit into
mainfrom
claude/spotbugs-exclude-flashattn-lazymode
Sep 1, 2026
Merged

fix(build): keep the OCP suppression list in step with the renamed setters#409
bernardladenthin merged 1 commit into
mainfrom
claude/spotbugs-exclude-flashattn-lazymode

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

  • main is red. The Publish run on 2d29615 fails its SpotBugs gate with two OCP_OVERLY_CONCRETE_PARAMETER findings, both introduced by feat!: llama.cpp b10731, value-taking flash-attn, and the --lazy-mode rename #408:
    setFlashAttn(FlashAttn): 1st parameter 'mode' could be declared as CliArg
    setLazyMode(LazyMode):   1st parameter 'mode' could be declared as CliArg
    
  • The finding is right about the mechanics and wrong about the design, which is why the fix belongs in spotbugs-exclude.xml and not in the code. Widening either parameter to CliArg is exactly what the comment already sitting above that block forbids: setFlashAttn(CacheType.Q8_0) would then compile and emit a nonsense CLI value that the native layer rejects at runtime. The narrow enum type is the API contract.
  • The block lists methods by name, so a rename makes it silently wrong. feat!: llama.cpp b10731, value-taking flash-attn, and the --lazy-mode rename #408 renamed setTensorReadLazy to setLazyMode; that entry has matched nothing since, while the new setLazyMode and setFlashAttn were never covered. Both are added, the dead entry dropped, and the block's own comment updated to name the current enum set.

Why it reached main

spotbugs:check binds to verify, so neither mvn test nor mvn package runs it — #408 was validated with both and still shipped this. Worth noting because it is the second time this exact gap has bitten in this line of work (the equivalent miss happened in srcmorph and was diagnosed as a Spotless failure at first). The gate itself did its job; only the local pre-push loop was blind.

Test plan

  • Verified with the exact command the failing CI job runs, not an approximation:
    mvn -B --no-transfer-progress -f llama/pom.xml -DskipTests -Denforcer.skip=true compile spotbugs:check
    BugInstance size is 0, BUILD SUCCESS (was Total bugs: 2 before the change)
  • Confirmed the dropped entry is genuinely dead: the only remaining occurrence of setTensorReadLazy in the tree is a javadoc line documenting the rename
  • CI is green on this branch
  • Docs / CHANGELOG updated where applicable — n/a, the suppression comment is the documentation and it is updated here

Related issues / PRs

Fixes the SpotBugs failure introduced by #408. Unblocks the 5.2.0 snapshot/release, which bernardladenthin/srcmorph main is currently waiting on (it pins net.ladenthin:llama:5.2.0).

Checklist

  • I have read CONTRIBUTING.md and CODE_OF_CONDUCT.md
  • My commits follow Conventional Commits
  • No security-sensitive changes

Generated by Claude Code

…tters

The Publish run on main fails its SpotBugs gate with two
OCP_OVERLY_CONCRETE_PARAMETER findings, both introduced by #408:

  setFlashAttn(FlashAttn): 1st parameter 'mode' could be declared as CliArg
  setLazyMode(LazyMode):   1st parameter 'mode' could be declared as CliArg

Widening either to CliArg is exactly what the surrounding comment says must
not happen -- setFlashAttn(CacheType.Q8_0) would then compile and emit a
nonsense CLI value the native code rejects at runtime. So these belong in the
existing design-intent suppression, not in the code.

The block lists methods by name, which makes it silently wrong after a rename:
#408 renamed setTensorReadLazy to setLazyMode, so that entry has been matching
nothing since, while the new setLazyMode and setFlashAttn were never covered.
Both are added and the dead entry dropped.

Not caught before the merge because spotbugs:check binds to verify, so neither
mvn test nor mvn package runs it -- the same gap that produced the equivalent
miss in srcmorph. Verified here with the exact command the CI job runs:
mvn -B -f llama/pom.xml -DskipTests -Denforcer.skip=true compile spotbugs:check
-> BugInstance size is 0, BUILD SUCCESS.
@claude

claude Bot commented Sep 1, 2026

Copy link
Copy Markdown

Code Review ✅

This is a straightforward and correct maintenance fix that resolves the SpotBugs gate failure introduced by #408.

Changes Verified

  1. Comment update (lines 62-63): Correctly lists all enum types in alphabetical order

    • Removed TensorReadLazyMode (now split into separate enum)
    • Added FlashAttn and LazyMode
    • List remains: CacheType, FlashAttn, LazyMode, MiroStat, NumaStrategy, ReasoningFormat, RopeScalingType, GpuSplitMode
  2. Method suppression list (lines 80-91): All changes verified against actual code

  3. Design rationale: The explanation in the PR is correct and well-documented

    • Narrow enum types prevent silently compiling nonsense CLI values
    • Widening to CliArg interface would violate the API contract
    • IDE autocomplete also benefits from the narrow type specificity

XML Validation

  • ✅ XML syntax is valid
  • ✅ Proper indentation maintained
  • ✅ All tags properly closed

Assessment

This fix is minimal, focused, and correct. It properly addresses the root cause of the SpotBugs failure without introducing unnecessary changes. The dead-code removal (setTensorReadLazy) and addition of the two new methods ensures the exclude list stays in sync with actual API changes.

@bernardladenthin
bernardladenthin merged commit 8d8980a into main Sep 1, 2026
10 of 14 checks passed
@bernardladenthin
bernardladenthin deleted the claude/spotbugs-exclude-flashattn-lazymode branch September 1, 2026 09:31
@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

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.

2 participants