<?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>Tue, 03 Mar 2026 00:00:00 +0100</lastBuildDate><atom:link href="https://curiouscoding.nl/posts/index.xml" rel="self" type="application/rss+xml"/><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
&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,
&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
have to go through the full chat-bot flow first, see below. Or maybe they
changed the magic bit.)&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;I have a NordVPN subscription since many years.&lt;/p&gt;
&lt;p&gt;Recently I have been getting mails that my card is expired and that I
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&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;
&lt;ul&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&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;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#initial-algorithm" &gt;Initial Algorithm&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;8&lt;/span&gt; &lt;a href="#optimizing-things" &gt;Optimizing things&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;13&lt;/span&gt; &lt;a href="#further-ideas" &gt;Further ideas&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;These are some notes on &lt;em&gt;customizable contraction hierarchies&lt;/em&gt;, based on talks
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;These are some notes on Wheeler DFAs after chatting with Nicola
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
from the RAVEN lab at DSB 2026 in Venice.&lt;/p&gt;
&lt;h3 id="deterministic-finite-automaton--dfa"&gt;
 &lt;span class="section-num"&gt;1&lt;/span&gt; Deterministic Finite Automaton (DFA)
 &lt;a class="heading-link" href="#deterministic-finite-automaton--dfa"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;A DFA is a graph where edges are labelled by characters.
Each node can have at most one outgoing edge with each label. (Otherwise it
would be &lt;em&gt;non-deterministic&lt;/em&gt;.)&lt;/p&gt;</description></item><item><title>QuadRank: Engineering a High-Throughput Rank</title><link>https://curiouscoding.nl/posts/quadrank-slides/</link><pubDate>Wed, 18 Feb 2026 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/quadrank-slides/</guid><description>&lt;script src="https://curiouscoding.nl/livereload.js?mindelay=10&amp;amp;v=2&amp;amp;port=1313&amp;amp;path=livereload" data-no-instant defer&gt;&lt;/script&gt;
&lt;h2 id="problem-statement"&gt;
 Binary Rank: Problem statement
 &lt;a class="heading-link" href="#problem-statement"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;div display="none"&gt;
&lt;ul&gt;
&lt;li&gt;Input: a many-GB text \(T = t_0\dots t_{n-1}\) of \(n\) bits.&lt;/li&gt;
&lt;li&gt;Queries: given \(q\), find&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;p&gt;\begin{equation*}
\newcommand{\rank}{\mathsf{rank}}
\rank(q) := \sum_{0\leq i&amp;lt; q} t_i.
\end{equation*}&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;\(T = \underline{\texttt{1001001}}\texttt{110010100}\)
&lt;ul&gt;
&lt;li&gt;\(\rank(0) = 0\)&lt;/li&gt;
&lt;li&gt;\(\rank(7) = 3\)&lt;/li&gt;
&lt;li&gt;\(\rank(16) = 7\)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Why? Occurrences table in FM-index.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="history"&gt;
 History
 &lt;a class="heading-link" href="#history"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;figure class="full post-large"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/rank-overview.svg"&gt;
&lt;/figure&gt;

&lt;h2 id="naive"&gt;
 Naive solutions
 &lt;a class="heading-link" href="#naive"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Linear scan:
&lt;ul&gt;
&lt;li&gt;\(O(n/w)\) time using \(w\) bit popcount, no space overhead.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class="post-large"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/1-linear.svg"&gt;
&lt;/figure&gt;

&lt;ul&gt;
&lt;li&gt;Precompute all 64-bit answers \(r_i := \rank(i)\):
&lt;ul&gt;
&lt;li&gt;\(O(1)\) time, \(64\times\) overhead.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class="post-large"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/2-precompute.svg"&gt;
&lt;/figure&gt;

&lt;h2 id="blocks"&gt;
 Middle-ground: block-based offsets
 &lt;a class="heading-link" href="#blocks"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Use \(B=512\) bit blocks, and store all \(b_j := \rank(j\cdot B)\).&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class="post-large"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/3-blocks.svg"&gt;
&lt;/figure&gt;

&lt;ul&gt;
&lt;li&gt;Query \(q = j\cdot B + q&amp;rsquo;\):
\(\rank(q) = b_j + \sum_{jB\leq i &amp;lt; jB+q&amp;rsquo;} t_i\).&lt;/li&gt;
&lt;li&gt;\(O(B/w) = O(512/64) = O(1)\) time.&lt;/li&gt;
&lt;li&gt;\(64/512 = 12.5\%\) space overhead.&lt;/li&gt;
&lt;li&gt;2 cache misses:
&lt;ul&gt;
&lt;li&gt;in \(n/8\) bit array: offset \(b_j\)&lt;/li&gt;
&lt;li&gt;in \(n\) bit array: block \(j\) bits&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="levels"&gt;
 Reducing overhead: PastaWide [and others]
 &lt;a class="heading-link" href="#levels"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;2 levels:
&lt;ul&gt;
&lt;li&gt;L2 with 16-bit &lt;em&gt;delta&lt;/em&gt; every block: 3.125% overhead&lt;/li&gt;
&lt;li&gt;L1 with 64-bit &lt;em&gt;offset&lt;/em&gt; every 128 blocks: 0.1% overhead&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class="post-large"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/4-pasta.svg"&gt;
&lt;/figure&gt;

&lt;h2 id="spider"&gt;
 Reducing cache misses: SPIDER
 &lt;a class="heading-link" href="#spider"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Inline the 16-bit L2 deltas bits into each cache line
&lt;ul&gt;
&lt;li&gt;Remaining 0.1% overhead L1 array fits in cache.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class="post-large"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/5-spider.svg"&gt;
&lt;/figure&gt;

&lt;h2 id="pairing"&gt;
 Reducing the popcount: Pairing
 &lt;a class="heading-link" href="#pairing"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Delta is to the &lt;em&gt;middle&lt;/em&gt; instead of &lt;em&gt;start&lt;/em&gt; of a block.
&lt;ul&gt;
&lt;li&gt;Count only 256 bits in first or second half of block.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class="post-large"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/6-pairing.svg"&gt;
&lt;/figure&gt;

&lt;h2 id="birank"&gt;
 All together now: BiRank
 &lt;a class="heading-link" href="#birank"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Inline 16-bit deltas&lt;/li&gt;
&lt;li&gt;Pairing&lt;/li&gt;
&lt;li&gt;32-bit &lt;em&gt;reduced&lt;/em&gt; L1 offsets: 0.05% overhead
&lt;ul&gt;
&lt;li&gt;Low 11 bits are stored in deltas&lt;/li&gt;
&lt;li&gt;Input up to \(2^{43}\) bits&lt;/li&gt;
&lt;li&gt;16 MiB cache supports 32 GiB input&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class="post-large"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/7-birank.svg"&gt;
&lt;/figure&gt;

&lt;h2 id="metric"&gt;
 What is &lt;em&gt;fast&lt;/em&gt;?
 &lt;a class="heading-link" href="#metric"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Latency: 80 ns/q&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;
 &lt;span class="section-num"&gt;1&lt;/span&gt; File formats
 &lt;a class="heading-link" href="#file-formats"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;This stuff is all insanely confusing. My summary:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;DEFLATE&lt;/dt&gt;
&lt;dd&gt;The &amp;lsquo;original&amp;rsquo; compression method. Works in 32kB blocks, and for
each stores a small header with the compression mode and optional huffman
encoded dictionary. It applies Lempel-Ziv'77 compression of replacing common texts
by back-references. It uses a 32kiB context window for this, which may extend
beyond the start of the block.&lt;/dd&gt;
&lt;dt&gt;zlib&lt;/dt&gt;
&lt;dd&gt;An implementation of DEFLATE. The file format wraps the raw deflate
blocks in a header and footer.&lt;/dd&gt;
&lt;dt&gt;gzip (GNU zip)&lt;/dt&gt;
&lt;dd&gt;Another file format around DEFLATE, consisting of a small header containing
eg the original file name, then a list of DEFLATE blocks, and lastly a CRC32 checksum.&lt;/dd&gt;
&lt;dt&gt;blocked gzip (BGZF, blocked gzip format)&lt;/dt&gt;
&lt;dd&gt;A file format developed for bioinformatics that is
just multiple GZIP files concatenated. This allows faster compression and
decompression by parallellizing over independent blocks, as well as random
access via a small auxiliary index of block starts.
This is backwards compatible with plain gzip.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h3 id="implementations"&gt;
 &lt;span class="section-num"&gt;2&lt;/span&gt; Implementations
 &lt;a class="heading-link" href="#implementations"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;zlib&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;The original C library.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;zlib-ng&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Modern C implementation of zlib using SIMD.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;libz-sys&lt;/code&gt; crate&lt;/dt&gt;
&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;
&lt;dt&gt;&lt;code&gt;zlib-rs&lt;/code&gt; crate&lt;/dt&gt;
&lt;dd&gt;Pure Rust re-implementation.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;zlib-rs-sys&lt;/code&gt; crate&lt;/dt&gt;
&lt;dd&gt;zlib-compatible C-API to &lt;code&gt;zlib-rs&lt;/code&gt;&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;flate2&lt;/code&gt; crate&lt;/dt&gt;
&lt;dd&gt;High level Rust crate with uniform bindings to multiple zlib implementations.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h3 id="containers"&gt;
 &lt;span class="section-num"&gt;3&lt;/span&gt; Containers
 &lt;a class="heading-link" href="#containers"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;figure class="inset large"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/gzip.svg"
 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;
 &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;</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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#background" &gt;Background&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#birank" &gt;BiRank&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#quadrank" &gt;QuadRank&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#results" &gt;Results&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&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;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;10&lt;/span&gt; &lt;a href="#additional-results" &gt;Additional results&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\[\newcommand{\rank}{\mathsf{rank}}
\newcommand{\rankone}{\mathsf{rank}}
\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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;ul&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\[
\newcommand{\inv}{^{-1}}
\newcommand{\di}{\delta\inv}
\newcommand{\poly}{\mathrm{poly}}
\]&lt;/p&gt;
&lt;p&gt;This post summarizes some recent results and idea on various types hash tables.
Collected together with Stefan Walzer.&lt;/p&gt;</description></item><item><title>CI for Rust testing and releasing</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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#releasing-libraries" &gt;Releasing libraries&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#releasing-binaries" &gt;Releasing binaries&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This post will collect template files for setting up
GitHub CI for testing and releasing Rust libraries and binaries to:&lt;/p&gt;
&lt;ul&gt;
&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;
&lt;li&gt;&lt;a href="#github" &gt;GitHub releases&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#binstall" &gt;cargo binstall&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#pypi" &gt;PyPI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#bioconda" &gt;Bioconda&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We also have some workarounds for dealing with &lt;a href="#avx2" &gt;AVX2 SIMD instructions&lt;/a&gt;.&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#sudoku" &gt;Sudoku&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;8&lt;/span&gt; &lt;a href="#cpu-benchmarks" &gt;CPU benchmarks&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;ul&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;These are chronological (and thus, only lightly organized) notes on my attempt to
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
&lt;a href="#citeproc_bib_item_1"&gt;“The Evolution of Mathematical Software”&lt;/a&gt;, Turing Lecture by the 2021
Turing Award winner Jack J. Dongarra, which talks about
algorithm and software development in the context of ever improving hardware.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;a large infrastructure of mathematical libraries [&amp;hellip;] that must be mainted,
ported, and enhanced for many years to come if the value of the application
codes that depend on it are to be preserved and extended.
The software that encapsulates all this time, energy, and thought, routinely
outlasts the hardware it was originally designed to run on.&lt;/p&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
466 human genomes. This posts
collects some statistics on the number of BWT runs (\(r\)) of this dataset, and
makes an estimate on the number of unique mutations based on that.&lt;/p&gt;
&lt;div class="ox-hugo-table small"&gt;
&lt;div class="table-caption"&gt;
 &lt;span class="table-number"&gt;Table 1:&lt;/span&gt;
 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;).
&lt;/div&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;dataset&lt;/th&gt;
 &lt;th&gt;copies&lt;/th&gt;
 &lt;th&gt;rc?&lt;/th&gt;
 &lt;th&gt;length (Gbp)&lt;/th&gt;
 &lt;th&gt;avg run-len&lt;/th&gt;
 &lt;th&gt;runs (G)&lt;/th&gt;
 &lt;th&gt;est total mut&amp;rsquo;s&lt;/th&gt;
 &lt;th&gt;unique mut rate&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;random&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;no&lt;/td&gt;
 &lt;td&gt;3.2&lt;/td&gt;
 &lt;td&gt;1.33&lt;/td&gt;
 &lt;td&gt;2.40&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;CHM13v2.0&lt;/td&gt;
 &lt;td&gt;1&lt;/td&gt;
 &lt;td&gt;no&lt;/td&gt;
 &lt;td&gt;3.2&lt;/td&gt;
 &lt;td&gt;1.85&lt;/td&gt;
 &lt;td&gt;1.72&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;HPRCv1&lt;/td&gt;
 &lt;td&gt;94&lt;/td&gt;
 &lt;td&gt;yes&lt;/td&gt;
 &lt;td&gt;2x 301&lt;/td&gt;
 &lt;td&gt;134&lt;/td&gt;
 &lt;td&gt;2.25&lt;/td&gt;
 &lt;td&gt;33M&lt;/td&gt;
 &lt;td&gt;1/8900&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;HPRCv2&lt;/td&gt;
 &lt;td&gt;466&lt;/td&gt;
 &lt;td&gt;yes&lt;/td&gt;
 &lt;td&gt;2x 1500&lt;/td&gt;
 &lt;td&gt;535&lt;/td&gt;
 &lt;td&gt;2.80&lt;/td&gt;
 &lt;td&gt;68M&lt;/td&gt;
 &lt;td&gt;1/22000&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&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!
(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
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
require a lot of space. So here&amp;rsquo;s a mathematical version of that.&lt;/p&gt;
&lt;h3 id="problem-statement"&gt;
 Problem statement
 &lt;a class="heading-link" href="#problem-statement"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Given are \(n\) people that need to go to floors \(1, 2, \dots, n\).&lt;/li&gt;
&lt;li&gt;Elevators have constant acceleration, and must be standing still to
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;
&lt;li&gt;Possible elevator configurations:
&lt;ol&gt;
&lt;li&gt;single elevator over entire height&lt;/li&gt;
&lt;li&gt;partition the height in disjoint intervals, and then one elevator per interval&lt;/li&gt;
&lt;li&gt;double-deck: a single elevator that is \(h\) floors high&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Not&lt;/em&gt; allowed: two free-moving elevators above each other that make sure to
never bump into each other.&lt;/li&gt;
&lt;li&gt;Elevators have infinite capacity.&lt;/li&gt;
&lt;li&gt;There are \(k\) elevator shafts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Question:&lt;/strong&gt; How much total travel time do you need to get everyone home, if
everybody arrives at the same time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Harder(?):&lt;/strong&gt; What if the people arrive in a random permutation (1 per time
step), and their clock starts ticking as soon as they arrive?&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="observations"&gt;
 Observations
 &lt;a class="heading-link" href="#observations"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Going \(n\) floors up takes at least \(O(\sqrt n)\) time.&lt;/li&gt;
&lt;li&gt;Total travel time is at least \(\sum_{i=0}^n O(\sqrt i) = O(n \sqrt n)\)&lt;/li&gt;
&lt;li&gt;\(1\) elevator carrying everyone going 1 step at a time: \(O(n^2)\) total time&lt;/li&gt;
&lt;li&gt;$2$-elevator sqrt-decomposition: one elevator stops every \(\sqrt n\) floors,
and then a (set of) second elevators for the final up to \(\sqrt n\) floors.
&lt;ul&gt;
&lt;li&gt;first elevator: \(n\) people times \(n/(\sqrt n)/2\) &amp;lsquo;big steps&amp;rsquo; on average
times \(\sqrt{\sqrt n}\) time per big step is \(O(n^{7/4})\)&lt;/li&gt;
&lt;li&gt;second elevator: \(n\) people times \((\sqrt n)\) &amp;lsquo;small steps&amp;rsquo; on average
times \(1\) per small step is \(O(n^{3.2})\)&lt;/li&gt;
&lt;li&gt;so overall the big steps dominate&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;$2$-elevator, one that stops every \(B\) floors and then \(B\) that stop every
one floor:
&lt;ul&gt;
&lt;li&gt;the first one: \(n \cdot (n/B) \cdot \sqrt B = n^2/\sqrt B\)&lt;/li&gt;
&lt;li&gt;the second one: \(n \cdot B = nB\).&lt;/li&gt;
&lt;li&gt;solve for equality: \(B = n/\sqrt B\) =&amp;gt; \(B = n^{2/3}\)&lt;/li&gt;
&lt;li&gt;so \(n^{1+2/3}\) solution&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;\(\lg n\) elevator binary tree:
&lt;ul&gt;
&lt;li&gt;\(2^k \leq n \leq 2^{k+1}\)&lt;/li&gt;
&lt;li&gt;Take first elevator to \(2^k\) if needed: time \(\sqrt{2^k} = O(\sqrt n)\)&lt;/li&gt;
&lt;li&gt;There take second elevator that goes up \(2^{k-1}\) floors if needed.&lt;/li&gt;
&lt;li&gt;Then \(2^{k-2}\) levels up&lt;/li&gt;
&lt;li&gt;and so on until the last floor.&lt;/li&gt;
&lt;li&gt;Total time per person averages \(\sqrt{2^k}/2 + \sqrt{2^{k-1}}/2 + \dots + \sqrt{2}/2 + \sqrt{1}/2 =
O(\sqrt{2^k}) = O(\sqrt n)\), so up-to-a-constant optimal total travel
time \(O(n \sqrt n)\).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\[
\newcommand{\K}{\mathbb K}
\newcommand{\V}{\mathbb V}
\newcommand{\c}[1]{\mathbf{\mathsf{#1}}}
\]&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;
&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
opens the current pdf file. Using &lt;code&gt;zathura&lt;/code&gt; as pdf viewer provides live updates.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;
&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;
&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;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&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
save the file often. Since &lt;code&gt;space f s&lt;/code&gt; is somewhat annoying to type all the
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&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;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#distributing-binaries" &gt;Distributing binaries&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;Many of my rust crates and binaries building on them use SIMD instructions. Notably:&lt;/p&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;p&gt;all support fast algorithms based on both x86-64 (x64, henceforth) AVX2 and
aarch64 NEON instructions. The question of this post is: how to effectively
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;These are some summarizing notes and thoughts on
&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;
&lt;h2 id="problem-definitions"&gt;
 &lt;span class="section-num"&gt;1&lt;/span&gt; Problem definitions
 &lt;a class="heading-link" href="#problem-definitions"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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
\(f(X) \in [2^v]\), encode \(f: X\to [2^v]\).
The goal is use a minimal number of bits on top of the trivial
\(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
&lt;a href="#citeproc_bib_item_4"&gt;NO_ITEM_DATA:singletrack&lt;/a&gt; by NO_ITEM_DATA:singletrack to reduce memory
usage of affine-cost alignment by removing the need to store the affine layers
of the DP matrix.&lt;/p&gt;
&lt;p&gt;Affine-cost alignment uses a gap-open
cost \(o&amp;gt;0\), so that a gap of length \(\ell\) has cost \(o + \ell \cdot e\). The
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
additional DP matrices \(I\) and \(D\) (alongside the main \(M\) matrix):
one to store the best cost to get to state
\((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.
The more logarithms there are (i.e. the more &amp;ldquo;\(\log\)&amp;rdquo; before your variables),
the higher your reputation will be.
No-log theoretical computer scientists are virtually non-existent, as virtually
all non-trivial algorithms require use of logarithms.
Most are one-log scientists.
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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;
&lt;p&gt;It&amp;rsquo;s a common complaint these days that Fasta parsing is slow.
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;).
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;
&lt;p&gt;Paraseq helps the user by providing an interface for parallel processing of
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;.
Unfortunately, this still has a bottleneck: while the users processing of reads
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#greedymini-results" &gt;GreedyMini Results&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#a-first-look" &gt;A first look&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#comparison-with-optimal-ilp-values" &gt;Comparison with optimal ILP values&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#large-alphabets" &gt;Large alphabets&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#analysing-greedymini-at-w-3" &gt;Analysing GreedyMini at \(w=3\)&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#w-3-k-3" &gt;\(w=3\), \(k=3\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#w-7-k-3" &gt;\(w=7\), \(k=3\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#w-3-k-4" &gt;\(w=3\), \(k=4\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#w-3-k-5" &gt;\(w=3\), \(k=5\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#w-3-k-6" &gt;\(w=3\), \(k=6\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#w-3-k-7" &gt;\(w=3\), \(k=7\)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#looking-at-fixed-k-5" &gt;Looking at fixed \(k=5\)&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#k-5-w-4" &gt;\(k=5\), \(w=4\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#k-5-w-5" &gt;\(k=5\), \(w=5\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#k-5-w-6" &gt;\(k=5\), \(w=6\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#k-5-w-7" &gt;\(k=5\), \(w=7\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#k-5-w-8" &gt;\(k=5\), \(w=8\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#k-5-w-12" &gt;\(k=5\), \(w=12\)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#investigating-w-5" &gt;Investigating \(w=5\)&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#w-5-k-8" &gt;\(w=5\), \(k=8\)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#what-about-k-w-plus-1" &gt;What about \(k = w+1\)?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;In this post, we will look at the minimizer schemes generated by the greedy
minimizer (Golan et al. 2025).&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;h2 id="early-idea-bottom-up-match-merging--aka-bummer"&gt;
 &lt;span class="section-num"&gt;1&lt;/span&gt; Early idea: Bottom-up match-merging (aka BUMMer?)
 &lt;a class="heading-link" href="#early-idea-bottom-up-match-merging--aka-bummer"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;TODO: Move to separate post.&lt;/p&gt;
&lt;p&gt;One thing that becomes clear with mapping is that we don&amp;rsquo;t quite
know where exactly to start the semi-global alignments.
This can be fixed by adding some buffer/padding, but this remains slightly ugly
and iffy.&lt;/p&gt;</description></item><item><title>Beyond Global Alignment</title><link>https://curiouscoding.nl/posts/mapping/</link><pubDate>Mon, 24 Mar 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/mapping/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&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;
&lt;ul&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This is Chapter 5 of my thesis (&lt;a href="#citeproc_bib_item_11"&gt;Groot Koerkamp 2025&lt;/a&gt;).
Please cite the thesis instead of this post.&lt;/p&gt;
&lt;hr&gt;
&lt;div class="notice summary"&gt;
 &lt;div class="notice-title"&gt;
 &lt;i class="fa-solid " aria-hidden="true"&gt;&lt;/i&gt;Summary
 &lt;/div&gt;
 &lt;div class="notice-content"&gt;
&lt;p&gt;So far, we have considered only algorithms for &lt;em&gt;global&lt;/em&gt; alignment.
In this chapter, we consider &lt;em&gt;semi-global&lt;/em&gt; alignment and its variants instead,
where a pattern (query) is searched in a longer string (reference).
There are many flavours of semi-global alignment, depending on the
(relative) sizes of the inputs. We list these variants, and introduce
some common approaches to solve this problem.&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#hash-schemes" &gt;Hash schemes&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#compressing-sketches" &gt;Compressing sketches&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#evaluation" &gt;Evaluation&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="section-num"&gt;6.1&lt;/span&gt; &lt;a href="#setup" &gt;Setup&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\[
\newcommand{\sketch}{\mathsf{sketch}}
\]&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;
 &lt;span class="section-num"&gt;1&lt;/span&gt; De Bruijn graph
 &lt;a class="heading-link" href="#de-bruijn-graph"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Consider an edge-centric De Bruijn graph, where each edge corresponds to a
k-mer, and nodes are the \(k-1\) overlaps between adjacent k-mers. In the figures,
all edges are directed towards the right.&lt;/p&gt;
&lt;figure class="inset medium"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/graph.svg"&gt;
&lt;/figure&gt;

&lt;h3 id="k-mers"&gt;
 &lt;span class="section-num"&gt;2&lt;/span&gt; k-mers
 &lt;a class="heading-link" href="#k-mers"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;The goal is now to store all edges / k-mers of the graph efficiently.
A &lt;em&gt;spectrum preserving string set&lt;/em&gt; (SPSS) is a set of strings whose k-mers are
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>Thesis: Optimal Throughput Bioinformatics</title><link>https://curiouscoding.nl/posts/thesis/</link><pubDate>Sun, 23 Feb 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/thesis/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#discussion" &gt;Discussion&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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;).
Individual chapters are based either on blog posts or papers and linked from the introduction.&lt;/p&gt;</description></item><item><title>A History of Pairwise Alignment</title><link>https://curiouscoding.nl/posts/pairwise-alignment/</link><pubDate>Sat, 22 Feb 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/pairwise-alignment/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#cost-models" &gt;Cost Models&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This is Chapter 2 of my thesis (&lt;a href="#citeproc_bib_item_27"&gt;Groot Koerkamp 2025&lt;/a&gt;), to introduce the first part on Pairwise Alignment.
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>Fri, 21 Feb 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/minimizers/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#lex-eval" &gt;Evaluation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#oc-eval" &gt;Evaluation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;3.5&lt;/span&gt; &lt;a href="#modmini" &gt;Mod-minimizer&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#theoretical-density" &gt;Theoretical density&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#modmini-eval" &gt;Evaluation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#sus-anchor-eval" &gt;Evaluation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This is Part 2 of my thesis (&lt;a href="#citeproc_bib_item_15"&gt;Groot Koerkamp 2025&lt;/a&gt;), containing chapters 6 to 9 on Low Density Minimizers.
Please cite the thesis instead of this post.&lt;/p&gt;</description></item><item><title>High Throughput Bioinformatics</title><link>https://curiouscoding.nl/posts/throughput/</link><pubDate>Thu, 20 Feb 2025 00:00:00 +0100</pubDate><guid>https://curiouscoding.nl/posts/throughput/</guid><description>&lt;div class="ox-hugo-toc toc has-section-numbers"&gt;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This is Chapter 10 of my thesis (Groot Koerkamp 2025a), to introduce the last part on High Throughput Bioinformatics.&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;
- &lt;a href="#previous-reviews" &gt;Previous reviews&lt;/a&gt;&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#minimizer-schemes" &gt;Minimizer schemes&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#selection-schemes" &gt;Selection schemes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#canonical-minimizers" &gt;Canonical minimizers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This post is simply a list of brief comments on many papers related to
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#binary-search" &gt;Binary search&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#alternative-memory-layout" &gt;Eytzinger&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;ul&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;h2 id="optimizing-binary-search-and-interpolation-search"&gt;
 &lt;span class="section-num"&gt;1&lt;/span&gt; Optimizing Binary Search And Interpolation Search
 &lt;a class="heading-link" href="#optimizing-binary-search-and-interpolation-search"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;This blogpost is a preliminary of the
&lt;a href="https://curiouscoding.nl/posts/static-search-tree/" class="external-link" target="_blank" rel="noopener"&gt;post on static
search trees&lt;/a&gt;. We will be looking into binary search and how it can be
optimized using different memory layouts (Eytzinger), branchless
techniques and careful use of prefetching. In addition, we will explore
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#consensus" &gt;Consensus&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;These are some thoughts on the Consensus-based MPHF presented in
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;
&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.” arXiv; arXiv. &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;
&lt;p&gt;Below are also some thoughts on the papers on tiny pointers, used to achieve
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#sec:orgce4a522" &gt;PtrHash&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#sec:orgbf28892" &gt;Results&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="section-num"&gt;4.1&lt;/span&gt; &lt;a href="#construction-eval" &gt;Construction&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#sec:throughput" &gt;Appendix A: Query Throughput&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#sec:orgabb5dd4" &gt;Batching and Streaming&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#throughput-evaluation" &gt;Evaluation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#multi-threaded-throughput." &gt;Multi-threaded Throughput.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#sec:sharding" &gt;Appendix B: Sharding&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#sec:sharding-eval" &gt;Evaluation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This is the HTML 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;).
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#latex" &gt;Latex&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#rust" &gt;Rust&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;li&gt;&lt;a href="#release-profile" &gt;Release profile&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#list-exported-functions" &gt;List exported functions&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#prevent-auto-vectorization" &gt;Prevent auto-vectorization&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#sorting" &gt;Sorting&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#python" &gt;Python&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#pretty-plots" &gt;Pretty plots&lt;/a&gt;&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;These are some common libraries and code snippets for various tasks.&lt;/p&gt;
&lt;h2 id="latex"&gt;
 Latex
 &lt;a class="heading-link" href="#latex"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;h3 id="code-highlighting-minted"&gt;
 Code highlighting: &lt;code&gt;minted&lt;/code&gt;
 &lt;a class="heading-link" href="#code-highlighting-minted"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-LaTeX" data-lang="LaTeX"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\usepackage&lt;/span&gt;&lt;span class="na"&gt;[newfloat=true]&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;minted&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\newmintedfile&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;rust&lt;span class="nb"&gt;}{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; linenos,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; numbersep=5pt,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; frame=lines,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; baselinestretch=1.05,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; fontsize=&lt;span class="k"&gt;\footnotesize&lt;/span&gt;,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\begin&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;listing&lt;span class="nb"&gt;}&lt;/span&gt;[t]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;\rustfile&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;code.rs&lt;span class="nb"&gt;}&lt;/span&gt;&lt;span class="c"&gt;%
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;\vspace&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;-1.3em&lt;span class="nb"&gt;}&lt;/span&gt;&lt;span class="c"&gt;%
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;\caption&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;Caption&lt;span class="nb"&gt;}&lt;/span&gt;&lt;span class="c"&gt;%
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;\label&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;rs:label&lt;span class="nb"&gt;}&lt;/span&gt;&lt;span class="c"&gt;%
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;\end&lt;/span&gt;&lt;span class="nb"&gt;{&lt;/span&gt;listing&lt;span class="nb"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id="rust"&gt;
 Rust
 &lt;a class="heading-link" href="#rust"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;h3 id="cargo-dot-toml-workspace"&gt;
 &lt;code&gt;Cargo.toml&lt;/code&gt; workspace
 &lt;a class="heading-link" href="#cargo-dot-toml-workspace"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;span class="lnt"&gt;6
&lt;/span&gt;&lt;span class="lnt"&gt;7
&lt;/span&gt;&lt;span class="lnt"&gt;8
&lt;/span&gt;&lt;span class="lnt"&gt;9
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;workspace&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;members&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;a&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;b&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;resolver&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;2&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&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="nx"&gt;workspace&lt;/span&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;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;serde&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="release-profile"&gt;
 Release profile
 &lt;a class="heading-link" href="#release-profile"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;profile&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;release&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;lto&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;thin&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;incremental&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;debug&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="list-exported-functions"&gt;
 List exported functions
 &lt;a class="heading-link" href="#list-exported-functions"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;cargo modules generate tree --fns --traits --types --sort-by visibility
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="read-human-genome-using-needletail"&gt;
 Read human genome using &lt;code&gt;needletail&lt;/code&gt;
 &lt;a class="heading-link" href="#read-human-genome-using-needletail"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;span class="lnt"&gt;17
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;fn&lt;/span&gt; &lt;span class="nf"&gt;read_human_genome&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;PackedSeqVec&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&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;packed_text&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;PackedSeqVec&lt;/span&gt;::&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt;
&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="nb"&gt;Ok&lt;/span&gt;&lt;span class="p"&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;reader&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;needletail&lt;/span&gt;::&lt;span class="n"&gt;parse_fastx_file&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;human-genome.fa&amp;#34;&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&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;Did not find human-genome.fa. Add/symlink it to test runtime on it.&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;
&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="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PackedSeqVec&lt;/span&gt;::&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt;
&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;
&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="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;r&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;reader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;next&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;
&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;r&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;r&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;
&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="w"&gt;
&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="s"&gt;&amp;#34;Read &lt;/span&gt;&lt;span class="si"&gt;{:?}&lt;/span&gt;&lt;span class="s"&gt; of len &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&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;std&lt;/span&gt;::&lt;span class="kt"&gt;str&lt;/span&gt;::&lt;span class="n"&gt;from_utf8&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;&lt;span class="w"&gt;
&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;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;raw_seq&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt;
&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;
&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;packed_text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;push_ascii&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;raw_seq&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;&lt;span class="w"&gt;
&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;
&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;packed_text&lt;/span&gt;&lt;span class="w"&gt;
&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;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="prevent-auto-vectorization"&gt;
 Prevent auto-vectorization
 &lt;a class="heading-link" href="#prevent-auto-vectorization"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;v[i]&lt;/code&gt; prevents auto-vectorization, because the index can panic.
Sometimes we want &lt;code&gt;v.get_unchecked(i)&lt;/code&gt; instead, but now there are no more panic
and the auto-vectorizer can kick in. Sometimes we want that, but sometimes we
don&amp;rsquo;t. Especially with array indexing this is prone to generate slow &lt;code&gt;gather&lt;/code&gt;
instructions.
Prevent this using:&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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
statistics on network traffic.
It took me some time to figure out exactly how to get the real-time websocket
server working through Nginx, so I&amp;rsquo;m just sharing my configuration here.&lt;/p&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;5&lt;/span&gt; &lt;a href="#prefix-partitioning" &gt;Prefix partitioning&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;7&lt;/span&gt; &lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;In this post, we will implement a static search tree (S+ tree) for
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.
We&amp;rsquo;ll mostly take the code presented there as a starting point, and optimize it
to its limits. For a large part, I&amp;rsquo;m simply taking the &amp;lsquo;future work&amp;rsquo; ideas of that post
and implementing them. And then there will be a bunch of looking at assembly
code to shave off all the instructions we can.
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#overview" &gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#detailed-comments" &gt;Detailed comments&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#general" &gt;General&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#1-dot-introduction" &gt;1. Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#2-dot-methods" &gt;2. Methods&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#2-dot-1-outline" &gt;2.1 Outline&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#2-dot-3-lazy-encoding" &gt;2.3 Lazy encoding&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#2-dot-4-probing" &gt;2.4 Probing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#2-dot-5-superbuckets" &gt;2.5 Superbuckets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#2-dot-6-implementation-details" &gt;2.6 Implementation details&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#3-dot-results" &gt;3. Results&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#3-dot-1-parameters" &gt;3.1 Parameters&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#3-dot-2-multicore" &gt;3.2 Multicore&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#3-dot-4-comparison" &gt;3.4 Comparison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#3-dot-5-query-times" &gt;3.5 Query times&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#4-dot-conclusion" &gt;4. Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;These are some (biased) comments on Brisk,
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#overview" &gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#detailed-comments" &gt;Detailed comments&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#terminology" &gt;Terminology&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#preliminaries" &gt;Preliminaries&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#methods" &gt;Methods&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#3-dot-5-transformations" &gt;3.5 Transformations&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#results" &gt;Results&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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;
(&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.
(Meanwhile, this has been published as Golan et al. (&lt;a href="#citeproc_bib_item_3"&gt;2025&lt;/a&gt;).)&lt;/p&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#the-importance-of-ordering" &gt;The importance of ordering&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#asymptotically-optimal-minimizers" &gt;Asymptotically optimal minimizers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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;
&lt;h2 id="the-importance-of-ordering"&gt;
 The importance of ordering
 &lt;a class="heading-link" href="#the-importance-of-ordering"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;the interest lies in constructing a minimizer with a density within a constant
factor, i.e., \(O(1/w)\) for any \(k\). With lexicographic ordering, minimizers can
achieve such density, but with large \(k\) values (\(\geq \log_{|Σ|}(w)-c\) for a
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
ordering can result in a lower density than that of the lexicographic ordering.
Thus, random ordering (implemented with pseudo-random hash functions) is
usually used in practice.&lt;/p&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#searching-methods" &gt;Searching methods&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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
with the left and right boundary of the remaining search interval has amortized
runtime&lt;/p&gt;
&lt;p&gt;\[
O\Big(\lg_2(n) + |P| + |P| \cdot \lg_2(Occ(P))\Big),
\]
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#a-note-on-sdsl-versions" &gt;A note on SDSL versions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;Here I&amp;rsquo;ll briefly list some FM-index and related implementations around the web.
Implementations seem relatively inconsistent, mostly because the FM-index is
more of a &amp;lsquo;wrapper&amp;rsquo; type around a given Burrows-Wheeler-transform and an
&lt;em&gt;occurrences&lt;/em&gt; list implementation. Both can be implemented in various ways. In particular
occurrences should be stored using a wavelet tree for optimal compression.&lt;/p&gt;
&lt;ul&gt;
&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;
&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
occurrences array&lt;/a&gt;, so that space is relatively small but lookups take \(O(k)\)
time for sampling factor \(k\).&lt;/li&gt;
&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
on it, that provides the same functionality as an FM-index.&lt;/li&gt;
&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
tree instead of the usual binary wavelet tree, and improves latency by around
a factor 2 over SDSL wavelet trees.&lt;/li&gt;
&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
an improved wavelet tree as well.&lt;/li&gt;
&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;
&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
compressed BWT with a B+ tree on top for fast queries.&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;h2 id="a-note-on-sdsl-versions"&gt;
 A note on SDSL versions
 &lt;a class="heading-link" href="#a-note-on-sdsl-versions"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&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;
&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
used currently.&lt;/li&gt;
&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
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
quick glance, I think it&amp;rsquo;s somewhat restructured and truly a v3, not just a v2.1.
However, it seems to be much less popular.&lt;/li&gt;
&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,
a number of small bug fixes and some updates for recent compiler versions.&lt;/li&gt;
&lt;/ul&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#sampling-schemes" &gt;Sampling schemes&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;2&lt;/span&gt; &lt;a href="#selection-schemes" &gt;Selection schemes&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#steps" &gt;Steps&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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.
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
python environments.&lt;/p&gt;
&lt;h2 id="steps"&gt;
 &lt;span class="section-num"&gt;1&lt;/span&gt; Steps
 &lt;a class="heading-link" href="#steps"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&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;
in the environment below.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&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;</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;
&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;
&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;
&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;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;In this post I will collect some high level ideas and approaches used to solve
the PACE 2024 challenge.
Very briefly, the goal is to write fast solvers for NP-hard problems. The
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
bipartite graph \((A, B)\) that is drawn in standard way with the nodes of both
\(A\) and \(B\) on a line, where the order of the nodes of \(A\) is fixed. The goal is
to find a permutation of \(B\) that minimizes the number of edge crossings when
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;h2 id="space-dust"&gt;
 &lt;span class="section-num"&gt;1&lt;/span&gt; Space dust
 &lt;a class="heading-link" href="#space-dust"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;What is the total mass of space dust hitting the earth during the Perseids
meteor shower?&lt;/p&gt;
&lt;h2 id="references"&gt;
 References
 &lt;a class="heading-link" href="#references"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;style&gt;.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}&lt;/style&gt;&lt;div class="csl-bib-body"&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#algorithms" &gt;Algorithms&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;ul&gt;
&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;
&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;
&lt;li&gt;&lt;a href="#problem-c-super-k-mers" &gt;Problem C: Super-k-mers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#which-problem-to-solve" &gt;Which problem to solve&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#canonical-k-mers" &gt;Canonical k-mers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#naive-performance" &gt;Performance characteristics&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#queue-performance" &gt;Performance characteristics&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#jumping-performance" &gt;Performance characteristics&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#rescan-performance" &gt;Performance characteristics&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#split-perfomance" &gt;Performance characteristics&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#open-problem-theoretical-lower-bounds" &gt;Open problem: Theoretical lower bounds&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#adding-criterion" &gt;Adding criterion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#making-criterion-fast" &gt;Making criterion fast&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#a-note-on-cpu-frequency" &gt;A note on CPU frequency&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&lt;li&gt;&lt;a href="#optimizing-rescan" &gt;Optimizing &lt;code&gt;Rescan&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#optimizing-split" &gt;Optimizing &lt;code&gt;Split&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;span class="section-num"&gt;5.1&lt;/span&gt; &lt;a href="#fxhash" &gt;FxHash&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#wyhash" &gt;WyHash&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&lt;li&gt;&lt;a href="#buffered-hash-values" &gt;Buffered hash values&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#drop-sanity-checks" &gt;Drop sanity checks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#drop-bound-checks" &gt;Drop bound checks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#efficiently-collecting-to-a-vector" &gt;Efficiently collecting to a vector&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#analysing-the-assembly-code" &gt;Analysing the assembly code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#more-parallel" &gt;More parallel&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#simd-table-lookups" &gt;SIMD table lookups&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#32-bit-hashes" &gt;32-bit hashes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#shared-offsets" &gt;Shared offsets&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&lt;li&gt;&lt;a href="#reusing-the-gathers" &gt;Reusing the gathers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#one-last-branch" &gt;One last branch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#doubling-down-again" &gt;Doubling down again&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#16-bit-hashes" &gt;16-bit hashes?&lt;/a&gt;&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#human-genome-results" &gt;Human genome results&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#nthash" &gt;NtHash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#leftmost-rightmost-sliding-min" &gt;Leftmost-rightmost sliding min&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#tiebreaking" &gt;Tiebreaking&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#further-reusing-iterated-bases" &gt;Further reusing iterated bases&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;8&lt;/span&gt; &lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;A 90 min recording of a talk I gave on this post can be found &lt;a href="https://curiouscoding.nl/talks/minimizer-talk.mp4" &gt;here&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#a-pa" &gt;A*PA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#pa-bench" &gt;PA-Bench&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mod-minimizers" &gt;Mod-minimizers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;There are links for my talks and posters.&lt;/p&gt;
&lt;h2 id="a-pa"&gt;
 A*PA
 &lt;a class="heading-link" href="#a-pa"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;A*PA (bioinformatic)&lt;/dt&gt;
&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;
&lt;dt&gt;A*PA2 (WABI24)&lt;/dt&gt;
&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;
&lt;dt&gt;Code&lt;/dt&gt;
&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;
&lt;dt&gt;Slides&lt;/dt&gt;
&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;
&lt;dt&gt;Poster&lt;/dt&gt;
&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;
&lt;/dl&gt;
&lt;h2 id="pa-bench"&gt;
 PA-Bench
 &lt;a class="heading-link" href="#pa-bench"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;Poster&lt;/dt&gt;
&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;
&lt;dt&gt;Code&lt;/dt&gt;
&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;
&lt;/dl&gt;
&lt;h2 id="mod-minimizers"&gt;
 Mod-minimizers
 &lt;a class="heading-link" href="#mod-minimizers"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;Mod-minimizer (WABI24)&lt;/dt&gt;
&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;
&lt;dt&gt;Code (C++)&lt;/dt&gt;
&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;
&lt;dt&gt;Code (Rust)&lt;/dt&gt;
&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;
&lt;/dl&gt;
&lt;h2 id="references"&gt;
 References
 &lt;a class="heading-link" href="#references"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;style&gt;.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}&lt;/style&gt;&lt;div class="csl-bib-body"&gt;
 &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;
 &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;
 &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;
 &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;
 &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;
 &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;
 &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;
 &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;
 &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;
 &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;
 &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;
 &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;
 &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;
 &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;
 &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;
 &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;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#succinct-background" &gt;Succinct background&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#definitions" &gt;Definitions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#lower-bounds" &gt;Lower bounds&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#a-new-lower-bound" &gt;A new lower bound&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#post-scriptum" &gt;Post scriptum&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#acknowledgement" &gt;Acknowledgement&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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;
&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;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;Let&amp;rsquo;s summarize some tools for efficiently searching suffix arrays.&lt;/p&gt;
&lt;h2 id="sapling"&gt;
 &lt;span class="section-num"&gt;1&lt;/span&gt; Sapling
 &lt;a class="heading-link" href="#sapling"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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;
&lt;ol&gt;
&lt;li&gt;Choose a parameter \(p\) store for each of the \(2^p\) &lt;strong&gt;$p$-bit prefixes&lt;/strong&gt; the
corresponding position in the suffix array.&lt;/li&gt;
&lt;li&gt;When querying, first find the bucket for the query prefix. Then do a &lt;strong&gt;linear
interpolation&lt;/strong&gt; inside the bucket.&lt;/li&gt;
&lt;li&gt;Search the area \([-E, +E]\) around the interpolated position, where \(E\) is a
bound on the error of the linear approximation. In practice \(E\) is only a
$95\%$-confidence bound, and if the true value is not in the range, a linear
search with steps of size \(E\) is done.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The paper also introduces a neural network approach to approximating buckets,
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;
&lt;ul&gt;
&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;
&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;
&lt;/ul&gt;
&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;
&lt;p&gt;Rust wrappers:&lt;/p&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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
algorithm anyway&lt;/li&gt;
&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
using OpenMP and wraps both the original and 64bit version.&lt;/li&gt;
&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
faster than divsufsort and libsais, but does not return a true fully sorted
suffix array.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="references"&gt;
 References
 &lt;a class="heading-link" href="#references"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;style&gt;.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}&lt;/style&gt;&lt;div class="csl-bib-body"&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#summary" &gt;Summary&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#background" &gt;Background&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#review-comments" &gt;Review comments&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#dfs" &gt;DFS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#supplementary-methods" &gt;Supplementary methods&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#details-of-pruning" &gt;Details of pruning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#evals" &gt;Evals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#code-and-repo" &gt;Code &amp;amp; repo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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
sequence-to-DAG (POA) aligner inspired by WFA and using A*.&lt;/p&gt;
&lt;h2 id="summary"&gt;
 Summary
 &lt;a class="heading-link" href="#summary"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Take a query and a directed acyclic graph (DAG).&lt;/li&gt;
&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.
&lt;ul&gt;
&lt;li&gt;In fact I think the graph doesn&amp;rsquo;t actually have to be acyclic, as long as it has
a start and end. (When there is a cycle, the maximum remaining path length
is simply \(\infty\).)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Do greedy extension of matches, similar to WFA and A*PA.
&lt;ul&gt;
&lt;li&gt;Note that this is not as strong as full diagonal transition as done by WFA
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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;In fact, this is &lt;strong&gt;the first&lt;/strong&gt; implementation of affine-cost WFA!&lt;/li&gt;
&lt;li&gt;It also uses A* with the classic gap-cost heuristic extended to graphs.
&lt;ul&gt;
&lt;li&gt;For each point in the graph the minimal and maximal remaining distance is
computed, and if the remaining query length is outside this range, the
difference to get into the range is a lowerbound on number of indels.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Greedy extension is applied (although this is inherent when using WFA).&lt;/li&gt;
&lt;li&gt;Suboptimal states in superbubbles are pruned using additional logic.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="background"&gt;
 Background
 &lt;a class="heading-link" href="#background"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Daniel: why is nobody doing exact banded alignment, i.e., simple band
doubling, for exact DP-based alignment. We are still not convinced that A*/WFA
is faster than DP, especially when divergence is not super low (\(&amp;lt;1\%\)).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="review-comments"&gt;
 Review comments
 &lt;a class="heading-link" href="#review-comments"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Fig 1 confuses me: (partly Daniel)&lt;/p&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;1&lt;/span&gt; &lt;a href="#introduction" &gt;Introduction&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;3&lt;/span&gt; &lt;a href="#methods" &gt;Methods&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;li&gt;&lt;span class="section-num"&gt;3.7&lt;/span&gt; &lt;a href="#a" &gt;A*&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;4&lt;/span&gt; &lt;a href="#results" &gt;Results&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#acknowledgements" &gt;Acknowledgements&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#conflict-of-interest" &gt;Conflict of interest&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="section-num"&gt;6&lt;/span&gt; &lt;a href="#appendix" &gt;Appendix&lt;/a&gt;
&lt;ul&gt;
&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;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\begin{equation*}
\newcommand{\g}{g^*}
\newcommand{\h}{h^*}
\newcommand{\f}{f^*}
\newcommand{\cgap}{c_{\textrm{gap}}}
\newcommand{\xor}{\ \mathrm{xor}\ }
\newcommand{\and}{\ \mathrm{and}\ }
\newcommand{\st}[2]{\langle #1, #2\rangle}
\newcommand{\matches}{\mathcal M}
\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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#summary" &gt;Summary&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#main-issues" &gt;Main issues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#1-dot-introduction" &gt;1. Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#2-dot-methods" &gt;2. Methods&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#2-dot-3-heuristic" &gt;2.3 heuristic&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#3-dot-results" &gt;3. Results&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#code" &gt;Code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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;
&lt;h2 id="summary"&gt;
 Summary
 &lt;a class="heading-link" href="#summary"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;The paper introduces &lt;em&gt;refined minimizers&lt;/em&gt;, a new scheme for sampling canonical
minimizers that is less biased than the usual scheme.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Instead of taking the minimum of the minimizer of the forward and reverse
strand, the minimizer of the strand with the higher &lt;code&gt;GT&lt;/code&gt; density is chosen.&lt;/li&gt;
&lt;li&gt;The less bias towards small minimizers causes a more equal distribution of
frequency of selected kmers.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="main-issues"&gt;
 Main issues
 &lt;a class="heading-link" href="#main-issues"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The methods contain a number of mistakes in the math and proofs.&lt;/li&gt;
&lt;li&gt;The limit to \(|s|\) needs to be made much more precise. In fact it is a
\(k\to\infty\) limit (rather than a \(w\to\infty\) limit), which seems not as useful in practice.&lt;/li&gt;
&lt;li&gt;A comparison to NtHash2 should be made, for both kmer frequency distribution
and speed.&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;h2 id="1-dot-introduction"&gt;
 1. Introduction
 &lt;a class="heading-link" href="#1-dot-introduction"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&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;
&lt;li&gt;\(w&amp;gt;k\): &lt;strong&gt;not needed&lt;/strong&gt;. \(w\geq 1\) is sufficient.&lt;/li&gt;
&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
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;
&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
to&lt;/strong&gt; some ordering scheme.&lt;/li&gt;
&lt;li&gt;nitpicky imprecision: \(X\) is the set of &lt;strong&gt;positions of kmers&lt;/strong&gt;, not simply the set
of &lt;strong&gt;kmer strings themselves&lt;/strong&gt;. (Or I suppose \(X\) could be a list of kmers.)
(Otherwise we have \(|X| \leq 4^k\) and \(|S|\to\infty\) so that
\(\rho\to 0\).)&lt;/li&gt;
&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;
&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;
&lt;li&gt;The definition of \(V\) is not clear to me. What is random? What is counted?&lt;/li&gt;
&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;
&lt;li&gt;&lt;code&gt;CMP&lt;/code&gt; (branch conditions) can be one of the slowest instructions on modern
hardware. Branch misses in an inner loop for minimizer computation can
severely affect performance.&lt;/li&gt;
&lt;li&gt;Simple operations and L1 accesses can be pipelined and latency can be hidden,
making them take 2-4x time less in practice. This makes branch-misses up to 4
times as bad, relatively.&lt;/li&gt;
&lt;li&gt;Are lexicographic minimizers used much in practice?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="2-dot-methods"&gt;
 2. Methods
 &lt;a class="heading-link" href="#2-dot-methods"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#applications" &gt;Applications&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#background" &gt;Background&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#minimizers" &gt;Minimizers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#density-bounds" &gt;Density bounds&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#robust-minimizers" &gt;Robust minimizers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#pasha" &gt;PASHA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#miniception" &gt;Miniception&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#closed-syncmers" &gt;Closed syncmers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#bd-anchors" &gt;Bd-anchors&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#new-mod-minimizers" &gt;New: Mod-minimizers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#experiments" &gt;Experiments&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#small-k-experiments" &gt;Small k experiments&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#search-methods" &gt;Search methods&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#directed-minimizer" &gt;Directed minimizer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#k-1-w-2" &gt;\(k=1\), \(w=2\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#k-1-w-4" &gt;\(k=1\), \(w=4\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#k-1-w-5" &gt;\(k=1\), \(w=5\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#k-2-w-2" &gt;\(k=2\), \(w=2\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#k-2-w-4" &gt;\(k=2\), \(w=4\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#notes" &gt;Notes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#reading-list" &gt;Reading list&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\[
\newcommand{\d}{\mathrm{d}}
\newcommand{\L}{\mathcal{L}}
\]&lt;/p&gt;
&lt;p&gt;This post introduces some background for minimizers and some
experiments for a new minimizer variant. That new variant is now called the
&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
also includes a review of existing methods, including pseudocode for
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#overview" &gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#rust-features" &gt;Rust features&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#basics" &gt;Basics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#basic-syntax" &gt;Basic syntax&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#expressions-everywhere" &gt;Expressions everywhere!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#closures" &gt;Closures&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#pattern-matching" &gt;Pattern matching&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#references" &gt;References&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#ownership" &gt;Ownership&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#containers" &gt;Containers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#traits" &gt;Traits&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#iterators" &gt;Iterators&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#common-libraries" &gt;Common libraries&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#ecosystem" &gt;Ecosystem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#useful-links" &gt;Useful links&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#hands-on" &gt;Hands-on&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#installation" &gt;Installation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#create-a-project" &gt;Create a project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#hello-world" &gt;Hello, world!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#small-project-ideas" &gt;Small project ideas&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;These are notes for a quick introduction to Rust.&lt;/p&gt;
&lt;h2 id="overview"&gt;
 Overview
 &lt;a class="heading-link" href="#overview"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Statically typed &amp;amp; Compiled language.&lt;/li&gt;
&lt;li&gt;Great developer experience:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;cargo&lt;/code&gt; build system&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rust-analyzer&lt;/code&gt; LSP&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="rust-features"&gt;
 Rust features
 &lt;a class="heading-link" href="#rust-features"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;h3 id="basics"&gt;
 Basics
 &lt;a class="heading-link" href="#basics"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="ox-hugo-table small"&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;C++&lt;/th&gt;
 &lt;th&gt;Rust&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;std::size_t&lt;/td&gt;
 &lt;td&gt;usize&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;std::pointerdiff_t&lt;/td&gt;
 &lt;td&gt;isize&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;int&lt;/td&gt;
 &lt;td&gt;i32&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;unsigned int&lt;/td&gt;
 &lt;td&gt;u32&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;long long&lt;/td&gt;
 &lt;td&gt;i64&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;unsigned long long&lt;/td&gt;
 &lt;td&gt;u64&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;string&lt;/td&gt;
 &lt;td&gt;String&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;string_view&lt;/td&gt;
 &lt;td&gt;&amp;amp;str&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;byte&lt;/td&gt;
 &lt;td&gt;u8&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;char&lt;/td&gt;
 &lt;td&gt;char&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;vector&amp;lt;T&amp;gt;&lt;/td&gt;
 &lt;td&gt;Vec&amp;lt;T&amp;gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;array&amp;lt;int, 4&amp;gt;&lt;/td&gt;
 &lt;td&gt;[u32; 4]&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;int[]&lt;/td&gt;
 &lt;td&gt;&amp;amp;[u32]&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;T&lt;/td&gt;
 &lt;td&gt;T&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;const T&amp;amp;&lt;/td&gt;
 &lt;td&gt;&amp;amp;T&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;T&amp;amp;&lt;/td&gt;
 &lt;td&gt;&amp;amp;mut T&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;T*&lt;/td&gt;
 &lt;td&gt;unsafe { T* }&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;unique_ptr&amp;lt;T&amp;gt;&lt;/td&gt;
 &lt;td&gt;Box&amp;lt;T&amp;gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;optional&amp;lt;T&amp;gt;&lt;/td&gt;
 &lt;td&gt;Option&amp;lt;T&amp;gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;variant&amp;lt;T, E&amp;gt;&lt;/td&gt;
 &lt;td&gt;Result&amp;lt;T, E&amp;gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class="ox-hugo-table small"&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;C++&lt;/th&gt;
 &lt;th&gt;Rust&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;for(int i = 0; i &amp;lt; n; ++i) {}&lt;/td&gt;
 &lt;td&gt;for i in 0..n {}&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;while(true) {}&lt;/td&gt;
 &lt;td&gt;loop {}&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;while(f()) {}&lt;/td&gt;
 &lt;td&gt;while f() {}&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;do { } while (f());&lt;/td&gt;
 &lt;td&gt;loop { if !f() { break; } }&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;switch x { case 1:; }&lt;/td&gt;
 &lt;td&gt;match x { 1 =&amp;gt; {} }&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class="ox-hugo-table small"&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;C++&lt;/th&gt;
 &lt;th&gt;Rust&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;cout &amp;lt;&amp;lt; &amp;ldquo;text&amp;rdquo; &amp;lt;&amp;lt; endl;&lt;/td&gt;
 &lt;td&gt;println!(&amp;ldquo;text&amp;rdquo;);&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;cout &amp;lt;&amp;lt; 1+1 &amp;lt;&amp;lt; endl;&lt;/td&gt;
 &lt;td&gt;println!(&amp;quot;{}&amp;quot;, 1+1);&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;cout &amp;lt;&amp;lt; n &amp;lt;&amp;lt; endl;&lt;/td&gt;
 &lt;td&gt;println!(&amp;quot;{n}&amp;quot;);&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h3 id="basic-syntax"&gt;
 Basic syntax
 &lt;a class="heading-link" href="#basic-syntax"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;span class="lnt"&gt;17
&lt;/span&gt;&lt;span class="lnt"&gt;18
&lt;/span&gt;&lt;span class="lnt"&gt;19
&lt;/span&gt;&lt;span class="lnt"&gt;20
&lt;/span&gt;&lt;span class="lnt"&gt;21
&lt;/span&gt;&lt;span class="lnt"&gt;22
&lt;/span&gt;&lt;span class="lnt"&gt;23
&lt;/span&gt;&lt;span class="lnt"&gt;24
&lt;/span&gt;&lt;span class="lnt"&gt;25
&lt;/span&gt;&lt;span class="lnt"&gt;26
&lt;/span&gt;&lt;span class="lnt"&gt;27
&lt;/span&gt;&lt;span class="lnt"&gt;28
&lt;/span&gt;&lt;span class="lnt"&gt;29
&lt;/span&gt;&lt;span class="lnt"&gt;30
&lt;/span&gt;&lt;span class="lnt"&gt;31
&lt;/span&gt;&lt;span class="lnt"&gt;32
&lt;/span&gt;&lt;span class="lnt"&gt;33
&lt;/span&gt;&lt;span class="lnt"&gt;34
&lt;/span&gt;&lt;span class="lnt"&gt;35
&lt;/span&gt;&lt;span class="lnt"&gt;36
&lt;/span&gt;&lt;span class="lnt"&gt;37
&lt;/span&gt;&lt;span class="lnt"&gt;38
&lt;/span&gt;&lt;span class="lnt"&gt;39
&lt;/span&gt;&lt;span class="lnt"&gt;40
&lt;/span&gt;&lt;span class="lnt"&gt;41
&lt;/span&gt;&lt;span class="lnt"&gt;42
&lt;/span&gt;&lt;span class="lnt"&gt;43
&lt;/span&gt;&lt;span class="lnt"&gt;44
&lt;/span&gt;&lt;span class="lnt"&gt;45
&lt;/span&gt;&lt;span class="lnt"&gt;46
&lt;/span&gt;&lt;span class="lnt"&gt;47
&lt;/span&gt;&lt;span class="lnt"&gt;48
&lt;/span&gt;&lt;span class="lnt"&gt;49
&lt;/span&gt;&lt;span class="lnt"&gt;50
&lt;/span&gt;&lt;span class="lnt"&gt;51
&lt;/span&gt;&lt;span class="lnt"&gt;52
&lt;/span&gt;&lt;span class="lnt"&gt;53
&lt;/span&gt;&lt;span class="lnt"&gt;54
&lt;/span&gt;&lt;span class="lnt"&gt;55
&lt;/span&gt;&lt;span class="lnt"&gt;56
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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
&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;
&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
&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;
&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;
&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;// mutable reference
&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;
&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;
&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;
&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&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&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.
&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.
&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&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.
&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;
&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;
&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:
&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;
&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;
&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;
&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&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.
&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;
&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.
&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;
&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;
&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&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`.
&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.
&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;
&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.
&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;
&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;
&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&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;
&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;
&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;
&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&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;
&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;
&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;
&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;
&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;
&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;
&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&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
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="expressions-everywhere"&gt;
 Expressions everywhere!
 &lt;a class="heading-link" href="#expressions-everywhere"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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&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;
&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;
&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;
&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;
&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;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="closures"&gt;
 Closures
 &lt;a class="heading-link" href="#closures"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;
&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;
&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;
&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;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="pattern-matching"&gt;
 Pattern matching
 &lt;a class="heading-link" href="#pattern-matching"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;span class="lnt"&gt;17
&lt;/span&gt;&lt;span class="lnt"&gt;18
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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&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;
&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;
&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;
&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&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;
&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;
&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;
&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;
&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&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;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="references"&gt;
 References
 &lt;a class="heading-link" href="#references"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;h3 id="ownership"&gt;
 Ownership
 &lt;a class="heading-link" href="#ownership"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;h3 id="containers"&gt;
 Containers
 &lt;a class="heading-link" href="#containers"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;span class="lnt"&gt;4
&lt;/span&gt;&lt;span class="lnt"&gt;5
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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
&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;
&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
&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;
&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;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="traits"&gt;
 Traits
 &lt;a class="heading-link" href="#traits"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;span class="lnt"&gt;17
&lt;/span&gt;&lt;span class="lnt"&gt;18
&lt;/span&gt;&lt;span class="lnt"&gt;19
&lt;/span&gt;&lt;span class="lnt"&gt;20
&lt;/span&gt;&lt;span class="lnt"&gt;21
&lt;/span&gt;&lt;span class="lnt"&gt;22
&lt;/span&gt;&lt;span class="lnt"&gt;23
&lt;/span&gt;&lt;span class="lnt"&gt;24
&lt;/span&gt;&lt;span class="lnt"&gt;25
&lt;/span&gt;&lt;span class="lnt"&gt;26
&lt;/span&gt;&lt;span class="lnt"&gt;27
&lt;/span&gt;&lt;span class="lnt"&gt;28
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;
&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&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;
&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&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;
&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;
&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;
&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;
&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;
&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&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;
&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;
&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;
&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;
&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;
&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&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;
&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;
&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;
&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&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;
&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
&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;
&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;
&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;
&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;
&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;
&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;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="iterators"&gt;
 Iterators
 &lt;a class="heading-link" href="#iterators"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;span class="lnt"&gt;17
&lt;/span&gt;&lt;span class="lnt"&gt;18
&lt;/span&gt;&lt;span class="lnt"&gt;19
&lt;/span&gt;&lt;span class="lnt"&gt;20
&lt;/span&gt;&lt;span class="lnt"&gt;21
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;
&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;
&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;
&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&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;
&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&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;
&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;
&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;
&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&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;
&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;
&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;
&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&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;
&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;
&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;
&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&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;
&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;
&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;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3 id="common-libraries"&gt;
 Common libraries
 &lt;a class="heading-link" href="#common-libraries"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#paper-overview" &gt;Paper overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#remarks-on-the-paper" &gt;Remarks on the paper&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#thoughts" &gt;Thoughts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\[
\newcommand{\A}{\mathcal{A}_\ell}
\newcommand{\T}{\mathcal{T}_\ell}
\]&lt;/p&gt;
&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
called &lt;em&gt;bd-anchors&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Resources:&lt;/p&gt;
&lt;ul&gt;
&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;
&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;
&lt;li&gt;Ayad, Loukides, and Pissis (&lt;a href="#citeproc_bib_item_1"&gt;2023&lt;/a&gt;): follow-up/second paper containing
&lt;ul&gt;
&lt;li&gt;a faster average-case \(O(n)\) construction algorithm;&lt;/li&gt;
&lt;li&gt;a more memory efficient construction algorithms for the index.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&lt;/ul&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#paper-summary" &gt;Paper summary&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#intro" &gt;Intro&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#prelims" &gt;Prelims&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#related-work" &gt;Related work&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#sparse-and-skew-hashing" &gt;Sparse and skew hashing&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#remarks" &gt;Remarks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#ideas" &gt;Ideas&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\[\newcommand{\S}{\mathcal{S}}\]&lt;/p&gt;
&lt;h2 id="paper-summary"&gt;
 Paper summary
 &lt;a class="heading-link" href="#paper-summary"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;h3 id="intro"&gt;
 Intro
 &lt;a class="heading-link" href="#intro"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;SsHash (&lt;a href="#citeproc_bib_item_7"&gt;Pibiri 2022&lt;/a&gt;) is a datastructure for indexing kmers.
Given a set of kmers \(\S\), it supports two operations:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;\(Lookup(g)\)&lt;/dt&gt;
&lt;dd&gt;return the unique id \(i\in [|\S|]\) of the kmer \(g\).&lt;/dd&gt;
&lt;dt&gt;\(Access(i)\)&lt;/dt&gt;
&lt;dd&gt;return the kmer corresponding to id \(i\).&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;It also supports &lt;em&gt;streaming&lt;/em&gt; queries, looking up all kmers from a longer string
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#external-links" &gt;External links&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#the-problem" &gt;The problem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#initial-solution-105s" &gt;Initial solution: 105s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#first-flamegraph" &gt;First flamegraph&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#bytes-instead-of-strings-72s" &gt;Bytes instead of strings: 72s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#manual-parsing-61s" &gt;Manual parsing: 61s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#inline-hash-keys-50s" &gt;Inline hash keys: 50s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#faster-hash-function-41s" &gt;Faster hash function: 41s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#a-new-flame-graph" &gt;A new flame graph&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#perf-it-is" &gt;Perf it is&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&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;
&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;
&lt;li&gt;&lt;a href="#manual-simd-29s" &gt;Manual SIMD: 29s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#profiling" &gt;Profiling&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#revisiting-the-key-function-23s" &gt;Revisiting the key function: 23s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#ptrhash-perfect-hash-function-17s" &gt;PtrHash perfect hash function: 17s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#larger-masks-15s" &gt;Larger masks: 15s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#reduce-pattern-matching-14s" &gt;Reduce pattern matching: 14s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#memory-map-12s" &gt;Memory map: 12s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#parallelization-2-dot-0s" &gt;Parallelization: 2.0s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#branchless-parsing-1-dot-7s" &gt;Branchless parsing: 1.7s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#purging-all-branches-1-dot-67s" &gt;Purging all branches: 1.67s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#some-more-attempts" &gt;Some more attempts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#faster-perfect-hashing-1-dot-55s" &gt;Faster perfect hashing: 1.55s&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&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;
&lt;li&gt;&lt;a href="#intermezzo-hyperthreading-1-dot-34s" &gt;Intermezzo: Hyperthreading: 1.34s&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#more-efficient-parsing-1-dot-44s" &gt;More efficient parsing: 1.44s&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&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;
&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;
&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;
&lt;li&gt;&lt;a href="#a-side-note-ascii" &gt;A side note: ASCII&lt;/a&gt;&lt;/li&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#improved" &gt;Improved&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#a-further-note" &gt;A further note&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#branchy-min-max-1-dot-37s" &gt;Branchy min/max: 1.37s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#no-counting-1-dot-34s" &gt;No counting: 1.34s&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&lt;li&gt;&lt;a href="#mmap-per-thread" &gt;Mmap per thread&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#reordering-some-operations-1-dot-19s" &gt;Reordering some operations: 1.19s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#reordering-more-1-dot-11s" &gt;Reordering more: 1.11s&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#even-more-ilp-1-dot-05" &gt;Even more ILP: 1.05&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&lt;li&gt;&lt;a href="#postscript" &gt;Postscript&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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>Perfect NtHash for Robust Minimizers</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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#nthash" &gt;NtHash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#minimizers" &gt;Minimizers&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#robust-minimizers" &gt;Robust minimizers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#is-nthash-injective-on-kmers" &gt;Is NtHash injective on kmers?&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#searching-for-a-collision" &gt;Searching for a collision&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#proving-perfection" &gt;Proving perfection&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#alternatives" &gt;Alternatives&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#smhasher-results" &gt;SmHasher results&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;h2 id="nthash"&gt;
 NtHash
 &lt;a class="heading-link" href="#nthash"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;NtHash (&lt;a href="#citeproc_bib_item_3"&gt;Mohamadi et al. 2016&lt;/a&gt;) is a rolling hash suitable for hashing any kind of text, but made for DNA originally.
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.
Sadly the recording doesn&amp;rsquo;t show the blackboard, but either way, find it &lt;a href="https://ragnargrootkoerkamp.nl/upload/astarpa-talk-cwi.mp4" class="external-link" target="_blank" rel="noopener"&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#notes" &gt;Notes&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#coloured-tree-problem" &gt;Coloured Tree Problem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#generic-sparse-suffix-array" &gt;Generic sparse suffix array&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#sparse-suffix-array-on-minimizers" &gt;Sparse suffix array on minimizers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#discussion-todos" &gt;Discussion / TODOs&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#evals" &gt;Evals&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;These are my running notes on implementing an algorithm for Longest Common
Repeat using minimizers.&lt;/p&gt;
&lt;h2 id="notes"&gt;
 Notes
 &lt;a class="heading-link" href="#notes"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;h3 id="coloured-tree-problem"&gt;
 Coloured Tree Problem
 &lt;a class="heading-link" href="#coloured-tree-problem"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&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;
&lt;h3 id="generic-sparse-suffix-array"&gt;
 Generic sparse suffix array
 &lt;a class="heading-link" href="#generic-sparse-suffix-array"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&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;
&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;
&lt;/ul&gt;
&lt;p&gt;For random strings and \(b \leq n / \log n\), direct radix sort on $2log n + log
log n$-bit
prefixes is sufficient for \(O(n)\) runtime. In fact, since computer word size
\(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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#monday" &gt;Monday&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#fimpera-bloom-filter-for-kmers" &gt;Fimpera: bloom filter for kmers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#progress-of-tools" &gt;Progress of tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#order-preserving-mphf-of-minimizers" &gt;Order-preserving MPHF of minimizers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#algorithmic-bottlenecks-in-sshash" &gt;Algorithmic bottlenecks in SSHash&lt;/a&gt;&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#tuesday" &gt;Tuesday&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#variant-types" &gt;Variant types&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#wednesday" &gt;Wednesday&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#sshash" &gt;SSHash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#pthash" &gt;PTHash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#de-bruijn-graphs" &gt;de Bruijn Graphs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;These are notes of discussions at the ALPACA/PANGAIA conference in
November 2023.&lt;/p&gt;
&lt;h2 id="monday"&gt;
 Monday
 &lt;a class="heading-link" href="#monday"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#lecture-1-14-november" &gt;Lecture 1, 14 November&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#resources" &gt;Resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#reader-friendlyness" &gt;Reader friendlyness&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#typical-problems" &gt;Typical problems&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#lecture-2-21-november" &gt;Lecture 2, 21 November&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#paragraph-level-expectations" &gt;Paragraph level expectations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#flow" &gt;Flow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#assignment-for-next-week" &gt;Assignment for next week&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#lecture-3-28-november" &gt;Lecture 3, 28 November&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#bad-organization" &gt;Bad organization&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#figures" &gt;Figures&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#references-to-figures" &gt;References to figures&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#indicative-vs-informative--ex-dot-7" &gt;Indicative vs Informative (ex. 7)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#lecture-4-december-5" &gt;Lecture 4, December 5&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#tense" &gt;Tense&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#lecture-5-december-12" &gt;Lecture 5, December 12&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#abstracts" &gt;Abstracts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#titles" &gt;Titles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#punctuation" &gt;Punctuation&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#comma" &gt;Comma&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#dashes" &gt;Dashes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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;
&lt;ol&gt;
&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;
&lt;li&gt;Make an alias to the executable:
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;Create a new problem:
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bt new_problem my_problem_name
&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
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;You now have the following:
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;span class="lnt"&gt;17
&lt;/span&gt;&lt;span class="lnt"&gt;18
&lt;/span&gt;&lt;span class="lnt"&gt;19
&lt;/span&gt;&lt;span class="lnt"&gt;20
&lt;/span&gt;&lt;span class="lnt"&gt;21
&lt;/span&gt;&lt;span class="lnt"&gt;22
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── data
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── sample
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   │   └── 1.in # Sample testcase input
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   │   └── 1.ans # Sample testcase output
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   └── secret
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── generators # for later
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   └── ...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── input_validators # for later
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   └── ...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── output_validators # for later
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   └── ...
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── problem_statement
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── figure.tex.template
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│   ├── problem.en.tex # The problem statement
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── problem.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── submissions
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── accepted
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │   └── name.cpp # A submission
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── run_time_error
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├── time_limit_exceeded
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └── wrong_answer
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;Edit the statement &lt;code&gt;problem.en.tex&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Make some samples by hand in &lt;code&gt;data/samples/*.{in,ans}&lt;/code&gt;&lt;/li&gt;
&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;
&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;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&lt;li&gt;&lt;a href="#ideas-for-improvement" &gt;Ideas for improvement&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#parameters" &gt;Parameters&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#align-packed-vectors-to-cachelines" &gt;Align packed vectors to cachelines&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#prefetching" &gt;Prefetching&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#faster-modulo-operations" &gt;Faster modulo operations&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&lt;li&gt;&lt;a href="#ideas-for-faster-construction" &gt;Ideas for faster construction&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#implementation-log" &gt;Implementation log&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#hashing-function" &gt;Hashing function&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#bitpacking-crates" &gt;Bitpacking crates&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#construction" &gt;Construction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#fastmod" &gt;Fastmod&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#first-benchmark" &gt;First benchmark&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#faster-bucket-computation" &gt;Faster bucket computation&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#compiling-and-benchmarking-pthash" &gt;Compiling and benchmarking PTHash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#compact-encoding" &gt;Compact encoding&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#find-the-x-differences" &gt;Find the \(x\) differences&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#fastreduce-revisited" &gt;&lt;code&gt;FastReduce&lt;/code&gt; revisited&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#faster-hashing" &gt;Faster hashing&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#an-experiment" &gt;An experiment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#compiler-struggles" &gt;Compiler struggles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#prefetching-at-last" &gt;Prefetching, at last&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#inverting-hki" &gt;Inverting \(h(k_i)\)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#another-day-of-progress" &gt;Another day of progress&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&lt;li&gt;&lt;a href="#bringing-it-home" &gt;Bringing it home&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#fast-path-for-small-buckets" &gt;Fast path for small buckets&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&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;
&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;
&lt;li&gt;&lt;a href="#perfect-matching-for-the-tail" &gt;Perfect matching for the tail&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#peeling-for-size-1-buckets" &gt;Peeling for size-1 buckets&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&lt;li&gt;&lt;a href="#sunday-morning-ideas" &gt;Sunday morning ideas&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#dinic" &gt;Dinic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#new-iterative-greedy-assignment-idea" &gt;New iterative greedy assignment idea&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#cuckoo-hashing-again" &gt;Cuckoo hashing, again&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#displacing-globally" &gt;Displacing globally&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#running-it" &gt;Running it&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#limitations" &gt;Limitations&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#cleanup-and-revisiting-defaults" &gt;Cleanup and revisiting defaults&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#revisiting-alpha-1" &gt;Revisiting \(\alpha &amp;lt; 1\)&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#global-iterative-prioritizing" &gt;Global iterative prioritizing&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&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;
&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;
&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;
&lt;li&gt;&lt;a href="#more-sorting-algorithm-resources" &gt;More sorting algorithm resources&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#and-some-resources-on-partitioning" &gt;And some resources on partitioning&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#partitioning-to-reduce-memory-latency" &gt;Partitioning to reduce memory latency&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#back-from-a-break" &gt;Back from a break!&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#multiplyreduce" &gt;&lt;code&gt;MultiplyReduce&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#linux-hugepages" &gt;Linux hugepages?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#dropping-the-bucket-split" &gt;Dropping the bucket split?&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#build-performance" &gt;Build performance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#an-alternative" &gt;An alternative&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#query-performance" &gt;Query performance&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#query-memory-bandwidth" &gt;Query memory bandwidth&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#some-more-experiments" &gt;Some more experiments&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#multithreading-benchmark" &gt;Multithreading benchmark&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#multithreading-queries-satisfaction-at-last" &gt;Multithreading queries: satisfaction at last&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#packing-difference-from-expected-position" &gt;Packing difference from expected position&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#local-packing-ideas" &gt;Local packing ideas&lt;/a&gt;&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#sharding" &gt;Sharding&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#128bit-hashing" &gt;128bit hashing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#varying-the-partition-size" &gt;Varying the partition size&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#ptrhash-part-2" &gt;PtrHash, part 2&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#phobic" &gt;Phobic&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\[
%\newcommand{\mm}{\,\%\,}
\newcommand{\mm}{\bmod}
\newcommand{\lxor}{\oplus}
\newcommand{\K}{\mathcal K}
\]&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#possible-speedup" &gt;Possible speedup?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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
hashing functions (MPHF), that hashes some input set into \([n]\).&lt;/p&gt;
&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;
&lt;p&gt;Simply said, it maps the \(n\) elements into \([\gamma \cdot n]\) using hashing function \(h_0\).
The \(k_0\) elements that have collisions are mapped into \([\gamma \cdot k_0]\)
using \(h_1\).
Then, the \(k_1\) elements with collisions are mapped into \([\gamma \cdot k_1]\),
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#problem" &gt;Problem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#input" &gt;Input&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#example" &gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#discussion" &gt;Discussion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#found-the-bug" &gt;Found the bug&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#outlook" &gt;Outlook&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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\)
operation version of Myers (&lt;a href="#citeproc_bib_item_2"&gt;1999&lt;/a&gt;) bitpacking algorithm, which uses \(16\)
operations when modified for edit distance.&lt;/p&gt;
&lt;p&gt;I tried implementing it, but it seems to have a bug that I will describe below.
The fix is &lt;a href="#found-the-bug" &gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="problem"&gt;
 Problem
 &lt;a class="heading-link" href="#problem"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;To recap, this algorithm solves the unit-cost edit distance problem by using
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#shortest-path-algorithms-dot-dot" &gt;Shortest path algorithms ..&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#dot-dot-in-general" &gt;.. in general&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#dot-dot-for-circuit-design" &gt;.. for circuit design&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#bucket-queues" &gt;Bucket queues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#shortest-path-algorithms-by-hadlock" &gt;Shortest path algorithms by Hadlock&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#grid-graphs" &gt;Grid graphs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#strings" &gt;Strings&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#spouge-s-computational-volumes" &gt;Spouge&amp;rsquo;s computational volumes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This note summarizes some papers I was reading while investigating the history
of A* for pairwise alignment, and related to that the first usage of a &lt;em&gt;bucket
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#research-plan" &gt;Research plan&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;li&gt;&lt;a href="#add-more-query-types" &gt;Add more query types&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This is a research proposal for a 5 month internship at CWI during autumn/winter 2023-2024.&lt;/p&gt;
&lt;h2 id="introduction"&gt;
 Introduction
 &lt;a class="heading-link" href="#introduction"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;An important problem in bioinformatics is &lt;em&gt;genome assembly&lt;/em&gt;:
DNA sequencing machines read substrings of a full DNA genome, and these pieces
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#comments" &gt;Comments&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#prelims" &gt;Prelims&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#one-to-one" &gt;One-to-One&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#one-to-all" &gt;One-to-All&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#report-and-count" &gt;Report and Count&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#top-k" &gt;Top-\(K\)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#ideas-for-simplification" &gt;Ideas for simplification&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#replace-and-tau-micro-macro-tree" &gt;Replace $τ$-micro-macro tree&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&lt;li&gt;&lt;a href="#reporting-matching-strings" &gt;Reporting matching strings&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#comparison" &gt;Comparison&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#closing-thoughts" &gt;Closing thoughts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\[\newcommand{\dol}{\$}\]&lt;/p&gt;
&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
methods more interesting than results.&lt;/p&gt;
&lt;h2 id="day-1-tuesday"&gt;
 Day 1, Tuesday
 &lt;a class="heading-link" href="#day-1-tuesday"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;h3 id="practical-data-structures-for-longest-common-extensions-alexander-herlez"&gt;
 Practical data structures for longest common extensions, Alexander Herlez
 &lt;a class="heading-link" href="#practical-data-structures-for-longest-common-extensions-alexander-herlez"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&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;
&lt;li&gt;alg:
&lt;ul&gt;
&lt;li&gt;compare first k&lt;/li&gt;
&lt;li&gt;if same: sample a subset and use black-box datastructure.&lt;/li&gt;
&lt;li&gt;similar idea to minhash/mash kmer selection methods, same(?) as syncmers&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;string synchronizing sets (SSS):
&lt;ul&gt;
&lt;li&gt;rolling hash. sample a position when it has minimal hash in it&amp;rsquo;s window&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;li&gt;useful for constant time LCE when extensions are length 1000 or longer. Not
faster for shorter LCEs.&lt;/li&gt;
&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
for short extensions.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="pan-genome-de-bruijn-graph-using-the-bidirectional-fm-index-lore-depuydt"&gt;
 Pan-genome de Bruijn graph using the bidirectional FM-index, Lore Depuydt
 &lt;a class="heading-link" href="#pan-genome-de-bruijn-graph-using-the-bidirectional-fm-index-lore-depuydt"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Goal: graph of pangenome with correspondences to reads&lt;/li&gt;
&lt;li&gt;Implicit graph by Beller and Ohlebusch: build on top of FM-index of concatenation&lt;/li&gt;
&lt;li&gt;New in Nexus:
&lt;ul&gt;
&lt;li&gt;Bidirectional FM-index for bidirectional traversal
&lt;ul&gt;
&lt;li&gt;down/upstream neighbourhoods can be visualized efficiently using traversal&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Search schemes for lossless approximate pattern matching (separate talk)
&lt;ul&gt;
&lt;li&gt;query -&amp;gt; candidate matches -&amp;gt; graph paths -&amp;gt; read paths&lt;/li&gt;
&lt;li&gt;Lossless aligner; reports many more occurrences than PuffAligner, although
this does make it slower for &amp;gt;0 edit distance&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;checkpoints k-mers inside long nodes
&lt;ul&gt;
&lt;li&gt;this way, to find the start of a long (compressed) node goes down significantly.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Memory usage: Bidirectional FM-index is &amp;gt;80%.
&lt;ul&gt;
&lt;li&gt;Bidir FM is linear in total size of pangenome.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Future: r index, which uses less memory.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="indexing-large-metagenomics-projects-with-abundances-pierre-peterlongo"&gt;
 Indexing large metagenomics projects with abundances, Pierre Peterlongo
 &lt;a class="heading-link" href="#indexing-large-metagenomics-projects-with-abundances-pierre-peterlongo"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Indexing read sets with abundance in &amp;lt;100GB with fast querying with low ram.&lt;/li&gt;
&lt;li&gt;Uses counting bloom filters&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fimpera&lt;/code&gt; decreases the overestimation, allowing less memory usage.&lt;/li&gt;
&lt;li&gt;Once k-mers are sorted, all processes are sequential! 1000x speedup&lt;/li&gt;
&lt;li&gt;instead of querying k-mers, store all slightly smaller s-mers and query all of
them for much better false positive rates&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="µ-pbwt-enabling-the-storage-and-use-of-uk-biobank-data-on-a-commodity-laptop-davide-cozzi"&gt;
 µ-PBWT: Enabling the Storage and Use of UK Biobank Data on a Commodity Laptop, Davide Cozzi
 &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;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;r-index equivalent of PBWT, using run-length encoding&lt;/li&gt;
&lt;li&gt;10-100x less memory than PBWT.&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;h3 id="genome-on-diet-taming-large-scale-genomic-analyses-via-sparsified-genomics-mohammed-alser"&gt;
 Genome-on-Diet: Taming Large-Scale Genomic Analyses via Sparsified Genomics, Mohammed Alser
 &lt;a class="heading-link" href="#genome-on-diet-taming-large-scale-genomic-analyses-via-sparsified-genomics-mohammed-alser"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Building an index on spaced kmers/patterns&lt;/li&gt;
&lt;li&gt;Only some positions are sampled. i.e.: sample every other basepair and build
kmers on those.&lt;/li&gt;
&lt;li&gt;Index is built on the fly; not preprocessed&lt;/li&gt;
&lt;li&gt;to 2x faster and 2x less memory than minimap2.&lt;/li&gt;
&lt;li&gt;to 50x faster and 700x less memory than other tools.&lt;/li&gt;
&lt;li&gt;summary: subsample 1 in m bits and run minimap on top of that.&lt;/li&gt;
&lt;li&gt;similar to spaced seeds, but additionally subsamples the number of kmers.&lt;/li&gt;
&lt;li&gt;Faster and better accuracy than spaced seeds.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="spectrum-preserving-tilings-enable-sparse-and-modular-reference-indexing-giulio-ermanno-pibiri"&gt;
 Spectrum preserving tilings enable sparse and modular reference indexing, Giulio Ermanno Pibiri
 &lt;a class="heading-link" href="#spectrum-preserving-tilings-enable-sparse-and-modular-reference-indexing-giulio-ermanno-pibiri"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Spectrum preserving tiling: Given a set of reads and their DBG, we can for
each read store location information per unitig in this larger graph&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;SSHash&lt;/code&gt; to store all unitigs.&lt;/li&gt;
&lt;li&gt;Sample a subset of unitigs to store location information for. Non-sampled
unitigs can still be recovered by querying adjacent unitig locations instead.&lt;/li&gt;
&lt;li&gt;Main contribution: reducing space usage of the reverse index: mapping kmers to locations.&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;h3 id="towards-a-lower-memory-chunked-graph-data-structure-inspired-by-minecraft-fawaz-dabbaghie"&gt;
 Towards a lower-memory chunked graph data structure inspired by Minecraft, Fawaz Dabbaghie
 &lt;a class="heading-link" href="#towards-a-lower-memory-chunked-graph-data-structure-inspired-by-minecraft-fawaz-dabbaghie"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Chunk big graphs as in minecraft chunks.&lt;/li&gt;
&lt;li&gt;First approach: split human genome graph in 1000 parts using BFS&amp;rsquo;s from random positions&lt;/li&gt;
&lt;li&gt;Already big speedup!&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;h3 id="optimal-worst-case-design-of-gapped-k-mer-masks-sven-rahmann"&gt;
 Optimal Worst-Case Design of Gapped k-mer Masks, Sven Rahmann
 &lt;a class="heading-link" href="#optimal-worst-case-design-of-gapped-k-mer-masks-sven-rahmann"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Gapped kmers are better in the worst case than normal kmers:
&lt;ul&gt;
&lt;li&gt;If you can make \(x\) substitutions in a length \(n\) strings, gapped kmers need
a higher \(x\) to mutate (break) all of them.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Second optimization goal: count number of recovered positions, instead of
number of kmers.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;#########_#########_#########&lt;/code&gt; (27,29)-mer: in a \(n=100\) window, lack of such
matches implies at least 4 errors. Normal 27-mers imply at least 3 errors.&lt;/li&gt;
&lt;li&gt;boundary effects (changing \(n\)) are not super strong.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TODO: read old papers and see if this could be used for A*PA&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;How about inexact spaced matches?&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="locality-preserving-hashing-of-k-mers-yoshihiro-shibuya"&gt;
 Locality-Preserving Hashing of k-mers, Yoshihiro Shibuya
 &lt;a class="heading-link" href="#locality-preserving-hashing-of-k-mers-yoshihiro-shibuya"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Mapping of kmers to \([0, 4^n)\) such that kmers with same minimizer are close.&lt;/li&gt;
&lt;li&gt;Split mapping based on whether the minimizer is &lt;em&gt;left-maximal&lt;/em&gt; and/or
&lt;em&gt;right-maximal&lt;/em&gt; inside its super-k-mer.&lt;/li&gt;
&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;
&lt;li&gt;Less than 1.44 bits/element for large k (which is the generic lower bound).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="space-efficient-k-mer-counting-using-an-implicit-sequence-representation-miika-leinonen"&gt;
 Space-efficient k-mer counting using an implicit sequence representation, Miika Leinonen
 &lt;a class="heading-link" href="#space-efficient-k-mer-counting-using-an-implicit-sequence-representation-miika-leinonen"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Map kmers into a hashtable storing at each index:
&lt;ul&gt;
&lt;li&gt;count of kmers mapping here&lt;/li&gt;
&lt;li&gt;the last character of the kmer&lt;/li&gt;
&lt;li&gt;the index of the preceding kmer&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Memory usage: 25%-50% of normal hash table&lt;/li&gt;
&lt;li&gt;saves more memory for larger k.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="vechat-correcting-errors-in-long-reads-using-variation-graphs-alexander-schönhuth"&gt;
 VeChat: correcting errors in long reads using variation graphs, Alexander Schönhuth
 &lt;a class="heading-link" href="#vechat-correcting-errors-in-long-reads-using-variation-graphs-alexander-sch%c3%b6nhuth"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Error correction using graph cleaning&lt;/li&gt;
&lt;li&gt;Clean using repeated steps of:
&lt;ul&gt;
&lt;li&gt;remove edges with low coverage&lt;/li&gt;
&lt;li&gt;clean edges with low &lt;em&gt;confidence&lt;/em&gt;: the relative weight this edge has with
respect to total weight of edges going out of predecessor or going into successor&lt;/li&gt;
&lt;li&gt;clean isolated nodes and leaf edges&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Up to 10x less remaining errors than other tools.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="fixing-homopolymer-errors-in-hifi-reads-using-dictionary-compression-diego-diaz-dominguez"&gt;
 Fixing homopolymer errors in HiFi reads using dictionary compression, Diego Diaz-Dominguez
 &lt;a class="heading-link" href="#fixing-homopolymer-errors-in-hifi-reads-using-dictionary-compression-diego-diaz-dominguez"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Encode sequence recursively using grammer based&lt;/li&gt;
&lt;li&gt;Grammar compression is good on its own&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TODO: read paper&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="orthanq-orthogonal-evidence-based-haplotype-quantification-hamdiye-uzuner"&gt;
 Orthanq: orthogonal evidence based haplotype quantification, Hamdiye Uzuner
 &lt;a class="heading-link" href="#orthanq-orthogonal-evidence-based-haplotype-quantification-hamdiye-uzuner"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Variant calling pipeline&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;h2 id="day-2-wednesday"&gt;
 Day 2, Wednesday
 &lt;a class="heading-link" href="#day-2-wednesday"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;h3 id="random-wheeler-graphs-riccardo-maso"&gt;
 Random Wheeler graphs, Riccardo Maso
 &lt;a class="heading-link" href="#random-wheeler-graphs-riccardo-maso"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#research-proposal-near-linear-exact-pairwise-alignment" &gt;Research Proposal: Near-linear exact pairwise alignment&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#abstract" &gt;Abstract&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#goals-of-the-thesis" &gt;Goals of the thesis&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#impact" &gt;Impact&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#progress-to-date" &gt;Progress to date&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#detailed-work-plan" &gt;Detailed work plan&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;li&gt;&lt;a href="#wp2-visualizing-aligners" &gt;WP2: Visualizing aligners&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#wp3-benchmarking-aligners" &gt;WP3: Benchmarking aligners&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#wp4-theory-review" &gt;WP4: Theory review&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#wp6-affine-costs" &gt;WP6: Affine costs&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&lt;li&gt;&lt;a href="#wp9-thesis-writing" &gt;WP9: Thesis writing&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#publication-plan" &gt;Publication plan&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#time-schedule" &gt;Time schedule&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#teaching-responsibilities" &gt;Teaching responsibilities&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#other-duties" &gt;Other duties&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#study-plan" &gt;Study plan&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#signatures" &gt;Signatures&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;h2 id="research-proposal-near-linear-exact-pairwise-alignment"&gt;
 Research Proposal: Near-linear exact pairwise alignment
 &lt;a class="heading-link" href="#research-proposal-near-linear-exact-pairwise-alignment"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;h3 id="abstract"&gt;
 Abstract
 &lt;a class="heading-link" href="#abstract"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&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
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
number of edits (substitutions, insertions, deletions) to transform one string/sequence
into another.
For sequences of length \(n\), the original algorithm takes \(O(n^2)\) quadratic
time (&lt;a href="#citeproc_bib_item_22"&gt;Sellers 1974&lt;/a&gt;).
In 1983, this was improved to \(O(ns)\) for sequences with low edit distance \(s\)
using Band-Doubling. At the same time, a further improvement to
\(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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#thoughts-and-remarks" &gt;Thoughts and remarks&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#good" &gt;Good&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#bad" &gt;Bad&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#my-programming-language-journey" &gt;My programming language journey&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#lego-mindstorms" &gt;Lego mindstorms&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#labview" &gt;LabVIEW&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#c-plus-plus" &gt;C++&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#python" &gt;Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#rust" &gt;Rust&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;These are some notes on my opinions on Rust after one year of using it.&lt;/p&gt;
&lt;h2 id="thoughts-and-remarks"&gt;
 Thoughts and remarks
 &lt;a class="heading-link" href="#thoughts-and-remarks"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;These pros and cons are mostly relative to C++, the language I used for the past
~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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#complexity-analysis" &gt;Complexity analysis&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#complexity-of-edit-distance" &gt;Complexity of edit distance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#complexity-of-affine-cost-alignment" &gt;Complexity of affine cost alignment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#comparison" &gt;Comparison&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#implementation-efficiency" &gt;Implementation efficiency&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#future-work" &gt;Future work&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This note explores the complexity and performance of band doubling (Edlib) and WFA under varying cost models.&lt;/p&gt;
&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\)
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;
&lt;li&gt;Select the algorithm to visualize&lt;/li&gt;
&lt;li&gt;Click the buttons, or click the canvas and use the indicated keys&lt;/li&gt;
&lt;/ol&gt;
&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;
&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;
&lt;script defer src="https://curiouscoding.nl/js/alg-viz.js" type="module"&gt;&lt;/script&gt;&lt;/head&gt;
&lt;div class="controls"&gt;
&lt;label for="algorithm"&gt;Algorithm&lt;/label&gt;
&lt;select name="algorithm" id="algorithm"&gt;
 &lt;option value="suffix-array"&gt;Suffix Array Construction&lt;/option&gt;
 &lt;option value="bwt"&gt;Burrows-Wheeler Transform&lt;/option&gt;
 &lt;option value="bibwt"&gt;Bidirectional BWT&lt;/option&gt;
&lt;/select&gt;
&lt;br/&gt;
&lt;label for="string"&gt;String&lt;/label&gt; &lt;input type="string" name="string" id="string"/&gt;&lt;br/&gt;
&lt;label for="query"&gt;Query&lt;/label&gt; &lt;input type="string" name="query" id="query"/&gt;&lt;br/&gt;
&lt;button class="button-primary" id="prev"&gt;prev (←/backspace)&lt;/button&gt;
&lt;button class="button-primary" id="next"&gt;next (→/space)&lt;/button&gt;
&lt;br/&gt;
&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;
&lt;button class="button-primary" id="faster"&gt;faster (↑/+/f)&lt;/button&gt;
&lt;button class="button-primary" id="slower"&gt;slower (↓/-/s)&lt;/button&gt;
&lt;button class="button-primary" id="pauseplay"&gt;pause/play (p/return)&lt;/button&gt;
&lt;/div&gt;
&lt;div class="canvas"&gt;
&lt;canvas id="canvas" tabindex='1' width="1600" height="1200"&gt;&lt;/canvas&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#linear-programming" &gt;Linear programming&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#assumptions" &gt;Assumptions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#idea-for-an-algorithm" &gt;Idea for an algorithm&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This note contains some ideas about linear programming and &lt;em&gt;most-orthogonal
faces&lt;/em&gt;. They&amp;rsquo;re mostly on an intuitive level and not very formal.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Postscriptum:&lt;/strong&gt; The ideas here don&amp;rsquo;t work.&lt;/p&gt;
&lt;h2 id="linear-programming"&gt;
 Linear programming
 &lt;a class="heading-link" href="#linear-programming"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;div style="display: none" class="div"&gt;
&lt;p&gt;\begin{equation*}
\newcommand{\v}[1]{\textbf{#1}}
\newcommand{\x}{\v x}
\newcommand{\t}{\v t}
\newcommand{\b}{\v b}
\end{equation*}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Maximize \(\t\x\) subject to \(A\x \leq \b\).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;\(\x\) is a vector of \(n\) variables \(x_i\).&lt;/li&gt;
&lt;li&gt;\(A\) is a \(m\times n\) matrix: there are \(m\) constraints \(A_j \x \leq b_j\).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="assumptions"&gt;
 Assumptions
 &lt;a class="heading-link" href="#assumptions"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#notation" &gt;Notation&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#dijkstra-bfs-visiting-fewer-states" &gt;Dijkstra/BFS: visiting fewer states&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#gapcost-a-first-heuristic" &gt;GapCost: A first heuristic&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&lt;li&gt;&lt;a href="#a-better-heuristics" &gt;A*: Better heuristics&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#local-doubling" &gt;Local doubling&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#without-heuristic" &gt;Without heuristic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#with-heuristic" &gt;With heuristic&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#diagonal-transition" &gt;Diagonal Transition&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&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;
&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;
&lt;li&gt;&lt;a href="#todo-aspriation-windows" &gt;TODO: aspriation windows&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\begin{equation*}
\newcommand{\st}[2]{\langle #1,#2\rangle}
\newcommand{\g}{g^*}
\newcommand{\fm}{f_{max}}
\newcommand{\gap}{\operatorname{Gap}}
\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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#burrows-wheeler-transformation--bwt" &gt;Burrows-Wheeler Transformation (BWT)&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;li&gt;&lt;a href="#pattern-matching" &gt;Pattern matching&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#visualization" &gt;Visualization&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#bi-directional-bwt" &gt;Bi-directional BWT&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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;
&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
notation and terminology.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At &lt;a href="#visualization" &gt;the bottom&lt;/a&gt; you can find a visualization.&lt;/li&gt;
&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;
&lt;/ul&gt;
&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;
&lt;h2 id="burrows-wheeler-transformation--bwt"&gt;
 Burrows-Wheeler Transformation (BWT)
 &lt;a class="heading-link" href="#burrows-wheeler-transformation--bwt"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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;
&lt;p&gt;\begin{equation}
\sum_{k=0}^n \binom{2k}k \binom{2n-2k}{n-k} = 4^n
\end{equation}&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Gould has two derivations:
&lt;ul&gt;
&lt;li&gt;
&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;
&lt;/li&gt;
&lt;li&gt;
&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;
&lt;p&gt;\begin{equation}
\sum_{k=0}^n \binom{x}k \binom{y}{n-k} = \binom{x+y}n
\end{equation}&lt;/p&gt;
&lt;p&gt;using \(x=y=-\frac 12\) and using the &lt;em&gt;$-\frac 12$-transform&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;\begin{equation}
\binom{-1/2}{n} = (-1)^n\binom{2n}{n}\frac 1 {2^{2n}}
\end{equation}&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;h2 id="references"&gt;
 References
 &lt;a class="heading-link" href="#references"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;style&gt;.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}&lt;/style&gt;&lt;div class="csl-bib-body"&gt;
 &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;
 &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;
 &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;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#definitions" &gt;Definitions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#proof-of-lemma-1" &gt;Proof of Lemma 1&lt;/a&gt;&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This is a proof that Tensor Embedding
(&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;
&lt;p&gt;This is in collaboration with Amir Joudaki.&lt;/p&gt;
&lt;p&gt;\begin{equation*}
\newcommand{\I}{\mathcal I}
\newcommand{\EE}{\mathbb E}
\newcommand{\var}{\operatorname{Var}}
\end{equation*}&lt;/p&gt;
&lt;h2 id="definitions"&gt;
 Definitions
 &lt;a class="heading-link" href="#definitions"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;Notation&lt;/dt&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;The alphabet is \(\Sigma\), of size \(|\Sigma| = \sigma\).&lt;/li&gt;
&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;
&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
\(a_I = (a_{i_1}, \dots, a_{i_t})\).&lt;/li&gt;
&lt;li&gt;We write \([ X ]\) for the indicator variable of event \(X\), which is \(1\) when
\(X\) holds and \(0\) otherwise.&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;Definition 1: Tensor embedding&lt;/dt&gt;
&lt;dd&gt;Given \(a\in \Sigma^n\), the &lt;em&gt;tensor embedding&lt;/em&gt; \(T_a\) is the \(\sigma^t\) tensor
given by \(T_a[s] = \sum_{I\in \I} [A_I = s]\) for each \(s\in \Sigma^t\).
&lt;p&gt;The &lt;em&gt;normalized tensor embedding distance&lt;/em&gt; \(d_{te}\) between two sequences \(a\)
and \(b\) is defined as&lt;/p&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#notation" &gt;Notation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#small-and-large-suffixes" &gt;Small and Large suffixes&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#visualization" &gt;Visualization&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;These are some notes about linear time suffix array (SA) construction algorithms (SACA&amp;rsquo;s).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;At &lt;a href="#visualization" &gt;the bottom&lt;/a&gt; you can find a visualization.&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;p&gt;History of suffix array construction algorithms:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1990 first algorithm: Manber and Myers (&lt;a href="#citeproc_bib_item_2"&gt;1993&lt;/a&gt;)&lt;/li&gt;
&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;
&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;
&lt;/ul&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#contest-strategies" &gt;Contest strategies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#pairwise-alignment-using-a" &gt;Pairwise Alignment using A*&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#exercises" &gt;Exercises&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;h2 id="contest-strategies"&gt;
 Contest strategies
 &lt;a class="heading-link" href="#contest-strategies"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;Preparation&lt;/dt&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;Thinking costs energy!&lt;/li&gt;
&lt;li&gt;Sleep enough; early to bed the 2 nights before.&lt;/li&gt;
&lt;li&gt;No practising on contest day (and the day before); it just takes energy.&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;During the contest&lt;/dt&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;Eat! At the very least take a break halfway with the entire team and eat some snacks.&lt;/li&gt;
&lt;li&gt;Make sure to read &lt;strong&gt;all&lt;/strong&gt; the problems before the end of the contest. In the
beginning, split the problems to find the simple ones, but towards the end,
find a problem you think you can solve (because of the scoreboard or because
you like it), and work on it as a team.&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;Coding&lt;/dt&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;Ideally, use C++. Otherwise, Python can be used too.
&lt;ul&gt;
&lt;li&gt;For big-integer problems, prefer Python.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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
containing algorithms. Ideally, implement all of them yourself so you know
how they work. Otherwise download one.&lt;/li&gt;
&lt;li&gt;Make a template, and add it to your TCR. One person should type this in the
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;
&lt;li&gt;When you think you solved a problem:
&lt;ul&gt;
&lt;li&gt;Decide &lt;em&gt;exactly&lt;/em&gt; how the code will look. Maybe write pseudocode on paper.&lt;/li&gt;
&lt;li&gt;For hard problems: verify your solution with a teammate.&lt;/li&gt;
&lt;li&gt;Once the keyboard is free, start typing it out. If needed, ask one
teammate to look while you code.&lt;/li&gt;
&lt;li&gt;Typical distribution:
&lt;ul&gt;
&lt;li&gt;1 person typing&lt;/li&gt;
&lt;li&gt;1 person solving a new problem&lt;/li&gt;
&lt;li&gt;1 person helping the other 2: spotting typos or working on problems.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id="pairwise-alignment-using-a"&gt;
 Pairwise Alignment using A*
 &lt;a class="heading-link" href="#pairwise-alignment-using-a"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#motivation" &gt;Motivation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#parititioning-a-memory-by-fronts" &gt;Parititioning A* memory by fronts&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#non-consistent-heuristics" &gt;Non-consistent heuristics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#front-indexing" &gt;Front indexing&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#tracing-back-the-path" &gt;Tracing back the path&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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
a time, similar to what Edlib and WFA do. Note that for now this &lt;strong&gt;will not
work&lt;/strong&gt;, but I&amp;rsquo;m putting this online anyway.&lt;/p&gt;
&lt;h2 id="motivation"&gt;
 Motivation
 &lt;a class="heading-link" href="#motivation"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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
visited (explored/expanded) states by A*. This can take up a lot of memory and
simply reading/writing \(g\) in the hashmap can take over half the total execution
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#motivation" &gt;Motivation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#summary" &gt;Summary&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#why-is-a-slow" &gt;Why is A* slow?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#computational-volumes" &gt;Computational volumes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#dealing-with-pruning" &gt;Dealing with pruning&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#thoughts-on-more-aggressive-pruning" &gt;Thoughts on more aggressive pruning&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#algorithm-summary" &gt;Algorithm summary&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#challenges" &gt;Challenges&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#results" &gt;Results&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#what-about-band-doubling" &gt;What about band-doubling?&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#todos" &gt;TODOs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#extensions" &gt;Extensions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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
overview of some of my new ideas to significantly speed up exact global pairwise
alignment. It&amp;rsquo;s recommended you understand the &lt;em&gt;seed heuristic&lt;/em&gt; and &lt;em&gt;match
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#motivation" &gt;Motivation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#path-traceback-two-strategies" &gt;Path traceback: two strategies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#observations" &gt;Observations&lt;/a&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#a-pragmatic-solution" &gt;A pragmatic solution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#another-interpretation" &gt;Another interpretation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#affine-costs" &gt;Affine costs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;&lt;a id="figure--result"&gt;&lt;/a&gt;&lt;/p&gt;
&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"
 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;
 &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;</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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#edit-graph" &gt;Edit graph&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#algorithms" &gt;Algorithms&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#potentials" &gt;Potentials&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#multiple-variants" &gt;Multiple variants&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#some-notes-on-algorithms" &gt;Some notes on algorithms&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#wfa" &gt;WFA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#a" &gt;A*&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#extending-to-different-cost-models" &gt;Extending to different cost models&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#affine-costs" &gt;Affine costs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#substitution-matrices" &gt;Substitution matrices&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#but-not-local-alignment" &gt;But not local alignment&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#evaluations" &gt;Evaluations&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#unequal-string-length" &gt;Unequal string length&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#equal-string-lengths" &gt;Equal string lengths&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;h2 id="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 class="heading-link" href="#tricks-with-match-bonus-or-how-to-fool-dijkstra-s-limitations"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#notation" &gt;Notation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#naming-and-style" &gt;Naming and style&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This is a growing list of notation and style decisions Pesho and I made during the
writing of our paper, written down so that we don&amp;rsquo;t have to spend time on it again
next time.&lt;/p&gt;
&lt;h2 id="notation"&gt;
 Notation
 &lt;a class="heading-link" href="#notation"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;Math&lt;/dt&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;Modulo: \(a\bmod m\) for remainder, \(a\equiv b\pmod m\) for equivalence.&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;Alphabet&lt;/dt&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;\(\Sigma\), \(|\Sigma| = 4\)&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;Sequences&lt;/dt&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;\(A = \overline{a_0\dots a_{n-1}} \in \Sigma^*\), \(|A| = n\)&lt;/li&gt;
&lt;li&gt;\(B = \overline{b_0\dots b_{m-1}} \in \Sigma^*\), \(|B| = m\)&lt;/li&gt;
&lt;li&gt;Edit distance \(\mathrm{ed}(A, B)\)&lt;/li&gt;
&lt;li&gt;\(A_{&amp;lt;i} = \overline{a_0\dots a_{i-1}}\)&lt;/li&gt;
&lt;li&gt;\(A_{\geq i} = \overline{a_i\dots a_{n-1}}\)&lt;/li&gt;
&lt;li&gt;\(A_{i\dots i&amp;rsquo;} = \overline{a_i\dots a_{i&amp;rsquo;-1}}\)&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;Edit graph&lt;/dt&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;State \(\langle i, j\rangle\)&lt;/li&gt;
&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;
&lt;li&gt;Root state \(v_s = \langle 0,0\rangle\)&lt;/li&gt;
&lt;li&gt;Target state \(v_t = \langle n,m\rangle\)&lt;/li&gt;
&lt;li&gt;Distance \(d(u, v)\)&lt;/li&gt;
&lt;li&gt;Path \(\pi\)&lt;/li&gt;
&lt;li&gt;Shortest path \(\pi^*\)&lt;/li&gt;
&lt;li&gt;Cost of path \(cost(\pi)\), \(cost(\pi^*) = d(v_s, v_t) = \mathrm{ed}(A, B)\).&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id="naming-and-style"&gt;
 Naming and style
 &lt;a class="heading-link" href="#naming-and-style"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Vertex, not node&lt;/p&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&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;
&lt;ul&gt;
&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;
&lt;li&gt;&lt;a href="#conclusion" &gt;Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;h2 id="diamond-transition-or-how-technicalities-can-break-concepts"&gt;
 Diamond transition or how technicalities can break concepts
 &lt;a class="heading-link" href="#diamond-transition-or-how-technicalities-can-break-concepts"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;We assume the reader has some basic knowledge about pairwise alignment
and in particular the WFA algorithm.&lt;/em&gt;&lt;/p&gt;
&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
insightful at the moment.&lt;/p&gt;
&lt;dl&gt;
&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;
&lt;dd&gt;introduces \(h_f(u) = \frac 12 (\pi_f(u) - \pi_r)\). Not found
a paper yet.&lt;/dd&gt;
&lt;dt&gt;An Improved Bidirectional Heuristic Search Algorithm (Champeaux 1977)&lt;/dt&gt;
&lt;dd&gt;introduces a bidirectional variant&lt;/dd&gt;
&lt;dt&gt;Bidirectional Heuristic Search Again (Champeaux 1983)&lt;/dt&gt;
&lt;dd&gt;fixes a bug in the
above paper&lt;/dd&gt;
&lt;dt&gt;Efficient modified bidirectional A* algorithm for optimal route-finding&lt;/dt&gt;
&lt;dd&gt;Didn&amp;rsquo;t read closely yet.&lt;/dd&gt;
&lt;dt&gt;A new bidirectional algorithm for shortest paths (Pijls 2008)&lt;/dt&gt;
&lt;dd&gt;Actually a
new methods. Seems to cite useful papers.
&lt;p&gt;There 2 papers that cite this one may also be interesting.&lt;/p&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;
&lt;p&gt;It seems that getting the meeting/overlap condition of BiWFA
(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;
&lt;p&gt;Let \(p := \max(x, o+e)\) be the maximal cost of any edge in the edit graph.
As in the BiWFA paper, let \(s_f\) and \(s_r\) be the distances of the &lt;em&gt;forward&lt;/em&gt; and
&lt;em&gt;reverse&lt;/em&gt; fronts computed so far.&lt;/p&gt;
&lt;p&gt;We prove the following lemma:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Lemma&lt;/strong&gt;
Once BiWFA has expanded the forward and reverse fronts up to \(s_f\) and \(s_r\) and
has found &lt;em&gt;some&lt;/em&gt; path of cost \(s \leq s_f + s_r\),
expanding the fronts until \(s&amp;rsquo;_f + s&amp;rsquo;_r \geq s+p+o\) is guaranteed to find a
&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
particular, here I&amp;rsquo;m interested in papers that update \(h\) during the A* search,
as a background for &lt;a href="https://curiouscoding.nl/posts/pruning/" &gt;pruning&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Specifically, our version of pruning increases \(h\) during a &lt;em&gt;single&lt;/em&gt; A* search,
and in fact the heuristic becomes &lt;em&gt;in-admissible&lt;/em&gt; after pruning.&lt;/p&gt;
&lt;h2 id="changing-h"&gt;
 Changing \(h\)
 &lt;a class="heading-link" href="#changing-h"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;The original A* paper has a proof of optimality. Later papers consider this also
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;
&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;
&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;
&lt;p&gt;This post lists some lessons I learned while attempting to run benchmarks for
&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
characteristics from CPUs in a typical server rack. All the programs I run are
single threaded.&lt;/p&gt;
&lt;h2 id="hardware"&gt;
 Hardware
 &lt;a class="heading-link" href="#hardware"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;Do not run while charging the laptop&lt;/dt&gt;
&lt;dd&gt;Charging makes the battery hot and causes throttling. Run either on
battery power or with a completely full battery to prevent this.&lt;/dd&gt;
&lt;dt&gt;Disable hyperthreading&lt;/dt&gt;
&lt;dd&gt;Completely disable hyperthreading in the BIOS.
Multiple programs running on the same core may fight for resources.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id="cpu-settings"&gt;
 CPU settings
 &lt;a class="heading-link" href="#cpu-settings"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;Pin CPU frequency&lt;/dt&gt;
&lt;dd&gt;CPUs, especially laptops, have turboboost, (thermal) throttling, and powersave
features. Make sure to pin the CPU core frequency low enough that it can be
sustained for long times without throttling.
&lt;p&gt;In my case, the &lt;code&gt;performance&lt;/code&gt; governor can fix the CPU frequency. The base
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;</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
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#pairwise-alignment-in-subquadratic-time" &gt;Pairwise alignment in subquadratic time&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#random-model" &gt;Random model&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#algorithm" &gt;Algorithm&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#seed-heuristic" &gt;Seed heuristic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#match-pruning" &gt;Match pruning&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#analysis" &gt;Analysis&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#expanded-states" &gt;Expanded states&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#excess-errors" &gt;Excess errors&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#algorithmic-complexity" &gt;Algorithmic complexity&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This post is a proof sketch to show that A* with the &lt;em&gt;seed heuristic&lt;/em&gt;
(&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
mutations in near linear time.&lt;/p&gt;
&lt;h2 id="pairwise-alignment-in-subquadratic-time"&gt;
 Pairwise alignment in subquadratic time
 &lt;a class="heading-link" href="#pairwise-alignment-in-subquadratic-time"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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
done in strongly subquadratic time (i.e. \(O(n^{2-\delta})\) for any \(\delta &amp;gt;0\))
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#gap-open" &gt;Gap open&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#gap-close" &gt;Gap close&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#symmetric-alternatives" &gt;Symmetric alternatives&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#another-symmetry" &gt;Another symmetry&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#conclusions" &gt;Conclusions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&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;
&lt;p&gt;In this post I will explore some variations of the recursion used by WFA/BiWFA
for the affine version of the diagonal transition algorithm.
In particular, we will go over a &lt;em&gt;gap-close&lt;/em&gt; variant, and look into some more symmetric
formulations.&lt;/p&gt;
&lt;h2 id="gap-open"&gt;
 Gap open
 &lt;a class="heading-link" href="#gap-open"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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
transition method.
Let us call it a &lt;strong&gt;gap-open&lt;/strong&gt; variant, because the gap-open cost \(o\) is payed when
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.
More of a place to store random remarks than a complete reference for now.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;diagonal transition&lt;/dt&gt;
&lt;dd&gt;name introduced by Navarro (&lt;a href="#citeproc_bib_item_1"&gt;2001&lt;/a&gt;)&lt;/dd&gt;
&lt;dt&gt;approximate&lt;/dt&gt;
&lt;dd&gt;&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;approximate algorithm&lt;/em&gt;: an algorithms that does not always give the
&lt;em&gt;correct&lt;/em&gt; answer.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;$k$-approximate string matching&lt;/em&gt;: variant semi-global alignment where we
find all matches of a pattern in a reference with at most \(k\) mistakes.&lt;/p&gt;
&lt;p&gt;Also &lt;em&gt;approximate string matching&lt;/em&gt;: alternative name for global pairwise alignment.&lt;/p&gt;</description></item><item><title>A survey of exact global pairwise alignment</title><link>https://curiouscoding.nl/posts/pairwise-alignment-history/</link><pubDate>Fri, 01 Apr 2022 00:00:00 +0200</pubDate><guid>https://curiouscoding.nl/posts/pairwise-alignment-history/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#variants-of-pairwise-alignment" &gt;Variants of pairwise alignment&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#cost-models" &gt;Cost models&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#alignment-types" &gt;Alignment types&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#a-chronological-overview-of-global-pairwise-alignment" &gt;A chronological overview of global pairwise alignment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#algorithms-in-detail" &gt;Algorithms in detail&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#classic-dp-algorithms" &gt;Classic DP algorithms&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#cubic-dp" &gt;Cubic algorithm of Needleman and Wunsch (&lt;a href="#citeproc_bib_item_24"&gt;1970&lt;/a&gt;)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#quadratic-dp" &gt;A quadratic DP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#local-alignment" &gt;Local alignment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#affine-costs" &gt;Affine costs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#minimizing-vs-dot-maximizing-duality" &gt;Minimizing vs. maximizing duality&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#four-russians" &gt;Four Russians method&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#o--ns--methods" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; \(O(ns)\) methods&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#exponential-band" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Exponential search on band&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#thresholds" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; LCS: thresholds, $k$-candidates and contours&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#diagonal-transition" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Diagonal transition: furthest reaching and wavefronts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#ns2" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Suffixtree for \(O(n+s^2)\) expected runtime&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#using-less-memory" &gt;Using less memory&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#computing-the-score-in-linear-space" &gt;Computing the score in linear space&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#divide-and-conquer" &gt;Divide-and-conquer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#lcsk-plus-plus-algorithms" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; LCSk[++] algorithms&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#theoretical-lower-bound" &gt;Theoretical lower bound&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#a-note-on-dp--toposort--vs-dijkstra-vs-a" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; A note on DP (toposort) vs Dijkstra vs A*&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#tools" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#notes-for-other-posts" &gt;&lt;span class="org-todo todo TODO"&gt;TODO&lt;/span&gt; Notes for other posts&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#semi-global-alignment-papers" &gt;Semi-global alignment papers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#approximate-pairwise-aligners" &gt;Approximate pairwise aligners&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#old-vs-new-papers" &gt;Old vs new papers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;This post explains the many variants of pairwise alignment, and covers papers
defining and exploring the topic.&lt;/p&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;
&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
looking for.&lt;/p&gt;
&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
estimated distance to the end should never be larger than the actual distance to
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;
&lt;ul&gt;
&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;
&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;
&lt;/ul&gt;
&lt;p&gt;AStarix is a method for aligning sequences (reads) to graphs:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Input&lt;/dt&gt;
&lt;dd&gt;&lt;ul&gt;
&lt;li&gt;A reference sequence or graph&lt;/li&gt;
&lt;li&gt;Alignment costs \((\Delta_{match}, \Delta_{subst}, \Delta_{del}, \Delta_{ins})\) for a match, substitution, insertion and deletion&lt;/li&gt;
&lt;li&gt;Sequence(s) to align&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;Output&lt;/dt&gt;
&lt;dd&gt;An optimal alignment of each input sequence&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;The input is a reference graph (automaton really) \(G_r = (V_r, E_r)\) with edges \(E_r \subseteq
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.
It differs from UPGMA in the way it computes the distances between clusters.&lt;/p&gt;
&lt;p&gt;This algorithm first assumes that the phylogeny is a star graph.
Then it finds the pair of vertices that when merged and split out gives the
minimal total edge length \(S_{ij}\) of the new almost-star graph. (See eq. (4)
and figure 2a and 2b in the paper.)
\[
S_{i,j} = \frac1{2(n-2)} \sum_{k\not\in \{i,j\}}(d(i, k)+d(j,k)) + \frac 12
d(i,j)+\frac 1{n-2} \sum_{k&amp;lt;l,\, k, l\not\in\{i,j\}}d(k,l).
\]
After subtracting the sum of all pairwise distances (which is a constant) and multiplying by \(2(n-2)\), we obtain
the familiar
\[
Q(i, j) = (n-2) d(i, j) - \sum_{k=1}^n d(i, k) - \sum_{k=1}^n d(j, k).
\]
Thus, we merge the two vertices that minimize \(Q\).
The distance from the merging of vertices \(i\) and \(j\) to each other vertex
\(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;
&lt;dl&gt;
&lt;dt&gt;Input&lt;/dt&gt;
&lt;dd&gt;Matrix of pairwise distances&lt;/dd&gt;
&lt;dt&gt;Output&lt;/dt&gt;
&lt;dd&gt;Phylogeny&lt;/dd&gt;
&lt;dt&gt;Algorithm&lt;/dt&gt;
&lt;dd&gt;Repeatedly merge the nearest two clusters. The distance between
clusters is the average of all pairwise distances between them. When merging
two clusters, the distances of the new cluster are the weighted averages of
distances from the two clusters being merged.&lt;/dd&gt;
&lt;dt&gt;Complexity&lt;/dt&gt;
&lt;dd&gt;\(O(n^3)\) naive, \(O(n^2 \ln n)\) using heap.&lt;/dd&gt;
&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;
&lt;ul&gt;
&lt;li&gt;When you complain about an error without reading it first.&lt;/li&gt;
&lt;li&gt;When you assume you understand the problem halfway through reading the error,
and only after more debugging you realize you failed to read properly.&lt;/li&gt;
&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
paper should be reviewable. Pipelines (e.g. &lt;code&gt;snakemake&lt;/code&gt; files) to generated them
should be attached to the paper.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve asked for automated scripts to reproduce test data on 3+ github repositories
now, and got a satisfactory answer zero times:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&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;
&lt;p&gt;Link to a datadump on the block-aligner repository. Good to have actual data,
but &lt;em&gt;exactly&lt;/em&gt; how this data was created is unclear to me.&lt;/p&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#background" &gt;Background&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#k-mers" &gt;$k$-mers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#sketching" &gt;Sketching&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#minhash" &gt;MinHash&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#terminology" &gt;Terminology&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#spaced-k-mer-seeded-distance" &gt;Spaced $k$-mer Seeded Distance&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#improving-performance" &gt;Improving performance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#analysis" &gt;Analysis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#pruning-false-positive-candidate-matches" &gt;Pruning false positive candidate matches&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#phylogeny-reconstruction" &gt;Phylogeny reconstruction&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#running-the-algorithm" &gt;Running the algorithm&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\[
\newcommand{\vp}{\varphi}
\newcommand{\A}{\mathcal A}
\newcommand{\O}{\mathcal O}
\newcommand{\N}{\mathbb N}
\newcommand{\ed}{\mathrm{ed}}
\newcommand{\mh}{\mathrm{mh}}
\newcommand{\hash}{\mathrm{hash}}
\]&lt;/p&gt;
&lt;h2 id="background"&gt;
 Background
 &lt;a class="heading-link" href="#background"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Quickly finding similar pieces of DNA within large datasets is at the
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;
&lt;h2 id="the-internet-is-more-accessible-than-papers"&gt;
 The internet is more accessible than papers
 &lt;a class="heading-link" href="#the-internet-is-more-accessible-than-papers"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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.
I think blog posts are a great way to quickly learn about new
ideas and concepts, since they are usually more accessible than papers.
A blog post can omit some of the more formal text required in papers
and spend more time explaining things on an intuitive level. This way,
scientific concepts can be understood by a larger audience than just those
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;
&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;
&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;.
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
and build from there.&lt;/p&gt;
&lt;p&gt;Some notes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I&amp;rsquo;m using the &lt;code&gt;Hugo-coder&lt;/code&gt; theme.&lt;/li&gt;
&lt;li&gt;Since the conversion from Org to markdown is done using an Emacs plugin, the
&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
to export all &lt;code&gt;*.org&lt;/code&gt; files in the repository apart from those inside the
&lt;code&gt;emacs&lt;/code&gt; folder itself.&lt;/li&gt;
&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
&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
serve the site locally.&lt;/li&gt;
&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;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#spaced-k-mers" &gt;Spaced \(k\)-mers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#minimap" &gt;Minimap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#spades" &gt;SPAdes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mummer4" &gt;MUMmer4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#blasr" &gt;BLASR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#bowtie-2" &gt;Bowtie 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#patternhunter" &gt;Patternhunter&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#lomex" &gt;LoMeX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#meeting-notes" &gt;Meeting notes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;Concepts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Mapping&lt;/strong&gt; Map a sequence onto a reference genome/dataset&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Assembly&lt;/strong&gt; Build a genome from a set of reads
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;de novo&lt;/em&gt; (implied): without using a reference genome&lt;/li&gt;
&lt;li&gt;Otherwise just called &lt;em&gt;mapping&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Typical complicating factors:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;read errors&lt;/li&gt;
&lt;li&gt;non-uniform coverage&lt;/li&gt;
&lt;li&gt;insert size variation&lt;/li&gt;
&lt;li&gt;chimeric reads (?)&lt;/li&gt;
&lt;li&gt;bireads&lt;/li&gt;
&lt;li&gt;non-uniform read coverage (as in metagenomics, i.e. multi cell
assembly)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="spaced-k-mers"&gt;
 Spaced \(k\)-mers
 &lt;a class="heading-link" href="#spaced-k-mers"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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;\[
\newcommand{\vp}{\varphi}
\newcommand{\A}{\mathcal A}
\newcommand{\O}{\mathcal O}
\newcommand{\N}{\mathbb N}
\newcommand{\Z}{\mathbb Z}
\newcommand{\ed}{\mathrm{ed}}
\newcommand{\mh}{\mathrm{mh}}
\newcommand{\hash}{\mathrm{hash}}
\]&lt;/p&gt;
&lt;p&gt;Here is an idea for an algorithm to assemble long reads.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go over all sequences and sketch their windows using the Hamming
distance preserving sketch method described &lt;a href="../hamming-similarity-search" &gt;here&lt;/a&gt;.
This method may need some tweaking to also work with an indel rate of
around 10%.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Let&amp;rsquo;s say we find a pair of matching windows between reads \(A\) and
\(B\) starting at positions \(i\) and \(j\). This indicates that
\(A\) and \(B\) may be related with an offset of \(j-i\).&lt;/p&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#background" &gt;Background&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#k-mers" &gt;$k$-mers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#sketching" &gt;Sketching&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#minhash" &gt;MinHash&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#introduction" &gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#hamming-similarity-search1" &gt;Hamming Similarity Search&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#improving-performance" &gt;Improving performance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#analysis" &gt;Analysis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#pruning-false-positive-candidate-matches" &gt;Pruning false positive candidate matches&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#phylogeny-reconstruction" &gt;Phylogeny reconstruction&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#running-the-algorithm" &gt;Running the algorithm&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#assembly" &gt;Assembly&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;\[
\newcommand{\vp}{\varphi}
\newcommand{\A}{\mathcal A}
\newcommand{\O}{\mathcal O}
\newcommand{\N}{\mathbb N}
\newcommand{\ed}{\mathrm{ed}}
\newcommand{\mh}{\mathrm{mh}}
\newcommand{\hash}{\mathrm{hash}}
\]&lt;/p&gt;
&lt;h2 id="background"&gt;
 Background
 &lt;a class="heading-link" href="#background"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Quickly finding similar pieces of DNA within large datasets is at the
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;Xrefs&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; |
&lt;a href="https://aur.archlinux.org/packages/sway-inhibit-fullscreen-git/" class="external-link" target="_blank" rel="noopener"&gt;AUR
package&lt;/a&gt; &lt;code&gt;sway-inhibit-fullscreen-git&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Once upon a time, Chromium had a bug where using &lt;code&gt;$mod+f&lt;/code&gt; in i3 to
fullscreen the Chromium window changed the window to occupy the entire
screen, but didn&amp;rsquo;t actually make Chromium enter full screen mode.
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;
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
possibly, back in those days:&lt;/p&gt;
&lt;figure class="inset"&gt;&lt;img src="https://curiouscoding.nl/ox-hugo/fullscreen.png"&gt;
&lt;/figure&gt;

&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#my-aur-packages" &gt;My aur packages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#some-issues-i-reported-fixed" &gt;Some issues I reported/fixed&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;h2 id="my-aur-packages"&gt;
 My aur packages
 &lt;a class="heading-link" href="#my-aur-packages"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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;
&lt;ul&gt;
&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;:
&lt;a href="https://github.com/RagnarGrootKoerkamp/BAPCtools" class="external-link" target="_blank" rel="noopener"&gt;BAPCtools&lt;/a&gt; is
used for developing ICPC style programming contest problems.&lt;/li&gt;
&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;:
&lt;a href="https://github.com/RagnarGrootKoerkamp/feh" class="external-link" target="_blank" rel="noopener"&gt;Branch&lt;/a&gt; of Feh that
loads the next image to speed up browsing images in a remote
directory.&lt;/li&gt;
&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;:
&lt;a href="https://github.com/lbonn/i3-focus-last" class="external-link" target="_blank" rel="noopener"&gt;Window switcher&lt;/a&gt; for
i3/sway.&lt;/li&gt;
&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;:
the original
&lt;a href="https://aur.archlinux.org/packages/python-pyexiftool/" class="external-link" target="_blank" rel="noopener"&gt;python-pyexiftool&lt;/a&gt;
is outdated, orphaned, and still depends on python2.&lt;/li&gt;
&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;:
Sway
&lt;a href="https://github.com/RagnarGrootKoerkamp/sway/tree/fakefullscreen" class="external-link" target="_blank" rel="noopener"&gt;branch&lt;/a&gt;
that adds the &lt;code&gt;inhibit_fullscreen toggle&lt;/code&gt; command. Bind this to
e.g. &lt;code&gt;$mod+Shift+f&lt;/code&gt; to disconnect the Sway full screen status from the
application full screen status. Used to e.g. watch YouTube videos in
Chromium in full screen mode, but in a window that is only a quarter
of the screen.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="some-issues-i-reported-fixed"&gt;
 Some issues I reported/fixed
 &lt;a class="heading-link" href="#some-issues-i-reported-fixed"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&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;
after searching and hitting Enter, vimium freezes and needs a mouse
click to unfreeze. &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;N&lt;/code&gt; do not work.
&lt;ul&gt;
&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
missing &lt;code&gt;return&lt;/code&gt; statement after many hours of debugging&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&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;
Bug: Last characters dropped when using custom search engine
&lt;ul&gt;
&lt;li&gt;duplicate of
&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;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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
&lt;code&gt;anything&lt;/code&gt; option to Grimshot to allow selecting either a window,
output, or manual area.&lt;/li&gt;
&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;
Feature Request: Dismiss all notifications with given category&lt;/li&gt;
&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;
Moving the mouse to a different output does not always grey out
rectangles&lt;/li&gt;
&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;
Clicking outside all rectangles should cancel&lt;/li&gt;
&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;
Unexpected &lt;code&gt;next_on_output&lt;/code&gt; behaviour with
&lt;code&gt;workspace_auto_back_and_forth&lt;/code&gt;
&lt;ul&gt;
&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;
&lt;/ul&gt;
&lt;/li&gt;
&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;
&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;
&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
great help to quickly search many webpages.&lt;/p&gt;
&lt;p&gt;I am using it many times a day to search for just the documentation I
need. Some of the search engines I have configured:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1
&lt;/span&gt;&lt;span class="lnt"&gt; 2
&lt;/span&gt;&lt;span class="lnt"&gt; 3
&lt;/span&gt;&lt;span class="lnt"&gt; 4
&lt;/span&gt;&lt;span class="lnt"&gt; 5
&lt;/span&gt;&lt;span class="lnt"&gt; 6
&lt;/span&gt;&lt;span class="lnt"&gt; 7
&lt;/span&gt;&lt;span class="lnt"&gt; 8
&lt;/span&gt;&lt;span class="lnt"&gt; 9
&lt;/span&gt;&lt;span class="lnt"&gt;10
&lt;/span&gt;&lt;span class="lnt"&gt;11
&lt;/span&gt;&lt;span class="lnt"&gt;12
&lt;/span&gt;&lt;span class="lnt"&gt;13
&lt;/span&gt;&lt;span class="lnt"&gt;14
&lt;/span&gt;&lt;span class="lnt"&gt;15
&lt;/span&gt;&lt;span class="lnt"&gt;16
&lt;/span&gt;&lt;span class="lnt"&gt;17
&lt;/span&gt;&lt;span class="lnt"&gt;18
&lt;/span&gt;&lt;span class="lnt"&gt;19
&lt;/span&gt;&lt;span class="lnt"&gt;20
&lt;/span&gt;&lt;span class="lnt"&gt;21
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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;
&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&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;
&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;
&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;
&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;
&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;
&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&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;
&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;
&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;
&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;
&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;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Any of these can now be activated by typing their shorthand in the
omnibar (which is usually activated by pressing &lt;code&gt;o&lt;/code&gt; or &lt;code&gt;O&lt;/code&gt;). Vimium even
has live preview support for Wikipedia and Google search, as well as
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
Wayland system.&lt;/p&gt;
&lt;h2 id="screen-brightness-light"&gt;
 Screen brightness: &lt;code&gt;light&lt;/code&gt;
 &lt;a class="heading-link" href="#screen-brightness-light"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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
screen and keyboard brightness.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install &lt;code&gt;light&lt;/code&gt;&lt;/li&gt;
&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;
&lt;/ul&gt;
&lt;p&gt;I really like the &lt;code&gt;light -T&lt;/code&gt; flag, which multiplies the current
brightness by some value. This way you can have fine grained control
both for very low and very high brightness values. To prevent yourself
from decreasing the brightness all the way to &lt;code&gt;0&lt;/code&gt;, you can run
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
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#chromium-theme" &gt;Chromium theme&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#dark-reader" &gt;Dark Reader&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#vimium" &gt;Vimium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;Let&amp;rsquo;s quickly go over some settings you can change for a better dark
mode experience in Chromium.&lt;/p&gt;
&lt;h2 id="chromium-theme"&gt;
 Chromium theme
 &lt;a class="heading-link" href="#chromium-theme"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;First of all, you can make Chromium itself use a dark theme. This will
ensure both a dark tab bar and nice dark settings pages. As explained
&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;,
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
window. However, I find that most of my window switching comes down to a
few simple commands that focus a specific application, or open it first
when it has no open windows yet. E.g.:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$mod+s&lt;/code&gt;: open and/or focus slack&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$mod+i&lt;/code&gt;: open and/or focus signal&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$mod+m&lt;/code&gt;: open and/or focus emacs&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$mod+c&lt;/code&gt;: open and/or focus chromium&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In addition to this, some apps like emacs have a separate &lt;code&gt;$mod+Shift+m&lt;/code&gt;
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;Xrefs&lt;/strong&gt;:
&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;
&lt;p&gt;In case you are, like me, tired of applications polluting your homedir
with config and data files, the XDB Base Directory Specification
(&lt;a href="https://wiki.archlinux.org/title/XDG_Base_Directory" class="external-link" target="_blank" rel="noopener"&gt;ArchWiki&lt;/a&gt;) has
your back.&lt;/p&gt;
&lt;p&gt;You probably saw the &lt;code&gt;~/.config&lt;/code&gt; directory already, and in fact, many
programs can be told to use this directory instead of polluting your
homedir. The ArchWiki page has a list of many applications and which
environment variables need to be set to change the location of their
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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#configuration" &gt;Configuration&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#init.el" &gt;init.el&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#config.el" &gt;config.el&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#running-as-server-and-client" &gt;Running as server and client&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#wayland" &gt;Wayland&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#useful-commands" &gt;Useful commands&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#emacs-as-mail-client" &gt;Emacs as mail client&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;Install Doom Emacs as explained in the
&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;
&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
search integration, and possibly &lt;code&gt;ttf-font-awesome&lt;/code&gt; for better icons.&lt;/p&gt;
&lt;h2 id="configuration"&gt;
 Configuration
 &lt;a class="heading-link" href="#configuration"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&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,
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;Xrefs&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;
&lt;p&gt;One problem I had with my Sway setup is that setting environment
variables in my &lt;code&gt;config.fish&lt;/code&gt; (the Fish equivalent to &lt;code&gt;.bashrc&lt;/code&gt; or
&lt;code&gt;.zshrc&lt;/code&gt;) is not always sufficient.&lt;/p&gt;
&lt;p&gt;In particular, I need my environment variables to be available in at
least the following places:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;my Fish shell,&lt;/li&gt;
&lt;li&gt;applications launched from Sway (e.g. using keybindings),&lt;/li&gt;
&lt;li&gt;applications launched as a systemd service (e.g. the Emacs server
daemon).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Setting variables in the shell profile has the problem that they are not
picked up by systemd services. Another option seems to be
&lt;code&gt;~/.pam_environment&lt;/code&gt;, but this
&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;
&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#cuda-overview" &gt;CUDA Overview&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#profiling" &gt;Profiling&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#optimizing-tensor-sketch" &gt;Optimizing Tensor Sketch&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#cpu-code" &gt;CPU code&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#v0-original-python-code" &gt;V0: Original python code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#v1-numba" &gt;V1: Numba&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#v2-multithreading" &gt;V2: Multithreading&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#gpu-code" &gt;GPU code&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#v3-a-first-gpu-version" &gt;V3: A first GPU version&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#v4-parallel-kernel-invocations" &gt;V4: Parallel kernel invocations&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#v6-detailed-profiling-kernel-compute" &gt;V6: Detailed profiling: Kernel Compute&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#v7-detailed-profiling-kernel-latency" &gt;V7: Detailed profiling: Kernel Latency&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#v9-more-work-per-thread" &gt;V9: More work per thread&lt;/a&gt;&lt;/li&gt;
&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;
&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;
&lt;li&gt;&lt;a href="#v12-revisiting-blocks-per-kernel" &gt;V12: Revisiting blocks per kernel&lt;/a&gt;&lt;/li&gt;
&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;
&lt;li&gt;&lt;a href="#v14-better-hardware" &gt;V14: Better hardware&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#v15-dynamic-shared-memory" &gt;V15: Dynamic shared memory&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#wrap-up" &gt;Wrap up&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!--endtoc--&gt;
&lt;p&gt;&lt;strong&gt;Xrefs:&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
Wayland.&lt;/p&gt;
&lt;h2 id="delta"&gt;
 Delta
 &lt;a class="heading-link" href="#delta"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;what&lt;/th&gt;
 &lt;th&gt;before&lt;/th&gt;
 &lt;th&gt;after&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;&lt;strong&gt;hardware&lt;/strong&gt;&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;laptop&lt;/td&gt;
 &lt;td&gt;Asus UX501V&lt;/td&gt;
 &lt;td&gt;Lenovo X1 Extreme Gen 3&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;CPU&lt;/td&gt;
 &lt;td&gt;i7-6700HQ&lt;/td&gt;
 &lt;td&gt;i7-10750H&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;GPU&lt;/td&gt;
 &lt;td&gt;GTX 960M&lt;/td&gt;
 &lt;td&gt;GTX 1650&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;RAM&lt;/td&gt;
 &lt;td&gt;16GB&lt;/td&gt;
 &lt;td&gt;64GB&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;&lt;strong&gt;OS&lt;/strong&gt;&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;bootloader&lt;/td&gt;
 &lt;td&gt;Grub&lt;/td&gt;
 &lt;td&gt;EFISTUB&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;OS&lt;/td&gt;
 &lt;td&gt;Windows + Arch dualboot&lt;/td&gt;
 &lt;td&gt;Windows + Arch dualboot&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;networking&lt;/td&gt;
 &lt;td&gt;netctl&lt;/td&gt;
 &lt;td&gt;systemd-networkd&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;dns/dhcp&lt;/td&gt;
 &lt;td&gt;dhcpcd&lt;/td&gt;
 &lt;td&gt;systemd-resolved&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;wifi&lt;/td&gt;
 &lt;td&gt;wpa_supplicant&lt;/td&gt;
 &lt;td&gt;iwd&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;&lt;strong&gt;Wayland&lt;/strong&gt;&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;display/login manager&lt;/td&gt;
 &lt;td&gt;-&lt;/td&gt;
 &lt;td&gt;-&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;display server&lt;/td&gt;
 &lt;td&gt;X&lt;/td&gt;
 &lt;td&gt;Wayland&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;window manager&lt;/td&gt;
 &lt;td&gt;i3&lt;/td&gt;
 &lt;td&gt;Sway&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;bar&lt;/td&gt;
 &lt;td&gt;i3blocks&lt;/td&gt;
 &lt;td&gt;waybar&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;backlight&lt;/td&gt;
 &lt;td&gt;xbacklight&lt;/td&gt;
 &lt;td&gt;light&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;night mode&lt;/td&gt;
 &lt;td&gt;redshift&lt;/td&gt;
 &lt;td&gt;gammastep&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;clipboard&lt;/td&gt;
 &lt;td&gt;-&lt;/td&gt;
 &lt;td&gt;wl-clipboard, clipman&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;program launcher&lt;/td&gt;
 &lt;td&gt;rofi&lt;/td&gt;
 &lt;td&gt;rofi [wayland]&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;password finder&lt;/td&gt;
 &lt;td&gt;rofi-pass&lt;/td&gt;
 &lt;td&gt;rofi-pass-git&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;key remapping&lt;/td&gt;
 &lt;td&gt;setxkbmap, xcape, xmodmap&lt;/td&gt;
 &lt;td&gt;interception-tools&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;strong&gt;&lt;strong&gt;Tools&lt;/strong&gt;&lt;/strong&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;td&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;terminal emulator&lt;/td&gt;
 &lt;td&gt;urxvt&lt;/td&gt;
 &lt;td&gt;foot&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;shell&lt;/td&gt;
 &lt;td&gt;zsh&lt;/td&gt;
 &lt;td&gt;fish&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;shell highlighting&lt;/td&gt;
 &lt;td&gt;zsh-syntax-highlight&lt;/td&gt;
 &lt;td&gt;-&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;environment variables&lt;/td&gt;
 &lt;td&gt;.zshrc&lt;/td&gt;
 &lt;td&gt;environment.d&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;text editor&lt;/td&gt;
 &lt;td&gt;vim&lt;/td&gt;
 &lt;td&gt;emacs doom&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;aur helper&lt;/td&gt;
 &lt;td&gt;packer&lt;/td&gt;
 &lt;td&gt;yay&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;directory usage&lt;/td&gt;
 &lt;td&gt;du&lt;/td&gt;
 &lt;td&gt;dust&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;password manager&lt;/td&gt;
 &lt;td&gt;pass&lt;/td&gt;
 &lt;td&gt;pass&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;search tool&lt;/td&gt;
 &lt;td&gt;ag [silver searcher]&lt;/td&gt;
 &lt;td&gt;ag + ripgrep + fd&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;file browser&lt;/td&gt;
 &lt;td&gt;terminal&lt;/td&gt;
 &lt;td&gt;terminal + ranger&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;calculator&lt;/td&gt;
 &lt;td&gt;qalc&lt;/td&gt;
 &lt;td&gt;qalc, rofi-calc&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;notification deamon&lt;/td&gt;
 &lt;td&gt;dunst&lt;/td&gt;
 &lt;td&gt;mako&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;image viewer&lt;/td&gt;
 &lt;td&gt;feh&lt;/td&gt;
 &lt;td&gt;feh + sxiv&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;music&lt;/td&gt;
 &lt;td&gt;-&lt;/td&gt;
 &lt;td&gt;spotifyd + spotify-tui + waybar custom/media&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;screenshot&lt;/td&gt;
 &lt;td&gt;teiler+scrot&lt;/td&gt;
 &lt;td&gt;grimshot (from sway) + custom upload wrapper&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;wallpaper&lt;/td&gt;
 &lt;td&gt;feh&lt;/td&gt;
 &lt;td&gt;sway&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;messenger&lt;/td&gt;
 &lt;td&gt;slack, signal-desktop&lt;/td&gt;
 &lt;td&gt;slack, signal-desktop [wayland]&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;system monitor&lt;/td&gt;
 &lt;td&gt;htop&lt;/td&gt;
 &lt;td&gt;htop&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;remote shell&lt;/td&gt;
 &lt;td&gt;ssh&lt;/td&gt;
 &lt;td&gt;ssh&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;browser&lt;/td&gt;
 &lt;td&gt;chromium&lt;/td&gt;
 &lt;td&gt;chromium&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;pdf viewer&lt;/td&gt;
 &lt;td&gt;zathura&lt;/td&gt;
 &lt;td&gt;zathura&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;vpn&lt;/td&gt;
 &lt;td&gt;-&lt;/td&gt;
 &lt;td&gt;openconnect&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&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;Xrefs&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;
&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
through Factorio with the Space Exploration mod.&lt;/p&gt;
&lt;p&gt;After lots of struggling, we recently finished our first SE world after
624 in-game hours. Since this was also our first/second Factorio world,
the start was very inefficient and we learned a lot of things along the
way. In this new map, which we call &lt;em&gt;Endurance&lt;/em&gt; (after the
interplanetary spaceship in &lt;em&gt;Interstellar&lt;/em&gt;), we will apply what we
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;Xrefs:&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;
&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;
&lt;strong&gt;Who:&lt;/strong&gt; Jan-Willem Buurlage, Ragnar Groot Koerkamp, Timon Knigge, Abe Wits&lt;br /&gt;
&lt;strong&gt;Score:&lt;/strong&gt; 274253375&lt;br /&gt;
&lt;strong&gt;Rank:&lt;/strong&gt; 19 of 38&lt;/p&gt;
&lt;p&gt;Not good.&lt;br /&gt;
Not bad.&lt;br /&gt;
Definitely ugly.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Linkerrijtje&lt;/em&gt; (aka top half).&lt;/p&gt;
&lt;p&gt;I would have liked to write that I&amp;rsquo;m happy with the result, but to be
fair&amp;ndash;I&amp;rsquo;m not. Just the fact that I can&amp;rsquo;t sleep and feel the need to
write this in the middle of the night surely is indication of this.
Plenty of things could have gone better, and there are so many things we
(I) could have done differently to actually break that elusive 300M
barrier (and potentially get that top 10 place we were hoping for), that
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;Xrefs:&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;
&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;
&lt;strong&gt;Who:&lt;/strong&gt; Jan-Willem Buurlage, Ragnar Groot Koerkamp, Timon Knigge, Abe Wits&lt;br /&gt;
&lt;strong&gt;Score:&lt;/strong&gt; 10282641&lt;br /&gt;
&lt;strong&gt;Rank:&lt;/strong&gt; 16&lt;/p&gt;
&lt;p&gt;Since we did quite well, here is a write-up of our participation in
Hashcode 2021.&lt;/p&gt;
&lt;h2 id="prep"&gt;
 Prep
 &lt;a class="heading-link" href="#prep"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;All four of us had previously participated in Hashcode, but this was the
first time in the current composition. Since we estimated our chances of
getting through to the finals to be more than nothing, we decided to
practice some previous Hashcode problems. Not all test sessions were
equally successful, but we did manage to get a good division of work:
while I start by immediately writing the IO &lt;code&gt;Input&lt;/code&gt; and &lt;code&gt;Output&lt;/code&gt;
classes, and the &lt;code&gt;Output::score()&lt;/code&gt; function, the others always start
with reading the statement, analysing the testcases, and writing at
least one greedy solution. This already is a big step up from previous
years/teams, where usually everybody would write the IO themselves.&lt;/p&gt;</description></item></channel></rss>