Repository navigation
Conversation
LLM ValidationLLM Validation Gate — java-agent-instructions✅ PASS
6 case(s) · quality 81.8 → 82.2 (+0.4) · win-rate 50% [47%–53%] Details — analysis and per-case resultsAnalysisChanged instruction file(s): No safety or blocking-case regressions across 6 case(s). Overall pairwise win-rate 50% [47%–53%], quality +0.4 — see the verdict above for whether that clears the noise band. Results
Cases
Per-dimension scores, token usage, latency, and estimated cost are in the CI job logs. |
17e1eaa to
53df754
Compare
bbf0ebe to
c9b84b7
Compare
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
53df754 to
a9c8f34
Compare
c9b84b7 to
27de784
Compare
There was a problem hiding this comment.
More details
Bucket growth rebuilds collision chains while preserving recency order, and the exposure cache retains synchronized access and bounded eviction. The specialist’s source review returned no actionable findings.
🤖 Bits Code Review · Commit 27de784
a9c8f34 to
8064973
Compare
27de784 to
10e38b8
Compare
There was a problem hiding this comment.
More details
Static analysis identified no actionable defect in bucket growth, LRU eviction, or the exposure-cache migration. Runtime behavior and benchmark claims remain unverified.
🤖 Bits Code Review · Commit 10e38b8
sarahchen6
left a comment
There was a problem hiding this comment.
LGTM! I reviewed with Codex as well and nothing worth noting from there
10e38b8 to
a95f804
Compare
There was a problem hiding this comment.
The LinkedHashMap benchmark creates two equivalent keys on misses, overstating its baseline costs when the lookup allocation survives JIT optimization. The comparison should reuse one key before its measurements support the performance claims.
🤖 Bits Code Review · Commit a95f804
| final String variant = tables.linkedHashMap.get(new Key(flag, subject)); | ||
| if (variant != null) { | ||
| return variant; | ||
| } | ||
| tables.linkedHashMap.put(new Key(flag, subject), "on"); |
There was a problem hiding this comment.
Reuse the lookup key in the LinkedHashMap benchmark
Each LinkedHashMap miss constructs one key for lookup and another identical key for insertion. When the JIT retains the lookup allocation, the baseline pays for two keys plus the map node, overstating allocation and biasing the timing comparison against LruTable. Reuse the lookup key for insertion and rerun the reported comparison.
| final String variant = tables.linkedHashMap.get(new Key(flag, subject)); | |
| if (variant != null) { | |
| return variant; | |
| } | |
| tables.linkedHashMap.put(new Key(flag, subject), "on"); | |
| final Key key = new Key(flag, subject); | |
| final String variant = tables.linkedHashMap.get(key); | |
| if (variant != null) { | |
| return variant; | |
| } | |
| tables.linkedHashMap.put(key, "on"); |
React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it
What each reaction means
- 👍 Useful: correct, and you're fixing it or will.
- 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
- 😕 Unclear: you can't tell what it means or why it matters.
- 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.
🤖 Bits Code Review · Open Bits AI session
There was a problem hiding this comment.
Agreed, fixed in a446a03: the baseline now builds one key and uses it for both the lookup and the insert. I'll rerun the comparison and update the numbers in the description.
There was a problem hiding this comment.
More details
The PR adds growable bounded LRU tables with allocation-free one- and two-part lookups, shared growth logic, tests, and a LinkedHashMap benchmark. The benchmark now reuses its lookup key, resolving the only finding; no issues remain open, though corrected performance measurements remain unverified.
🤖 Bits Code Review · Commit a446a03
a446a03 to
ddd936d
Compare
There was a problem hiding this comment.
More details
Static review found no actionable defect in bounded eviction, recency updates, or resizing. Runtime behavior and the reported performance gains were not independently verified.
🤖 Bits Code Review · Commit ddd936d
LruTable.D1 and D2 are bounded least-recently-used tables over chained buckets whose entries carry their own recency links, so a lookup allocates nothing and a full table holds one object per key. The bucket array starts at 16 and doubles as the table fills, up to the size a fixed table would allocate for the bound, so a table that never fills never pays for it. At the bound, insert evicts the eldest entry and returns it. LruTable lives next to Hashtable in internal-api's datadog.trace.util. LruTableBenchmark compares it with a LinkedHashMap in access order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LruTable kept its own copy of the growth rule: a 16-bucket start, a doubling past 3/4 full, and a private grow() that walked the recency list to relink the entries. It now uses Hashtable's: the start comes from Hashtable.Sizing, the check from the same needsGrowth rule Hashtable.D1 and D2 use, and the relinking from Hashtable.resize. The sizes are unchanged (min(16, capacityFor(max)) up to capacityFor(max)), and the recency links are separate fields that resize never touches. LruTable.D1.create and D2.create take a Hashtable.Sizing, so a caller can choose the starting size as with Hashtable.D1.create; the int constructors stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a miss the baseline built one key to look up and another to insert, which overstated its allocation when the lookup key wasn't scalar replaced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ddd936d to
805ceb9
Compare
There was a problem hiding this comment.
More details
Bucket growth reuses Hashtable’s resize logic while keeping recency links separate. The completed static review identified no reportable defect; runtime correctness and benchmark performance were not exercised.
🤖 Bits Code Review · Commit 805ceb9
What Does This Do
datadog.trace.util.LruTabletointernal-api, withD1(one key) andD2(a two-part key, with no key object per lookup). Both are bounded least-recently-used tables.Hashtable.capacityFor(bound)by default. With aSizingthat sets an initial capacity, the bucket array starts at a quarter of that at least and doubles past 3/4 full, at most twice, up to the full size.insertevicts the least recently used entry and returns it, so the caller can release what it holds or count the eviction.getreorders,peekdoesn't. Alsoremove,clear,eldestandforEach, with entries visited from eldest to youngest.LruTableBenchmark(internal-api JMH):LruTable.D2against aLinkedHashMapin access order withremoveEldestEntry.Motivation
Motivating user: #13533 made dd-openfeature's exposure cache allocation-free and one object per subject. Its
Hashtable.D2has a fixed bucket array, though: at the cache's 65,536-subject bound that's 131,072 buckets, a 512 KiB array, which is a humongous allocation on a small G1 heap. Creating it lazily (the review follow-up on #13533) only delays it to the first exposure, so a service with a handful of subjects still holds the whole array. Bits flagged this as a P3: caches under about 12k entries hold more than theLinkedHashMapthey replaced.With a growable spine (#13652 opts in), the array tracks the number of subjects actually seen, within a quarter of the full size. A full cache ends up the same size as before, with the same entry layout:
Exposurealready carried its ownolderandnewerlinks.The recency-list code was generic, so it now lives in
internal-api.dd-trace-core'sLRUCacheis aLinkedHashMapand a possible next user.Measured (Bits, at
a446a032b6, when theintconstructor still gave a growable table, with the correctedLinkedHashMapbaseline that builds one key per miss; 3 forks per arm, 4 threads with per-thread tables, 3×10 s warmup and 5×10 s measurement,-prof gc, 5 vCPUs). Steal was high (about 22–23%) but matched between arms within 1 point.fitsuses keys = half the bound, so every op is a hit;overflowsuses keys = 4× the bound, so most ops are a miss, an insert and an eviction. Median ns/op:LruTable.D2LinkedHashMapLruTable.D2LinkedHashMapAllocation, the same on both JDKs and both bounds:
LruTableabout 0 B/op,LinkedHashMap24 B/op (its key object isn't scalar-replaced in these runs).LruTable48 B/op (one entry),LinkedHashMap64 B/op (key plus node): 25% less.No parameter showed
LruTableslower. Deltas under about 7% are treated as unconfirmed. The retained-size table forExposureDeduplicationCachemoved to #13652 with the integration.Additional Notes
Hashtable.LruTablereuses itsresizeandneedsGrowthbuilding blocks and its hash functions.Hashtable, so an evicted entry is returned for cleanup, not for reuse under a new key.Hashtableto its bound at about 2× the time of a fixed one, which is why growth is opt-in. The benchmark's tables are long-lived (filled in warmup), so its numbers aren't sensitive to which sizing is used.LruTableTest: recency order (getreorders,peekdoesn't), eviction of the eldest, removal from the middle of a collision chain, null keys, two-part keys with equal hashes, a bound of 0, growth up to and not past the fixed size, andclear.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue🤖 Generated with Claude Code