Skip to content

Conversation

@blt
Copy link
Contributor

@blt blt commented Jan 27, 2026

What does this PR do?

This commit is motivated by the potential end state in spike PR #45519.
That is, if we want to make non-trivial changes to this package systematic
testing of the package is warranted. I have introduced tests to confirm that
for all the strategies supported by this package:

  • the identity b == decompress(compress(b)) holds
    • that this is true also for zstd cgo/nocgo crossed
  • empirical confirmation of the CompressBound calculations
  • tests for resource management by the streaming compression

This commit includes fixes for the following:

  • zlib CompressBound: Changed from 13 to 16 bytes overhead
  • gzip CompressBound: Changed from 18 to 33 bytes overhead
  • zstd CGO: Fixed write-after-close bug by adding a wrapper with state tracking

Copy link
Contributor Author

blt commented Jan 27, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added long review PR is complex, plan time to review it team/agent-runtimes labels Jan 27, 2026
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Jan 27, 2026

Go Package Import Differences

Baseline: 8766844
Comparison: ab6aa69

binaryosarchchange
security-agentlinuxamd64
+4, -0
+github.com/klauspost/compress
+github.com/klauspost/compress/fse
+github.com/klauspost/compress/huff0
+github.com/klauspost/compress/zstd
security-agentlinuxarm64
+4, -0
+github.com/klauspost/compress
+github.com/klauspost/compress/fse
+github.com/klauspost/compress/huff0
+github.com/klauspost/compress/zstd
security-agentwindowsamd64
+4, -0
+github.com/klauspost/compress
+github.com/klauspost/compress/fse
+github.com/klauspost/compress/huff0
+github.com/klauspost/compress/zstd

blt added 2 commits January 26, 2026 19:47
This commit is motivated by the potential end state in spike PR #45519.
That is, if we want to make non-trivial changes to this package systematic
testing of the package is warranted. I have introduced tests to confirm that
for all the strategies supported by this package:

- the identity `b == decompress(compress(b))` holds
  * that this is true also for zstd cgo/nocgo crossed
- empirical confirmation of the `CompressBound` calculations
- tests for resource management by the streaming compression

This commit includes fixes for the following:

- zlib CompressBound: Changed from 13 to 16 bytes overhead
- gzip CompressBound: Changed from 18 to 33 bytes overhead
- zstd CGO: Fixed write-after-close bug by adding a wrapper with state tracking

Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
@blt blt force-pushed the 01-27-expand_test_coverage_for_pkg_util_compression_ branch from dab3839 to ab6aa69 Compare January 27, 2026 03:51
@agent-platform-auto-pr
Copy link
Contributor

Static quality checks

❌ Please find below the results from static quality gates
Comparison made with ancestor 8766844
📊 Static Quality Gates Dashboard

Error

Quality gate Change Size (prev → curr → max)
agent_msi (on wire) +268.0 KiB (0.18% increase) 143.152 → 143.414 → 143.300
Gate failure full details
Quality gate Error type Error message
agent_msi StaticQualityGateFailed �[91mstatic_quality_gate_agent_msi failed!
Wire size 143.4 MB exceeds limit of 143.3 MB by 116.8 KB�[0m

Static quality gates prevent the PR to merge!
You can check the static quality gates confluence page for guidance. We also have a toolbox page available to list tools useful to debug the size increase.

Successful checks

Info

Quality gate Change Size (prev → curr → max)
agent_deb_amd64 +8.41 KiB (0.00% increase) 752.511 → 752.519 → 754.830
agent_deb_amd64_fips +12.41 KiB (0.00% increase) 701.180 → 701.192 → 704.000
agent_heroku_amd64 +4.03 KiB (0.00% increase) 326.974 → 326.977 → 329.530
agent_rpm_amd64 +8.41 KiB (0.00% increase) 752.495 → 752.503 → 754.800
agent_rpm_amd64_fips +12.41 KiB (0.00% increase) 701.164 → 701.176 → 703.990
agent_rpm_arm64 +4.41 KiB (0.00% increase) 731.268 → 731.272 → 737.340
agent_rpm_arm64_fips +12.41 KiB (0.00% increase) 683.256 → 683.268 → 688.480
agent_suse_amd64 +8.41 KiB (0.00% increase) 752.495 → 752.503 → 754.800
agent_suse_amd64_fips +12.41 KiB (0.00% increase) 701.164 → 701.176 → 703.990
agent_suse_arm64 +4.41 KiB (0.00% increase) 731.268 → 731.272 → 737.340
agent_suse_arm64_fips +12.41 KiB (0.00% increase) 683.256 → 683.268 → 688.480
docker_agent_amd64 +8.4 KiB (0.00% increase) 814.612 → 814.620 → 817.140
docker_agent_arm64 +4.41 KiB (0.00% increase) 817.976 → 817.980 → 824.020
docker_agent_jmx_amd64 +8.42 KiB (0.00% increase) 1005.491 → 1005.499 → 1008.020
docker_agent_jmx_arm64 +4.41 KiB (0.00% increase) 997.574 → 997.578 → 1003.620
docker_cluster_agent_amd64 +4.03 KiB (0.00% increase) 181.112 → 181.116 → 181.120
iot_agent_deb_arm64 +4.03 KiB (0.01% increase) 40.135 → 40.139 → 40.920
iot_agent_deb_armhf +4.02 KiB (0.01% increase) 40.705 → 40.709 → 41.030
12 successful checks with minimal change (< 2 KiB)
Quality gate Current Size
docker_cluster_agent_arm64 196.918 MiB
docker_cws_instrumentation_amd64 7.135 MiB
docker_cws_instrumentation_arm64 6.689 MiB
docker_dogstatsd_amd64 38.840 MiB
docker_dogstatsd_arm64 37.128 MiB
dogstatsd_deb_amd64 30.059 MiB
dogstatsd_deb_arm64 28.204 MiB
dogstatsd_rpm_amd64 30.059 MiB
dogstatsd_suse_amd64 30.059 MiB
iot_agent_deb_amd64 43.037 MiB
iot_agent_rpm_amd64 43.038 MiB
iot_agent_suse_amd64 43.038 MiB
On-wire sizes (compressed)
Quality gate Change Size (prev → curr → max)
agent_msi +268.0 KiB (0.18% increase) 143.152 → 143.414 → 143.300
agent_deb_amd64 -45.44 KiB (0.02% reduction) 183.949 → 183.905 → 184.810
agent_deb_amd64_fips +49.43 KiB (0.03% increase) 172.616 → 172.664 → 173.790
agent_heroku_amd64 neutral 87.157 MiB → 88.450
agent_rpm_amd64 -5.39 KiB (0.00% reduction) 186.830 → 186.824 → 188.160
agent_rpm_amd64_fips -10.23 KiB (0.01% reduction) 175.731 → 175.721 → 176.600
agent_rpm_arm64 -8.96 KiB (0.01% reduction) 168.625 → 168.616 → 169.930
agent_rpm_arm64_fips -6.83 KiB (0.00% reduction) 159.172 → 159.165 → 160.550
agent_suse_amd64 -5.39 KiB (0.00% reduction) 186.830 → 186.824 → 188.160
agent_suse_amd64_fips -10.23 KiB (0.01% reduction) 175.731 → 175.721 → 176.600
agent_suse_arm64 -8.96 KiB (0.01% reduction) 168.625 → 168.616 → 169.930
agent_suse_arm64_fips -6.83 KiB (0.00% reduction) 159.172 → 159.165 → 160.550
docker_agent_amd64 neutral 276.622 MiB → 277.400
docker_agent_arm64 +15.32 KiB (0.01% increase) 264.050 → 264.065 → 266.040
docker_agent_jmx_amd64 -3.21 KiB (0.00% reduction) 345.262 → 345.258 → 346.020
docker_agent_jmx_arm64 +14.66 KiB (0.00% increase) 328.668 → 328.682 → 330.660
docker_cluster_agent_amd64 +2.14 KiB (0.00% increase) 63.994 → 63.996 → 64.490
docker_cluster_agent_arm64 -4.78 KiB (0.01% reduction) 60.256 → 60.252 → 61.170
docker_cws_instrumentation_amd64 neutral 2.994 MiB → 3.330
docker_cws_instrumentation_arm64 neutral 2.726 MiB → 3.090
docker_dogstatsd_amd64 neutral 15.031 MiB → 15.820
docker_dogstatsd_arm64 -2.41 KiB (0.02% reduction) 14.356 → 14.354 → 14.830
dogstatsd_deb_amd64 neutral 7.947 MiB → 8.790
dogstatsd_deb_arm64 neutral 6.826 MiB → 7.710
dogstatsd_rpm_amd64 neutral 7.958 MiB → 8.800
dogstatsd_suse_amd64 neutral 7.958 MiB → 8.800
iot_agent_deb_amd64 neutral 11.290 MiB → 12.040
iot_agent_deb_arm64 neutral 9.650 MiB → 10.450
iot_agent_deb_armhf neutral 9.843 MiB → 10.620
iot_agent_rpm_amd64 neutral 11.309 MiB → 12.060
iot_agent_suse_amd64 neutral 11.309 MiB → 12.060

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

Labels

long review PR is complex, plan time to review it team/agent-runtimes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants