Repository navigation
Conversation
Contributor
🟢 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. |
This was referenced Nov 19, 2026
Draft
…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>
dougqh
force-pushed
the
dougqh/ffe-toolbox-shading
branch
from
November 19, 2026 21:24
3d4204f to
8dd30e7
Compare
dougqh
force-pushed
the
dougqh/ffe-chunked-payloads
branch
from
November 19, 2026 21:25
2a118a2 to
32070d8
Compare
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>
dougqh
force-pushed
the
dougqh/ffe-toolbox-shading
branch
from
November 19, 2026 22:38
8dd30e7 to
cdda826
Compare
dougqh
force-pushed
the
dougqh/ffe-chunked-payloads
branch
from
November 19, 2026 22:56
88b2739 to
815056a
Compare
This was referenced Nov 19, 2026
dougqh
force-pushed
the
dougqh/ffe-chunked-payloads
branch
from
November 20, 2026 13:36
815056a to
910c68d
Compare
…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>
dougqh
force-pushed
the
dougqh/ffe-toolbox-shading
branch
from
November 20, 2026 13:39
89895cd to
8c81722
Compare
dougqh
force-pushed
the
dougqh/ffe-chunked-payloads
branch
from
November 20, 2026 13:39
910c68d to
b571777
Compare
LLM ValidationLLM Validation Gate — java-agent-instructions✅ PASS
6 case(s) · quality 80.0 → 80.5 (+0.4) · win-rate 49% [46%–51%] Details — analysis and per-case resultsAnalysisChanged instruction file(s): No safety or blocking-case regressions across 6 case(s). Overall pairwise win-rate 49% [46%–51%], 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. |
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>
dougqh
force-pushed
the
dougqh/ffe-toolbox-shading
branch
from
November 20, 2026 20:50
8c81722 to
6ac4db5
Compare
dougqh
force-pushed
the
dougqh/ffe-chunked-payloads
branch
from
November 20, 2026 20:50
b571777 to
8eaba80
Compare
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>
dougqh
force-pushed
the
dougqh/ffe-toolbox-shading
branch
from
November 20, 2026 21:32
6ac4db5 to
0e0d85e
Compare
dougqh
force-pushed
the
dougqh/ffe-chunked-payloads
branch
from
November 20, 2026 21:32
8eaba80 to
8284622
Compare
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>
dd-openfeature is published on its own and must work with any attached agent version, so it can't depend on the toolbox module. Instead its published jar carries a relocated copy of the toolbox classes it uses, under com.datadog.openfeature.internal.shaded, and Shadow's minimize() drops the classes it doesn't reach. The Shadow plugin is not applied: publish.gradle would then list only api dependencies in the POM and drop opentelemetry-api. A ShadowJar task replaces the jar of the java component's apiElements and runtimeElements instead, so the publication and its POM are unchanged. The plain jar moves to the "unbundled" classifier, and the japicmp checks compare the published jar. checkToolboxRelocation, run by check, fails if an unrelocated toolbox class reaches the jar. Nothing in the SDK uses the toolbox yet, so the published jar has the same entries as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
compareToReferenceJar (jardiff) compares the module's jar task output unless the Shadow plugin is applied. Here the plain jar moved to the "unbundled" classifier and toolboxJar became the published jar, so the check looked for an unbundled jar the reference set doesn't have. It now compares the published, shaded jar; a clean rebuild matches it byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI runs :dd-openfeature:jar and collects build/libs/*.jar, but jar now builds the unbundled jar into build/libs-unbundled, which left nothing for validate_build, the S3 upload or system-tests. jar is now finalized by toolboxJar, which writes the shaded jar to build/libs. The shaded jar also takes the plain jar's manifest, so it keeps the Implementation-* attributes the jar convention sets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Serialize each exposure as it is drained into a reused ChunkedBuffer, sending a payload once it reaches 5 MiB, instead of holding the event objects until the flush and then one large array. Flag evaluation payloads are written into chunks too, and the transports post the chunks: direct intake streams them, other transports join them. Hashed targeting keys are hex-encoded from a digit table. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: dougqh <dougqh@gmail.com>
Coverage verification failed on the new chunked path. The tests cover: - ChunksPublisher against the Flow contract: partial and unbounded requests, completion, an empty body, read-only views, an error for a non-positive request, cancel, and a cancel from inside onNext. - DirectIntakeTransport: a chunked post arrives as one body with its length. - FallbackTransport: the chunked post follows the same proxy/direct switching as the array post. - JsonWriting: a message per document, rewinding a partial message when the writer fails, and single-byte writes. ChunkedOutput becomes package-private for the last one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A request that timed out can still be reading its body after post throws, so the exposure serializer now replaces its buffer after a failed post instead of overwriting the bytes in flight. EventTransport documents that contract. Flag evaluations were encoded into all of a flush's payloads before the first was posted; a full aggregator can make that tens of MiB at once. Each payload is now posted as it closes, reusing one buffer, so a flush holds one payload at a time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both pipelines built a JSON array of events in a reused ChunkedBuffer between a fixed prefix and suffix: the separator before each event after the first, the rollback on overflow or failure, and the body assembled for posting. JsonArrayPayload now does that once, with reset() after a delivered post and discard() after a failed one, whose buffers a timed-out request may still be reading. Exposure tests now cover splitting a batch across payloads, dropping an exposure larger than a payload, and dropping one that can't be serialized. From Bits' review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dougqh
force-pushed
the
dougqh/ffe-toolbox-shading
branch
from
November 21, 2026 03:53
0e0d85e to
676974d
Compare
dougqh
force-pushed
the
dougqh/ffe-chunked-payloads
branch
from
November 21, 2026 03:53
cde93ef to
9f20045
Compare
dougqh
force-pushed
the
dougqh/ffe-toolbox-shading
branch
from
November 24, 2026 02:04
676974d to
97180eb
Compare
This branch has not been deployed
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.
What Does This Do
Writes the exposure and flag evaluation payloads into the toolbox's
ChunkedBuffer(chunks just under 256 KiB) and posts the chunks, instead of building each payload as one array of up to several MiB.ChunkedBufferthat it reuses across flushes. A payload is a prefix with the context, the exposures separated by commas, and a suffix. It is sent once it reaches 5 MiB, the same limit as flag evaluation payloads. Before, the exposures waited for the flush asExposureEventobjects, then were written into one array.EncodedPayloads.bodiesbecomes a list of chunk lists. Hashed targeting keys are hex-encoded from a digit table, instead of building anInteger.toHexStringstring per byte.EventTransport(the bridge SPI) gets apost(String, List<ByteBuffer>)default method that joins the chunks, for transports that only post arrays.DirectIntakeTransportstreams the chunks withBodyPublishers.fromPublisherand a known content length, without joining them.FallbackTransportpasses the chunks on to the agent's event proxy, or to direct intake once it has switched.Motivation
On G1 with 1 MB regions (heaps up to 2 GB), any array of 512 KB or more is humongous. It is allocated straight into the old generation, can start a concurrent cycle, and is only reclaimed by a collection that handles humongous regions. A payload built as one array (and the arrays copied while a stream grows) crosses that size well before 5 MiB. The chunks stay regular-sized.
Measured on its own by Bits, at this PR's head (
815056a903) against #13532's head (cdda8262d8). Both sides get the same benchmark-only overlay (#13529'sClientEvaluationBenchmark, aconsentparam, and the chunkedpostoverride). Unique subjects, JDK 21.0.12,-prof gc, with base and PR forks alternating. "Noise" means the fork ranges overlap.256 MB heap, average time (5 forks at 1 thread, 3 at 4 threads):
scale/flagsscale/flagsscale/splitsscale/splits128 MB heap, G1, 4 threads, throughput (3 forks, per million evaluations):
scale/flagsscale/splitsscale/flagsscale/splitsscale/flagsat 1 thread is 891 ns [864..940] → 886 ns [864..900], −0.5%.scale/splitsat 4 threads is noise. A 3-fork run showed +6.5%; with 7 forks a side it's +3.8% with overlapping ranges ([44.53..50.56] vs [47.43..49.59]).scale/flagspromotion drop 15–30%.Additional Notes
ChunkedBuffer.AgentEventProxy) only haspostEvent(route, byte[]), so it uses the default method and still joins each payload into one array. A follow-up can add a chunkedpostEventtoFeatureFlaggingGateway.Backendand override the chunkedpostin the proxy.ClientEvaluationBenchmarkwhose in-memory transport overrides the chunkedpost, so it takes the chunks as they are, like direct intake. That benchmark lives in Benchmark flag evaluation through the OpenFeature client (FFE optimization) #13529, which isn't onmaster, so the override isn't in this PR. Once both land, add it there. Without it, the benchmark joins the chunks through the default method and shows humongous arrays that a streaming transport doesn't have.dd-openfeaturetests pass, and Spotless, SpotBugs (spotbugsMain,spotbugsTest,spotbugsJmh) andcheckToolboxRelocationpass. The sandbox run on the earlier base had 1,609 tests: Benchmark FFE evaluation on the scale suites #13485 adds the scale-suite tests.FlagEvaluationPayloadsTestjoins the chunks through abytes()helper to check the JSON. The exposure serializer suppressesAT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLEandAT_STALE_THREAD_WRITE_OF_PRIMITIVE, because the payload is confined to the serializer thread.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]
Review follow-ups
HttpCallcancels the future andpostthrows, but the JDK client can still be reading the request body, whose read-only views share theChunkedBuffer's arrays. The exposure serializer reset the buffer infinallyand overwrote those bytes. It now replaces the buffer after a failed post (aFailedPostKeepsItsBuffersfails without the fix).EventTransportdocuments that buffers are reusable only after a normal return.finally, so the counts survive a failed post.🤖 Generated with Claude Code