Skip to content

Adopt JSpecify in shared components - #13025

Draft
bric3 wants to merge 6 commits into
bdu/nullaway-productionfrom
bdu/jspecify-production
Draft

bric3 wants to merge 6 commits into
bdu/nullaway-productionfrom
bdu/jspecify-production

Conversation

@bric3

@bric3 bric3 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Adopt JSpecify in context, time, and version utilities. Enable NullAway's JSpecify mode, mark each production package, and describe nullable context array elements. Export the annotations through api so consumers can compile and analyse these contracts. Upgrade the SpotBugs analyser and annotations to 4.10.5 so override checks recognise JSpecify type annotations.

Motivation

Standardise nullness contracts in the initial adopters and check nullable values inside generic types and arrays while preserving Java 8 reflection.

Additional Notes

Stacked on #13022. NullAway checking stays within the three initial modules. The downstream nullness repairs align contracts in AgentSpan and ScopeContext and update the shared test bootstrap setup.

SpotBugs treats JSpecify @Nullable as @CheckForNull, while JSR-305 @Nullable has weaker semantics. Both context overrides now use JSpecify @Nullable to keep the parent contract consistent.

SpotBugs 4.10.5 includes the JSpecify override detector fix, allowing AgentSpan to use JSpecify throughout. Upgrade repairs remove obsolete suppressions, document thread-confined cursors, and make the shared test timing field volatile.

Important

queue-utils retains the 4.10.4 analyser. SpotBugs 4.10.5 fails to converge while analysing inherited JCTools fill methods; 4.10.4 passes on the same inputs. The module keeps its existing checks.

JSR-305 remains for other legacy nullness and concurrency annotations. JetBrains contracts, SpotBugs suppressions, and Forbidden APIs annotations retain their dependencies while consumers remain.

Java 8 type reflection requires the annotation classes to be visible to the loader of the annotated API. The test harness includes JSpecify in its bootstrap jar. The agent bundles one copy of the four annotations under datadog.trace.bootstrap.jspecify.annotations, isolated from the application's org.jspecify classes.

The dependency export and shared analyser reach many consumers. Lockfiles include JSpecify and the SpotBugs upgrade. Other dependency version changes are confined to the analyser configuration.

Compiling @NullMarked with --release 8 emits the known ElementType.MODULE warning; see the JSpecify compatibility notes.

Contributor Checklist

@bric3 bric3 added comp: tooling Build & Tooling type: feature Enhancements and improvements tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes labels Oct 23, 2026 — with ChatGPT Codex Connector
@bric3
bric3 added this pull request to stack #13023 October 23, 2026 17:11
@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 59.85% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2f91daa | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)

Suite Status
Startup 🟡 warning

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.85 s 14.67 s [+0.3%; +2.1%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.63 s 13.65 s [-1.1%; +0.8%] (no difference)
startup:petclinic:appsec:Agent 17.68 s 17.61 s [-0.4%; +1.2%] (no difference)
startup:petclinic:iast:Agent 17.32 s 17.70 s [-2.9%; -1.4%] (significantly better)
startup:petclinic:profiling:Agent 17.53 s 17.21 s [+0.6%; +3.1%] (maybe worse)
startup:petclinic:sca:Agent 17.76 s 17.67 s [-0.7%; +1.7%] (no difference)
startup:petclinic:tracing:Agent 15.72 s 16.70 s [-11.6%; -0.2%] (unstable)

Commit: 2f91daa8 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@pr-commenter

pr-commenter Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Debugger benchmarks

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
ci_job_date 1793189984 1793190325
end_time 2026-10-28T12:21:14 2026-10-28T12:26:56
git_branch master bdu/jspecify-production
git_commit_sha 5aae203 2f91daa
start_time 2026-10-28T12:19:44 2026-10-28T12:25:26
See matching parameters
Baseline Candidate
ci_job_id 2185033704 2185033704
ci_pipeline_id 148157107 148157107
cpu_model Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
git_commit_date 1793189156 1793189156

Summary

Found 5 performance improvements and 0 performance regressions! Performance is the same for 4 metrics, 6 unstable metrics.

scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:loop better
[-921.488µs; -623.608µs] or [-10.435%; -7.062%]
better
[-959.822µs; -659.877µs] or [-10.747%; -7.389%]
better
[-955.530µs; -657.814µs] or [-10.655%; -7.335%]
better
[-939.594µs; -627.821µs] or [-10.355%; -6.919%]
better
[+7.636op/s; +12.566op/s] or [+6.873%; +11.309%]
See unchanged results
scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:noprobe unstable
[-44352.814ns; +42568.726ns] or [-12.722%; +12.210%]
unstable
[-53823.973ns; +55771.457ns] or [-13.971%; +14.477%]
unstable
[-62.534µs; +69.136µs] or [-15.567%; +17.211%]
unstable
[-540.544µs; +355.174µs] or [-43.419%; +28.529%]
same
scenario:basic same same same unstable
[-96.080µs; +185.204µs] or [-10.572%; +20.379%]
unstable
[-113.016op/s; +113.016op/s] or [-5.086%; +5.086%]
Request duration reports for reports
gantt
    title reports - request duration [CI 0.99] : candidate=None, baseline=None
    dateFormat X
    axisFormat %s
section baseline
noprobe (385.248 µs) : 320, 450
.   : milestone, 385,
basic (348.811 µs) : 343, 355
.   : milestone, 349,
loop (8.931 ms) : 8745, 9118
.   : milestone, 8931,
section candidate
noprobe (386.222 µs) : 352, 421
.   : milestone, 386,
basic (351.275 µs) : 345, 358
.   : milestone, 351,
loop (8.121 ms) : 8058, 8185
.   : milestone, 8121,
Loading
  • baseline results
Scenario Request median duration [CI 0.99]
noprobe 385.248 µs [320.195 µs, 450.301 µs]
basic 348.811 µs [342.66 µs, 354.962 µs]
loop 8.931 ms [8.745 ms, 9.118 ms]
  • candidate results
Scenario Request median duration [CI 0.99]
noprobe 386.222 µs [351.851 µs, 420.592 µs]
basic 351.275 µs [344.946 µs, 357.605 µs]
loop 8.121 ms [8.058 ms, 8.185 ms]

@pr-commenter

pr-commenter Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Kafka / producer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch bdu/nullaway-production bdu/jspecify-production
git_commit_date 1793181651 1793189156
git_commit_sha c36647f 2f91daa
See matching parameters
Baseline Candidate
ci_job_date 1793190486 1793190486
ci_job_id 2185033689 2185033689
ci_pipeline_id 148157107 148157107
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.31 11.0.31
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15002 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15002 -Dhttp.nonProxyHosts=localhost *.localhost
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-wz4nhy5g 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-wz4nhy5g 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaProduceBenchmark.benchProduce unsure
[-4944.054op/s; -378.481op/s] or [-3.890%; -0.298%]

@pr-commenter

pr-commenter Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Kafka / consumer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch bdu/nullaway-production bdu/jspecify-production
git_commit_date 1793181651 1793181744
git_commit_sha c36647f 1b12056
See matching parameters
Baseline Candidate
ci_job_date 1793183083 1793183083
ci_job_id 2184535539 2184535539
ci_pipeline_id 148121239 148121239
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.31 11.0.31
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15002 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15002 -Dhttp.nonProxyHosts=localhost *.localhost
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-1-ntpyc50y 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-1-ntpyc50y 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu 11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume unsure
[+81.519op/s; +7658.408op/s] or [+0.045%; +4.231%]

@bric3
bric3 force-pushed the bdu/jspecify-production branch from 53a778e to 1b12056 Compare October 28, 2026 10:03

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant