Skip to content

Solomus - #50

Merged
merkalev merged 7 commits into
accelerationfrom
solomus
Aug 26, 2026
Merged

Solomus#50
merkalev merged 7 commits into
accelerationfrom
solomus

Conversation

@merkalev

Copy link
Copy Markdown
Collaborator

No description provided.

The Q1-larger-than-Q2 inversion reported in roadmap 5b predates the
2.1/2.2 ladder retunes and no longer reproduces on flat, gradient, or
noisy content. Tick the item and guard it with
test_lossy_size_monotonic_in_quality so it cannot silently return.
Lossy quantized coefficient statistics diverge sharply by subband
(large LL magnitudes, mostly-zero HH), so the RC now walks dyadic
segments with per-band zero-run and threshold models. Measured on the
forced-wavelet bench: 37701 to 37530 bytes at equal PSNR.

Lossless stays on the single-context flag-3 stream: splitting its
near-uniform 5/3 statistics cost more to context fragmentation than it
saved. Flags 3 and 4 remain byte-compatible with 2.2.4 files; the
decoder accepts 3 through 6 and derives segment layout from the flag.
Predictive residuals now compete as an RC candidate during scoring:
signed residuals through the shared coefficient models, per-predictor
context slots, two adaptive bits per predictor kind. Winning payloads
ship with tile entropy byte 2; the decoder reconstructs the classic
predictive payload from the RC stream and validates stream length.
Noise-heavy forced-predictive bench: 92314 to 67853 bytes per image.

Palette stays on zstd: index streams are near-uniform so the range
coder has nothing to model there.

Also fixes a latent MinGW-only heap corruption the new stress runs
exposed: thread_local zstd contexts wrapped in destroying unique_ptr
crash at worker-thread exit because emutls tears down TLS storage
during pthread key cleanup. Contexts are now intentionally leaked
(one bounded allocation per thread). Dr.Memory reports zero errors
on the previously failing workload; 0 crashes in 120 hammer runs.

Hardens RangeDecoder with a consumption limit derived from payload
size so hostile or desynced streams throw instead of reading past
the container.
Resolves the roadmap item by choosing the documented-deferral path:
tiles are independently decodable, layer bookkeeping would touch every
container invariant at once, and embedded progressive streams move to
the WIMF 3.0 container break. Also refreshes the coding-modes section
for range-coder entropy (flags 3/4/6, predictive entropy byte 2).
Companion to the predictive range-coder commit: entropy byte 2 tiles
now raise a clear native-required message instead of falling into the
zstd decompressor and failing with a confusing expansion error.
@merkalev
merkalev merged commit 1177b41 into acceleration Aug 26, 2026
36 checks passed
@merkalev
merkalev deleted the solomus branch August 26, 2026 06:27
@merkalev
merkalev restored the solomus branch August 26, 2026 06:27
@merkalev
merkalev deleted the solomus branch August 26, 2026 06:27
@merkalev
merkalev restored the solomus branch August 26, 2026 06:30
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