<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Posts on Monoidal Tranformation</title><link>https://monoid.github.io/posts/</link><description>Recent content in Posts on Monoidal Tranformation</description><generator>Hugo -- 0.147.2</generator><language>en-us</language><copyright>Copyright © 2025, Ivan Boldyrev; all rights reserved.</copyright><lastBuildDate>Sat, 27 Jun 2026 14:29:28 +0200</lastBuildDate><atom:link href="https://monoid.github.io/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>False Sharing Alignment</title><link>https://monoid.github.io/posts/false-sharing-alignment/</link><pubDate>Sat, 27 Jun 2026 14:29:28 +0200</pubDate><guid>https://monoid.github.io/posts/false-sharing-alignment/</guid><description>&lt;h1 id="what-is-false-sharing">What is false sharing&lt;/h1>
&lt;p>What is &lt;a href="https://en.wikipedia.org/wiki/False_sharing">false sharing&lt;/a>? When CPUs
and their cores read and update atomic variables, special hardware protocols
make it correct and efficient, while keeping each core&amp;rsquo;s caches consistent. The
coordination doesn&amp;rsquo;t happen per-address: these protocols work on
cache-line-sized chunks.&lt;/p>
&lt;p>What happens when two atomic variables happen to reside on the same cache line?
For example:&lt;/p>
&lt;ul>
&lt;li>an array of atomics where each atomic is used by a separate thread (e.g. per-thread counters);&lt;/li>
&lt;li>a queue with two atomic pointers where a writer updates the tail and a
reader updates the head. Of course, you declare both pointers in the same
struct and they have adjacent addresses!&lt;/li>
&lt;/ul>
&lt;p>Each update operation makes the cache line dirty and requires coordination
between CPUs. The CPUs are essentially playing ping pong with the chunk of
memory.&lt;/p></description></item><item><title>C in "C" means "confusion"</title><link>https://monoid.github.io/posts/c-in-c/</link><pubDate>Fri, 29 Aug 2025 10:13:58 +0200</pubDate><guid>https://monoid.github.io/posts/c-in-c/</guid><description>&lt;p>And in &amp;ldquo;C++&amp;rdquo; too.&lt;/p></description></item><item><title>AARCHMRS dataset for AArch64 instruction synthesis in Rust</title><link>https://monoid.github.io/posts/rust-aarchmrs/</link><pubDate>Tue, 29 Jul 2025 16:12:02 +0200</pubDate><guid>https://monoid.github.io/posts/rust-aarchmrs/</guid><description>&lt;p>Arm Limited, the company behind the ARM architecture, publishes &lt;a href="https://developer.arm.com/Architectures/A-Profile%20Architecture#Downloads">AARCHMRS
dataset&lt;/a>
&amp;ndash; &amp;ldquo;Arm Architecture Machine Readable Specification&amp;rdquo;, a detailed description of
an ARM processor as a set of JSON files.&lt;/p>
&lt;p>Today I published a set of crates:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://crates.io/crates/aarchmrs-parser">&lt;code>aarchmrs-parser&lt;/code>&lt;/a>: a set of
definitions that allows parsing the AARCHMRS dataset, but only instructions
description file.&lt;/li>
&lt;li>&lt;a href="https://crates.io/crates/aarchmrs-instructions">&lt;code>aarchmrs-instructions&lt;/code>&lt;/a>: a
set of functions derived from the AARCHMRS that allow you to build
instruction codes.&lt;/li>
&lt;li>&lt;a href="https://crates.io/crates/aarchmrs-types">&lt;code>aarchmrs-types&lt;/code>&lt;/a>: a helper crate
with useful types for &lt;code>aarchmrs-instructions&lt;/code>, which now contains only generated code.&lt;/li>
&lt;/ul>
&lt;p>The license is the same as the original dataset: BSD-3-Clause.&lt;/p></description></item><item><title>Baby-step-giant-step algorithm in functional encryption</title><link>https://monoid.github.io/posts/bsgs-fe/</link><pubDate>Sat, 12 Jul 2025 18:44:31 +0200</pubDate><guid>https://monoid.github.io/posts/bsgs-fe/</guid><description>&lt;p>The &lt;a href="https://en.wikipedia.org/wiki/Baby-step_giant-step">Shanks&amp;rsquo; baby-step-giant step (BSGS)
algorithm&lt;/a> is the final
stage of certain functional encryption schemes based on elliptic curve pairings.
This article discusses how the application of BSGS in these schemes differs from the
classical one.&lt;/p>
&lt;h2 id="boundaries">Boundaries&lt;/h2>
&lt;p>The textbook implementations use the group&amp;rsquo;s order $q$ as an input parameter.
However, it would make the functional encryption scheme infeasible, as the order of
the pairing target group is large enough to ensure cryptographic security.&lt;/p></description></item><item><title>A ZKP Joke</title><link>https://monoid.github.io/posts/zkp-joke/</link><pubDate>Fri, 11 Jul 2025 19:47:11 +0200</pubDate><guid>https://monoid.github.io/posts/zkp-joke/</guid><description>&lt;p>I&amp;rsquo;ve got a ZKP joke, but I&amp;rsquo;m not gonna to tell you. Nevertheless, this is a proof that it is funny.&lt;/p></description></item><item><title>Rust Coroutines on AArch64 (ARM64)</title><link>https://monoid.github.io/posts/arm-coroutines/</link><pubDate>Tue, 20 May 2025 19:08:55 +0200</pubDate><guid>https://monoid.github.io/posts/arm-coroutines/</guid><description>&lt;p>The amazing book &lt;a href="https://www.packtpub.com/en-us/product/asynchronous-programming-in-rust-9781805128137">Asynchronous Programming in
Rust&lt;/a>
by Carl Fredrik Samson has a chapter on implementing stackful coroutines
(fibers) in Rust for &lt;code>x86_64&lt;/code> architecture, both Linux and MacOS. But unlike
the other chapters, no &lt;code>AArch64&lt;/code> implementation was included for the sake of
simplicity. I tried to port it to &lt;code>AArch64&lt;/code>, and this post describes my
approach.&lt;/p>
&lt;p>This text is just an additional material for the book. I presume you are
familiar either with it or with the original code at
&lt;a href="https://github.com/PacktPublishing/Asynchronous-Programming-in-Rust/tree/main/ch05/c-fibers">&lt;code>ch05/c-fibers&lt;/code>&lt;/a>.&lt;/p></description></item><item><title>Introductory Post</title><link>https://monoid.github.io/posts/my-first-post/</link><pubDate>Thu, 06 Jan 2022 14:13:44 +0700</pubDate><guid>https://monoid.github.io/posts/my-first-post/</guid><description>&lt;p>Hi!&lt;/p>
&lt;p>My name is Ivan Boldyrev, I am software engineer born in Novosibirsk, Russia.
My main areas of interest are functional programming, Rust, and parallel programming.&lt;/p>
&lt;p>Since the start of 2024 I live in Barcelona, Spain.&lt;/p>
&lt;p>My favourite projects are:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://github.com/monoid/starjs">StarJs&lt;/a> &amp;ndash; astronomical library for JavaScript.&lt;/li>
&lt;li>&lt;a href="https://github.com/monoid/fucc">FUCC&lt;/a> &amp;ndash; LALR parser generator for Common Lisp.&lt;/li>
&lt;li>&lt;a href="http://github.com/monoid/harm">harm&lt;/a> &amp;ndash; WIP dynamic ARM assembler DSL for Rust.&lt;/li>
&lt;/ul>
&lt;p>I am big fan of &lt;a href="https://www.gnu.org/software/emacs/">Emacs&lt;/a>, Rust language and Apple Macbook Air M1. My other hobbies include studying French language, ink pens, sailing and reading.&lt;/p></description></item></channel></rss>