Skip to content

fix: measure gzip sizes at level 9 on every Python - #449

Merged
JuroOravec merged 1 commit into
mainfrom
fix/gzip-level-9-on-python-315
Oct 28, 2026
Merged

JuroOravec merged 1 commit into
mainfrom
fix/gzip-level-9-on-python-315

Conversation

@JuroOravec

Copy link
Copy Markdown
Member

What this fixes

test_command_palette_assets_stay_within_the_family_budgets fails in the macOS and Windows Python 3.15 cells, for example on #438, with assert 20557 < (20 * 1024). The cause is that Python 3.15 lowered the default level of gzip.compress and gzip.GzipFile from 9 to 6, so the same bytes compress larger there.

What changes

Every place that compares or records a gzip size now passes compresslevel=9:

  • the citry_ui asset report;
  • the i18n client size tests;
  • scripts/protocol_runtime_baseline.py;
  • the client and i18n benchmarks;
  • the example project archive. Its .sha256 file would otherwise differ by Python version.

A new test checks that the asset report measures at level 9. Every gzip call in packages/, scripts/, benchmarks/, examples/ and docs_site/ was checked; the zlib.compress(..., 9) calls in the docs already name the level.

Evidence

  • The asset-report, i18n-client and archive tests pass: 59 passed. ruff passes.
  • The 3.15 cells in this PR's CI are the real check. Cargo is left to CI.

Note on headroom

On main the palette family has 91 bytes of gzip headroom and 55 bytes of brotli headroom. #446 grows the palette past both budgets, so #446 will be trimmed separately.

🤖 Generated with Claude Code

Python 3.15 lowered the default level of gzip.compress and gzip.GzipFile
from 9 to 6. The asset budgets were set at level 9, so on Python 3.15
the same CCommandPalette bytes measured 20557 gzip bytes instead of
20389 and failed the 20480-byte budget, in the macOS and Windows 3.15
cells only (the Linux 3.15 cell fails earlier, at install). Main's
palette assets have not grown since before #424.

Every place that compares or records a gzip size now names level 9:
the citry_ui asset report, the i18n client size tests, the protocol
runtime baseline script, the client and i18n benchmarks, and the example
project archive (whose checksum would otherwise differ by Python
version). A test checks that the asset report measures at level 9.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JuroOravec
JuroOravec merged commit 5baffd6 into main Oct 28, 2026
25 of 34 checks passed
@JuroOravec
JuroOravec deleted the fix/gzip-level-9-on-python-315 branch October 28, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant