Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/znippy-zoomies

.nornir/assets/codec_stack.svg

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 720" font-family="'DejaVu Sans', 'Segoe UI', sans-serif">
  <defs>
    <linearGradient id="board" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0" stop-color="#0b1c2e"/><stop offset="1" stop-color="#06111d"/>
    </linearGradient>
    <linearGradient id="chip" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0" stop-color="#14384f"/><stop offset="1" stop-color="#0e2a3e"/>
    </linearGradient>
    <linearGradient id="rail" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0" stop-color="#173d57"/><stop offset="1" stop-color="#0c2438"/>
    </linearGradient>
    <linearGradient id="core" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0" stop-color="#123f3a"/><stop offset="1" stop-color="#0a2622"/>
    </linearGradient>
    <marker id="arrow" markerWidth="9" markerHeight="9" refX="7" refY="4.5" orient="auto">
      <path d="M0,0 L9,4.5 L0,9 Z" fill="#6fd3f5"/>
    </marker>
  </defs>

  <rect x="0" y="0" width="1200" height="720" fill="url(#board)"/>
  <g stroke="#143a52" stroke-width="1"><line x1="0" y1="80" x2="1200" y2="80"/></g>
  <g fill="#16415c"><circle cx="40" cy="40" r="2"/><circle cx="1160" cy="40" r="2"/><circle cx="40" cy="690" r="2"/><circle cx="1160" cy="690" r="2"/></g>

  <text x="40" y="40" fill="#eaf6ff" font-size="22" font-weight="700">the codec stack</text>
  <text x="240" y="40" fill="#9fc9e0" font-size="15">five parallel decoders for <tspan fill="#bfe6ff" font-weight="700">stock formats</tspan> &#8212; one shared DEFLATE core, one shared split scanner</text>
  <text x="40" y="64" fill="#7fa8bf" font-size="12.5">every format is a set of <tspan fill="#bfe6ff">independently decodable segments</tspan>: <tspan fill="#7CFFB2">scan boundaries &#8594; fan across N workers &#8594; write</tspan> &#8212; the three-move gatling pipeline</text>

  <!-- ===== per-codec containers ===== -->
  <text x="52" y="112" fill="#8fd6c9" font-size="13" font-weight="700">PER-CODEC &#8212; container parse + boundary discovery + extraction</text>

  <!-- lgz -->
  <rect x="52" y="126" width="256" height="118" rx="9" fill="url(#chip)" stroke="#5aa6cf" stroke-width="1.8"/>
  <text x="70" y="150" fill="#bfe6ff" font-size="14.5" font-weight="700">lgz</text>
  <text x="118" y="150" fill="#9fc9e0" font-size="11.5">multi-member gzip .gz</text>
  <text x="70" y="174" fill="#cfe6f5" font-size="11">split at member boundaries</text>
  <text x="70" y="192" fill="#7fa8bf" font-size="10.5" font-family="'DejaVu Sans Mono', monospace">decompress_tar_gz_filter</text>
  <text x="70" y="208" fill="#7fa8bf" font-size="10" font-family="'DejaVu Sans Mono', monospace">lgz/src/lib.rs:63</text>
  <text x="70" y="228" fill="#5d7d92" font-size="10" font-family="'DejaVu Sans Mono', monospace">chunk.rs:29 &#183; deflate_scan.rs:92</text>

  <!-- ljar -->
  <rect x="324" y="126" width="256" height="118" rx="9" fill="url(#chip)" stroke="#5aa6cf" stroke-width="1.8"/>
  <text x="342" y="150" fill="#bfe6ff" font-size="14.5" font-weight="700">ljar</text>
  <text x="386" y="150" fill="#9fc9e0" font-size="11.5">JAR .jar</text>
  <text x="342" y="174" fill="#cfe6f5" font-size="11">Central-Directory scan &#8594; per-entry</text>
  <text x="342" y="192" fill="#7fa8bf" font-size="10.5" font-family="'DejaVu Sans Mono', monospace">decompress_jar</text>
  <text x="342" y="208" fill="#7fa8bf" font-size="10" font-family="'DejaVu Sans Mono', monospace">ljar/src/lib.rs:65 &#183; reader.rs:122</text>
  <text x="342" y="228" fill="#5d7d92" font-size="10" font-family="'DejaVu Sans Mono', monospace">deflate_scan.rs:16</text>

  <!-- lzip -->
  <rect x="596" y="126" width="256" height="118" rx="9" fill="url(#chip)" stroke="#5aa6cf" stroke-width="1.8"/>
  <text x="614" y="150" fill="#bfe6ff" font-size="14.5" font-weight="700">lzip-parallel</text>
  <text x="722" y="150" fill="#9fc9e0" font-size="11.5">ZIP .zip</text>
  <text x="614" y="174" fill="#cfe6f5" font-size="11">near-verbatim twin of ljar (JAR &#8834; ZIP)</text>
  <text x="614" y="192" fill="#7fa8bf" font-size="10.5" font-family="'DejaVu Sans Mono', monospace">decompress_zip</text>
  <text x="614" y="208" fill="#7fa8bf" font-size="10" font-family="'DejaVu Sans Mono', monospace">lzip-parallel/src/lib.rs:58</text>
  <text x="614" y="228" fill="#5d7d92" font-size="10" font-family="'DejaVu Sans Mono', monospace">reader.rs:172 &#183; deflate_scan.rs:16</text>

  <!-- lbzip2 (own decode path) -->
  <rect x="868" y="126" width="284" height="118" rx="9" fill="url(#chip)" stroke="#5aa6cf" stroke-width="1.8"/>
  <text x="886" y="150" fill="#bfe6ff" font-size="14.5" font-weight="700">lbzip2</text>
  <text x="954" y="150" fill="#9fc9e0" font-size="11.5">bzip2 .bz2</text>
  <text x="886" y="174" fill="#cfe6f5" font-size="11">scan block-start bit patterns &#8594;</text>
  <text x="886" y="190" fill="#cfe6f5" font-size="11">independent BWT/MTF/Huffman blocks</text>
  <text x="886" y="212" fill="#ffcf6f" font-size="10.5">own decode path (not DEFLATE)</text>
  <text x="886" y="230" fill="#5d7d92" font-size="10" font-family="'DejaVu Sans Mono', monospace">block_scan.rs:85,221 &#183; chunk.rs:35</text>

  <!-- arrows down into shared -->
  <g stroke="#6fd3f5" stroke-width="2.4">
    <line x1="180" y1="244" x2="180" y2="300" marker-end="url(#arrow)"/>
    <line x1="452" y1="244" x2="452" y2="300" marker-end="url(#arrow)"/>
    <line x1="724" y1="244" x2="724" y2="300" marker-end="url(#arrow)"/>
  </g>
  <text x="895" y="270" fill="#7fa8bf" font-size="10.5">(bzip2 has no DEFLATE stage)</text>

  <!-- ===== shared split scanner ===== -->
  <rect x="52" y="308" width="800" height="88" rx="10" fill="url(#core)" stroke="#4fd0b0" stroke-width="1.8"/>
  <text x="70" y="332" fill="#9df0dc" font-size="13.5" font-weight="700">SHARED &#8212; candidate-split flush-boundary SIMD scanner</text>
  <text x="70" y="354" fill="#cfe6f5" font-size="11.5">split_boundaries_parallel: N&#8722;1 workers each pick a nominal offset (candidate),</text>
  <text x="70" y="371" fill="#cfe6f5" font-size="11.5">then forward-scan the <tspan font-family="'DejaVu Sans Mono', monospace" fill="#9df0dc">00 00 FF FF</tspan> full-flush pattern to the true validated border</text>
  <text x="70" y="389" fill="#7fa8bf" font-size="10" font-family="'DejaVu Sans Mono', monospace">linflate/src/deflate_scan.rs:25,57,201 &#183; per-codec re-exports</text>

  <!-- config/law rail -->
  <rect x="868" y="308" width="284" height="88" rx="10" fill="url(#rail)" stroke="#cf5a5a" stroke-width="1.6"/>
  <text x="886" y="332" fill="#ffc9c9" font-size="13" font-weight="700">THE LAW</text>
  <text x="886" y="354" fill="#f0d6d6" font-size="11">All five: no rayon, one shared engine.</text>
  <text x="886" y="372" fill="#e9cccc" font-size="11">ljar/lzip ported off rayon pools;</text>
  <text x="886" y="389" fill="#e9cccc" font-size="11">guard walks the whole workspace.</text>

  <line x1="452" y1="396" x2="452" y2="440" stroke="#6fd3f5" stroke-width="2.4" marker-end="url(#arrow)"/>

  <!-- ===== shared inflate core ===== -->
  <rect x="52" y="448" width="800" height="120" rx="10" fill="url(#core)" stroke="#4fd0b0" stroke-width="2.2"/>
  <text x="70" y="474" fill="#9df0dc" font-size="15" font-weight="700">SHARED &#8212; linflate: the one raw-DEFLATE decode core</text>
  <text x="70" y="496" fill="#cfe6f5" font-size="11.5">SIMD match-copy &#183; branchless refill &#183; segment-aware. lgz / ljar / lzip-parallel all route every byte-decode through it.</text>
  <g font-family="'DejaVu Sans Mono', monospace" font-size="10.5">
    <rect x="70" y="510" width="230" height="24" rx="4" fill="#123448" stroke="#6fd3f5" stroke-width="1"/>
    <text x="80" y="526" fill="#bfe6ff">inflate_segment / _with_prefix</text>
    <rect x="312" y="510" width="180" height="24" rx="4" fill="#123448" stroke="#6fd3f5" stroke-width="1"/>
    <text x="322" y="526" fill="#bfe6ff">inflate_to_vec</text>
    <rect x="504" y="510" width="200" height="24" rx="4" fill="#123448" stroke="#6fd3f5" stroke-width="1"/>
    <text x="514" y="526" fill="#bfe6ff">OVERWRITE_HEADROOM</text>
  </g>
  <text x="70" y="556" fill="#5d7d92" font-size="10" font-family="'DejaVu Sans Mono', monospace">linflate/src/lib.rs:81,93,108,206 &#183; consolidated 2026-06 (engine 574eb00, scanner fe2c895)</text>

  <!-- ===== the fan + writer ===== -->
  <rect x="52" y="584" width="800" height="80" rx="10" fill="url(#chip)" stroke="#5aa6cf" stroke-width="1.6"/>
  <text x="70" y="608" fill="#bfe6ff" font-size="13" font-weight="700">FAN &#8594; WRITE &#8212; gatling_for_each across all cores, then parwrite (each worker writes its own output)</text>
  <text x="70" y="630" fill="#cfe6f5" font-size="11">the "Fan" move (linflate fast loop) is parallel &amp; fast; the writer tail was the limiter &#8212; now removed by parwrite.</text>
  <text x="70" y="650" fill="#7fa8bf" font-size="10" font-family="'DejaVu Sans Mono', monospace">gatling/src/gatling_forkjoin.rs:60 &#183; gatling/src/parwrite.rs (on master)</text>

  <!-- legend -->
  <rect x="868" y="448" width="284" height="216" rx="10" fill="url(#rail)" stroke="#2c6485" stroke-width="1.4"/>
  <text x="886" y="472" fill="#bfe6ff" font-size="13" font-weight="700">the honest boundary</text>
  <text x="886" y="498" fill="#9df0dc" font-size="11.5" font-weight="700">SHARED (green):</text>
  <text x="886" y="516" fill="#cfe6f5" font-size="11">&#8226; raw inflate engine (linflate)</text>
  <text x="886" y="533" fill="#cfe6f5" font-size="11">&#8226; candidate-split flush scanner</text>
  <text x="886" y="558" fill="#8fd6c9" font-size="11.5" font-weight="700">PER-CODEC (blue):</text>
  <text x="886" y="576" fill="#cfe6f5" font-size="11">&#8226; container parse (member /</text>
  <text x="896" y="592" fill="#cfe6f5" font-size="11">central-dir / ZIP-entry / block)</text>
  <text x="886" y="610" fill="#cfe6f5" font-size="11">&#8226; extraction / writer plumbing</text>
  <text x="886" y="636" fill="#7fa8bf" font-size="10">bzip2 is fully per-codec (BWT,</text>
  <text x="886" y="650" fill="#7fa8bf" font-size="10">no DEFLATE) &#8212; heavier decode,</text>

  <text x="40" y="690" fill="#5d7d92" font-size="11">znippy-zoomies &#183; decompressors &#8212; see decompressors-design.md / benchmarks.md</text>
</svg>