<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on CuriousCoding</title><link>https://curiouscoding.nl/posts/</link><description>Recent content in Posts on CuriousCoding</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 15 Oct 2026 00:00:00 +0200</lastBuildDate><atom:link href="https://curiouscoding.nl/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>Comparing PHastR and PtrHash</title><link>https://curiouscoding.nl/posts/phastr-and-ptrhash/</link><pubDate>Wed, 14 Oct 2026 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/phastr-and-ptrhash/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#bucket-placement" &gt;Bucket placement&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#bumping" &gt;Bumping&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#query-speed" &gt;Query speed&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#space-usage" &gt;Space usage&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#construction-speed" &gt;Construction speed&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#overview" &gt;Overview&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#ideas-for-improving-ptrhash" &gt;Ideas for improving PtrHash&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#levels" &gt;Levels&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Sebastiano Vigna just preprinted &lt;a href="https://github.com/vigna/sux-rs" class="external-link" target="_blank" rel="noopener"&gt;PHastR&lt;/a&gt; (&lt;a href="#citeproc_bib_item_7"&gt;Vigna 2026&lt;/a&gt;), a new, faster version of&#10;PHast and PHast+ (&lt;a href="#citeproc_bib_item_1"&gt;Beling and Sanders 2025&lt;/a&gt;, &lt;a href="#citeproc_bib_item_2"&gt;n.d.&lt;/a&gt;).&#10;In the evaluations, it is a direct improvement over PHast+:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;slightly smaller,&lt;/li&gt;&#10;&lt;li&gt;2\(\times\) to \(3\times\) faster to build,&lt;/li&gt;&#10;&lt;li&gt;faster queries.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;This is a quick note comparing the PHast line of work to &lt;a href="https://github.com/RagnarGrootKoerkamp/ptrhash" class="external-link" target="_blank" rel="noopener"&gt;PtrHash&lt;/a&gt; (&lt;a href="#citeproc_bib_item_4"&gt;Groot Koerkamp 2025&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>SimdQuickHeap: the fastest priority queue</title><link>https://curiouscoding.nl/posts/quickheap/</link><pubDate>Tue, 29 Sep 2026 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/quickheap/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#background" &gt;Background&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#priority-queue" &gt;Priority queue&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#binary-heap" &gt;Binary heap&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#d-ary-heaps" &gt;D-ary heaps&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#other-heaps" &gt;Other heaps&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#literature-on-quickheaps" &gt;Literature on Quickheaps&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#optimal-incremental-sorting" &gt;Optimal incremental sorting&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#quickheap" &gt;Quickheap&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#randomized-quickheaps" &gt;Randomized quickheaps&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#implementation" &gt;Bucket-based implementation&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#data-structure" &gt;Data structure&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#push" &gt;Push&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#pop" &gt;Pop&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#partition" &gt;Partition&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#results" &gt;Results&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#libraries" &gt;Libraries&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#datasets" &gt;Datasets&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#results" &gt;Results&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;&lt;strong&gt;Backlinks&lt;/strong&gt;: &lt;a href="https://bsky.app/profile/curiouscoding.nl/post/3mko6y5k2f22w" class="external-link" target="_blank" rel="noopener"&gt;bsky&lt;/a&gt;, &lt;a href="https://x.com/curious_coding/status/2049441073718518046" class="external-link" target="_blank" rel="noopener"&gt;X&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;A paper on the SimdQuickHeap (&lt;a href="https://github.com/ragnargrootkoerkamp/quickheap" class="external-link" target="_blank" rel="noopener"&gt;github:RagnarGrootKoerkamp/QuickHeap&lt;/a&gt;)&#10;was published at ESA 2026 (&lt;a href="https://doi.org/10.48550/ARXIV.2604.25681" class="external-link" target="_blank" rel="noopener"&gt;DOI&lt;/a&gt;, &lt;a href="https://curiouscoding.nl/papers/simdquickheap.pdf" &gt;PDF&lt;/a&gt;), where it won a best paper award:&lt;/p&gt;</description></item><item><title>On the Energy Usage for Navier-Stokes</title><link>https://curiouscoding.nl/posts/energy-usage-of-navier-stokes/</link><pubDate>Wed, 16 Sep 2026 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/energy-usage-of-navier-stokes/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#later-addition" &gt;Later addition&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#input-data" &gt;Input data&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#electricity-cost-and-coal-usage" &gt;Electricity cost and coal usage&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#energy-to-gpus" &gt;Energy to GPUs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#agents-per-gpu" &gt;Agents per GPU&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#tokens-per-second" &gt;Tokens per second&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#extrapolating" &gt;Extrapolating&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#putting-things-in-perspective" &gt;Putting things in perspective&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#d41d8c" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; &lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;As they&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; say,&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;a mathematician is a machine for turning coffee into theorems.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;These days, we can extend this into&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;an LLM is a machine for turning energy into theorems.&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>Possible improvements to the QuickHeap</title><link>https://curiouscoding.nl/posts/quickheap-improvements/</link><pubDate>Fri, 11 Sep 2026 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/quickheap-improvements/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#a-history-independent-quickheap" &gt;A history independent quickheap&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#history-independent-data-structures" &gt;History independent data structures&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2&lt;/span&gt; &lt;a href="#history-independent-list-labeling" &gt;History independent list labeling&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.3&lt;/span&gt; &lt;a href="#history-independent-quickheap" &gt;History independent quickheap&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.4&lt;/span&gt; &lt;a href="#duplicate-elements-and-randomized-weights" &gt;Duplicate elements and randomized weights&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.5&lt;/span&gt; &lt;a href="#stronger-quickheaps" &gt;Stronger quickheaps&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.6&lt;/span&gt; &lt;a href="#order-of-elements" &gt;Order of elements&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#quickheap-with-decreasekey" &gt;QuickHeap with &lt;code&gt;decreaseKey&lt;/code&gt;&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#some-theoretical-bounds" &gt;Some theoretical bounds&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#the-buffer-heap" &gt;The buffer heap&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#deletion-tokens-for-the-quickheap" &gt;Deletion tokens for the quickheap&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.4&lt;/span&gt; &lt;a href="#bloom-filters" &gt;Bloom filters&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.5&lt;/span&gt; &lt;a href="#counting-bloom-filters" &gt;Counting bloom filters&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#the-simd-radix-heap" &gt;The SIMD radix heap&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#adding-simd-to-the-radix-heap" &gt;Adding SIMD to the radix heap&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#two-level-radix-heap" &gt;Two-level radix heap&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Here, we&amp;rsquo;ll discuss some possible improvements to the SimdQuickHeap&#10;(&lt;a href="#citeproc_bib_item_3"&gt;Breitling, Groot Koerkamp, and Williams 2026&lt;/a&gt;) (&lt;a href="https://curiouscoding.nl/posts/quickheap/" &gt;previous post&lt;/a&gt;, &lt;a href="https://curiouscoding.nl/papers/simdquickheap.pdf" &gt;paper PDF&lt;/a&gt;).&#10;Most of these came up last week during ESA, after William Kuszmaul gave a keynote on&#10;&lt;em&gt;history independent data structures&lt;/em&gt; (specifically, layered list labelling&#10;(&lt;a href="#citeproc_bib_item_2"&gt;Bender et al. 2024&lt;/a&gt;)) and Marvin Williams presented our work.&lt;/p&gt;</description></item><item><title>Scans of some rare papers</title><link>https://curiouscoding.nl/posts/scans/</link><pubDate>Tue, 25 Aug 2026 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/scans/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#johnson--1977--efficient-special-purpose-priority-queues" &gt;Johnson (1977): Efficient special-purpose priority queues&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This is a collection of some PDFs of hard-to-find papers.&lt;/p&gt;&#10;&lt;h3 id="johnson--1977--efficient-special-purpose-priority-queues"&gt;&#10; Johnson (1977): Efficient special-purpose priority queues&#10; &lt;a class="heading-link" href="#johnson--1977--efficient-special-purpose-priority-queues"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;&lt;a href="https://curiouscoding.nl/scans/radix-heap-johnson-1977.pdf" &gt;&lt;strong&gt;PDF&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;The paper introducing the first variant of the &lt;strong&gt;radix heap&lt;/strong&gt;.&#10;Found on &lt;a href="https://archive.org/details/proceedings1977alle_0/page/4/mode/2up" class="external-link" target="_blank" rel="noopener"&gt;archive.org&lt;/a&gt; with help from the University of Illinois library.&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;Johnson, D. B. 1977. “Efficient Special-Purpose Priority Queues.” In &lt;i&gt;Proceedings of the 15th Annual Allerton Conference on Communications, Control, and Computing&lt;/i&gt;, 1–7.&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>NtHash3: first ideas</title><link>https://curiouscoding.nl/posts/nthash-revisited/</link><pubDate>Sat, 01 Aug 2026 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/nthash-revisited/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#quick-introduction" &gt;Quick introduction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a-new-strategy" &gt;A new strategy&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#inverse-operation" &gt;Inverse operation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#some-more-variants" &gt;Some more variants&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#repeated-applications-of-f" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Repeated applications of \(f\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#collisions" &gt;Collisions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#consecutive-small-values" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Consecutive small values&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;div style="display:none;"&gt;&#10;&lt;p&gt;\[&#10;\newcommand{\rot}{\mathsf{rot}}&#10;\newcommand{\shift}{\mathsf{shift}}&#10;\]&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;This is the third post in (by now) a series of 3 posts on NtHash:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://curiouscoding.nl/posts/nthash/" &gt;NtHash1: making it perfect&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://curiouscoding.nl/posts/nthash2-collisions/" &gt;NtHash2: investigating collisions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://curiouscoding.nl/posts/nthash-revisited/" &gt;&lt;strong&gt;NtHash3: first ideas&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;hr&gt;&#10;&lt;p&gt;Previously, I have written on:&lt;/p&gt;</description></item><item><title>A seed-independent hash collision in GxHash</title><link>https://curiouscoding.nl/posts/gxhash-collision/</link><pubDate>Fri, 31 Jul 2026 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/gxhash-collision/</guid><description>&lt;p&gt;For a pangenome deduplication tool I&amp;rsquo;m working on (&lt;a href="https://github.com/RagnarGrootKoerkamp/pandedup" class="external-link" target="_blank" rel="noopener"&gt;pandedup&lt;/a&gt;), I&amp;rsquo;m using 128-bit&#10;hashes as &amp;ldquo;unique&amp;rdquo; identifiers of substrings.&lt;/p&gt;&#10;&lt;p&gt;Sadly, it turns out that &lt;code&gt;gxhash128&lt;/code&gt; (the 128-bit version of &lt;a href="https://github.com/ogxd/gxhash" class="external-link" target="_blank" rel="noopener"&gt;gxhash&lt;/a&gt;) has a hash collision between the two&#10;strings of length 88 below that only differ in 5 positions, &lt;em&gt;regardless&lt;/em&gt; of the value of the seed.&lt;/p&gt;&#10;&lt;p&gt;Looking at the strings, this clearly isn&amp;rsquo;t a &lt;em&gt;random&lt;/em&gt; collision. Those could be&#10;expected when doing \(2^{64}\) lookups in a dictionary of \(2^{64}\) keys, but my&#10;data is nowhere near that large.&lt;/p&gt;</description></item><item><title>Kayaking in Latvia: Engure, Rinda, and Irbe rivers</title><link>https://curiouscoding.nl/posts/latvia-kayaking-2026/</link><pubDate>Thu, 23 Jul 2026 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/latvia-kayaking-2026/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#the-route" &gt;The Route&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#prep" &gt;Prep&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#day-0" &gt;Day 0&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#day-1-engure-river-to-lake" &gt;Day 1: Engure river to lake&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#day-2-lake-plus-rinda-river-to-rinda" &gt;Day 2: Lake + Rinda river to Rinda&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#day-3-rinda-to-middle-of-irbe-river-plus-walk-to-ghost-town" &gt;Day 3: Rinda to middle of Irbe river + walk to ghost town&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#day-4-irbe-river-to-the-sea" &gt;Day 4: Irbe river to the sea&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#countryside" &gt;Countryside&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#logistics" &gt;Logistics&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#boats" &gt;Boats&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#water-drinks" &gt;Water / drinks&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#food-supplies" &gt;Food supplies&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#packing" &gt;Packing&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#additions-for-next-time" &gt;Additions for next time&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#bird-watching" &gt;Bird watching&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;figure class="float tiny"&gt;&lt;a href="https://curiouscoding.nl/ox-hugo/route.png"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/route.png"&#10;&#9;&#9;&#9;alt="Figure 1: An overview of the route we kayaked. (Click to enlarge.)"&gt;&lt;/a&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;&lt;span class="figure-number"&gt;Figure 1: &lt;/span&gt;An overview of the route we kayaked. (Click to enlarge.)&lt;/p&gt;&#10;&#9;&#9;&lt;/figcaption&gt;&#10;&lt;/figure&gt;</description></item><item><title>Sassy: fuzzy searching DNA sequences using SIMD</title><link>https://curiouscoding.nl/posts/sassy/</link><pubDate>Thu, 04 Jun 2026 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/sassy/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#why-should-you-care" &gt;Why should you care?&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#using-sassy" &gt;Using Sassy&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#the-cli" &gt;The CLI&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#rust-library" &gt;Rust library&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#python-bindings" &gt;Python bindings&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.4&lt;/span&gt; &lt;a href="#c-and-r-bindings" &gt;C and R bindings&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#problem-statement-approximate-string-matching" &gt;Problem statement: Approximate String Matching&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#overhang-when-the-pattern-extends-beyond-the-read" &gt;Overhang: when the pattern extends beyond the read&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#some-background" &gt;Some background&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#the-algorithm" &gt;The algorithm&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.1&lt;/span&gt; &lt;a href="#simd" &gt;SIMD&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.2&lt;/span&gt; &lt;a href="#sassy2" &gt;Sassy2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#results" &gt;Results&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.1&lt;/span&gt; &lt;a href="#sassy1" &gt;Sassy1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.2&lt;/span&gt; &lt;a href="#sassy2" &gt;Sassy2&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.3&lt;/span&gt; &lt;a href="#applications" &gt;Applications&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;div style="color:grey"&gt;&#10;&lt;p&gt;Discuss on &lt;a href="https://www.reddit.com/r/rust/comments/1twnnq0" style="color:grey"&gt;reddit&lt;/a&gt;.&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;Sassy is a tool for quickly searching short DNA patterns across large inputs that&#10;&lt;a href="https://github.com/rickbeeloo" class="external-link" target="_blank" rel="noopener"&gt;Rick Beeloo&lt;/a&gt; and myself have been working on over the past year.&#10;It just got published (&lt;a href="#citeproc_bib_item_3"&gt;Beeloo and Groot Koerkamp 2026b&lt;/a&gt;) (&lt;a href="https://curiouscoding.nl/papers/sassy.pdf" &gt;PDF&lt;/a&gt;, &lt;a href="https://doi.org/10.1093/bioinformatics/btag244" class="external-link" target="_blank" rel="noopener"&gt;DOI&lt;/a&gt;), and this blog post&#10;briefly outlines some possible applications and how we developed it.&#10;See also the &lt;a href="https://github.com/RagnarGrootKoerkamp/sassy" class="external-link" target="_blank" rel="noopener"&gt;GitHub readme&lt;/a&gt; and the &lt;a href="https://curiouscoding.nl/slides/sassy/slides/" &gt;slides&lt;/a&gt; for my &lt;a href="https://recomb-seq.github.io/seq2026/program" class="external-link" target="_blank" rel="noopener"&gt;RECOMB-Seq&lt;/a&gt; talk, which loosely&#10;form the basis for this post.&lt;/p&gt;</description></item><item><title>The Anti-Lexicographic SUS-Anchor: an Empirically Optimal Selection Scheme</title><link>https://curiouscoding.nl/posts/sus-anchors/</link><pubDate>Tue, 12 May 2026 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/sus-anchors/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#preliminaries" &gt;Preliminaries&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#minimizer-sampling-and-selection-schemes" &gt;Minimizer, sampling, and selection schemes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#bd-anchors" &gt;Bidirectional string anchors&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#maximal-suffixes" &gt;Maximal suffixes&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#character-based-orders" &gt;Character-based orders&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#smallest-unique-substring-anchors" &gt;Smallest unique substring anchors&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1&lt;/span&gt; &lt;a href="#properties" &gt;Properties&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.2&lt;/span&gt; &lt;a href="#computing-sus-anchors" &gt;Computing SUS-anchors&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#results" &gt;Results&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\[&#10;\newcommand{\sus}{\mathsf{SUS}}&#10;\newcommand{\lcp}{\mathsf{lcp}}&#10;\newcommand{\last}{\mathsf{last}}&#10;\]&lt;/p&gt;&#10;&lt;p&gt;A paper of this blog can be found here: &lt;a href="https://curiouscoding.nl/papers/sus-anchor.pdf" &gt;PDF&lt;/a&gt;, &lt;a href="https://doi.org/10.48550/ARXIV.2602.04103" class="external-link" target="_blank" rel="noopener"&gt;DOI&lt;/a&gt; (&lt;a href="#citeproc_bib_item_15"&gt;Groot Koerkamp 2026&lt;/a&gt;).&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;h3 id="abstract"&gt;&#10; Abstract&#10; &lt;a class="heading-link" href="#abstract"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;&lt;strong&gt;Motivation.&lt;/strong&gt;&#10;&lt;em&gt;Selection schemes&lt;/em&gt; provide a way to select a subset of positions in a text in&#10;such a way that no two consecutive selected positions are more than \(w\) apart.&#10;These selected positions can be used as &amp;ldquo;anchor&amp;rdquo; points for text indices&#10;such that every sufficiently long pattern corresponds to at least one anchor&#10;(&lt;a href="#citeproc_bib_item_2"&gt;Ayad, Loukides, and Pissis 2025&lt;/a&gt;).&#10;Closely related are &lt;em&gt;sampling schemes&lt;/em&gt;, that sample a &lt;em&gt;\(k\)-mer&lt;/em&gt; from each window&#10;of \(w\) consecutive \(k\)-mers in a text, and the more restricted &lt;em&gt;minimizer&#10;schemes&lt;/em&gt;, that achieve this by taking the smallest \(k\)-mer according to some&#10;order. In recent years, there has been a renewed interest in the search for&#10;&lt;em&gt;low density&lt;/em&gt; schemes that select/sample only a small fraction of&#10;positions/\(k\)-mers.&lt;/p&gt;</description></item><item><title>List of interesting blogs</title><link>https://curiouscoding.nl/posts/list-of-blogs/</link><pubDate>Tue, 05 May 2026 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/list-of-blogs/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#april-2026-the-fall-of-the-theorem-economy-david-bessis" &gt;April 2026: The fall of the theorem economy - David Bessis&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are some links to interesting posts around the web, with some quick quotes/notes.&lt;/p&gt;&#10;&lt;h2 id="april-2026-the-fall-of-the-theorem-economy-david-bessis"&gt;&#10; April 2026: &lt;a href="https://davidbessis.substack.com/p/the-fall-of-the-theorem-economy" class="external-link" target="_blank" rel="noopener"&gt;The fall of the theorem economy&lt;/a&gt; - David Bessis&#10; &lt;a class="heading-link" href="#april-2026-the-fall-of-the-theorem-economy-david-bessis"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;from the moment I conceived of Theorem 0.5, I knew it was true and that proving it would be straightforward.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;Too long but wow:&lt;/p&gt;</description></item><item><title>NordVPN refund dark patterns</title><link>https://curiouscoding.nl/posts/nordvpn-refund/</link><pubDate>Tue, 03 Mar 2026 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/nordvpn-refund/</guid><description>&lt;p&gt;Tl;dr: if you want to refund your NordVPN payment, go to&#10;&lt;a href="https://my.nordaccount.com/billing/billing-history?intent_rf=true" class="external-link" target="_blank" rel="noopener"&gt;my.nordaccount.com/billing/billing-history?intent_rf=true&lt;/a&gt;. The last part,&#10;&lt;code&gt;?intent_rf=true&lt;/code&gt;, is the important bit. (If that doesn&amp;rsquo;t work, you&amp;rsquo;ll probably&#10;have to go through the full chat-bot flow first, see below. Or maybe they&#10;changed the magic bit.)&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;p&gt;I have a NordVPN subscription since many years.&lt;/p&gt;&#10;&lt;p&gt;Recently I have been getting mails that my card is expired and that I&#10;should update it to keep the service:&lt;/p&gt;</description></item><item><title>Route Planning using Customizable Contraction Hierarchies</title><link>https://curiouscoding.nl/posts/cch/</link><pubDate>Mon, 02 Mar 2026 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/cch/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#problem-statement-customizable-route-planning--crp" &gt;Problem Statement: Customizable Route Planning (CRP)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#contraction-hierarchies--ch" &gt;Contraction Hierarchies (CH)&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#classic-contraction-hierarchies" &gt;&lt;em&gt;Classic&lt;/em&gt; Contraction Hierarchies&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#customizable-contraction-hierarchies--cch" &gt;&lt;em&gt;Customizable&lt;/em&gt; Contraction Hierarchies (CCH)&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#analogy-with-trees" &gt;Analogy with trees&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#shortest-paths-in-chs" &gt;Shortest Paths in CHs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#parents-faster-shortest-paths-in-cchs" &gt;Parents: Faster Shortest Paths in CCHs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#input-graph" &gt;Input Graph&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#initial-algorithm" &gt;Initial Algorithm&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.1&lt;/span&gt; &lt;a href="#permute-input" &gt;Permute input&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.2&lt;/span&gt; &lt;a href="#chordal-completion-and-parents" &gt;Chordal Completion and Parents&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.3&lt;/span&gt; &lt;a href="#customize" &gt;Customize&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.4&lt;/span&gt; &lt;a href="#query" &gt;Query&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8&lt;/span&gt; &lt;a href="#optimizing-things" &gt;Optimizing things&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.1&lt;/span&gt; &lt;a href="#binary-searching-in-find-edge" &gt;Binary searching in &lt;code&gt;find_edge&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.2&lt;/span&gt; &lt;a href="#hashmap-of-edges" &gt;&lt;code&gt;HashMap&lt;/code&gt; of edges&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.3&lt;/span&gt; &lt;a href="#ranges-of-neighbours" &gt;Ranges of neighbours&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.4&lt;/span&gt; &lt;a href="#linear-scan" &gt;Linear scan&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.5&lt;/span&gt; &lt;a href="#proper-query-algorithm" &gt;Proper query algorithm&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.6&lt;/span&gt; &lt;a href="#pruning-edges" &gt;Pruning edges&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.7&lt;/span&gt; &lt;a href="#pruning" &gt;Pruning&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.8&lt;/span&gt; &lt;a href="#unconditional-edge-relaxing" &gt;Unconditional edge relaxing&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.9&lt;/span&gt; &lt;a href="#early-edge-break" &gt;Early edge break&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.10&lt;/span&gt; &lt;a href="#dfs-ordering-the-nodes" &gt;DFS-ordering the nodes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.11&lt;/span&gt; &lt;a href="#not-inclining-queries" &gt;Not inclining queries&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;9&lt;/span&gt; &lt;a href="#some-stats" &gt;Some stats&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;10&lt;/span&gt; &lt;a href="#serializing-the-final-structure" &gt;Serializing the final structure&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;11&lt;/span&gt; &lt;a href="#merging-adjacent-edges" &gt;Merging adjacent edges&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;11.1&lt;/span&gt; &lt;a href="#perf-stat" &gt;Perf stat&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;11.2&lt;/span&gt; &lt;a href="#all-ranges-are-multiples-of-8" &gt;All ranges are multiples of 8&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;11.3&lt;/span&gt; &lt;a href="#all-ranges-have-size-8" &gt;All ranges have size 8&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;11.4&lt;/span&gt; &lt;a href="#finding-the-bottleneck" &gt;Finding the bottleneck&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;12&lt;/span&gt; &lt;a href="#bugfixing" &gt;Bugfixing&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;13&lt;/span&gt; &lt;a href="#further-ideas" &gt;Further ideas&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;13.1&lt;/span&gt; &lt;a href="#failed-doubling-the-graph" &gt;Failed: Doubling the graph&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;13.2&lt;/span&gt; &lt;a href="#edge-pruning" &gt;Edge pruning&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;13.3&lt;/span&gt; &lt;a href="#failed-expanding-a-node-and-its-parent-in-parallel" &gt;Failed: Expanding a node and its parent in parallel&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;14&lt;/span&gt; &lt;a href="#current-best-results" &gt;Current best results&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;14.1&lt;/span&gt; &lt;a href="#bottleneck" &gt;Bottleneck&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;15&lt;/span&gt; &lt;a href="#d41d8c" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; &lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are some notes on &lt;em&gt;customizable contraction hierarchies&lt;/em&gt;, based on talks&#10;with Michael Zündorf and the survey paper by Bläsius, Buchhold, Wagner, Zeitz, and Zündorf (&lt;a href="#citeproc_bib_item_1"&gt;2025&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Wheeler graphs</title><link>https://curiouscoding.nl/posts/wheeler-graphs/</link><pubDate>Thu, 26 Feb 2026 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/wheeler-graphs/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#deterministic-finite-automaton--dfa" &gt;Deterministic Finite Automaton (DFA)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#wheeler-dfa" &gt;Wheeler-DFA&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#linear-graphs-prefix-array" &gt;Linear graphs: Prefix array&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#de-bruijn-graphs-are-wheeler" &gt;De Bruijn graphs are Wheeler&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#not-all-dfas-are-wheeler" &gt;Not all DFAs are Wheeler&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#locating-patterns-via-binary-search" &gt;Locating patterns via binary search&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#locating-patterns-via-the-boss-table" &gt;Locating patterns via the BOSS table&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are some notes on Wheeler DFAs after chatting with Nicola&#10;Prezza&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; and others&#10;from the RAVEN lab at DSB 2026 in Venice.&lt;/p&gt;&#10;&lt;h3 id="deterministic-finite-automaton--dfa"&gt;&#10; &lt;span class="section-num"&gt;1&lt;/span&gt; Deterministic Finite Automaton (DFA)&#10; &lt;a class="heading-link" href="#deterministic-finite-automaton--dfa"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;A DFA is a graph where edges are labelled by characters.&#10;Each node can have at most one outgoing edge with each label. (Otherwise it&#10;would be &lt;em&gt;non-deterministic&lt;/em&gt;.)&lt;/p&gt;</description></item><item><title>DEFLATE, gzip, zlib, libz, et al.</title><link>https://curiouscoding.nl/posts/gzip/</link><pubDate>Mon, 09 Feb 2026 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/gzip/</guid><description>&lt;h3 id="file-formats"&gt;&#10; &lt;span class="section-num"&gt;1&lt;/span&gt; File formats&#10; &lt;a class="heading-link" href="#file-formats"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;This stuff is all insanely confusing. My summary:&lt;/p&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;DEFLATE&lt;/dt&gt;&#10;&lt;dd&gt;The &amp;lsquo;original&amp;rsquo; compression method. Works in 32kB blocks, and for&#10;each stores a small header with the compression mode and optional huffman&#10;encoded dictionary. It applies Lempel-Ziv'77 compression of replacing common texts&#10;by back-references. It uses a 32kiB context window for this, which may extend&#10;beyond the start of the block.&lt;/dd&gt;&#10;&lt;dt&gt;zlib&lt;/dt&gt;&#10;&lt;dd&gt;An implementation of DEFLATE. The file format wraps the raw deflate&#10;blocks in a header and footer.&lt;/dd&gt;&#10;&lt;dt&gt;gzip (GNU zip)&lt;/dt&gt;&#10;&lt;dd&gt;Another file format around DEFLATE, consisting of a small header containing&#10;eg the original file name, then a list of DEFLATE blocks, and lastly a CRC32 checksum.&lt;/dd&gt;&#10;&lt;dt&gt;blocked gzip (BGZF, blocked gzip format)&lt;/dt&gt;&#10;&lt;dd&gt;A file format developed for bioinformatics that is&#10;just multiple GZIP files concatenated. This allows faster compression and&#10;decompression by parallellizing over independent blocks, as well as random&#10;access via a small auxiliary index of block starts.&#10;This is backwards compatible with plain gzip.&lt;/dd&gt;&#10;&lt;/dl&gt;&#10;&lt;h3 id="implementations"&gt;&#10; &lt;span class="section-num"&gt;2&lt;/span&gt; Implementations&#10; &lt;a class="heading-link" href="#implementations"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;&lt;code&gt;zlib&lt;/code&gt;&lt;/dt&gt;&#10;&lt;dd&gt;The original C library.&lt;/dd&gt;&#10;&lt;dt&gt;&lt;code&gt;zlib-ng&lt;/code&gt;&lt;/dt&gt;&#10;&lt;dd&gt;Modern C implementation of zlib using SIMD.&lt;/dd&gt;&#10;&lt;dt&gt;&lt;code&gt;libz-sys&lt;/code&gt; crate&lt;/dt&gt;&#10;&lt;dd&gt;Rust bindings to &lt;code&gt;zlib&lt;/code&gt; and &lt;code&gt;zlib-ng&lt;/code&gt;.&lt;/dd&gt;&#10;&lt;dt&gt;&lt;code&gt;zlib-rs&lt;/code&gt; crate&lt;/dt&gt;&#10;&lt;dd&gt;Pure Rust re-implementation.&lt;/dd&gt;&#10;&lt;dt&gt;&lt;code&gt;zlib-rs-sys&lt;/code&gt; crate&lt;/dt&gt;&#10;&lt;dd&gt;zlib-compatible C-API to &lt;code&gt;zlib-rs&lt;/code&gt;&lt;/dd&gt;&#10;&lt;dt&gt;&lt;code&gt;flate2&lt;/code&gt; crate&lt;/dt&gt;&#10;&lt;dd&gt;High level Rust crate with uniform bindings to multiple zlib implementations.&lt;/dd&gt;&#10;&lt;/dl&gt;&#10;&lt;h3 id="containers"&gt;&#10; &lt;span class="section-num"&gt;3&lt;/span&gt; Containers&#10; &lt;a class="heading-link" href="#containers"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;figure class="inset large"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/gzip.svg"&#10;&#9;&#9;&#9;alt="Figure 1: Overview of the containers in a (blocked) GZIP file. Mim stores checkpoints at the start of DEFLATE blocks, which do not coincide with the start of GZIP blocks!"&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;&lt;span class="figure-number"&gt;Figure 1: &lt;/span&gt;Overview of the containers in a (blocked) GZIP file. Mim stores checkpoints at the start of DEFLATE blocks, which do &lt;em&gt;not&lt;/em&gt; coincide with the start of GZIP blocks!&lt;/p&gt;&#10;&#9;&#9;&lt;/figcaption&gt;&#10;&lt;/figure&gt;</description></item><item><title>QuadRank: Engineering a High Throughput Rank</title><link>https://curiouscoding.nl/posts/quadrank/</link><pubDate>Thu, 29 Jan 2026 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/quadrank/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#background" &gt;Background&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#implementations" &gt;Further implementations&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#birank" &gt;BiRank&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#variants" &gt;Variants&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#quadrank" &gt;QuadRank&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1&lt;/span&gt; &lt;a href="#variants" &gt;Variants&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#results" &gt;Results&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.1&lt;/span&gt; &lt;a href="#evals-birank" &gt;BiRank&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.2&lt;/span&gt; &lt;a href="#evals-quadrank" &gt;QuadRank&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#acknowledgements" &gt;Acknowledgements&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8&lt;/span&gt; &lt;a href="#snippets" &gt;Code snippets&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;9&lt;/span&gt; &lt;a href="#pairing-math" &gt;Pairing superblocks&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;10&lt;/span&gt; &lt;a href="#additional-results" &gt;Additional results&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;10.1&lt;/span&gt; &lt;a href="#cache-misses" &gt;Cache misses per query&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;10.2&lt;/span&gt; &lt;a href="#small-n" &gt;Throughput for small inputs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;10.3&lt;/span&gt; &lt;a href="#epyc" &gt;AMD EPYC evals&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;11&lt;/span&gt; &lt;a href="#fm-index" &gt;QuadFm: A Batching FM-index&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;11.1&lt;/span&gt; &lt;a href="#results" &gt;Results&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;12&lt;/span&gt; &lt;a href="#further-code-optimization-ideas" &gt;Further code optimization ideas&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\[\newcommand{\rank}{\mathsf{rank}}&#10;\newcommand{\rankone}{\mathsf{rank}}&#10;\newcommand{\rankall}{\mathsf{rank_4}}\]&lt;/p&gt;</description></item><item><title>Recent results on hash tables</title><link>https://curiouscoding.nl/posts/hash-table-bounds/</link><pubDate>Wed, 28 Jan 2026 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/hash-table-bounds/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#types-of-hash-tables" &gt;Types of hash tables&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#metrics" &gt;Metrics&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#lower-bounds" &gt;Lower bounds&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#iceberg-hashing--2023" &gt;Iceberg hashing (2023)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#iceberg-ht" &gt;IcebergHT (2023)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#tight-bounds-for-classical-open-addressing--2024" &gt;Tight Bounds for Classical Open Addressing (2024)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#optimal-non-oblivious-open-addressing--2025" &gt;Optimal Non-oblivious Open Addressing (2025)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8&lt;/span&gt; &lt;a href="#optimal-bounds-for-open-addressing-without-reordering" &gt;Optimal Bounds for Open Addressing Without Reordering&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.1&lt;/span&gt; &lt;a href="#funnel-hashing" &gt;Funnel hashing&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.2&lt;/span&gt; &lt;a href="#elastic-hashing" &gt;Elastic hashing&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\[&#10;\newcommand{\inv}{^{-1}}&#10;\newcommand{\di}{\delta\inv}&#10;\newcommand{\poly}{\mathrm{poly}}&#10;\]&lt;/p&gt;&#10;&lt;p&gt;This post summarizes some recent results and idea on various types hash tables.&#10;Collected together with Stefan Walzer.&lt;/p&gt;</description></item><item><title>Releasing Rust SIMD binaries to GitHub, BioConda, and PyPI</title><link>https://curiouscoding.nl/posts/release-flow/</link><pubDate>Sun, 25 Jan 2026 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/release-flow/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#testing" &gt;Testing&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#releasing-libraries" &gt;Releasing libraries&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#changelog" &gt;Changelog&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#cargo-release" &gt;&lt;code&gt;cargo release&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#cratesio" &gt;crates.io&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.4&lt;/span&gt; &lt;a href="#docs-dot-rs" &gt;docs.rs&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#releasing-binaries" &gt;Releasing binaries&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#cratesio-bin" &gt;Crates.io&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#avx2" &gt;The pain of AVX2&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2.1&lt;/span&gt; &lt;a href="#ensure-simd" &gt;&lt;code&gt;ensure_simd&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3&lt;/span&gt; &lt;a href="#profile-selection" &gt;Profile selection&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.4&lt;/span&gt; &lt;a href="#github" &gt;GitHub&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.5&lt;/span&gt; &lt;a href="#binstall" &gt;&lt;code&gt;cargo binstall&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.6&lt;/span&gt; &lt;a href="#pypi" &gt;PyPI&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.7&lt;/span&gt; &lt;a href="#bioconda" &gt;Bioconda&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This post collects the GitHub and BioConda CI configurations I use for&#10;maintaining and releasing Sassy. This includes releasing to:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;crates.io (&lt;a href="#cratesio" &gt;libraries&lt;/a&gt;, &lt;a href="#cratesio-bin" &gt;binaries&lt;/a&gt;)&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#github" &gt;GitHub releases&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#binstall" &gt;cargo binstall&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#pypi" &gt;PyPI&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#bioconda" &gt;Bioconda&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;We also have some specific settings to ensure the distributed binaries use &lt;a href="#avx2" &gt;AVX2&#10;SIMD instructions&lt;/a&gt;, as well as some configuration to distribute x86-64 binaries&#10;that transparently switch to a AVX-512 enabled implementation when possible.&#10;See also this earlier post on &lt;a href="https://curiouscoding.nl/posts/distributing-rust-simd-binaries/" &gt;distributing Rust SIMD binaries&lt;/a&gt;.&#10;(&lt;strong&gt;TODO&lt;/strong&gt;: Write on cargo-multivers for shipping AVX-512 compatible binaries. See&#10;&lt;a href="https://github.com/RagnarGrootKoerkamp/sassy/issues/64" class="external-link" target="_blank" rel="noopener"&gt;this issue&lt;/a&gt; for a tricky fix.)&lt;/p&gt;</description></item><item><title>Trying to understand DDR memory</title><link>https://curiouscoding.nl/posts/ddr/</link><pubDate>Tue, 20 Jan 2026 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/ddr/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#questions" &gt;Questions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#a-load-of-articles-blogs-pages-to-read" &gt;A load of articles/blogs/pages to read&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#wikipedia-articles" &gt;Wikipedia articles&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#more-posts" &gt;More posts&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#notes" &gt;Notes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.4&lt;/span&gt; &lt;a href="#my-own-ram" &gt;My own RAM&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.5&lt;/span&gt; &lt;a href="#continued-notes" &gt;Continued notes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.6&lt;/span&gt; &lt;a href="#address-mapping-notation" &gt;Address mapping notation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.7&lt;/span&gt; &lt;a href="#intel-spec" &gt;Intel spec&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.8&lt;/span&gt; &lt;a href="#rank-interleaving" &gt;Rank interleaving&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.9&lt;/span&gt; &lt;a href="#nontemporal-reads-writes" &gt;Nontemporal reads/writes&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#remap-using-performance-counters" &gt;reMap: using Performance counters&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#sudoku" &gt;Sudoku&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1&lt;/span&gt; &lt;a href="#step-1-dram-addressing-functions" &gt;Step 1: DRAM addressing functions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.2&lt;/span&gt; &lt;a href="#step-2-row-column-bits" &gt;Step 2: row/column bits&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.3&lt;/span&gt; &lt;a href="#step-3-validation" &gt;Step 3: validation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.4&lt;/span&gt; &lt;a href="#step-4-which-function-is-what" &gt;Step 4: which function is what?&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.5&lt;/span&gt; &lt;a href="#refreshes" &gt;Refreshes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.6&lt;/span&gt; &lt;a href="#consecutive-accesses" &gt;Consecutive Accesses&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#sudoku-now-with-only-1-dimm" &gt;Sudoku, now with only 1 DIMM&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.1&lt;/span&gt; &lt;a href="#setup" &gt;setup&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.2&lt;/span&gt; &lt;a href="#1-dot-reverse-functions" &gt;1. reverse functions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.3&lt;/span&gt; &lt;a href="#2-dot-identify-bits" &gt;2. identify bits&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.4&lt;/span&gt; &lt;a href="#3-dot-validate-mapping" &gt;3. validate mapping&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.5&lt;/span&gt; &lt;a href="#4-dot-decompose-functions" &gt;4. decompose functions&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#results" &gt;Final results&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#decode-dimms" &gt;&lt;code&gt;decode-dimms&lt;/code&gt;&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.1&lt;/span&gt; &lt;a href="#bank-groups" &gt;Bank groups&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.2&lt;/span&gt; &lt;a href="#refresh" &gt;Refresh&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.3&lt;/span&gt; &lt;a href="#random-access-throughput" &gt;Random access throughput&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8&lt;/span&gt; &lt;a href="#cpu-benchmarks" &gt;CPU benchmarks&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.1&lt;/span&gt; &lt;a href="#cpu-benchmarks" &gt;cpu-benchmarks&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.1.1&lt;/span&gt; &lt;a href="#random-access-throughput-1-dimm" &gt;random access throughput 1 DIMM&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.1.2&lt;/span&gt; &lt;a href="#random-access-throughput-2-dimm" &gt;random access throughput 2 DIMM&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.2&lt;/span&gt; &lt;a href="#memory-read-experiment" &gt;memory-read-experiment&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.2.1&lt;/span&gt; &lt;a href="#strided-reading-1-dimm" &gt;strided reading 1 DIMM&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.2.2&lt;/span&gt; &lt;a href="#strided-reading-2-dimm" &gt;strided reading 2 DIMM&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;9&lt;/span&gt; &lt;a href="#tinymembench" &gt;&lt;code&gt;tinymembench&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;10&lt;/span&gt; &lt;a href="#remaining-questions" &gt;Remaining questions&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are chronological (and thus, only lightly organized) notes on my attempt to&#10;understand how DDR4 and DDR5 RAM memory work.&lt;/p&gt;</description></item><item><title> Quotes from "The Evolution of Mathematical Software"</title><link>https://curiouscoding.nl/posts/evolution-of-mathematical-software/</link><pubDate>Sun, 18 Jan 2026 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/evolution-of-mathematical-software/</guid><description>&lt;p&gt;These are some nice quotes from&#10;&lt;a href="#citeproc_bib_item_1"&gt;“The Evolution of Mathematical Software”&lt;/a&gt;, Turing Lecture by the 2021&#10;Turing Award winner Jack J. Dongarra, which talks about&#10;algorithm and software development in the context of ever improving hardware.&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;a large infrastructure of mathematical libraries [&amp;hellip;] that must be mainted,&#10;ported, and enhanced for many years to come if the value of the application&#10;codes that depend on it are to be preserved and extended.&#10;The software that encapsulates all this time, energy, and thought, routinely&#10;outlasts the hardware it was originally designed to run on.&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>HPRC v2 stats</title><link>https://curiouscoding.nl/posts/hprc-v2-stats/</link><pubDate>Fri, 26 Dec 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/hprc-v2-stats/</guid><description>&lt;p&gt;The Movi 2 paper (&lt;a href="#citeproc_bib_item_3"&gt;Zakeri et al. 2025&lt;/a&gt;) builds a fast index on HPRCv2 (&lt;a href="#citeproc_bib_item_1"&gt;Human Pangenome Reference Consortium 2025&lt;/a&gt;), a collection of&#10;466 human genomes. This posts&#10;collects some statistics on the number of BWT runs (\(r\)) of this dataset, and&#10;makes an estimate on the number of unique mutations based on that.&lt;/p&gt;&#10;&lt;div class="ox-hugo-table small"&gt;&#10;&lt;div class="table-caption"&gt;&#10; &lt;span class="table-number"&gt;Table 1:&lt;/span&gt;&#10; Number of BWT runs and average run length for a random 3.2Gbp string, a human genome, and HPRCv1 and v2. The average run-length in HPRC is taken from Zakeri et al. (&lt;a href="#citeproc_bib_item_3"&gt;2025&lt;/a&gt;).&#10;&lt;/div&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;dataset&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;copies&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;rc?&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;length (Gbp)&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;avg run-len&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;runs (G)&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;est total mut&amp;rsquo;s&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;unique mut rate&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;random&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;no&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;3.2&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;1.33&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2.40&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;CHM13v2.0&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;1&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;no&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;3.2&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;1.85&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;1.72&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;HPRCv1&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;94&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2x 301&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;134&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2.25&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;33M&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;1/8900&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;HPRCv2&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;466&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;yes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2x 1500&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;535&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2.80&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;68M&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;1/22000&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;TODO: Update for the fact that HPRC run-lengths are for the version &lt;span class="underline"&gt;with&lt;/span&gt; rc!&#10;(Include single human genome with rc)&lt;/p&gt;</description></item><item><title>Asymptotic elevators</title><link>https://curiouscoding.nl/posts/asymptotic-elevators/</link><pubDate>Mon, 22 Dec 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/asymptotic-elevators/</guid><description>&lt;p&gt;I was listening to an episode of the &lt;em&gt;well there&amp;rsquo;s your problem&lt;/em&gt; podcast about&#10;pencil towers (&lt;a href="https://www.youtube.com/watch?v=BvMYplJ59TE&amp;amp;t=11297s" class="external-link" target="_blank" rel="noopener"&gt;youtube&lt;/a&gt;), and it had a section on how elevators are a problem because they&#10;require a lot of space. So here&amp;rsquo;s a mathematical version of that.&lt;/p&gt;&#10;&lt;h3 id="problem-statement"&gt;&#10; Problem statement&#10; &lt;a class="heading-link" href="#problem-statement"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Given are \(n\) people that need to go to floors \(1, 2, \dots, n\).&lt;/li&gt;&#10;&lt;li&gt;Elevators have constant acceleration, and must be standing still to&#10;enter/exit.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;&#10;&lt;li&gt;Possible elevator configurations:&#10;&lt;ol&gt;&#10;&lt;li&gt;single elevator over entire height&lt;/li&gt;&#10;&lt;li&gt;partition the height in disjoint intervals, and then one elevator per interval&lt;/li&gt;&#10;&lt;li&gt;double-deck: a single elevator that is \(h\) floors high&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;Not&lt;/em&gt; allowed: two free-moving elevators above each other that make sure to&#10;never bump into each other.&lt;/li&gt;&#10;&lt;li&gt;Elevators have infinite capacity.&lt;/li&gt;&#10;&lt;li&gt;There are \(k\) elevator shafts.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Question:&lt;/strong&gt; How much total travel time do you need to get everyone home, if&#10;everybody arrives at the same time.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Harder(?):&lt;/strong&gt; What if the people arrive in a random permutation (1 per time&#10;step), and their clock starts ticking as soon as they arrive?&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="observations"&gt;&#10; Observations&#10; &lt;a class="heading-link" href="#observations"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Going \(n\) floors up takes at least \(O(\sqrt n)\) time.&lt;/li&gt;&#10;&lt;li&gt;Total travel time is at least \(\sum_{i=0}^n O(\sqrt i) = O(n \sqrt n)\)&lt;/li&gt;&#10;&lt;li&gt;\(1\) elevator carrying everyone going 1 step at a time: \(O(n^2)\) total time&lt;/li&gt;&#10;&lt;li&gt;$2$-elevator sqrt-decomposition: one elevator stops every \(\sqrt n\) floors,&#10;and then a (set of) second elevators for the final up to \(\sqrt n\) floors.&#10;&lt;ul&gt;&#10;&lt;li&gt;first elevator: \(n\) people times \(n/(\sqrt n)/2\) &amp;lsquo;big steps&amp;rsquo; on average&#10;times \(\sqrt{\sqrt n}\) time per big step is \(O(n^{7/4})\)&lt;/li&gt;&#10;&lt;li&gt;second elevator: \(n\) people times \((\sqrt n)\) &amp;lsquo;small steps&amp;rsquo; on average&#10;times \(1\) per small step is \(O(n^{3.2})\)&lt;/li&gt;&#10;&lt;li&gt;so overall the big steps dominate&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;$2$-elevator, one that stops every \(B\) floors and then \(B\) that stop every&#10;one floor:&#10;&lt;ul&gt;&#10;&lt;li&gt;the first one: \(n \cdot (n/B) \cdot \sqrt B = n^2/\sqrt B\)&lt;/li&gt;&#10;&lt;li&gt;the second one: \(n \cdot B = nB\).&lt;/li&gt;&#10;&lt;li&gt;solve for equality: \(B = n/\sqrt B\) =&amp;gt; \(B = n^{2/3}\)&lt;/li&gt;&#10;&lt;li&gt;so \(n^{1+2/3}\) solution&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;\(\lg n\) elevator binary tree:&#10;&lt;ul&gt;&#10;&lt;li&gt;\(2^k \leq n \leq 2^{k+1}\)&lt;/li&gt;&#10;&lt;li&gt;Take first elevator to \(2^k\) if needed: time \(\sqrt{2^k} = O(\sqrt n)\)&lt;/li&gt;&#10;&lt;li&gt;There take second elevator that goes up \(2^{k-1}\) floors if needed.&lt;/li&gt;&#10;&lt;li&gt;Then \(2^{k-2}\) levels up&lt;/li&gt;&#10;&lt;li&gt;and so on until the last floor.&lt;/li&gt;&#10;&lt;li&gt;Total time per person averages \(\sqrt{2^k}/2 + \sqrt{2^{k-1}}/2 + \dots + \sqrt{2}/2 + \sqrt{1}/2 =&#10;O(\sqrt{2^k}) = O(\sqrt n)\), so up-to-a-constant optimal total travel&#10;time \(O(n \sqrt n)\).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;strong&gt;Open questions:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Overview of static data structures</title><link>https://curiouscoding.nl/posts/static-data-structures/</link><pubDate>Wed, 17 Dec 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/static-data-structures/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#classification-of-static-data-structures" &gt;Classification of static data structures&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#space-lower-bounds-and-practical-approaches" &gt;Space lower bounds and practical approaches&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#rank" &gt;Rank&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#rank-plus-select" &gt;Rank + Select&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#minimal-perfect-hash-function--mphf" &gt;Minimal perfect hash function (MPHF)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.4&lt;/span&gt; &lt;a href="#monotone-mphf" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Monotone MPHF&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.5&lt;/span&gt; &lt;a href="#order-preserving-mphf" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Order-preserving MPHF&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.6&lt;/span&gt; &lt;a href="#static-retrieval-static-function-with-static-values" &gt;Static retrieval: Static function with static values&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.7&lt;/span&gt; &lt;a href="#updatable-retrieval-static-function-with-mutable-values" &gt;Updatable retrieval: Static function with mutable values&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.8&lt;/span&gt; &lt;a href="#static-set--membership" &gt;Static set (membership)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.9&lt;/span&gt; &lt;a href="#static-ordered-set" &gt;Static ordered set&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.10&lt;/span&gt; &lt;a href="#static-dictionary-static-keys-and-values" &gt;Static dictionary: static keys and values&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.11&lt;/span&gt; &lt;a href="#updatable-dictionary-with-mutable-values" &gt;Updatable dictionary with mutable values&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.12&lt;/span&gt; &lt;a href="#dynamic-dictionary-with-mutable-keys-and-values" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Dynamic dictionary with mutable keys and values&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.13&lt;/span&gt; &lt;a href="#static-filter" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Static filter&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.14&lt;/span&gt; &lt;a href="#ordered-static-updatable-dynamic-dictionary" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Ordered static/updatable/dynamic dictionary?&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#summary" &gt;Summary table&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\[&#10;\newcommand{\K}{\mathbb K}&#10;\newcommand{\V}{\mathbb V}&#10;\newcommand{\c}[1]{\mathbf{\mathsf{#1}}}&#10;\]&lt;/p&gt;</description></item><item><title>Writing typst in emacs</title><link>https://curiouscoding.nl/posts/typst-in-emacs/</link><pubDate>Fri, 12 Dec 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/typst-in-emacs/</guid><description>&lt;p&gt;This is a short note on setting up Doom emacs for very fast typst previews.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;typst-ts-mode&lt;/strong&gt; provides &lt;code&gt;typst-ts-watch-mode&lt;/code&gt; via &lt;code&gt;C-c C-w&lt;/code&gt;, which runs &lt;code&gt;typst watch&lt;/code&gt; in the background, as well as &lt;code&gt;typst-ts-preview&lt;/code&gt; via &lt;code&gt;C-c C-p&lt;/code&gt; which&#10;opens the current pdf file. Using &lt;code&gt;zathura&lt;/code&gt; as pdf viewer provides live updates.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-elisp" data-lang="elisp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; doom/packages.el&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;;; typst: https://codeberg.org/meow_king/typst-ts-mode/wiki/Installation.md&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;package!&lt;/span&gt; &lt;span class="nv"&gt;typst-ts-mode&lt;/span&gt; &lt;span class="nb"&gt;:recipe&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;:host&lt;/span&gt; &lt;span class="nv"&gt;codeberg&lt;/span&gt; &lt;span class="nb"&gt;:repo&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;meow_king/typst-ts-mode&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;Since typst is so fast to compile, and near-live previews are nice, we&amp;rsquo;d like to&#10;save the file often. Since &lt;code&gt;space f s&lt;/code&gt; is somewhat annoying to type all the&#10;time, we&amp;rsquo;ll add some auto-saving.&lt;/p&gt;</description></item><item><title>Distributing Rust SIMD Binaries</title><link>https://curiouscoding.nl/posts/distributing-rust-simd-binaries/</link><pubDate>Thu, 20 Nov 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/distributing-rust-simd-binaries/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#what-s-inside" &gt;What&amp;rsquo;s inside&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#compile-time-feature-detection" &gt;Compile-time feature detection&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#other-solutions" &gt;Other solutions&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#rust-s-default-target-cpu" &gt;Rust&amp;rsquo;s default target-cpu&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#cargo-build-vs-cargo-install" &gt;&lt;code&gt;cargo build&lt;/code&gt; vs &lt;code&gt;cargo install&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#hardware-support" &gt;Hardware support&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#distributing-binaries" &gt;Distributing binaries&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.1&lt;/span&gt; &lt;a href="#github-releases" &gt;GitHub Releases&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.2&lt;/span&gt; &lt;a href="#bioconda" &gt;Bioconda&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.3&lt;/span&gt; &lt;a href="#pypi" &gt;Pypi&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#open-questions" &gt;Open questions&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Many of my rust crates and binaries building on them use SIMD instructions. Notably:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;packed-seq&lt;/code&gt;, a library for 2-bit encoding DNA (&lt;a href="https://github.com/rust-seq/packed-seq" class="external-link" target="_blank" rel="noopener"&gt;gh&lt;/a&gt;, &lt;a href="https://docs.rs/packed-seq/latest/packed_seq/" class="external-link" target="_blank" rel="noopener"&gt;docs.rs&lt;/a&gt;),&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;simd-minimizers&lt;/code&gt;, a library for fast computation of &lt;em&gt;minimizers&lt;/em&gt; (&lt;a href="https://github.com/rust-seq/simd-minimizers" class="external-link" target="_blank" rel="noopener"&gt;gh&lt;/a&gt;, &lt;a href="https://docs.rs/simd-minimizers/latest/simd_minimizers/" class="external-link" target="_blank" rel="noopener"&gt;docs.rs&lt;/a&gt;, &lt;a href="https://doi.org/10.4230/LIPIcs.SEA.2025.20" class="external-link" target="_blank" rel="noopener"&gt;paper&lt;/a&gt;),&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;deacon&lt;/code&gt;, a tool for fast decontamination of reads (&lt;a href="https://github.com/bede/deacon" class="external-link" target="_blank" rel="noopener"&gt;gh&lt;/a&gt;, &lt;a href="https://doi.org/10.1101/2025.06.09.658732" class="external-link" target="_blank" rel="noopener"&gt;preprint&lt;/a&gt;),&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;sassy&lt;/code&gt;, a SIMD-based approximate string searching library and binary (&lt;a href="https://github.com/RagnarGrootKoerkamp/sassy" class="external-link" target="_blank" rel="noopener"&gt;gh&lt;/a&gt;, &lt;a href="https://docs.rs/sassy/latest/sassy/" class="external-link" target="_blank" rel="noopener"&gt;docs.rs&lt;/a&gt;, &lt;a href="https://doi.org/10.1101/2025.07.22.666207" class="external-link" target="_blank" rel="noopener"&gt;preprint&lt;/a&gt;),&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;barbell&lt;/code&gt;, a tool for demultiplexer based on sassy (&lt;a href="https://github.com/rickbeeloo/barbell" class="external-link" target="_blank" rel="noopener"&gt;gh&lt;/a&gt;, &lt;a href="https://doi.org/10.1101/2025.10.22.683865" class="external-link" target="_blank" rel="noopener"&gt;preprint&lt;/a&gt;)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;all support fast algorithms based on both x86-64 (x64, henceforth) AVX2 and&#10;aarch64 NEON instructions. The question of this post is: how to effectively&#10;distribute binaries using these libraries?&lt;/p&gt;</description></item><item><title> Thoughts on "Static Retrieval Revisited"</title><link>https://curiouscoding.nl/posts/static-retrieval-revisited/</link><pubDate>Tue, 04 Nov 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/static-retrieval-revisited/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#problem-definitions" &gt;Problem definitions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#optimal-solutions" &gt;Optimal solutions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#why-an-overhead-is-necessary" &gt;Why an overhead is necessary&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#augmented-retrieval" &gt;Augmented Retrieval&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are some summarizing notes and thoughts on&#10;&lt;a href="#citeproc_bib_item_2"&gt;“Static Retrieval Revisited: To Optimality and beyond”&lt;/a&gt; by &lt;a href="#citeproc_bib_item_2"&gt;Hu, Kuszmaul, Liang, Yu, Zhang, and Zhou&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="problem-definitions"&gt;&#10; &lt;span class="section-num"&gt;1&lt;/span&gt; Problem definitions&#10; &lt;a class="heading-link" href="#problem-definitions"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;&lt;strong&gt;Static Retrieval.&lt;/strong&gt;&lt;/strong&gt; Given \(n\) keys \(X\subseteq U\) and \(n\) $v$-bit values&#10;\(f(X) \in [2^v]\), encode \(f: X\to [2^v]\).&#10;The goal is use a minimal number of bits on top of the trivial&#10;\(nv\) lower bound, while allowing efficient queries.&lt;/p&gt;</description></item><item><title>Thoughts on Singletrack</title><link>https://curiouscoding.nl/posts/singletrack/</link><pubDate>Tue, 04 Nov 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/singletrack/</guid><description>&lt;p&gt;This is a quick post summarizing the idea of&#10;&lt;a href="#citeproc_bib_item_2"&gt;“Singletrack: An Algorithm for Improving Memory Consumption and Performance of Gap-Affine Sequence Alignment”&lt;/a&gt; by &lt;a href="#citeproc_bib_item_2"&gt;López-Villellas, Iñiguez, Jiménez-Blanco, Aguado-Puig, Moretó, Alastruey-Benedé, Ibáñez, and Marco-Sola&lt;/a&gt; to reduce memory&#10;usage of affine-cost alignment by removing the need to store the affine layers&#10;of the DP matrix.&lt;/p&gt;&#10;&lt;p&gt;Affine-cost alignment uses a gap-open&#10;cost \(o&amp;gt;0\), so that a gap of length \(\ell\) has cost \(o + \ell \cdot e\). The&#10;classic DP solution for this is Gotoh&amp;rsquo;s method (&lt;a href="#citeproc_bib_item_1"&gt;Gotoh 1982&lt;/a&gt;) that uses two&#10;additional DP matrices \(I\) and \(D\) (alongside the main \(M\) matrix):&#10;one to store the best cost to get to state&#10;\((i,j)\) while ending in an insertion, and one that ends with a deletion.&lt;/p&gt;</description></item><item><title>Three log scientist</title><link>https://curiouscoding.nl/posts/three-log-scientist/</link><pubDate>Tue, 12 Aug 2025 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/three-log-scientist/</guid><description>&lt;p&gt;A rating system for theoretical computer scientists.&#10;The more logarithms there are (i.e. the more &amp;ldquo;\(\log\)&amp;rdquo; before your variables),&#10;the higher your reputation will be.&#10;No-log theoretical computer scientists are virtually non-existent, as virtually&#10;all non-trivial algorithms require use of logarithms.&#10;Most are one-log scientists.&#10;In the old times (well, I&amp;rsquo;m young, so these look like old times to me at least), one would occasionally find a piece of code done by a three-log scientist and shiver with awe.&lt;/p&gt;</description></item><item><title>Chunking for Fasta Parsing</title><link>https://curiouscoding.nl/posts/fasta-parsing/</link><pubDate>Wed, 06 Aug 2025 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/fasta-parsing/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#minimizing-critical-sections" &gt;Minimizing critical sections&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#rabbitfx-chunking" &gt;RabbitFx: chunking&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#different-chunking" &gt;Different chunking&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#experiments" &gt;Experiments&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#outlook" &gt;Outlook&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#some-helicase-benchmarks" &gt;Some helicase benchmarks&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This is a quick note on some thoughts &amp;amp; experiments on fasta parsing, alongside &lt;a href="https://github.com/RagnarGrootKoerkamp/fasta-parsing-playground" class="external-link" target="_blank" rel="noopener"&gt;github:RagnarGrootKoerkamp/fasta-parsing-playground&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;It&amp;rsquo;s a common complaint these days that Fasta parsing is slow.&#10;A common parser is Needletail (&lt;a href="https://github.com/onecodex/needletail" class="external-link" target="_blank" rel="noopener"&gt;github&lt;/a&gt;), which builds on seq_io (&lt;a href="https://github.com/markschl/seq_io" class="external-link" target="_blank" rel="noopener"&gt;github&lt;/a&gt;).&#10;Another recent one is paraseq (&lt;a href="https://github.com/noamteyssier/paraseq" class="external-link" target="_blank" rel="noopener"&gt;github&lt;/a&gt;).&lt;/p&gt;&#10;&lt;p&gt;Paraseq helps the user by providing an interface for parallel processing of&#10;reads, see eg &lt;a href="https://github.com/noamteyssier/paraseq/blob/main/examples/multi_parallel.rs#L33" class="external-link" target="_blank" rel="noopener"&gt;this example&lt;/a&gt;.&#10;Unfortunately, this still has a bottleneck: while the users processing of reads&#10;is multi threaded, the parsing itself is still single threaded.&lt;/p&gt;</description></item><item><title>Understanding GreedyMini</title><link>https://curiouscoding.nl/posts/greedymini-analysis/</link><pubDate>Sun, 27 Apr 2025 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/greedymini-analysis/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#greedymini-results" &gt;GreedyMini Results&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#a-first-look" &gt;A first look&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#comparison-with-optimal-ilp-values" &gt;Comparison with optimal ILP values&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#large-alphabets" &gt;Large alphabets&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#analysing-greedymini-at-w-3" &gt;Analysing GreedyMini at \(w=3\)&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#w-3-k-3" &gt;\(w=3\), \(k=3\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#w-7-k-3" &gt;\(w=7\), \(k=3\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#w-3-k-4" &gt;\(w=3\), \(k=4\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#w-3-k-5" &gt;\(w=3\), \(k=5\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#w-3-k-6" &gt;\(w=3\), \(k=6\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#w-3-k-7" &gt;\(w=3\), \(k=7\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#looking-at-fixed-k-5" &gt;Looking at fixed \(k=5\)&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#k-5-w-4" &gt;\(k=5\), \(w=4\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#k-5-w-5" &gt;\(k=5\), \(w=5\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#k-5-w-6" &gt;\(k=5\), \(w=6\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#k-5-w-7" &gt;\(k=5\), \(w=7\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#k-5-w-8" &gt;\(k=5\), \(w=8\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#k-5-w-12" &gt;\(k=5\), \(w=12\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#investigating-w-5" &gt;Investigating \(w=5\)&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#w-5-k-8" &gt;\(w=5\), \(k=8\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#what-about-k-w-plus-1" &gt;What about \(k = w+1\)?&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;In this post, we will look at the minimizer schemes generated by the greedy&#10;minimizer (Golan et al. 2025).&lt;/p&gt;</description></item><item><title>Thesis: Optimal Throughput Bioinformatics</title><link>https://curiouscoding.nl/posts/thesis/</link><pubDate>Thu, 10 Apr 2025 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/thesis/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#part-1-pairwise-alignment" &gt;Part 1: Pairwise Alignment&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2&lt;/span&gt; &lt;a href="#part-2-low-density-minimizers" &gt;Part 2: Low Density Minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.3&lt;/span&gt; &lt;a href="#part-3-high-throughput-bioinformatics" &gt;Part 3: High Throughput Bioinformatics&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#pairwise-alignment" &gt;Pairwise Alignment&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#low-density-minimizers" &gt;Low Density Minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#high-throughput-bioinformatics" &gt;High Throughput Bioinformatics&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.4&lt;/span&gt; &lt;a href="#propositions" &gt;Propositions&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This post contains the abstract, introduction, and conclusion of my thesis (&lt;a href="#citeproc_bib_item_3"&gt;Groot Koerkamp 2025a&lt;/a&gt;).&#10;The full PDF is &lt;a href="https://curiouscoding.nl/thesis.pdf" &gt;here&lt;/a&gt;.&#10;Individual chapters are based on blog posts and/or papers and introduced in&#10;detail in the introduction below. In brief:&lt;/p&gt;</description></item><item><title>A History of Pairwise Alignment</title><link>https://curiouscoding.nl/posts/pairwise-alignment/</link><pubDate>Wed, 09 Apr 2025 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/pairwise-alignment/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#a-brief-history" &gt;A Brief History&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#a-pa" &gt;A*PA&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2&lt;/span&gt; &lt;a href="#a-pa2" &gt;A*PA2&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.3&lt;/span&gt; &lt;a href="#overview" &gt;Overview&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#problem-statement" &gt;Problem Statement&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#alignment-types" &gt;Alignment types&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#cost-models" &gt;Cost Models&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1&lt;/span&gt; &lt;a href="#minimizing-cost-versus-maximizing-score" &gt;Minimizing Cost versus Maximizing Score&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#dp" &gt;The Classic DP Algorithms&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#linear-memory-using-divide-and-conquer" &gt;Linear Memory using Divide and Conquer&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#graphs" &gt;Dijkstra&amp;rsquo;s Algorithm and A*&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8&lt;/span&gt; &lt;a href="#computational-volumes" &gt;Computational Volumes and Band Doubling&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;9&lt;/span&gt; &lt;a href="#diagonal-transition" &gt;Diagonal Transition&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;10&lt;/span&gt; &lt;a href="#parallelism" &gt;Parallelism&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;11&lt;/span&gt; &lt;a href="#lcs-and-contours" &gt;LCS and Contours&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;12&lt;/span&gt; &lt;a href="#some-tools" &gt;Some Tools&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;13&lt;/span&gt; &lt;a href="#subquadratic-methods-and-lower-bounds" &gt;Subquadratic Methods and Lower Bounds&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;14&lt;/span&gt; &lt;a href="#summary" &gt;Summary&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This is Chapter 2 of my &lt;a href="https://curiouscoding.nl/posts/thesis/" &gt;thesis&lt;/a&gt; (&lt;a href="#citeproc_bib_item_27"&gt;Groot Koerkamp 2025&lt;/a&gt;), to introduce the first part on Pairwise Alignment.&#10;Please cite the thesis instead of this post.&lt;/p&gt;</description></item><item><title>Low Density Minimizers</title><link>https://curiouscoding.nl/posts/minimizers/</link><pubDate>Tue, 08 Apr 2025 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/minimizers/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#theory-of-sampling-schemes" &gt;Theory of Sampling Schemes&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2&lt;/span&gt; &lt;a href="#overview" &gt;Overview&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.3&lt;/span&gt; &lt;a href="#theory-of-sampling-schemes" &gt;Theory of sampling schemes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.4&lt;/span&gt; &lt;a href="#notation" &gt;Notation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.5&lt;/span&gt; &lt;a href="#types-of-sampling-schemes" &gt;Types of sampling schemes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.6&lt;/span&gt; &lt;a href="#computing-the-density" &gt;Computing the density&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.7&lt;/span&gt; &lt;a href="#random-mini-density" &gt;The density of random minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.8&lt;/span&gt; &lt;a href="#universal-hitting-sets" &gt;Universal hitting sets&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.9&lt;/span&gt; &lt;a href="#asymptotic-results" &gt;Asymptotic results&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.10&lt;/span&gt; &lt;a href="#variants" &gt;Variants&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#lower-bounds" &gt;Lower Bounds on Sampling Scheme Density&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#schleimer-et-al-dot-s-bound" &gt;Schleimer et al.&amp;rsquo;s bound&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#mar%c3%a7ais-et-al-dot-s-bound" &gt;Marçais et al.&amp;rsquo;s bound&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#improving-and-extending-mar%c3%a7ais-et-al-dot-s-bound" &gt;Improving and extending Marçais et al.&amp;rsquo;s bound&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.4&lt;/span&gt; &lt;a href="#near-tight-lb" &gt;A near-tight lower bound on the density of forward sampling schemes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.5&lt;/span&gt; &lt;a href="#lower-bound-eval" &gt;Discussion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#sampling-schemes" &gt;Practical Sampling Schemes&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#lexmin" &gt;Variants of lexicographic minimizers&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#lex-eval" &gt;Evaluation&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#uhs-inspired-schemes" &gt;UHS-inspired schemes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3&lt;/span&gt; &lt;a href="#syncmer-based-schemes" &gt;Syncmer-based schemes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.4&lt;/span&gt; &lt;a href="#open-closed-minimizer" &gt;Open-closed minimizer&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#oc-eval" &gt;Evaluation&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.5&lt;/span&gt; &lt;a href="#modmini" &gt;Mod-minimizer&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#theoretical-density" &gt;Theoretical density&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#modmini-eval" &gt;Evaluation&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.6&lt;/span&gt; &lt;a href="#sampling-schemes-discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#selection-schemes" &gt;Towards Optimal Selection Schemes&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1&lt;/span&gt; &lt;a href="#bd-anchors" &gt;Bidirectional anchors&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.2&lt;/span&gt; &lt;a href="#sus-anchors" &gt;Sus-anchors&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#sus-anchor-eval" &gt;Evaluation&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.3&lt;/span&gt; &lt;a href="#selection-schemes-discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This is Part 2 of my &lt;a href="https://curiouscoding.nl/posts/thesis/" &gt;thesis&lt;/a&gt; (&lt;a href="#citeproc_bib_item_15"&gt;Groot Koerkamp 2025&lt;/a&gt;), containing chapters 6 to 9 on Low Density Minimizers.&#10;Please cite the thesis instead of this post.&lt;/p&gt;</description></item><item><title>Beyond Global Alignment</title><link>https://curiouscoding.nl/posts/mapping/</link><pubDate>Mon, 07 Apr 2025 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/mapping/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#semi-global-variants" &gt;Variants of semi-global alignment&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#text-searching" &gt;Fast text searching&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#skip-cost-for-overlap-alignments" &gt;Skip-cost for overlap alignments&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#search-results" &gt;Results&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#mapping" &gt;Mapping using A*Map&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#seeding" &gt;Seeding&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#chaining" &gt;Chaining&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3&lt;/span&gt; &lt;a href="#aligning" &gt;Aligning&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.4&lt;/span&gt; &lt;a href="#a-map" &gt;A*Map&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.5&lt;/span&gt; &lt;a href="#results" &gt;Results&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This is Chapter 5 of my &lt;a href="https://curiouscoding.nl/posts/thesis/" &gt;thesis&lt;/a&gt; (&lt;a href="#citeproc_bib_item_11"&gt;Groot Koerkamp 2025&lt;/a&gt;).&#10;Please cite the thesis instead of this post.&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;div class="notice summary"&gt;&#10; &lt;div class="notice-title"&gt;&#10; &lt;i class="fa-solid " aria-hidden="true"&gt;&lt;/i&gt;Summary&#10; &lt;/div&gt;&#10; &lt;div class="notice-content"&gt;&#10;&lt;p&gt;So far, we have considered only algorithms for &lt;em&gt;global&lt;/em&gt; alignment.&#10;In this chapter, we consider &lt;em&gt;semi-global&lt;/em&gt; alignment and its variants instead,&#10;where a pattern (query) is searched in a longer string (reference).&#10;There are many flavours of semi-global alignment, depending on the&#10;(relative) sizes of the inputs. We list these variants, and introduce&#10;some common approaches to solve this problem.&lt;/p&gt;&#10;&lt;p&gt;We then extend A*PA into A*Map as a new tool to solve these problems.&lt;/p&gt;&#10; &lt;/div&gt;&#10;&lt;/div&gt;</description></item><item><title>High Throughput Bioinformatics</title><link>https://curiouscoding.nl/posts/throughput/</link><pubDate>Sun, 06 Apr 2025 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/throughput/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#overview" &gt;Overview&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#compute-bound" &gt;Optimizing Compute Bound Code: Random Minimizers&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#avoiding-branch-misses" &gt;Avoiding Branch Misses&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#simd-processing-in-parallel" &gt;SIMD: Processing In Parallel&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#instruction-level-parallelism" &gt;Instruction Level Parallelism&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.4&lt;/span&gt; &lt;a href="#input-format" &gt;Input Format&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#memory-bound" &gt;Optimizing Memory Bound Code: Minimal Perfect Hashing&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#using-less-memory" &gt;Using Less Memory&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#reducing-memory-accesses" &gt;Reducing Memory Accesses&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3&lt;/span&gt; &lt;a href="#interleaving-memory-accesses" &gt;Interleaving Memory Accesses&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.4&lt;/span&gt; &lt;a href="#batching-streaming-and-prefetching" &gt;Batching, Streaming, and Prefetching&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This is Chapter 10 of my &lt;a href="https://curiouscoding.nl/posts/thesis/" &gt;thesis&lt;/a&gt; (&lt;a href="#citeproc_bib_item_12"&gt;Groot Koerkamp 2025a&lt;/a&gt;), to introduce the last part on High Throughput Bioinformatics.&lt;/p&gt;</description></item><item><title>Path Pruning Revisited</title><link>https://curiouscoding.nl/posts/path-pruning/</link><pubDate>Mon, 31 Mar 2025 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/path-pruning/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#early-idea-bottom-up-match-merging--aka-bummer" &gt;Early idea: Bottom-up match-merging (aka BUMMer?)&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#some-previous-ideas" &gt;Some previous ideas&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2&lt;/span&gt; &lt;a href="#divide-and-conquer" &gt;Divide &amp;amp; conquer&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.3&lt;/span&gt; &lt;a href="#bottom-up-match-merging--bummer" &gt;Bottom-up match merging (BUMMer)&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;h2 id="early-idea-bottom-up-match-merging--aka-bummer"&gt;&#10; &lt;span class="section-num"&gt;1&lt;/span&gt; Early idea: Bottom-up match-merging (aka BUMMer?)&#10; &lt;a class="heading-link" href="#early-idea-bottom-up-match-merging--aka-bummer"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;TODO: Move to separate post.&lt;/p&gt;&#10;&lt;p&gt;One thing that becomes clear with mapping is that we don&amp;rsquo;t quite&#10;know where exactly to start the semi-global alignments.&#10;This can be fixed by adding some buffer/padding, but this remains slightly ugly&#10;and iffy.&lt;/p&gt;</description></item><item><title>SimdSketch: a fast bucket sketch</title><link>https://curiouscoding.nl/posts/simd-sketch/</link><pubDate>Sun, 09 Mar 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/simd-sketch/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#jaccard-similarity" &gt;Jaccard similarity&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#hash-schemes" &gt;Hash schemes&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#minhash" &gt;MinHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#s-mins-sketch" &gt;$s$-mins sketch&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#bottom-s" &gt;Bottom-\(s\) sketch&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.4&lt;/span&gt; &lt;a href="#fracminhash" &gt;FracMinHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.5&lt;/span&gt; &lt;a href="#bucket-sketch" &gt;Bucket sketch&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.6&lt;/span&gt; &lt;a href="#mod-bucket-hash--new" &gt;Mod-bucket hash (new?)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.7&lt;/span&gt; &lt;a href="#variants" &gt;Variants&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#compressing-sketches" &gt;Compressing sketches&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#b-bit-hashing" &gt;$b$-bit hashing&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1.1&lt;/span&gt; &lt;a href="#accounting-for-collisions" &gt;Accounting for collisions&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#hyperminhash" &gt;HyperMinHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#densification-strategies" &gt;Densification strategies&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#simdsketch" &gt;SimdSketch&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#evaluation" &gt;Evaluation&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.1&lt;/span&gt; &lt;a href="#setup" &gt;Setup&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.1.1&lt;/span&gt; &lt;a href="#tools" &gt;Tools&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.1.2&lt;/span&gt; &lt;a href="#inputs" &gt;Inputs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.1.3&lt;/span&gt; &lt;a href="#parameters" &gt;Parameters&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.1.4&lt;/span&gt; &lt;a href="#metrics" &gt;Metrics&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.2&lt;/span&gt; &lt;a href="#raw-results" &gt;Raw results&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.3&lt;/span&gt; &lt;a href="#correlation" &gt;Correlation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.4&lt;/span&gt; &lt;a href="#comparison-speed" &gt;Comparison speed&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.5&lt;/span&gt; &lt;a href="#low-similarity-data" &gt;Low-similarity data&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8&lt;/span&gt; &lt;a href="#future-work" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; / Future work&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\[&#10;\newcommand{\sketch}{\mathsf{sketch}}&#10;\]&lt;/p&gt;</description></item><item><title>Types of tigs</title><link>https://curiouscoding.nl/posts/tigs/</link><pubDate>Sun, 09 Mar 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/tigs/</guid><description>&lt;h3 id="de-bruijn-graph"&gt;&#10; &lt;span class="section-num"&gt;1&lt;/span&gt; De Bruijn graph&#10; &lt;a class="heading-link" href="#de-bruijn-graph"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;Consider an edge-centric De Bruijn graph, where each edge corresponds to a&#10;k-mer, and nodes are the \(k-1\) overlaps between adjacent k-mers. In the figures,&#10;all edges are directed towards the right.&lt;/p&gt;&#10;&lt;figure class="inset medium"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/graph.svg"&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;h3 id="k-mers"&gt;&#10; &lt;span class="section-num"&gt;2&lt;/span&gt; k-mers&#10; &lt;a class="heading-link" href="#k-mers"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;The goal is now to store all edges / k-mers of the graph efficiently.&#10;A &lt;em&gt;spectrum preserving string set&lt;/em&gt; (SPSS) is a set of strings whose k-mers are&#10;the k-mers of the input graph, that does not contain duplicate k-mers (&lt;a href="#citeproc_bib_item_2"&gt;Rahman and Medvedev 2020&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Minimizer papers</title><link>https://curiouscoding.nl/posts/minimizer-papers/</link><pubDate>Mon, 17 Feb 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/minimizer-papers/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#overview" &gt;Overview&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&#10;- &lt;a href="#previous-reviews" &gt;Previous reviews&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#theory-of-sampling-schemes" &gt;Theory of sampling schemes&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#questions" &gt;Questions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#types-of-schemes" &gt;Types of schemes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3&lt;/span&gt; &lt;a href="#parameter-regimes" &gt;Parameter regimes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.4&lt;/span&gt; &lt;a href="#different-perspectives" &gt;Different perspectives&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.5&lt;/span&gt; &lt;a href="#uhs-vs-minimizer-scheme" &gt;UHS vs minimizer scheme&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.6&lt;/span&gt; &lt;a href="#asymptotic--bounds" &gt;(Asymptotic) bounds&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.7&lt;/span&gt; &lt;a href="#lower-bounds" &gt;Lower bounds&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#minimizer-schemes" &gt;Minimizer schemes&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1&lt;/span&gt; &lt;a href="#orders" &gt;Orders&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.2&lt;/span&gt; &lt;a href="#uhs-based-and-search-based-schemes" &gt;UHS-based and search-based schemes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.3&lt;/span&gt; &lt;a href="#pure-schemes" &gt;Pure schemes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.4&lt;/span&gt; &lt;a href="#other-variants" &gt;Other variants&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#selection-schemes" &gt;Selection schemes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#canonical-minimizers" &gt;Canonical minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.5&lt;/span&gt; &lt;a href="#non-overlapping-string-sets" &gt;Non-overlapping string sets&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This post is simply a list of brief comments on many papers related to&#10;minimizers, and forms the basis of &lt;a href="https://curiouscoding.nl/posts/minimizers/" &gt;/posts/minimizers/&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Binary search variants and the effects of batching</title><link>https://curiouscoding.nl/posts/binsearch/</link><pubDate>Wed, 12 Feb 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/binsearch/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#optimizing-binary-search-and-interpolation-search" &gt;Optimizing Binary Search And Interpolation Search&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#problem-statement" &gt;Problem statement&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2&lt;/span&gt; &lt;a href="#inspiration-and-background" &gt;Inspiration and background&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.3&lt;/span&gt; &lt;a href="#benchmarking-setup" &gt;Benchmarking setup&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#binary-search" &gt;Binary search&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#branchless-search" &gt;Branchless search&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#explicit-prefetching" &gt;Explicit prefetching&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#batching" &gt;Batching&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.4&lt;/span&gt; &lt;a href="#a-note-on-power-of-two-array-sizes" &gt;A note on power-of-two array sizes&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#alternative-memory-layout" &gt;Eytzinger&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#naive-implementation" &gt;Naive implementation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#prefetching" &gt;Prefetching&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3&lt;/span&gt; &lt;a href="#branchless-eytzinger" &gt;Branchless Eytzinger&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.4&lt;/span&gt; &lt;a href="#batched-eytzinger" &gt;Batched Eytzinger&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.4.1&lt;/span&gt; &lt;a href="#non-prefetched" &gt;Non-prefetched&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.4.2&lt;/span&gt; &lt;a href="#prefetched" &gt;Prefetched&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#eytzinger-or-binsearch" &gt;Eytzinger or BinSearch?&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#memory-efficiency-parallel-search-and-comparison-to-s-trees" &gt;Memory efficiency &amp;ndash; parallel search and comparison to S-trees&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#interpolation-search" &gt;Interpolation search&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#conclusion-and-takeaways" &gt;Conclusion and takeaways&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;h2 id="optimizing-binary-search-and-interpolation-search"&gt;&#10; &lt;span class="section-num"&gt;1&lt;/span&gt; Optimizing Binary Search And Interpolation Search&#10; &lt;a class="heading-link" href="#optimizing-binary-search-and-interpolation-search"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;This blogpost is a preliminary of the&#10;&lt;a href="https://curiouscoding.nl/posts/static-search-tree/" class="external-link" target="_blank" rel="noopener"&gt;post on static&#10;search trees&lt;/a&gt;. We will be looking into binary search and how it can be&#10;optimized using different memory layouts (Eytzinger), branchless&#10;techniques and careful use of prefetching. In addition, we will explore&#10;batching. Our language of choice will be Rust.&lt;/p&gt;</description></item><item><title>Thoughts on Consensus MPHF and tiny pointers</title><link>https://curiouscoding.nl/posts/consensus/</link><pubDate>Wed, 12 Feb 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/consensus/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#consensus" &gt;Consensus&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#consensus-recsplit" &gt;Consensus-RecSplit&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#idea-consensus-ptrhash" &gt;IDEA: Consensus-PtrHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#hashing" &gt;Tiny pointers and optimal open addressing hash tables&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are some thoughts on the Consensus-based MPHF presented in&#10;Lehmann et al. (&lt;a href="#citeproc_bib_item_4"&gt;2025&lt;/a&gt;), and how this could be applied to PtrHash:&lt;/p&gt;&#10;&lt;p&gt;Lehmann, Hans-Peter, Peter Sanders, Stefan Walzer, and Jonatan Ziegler. 2025. “Combined Search and Encoding for Seeds, with an Application to Minimal Perfect Hashing.” &lt;i&gt;Arxiv&lt;/i&gt;. &lt;a href="https://doi.org/10.48550/ARXIV.2502.05613"&gt;&lt;a href="https://doi.org/10.48550/ARXIV.2502.05613" class="external-link" target="_blank" rel="noopener"&gt;https://doi.org/10.48550/ARXIV.2502.05613&lt;/a&gt;&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Below are also some thoughts on the papers on tiny pointers, used to achieve&#10;hash tables with load factors very close to 1: Bender et al. (&lt;a href="#citeproc_bib_item_1"&gt;2021&lt;/a&gt;), Farach-Colton, Krapivin, and Kuszmaul (&lt;a href="#citeproc_bib_item_2"&gt;2024&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>PtrHash: Minimal Perfect Hashing at RAM Throughput</title><link>https://curiouscoding.nl/posts/ptrhash/</link><pubDate>Mon, 03 Feb 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/ptrhash/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#sec:orgebb9721" &gt;Introduction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#sec:orgfe4e2e9" &gt;Related work&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#sec:orgce4a522" &gt;PtrHash&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#sec:org06ce748" &gt;Overview&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#sec:construction" &gt;Construction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3&lt;/span&gt; &lt;a href="#sec:bucket-fn" &gt;Bucket Assignment Functions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.4&lt;/span&gt; &lt;a href="#remapping" &gt;Remapping using CacheLineEF&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#sec:orgbf28892" &gt;Results&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1&lt;/span&gt; &lt;a href="#construction-eval" &gt;Construction&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1.1&lt;/span&gt; &lt;a href="#sec:orge11d60c" &gt;Bucket Functions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1.2&lt;/span&gt; &lt;a href="#sec:org9f908d8" &gt;Tuning Parameters for Construction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1.3&lt;/span&gt; &lt;a href="#sec:orgece074a" &gt;Remap&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.2&lt;/span&gt; &lt;a href="#sec:comparison" &gt;Comparison to Other Methods&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#sec:org9f032dd" &gt;Conclusions and Future Work&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#sec:throughput" &gt;Appendix A: Query Throughput&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#sec:orgabb5dd4" &gt;Batching and Streaming&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#throughput-evaluation" &gt;Evaluation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#multi-threaded-throughput." &gt;Multi-threaded Throughput.&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#sec:sharding" &gt;Appendix B: Sharding&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#sec:sharding-eval" &gt;Evaluation&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This is the online version of my SEA 2025 paper on PtrHash (&lt;a href="https://doi.org/10.48550/arXiv.2502.15539" class="external-link" target="_blank" rel="noopener"&gt;DOI&lt;/a&gt;, &lt;a href="https://curiouscoding.nl/papers/ptrhash.pdf" &gt;PDF&lt;/a&gt;, &lt;a href="https://github.com/RagnarGrootKoerkamp/ptrhash" class="external-link" target="_blank" rel="noopener"&gt;github&lt;/a&gt;).&#10;The original development-log can be found &lt;a href="../ptrhash-log" &gt;here&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Code snippets for Latex, Rust, and Python</title><link>https://curiouscoding.nl/posts/snippets/</link><pubDate>Wed, 15 Jan 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/snippets/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#latex" &gt;Latex&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#code-highlighting-minted" &gt;Code highlighting: &lt;code&gt;minted&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wide-figure" &gt;Wide figure&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#fit-more-text-on-a-page" &gt;Fit more text on a page&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#rust" &gt;Rust&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#cargo-dot-toml-workspace" &gt;&lt;code&gt;Cargo.toml&lt;/code&gt; workspace&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#release-profile" &gt;Release profile&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#list-exported-functions" &gt;List exported functions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#read-human-genome-using-needletail" &gt;Read human genome using &lt;code&gt;needletail&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#prevent-auto-vectorization" &gt;Prevent auto-vectorization&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#sorting" &gt;Sorting&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#python" &gt;Python&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#pretty-plots" &gt;Pretty plots&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#json-to-pivot-table-to-org-table" &gt;Json to pivot table to org table&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#ipe" &gt;IPE&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#make-all-text-textsf" &gt;Make all text &lt;code&gt;\textsf&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#export-all-named-views" &gt;Export all named views&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#ox-reveal" &gt;Ox-reveal&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#fragmented-list" &gt;Fragmented list&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#split-slide" &gt;Split slide&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are some common libraries and code snippets for various tasks.&lt;/p&gt;</description></item><item><title>Setting up traffic monitoring using GoAccess</title><link>https://curiouscoding.nl/posts/goaccess-setup/</link><pubDate>Sat, 04 Jan 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/goaccess-setup/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#nginx-setup" &gt;Nginx setup&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#goaccess-configuration" &gt;GoAccess configuration&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#systemd-setup" &gt;Systemd setup&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#serving-the-static-file" &gt;Serving the static file&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#serving-live-statistics" &gt;Serving live statistics&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#geoip-database" &gt;GeoIP database&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;GoAccess (&lt;a href="https://goaccess.io/" class="external-link" target="_blank" rel="noopener"&gt;goaccess.io&lt;/a&gt;, &lt;a href="https://github.com/allinurl/goaccess" class="external-link" target="_blank" rel="noopener"&gt;github&lt;/a&gt;) is a tool that analyses server logs and gives real-time&#10;statistics on network traffic.&#10;It took me some time to figure out exactly how to get the real-time websocket&#10;server working through Nginx, so I&amp;rsquo;m just sharing my configuration here.&lt;/p&gt;&#10;&lt;p&gt;Install via your package manager, e.g. &lt;code&gt;sudo pacman -S goaccess&lt;/code&gt; on Arch.&lt;/p&gt;</description></item><item><title>Static search trees: 40x faster than binary search</title><link>https://curiouscoding.nl/posts/static-search-tree/</link><pubDate>Wed, 18 Dec 2024 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/static-search-tree/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#problem-statement" &gt;Problem statement&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2&lt;/span&gt; &lt;a href="#motivation" &gt;Motivation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.3&lt;/span&gt; &lt;a href="#recommended-reading" &gt;Recommended reading&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.4&lt;/span&gt; &lt;a href="#binary-search-and-eytzinger-layout" &gt;Binary search and Eytzinger layout&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.5&lt;/span&gt; &lt;a href="#hugepages" &gt;Hugepages&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.6&lt;/span&gt; &lt;a href="#a-note-on-benchmarking" &gt;A note on benchmarking&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.7&lt;/span&gt; &lt;a href="#cache-lines" &gt;Cache lines&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.8&lt;/span&gt; &lt;a href="#s-trees-and-b-trees" &gt;S-trees and B-trees&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#optimizing-find" &gt;Optimizing &lt;code&gt;find&lt;/code&gt;&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#linear" &gt;Linear&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#auto-vectorization" &gt;Auto-vectorization&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#trailing-zeros" &gt;Trailing zeros&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.4&lt;/span&gt; &lt;a href="#popcount" &gt;Popcount&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.5&lt;/span&gt; &lt;a href="#manual-simd" &gt;Manual SIMD&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#optimizing-the-search" &gt;Optimizing the search&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#batching" &gt;Batching&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#prefetching" &gt;Prefetching&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3&lt;/span&gt; &lt;a href="#pointer-arithmetic" &gt;Pointer arithmetic&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3.1&lt;/span&gt; &lt;a href="#up-front-splat" &gt;Up-front splat&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3.2&lt;/span&gt; &lt;a href="#byte-based-pointers" &gt;Byte-based pointers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3.3&lt;/span&gt; &lt;a href="#the-final-version" &gt;The final version&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.4&lt;/span&gt; &lt;a href="#skip-prefetch" &gt;Skip prefetch&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.5&lt;/span&gt; &lt;a href="#interleave" &gt;Interleave&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#optimizing-the-tree-layout" &gt;Optimizing the tree layout&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1&lt;/span&gt; &lt;a href="#left-tree" &gt;Left-tree&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.2&lt;/span&gt; &lt;a href="#memory-layouts" &gt;Memory layouts&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.3&lt;/span&gt; &lt;a href="#node-size-b-15" &gt;Node size \(B=15\)&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.3.1&lt;/span&gt; &lt;a href="#data-structure-size" &gt;Data structure size&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.4&lt;/span&gt; &lt;a href="#summary" &gt;Summary&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#prefix-partitioning" &gt;Prefix partitioning&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.1&lt;/span&gt; &lt;a href="#full-layout" &gt;Full layout&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.2&lt;/span&gt; &lt;a href="#compact-subtrees" &gt;Compact subtrees&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.3&lt;/span&gt; &lt;a href="#the-best-of-both-compact-first-level" &gt;The best of both: compact first level&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.4&lt;/span&gt; &lt;a href="#overlapping-trees" &gt;Overlapping trees&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.5&lt;/span&gt; &lt;a href="#human-data" &gt;Human data&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.6&lt;/span&gt; &lt;a href="#prefix-map" &gt;Prefix map&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.7&lt;/span&gt; &lt;a href="#prefix-summary" &gt;Summary&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#multi-threaded-comparison" &gt;Multi-threaded comparison&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.1&lt;/span&gt; &lt;a href="#future-work" &gt;Future work&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.1.1&lt;/span&gt; &lt;a href="#branchy-search" &gt;Branchy search&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.1.2&lt;/span&gt; &lt;a href="#interpolation-search" &gt;Interpolation search&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.1.3&lt;/span&gt; &lt;a href="#packing-data-smaller" &gt;Packing data smaller&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.1.4&lt;/span&gt; &lt;a href="#returning-indices-in-original-data" &gt;Returning indices in original data&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.1.5&lt;/span&gt; &lt;a href="#range-queries" &gt;Range queries&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.1.6&lt;/span&gt; &lt;a href="#sorting-queries" &gt;Sorting queries&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.1.7&lt;/span&gt; &lt;a href="#suffix-array-searching" &gt;Suffix array searching&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;In this post, we will implement a static search tree (S+ tree) for&#10;high-throughput searching of sorted data, as &lt;a href="https://en.algorithmica.org/hpc/data-structures/s-tree/" class="external-link" target="_blank" rel="noopener"&gt;introduced&lt;/a&gt; on Algorithmica.&#10;We&amp;rsquo;ll mostly take the code presented there as a starting point, and optimize it&#10;to its limits. For a large part, I&amp;rsquo;m simply taking the &amp;lsquo;future work&amp;rsquo; ideas of that post&#10;and implementing them. And then there will be a bunch of looking at assembly&#10;code to shave off all the instructions we can.&#10;Lastly, there will be one big addition to optimize throughput: &lt;em&gt;batching&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>Comments on Brisk</title><link>https://curiouscoding.nl/posts/brisk/</link><pubDate>Fri, 29 Nov 2024 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/brisk/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#overview" &gt;Overview&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#detailed-comments" &gt;Detailed comments&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#general" &gt;General&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#1-dot-introduction" &gt;1. Introduction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#2-dot-methods" &gt;2. Methods&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#2-dot-1-outline" &gt;2.1 Outline&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#2-dot-2-indexing-super-k-mers" &gt;2.2 Indexing super-k-mers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#2-dot-3-lazy-encoding" &gt;2.3 Lazy encoding&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#2-dot-4-probing" &gt;2.4 Probing&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#2-dot-5-superbuckets" &gt;2.5 Superbuckets&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#2-dot-6-implementation-details" &gt;2.6 Implementation details&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#3-dot-results" &gt;3. Results&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#3-dot-1-parameters" &gt;3.1 Parameters&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#3-dot-2-multicore" &gt;3.2 Multicore&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#3-dot-4-comparison" &gt;3.4 Comparison&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#3-dot-5-query-times" &gt;3.5 Query times&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#4-dot-conclusion" &gt;4. Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are some (biased) comments on Brisk,&#10;a dynamic k-mer dictionary (&lt;a href="#citeproc_bib_item_5"&gt;Smith et al. 2024&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Comments on GreedyMini</title><link>https://curiouscoding.nl/posts/greedymini/</link><pubDate>Mon, 04 Nov 2024 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/greedymini/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#overview" &gt;Overview&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#detailed-comments" &gt;Detailed comments&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#terminology" &gt;Terminology&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#preliminaries" &gt;Preliminaries&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#methods" &gt;Methods&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#3-dot-5-transformations" &gt;3.5 Transformations&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#results" &gt;Results&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#comments-on-expected-density-of-random-minimizers" &gt;Comments on &amp;ldquo;Expected density of random minimizers&amp;rdquo;&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are some (biased) comments on &lt;a href="#citeproc_bib_item_2"&gt;“Greedymini: Generating Low-Density Dna Minimizers”&lt;/a&gt;&#10;(&lt;a href="#citeproc_bib_item_2"&gt;Golan et al. 2024&lt;/a&gt;), which introduces the &lt;code&gt;GreedyMini&lt;/code&gt; minimizer scheme.&#10;(Meanwhile, this has been published as Golan et al. (&lt;a href="#citeproc_bib_item_3"&gt;2025&lt;/a&gt;).)&lt;/p&gt;&#10;&lt;p&gt;At the bottom, there are also some comment on Golan and Shur (&lt;a href="#citeproc_bib_item_4"&gt;2025&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Comments on 'When Less is More' minimizer review</title><link>https://curiouscoding.nl/posts/minimizer-review-comments/</link><pubDate>Tue, 15 Oct 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/minimizer-review-comments/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#the-importance-of-ordering" &gt;The importance of ordering&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#asymptotically-optimal-minimizers" &gt;Asymptotically optimal minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are some (biased) comments on &lt;a href="#citeproc_bib_item_5"&gt;“When Less Is More: Sketching with Minimizers in Genomics”&lt;/a&gt; (&lt;a href="#citeproc_bib_item_5"&gt;Ndiaye et al. 2024&lt;/a&gt;).&lt;/p&gt;&#10;&lt;h2 id="the-importance-of-ordering"&gt;&#10; The importance of ordering&#10; &lt;a class="heading-link" href="#the-importance-of-ordering"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;the interest lies in constructing a minimizer with a density within a constant&#10;factor, i.e., \(O(1/w)\) for any \(k\). With lexicographic ordering, minimizers can&#10;achieve such density, but with large \(k\) values (\(\geq \log_{|Σ|}(w)-c\) for a&#10;constant \(c\)), which might not be desirable (&lt;a href="#citeproc_bib_item_9"&gt;Zheng, Kingsford, and Marçais 2020&lt;/a&gt;). However, random&#10;ordering can result in a lower density than that of the lexicographic ordering.&#10;Thus, random ordering (implemented with pseudo-random hash functions) is&#10;usually used in practice.&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>A lemma on suffix array searching</title><link>https://curiouscoding.nl/posts/suffix-array-searching-lemma/</link><pubDate>Sat, 05 Oct 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/suffix-array-searching-lemma/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#suffix-arrays" &gt;Suffix arrays&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#searching-methods" &gt;Searching methods&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#naive-o--p-cdot-lg-2-n--search" &gt;Naive \(O(|P|\cdot \lg_2 n)\) search&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#faster-search" &gt;Faster \(O(|P|\cdot \lg_2 n)\) search&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#lcp-based-o--p-plus-lg-2-n--search" &gt;LCP-based \(O(|P| + \lg_2 n)\) search&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#analysing-the-faster-search" &gt;Analysing the faster search&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;We&amp;rsquo;ll prove that using the &amp;ldquo;faster&amp;rdquo; binary search algorithm (see &lt;a href="#faster-search" &gt;2.2&lt;/a&gt;) that tracks the LCP&#10;with the left and right boundary of the remaining search interval has amortized&#10;runtime&lt;/p&gt;&#10;&lt;p&gt;\[&#10;O\Big(\lg_2(n) + |P| + |P| \cdot \lg_2(Occ(P))\Big),&#10;\]&#10;when \(P\) is a randomly sampled fixed-length pattern from the text and \(Occ(P)\) counts the number of occurrences of \(P\) in the text.&lt;/p&gt;</description></item><item><title>FM-index implementations</title><link>https://curiouscoding.nl/posts/fm-index-implementations/</link><pubDate>Wed, 02 Oct 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/fm-index-implementations/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#a-note-on-sdsl-versions" &gt;A note on SDSL versions&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Here I&amp;rsquo;ll briefly list some FM-index and related implementations around the web.&#10;Implementations seem relatively inconsistent, mostly because the FM-index is&#10;more of a &amp;lsquo;wrapper&amp;rsquo; type around a given Burrows-Wheeler-transform and an&#10;&lt;em&gt;occurrences&lt;/em&gt; list implementation. Both can be implemented in various ways. In particular&#10;occurrences should be stored using a wavelet tree for optimal compression.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The &lt;a href="https://github.com/wafflespeanut/nucleic-acid/blob/2adbf5181081245423f974a88b5ccf53d7bf26ac/src/bwt.rs#L96" class="external-link" target="_blank" rel="noopener"&gt;nucleic-acid repo&lt;/a&gt; contains a completely unoptimised version.&lt;/li&gt;&#10;&lt;li&gt;The Rust-bio crate contains a &lt;a href="https://github.com/rust-bio/rust-bio/blob/master/src/data_structures/fmindex.rs#L209" class="external-link" target="_blank" rel="noopener"&gt;generic FM-index&lt;/a&gt;. It stores a &lt;a href="https://github.com/rust-bio/rust-bio/blob/master/src/data_structures/bwt.rs#L75-L94" class="external-link" target="_blank" rel="noopener"&gt;sampled&#10;occurrences array&lt;/a&gt;, so that space is relatively small but lookups take \(O(k)\)&#10;time for sampling factor \(k\).&lt;/li&gt;&#10;&lt;li&gt;SDSL-lite contains a &lt;a href="https://github.com/simongog/sdsl-lite/blob/c32874cb2d8524119f25f3b501526fe692df29f4/include/sdsl/wavelet_" class="external-link" target="_blank" rel="noopener"&gt;wavelet tree&lt;/a&gt; and &lt;a href="https://github.com/simongog/sdsl-lite/blob/master/include/sdsl/csa_wt.hpp#L48" class="external-link" target="_blank" rel="noopener"&gt;compressed suffix array&lt;/a&gt; implementation based&#10;on it, that provides the same functionality as an FM-index.&lt;/li&gt;&#10;&lt;li&gt;There is the &lt;a href="https://github.com/rossanoventurini/qwt" class="external-link" target="_blank" rel="noopener"&gt;Quad Wavelet Tree&lt;/a&gt; (QWT) Rust crate (Ceregini, Kurpicz, and Venturini 2024). This uses a 4-ary&#10;tree instead of the usual binary wavelet tree, and improves latency by around&#10;a factor 2 over SDSL wavelet trees.&lt;/li&gt;&#10;&lt;li&gt;Dominik Kempa has the &lt;a href="https://github.com/dominikkempa/faster-minuter?tab=readme-ov-file" class="external-link" target="_blank" rel="noopener"&gt;Faster-Minuter index&lt;/a&gt; (Gog et al. 2019) that contains&#10;an improved wavelet tree as well.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/achacond/gem-cutter" class="external-link" target="_blank" rel="noopener"&gt;GEM-Cutter&lt;/a&gt; contain a GPU implementation of the FM-index (Chacon et al. 2015).&lt;/li&gt;&#10;&lt;li&gt;There is also &lt;a href="https://github.com/lh3/ropebwt3" class="external-link" target="_blank" rel="noopener"&gt;RopeBWT3&lt;/a&gt; (Li 2024), which is basically a run-length&#10;compressed BWT with a B+ tree on top for fast queries.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/UM-Applied-Algorithms-Lab/AWRY" class="external-link" target="_blank" rel="noopener"&gt;AWRY&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="a-note-on-sdsl-versions"&gt;&#10; A note on SDSL versions&#10; &lt;a class="heading-link" href="#a-note-on-sdsl-versions"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/simongog/sdsl" class="external-link" target="_blank" rel="noopener"&gt;github:simongog/sdsl&lt;/a&gt; is the original, with last commit in 2013.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/simongog/sdsl-lite" class="external-link" target="_blank" rel="noopener"&gt;github:simongog/sdsl-lite&lt;/a&gt; is v2, with last commit in 2019, and seems the most&#10;used currently.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/xxsds/sdsl-lite" class="external-link" target="_blank" rel="noopener"&gt;github:xxsds/sdsl-lite&lt;/a&gt; is v3 and seems to be actively maintained at the time&#10;of writing (Jan 2025), and is &lt;a href="https://www.reddit.com/r/rust/comments/nlxhym/comment/gzpqejn/?utm_source=share&amp;amp;utm_medium=web3x&amp;amp;utm_name=web3xcss&amp;amp;utm_term=1&amp;amp;utm_content=share_button" class="external-link" target="_blank" rel="noopener"&gt;recommended&lt;/a&gt; by the original developers. From a&#10;quick glance, I think it&amp;rsquo;s somewhat restructured and truly a v3, not just a v2.1.&#10;However, it seems to be much less popular.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/vgteam/sdsl-lite" class="external-link" target="_blank" rel="noopener"&gt;github:vgteam/sdsl-lite&lt;/a&gt; is a fork of the original &lt;code&gt;sdsl-lite&lt;/code&gt;, with, I think,&#10;a number of small bug fixes and some updates for recent compiler versions.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Then there are also some rust versions:&lt;/p&gt;</description></item><item><title>Practical minimizers</title><link>https://curiouscoding.nl/posts/practical-minimizers/</link><pubDate>Thu, 12 Sep 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/practical-minimizers/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#sampling-schemes" &gt;Sampling schemes&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#definitions" &gt;Definitions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2&lt;/span&gt; &lt;a href="#miniception" &gt;Miniception&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.3&lt;/span&gt; &lt;a href="#mod-minimizer" &gt;Mod-minimizer&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.4&lt;/span&gt; &lt;a href="#forward-scheme-lower-bound" &gt;Forward scheme lower bound&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.5&lt;/span&gt; &lt;a href="#open-syncmer-minimizer" &gt;Open syncmer minimizer&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.6&lt;/span&gt; &lt;a href="#open-closed-minimizer" &gt;Open-closed minimizer&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.7&lt;/span&gt; &lt;a href="#new-general-mod-minimizer" &gt;New: General mod-minimizer&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.8&lt;/span&gt; &lt;a href="#variant-open-closed-minimizer-using-offsets" &gt;Variant: Open-closed minimizer using offsets&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#selection-schemes" &gt;Selection schemes&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.1&lt;/span&gt; &lt;a href="#definition" &gt;Definition&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.2&lt;/span&gt; &lt;a href="#bd-anchors" &gt;Bd-anchors&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.3&lt;/span&gt; &lt;a href="#new-smallest-unique-substring-anchors" &gt;New: Smallest unique substring anchors&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2.4&lt;/span&gt; &lt;a href="#new-anti-lexicographic-sorting" &gt;New: Anti lexicographic sorting&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#more-sampling-schemes" &gt;More sampling schemes&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#anti-lex-sus-anchors" &gt;Anti-lex sus-anchors&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#threshold-anchors" &gt;Threshold anchors&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3&lt;/span&gt; &lt;a href="#the-t-gap-disappears-for-large-alphabets" &gt;The $t$-gap disappears for large alphabets&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#computing-the-density-of-forward-schemes" &gt;Computing the density of forward schemes&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1&lt;/span&gt; &lt;a href="#wip-anti-lexicographic-sus-anchor-density" &gt;WIP: Anti lexicographic sus-anchor density&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#open-questions" &gt;Open questions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#ideas" &gt;Ideas&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#optimal-schemes-for-k-in-w-w-plus-1" &gt;Optimal schemes for \(k \in \{w, w+1\}\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;&lt;strong&gt;Most of the content here has now been absorbed into my &lt;a href="https://curiouscoding.nl/posts/minimizers/" &gt;thesis chapter on minimizers&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Calling Rust from Python</title><link>https://curiouscoding.nl/posts/calling-rust-from-python/</link><pubDate>Tue, 10 Sep 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/calling-rust-from-python/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#steps" &gt;Steps&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#using-kwargs" &gt;Using &lt;code&gt;kwargs&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#todos" &gt;TODOs&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Using &lt;code&gt;PyO3&lt;/code&gt; and &lt;code&gt;maturin&lt;/code&gt;, it&amp;rsquo;s very easy to call Rust code from Python.&#10;I&amp;rsquo;m mostly following the guide at &lt;a href="https://pyo3.rs" class="external-link" target="_blank" rel="noopener"&gt;pyo3.rs&lt;/a&gt;, but leaving out some thing related to&#10;python environments.&lt;/p&gt;&#10;&lt;h2 id="steps"&gt;&#10; &lt;span class="section-num"&gt;1&lt;/span&gt; Steps&#10; &lt;a class="heading-link" href="#steps"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Install &lt;code&gt;maturin&lt;/code&gt;. I use the Arch package but you can also do a &lt;code&gt;pip install&lt;/code&gt;&#10;in the environment below.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Make sure you have a &lt;code&gt;lib&lt;/code&gt; target, and add &lt;code&gt;cdylib&lt;/code&gt; as a crate-type.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;lib&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;crate&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;cdylib&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;rlib&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Add &lt;code&gt;pyo3&lt;/code&gt; as a dependency:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;dependencies&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;pyo3&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;0.22.2&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;features&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;extension-module&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Create a python environment&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python -m venv .env&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Wrap the functions you want to export. I like to put them in a separate&#10;&lt;code&gt;src/py.rs&lt;/code&gt; module&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. A list of how Rust types map to Python types is &lt;a href="https://pyo3.rs/v0.22.2/conversions/tables" class="external-link" target="_blank" rel="noopener"&gt;here&lt;/a&gt;.&#10;For example, for my &lt;code&gt;minimizers&lt;/code&gt; repository:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;span class="lnt"&gt;12&#10;&lt;/span&gt;&lt;span class="lnt"&gt;13&#10;&lt;/span&gt;&lt;span class="lnt"&gt;14&#10;&lt;/span&gt;&lt;span class="lnt"&gt;15&#10;&lt;/span&gt;&lt;span class="lnt"&gt;16&#10;&lt;/span&gt;&lt;span class="lnt"&gt;17&#10;&lt;/span&gt;&lt;span class="lnt"&gt;18&#10;&lt;/span&gt;&lt;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;use&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;super&lt;/span&gt;::&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;use&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pyo3&lt;/span&gt;::&lt;span class="n"&gt;prelude&lt;/span&gt;::&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#[pyfunction]&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;pub&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;generate_random_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;: &lt;span class="kt"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sigma&lt;/span&gt;: &lt;span class="kt"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-&amp;gt; &lt;span class="nc"&gt;PyResult&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;u8&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;super&lt;/span&gt;::&lt;span class="n"&gt;generate_random_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sigma&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt;/// Take the minimizer configuration (a Rust enum) json encoded, we don&amp;#39;t have&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt;/// to pass around complex types.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt;/// The text is automatically converted between Rust slice and python list.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt;/// Returns a simple floa.t&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#[pyfunction]&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;density&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scheme&lt;/span&gt;: &lt;span class="kp"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;: &lt;span class="nb"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;u8&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;: &lt;span class="kt"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;: &lt;span class="kt"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sigma&lt;/span&gt;: &lt;span class="kt"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-&amp;gt; &lt;span class="nc"&gt;PyResult&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;f64&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;tp&lt;/span&gt;: &lt;span class="nc"&gt;MinimizerType&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;serde_json&lt;/span&gt;::&lt;span class="n"&gt;from_str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scheme&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;density&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;tp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sigma&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;density&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt;/// A Python module. The name of this function must match the `lib.name`&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt;/// setting in the `Cargo.toml`, else Python will not be able to import the&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="sd"&gt;/// module.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#[pymodule]&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;minimizers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;: &lt;span class="kp"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;Bound&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nb"&gt;&amp;#39;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PyModule&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-&amp;gt; &lt;span class="nc"&gt;PyResult&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// Add our functions to the module.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="fm"&gt;wrap_pyfunction!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;generate_random_string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="fm"&gt;wrap_pyfunction!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;density&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(())&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Build the python code. Make sure to include the &lt;code&gt;-r&lt;/code&gt; to build in release mode.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;source&lt;/span&gt; .env/bin/activate &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; maturin develop -r&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;span class="lnt"&gt;5&#10;&lt;/span&gt;&lt;span class="lnt"&gt;6&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-txt" data-lang="txt"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;🐍 Found CPython 3.12 at /home/philae/git/eth/git/minimizers/.env/bin/python&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Compiling minimizers v0.1.0 (/home/philae/git/eth/git/minimizers)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Finished `release` profile [optimized + debuginfo] target(s) in 5.81s&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;📦 Built wheel to /tmp/.tmpq2msxE/minimizers-0.1.0-cp312-cp312-linux_x86_64.whl&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;✏️ Setting installed package as editable&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;🛠 Installed minimizers-0.1.0&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;I like to put my python files separate, so create a &lt;code&gt;py/&lt;/code&gt; directory. From&#10;there, symlink the generated library:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir py&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; py&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ln -s ../.env/lib/python3.12/site-packages/minimizers&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Now we can run the following python code:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;span class="lnt"&gt;5&#10;&lt;/span&gt;&lt;span class="lnt"&gt;6&#10;&lt;/span&gt;&lt;span class="lnt"&gt;7&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-py" data-lang="py"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;minimizers&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10000000&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;sigma&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;minimizers&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;generate_random_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sigma&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;minimizers&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;density&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;{&amp;#34;minimizer_type&amp;#34;: &amp;#34;ModSampling&amp;#34;, &amp;#34;k0&amp;#34;: 4}&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sigma&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;/li&gt;&#10;&lt;/ol&gt;</description></item><item><title>AI reading list</title><link>https://curiouscoding.nl/posts/ai-reading-list/</link><pubDate>Mon, 09 Sep 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/ai-reading-list/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://transformer-circuits.pub/2021/framework/index.html" class="external-link" target="_blank" rel="noopener"&gt;https://transformer-circuits.pub/2021/framework/index.html&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://infini-gram.io/" class="external-link" target="_blank" rel="noopener"&gt;https://infini-gram.io/&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://sleepinyourhat.github.io/checklist/" class="external-link" target="_blank" rel="noopener"&gt;https://sleepinyourhat.github.io/checklist/&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>PACE 24</title><link>https://curiouscoding.nl/posts/pace24/</link><pubDate>Thu, 05 Sep 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/pace24/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#general-observations" &gt;General observations&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#heuristic-track" &gt;Heuristic track&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#parameterized-track" &gt;Parameterized track&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#exact-track" &gt;Exact track&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;In this post I will collect some high level ideas and approaches used to solve&#10;the PACE 2024 challenge.&#10;Very briefly, the goal is to write fast solvers for NP-hard problems. The&#10;problem for the &lt;a href="https://pacechallenge.org/2024/" class="external-link" target="_blank" rel="noopener"&gt;2024 edition is one-side crossing minimization&lt;/a&gt;: Given is a&#10;bipartite graph \((A, B)\) that is drawn in standard way with the nodes of both&#10;\(A\) and \(B\) on a line, where the order of the nodes of \(A\) is fixed. The goal is&#10;to find a permutation of \(B\) that minimizes the number of edge crossings when&#10;all edges are drawn as straight lines.&lt;/p&gt;</description></item><item><title>[WIP] Feynman problems</title><link>https://curiouscoding.nl/posts/feynman-problems/</link><pubDate>Mon, 12 Aug 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/feynman-problems/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#space-dust" &gt;Space dust&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;h2 id="space-dust"&gt;&#10; &lt;span class="section-num"&gt;1&lt;/span&gt; Space dust&#10; &lt;a class="heading-link" href="#space-dust"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;What is the total mass of space dust hitting the earth during the Perseids&#10;meteor shower?&lt;/p&gt;&#10;&lt;h2 id="references"&gt;&#10; References&#10; &lt;a class="heading-link" href="#references"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;style&gt;.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}&lt;/style&gt;&lt;div class="csl-bib-body"&gt;&#10;&lt;/div&gt;</description></item><item><title>SimdMinimizers: Computing random minimizers, fast</title><link>https://curiouscoding.nl/posts/simd-minimizers/</link><pubDate>Fri, 12 Jul 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/simd-minimizers/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#intro-results" &gt;Results&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#random-minimizers" &gt;Random minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#algorithms" &gt;Algorithms&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#problem-statement" &gt;Problem statement&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#problem-a-only-the-set-of-minimizers" &gt;Problem A: Only the set of minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#problem-b-the-minimizer-of-each-window" &gt;Problem B: The minimizer of each window&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#problem-c-super-k-mers" &gt;Problem C: Super-k-mers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#which-problem-to-solve" &gt;Which problem to solve&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#canonical-k-mers" &gt;Canonical k-mers&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#the-naive-algorithm" &gt;The naive algorithm&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#naive-performance" &gt;Performance characteristics&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3&lt;/span&gt; &lt;a href="#rephrasing-as-sliding-window-minimum" &gt;Rephrasing as sliding window minimum&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.4&lt;/span&gt; &lt;a href="#the-queue" &gt;The queue&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#queue-performance" &gt;Performance characteristics&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.5&lt;/span&gt; &lt;a href="#jumping-away-with-the-queue" &gt;Jumping: Away with the queue&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#jumping-performance" &gt;Performance characteristics&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.6&lt;/span&gt; &lt;a href="#re-scan" &gt;Re-scan&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#rescan-performance" &gt;Performance characteristics&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.7&lt;/span&gt; &lt;a href="#split-windows" &gt;Split windows&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#split-perfomance" &gt;Performance characteristics&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#analysing-what-we-have-so-far" &gt;Analysing what we have so far&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1&lt;/span&gt; &lt;a href="#counting-comparisons" &gt;Counting comparisons&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#open-problem-theoretical-lower-bounds" &gt;Open problem: Theoretical lower bounds&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.2&lt;/span&gt; &lt;a href="#setting-up-benchmarking" &gt;Setting up benchmarking&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#adding-criterion" &gt;Adding criterion&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#making-criterion-fast" &gt;Making criterion fast&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a-note-on-cpu-frequency" &gt;A note on CPU frequency&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.3&lt;/span&gt; &lt;a href="#runtime-comparison-with-other-implementations" &gt;Runtime comparison with other implementations&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.4&lt;/span&gt; &lt;a href="#deeper-inspection-using-perf-stat" &gt;Deeper inspection using &lt;code&gt;perf stat&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.5&lt;/span&gt; &lt;a href="#a-first-optimization-pass" &gt;A first optimization pass&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#optimizing-buffered-reducing-branch-misses" &gt;Optimizing &lt;code&gt;Buffered&lt;/code&gt;: reducing branch misses&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#queue-is-hopelessly-branchy" &gt;&lt;code&gt;Queue&lt;/code&gt; is hopelessly branchy&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#jumping-is-already-very-efficient" &gt;&lt;code&gt;Jumping&lt;/code&gt; is already very efficient&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#optimizing-rescan" &gt;Optimizing &lt;code&gt;Rescan&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#optimizing-split" &gt;Optimizing &lt;code&gt;Split&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.6&lt;/span&gt; &lt;a href="#a-new-performance-comparison" &gt;A new performance comparison&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#rolling-our-own-hash" &gt;Rolling our own hash&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.1&lt;/span&gt; &lt;a href="#fxhash" &gt;FxHash&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#wyhash" &gt;WyHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.2&lt;/span&gt; &lt;a href="#nthash-a-rolling-hash" &gt;NtHash: a rolling hash&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#the-nthash-crate" &gt;The &lt;code&gt;nthash&lt;/code&gt; crate&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#buffered-hash-values" &gt;Buffered hash values&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.3&lt;/span&gt; &lt;a href="#making-nthash-fast-going-branchless" &gt;Making ntHash fast: going branchless&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#drop-sanity-checks" &gt;Drop sanity checks&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#drop-bound-checks" &gt;Drop bound checks&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#efficiently-collecting-to-a-vector" &gt;Efficiently collecting to a vector&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.4&lt;/span&gt; &lt;a href="#rolling-a-bit-less" &gt;Rolling a bit less&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#analysing-the-assembly-code" &gt;Analysing the assembly code&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.5&lt;/span&gt; &lt;a href="#parallel-it-is" &gt;Parallel it is&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#more-parallel" &gt;More parallel&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.6&lt;/span&gt; &lt;a href="#actual-simd-at-last" &gt;Actual SIMD, at last&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#simd-table-lookups" &gt;SIMD table lookups&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#32-bit-hashes" &gt;32-bit hashes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#shared-offsets" &gt;Shared offsets&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.7&lt;/span&gt; &lt;a href="#simd-the-gathering" &gt;SIMD: The Gathering&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#gathering-4-characters-at-a-time" &gt;Gathering 4 characters at a time&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#gathering-8-characters-at-a-time" &gt;Gathering 8 characters at a time&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#gathering-32-characters-at-a-time" &gt;Gathering 32 characters at a time&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#reusing-the-gathers" &gt;Reusing the gathers&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.8&lt;/span&gt; &lt;a href="#cached-vec" &gt;Fixing the benchmark&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#one-last-branch" &gt;One last branch&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.9&lt;/span&gt; &lt;a href="#analysis-machine-code-analysis" &gt;Analysis: Machine code analysis&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5.10&lt;/span&gt; &lt;a href="#finals-thoughts" &gt;Finals thoughts&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#doubling-down-again" &gt;Doubling down again&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#16-bit-hashes" &gt;16-bit hashes?&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#what-about-a-simple-multiply-hash" &gt;What about a simple multiply hash&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#simd-sliding-window" &gt;SIMD sliding window&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.1&lt;/span&gt; &lt;a href="#sliding-window-results" &gt;Results&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#human-genome-results" &gt;Human genome results&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#extending-into-something-useful" &gt;Extending into something useful&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.1&lt;/span&gt; &lt;a href="#collecting-minimizer-positions" &gt;Collecting minimizer positions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.2&lt;/span&gt; &lt;a href="#deduplicating-the-minimizer-positions" &gt;Deduplicating the minimizer positions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.3&lt;/span&gt; &lt;a href="#super-k-mers" &gt;Super-k-mers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.4&lt;/span&gt; &lt;a href="#canonical-k-mers" &gt;Canonical k-mers&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#nthash" &gt;NtHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#leftmost-rightmost-sliding-min" &gt;Leftmost-rightmost sliding min&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#tiebreaking" &gt;Tiebreaking&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#further-reusing-iterated-bases" &gt;Further reusing iterated bases&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;7.5&lt;/span&gt; &lt;a href="#antilex-hash" &gt;AntiLex hash&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8&lt;/span&gt; &lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;8.1&lt;/span&gt; &lt;a href="#future-work" &gt;Future work&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;SimdMinimizers has been published as a paper: &lt;a href="https://doi.org/10.1101/2025.01.27.634998" class="external-link" target="_blank" rel="noopener"&gt;DOI&lt;/a&gt;, &lt;a href="https://curiouscoding.nl/papers/simd-minimizers.pdf" &gt;PDF&lt;/a&gt;:&lt;/p&gt;</description></item><item><title>Links for talks &amp; posters</title><link>https://curiouscoding.nl/posts/links/</link><pubDate>Mon, 01 Jul 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/links/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#a-pa" &gt;A*PA&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#pa-bench" &gt;PA-Bench&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#mod-minimizers" &gt;Mod-minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;There are links for my talks and posters.&lt;/p&gt;&#10;&lt;h2 id="a-pa"&gt;&#10; A*PA&#10; &lt;a class="heading-link" href="#a-pa"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;A*PA (bioinformatic)&lt;/dt&gt;&#10;&lt;dd&gt;Groot Koerkamp, Ragnar, and Pesho Ivanov. 2024. “Exact Global Alignment Using A* with Chaining Seed Heuristic and Match Pruning.” Edited by Tobias Marschall. &lt;i&gt;Bioinformatics&lt;/i&gt; 40 (3). &lt;a href="https://doi.org/10.1093/bioinformatics/btae032"&gt;&lt;a href="https://doi.org/10.1093/bioinformatics/btae032" class="external-link" target="_blank" rel="noopener"&gt;https://doi.org/10.1093/bioinformatics/btae032&lt;/a&gt;&lt;/a&gt;.&lt;/dd&gt;&#10;&lt;dt&gt;A*PA2 (WABI24)&lt;/dt&gt;&#10;&lt;dd&gt;Groot Koerkamp, Ragnar. 2024. “A*PA2: Up to 19 Faster Exact Global Alignment.” In &lt;i&gt;Wabi 2024&lt;/i&gt;, 312:17:1–17:25. Lipics. &lt;a href="https://doi.org/10.4230/LIPIcs.WABI.2024.17"&gt;&lt;a href="https://doi.org/10.4230/LIPIcs.WABI.2024.17" class="external-link" target="_blank" rel="noopener"&gt;https://doi.org/10.4230/LIPIcs.WABI.2024.17&lt;/a&gt;&lt;/a&gt;.&lt;/dd&gt;&#10;&lt;dt&gt;Code&lt;/dt&gt;&#10;&lt;dd&gt;&lt;a href="https://github.com/RagnarGrootKoerkamp/astar-pairwise-aligner" class="external-link" target="_blank" rel="noopener"&gt;github.com/RagnarGrootKoerkamp/astar-pairwise-aligner&lt;/a&gt;&lt;/dd&gt;&#10;&lt;dt&gt;Slides&lt;/dt&gt;&#10;&lt;dd&gt;&lt;a href="https://docs.google.com/presentation/d/1_wF9SE8k-sWn6cEqns2I54NYpRbJLt8ev2ip02WMWOA" class="external-link" target="_blank" rel="noopener"&gt;slides.google.com/&amp;hellip;&lt;/a&gt;&lt;/dd&gt;&#10;&lt;dt&gt;Poster&lt;/dt&gt;&#10;&lt;dd&gt;&lt;a href="https://curiouscoding.nl/upload/astarpa-poster.pdf" &gt;curiouscoding.nl/upload/astarpa-poster.pdf&lt;/a&gt;&lt;/dd&gt;&#10;&lt;/dl&gt;&#10;&lt;h2 id="pa-bench"&gt;&#10; PA-Bench&#10; &lt;a class="heading-link" href="#pa-bench"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;Poster&lt;/dt&gt;&#10;&lt;dd&gt;&lt;a href="https://curiouscoding.nl/upload/pabench-poster.pdf" &gt;curiouscoding.nl/upload/pabench-poster.pdf&lt;/a&gt;&lt;/dd&gt;&#10;&lt;dt&gt;Code&lt;/dt&gt;&#10;&lt;dd&gt;&lt;a href="https://github.com/pairwise-alignment/pa-bench" class="external-link" target="_blank" rel="noopener"&gt;github.com/pairwise-alignment/pa-bench&lt;/a&gt;&lt;/dd&gt;&#10;&lt;/dl&gt;&#10;&lt;h2 id="mod-minimizers"&gt;&#10; Mod-minimizers&#10; &lt;a class="heading-link" href="#mod-minimizers"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;Mod-minimizer (WABI24)&lt;/dt&gt;&#10;&lt;dd&gt;Groot Koerkamp, Ragnar, and Giulio Ermanno Pibiri. 2024. “The Mod-Minimizer: A Simple and Efficient Sampling Algorithm for Long $k$-Mers.” In &lt;i&gt;Wabi 2024&lt;/i&gt;, 312:11:1–11:23. Lipics. &lt;a href="https://doi.org/10.4230/LIPIcs.WABI.2024.11"&gt;&lt;a href="https://doi.org/10.4230/LIPIcs.WABI.2024.11" class="external-link" target="_blank" rel="noopener"&gt;https://doi.org/10.4230/LIPIcs.WABI.2024.11&lt;/a&gt;&lt;/a&gt;.&lt;/dd&gt;&#10;&lt;dt&gt;Code (C++)&lt;/dt&gt;&#10;&lt;dd&gt;&lt;a href="https://github.com/jermp/minimizers" class="external-link" target="_blank" rel="noopener"&gt;github.com/jermp/minimizers&lt;/a&gt;&lt;/dd&gt;&#10;&lt;dt&gt;Code (Rust)&lt;/dt&gt;&#10;&lt;dd&gt;&lt;a href="https://github.com/RagnarGrootKoerkamp/minimizers" class="external-link" target="_blank" rel="noopener"&gt;github.com/RagnarGrootKoerkamp/minimizers&lt;/a&gt;&lt;/dd&gt;&#10;&lt;/dl&gt;&#10;&lt;h2 id="references"&gt;&#10; References&#10; &lt;a class="heading-link" href="#references"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;style&gt;.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}&lt;/style&gt;&lt;div class="csl-bib-body"&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_1"&gt;&lt;/a&gt;Daily, Jeff. 2016. “Parasail: SIMD C Library for Global, Semi-Global, and Local Pairwise Sequence Alignments.” &lt;i&gt;Bmc Bioinformatics&lt;/i&gt; 17 (1). &lt;a href="https://doi.org/10.1186/s12859-016-0930-z"&gt;https://doi.org/10.1186/s12859-016-0930-z&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_2"&gt;&lt;/a&gt;Dijkstra, Edsger W. 1959. “A Note on Two Problems in Connexion with Graphs.” &lt;i&gt;Numerische Mathematik&lt;/i&gt; 1 (1): 269–71. &lt;a href="https://doi.org/10.1007/bf01386390"&gt;https://doi.org/10.1007/bf01386390&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_3"&gt;&lt;/a&gt;Groot Koerkamp, Ragnar. 2024. “A*PA2: Up to 19 Faster Exact Global Alignment.” In &lt;i&gt;Wabi 2024&lt;/i&gt;, 312:17:1–17:25. Lipics. &lt;a href="https://doi.org/10.4230/LIPIcs.WABI.2024.17"&gt;https://doi.org/10.4230/LIPIcs.WABI.2024.17&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_4"&gt;&lt;/a&gt;Groot Koerkamp, Ragnar, and Pesho Ivanov. 2024. “Exact Global Alignment Using A* with Chaining Seed Heuristic and Match Pruning.” Edited by Tobias Marschall. &lt;i&gt;Bioinformatics&lt;/i&gt; 40 (3). &lt;a href="https://doi.org/10.1093/bioinformatics/btae032"&gt;https://doi.org/10.1093/bioinformatics/btae032&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_5"&gt;&lt;/a&gt;Groot Koerkamp, Ragnar, and Giulio Ermanno Pibiri. 2024. “The Mod-Minimizer: A Simple and Efficient Sampling Algorithm for Long $k$-Mers.” In &lt;i&gt;Wabi 2024&lt;/i&gt;, 312:11:1–11:23. Lipics. &lt;a href="https://doi.org/10.4230/LIPIcs.WABI.2024.11"&gt;https://doi.org/10.4230/LIPIcs.WABI.2024.11&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_6"&gt;&lt;/a&gt;Hirschberg, Daniel S. 1975. “A Linear Space Algorithm for Computing Maximal Common Subsequences.” &lt;i&gt;Communications of the Acm&lt;/i&gt; 18 (6): 341–43. &lt;a href="https://doi.org/10.1145/360825.360861"&gt;https://doi.org/10.1145/360825.360861&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_7"&gt;&lt;/a&gt;Ivanov, Pesho, Benjamin Bichsel, and Martin Vechev. 2022. “Fast and Optimal Sequence-to-Graph Alignment Guided by Seeds.” In &lt;i&gt;Recomb&lt;/i&gt;, 306–25. Springer International Publishing. &lt;a href="https://doi.org/10.1007/978-3-031-04749-7_22"&gt;https://doi.org/10.1007/978-3-031-04749-7_22&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_8"&gt;&lt;/a&gt;Li, Heng. 2018. “Minimap2: Pairwise Alignment for Nucleotide Sequences.” Edited by Inanc Birol. &lt;i&gt;Bioinformatics&lt;/i&gt; 34 (18): 3094–3100. &lt;a href="https://doi.org/10.1093/bioinformatics/bty191"&gt;https://doi.org/10.1093/bioinformatics/bty191&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_9"&gt;&lt;/a&gt;Liu, Daniel, and Martin Steinegger. 2023. “Block Aligner: an adaptive SIMD-accelerated aligner for sequences and position-specific scoring matrices.” &lt;i&gt;Bioinformatics&lt;/i&gt;. &lt;a href="https://doi.org/10.1093/bioinformatics/btad487"&gt;https://doi.org/10.1093/bioinformatics/btad487&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_10"&gt;&lt;/a&gt;Marco-Sola, Santiago, Jordan M Eizenga, Andrea Guarracino, Benedict Paten, Erik Garrison, and Miquel Moreto. 2023. “Optimal Gap-Affine Alignment in $O(s)$ Space.” Edited by Pier Luigi Martelli. &lt;i&gt;Bioinformatics&lt;/i&gt; 39 (2). &lt;a href="https://doi.org/10.1093/bioinformatics/btad074"&gt;https://doi.org/10.1093/bioinformatics/btad074&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_11"&gt;&lt;/a&gt;Marco-Sola, Santiago, Juan Carlos Moure, Miquel Moreto, and Antonio Espinosa. 2021. “Fast Gap-Affine Pairwise Alignment Using the Wavefront Algorithm.” &lt;i&gt;Bioinformatics&lt;/i&gt; 37 (4): 456–63. &lt;a href="https://doi.org/10.1093/bioinformatics/btaa777"&gt;https://doi.org/10.1093/bioinformatics/btaa777&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_12"&gt;&lt;/a&gt;Myers, Gene. 1986. “An $O(ND)$ Difference Algorithm and Its Variations.” &lt;i&gt;Algorithmica&lt;/i&gt; 1 (1–4): 251–66. &lt;a href="https://doi.org/10.1007/bf01840446"&gt;https://doi.org/10.1007/bf01840446&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_13"&gt;&lt;/a&gt;———. 1999. “A Fast Bit-Vector Algorithm for Approximate String Matching Based on Dynamic Programming.” &lt;i&gt;Journal of the Acm&lt;/i&gt; 46 (3): 395–415. &lt;a href="https://doi.org/10.1145/316542.316550"&gt;https://doi.org/10.1145/316542.316550&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_14"&gt;&lt;/a&gt;Suzuki, Hajime, and Masahiro Kasahara. 2018. “Introducing Difference Recurrence Relations for Faster Semi-Global Alignment of Long Sequences.” &lt;i&gt;BMC Bioinformatics&lt;/i&gt; 19 (S1). &lt;a href="https://doi.org/10.1186/s12859-018-2014-8"&gt;https://doi.org/10.1186/s12859-018-2014-8&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_15"&gt;&lt;/a&gt;Ukkonen, Esko. 1985. “Algorithms for Approximate String Matching.” &lt;i&gt;Information and Control&lt;/i&gt; 64 (1–3): 100–118. &lt;a href="https://doi.org/10.1016/s0019-9958(85)80046-2"&gt;https://doi.org/10.1016/s0019-9958(85)80046-2&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_16"&gt;&lt;/a&gt;Šošić, Martin, and Mile Šikić. 2017. “Edlib: a C/C++ library for fast, exact sequence alignment using edit distance.” Edited by John Hancock. &lt;i&gt;Bioinformatics&lt;/i&gt; 33 (9): 1394–95. &lt;a href="https://doi.org/10.1093/bioinformatics/btw753"&gt;https://doi.org/10.1093/bioinformatics/btw753&lt;/a&gt;.&lt;/div&gt;&#10;&lt;/div&gt;</description></item><item><title>A near-tight lower bound on minimizer density</title><link>https://curiouscoding.nl/posts/minimizer-lower-bound/</link><pubDate>Tue, 25 Jun 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/minimizer-lower-bound/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#succinct-background" &gt;Succinct background&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#definitions" &gt;Definitions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#lower-bounds" &gt;Lower bounds&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a-new-lower-bound" &gt;A new lower bound&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#post-scriptum" &gt;Post scriptum&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#acknowledgement" &gt;Acknowledgement&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;&lt;strong&gt;The results of this post are now published in Bioinformatics: &lt;a href="https://doi.org/10.1093/bioinformatics/btae736" class="external-link" target="_blank" rel="noopener"&gt;&lt;strong&gt;DOI&lt;/strong&gt;&lt;/a&gt;, &lt;a href="https://curiouscoding.nl/papers/sampling-lower-bound.pdf" &gt;&lt;strong&gt;PDF&lt;/strong&gt;&lt;/a&gt;:&lt;/strong&gt;&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;Kille, Bryce, Ragnar Groot Koerkamp, Drake McAdams, Alan Liu, and Todd J Treangen. 2024. “A near-tight Lower Bound on the Density of Forward Sampling Schemes.” Edited by Yann Ponty. &lt;i&gt;Bioinformatics&lt;/i&gt;, December. &lt;a href="https://doi.org/10.1093/bioinformatics/btae736"&gt;&lt;a href="https://doi.org/10.1093/bioinformatics/btae736" class="external-link" target="_blank" rel="noopener"&gt;https://doi.org/10.1093/bioinformatics/btae736&lt;/a&gt;&lt;/a&gt;.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;This content has also been absorbed into my &lt;a href="https://curiouscoding.nl/posts/minimizers/" &gt;&lt;strong&gt;thesis chapter on minimizers&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Tools for suffix array searching</title><link>https://curiouscoding.nl/posts/suffix-array-searching/</link><pubDate>Fri, 14 Jun 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/suffix-array-searching/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#sapling" &gt;Sapling&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#pla-index" &gt;PLA-Index&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#lisa-learned-index" &gt;LISA: learned index&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Let&amp;rsquo;s summarize some tools for efficiently searching suffix arrays.&lt;/p&gt;&#10;&lt;h2 id="sapling"&gt;&#10; &lt;span class="section-num"&gt;1&lt;/span&gt; Sapling&#10; &lt;a class="heading-link" href="#sapling"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Sapling (&lt;a href="#citeproc_bib_item_2"&gt;Kirsche, Das, and Schatz 2020&lt;/a&gt;) works as follows:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Choose a parameter \(p\) store for each of the \(2^p\) &lt;strong&gt;$p$-bit prefixes&lt;/strong&gt; the&#10;corresponding position in the suffix array.&lt;/li&gt;&#10;&lt;li&gt;When querying, first find the bucket for the query prefix. Then do a &lt;strong&gt;linear&#10;interpolation&lt;/strong&gt; inside the bucket.&lt;/li&gt;&#10;&lt;li&gt;Search the area \([-E, +E]\) around the interpolated position, where \(E\) is a&#10;bound on the error of the linear approximation. In practice \(E\) is only a&#10;$95\%$-confidence bound, and if the true value is not in the range, a linear&#10;search with steps of size \(E\) is done.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;The paper also introduces a neural network approach to approximating buckets,&#10;but this takes over a day to learn and is slower to query in practice.&lt;/p&gt;</description></item><item><title>Crates for suffix array construction</title><link>https://curiouscoding.nl/posts/suffix-array-crates/</link><pubDate>Thu, 13 Jun 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/suffix-array-crates/</guid><description>&lt;p&gt;Popular C libraries are:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/y-256/libdivsufsort" class="external-link" target="_blank" rel="noopener"&gt;divsufsort&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/IlyaGrebnov/libsais" class="external-link" target="_blank" rel="noopener"&gt;libsais&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Both have a &lt;code&gt;..64&lt;/code&gt; variant that supports input strings longer than &lt;code&gt;2GB&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;Rust wrappers:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://crates.io/crates/divsufsort" class="external-link" target="_blank" rel="noopener"&gt;divsufsort&lt;/a&gt;: rust reimplementation, does not support large inputs.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://crates.io/crates/cdivsufsort" class="external-link" target="_blank" rel="noopener"&gt;cdivsufsort&lt;/a&gt;: c-wrapper, does not support large inputs&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://crates.io/crates/libdivsufsort-rs" class="external-link" target="_blank" rel="noopener"&gt;livdivsufsort-rs&lt;/a&gt;: c-wrapper, &lt;strong&gt;does&lt;/strong&gt; support large inputs&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://crates.io/crates/sais" class="external-link" target="_blank" rel="noopener"&gt;sais&lt;/a&gt;: unrelated to the original library; does not implement a linear time&#10;algorithm anyway&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/Daniel-Liu-c0deb0t/libsais-rs" class="external-link" target="_blank" rel="noopener"&gt;libsais-rs&lt;/a&gt;: Daniel Liu&amp;rsquo;s fork-of-fork of &lt;a href="https://github.com/hucsmn/libsais-rs" class="external-link" target="_blank" rel="noopener"&gt;the original&lt;/a&gt;, but not on crates.io. Supports multithreading&#10;using OpenMP and wraps both the original and 64bit version.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/Daniel-Liu-c0deb0t/simple-saca" class="external-link" target="_blank" rel="noopener"&gt;simple-saca&lt;/a&gt;: Daniel Liu&amp;rsquo;s bounded-context suffix array construction that is&#10;faster than divsufsort and libsais, but does not return a true fully sorted&#10;suffix array.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="references"&gt;&#10; References&#10; &lt;a class="heading-link" href="#references"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;style&gt;.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}&lt;/style&gt;&lt;div class="csl-bib-body"&gt;&#10;&lt;/div&gt;</description></item><item><title>Thoughts on POASTA</title><link>https://curiouscoding.nl/posts/poasta/</link><pubDate>Tue, 28 May 2024 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/poasta/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#summary" &gt;Summary&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#background" &gt;Background&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#review-comments" &gt;Review comments&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#dfs" &gt;DFS&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#supplementary-methods" &gt;Supplementary methods&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#details-of-pruning" &gt;Details of pruning&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#evals" &gt;Evals&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#code-and-repo" &gt;Code &amp;amp; repo&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Here are some thoughts on POASTA (&lt;a href="#citeproc_bib_item_2"&gt;van Dijk et al. 2024&lt;/a&gt;), a recent affine-cost&#10;sequence-to-DAG (POA) aligner inspired by WFA and using A*.&lt;/p&gt;&#10;&lt;h2 id="summary"&gt;&#10; Summary&#10; &lt;a class="heading-link" href="#summary"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Take a query and a directed acyclic graph (DAG).&lt;/li&gt;&#10;&lt;li&gt;Align the query to the &lt;strong&gt;full&lt;/strong&gt; DAG. It&amp;rsquo;s like global alignment for graphs.&#10;&lt;ul&gt;&#10;&lt;li&gt;In fact I think the graph doesn&amp;rsquo;t actually have to be acyclic, as long as it has&#10;a start and end. (When there is a cycle, the maximum remaining path length&#10;is simply \(\infty\).)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Do greedy extension of matches, similar to WFA and A*PA.&#10;&lt;ul&gt;&#10;&lt;li&gt;Note that this is not as strong as full diagonal transition as done by WFA&#10;and &lt;a href="https://github.com/lh3/gwfa" class="external-link" target="_blank" rel="noopener"&gt;gWFA&lt;/a&gt; (graph WFA for unit costs only), which only consider farthest reaching states.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;In fact, this is &lt;strong&gt;the first&lt;/strong&gt; implementation of affine-cost WFA!&lt;/li&gt;&#10;&lt;li&gt;It also uses A* with the classic gap-cost heuristic extended to graphs.&#10;&lt;ul&gt;&#10;&lt;li&gt;For each point in the graph the minimal and maximal remaining distance is&#10;computed, and if the remaining query length is outside this range, the&#10;difference to get into the range is a lowerbound on number of indels.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Greedy extension is applied (although this is inherent when using WFA).&lt;/li&gt;&#10;&lt;li&gt;Suboptimal states in superbubbles are pruned using additional logic.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="background"&gt;&#10; Background&#10; &lt;a class="heading-link" href="#background"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Daniel: why is nobody doing exact banded alignment, i.e., simple band&#10;doubling, for exact DP-based alignment. We are still not convinced that A*/WFA&#10;is faster than DP, especially when divergence is not super low (\(&amp;lt;1\%\)).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="review-comments"&gt;&#10; Review comments&#10; &lt;a class="heading-link" href="#review-comments"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Fig 1 confuses me: (partly Daniel)&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;What &lt;em&gt;exactly&lt;/em&gt; does the y-axis mean? Is it like the other figures, with&#10;different branches at different y-coordinates?&lt;/li&gt;&#10;&lt;li&gt;Why horizontal stripes but no vertical stripes? (Because there are many&#10;vertical edges but few horizontal edges?)&lt;/li&gt;&#10;&lt;li&gt;What causes the bold triangles?&lt;/li&gt;&#10;&lt;li&gt;Why is the bottom 250 rows of the graph so different? A vertical plot of the&#10;graph structure feels needed to parse this.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Figs 1 and 2 should mention the cost model parameters.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Match costs are restricted to be \(0\). That&amp;rsquo;s fine, but for sequence-to-graph&#10;alignment this &lt;strong&gt;is&lt;/strong&gt; a restriction. The argument&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;a cost model with non-zero match cost can be reformulated into one with a match&#10;cost of zero (&lt;a href="#citeproc_bib_item_4"&gt;Eizenga and Paten 2022&lt;/a&gt;).&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;is false. The argument only works for global sequence-to-sequence alignment&#10;and requires that the total number of matches/mismatches/indels is known,&#10;which it is not for sequence-to-graph alignment.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Instead of \(\Delta_x,\Delta_o,\Delta_g&amp;gt;0\) it&amp;rsquo;s more accurate to say \(\Delta_o\geq 0\) since POASTA&#10;do linear-cost alignment as well.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;I wish I could read the supplement somewhere :)&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Def 1: feels cleaner to redefine \(d^{min,max}\) one smaller so the \(-1\) isn&amp;rsquo;t needed.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Def 2: maybe remark again that this omits a \(+\Delta_o\) for affine cost&#10;alignment?&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Pruning around bubbles is cool! This sounds like the equivalent of the&#10;deduplication WFA does along diagonals, but extended to graphs. I did not&#10;verify the mathematical details yet.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;A* in WFA space: there&amp;rsquo;s a difference between actually computing farthest&#10;reaching points, and only doing A* with greedy matching. Without dedupping&#10;f.r. points, some redundant work is done.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>A*PA2: Up to 19x faster exact global alignment</title><link>https://curiouscoding.nl/posts/astarpa2/</link><pubDate>Sat, 23 Mar 2024 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/astarpa2/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.1&lt;/span&gt; &lt;a href="#contributions" &gt;Contributions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2&lt;/span&gt; &lt;a href="#previous-work" &gt;Previous work&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2.1&lt;/span&gt; &lt;a href="#needleman-wunsch" &gt;Needleman-Wunsch&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2.2&lt;/span&gt; &lt;a href="#graph-algorithms" &gt;Graph algorithms&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2.3&lt;/span&gt; &lt;a href="#computational-volumes" &gt;Computational volumes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2.4&lt;/span&gt; &lt;a href="#parallelism" &gt;Parallelism&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;1.2.5&lt;/span&gt; &lt;a href="#tools" &gt;Tools&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#preliminaries" &gt;Preliminaries&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#methods" &gt;Methods&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.1&lt;/span&gt; &lt;a href="#band-doubling" &gt;Band-doubling&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.2&lt;/span&gt; &lt;a href="#blocks" &gt;Blocks&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.3&lt;/span&gt; &lt;a href="#memory" &gt;Memory&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.4&lt;/span&gt; &lt;a href="#simd" &gt;SIMD&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.5&lt;/span&gt; &lt;a href="#simd-friendly-sequence-profile" &gt;SIMD-friendly sequence profile&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.6&lt;/span&gt; &lt;a href="#traceback" &gt;Traceback&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.7&lt;/span&gt; &lt;a href="#a" &gt;A*&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.7.1&lt;/span&gt; &lt;a href="#bulk-contours-update" &gt;Bulk-contours update&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.7.2&lt;/span&gt; &lt;a href="#pre-pruning" &gt;Pre-pruning&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.8&lt;/span&gt; &lt;a href="#determining-the-rows-to-compute" &gt;Determining the rows to compute&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.8.1&lt;/span&gt; &lt;a href="#sparse-heuristic-invocation" &gt;Sparse heuristic invocation&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;3.9&lt;/span&gt; &lt;a href="#incremental-doubling" &gt;Incremental doubling&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#results" &gt;Results&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.1&lt;/span&gt; &lt;a href="#setup" &gt;Setup&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.2&lt;/span&gt; &lt;a href="#comparison-with-other-aligners" &gt;Comparison with other aligners&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;4.3&lt;/span&gt; &lt;a href="#effects-of-methods" &gt;Effects of methods&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#acknowledgements" &gt;Acknowledgements&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conflict-of-interest" &gt;Conflict of interest&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#appendix" &gt;Appendix&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.1&lt;/span&gt; &lt;a href="#bitpacking" &gt;Bitpacking&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.2&lt;/span&gt; &lt;a href="#app-comparison" &gt;Comparison with other aligners&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;span class="section-num"&gt;6.3&lt;/span&gt; &lt;a href="#app-effects" &gt;Effects of methods&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\begin{equation*}&#10;\newcommand{\g}{g^*}&#10;\newcommand{\h}{h^*}&#10;\newcommand{\f}{f^*}&#10;\newcommand{\cgap}{c_{\textrm{gap}}}&#10;\newcommand{\xor}{\ \mathrm{xor}\ }&#10;\newcommand{\and}{\ \mathrm{and}\ }&#10;\newcommand{\st}[2]{\langle #1, #2\rangle}&#10;\newcommand{\matches}{\mathcal M}&#10;\end{equation*}&lt;/p&gt;</description></item><item><title>Review of refined minimizes</title><link>https://curiouscoding.nl/posts/refined-minimizer/</link><pubDate>Fri, 26 Jan 2024 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/refined-minimizer/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#summary" &gt;Summary&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#main-issues" &gt;Main issues&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#1-dot-introduction" &gt;1. Introduction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#2-dot-methods" &gt;2. Methods&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#2-dot-3-heuristic" &gt;2.3 heuristic&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#3-dot-results" &gt;3. Results&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#code" &gt;Code&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are my review-like notes on refined minimizers, introduced in Pan and Reinert (&lt;a href="#citeproc_bib_item_4"&gt;2024&lt;/a&gt;).&lt;/p&gt;&#10;&lt;h2 id="summary"&gt;&#10; Summary&#10; &lt;a class="heading-link" href="#summary"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;The paper introduces &lt;em&gt;refined minimizers&lt;/em&gt;, a new scheme for sampling canonical&#10;minimizers that is less biased than the usual scheme.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Instead of taking the minimum of the minimizer of the forward and reverse&#10;strand, the minimizer of the strand with the higher &lt;code&gt;GT&lt;/code&gt; density is chosen.&lt;/li&gt;&#10;&lt;li&gt;The less bias towards small minimizers causes a more equal distribution of&#10;frequency of selected kmers.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="main-issues"&gt;&#10; Main issues&#10; &lt;a class="heading-link" href="#main-issues"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The methods contain a number of mistakes in the math and proofs.&lt;/li&gt;&#10;&lt;li&gt;The limit to \(|s|\) needs to be made much more precise. In fact it is a&#10;\(k\to\infty\) limit (rather than a \(w\to\infty\) limit), which seems not as useful in practice.&lt;/li&gt;&#10;&lt;li&gt;A comparison to NtHash2 should be made, for both kmer frequency distribution&#10;and speed.&lt;/li&gt;&#10;&lt;li&gt;The provided code (&lt;a href="https://github.com/xp3i4/mini_benchmark" class="external-link" target="_blank" rel="noopener"&gt;github:xp3i4/mini_benchmark&lt;/a&gt;) &lt;a href="https://github.com/xp3i4/mini_benchmark/issues/1" class="external-link" target="_blank" rel="noopener"&gt;segfaults&lt;/a&gt; and is undocumented.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="1-dot-introduction"&gt;&#10; 1. Introduction&#10; &lt;a class="heading-link" href="#1-dot-introduction"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;em&gt;the minimizer concept is a data structure&lt;/em&gt;: to me, minimizers by themselves are not a data structure.&lt;/li&gt;&#10;&lt;li&gt;\(w&amp;gt;k\): &lt;strong&gt;not needed&lt;/strong&gt;. \(w\geq 1\) is sufficient.&lt;/li&gt;&#10;&lt;li&gt;In many places, &lt;code&gt;\citep&lt;/code&gt; citations like (&lt;a href="#citeproc_bib_item_4"&gt;Pan and Reinert 2024&lt;/a&gt;) would have&#10;been more appropriate then &lt;code&gt;\citet&lt;/code&gt; ones like Pan and Reinert (&lt;a href="#citeproc_bib_item_4"&gt;2024&lt;/a&gt;).&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;of a predefined ordering scheme&lt;/em&gt;: the minimum of/over some set &lt;strong&gt;with respect&#10;to&lt;/strong&gt; some ordering scheme.&lt;/li&gt;&#10;&lt;li&gt;nitpicky imprecision: \(X\) is the set of &lt;strong&gt;positions of kmers&lt;/strong&gt;, not simply the set&#10;of &lt;strong&gt;kmer strings themselves&lt;/strong&gt;. (Or I suppose \(X\) could be a list of kmers.)&#10;(Otherwise we have \(|X| \leq 4^k\) and \(|S|\to\infty\) so that&#10;\(\rho\to 0\).)&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;a k-mer \(X = x\)&lt;/em&gt; =&amp;gt; Why not just \(x\)? The notation is confusing.&lt;/li&gt;&#10;&lt;li&gt;\(n(x)/|S|\) is not really an &lt;em&gt;average&lt;/em&gt; (there is only one string \(S\)); rather it&amp;rsquo;s a density.&lt;/li&gt;&#10;&lt;li&gt;The definition of \(V\) is not clear to me. What is random? What is counted?&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;3. Its density converges&lt;/em&gt; =&amp;gt; For \(w\to \infty\) or \(k\to\infty\) or both?&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;CMP&lt;/code&gt; (branch conditions) can be one of the slowest instructions on modern&#10;hardware. Branch misses in an inner loop for minimizer computation can&#10;severely affect performance.&lt;/li&gt;&#10;&lt;li&gt;Simple operations and L1 accesses can be pipelined and latency can be hidden,&#10;making them take 2-4x time less in practice. This makes branch-misses up to 4&#10;times as bad, relatively.&lt;/li&gt;&#10;&lt;li&gt;Are lexicographic minimizers used much in practice?&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="2-dot-methods"&gt;&#10; 2. Methods&#10; &lt;a class="heading-link" href="#2-dot-methods"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;There are a number of mistaken in the math here here and some unclarities that could use fixing.&lt;/p&gt;</description></item><item><title>Mod-minimizers and other minimizers</title><link>https://curiouscoding.nl/posts/mod-minimizers/</link><pubDate>Thu, 18 Jan 2024 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/mod-minimizers/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#applications" &gt;Applications&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#background" &gt;Background&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#minimizers" &gt;Minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#density-bounds" &gt;Density bounds&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#robust-minimizers" &gt;Robust minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#pasha" &gt;PASHA&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#miniception" &gt;Miniception&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#closed-syncmers" &gt;Closed syncmers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#bd-anchors" &gt;Bd-anchors&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#new-mod-minimizers" &gt;New: Mod-minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#experiments" &gt;Experiments&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#small-k-experiments" &gt;Small k experiments&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#search-methods" &gt;Search methods&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#directed-minimizer" &gt;Directed minimizer&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#k-1-w-2" &gt;\(k=1\), \(w=2\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#k-1-w-4" &gt;\(k=1\), \(w=4\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#k-1-w-5" &gt;\(k=1\), \(w=5\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#k-2-w-2" &gt;\(k=2\), \(w=2\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#k-2-w-4" &gt;\(k=2\), \(w=4\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#notes" &gt;Notes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#reading-list" &gt;Reading list&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\[&#10;\newcommand{\d}{\mathrm{d}}&#10;\newcommand{\L}{\mathcal{L}}&#10;\]&lt;/p&gt;&#10;&lt;p&gt;This post introduces some background for minimizers and some&#10;experiments for a new minimizer variant. That new variant is now called the&#10;&lt;em&gt;mod-minimizer&lt;/em&gt; and published at WABI24 (&lt;a href="https://doi.org/10.4230/LIPIcs.WABI.2024.11" class="external-link" target="_blank" rel="noopener"&gt;&lt;strong&gt;DOI&lt;/strong&gt;&lt;/a&gt;, &lt;a href="https://curiouscoding.nl/papers/modmini.pdf" &gt;&lt;strong&gt;PDF&lt;/strong&gt;&lt;/a&gt;) (&lt;a href="#citeproc_bib_item_5"&gt;Groot Koerkamp and Pibiri 2024&lt;/a&gt;). The paper&#10;also includes a review of existing methods, including pseudocode for&#10;most of the methods covered below.&lt;/p&gt;</description></item><item><title>Intro to Rust</title><link>https://curiouscoding.nl/posts/intro-to-rust/</link><pubDate>Tue, 16 Jan 2024 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/intro-to-rust/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#overview" &gt;Overview&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#rust-features" &gt;Rust features&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#basics" &gt;Basics&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#basic-syntax" &gt;Basic syntax&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#expressions-everywhere" &gt;Expressions everywhere!&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#closures" &gt;Closures&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#pattern-matching" &gt;Pattern matching&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#references" &gt;References&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#ownership" &gt;Ownership&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#containers" &gt;Containers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#traits" &gt;Traits&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#iterators" &gt;Iterators&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#common-libraries" &gt;Common libraries&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#ecosystem" &gt;Ecosystem&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#useful-links" &gt;Useful links&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#hands-on" &gt;Hands-on&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#installation" &gt;Installation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#create-a-project" &gt;Create a project&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#hello-world" &gt;Hello, world!&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#small-project-ideas" &gt;Small project ideas&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are notes for a quick introduction to Rust.&lt;/p&gt;&#10;&lt;h2 id="overview"&gt;&#10; Overview&#10; &lt;a class="heading-link" href="#overview"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Statically typed &amp;amp; Compiled language.&lt;/li&gt;&#10;&lt;li&gt;Great developer experience:&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;cargo&lt;/code&gt; build system&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;rust-analyzer&lt;/code&gt; LSP&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="rust-features"&gt;&#10; Rust features&#10; &lt;a class="heading-link" href="#rust-features"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;h3 id="basics"&gt;&#10; Basics&#10; &lt;a class="heading-link" href="#basics"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;div class="ox-hugo-table small"&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;C++&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Rust&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;std::size_t&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;usize&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;std::pointerdiff_t&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;isize&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;int&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;i32&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;unsigned int&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;u32&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;long long&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;i64&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;unsigned long long&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;u64&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;string&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;String&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;string_view&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&amp;amp;str&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;byte&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;u8&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;char&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;char&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;vector&amp;lt;T&amp;gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Vec&amp;lt;T&amp;gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;array&amp;lt;int, 4&amp;gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;[u32; 4]&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;int[]&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&amp;amp;[u32]&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;T&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;T&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;const T&amp;amp;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&amp;amp;T&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;T&amp;amp;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&amp;amp;mut T&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;T*&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;unsafe { T* }&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;unique_ptr&amp;lt;T&amp;gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Box&amp;lt;T&amp;gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;optional&amp;lt;T&amp;gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Option&amp;lt;T&amp;gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;variant&amp;lt;T, E&amp;gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Result&amp;lt;T, E&amp;gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;div class="ox-hugo-table small"&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;C++&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Rust&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;for(int i = 0; i &amp;lt; n; ++i) {}&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;for i in 0..n {}&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;while(true) {}&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;loop {}&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;while(f()) {}&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;while f() {}&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;do { } while (f());&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;loop { if !f() { break; } }&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;switch x { case 1:; }&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;match x { 1 =&amp;gt; {} }&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;div class="ox-hugo-table small"&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;C++&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Rust&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;cout &amp;lt;&amp;lt; &amp;ldquo;text&amp;rdquo; &amp;lt;&amp;lt; endl;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;println!(&amp;ldquo;text&amp;rdquo;);&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;cout &amp;lt;&amp;lt; 1+1 &amp;lt;&amp;lt; endl;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;println!(&amp;quot;{}&amp;quot;, 1+1);&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;cout &amp;lt;&amp;lt; n &amp;lt;&amp;lt; endl;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;println!(&amp;quot;{n}&amp;quot;);&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;h3 id="basic-syntax"&gt;&#10; Basic syntax&#10; &lt;a class="heading-link" href="#basic-syntax"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;span class="lnt"&gt;12&#10;&lt;/span&gt;&lt;span class="lnt"&gt;13&#10;&lt;/span&gt;&lt;span class="lnt"&gt;14&#10;&lt;/span&gt;&lt;span class="lnt"&gt;15&#10;&lt;/span&gt;&lt;span class="lnt"&gt;16&#10;&lt;/span&gt;&lt;span class="lnt"&gt;17&#10;&lt;/span&gt;&lt;span class="lnt"&gt;18&#10;&lt;/span&gt;&lt;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;span class="lnt"&gt;30&#10;&lt;/span&gt;&lt;span class="lnt"&gt;31&#10;&lt;/span&gt;&lt;span class="lnt"&gt;32&#10;&lt;/span&gt;&lt;span class="lnt"&gt;33&#10;&lt;/span&gt;&lt;span class="lnt"&gt;34&#10;&lt;/span&gt;&lt;span class="lnt"&gt;35&#10;&lt;/span&gt;&lt;span class="lnt"&gt;36&#10;&lt;/span&gt;&lt;span class="lnt"&gt;37&#10;&lt;/span&gt;&lt;span class="lnt"&gt;38&#10;&lt;/span&gt;&lt;span class="lnt"&gt;39&#10;&lt;/span&gt;&lt;span class="lnt"&gt;40&#10;&lt;/span&gt;&lt;span class="lnt"&gt;41&#10;&lt;/span&gt;&lt;span class="lnt"&gt;42&#10;&lt;/span&gt;&lt;span class="lnt"&gt;43&#10;&lt;/span&gt;&lt;span class="lnt"&gt;44&#10;&lt;/span&gt;&lt;span class="lnt"&gt;45&#10;&lt;/span&gt;&lt;span class="lnt"&gt;46&#10;&lt;/span&gt;&lt;span class="lnt"&gt;47&#10;&lt;/span&gt;&lt;span class="lnt"&gt;48&#10;&lt;/span&gt;&lt;span class="lnt"&gt;49&#10;&lt;/span&gt;&lt;span class="lnt"&gt;50&#10;&lt;/span&gt;&lt;span class="lnt"&gt;51&#10;&lt;/span&gt;&lt;span class="lnt"&gt;52&#10;&lt;/span&gt;&lt;span class="lnt"&gt;53&#10;&lt;/span&gt;&lt;span class="lnt"&gt;54&#10;&lt;/span&gt;&lt;span class="lnt"&gt;55&#10;&lt;/span&gt;&lt;span class="lnt"&gt;56&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// trailing return type&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;square&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;: &lt;span class="kt"&gt;u32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-&amp;gt; &lt;span class="kt"&gt;u32&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// return on last line can be omitted&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// mutable reference&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;: &lt;span class="kp"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;mut&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;u32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// Introduce variables with let.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// Types are automatically inferred.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// b is mutable.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// c, d, and e are usize:&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;: &lt;span class="kt"&gt;usize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="k"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;usize&lt;/span&gt;::&lt;span class="no"&gt;MAX&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// No parentheses needed.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// This shouldn&amp;#39;t happen.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;panic!&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// 0..n is a `Range`.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// Ranges are `IntoIterator` and converted into an iterator, which is looped over.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// Print i to a line on stderr.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;{i}&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;loop&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;square&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1000000000&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// Pattern matching&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;match&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;panic!&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;todo!&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;small&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;even &lt;/span&gt;&lt;span class="si"&gt;{x}&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;odd&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;h3 id="expressions-everywhere"&gt;&#10; Expressions everywhere!&#10; &lt;a class="heading-link" href="#expressions-everywhere"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;span class="lnt"&gt;12&#10;&lt;/span&gt;&lt;span class="lnt"&gt;13&#10;&lt;/span&gt;&lt;span class="lnt"&gt;14&#10;&lt;/span&gt;&lt;span class="lnt"&gt;15&#10;&lt;/span&gt;&lt;span class="lnt"&gt;16&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;loop&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;mut&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;match&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;None&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;h3 id="closures"&gt;&#10; Closures&#10; &lt;a class="heading-link" href="#closures"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;double&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;double&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;multiply&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;: &lt;span class="kt"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;: &lt;span class="kt"&gt;usize&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-&amp;gt; &lt;span class="kt"&gt;usize&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;h3 id="pattern-matching"&gt;&#10; Pattern matching&#10; &lt;a class="heading-link" href="#pattern-matching"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;span class="lnt"&gt;12&#10;&lt;/span&gt;&lt;span class="lnt"&gt;13&#10;&lt;/span&gt;&lt;span class="lnt"&gt;14&#10;&lt;/span&gt;&lt;span class="lnt"&gt;15&#10;&lt;/span&gt;&lt;span class="lnt"&gt;16&#10;&lt;/span&gt;&lt;span class="lnt"&gt;17&#10;&lt;/span&gt;&lt;span class="lnt"&gt;18&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;: &lt;span class="nb"&gt;Option&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;i32&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;match&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;I am 0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;I am even&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;I am &lt;/span&gt;&lt;span class="si"&gt;{x}&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;None&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;I am none&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;a = Some(&lt;/span&gt;&lt;span class="si"&gt;{x}&lt;/span&gt;&lt;span class="s"&gt;)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;};&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;{x}&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;h3 id="references"&gt;&#10; References&#10; &lt;a class="heading-link" href="#references"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;h3 id="ownership"&gt;&#10; Ownership&#10; &lt;a class="heading-link" href="#ownership"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;h3 id="containers"&gt;&#10; Containers&#10; &lt;a class="heading-link" href="#containers"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;span class="lnt"&gt;5&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Create an array&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;: &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// Create a vec&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;: &lt;span class="nb"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;usize&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;vec!&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="k"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="fm"&gt;assert_eq!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Slices are not equal!&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;h3 id="traits"&gt;&#10; Traits&#10; &lt;a class="heading-link" href="#traits"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;span class="lnt"&gt;12&#10;&lt;/span&gt;&lt;span class="lnt"&gt;13&#10;&lt;/span&gt;&lt;span class="lnt"&gt;14&#10;&lt;/span&gt;&lt;span class="lnt"&gt;15&#10;&lt;/span&gt;&lt;span class="lnt"&gt;16&#10;&lt;/span&gt;&lt;span class="lnt"&gt;17&#10;&lt;/span&gt;&lt;span class="lnt"&gt;18&#10;&lt;/span&gt;&lt;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;trait&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MyTrait&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;my_fn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;impl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MyTrait&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;usize&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;my_fn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;I am a usize!&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;impl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MyTrait&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;i32&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;my_fn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;I am a i32!&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;: &lt;span class="nc"&gt;impl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MyTrait&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;my_fn&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// i32 by default&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;my_fn&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="k"&gt;usize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;my_fn&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;h3 id="iterators"&gt;&#10; Iterators&#10; &lt;a class="heading-link" href="#iterators"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;span class="lnt"&gt;12&#10;&lt;/span&gt;&lt;span class="lnt"&gt;13&#10;&lt;/span&gt;&lt;span class="lnt"&gt;14&#10;&lt;/span&gt;&lt;span class="lnt"&gt;15&#10;&lt;/span&gt;&lt;span class="lnt"&gt;16&#10;&lt;/span&gt;&lt;span class="lnt"&gt;17&#10;&lt;/span&gt;&lt;span class="lnt"&gt;18&#10;&lt;/span&gt;&lt;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-rust" data-lang="rust"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;i=&lt;/span&gt;&lt;span class="si"&gt;{}&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;collect_vec&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;x=&lt;/span&gt;&lt;span class="si"&gt;{}&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iter&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;{i:&amp;gt;2}&lt;/span&gt;&lt;span class="s"&gt; =&amp;gt; &lt;/span&gt;&lt;span class="si"&gt;{x}&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iter&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;x=&lt;/span&gt;&lt;span class="si"&gt;{}&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iter&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="fm"&gt;eprintln!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;square: &lt;/span&gt;&lt;span class="si"&gt;{}&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;h3 id="common-libraries"&gt;&#10; Common libraries&#10; &lt;a class="heading-link" href="#common-libraries"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;See &lt;a href="https://blessed.rs" class="external-link" target="_blank" rel="noopener"&gt;blessed.rs&lt;/a&gt; for a list of commonly used and recommended libraries.&lt;/p&gt;</description></item><item><title>Notes on bidirectional anchors</title><link>https://curiouscoding.nl/posts/bd-anchors/</link><pubDate>Mon, 15 Jan 2024 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/bd-anchors/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#paper-overview" &gt;Paper overview&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#remarks-on-the-paper" &gt;Remarks on the paper&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#thoughts" &gt;Thoughts&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\[&#10;\newcommand{\A}{\mathcal{A}_\ell}&#10;\newcommand{\T}{\mathcal{T}_\ell}&#10;\]&lt;/p&gt;&#10;&lt;p&gt;These are some notes on &lt;em&gt;Bidirectional String Anchors&lt;/em&gt; (&lt;a href="#citeproc_bib_item_2"&gt;Loukides, Pissis, and Sweering 2023&lt;/a&gt;), also&#10;called &lt;em&gt;bd-anchors&lt;/em&gt;.&lt;/p&gt;&#10;&lt;p&gt;Resources:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Loukides and Pissis (&lt;a href="#citeproc_bib_item_3"&gt;2021&lt;/a&gt;): preceding conference paper with subset of content.&lt;/li&gt;&#10;&lt;li&gt;Loukides, Pissis, and Sweering (&lt;a href="#citeproc_bib_item_2"&gt;2023&lt;/a&gt;): The paper discussed here.&lt;/li&gt;&#10;&lt;li&gt;Ayad, Loukides, and Pissis (&lt;a href="#citeproc_bib_item_1"&gt;2023&lt;/a&gt;): follow-up/second paper containing&#10;&lt;ul&gt;&#10;&lt;li&gt;a faster average-case \(O(n)\) construction algorithm;&lt;/li&gt;&#10;&lt;li&gt;a more memory efficient construction algorithms for the index.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/solonas13/bd-anchors" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/solonas13/bd-anchors&lt;/a&gt;: code for first paper&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/lorrainea/BDA-index" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/lorrainea/BDA-index&lt;/a&gt;: code for follow-up paper&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The remainder of this post is split into &lt;a href="#paper-overview" &gt;an overview of the paper&lt;/a&gt;, &lt;a href="#remarks-on-the-paper" &gt;Remarks on the paper&lt;/a&gt;, and further &lt;a href="#thoughts" &gt;Thoughts&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Notes on SsHash</title><link>https://curiouscoding.nl/posts/sshash/</link><pubDate>Mon, 15 Jan 2024 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/sshash/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#paper-summary" &gt;Paper summary&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#intro" &gt;Intro&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#prelims" &gt;Prelims&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#related-work" &gt;Related work&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#sparse-and-skew-hashing" &gt;Sparse and skew hashing&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#remarks" &gt;Remarks&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#ideas" &gt;Ideas&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\[\newcommand{\S}{\mathcal{S}}\]&lt;/p&gt;&#10;&lt;h2 id="paper-summary"&gt;&#10; Paper summary&#10; &lt;a class="heading-link" href="#paper-summary"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;h3 id="intro"&gt;&#10; Intro&#10; &lt;a class="heading-link" href="#intro"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;SsHash (&lt;a href="#citeproc_bib_item_7"&gt;Pibiri 2022&lt;/a&gt;) is a datastructure for indexing kmers.&#10;Given a set of kmers \(\S\), it supports two operations:&lt;/p&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;\(Lookup(g)\)&lt;/dt&gt;&#10;&lt;dd&gt;return the unique id \(i\in [|\S|]\) of the kmer \(g\).&lt;/dd&gt;&#10;&lt;dt&gt;\(Access(i)\)&lt;/dt&gt;&#10;&lt;dd&gt;return the kmer corresponding to id \(i\).&lt;/dd&gt;&#10;&lt;/dl&gt;&#10;&lt;p&gt;It also supports &lt;em&gt;streaming&lt;/em&gt; queries, looking up all kmers from a longer string&#10;consecutively, by expoiting the overlap between them.&lt;/p&gt;</description></item><item><title>One Billion Row Challenge</title><link>https://curiouscoding.nl/posts/1brc/</link><pubDate>Wed, 03 Jan 2024 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/1brc/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#external-links" &gt;External links&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#the-problem" &gt;The problem&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#initial-solution-105s" &gt;Initial solution: 105s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#first-flamegraph" &gt;First flamegraph&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#bytes-instead-of-strings-72s" &gt;Bytes instead of strings: 72s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#manual-parsing-61s" &gt;Manual parsing: 61s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#inline-hash-keys-50s" &gt;Inline hash keys: 50s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#faster-hash-function-41s" &gt;Faster hash function: 41s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a-new-flame-graph" &gt;A new flame graph&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#perf-it-is" &gt;Perf it is&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#something-simple-allocating-the-right-size-41s" &gt;Something simple: allocating the right size: 41s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#memchr-for-scanning-47s" &gt;&lt;code&gt;memchr&lt;/code&gt; for scanning: 47s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#memchr-crate-29s" &gt;&lt;code&gt;memchr&lt;/code&gt; crate: 29s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#get-unchecked-28s" &gt;&lt;code&gt;get_unchecked&lt;/code&gt;: 28s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#manual-simd-29s" &gt;Manual SIMD: 29s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#profiling" &gt;Profiling&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#revisiting-the-key-function-23s" &gt;Revisiting the key function: 23s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#ptrhash-perfect-hash-function-17s" &gt;PtrHash perfect hash function: 17s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#larger-masks-15s" &gt;Larger masks: 15s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#reduce-pattern-matching-14s" &gt;Reduce pattern matching: 14s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#memory-map-12s" &gt;Memory map: 12s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#parallelization-2-dot-0s" &gt;Parallelization: 2.0s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#branchless-parsing-1-dot-7s" &gt;Branchless parsing: 1.7s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#purging-all-branches-1-dot-67s" &gt;Purging all branches: 1.67s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#some-more-attempts" &gt;Some more attempts&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#faster-perfect-hashing-1-dot-55s" &gt;Faster perfect hashing: 1.55s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#bug-time-back-up-to-1-dot-71s" &gt;Bug time: Back up to 1.71s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#temperatures-less-than-100-1-dot-62s" &gt;Temperatures less than 100: 1.62s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#computing-min-as-a-max-1-dot-50" &gt;Computing &lt;code&gt;min&lt;/code&gt; as a &lt;code&gt;max&lt;/code&gt;: 1.50&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#intermezzo-hyperthreading-1-dot-34s" &gt;Intermezzo: Hyperthreading: 1.34s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#not-parsing-negative-numbers-1-dot-48s" &gt;Not parsing negative numbers: 1.48s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#more-efficient-parsing-1-dot-44s" &gt;More efficient parsing: 1.44s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#fixing-undefined-behaviour-back-to-1-dot-56s" &gt;Fixing undefined behaviour: back to 1.56s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#lazily-subtracting-b-0-1-dot-52s" &gt;Lazily subtracting &lt;code&gt;b'0'&lt;/code&gt;: 1.52s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#min-max-without-parsing-1-dot-55s" &gt;Min/max without parsing: 1.55s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#parsing-using-a-single-multiplication-doesn-t-work" &gt;Parsing using a single multiplication: doesn&amp;rsquo;t work&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#parsing-using-a-single-multiplication-does-work-after-all-1-dot-48s" &gt;Parsing using a single multiplication does work after all! 1.48s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a-side-note-ascii" &gt;A side note: ASCII&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#skip-parsing-using-pdep-1-dot-42s" &gt;Skip parsing using &lt;code&gt;PDEP&lt;/code&gt;: 1.42s&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#improved" &gt;Improved&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a-further-note" &gt;A further note&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#branchy-min-max-1-dot-37s" &gt;Branchy min/max: 1.37s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#no-counting-1-dot-34s" &gt;No counting: 1.34s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#arbitrary-long-city-names-1-dot-34" &gt;Arbitrary long city names: 1.34&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#4-entries-in-parallel-1-dot-23s" &gt;4 entries in parallel: 1.23s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#mmap-per-thread" &gt;Mmap per thread&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#reordering-some-operations-1-dot-19s" &gt;Reordering some operations: 1.19s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#reordering-more-1-dot-11s" &gt;Reordering more: 1.11s&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#even-more-ilp-1-dot-05" &gt;Even more ILP: 1.05&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#compliance-1-ok-i-ll-count-1-dot-06" &gt;Compliance 1, OK I&amp;rsquo;ll count: 1.06&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#d41d8c" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; &lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#postscript" &gt;Postscript&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;A youtube video on this post is &lt;a href="https://youtu.be/e_9ziFKcEhw?si=JHy4aVliKw9gfryf&amp;amp;t=896" class="external-link" target="_blank" rel="noopener"&gt;here&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>NtHash1: making it perfect</title><link>https://curiouscoding.nl/posts/nthash/</link><pubDate>Sun, 31 Dec 2023 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/nthash/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#nthash" &gt;NtHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#minimizers" &gt;Minimizers&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#robust-minimizers" &gt;Robust minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#is-nthash-injective-on-kmers" &gt;Is NtHash injective on kmers?&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#searching-for-a-collision" &gt;Searching for a collision&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#proving-perfection" &gt;Proving perfection&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#alternatives" &gt;Alternatives&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#smhasher-results" &gt;SmHasher results&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This is the first post in (by now) a series of 3 posts on NtHash:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://curiouscoding.nl/posts/nthash/" &gt;&lt;strong&gt;NtHash1: making it perfect&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://curiouscoding.nl/posts/nthash2-collisions/" &gt;NtHash2: investigating collisions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://curiouscoding.nl/posts/nthash-revisited/" &gt;NtHash3: first ideas&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="nthash"&gt;&#10; NtHash&#10; &lt;a class="heading-link" href="#nthash"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;NtHash (&lt;a href="#citeproc_bib_item_4"&gt;Mohamadi et al. 2016&lt;/a&gt;) is a rolling hash suitable for hashing any kind of text, but made for DNA originally.&#10;For a string of length \(k\) it is a \(64\) bit value computed as:&lt;/p&gt;</description></item><item><title>A*PA talk @ CWI</title><link>https://curiouscoding.nl/posts/astarpa-talk-cwi/</link><pubDate>Wed, 27 Dec 2023 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/astarpa-talk-cwi/</guid><description>&lt;p&gt;I recently gave a talk about A*PA at CWI.&#10;Sadly the recording doesn&amp;rsquo;t show the blackboard, but either way, find it &lt;a href="https://curiouscoding.nl/talks/astarpa-talk-cwi.mp4" &gt;here&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Notes on implementing Longest Common Repeat (LCR)</title><link>https://curiouscoding.nl/posts/longest-common-repeat/</link><pubDate>Wed, 06 Dec 2023 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/longest-common-repeat/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#notes" &gt;Notes&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#coloured-tree-problem" &gt;Coloured Tree Problem&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#generic-sparse-suffix-array" &gt;Generic sparse suffix array&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#sparse-suffix-array-on-minimizers" &gt;Sparse suffix array on minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#discussion-todos" &gt;Discussion / TODOs&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#evals" &gt;Evals&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are my running notes on implementing an algorithm for Longest Common&#10;Repeat using minimizers.&lt;/p&gt;&#10;&lt;h2 id="notes"&gt;&#10; Notes&#10; &lt;a class="heading-link" href="#notes"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;h3 id="coloured-tree-problem"&gt;&#10; Coloured Tree Problem&#10; &lt;a class="heading-link" href="#coloured-tree-problem"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;See Lemma 3 at &lt;a href="https://drops.dagstuhl.de/storage/00lipics/lipics-vol105-cpm2018/LIPIcs.CPM.2018.23/LIPIcs.CPM.2018.23.pdf" class="external-link" target="_blank" rel="noopener"&gt;here&lt;/a&gt;&lt;/p&gt;&#10;&lt;h3 id="generic-sparse-suffix-array"&gt;&#10; Generic sparse suffix array&#10; &lt;a class="heading-link" href="#generic-sparse-suffix-array"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;paper: &lt;a href="https://arxiv.org/pdf/2310.09023.pdf" class="external-link" target="_blank" rel="noopener"&gt;https://arxiv.org/pdf/2310.09023.pdf&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;code: &lt;a href="https://github.com/lorrainea/SSA/blob/main/PA/ssa.cc" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/lorrainea/SSA/blob/main/PA/ssa.cc&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;For random strings and \(b \leq n / \log n\), direct radix sort on $2log n + log&#10;log n$-bit&#10;prefixes is sufficient for \(O(n)\) runtime. In fact, since computer word size&#10;\(w\geq \log n\), we only need at most \(2\) rounds of radix sort! (See simple-saca.)&lt;/p&gt;</description></item><item><title>ALPACA/PANGAIA winter workshop notes</title><link>https://curiouscoding.nl/posts/winter-workshop-2023/</link><pubDate>Mon, 20 Nov 2023 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/winter-workshop-2023/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#monday" &gt;Monday&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#fimpera-bloom-filter-for-kmers" &gt;Fimpera: bloom filter for kmers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#progress-of-tools" &gt;Progress of tools&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#order-preserving-mphf-of-minimizers" &gt;Order-preserving MPHF of minimizers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#algorithmic-bottlenecks-in-sshash" &gt;Algorithmic bottlenecks in SSHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#fourier-transform-of-the-human-genome" &gt;Fourier transform of the human genome?&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#tuesday" &gt;Tuesday&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#variant-types" &gt;Variant types&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wednesday" &gt;Wednesday&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#sshash" &gt;SSHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#pthash" &gt;PTHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#de-bruijn-graphs" &gt;de Bruijn Graphs&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are notes of discussions at the ALPACA/PANGAIA conference in&#10;November 2023.&lt;/p&gt;&#10;&lt;h2 id="monday"&gt;&#10; Monday&#10; &lt;a class="heading-link" href="#monday"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;I had interesting discussions with Giulio, Paul, and Lucas Robidou.&lt;/p&gt;</description></item><item><title>Notes on writing course</title><link>https://curiouscoding.nl/posts/writing-course/</link><pubDate>Tue, 14 Nov 2023 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/writing-course/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#lecture-1-14-november" &gt;Lecture 1, 14 November&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#resources" &gt;Resources&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#reader-friendlyness" &gt;Reader friendlyness&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#typical-problems" &gt;Typical problems&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#lecture-2-21-november" &gt;Lecture 2, 21 November&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#paragraph-level-expectations" &gt;Paragraph level expectations&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#flow" &gt;Flow&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#assignment-for-next-week" &gt;Assignment for next week&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#lecture-3-28-november" &gt;Lecture 3, 28 November&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#bad-organization" &gt;Bad organization&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#figures" &gt;Figures&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#references-to-figures" &gt;References to figures&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#indicative-vs-informative--ex-dot-7" &gt;Indicative vs Informative (ex. 7)&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#lecture-4-december-5" &gt;Lecture 4, December 5&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#tense" &gt;Tense&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#lecture-5-december-12" &gt;Lecture 5, December 12&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#abstracts" &gt;Abstracts&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#titles" &gt;Titles&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#punctuation" &gt;Punctuation&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#comma" &gt;Comma&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#dashes" &gt;Dashes&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Some notes from the writing course I&amp;rsquo;m taking.&lt;/p&gt;</description></item><item><title>BAPCtools instruction</title><link>https://curiouscoding.nl/posts/bapctools-demo/</link><pubDate>Tue, 17 Oct 2023 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/bapctools-demo/</guid><description>&lt;p&gt;Steps:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Clone &lt;a href="https://github.com/RagnarGrootKoerkamp/BAPCtools" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/RagnarGrootKoerkamp/BAPCtools&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;Make an alias to the executable:&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ln -s ~/git/BAPCtools/bin/tools.py ~/bin/bt&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;/li&gt;&#10;&lt;li&gt;Create a new problem:&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/problems&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bt new_problem my_problem_name&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/problems/my_problem_name&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;/li&gt;&#10;&lt;li&gt;You now have the following:&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;span class="lnt"&gt;12&#10;&lt;/span&gt;&lt;span class="lnt"&gt;13&#10;&lt;/span&gt;&lt;span class="lnt"&gt;14&#10;&lt;/span&gt;&lt;span class="lnt"&gt;15&#10;&lt;/span&gt;&lt;span class="lnt"&gt;16&#10;&lt;/span&gt;&lt;span class="lnt"&gt;17&#10;&lt;/span&gt;&lt;span class="lnt"&gt;18&#10;&lt;/span&gt;&lt;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-txt" data-lang="txt"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── data&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── sample&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   │   └── 1.in # Sample testcase input&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   │   └── 1.ans # Sample testcase output&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   └── secret&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── generators # for later&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   └── ...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── input_validators # for later&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   └── ...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── output_validators # for later&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   └── ...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── problem_statement&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── figure.tex.template&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── problem.en.tex # The problem statement&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── problem.yaml&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── submissions&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── accepted&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │   └── name.cpp # A submission&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── run_time_error&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── time_limit_exceeded&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └── wrong_answer&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;/li&gt;&#10;&lt;li&gt;Edit the statement &lt;code&gt;problem.en.tex&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Make some samples by hand in &lt;code&gt;data/samples/*.{in,ans}&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Write a solution in &lt;code&gt;submissions/accepted/&amp;lt;yourname&amp;gt;.{py,cpp,java}&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;Use &lt;code&gt;bt run&lt;/code&gt; or &lt;code&gt;bt run submissions/accepted/&amp;lt;submission&amp;gt;&lt;/code&gt; to test your submission.&lt;/li&gt;&#10;&lt;/ol&gt;</description></item><item><title>PtrHash: Notes on adapting PTHash in Rust</title><link>https://curiouscoding.nl/posts/ptrhash-log/</link><pubDate>Thu, 21 Sep 2023 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/ptrhash-log/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#questions-and-remarks-on-pthash-paper" &gt;Questions and remarks on PTHash paper&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#ideas-for-improvement" &gt;Ideas for improvement&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#parameters" &gt;Parameters&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#align-packed-vectors-to-cachelines" &gt;Align packed vectors to cachelines&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#prefetching" &gt;Prefetching&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#faster-modulo-operations" &gt;Faster modulo operations&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#store-dictionary-d-sorted-using-elias-fano-coding" &gt;Store dictionary \(D\) sorted using Elias-Fano coding&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#how-many-bits-of-n-and-hash-entropy-do-we-need" &gt;How many bits of \(n\) and hash entropy do we need?&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#ideas-for-faster-construction" &gt;Ideas for faster construction&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#implementation-log" &gt;Implementation log&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#hashing-function" &gt;Hashing function&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#bitpacking-crates" &gt;Bitpacking crates&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#construction" &gt;Construction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#fastmod" &gt;Fastmod&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#try-out-fastdivide-and-reciprocal-crates" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Try out &lt;code&gt;fastdivide&lt;/code&gt; and &lt;code&gt;reciprocal&lt;/code&gt; crates&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#first-benchmark" &gt;First benchmark&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#faster-bucket-computation" &gt;Faster bucket computation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#branchless-for-real-now--aka-the-trick-of-thirds" &gt;Branchless, for real now! (aka the trick-of-thirds)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#compiling-and-benchmarking-pthash" &gt;Compiling and benchmarking PTHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#compact-encoding" &gt;Compact encoding&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#find-the-x-differences" &gt;Find the \(x\) differences&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#fastreduce-revisited" &gt;&lt;code&gt;FastReduce&lt;/code&gt; revisited&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#is-there-a-problem-if-gcd--m-n--is-large" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Is there a problem if \(\gcd(m, n)\) is large?&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#faster-hashing" &gt;Faster hashing&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#try-xxhash" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Try xxhash&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#an-experiment" &gt;An experiment&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#compiler-struggles" &gt;Compiler struggles&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#prefetching-at-last" &gt;Prefetching, at last&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#prefetching-with-vectorization" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Prefetching with vectorization&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#inverting-hki" &gt;Inverting \(h(k_i)\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#another-day-of-progress" &gt;Another day of progress&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#possible-sorting-algorithms" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Possible sorting algorithms&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#diving-into-the-inverse-hash-problem" &gt;Diving into the inverse hash problem&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#bringing-it-home" &gt;Bringing it home&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#hash-inversion-for-faster-pthash-construction" &gt;Hash-inversion for faster PTHash construction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#fast-path-for-small-buckets" &gt;Fast path for small buckets&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#dictionary-encoding" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Dictionary encoding&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#larger-buckets" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Larger buckets&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#prefetching-free-slots" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Prefetching free slots&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#filling-the-last-few-empty-slots-needs-very-high-k-i" &gt;Filling the last few empty slots needs very high \(k_i\)!&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#perfect-matching-for-the-tail" &gt;Perfect matching for the tail&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#peeling-for-size-1-buckets" &gt;Peeling for size-1 buckets&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#greedy-peeling-1-assigning-from-hard-to-easy" &gt;Greedy peeling 1: Assigning from hard to easy&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#peeling-and-cuckoo-hashing-for-larger-buckets-dot" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Peeling and cuckoo hashing for larger buckets.&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#sunday-morning-ideas" &gt;Sunday morning ideas&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#dinic" &gt;Dinic&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#new-iterative-greedy-assignment-idea" &gt;New iterative greedy assignment idea&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#cuckoo-hashing-again" &gt;Cuckoo hashing, again&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#cuckoo-hashing-displacing-for-real-now" &gt;Cuckoo hashing / displacing, &lt;em&gt;for real now&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#displacing-globally" &gt;Displacing globally&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#running-it" &gt;Running it&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#limitations" &gt;Limitations&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#cleanup-and-revisiting-defaults" &gt;Cleanup and revisiting defaults&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#sum-instead-of-xor" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Sum instead of xor?&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#revisiting-alpha-1" &gt;Revisiting \(\alpha &amp;lt; 1\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#elias-fano-for-the-remap-dictionary" &gt;Elias-Fano for the remap-dictionary&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#global-iterative-prioritizing" &gt;Global iterative prioritizing&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#cleanup-removing-peeling-and-suboptimal-displacing-code" &gt;Cleanup: removing peeling and suboptimal displacing code&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#some-speedups-to-the-displacement-algorithm" &gt;Some speedups to the displacement algorithm&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#runtime-analysis-of-displacement-algorithm" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Runtime analysis of displacement algorithm&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#optimal-prefetching-strategy" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Optimal prefetching strategy&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#are-we-close-to-the-memory-bandwidth" &gt;Are we close to the memory bandwidth?&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#more-sorting-algorithm-resources" &gt;More sorting algorithm resources&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#and-some-resources-on-partitioning" &gt;And some resources on partitioning&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#partitioning-to-reduce-memory-latency" &gt;Partitioning to reduce memory latency&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#back-from-a-break" &gt;Back from a break!&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#speeding-up-the-search-for-pilots" &gt;Speeding up the search for pilots&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#multiplyreduce" &gt;&lt;code&gt;MultiplyReduce&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#linux-hugepages" &gt;Linux hugepages?&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#dropping-the-bucket-split" &gt;Dropping the bucket split?&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#build-performance" &gt;Build performance&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#an-alternative" &gt;An alternative&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#query-performance" &gt;Query performance&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#query-memory-bandwidth" &gt;Query memory bandwidth&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#some-more-experiments" &gt;Some more experiments&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#multithreading-benchmark" &gt;Multithreading benchmark&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#multithreading-queries-satisfaction-at-last" &gt;Multithreading queries: satisfaction at last&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#packing-difference-from-expected-position" &gt;Packing difference from expected position&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#local-packing-ideas" &gt;Local packing ideas&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#query-times-for-different-remapping-structures" &gt;Query times for different remapping structures&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#sharding" &gt;Sharding&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#128bit-hashing" &gt;128bit hashing&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#varying-the-partition-size" &gt;Varying the partition size&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#ptrhash-part-2" &gt;PtrHash, part 2&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#phobic" &gt;Phobic&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#for-ptrhash" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; for PtrHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\[&#10;%\newcommand{\mm}{\,\%\,}&#10;\newcommand{\mm}{\bmod}&#10;\newcommand{\lxor}{\oplus}&#10;\newcommand{\K}{\mathcal K}&#10;\]&lt;/p&gt;</description></item><item><title>BBHash: some ideas</title><link>https://curiouscoding.nl/posts/bbhash/</link><pubDate>Mon, 04 Sep 2023 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/bbhash/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#possible-speedup" &gt;Possible speedup?&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;BBHash Limasset et al. (&lt;a href="#citeproc_bib_item_1"&gt;2017&lt;/a&gt;) uses multiple &lt;em&gt;layers&lt;/em&gt; to create a minimal perfect&#10;hashing functions (MPHF), that hashes some input set into \([n]\).&lt;/p&gt;&#10;&lt;p&gt;(See also my &lt;a href="https://curiouscoding.nl/posts/ptrhash/" &gt;note on PTHash&lt;/a&gt; (&lt;a href="#citeproc_bib_item_2"&gt;Pibiri and Trani 2021&lt;/a&gt;).)&lt;/p&gt;&#10;&lt;p&gt;Simply said, it maps the \(n\) elements into \([\gamma \cdot n]\) using hashing function \(h_0\).&#10;The \(k_0\) elements that have collisions are mapped into \([\gamma \cdot k_0]\)&#10;using \(h_1\).&#10;Then, the \(k_1\) elements with collisions are mapped into \([\gamma \cdot k_1]\),&#10;and so on.&lt;/p&gt;</description></item><item><title>BitPAl bitpacking algorithm</title><link>https://curiouscoding.nl/posts/bitpal/</link><pubDate>Sun, 03 Sep 2023 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/bitpal/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#problem" &gt;Problem&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#input" &gt;Input&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#example" &gt;Example&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#found-the-bug" &gt;Found the bug&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#outlook" &gt;Outlook&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;The supplement (&lt;a href="https://oup.silverchair-cdn.com/oup/backfile/Content_public/Journal/bioinformatics/30/22/10.1093_bioinformatics_btu507/3/bioinformatics_30_22_3166_s1.zip?Expires=1695376479&amp;amp;Signature=vroWHrpg-P0tvOPcafVy~gh6mhZ-AZ8kj6lHr1DH7byZGTK2sy8chti7hDiWdbtGx6onKv94EAI5odd~GMBMG0GNXxfp1bZ~7ItGeNCXp0tosJpArez7Yo~PuKT77nJpgQYo5rabbkJ6qtvP3-V-41oznQ~Zh9Tl~GNLvjLo~5vq0D1wa4PMmqhc-C0zcEeh8ybqEK7hQdyvoxreWppOTZFIHIJwmZOSOeXBWM0fQhcPnM9ZU8cEsqAI64WuWt1AJgmDOPDTBVzQHmHpsl01F4Jt8Hf2gvDYwhmoM7t4U~qCIGFr4raran~hzr-eD2vhwexQhpC7e1U2~N2lMC7e7w__&amp;amp;Key-Pair-Id=APKAIE5G5CRDK6RD3PGA" class="external-link" target="_blank" rel="noopener"&gt;download&lt;/a&gt;) of the Loving, Hernandez, and Benson (&lt;a href="#citeproc_bib_item_1"&gt;2014&lt;/a&gt;) paper introduces a \(15\)&#10;operation version of Myers (&lt;a href="#citeproc_bib_item_2"&gt;1999&lt;/a&gt;) bitpacking algorithm, which uses \(16\)&#10;operations when modified for edit distance.&lt;/p&gt;&#10;&lt;p&gt;I tried implementing it, but it seems to have a bug that I will describe below.&#10;The fix is &lt;a href="#found-the-bug" &gt;here&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="problem"&gt;&#10; Problem&#10; &lt;a class="heading-link" href="#problem"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;To recap, this algorithm solves the unit-cost edit distance problem by using&#10;bitpacking to compute a \(1\times w\) at a time. As input, it takes&lt;/p&gt;</description></item><item><title>Shortest paths, bucket queues, and A* on the edit graph</title><link>https://curiouscoding.nl/posts/shortest_path_history/</link><pubDate>Sat, 29 Jul 2023 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/shortest_path_history/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#shortest-path-algorithms-dot-dot" &gt;Shortest path algorithms ..&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#dot-dot-in-general" &gt;.. in general&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#dot-dot-for-circuit-design" &gt;.. for circuit design&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#bucket-queues" &gt;Bucket queues&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#shortest-path-algorithms-by-hadlock" &gt;Shortest path algorithms by Hadlock&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#grid-graphs" &gt;Grid graphs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#strings" &gt;Strings&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#spouge-s-computational-volumes" &gt;Spouge&amp;rsquo;s computational volumes&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This note summarizes some papers I was reading while investigating the history&#10;of A* for pairwise alignment, and related to that the first usage of a &lt;em&gt;bucket&#10;queue&lt;/em&gt;. Schrijver (&lt;a href="#citeproc_bib_item_16"&gt;2012&lt;/a&gt;) provides a nice overview of general shortest path methods.&lt;/p&gt;</description></item><item><title>Research proposal: subquadratic string graph construction</title><link>https://curiouscoding.nl/posts/cwi-proposal/</link><pubDate>Mon, 10 Jul 2023 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/cwi-proposal/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#research-plan" &gt;Research plan&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#improve-query-performance-using-heavy-light-decomposition" &gt;Improve query performance using Heavy-Light Decomposition&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#add-more-query-types" &gt;Add more query types&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#extend-to-non-exact-suffix-prefix-overlap-that-allows-for-read-errors" &gt;Extend to non-exact suffix-prefix-overlap that allows for read errors&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#implement-an-algorithm-to-build-string-graphs-and-possibly-a-full-assembler" &gt;Implement an algorithm to build string graphs, and possibly a full assembler&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This is a research proposal for a 5 month internship at CWI during autumn/winter 2023-2024.&lt;/p&gt;&#10;&lt;h2 id="introduction"&gt;&#10; Introduction&#10; &lt;a class="heading-link" href="#introduction"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;An important problem in bioinformatics is &lt;em&gt;genome assembly&lt;/em&gt;:&#10;DNA sequencing machines read substrings of a full DNA genome, and these pieces&#10;must be &lt;em&gt;assembled&lt;/em&gt; together to recover the entire genome.&lt;/p&gt;</description></item><item><title>Loukides, Pissis, Thankachan, Zuba :: Suffix-Prefix Queries on a Dictionary</title><link>https://curiouscoding.nl/posts/apsp/</link><pubDate>Fri, 07 Jul 2023 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/apsp/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#comments" &gt;Comments&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#prelims" &gt;Prelims&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#one-to-one" &gt;One-to-One&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#one-to-all" &gt;One-to-All&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#report-and-count" &gt;Report and Count&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#top-k" &gt;Top-\(K\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a-small-rant-on-and-tau-micro-macro-trees" &gt;A small rant on $τ$-micro-macro trees&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#ideas-for-simplification" &gt;Ideas for simplification&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#replace-and-tau-micro-macro-tree" &gt;Replace $τ$-micro-macro tree&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#heavy-light-decomposition--hld--for-count-queries-in-o--log-n--time" &gt;Heavy-Light-Decomposition (HLD) for \(Count\) queries in \(O(\log n)\) time&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#finding-the-largest-l-with-count--i-l--geq-k-in-o--log-n--time" &gt;Finding the largest \(l\) with \(Count(i, l) \geq K\) in \(O(\log n)\) time&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#reporting-matching-strings" &gt;Reporting matching strings&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#comparison" &gt;Comparison&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#closing-thoughts" &gt;Closing thoughts&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\[\newcommand{\dol}{\$}\]&lt;/p&gt;&#10;&lt;p&gt;These are some comments and new ideas on the paper by Loukides, Pissis, Thankachan, and Zuba (&lt;a href="#citeproc_bib_item_7"&gt;2023&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>DSB 2023</title><link>https://curiouscoding.nl/posts/dsb-2023/</link><pubDate>Mon, 20 Mar 2023 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/dsb-2023/</guid><description>&lt;p&gt;These are notes for &lt;a href="https://dsb-meeting.github.io/DSB2023/" class="external-link" target="_blank" rel="noopener"&gt;DSB 2023&lt;/a&gt;. They&amp;rsquo;re not very structured though. I usually find&#10;methods more interesting than results.&lt;/p&gt;&#10;&lt;h2 id="day-1-tuesday"&gt;&#10; Day 1, Tuesday&#10; &lt;a class="heading-link" href="#day-1-tuesday"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;h3 id="practical-data-structures-for-longest-common-extensions-alexander-herlez"&gt;&#10; Practical data structures for longest common extensions, Alexander Herlez&#10; &lt;a class="heading-link" href="#practical-data-structures-for-longest-common-extensions-alexander-herlez"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;LCE: longest common extension: given \(i\), \(j\), the max \(k\) s.t. \(A[i, i+k) = A[j, j+k)\).&lt;/li&gt;&#10;&lt;li&gt;alg:&#10;&lt;ul&gt;&#10;&lt;li&gt;compare first k&lt;/li&gt;&#10;&lt;li&gt;if same: sample a subset and use black-box datastructure.&lt;/li&gt;&#10;&lt;li&gt;similar idea to minhash/mash kmer selection methods, same(?) as syncmers&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;string synchronizing sets (SSS):&#10;&lt;ul&gt;&#10;&lt;li&gt;rolling hash. sample a position when it has minimal hash in it&amp;rsquo;s window&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/herlaz/alx" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/herlaz/alx&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;useful for constant time LCE when extensions are length 1000 or longer. Not&#10;faster for shorter LCEs.&lt;/li&gt;&#10;&lt;li&gt;note: WFA uses this &lt;strong&gt;a lot&lt;/strong&gt; and it&amp;rsquo;s actually the bottleneck, but really only&#10;for short extensions.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="pan-genome-de-bruijn-graph-using-the-bidirectional-fm-index-lore-depuydt"&gt;&#10; Pan-genome de Bruijn graph using the bidirectional FM-index, Lore Depuydt&#10; &lt;a class="heading-link" href="#pan-genome-de-bruijn-graph-using-the-bidirectional-fm-index-lore-depuydt"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Goal: graph of pangenome with correspondences to reads&lt;/li&gt;&#10;&lt;li&gt;Implicit graph by Beller and Ohlebusch: build on top of FM-index of concatenation&lt;/li&gt;&#10;&lt;li&gt;New in Nexus:&#10;&lt;ul&gt;&#10;&lt;li&gt;Bidirectional FM-index for bidirectional traversal&#10;&lt;ul&gt;&#10;&lt;li&gt;down/upstream neighbourhoods can be visualized efficiently using traversal&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Search schemes for lossless approximate pattern matching (separate talk)&#10;&lt;ul&gt;&#10;&lt;li&gt;query -&amp;gt; candidate matches -&amp;gt; graph paths -&amp;gt; read paths&lt;/li&gt;&#10;&lt;li&gt;Lossless aligner; reports many more occurrences than PuffAligner, although&#10;this does make it slower for &amp;gt;0 edit distance&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;checkpoints k-mers inside long nodes&#10;&lt;ul&gt;&#10;&lt;li&gt;this way, to find the start of a long (compressed) node goes down significantly.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Memory usage: Bidirectional FM-index is &amp;gt;80%.&#10;&lt;ul&gt;&#10;&lt;li&gt;Bidir FM is linear in total size of pangenome.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Future: r index, which uses less memory.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="indexing-large-metagenomics-projects-with-abundances-pierre-peterlongo"&gt;&#10; Indexing large metagenomics projects with abundances, Pierre Peterlongo&#10; &lt;a class="heading-link" href="#indexing-large-metagenomics-projects-with-abundances-pierre-peterlongo"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Indexing read sets with abundance in &amp;lt;100GB with fast querying with low ram.&lt;/li&gt;&#10;&lt;li&gt;Uses counting bloom filters&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;fimpera&lt;/code&gt; decreases the overestimation, allowing less memory usage.&lt;/li&gt;&#10;&lt;li&gt;Once k-mers are sorted, all processes are sequential! 1000x speedup&lt;/li&gt;&#10;&lt;li&gt;instead of querying k-mers, store all slightly smaller s-mers and query all of&#10;them for much better false positive rates&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="µ-pbwt-enabling-the-storage-and-use-of-uk-biobank-data-on-a-commodity-laptop-davide-cozzi"&gt;&#10; µ-PBWT: Enabling the Storage and Use of UK Biobank Data on a Commodity Laptop, Davide Cozzi&#10; &lt;a class="heading-link" href="#%c2%b5-pbwt-enabling-the-storage-and-use-of-uk-biobank-data-on-a-commodity-laptop-davide-cozzi"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;r-index equivalent of PBWT, using run-length encoding&lt;/li&gt;&#10;&lt;li&gt;10-100x less memory than PBWT.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/dlcgold/muPBWT" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/dlcgold/muPBWT&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="genome-on-diet-taming-large-scale-genomic-analyses-via-sparsified-genomics-mohammed-alser"&gt;&#10; Genome-on-Diet: Taming Large-Scale Genomic Analyses via Sparsified Genomics, Mohammed Alser&#10; &lt;a class="heading-link" href="#genome-on-diet-taming-large-scale-genomic-analyses-via-sparsified-genomics-mohammed-alser"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Building an index on spaced kmers/patterns&lt;/li&gt;&#10;&lt;li&gt;Only some positions are sampled. i.e.: sample every other basepair and build&#10;kmers on those.&lt;/li&gt;&#10;&lt;li&gt;Index is built on the fly; not preprocessed&lt;/li&gt;&#10;&lt;li&gt;to 2x faster and 2x less memory than minimap2.&lt;/li&gt;&#10;&lt;li&gt;to 50x faster and 700x less memory than other tools.&lt;/li&gt;&#10;&lt;li&gt;summary: subsample 1 in m bits and run minimap on top of that.&lt;/li&gt;&#10;&lt;li&gt;similar to spaced seeds, but additionally subsamples the number of kmers.&lt;/li&gt;&#10;&lt;li&gt;Faster and better accuracy than spaced seeds.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="spectrum-preserving-tilings-enable-sparse-and-modular-reference-indexing-giulio-ermanno-pibiri"&gt;&#10; Spectrum preserving tilings enable sparse and modular reference indexing, Giulio Ermanno Pibiri&#10; &lt;a class="heading-link" href="#spectrum-preserving-tilings-enable-sparse-and-modular-reference-indexing-giulio-ermanno-pibiri"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Spectrum preserving tiling: Given a set of reads and their DBG, we can for&#10;each read store location information per unitig in this larger graph&lt;/li&gt;&#10;&lt;li&gt;Use &lt;code&gt;SSHash&lt;/code&gt; to store all unitigs.&lt;/li&gt;&#10;&lt;li&gt;Sample a subset of unitigs to store location information for. Non-sampled&#10;unitigs can still be recovered by querying adjacent unitig locations instead.&lt;/li&gt;&#10;&lt;li&gt;Main contribution: reducing space usage of the reverse index: mapping kmers to locations.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/COMBINE-lab/pufferfish2" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/COMBINE-lab/pufferfish2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="towards-a-lower-memory-chunked-graph-data-structure-inspired-by-minecraft-fawaz-dabbaghie"&gt;&#10; Towards a lower-memory chunked graph data structure inspired by Minecraft, Fawaz Dabbaghie&#10; &lt;a class="heading-link" href="#towards-a-lower-memory-chunked-graph-data-structure-inspired-by-minecraft-fawaz-dabbaghie"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Chunk big graphs as in minecraft chunks.&lt;/li&gt;&#10;&lt;li&gt;First approach: split human genome graph in 1000 parts using BFS&amp;rsquo;s from random positions&lt;/li&gt;&#10;&lt;li&gt;Already big speedup!&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;TODO: simple idea and super effective. Maybe play around with this at some point&lt;/strong&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="optimal-worst-case-design-of-gapped-k-mer-masks-sven-rahmann"&gt;&#10; Optimal Worst-Case Design of Gapped k-mer Masks, Sven Rahmann&#10; &lt;a class="heading-link" href="#optimal-worst-case-design-of-gapped-k-mer-masks-sven-rahmann"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Gapped kmers are better in the worst case than normal kmers:&#10;&lt;ul&gt;&#10;&lt;li&gt;If you can make \(x\) substitutions in a length \(n\) strings, gapped kmers need&#10;a higher \(x\) to mutate (break) all of them.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Second optimization goal: count number of recovered positions, instead of&#10;number of kmers.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;#########_#########_#########&lt;/code&gt; (27,29)-mer: in a \(n=100\) window, lack of such&#10;matches implies at least 4 errors. Normal 27-mers imply at least 3 errors.&lt;/li&gt;&#10;&lt;li&gt;boundary effects (changing \(n\)) are not super strong.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;TODO: read old papers and see if this could be used for A*PA&lt;/strong&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;How about inexact spaced matches?&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="locality-preserving-hashing-of-k-mers-yoshihiro-shibuya"&gt;&#10; Locality-Preserving Hashing of k-mers, Yoshihiro Shibuya&#10; &lt;a class="heading-link" href="#locality-preserving-hashing-of-k-mers-yoshihiro-shibuya"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Mapping of kmers to \([0, 4^n)\) such that kmers with same minimizer are close.&lt;/li&gt;&#10;&lt;li&gt;Split mapping based on whether the minimizer is &lt;em&gt;left-maximal&lt;/em&gt; and/or&#10;&lt;em&gt;right-maximal&lt;/em&gt; inside its super-k-mer.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/jermp/lphash" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/jermp/lphash&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;Less than 1.44 bits/element for large k (which is the generic lower bound).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="space-efficient-k-mer-counting-using-an-implicit-sequence-representation-miika-leinonen"&gt;&#10; Space-efficient k-mer counting using an implicit sequence representation, Miika Leinonen&#10; &lt;a class="heading-link" href="#space-efficient-k-mer-counting-using-an-implicit-sequence-representation-miika-leinonen"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Map kmers into a hashtable storing at each index:&#10;&lt;ul&gt;&#10;&lt;li&gt;count of kmers mapping here&lt;/li&gt;&#10;&lt;li&gt;the last character of the kmer&lt;/li&gt;&#10;&lt;li&gt;the index of the preceding kmer&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Memory usage: 25%-50% of normal hash table&lt;/li&gt;&#10;&lt;li&gt;saves more memory for larger k.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="vechat-correcting-errors-in-long-reads-using-variation-graphs-alexander-schönhuth"&gt;&#10; VeChat: correcting errors in long reads using variation graphs, Alexander Schönhuth&#10; &lt;a class="heading-link" href="#vechat-correcting-errors-in-long-reads-using-variation-graphs-alexander-sch%c3%b6nhuth"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Error correction using graph cleaning&lt;/li&gt;&#10;&lt;li&gt;Clean using repeated steps of:&#10;&lt;ul&gt;&#10;&lt;li&gt;remove edges with low coverage&lt;/li&gt;&#10;&lt;li&gt;clean edges with low &lt;em&gt;confidence&lt;/em&gt;: the relative weight this edge has with&#10;respect to total weight of edges going out of predecessor or going into successor&lt;/li&gt;&#10;&lt;li&gt;clean isolated nodes and leaf edges&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Up to 10x less remaining errors than other tools.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="fixing-homopolymer-errors-in-hifi-reads-using-dictionary-compression-diego-diaz-dominguez"&gt;&#10; Fixing homopolymer errors in HiFi reads using dictionary compression, Diego Diaz-Dominguez&#10; &lt;a class="heading-link" href="#fixing-homopolymer-errors-in-hifi-reads-using-dictionary-compression-diego-diaz-dominguez"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Encode sequence recursively using grammer based&lt;/li&gt;&#10;&lt;li&gt;Grammar compression is good on its own&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;TODO: read paper&lt;/strong&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="orthanq-orthogonal-evidence-based-haplotype-quantification-hamdiye-uzuner"&gt;&#10; Orthanq: orthogonal evidence based haplotype quantification, Hamdiye Uzuner&#10; &lt;a class="heading-link" href="#orthanq-orthogonal-evidence-based-haplotype-quantification-hamdiye-uzuner"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Variant calling pipeline&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/orthanq" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/orthanq&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="day-2-wednesday"&gt;&#10; Day 2, Wednesday&#10; &lt;a class="heading-link" href="#day-2-wednesday"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;h3 id="random-wheeler-graphs-riccardo-maso"&gt;&#10; Random Wheeler graphs, Riccardo Maso&#10; &lt;a class="heading-link" href="#random-wheeler-graphs-riccardo-maso"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;missed it :(&lt;/p&gt;</description></item><item><title>Doctoral plan</title><link>https://curiouscoding.nl/posts/research-proposal/</link><pubDate>Mon, 12 Dec 2022 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/research-proposal/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#research-proposal-near-linear-exact-pairwise-alignment" &gt;Research Proposal: Near-linear exact pairwise alignment&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#introduction-and-current-state-of-research-in-the-field" &gt;Introduction and current state of research in the field&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#goals-of-the-thesis" &gt;Goals of the thesis&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#impact" &gt;Impact&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#progress-to-date" &gt;Progress to date&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#detailed-work-plan" &gt;Detailed work plan&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#wp1-a-pa-v1-initial-version" &gt;WP1: A*PA v1: initial version&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wp2-visualizing-aligners" &gt;WP2: Visualizing aligners&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wp3-benchmarking-aligners" &gt;WP3: Benchmarking aligners&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wp4-theory-review" &gt;WP4: Theory review&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wp5-a-pa-v2-efficient-implementation" &gt;WP5: A*PA v2: efficient implementation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wp6-affine-costs" &gt;WP6: Affine costs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wp7-ends-free-alignment-and-mapping" &gt;WP7: Ends-free alignment and mapping&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wp8-further-extension-and-open-ended-research" &gt;WP8: Further extension and open ended research&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wp9-thesis-writing" &gt;WP9: Thesis writing&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#publication-plan" &gt;Publication plan&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#time-schedule" &gt;Time schedule&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#teaching-responsibilities" &gt;Teaching responsibilities&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#other-duties" &gt;Other duties&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#study-plan" &gt;Study plan&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#signatures" &gt;Signatures&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;h2 id="research-proposal-near-linear-exact-pairwise-alignment"&gt;&#10; Research Proposal: Near-linear exact pairwise alignment&#10; &lt;a class="heading-link" href="#research-proposal-near-linear-exact-pairwise-alignment"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;h3 id="abstract"&gt;&#10; Abstract&#10; &lt;a class="heading-link" href="#abstract"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;&lt;em&gt;Pairwise alignment&lt;/em&gt; and &lt;em&gt;edit distance&lt;/em&gt; specifically is a problem that was&#10;first stated around 1968 (&lt;a href="#citeproc_bib_item_20"&gt;Needleman and Wunsch 1970&lt;/a&gt;; &lt;a href="#citeproc_bib_item_26"&gt;Vintsyuk 1968&lt;/a&gt;). It involves finding the minimal&#10;number of edits (substitutions, insertions, deletions) to transform one string/sequence&#10;into another.&#10;For sequences of length \(n\), the original algorithm takes \(O(n^2)\) quadratic&#10;time (&lt;a href="#citeproc_bib_item_22"&gt;Sellers 1974&lt;/a&gt;).&#10;In 1983, this was improved to \(O(ns)\) for sequences with low edit distance \(s\)&#10;using Band-Doubling. At the same time, a further improvement to&#10;\(O(n+s^2)\) expected runtime was presented using the diagonal-transition method (&lt;a href="#citeproc_bib_item_24"&gt;Ukkonen 1983&lt;/a&gt;, &lt;a href="#citeproc_bib_item_25"&gt;1985&lt;/a&gt;; &lt;a href="#citeproc_bib_item_17"&gt;Myers 1986&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>One Year Of Rust</title><link>https://curiouscoding.nl/posts/one-year-of-rust/</link><pubDate>Thu, 17 Nov 2022 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/one-year-of-rust/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#thoughts-and-remarks" &gt;Thoughts and remarks&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#good" &gt;Good&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#bad" &gt;Bad&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#my-programming-language-journey" &gt;My programming language journey&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#lego-mindstorms" &gt;Lego mindstorms&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#labview" &gt;LabVIEW&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#c-plus-plus" &gt;C++&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#python" &gt;Python&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#rust" &gt;Rust&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are some notes on my opinions on Rust after one year of using it.&lt;/p&gt;&#10;&lt;h2 id="thoughts-and-remarks"&gt;&#10; Thoughts and remarks&#10; &lt;a class="heading-link" href="#thoughts-and-remarks"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;These pros and cons are mostly relative to C++, the language I used for the past&#10;~10 years.&lt;/p&gt;</description></item><item><title>The complexity and performance of WFA and band doubling</title><link>https://curiouscoding.nl/posts/wfa-edlib-perf/</link><pubDate>Thu, 17 Nov 2022 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/wfa-edlib-perf/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#complexity-analysis" &gt;Complexity analysis&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#complexity-of-edit-distance" &gt;Complexity of edit distance&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#complexity-of-affine-cost-alignment" &gt;Complexity of affine cost alignment&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#comparison" &gt;Comparison&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#implementation-efficiency" &gt;Implementation efficiency&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#band-doubling-for-affine-scores-was-never-implemented" &gt;Band doubling for affine scores was never implemented&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wfa-vs-band-doubling-for-affine-costs" &gt;WFA vs band doubling for affine costs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#future-work" &gt;Future work&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This note explores the complexity and performance of band doubling (Edlib) and WFA under varying cost models.&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/Martinsos/edlib" class="external-link" target="_blank" rel="noopener"&gt;Edlib&lt;/a&gt; (&lt;a href="#citeproc_bib_item_5"&gt;Šošić and Šikić 2017&lt;/a&gt;) uses band doubling and runs in \(O(ns)\) time, for sequence length \(n\)&#10;and edit distance \(s\) between the two sequences.&lt;/p&gt;</description></item><item><title>String algorithm visualizations</title><link>https://curiouscoding.nl/posts/alg-viz/</link><pubDate>Tue, 08 Nov 2022 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/alg-viz/</guid><description>&lt;ol&gt;&#10;&lt;li&gt;Select the algorithm to visualize&lt;/li&gt;&#10;&lt;li&gt;Click the buttons, or click the canvas and use the indicated keys&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;Suffix-array construction is explained &lt;a href="https://curiouscoding.nl/posts/suffix-array-construction/" &gt;here&lt;/a&gt; and BWT is explained &lt;a href="https://curiouscoding.nl/posts/bwt/" &gt;here&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Source code is &lt;a href="https://github.com/RagnarGrootKoerkamp/alg-viz" class="external-link" target="_blank" rel="noopener"&gt;on GitHub&lt;/a&gt;.&lt;/p&gt;&#10;&lt;script defer src="https://curiouscoding.nl/js/alg-viz.js" type="module"&gt;&lt;/script&gt;&lt;/head&gt;&#10;&lt;div class="controls"&gt;&#10;&lt;label for="algorithm"&gt;Algorithm&lt;/label&gt;&#10;&lt;select name="algorithm" id="algorithm"&gt;&#10; &lt;option value="suffix-array"&gt;Suffix Array Construction&lt;/option&gt;&#10; &lt;option value="bwt"&gt;Burrows-Wheeler Transform&lt;/option&gt;&#10; &lt;option value="bibwt"&gt;Bidirectional BWT&lt;/option&gt;&#10;&lt;/select&gt;&#10;&lt;br/&gt;&#10;&lt;label for="string"&gt;String&lt;/label&gt; &lt;input type="string" name="string" id="string"/&gt;&lt;br/&gt;&#10;&lt;label for="query"&gt;Query&lt;/label&gt; &lt;input type="string" name="query" id="query"/&gt;&lt;br/&gt;&#10;&lt;button class="button-primary" id="prev"&gt;prev (←/backspace)&lt;/button&gt;&#10;&lt;button class="button-primary" id="next"&gt;next (→/space)&lt;/button&gt;&#10;&lt;br/&gt;&#10;&lt;label for="delay"&gt;Delay (s)&lt;/label&gt; &lt;input type="number" name="delay" id="delay" value="0.8"/&gt;&lt;br/&gt;&#10;&lt;button class="button-primary" id="faster"&gt;faster (↑/+/f)&lt;/button&gt;&#10;&lt;button class="button-primary" id="slower"&gt;slower (↓/-/s)&lt;/button&gt;&#10;&lt;button class="button-primary" id="pauseplay"&gt;pause/play (p/return)&lt;/button&gt;&#10;&lt;/div&gt;&#10;&lt;div class="canvas"&gt;&#10;&lt;canvas id="canvas" tabindex='1' width="1600" height="1200"&gt;&lt;/canvas&gt;&#10;&lt;/div&gt;</description></item><item><title>Thoughts on linear programming</title><link>https://curiouscoding.nl/posts/linear-programming/</link><pubDate>Fri, 04 Nov 2022 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/linear-programming/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#linear-programming" &gt;Linear programming&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#assumptions" &gt;Assumptions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#idea-for-an-algorithm" &gt;Idea for an algorithm&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This note contains some ideas about linear programming and &lt;em&gt;most-orthogonal&#10;faces&lt;/em&gt;. They&amp;rsquo;re mostly on an intuitive level and not very formal.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Postscriptum:&lt;/strong&gt; The ideas here don&amp;rsquo;t work.&lt;/p&gt;&#10;&lt;h2 id="linear-programming"&gt;&#10; Linear programming&#10; &lt;a class="heading-link" href="#linear-programming"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;div style="display: none" class="div"&gt;&#10;&lt;p&gt;\begin{equation*}&#10;\newcommand{\v}[1]{\textbf{#1}}&#10;\newcommand{\x}{\v x}&#10;\newcommand{\t}{\v t}&#10;\newcommand{\b}{\v b}&#10;\end{equation*}&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;Maximize \(\t\x\) subject to \(A\x \leq \b\).&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;\(\x\) is a vector of \(n\) variables \(x_i\).&lt;/li&gt;&#10;&lt;li&gt;\(A\) is a \(m\times n\) matrix: there are \(m\) constraints \(A_j \x \leq b_j\).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="assumptions"&gt;&#10; Assumptions&#10; &lt;a class="heading-link" href="#assumptions"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;We make the following assumptions:&lt;/p&gt;</description></item><item><title>Local Doubling</title><link>https://curiouscoding.nl/posts/local-doubling/</link><pubDate>Wed, 19 Oct 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/local-doubling/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#notation" &gt;Notation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#needleman-wunsch-where-it-all-begins" &gt;Needleman-Wunsch: where it all begins&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#dijkstra-bfs-visiting-fewer-states" &gt;Dijkstra/BFS: visiting fewer states&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#band-doubling-dijkstra-but-more-efficient" &gt;Band doubling: Dijkstra, but more efficient&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#gapcost-a-first-heuristic" &gt;GapCost: A first heuristic&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#computational-volumes-an-even-smaller-search" &gt;Computational volumes: an even smaller search&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#cheating-an-oracle-gave-us-g" &gt;Cheating: an oracle gave us \(g^*\)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a-better-heuristics" &gt;A*: Better heuristics&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#broken-idea-a-and-computational-volumes" &gt;Broken idea: A* and computational volumes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#local-doubling" &gt;Local doubling&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#without-heuristic" &gt;Without heuristic&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#with-heuristic" &gt;With heuristic&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#diagonal-transition" &gt;Diagonal Transition&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a-with-diagonal-transition-and-pruning-doing-less-work" &gt;A* with Diagonal Transition and pruning: doing less work&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#goal-diagonal-transition-plus-pruning-plus-local-doubling" &gt;Goal: Diagonal Transition + pruning + local doubling&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#pruning-improving-a-heuristics-on-the-go" &gt;Pruning: Improving A* heuristics on the go&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#cheating-more-an-oracle-gave-us-the-optimal-path" &gt;Cheating more: an oracle gave us the optimal path&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#todo-aspriation-windows" &gt;TODO: aspriation windows&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\begin{equation*}&#10;\newcommand{\st}[2]{\langle #1,#2\rangle}&#10;\newcommand{\g}{g^*}&#10;\newcommand{\fm}{f_{max}}&#10;\newcommand{\gap}{\operatorname{Gap}}&#10;\end{equation*}&lt;/p&gt;</description></item><item><title>BWT and FM-index</title><link>https://curiouscoding.nl/posts/bwt/</link><pubDate>Tue, 18 Oct 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/bwt/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#burrows-wheeler-transformation--bwt" &gt;Burrows-Wheeler Transformation (BWT)&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#last-to-first-mapping--lf-mapping" &gt;Last-to-first mapping (LF mapping)&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#pattern-matching" &gt;Pattern matching&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#visualization" &gt;Visualization&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#bi-directional-bwt" &gt;Bi-directional BWT&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are some notes about the &lt;a href="https://en.wikipedia.org/wiki/Burrows%E2%80%93Wheeler_transform" class="external-link" target="_blank" rel="noopener"&gt;Burrows-Wheeler Transform&lt;/a&gt; (BWT), &lt;a href="https://en.wikipedia.org/wiki/FM-index" class="external-link" target="_blank" rel="noopener"&gt;FM-index&lt;/a&gt;, and variants.&lt;/p&gt;&#10;&lt;p&gt;See my post on the &lt;a href="../suffix-array-construction/" &gt;linear time suffix array construction algorithm&lt;/a&gt; for&#10;notation and terminology.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;At &lt;a href="#visualization" &gt;the bottom&lt;/a&gt; you can find a visualization.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://curiouscoding.nl/posts/alg-viz/" &gt;&lt;strong&gt;&lt;strong&gt;This page&lt;/strong&gt;&lt;/strong&gt;&lt;/a&gt; has an &lt;strong&gt;&lt;strong&gt;interactive demo&lt;/strong&gt;&lt;/strong&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Source code for visualizations is &lt;a href="https://github.com/RagnarGrootKoerkamp/suffix-array-construction" class="external-link" target="_blank" rel="noopener"&gt;this GitHub repo&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="burrows-wheeler-transformation--bwt"&gt;&#10; Burrows-Wheeler Transformation (BWT)&#10; &lt;a class="heading-link" href="#burrows-wheeler-transformation--bwt"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;The BWT of a string \(S\) is generated as follows:&lt;/p&gt;</description></item><item><title>A Combinatorial Identity</title><link>https://curiouscoding.nl/posts/a-combinatorial-identity/</link><pubDate>Sun, 16 Oct 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/a-combinatorial-identity/</guid><description>&lt;p&gt;Some notes regarding the identity&lt;/p&gt;&#10;&lt;p&gt;\begin{equation}&#10;\sum_{k=0}^n \binom{2k}k \binom{2n-2k}{n-k} = 4^n&#10;\end{equation}&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Gould has two derivations:&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://web.archive.org/web/20171225173015/http://math.wvu.edu/~gould/Vol.5.PDF" class="external-link" target="_blank" rel="noopener"&gt;The first&lt;/a&gt;, from Jensens equality, (18) in (&lt;a href="#citeproc_bib_item_2"&gt;Jensen 1902&lt;/a&gt;; &lt;a href="#citeproc_bib_item_3"&gt;Shijie 1303&lt;/a&gt;).&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://web.archive.org/web/20171118022119/http://www.math.wvu.edu/~gould/Vol.4.PDF" class="external-link" target="_blank" rel="noopener"&gt;A second&lt;/a&gt; via the Chu-Vandermonde convolution:&lt;/p&gt;&#10;&lt;p&gt;\begin{equation}&#10;\sum_{k=0}^n \binom{x}k \binom{y}{n-k} = \binom{x+y}n&#10;\end{equation}&lt;/p&gt;&#10;&lt;p&gt;using \(x=y=-\frac 12\) and using the &lt;em&gt;$-\frac 12$-transform&lt;/em&gt;:&lt;/p&gt;&#10;&lt;p&gt;\begin{equation}&#10;\binom{-1/2}{n} = (-1)^n\binom{2n}{n}\frac 1 {2^{2n}}&#10;\end{equation}&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Duarte and de Oliveira (&lt;a href="#citeproc_bib_item_1"&gt;2012&lt;/a&gt;) has a combinatorial proof.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="references"&gt;&#10; References&#10; &lt;a class="heading-link" href="#references"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;style&gt;.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}&lt;/style&gt;&lt;div class="csl-bib-body"&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_1"&gt;&lt;/a&gt;Duarte, Rui, and António Guedes de Oliveira. 2012. “New Developments of an Old Identity.” &lt;a href="https://doi.org/10.48550/ARXIV.1203.5424"&gt;https://doi.org/10.48550/ARXIV.1203.5424&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_2"&gt;&lt;/a&gt;Jensen, J. L. W. V. 1902. “Sur Une Identité D’abel et Sur D’autres Formules Analogues.” &lt;i&gt;Acta Mathematica&lt;/i&gt; 26 (0): 307–18. &lt;a href="https://doi.org/10.1007/bf02415499"&gt;https://doi.org/10.1007/bf02415499&lt;/a&gt;.&lt;/div&gt;&#10; &lt;div class="csl-entry"&gt;&lt;a id="citeproc_bib_item_3"&gt;&lt;/a&gt;Shijie, Zhu. 1303. &lt;i&gt;Jade Mirror of the Four Unknowns&lt;/i&gt;.&lt;/div&gt;&#10;&lt;/div&gt;</description></item><item><title>Tensor embedding preserves Hamming distance</title><link>https://curiouscoding.nl/posts/tensor-embedding-distance/</link><pubDate>Fri, 14 Oct 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/tensor-embedding-distance/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#definitions" &gt;Definitions&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#proof-of-lemma-1" &gt;Proof of Lemma 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#proof-of-lemma-2" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Proof of Lemma 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This is a proof that Tensor Embedding&#10;(&lt;a href="#citeproc_bib_item_3"&gt;Joudaki, Rätsch, and Kahles 2020&lt;/a&gt;) with $ℓ^2$-norm preserves the Hamming distance.&lt;/p&gt;&#10;&lt;p&gt;This is in collaboration with Amir Joudaki.&lt;/p&gt;&#10;&lt;p&gt;\begin{equation*}&#10;\newcommand{\I}{\mathcal I}&#10;\newcommand{\EE}{\mathbb E}&#10;\newcommand{\var}{\operatorname{Var}}&#10;\end{equation*}&lt;/p&gt;&#10;&lt;h2 id="definitions"&gt;&#10; Definitions&#10; &lt;a class="heading-link" href="#definitions"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;Notation&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ul&gt;&#10;&lt;li&gt;The alphabet is \(\Sigma\), of size \(|\Sigma| = \sigma\).&lt;/li&gt;&#10;&lt;li&gt;The set of indices is \(\I := \{(i_1, \dots, i_t) \in [n]^t: i_1 &amp;lt; \dots &amp;lt; i_t\}\).&lt;/li&gt;&#10;&lt;li&gt;Given a string \(a_1\dots a_n = a\in \Sigma^n\), we define the &lt;em&gt;$I$-index&lt;/em&gt; as&#10;\(a_I = (a_{i_1}, \dots, a_{i_t})\).&lt;/li&gt;&#10;&lt;li&gt;We write \([ X ]\) for the indicator variable of event \(X\), which is \(1\) when&#10;\(X\) holds and \(0\) otherwise.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;Definition 1: Tensor embedding&lt;/dt&gt;&#10;&lt;dd&gt;Given \(a\in \Sigma^n\), the &lt;em&gt;tensor embedding&lt;/em&gt; \(T_a\) is the \(\sigma^t\) tensor&#10;given by \(T_a[s] = \sum_{I\in \I} [A_I = s]\) for each \(s\in \Sigma^t\).&#10;&lt;p&gt;The &lt;em&gt;normalized tensor embedding distance&lt;/em&gt; \(d_{te}\) between two sequences \(a\)&#10;and \(b\) is defined as&lt;/p&gt;&#10;&lt;p&gt;\begin{equation*}&#10;d_{te}(a,b) := \frac 12 \binom{n}{2t-1}^{-1}\cdot \|T_a - T_b\|_2^2.&#10;\end{equation*}&lt;/p&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;Lemma 1: Tensor embedding preserves Hamming distance under \(\ell^2\) norm&lt;/dt&gt;&#10;&lt;dd&gt;Let \(a\) be a uniform random sequence of length \(n\) in \(\Sigma^n\), and for a&#10;fixed mutation rate \(r\in [0,1]\) let \(b\) be a sequence where&#10;\(a_i\) is substituted by a new character \(b_i \in Unif(\Sigma \backslash a_i)\) with probability \(r\) and \(b_i = a_i\) otherwise.&#10;Then for \(n\gg 2t\sigma\):&#10;&lt;p&gt;\begin{equation*}&#10;\EE_{a,b}[d_{te}(a,b)]&#10;= (4/\sigma)^{t-1} \cdot r + O(2t\sigma^{2-t}/n) \cdot r,&#10;\end{equation*}&lt;/p&gt;&#10;&lt;p&gt;which for DNA with \(\sigma=4\) and fixed \(t\) gives \(\EE[d_{te}(a,b)] = (1 + O(n^{-1})) \cdot r\).&lt;/p&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;Lemma 2: Variance of Tensor embedding&lt;/dt&gt;&#10;&lt;dd&gt;In the same setting as Lemma 1,&#10;&lt;p&gt;\begin{equation*}&#10;\var_{a,b}[d_{te}(a,b)] = TODO.&#10;\end{equation*}&lt;/p&gt;&#10;&lt;/dd&gt;&#10;&lt;/dl&gt;</description></item><item><title>Linear-time suffix array construction</title><link>https://curiouscoding.nl/posts/suffix-array-construction/</link><pubDate>Thu, 13 Oct 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/suffix-array-construction/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#notation" &gt;Notation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#small-and-large-suffixes" &gt;Small and Large suffixes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#building-the-suffix-array-from-a-smaller-one" &gt;Building the suffix array from a smaller one&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#visualization" &gt;Visualization&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;These are some notes about linear time suffix array (SA) construction algorithms (SACA&amp;rsquo;s).&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;At &lt;a href="#visualization" &gt;the bottom&lt;/a&gt; you can find a visualization.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://curiouscoding.nl/posts/alg-viz/" &gt;&lt;strong&gt;&lt;strong&gt;This page&lt;/strong&gt;&lt;/strong&gt;&lt;/a&gt; has an &lt;strong&gt;&lt;strong&gt;interactive demo&lt;/strong&gt;&lt;/strong&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;History of suffix array construction algorithms:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;1990 first algorithm: Manber and Myers (&lt;a href="#citeproc_bib_item_2"&gt;1993&lt;/a&gt;)&lt;/li&gt;&#10;&lt;li&gt;2002 small/large suffixes, explained below: Ko and Aluru (&lt;a href="#citeproc_bib_item_1"&gt;2005&lt;/a&gt;)&lt;/li&gt;&#10;&lt;li&gt;2009 recursion only on &lt;em&gt;LMS&lt;/em&gt; suffixes: Nong, Zhang, and Chan (&lt;a href="#citeproc_bib_item_3"&gt;2009&lt;/a&gt;)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;a href="http://web.stanford.edu/class/archive/cs/cs166/cs166.1196/lectures/04/Small04.pdf" class="external-link" target="_blank" rel="noopener"&gt;These slides&lt;/a&gt; from Stanford are a nice reference for the last algorithm.&lt;/p&gt;</description></item><item><title>Competitive Programming Lecture</title><link>https://curiouscoding.nl/posts/competitive-programming-lecture/</link><pubDate>Wed, 28 Sep 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/competitive-programming-lecture/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#contest-strategies" &gt;Contest strategies&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#pairwise-alignment-using-a" &gt;Pairwise Alignment using A*&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#exercises" &gt;Exercises&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;h2 id="contest-strategies"&gt;&#10; Contest strategies&#10; &lt;a class="heading-link" href="#contest-strategies"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;Preparation&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ul&gt;&#10;&lt;li&gt;Thinking costs energy!&lt;/li&gt;&#10;&lt;li&gt;Sleep enough; early to bed the 2 nights before.&lt;/li&gt;&#10;&lt;li&gt;No practising on contest day (and the day before); it just takes energy.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;During the contest&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ul&gt;&#10;&lt;li&gt;Eat! At the very least take a break halfway with the entire team and eat some snacks.&lt;/li&gt;&#10;&lt;li&gt;Make sure to read &lt;strong&gt;all&lt;/strong&gt; the problems before the end of the contest. In the&#10;beginning, split the problems to find the simple ones, but towards the end,&#10;find a problem you think you can solve (because of the scoreboard or because&#10;you like it), and work on it as a team.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;Coding&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ul&gt;&#10;&lt;li&gt;Ideally, use C++. Otherwise, Python can be used too.&#10;&lt;ul&gt;&#10;&lt;li&gt;For big-integer problems, prefer Python.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Use a TCR (e.g. &lt;a href="https://github.com/TimonKnigge/TCR" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/TimonKnigge/TCR&lt;/a&gt;): a 25 page document&#10;containing algorithms. Ideally, implement all of them yourself so you know&#10;how they work. Otherwise download one.&lt;/li&gt;&#10;&lt;li&gt;Make a template, and add it to your TCR. One person should type this in the&#10;first minutes of the contest and copy it to &lt;code&gt;A.cpp&lt;/code&gt;, &lt;code&gt;B.cpp&lt;/code&gt;, &amp;hellip; .&lt;/li&gt;&#10;&lt;li&gt;When you think you solved a problem:&#10;&lt;ul&gt;&#10;&lt;li&gt;Decide &lt;em&gt;exactly&lt;/em&gt; how the code will look. Maybe write pseudocode on paper.&lt;/li&gt;&#10;&lt;li&gt;For hard problems: verify your solution with a teammate.&lt;/li&gt;&#10;&lt;li&gt;Once the keyboard is free, start typing it out. If needed, ask one&#10;teammate to look while you code.&lt;/li&gt;&#10;&lt;li&gt;Typical distribution:&#10;&lt;ul&gt;&#10;&lt;li&gt;1 person typing&lt;/li&gt;&#10;&lt;li&gt;1 person solving a new problem&lt;/li&gt;&#10;&lt;li&gt;1 person helping the other 2: spotting typos or working on problems.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/dd&gt;&#10;&lt;/dl&gt;&#10;&lt;h2 id="pairwise-alignment-using-a"&gt;&#10; Pairwise Alignment using A*&#10; &lt;a class="heading-link" href="#pairwise-alignment-using-a"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Some resources you can use:&lt;/p&gt;</description></item><item><title>Reducing A* memory usage using fronts</title><link>https://curiouscoding.nl/posts/astar-memory-usage/</link><pubDate>Mon, 26 Sep 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/astar-memory-usage/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#motivation" &gt;Motivation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#parititioning-a-memory-by-fronts" &gt;Parititioning A* memory by fronts&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#non-consistent-heuristics" &gt;Non-consistent heuristics&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#front-indexing" &gt;Front indexing&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#tracing-back-the-path" &gt;Tracing back the path&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Here is an idea to reduce the memory usage of A* by only storing one &lt;em&gt;front&lt;/em&gt; at&#10;a time, similar to what Edlib and WFA do. Note that for now this &lt;strong&gt;will not&#10;work&lt;/strong&gt;, but I&amp;rsquo;m putting this online anyway.&lt;/p&gt;&#10;&lt;h2 id="motivation"&gt;&#10; Motivation&#10; &lt;a class="heading-link" href="#motivation"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;In our &lt;a href="https://github.com/RagnarGrootKoerkamp/astar-pairwise-aligner" class="external-link" target="_blank" rel="noopener"&gt;implementation&lt;/a&gt; of A*PA, we use a hashmap to store the value of \(g\) of all&#10;visited (explored/expanded) states by A*. This can take up a lot of memory and&#10;simply reading/writing \(g\) in the hashmap can take over half the total execution&#10;time.&lt;/p&gt;</description></item><item><title>Speeding up A*: computational volumes and path-pruning</title><link>https://curiouscoding.nl/posts/speeding-up-astar/</link><pubDate>Fri, 23 Sep 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/speeding-up-astar/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#motivation" &gt;Motivation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#summary" &gt;Summary&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#why-is-a-slow" &gt;Why is A* slow?&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#computational-volumes" &gt;Computational volumes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#dealing-with-pruning" &gt;Dealing with pruning&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#thoughts-on-more-aggressive-pruning" &gt;Thoughts on more aggressive pruning&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#algorithm-summary" &gt;Algorithm summary&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#challenges" &gt;Challenges&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#results" &gt;Results&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#what-about-band-doubling" &gt;What about band-doubling?&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#maybe-doubling-can-work-after-all" &gt;Maybe doubling can work after all?&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#todos" &gt;TODOs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#extensions" &gt;Extensions&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This post build on top of our recent preprint Groot Koerkamp and Ivanov (&lt;a href="#citeproc_bib_item_1"&gt;2024&lt;/a&gt;) and gives an&#10;overview of some of my new ideas to significantly speed up exact global pairwise&#10;alignment. It&amp;rsquo;s recommended you understand the &lt;em&gt;seed heuristic&lt;/em&gt; and &lt;em&gt;match&#10;pruning&lt;/em&gt; before reading this post.&lt;/p&gt;</description></item><item><title>Revised Oxford Bioinformatics latex template</title><link>https://curiouscoding.nl/posts/bioinformatics-template/</link><pubDate>Thu, 22 Sep 2022 12:13:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/bioinformatics-template/</guid><description>&lt;p&gt;I made an improved version of the Oxford Bioinformatics latex template. See the &lt;a href="https://github.com/RagnarGrootKoerkamp/oxford-bioinformatics-template" class="external-link" target="_blank" rel="noopener"&gt;Github repository&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Linear memory WFA?</title><link>https://curiouscoding.nl/posts/linear-memory-wfa/</link><pubDate>Wed, 17 Aug 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/linear-memory-wfa/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#motivation" &gt;Motivation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#path-traceback-two-strategies" &gt;Path traceback: two strategies&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#observations" &gt;Observations&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#what-information-is-needed-for-path-tracing" &gt;What information is needed for path tracing&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a-pragmatic-solution" &gt;A pragmatic solution&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#another-interpretation" &gt;Another interpretation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#affine-costs" &gt;Affine costs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;&lt;a id="figure--result"&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;figure&gt;&lt;a href="https://curiouscoding.nl/ox-hugo/simple-final.png"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/simple-final.png"&#10;&#9;&#9;&#9;alt="Figure 1: Only the red substitutions and blue indel need to be stored to trace the entire path."&gt;&lt;/a&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;&lt;span class="figure-number"&gt;Figure 1: &lt;/span&gt;Only the red substitutions and blue indel need to be stored to trace the entire path.&lt;/p&gt;&#10;&#9;&#9;&lt;/figcaption&gt;&#10;&lt;/figure&gt;</description></item><item><title>Transforming match bonus into cost</title><link>https://curiouscoding.nl/posts/alignment-scores-transform/</link><pubDate>Tue, 16 Aug 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/alignment-scores-transform/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#tricks-with-match-bonus-or-how-to-fool-dijkstra-s-limitations" &gt;Tricks with match bonus or how to fool Dijkstra&amp;rsquo;s limitations&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#edit-graph" &gt;Edit graph&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#algorithms" &gt;Algorithms&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#potentials" &gt;Potentials&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#multiple-variants" &gt;Multiple variants&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#some-notes-on-algorithms" &gt;Some notes on algorithms&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#wfa" &gt;WFA&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#a" &gt;A*&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#extending-to-different-cost-models" &gt;Extending to different cost models&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#affine-costs" &gt;Affine costs&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#substitution-matrices" &gt;Substitution matrices&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#but-not-local-alignment" &gt;But not local alignment&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#evaluations" &gt;Evaluations&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#unequal-string-length" &gt;Unequal string length&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#equal-string-lengths" &gt;Equal string lengths&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;h2 id="tricks-with-match-bonus-or-how-to-fool-dijkstra-s-limitations"&gt;&#10; Tricks with match bonus or how to fool Dijkstra&amp;rsquo;s limitations&#10; &lt;a class="heading-link" href="#tricks-with-match-bonus-or-how-to-fool-dijkstra-s-limitations"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;em&gt;The reader is assumed to have basic knowledge about pairwise alignment and graph theory.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Paper styleguide</title><link>https://curiouscoding.nl/posts/styleguide/</link><pubDate>Sat, 06 Aug 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/styleguide/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#notation" &gt;Notation&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#naming-and-style" &gt;Naming and style&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This is a growing list of notation and style decisions Pesho and I made during the&#10;writing of our paper, written down so that we don&amp;rsquo;t have to spend time on it again&#10;next time.&lt;/p&gt;&#10;&lt;h2 id="notation"&gt;&#10; Notation&#10; &lt;a class="heading-link" href="#notation"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;Math&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ul&gt;&#10;&lt;li&gt;Modulo: \(a\bmod m\) for remainder, \(a\equiv b\pmod m\) for equivalence.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;Alphabet&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ul&gt;&#10;&lt;li&gt;\(\Sigma\), \(|\Sigma| = 4\)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;Sequences&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ul&gt;&#10;&lt;li&gt;\(A = \overline{a_0\dots a_{n-1}} \in \Sigma^*\), \(|A| = n\)&lt;/li&gt;&#10;&lt;li&gt;\(B = \overline{b_0\dots b_{m-1}} \in \Sigma^*\), \(|B| = m\)&lt;/li&gt;&#10;&lt;li&gt;Edit distance \(\mathrm{ed}(A, B)\)&lt;/li&gt;&#10;&lt;li&gt;\(A_{&amp;lt;i} = \overline{a_0\dots a_{i-1}}\)&lt;/li&gt;&#10;&lt;li&gt;\(A_{\geq i} = \overline{a_i\dots a_{n-1}}\)&lt;/li&gt;&#10;&lt;li&gt;\(A_{i\dots i&amp;rsquo;} = \overline{a_i\dots a_{i&amp;rsquo;-1}}\)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;Edit graph&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ul&gt;&#10;&lt;li&gt;State \(\langle i, j\rangle\)&lt;/li&gt;&#10;&lt;li&gt;Graph \(G(V, E)\) where \(V = \{\langle i,j\rangle | 0\leq i\leq n, 0\leq j\leq m\}\)&lt;/li&gt;&#10;&lt;li&gt;Root state \(v_s = \langle 0,0\rangle\)&lt;/li&gt;&#10;&lt;li&gt;Target state \(v_t = \langle n,m\rangle\)&lt;/li&gt;&#10;&lt;li&gt;Distance \(d(u, v)\)&lt;/li&gt;&#10;&lt;li&gt;Path \(\pi\)&lt;/li&gt;&#10;&lt;li&gt;Shortest path \(\pi^*\)&lt;/li&gt;&#10;&lt;li&gt;Cost of path \(cost(\pi)\), \(cost(\pi^*) = d(v_s, v_t) = \mathrm{ed}(A, B)\).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/dd&gt;&#10;&lt;/dl&gt;&#10;&lt;h2 id="naming-and-style"&gt;&#10; Naming and style&#10; &lt;a class="heading-link" href="#naming-and-style"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Vertex, not node&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Target, not end&lt;/p&gt;&#10;&lt;p&gt;Goes better with \(v_s \to v_t\) notation.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Substitution, not mismatch&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Letter, not character&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Runtime complexity, not just complexity or just runtime&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;LCS, not lcs&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;code&gt;\cref&lt;/code&gt;, not &lt;code&gt;\ref&lt;/code&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Diamond optimisation for diagonal transition</title><link>https://curiouscoding.nl/posts/diamond-optimization/</link><pubDate>Mon, 01 Aug 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/diamond-optimization/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#diamond-transition-or-how-technicalities-can-break-concepts" &gt;Diamond transition or how technicalities can break concepts&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#but-let-s-take-a-closer-look" &gt;But let’s take a closer look&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;h2 id="diamond-transition-or-how-technicalities-can-break-concepts"&gt;&#10; Diamond transition or how technicalities can break concepts&#10; &lt;a class="heading-link" href="#diamond-transition-or-how-technicalities-can-break-concepts"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;em&gt;We assume the reader has some basic knowledge about pairwise alignment&#10;and in particular the WFA algorithm.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;In this post we dive into a potential 2x speedup of WFA &amp;mdash; one that turns out not to work.&lt;/p&gt;</description></item><item><title>Bidirectional A*</title><link>https://curiouscoding.nl/posts/bidirectional-astar/</link><pubDate>Thu, 28 Jul 2022 17:59:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/bidirectional-astar/</guid><description>&lt;p&gt;These are some links and papers on bidirectional A* variants. Nothing&#10;insightful at the moment.&lt;/p&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;&lt;a href="https://www.coursera.org/lecture/algorithms-on-graphs/bidirectional-a-Qel6Q" class="external-link" target="_blank" rel="noopener"&gt;small lecture&lt;/a&gt;&lt;/dt&gt;&#10;&lt;dd&gt;introduces \(h_f(u) = \frac 12 (\pi_f(u) - \pi_r)\). Not found&#10;a paper yet.&lt;/dd&gt;&#10;&lt;dt&gt;An Improved Bidirectional Heuristic Search Algorithm (Champeaux 1977)&lt;/dt&gt;&#10;&lt;dd&gt;introduces a bidirectional variant&lt;/dd&gt;&#10;&lt;dt&gt;Bidirectional Heuristic Search Again (Champeaux 1983)&lt;/dt&gt;&#10;&lt;dd&gt;fixes a bug in the&#10;above paper&lt;/dd&gt;&#10;&lt;dt&gt;Efficient modified bidirectional A* algorithm for optimal route-finding&lt;/dt&gt;&#10;&lt;dd&gt;Didn&amp;rsquo;t read closely yet.&lt;/dd&gt;&#10;&lt;dt&gt;A new bidirectional algorithm for shortest paths (Pijls 2008)&lt;/dt&gt;&#10;&lt;dd&gt;Actually a&#10;new methods. Seems to cite useful papers.&#10;&lt;p&gt;There 2 papers that cite this one may also be interesting.&lt;/p&gt;&#10;&lt;/dd&gt;&#10;&lt;/dl&gt;</description></item><item><title>The BiWFA meeting condition</title><link>https://curiouscoding.nl/posts/biwfa-meeting-condition/</link><pubDate>Mon, 11 Jul 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/biwfa-meeting-condition/</guid><description>&lt;p&gt;&lt;strong&gt;cross references:&lt;/strong&gt; &lt;a href="https://github.com/smarco/BiWFA-paper/issues/8" class="external-link" target="_blank" rel="noopener"&gt;BiWFA GitHub issue&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;It seems that getting the meeting/overlap condition of BiWFA&#10;(Marco-Sola et al. (&lt;a href="#citeproc_bib_item_1"&gt;2023&lt;/a&gt;), Algorithm 1 and Lemma 2.1) correct is tricky.&lt;/p&gt;&#10;&lt;p&gt;Let \(p := \max(x, o+e)\) be the maximal cost of any edge in the edit graph.&#10;As in the BiWFA paper, let \(s_f\) and \(s_r\) be the distances of the &lt;em&gt;forward&lt;/em&gt; and&#10;&lt;em&gt;reverse&lt;/em&gt; fronts computed so far.&lt;/p&gt;&#10;&lt;p&gt;We prove the following lemma:&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Lemma&lt;/strong&gt;&#10;Once BiWFA has expanded the forward and reverse fronts up to \(s_f\) and \(s_r\) and&#10;has found &lt;em&gt;some&lt;/em&gt; path of cost \(s \leq s_f + s_r\),&#10;expanding the fronts until \(s&amp;rsquo;_f + s&amp;rsquo;_r \geq s+p+o\) is guaranteed to find a&#10;&lt;em&gt;shortest&lt;/em&gt; path.&lt;/p&gt;</description></item><item><title>A* variants</title><link>https://curiouscoding.nl/posts/astar-variants/</link><pubDate>Sun, 12 Jun 2022 12:04:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/astar-variants/</guid><description>&lt;p&gt;These are some quick notes listing papers related to A* itself and variants. In&#10;particular, here I&amp;rsquo;m interested in papers that update \(h\) during the A* search,&#10;as a background for &lt;a href="https://curiouscoding.nl/posts/pruning/" &gt;pruning&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Specifically, our version of pruning increases \(h\) during a &lt;em&gt;single&lt;/em&gt; A* search,&#10;and in fact the heuristic becomes &lt;em&gt;in-admissible&lt;/em&gt; after pruning.&lt;/p&gt;&#10;&lt;h2 id="changing-h"&gt;&#10; Changing \(h\)&#10; &lt;a class="heading-link" href="#changing-h"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;The original A* paper has a proof of optimality. Later papers consider this also&#10;with heuristics that change their value over time.&lt;/p&gt;</description></item><item><title>IGGSY 22 Slides</title><link>https://curiouscoding.nl/posts/iggsy-presentation-slides/</link><pubDate>Sun, 12 Jun 2022 12:04:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/iggsy-presentation-slides/</guid><description>&lt;p&gt;These are the slides Pesho Ivanov and I presented at IGGSY 2022 on Astarix and A*PA.&lt;/p&gt;&#10;&lt;p&gt;Drive: &lt;a href="https://docs.google.com/presentation/d/1VHM0GADifQ6COi4VpUn3FNTtt-NxwFLHa7itAbx1GJM/edit?usp=sharing" class="external-link" target="_blank" rel="noopener"&gt;here&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Pdf: &lt;a href="http://ragnargrootkoerkamp.nl/upload/A%20for%20optimal%20sequence%20alignment.S1vgF6CTik.pdf" class="external-link" target="_blank" rel="noopener"&gt;here&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Benchmark attention points</title><link>https://curiouscoding.nl/posts/benchmarks/</link><pubDate>Thu, 28 Apr 2022 23:33:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/benchmarks/</guid><description>&lt;p&gt;&lt;em&gt;Benchmarking is harder than you think, even when taking into account this rule.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;This post lists some lessons I learned while attempting to run benchmarks for&#10;&lt;a href="https://github.com/RagnarGrootKoerkamp/astar-pairwise-aligner" class="external-link" target="_blank" rel="noopener"&gt;A* pairwise aligner&lt;/a&gt;. I was doing this on a laptop, which likely has different&#10;characteristics from CPUs in a typical server rack. All the programs I run are&#10;single threaded.&lt;/p&gt;&#10;&lt;h2 id="hardware"&gt;&#10; Hardware&#10; &lt;a class="heading-link" href="#hardware"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;Do not run while charging the laptop&lt;/dt&gt;&#10;&lt;dd&gt;Charging makes the battery hot and causes throttling. Run either on&#10;battery power or with a completely full battery to prevent this.&lt;/dd&gt;&#10;&lt;dt&gt;Disable hyperthreading&lt;/dt&gt;&#10;&lt;dd&gt;Completely disable hyperthreading in the BIOS.&#10;Multiple programs running on the same core may fight for resources.&lt;/dd&gt;&#10;&lt;/dl&gt;&#10;&lt;h2 id="cpu-settings"&gt;&#10; CPU settings&#10; &lt;a class="heading-link" href="#cpu-settings"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;Pin CPU frequency&lt;/dt&gt;&#10;&lt;dd&gt;CPUs, especially laptops, have turboboost, (thermal) throttling, and powersave&#10;features. Make sure to pin the CPU core frequency low enough that it can be&#10;sustained for long times without throttling.&#10;&lt;p&gt;In my case, the &lt;code&gt;performance&lt;/code&gt; governor can fix the CPU frequency. The base&#10;frequency of my CPU is &lt;code&gt;2.6GHz&lt;/code&gt;, so that&amp;rsquo;s where I pinned it.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo cpupower frequency-set -g performance&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo cpupower frequency-set -u 2.6GHz&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo cpupower frequency-set -d 2.6GHz&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;Note that even with a pinned CPU frequency, thermal throttling can reduce it.&lt;/p&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;Pin program to core&lt;/dt&gt;&#10;&lt;dd&gt;Make sure your program only executes on one core. Do this using e.g.&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;taskset -c &lt;span class="m"&gt;0&lt;/span&gt; &amp;lt;shell invocation&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;When running multiple experiments in parallel, use distinct ids instead of &lt;code&gt;0&lt;/code&gt;.&lt;/p&gt;&#10;&lt;/dd&gt;&#10;&lt;/dl&gt;</description></item><item><title>Motivation</title><link>https://curiouscoding.nl/posts/motivation/</link><pubDate>Thu, 28 Apr 2022 23:22:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/motivation/</guid><description>&lt;p&gt;It&amp;rsquo;s not the need for faster software that motivates; it&amp;rsquo;s the mathematical&#10;discovery that needs sharing.&lt;/p&gt;</description></item><item><title>Proof sketch for linear time seed heuristic alignment</title><link>https://curiouscoding.nl/posts/linear-time-pa/</link><pubDate>Sun, 24 Apr 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/linear-time-pa/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#pairwise-alignment-in-subquadratic-time" &gt;Pairwise alignment in subquadratic time&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#random-model" &gt;Random model&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#algorithm" &gt;Algorithm&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#seed-heuristic" &gt;Seed heuristic&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#match-pruning" &gt;Match pruning&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#analysis" &gt;Analysis&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#expanded-states" &gt;Expanded states&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#excess-errors" &gt;Excess errors&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#algorithmic-complexity" &gt;Algorithmic complexity&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This post is a proof sketch to show that A* with the &lt;em&gt;seed heuristic&lt;/em&gt;&#10;(&lt;a href="#citeproc_bib_item_3"&gt;Groot Koerkamp and Ivanov 2024&lt;/a&gt;) does exact pairwise alignment of random strings with random&#10;mutations in near linear time.&lt;/p&gt;&#10;&lt;h2 id="pairwise-alignment-in-subquadratic-time"&gt;&#10; Pairwise alignment in subquadratic time&#10; &lt;a class="heading-link" href="#pairwise-alignment-in-subquadratic-time"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Backurs and Indyk (&lt;a href="#citeproc_bib_item_1"&gt;2018&lt;/a&gt;) show that computing edit distance can not be&#10;done in strongly subquadratic time (i.e. \(O(n^{2-\delta})\) for any \(\delta &amp;gt;0\))&#10;assuming the Strong Exponential Time Hypothesis.&lt;/p&gt;</description></item><item><title>Variations on the WFA recursion</title><link>https://curiouscoding.nl/posts/wfa-variations/</link><pubDate>Sun, 17 Apr 2022 03:14:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/wfa-variations/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#gap-open" &gt;Gap open&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#gap-close" &gt;Gap close&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#symmetric-alternatives" &gt;Symmetric alternatives&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#another-symmetry" &gt;Another symmetry&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#conclusions" &gt;Conclusions&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;&lt;strong&gt;cross references:&lt;/strong&gt; &lt;a href="https://github.com/smarco/BiWFA-paper/issues/4" class="external-link" target="_blank" rel="noopener"&gt;BiWFA GitHub issue&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;In this post I will explore some variations of the recursion used by WFA/BiWFA&#10;for the affine version of the diagonal transition algorithm.&#10;In particular, we will go over a &lt;em&gt;gap-close&lt;/em&gt; variant, and look into some more symmetric&#10;formulations.&lt;/p&gt;&#10;&lt;h2 id="gap-open"&gt;&#10; Gap open&#10; &lt;a class="heading-link" href="#gap-open"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;WFA (&lt;a href="#citeproc_bib_item_3"&gt;Marco-Sola et al. 2021&lt;/a&gt;) introduces the affine cost variant of the classic diagonal&#10;transition method.&#10;Let us call it a &lt;strong&gt;gap-open&lt;/strong&gt; variant, because the gap-open cost \(o\) is payed when&#10;opening the gap, that is, when jumping from the \(M\) &lt;em&gt;layer&lt;/em&gt; to the \(I\) or \(D\) &lt;em&gt;layer&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>Glossary</title><link>https://curiouscoding.nl/posts/glossary/</link><pubDate>Thu, 14 Apr 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/glossary/</guid><description>&lt;p&gt;This is a growing list of ambiguous terms and their definitions.&#10;More of a place to store random remarks than a complete reference for now.&lt;/p&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;diagonal transition&lt;/dt&gt;&#10;&lt;dd&gt;name introduced by Navarro (&lt;a href="#citeproc_bib_item_1"&gt;2001&lt;/a&gt;)&lt;/dd&gt;&#10;&lt;dt&gt;approximate&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;em&gt;approximate algorithm&lt;/em&gt;: an algorithms that does not always give the&#10;&lt;em&gt;correct&lt;/em&gt; answer.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;em&gt;$k$-approximate string matching&lt;/em&gt;: variant semi-global alignment where we&#10;find all matches of a pattern in a reference with at most \(k\) mistakes.&lt;/p&gt;&#10;&lt;p&gt;Also &lt;em&gt;approximate string matching&lt;/em&gt;: alternative name for global pairwise alignment.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;dynamic heuristic&lt;/dt&gt;&#10;&lt;dd&gt;A heuristic that changes as the A* progresses. Not:&#10;&lt;em&gt;online heuristic&lt;/em&gt;.&lt;/dd&gt;&#10;&lt;dt&gt;heuristic&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ol&gt;&#10;&lt;li&gt;&lt;em&gt;A* heuristic&lt;/em&gt;: A function \(h\) that provides a lower bound (when&#10;&lt;em&gt;admissible&lt;/em&gt;) on the distance from the current state to the end.&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;heuristic method&lt;/em&gt;: An approximate method, that approximates the exact answer.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;exact&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ol&gt;&#10;&lt;li&gt;An &lt;em&gt;exact algorithm&lt;/em&gt; is guaranteed to give the correct (e.g. minimal) answer.&lt;/li&gt;&#10;&lt;li&gt;An &lt;em&gt;exact match&lt;/em&gt; between strings, without errors.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;optimal&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ol&gt;&#10;&lt;li&gt;&lt;em&gt;exact&lt;/em&gt;, guaranteed correct.&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;optimal performance/complexity&lt;/em&gt;: as fast as (theoretically) possible&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;complexity&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ol&gt;&#10;&lt;li&gt;&lt;em&gt;(asymptotic) runtime complexity&lt;/em&gt;: how the runtime of an algorithm scales&#10;with input size, as in \(O(n^2)\).&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;not simple, but difficult&lt;/em&gt;: a more informal statement.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;vertex / node / state&lt;/dt&gt;&#10;&lt;dd&gt;All are used interchangeably, but have slightly different meanings:&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;em&gt;vertex&lt;/em&gt;: The objects of a graph between which the edges go. The most&#10;&amp;lsquo;mathematical&amp;rsquo;/precise of the three.&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;node&lt;/em&gt;: Same as &lt;em&gt;vertex&lt;/em&gt;, but can additionally mean a &lt;em&gt;node in a&#10;data structure&lt;/em&gt; or a &lt;em&gt;node in a tree&lt;/em&gt;. More general and hence slightly less precise when&#10;&lt;em&gt;vertex&lt;/em&gt; could also be used.&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;state&lt;/em&gt;: Usually in relation to a &lt;em&gt;state machine&lt;/em&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;In A*PA, we use &lt;em&gt;state&lt;/em&gt; exclusively for a vertex of the &lt;em&gt;edit-graph&lt;/em&gt;, and&#10;use &lt;em&gt;node&lt;/em&gt; instead of &lt;em&gt;vertex&lt;/em&gt;, mostly because it&amp;rsquo;s shorter.&lt;/p&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;seed&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ol&gt;&#10;&lt;li&gt;An arbitrary $k$mer, as in MinHash and spaced $k$mer methods.&lt;/li&gt;&#10;&lt;li&gt;A &lt;em&gt;substring&lt;/em&gt; of \(A\) when doing pairwise alignment.&lt;/li&gt;&#10;&lt;li&gt;As in &lt;em&gt;seed-and-extend&lt;/em&gt;, a &lt;em&gt;match&lt;/em&gt;: a substring of \(A\) that &lt;em&gt;matches&lt;/em&gt; somewhere to a substring of&#10;\(B\).&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;significant&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ol&gt;&#10;&lt;li&gt;&lt;em&gt;a significant result&lt;/em&gt;: the result passed a statistical test&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;a significant speedup&lt;/em&gt;: (informal) much faster&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;average / expected / mean&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ul&gt;&#10;&lt;li&gt;&lt;em&gt;mean&lt;/em&gt;: a statistic of a set of real numbers.&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;average&lt;/em&gt;: the mean, or &amp;lsquo;common case&amp;rsquo; of some sample.&lt;/li&gt;&#10;&lt;li&gt;&lt;em&gt;expected&lt;/em&gt;: the expected value of a random variable.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/dd&gt;&#10;&lt;/dl&gt;</description></item><item><title>Pruning for A* heuristics</title><link>https://curiouscoding.nl/posts/pruning/</link><pubDate>Sat, 11 Dec 2021 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/pruning/</guid><description>&lt;p&gt;Note: this post extends the concept of &lt;em&gt;multiple-path pruning&lt;/em&gt; presented in Poole and Mackworth (&lt;a href="#citeproc_bib_item_1"&gt;2017&lt;/a&gt;).&lt;/p&gt;&#10;&lt;p&gt;Say we&amp;rsquo;re running A* in a graph from \(s\) to \(t\). \(d(s,t)\) is the distance we are&#10;looking for.&lt;/p&gt;&#10;&lt;p&gt;An A* heuristic has to satisfy \(h(u) \leq d(u, t)\) to be &lt;em&gt;admissible&lt;/em&gt;: the&#10;estimated distance to the end should never be larger than the actual distance to&#10;guarantee that the algorithm finds a shortest path.&lt;/p&gt;</description></item><item><title>AStarix</title><link>https://curiouscoding.nl/posts/astarix/</link><pubDate>Fri, 12 Nov 2021 13:05:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/astarix/</guid><description>&lt;p&gt;&lt;strong&gt;Papers&lt;/strong&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://www.biorxiv.org/content/10.1101/2020.01.22.915496v2.full" class="external-link" target="_blank" rel="noopener"&gt;AStarix: Fast and Optimal Sequence-to-Graph Alignment&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://www.biorxiv.org/content/10.1101/2021.11.05.467453v1" class="external-link" target="_blank" rel="noopener"&gt;Fast and Optimal Sequence-to-Graph Alignment Guided by Seeds&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;AStarix is a method for aligning sequences (reads) to graphs:&lt;/p&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;Input&lt;/dt&gt;&#10;&lt;dd&gt;&lt;ul&gt;&#10;&lt;li&gt;A reference sequence or graph&lt;/li&gt;&#10;&lt;li&gt;Alignment costs \((\Delta_{match}, \Delta_{subst}, \Delta_{del}, \Delta_{ins})\) for a match, substitution, insertion and deletion&lt;/li&gt;&#10;&lt;li&gt;Sequence(s) to align&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/dd&gt;&#10;&lt;dt&gt;Output&lt;/dt&gt;&#10;&lt;dd&gt;An optimal alignment of each input sequence&lt;/dd&gt;&#10;&lt;/dl&gt;&#10;&lt;p&gt;The input is a reference graph (automaton really) \(G_r = (V_r, E_r)\) with edges \(E_r \subseteq&#10;V_r\times V_r\times \Sigma\) that indicate the transitions between states.&lt;/p&gt;</description></item><item><title>Neighbour joining</title><link>https://curiouscoding.nl/posts/neighbour-joining/</link><pubDate>Fri, 12 Nov 2021 11:57:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/neighbour-joining/</guid><description>&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Neighbor_joining" class="external-link" target="_blank" rel="noopener"&gt;Neighbour joining&lt;/a&gt; (NJ, &lt;a href="https://academic.oup.com/mbe/article/4/4/406/1029664" class="external-link" target="_blank" rel="noopener"&gt;paper&lt;/a&gt;) is a phylogeny reconstruction method.&#10;It differs from UPGMA in the way it computes the distances between clusters.&lt;/p&gt;&#10;&lt;p&gt;This algorithm first assumes that the phylogeny is a star graph.&#10;Then it finds the pair of vertices that when merged and split out gives the&#10;minimal total edge length \(S_{ij}\) of the new almost-star graph. (See eq. (4)&#10;and figure 2a and 2b in the paper.)&#10;\[&#10;S_{i,j} = \frac1{2(n-2)} \sum_{k\not\in \{i,j\}}(d(i, k)+d(j,k)) + \frac 12&#10;d(i,j)+\frac 1{n-2} \sum_{k&amp;lt;l,\, k, l\not\in\{i,j\}}d(k,l).&#10;\]&#10;After subtracting the sum of all pairwise distances (which is a constant) and multiplying by \(2(n-2)\), we obtain&#10;the familiar&#10;\[&#10;Q(i, j) = (n-2) d(i, j) - \sum_{k=1}^n d(i, k) - \sum_{k=1}^n d(j, k).&#10;\]&#10;Thus, we merge the two vertices that minimize \(Q\).&#10;The distance from the merging of vertices \(i\) and \(j\) to each other vertex&#10;\(k\) is \(d_{(i-j)k} = (d_{i,k} + d_{j,k})/2\).&lt;/p&gt;</description></item><item><title>UPGMA</title><link>https://curiouscoding.nl/posts/upgma/</link><pubDate>Thu, 28 Oct 2021 11:56:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/upgma/</guid><description>&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/UPGMA" class="external-link" target="_blank" rel="noopener"&gt;Unweighted pair group method with arithmetic mean&lt;/a&gt; (UPGMA) is a phylogeny reconstruction method.&lt;/p&gt;&#10;&lt;dl&gt;&#10;&lt;dt&gt;Input&lt;/dt&gt;&#10;&lt;dd&gt;Matrix of pairwise distances&lt;/dd&gt;&#10;&lt;dt&gt;Output&lt;/dt&gt;&#10;&lt;dd&gt;Phylogeny&lt;/dd&gt;&#10;&lt;dt&gt;Algorithm&lt;/dt&gt;&#10;&lt;dd&gt;Repeatedly merge the nearest two clusters. The distance between&#10;clusters is the average of all pairwise distances between them. When merging&#10;two clusters, the distances of the new cluster are the weighted averages of&#10;distances from the two clusters being merged.&lt;/dd&gt;&#10;&lt;dt&gt;Complexity&lt;/dt&gt;&#10;&lt;dd&gt;\(O(n^3)\) naive, \(O(n^2 \ln n)\) using heap.&lt;/dd&gt;&#10;&lt;/dl&gt;</description></item><item><title>RTFE</title><link>https://curiouscoding.nl/posts/rfte/</link><pubDate>Fri, 22 Oct 2021 15:16:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/rfte/</guid><description>&lt;p&gt;Read The F*ing Error&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;When you complain about an error without reading it first.&lt;/li&gt;&#10;&lt;li&gt;When you assume you understand the problem halfway through reading the error,&#10;and only after more debugging you realize you failed to read properly.&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>1st law of Procrastination</title><link>https://curiouscoding.nl/posts/procrastination/</link><pubDate>Fri, 22 Oct 2021 11:46:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/procrastination/</guid><description>&lt;p&gt;Important deadlines require important procrastination.&lt;/p&gt;</description></item><item><title>Data should be reviewed</title><link>https://curiouscoding.nl/posts/data-should-be-reviewed/</link><pubDate>Fri, 22 Oct 2021 11:41:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/data-should-be-reviewed/</guid><description>&lt;p&gt;Experiments and their analysis should be reproducible, and all data/figures in a&#10;paper should be reviewable. Pipelines (e.g. &lt;code&gt;snakemake&lt;/code&gt; files) to generated them&#10;should be attached to the paper.&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;ve asked for automated scripts to reproduce test data on 3+ github repositories&#10;now, and got a satisfactory answer zero times:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;WFA: &lt;a href="https://github.com/smarco/WFA/issues/26" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/smarco/WFA/issues/26&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Link to a datadump on the block-aligner repository. Good to have actual data,&#10;but &lt;em&gt;exactly&lt;/em&gt; how this data was created is unclear to me.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;WFAlm: &lt;a href="https://github.com/jeizenga/wfalm/issues/6" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/jeizenga/wfalm/issues/6&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Some manual scripts to be invoked &amp;ndash; high probability of manual error, and I&#10;have to use tools I do not fully understand since I have not used them before.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;BiWFA: &lt;a href="https://github.com/smarco/BiWFA-paper/issues/1" class="external-link" target="_blank" rel="noopener"&gt;https://github.com/smarco/BiWFA-paper/issues/1&lt;/a&gt; (pending)&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Spaced K-mer Seeded Distance</title><link>https://curiouscoding.nl/posts/spaced-kmer-distance/</link><pubDate>Wed, 20 Oct 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/spaced-kmer-distance/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#background" &gt;Background&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#k-mers" &gt;$k$-mers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#sketching" &gt;Sketching&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#minhash" &gt;MinHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#terminology" &gt;Terminology&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#spaced-k-mer-seeded-distance" &gt;Spaced $k$-mer Seeded Distance&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#improving-performance" &gt;Improving performance&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#analysis" &gt;Analysis&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#pruning-false-positive-candidate-matches" &gt;Pruning false positive candidate matches&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#phylogeny-reconstruction" &gt;Phylogeny reconstruction&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#running-the-algorithm" &gt;Running the algorithm&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#assembly" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Assembly&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\[&#10;\newcommand{\vp}{\varphi}&#10;\newcommand{\A}{\mathcal A}&#10;\newcommand{\O}{\mathcal O}&#10;\newcommand{\N}{\mathbb N}&#10;\newcommand{\ed}{\mathrm{ed}}&#10;\newcommand{\mh}{\mathrm{mh}}&#10;\newcommand{\hash}{\mathrm{hash}}&#10;\]&lt;/p&gt;&#10;&lt;h2 id="background"&gt;&#10; Background&#10; &lt;a class="heading-link" href="#background"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Quickly finding similar pieces of DNA within large datasets is at the&#10;core of computational biology. This has many applications:&lt;/p&gt;</description></item><item><title>Open Science</title><link>https://curiouscoding.nl/posts/open-science/</link><pubDate>Tue, 19 Oct 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/open-science/</guid><description>&lt;p&gt;Let&amp;rsquo;s go over some reasons for why I&amp;rsquo;m writing this blog.&lt;/p&gt;&#10;&lt;h2 id="the-internet-is-more-accessible-than-papers"&gt;&#10; The internet is more accessible than papers&#10; &lt;a class="heading-link" href="#the-internet-is-more-accessible-than-papers"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;The inspiration for this blog is the post on &lt;a href="https://alexbowe.com/succinct-debruijn-graphs/" class="external-link" target="_blank" rel="noopener"&gt;Succinct de Bruijn Graphs&lt;/a&gt; by Alex Bowe.&#10;I think blog posts are a great way to quickly learn about new&#10;ideas and concepts, since they are usually more accessible than papers.&#10;A blog post can omit some of the more formal text required in papers&#10;and spend more time explaining things on an intuitive level. This way,&#10;scientific concepts can be understood by a larger audience than just those&#10;actively working on it.&lt;/p&gt;</description></item><item><title>Hugo and ox-hugo</title><link>https://curiouscoding.nl/posts/hugo/</link><pubDate>Thu, 14 Oct 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/hugo/</guid><description>&lt;p&gt;Here&amp;rsquo;s the customary &lt;em&gt;how I made this site using X&lt;/em&gt; post.&lt;/p&gt;&#10;&lt;p&gt;This site is built using &lt;a href="https://gohugo.io" class="external-link" target="_blank" rel="noopener"&gt;Hugo&lt;/a&gt; and &lt;a href="https://ox-hugo.scripter.co/" class="external-link" target="_blank" rel="noopener"&gt;&lt;code&gt;ox-hugo&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;The source is written in &lt;a href="https://orgmode.org/" class="external-link" target="_blank" rel="noopener"&gt;Org mode&lt;/a&gt;, which is converted to markdown by &lt;code&gt;ox-hugo&lt;/code&gt;.&#10;To get started yourself, check out the &lt;a href="https://github.com/RagnarGrootKoerkamp/research/tree/c46e8c7840d70b86746ebe1d76384893638d8bbc" class="external-link" target="_blank" rel="noopener"&gt;initial commit&lt;/a&gt; of the source repository&#10;and build from there.&lt;/p&gt;&#10;&lt;p&gt;Some notes:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;I&amp;rsquo;m using the &lt;code&gt;Hugo-coder&lt;/code&gt; theme.&lt;/li&gt;&#10;&lt;li&gt;Since the conversion from Org to markdown is done using an Emacs plugin, the&#10;&lt;code&gt;emacs&lt;/code&gt; folder contains a simple &lt;code&gt;init.el&lt;/code&gt; to import &lt;code&gt;ox-hugo&lt;/code&gt; and a function&#10;to export all &lt;code&gt;*.org&lt;/code&gt; files in the repository apart from those inside the&#10;&lt;code&gt;emacs&lt;/code&gt; folder itself.&lt;/li&gt;&#10;&lt;li&gt;The &lt;code&gt;makefile&lt;/code&gt; contains the &lt;code&gt;build-content&lt;/code&gt; rule to call the conversion, and&#10;&lt;code&gt;build-site&lt;/code&gt; to invoke Hugo. Just running &lt;code&gt;make&lt;/code&gt; will do both of these and&#10;serve the site locally.&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Hello, World!</title><link>https://curiouscoding.nl/posts/hello-world/</link><pubDate>Wed, 13 Oct 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/hello-world/</guid><description>&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Hello, World!&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-cpp" data-lang="cpp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;Hello, World!&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;endl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;</description></item><item><title>Spaced k-mer and assembler methods</title><link>https://curiouscoding.nl/posts/spaced-kmer-review/</link><pubDate>Wed, 14 Jul 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/spaced-kmer-review/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#spaced-k-mers" &gt;Spaced \(k\)-mers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#minimap" &gt;Minimap&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#spades" &gt;SPAdes&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#mummer4" &gt;MUMmer4&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#blasr" &gt;BLASR&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#bowtie-2" &gt;Bowtie 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#patternhunter" &gt;Patternhunter&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#spaced-seeds-improve-k-mer-based-metagenomic-classification" &gt;Spaced seeds improve \(k\)-mer-based metagenomic classification&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#lomex" &gt;LoMeX&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#meeting-notes" &gt;Meeting notes&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Concepts:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Mapping&lt;/strong&gt; Map a sequence onto a reference genome/dataset&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Assembly&lt;/strong&gt; Build a genome from a set of reads&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;em&gt;de novo&lt;/em&gt; (implied): without using a reference genome&lt;/li&gt;&#10;&lt;li&gt;Otherwise just called &lt;em&gt;mapping&lt;/em&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Typical complicating factors:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;read errors&lt;/li&gt;&#10;&lt;li&gt;non-uniform coverage&lt;/li&gt;&#10;&lt;li&gt;insert size variation&lt;/li&gt;&#10;&lt;li&gt;chimeric reads (?)&lt;/li&gt;&#10;&lt;li&gt;bireads&lt;/li&gt;&#10;&lt;li&gt;non-uniform read coverage (as in metagenomics, i.e. multi cell&#10;assembly)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="spaced-k-mers"&gt;&#10; Spaced \(k\)-mers&#10; &lt;a class="heading-link" href="#spaced-k-mers"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Also called&lt;/p&gt;</description></item><item><title>Ideas for assembling [long] reads</title><link>https://curiouscoding.nl/posts/thoughts-on-assembling/</link><pubDate>Fri, 09 Jul 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/thoughts-on-assembling/</guid><description>&lt;p&gt;\[&#10;\newcommand{\vp}{\varphi}&#10;\newcommand{\A}{\mathcal A}&#10;\newcommand{\O}{\mathcal O}&#10;\newcommand{\N}{\mathbb N}&#10;\newcommand{\Z}{\mathbb Z}&#10;\newcommand{\ed}{\mathrm{ed}}&#10;\newcommand{\mh}{\mathrm{mh}}&#10;\newcommand{\hash}{\mathrm{hash}}&#10;\]&lt;/p&gt;&#10;&lt;p&gt;Here is an idea for an algorithm to assemble long reads.&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Go over all sequences and sketch their windows using the Hamming&#10;distance preserving sketch method described &lt;a href="../hamming-similarity-search" &gt;here&lt;/a&gt;.&#10;This method may need some tweaking to also work with an indel rate of&#10;around 10%.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Let&amp;rsquo;s say we find a pair of matching windows between reads \(A\) and&#10;\(B\) starting at positions \(i\) and \(j\). This indicates that&#10;\(A\) and \(B\) may be related with an offset of \(j-i\).&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;For each pair of reads, keep track of all potential offsets. We don&amp;rsquo;t&#10;need to keep the list of exact offsets. Instead, we can bucket them&#10;into buckets of size \(\O(\sqrt{|A|})\).&lt;/p&gt;&#10;&lt;p&gt;In particular, for two reads \(A\) and \(B\) that overlap on \(n\)&#10;basepairs where each of them has an indel rate of \(p=0.1\), we can&#10;crudely model the deviation of the offset as a random walk on \(\Z\),&#10;where for each pair of nucleotides there is a \(0.1\) chance of&#10;moving from \(n\) to \(n+1\) and \(0.1\) change of moving to \(n-1\).&lt;/p&gt;&#10;&lt;p&gt;One property of such a random walk is that the expected deviation&#10;from \(0\) is of order \(\sqrt n\). Thus, when we bucket all&#10;candidate overlaps into buckets of size \(\sqrt n\) we expect one (or&#10;possibly two adjacent) bucket(s) to contain all the true positive&#10;pairs of matching windows.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;For each pair of reads, find the buckets with count significantly&#10;higher than the expected noise coming from false positives.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;A true positive offset gives rise to an alignment of the two reads.&#10;We only know the start of the alignment with precision \(\sqrt n\),&#10;but this is sufficient to quickly (after processing \(\O(\sqrt n)\)&#10;basepairs) converge to the actual offset.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Build the overlay graph.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Assemble using the overlay graph. This could be done using existing&#10;methods.&lt;/p&gt;&#10;&lt;p&gt;(Dealing with long repeats is the tricky part here, where sequences&#10;may overlap but not actually match in practice. Also, there are two&#10;copies of all DNA because of duplicate chromosomes, which need to be&#10;taken into account.)&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;</description></item><item><title>Hamming Similarity Search</title><link>https://curiouscoding.nl/posts/hamming-similarity-search/</link><pubDate>Thu, 08 Jul 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/hamming-similarity-search/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#background" &gt;Background&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#k-mers" &gt;$k$-mers&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#sketching" &gt;Sketching&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#minhash" &gt;MinHash&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#hamming-similarity-search1" &gt;Hamming Similarity Search&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#improving-performance" &gt;Improving performance&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#analysis" &gt;Analysis&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#pruning-false-positive-candidate-matches" &gt;Pruning false positive candidate matches&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#phylogeny-reconstruction" &gt;Phylogeny reconstruction&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#running-the-algorithm" &gt;Running the algorithm&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#assembly" &gt;Assembly&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;\[&#10;\newcommand{\vp}{\varphi}&#10;\newcommand{\A}{\mathcal A}&#10;\newcommand{\O}{\mathcal O}&#10;\newcommand{\N}{\mathbb N}&#10;\newcommand{\ed}{\mathrm{ed}}&#10;\newcommand{\mh}{\mathrm{mh}}&#10;\newcommand{\hash}{\mathrm{hash}}&#10;\]&lt;/p&gt;&#10;&lt;h2 id="background"&gt;&#10; Background&#10; &lt;a class="heading-link" href="#background"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Quickly finding similar pieces of DNA within large datasets is at the&#10;core of computational biology. This has many applications:&lt;/p&gt;</description></item><item><title>Detached fullscreen in Sway</title><link>https://curiouscoding.nl/posts/sway-fullscreen/</link><pubDate>Fri, 02 Jul 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/sway-fullscreen/</guid><description>&lt;p&gt;&lt;strong&gt;Backlinks&lt;/strong&gt;: &lt;a href="https://github.com/swaywm/sway/pull/4255" class="external-link" target="_blank" rel="noopener"&gt;PR for Sway&lt;/a&gt; |&#10;&lt;a href="https://aur.archlinux.org/packages/sway-inhibit-fullscreen-git/" class="external-link" target="_blank" rel="noopener"&gt;AUR&#10;package&lt;/a&gt; &lt;code&gt;sway-inhibit-fullscreen-git&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;Once upon a time, Chromium had a bug where using &lt;code&gt;$mod+f&lt;/code&gt; in i3 to&#10;fullscreen the Chromium window changed the window to occupy the entire&#10;screen, but didn&amp;rsquo;t actually make Chromium enter full screen mode.&#10;According to some, those&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; were&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt; the&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt; good&lt;sup id="fnref:4"&gt;&lt;a href="#fn:4" class="footnote-ref" role="doc-noteref"&gt;4&lt;/a&gt;&lt;/sup&gt;&#10;days&lt;sup id="fnref:5"&gt;&lt;a href="#fn:5" class="footnote-ref" role="doc-noteref"&gt;5&lt;/a&gt;&lt;/sup&gt;&lt;sup&gt;, &lt;/sup&gt;&lt;sup id="fnref:6"&gt;&lt;a href="#fn:6" class="footnote-ref" role="doc-noteref"&gt;6&lt;/a&gt;&lt;/sup&gt;. Watching 4 YouTube streams in parallel was still&#10;possibly, back in those days:&lt;/p&gt;&#10;&lt;figure class="inset"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/fullscreen.png"&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;p&gt;Without patches, the best we can do nowadays&lt;sup id="fnref:7"&gt;&lt;a href="#fn:7" class="footnote-ref" role="doc-noteref"&gt;7&lt;/a&gt;&lt;/sup&gt; is the following&lt;/p&gt;</description></item><item><title>Open source contributions</title><link>https://curiouscoding.nl/posts/oss-contributions/</link><pubDate>Fri, 02 Jul 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/oss-contributions/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#my-aur-packages" &gt;My aur packages&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#some-issues-i-reported-fixed" &gt;Some issues I reported/fixed&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;h2 id="my-aur-packages"&gt;&#10; My aur packages&#10; &lt;a class="heading-link" href="#my-aur-packages"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;a href="https://aur.archlinux.org/packages/?K=rgrootkoerkamp&amp;amp;SeB=m" class="external-link" target="_blank" rel="noopener"&gt;List on aur.archlinux.org&lt;/a&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://aur.archlinux.org/packages/bapctools-git/" class="external-link" target="_blank" rel="noopener"&gt;bapctools-git&lt;/a&gt;:&#10;&lt;a href="https://github.com/RagnarGrootKoerkamp/BAPCtools" class="external-link" target="_blank" rel="noopener"&gt;BAPCtools&lt;/a&gt; is&#10;used for developing ICPC style programming contest problems.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://aur.archlinux.org/packages/feh-preload-next-image-git/" class="external-link" target="_blank" rel="noopener"&gt;feh-preload-next-image-git&lt;/a&gt;:&#10;&lt;a href="https://github.com/RagnarGrootKoerkamp/feh" class="external-link" target="_blank" rel="noopener"&gt;Branch&lt;/a&gt; of Feh that&#10;loads the next image to speed up browsing images in a remote&#10;directory.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://aur.archlinux.org/packages/i3-focus-last-git/" class="external-link" target="_blank" rel="noopener"&gt;i3-focus-last-git&lt;/a&gt;:&#10;&lt;a href="https://github.com/lbonn/i3-focus-last" class="external-link" target="_blank" rel="noopener"&gt;Window switcher&lt;/a&gt; for&#10;i3/sway.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://aur.archlinux.org/packages/python-pyexiftool-nocheck/" class="external-link" target="_blank" rel="noopener"&gt;python-pyexiftool-nocheck&lt;/a&gt;:&#10;the original&#10;&lt;a href="https://aur.archlinux.org/packages/python-pyexiftool/" class="external-link" target="_blank" rel="noopener"&gt;python-pyexiftool&lt;/a&gt;&#10;is outdated, orphaned, and still depends on python2.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://aur.archlinux.org/packages/sway-inhibit-fullscreen-git/" class="external-link" target="_blank" rel="noopener"&gt;sway-inhibit-fullscreen-git&lt;/a&gt;:&#10;Sway&#10;&lt;a href="https://github.com/RagnarGrootKoerkamp/sway/tree/fakefullscreen" class="external-link" target="_blank" rel="noopener"&gt;branch&lt;/a&gt;&#10;that adds the &lt;code&gt;inhibit_fullscreen toggle&lt;/code&gt; command. Bind this to&#10;e.g. &lt;code&gt;$mod+Shift+f&lt;/code&gt; to disconnect the Sway full screen status from the&#10;application full screen status. Used to e.g. watch YouTube videos in&#10;Chromium in full screen mode, but in a window that is only a quarter&#10;of the screen.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="some-issues-i-reported-fixed"&gt;&#10; Some issues I reported/fixed&#10; &lt;a class="heading-link" href="#some-issues-i-reported-fixed"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/philc/vimium/issues/3557" class="external-link" target="_blank" rel="noopener"&gt;vimium/issues/3557&lt;/a&gt;&#10;after searching and hitting Enter, vimium freezes and needs a mouse&#10;click to unfreeze. &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;N&lt;/code&gt; do not work.&#10;&lt;ul&gt;&#10;&lt;li&gt;fix &lt;a href="https://github.com/philc/vimium/pull/3847" class="external-link" target="_blank" rel="noopener"&gt;here&lt;/a&gt;: add a&#10;missing &lt;code&gt;return&lt;/code&gt; statement after many hours of debugging&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/philc/vimium/issues/3844" class="external-link" target="_blank" rel="noopener"&gt;vimium/issues/3844&lt;/a&gt;&#10;Bug: Last characters dropped when using custom search engine&#10;&lt;ul&gt;&#10;&lt;li&gt;duplicate of&#10;&lt;a href="https://github.com/philc/vimium/issues/3567" class="external-link" target="_blank" rel="noopener"&gt;issues/3567&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;PR &lt;a href="https://github.com/philc/vimium/pull/3846" class="external-link" target="_blank" rel="noopener"&gt;pull/3846&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/swaywm/sway/pull/6286" class="external-link" target="_blank" rel="noopener"&gt;sway/pull/6286&lt;/a&gt; Add&#10;&lt;code&gt;anything&lt;/code&gt; option to Grimshot to allow selecting either a window,&#10;output, or manual area.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/emersion/mako/issues/358" class="external-link" target="_blank" rel="noopener"&gt;mako/issues/358&lt;/a&gt;&#10;Feature Request: Dismiss all notifications with given category&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/emersion/slurp/issues/87" class="external-link" target="_blank" rel="noopener"&gt;slurp/issues/87&lt;/a&gt;&#10;Moving the mouse to a different output does not always grey out&#10;rectangles&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/emersion/slurp/issues/86" class="external-link" target="_blank" rel="noopener"&gt;slurp/issues/86&lt;/a&gt;&#10;Clicking outside all rectangles should cancel&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/swaywm/sway/issues/6299" class="external-link" target="_blank" rel="noopener"&gt;sway/issues/6299&lt;/a&gt;&#10;Unexpected &lt;code&gt;next_on_output&lt;/code&gt; behaviour with&#10;&lt;code&gt;workspace_auto_back_and_forth&lt;/code&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;follow-up PRs: &lt;a href="https://github.com/swaywm/sway/pull/6332" class="external-link" target="_blank" rel="noopener"&gt;6332: cleanup&lt;/a&gt;, &lt;a href="https://github.com/swaywm/sway/pull/6334" class="external-link" target="_blank" rel="noopener"&gt;6334: more cleanup&lt;/a&gt;, &lt;a href="https://github.com/swaywm/sway/pull/6335" class="external-link" target="_blank" rel="noopener"&gt;6335: &lt;code&gt;.clang-format&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/signalapp/Signal-Desktop/issues/5307" class="external-link" target="_blank" rel="noopener"&gt;Signal-Desktop/issues/5307&lt;/a&gt; &lt;code&gt;ctrl-2&lt;/code&gt; broken under Wayland&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Powersearch with Vimium</title><link>https://curiouscoding.nl/posts/vimium/</link><pubDate>Fri, 02 Jul 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/vimium/</guid><description>&lt;p&gt;&lt;strong&gt;Related posts&lt;/strong&gt;: &lt;a href="../dark-mode" &gt;Dark mode with Vimium&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Vimium (&lt;a href="https://github.com/philc/vimium" class="external-link" target="_blank" rel="noopener"&gt;Github&lt;/a&gt;, &lt;a href="https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb" class="external-link" target="_blank" rel="noopener"&gt;Chromium extension&lt;/a&gt;) is not only a great way to navigate webpages; it&amp;rsquo;s also a&#10;great help to quickly search many webpages.&lt;/p&gt;&#10;&lt;p&gt;I am using it many times a day to search for just the documentation I&#10;need. Some of the search engines I have configured:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;span class="lnt"&gt;12&#10;&lt;/span&gt;&lt;span class="lnt"&gt;13&#10;&lt;/span&gt;&lt;span class="lnt"&gt;14&#10;&lt;/span&gt;&lt;span class="lnt"&gt;15&#10;&lt;/span&gt;&lt;span class="lnt"&gt;16&#10;&lt;/span&gt;&lt;span class="lnt"&gt;17&#10;&lt;/span&gt;&lt;span class="lnt"&gt;18&#10;&lt;/span&gt;&lt;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Documentation&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;archwiki&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://wiki.archlinux.org/index.php?search=%s ArchWiki&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;aur&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://aur.archlinux.org/packages/?K=%s AUR&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;cpp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://en.cppreference.com/mwiki/index.php?search=%s CppReference&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;github&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://github.com/search?q=%s GitHub&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;hoogle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://www.haskell.org/hoogle/?hoogle=%s Hoogle&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;oeis&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://oeis.org/search?q=%s OEIS&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;python&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://docs.python.org/3.7/search.html?q=%s Python&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;wiki&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://en.wikipedia.org/w/index.php?title=Special:Search&amp;amp;search=%s Wikipedia&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Translation&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;nlen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://translate.google.nl/#nl/en/%s Dutch -&amp;gt; English&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;ennl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://translate.google.nl/#en/nl/%s English -&amp;gt; Dutch&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;deen&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://translate.google.nl/#de/en/%s German -&amp;gt; English&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;ende&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://translate.google.nl/#en/de/%s English -&amp;gt; German&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# Other&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;imdb&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://www.imdb.com/find?q=%s IMDB&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;# `pe 123` to jump straight to problem 123.&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;pe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://projecteuler.net/problem=%s Project Euler&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;kattis&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;https://open.kattis.com/search?q=%s Kattis&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;Any of these can now be activated by typing their shorthand in the&#10;omnibar (which is usually activated by pressing &lt;code&gt;o&lt;/code&gt; or &lt;code&gt;O&lt;/code&gt;). Vimium even&#10;has live preview support for Wikipedia and Google search, as well as&#10;some others.&lt;/p&gt;</description></item><item><title>Wayland utilities</title><link>https://curiouscoding.nl/posts/wayland/</link><pubDate>Fri, 02 Jul 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/wayland/</guid><description>&lt;p&gt;This post goes over some useful utilities I have been using on my&#10;Wayland system.&lt;/p&gt;&#10;&lt;h2 id="screen-brightness-light"&gt;&#10; Screen brightness: &lt;code&gt;light&lt;/code&gt;&#10; &lt;a class="heading-link" href="#screen-brightness-light"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/haikarainen/light" class="external-link" target="_blank" rel="noopener"&gt;Light&lt;/a&gt; is a nice tool to manage&#10;screen and keyboard brightness.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Install &lt;code&gt;light&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Add your user to the &lt;code&gt;video&lt;/code&gt; group: &lt;code&gt;usermod -aG video &amp;lt;user&amp;gt;&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;I really like the &lt;code&gt;light -T&lt;/code&gt; flag, which multiplies the current&#10;brightness by some value. This way you can have fine grained control&#10;both for very low and very high brightness values. To prevent yourself&#10;from decreasing the brightness all the way to &lt;code&gt;0&lt;/code&gt;, you can run&#10;e.g. &lt;code&gt;light -N 0.2&lt;/code&gt; to set a minimium screen brightness of &lt;code&gt;0.2&lt;/code&gt;. This&#10;value will be stored in your config directory under &lt;code&gt;~/.config/light/&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Browsing in the dark with Vimium and Dark Reader</title><link>https://curiouscoding.nl/posts/dark-mode/</link><pubDate>Thu, 01 Jul 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/dark-mode/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#chromium-theme" &gt;Chromium theme&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#dark-reader" &gt;Dark Reader&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#vimium" &gt;Vimium&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Let&amp;rsquo;s quickly go over some settings you can change for a better dark&#10;mode experience in Chromium.&lt;/p&gt;&#10;&lt;h2 id="chromium-theme"&gt;&#10; Chromium theme&#10; &lt;a class="heading-link" href="#chromium-theme"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;First of all, you can make Chromium itself use a dark theme. This will&#10;ensure both a dark tab bar and nice dark settings pages. As explained&#10;&lt;a href="https://askubuntu.com/questions/1159741/enable-dark-mode-on-chromes-internal-pages" class="external-link" target="_blank" rel="noopener"&gt;here&lt;/a&gt;,&#10;you&amp;rsquo;ll need to change the following:&lt;/p&gt;</description></item><item><title>Window switching in Sway</title><link>https://curiouscoding.nl/posts/sway-window-switching/</link><pubDate>Thu, 01 Jul 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/sway-window-switching/</guid><description>&lt;p&gt;Sway has many commands for switching the active workspace and focused&#10;window. However, I find that most of my window switching comes down to a&#10;few simple commands that focus a specific application, or open it first&#10;when it has no open windows yet. E.g.:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;$mod+s&lt;/code&gt;: open and/or focus slack&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;$mod+i&lt;/code&gt;: open and/or focus signal&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;$mod+m&lt;/code&gt;: open and/or focus emacs&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;$mod+c&lt;/code&gt;: open and/or focus chromium&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;In addition to this, some apps like emacs have a separate &lt;code&gt;$mod+Shift+m&lt;/code&gt;&#10;command that always opens a new window/instance.&lt;/p&gt;</description></item><item><title>Clean your homedir with XDG Base Dir</title><link>https://curiouscoding.nl/posts/xdg-base-dir/</link><pubDate>Wed, 30 Jun 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/xdg-base-dir/</guid><description>&lt;p&gt;&lt;strong&gt;Links&lt;/strong&gt;:&#10;&lt;a href="https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html" class="external-link" target="_blank" rel="noopener"&gt;XDG specification&lt;/a&gt; | &lt;a href="https://wiki.archlinux.org/title/XDG_Base_Directory" class="external-link" target="_blank" rel="noopener"&gt;ArchWiki&lt;/a&gt; | &lt;a href="https://www.reddit.com/r/linux/comments/971m0z/im_tired_of_folders_littering_my_home_directory/" class="external-link" target="_blank" rel="noopener"&gt;Reddit post&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;In case you are, like me, tired of applications polluting your homedir&#10;with config and data files, the XDB Base Directory Specification&#10;(&lt;a href="https://wiki.archlinux.org/title/XDG_Base_Directory" class="external-link" target="_blank" rel="noopener"&gt;ArchWiki&lt;/a&gt;) has&#10;your back.&lt;/p&gt;&#10;&lt;p&gt;You probably saw the &lt;code&gt;~/.config&lt;/code&gt; directory already, and in fact, many&#10;programs can be told to use this directory instead of polluting your&#10;homedir. The ArchWiki page has a list of many applications and which&#10;environment variables need to be set to change the location of their&#10;configuration.&lt;/p&gt;</description></item><item><title>Emacs Doom</title><link>https://curiouscoding.nl/posts/emacs/</link><pubDate>Wed, 30 Jun 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/emacs/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#configuration" &gt;Configuration&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#init.el" &gt;init.el&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#config.el" &gt;config.el&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#running-as-server-and-client" &gt;Running as server and client&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wayland" &gt;Wayland&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#useful-commands" &gt;Useful commands&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#emacs-as-mail-client" &gt;Emacs as mail client&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Install Doom Emacs as explained in the&#10;&lt;a href="https://github.com/hlissner/doom-emacs#install" class="external-link" target="_blank" rel="noopener"&gt;readme&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Alongside it, you&amp;rsquo;ll want to install &lt;code&gt;ripgrep&lt;/code&gt; and &lt;code&gt;fd&lt;/code&gt; for better&#10;search integration, and possibly &lt;code&gt;ttf-font-awesome&lt;/code&gt; for better icons.&lt;/p&gt;&#10;&lt;h2 id="configuration"&gt;&#10; Configuration&#10; &lt;a class="heading-link" href="#configuration"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Instead of the default &lt;code&gt;~/emacs.d/&lt;/code&gt; and &lt;code&gt;~/doom.d/&lt;/code&gt; config directories,&#10;you can also use &lt;code&gt;~/.config/emacs/&lt;/code&gt; and &lt;code&gt;~/.config/doom/&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Environment variables done once</title><link>https://curiouscoding.nl/posts/environment-variables/</link><pubDate>Wed, 30 Jun 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/environment-variables/</guid><description>&lt;p&gt;&lt;strong&gt;Links&lt;/strong&gt;: &lt;a href="https://github.com/systemd/systemd/issues/7641" class="external-link" target="_blank" rel="noopener"&gt;GitHub issue&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;One problem I had with my Sway setup is that setting environment&#10;variables in my &lt;code&gt;config.fish&lt;/code&gt; (the Fish equivalent to &lt;code&gt;.bashrc&lt;/code&gt; or&#10;&lt;code&gt;.zshrc&lt;/code&gt;) is not always sufficient.&lt;/p&gt;&#10;&lt;p&gt;In particular, I need my environment variables to be available in at&#10;least the following places:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;my Fish shell,&lt;/li&gt;&#10;&lt;li&gt;applications launched from Sway (e.g. using keybindings),&lt;/li&gt;&#10;&lt;li&gt;applications launched as a systemd service (e.g. the Emacs server&#10;daemon).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Setting variables in the shell profile has the problem that they are not&#10;picked up by systemd services. Another option seems to be&#10;&lt;code&gt;~/.pam_environment&lt;/code&gt;, but this&#10;&lt;a href="https://github.com/linux-pam/linux-pam/commit/ecd526743a27157c5210b0ce9867c43a2fa27784" class="external-link" target="_blank" rel="noopener"&gt;is deprecated&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>28000x speedup with Numba.CUDA</title><link>https://curiouscoding.nl/posts/numba-cuda-speedup/</link><pubDate>Mon, 24 May 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/numba-cuda-speedup/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#cuda-overview" &gt;CUDA Overview&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#profiling" &gt;Profiling&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#optimizing-tensor-sketch" &gt;Optimizing Tensor Sketch&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#cpu-code" &gt;CPU code&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#v0-original-python-code" &gt;V0: Original python code&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v1-numba" &gt;V1: Numba&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v2-multithreading" &gt;V2: Multithreading&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#gpu-code" &gt;GPU code&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="#v3-a-first-gpu-version" &gt;V3: A first GPU version&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v4-parallel-kernel-invocations" &gt;V4: Parallel kernel invocations&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v5-single-kernel-with-many-blocks" &gt;V5: Single kernel with many blocks&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v6-detailed-profiling-kernel-compute" &gt;V6: Detailed profiling: Kernel Compute&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v7-detailed-profiling-kernel-latency" &gt;V7: Detailed profiling: Kernel Latency&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v8-detailed-profiling-shared-memory-access-pattern" &gt;V8: Detailed profiling: Shared Memory Access Pattern&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v9-more-work-per-thread" &gt;V9: More work per thread&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v10-cache-seq-to-shared-memory" &gt;V10: Cache seq to shared memory&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v11-hashes-and-signs-in-shared-memory" &gt;V11: Hashes and signs in shared memory&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v12-revisiting-blocks-per-kernel" &gt;V12: Revisiting blocks per kernel&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v13-passing-a-tuple-of-sequences" &gt;V13: Passing a tuple of sequences&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v14-better-hardware" &gt;V14: Better hardware&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#v15-dynamic-shared-memory" &gt;V15: Dynamic shared memory&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#wrap-up" &gt;Wrap up&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;&lt;strong&gt;Backlinks&lt;/strong&gt;: &lt;a href="https://www.reddit.com/r/CUDA/comments/mq1yrm/28000x_speedup_with_numbacuda/" class="external-link" target="_blank" rel="noopener"&gt;r/CUDA&lt;/a&gt;, &lt;a href="https://numba.discourse.group/t/blog-28000x-speedup-with-numba-cuda/667" class="external-link" target="_blank" rel="noopener"&gt;Numba discourse&lt;/a&gt;&lt;/p&gt;</description></item><item><title>X1 Extreme Gen 3 - Migrating to Wayland</title><link>https://curiouscoding.nl/posts/x1e3/</link><pubDate>Sun, 16 May 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/x1e3/</guid><description>&lt;p&gt;I got a new laptop, so this felt like the right time to migrate to&#10;Wayland.&lt;/p&gt;&#10;&lt;h2 id="delta"&gt;&#10; Delta&#10; &lt;a class="heading-link" href="#delta"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;what&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;before&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;after&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;&lt;strong&gt;hardware&lt;/strong&gt;&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;laptop&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Asus UX501V&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Lenovo X1 Extreme Gen 3&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;CPU&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;i7-6700HQ&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;i7-10750H&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;GPU&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;GTX 960M&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;GTX 1650&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;RAM&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;16GB&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;64GB&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;&lt;strong&gt;OS&lt;/strong&gt;&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;bootloader&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Grub&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;EFISTUB&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;OS&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Windows + Arch dualboot&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Windows + Arch dualboot&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;networking&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;netctl&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;systemd-networkd&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;dns/dhcp&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;dhcpcd&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;systemd-resolved&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;wifi&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;wpa_supplicant&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;iwd&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;&lt;strong&gt;Wayland&lt;/strong&gt;&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;display/login manager&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;-&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;-&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;display server&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;X&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Wayland&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;window manager&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;i3&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Sway&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;bar&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;i3blocks&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;waybar&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;backlight&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;xbacklight&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;light&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;night mode&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;redshift&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;gammastep&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;clipboard&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;-&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;wl-clipboard, clipman&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;program launcher&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;rofi&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;rofi [wayland]&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;password finder&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;rofi-pass&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;rofi-pass-git&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;key remapping&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;setxkbmap, xcape, xmodmap&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;interception-tools&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;&lt;strong&gt;Tools&lt;/strong&gt;&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;terminal emulator&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;urxvt&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;foot&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;shell&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;zsh&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;fish&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;shell highlighting&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;zsh-syntax-highlight&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;-&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;environment variables&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;.zshrc&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;environment.d&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;text editor&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;vim&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;emacs doom&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;aur helper&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;packer&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;yay&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;directory usage&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;du&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;dust&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;password manager&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;pass&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;pass&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;search tool&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;ag [silver searcher]&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;ag + ripgrep + fd&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;file browser&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;terminal&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;terminal + ranger&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;calculator&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;qalc&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;qalc, rofi-calc&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;notification deamon&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;dunst&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;mako&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;image viewer&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;feh&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;feh + sxiv&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;music&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;-&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;spotifyd + spotify-tui + waybar custom/media&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;screenshot&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;teiler+scrot&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;grimshot (from sway) + custom upload wrapper&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;wallpaper&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;feh&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;sway&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;messenger&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;slack, signal-desktop&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;slack, signal-desktop [wayland]&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;system monitor&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;htop&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;htop&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;remote shell&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;ssh&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;ssh&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;browser&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;chromium&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;chromium&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;pdf viewer&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;zathura&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;zathura&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;vpn&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;-&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;openconnect&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;see also the i3 -&amp;gt; sway &lt;a href="https://github.com/swaywm/sway/wiki/i3-Migration-Guide" class="external-link" target="_blank" rel="noopener"&gt;migration guide&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>SE Endurance: Early game</title><link>https://curiouscoding.nl/posts/factorio-early-game/</link><pubDate>Mon, 26 Apr 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/factorio-early-game/</guid><description>&lt;p&gt;&lt;strong&gt;Backlinks&lt;/strong&gt;: &lt;a href="https://www.reddit.com/r/factorio/comments/myt05k/se_endurance_early_game/" class="external-link" target="_blank" rel="noopener"&gt;Reddit&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This is the start of a series of posts on our (&lt;code&gt;philae&lt;/code&gt;, &lt;code&gt;winston&lt;/code&gt;) play&#10;through Factorio with the Space Exploration mod.&lt;/p&gt;&#10;&lt;p&gt;After lots of struggling, we recently finished our first SE world after&#10;624 in-game hours. Since this was also our first/second Factorio world,&#10;the start was very inefficient and we learned a lot of things along the&#10;way. In this new map, which we call &lt;em&gt;Endurance&lt;/em&gt; (after the&#10;interplanetary spaceship in &lt;em&gt;Interstellar&lt;/em&gt;), we will apply what we&#10;learned, and share it with the world :)&lt;/p&gt;</description></item><item><title>Hashcode 2021 Finals</title><link>https://curiouscoding.nl/posts/hashcode-2021-finals/</link><pubDate>Sat, 24 Apr 2021 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/hashcode-2021-finals/</guid><description>&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt; &lt;a href="https://hashcodejudge.withgoogle.com/#/rounds/5879728443490304/" class="external-link" target="_blank" rel="noopener"&gt;Problem&lt;/a&gt; | &lt;a href="https://hashcodejudge.withgoogle.com/scoreboard" class="external-link" target="_blank" rel="noopener"&gt;Scoreboard&lt;/a&gt;&lt;br /&gt;&#10;&lt;strong&gt;Team:&lt;/strong&gt; &lt;code&gt;cat /dev/random | grep &amp;quot;to be or not to be&amp;quot;&lt;/code&gt;&lt;br /&gt;&#10;&lt;strong&gt;Who:&lt;/strong&gt; Jan-Willem Buurlage, Ragnar Groot Koerkamp, Timon Knigge, Abe Wits&lt;br /&gt;&#10;&lt;strong&gt;Score:&lt;/strong&gt; 274253375&lt;br /&gt;&#10;&lt;strong&gt;Rank:&lt;/strong&gt; 19 of 38&lt;/p&gt;&#10;&lt;p&gt;Not good.&lt;br /&gt;&#10;Not bad.&lt;br /&gt;&#10;Definitely ugly.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Linkerrijtje&lt;/em&gt; (aka top half).&lt;/p&gt;&#10;&lt;p&gt;I would have liked to write that I&amp;rsquo;m happy with the result, but to be&#10;fair&amp;ndash;I&amp;rsquo;m not. Just the fact that I can&amp;rsquo;t sleep and feel the need to&#10;write this in the middle of the night surely is indication of this.&#10;Plenty of things could have gone better, and there are so many things we&#10;(I) could have done differently to actually break that elusive 300M&#10;barrier (and potentially get that top 10 place we were hoping for), that&#10;I&amp;rsquo;ll definitely be sad for a little while.&lt;/p&gt;</description></item><item><title>Hashcode 2021: A lucky ride</title><link>https://curiouscoding.nl/posts/hashcode-2021/</link><pubDate>Mon, 01 Mar 2021 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/hashcode-2021/</guid><description>&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt; &lt;a href="https://hashcodejudge.withgoogle.com/#/rounds/5879728443490304/" class="external-link" target="_blank" rel="noopener"&gt;Problem&lt;/a&gt; | &lt;a href="https://hashcodejudge.withgoogle.com/scoreboard" class="external-link" target="_blank" rel="noopener"&gt;Scoreboard&lt;/a&gt; | &lt;a href="https://codeforces.com/blog/entry/88188" class="external-link" target="_blank" rel="noopener"&gt;Codeforces announcement&lt;/a&gt;, &lt;a href="https://codeforces.com/blog/entry/88328" class="external-link" target="_blank" rel="noopener"&gt;this blog&lt;/a&gt; | &lt;a href="https://news.ycombinator.com/item?id=26319076" class="external-link" target="_blank" rel="noopener"&gt;Hacker News&lt;/a&gt;&lt;br /&gt;&#10;&lt;strong&gt;Team:&lt;/strong&gt; &lt;code&gt;cat /dev/random | grep &amp;quot;to be or not to be&amp;quot;&lt;/code&gt;&lt;br /&gt;&#10;&lt;strong&gt;Who:&lt;/strong&gt; Jan-Willem Buurlage, Ragnar Groot Koerkamp, Timon Knigge, Abe Wits&lt;br /&gt;&#10;&lt;strong&gt;Score:&lt;/strong&gt; 10282641&lt;br /&gt;&#10;&lt;strong&gt;Rank:&lt;/strong&gt; 16&lt;/p&gt;&#10;&lt;p&gt;Since we did quite well, here is a write-up of our participation in&#10;Hashcode 2021.&lt;/p&gt;&#10;&lt;h2 id="prep"&gt;&#10; Prep&#10; &lt;a class="heading-link" href="#prep"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;All four of us had previously participated in Hashcode, but this was the&#10;first time in the current composition. Since we estimated our chances of&#10;getting through to the finals to be more than nothing, we decided to&#10;practice some previous Hashcode problems. Not all test sessions were&#10;equally successful, but we did manage to get a good division of work:&#10;while I start by immediately writing the IO &lt;code&gt;Input&lt;/code&gt; and &lt;code&gt;Output&lt;/code&gt;&#10;classes, and the &lt;code&gt;Output::score()&lt;/code&gt; function, the others always start&#10;with reading the statement, analysing the testcases, and writing at&#10;least one greedy solution. This already is a big step up from previous&#10;years/teams, where usually everybody would write the IO themselves.&lt;/p&gt;</description></item></channel></rss>