mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:40:50 +01:00
[PR #1081] [MERGED] inflate: expand repeated matches in blocks and batch Adler reductions #1115
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1115
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1081
Author: @Kadamitas
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @QemmHD
Base:
main← Head:perf/inflate-output📝 Commits (1)
f7d1862inflate: expand repeated matches in blocks and batch Adler reductions📊 Changes
2 files changed (+41 additions, -5 deletions)
View changed files
📝
runtime/src/shader_library.h(+25 -5)📝
runtime/test/shader_library_test.cpp(+16 -0)📄 Description
Claimed in the coordination issue as: RT-INFLATE-MATCH-COPY.
Depends on: none
What and why
Shader loading and DirectStorage use the same CPU inflater. This change grows the output buffer once for each length/distance match. A one-byte pattern uses a fill. Longer patterns start with the available prefix and copy completed, non-overlapping spans until the match is complete. Adler-32 reduces its two accumulators every 5,552 bytes, the maximum safe interval for 32-bit sums.
Tested
The Windows x64 MSVC shader-library suite passed, including a new case that expands overlapping one- and three-byte patterns across multiple checksum boundaries.
An independent CPU benchmark compared the parent and proposed code on 114 synthetic stored, fixed and dynamic streams. Both produced the expected decoded bytes and the same digest across 2,136 checks covering success, partial output and errors. Each batch expanded 4,493,676 bytes. In two runs per version the median fell from 12.580–12.596 ms to 3.068–3.076 ms, about 4.1× faster for this CPU workload.
The semantic suite ran 6,165 tests across 470 files. Two files failed because the SPIR-V assembler and validator were missing from the test environment. On the rebased branch, rerunning those files with both tools on
PATHpassed all 12 tests intest_sopc_validationand all 7 intest_unary_f16_validation.GPUs tested: n/a (CPU-only change)
AI-assisted: yes
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.