-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathspotbugs-exclude.xml
More file actions
137 lines (135 loc) · 6.98 KB
/
Copy pathspotbugs-exclude.xml
File metadata and controls
137 lines (135 loc) · 6.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<!-- Suppress warnings about use of incubating Vector API -->
<Match>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
<!-- MemorySegment and internal-state fields throughout the inference pipeline are
performance-critical views over mmap'd file data or shared state. Defensive copies
are not feasible (would defeat zero-copy design). -->
<Match>
<Package name="com.integrallis.models.backend.purejava.llama"/>
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
</Match>
<Match>
<Package name="com.integrallis.models.backend.purejava.gguf"/>
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
</Match>
<Match>
<Package name="com.integrallis.models.backend.purejava.cache"/>
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
</Match>
<Match>
<Package name="com.integrallis.models.backend.purejava"/>
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
</Match>
<!-- JFR reads event fields reflectively when the event is committed; nothing in Java reads them. -->
<Match>
<Class name="com.integrallis.models.backend.purejava.diagnostics.PerformanceCliffEvent"/>
<Bug pattern="URF_UNREAD_FIELD"/>
</Match>
<!-- SopranoBackend.Step is a per-call transfer object. LlamaForwardPass already creates stable
copies for it; returning those arrays without another defensive copy avoids duplicating
the vocabulary and acoustic-frame buffers on every generated token. -->
<Match>
<Class name="com.integrallis.models.backend.purejava.soprano.SopranoBackend$Step"/>
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
</Match>
<!-- bytes_to_unicode mapping: byte value is known <=255 by construction (loop 0..255) -->
<Match>
<Class name="com.integrallis.models.backend.purejava.tokenizer.GgufTokenizer"/>
<Bug pattern="UC_USELESS_CONDITION"/>
</Match>
<!-- PureJavaBackend.load: metadata getString returning Optional is handled by orElse -->
<Match>
<Class name="com.integrallis.models.backend.purejava.PureJavaBackend"/>
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
</Match>
<!-- models-embedding: VectorCollectionEmbeddingSink intentionally exposes the wrapped
VectorCollection and EmbeddingBackend via accessors so callers can interleave bulk
operations and direct backend calls. Defensive copies of these references would defeat
the bridge's purpose (the entire point is to share state with the downstream collection). -->
<Match>
<Class name="com.integrallis.models.embedding.VectorCollectionEmbeddingSink"/>
<Or>
<Bug pattern="EI_EXPOSE_REP"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Or>
</Match>
<!-- Lfm2ForwardPass hands back its own logits buffer, which is what every decoder in this
backend does: the contract is that the array is valid until the next forward call, and the
callers immediately read or clone it. Copying a vocabulary-sized array on every token would
allocate once per generated token for no benefit, and the returned array is documented as
transient on the method itself. -->
<Match>
<Class name="com.integrallis.models.backend.purejava.lfm2.Lfm2ForwardPass"/>
<Method name="forward"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<!-- Gemma3nForwardPass hands back its own logits buffer for the same reason Lfm2ForwardPass does:
the contract is that the array is valid until the next forward call, the callers read or clone
it immediately, and copying a vocabulary-sized array per generated token would allocate once
per token for no benefit. Documented on the method itself. -->
<Match>
<Class name="com.integrallis.models.backend.purejava.gemma3n.Gemma3nForwardPass"/>
<Method name="forward"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<!-- Deepseek2ForwardPass hands back its own logits buffer, the same contract as every other decoder
here: valid until the next forward call, read or cloned immediately by the caller. Documented on
the method. -->
<Match>
<Class name="com.integrallis.models.backend.purejava.deepseek2.Deepseek2ForwardPass"/>
<Method name="forward"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<!-- A ModelFleet deliberately shares its mutable ModelRouter so applications and framework
adapters can publish live availability, load, cache, and call feedback to the same router
that makes decisions. Returning a defensive copy would split that operational state. -->
<Match>
<Class name="com.integrallis.models.router.ModelFleet"/>
<Method name="router"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<!-- An Attempt is the intentional lifecycle handle for an active reservation. Sharing its
identity lets provider callbacks and cancellation settle the same reservation exactly once;
a defensive copy would double-charge or lose that coordination. -->
<Match>
<Class name="com.integrallis.models.router.RoutingExecution"/>
<Method name="beginAttempt"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<!-- models-decisions: every answer space's criteria() hands back a Map.copyOf result, built by
AnswerSpaces.requireCriteria, so it is already immutable. Asserted behaviourally by
AnswerSpaceCriteriaTest rather than trusted. Noul joins the list below because it now holds
a map too. -->
<Match>
<Or>
<Class name="com.integrallis.models.decisions.Noul"/>
<Class name="com.integrallis.models.decisions.Choice"/>
<Class name="com.integrallis.models.decisions.Score"/>
</Or>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<!-- models-decisions: Choice.options and Score.levels hold List.copyOf results, which are
genuinely immutable; SpotBugs cannot see through the factory. The immutability is pinned
behaviourally by AnswerSpaceTest, which asserts both that the returned list rejects
mutation and that the space copies the options it was handed. Copying again on every read
would allocate once per decision for no gain. -->
<Match>
<Or>
<Class name="com.integrallis.models.decisions.Choice"/>
<Class name="com.integrallis.models.decisions.Score"/>
</Or>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<!-- These hand back a DecisionArtifact, a final class of final fields with no array accessor.
The value is immutable; SpotBugs cannot see that through the accessor. -->
<Match>
<Or>
<Class name="com.integrallis.models.decisions.NoulEvaluation"/>
<Class name="com.integrallis.models.decisions.TypedEvaluation"/>
</Or>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
</FindBugsFilter>