Repository navigation
Conversation
|
Tested 9c3ba87 on Windows 11. On a synthetic 1 MiB buffer filled with 0xff, the median time for a full inflate fell from 3,428.5 µs on parent 867d922 to 1,462.7 µs on this head (2.34× faster). I compressed the buffer once with Python zlib at its default level. I compiled the same timing loop against each header with MSVC Both AI-assisted. |
|
Independent native Linux check of For a boundary check beyond the stored-block fixtures, I constructed a 5,552-byte prefix whose Python Full inflate timings with GCC
CPU-only synthetic checks; no game data. AI-assisted (Codex). |
|
Tested
|
|
Tested 9c3ba87 merged onto main 867d922 (clean merge) on NVIDIA GeForce RTX 4070, driver 621.24, native Windows 11 Pro 26300, MSVC 14.44.35207, Ninja RelWithDebInfo: pass.
No game data used. AI-assisted (Claude Code). |
|
Tested 9c3ba87 on NVIDIA GeForce RTX 5060 Ti, driver 621.24, Windows 11 Pro build 26300, VS 18 Build Tools (MSVC), Ninja, RelWithDebInfo: pass.
Built the PR head, not merged onto main. Synthetic only, no game files. AI-assisted (Claude Code). |
Claimed in the coordination issue as: PERF-ZLIB-ADLER-BATCH.
What and why
zlib_inflatereduces both Adler-32 sums modulo 65521 after every decompressed byte. This puts two dependent modulo operations per byte on the runtime's shader-container extraction path. Reduce the sums after at most 5552 bytes instead; the checksum value, malformed-stream rejection, output limit and public API stay the same.The code states the 32-bit worst-case bound used by zlib's Adler-32 implementation: start both sums at 65520, then add 5552 bytes of 255 without overflowing. No new dependency or architecture-specific instructions.
Full
zlib_inflatetimings, not just the checksum loop, on synthetic inputs:MSVC
/O2 /EHsc /std:c++20, i7-12700K, Windows 11 Pro N 26200. Medians of five separate process runs, alternating before/after order; each case inflates 64 MiB total, reusing the output vector after a warm-up. Compression and file reads are outside the timing. All 26 cases improved (32 B to 1 MiB, stored/fixed/default compression); the least gain was 1.10x for a 32-byte literal-heavy case. No game corpus or game startup was measured; these numbers describe these synthetic inputs only.Tested
Revision
9c3ba87aa15e4e7e3fe8beb0d749508807701e2c, based on867d922f09b86583859796a174df89555fb32da8.RelWithDebInfo, MSVC 19.44.35230:ctest --test-dir <build> -R '^(shader_library|mods)$' --output-on-failure: 2/2 pass. The new test adds 33 cases with literal Python zlib checksums, covering empty output, 5552-byte reduction boundaries, two batches, 65535-byte deflate-block boundaries, and 1 MiB. Zero, 0xff and byte-ramp patterns; each checksum byte corrupted separately and undersized output limits checked. Existing fixed/dynamic, extraction and lookup checks pass.git diff --checkandpython -I scripts/check_no_game_data.pyon both changed source files and the PR/report text: pass.CPU-only change; available GPU is NVIDIA RTX 3070, driver 610.88, not used. Linux/macOS and the game corpus were not run.
Overlap and integration
No unmerged implementation dependency. Refreshed #8504 and all-state PR searches before claiming and before publication.
git merge-treeis clean with current main and #7734, #8358, #8364, #8254, #8348, #8114 and #8445. Separate combined shader-library test builds with #7734 (Huffman validity) and #8358 (SHA-256) pass.The header and shader-library tests also merge cleanly with #7180's DirectStorage error-reporting changes, and that combined shader-library test passes. #7180 itself has pre-existing conflicts against main in
docs/README.md,docs/runtime_imports.mdandruntime/CMakeLists.txt, none touched here; no full DirectStorage integration build was run.AI-assisted: yes (Codex).
Checklist
docs/design.mdtranslator-contract requirement is not applicable.