Skip to content

Windows: update zlib-ng to 2.2.5 (PGO builds with Visual Studio 17.11 decompress wrongly on AVX-512 CPUs) #161735

Open

Description

@maikschulze

Bug report

On Windows, a PGO build made with Visual Studio 17.11 (MSVC 14.41, MSC v.1941) decompresses deflate data wrongly on CPUs with AVX-512 (here a Ryzen 9 7950X): test_zlib (test_decompressmaxlen*: "incorrect data check"), test_gzip (test_write_seek_write: "CRC check failed") and test_tarfile fail. The checks are right, the data is wrong: raw inflate of an intact file returns different bytes than Linux gzip, and zlib.crc32() is correct. Builds without PGO and the python.org builds (newer compiler) are fine.

This is zlib-ng/zlib-ng#1883: MSVC from Visual Studio 17.11 miscompiles GET_CHUNK_MAG() (arch/x86/chunkset_avx512.c, used for back-references shorter than 32 bytes). zlib-ng 2.2.5 works around it (zlib-ng/zlib-ng#1884) by turning optimization off for that function for Visual Studio before 17.13 (_MSC_VER < 1943). main, 3.15 and 3.14 bundle 2.2.4.

As discussed on #131438, I would like to request updating the Windows build to zlib-ng 2.2.5. 2.2.5 also checks for ZMM support before using the VPCLMULQDQ CRC code that CPython builds (zlib-ng/zlib-ng#1932) and reverts a deflate_medium change that regressed performance (zlib-ng/zlib-ng#1938). I'm happy to test a build on the affected machine.

cc @zooba

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Activity

  1. StanFromIreland commented on Nov 10, 2026

    @StanFromIreland
    Member
  2. added a commit that references this issue on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsbuildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions