Repository navigation
Conversation
🟢 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. |
81636d4 to
c76183c
Compare
LLM ValidationLLM Validation Gate — java-agent-instructions✅ PASS
6 case(s) · quality 79.7 → 81.3 (+1.7) · win-rate 54% [50%–58%] Details — analysis and per-case resultsAnalysisChanged instruction file(s): No safety or blocking-case regressions across 6 case(s). Overall pairwise win-rate 54% [50%–58%], quality +1.7 — 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. |
There was a problem hiding this comment.
I feel there is something off with this refactoring. The "toolbox" component seem a bag of various thing compared to a purposefully crafted module with a single goals.
The contract package seems like the could fit in annotations, the util usually is an anti-pattern, trace is product related (and we don't mix product related feature with components. Some classes would make a dedicated collection component maybe?
What about moving it to utils instead if we need to extract it to be reusable?
@PerfectSlayer Yeah, I do tend to agree. Although, that was the structure before I started adding to it as well. |
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. |
There was a problem hiding this comment.
More details
Static review found the dependency re-export and agent packaging consistent with preserving access to the moved toolbox classes without duplicate agent copies.
🤖 Bits Code Review · Commit 062359f
|
@PerfectSlayer Following up on the structure: here's a proposal for reshaping this PR into purposeful modules instead of one bag. Split by purpose, along the existing dependency lines:
Rename the packages away from Why Does that address your concerns? If so, I'll reshape this PR along these lines before the stack above it lands. |
062359f to
5c9275f
Compare
There was a problem hiding this comment.
More details
Source inspection supports preserved access to the moved classes through internal-api’s dependency re-export, with agent packaging exclusions updated for the new module. No actionable defect was identified.
🤖 Bits Code Review · Commit 5c9275f
…dule Moves the toolbox primitives that have no dependencies outside the JDK out of internal-api, with their tests: Hashtable, FlatHashtable, StringIndex, ChunkedBuffer, Cursor, Maybe, the hashing utilities, BitUtils and FNV64Hash, plus the contract annotations and the Strategy, StrategyConsumer and NoEscape markers. Package names do not change, and internal-api re-exports the module, so callers are unchanged. Strings.caseInsensitiveHashCode moves to HashingUtils, which FlatHashtable uses. Strings keeps the method and delegates to it. The agent's shared and per-product jars exclude the module, as they do the other bootstrap components, so each class is packaged once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The moved classes passed under internal-api's thresholds (0.7 branch, 0.8 instruction). The new module got the 0.9 default instead, which failed coverage verification for seven of them. Using internal-api's thresholds keeps enforcement exactly as it was before the move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing calls the Strings delegate, so drop it and move its test next to HashingUtils. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cies The toolbox was extracted from internal-api, so it keeps the strict core performance rules in AGENTS.md and the perf-review posture. Its lockfile now covers the test configurations too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It only depends on toolbox classes, plus TriFunction, which moves with it in the same package, as Strategy did. internal-api exposes the toolbox as an api dependency, so its users compile unchanged. The size-manager test polls the thread state itself rather than through test-utils, so the toolbox tests keep junit as their only dependency, and hashIterator gets a direct test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ConcurrentHashtable, StringIndex and FlatHashtable are on master and now live in components/toolbox; StringCanonicalizer and LruTable are coming. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EscapeShapeBenchmark's arms are mergeWithStatic and mergeOfTwoAllocations now, and "merge of several allocations" replaces the compiler term "phi". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5c9275f to
0dbdb72
Compare
There was a problem hiding this comment.
More details
The toolbox remains available through internal-api’s API dependency, with matching exclusions in agent packaging. Compilation and runtime packaging were not exercised.
🤖 Bits Code Review · Commit 0dbdb72
To avoid being a grab base, it feels like
Yes, that's already better. The cleaner we put it in place at first, the best it will live and we can enrich it later. |
|
@PerfectSlayer Agreed. Moving Looking closer at the "functional interfaces": three of the four ( Revised layout:
One correction to my earlier comment: I said strings would keep a private copy of the hash spread. It was just tuned in #13576, and two copies would drift, so I'd rather have strings depend on collections. It's one-way, so no cycle. Packages would be I'd reshape this PR in place, one commit per module, so it reads in steps. Does that work for you? |
|
components/strings | StringIndex, StringCanonicalizer I could not find the source of |
|
@PerfectSlayer I'd like to keep
and grow with
To keep
So in this PR the modules would be |
What Does This Do
Moves the perf toolbox primitives out of
internal-apiinto a new module,components/toolbox, with their tests. The module depends on nothing outside the JDK.Hashtable,ConcurrentHashtable,FlatHashtable,StringIndex,ChunkedBuffer,Cursor,MaybeHashingUtils,LongHashingUtils,FNV64Hash,BitUtilsdatadog.contractannotations, andStrategy,StrategyConsumer,NoEscapeandTriFunctionfromdatadog.trace.api.functionPackage names don't change, and
internal-apire-exports the module withapi(...), so callers don't change.caseInsensitiveHashCodemoves fromStringstoHashingUtils, whereFlatHashtableuses it.Motivation
The toolbox is meant for product and instrumentation code, but a standalone SDK can't depend on
internal-api, which brings indd-trace-api, slf4j and several components. An SDK published on its own also has to work with whatever agent version is attached. A module with no dependencies can be shaded into such an SDK under a private package. The next PR does that fordd-openfeature.Additional Notes
internal-api(gradle/dependencies.gradleandsharedShadowJar). The agent jar has one copy of each toolbox class, at the bootstrap root, whereverinternal-apiis.datadog.trace.util,datadog.trace.api.functionanddatadog.contractnow span two jars. That's fine on the classpath, and nothing uses the JPMS module path.components/toolbox/src/main/joins the strict core performance rules inAGENTS.mdand the perf-review posture, as code moved frominternal-api.components/toolboxwith JUnit as their only dependency (the one test that usedPollingConditionspolls the thread state itself). The toolbox keepsinternal-api's coverage thresholds (0.7 branch, 0.8 instruction). The benchmarks, andStringIndexFootprintTest(which compares againstCollectionUtils), stay ininternal-api.internal-api(main, test, jmh),dd-trace-core, agent-bootstrap, agent-tooling and the instrumentations that useTriFunctioncompile.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 issueJira ticket: [PROJ-IDENT]
🤖 Generated with Claude Code