Skip to content

Crinkler

Linking and compression share the same byte budget

Crinkler combines a Windows linker and compressor for small executable programs. By arranging compiled code and data together, it helps demoscene authors spend more of a 4K intro’s limited space on the production itself.

Crinkler makes the linker and compressor work together. A normal linker joins compiled pieces into an executable program. Crinkler also arranges and compresses those pieces, producing a Windows executable intended to occupy only a few kilobytes.

Its authors are Aske Simon Christensen, Blueberry of Loonies, and Rune L. H. Stubbe, Mentor of TBC. The manual dates its first release to 21 July 2005. It became part of the toolkit for size coding, including the 4K intro Elevated.

Object files and libraries feed a combined linking, arrangement and compression stage, which produces a Windows executable with startup code, a decoder and packed data.
Original schematic of Crinkler’s combined workflow. The arrangement of compiled pieces can change how well they compress; this is not a capture of the program.

Every supporting byte counts

An executable needs more than the instructions that draw a scene. It also needs enough information for Windows to load it, code to find the functions it uses, and a way to decompress its contents. In a 4K intro, those supporting bytes occupy a substantial part of the allowance.

Crinkler can reorder sections before compression and model patterns across the result. Its manual describes context modelling: predictions about the next bit depend on the bits that precede it. The search can be expensive during preparation, while the delivered program contains what is needed to decode the chosen representation.

Find the expensive parts

The project supplies an HTML report to help authors inspect where compressed space goes. That changes the question from “which function is longest?” to “which parts cost most after compression?” A change that shortens source code need not shrink the delivered file.

Crinkler’s compatibility also has a history. The manual records fixes for changing Windows and driver behaviour, and a recompression facility for older productions. Version 3.0 introduced an SSE4.2 processor requirement. A modern build’s requirements should therefore not be read back into a 2005 intro.

kkrunchy tackles a related task for larger intros, but operates on an executable that has already been linked. Crinkler makes the arrangement of the program part of compression itself.

Sources

Checked. Verified against primary sources and signed off by a person.